@redneckz/wildless-cms-uni-blocks 0.14.808 → 0.14.810
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.
- package/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +2 -2
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +0 -2
- package/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +0 -2
- package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +1 -1
- package/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +0 -2
- package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +1 -1
- package/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +2 -2
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/CalculatorDeposit/CalculatorDepositContent.d.ts +0 -2
- package/mobile/dist/components/CalculatorDeposit/CalculatorDepositContent.d.ts +0 -2
- package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js +1 -1
- package/mobile/dist/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/mobile/lib/components/CalculatorDeposit/CalculatorDepositContent.d.ts +0 -2
- package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js +1 -1
- package/mobile/lib/components/CalculatorDeposit/getDepositCalculatorParams.js.map +1 -1
- package/mobile/src/components/CalculatorDeposit/CalculatorDepositContent.ts +0 -2
- package/mobile/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +1 -1
- package/package.json +1 -1
- package/src/components/CalculatorDeposit/CalculatorDepositContent.ts +0 -2
- package/src/components/CalculatorDeposit/getDepositCalculatorParams.ts +1 -1
|
@@ -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),a=n("useState"),i=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={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","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={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"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=S[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...a},i):null}},i)}const P=[],B=(e,{key:t,ancestors:n=P,slotName:a=null,extraProps:i,renderProps:l=R,...r})=>{const s=i?(e,t)=>R(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||P,[r.parent,a]]:n},i)))};function E({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?B(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function _(){return _._impl()}_._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),_.setup=e=>{_._impl=e};const D=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return D.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),F=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:z,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:F});const j="/api/",$=`${j}v1/storage`,U=[A.CDN,j],q=e=>(t,n)=>{if(W(t))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${$}/${t}/attachment`;const a=t?.startsWith("/");return V(F(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||M(e)||z(e)||U.some(F(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},Y={small:"16",medium:"24",large:"48",xl:"78"},G=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",size:r,width:s=r&&Y[r],height:d=s})=>{const m=_(),h="normal"===l?`${n}.svg`:`sprites.svg#${n}`,p=q(m)(V(A.CDN,"/icons/",h));return"normal"===l?o("img",{className:e,style:K(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(X,{className:e,children:c("svg",{className:u(H[l],{"w-full h-full":!s,invert:"white"===l},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:p,xlinkHref:p})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},X=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Z(e=""){try{return new URL(e).pathname}catch(e){return""}}const Q=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Z(J.SITE_URL);return t&&!M(t)?q(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=_();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:Q(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ne({...t,src:Q(a)(t.src)},n):null]})})),ne=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(G,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),le={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},re="bg-main-divider text-main-disabled",se={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return r((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const pe=new he,ge=()=>ue(pe.emitter,"dialog");function fe(){const e=_(),{closeAll:t}=ge();return n=>{const a=q(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const l=Z(J.SITE_URL);xe(a,n.target,l)&&(t(),i?.preventDefault(),e.push(((e,t="")=>e?.replace(t,"")||"/")(a,l)))}))}}}const xe=(e,t,n)=>O(e,t)&&!J.SUB_PORTALS?.split(",")?.some(F(e))&&F(e)(n||"/"),ye=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},be=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=Ne(e)&&"hidden lg:block";return c("div",{className:u(ve(e),"flex gap-xs"),children:[a?o("div",{className:u(r,ce[l]),children:a}):null,Ne(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,ce[l]),children:i}):null]})})),ve=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",Ne(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ne=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),we=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ce=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.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()}),[e,t]))({method:n,href:a}),s=fe()({onClick:r,href:a,...i}),c=t??o(be,{...s});return o(e?ke:Se,{...s,children:c})})),Se=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ye(d),children:m}))),ke=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:we({className:e,rounded:a,version:n}),children:i})));function Ie({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Ce,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Te=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Re={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Pe=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Re[n],t),children:e}):null,Be=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Te(),v=_(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Ie({version:t,handleClick:N,text:w}),i?o("div",{className:"relative h-full",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Pe(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),_e(E({...y,extraProps:{className:"@container-normal"}})),Pe(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Ee(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Ee=e=>u(e?"row-span-2":"@xl:row-span-2"),_e=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Ae=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Me=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Oe=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?o(Oe,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ve=(e,t)=>["label"in e?ze(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Me(e.description,t)},String(t)):null,"__html"in e?o(Ae,{...e},`rte-${t}`):null],Fe=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?De(n.icon,t):null,o("div",{children:Ve(n)})]}))),Le=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Fe,{benefitsVersion:t,...e},String(n))))}):null)),je=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ve)}):null)),$e=d((({isTabularBenefits:e,...t})=>o(e?je:Le,{...t}))),Ue=e=>Boolean(e?.src||e?.icon),qe=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(We(n))}):null,We=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=He(i,r),d=He(l,r);return a||i?.icon?o(Ce,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ye({...i,iconVersion:c}),appendRight:Ye({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},He=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ye=e=>Ue(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ge=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ke=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Xe)}):null)),Xe=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Oe,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Ge(2)(t)," ",n||"₽"]}):null]},String(a)),Je=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ze)}):null)),Ze=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Oe,{size:"text-m",font:"font-light",children:e})},String(t)),Qe={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},et=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const R=b?.src?o(ie,{image:b}):null,P=o(k,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),B=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...tt(R,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:qe(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[B?.length?o($e,{benefitsVersion:s,isTabularBenefits:d,benefits:B}):null,h?o(Ae,{richVersion:p,__html:h,isDotted:m,itemSize:Qe[l]}):null,I,f?.length?o(Ke,{priceList:f}):null,nt(x)]})})})),tt=(e,t)=>t?{rightImage:e}:{leftImage:e},nt=e=>e?.length?o(Je,{tags:e}):null;class at{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof at?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const it=()=>!0,lt=(e,t)=>(...n)=>e(...n)&&t(...n),rt=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const st=e=>Boolean(e&&Array.isArray(e)),ot=e=>Boolean(e&&"object"==typeof e&&!st(e)),ct=e=>e;function dt(e){return e instanceof at?e._:e}class mt extends at{from(e){return this.of(e.map(((e=ct)=>([,t])=>e(t))(dt)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(st(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class ut extends at{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class ht extends at{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,dt(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class pt extends at{proto=rt([e=>st(this._)||"number"==typeof e,()=>mt.prototype],[e=>ot(this._)||"string"==typeof e,()=>ht.prototype],[it,()=>ut.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const gt=e=>e instanceof at?e:new pt(e),ft=e=>{const t=(t,...n)=>dt(e(gt(t),...n));return t.fn=e,t},xt=[],yt=e=>e instanceof Function?e:t=>e===t,bt=e=>(t,n,a=xt)=>gt(t).entries().reduce(((t,[n,i])=>bt(e)(i,t,a.concat(n))),e(n,[a,gt(t)])),vt=ft(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?vt(e.get(a),[i,n]):n)})),Nt=ft(((e,t)=>t.reduce(vt.fn,e))),wt=e=>bt(((e,[t,n])=>Ct(n)?[...e,[t,dt(n)]]:e))(e,[]),Ct=e=>0===e.size();ft(((e,t=xt)=>t.reduce(((e,t)=>e.get(t)),e)));const St=ft(((e,[t,...n])=>n.length?e.set(t,St(e.get(t),n)):e.filter((([e])=>e!==t)))),kt=(It=["$ref"]).map(((e,t)=>n=>yt(e)(n[t+n.length-It.length]))).reduceRight(lt,it);var It;const Tt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Rt,e),Rt=rt([st,(e,t)=>e[parseInt(t,10)]],[ot,(e,t)=>e[t]],[it,ct]),Pt=(e,t)=>((e,t={})=>n=>Nt(t,wt(n).map((t=>e(t)))))((([e,n])=>{return kt(e)?[(a=e,a.slice(0,-1)),Tt(t(n),n)]:[e,n];var a}))(e),Bt=e=>wt(e).filter(((e=ct)=>([t])=>e(t))(kt)),Et=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function _t(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),At=e=>[...new Set(e)],Mt={},Ot=["/portal-resources"],zt=(e,t)=>Pt(e,(e=>t?.[e])),Vt=(e,t)=>{const n=Et(e),[l,r]=a({});return i((()=>{Ft(n).then(r)}),[n.join()]),n.length?zt(e,{...t,...l}):e},Ft=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(At(e).filter((e=>!Ot.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Et(e)));return i.length?Ft(i,a):a}return t};function Lt(e,t={}){const n=d((t=>{const n=Vt((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const jt=Lt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(et,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),$t=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Ut(0,t?.length)),[t]),a=t?.[n];return a?o(jt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Ut=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),qt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},Wt=e=>e?.replace(/[^+\d]/g,""),Ht="/api/v1";const Yt=e=>e?{phone:Wt(e)}:{},Gt=(e,t="birthday")=>e?{[t]:qt(e)}:{},Kt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Xt=(e,t=!0)=>({[t?"email":"mail"]:e}),Jt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Wt(e)}:{},Zt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[])t[a??""]?.(n,i)};function Qt(){return Qt._impl()}Qt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Qt.setup=e=>{Qt._impl=e};const en="rshb-query-params";function tn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(en)||"";return e&&globalThis.sessionStorage?.setItem(en,e),e}const nn=e=>{const t=e.target?.closest("a"),n=Qt();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=tn();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function an(){return an._impl()}function ln(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}an._impl=()=>({forwardQuery:nn}),an.setup=e=>{an._impl=e};const rn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],sn=e=>!e?.length,on=e=>t=>n=>e(n)?[]:[t],cn={},dn=[];const mn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function un(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[r,s]=a(e),o=l((e=>s((a=>{const i=e instanceof Function?e(a):e,l=t?t(i):i,r=mn(i,l)?i:l;return!mn(a,r)&&n?.(r),r}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[r,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=ln(!1),f=s({}),[x,{isValid:y,errors:b}]=function(e,t){const n=r((()=>t?.(e)??cn),[t,e]),a=r((()=>rn(n)(e)??dn),[n,e]),i=sn(a);return[n,{isValid:i,errors:a}]}(m,n),v=l(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,l=m[e],r=h||f.current?.[String(e)],s=t?.validator??x[e],o=r&&s?s(l):[];return{value:a?a(l):l,isDirty:r,errors:s&&o,error:o[0],onChange:t=>{f.current||={},f.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,x,u]),N=l((e=>{f.current=e,u(e)}),[u]),w=l((()=>{f.current={},g(),u(e)}),[e,u]),C=l((e=>{e.preventDefault(),y?(t&&w(),d?.(m,e)):p()}),[t,m,y,w,d]);return[m,{errors:b,field:v,update:N,reset:w,onSubmit:C}]}const hn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function pn(e,t={}){const{open:n,close:a,...i}=ge();return{open:l(((i,l={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...l})),[e,n,a]),close:a,...i}}function gn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function fn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return gn(globalThis.document,"click",n),t}const xn=({label:e,errors:t})=>e&&t?`${e}*`:e,yn=()=>{},bn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",vn=e=>e?bn:"border-error",Nn=e=>e?o(Oe,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,wn=d((({key:e,className:t,id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:x=!1,disabled:y=!1,children:b,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),S=l((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const k=b?"pr-3xl":"",I=vn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Nn(d),x?o("textarea",{className:u("block resize-y min-h-24",Cn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:y,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Cn,k,I),id:n,type:r,value:h,name:a||n,placeholder:m,pattern:g,disabled:y,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e)]}),b]})})),Cn="w-full border rounded-md text-primary-text outline-none p-m",Sn=e=>o("div",{className:"h-6",children:e?o(Oe,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),kn=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=yn,onBlur:m,isTextarea:h,type:p,isInteger:g=!1,maxLength:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=ln(),N=fn(b),w=l((e=>{!y&&v(),f?e.length<=f&&d(e):d(e)}),[y,d]);return i((()=>{g&&n&&d(In(n))}),[n]),c("div",{className:u("shrink-0 w-full",e),ref:N,onBlur:b,onFocus:v,children:[o("div",{children:o(wn,{disabled:x,type:p||"text","aria-label":t,label:xn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:w,onBlur:m,isTextarea:h,placeholder:Tn(a,s,t)})}),Sn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Rn=e=>e?.text||e?.key||"",Pn=()=>ue(pe.emitter,"popup"),Bn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,En=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Bn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&i(e)},children:[o("span",{className:"min-h-6",children:Rn(e)}),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const _n=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,disabled:g=!1,iconVersion:f="black",onChange:x})=>{const[y,{setFalse:b,setTrue:v}]=ln(),[N,w]=a(""),C=Mn(g,n.length),S=y&&!C,k=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=Pn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=fn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(En,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:x,onClose:I,iconVersion:f});return c("div",{className:u("space-y-xs",e),children:[Nn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Rn(r)||h}),Dn(S,f)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(wn,{type:"text",value:N,autoFocus:!0,disabled:C,onChange:w})}):null]})]})})),Dn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Mn=(e,t)=>e||0===t,On=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(_n,{...i,valid:!n,label:xn({label:t,errors:a})}),Sn(n)]}))),zn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Vn=d((({field:e,input:t})=>o(On,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:zn,...e(t?.name??"")}))),Fn=(e="")=>Boolean("trade"===e||"all"===e),Ln=e=>null!=e,jn=new Map,$n=(e,t=jn)=>n=>{const a=qn(n),i=t.get(a);if(a&&Ln(i))return i;const l=e(...n);return a&&Ln(l)&&t.set(a,Promise.resolve(l)),l},Un=e=>Boolean(e?.every((e=>Array.isArray(e)?Un(e):!e||"string"==typeof e))),qn=e=>Un(e)?e.toString():"",Wn=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Hn(e,t,{fallback:n,cache:l}={}){const s=r((()=>Yn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Ln))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await $n(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&Wn(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Yn(e){return Array.isArray(e)?e:e instanceof Function?Yn(e()):[e]}const Gn=`${Ht}/branches`,Kn=[];const Xn=async e=>await _t(e,{method:"GET"})||Kn;function Jn(e=!1){const{data:t}=Hn(`${Ht}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Zn=(e="")=>"ULTRASERVICE"===e,Qn=d((({field:e,input:t,params:n})=>{const a=Zn(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?Jn(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Hn(e?`${Gn}?regionCode=${e}`:null,Xn);return t||Kn}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(On,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),ea=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},ta=(e,t,n)=>Math.max(t,Math.min(e,n));function na(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function aa({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:l,onChange:t=>{const n=na(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const ia=1,la=100,ra=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:ia),max:s=(i.length?i.length-1:la),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=ea(e,{normalize:(e=0)=>i.length?sa(i)(e):ta(e,r,s),format:Ge()}),f=l((e=>{p&&p(na(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Oe,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",bn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),aa({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),oa(a)]})})),sa=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),oa=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Oe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ca=["От 1 000 ₽","До 1 000 000 000 ₽"],da=d((({field:e,input:t})=>o(ra,{title:"Сумма, ₽",items:ca,min:1e3,max:1e9,...e(t?.name??"")}))),ma=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),ua="client",ha=[{key:ua,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],pa=d((({field:e,input:t})=>o(On,{label:"Тип обратившегося",...t,options:ha,...e("applierType")}))),ga=d((({field:e,input:t})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),fa=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=xa(t,e),c=ya(t,l,r);u.push(o("td",{children:o("div",{className:ba(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},xa=(e,t)=>t&&e.toDateString()===t.toDateString(),ya=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),ba=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),va=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Na=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:l=yn})=>{const{firstDayOfWeek:s,totalDays:d}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:va.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:fa({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:l})})]})})),wa=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ca(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Sa),l=a.map(((e,t)=>Ia(e)?a.slice(0,t).filter(Ia).length:-1)),r=a.map(((e,t)=>ka(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const Sa=e=>"_"===e,ka=e=>/\d/.test(e),Ia=e=>Sa(e)||ka(e),Ta=1940,Ra={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Pa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),i((()=>{Ea({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Ca(t,"__.__.____"))},onBlur:()=>{Ba(p)?Ea({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(l||"")},disabled:r}),r?null:o(G,{className:"mr-s",...Ra})]})})),Ba=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Ta&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},Ea=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Ba(e)){const{day:i,month:l,year:r}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(l),n(r),a?.(new Date(r,l,i))}},_a=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Pa,{onChange:a,disabled:r,onClick:e,value:t&&qt(t),setSelectedMonth:i,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Da=wa.map((e=>({key:e}))),Aa=Array.from({length:(new Date).getFullYear()-Ta+1},((e,t)=>Ta+t)).reverse().map((e=>({key:String(e)}))),Ma=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Oa=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},za={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Va={className:"min-w-32",iconVersion:"black",isBorder:!1},Fa=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=ln(!1),[x,y]=a(n?.getMonth()||(new Date).getMonth()),[b,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=l((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:S,handleSelectYear:k,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:R,ref:P}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=fn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(wa.indexOf(e));const t=Ma(r,wa.indexOf(e));Oa({maxDateOfMonth:t,selectedYear:r,selectedMonth:wa.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Da,yearsOptions:Aa,ref:c}})({onYearSelect:v,onMonthSelect:y,onShowCalendar:g,selectedYear:b,selectedMonth:x,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(P,370);return c("div",{className:u("space-y-xs",e),ref:P,children:[Nn(t),c("div",{className:"relative",children:[_a({handleChangeVisibleCalendar:R,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:y,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...za,className:"-rotate-90 cursor-pointer"})}),o(_n,{onChange:S,value:{key:wa[x]},options:I,...Va}),o(_n,{onChange:k,value:{key:String(b)},options:T,...Va}),o("div",{className:"my-auto",onClick:C,children:o(G,{...za,className:"rotate-90 cursor-pointer"})})]}),o(Na,{today:n,currentMonth:x,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),La=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Fa,{label:xn({label:t,errors:a}),valid:Boolean(!n),...i}),Sn(n)]}))),ja=d((({field:e,input:t})=>o(La,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),$a=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),Ua=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),qa=d((({field:e,input:t})=>o(La,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Wa=d((({field:e,input:t})=>o(kn,{label:"Электронная почта",...e(t?.name??""),...t}))),Ha=[{key:"ULTRASERVICE",text:"Ультра"}],Ya=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Ga=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Ka=d((({field:e,input:t})=>o(On,{label:"Способ получения ответа",options:Ga,...e(t?.name??"")}))),Xa=d((({field:e,input:t})=>o(kn,{label:"ФИО",...e(t?.name??""),...t}))),Ja=d((({field:e,input:t})=>o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),Za=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),Qa="appearance-none w-5 h-5 border-solid flex-none",ei=[{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"}],ti=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Za,{paths:ei,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",ai(a)),onClick:s,children:[o("div",{className:u(Qa,"m-0",i?"rounded-full border-2":li(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ii(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ni(n)]})})})),ni=e=>e?o("div",{className:"ml-s",children:o(Oe,{size:"text-l",font:"font-light",children:e})}):null,ai=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ii=(e=!1)=>e?"radio":"checkbox",li=(e=!1)=>u("rounded border",{"bg-primary-main":e}),ri=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ti,{text:t,value:n,disabled:i,onChange:r},a),Sn(l)]}))),si=d((({field:e,input:t})=>o(ri,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),oi=`${Ht}/outservice`,ci=[];async function di(){const e=await _t(`${oi}/outserviceregions`);return e&&Array.isArray(e)?e:ci}const mi=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=Hn("outServiceRegions",di),s=r((()=>l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[l,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(On,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),ui=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,hi=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),pi=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),gi=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Oe,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),fi=d((({field:e,input:t})=>Fn(e("acquiringType")?.value?.key)?o(gi,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),xi=d((({field:e,input:t})=>o(kn,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),yi=e=>"_"===e,bi=e=>/\d/.test(e),vi=e=>yi(e)||bi(e),Ni=[..."+7 (___) ___-__-__"],wi=Ni.findIndex(yi),Ci=Ni.map(((e,t)=>vi(e)?Ni.slice(0,t).filter(vi).length:-1));function Si(e){const t=e.replace(/\D/g,""),n=Ni.map(((e,n)=>bi(e)?e:t.charAt(Ci[n])||e)),a=Ci.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(wi,a)):n).join("")}const ki=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(Si(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(wn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Ii=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ki,{"aria-label":t,label:xn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Sn(a)]}))),Ti=d((({field:e,input:t})=>o(Ii,{label:"Телефон",...e(t?.name||"phone"),...t}))),Ri=d((({field:e})=>Fn(e("acquiringType")?.value?.key)?o(gi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Pi=Lt((({field:e,input:t,source:n})=>o(On,{placeholder:"Выберите продукт",label:"Продукт",options:Bi(n?.productList),...e(t?.name??"")}))),Bi=e=>(e??[]).map((e=>({key:e,value:e}))),Ei=`${Ht}/regions`,_i=[];function Di(e=Ei){const{data:t}=Hn(e,Dt);return Array.isArray(t)?t:_i}const Ai=`${Ht}/outservice/outserviceregions`,Mi=d((({field:e,input:t,params:n})=>{var a;const i=Di((a=n?.typeForm,"OUTSERVICE"===a?Ai:void 0));return o(On,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),Oi=d((({field:e,input:t})=>{const n=Jn(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(On,{label:"Регион",placeholder:"Выберите регион",options:a,...e(t?.name??"")})})),zi=d((({field:e,input:t})=>o(kn,{label:"ФИО представителя",...t,...e("representativeName")}))),Vi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Fi=/^[\u0400-\u04FF\d\s]+$/u,Li=(e="")=>Fi.test(e),ji=on((e=>null!=e&&""!==e)),$i="Некорректно заполненное поле",Ui=e=>ji(e??$i),qi=e=>on((e=>e?.key&&""!==e?.key))(e??$i),Wi=e=>on((e=>"string"==typeof e&&e.length>1&&Li(e)))(e??$i),Hi=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Yi=e=>on(Hi)(e),Gi=on((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Ki={fullName:Ui(),addressBranch:qi(),desiredMeetingDate:Ui(),product:Ui(),localities:Ui(),partnerComments:Ui(),collectionCount:Ui(),acquiringType:qi(),serviceType:qi(),annualRevenue:Ui(),feedbackMethod:qi(),serviceDirection:qi(),secondaryPhone:Yi("Укажите номер телефона"),region:qi(),situationDescription:Ui(),sufferedFrom:Ui(),applierType:Ui(),surname:Wi("Укажите свою фамилию на кириллице"),name:Wi("Укажите своё имя на кириллице"),middleName:Wi("Укажите своё отчество на кириллице"),birthday:Ui("Укажите дату рождения"),phone:Yi("Укажите номер телефона"),email:(Xi="Укажите электронную почту",on((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(Xi)),inn:(e=>on((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:Ui(),typeForm:Ui(),consentToReceiveMaterials:Gi,consentDataProcessing:Gi};var Xi;const Ji=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...Ki,...t},i=n.some((e=>e.condition?.values)),l=Object.fromEntries(n.filter(Zi(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(Zi(a)).filter(Qi(e)).map((({name:e})=>[e,a[e??""]]))):l},Zi=(e={})=>({name:t})=>Boolean(e[t??""]),Qi=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),el=d((({field:e})=>{const t=e("secondaryPhone");return o(Ii,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Vi(t,Ki.secondaryPhone):t})})),tl=d((({field:e,input:t})=>o(On,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Ya,...e(t?.name??"")}))),nl=d((({field:e,input:t})=>o(kn,{label:"Описание ситуации",...t,...e("situationDescription")}))),al=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],il=d((({field:e,input:t})=>o(On,{label:"Пострадал в",...t,options:al,...e("sufferedFrom")}))),ll=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),rl=["От 1 мес","До 15 лет"],sl=d((({field:e})=>o(ra,{title:"Срок, месяцев",items:rl,min:1,max:180,...e("term")}))),ol=d((({field:e,input:t})=>o(On,{label:"Тип обслуживания",options:Ha,...e(t?.name??"")}))),cl={horizontal:"@lg:flex-row",vertical:""},dl=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:l="horizontal",onChange:r})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Oe,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",cl[l],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ti,{isRadio:!0,text:t,value:n===e,onChange:()=>r?.(e),disabled:i},String(e))))})]}))),ml=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],ul=d((({field:e,input:t})=>{const n=l((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(dl,{className:"whitespace-normal",orientation:"horizontal",items:ml,...e(t?.name??"",{onChange:n})})})})),hl=d((({field:e,input:t})=>o(ti,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const pl={$ref:"/wcms-resources/outservice-productlist.json"},gl={fullName:Xa,addressBranch:Qn,desiredMeetingDate:qa,product:e=>o(Pi,{...e,source:pl}),localities:mi,isClient:si,partnerComments:xi,collectionCount:$a,acquiringType:Vn,onlineCheckout:fi,posTerminal:Ri,serviceType:ol,term:sl,amount:da,annualRevenue:ma,vedTypes:ul,feedbackMethod:Ka,serviceDirection:tl,bankEmpolee:ga,secondaryPhone:el,applicationDate:e=>o(kn,{label:"Дата и время обращения в Банк",...e}),region:e=>Zn(e?.params?.typeForm)?o(Oi,{...e}):o(Mi,{...e}),consentToReceiveMaterials:hl,sufferedFrom:il,situationDescription:nl,representativeName:zi,applierType:pa,surname:ll,name:pi,middleName:hi,birthday:ja,phone:Ti,email:Wa,inn:Ja,comment:Ua},fl=(e,t,n={})=>(a,i)=>{const l={...gl,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})&&l?o("div",{children:o(l,{field:e,input:a,params:t})},i):null},xl=e=>2===e?"@xl:grid-cols-2":"",yl=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Oe,{size:"text-h6",children:e})}):null,bl={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","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")},vl=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Nl=u("bg-main-gray text-main-disabled cursor-not-allowed"),wl=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=yn})=>{const x=l("tab"!==c?me(f):f,[c,f]),y=r((()=>ye(m)),[m]),b="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[bl[n]]:!s&&!i,[vl]:i,[Nl]:s},i?"justify-between":"justify-center",i||b?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":b},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...y,onClick:x,children:p})})),Cl=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(G,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Sl=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Cl,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),kl=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(wl,{type:"button",onClick:n,children:"Хорошо"})]})})})),Il=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,...p}=e,g=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${Fn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,f={...p,...Bl(o),...Pl(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},...Rl(m?.text,u),...Tl(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Tl=e=>e?.key?{isClient:e?.key===ua}:{},Rl=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Pl=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Bl=e=>e?{vedTypes:Object.fromEntries(ml.map((({id:t})=>[t,t===e])))}:{},El={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:Ha[0],feedbackMethod:Ga[0],serviceDirection:Ya[0],vedTypes:ml[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},_l=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block","animate-spin rounded-full","border-solid border-current","border-r-transparent","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})}))),Dl=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(wl,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(_l,{blur:!0,size:"small"}):null,n]}))),Al={primary:bl.primary,secondary:bl.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:bl.secondary,transparent:"","":""},Ml=d((e=>{const t=fe(),{className:n,href:a,target:i,text:l,aboveText:r,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[Al[s]]:Boolean(s),[r?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${l}`,role:a?"link":"button",onClick:p,...ye(m),children:h??Ol(l,r)})})),Ol=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,zl=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Oe,{children:e}):null,t?o(Ml,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),Vl=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(ti,{...e}),o(zl,{link:t})]}),Sn(Vi(e,Gi).error)]}):o(zl,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(Dl,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),Fl={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Ht}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Kt(a,g),...Xt(l,g),...Yt(i),...Gt(s,"desiredMeetingDate"),...g?Gt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Jt(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Ll=d((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,...g})=>{const f=r((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),x=r((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||El[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),y=r((()=>Ji(f)),[f]),b=pn(kl),v=an(),N=l((async(e,t)=>{const a=Il({...e,...m}),i=Boolean(await Fl.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&Zt({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:S}]=un(x,{resetOnSubmit:!0,formValidator:y,onSubmit:N}),k=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(hn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:S,children:[a.map(((e,t)=>c("div",{className:u(xl(e.columns),"grid gap-x-m"),children:[yl(e.title),(e?.inputs||[])?.map(fl(C,{typeForm:n}))]},`section-${t}`))),Vl(k?C("consentDataProcessing"):void 0,s,i)]}),h?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ie,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),jl="Некорректно заполненное поле",$l="Укажите регион, город/населенный пункт, улицу, дом",Ul=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),ql=()=>on(Ul)($l),Wl=e=>on((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??jl),Hl=(e,t)=>on((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??jl),Yl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},Gl=e=>on((e=>"string"==typeof e&&6===e.length))(e),Kl=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.slice(9))}return!1},Xl={processPersonalDataFlg:Gi,consentProviderFlg:Gi,consentInformFlg:Gi,consentPfrFlg:Gi,consentOthersFlg:Gi,consentFATCA:Gi},Jl={addressCourier:ql(),paymentSystem:Ui("Укажите тип платежной системы"),currency:Ui("Укажите валюту"),cardCategory:Ui("Укажите категорию карты"),codeWord:(e=>on((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Li(e)))(e??jl))("Необходимо ввести кодовое слово"),confirmationIncome:qi(),methodObtain:Ui(),deliveryDate:Ui("Укажите дату доставки")},Zl={organization:qi("Выберите тип организации"),organizationAddress:on((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))($l),organizationPhone:Yi("Укажите номер телефона"),organizationName:Ui("Укажите наименование организации"),legalForm:Ui("Укажите ОПФ"),generalSeniority:Wl("Укажите количество лет стажа"),lastJobExperience:Wl("Укажите стаж на последнем месте работы"),experience5Years:Wl("Укажите общий стаж за последние 5 лет"),jobsNumber:Wl("Укажите количество мест работы за последние 5 лет"),beginDate:Ui("Укажите дату заключения трудового договора"),addressFact:ql(),addressRegistration:ql(),addressRetail:qi("Выберите адрес банка"),addressMatch:Ui(),sex:Ui("Укажите свой пол"),limitedBirthday:on(Yl)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:Ui("Укажите место рождения"),education:qi("Выберите ваше образование"),housing:qi("Выберите тип жилья"),amountWorkers:qi("Выберите информацию о количестве сотрудников"),employment:qi("Выберите информацию о трудоустройстве"),employerActivities:qi("Выберите вид деятельности организации"),employerOrganization:qi("Выберите вид организации"),positionOrganization:qi("Выберите вашу должность"),familyStatus:qi("Выберите семейное положение"),familyMembers:Hl(2,"Укажите количество членов семьи"),children:Hl(2,"Укажите количество детей"),dependents:Hl(2,"Укажите количество иждивенцев"),totalIncome:Hl(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Hl(10,"Укажите сумму обязательных выплат"),snils:(e=>on(Kl)(e))("Некорректный номер СНИЛС"),conscription:Ui(),armyIdFlg:Gi,dulSerie:(e=>on((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:Gl("Укажите номер паспорта"),dulIssueDate:Ui("Укажите дату выдачи паспорта"),dulSubdivisionCode:Gl("Укажите код подразделения"),dulIssuedBy:Ui("Укажите организацию, выдавшую паспорт"),participantDateRegistration:Ui("Укажите дату регистрации"),retirementIncome:Ui(),otherIncome:Ui(),wages:Ui(),mandatoryPayments:Ui(),bankruptcyFlg:Ui(),shareholderFlg:Ui(),legalEntityName:Ui(),bankEmployeeCode:Ui(),partInBusiness:Ui(),regionRetail:qi("Выберите регион"),latinSurname:Ui("Укажите фамилию")},Ql={...Zl,...Jl,...Xl},er={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18},consentPhotoFlg:{text:"Согласие на фотографирование",docId:17}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}},tr=e=>e?.value||"",nr=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=tr}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`,c=globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(r);return c},ar={url:"suggest/address"},ir={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:ar,addressFact:ar,organizationAddress:ar,addressCourier:ar},lr=d((({options:e,container:t,onChange:n})=>{const[l,r]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?r(l<a?l+1:0):"ArrowUp"===t.key?r(l>0?l-1:a):"Enter"===t.key&&e[l]&&(t.preventDefault(),n(e[l]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[l]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>o("div",{className:u("flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",{"bg-main-divider":l===t}),role:"listitem",onMouseDown:()=>n(e),children:o("span",{className:"min-h-6",children:e.processedValue})},t.toString())))})}));function rr({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=Pn(),x=ir[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await nr({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(lr,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,b]),v}const sr=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=yn,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:S}]=ln(),k=fn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[w,d]);i((()=>{y&&n&&d(or(n))}),[n]);const T=rr({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(wn,{disabled:N,type:g||"text","aria-label":t,label:xn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:cr(a,s,t)})}),Sn(r)]})})),or=(e="")=>e.replace(/[^\d]+/g,""),cr=(e,t,n)=>t&&!n?`${e}*`:e,dr=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(mr(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(sr,{disabled:t?.filledByEsia&&ui(e,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:r,...t,onDaDataChange:i})})),mr=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),ur=Lt((({field:e,input:t,source:n})=>{const[r,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=l((t=>{e?.("addressCourier")?.onChange?.(mr(t))}),[]),h=l((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(sr,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:r||e("addressCourier")?.error,onDaDataChange:u})})),hr=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(sr,{label:"Адрес",disabled:r,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),pr=d((({field:e,input:t})=>o(ri,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),gr=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:fr({textItems:l,subText:t,children:n,isPhone:a,...i})})),fr=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Oe,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||xr(n,s),i?o(Oe,{color:a,size:"text-m",children:i}):null]}),xr=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Oe,{size:"text-l",children:t?o("a",{href:`tel:${yr(e)}`,children:e.trim()}):e.trim()},String(n)))),yr=e=>e.replace(/\D/g,""),br=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),vr=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),Nr=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),wr=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...l})=>c(wl,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...l,children:[o(vr,{children:a}),o(Nr,{isUnfolded:t,iconVersion:i?"color":""})]}))),Cr=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const Sr=d((({className:e,isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:u("transition-max-h duration-300 overflow-hidden",{"max-h-0":Boolean(a.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:n})})})),kr=d((({children:e})=>{const[t,{toggle:n}]=ln(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Cr,{className:"block sm:hidden",children:[o(Sr,{isUnfolded:t,children:e}),o(wr,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),Ir=e=>{const t=Rr(e);return o(gr,{label:"Режим работы",value:t,className:"max-w-none"})},Tr=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Rr=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))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Tr({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Tr({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Pr=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Br=e=>Pr.map((([t,n,a])=>({key:t,title:a,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??"")}}))),Er=e=>{if(!e)return null;const t=_r(e);return c(br,{className:"border-none",children:[o(gr,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Dr)})}),o(gr,{label:"Режим работы",className:"max-w-none",children:o(Oe,{children:e})})]})},_r=e=>{const t=Pr.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},Dr=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Oe,{size:"text-xs",children:e})},String(n)),Ar=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(gr,{label:"Валюта",value:e.currency}):null,t?o(gr,{label:"Купить",value:String(t)}):null,n?o(gr,{label:"Продать",value:String(n)}):null]},String(a)),Mr={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"}},Or=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",Mr[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Oe,{size:"text-m",color:Mr[n].text,children:t})]}))),zr=(new Date).getDay(),Vr=e=>{const[t]=e?.slice(zr-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Or,{color:"green",children:i}):null,n&&l?o(Or,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Or,{color:"red",children:"Выходной"})},Fr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Lr=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(gr,{label:e,value:t&&n?n:"",subText:Fr({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),jr=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,$r=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ur=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,qr=(e,t)=>{if(!e.workSchedule)return null;const n=Br(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Oe,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Oe,{size:"text-l",children:e.address})]}):null]}),Vr(n)]}),o(kr,{children:Wr(e)})]},String(t))},Wr=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=Br(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(br,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(gr,{label:"Факс",value:t,isPhone:!0}),o(gr,{label:"Телефон филиала",value:e,isPhone:!0}),o(gr,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(gr,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(gr,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(gr,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(br,{children:o(gr,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Lr)})})}):c(br,{children:[o(gr,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Dr)})}),Ir(d)]}),r?.businessScheduleVisibleTag?Er(r?.businessScheduleDescription):null,s?.currencies?.length?o(br,{className:"flex-wrap",children:s?.currencies?.map(Ar)}):null]})},Hr=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=Br(e),n=e?Rr(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?jr(n):Ur(n,a):$r(n):""})(n)}`;return{header:a,body:l}},Yr={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Gr={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Kr={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},Xr=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Kr[t](e)))))},Jr=()=>{},Zr=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Jr,getBalloonRemoteWorkplaces:i=Jr})=>{const[l,s,o,c]=r((()=>{const l=Xr(e,n),r=Xr(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Qr=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),es=d((({children:e})=>Qr?e:null)),ts="/icons/MapMarkerClusterIcon.svg",ns="/icons/MapMarkerClusterYellowIcon.svg";function as({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=is("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=is("workplaces",e,i),r=ls(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ls(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=ls(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const is=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?ts:ns,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ls=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?ts:ns,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),rs={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},ss={...rs,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},os=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ss).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(G,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),cs=e=>globalThis[e],ds=(e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=cs(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(cs(e))}))}))}return new Promise(((a,i)=>{const l=globalThis.document.createElement("script");l.src=t,l.async=!0,l.id=t,n&&(l.type="module"),l.addEventListener("load",(()=>{a(cs(e))})),l.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(l)}))};const ms=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return ds(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),us={...rs,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},hs=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(us).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),ps=[55.753995,37.614069],gs=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=ms();if(i((()=>{r.current?as({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:fs(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),as({yandexMaps:m,map:r.current,points:e,isLoad:a})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,a,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(_l,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(hs,{yandexMaps:r}),o(hs,{yandexMaps:r,direction:"out"})]}),os(r,m,u("right-2 top-80",h))]})})),fs=e=>{const t=[ys(xs(e,0)),ys(xs(e,1))];return t.every((e=>e))?t:ps},xs=(e,t)=>e.map((e=>e.coords?.[t])),ys=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,bs=async(e,t,n)=>{try{return(await vs(e,t,n)).json()}catch(e){return console.error(e),null}};async function vs(e,t,n){const a=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`/light-api-cash/v1${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":a,"X-B3-Traceid":a,...Ns()},credentials:"include",body:n?JSON.stringify(n):null})}const Ns=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ws=e=>Number(e.toString().replace(",",".")),Cs=e=>{const{data:t,error:n}=Hn(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Ss);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Ss=async e=>await _t(e,{method:"POST"})||[],ks=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=Cs("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await bs("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:ws(e.latitude??ps[0]),gpsLongitude:ws(e.longitude??ps[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=Zr({data:n,filtrationState:{},getBalloon:Hr});return c("div",{children:[o(On,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(es,{children:o(gs,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Is(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Ts(e,t){return Is(e,t),Is(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class Rs{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}class Ps{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}}const Bs={};function Es(e,t=Bs){const n=s(null),o=function(){const[,e]=a(0);return l((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const _s=new Ps;function Ds(e){return Es(_s,e)}Ts(_s,new Rs(globalThis?.localStorage));const As=()=>Ds(),Ms=Lt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...l})=>{const r=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(On,{placeholder:a,options:r,...e(n),...l})})),Os=d((({field:e,input:t})=>{const{data:n}=Cs("EMPLOYEES_NUMBER"),a=As();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(Ms,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),zs=d((({field:e,input:t})=>o(ri,{text:"Наличие военного билета",...e(t?.name??"")}))),Vs=d((({field:e,input:t})=>o(sr,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),Fs=d((({field:e,input:t})=>o(ri,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Ls=d((({field:e,input:t})=>o(La,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t}))),js=d((({field:e,input:t})=>o(sr,{label:"Место рождения",...e(t?.name??""),...t,disabled:t?.filledByEsia&&ui(e,"birthPlace")}))),$s=e=>{try{return JSON.parse(String(e))}catch(e){return null}};const Us=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black"})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Ae,{__html:e})})]}))),qs=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=function(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?$s(t):null);return[n,l((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}("programId"),{value:m,onChange:u}=e("cardCategory"),h=e("paymentSystem")?.value?.key;i((()=>{h&&d&&(async()=>{const e=await(async(e,t)=>{const n=await bs("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(h,d);s(e),Ws(e,m)||u&&u(null)})()}),[h]);const p=r((()=>n?.find((e=>e.key===m?.key))?.description),[n,m]);return c("div",{children:[o(Ms,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),p?o(Us,{__html:p}):null]})})),Ws=(e,t)=>e.some((e=>e.key===t?.key)),Hs=d((({field:e,input:t})=>o(sr,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Ys=d((({field:e,input:t})=>o(sr,{label:"Кодовое слово",...e(t?.name??""),...t}))),Gs=d((({field:e,input:t})=>{const{data:n}=Cs("INCOME_CERT_UNITED");return o(Ms,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Ks=d((({field:e,input:t})=>{const{data:n}=Cs("MILITARY_STATUS");return o(Ms,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Xs=()=>Ds(),Js=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Te();return c(Sl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0 z-[101]",onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(wl,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),Zs=(e,t)=>{const{open:n}=pn(Js),a=Te();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await vs(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},Qs=d((({className:e,error:t,docId:n,...a})=>{const i=Zs(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ti,{...a}),n?o(wl,{embedded:!0,onClick:i,children:o(vr,{children:"Ознакомиться"})}):null]}),Sn(t)]})})),eo=d((({field:e,input:t})=>{const{productType:n}=Xs(),a=er[n??""];return t&&t.name?o(Qs,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),to=Math.round(29.5),no=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),ao="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",io="flex flex-col lg:w-1/2 gap-2xl",lo="flex flex-col gap-y-xl min-w-52",ro=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Oe,{size:"text-h3",children:"number"==typeof e?[a,Ge(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),so=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Oe,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(ro,{value:n,...i}):o(Oe,{size:"text-h3",children:"-"})]}))),oo=e=>mo([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),co=(e=[],t=!1,n=[])=>({...mo([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),mo=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},uo=(e,t=0)=>e?.sum?e.sum:t,ho=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,po=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,go=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ra,{items:[`От ${fo(e)}`,`До ${fo(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),fo=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,xo=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...l})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(Oe,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(dl,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...l})]}),yo=e=>xo({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),bo=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ra,{items:e?[`От ${Ge(1)(a.min||0)} ${n}`,`До ${Ge(1)(a.max||0)} ${n}`]:[],step:t,...a}),vo=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(ta(t?.[i],n.minMonths,n.maxMonths))},No=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},wo=e=>e,Co=(e=wo)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),So=Co(),ko=(e=wo)=>Co((t=>-e(t))),Io=ko(),To=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Ro([e,t],a),Ro=([e,t],n=[])=>({[e]:n.length?Io(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?So(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Po=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Bo={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Eo=e=>_o({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&_o({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&_o({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&_o({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),_o=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Do=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[Bo],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Eo({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=To(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=To(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Eo({row:e,userInputParams:t,paramsViewSettings:n})&&Po(a,["minSum","maxSum"],e)&&Po(i,["minMonths","maxMonths"],e)))||Bo)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=No(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Ao=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Mo={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Oo=Lt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=oo(n?.rateRows),[p,{field:g}]=un({moneyValue:uo(s,2e5),monthsValue:ho(s,to),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)},{onChange:d}),f=Do(p,n,r),x=yo({...g("isAnnuity")}),{onChange:y}=g("moneyValue"),{onChange:b}=g("monthsValue");return i((()=>{y&&y(ta(p.moneyValue,f.minSum,f.maxSum))}),[f.minSum,f.maxSum]),i((()=>{b&&b(ta(p.monthsValue,f.minMonths,f.maxMonths))}),[f.minMonths,f.maxMonths]),i((()=>{!Ao(s)&&h&&vo({field:g,defParams:h,calcParams:f,map:Mo,monthsValue:"minMonths"})}),[n,s]),o(no,{className:e,title:t,...m,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Сумма кредита, ₽",step:500,min:f.minSum,max:f.maxSum,...g("moneyValue"),value:f.moneyValue}),go({title:"Срок кредита, месяцев",min:f.minMonths,max:f.maxMonths,...g("monthsValue"),value:f.monthsValue}),zo({...f,...r},g),o("div",{className:"sm:hidden",children:x})]}),c("div",{className:u(lo,"@4xl:w-1/2"),children:[o(so,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(so,{title:"Ставка от",value:h?.rate,fractionDigits:2,postfix:"%"}),o(so,{title:"Ежемесячный платёж",value:f.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:x}),qe(a,{isVertical:!0}),po(l)]})]})})})),zo=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ti,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ti,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ti,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ti,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Vo="calculator",Fo=d((({field:e,params:t})=>{const n=l((t=>{e(Vo).onChange?.(t)}),[]);return o(Oo,{...t?.calcData,padding:"p-0",defaultParams:jo(e(Vo).value),onChange:n})})),Lo={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},jo=(e,t=!1)=>{const n=t?$o(Lo):Lo;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},$o=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Uo=d((({field:e,input:t})=>{const{data:n}=Cs("CREDIT_IN_RSHB");return o(Ms,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),qo={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card"},Wo=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(dl,{label:xn({label:t,errors:a?.errors}),...a}),Sn(n)]}))),Ho=[{id:"810",text:"Рубли"}],Yo=d((({field:e,input:t})=>{const{data:n}=Cs("CURRENCY"),{programId:a}=Xs(),i=r((()=>!Object.keys(qo).includes(a||"")||"38"===a),[]),l=r((()=>i?Ho:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(Wo,{label:"Валюта",orientation:"horizontal",items:l,...e(t?.name??"")})})),Go=(e,t)=>{if(!t)return null;const n=Zo(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},Ko=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},Xo=(e,t)=>{const n=Zo(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},Jo=(e,t,n)=>{const a=Zo(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},Zo=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Qo=(e,t,n)=>{const{okved:a,okopf:i,inn:l,organizationName:r}=ec(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(mr(n.data?.address));const s={amountWorkers:Ko(e?.amountWorkers,n.data?.employee_count),employerActivities:Go(e?.employerActivities??[],a),organization:Jo(e?.organization??[],i,l),employerOrganization:Xo(e?.employerOrganization??[],i),organizationName:r};for(const e in s)s[e]&&t?.(e)?.onChange?.(s[e])},ec=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),tc=d((({field:e,input:t})=>{const n=As(),{employerActivities:a,employerOrganization:r,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=l((t=>{Qo(n,e,t)}),[]);return i((()=>{d&&m&&a&&r&&s&&c&&(async()=>{const t=await(async e=>{const t=await nr({url:"suggest/party",query:e});return t?.[0]})(m);t&&Qo(n,e,t)})()}),[a,r,s,c]),o(sr,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u})})),nc=d((({field:e,input:t})=>o(La,{label:"Дата доставки",...e(t?.name??"")}))),ac=d((({field:e,input:t})=>{const{data:n}=Cs("COURIER_DELIVERY_TIME"),a=r((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(Wo,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),ic=d((({field:e,input:t})=>o(sr,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),lc=d((({field:e,input:t})=>o(La,{label:"Дата выдачи",...e(t?.name??""),disabled:t?.filledByEsia&&ui(e,t?.name??"")}))),rc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(sr,{disabled:t?.filledByEsia&&ui(e,t?.name??""),label:"Кем выдан",...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),sc=d((({field:e,input:t})=>o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),oc=d((({field:e,input:t})=>o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),cc=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...e(t?.name??""),onDaDataChange:n})})),dc=d((({field:e,input:t})=>{const{data:n}=Cs("EDUCATION_LEVEL");return o(Ms,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),mc=d((({field:e,input:t})=>o(sr,{label:"Электронная почта",...e(t?.name??""),...t}))),uc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_ACTIVITY_TYPE"),a=As();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(Ms,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),hc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_KIND"),a=As();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(Ms,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),pc=d((({field:e,input:t})=>{const{data:n}=Cs("EMPLOYMENT_INFO_UNITED");return o(Ms,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),gc=d((({field:e,input:t})=>o(sr,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),fc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ta(Number(n),0,5)))),[]);return o(sr,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...e(t?.name??""),...t,onChange:n})})),xc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),l=e("familyStatus")?.value?.key,r="MARRIED"===l?2:1,s=Number(e("children")?.value),c=Number(e("dependents")?.value),d=r+s+c;return i((()=>{a?.(d)}),[l,s,c]),o(sr,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),yc=d((({field:e,input:t})=>{const{data:n}=Cs("MARITAL_STATUS");return o(Ms,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),bc=d((({field:e,input:t})=>o(sr,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...e(t?.name??""),...t}))),vc=d((({field:e,input:t})=>{const{data:n}=Cs("HOUSE_TYPE");return o(Ms,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Nc=d((({input:e})=>o(Us,{__html:e?.label}))),wc=d((({field:e,input:t})=>o(sr,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),Cc=d((({field:e,input:t})=>o(sr,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t}))),Sc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,kc=(e="")=>Sc.test(e),Ic=e=>{const t={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "};return e.replace(/[А-ЯЁа-яё,. -]/g,(e=>t[e.toLowerCase()].toUpperCase()||""))},Tc=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,r=e("latinName")?.onChange;i((()=>{r?.(Ic(a))}),[]);const s=l((e=>{(kc(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(kn,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Rc=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,r=e("latinSurname")?.onChange;i((()=>{r?.(Ic(a))}),[]);const s=l((e=>{(kc(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(kn,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Pc=d((({field:e,input:t})=>o(sr,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),Bc=d((({field:e,input:t})=>o(sr,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),Ec=d((({field:e,input:t})=>o(La,{label:"Дата рождения",...e(t?.name??""),disabled:t?.filledByEsia&&ui(e,t.name??"")}))),_c=d((({field:e,input:t})=>o(sr,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Dc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Ac=d((({field:e,input:t})=>o(Wo,{orientation:"horizontal",items:Dc,...e(t?.name??"")}))),Mc=d((({field:e,input:t})=>o(sr,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&ui(e,t?.name??""),...e(t?.name??""),...t}))),Oc=d((({field:e,input:t})=>o(sr,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),zc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_TYPE"),a=As();return i((()=>{n&&(a.organization=n)}),[n]),o(Ms,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Vc=d((({field:e,input:t})=>{const n=As(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),Qo(n,e,t)}),[]);return o(sr,{label:"Наименование организации",...t,...e(t?.name??""),onDaDataChange:a})})),Fc=d((({field:e,input:t})=>o(sr,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Lc=d((({field:e,input:t})=>o(La,{label:"Дата регистрации по месту жительства",...e(t?.name??"")}))),jc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ta(Number(n),0,100)))),[]);return o(sr,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})}));const $c=e=>e.map((e=>({key:e.type,text:e.name}))),Uc=e=>e?.key,qc=d((({field:e,input:t})=>{const[n,l]=a([]),s=Ds();var c;c=async()=>{const{programId:e}=s;if(e){const t=await(async e=>{const t=await bs("/public-data/creditProgramConditions","POST",{creditProgramId:e});return $c(t?.paymentSystems||[])})(e);l(t??[])}},i((()=>{const e=c();return()=>{e.then((e=>{e instanceof Function&&e()}))}}),[]);const d=r((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(Wo,{label:"Платежная система",orientation:"horizontal",items:d,...e(t?.name??"",{format:Uc,parse:e=>n?.find((t=>t.key===e))})})})),Wc=d((({field:e,input:t})=>{const{data:n}=Cs("POSITION");return o(Ms,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Hc=async()=>await bs("/public-data/regionsCardDelivery","GET")||void 0,Yc=d((({field:e,input:t})=>{const{data:n}=Cs("REGION_RF"),{data:a}=Hn("regionsDelivery",Hc),{programId:i}=As(),r="38"===i,s=n?.map((({key:e,value:t})=>({key:e,text:t}))),c=e("regionRetail")?.onChange,d=e("regionHasDelivery")?.onChange,m=e("methodObtain")?.onChange,u=l((e=>{const t=a?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!r;d?.(t),m?.(t?"courier":"office"),c?.(e)}),[a]);return o(On,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:s,...e(t?.name??""),onChange:u})})),Gc=d((({field:e,input:t})=>o(sr,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Kc=["male","female"],Xc=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Jc=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:l}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await nr({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return Kc.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Wo,{label:"Пол",orientation:"horizontal",items:Xc,...e(t?.name??"")})})),Zc=d((({field:e,input:t})=>o(ri,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),Qc=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=l((e=>n?e.length<=n&&t?.(Ca(e,"___-___-___ __")):t?.(Ca(e,"___-___-___ __"))),[t]),r=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(wn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>r(e?.target?.value||""),children:e})})),ed=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Qc,{"aria-label":t,label:xn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __",...r}),Sn(a)]}))),td=d((({field:e,input:t})=>o(ed,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),nd=d((({field:e,input:t})=>o(sr,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&ui(e,"surname"),...e(t?.name??""),...t}))),ad=d((({field:e,input:t})=>o(sr,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),id=d((({field:e,input:t})=>o(sr,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),ld={$ref:"/wcms-resources/delivery-cities-data.json"},rd={limitedBirthday:Ec,name:Oc,surname:nd,middleName:Mc,email:mc},sd={processPersonalDataFlg:eo,consentProviderFlg:eo,consentOthersFlg:eo,consentInformFlg:eo,consentPfrFlg:eo,consentInformMaterialsFlg:eo,consentPhotoFlg:eo,consentFATCA:eo},od={organization:zc,organizationAddress:dr,organizationPhone:Ti,organizationName:Vc,legalForm:Bc,generalSeniority:bc,lastJobExperience:Cc,experience5Years:fc,jobsNumber:wc,beginDate:Ls,addressFact:hr,addressRegistration:dr,addressRetail:ks,addressMatch:pr,sex:Jc,limitedBirthday:Ec,birthPlace:js,education:dc,housing:vc,amountWorkers:Os,employment:pc,employerActivities:uc,employerOrganization:hc,positionOrganization:Wc,familyStatus:yc,familyMembers:xc,children:Hs,dependents:ic,totalIncome:ad,expenses:gc,snils:td,conscription:Ks,armyIdFlg:zs,dulSerie:oc,dulNumber:sc,dulIssueDate:lc,dulSubdivisionCode:cc,dulIssuedBy:rc,participantDateRegistration:Lc,retirementIncome:Gc,otherIncome:Fc,wages:id,mandatoryPayments:_c,bankruptcyFlg:Fs,shareholderFlg:Zc,legalEntityName:Pc,creditInRshbCd:Uo,bankEmployeeCode:Vs,partInBusiness:jc,regionRetail:Yc,infoCard:Nc,calculator:Fo,confirmationIncome:Gs,inn:tc},cd={addressCourier:e=>o(ur,{...e,source:ld}),paymentSystem:qc,currency:Yo,cardCategory:qs,codeWord:Ys,methodObtain:Ac,deliveryDate:nc,latinName:Tc,latinSurname:Rc,deliveryTime:ac},dd="Согласие на все документы",md=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=l((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Vi(t(e?.name),Gi).error)))),[e]),[d,{toggle:m}]=ln(!0);return o("div",{className:"w-fit",children:c(Cr,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ti,{text:dd,value:a,onChange:i},n),Sn(s?"Отметьте все обязательные соглашения":"")]}),o(wl,{embedded:!0,ariaLabel:dd,onClick:m,children:o(Nr,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(Sr,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(fl(t,{},sd))})]})})})),ud=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=hd(t||[],n);return a.length>2?c("div",{children:[i.map(fl(e,{},{...rd})),o(md,{inputs:a,field:e})]}):(t||[])?.map(fl(e,{},{...rd}))},hd=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(er[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(er[t]).includes(String(e))))}),pd=(e,t=!1)=>o(Dl,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),gd=e=>vs("/user-data/updateUserProfile","PUT",e),fd=e=>vs("/user-data/updateUserTask","PUT",e),xd=d((({className:e,seconds:t})=>o("span",{className:e,children:yd(t)}))),yd=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),bd=(e,t)=>{const n=s(null),a=l((()=>clearInterval(n.current)),[]),r=l((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(r(),a)),[r,a]),{start:r,stop:a}};function vd({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),r=l((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=bd(r,t);return l((e=>{i.current=e,o()}),[])}const Nd={width:"103",height:"21"},wd={"bg-white":"color",transparent:"white"},Cd={"bg-white":"text-primary-main",transparent:"text-white"},Sd=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:wd[e]},className:Cd[e],width:n?.width,height:n?.height}),kd={"bg-white":"text-primary-text",transparent:"text-white"},Id=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ye(s),children:[Sd(l,n?.image,Nd),r?a??o("div",{className:"ml-s",children:o(Oe,{font:"font-medium",color:kd[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Td=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=ln(!1),x=l((async()=>{g();var e;await(e={captchaText:d},vs("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),y=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>vs(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(y,[]),o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Id,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o(wl,{className:"w-8",embedded:!0,onClick:y,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(wn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(wl,{version:"secondary",onClick:close,children:"Вернуться"}),o(Dl,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),p?o(_l,{blur:!1}):null]})})})),Rd=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=l((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Pd(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Pd=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${vn(!n||!a)} rounded-md caret-transparent outline-none`},Bd=d((({isDisabled:e,onClick:t,text:n})=>o(wl,{type:"button",onClick:t,disabled:e,children:o(Oe,{font:"font-normal",children:n})}))),Ed=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},_d=({values:e,onSuccess:t})=>{const[n,r]=a(""),[s,{setTrue:o,setFalse:c}]=ln(!1),[d,m]=a(0),[u,h]=a(!1),[p,g]=a(0),f=l((()=>r("")),[]),x=Boolean(0===d&&u),y=p>2||x||!e.every(Boolean),b=l((async()=>{try{h(!1),m(0),g((e=>e+1)),o(),await(async e=>bs("/sms/checkCode","POST",e).then(Ed))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),f(),await(t?.(e.join("")))}catch{r(p>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{c()}}),[e,p]);return i((()=>{r(x?"Код просрочен":"")}),[x]),{handleSubmit:b,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:d,isSubmitButtonDisabled:y,setTimeNextReq:m,setIsTimerStarted:h,setAttempts:g}},Dd=d((({phone:e,code:t=!0,withDescription:n=!0,codeLength:r=4,consents:s,onSuccess:d=yn,onClose:m=yn})=>{const[u,h]=a(Array(r).fill("")),{handleSubmit:p,hasError:g,errorText:f,isLoading:x,timeNextReq:y,isSubmitButtonDisabled:b,setTimeNextReq:v,setIsTimerStarted:N,setAttempts:w}=_d({values:u,onSuccess:d}),C=pn(Td),S=Wt(e),I=vd({seconds:y,onTick:v}),T=l((async()=>{var e;await(e={phoneNumber:S,smsCodesSetName:{key:"AUTHENTICATION"}},vs("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(w(0),v(180),I(180),N(!0)):C.open({phoneNumber:S,sendCode:T})}),[S,I,m]);return i((()=>{T()}),[]),o(Sl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:m,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Rd,{values:u,setValues:h,errorText:f,hasError:g}):null,Md(y,T),n?c(Ae,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:s?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Ad(b,p),x?o(_l,{blur:!1}):null]})})})),Ad=(e,t)=>o(Bd,{text:"Далее",isDisabled:e,onClick:t}),Md=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(xd,{className:"ml-1",seconds:e})]}):o(wl,{embedded:!0,onClick:t,children:o(vr,{children:"Получить новый код"})}),Od={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},zd={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Vd=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Fd=d((({onSubmit:e=yn,onClose:t=yn})=>{const[n,i]=a(""),[r,s]=a(!1),d=Zs(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),s("REFUSE"===e)}),[]),h=r?zd:Od;return o(Sl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(dl,{className:"whitespace-normal",orientation:"horizontal",items:Vd,value:n,onChange:u}),o(wl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Ld=d((({title:e,icon:t,description:n,onClick:a=yn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[o(Oe,{font:"font-medium",size:"text-s",children:e}),n?o(Oe,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),jd={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},$d={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},Ud={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},qd=e=>Object.entries(e).reduce(((e,[t,n])=>t in jd?[...e,{contactTypeCd:{key:jd[t]},value:n}]:e),[]),Wd=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in $d){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:$d[t]},...a}]}return e}),[]),Hd=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:l,wages:r,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:l,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(f={wages:r,mandatoryPayments:s,incomeAverage:Yd(r,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(f).reduce(((e,[t,n])=>t in Ud?[...e,{incomeTypeCd:{key:Ud[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p};var f},Yd=(e,t)=>(Number(e??0)+Number(t??0)).toString(),Gd={WORK:"Работаю",RETIREE:"Пенсионер"},Kd={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},Xd={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Jd={...Xd,amur_card:"14",owner_card:"13",travel_card:"15"},Zd=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:Yd(t,s),additionalIncome:a,otherIncome:i,otherPayments:l,rentalIncome:r,retirementIncome:s}},Qd=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},em=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},tm=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,nm=d((function({task:e,isFromLead:t=!1,sendAspects:n=yn,onClose:a=yn}){const i=As(),r=Qt(),{participants:s,creditProgram:d,createdDate:m="",id:u}=e,h=Jd[d.code],p=Boolean(Xd[d.code]),g=p?"/credit-lead":"/credit-card-lead",{id:f,profile:x}=s[0],y=l((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:l}=e,{loanAmount:r,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:P,organizationTypeCd:B,organizationKindCd:E,employeesNumberCd:_,opf:D,seniority:A,generalSeniority:M,jobsNumber:O,lastWorkDuration:z,positionCd:V,maritalStatusCd:F,childrenDependents:L,totalDependents:j,otherDependents:$,militaryStatusCd:U,participantIncomes:q,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q}=t;return{currency:l?.key,paymentSystem:tm(i),cardCategory:tm(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:tm(b),participantDateRegistration:v,housing:tm(N),beginDate:k,employment:tm(I,Gd),organizationName:T,inn:R,employerActivities:tm(P),organization:tm(B),employerOrganization:tm(E),amountWorkers:tm(_),legalForm:D,generalSeniority:A?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:z?.toString(),positionOrganization:tm(V),familyStatus:tm(F),children:L?.toString(),familyMembers:j?.toString(),dependents:$?.toString(),conscription:tm(U),confirmationIncome:tm(Q,Kd),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:tm(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:r,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...Zd(q),...Qd(S),...em(C),...(ee=w,ee?.key?{sex:"MAN"===ee.key?"male":"female"}:null)};var ee})(e);i.participantId=f??null,i.taskId=u,i.profileId=x?.id??null,i.programId=h,i.leadForm=t,x?.id&&n(x.id,u),r.assign(g)}),[]),b=l((()=>{r.assign(p?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]);return o(Sl,{className:"my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0",onClose:a,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs md:mt-0 mx-6xl",children:[o(w,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(Ld,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:m?`Черновик от ${qt(new Date(m))}`:"",onClick:y}),o(Ld,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?a:b})]})]})})})),am=d((function({onClose:e=yn}){const t=Qt(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(Sl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(wl,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(wl,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),im=d((({onClose:e})=>{const t=Qt(),n=As(),a=l((async()=>{const e=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},bs("/esia/getLink","POST",n));var n;e?.link&&(t.assign(e.link),globalThis.location.href=e.link)}),[]),i=l((()=>{if(n.leadForm){const e={...n.leadForm};delete e.esiaAccountTypeCd,n.leadForm=e}e?.()}),[]);return o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full px-m",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"@container flex flex-wrap gap-lg w-full",children:[o(wl,{type:"button",onClick:a,className:"w-full md:w-auto",children:"Заполнить через Госуслуги"}),o(wl,{type:"button",version:"secondary",onClick:i,className:"w-full md:w-auto",children:"Пропустить"})]})]})})})),lm=()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search));return{utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_source:e.get("utm_source"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}},rm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),sm=({programId:e,nextStepLink:t,productType:n,esiaError:i,data:r})=>{const[s,{setTrue:o,setFalse:c}]=ln(!1),[d,m]=a(),u=(()=>{const e=Xs();return l((({participantId:t,taskId:n,profileId:a,programId:i,formData:l})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=l}),[])})(),h=(({data:e})=>{const t=an();return l(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});Zt({aspectsAttributes:rm(e,i),aspects:t,ev:{}})}),[e])})({data:r}),p=Qt(),g=(e=>{const{open:t}=pn(im),n=Qt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(t),f=(e=>{const{open:t}=pn(Fd),n=pn(Dd),a=t=>async n=>{try{t&&await gd({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(g),x=pn(Dd),y=(()=>{const{open:e}=pn(nm),{open:t}=pn(am);return{open:({task:n,isFromLead:a,onClose:i,sendAspects:l})=>{n?e({task:n,isFromLead:a,onClose:i,sendAspects:l}):t({})}}})();return{isSending:s,ok:d,handleSubmit:l((async a=>{var l;if(i)p.assign(t);else try{o();const t=await(l={profile:{phone:Wt(a.phone)}},bs("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(t&&a?.phone){const i=async()=>{await cm({programId:e,profileId:t,formData:a,productType:n,saveUserData:u,sendAspects:h}),x.close(),"debitCard"===n?g():f.open(a.phone,t)},l=async()=>{try{const n=await(async e=>{const t=await bs("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:t,programId:e});if(n){const e=await(async e=>await bs("/user-data/getTaskById","POST",e)||void 0)({taskId:n});x.close(),y.open({task:e,isFromLead:!0,sendAspects:h,onClose:i})}else await i()}catch{m(!1)}},r=om(a,n);x.open({phone:a?.phone,consents:r,onSuccess:l}),c()}}catch{m(!1)}}),[i])}},om=(e,t)=>{const n=er[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},cm=async({programId:e,profileId:t,formData:n,productType:a,saveUserData:i,sendAspects:l})=>{let r,s;const o=dm(n,a);await gd(((e,t,n)=>{const{name:a="",surname:i="",middleName:l="",limitedBirthday:r="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:l,birthDate:r&&qt(r,!0),email:o,phone:Wt(s),...n}}})(t,n,o));try{if("debitCard"===a){const t=await(async e=>await bs("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t)=>{const{name:n,surname:a,middleName:i,limitedBirthday:l,phone:r,email:s}=e;return{task:{taskSource:Qt().origin,creditProgram:{code:qo[t]},participants:[{birthDate:l&&qt(l,!0),midname:i,name:n,surname:a,participantContacts:qd({phone:r&&Wt(r),email:s})}]}}})(n,e));r=t.taskId,s=t.participantId}else{const a=await(async e=>await bs("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});r=a.taskId,s=a.participantId,await fd((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Qt().origin,id:t,participants:[{birthDate:s&&qt(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:qd({phone:o&&Wt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:lm()}}})({participantId:s,taskId:r,profileId:t,formData:n}))}l(t,r),i({participantId:s,taskId:r,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},dm=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:l,consentProviderFlg:r,consentInformMaterialsFlg:s,consentPhotoFlg:o,consentFATCA:c}=e;let d;return d="credit"===t?{consentPhotoFlg:n,consentPfrFlg:a,consentInformMaterialsFlg:n}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:o}:{consentFATCA:c,consentPhotoFlg:n},{...d,processPersonalDataFlg:i,consentInformFlg:l,consentProviderFlg:r,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},mm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},um=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,mm[e.name||""]])))}},hm=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},pm=e=>Math.floor(e/12),gm=async({document:e,taskId:t,category:n,files:a})=>{await fetch(`data:application/pdf;base64,${e}`).then((e=>e.blob())).then((e=>(async(e,t,n)=>{const a=new FormData;return a.append("taskId",t),a.append("documentCategory",n),a.append("file",e,"file.pdf"),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...Ns()},credentials:"include",body:a}).then((e=>e.json())))})(e,t,n))).then((e=>a.push(e)))},fm=e=>{const{profile:t,document:n,addressRegistration:a,esiaAdditionalDocument:i}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,t.email,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType,i.inn,i.averageMonthlyIncome.toString(),i.startWorkDate,i.workLengthInFiveYears.toString(),i.workLength.toString(),i.workLengthLastJob.toString(),i.jobsNumberInFiveYears.toString(),i.pdfFilePayout,i.pdfFileWorkbook].every((e=>Boolean(e))))throw new Error},xm=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,t.email,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every((e=>Boolean(e))))throw new Error},ym=({inputs:e,nextStepLink:t,productType:n,setEsiaError:a})=>{const s=Qt(),[o,{setTrue:c,setFalse:d}]=ln(!1),m=Xs(),u=l((e=>{const t=e instanceof Function?e(h[p]):e;null!=t?h[p]=t:delete h[p]}),[h=m,p="leadForm"]);var h,p;const g=r((()=>um(e,m.leadForm)),[e,m.leadForm]),f=l((async(e,i,l)=>{c();try{const a=await(r={profileId:e,code:i,state:l,redirectUri:globalThis.location?.href},bs("/esia/updateProfileEsia","POST",r));if(a&&m?.taskId){const e=await(async(e,t,n)=>{n?xm(e):fm(e);const{profile:a,addInfo:i,document:l,addressRegistration:r,addressFact:s,esiaAdditionalDocument:o}=e,c=[];return n||(await gm({document:o.pdfFileWorkbook,taskId:t,category:"CONFIRMING_INCOME_DOC",files:c}),await gm({document:o.pdfFilePayout,taskId:t,category:"CONFIRMING_EMPLOYMENT_DOC",files:c})),{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Si(a.phone),email:a.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:hm(r),addressFact:hm(s),esiaAccountTypeCd:a.esiaAccountType,...!n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:pm(o.workLengthInFiveYears).toString(),generalSeniority:pm(o.workLength).toString(),lastJobExperience:pm(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),files:c}}})(a,m.taskId.toString(),"debitCard"===n);u((t=>({...t,...e})))}s.assign(t)}catch{a()}finally{d()}var r}),[t]);return i((()=>{m.productType=n;const e=$s(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=t.get("code"),i=t.get("state");e&&a&&i?f(e,a,i):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[g,{isLoading:o}]},bm=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,productType:s="credit",data:d,...m})=>{const[h,{setTrue:p}]=ln(!1),g=r((()=>(e=>{const t=er[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0},{name:"name",required:!0,dadata:!0},{name:"middleName",dadata:!0},{name:"limitedBirthday",required:!0},{name:"phone",required:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentInformMaterialsFlg"},{name:"consentPhotoFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(s)),[s]),f=r((()=>g?.flatMap((e=>e?.inputs))||[]),[g]),x=r((()=>Ji(f,Ql)),[f]),[y,{isLoading:b}]=ym({inputs:f,nextStepLink:a,productType:s,setEsiaError:p}),{isSending:v,ok:N,handleSubmit:w}=sm({programId:n,nextStepLink:a,productType:s,esiaError:h,data:d}),[,{field:C,onSubmit:S}]=un(y,{formValidator:x,onSubmit:w}),k=pn(kl);return i((()=>{void 0!==N&&k.open({ok:N})}),[N]),o(hn,{className:u("container space-y-m",e),title:t,...m,children:c("form",{onSubmit:S,className:"space-y-m relative",children:[b?o(_l,{blur:!1}):null,g.map(((e,t)=>c("div",{className:u(xl(e.columns),"grid gap-x-m"),children:[yl(e.title),ud({field:C,inputs:e?.inputs},s)]},`section-${t}`))),pd(l,v),h?o(Oe,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})})})),vm=d((({title:e,description:t})=>{const n=Te();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Nm=e=>e%2!=0,wm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Cm=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=ln(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(wm),children:[B(l,{...i.options,parent:n}),Nm(l.length)?o($t,{className:"col-span-6",...i}):null]}),c(Cr,{children:[c(Sr,{className:u(wm),isUnfolded:s,children:[B(r,{...i.options,parent:n}),Nm(r.length)?o($t,{className:"col-span-6",...i}):null]}),o(wr,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!r?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Sm=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",km=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Im=10;function Tm(e=0){const t=Math.round(e*Im);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Rm=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Tm(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:h,role:"listitem",children:d})})),Pm=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Bm=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(_m(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Em(c,v):{},...N?km(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(Rm,{className:u(m,i?Pm[i-1]:"",{"h-full":N},t),style:w?Em(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),Em=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),_m=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Dm={"horizontal-list":"w-6","vertical-list":"h-6"},Am=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Dm[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Mm=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},Om=e=>t=>e.scrollWidth/t,zm=e=>(t,n)=>{e.scrollBy({left:n*Om(e)(t),behavior:"smooth"})},Vm=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[ko()(i),Co()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?zm(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?zm(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Fm={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Lm=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Te(),[h,p]=Vm({itemCount:s.length}),g=jm(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Bm,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Mm({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Fm[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Am({activeIndex:t,onClick:f,listType:a}))}):null})),jm=(e=!1)=>({behavior:e?"auto":"smooth"}),$m=d((({className:e,name:t,...n})=>o(wl,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),Um=d((e=>o($m,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),qm=d((e=>o($m,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Wm="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Hm=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?Ym(t):null,l?o(Um,{wcmsIgnore:!0,className:u(Gm(i),m?"left-1":"left-0"),onClick:s}):null,r?o(qm,{wcmsIgnore:!0,className:u(Gm(i),m?"right-1":"right-0"),onClick:d}):null]})})),Ym=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Wm,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Wm,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Gm=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Km=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Vm({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Bm,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Hm,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Lm,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Xm=({blocksToRender:e,...t})=>o(Km,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:B(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Sm(!0)),children:R(e,t)},String(n))})}),Jm=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Zm(n,t),o(Cm,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Zm(n,t),Xm({...a,blocksToRender:t})]});default:return null}})),Zm=(e,t)=>e&&!t.length?o(vm,{...e}):null,Qm=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),eu=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(gi,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),tu=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,Qm(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(nu(a)).filter(Boolean))]}),n?o("div",{children:o(wl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),nu=e=>([t,n])=>{const a=n?.type;return"array"===a?au(t,e)(n):null},au=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Oe,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(eu,{items:a,multiple:!n?.single,...t(e)})]},e)},iu=e=>e;function lu(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const ru=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,su=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>ru(t[e])||ru(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>ru(t[e])||ru(n[e])||ou(t[e])<=ou(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>ru(t[e])||ru(n[e])||ou(t[e]?.min)>=ou(n[e]?.min)&&ou(t[e]?.min)<=ou(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>ru(t[e])||ru(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>ru(t[e])||ru(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),ou=e=>Number(e||0),cu=(e,{block:t,page:n,normalize:a=iu})=>{const i=t?.blocks||[],[l,s]=un(e),o=r((()=>lu(i,i.map((e=>zt(e.content,n?.fallback))))),[i,n?.fallback]),c=l===e?i:((e,t)=>(n=iu)=>e?.filter((([,e])=>su(t,n(e)||{}))).map((([e])=>e)))(o,l)(a);return[l,{blocksToRender:c,blocksWithProps:o},s]},du={},mu={},uu=Lt((({className:e,filtrationSchema:t=du,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=cu(mu,{block:i.block,page:i.options?.page}),d=o(_n,{className:"w-64",label:n?.title,options:hu(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>hu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(tu,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(wl,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Jm,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),hu=e=>lu(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),pu=(e=!1)=>e?"text-left":"text-center",gu={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},fu=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const l=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",gu[t],e),style:{width:l,height:l},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),xu=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Te();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:pu(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(yu)}):null]})})),yu=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(fu,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Oe,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Ae,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),bu=(e,t,n)=>{return o(Km,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Oe,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ie,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Oe,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},vu=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?bu(e,0,t):null]}))),Nu={start:"justify-start",center:"justify-center",end:"justify-end"},wu=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Nu[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:qe(e)})})),Cu=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Oe,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Ge(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),Su=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Oe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),ku=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Cu,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(so,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(Su,{title:e,...r}),Iu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Tu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ru=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Iu.prefMonthsNum,prefTravelBonusRate:l=Iu.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Tu,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Pu=Lt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=un({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=Ru(r,n);return o(no,{className:e,title:t,...l,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),bo({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?ku({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:lo,children:[f>=0?o(so,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,qe(a,{isVertical:!0}),po(i)]})]})})})),Bu=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Eu=e=>xo({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),_u=" (c капитализацией)",Du=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:lo,children:[o(so,{title:`Доход в конце срока${l?_u:""}`,value:e,postfix:n,prefix:"+"}),o(so,{title:`Сумма в конце срока${l?_u:""}`,value:t,postfix:n}),qe(a,{isVertical:!0}),i?.map(po)]}),Au={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Mu={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ou=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Au[e?.rateType]:"",{data:n}=Hn(t?`${Ht}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&zu(s,e)&&Po(a,["minSum","maxSum"],e)&&Po(n,["minDays","maxDays"],e)))||Mu,{rate:m}=d,u=Vu(m,e),h=a+u,p=c||[Mu];return{...d,...Ro(["minSum","maxSum"],p),...Ro(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},zu=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Vu=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},Fu=Lt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=un({moneyValue:uo(r,1e5),daysValue:ho(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Ou(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(no,{className:e,title:t,...d,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ra,{items:[`От ${Bu(b.min||0)}`,`До ${Bu(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Lu(p,h),Eu({...h("isMonthlyInterestPayment")})]})]}),ku({rate:x,depositeName:y,isShowDepositeName:l}),Du({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),Lu=(e,t)=>c("div",{className:"space-y-s",children:[o(Oe,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ti,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ti,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),ju=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},$u={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Uu=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Hu(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Wu({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Wu({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Wu({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Wu({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Po(a,["minSum","maxSum"],t),Po(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||$u,{rate:u}=m,h=e?.extraPercent?.key,p=Number(u)+Number(h),g=qu(p,e),f=a+g,x=t||[$u];return{...m,...Ro(["minSum","maxSum"],x),...Ro(["minMonths","maxMonths"],x),availableMonths:ju(x.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:l,income:g,finalSum:f}},qu=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},Wu=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Hu=(e,t)=>e+Math.round((t-e)/2),Yu=(e="rub")=>"rub"===e,Gu=(e,t)=>{const{minMonths:n,maxMonths:a}=Ro(["minMonths","maxMonths"],Zu(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:ta(i,n,a)}},Ku=(e,t)=>{const{minSum:n,maxSum:a}=Ro(["minSum","maxSum"],Zu(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:ta(i,n,a)}},Xu=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Ju=e=>{const t=Yu(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Zu=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Qu=(e,t=!1)=>t?xo({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,eh=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[th(t("isReplenish"),e,a),nh(t("isWithdrawn"),e,a),ah(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Eu(t("isMonthlyInterestPayment")):null,Qu(t("isRemoteRegistration"),e.isShowRemoteRegistration),ih(t("extraPercent"),n),e.isShowNewClient?o(ti,{text:"Новый сберегатель",...t("isNewClient")}):null]})},th=(e,t,n=!1)=>t.isShowReplenish?xo({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,nh=(e,t,n=!1)=>t.isShowWithdrawn?xo({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,ah=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,ih=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Oe,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(_n,{options:t,...e})]}):null,lh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},rh={text:"₽",key:"rub"},sh={text:"Без учета надбавки",key:"0"},oh=Lt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[rh],g=l((e=>t=>e?{...t,...Ju(t),...Ku(t,e),...Gu(t,e),...Xu(t,e)}:t)(h),[h]),[f,{field:x}]=un({moneyValue:uo(d,2e4),monthsValue:ho(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:rh,extraPercent:d?.extraPercent??sh},{normalizer:g}),y=hh(x),b=Boolean(x?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=Zu(h,y),w=Uu(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=l((()=>{vo({field:x,defParams:co(N,b,v),calcParams:w,monthsValue:"minMonths",map:lh})}),[x,h,v]);i((()=>{!Ao(d)&&N&&T()}),[d,h]);const R=x?.("extraPercent")?.value?.key,P=uh(C,R),B=C===co(N,b)?.rate&&R===v?.at(-1)?.key;return o(no,{className:e,title:t,...m,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[c("div",{className:"flex gap-m",children:[bo({className:"w-full",title:`Сумма, ${y?.text}`,min:w.minSum,max:w.maxSum,...x("moneyValue"),value:w.moneyValue,postfix:y?.text,step:ch(y?.key)}),h&&h?.length>1?o(On,{label:"Валюта",options:p,...x("currency")}):null]}),go({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...x("monthsValue"),value:w.monthsValue}),eh({...w,...s},x,v)]}),ku({rate:P,children:mh(T,B)}),Du({income:S,finalSum:k,buttons:[...a,dh(n?.buttons,I)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),ch=(e="")=>Yu(e)?1e3:100,dh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},mh=(e,t=!1)=>t?null:o(wl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),uh=(e,t)=>Number(e)+Number(t??0),hh=e=>e?.("currency")?.value??rh,ph=e=>gh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&gh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),gh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],fh={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},xh=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[fh],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>ph({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=To(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=To(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>ph({row:e,userInputParams:t,paramsViewSettings:n})&&Po(a+r,["minSum","maxSum"],e)&&Po(l,["minSumOld","maxSumOld"],e)&&Po(r,["minSumExtra","maxSumExtra"],e)&&Po(i,["minMonths","maxMonths"],e)))||fh)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=No(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},yh=Lt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...s})=>{const[d,{field:m}]=un({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=xh(d,n,l),p=r((()=>oo(n?.rateRows)?.rate),[n?.rateRows]),g=yo({...m("isAnnuity")});return o(no,{className:e,title:t,...s,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),bo({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),go({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),bh({...h,...l},m),h.isExtraMoney?bo({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:g})]}),c("div",{className:u(lo,"@4xl:w-1/2"),children:[o(so,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(so,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(so,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(so,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),qe(a,{isVertical:!0}),po(i)]})]})})})),bh=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ti,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ti,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ti,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),vh=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=ea(e,{normalize:(e=i)=>n&&a?String(ta(Number(Nh(e)),n,a)):Nh(e),format:Ge(r)}),d=l((e=>t&&t(Nh(e))),[t]);return o(wn,{onChange:d,...s,...c})})),Nh=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),wh=d((e=>o(vh,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Oe,{size:"text-xl",font:"font-light",children:"₽"})})}))),Ch=new Ps;function Sh(){return Es(Ch)}Ts(Ch,new Rs(globalThis?.sessionStorage));const kh={private:"p2p/registerP2P",business:"b2c/registerB2C"},Ih=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl px-4 pt-4 pb-8 grid gap-4 grid-cols-12",children:[c("div",{className:"col-span-8",children:[" ",n]}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Th=e=>{const t=pn(Ih),n=Sh(),a=Qt(),i="private"===e?"p2p":"b2c";return l((async({amount:l})=>{const r=await(async(e,t)=>{const n=Qt(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Ht}/payment/${kh[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,l);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(r)&&(n.transaction={orderId:r.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(r.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(r)&&t.open({errorCode:r.errorCode,errorMessage:r.errorMessage})}),[e])},Rh={amount:1500},Ph=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:l="private",...r})=>{const[s,{setValue:d}]=ln(!1),m=Th(l),[{amount:h},{field:p,onSubmit:f}]=un(Rh,{onSubmit:m});return i((()=>{d(h<=0)}),[h]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",onSubmit:f,children:[o(wh,{valid:!s,label:n,max:3e5,min:1,...p("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:h}),a?.text?o(Dl,{className:"w-full mt-lg",disabled:s,children:a.text}):null]})]})})),Bh=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(G,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Eh="relative h-full",_h={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Dh=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Oh),r=n?{defaultPadding:"p-6xl pb-m"}:{};return E({...a,renderProps:(n,a,i)=>c("div",{className:Ah(n,{someCardsHighlighted:l}),children:[R(n,a,{className:Mh(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Oh(n)?Bh({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Ah=(e,{someCardsHighlighted:t})=>u(Eh,t&&(Oh(e)?"pt-3xl":"pt-3xl sm:pt-16")),Mh=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Eh,"min-w-80",_h[a],t&&(Oh(e)?"pt-3xl sm:pt-16":"pt-3xl"),Sm(n),n&&"h-full"),Oh=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,zh=Lt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Km,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Vh(s?.block?.blocks):[],hasBlur:!0,children:Dh({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Vh=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Fh="z-10 border border-solid w-full h-full",Lh=u(Fh,"absolute hidden @xl:block border-transparent"),jh=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u(Lh,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Lh,"top-6 right-8 bg-green")}),o("div",{className:u(Lh,"top-3 right-4 bg-green-light")}),c("div",{className:u(Fh,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),qe([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),$h={black:"bg-black",white:"bg-white"},Uh=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Be,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:qe([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Oe,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(qh)]}):null,i?c(Oe,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),qh=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${$h[e]}`},String(t)),Wh=d((({icon:e,...t})=>{const n=fe(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ie,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Hh=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?Yh(a):null]})}))),Yh=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Wh,{...e},String(t))))}),Gh=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=fe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ye(i),children:l})})),Kh=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],Xh=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>Kh.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ue(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},Jh(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:qe(m,{className:Zh(s??!1,i??!1,n),buttonClassName:h})}),r?o(Oe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Jh=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Zh=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Qh=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(Gh,{href:i,target:m,className:"h-full",data:rm(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...tt(Ue(l)?o(ie,{image:l}):null,x),buttons:d.length?o(Xh,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o($e,{benefits:f}),s?o(Ae,{__html:s,isDotted:r,itemSize:"list-s"}):null,ep(a,p)]})})}))),ep=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,tp=new he,np=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Oe,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Oe,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:qe(i)}):null]},String(t))},ap=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...x})=>{const y=r((()=>h.map(np)),[h]),[b,v]=r((()=>m>0?[y.slice(0,m),y.slice(m)]:[y,[]]),[m,y]),[N,C]=a(!1);i((()=>tp.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const S=l((()=>{tp.fire("fold",{type:"fold",isUnfolded:!N,parent:p?.parent})}),[N,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...x,children:[o(ie,{className:"self-center",image:s}),t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(Ce,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(Cr,{children:[c("div",{children:[b,o(Sr,{isUnfolded:N,children:v})]}),h.length>=m?o(wr,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:b})]})})),ip=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=Qt();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await vs("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},lp=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),rp=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(lp,{step:a,showPercentage:!1})]})})}));var sp;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND"}(sp||(sp={}));const op=e=>bs("/user-data/getTaskStatus","POST",e),cp=async e=>{const t=await bs("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},dp=d((({title:e,interval:t=0,onEnd:n=yn})=>{const[i,l]=a(t);vd({seconds:t,onTick:l,onEnd:n});const r=100-(t-i)/t*100;return c("div",{children:[e?o(k,{title:e,headlineVersion:"S"}):null,c("div",{className:"relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5",children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${r}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(xd,{seconds:i})})]})]})})),mp=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:l,buttonText:r,interval:s,onExpire:d=yn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(dp,{interval:s,onEnd:d}):null]}),o(up,{title:n,items:a}),o(up,{title:i,items:l,countColumns:!0}),r?o(Ml,{href:"/natural",text:r,version:"primary",className:"w-full mt-lg"}):null]}))),up=({title:e,items:t,countColumns:n=!1})=>{const a=Te();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Oe,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",xl(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:hp(e)},t)))}):null]})]}):null},hp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Oe,{color:"text-secondary-text",size:"text-l",children:e}),o(Oe,{color:"text-primary-text",size:"text-xl",children:t})]}),pp=d((()=>o(mp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),gp=d((({onExpire:e})=>{const{statusInfo:t}=As();return o(mp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),fp=d((()=>{const{statusInfo:e}=As(),t="courier"===e?.methodObtain;return o(mp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),xp=d((()=>{const{statusInfo:e}=As();return o(mp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:yp(e),buttonText:"Вернуться на главную"})})),yp=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:qt(e?.deliveryDate)}]):t},bp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],vp=d((()=>{const[e,t]=a(sp.process),{taskId:n}=As();i((()=>{(async()=>{for(const e of bp)await cp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await op({taskId:n});a&&a?.statusCd!==sp.process&&(e(),t(a.statusCd))}),[n]);bd(r,3e4);const s=l((()=>t(sp.rework)),[]);return Np(e,s)})),Np=(e,t)=>({IN_PROCESS:o(gp,{onExpire:t}),CANCELLED:o(pp,{}),FAILED:o(pp,{}),DRAFT:o(pp,{}),APPROVED:o(xp,{}),PRE_DECISION:o(xp,{}),REVISION:o(fp,{})}[e]||o(fp,{})),wp=e=>(t,n)=>t.filter((e=>e)).map((t=>[Cp(n,e),Sp(t,e),Rp(t,e),kp(t,e),Ip(t,e),Tp(t,e)].some(Boolean)?{...t,required:!1}:t)),Cp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Sp=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,kp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ip=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Tp=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Rp=({name:e},t)=>"snils"===e&&Pp(t),Pp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Bp={...od,...cd},Ep=({field:e,inputs:t,params:n})=>t.map(fl(e,n,Bp)),_p=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l,condition:r},s)=>{const o=wp(Dp(t))(e,n);return c("div",{className:u(xl(i),"grid gap-x-m"),children:[Tp({condition:r},Dp(t))?null:yl(l),Ep({field:t,inputs:o,params:a})]},`section-${s}`)})),Dp=e=>t=>e(t)?.value,Ap=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(wl,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(Dl,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),Mp=(e,t,n)=>({...n[e],...t,limitedBirthday:Op(t?.limitedBirthday),dulIssueDate:Op(t?.dulIssueDate),participantDateRegistration:Op(t?.participantDateRegistration),beginDate:Op(t?.beginDate),deliveryDate:Op(t?.deliveryDate)}),Op=e=>{try{return e?new Date(e):void 0}catch(e){return}},zp=[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0}],Vp=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...zp,{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Fp=e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}},Lp=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},jp=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:x}=e;return{employmentContractDate:qt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:qd({organizationPhone:p&&Wt(p)}),participantAddresses:Wd({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?x:""}},$p=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDate:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y,addressMatch:b}=e;return{birthDate:qt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:qt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:qt(g,!0),homeMatchFlg:b,houseTypeCd:f,participantContacts:qd({phone:Wt(l),email:r}),participantAddresses:Wd({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Up=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,l=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:(r=n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000"),r?new Date(r).toISOString().split(".")[0]:""),office:{id:"3"},...l}:{};var r},qp=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Wp=(e,t)=>{switch(e){case 0:default:return{};case 1:return $p(t);case 2:return jp(t);case 3:return Hd(t);case 4:return Fp(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Wd({addressCourier:t})}:{}})(t)}},Hp=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=ln(!1),o=5===e,c=As(),d=r((()=>Mp(e,c.leadForm,Vp)),[e,c.leadForm]),m=l((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=l((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:l,participantId:r}=c;if(i&&l&&r){const t=await fd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Qt().origin,id:t,...qp(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Wp(i,a)}],...Lp(a),...Up(a),files:a?.files}}))({participantId:r,taskId:i,profileId:l,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Yp=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=r((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=l((t=>Ji(wp((e=>t[e]))(s,e),Ql)(t)),[s]),[m,u,h]=Hp({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=un(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[_p({sections:t,field:p,step:e}),o(Ap,{isSending:h,step:e,onPrevStep:n})]})})),Gp=[[{title:"Персональные данные",columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"sex",required:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0},{name:"phone",disabled:!0,required:!0},{name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"employerOrganization",required:!0},{name:"generalSeniority",required:!0,filledByEsia:!0},{name:"lastJobExperience",required:!0,filledByEsia:!0},{name:"experience5Years",required:!0,filledByEsia:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}]],Kp=[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}],Xp=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],...Gp,Kp],Jp=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Zp=d((({className:e,...t})=>{const[n,r]=a(0),d=s(null),m=l((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(ip,[]);const u=l((()=>{r((e=>Math.min(e+1,6))),m()}),[]),h=l((()=>{r((e=>Math.max(e-1,0))),m()}),[]),p=Xp[n],[f,{setTrue:x}]=ln(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(rp,{stepsTitles:Jp,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(vp,{}):o(Yp,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),Qp=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(lp,{step:a,showPercentage:!1})]})})})),eg=d((()=>o(mp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),tg=d((({onExpire:e})=>{const{statusInfo:t}=As();return o(mp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),ng=d((()=>{const{statusInfo:e}=As();return o(mp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ag=d((()=>{const{statusInfo:e}=As();return o(mp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),ig=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],lg=d((()=>{const[e,t]=a(sp.process),{taskId:n}=As();i((()=>{(async()=>{for(const e of ig)await cp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await op({taskId:n});a&&a?.statusCd!==sp.process&&(e(),t(a.statusCd))}),[n]);bd(r,3e4);const s=l((()=>t(sp.rework)),[]);return rg(e,s)})),rg=(e,t)=>({IN_PROCESS:o(tg,{onExpire:t}),CANCELLED:o(eg,{}),FAILED:o(eg,{}),DRAFT:o(eg,{}),APPROVED:o(ag,{}),PRE_DECISION:o(ag,{}),REVISION:o(ng,{})}[e]||o(ng,{})),sg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(wl,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(Dl,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),og={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},cg=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:og[a?"annuity":"differential"]}},dg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},mg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return $p(t);case 2:return jp(t);case 3:return Hd(t);case 4:return Fp(t);default:return{}}},ug=[{calculator:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...zp,{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],hg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=ln(!1),o=5===e,c=As(),d=r((()=>Mp(e,c.leadForm,ug)),[e,c.leadForm]),m=l((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity}},c.leadForm=d)}),[o,d]),u=l((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:l,participantId:r}=c;if(i&&l&&r){const t=await fd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Qt().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...mg(i,a)}],...cg(a),...dg(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}))({participantId:r,taskId:i,profileId:l,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},pg=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=As(),m=n?.[d??""],u=r((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=l((t=>Ji(wp((e=>t[e]))(u,e),Ql)(t)),[u]),[p,g,f]=hg({step:e,onNextStep:i,onFinish:s}),[,{field:x,onSubmit:y}]=un(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:y,className:"space-y-m",children:[_p({sections:t,field:x,step:e,params:{calcData:m}}),o(sg,{step:e,isSending:f,onPrevStep:a})]})})),gg=[[{columns:1,inputs:[{name:"calculator"}]}],...Gp,[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{name:"bankEmployeeCode"}]}]],fg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],xg=Lt((({className:e,programsSource:t,...n})=>{const[r,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(ip,[]);const h=l((()=>{d((e=>Math.min(e+1,5))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=gg[r],x=0===r,[y,{setTrue:b}]=ln(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x||y?null:o(Qp,{stepsTitles:fg,step:r,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(lg,{}):o(pg,{step:r,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(r))})]})})})),yg=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,bg=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),vg=1e9,Ng={sum:{min:1e4,max:vg},period:3},wg=Lt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=cu(Ng,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Cg(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Sg(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(tu,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(wh,{label:a?.title,min:500,max:vg,...d("sum",{parse:e=>({min:Number(e),max:vg}),format:({min:e})=>String(e)})}),o(ra,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Jm,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Cg=e=>At((e?.paramsSource?.rateRows||[]).filter(yg).flatMap((e=>bg(e.minMonths,e.maxMonths)))),Sg=e=>At(e.flatMap((e=>e||[])).filter(yg).flatMap((e=>bg(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],kg=[{key:"10"},{key:"50"},{key:"100"}],Ig=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(_n,{className:"min-w-20",onChange:n,value:{key:String(e)},options:kg,iconVersion:"black"})]})},Tg="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Rg=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:Tg,"aria-label":`Страница ${l}`,children:l},String(t)):null},Pg={width:"24",height:"24"},Bg=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(G,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Eg(1===e),...Pg})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Tg,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Rg),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Tg,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(G,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Eg(e===n),...Pg})})]})},Eg=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",_g=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Bg,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Ig,{itemCount:a,onItemCountChange:i}):null]}),Dg=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ie,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",bn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),Ag=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Dg,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Fa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Fa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(wl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Mg=d((({title:e,timestamp:t,publicId:n})=>{const a=fe(),{href:i}=a({href:`${Ht}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[o(fu,{className:"shrink-0",icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Oe,{size:"text-m","font-weight":"font-light",children:qt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),Og=`${Ht}/depository`,zg={startDate:void 0,endDate:void 0,query:""},Vg=Lt((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=un(zg),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?qt(a,!0):"",r=i?qt(i,!0):"",s=new URLSearchParams(Og);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=Hn(Og+o,Dt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),y=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Ag,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Oe,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Oe,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Mg,{...e},String(e.publicId)))):o(vm,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(_g,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Fg=e=>"Image"===e?.contentType&&e?.image?o(ie,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Lg=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:Fg(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ce,{version:i?.version,text:i?.text,...i}):null]}))),jg=`${Ht}/region`;function $g(e="Москва"){return Ds().location??{name:e}}function Ug(e="Москва"){const t=Ds(),n=l((async()=>{if(!t.location){const n=await _t(jg);t.location=n??{name:e}}}),[t,e]);return Hn(jg,n),t}var qg;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(qg||(qg={}));const Wg=new Intl.NumberFormat("ru",{style:"currency",currency:qg.RUB}),Hg=e=>e?Wg.format(e):"",Yg="text-m font-light text-secondary-text ",Gg=`${Yg} text-left`,Kg=`${Yg} pl-5xl text-center`,Xg=`${Yg} pl-5xl text-right`,Jg={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Zg=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Gg,children:o(Oe,{size:"text-m",children:"Валюта"})}),o("th",{className:Kg,children:o(Oe,{size:"text-m",children:"Купить"})}),o("th",{className:Xg,children:o(Oe,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Qg)})]}))),Qg=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ie,{image:{icon:Jg[t]},width:"24",height:"24"}):null,o(Oe,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Oe,{size:"text-h6",children:Hg(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Oe,{size:"text-h6",children:Hg(e?.buyExchangeRate)})})]},t)},ef={icon:"GpsIcon"},tf=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(fu,{...ef,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),nf=(e,t,n)=>{const a=Number(af(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},af=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function lf(e){if(!e)throw new Error("Value should be fulfilled");return e}const rf=e=>t=>{const[,n]=lf(e.find((([e])=>e(t))));return n(t)},sf=e=>rf(e.map((([e,t])=>[e,()=>t])));sf.if=e=>new of(void 0,e);class of{parent;predicate;unit;get entry(){return[lf(this.predicate),lf(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new of(this,e)}then(e){return new of(this.parent,this.predicate,e)}else(e){return rf([...cf(this),[()=>!0,e]])}}const cf=e=>[...e?.parent?cf(e.parent):[],e.entry],df=e=>sf([[e=>e.value!==qg.RUB&&e.oppositeValue!==qg.RUB,()=>e.handleConvert(e.value,qg.RUB)],[e=>e.value===qg.RUB&&e.oppositeValue===qg.RUB,()=>e.handleConvert(e.value,qg.USD)],[e=>e.value===qg.RUB&&e.oppositeValue===qg.RUB,()=>e.handleConvert(e.value,qg.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function mf(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(wn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(_n,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const uf=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||qg.RUB,selectBuy:n?.[0]?.currency?.currency||qg.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[mf({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:hf(r,d,n),value:r.inputSell,setValue:e=>gf(d,n)(e,r.selectSell,r.selectBuy)}),mf({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:pf(r,d,t),value:r.inputBuy,setValue:e=>ff(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ce,{text:i.text,version:i?.version,...i}):null]})})),hf=(e,t,n)=>a=>{t({selectSell:a}),df({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{gf(t,n)(e.inputSell,a,i)}})},pf=(e,t,n)=>a=>{t({selectBuy:a}),df({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>ff(t,n)(e.inputBuy,a,i)})},gf=(e,t)=>(n,a,i)=>{e({inputSell:af(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(nf(n,l,a===qg.RUB)||"")})},ff=(e,t)=>(n,a,i)=>{e({inputBuy:af(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(nf(n,l,a===qg.RUB)||"")})},xf=`${Ht}/exchangerates`;const yf=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=Hn(xf+`?regionCode=${t}`,Dt);return n||{}}($g()),l=bf(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:qg.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:qg.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Be,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Zg,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(tf,{address:i?.address})]}),o(uf,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),bf=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],vf=d((({className:e="",items:t})=>{const n=fe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Nf(n))})})),Nf=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ye(t),children:i||null})},String(a)):null},wf=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Cf(e)}))),Cf=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Sf,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Sf=d((({className:e,item:t})=>{const[n,{toggle:a}]=ln(!1);return c(Cr,{className:e,role:"menuitem",children:[c(wl,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(vr,{children:[o(fu,{className:"shrink-0",...t.icon}),o(Oe,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(Nr,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(Sr,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(vf,{items:t.items}):null})]})})),kf=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(If)}):null)),If=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Oe,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Tf)})]},String(t)),Tf=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Rf(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Rf=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Pf(t)}`,children:o(Oe,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Pf=e=>e.replaceAll(/\D/g,""),Bf=d((({className:e="",index:t,text:n,...a})=>{const i=fe(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Ef=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Oe,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Bf,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),_f=d((({className:e="",index:t,...n})=>{const a=fe(),{href:i,target:l,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),Df=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Oe,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(_f,{index:t,...e},String(t))))}):null]}))),Af=Lt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(wf,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(kf,{items:r}),m?o(Ce,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(Xh,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ml,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(Ef,{title:d,links:l}),o(Df,{links:i,license:h})]})})),Mf=Lt((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(On,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(Ml,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:rm(l,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),Of={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},zf=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d,isLoading:m,dataTestId:h=""})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Of[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...Vf(h),...ye(s),children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Vf=e=>e?{"data-test-id":e}:null,Ff="chatbot",Lf="text-page__btn-chat",jf="webchat-js-container:webchat_rshb",$f={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:"/webchat"},Uf=async(e,t)=>{const n=e.target;n?.classList.contains(Lf)||n?.classList.add(Lf);globalThis.document.getElementById(jf)||await ds(Ff,t)},qf=async e=>{const t=await ds(Ff,`${e}/bundle.js`,!0);((e="")=>{if(!globalThis.document.getElementById(e)){const t=globalThis.document.createElement("link");t.href=e,t.id=e,t.rel="stylesheet",globalThis.document.head.appendChild(t)}})(`${e}/bundle.css`);globalThis.document.getElementById(jf)?t?.chatOpen?.():(Wf(),t?.render?.(jf,!0,"/webchat-api","@container fixed right-0 bottom-0 h-full w-full z-[100] @3xl:w-auto h-fit"))},Wf=()=>{const e=globalThis.document.createElement("div");e.id=jf,globalThis.document.body.appendChild(e)},Hf=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:r="Чат",version:s,buttonSize:c="large"})=>{const{load:d,isLoading:m}=(e=>{const[t,n]=a(!1);i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const r=$f[e??""];return{load:l((t=>{r&&(n(!0),"business"===e?qf(r).finally((()=>n(!1))):Uf(t,r).finally((()=>n(!1))))}),[r,e]),isLoading:t}})(e);return o(zf,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:r,onClick:d,buttonSize:c,isGrayBg:!0,version:s,isLoading:m,dataTestId:"chat icon"})})),Yf={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},Gf=d((({version:e,text:t,mobileText:n,...a})=>{const i=Te()?n:t;return i?o(Ce,{className:u("py-s px-lg font-light whitespace-nowrap",Yf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Kf=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:r})=>{const s=_(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:h,...p}=t??{},g=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Id,{className:"my-2xs",bgColor:e,logo:p,data:h,showTitle:!1})}):Xf(g,r),c("div",{className:"flex gap-lg items-center",children:[A.CHAT_BOT?o(Hf,{version:i,iconVersion:m,chat:A.CHAT_BOT,buttonSize:"medium"}):null,o(Gf,{version:i,...a})]})]})})),Xf=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(G,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,Jf={"bg-white":"primary",transparent:"transparent"},Zf=Lt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Jf[e],portal:a,logo:i={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(Kf,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),Qf=(e=!1)=>e?{}:{padding:"p-0"},ex={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},tx=Lt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=_();return o(g,{className:u("relative flex flex-col",ex[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Q(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:E({...c,extraProps:{className:u("w-full",Sm(r)),...Qf(a)}})})}),{childrenTypes:[]}),nx=Lt((e=>o(tx,{...e})),{childrenTypes:[]}),ax=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Nu[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),ix=["байт","Кб","Мб","Гб","Тб","Пб"],lx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...ye(l),children:[e,t?c(Oe,{size:"text-l",font:"font-light",children:[t," ",rx(d,m),o(Oe,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),rx=(e,t)=>e||t?o("span",{children:", "}):"",sx=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="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))} ${ix[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?cx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(lx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:ox(t),data:n?.data}),o(Ae,{__html:n?.__html})]},String(a))},ox=e=>e?o(ie,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,cx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},dx=d((({href:e,__html:t,target:n,onClose:a})=>c(Sl,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Ae,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ml,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(wl,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),mx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=pn(dx),s=l((()=>r({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[ox(i),o(Oe,{font:"font-light",children:e})]}):null})),ux={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},hx=Lt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=_();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",ux[r]),role:"list",children:i.map(px(d,l))}):null]})})),px=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?gx(t)(n,a):sx(e,t)(n,a)},gx=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(mx,{...a,icon:e,href:fx(t)?t?.href:t?.attachment?.src}),o(Ae,{__html:t?.__html})]},String(n)):null},fx=e=>"href"in e,xx=Lt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ie,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:qe(a,{className:"flex-wrap"}),children:[i?o(Oe,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Ae,{__html:r,itemSize:"list-m"}):null,o(Oe,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ie,{className:"w-fit",image:d})}):null,l?.src?o(ie,{className:"lg:hidden",image:l}):null]})]})})})),yx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",bx=(e=[],t={})=>e.filter((({content:e={}})=>su(t,e))).length,vx=(e,t)=>e===t;const Nx=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,a])=>e(a,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(vx,((e=vx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),wx=[],Cx={},Sx={primary:"bg-white/30",secondary:"bg-main-divider"},kx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Ix=d((({count:e,version:t="secondary"})=>{const n=Te(),a=n?"bg-main-divider":Sx[t],i=kx[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Oe,{size:"text-xs",color:i,children:e})})})),Tx=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ie,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},Rx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Px={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Bx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Ex={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},_x=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Rx[a],n?Ex[a]:Bx[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Px[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Tx({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Ix,{count:m,version:yx(n,a)})}):null]})})})),Dx=d((e=>o(e?.item?.href?Ax:Mx,{...e}))),Ax=d((e=>{const t=fe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(_x,{...e,tag:"a",item:i,onClick:a})})),Mx=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(_x,{item:e,onClick:a,...n})})),Ox=(e,t,n)=>(a,i)=>o(Dx,{isActive:a===e,onClick:t,type:n,item:a},String(i)),zx=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Ox(a,i,t))}))),Vx={categories:[],extraOptions:[],propertyType:[],stage:[]},Fx=Lt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=cu(Vx,{block:i.block,page:i.options?.page}),f=l(((e=Vx)=>p(e)),[]),x=(({hotFilters:e=wx,filtrationState:t=Cx,blocks:n=wx,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Nx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:bx(n,t.filter),version:yx(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(zx,{...x}),o(tu,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(Jm,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Lx="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",jx=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(ti,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]],[m,{toggle:u}]=ln(!1);return o("div",{children:e?.length?o("div",{children:c(Cr,{children:[c("div",{children:[o("div",{className:Lx,children:s}),o(Sr,{className:Lx,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(wr,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(wl,{embedded:!0,onClick:n,children:[o(vr,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),$x=(e,t,n)=>{const a=yx("all"===t),i=yx("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(wl,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(wl,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},Ux=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Ae,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ie,{image:e.image}):null,e?.text?o(Oe,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,qx=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Oe,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Wx=()=>{},Hx=e=>"all"===e?"block":"hidden",Yx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=Wx,renderRemoteWorkplaceCard:r=Wx,getBalloon:s=Wx,getBalloonRemoteWorkplaces:d=Wx,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=un(Yr),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=Zr({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[qx(h,N),m?Ux(m):null,p&&$x(t,w,C),o("div",{className:u("pb-3xl",Hx(w)),children:o(jx,{filters:Gx([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:Gr})})]}),o("div",{className:"h-[600px]",children:o(es,{children:o(gs,{points:b,isLoad:n,className:"h-full"})})})]}),c(es,{children:[y.map(l),v.map(r)]})]})})),Gx=e=>Object.keys(Yr).filter((t=>e.filter((e=>Kr[t](e))).length)),Kx=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Xx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Kx(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Oe,{size:"text-h4",children:Kx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Oe,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Or,{color:"green",children:Kx(s)})})]}),o(kr,{children:o(br,{className:"flex-wrap",children:m?.map(((e,t)=>o(gr,{...e},String(t))))})})]},String(d))},Jx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Kx(t)} №${n}`,body:e.toUpperCase()}),Zx=[];const Qx=async e=>{const t=await _t(e,{method:"GET"});return Array.isArray(t)?t:Zx},ey={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ty={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},ny=d((({descriptionData:e,className:t})=>{const n=$g(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=Hn(`${Ht}/atms?regionCode=${e}`,Qx);return{data:t||Zx,isLoad:!t&&!n}}(a);return o(Yx,{className:t,filterItems:ay,data:i,isLoad:l,initFilterState:ey,renderCard:Xx,getBalloon:Jx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),ay=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>ty[t](e))),n=!a.length||a.some((t=>ty[t](e)));return t&&n}))},iy=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Oe,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Oe,{size:"text-l",children:e})]}):null]})}),o(kr,{children:ly(t)})]},String(n)):null,ly=e=>c("div",{children:[c(br,{className:"flex",children:[o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Оформление и обслуживание банковских карт"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Инвестиционное и накопительное страхование"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(gr,{label:"Режим работы",className:"max-w-none",children:o(Oe,{children:e})})]}),ry=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),sy={branches:[],remoteWorkplaces:[]};const oy=async e=>await _t(e,{method:"GET"})||sy,cy=d((({className:e})=>{const t=$g(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Hn(`${Ht}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,oy);return{data:t||sy,isLoad:!t&&!n}}(n);return o(Yx,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:qr,renderRemoteWorkplaceCard:iy,getBalloon:Hr,getBalloonRemoteWorkplaces:ry,title:`Офисы филиала ${t?.name}`})})),dy=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(cy,{}):o(ny,{descriptionData:e})})})),my=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),uy=d((({className:e,padding:t,slides:n=[],...a})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...a,children:o(Km,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(et,{className:"px-5 h-full",headlineVersion:"L",...e,...a})},String(t))))})}))),hy=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ue(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ie,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?py({__html:l,richVersion:r}):null,gy({label:"Адрес",data:e,iconName:"GeolocationIcon"}),gy({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),gy({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?qe([a]):null]})]}))),py=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ae,{...e,itemSize:"list-s"})}),gy=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(G,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Oe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Oe,{size:"text-xl",color:a,children:t})]})]}):null,fy=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Ae,{__html:t,richVersion:n})})})),xy=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",yy=Lt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:l,role:r,...s})=>{const d=Te(),[m,{toggle:h}]=ln(t),p=o(Sr,{className:u("gap-lg",xy(d)),isUnfolded:m,children:E({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,x=o(wr,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:r,...s,children:c(Cr,{children:[n?x:p,n?p:x]})})}),{childrenTypes:{exclude:["RollupItem"]}}),by=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(bn.split(" ").filter((e=>"rounded"!==e)),Qa,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(Oe,{color:"text-primary-text",children:t}):null]})}))),vy=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(by,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(by,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Ny=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(_n,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),wy=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Cy=["От 1 дня","До 365 дней"],Sy=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Oe,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ra,{min:1,max:365,value:e,items:Cy,onChange:t})]}))),ky=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Iy=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(wy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Ty(m)}),o(Sy,{days:i,setDays:e=>m({days:e})}),o(ky,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Ry(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Oe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(vy,{}),o(wl,{className:"order-6",version:"primary",onClick:u,children:"Офисы на карте"})]})]}))),Ty=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Ry=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Py=d((({days:e,tariffs:t=[]})=>{const n=Ey(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[By("Аренда за",e),By("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(G,{className:"@xl:h-60",name:"PackA4Icon"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),By=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Oe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Ey=(e,t)=>{const n=_y(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},_y=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},Dy=(e,t)=>e.find((e=>e.branchCode===t)),Ay=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Dy(a,n.selectedBranch),d=My(s?.safeBoxCaseVolumes),m=Oy(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=zy(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Iy,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(Py,{days:n.days,tariffs:u})]})})),My=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Oy=(e,t)=>e?.find((e=>e.volume===t)),zy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Vy=`${Ht}/safeboxes`,Fy=[];const Ly=async e=>await _t(e,{method:"GET"})||Fy,jy=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Di(),p=$y(m.selectedRegion,h),f=function(e){const{data:t}=Hn(e?`${Vy}?regionCode=${e}`:null,Ly);return t||Fy}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Dy(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Ay,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(gs,{points:y,className:"h-[640px]"}):null]})})),$y=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Uy={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"},qy=(e,t,n)=>(a,i)=>{const{button:l}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:Wy(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Hy(a),l?.text?o(Ce,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(i))},Wy=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=Yy(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:Gy({step:n,iconVersion:i,i:a,stepVersion:t})})})},Hy=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",Uy.description),children:e.description}):null,o(Ae,{__html:e.__html})]}),Yy=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Gy=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return Ue(e?.icon)?o(ie,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?Uy.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},Ky=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:l="gray",version:r="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(qy(d,r,l))}):null,qe(i,{isVertical:!0})]})})),Xy=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(G,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Jy=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Cl,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Zy(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const Qy=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}();return Zy(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},eb=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let l=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++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/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 tb=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Oe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(nb,{...e},String(t))))})]}):null,nb=d((({icon:e,...t})=>{const n=fe(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(Oe,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),ab=(e,t)=>n=>n.name?o(Gh,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:rm(e,n.name),children:o(Oe,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,ib=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(bn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),lb=d((({defaultLocation:e})=>{const t=$g(e),n=fe(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Gh,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),rb=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Ug(t?.default),[s,d]=a(""),m=Di(),u=r((()=>ob(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,sb)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(Sl,{className:"pb-20",head:c("div",{children:[o(Oe,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(lb,{defaultLocation:t?.default}),o(ib,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&eb(e.toLowerCase())(s.toLowerCase())>=.8)).map(ab(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Oe,{size:"text-h6",children:e})}),t.map(ab(f,g))]},e)))}),tb(e)]});var g,f})),sb=e=>e.name?.charAt(0)??"",ob=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),cb=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=pn(rb,n),{name:r}=$g(),s=e?.current?.getBoundingClientRect(),c=Z(J.SITE_URL);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(Jy,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),db="burgerMenuDialog",mb=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=yn})=>{const{open:i}=pn(cb),[r]=Qy(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(db,r),o=l((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:db})),[e,n,t,a]);return[s,{toggle:s?a:o}]},ub=[],hb=Lt((({sticky:e,...t})=>{const{menuItems:n=ub}=e??{},i=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=a(-1),[f,x]=a(""),{closeAll:y}=ge(),b=l((()=>{p(-1),x(""),y()}),[y]),v=fn(b),N=s(null),[C,{toggle:S}]=mb({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:r,close:s}=ge(),c=l((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return l(((l,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();r({id:"left"===d?n[l].title:a[l].title,dialog:o(Jy,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[l].description||m[l].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[l]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=l((e=>{e.stopPropagation(),b(),S()}),[b,S]),T=l(((e,t)=>{x(t),p(e),y(),k(e,t)}),[y,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(pb(T,"left",{activeIndex:h,currentItemPosition:f})),o(Xy,{item:i,isActive:C,onClick:e=>I(e)}),u.map(pb(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),pb=(e,t,n)=>(a,i,l)=>o(Xy,{item:a,isActive:l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||r.stopPropagation(),e(i,t)}},a.title||String(i)),gb="hidden sm:flex absolute z-40",fb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},xb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=Vm({itemCount:t?.length||0});return i((()=>yb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Bm,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:fb[l].item,gap:fb[l].gap,children:t.map(Ox(n,a,l))}),s.canScrollLeft?o(Um,{wcmsIgnore:!0,className:u("left-6",gb,fb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(qm,{wcmsIgnore:!0,className:u("right-6",gb,fb[l].buttonTop),onClick:s.scrollRight}):null]})})),yb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},bb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},vb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(bb[t].wrapper,e),children:o(xb,{className:bb[t].component,tabsType:t,...n})}):null,Nb=Lt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=wb(n??{}),p=_(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=a(kb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=Sb(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[vb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Cb(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>B(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Sb)?.filter(Boolean)||[]}),wb=({__id:e,anchor:t})=>t??e??"tabs",Cb=(e,t)=>t?.length?t:e,Sb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",kb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Ib={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Tb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ib[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),Rb=d((({className:e="",isOpen:t,onClick:n})=>o(wr,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),Pb={Buttons:({buttons:e})=>qe(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ie,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Ae,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Oe,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Oe,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(Rb,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Bb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return Eb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Eb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in Pb))return null;return o(Pb[n],{...t,...a})},_b=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Bb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Db=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Ab=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Oe,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Mb=d((({rows:e})=>{return o(Bm,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Oe,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Db(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Oe,{size:"text-xl",children:e.data}):null,e?.cols?Ab(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Ob=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Oe,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Mb,{rows:t.rowsData})})})]},a)}))}))),zb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Vb=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Oe,{size:"text-xl",font:"font-light",color:zb(t===n),children:e||t+1})},e)))}):null,t?o(Ce,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Fb=Lt((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Vb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Ob,{activeTabIndex:r,items:m}),o(Rb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Oe,{size:"text-h6",children:"Данных нет"}),o(Rb,{onClick:n,isOpen:!0})]})})),Lb=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Fb,{...t,onClick:n})}):null]}))),jb=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(Lb,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ie,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Oe,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Tb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(_b,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),$b=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:l})=>n||a?c("div",{children:[n?o(Um,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(qm,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:l}):null]}):null,Ub=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,$b({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),qb=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(jb,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]],[N,{toggle:w}]=ln(!1);return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?c(Cr,{children:[c(Ub,{controls:x,children:[b,o(Sr,{isUnfolded:N,children:v})]}),o(wr,{className:"text-h4",isUnfolded:N,onClick:w})]}):o(Ub,{controls:x,children:y})})]})})),Wb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?Hb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Oe,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Yb(n):null,i?o(Ae,{richVersion:l,__html:i}):null]})]}))),Hb=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),Yb=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Gb=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Oe,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Oe,{size:"text-h2",children:n})}):null]}))),Kb=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Gb,{prefix:t,unit:n,suffix:a})})})),Xb={AdTile:$t,ApplicationForm:Ll,BankAccountFiltration:uu,BenefitsBlock:xu,BonusBenefitsBlock:vu,ButtonsBlock:wu,CalculatorBonus:Pu,CalculatorBusinessDeposit:Fu,CalculatorCredit:Oo,CalculatorDeposit:oh,CalculatorRefinancing:yh,CardTransfer:Ph,Carousel:zh,CarouselCard:jh,CarouselCatalogCard:Uh,CarouselLinks:Hh,CarouselRecommendationCard:Qh,CarouselTariffsCard:ap,DepositFiltration:wg,Depository:Vg,ErrorBlock:Lg,ExchangeRateTile:yf,Footer:Af,GrantSupport:Mf,Header:Zf,Headline:k,HorizontalLayout:nx,ImgBlock:ax,LinkDocs:hx,MobileAppTile:xx,MortgageFiltration:Fx,OfficesAtmsMap:dy,Placeholder:my,ProductBlock:jt,ProductGallery:uy,RepresentativeOfficeInfo:hy,RichTextBlock:fy,RollupItem:yy,SafeDepositRental:jy,StepsBlock:Ky,StickyBottomMenu:hb,TabsLayout:Nb,TariffsTable:qb,TextBlock:Wb,UnitBlock:Kb,VerticalLayout:tx,ApplicationLeadForm:bm,CreditCardForm:Zp,CreditForm:xg},Jb=me((()=>{i((()=>{tn()}),[]);const e=an();gn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Zt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Zb="cookie",Qb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=ln();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(Zb)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(Zb,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Ae,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Cl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function ev(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);gn(globalThis.document,"keydown",t)}const tv=d((()=>{const[e,{close:t}]=Qy(),n=Boolean(e.length);return ev(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),nv=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return Zy(pe.observable,"popup",{open:t,close:n}),ev(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",title:"Всплывающее окно",children:e.popup}):null})),av="header",iv="footer",lv="sticky-footer",rv={},sv=d((({className:e,data:t=rv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Vt(s,r);Jb(),Ug();const m={key:"",page:{slots:i,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[av]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:B(i?.[av],{...m,slotName:av})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[E({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),B(i?.[iv],{...m,slotName:iv})]})]}),i?.[lv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:B(i?.[lv],{...m,slotName:lv})}):null,o(tv,{}),o(nv,{}),o(Qb,{__html:d?.cookieContent?.__html})]})}));Object.assign(sv,{childrenTypes:[],slots:()=>[av,iv,lv]});e.Blocks=Xb,e.ContentPage=sv,e.handlerDecorator=me,e.joinList=Qm,e.locationNavigator=Qt,e.packageVersion="0.14.807",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=_,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),a=n("useState"),i=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={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","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={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"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=S[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...a},i):null}},i)}const P=[],B=(e,{key:t,ancestors:n=P,slotName:a=null,extraProps:i,renderProps:l=R,...r})=>{const s=i?(e,t)=>R(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||P,[r.parent,a]]:n},i)))};function E({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?B(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function _(){return _._impl()}_._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),_.setup=e=>{_._impl=e};const D=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return D.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),z=e=>Boolean(e?.startsWith("#")),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),F=e=>t=>Boolean(e&&t&&e.startsWith(t)&&("/"===t||e===t||"/"===e[t.length]));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:z,withoutQuery:e=>(e??"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:F});const j="/api/",$=`${j}v1/storage`,U=[A.CDN,j],q=e=>(t,n)=>{if(W(t))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${$}/${t}/attachment`;const a=t?.startsWith("/");return V(F(t)(n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},W=e=>!e||M(e)||z(e)||U.some(F(e)),H={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},Y={small:"16",medium:"24",large:"48",xl:"78"},G=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",size:r,width:s=r&&Y[r],height:d=s})=>{const m=_(),h="normal"===l?`${n}.svg`:`sprites.svg#${n}`,p=q(m)(V(A.CDN,"/icons/",h));return"normal"===l?o("img",{className:e,style:K(e,d),src:p,alt:a,title:i,"aria-hidden":"true",width:s,height:d}):o(X,{className:e,children:c("svg",{className:u(H[l],{"w-full h-full":!s,invert:"white"===l},t),width:s,height:d,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:p,xlinkHref:p})]})})})),K=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},X=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),J=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function Z(e=""){try{return new URL(e).pathname}catch(e){return""}}const Q=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":Z(J.SITE_URL);return t&&!M(t)?q(e)(t,n):t},ee=(e,t)=>e?.media&&t?.media?e.media-t.media:0,te=d((({className:e="",image:t,imageClassName:n=""})=>{const a=_();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(ee).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:Q(a)(e),type:ae(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ne({...t,src:Q(a)(t.src)},n):null]})})),ne=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),ae=e=>e?`image/${String(e)}`:void 0,ie=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(G,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(te,{className:e,imageClassName:n,image:t}):null)),le={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},re="bg-main-divider text-main-disabled",se={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},oe="text-center font-sans select-none",ce={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},de=({className:e,rounded:t,version:n})=>[oe,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),me=e=>me._impl(e);function ue(e,t){const n=s({});return r((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}me._impl=e=>e,me.setup=e=>{me._impl=e};class he{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const pe=new he,ge=()=>ue(pe.emitter,"dialog");function fe(){const e=_(),{closeAll:t}=ge();return n=>{const a=q(e)(n.href);return{...n,href:a,"aria-label":n.text,onClick:me((i=>{n.onClick?.(i);const l=Z(J.SITE_URL);xe(a,n.target,l)&&(t(),i?.preventDefault(),e.push(((e,t="")=>e?.replace(t,"")||"/")(a,l)))}))}}}const xe=(e,t,n)=>O(e,t)&&!J.SUB_PORTALS?.split(",")?.some(F(e))&&F(e)(n||"/"),ye=e=>{try{return Array.isArray(e)&&e.length?{"data-aspects":JSON.stringify(e)}:{}}catch(e){return{}}},be=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=Ne(e)&&"hidden lg:block";return c("div",{className:u(ve(e),"flex gap-xs"),children:[a?o("div",{className:u(r,ce[l]),children:a}):null,Ne(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,ce[l]),children:i}):null]})})),ve=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",Ne(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},Ne=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),we=({className:e,rounded:t,version:n})=>["inline-block",oe,n?se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ce=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.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()}),[e,t]))({method:n,href:a}),s=fe()({onClick:r,href:a,...i}),c=t??o(be,{...s});return o(e?ke:Se,{...s,children:c})})),Se=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:de({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ye(d),children:m}))),ke=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:we({className:e,rounded:a,version:n}),children:i})));function Ie({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(de({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ie,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Ce,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Te=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Re={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Pe=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Re[n],t),children:e}):null,Be=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Te(),v=_(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Ie({version:t,handleClick:N,text:w}),i?o("div",{className:"relative h-full",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Pe(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),_e(E({...y,extraProps:{className:"@container-normal"}})),Pe(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Ee(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Ee=e=>u(e?"row-span-2":"@xl:row-span-2"),_e=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ie,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Ae=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Me=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Oe=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),ze=(e,t)=>e?o(Oe,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ve=(e,t)=>["label"in e?ze(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Me(e.description,t)},String(t)):null,"__html"in e?o(Ae,{...e},`rte-${t}`):null],Fe=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?De(n.icon,t):null,o("div",{children:Ve(n)})]}))),Le=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Fe,{benefitsVersion:t,...e},String(n))))}):null)),je=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ve)}):null)),$e=d((({isTabularBenefits:e,...t})=>o(e?je:Le,{...t}))),Ue=e=>Boolean(e?.src||e?.icon),qe=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(We(n))}):null,We=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=He(i,r),d=He(l,r);return a||i?.icon?o(Ce,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ye({...i,iconVersion:c}),appendRight:Ye({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},He=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ye=e=>Ue(e)&&o(ie,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ge=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ke=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Xe)}):null)),Xe=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Oe,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[Ge(2)(t)," ",n||"₽"]}):null]},String(a)),Je=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ze)}):null)),Ze=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Oe,{size:"text-m",font:"font-light",children:e})},String(t)),Qe={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},et=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const R=b?.src?o(ie,{image:b}):null,P=o(k,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),B=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Be,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...tt(R,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:qe(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[B?.length?o($e,{benefitsVersion:s,isTabularBenefits:d,benefits:B}):null,h?o(Ae,{richVersion:p,__html:h,isDotted:m,itemSize:Qe[l]}):null,I,f?.length?o(Ke,{priceList:f}):null,nt(x)]})})})),tt=(e,t)=>t?{rightImage:e}:{leftImage:e},nt=e=>e?.length?o(Je,{tags:e}):null;class at{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof at?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const it=()=>!0,lt=(e,t)=>(...n)=>e(...n)&&t(...n),rt=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const st=e=>Boolean(e&&Array.isArray(e)),ot=e=>Boolean(e&&"object"==typeof e&&!st(e)),ct=e=>e;function dt(e){return e instanceof at?e._:e}class mt extends at{from(e){return this.of(e.map(((e=ct)=>([,t])=>e(t))(dt)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(st(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class ut extends at{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class ht extends at{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,dt(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class pt extends at{proto=rt([e=>st(this._)||"number"==typeof e,()=>mt.prototype],[e=>ot(this._)||"string"==typeof e,()=>ht.prototype],[it,()=>ut.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const gt=e=>e instanceof at?e:new pt(e),ft=e=>{const t=(t,...n)=>dt(e(gt(t),...n));return t.fn=e,t},xt=[],yt=e=>e instanceof Function?e:t=>e===t,bt=e=>(t,n,a=xt)=>gt(t).entries().reduce(((t,[n,i])=>bt(e)(i,t,a.concat(n))),e(n,[a,gt(t)])),vt=ft(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?vt(e.get(a),[i,n]):n)})),Nt=ft(((e,t)=>t.reduce(vt.fn,e))),wt=e=>bt(((e,[t,n])=>Ct(n)?[...e,[t,dt(n)]]:e))(e,[]),Ct=e=>0===e.size();ft(((e,t=xt)=>t.reduce(((e,t)=>e.get(t)),e)));const St=ft(((e,[t,...n])=>n.length?e.set(t,St(e.get(t),n)):e.filter((([e])=>e!==t)))),kt=(It=["$ref"]).map(((e,t)=>n=>yt(e)(n[t+n.length-It.length]))).reduceRight(lt,it);var It;const Tt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(Rt,e),Rt=rt([st,(e,t)=>e[parseInt(t,10)]],[ot,(e,t)=>e[t]],[it,ct]),Pt=(e,t)=>((e,t={})=>n=>Nt(t,wt(n).map((t=>e(t)))))((([e,n])=>{return kt(e)?[(a=e,a.slice(0,-1)),Tt(t(n),n)]:[e,n];var a}))(e),Bt=e=>wt(e).filter(((e=ct)=>([t])=>e(t))(kt)),Et=e=>{return t=Bt(e).map((([,e])=>e)),[...new Set(t)];var t};async function _t(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),At=e=>[...new Set(e)],Mt={},Ot=["/portal-resources"],zt=(e,t)=>Pt(e,(e=>t?.[e])),Vt=(e,t)=>{const n=Et(e),[l,r]=a({});return i((()=>{Ft(n).then(r)}),[n.join()]),n.length?zt(e,{...t,...l}):e},Ft=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(At(e).filter((e=>!Ot.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Et(e)));return i.length?Ft(i,a):a}return t};function Lt(e,t={}){const n=d((t=>{const n=Vt((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const jt=Lt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(et,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),$t=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Ut(0,t?.length)),[t]),a=t?.[n];return a?o(jt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),Ut=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),qt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},Wt=e=>e?.replace(/[^+\d]/g,""),Ht="/api/v1";const Yt=e=>e?{phone:Wt(e)}:{},Gt=(e,t="birthday")=>e?{[t]:qt(e)}:{},Kt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Xt=(e,t=!0)=>({[t?"email":"mail"]:e}),Jt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:Wt(e)}:{},Zt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e??[])t[a??""]?.(n,i)};function Qt(){return Qt._impl()}Qt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Qt.setup=e=>{Qt._impl=e};const en="rshb-query-params";function tn(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(en)||"";return e&&globalThis.sessionStorage?.setItem(en,e),e}const nn=e=>{const t=e.target?.closest("a"),n=Qt();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=tn();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function an(){return an._impl()}function ln(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}an._impl=()=>({forwardQuery:nn}),an.setup=e=>{an._impl=e};const rn=e=>t=>t&&Object.entries(e??{}).flatMap((([e,n])=>n?n(t[e]):[]))||[],sn=e=>!e?.length,on=e=>t=>n=>e(n)?[]:[t],cn={},dn=[];const mn=(e,t)=>e&&t&&(e===t||Object.keys({...e,...t}).every((n=>e[n]===t[n])));function un(e,{resetOnSubmit:t,formValidator:n,normalizer:o,onChange:c,onSubmit:d}={}){const[m,u]=function(e,t,n){const[r,s]=a(e),o=l((e=>s((a=>{const i=e instanceof Function?e(a):e,l=t?t(i):i,r=mn(i,l)?i:l;return!mn(a,r)&&n?.(r),r}))),[t,n]);return i((()=>{t&&s(t)}),[t]),[r,o]}(e,o,c),[h,{setTrue:p,setFalse:g}]=ln(!1),f=s({}),[x,{isValid:y,errors:b}]=function(e,t){const n=r((()=>t?.(e)??cn),[t,e]),a=r((()=>rn(n)(e)??dn),[n,e]),i=sn(a);return[n,{isValid:i,errors:a}]}(m,n),v=l(((e,t={})=>{const{parse:n,format:a,onChange:i}=t,l=m[e],r=h||f.current?.[String(e)],s=t?.validator??x[e],o=r&&s?s(l):[];return{value:a?a(l):l,isDirty:r,errors:s&&o,error:o[0],onChange:t=>{f.current||={},f.current[String(e)]=!0;const a=n?n(t):t;i?.(a),u((t=>({...t,[e]:a})))}}}),[m,h,x,u]),N=l((e=>{f.current=e,u(e)}),[u]),w=l((()=>{f.current={},g(),u(e)}),[e,u]),C=l((e=>{e.preventDefault(),y?(t&&w(),d?.(m,e)):p()}),[t,m,y,w,d]);return[m,{errors:b,field:v,update:N,reset:w,onSubmit:C}]}const hn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function pn(e,t={}){const{open:n,close:a,...i}=ge();return{open:l(((i,l={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...l})),[e,n,a]),close:a,...i}}function gn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function fn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return gn(globalThis.document,"click",n),t}const xn=({label:e,errors:t})=>e&&t?`${e}*`:e,yn=()=>{},bn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",vn=e=>e?bn:"border-error",Nn=e=>e?o(Oe,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,wn=d((({key:e,className:t,id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,pattern:g,autoFocus:f=!1,isTextarea:x=!1,disabled:y=!1,children:b,onChange:v,onFocus:N,onBlur:w})=>{const C=s(null),S=l((e=>{const t=(e.target?.value??"").trimStart();v&&v(t)}),[v]);i((()=>{f&&C.current?.focus()}),[f,C]);const k=b?"pr-3xl":"",I=vn(p),T=d??a??n;return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Nn(d),x?o("textarea",{className:u("block resize-y min-h-24",Cn,I),id:u("textarea",n),value:h,name:a||n,placeholder:m,disabled:y,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e):o("input",{ref:C,className:u("h-14",Cn,k,I),id:n,type:r,value:h,name:a||n,placeholder:m,pattern:g,disabled:y,"aria-label":T,onChange:S,onFocus:N,onBlur:w},e)]}),b]})})),Cn="w-full border rounded-md text-primary-text outline-none p-m",Sn=e=>o("div",{className:"h-6",children:e?o(Oe,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),kn=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=yn,onBlur:m,isTextarea:h,type:p,isInteger:g=!1,maxLength:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=ln(),N=fn(b),w=l((e=>{!y&&v(),f?e.length<=f&&d(e):d(e)}),[y,d]);return i((()=>{g&&n&&d(In(n))}),[n]),c("div",{className:u("shrink-0 w-full",e),ref:N,onBlur:b,onFocus:v,children:[o("div",{children:o(wn,{disabled:x,type:p||"text","aria-label":t,label:xn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:w,onBlur:m,isTextarea:h,placeholder:Tn(a,s,t)})}),Sn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Rn=e=>e?.text||e?.key||"",Pn=()=>ue(pe.emitter,"popup"),Bn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,En=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Bn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&i(e)},children:[o("span",{className:"min-h-6",children:Rn(e)}),o(G,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const _n=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,disabled:g=!1,iconVersion:f="black",onChange:x})=>{const[y,{setFalse:b,setTrue:v}]=ln(),[N,w]=a(""),C=Mn(g,n.length),S=y&&!C,k=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=Pn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=fn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(En,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:x,onClose:I,iconVersion:f});return c("div",{className:u("space-y-xs",e),children:[Nn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",An(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Rn(r)||h}),Dn(S,f)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(wn,{type:"text",value:N,autoFocus:!0,disabled:C,onChange:w})}):null]})]})})),Dn=(e,t)=>o(G,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),An=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Mn=(e,t)=>e||0===t,On=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(_n,{...i,valid:!n,label:xn({label:t,errors:a})}),Sn(n)]}))),zn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Vn=d((({field:e,input:t})=>o(On,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:zn,...e(t?.name??"")}))),Fn=(e="")=>Boolean("trade"===e||"all"===e),Ln=e=>null!=e,jn=new Map,$n=(e,t=jn)=>n=>{const a=qn(n),i=t.get(a);if(a&&Ln(i))return i;const l=e(...n);return a&&Ln(l)&&t.set(a,Promise.resolve(l)),l},Un=e=>Boolean(e?.every((e=>Array.isArray(e)?Un(e):!e||"string"==typeof e))),qn=e=>Un(e)?e.toString():"",Wn=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function Hn(e,t,{fallback:n,cache:l}={}){const s=r((()=>Yn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(Ln))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await $n(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&Wn(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Yn(e){return Array.isArray(e)?e:e instanceof Function?Yn(e()):[e]}const Gn=`${Ht}/branches`,Kn=[];const Xn=async e=>await _t(e,{method:"GET"})||Kn;function Jn(e=!1){const{data:t}=Hn(`${Ht}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const Zn=(e="")=>"ULTRASERVICE"===e,Qn=d((({field:e,input:t,params:n})=>{const a=Zn(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?Jn(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=Hn(e?`${Gn}?regionCode=${e}`:null,Xn);return t||Kn}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(On,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...e(t?.name??""),isSearch:!0})})),ea=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},ta=(e,t,n)=>Math.max(t,Math.min(e,n));function na(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function aa({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:l,onChange:t=>{const n=na(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const ia=1,la=100,ra=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:ia),max:s=(i.length?i.length-1:la),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=ea(e,{normalize:(e=0)=>i.length?sa(i)(e):ta(e,r,s),format:Ge()}),f=l((e=>{p&&p(na(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Oe,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",bn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),aa({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),oa(a)]})})),sa=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),oa=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Oe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ca=["От 1 000 ₽","До 1 000 000 000 ₽"],da=d((({field:e,input:t})=>o(ra,{title:"Сумма, ₽",items:ca,min:1e3,max:1e9,...e(t?.name??"")}))),ma=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...e(t?.name??"")}))),ua="client",ha=[{key:ua,text:"Клиент"},{key:"representative",text:"Представитель клиента"}],pa=d((({field:e,input:t})=>o(On,{label:"Тип обратившегося",...t,options:ha,...e("applierType")}))),ga=d((({field:e,input:t})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e(t?.name??"")}))),fa=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=xa(t,e),c=ya(t,l,r);u.push(o("td",{children:o("div",{className:ba(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},xa=(e,t)=>t&&e.toDateString()===t.toDateString(),ya=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),ba=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),va=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Na=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:l=yn})=>{const{firstDayOfWeek:s,totalDays:d}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:va.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:fa({firstDayOfWeek:s,today:e,totalDays:d,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:l})})]})})),wa=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ca(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Sa),l=a.map(((e,t)=>Ia(e)?a.slice(0,t).filter(Ia).length:-1)),r=a.map(((e,t)=>ka(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const Sa=e=>"_"===e,ka=e=>/\d/.test(e),Ia=e=>Sa(e)||ka(e),Ta=1940,Ra={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Pa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),i((()=>{Ea({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Ca(t,"__.__.____"))},onBlur:()=>{Ba(p)?Ea({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(l||"")},disabled:r}),r?null:o(G,{className:"mr-s",...Ra})]})})),Ba=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Ta&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},Ea=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(Ba(e)){const{day:i,month:l,year:r}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(l),n(r),a?.(new Date(r,l,i))}},_a=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Pa,{onChange:a,disabled:r,onClick:e,value:t&&qt(t),setSelectedMonth:i,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),Da=wa.map((e=>({key:e}))),Aa=Array.from({length:(new Date).getFullYear()-Ta+1},((e,t)=>Ta+t)).reverse().map((e=>({key:String(e)}))),Ma=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Oa=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},za={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Va={className:"min-w-32",iconVersion:"black",isBorder:!1},Fa=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g,setFalse:f}]=ln(!1),[x,y]=a(n?.getMonth()||(new Date).getMonth()),[b,v]=a(n?.getFullYear()??(new Date).getFullYear()),N=l((e=>{h?.(e),f()}),[h]),{handlePrevMonth:w,handleNextMonth:C,handleSelectMonth:S,handleSelectYear:k,monthsOptions:I,yearsOptions:T,handleChangeVisibleCalendar:R,ref:P}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=fn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(wa.indexOf(e));const t=Ma(r,wa.indexOf(e));Oa({maxDateOfMonth:t,selectedYear:r,selectedMonth:wa.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Da,yearsOptions:Aa,ref:c}})({onYearSelect:v,onMonthSelect:y,onShowCalendar:g,selectedYear:b,selectedMonth:x,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(P,370);return c("div",{className:u("space-y-xs",e),ref:P,children:[Nn(t),c("div",{className:"relative",children:[_a({handleChangeVisibleCalendar:R,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:y,setSelectedYear:v}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:w,children:o(G,{...za,className:"-rotate-90 cursor-pointer"})}),o(_n,{onChange:S,value:{key:wa[x]},options:I,...Va}),o(_n,{onChange:k,value:{key:String(b)},options:T,...Va}),o("div",{className:"my-auto",onClick:C,children:o(G,{...za,className:"rotate-90 cursor-pointer"})})]}),o(Na,{today:n,currentMonth:x,currentYear:b,min:s,max:d,onDateSelect:N})]}):null]})]})})),La=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Fa,{label:xn({label:t,errors:a}),valid:Boolean(!n),...i}),Sn(n)]}))),ja=d((({field:e,input:t})=>o(La,{label:t?.label||"Дата рождения",...e(t?.name??"")}))),$a=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...e(t?.name??"")}))),Ua=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...e(t?.name??""),placeholder:"Ваше сообщение",isTextarea:!0}))),qa=d((({field:e,input:t})=>o(La,{label:"Желаемая дата встречи",...e(t?.name??"")}))),Wa=d((({field:e,input:t})=>o(kn,{label:"Электронная почта",...e(t?.name??""),...t}))),Ha=[{key:"ULTRASERVICE",text:"Ультра"}],Ya=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Ga=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Ka=d((({field:e,input:t})=>o(On,{label:"Способ получения ответа",options:Ga,...e(t?.name??"")}))),Xa=d((({field:e,input:t})=>o(kn,{label:"ФИО",...e(t?.name??""),...t}))),Ja=d((({field:e,input:t})=>o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??"")}))),Za=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),Qa="appearance-none w-5 h-5 border-solid flex-none",ei=[{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"}],ti=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Za,{paths:ei,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",ai(a)),onClick:s,children:[o("div",{className:u(Qa,"m-0",i?"rounded-full border-2":li(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ii(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ni(n)]})})})),ni=e=>e?o("div",{className:"ml-s",children:o(Oe,{size:"text-l",font:"font-light",children:e})}):null,ai=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ii=(e=!1)=>e?"radio":"checkbox",li=(e=!1)=>u("rounded border",{"bg-primary-main":e}),ri=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ti,{text:t,value:n,disabled:i,onChange:r},a),Sn(l)]}))),si=d((({field:e,input:t})=>o(ri,{...e(t?.name??""),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),oi=`${Ht}/outservice`,ci=[];async function di(){const e=await _t(`${oi}/outserviceregions`);return e&&Array.isArray(e)?e:ci}const mi=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=Hn("outServiceRegions",di),s=r((()=>l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})))),[l,a]);return i((()=>{""!==a&&e?.(t?.name??"")?.onChange?.("")}),[a,t?.name??""]),o(On,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:s,...e(t?.name??""),isSearch:!0})})),ui=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,hi=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),pi=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),gi=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Oe,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),fi=d((({field:e,input:t})=>Fn(e("acquiringType")?.value?.key)?o(gi,{type:"radio",text:"Хочу онлайн-кассу",...e(t?.name??"")}):null)),xi=d((({field:e,input:t})=>o(kn,{...e(t?.name??""),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...t}))),yi=e=>"_"===e,bi=e=>/\d/.test(e),vi=e=>yi(e)||bi(e),Ni=[..."+7 (___) ___-__-__"],wi=Ni.findIndex(yi),Ci=Ni.map(((e,t)=>vi(e)?Ni.slice(0,t).filter(vi).length:-1));function Si(e){const t=e.replace(/\D/g,""),n=Ni.map(((e,n)=>bi(e)?e:t.charAt(Ci[n])||e)),a=Ci.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(wi,a)):n).join("")}const ki=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(Si(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(wn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),Ii=d((({className:e,label:t,disabled:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ki,{"aria-label":t,label:xn({label:t,errors:i?.errors}),valid:Boolean(!a),disabled:n,placeholder:"+7 (___) ___-__-__",...i}),Sn(a)]}))),Ti=d((({field:e,input:t})=>o(Ii,{label:"Телефон",...e(t?.name||"phone"),...t}))),Ri=d((({field:e})=>Fn(e("acquiringType")?.value?.key)?o(gi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Pi=Lt((({field:e,input:t,source:n})=>o(On,{placeholder:"Выберите продукт",label:"Продукт",options:Bi(n?.productList),...e(t?.name??"")}))),Bi=e=>(e??[]).map((e=>({key:e,value:e}))),Ei=`${Ht}/regions`,_i=[];function Di(e=Ei){const{data:t}=Hn(e,Dt);return Array.isArray(t)?t:_i}const Ai=`${Ht}/outservice/outserviceregions`,Mi=d((({field:e,input:t,params:n})=>{var a;const i=Di((a=n?.typeForm,"OUTSERVICE"===a?Ai:void 0));return o(On,{label:t?.label||"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...e(t?.name??"")})})),Oi=d((({field:e,input:t})=>{const n=Jn(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(On,{label:"Регион",placeholder:"Выберите регион",options:a,...e(t?.name??"")})})),zi=d((({field:e,input:t})=>o(kn,{label:"ФИО представителя",...t,...e("representativeName")}))),Vi=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},Fi=/^[\u0400-\u04FF\d\s]+$/u,Li=(e="")=>Fi.test(e),ji=on((e=>null!=e&&""!==e)),$i="Некорректно заполненное поле",Ui=e=>ji(e??$i),qi=e=>on((e=>e?.key&&""!==e?.key))(e??$i),Wi=e=>on((e=>"string"==typeof e&&e.length>1&&Li(e)))(e??$i),Hi=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Yi=e=>on(Hi)(e),Gi=on((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Ki={fullName:Ui(),addressBranch:qi(),desiredMeetingDate:Ui(),product:Ui(),localities:Ui(),partnerComments:Ui(),collectionCount:Ui(),acquiringType:qi(),serviceType:qi(),annualRevenue:Ui(),feedbackMethod:qi(),serviceDirection:qi(),secondaryPhone:Yi("Укажите номер телефона"),region:qi(),situationDescription:Ui(),sufferedFrom:Ui(),applierType:Ui(),surname:Wi("Укажите свою фамилию на кириллице"),name:Wi("Укажите своё имя на кириллице"),middleName:Wi("Укажите своё отчество на кириллице"),birthday:Ui("Укажите дату рождения"),phone:Yi("Укажите номер телефона"),email:(Xi="Укажите электронную почту",on((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(Xi)),inn:(e=>on((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:Ui(),typeForm:Ui(),consentToReceiveMaterials:Gi,consentDataProcessing:Gi};var Xi;const Ji=(e,t={})=>{const n=e.filter((e=>Boolean(e?.required&&e?.name))),a={...Ki,...t},i=n.some((e=>e.condition?.values)),l=Object.fromEntries(n.filter(Zi(a)).map((({name:e})=>[e,a[e??""]])));return e=>i?Object.fromEntries(n.filter(Zi(a)).filter(Qi(e)).map((({name:e})=>[e,a[e??""]]))):l},Zi=(e={})=>({name:t})=>Boolean(e[t??""]),Qi=e=>t=>!t?.condition||t.condition.values.find((n=>{const a=e?.[t?.condition?.name??""];return n===(a?.key??a)})),el=d((({field:e})=>{const t=e("secondaryPhone");return o(Ii,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Vi(t,Ki.secondaryPhone):t})})),tl=d((({field:e,input:t})=>o(On,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Ya,...e(t?.name??"")}))),nl=d((({field:e,input:t})=>o(kn,{label:"Описание ситуации",...t,...e("situationDescription")}))),al=[{key:"blg",text:"Белгородской области"},{key:"brnsk",text:"Брянской области"},{key:"krsk",text:"Курской области"},{key:"chs",text:"От стихийного бедствия ЧС"}],il=d((({field:e,input:t})=>o(On,{label:"Пострадал в",...t,options:al,...e("sufferedFrom")}))),ll=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),rl=["От 1 мес","До 15 лет"],sl=d((({field:e})=>o(ra,{title:"Срок, месяцев",items:rl,min:1,max:180,...e("term")}))),ol=d((({field:e,input:t})=>o(On,{label:"Тип обслуживания",options:Ha,...e(t?.name??"")}))),cl={horizontal:"@lg:flex-row",vertical:""},dl=d((({label:e,items:t,value:n,className:a,disabled:i=!1,orientation:l="horizontal",onChange:r})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Oe,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",cl[l],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ti,{isRadio:!0,text:t,value:n===e,onChange:()=>r?.(e),disabled:i},String(e))))})]}))),ml=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],ul=d((({field:e,input:t})=>{const n=l((t=>{"currencyControl"!==t&&(e("inn").onChange?.(""),e("region").onChange?.(""))}),[]);return o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(dl,{className:"whitespace-normal",orientation:"horizontal",items:ml,...e(t?.name??"",{onChange:n})})})})),hl=d((({field:e,input:t})=>o(ti,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...e(t?.name??"")})));const pl={$ref:"/wcms-resources/outservice-productlist.json"},gl={fullName:Xa,addressBranch:Qn,desiredMeetingDate:qa,product:e=>o(Pi,{...e,source:pl}),localities:mi,isClient:si,partnerComments:xi,collectionCount:$a,acquiringType:Vn,onlineCheckout:fi,posTerminal:Ri,serviceType:ol,term:sl,amount:da,annualRevenue:ma,vedTypes:ul,feedbackMethod:Ka,serviceDirection:tl,bankEmpolee:ga,secondaryPhone:el,applicationDate:e=>o(kn,{label:"Дата и время обращения в Банк",...e}),region:e=>Zn(e?.params?.typeForm)?o(Oi,{...e}):o(Mi,{...e}),consentToReceiveMaterials:hl,sufferedFrom:il,situationDescription:nl,representativeName:zi,applierType:pa,surname:ll,name:pi,middleName:hi,birthday:ja,phone:Ti,email:Wa,inn:Ja,comment:Ua},fl=(e,t,n={})=>(a,i)=>{const l={...gl,...n}[String(a.name)];return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})&&l?o("div",{children:o(l,{field:e,input:a,params:t})},i):null},xl=e=>2===e?"@xl:grid-cols-2":"",yl=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Oe,{size:"text-h6",children:e})}):null,bl={primary:u("text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active","group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","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")},vl=u("group/btn-embedded","bg-transparent border border-transparent outline-none"),Nl=u("bg-main-gray text-main-disabled cursor-not-allowed"),wl=d((({className:e,type:t="button",version:n="primary",shape:a="default",embedded:i,disabled:s,role:c,ariaLabel:d,data:m,dataTheme:h,children:p,wcmsIgnore:g,onClick:f=yn})=>{const x=l("tab"!==c?me(f):f,[c,f]),y=r((()=>ye(m)),[m]),b="round"===a;return o("button",{className:u("font-sans flex items-center gap-xs",{[bl[n]]:!s&&!i,[vl]:i,[Nl]:s},i?"justify-between":"justify-center",i||b?"p-0":"px-9 py-4",{"rounded-md":"default"===a,"rounded-full":b},e),type:t,role:c,"aria-label":d,disabled:s,"aria-disabled":s?"true":void 0,"data-theme":h,"data-wcms-ignore":g,...y,onClick:x,children:p})})),Cl=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(G,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Sl=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",title:"Диалог",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Cl,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),kl=d((({ok:e,typeForm:t,onClose:n})=>{const a="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:e?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:e?"Ваша заявка отправлена":"Не удалось отправить заявку",description:e?a:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(wl,{type:"button",onClick:n,children:"Хорошо"})]})})})),Il=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,inn:d,sufferedFrom:m,situationDescription:u,applierType:h,...p}=e,g=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${Fn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,f={...p,...Bl(o),...Pl(c),...d&&{inn:d},...g?{partnerComments:g}:{},...s?{typeForm:s}:{},...Rl(m?.text,u),...Tl(h)};return Object.fromEntries(Object.entries(f)?.map((([e,t])=>[e,t?.key||t])))},Tl=e=>e?.key?{isClient:e?.key===ua}:{},Rl=(e,t)=>e||t?{comment:`${e||""};${t||""}`}:{},Pl=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Bl=e=>e?{vedTypes:Object.fromEntries(ml.map((({id:t})=>[t,t===e])))}:{},El={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:Ha[0],feedbackMethod:Ga[0],serviceDirection:Ya[0],vedTypes:ml[0].id,birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},_l=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block","animate-spin rounded-full","border-solid border-current","border-r-transparent","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})}))),Dl=d((({isLoading:e,disabled:t,children:n,className:a,...i})=>c(wl,{type:"submit",className:u("relative",a),disabled:e||t,...i,children:[e?o(_l,{blur:!0,size:"small"}):null,n]}))),Al={primary:bl.primary,secondary:bl.secondary,white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",gray:bl.secondary,transparent:"","":""},Ml=d((e=>{const t=fe(),{className:n,href:a,target:i,text:l,aboveText:r,version:s="link",rel:c,ariaLabel:d,data:m,children:h,onClick:p}=t(e),g="link"!==s;return o("a",{className:u("group/btn inline-flex items-center h-fit","font-sans no-underline select-none","border border-transparent focus:border-primary-text focus:border","cursor-pointer",{[Al[s]]:Boolean(s),[r?"px-9 py-2.5":"px-9 py-4"]:g,"rounded-md":g},n),href:a,target:i,rel:c,"aria-label":d??`Ссылка на ${l}`,role:a?"link":"button",onClick:p,...ye(m),children:h??Ol(l,r)})})),Ol=(e,t)=>e||t?c("div",{className:"whitespace-pre",children:[t?o("div",{className:"font-light text-left text-xs",children:t}):null,o("div",{className:u("text-left",{"text-s -mt-3xs":Boolean(t)}),children:e})]}):null,zl=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Oe,{children:e}):null,t?o(Ml,{...t,ariaLabel:"условия передачи данных",children:t.text}):null]}))),Vl=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(ti,{...e}),o(zl,{link:t})]}),Sn(Vi(e,Gi).error)]}):o(zl,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),o(Dl,{className:"w-full @xl:w-auto",children:n?.text?n.text:"Отправить заявку"})]}),Fl={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Ht}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Kt(a,g),...Xt(l,g),...Yt(i),...Gt(s,"desiredMeetingDate"),...g?Gt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Jt(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Ll=d((({className:e,title:t,typeForm:n="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,data:p,...g})=>{const f=r((()=>a?.flatMap((e=>e?.inputs))||[]),[a]),x=r((()=>((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"vedTypes"===e?.name&&e?.defaultValue||El[e.name||""]]))),typeForm:{key:t,text:""}}))(f,n)),[f,n]),y=r((()=>Ji(f)),[f]),b=pn(kl),v=an(),N=l((async(e,t)=>{const a=Il({...e,...m}),i=Boolean(await Fl.send(a,"lead"===d));b.open({ok:i,typeForm:n}),i&&Zt({aspectsAttributes:p,aspects:v,ev:t})}),[n]),[,{field:C,onSubmit:S}]=un(x,{resetOnSubmit:!0,formValidator:y,onSubmit:N}),k=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(f)?.name;return c(hn,{className:u("container space-y-m",e),title:t,...g,children:[c("form",{onSubmit:S,children:[a.map(((e,t)=>c("div",{className:u(xl(e.columns),"grid gap-x-m"),children:[yl(e.title),(e?.inputs||[])?.map(fl(C,{typeForm:n}))]},`section-${t}`))),Vl(k?C("consentDataProcessing"):void 0,s,i)]}),h?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ie,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ie,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),jl="Некорректно заполненное поле",$l="Укажите регион, город/населенный пункт, улицу, дом",Ul=e=>Boolean(e.region&&(e.city||e.locality)&&e.house),ql=()=>on(Ul)($l),Wl=e=>on((e=>"string"==typeof e&&/^[0-9]{1,2}$/g.test(e)))(e??jl),Hl=(e,t)=>on((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??jl),Yl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},Gl=e=>on((e=>"string"==typeof e&&6===e.length))(e),Kl=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.slice(9))}return!1},Xl={processPersonalDataFlg:Gi,consentProviderFlg:Gi,consentInformFlg:Gi,consentPfrFlg:Gi,consentOthersFlg:Gi,consentFATCA:Gi},Jl={addressCourier:ql(),paymentSystem:Ui("Укажите тип платежной системы"),currency:Ui("Укажите валюту"),cardCategory:Ui("Укажите категорию карты"),codeWord:(e=>on((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Li(e)))(e??jl))("Необходимо ввести кодовое слово"),confirmationIncome:qi(),methodObtain:Ui(),deliveryDate:Ui("Укажите дату доставки")},Zl={organization:qi("Выберите тип организации"),organizationAddress:on((e=>Boolean(e.fiasCode&&(e.city||e.locality)&&e.house)))($l),organizationPhone:Yi("Укажите номер телефона"),organizationName:Ui("Укажите наименование организации"),legalForm:Ui("Укажите ОПФ"),generalSeniority:Wl("Укажите количество лет стажа"),lastJobExperience:Wl("Укажите стаж на последнем месте работы"),experience5Years:Wl("Укажите общий стаж за последние 5 лет"),jobsNumber:Wl("Укажите количество мест работы за последние 5 лет"),beginDate:Ui("Укажите дату заключения трудового договора"),addressFact:ql(),addressRegistration:ql(),addressRetail:qi("Выберите адрес банка"),addressMatch:Ui(),sex:Ui("Укажите свой пол"),limitedBirthday:on(Yl)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:Ui("Укажите место рождения"),education:qi("Выберите ваше образование"),housing:qi("Выберите тип жилья"),amountWorkers:qi("Выберите информацию о количестве сотрудников"),employment:qi("Выберите информацию о трудоустройстве"),employerActivities:qi("Выберите вид деятельности организации"),employerOrganization:qi("Выберите вид организации"),positionOrganization:qi("Выберите вашу должность"),familyStatus:qi("Выберите семейное положение"),familyMembers:Hl(2,"Укажите количество членов семьи"),children:Hl(2,"Укажите количество детей"),dependents:Hl(2,"Укажите количество иждивенцев"),totalIncome:Hl(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Hl(10,"Укажите сумму обязательных выплат"),snils:(e=>on(Kl)(e))("Некорректный номер СНИЛС"),conscription:Ui(),armyIdFlg:Gi,dulSerie:(e=>on((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:Gl("Укажите номер паспорта"),dulIssueDate:Ui("Укажите дату выдачи паспорта"),dulSubdivisionCode:Gl("Укажите код подразделения"),dulIssuedBy:Ui("Укажите организацию, выдавшую паспорт"),participantDateRegistration:Ui("Укажите дату регистрации"),retirementIncome:Ui(),otherIncome:Ui(),wages:Ui(),mandatoryPayments:Ui(),bankruptcyFlg:Ui(),shareholderFlg:Ui(),legalEntityName:Ui(),bankEmployeeCode:Ui(),partInBusiness:Ui(),regionRetail:qi("Выберите регион"),latinSurname:Ui("Укажите фамилию")},Ql={...Zl,...Jl,...Xl},er={credit:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},creditCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:19},consentInformMaterialsFlg:{text:"Согласие на получение информационных материалов",docId:18},consentPhotoFlg:{text:"Согласие на фотографирование",docId:17}},debitCard:{processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:20},consentFATCA:{text:"Форма самосертификации",docId:10}}},tr=e=>e?.value||"",nr=e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=tr}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`,c=globalThis?.fetch?.(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(r);return c},ar={url:"suggest/address"},ir={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:ar,addressFact:ar,organizationAddress:ar,addressCourier:ar},lr=d((({options:e,container:t,onChange:n})=>{const[l,r]=a(-1),s=t=>{const a=e.length-1;"ArrowDown"===t.key?r(l<a?l+1:0):"ArrowUp"===t.key?r(l>0?l-1:a):"Enter"===t.key&&e[l]&&(t.preventDefault(),n(e[l]))};return i((()=>(t.addEventListener("keydown",s),()=>t.removeEventListener("keydown",s))),[l]),o("div",{className:"bg-white text-l overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,t)=>o("div",{className:u("flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",{"bg-main-divider":l===t}),role:"listitem",onMouseDown:()=>n(e),children:o("span",{className:"min-h-6",children:e.processedValue})},t.toString())))})}));function rr({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=Pn(),x=ir[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c?.(e.processedValue),d?.(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await nr({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(lr,{options:p,container:n,value:t,onChange:b}),top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,b]),v}const sr=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=yn,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:S}]=ln(),k=fn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[w,d]);i((()=>{y&&n&&d(or(n))}),[n]);const T=rr({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(wn,{disabled:N,type:g||"text","aria-label":t,label:xn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:cr(a,s,t)})}),Sn(r)]})})),or=(e="")=>e.replace(/[^\d]+/g,""),cr=(e,t,n)=>t&&!n?`${e}*`:e,dr=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(mr(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(sr,{disabled:t?.filledByEsia&&ui(e,n),label:"Адрес",...e(n),value:a?.fullAddress,onChange:r,...t,onDaDataChange:i})})),mr=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),ur=Lt((({field:e,input:t,source:n})=>{const[r,s]=a(""),c=e("addressCourier")?.value,d=c?.locality,m=c?.city;i((()=>{!m&&!d||n?.deliveryCities?.includes(m)?s(""):(e?.("addressCourier")?.onChange?.({...c,house:""}),s("Город недоступен для доставки"))}),[m,d,n]);const u=l((t=>{e?.("addressCourier")?.onChange?.(mr(t))}),[]),h=l((t=>{e?.("addressCourier")?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(sr,{label:"Адрес",...e("addressCourier"),value:c?.fullAddress,onChange:h,...t,error:r||e("addressCourier")?.error,onDaDataChange:u})})),hr=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(sr,{label:"Адрес",disabled:r,...e(n),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),pr=d((({field:e,input:t})=>o(ri,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...e(t?.name??"")}))),gr=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:fr({textItems:l,subText:t,children:n,isPhone:a,...i})})),fr=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Oe,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||xr(n,s),i?o(Oe,{color:a,size:"text-m",children:i}):null]}),xr=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Oe,{size:"text-l",children:t?o("a",{href:`tel:${yr(e)}`,children:e.trim()}):e.trim()},String(n)))),yr=e=>e.replace(/\D/g,""),br=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),vr=d((({className:e,children:t})=>o("span",{className:u("inline-flex items-center text-start gap-s group-[]/btn-embedded:text-primary-main",e),children:t}))),Nr=d((({isUnfolded:e,...t})=>o(G,{name:e?"ArrowUpIcon":"ArrowDownIcon",size:"small",iconVersion:"",...t}))),wr=d((({className:e,isUnfolded:t,short:n,label:a=(t?"Скрыть":"Развернуть"),embedded:i,...l})=>c(wl,{className:u({"w-full":!n},e),embedded:i,shape:n?"default":"square",role:"tab","aria-label":"Кнопка сворачивающейся секции",...l,children:[o(vr,{children:a}),o(Nr,{isUnfolded:t,iconVersion:i?"color":""})]}))),Cr=d((({className:e,role:t="tablist",children:n})=>o("div",{className:u(e),role:t,children:n})));const Sr=d((({className:e,isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:u("transition-max-h duration-300 overflow-hidden",{"max-h-0":Boolean(a.current||!t)}),role:"tabpanel","aria-label":"Сворачивающаяся секция",children:o("div",{className:e,ref:l,children:n})})})),kr=d((({children:e})=>{const[t,{toggle:n}]=ln(!1);return c("div",{children:[o("div",{className:"hidden sm:block",children:e}),c(Cr,{className:"block sm:hidden",children:[o(Sr,{isUnfolded:t,children:e}),o(wr,{className:"my-m mr-m border-b border-solid border-main-divider",label:t?"Скрыть":"Подробнее",isUnfolded:t,embedded:!0,onClick:n})]})]})})),Ir=e=>{const t=Rr(e);return o(gr,{label:"Режим работы",value:t,className:"max-w-none"})},Tr=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Rr=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))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Tr({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Tr({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Pr=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Br=e=>Pr.map((([t,n,a])=>({key:t,title:a,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??"")}}))),Er=e=>{if(!e)return null;const t=_r(e);return c(br,{className:"border-none",children:[o(gr,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Dr)})}),o(gr,{label:"Режим работы",className:"max-w-none",children:o(Oe,{children:e})})]})},_r=e=>{const t=Pr.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},Dr=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Oe,{size:"text-xs",children:e})},String(n)),Ar=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(gr,{label:"Валюта",value:e.currency}):null,t?o(gr,{label:"Купить",value:String(t)}):null,n?o(gr,{label:"Продать",value:String(n)}):null]},String(a)),Mr={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"}},Or=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",Mr[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ie,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Oe,{size:"text-m",color:Mr[n].text,children:t})]}))),zr=(new Date).getDay(),Vr=e=>{const[t]=e?.slice(zr-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Or,{color:"green",children:i}):null,n&&l?o(Or,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Or,{color:"red",children:"Выходной"})},Fr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Lr=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(gr,{label:e,value:t&&n?n:"",subText:Fr({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),jr=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,$r=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ur=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,qr=(e,t)=>{if(!e.workSchedule)return null;const n=Br(e.workSchedule);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Oe,{size:"text-h4",children:e.name}),e.address?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Oe,{size:"text-l",children:e.address})]}):null]}),Vr(n)]}),o(kr,{children:Wr(e)})]},String(t))},Wr=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=Br(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(br,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(gr,{label:"Факс",value:t,isPhone:!0}),o(gr,{label:"Телефон филиала",value:e,isPhone:!0}),o(gr,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(gr,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(gr,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(gr,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(br,{children:o(gr,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Lr)})})}):c(br,{children:[o(gr,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Dr)})}),Ir(d)]}),r?.businessScheduleVisibleTag?Er(r?.businessScheduleDescription):null,s?.currencies?.length?o(br,{className:"flex-wrap",children:s?.currencies?.map(Ar)}):null]})},Hr=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=Br(e),n=e?Rr(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?jr(n):Ur(n,a):$r(n):""})(n)}`;return{header:a,body:l}},Yr={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Gr={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Kr={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},Xr=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Kr[t](e)))))},Jr=()=>{},Zr=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=Jr,getBalloonRemoteWorkplaces:i=Jr})=>{const[l,s,o,c]=r((()=>{const l=Xr(e,n),r=Xr(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Qr=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),es=d((({children:e})=>Qr?e:null)),ts="/icons/MapMarkerClusterIcon.svg",ns="/icons/MapMarkerClusterYellowIcon.svg";function as({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=is("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=is("workplaces",e,i),r=ls(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=ls(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=ls(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const is=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?ts:ns,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),ls=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?ts:ns,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),rs={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},ss={...rs,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},os=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(ss).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(G,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),cs=e=>globalThis[e],ds=(e,t,n=!1)=>{const a=globalThis.document.getElementById(t);if(a){const t=cs(e);return t?Promise.resolve(t):new Promise((t=>{a.addEventListener("load",(()=>{t(cs(e))}))}))}return new Promise(((a,i)=>{const l=globalThis.document.createElement("script");l.src=t,l.async=!0,l.id=t,n&&(l.type="module"),l.addEventListener("load",(()=>{a(cs(e))})),l.addEventListener("error",(e=>{i(e)})),globalThis.document.head.appendChild(l)}))};const ms=()=>function(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return ds(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=globalThis.document.getElementById(t);e&&globalThis.document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),us={...rs,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},hs=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(us).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(G,{name:n,width:"20",height:"16"})})})),ps=[55.753995,37.614069],gs=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=ms();if(i((()=>{r.current?as({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:fs(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),as({yandexMaps:m,map:r.current,points:e,isLoad:a})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,a,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o(_l,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(hs,{yandexMaps:r}),o(hs,{yandexMaps:r,direction:"out"})]}),os(r,m,u("right-2 top-80",h))]})})),fs=e=>{const t=[ys(xs(e,0)),ys(xs(e,1))];return t.every((e=>e))?t:ps},xs=(e,t)=>e.map((e=>e.coords?.[t])),ys=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,bs=async(e,t,n)=>{try{return(await vs(e,t,n)).json()}catch(e){return console.error(e),null}};async function vs(e,t,n){const a=(()=>{const e=new Uint8Array(8);return globalThis.crypto.getRandomValues(e),e.reduce(((e,t)=>`${e}${t.toString(16).padStart(2,"0")}`),"")})();return globalThis?.fetch?.(`/light-api-cash/v1${e}`,{method:t,headers:{"Content-Type":"application/json","X-B3-Sampled":"1","X-B3-Spanid":a,"X-B3-Traceid":a,...Ns()},credentials:"include",body:n?JSON.stringify(n):null})}const Ns=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ws=e=>Number(e.toString().replace(",",".")),Cs=e=>{const{data:t,error:n}=Hn(`/light-api-cash/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Ss);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Ss=async e=>await _t(e,{method:"POST"})||[],ks=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=Cs("REGION_RF"),s=e("regionRetail")?.value||{},d=e(t?.name??"");i((()=>{(async()=>{const e=await(async e=>{const t=await bs("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:ws(e.latitude??ps[0]),gpsLongitude:ws(e.longitude??ps[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&d.onChange?.("")}),[s.key]);const{points:m}=Zr({data:n,filtrationState:{},getBalloon:Hr});return c("div",{children:[o(On,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...d,isSearch:!0}),o("div",{className:"h-[600px]",children:o(es,{children:o(gs,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})}));function Is(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}function Ts(e,t){return Is(e,t),Is(t,e),e.bus.watch((({type:e,event:n})=>{null!=n?t.setItem(e,n):t.removeItem(e)}))}class Rs{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new he){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}class Ps{bus;store=new Map;get size(){return this.store.size}constructor(e=new he){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}}const Bs={};function Es(e,t=Bs){const n=s(null),o=function(){const[,e]=a(0);return l((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const _s=new Ps;function Ds(e){return Es(_s,e)}Ts(_s,new Rs(globalThis?.localStorage));const As=()=>Ds(),Ms=Lt((({field:e,source:t,fieldName:n,placeholder:a="Выберите из списка",options:i,...l})=>{const r=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(On,{placeholder:a,options:r,...e(n),...l})})),Os=d((({field:e,input:t})=>{const{data:n}=Cs("EMPLOYEES_NUMBER"),a=As();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(Ms,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),zs=d((({field:e,input:t})=>o(ri,{text:"Наличие военного билета",...e(t?.name??"")}))),Vs=d((({field:e,input:t})=>o(sr,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...e(t?.name??""),...t}))),Fs=d((({field:e,input:t})=>o(ri,{text:"В отношении меня ведётся производство по делу о банкротстве",...e(t?.name??"")}))),Ls=d((({field:e,input:t})=>o(La,{label:"Дата начала работы на текущем месте",...e(t?.name??""),...t}))),js=d((({field:e,input:t})=>o(sr,{label:"Место рождения",...e(t?.name??""),...t,disabled:t?.filledByEsia&&ui(e,"birthPlace")}))),$s=e=>{try{return JSON.parse(String(e))}catch(e){return null}};const Us=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black"})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(G,{name:t,width:"24",height:"24",iconVersion:n})}),o("div",{className:"",children:o(Ae,{__html:e})})]}))),qs=d((({field:e,input:t})=>{const[n,s]=a([]),[d]=function(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?$s(t):null);return[n,l((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}("programId"),{value:m,onChange:u}=e("cardCategory"),h=e("paymentSystem")?.value?.key;i((()=>{h&&d&&(async()=>{const e=await(async(e,t)=>{const n=await bs("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(h,d);s(e),Ws(e,m)||u&&u(null)})()}),[h]);const p=r((()=>n?.find((e=>e.key===m?.key))?.description),[n,m]);return c("div",{children:[o(Ms,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t}),p?o(Us,{__html:p}):null]})})),Ws=(e,t)=>e.some((e=>e.key===t?.key)),Hs=d((({field:e,input:t})=>o(sr,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Ys=d((({field:e,input:t})=>o(sr,{label:"Кодовое слово",...e(t?.name??""),...t}))),Gs=d((({field:e,input:t})=>{const{data:n}=Cs("INCOME_CERT_UNITED");return o(Ms,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Ks=d((({field:e,input:t})=>{const{data:n}=Cs("MILITARY_STATUS");return o(Ms,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),Xs=()=>Ds(),Js=d((({src:e,onClose:t,onDocumentRead:n})=>{const a=Te();return c(Sl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0 z-[101]",onClose:t,children:[a?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(wl,{className:"mx-auto mt-m",type:"button",onClick:()=>{n?.(),t?.()},children:"Ознакомиться"})]})})),Zs=(e,t)=>{const{open:n}=pn(Js),a=Te();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await vs(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},Qs=d((({className:e,error:t,docId:n,...a})=>{const i=Zs(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ti,{...a}),n?o(wl,{embedded:!0,onClick:i,children:o(vr,{children:"Ознакомиться"})}):null]}),Sn(t)]})})),eo=d((({field:e,input:t})=>{const{productType:n}=Xs(),a=er[n??""];return t&&t.name?o(Qs,{text:a?.[t.name]?.text,docId:a?.[t.name]?.docId,...e(t.name)}):null})),to=Math.round(29.5),no=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),ao="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",io="flex flex-col lg:w-1/2 gap-2xl",lo="flex flex-col gap-y-xl min-w-52",ro=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Oe,{size:"text-h3",children:"number"==typeof e?[a,Ge(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),so=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Oe,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(ro,{value:n,...i}):o(Oe,{size:"text-h3",children:"-"})]}))),oo=e=>mo([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],e),co=(e=[],t=!1,n=[])=>({...mo([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),extraPercent:n.at(-1),extraPercents:n}),mo=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},uo=(e,t=0)=>e?.sum?e.sum:t,ho=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,po=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,go=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ra,{items:[`От ${fo(e)}`,`До ${fo(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),fo=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,xo=({items:e,title:t,orientation:n="horizontal",value:a,onChange:i,...l})=>c("div",{className:"grid gap-s whitespace-nowrap lg:sm:col-span-1 col-span-2",children:[t?o("div",{role:"radiogroup","aria-label":t,children:o(Oe,{color:"text-secondary-text",font:"font-light",children:t})}):null,o(dl,{orientation:n,items:e,value:e[a?0:1].id,onChange:t=>i&&i(t===e[0].id),...l})]}),yo=e=>xo({...e,title:"Тип платежа",orientation:"vertical",className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),bo=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ra,{items:e?[`От ${Ge(1)(a.min||0)} ${n}`,`До ${Ge(1)(a.max||0)} ${n}`]:[],step:t,...a}),vo=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(ta(t?.[i],n.minMonths,n.maxMonths))},No=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},wo=e=>e,Co=(e=wo)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),So=Co(),ko=(e=wo)=>Co((t=>-e(t))),Io=ko(),To=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Ro([e,t],a),Ro=([e,t],n=[])=>({[e]:n.length?Io(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?So(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Po=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Bo={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Eo=e=>_o({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&_o({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&_o({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&_o({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),_o=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Do=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[Bo],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Eo({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=To(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=To(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>Eo({row:e,userInputParams:t,paramsViewSettings:n})&&Po(a,["minSum","maxSum"],e)&&Po(i,["minMonths","maxMonths"],e)))||Bo)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=No(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},Ao=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Mo={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Oo=Lt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=oo(n?.rateRows),[p,{field:g}]=un({moneyValue:uo(s,2e5),monthsValue:ho(s,to),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)},{onChange:d}),f=Do(p,n,r),x=yo({...g("isAnnuity")}),{onChange:y}=g("moneyValue"),{onChange:b}=g("monthsValue");return i((()=>{y&&y(ta(p.moneyValue,f.minSum,f.maxSum))}),[f.minSum,f.maxSum]),i((()=>{b&&b(ta(p.monthsValue,f.minMonths,f.maxMonths))}),[f.minMonths,f.maxMonths]),i((()=>{!Ao(s)&&h&&vo({field:g,defParams:h,calcParams:f,map:Mo,monthsValue:"minMonths"})}),[n,s]),o(no,{className:e,title:t,...m,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Сумма кредита, ₽",step:500,min:f.minSum,max:f.maxSum,...g("moneyValue"),value:f.moneyValue}),go({title:"Срок кредита, месяцев",min:f.minMonths,max:f.maxMonths,...g("monthsValue"),value:f.monthsValue}),zo({...f,...r},g),o("div",{className:"sm:hidden",children:x})]}),c("div",{className:u(lo,"@4xl:w-1/2"),children:[o(so,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(so,{title:"Ставка от",value:h?.rate,fractionDigits:2,postfix:"%"}),o(so,{title:"Ежемесячный платёж",value:f.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:x}),qe(a,{isVertical:!0}),po(l)]})]})})})),zo=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ti,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ti,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ti,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ti,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Vo="calculator",Fo=d((({field:e,params:t})=>{const n=l((t=>{e(Vo).onChange?.(t)}),[]);return o(Oo,{...t?.calcData,padding:"p-0",defaultParams:jo(e(Vo).value),onChange:n})})),Lo={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},jo=(e,t=!1)=>{const n=t?$o(Lo):Lo;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},$o=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Uo=d((({field:e,input:t})=>{const{data:n}=Cs("CREDIT_IN_RSHB");return o(Ms,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),qo={17:"amur_debit_card",16:"owner_debit_card",18:"pansion_debit_card",38:"salary_debit_card",40:"vordi_debit_card",42:"eco_debit_card",43:"junior_debit_card",44:"appetit_debit_card"},Wo=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(dl,{label:xn({label:t,errors:a?.errors}),...a}),Sn(n)]}))),Ho=[{id:"810",text:"Рубли"}],Yo=d((({field:e,input:t})=>{const{data:n}=Cs("CURRENCY"),{programId:a}=Xs(),i=r((()=>!Object.keys(qo).includes(a||"")||"38"===a),[]),l=r((()=>i?Ho:n?.map((e=>({id:e.key??"",text:e.description})))),[n]);return o(Wo,{label:"Валюта",orientation:"horizontal",items:l,...e(t?.name??"")})})),Go=(e,t)=>{if(!t)return null;const n=Zo(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},Ko=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},Xo=(e,t)=>{const n=Zo(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},Jo=(e,t,n)=>{const a=Zo(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},Zo=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Qo=(e,t,n)=>{const{okved:a,okopf:i,inn:l,organizationName:r}=ec(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(mr(n.data?.address));const s={amountWorkers:Ko(e?.amountWorkers,n.data?.employee_count),employerActivities:Go(e?.employerActivities??[],a),organization:Jo(e?.organization??[],i,l),employerOrganization:Xo(e?.employerOrganization??[],i),organizationName:r};for(const e in s)s[e]&&t?.(e)?.onChange?.(s[e])},ec=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??"",organizationName:e.data?.name?.short_with_opf??""}),tc=d((({field:e,input:t})=>{const n=As(),{employerActivities:a,employerOrganization:r,organization:s,amountWorkers:c}=n,d=e?.("esiaAccountTypeCd")?.value,m=e?.("inn")?.value,u=l((t=>{Qo(n,e,t)}),[]);return i((()=>{d&&m&&a&&r&&s&&c&&(async()=>{const t=await(async e=>{const t=await nr({url:"suggest/party",query:e});return t?.[0]})(m);t&&Qo(n,e,t)})()}),[a,r,s,c]),o(sr,{label:"ИНН",isInteger:!0,maxLength:12,...t,...e(t?.name??""),onDaDataChange:u})})),nc=d((({field:e,input:t})=>o(La,{label:"Дата доставки",...e(t?.name??"")}))),ac=d((({field:e,input:t})=>{const{data:n}=Cs("COURIER_DELIVERY_TIME"),a=r((()=>n?.map((e=>({id:e.key,text:e.value})))??[]),[n]);return o(Wo,{label:"Время доставки",className:"flex-row",items:a,...e(t?.name??"")})})),ic=d((({field:e,input:t})=>o(sr,{label:"Количество иных иждивенцев",placeholder:"За исключением детей до 18 лет",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),lc=d((({field:e,input:t})=>o(La,{label:"Дата выдачи",...e(t?.name??""),disabled:t?.filledByEsia&&ui(e,t?.name??"")}))),rc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(sr,{disabled:t?.filledByEsia&&ui(e,t?.name??""),label:"Кем выдан",...t,...e(t?.name??""),onDaDataChange:i,daDataQueryPrefix:n})})),sc=d((({field:e,input:t})=>o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Номер документа",isInteger:!0,maxLength:6,...e(t?.name??"")}))),oc=d((({field:e,input:t})=>o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Серия документа",isInteger:!0,maxLength:4,...e(t?.name??"")}))),cc=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(sr,{disabled:t?.filledByEsia&&ui(e,t.name??""),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...e(t?.name??""),onDaDataChange:n})})),dc=d((({field:e,input:t})=>{const{data:n}=Cs("EDUCATION_LEVEL");return o(Ms,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),mc=d((({field:e,input:t})=>o(sr,{label:"Электронная почта",...e(t?.name??""),...t}))),uc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_ACTIVITY_TYPE"),a=As();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(Ms,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),hc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_KIND"),a=As();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(Ms,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),pc=d((({field:e,input:t})=>{const{data:n}=Cs("EMPLOYMENT_INFO_UNITED");return o(Ms,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),gc=d((({field:e,input:t})=>o(sr,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),fc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ta(Number(n),0,5)))),[]);return o(sr,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...e(t?.name??""),...t,onChange:n})})),xc=d((({field:e,input:t})=>{const{value:n,onChange:a}=e(t?.name??""),l=e("familyStatus")?.value?.key,r="MARRIED"===l?2:1,s=Number(e("children")?.value),c=Number(e("dependents")?.value),d=r+s+c;return i((()=>{a?.(d)}),[l,s,c]),o(sr,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:n,onChange:a})})),yc=d((({field:e,input:t})=>{const{data:n}=Cs("MARITAL_STATUS");return o(Ms,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),bc=d((({field:e,input:t})=>o(sr,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...e(t?.name??""),...t}))),vc=d((({field:e,input:t})=>{const{data:n}=Cs("HOUSE_TYPE");return o(Ms,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Nc=d((({input:e})=>o(Us,{__html:e?.label}))),wc=d((({field:e,input:t})=>o(sr,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...e(t?.name??""),...t}))),Cc=d((({field:e,input:t})=>o(sr,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...e(t?.name??""),...t}))),Sc=/^[\u0041-\u005A\u0061-\u007A\s]+$/u,kc=(e="")=>Sc.test(e),Ic=e=>{const t={"А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ё":"E","Ж":"ZH","З":"Z","И":"I","Й":"I","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"KH","Ц":"TS","Ч":"CH","Ш":"SH","Щ":"SHCH","Ъ":"IE","Ы":"Y","Ь":"","Э":"E","Ю":"YU","Я":"YA","":"","а":"A","б":"B","в":"V","г":"G","д":"D","е":"E","ё":"E","ж":"ZH","з":"Z","и":"I","й":"I","к":"K","л":"L","м":"M","н":"N","о":"O","п":"P","р":"R","с":"S","т":"T","у":"U","ф":"F","х":"KH","ц":"TS","ч":"CH","ш":"SH","щ":"SHCH","ъ":"IE","ы":"Y","ь":"","э":"E","ю":"YU","я":"YA",".":".",",":",","-":"-"," ":" "};return e.replace(/[А-ЯЁа-яё,. -]/g,(e=>t[e.toLowerCase()].toUpperCase()||""))},Tc=d((({field:e,input:t})=>{const n=e("latinSurname")?.value,a=e("name")?.value,r=e("latinName")?.onChange;i((()=>{r?.(Ic(a))}),[]);const s=l((e=>{(kc(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(kn,{label:"Имя",placeholder:"Имя латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Rc=d((({field:e,input:t})=>{const n=e("latinName")?.value,a=e("surname")?.value,r=e("latinSurname")?.onChange;i((()=>{r?.(Ic(a))}),[]);const s=l((e=>{(kc(e)||0===e.length)&&r?.(e.toUpperCase())}),[]);return o(kn,{label:"Фамилия",placeholder:"Фамилия латинскими буквами",maxLength:Math.max(20-n?.length,1),...e(t?.name??""),onChange:s,...t})})),Pc=d((({field:e,input:t})=>o(sr,{label:"Наименование юридического лица",...t,...e(t?.name??""),disabled:!e?.("shareholderFlg")?.value}))),Bc=d((({field:e,input:t})=>o(sr,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...e(t?.name??""),...t}))),Ec=d((({field:e,input:t})=>o(La,{label:"Дата рождения",...e(t?.name??""),disabled:t?.filledByEsia&&ui(e,t.name??"")}))),_c=d((({field:e,input:t})=>o(sr,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Dc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Ac=d((({field:e,input:t})=>o(Wo,{orientation:"horizontal",items:Dc,...e(t?.name??"")}))),Mc=d((({field:e,input:t})=>o(sr,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&ui(e,t?.name??""),...e(t?.name??""),...t}))),Oc=d((({field:e,input:t})=>o(sr,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&ui(e,t.name??""),...e(t?.name??""),...t}))),zc=d((({field:e,input:t})=>{const{data:n}=Cs("ORGANIZATION_TYPE"),a=As();return i((()=>{n&&(a.organization=n)}),[n]),o(Ms,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),Vc=d((({field:e,input:t})=>{const n=As(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),Qo(n,e,t)}),[]);return o(sr,{label:"Наименование организации",...t,...e(t?.name??""),onDaDataChange:a})})),Fc=d((({field:e,input:t})=>o(sr,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Lc=d((({field:e,input:t})=>o(La,{label:"Дата регистрации по месту жительства",...e(t?.name??"")}))),jc=d((({field:e,input:t})=>{const n=l((n=>e(t?.name??"")?.onChange?.(String(ta(Number(n),0,100)))),[]);return o(sr,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...e(t?.name??""),...t,onChange:n})}));const $c=e=>e.map((e=>({key:e.type,text:e.name}))),Uc=e=>e?.key,qc=d((({field:e,input:t})=>{const[n,l]=a([]),s=Ds();var c;c=async()=>{const{programId:e}=s;if(e){const t=await(async e=>{const t=await bs("/public-data/creditProgramConditions","POST",{creditProgramId:e});return $c(t?.paymentSystems||[])})(e);l(t??[])}},i((()=>{const e=c();return()=>{e.then((e=>{e instanceof Function&&e()}))}}),[]);const d=r((()=>n?.map((e=>({id:e.key,text:e.text})))??[]),[n]);return o(Wo,{label:"Платежная система",orientation:"horizontal",items:d,...e(t?.name??"",{format:Uc,parse:e=>n?.find((t=>t.key===e))})})})),Wc=d((({field:e,input:t})=>{const{data:n}=Cs("POSITION");return o(Ms,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Hc=async()=>await bs("/public-data/regionsCardDelivery","GET")||void 0,Yc=d((({field:e,input:t})=>{const{data:n}=Cs("REGION_RF"),{data:a}=Hn("regionsDelivery",Hc),{programId:i}=As(),r="38"===i,s=n?.map((({key:e,value:t})=>({key:e,text:t}))),c=e("regionRetail")?.onChange,d=e("regionHasDelivery")?.onChange,m=e("methodObtain")?.onChange,u=l((e=>{const t=a?.find((t=>t.regionCode===e.key))?.deliveryFlg&&!r;d?.(t),m?.(t?"courier":"office"),c?.(e)}),[a]);return o(On,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:s,...e(t?.name??""),onChange:u})})),Gc=d((({field:e,input:t})=>o(sr,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),Kc=["male","female"],Xc=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Jc=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:l}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await nr({url:"suggest/fio",requestData:{parts:["NAME"]},query:e}),n=t[0]?.data?.gender?.toLowerCase()||"";return Kc.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(Wo,{label:"Пол",orientation:"horizontal",items:Xc,...e(t?.name??"")})})),Zc=d((({field:e,input:t})=>o(ri,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...e(t?.name??"")}))),Qc=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=l((e=>n?e.length<=n&&t?.(Ca(e,"___-___-___ __")):t?.(Ca(e,"___-___-___ __"))),[t]),r=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(wn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>r(e?.target?.value||""),children:e})})),ed=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Qc,{"aria-label":t,label:xn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __",...r}),Sn(a)]}))),td=d((({field:e,input:t})=>o(ed,{label:"СНИЛС",maxLength:14,...e(t?.name??""),...t}))),nd=d((({field:e,input:t})=>o(sr,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&ui(e,"surname"),...e(t?.name??""),...t}))),ad=d((({field:e,input:t})=>o(sr,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),id=d((({field:e,input:t})=>o(sr,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...e(t?.name??""),...t}))),ld={$ref:"/wcms-resources/delivery-cities-data.json"},rd={limitedBirthday:Ec,name:Oc,surname:nd,middleName:Mc,email:mc},sd={processPersonalDataFlg:eo,consentProviderFlg:eo,consentOthersFlg:eo,consentInformFlg:eo,consentPfrFlg:eo,consentInformMaterialsFlg:eo,consentPhotoFlg:eo,consentFATCA:eo},od={organization:zc,organizationAddress:dr,organizationPhone:Ti,organizationName:Vc,legalForm:Bc,generalSeniority:bc,lastJobExperience:Cc,experience5Years:fc,jobsNumber:wc,beginDate:Ls,addressFact:hr,addressRegistration:dr,addressRetail:ks,addressMatch:pr,sex:Jc,limitedBirthday:Ec,birthPlace:js,education:dc,housing:vc,amountWorkers:Os,employment:pc,employerActivities:uc,employerOrganization:hc,positionOrganization:Wc,familyStatus:yc,familyMembers:xc,children:Hs,dependents:ic,totalIncome:ad,expenses:gc,snils:td,conscription:Ks,armyIdFlg:zs,dulSerie:oc,dulNumber:sc,dulIssueDate:lc,dulSubdivisionCode:cc,dulIssuedBy:rc,participantDateRegistration:Lc,retirementIncome:Gc,otherIncome:Fc,wages:id,mandatoryPayments:_c,bankruptcyFlg:Fs,shareholderFlg:Zc,legalEntityName:Pc,creditInRshbCd:Uo,bankEmployeeCode:Vs,partInBusiness:jc,regionRetail:Yc,infoCard:Nc,calculator:Fo,confirmationIncome:Gs,inn:tc},cd={addressCourier:e=>o(ur,{...e,source:ld}),paymentSystem:qc,currency:Yo,cardCategory:qs,codeWord:Ys,methodObtain:Ac,deliveryDate:nc,latinName:Tc,latinSurname:Rc,deliveryTime:ac},dd="Согласие на все документы",md=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=l((n=>{for(const a of e){const e=t(a.name);e.onChange?.(n)}}),[e]),s=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Vi(t(e?.name),Gi).error)))),[e]),[d,{toggle:m}]=ln(!0);return o("div",{className:"w-fit",children:c(Cr,{children:[c("div",{className:"flex items-start",children:[c("div",{children:[o(ti,{text:dd,value:a,onChange:i},n),Sn(s?"Отметьте все обязательные соглашения":"")]}),o(wl,{embedded:!0,ariaLabel:dd,onClick:m,children:o(Nr,{className:"p-2xs",iconVersion:"color",isUnfolded:d})})]}),o(Sr,{className:"flex flex-col pl-2xl",isUnfolded:d,children:e.map(fl(t,{},sd))})]})})})),ud=({field:e,inputs:t},n)=>{const{consentInputs:a,restInputs:i}=hd(t||[],n);return a.length>2?c("div",{children:[i.map(fl(e,{},{...rd})),o(md,{inputs:a,field:e})]}):(t||[])?.map(fl(e,{},{...rd}))},hd=(e,t)=>({consentInputs:e.filter((({name:e})=>Object.keys(er[t]).includes(String(e)))),restInputs:e.filter((({name:e})=>!Object.keys(er[t]).includes(String(e))))}),pd=(e,t=!1)=>o(Dl,{className:"w-full @xl:w-auto",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),gd=e=>vs("/user-data/updateUserProfile","PUT",e),fd=e=>vs("/user-data/updateUserTask","PUT",e),xd=d((({className:e,seconds:t})=>o("span",{className:e,children:yd(t)}))),yd=e=>[Math.floor(e/60),e%60].map((e=>String(e).padStart(2,"0"))).join(":"),bd=(e,t)=>{const n=s(null),a=l((()=>clearInterval(n.current)),[]),r=l((()=>{a(),n.current=setInterval((()=>e(a)),t)}),[e,t,a]);return i((()=>(r(),a)),[r,a]),{start:r,stop:a}};function vd({seconds:e,period:t=1e3,onTick:n,onEnd:a}){const i=s(e),r=l((e=>{i.current||=0,i.current=Math.max(0,i.current-1);try{n?.(i.current)}finally{i.current<=0&&(e(),a?.())}}),[n,a]),{start:o}=bd(r,t);return l((e=>{i.current=e,o()}),[])}const Nd={width:"103",height:"21"},wd={"bg-white":"color",transparent:"white"},Cd={"bg-white":"text-primary-main",transparent:"text-white"},Sd=(e,t,n)=>o(ie,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:wd[e]},className:Cd[e],width:n?.width,height:n?.height}),kd={"bg-white":"text-primary-text",transparent:"text-white"},Id=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ye(s),children:[Sd(l,n?.image,Nd),r?a??o("div",{className:"ml-s",children:o(Oe,{font:"font-medium",color:kd[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Td=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1),[p,{setTrue:g,setFalse:f}]=ln(!1),x=l((async()=>{g();var e;await(e={captchaText:d},vs("/sms/checkCaptcha","POST",e).then((e=>e.text())).then((e=>"ERROR"!==e)))?(n?.(),t?.()):h(!0),f()}),[d,t]),y=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>vs(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(y,[]),o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Id,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o(wl,{className:"w-8",embedded:!0,onClick:y,children:o(G,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(wn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(wl,{version:"secondary",onClick:close,children:"Вернуться"}),o(Dl,{version:"secondary",disabled:!d,onClick:x,children:"Отправить"})]}),p?o(_l,{blur:!1}):null]})})})),Rd=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=l((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Pd(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Pd=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${vn(!n||!a)} rounded-md caret-transparent outline-none`},Bd=d((({isDisabled:e,onClick:t,text:n})=>o(wl,{type:"button",onClick:t,disabled:e,children:o(Oe,{font:"font-normal",children:n})}))),Ed=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},_d=({values:e,onSuccess:t})=>{const[n,r]=a(""),[s,{setTrue:o,setFalse:c}]=ln(!1),[d,m]=a(0),[u,h]=a(!1),[p,g]=a(0),f=l((()=>r("")),[]),x=Boolean(0===d&&u),y=p>2||x||!e.every(Boolean),b=l((async()=>{try{h(!1),m(0),g((e=>e+1)),o(),await(async e=>bs("/sms/checkCode","POST",e).then(Ed))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),f(),await(t?.(e.join("")))}catch{r(p>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{c()}}),[e,p]);return i((()=>{r(x?"Код просрочен":"")}),[x]),{handleSubmit:b,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:d,isSubmitButtonDisabled:y,setTimeNextReq:m,setIsTimerStarted:h,setAttempts:g}},Dd=d((({phone:e,code:t=!0,withDescription:n=!0,codeLength:r=4,consents:s,onSuccess:d=yn,onClose:m=yn})=>{const[u,h]=a(Array(r).fill("")),{handleSubmit:p,hasError:g,errorText:f,isLoading:x,timeNextReq:y,isSubmitButtonDisabled:b,setTimeNextReq:v,setIsTimerStarted:N,setAttempts:w}=_d({values:u,onSuccess:d}),C=pn(Td),S=Wt(e),I=vd({seconds:y,onTick:v}),T=l((async()=>{var e;await(e={phoneNumber:S,smsCodesSetName:{key:"AUTHENTICATION"}},vs("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(w(0),v(180),I(180),N(!0)):C.open({phoneNumber:S,sendCode:T})}),[S,I,m]);return i((()=>{T()}),[]),o(Sl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:m,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Rd,{values:u,setValues:h,errorText:f,hasError:g}):null,Md(y,T),n?c(Ae,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:s?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}):null,Ad(b,p),x?o(_l,{blur:!1}):null]})})})),Ad=(e,t)=>o(Bd,{text:"Далее",isDisabled:e,onClick:t}),Md=(e,t)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(xd,{className:"ml-1",seconds:e})]}):o(wl,{embedded:!0,onClick:t,children:o(vr,{children:"Получить новый код"})}),Od={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},zd={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Vd=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Fd=d((({onSubmit:e=yn,onClose:t=yn})=>{const[n,i]=a(""),[r,s]=a(!1),d=Zs(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),s("REFUSE"===e)}),[]),h=r?zd:Od;return o(Sl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(dl,{className:"whitespace-normal",orientation:"horizontal",items:Vd,value:n,onChange:u}),o(wl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),Ld=d((({title:e,icon:t,description:n,onClick:a=yn})=>c("button",{className:"flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ie,{image:{icon:t,iconVersion:"normal"},width:"78",height:"78"}),c("div",{className:"flex flex-col items-start gap-xs md:w-72 md:mr-lg",children:[o(Oe,{font:"font-medium",size:"text-s",children:e}),n?o(Oe,{color:"text-secondary-text",size:"text-xs",children:n}):null]})]}))),jd={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},$d={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},Ud={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},qd=e=>Object.entries(e).reduce(((e,[t,n])=>t in jd?[...e,{contactTypeCd:{key:jd[t]},value:n}]:e),[]),Wd=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in $d){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:$d[t]},...a}]}return e}),[]),Hd=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:l,wages:r,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:l,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(f={wages:r,mandatoryPayments:s,incomeAverage:Yd(r,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(f).reduce(((e,[t,n])=>t in Ud?[...e,{incomeTypeCd:{key:Ud[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p};var f},Yd=(e,t)=>(Number(e??0)+Number(t??0)).toString(),Gd={WORK:"Работаю",RETIREE:"Пенсионер"},Kd={BANK_STATEMENT:"Получаю зарплату на счет/карту в РСХБ",BANK_STATEMENT_PENS:"Получаю пенсию на счет/карту в РСХБ",PFR_CERTIFICATE:"Получаю зарплату на счет/карту в другом банке",OTHER:"Другое"},Xd={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},Jd={...Xd,amur_card:"14",owner_card:"13",travel_card:"15"},Zd=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:Yd(t,s),additionalIncome:a,otherIncome:i,otherPayments:l,rentalIncome:r,retirementIncome:s}},Qd=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},em=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},tm=(e,t)=>e?.key?{key:e.key,text:t?t[e.key]:e.value}:void 0,nm=d((function({task:e,isFromLead:t=!1,sendAspects:n=yn,onClose:a=yn}){const i=As(),r=Qt(),{participants:s,creditProgram:d,createdDate:m="",id:u}=e,h=Jd[d.code],p=Boolean(Xd[d.code]),g=p?"/credit-lead":"/credit-card-lead",{id:f,profile:x}=s[0],y=l((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:l}=e,{loanAmount:r,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:P,organizationTypeCd:B,organizationKindCd:E,employeesNumberCd:_,opf:D,seniority:A,generalSeniority:M,jobsNumber:O,lastWorkDuration:z,positionCd:V,maritalStatusCd:F,childrenDependents:L,totalDependents:j,otherDependents:$,militaryStatusCd:U,participantIncomes:q,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,nameLegalEntity:K,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q}=t;return{currency:l?.key,paymentSystem:tm(i),cardCategory:tm(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:tm(b),participantDateRegistration:v,housing:tm(N),beginDate:k,employment:tm(I,Gd),organizationName:T,inn:R,employerActivities:tm(P),organization:tm(B),employerOrganization:tm(E),amountWorkers:tm(_),legalForm:D,generalSeniority:A?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:z?.toString(),positionOrganization:tm(V),familyStatus:tm(F),children:L?.toString(),familyMembers:j?.toString(),dependents:$?.toString(),conscription:tm(U),confirmationIncome:tm(Q,Kd),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:G,legalEntityName:K,creditInRshbCd:tm(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:r,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...Zd(q),...Qd(S),...em(C),...(ee=w,ee?.key?{sex:"MAN"===ee.key?"male":"female"}:null)};var ee})(e);i.participantId=f??null,i.taskId=u,i.profileId=x?.id??null,i.programId=h,i.leadForm=t,x?.id&&n(x.id,u),r.assign(g)}),[]),b=l((()=>{r.assign(p?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]);return o(Sl,{className:"my-6xl max-w-4xl w-full min-h-fit mx-auto rounded-xl py-0",onClose:a,children:c("div",{className:"flex flex-col gap-lg items-center mt-xs md:mt-0 mx-6xl",children:[o(w,{className:"whitespace-pre-wrap text-center",title:"Нашли черновик вашей заявки",headingType:"h5"}),c("div",{className:"flex flex-col gap-m max-w-lg",children:[o(Ld,{title:"Продолжить заполнение черновика",icon:"BankColorIcon",description:m?`Черновик от ${qt(new Date(m))}`:"",onClick:y}),o(Ld,{title:t?"Продолжить заполнение текущей заявки":"Создать новую заявку",icon:"NewLoanIcon",description:"На получение кредита",onClick:t?a:b})]})]})})})),am=d((function({onClose:e=yn}){const t=Qt(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(Sl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(wl,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(wl,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),im=d((({onClose:e})=>{const t=Qt(),n=As(),a=l((async()=>{const e=await(n={redirectUri:globalThis.location.origin+globalThis.location.pathname},bs("/esia/getLink","POST",n));var n;e?.link&&(t.assign(e.link),globalThis.location.href=e.link)}),[]),i=l((()=>{if(n.leadForm){const e={...n.leadForm};delete e.esiaAccountTypeCd,n.leadForm=e}e?.()}),[]);return o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full px-m",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ie,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"@container flex flex-wrap gap-lg w-full",children:[o(wl,{type:"button",onClick:a,className:"w-full md:w-auto",children:"Заполнить через Госуслуги"}),o(wl,{type:"button",version:"secondary",onClick:i,className:"w-full md:w-auto",children:"Пропустить"})]})]})})})),lm=()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search));return{utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_source:e.get("utm_source"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}},rm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"snowplowEvent"===e?{...n,eventJSON:t}:n}))),sm=({programId:e,nextStepLink:t,productType:n,esiaError:i,data:r})=>{const[s,{setTrue:o,setFalse:c}]=ln(!1),[d,m]=a(),u=(()=>{const e=Xs();return l((({participantId:t,taskId:n,profileId:a,programId:i,formData:l})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=l}),[])})(),h=(({data:e})=>{const t=an();return l(((n,a)=>{const i=JSON.stringify({ProfileId:n,TaskId:a});Zt({aspectsAttributes:rm(e,i),aspects:t,ev:{}})}),[e])})({data:r}),p=Qt(),g=(e=>{const{open:t}=pn(im),n=Qt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(t),f=(e=>{const{open:t}=pn(Fd),n=pn(Dd),a=t=>async n=>{try{t&&await gd({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(g),x=pn(Dd),y=(()=>{const{open:e}=pn(nm),{open:t}=pn(am);return{open:({task:n,isFromLead:a,onClose:i,sendAspects:l})=>{n?e({task:n,isFromLead:a,onClose:i,sendAspects:l}):t({})}}})();return{isSending:s,ok:d,handleSubmit:l((async a=>{var l;if(i)p.assign(t);else try{o();const t=await(l={profile:{phone:Wt(a.phone)}},bs("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(t&&a?.phone){const i=async()=>{await cm({programId:e,profileId:t,formData:a,productType:n,saveUserData:u,sendAspects:h}),x.close(),"debitCard"===n?g():f.open(a.phone,t)},l=async()=>{try{const n=await(async e=>{const t=await bs("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:t,programId:e});if(n){const e=await(async e=>await bs("/user-data/getTaskById","POST",e)||void 0)({taskId:n});x.close(),y.open({task:e,isFromLead:!0,sendAspects:h,onClose:i})}else await i()}catch{m(!1)}},r=om(a,n);x.open({phone:a?.phone,consents:r,onSuccess:l}),c()}}catch{m(!1)}}),[i])}},om=(e,t)=>{const n=er[t];return Object.keys(n).filter((t=>e[t])).map((e=>n[e]?.text))},cm=async({programId:e,profileId:t,formData:n,productType:a,saveUserData:i,sendAspects:l})=>{let r,s;const o=dm(n,a);await gd(((e,t,n)=>{const{name:a="",surname:i="",middleName:l="",limitedBirthday:r="",phone:s="",email:o=""}=t;return{profile:{id:e,name:a,surname:i,midname:l,birthDate:r&&qt(r,!0),email:o,phone:Wt(s),...n}}})(t,n,o));try{if("debitCard"===a){const t=await(async e=>await bs("/user-data/createUserTaskDebit","PUT",e)||{})(((e,t)=>{const{name:n,surname:a,middleName:i,limitedBirthday:l,phone:r,email:s}=e;return{task:{taskSource:Qt().origin,creditProgram:{code:qo[t]},participants:[{birthDate:l&&qt(l,!0),midname:i,name:n,surname:a,participantContacts:qd({phone:r&&Wt(r),email:s})}]}}})(n,e));r=t.taskId,s=t.participantId}else{const a=await(async e=>await bs("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});r=a.taskId,s=a.participantId,await fd((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Qt().origin,id:t,participants:[{birthDate:s&&qt(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:qd({phone:o&&Wt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:lm()}}})({participantId:s,taskId:r,profileId:t,formData:n}))}l(t,r),i({participantId:s,taskId:r,profileId:t,programId:e,formData:n})}catch(e){console.log(e)}},dm=(e,t)=>{const{consentOthersFlg:n,consentPfrFlg:a,processPersonalDataFlg:i,consentInformFlg:l,consentProviderFlg:r,consentInformMaterialsFlg:s,consentPhotoFlg:o,consentFATCA:c}=e;let d;return d="credit"===t?{consentPhotoFlg:n,consentPfrFlg:a,consentInformMaterialsFlg:n}:"creditCard"===t?{consentInformMaterialsFlg:s,consentPhotoFlg:o}:{consentFATCA:c,consentPhotoFlg:n},{...d,processPersonalDataFlg:i,consentInformFlg:l,consentProviderFlg:r,consentCollectionFlg:n,consentAssignmentClaimsFlg:n}},mm={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1,consentInformMaterialsFlg:!1,consentPhotoFlg:!1,consentFATCA:!1},um=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,mm[e.name||""]])))}},hm=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},pm=e=>Math.floor(e/12),gm=async({document:e,taskId:t,category:n,files:a})=>{await fetch(`data:application/pdf;base64,${e}`).then((e=>e.blob())).then((e=>(async(e,t,n)=>{const a=new FormData;return a.append("taskId",t),a.append("documentCategory",n),a.append("file",e,"file.pdf"),await(globalThis?.fetch?.("/light-api-cash/v1/file",{method:"POST",headers:{...Ns()},credentials:"include",body:a}).then((e=>e.json())))})(e,t,n))).then((e=>a.push(e)))},fm=e=>{const{profile:t,document:n,addressRegistration:a,esiaAdditionalDocument:i}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,t.email,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType,i.inn,i.averageMonthlyIncome.toString(),i.startWorkDate,i.workLengthInFiveYears.toString(),i.workLength.toString(),i.workLengthLastJob.toString(),i.jobsNumberInFiveYears.toString(),i.pdfFilePayout,i.pdfFileWorkbook].every((e=>Boolean(e))))throw new Error},xm=e=>{const{profile:t,document:n,addressRegistration:a}=e;if(![t.name,t.surname,t.midname,t.birthDate,t.phone,t.email,n.dulIssueDate,n.dulIssuedBy,n.dulNumber,n.dulSerie,n.dulSubdivisionCode,a,t.esiaAccountType].every((e=>Boolean(e))))throw new Error},ym=({inputs:e,nextStepLink:t,productType:n,setEsiaError:a})=>{const s=Qt(),[o,{setTrue:c,setFalse:d}]=ln(!1),m=Xs(),u=l((e=>{const t=e instanceof Function?e(h[p]):e;null!=t?h[p]=t:delete h[p]}),[h=m,p="leadForm"]);var h,p;const g=r((()=>um(e,m.leadForm)),[e,m.leadForm]),f=l((async(e,i,l)=>{c();try{const a=await(r={profileId:e,code:i,state:l,redirectUri:globalThis.location?.href},bs("/esia/updateProfileEsia","POST",r));if(a&&m?.taskId){const e=await(async(e,t,n)=>{n?xm(e):fm(e);const{profile:a,addInfo:i,document:l,addressRegistration:r,addressFact:s,esiaAdditionalDocument:o}=e,c=[];return n||(await gm({document:o.pdfFileWorkbook,taskId:t,category:"CONFIRMING_INCOME_DOC",files:c}),await gm({document:o.pdfFilePayout,taskId:t,category:"CONFIRMING_EMPLOYMENT_DOC",files:c})),{name:a.name,surname:a.surname,middleName:a.midname,limitedBirthday:a.birthDate,phone:Si(a.phone),email:a.email,dulIssueDate:l.dulIssueDate,dulIssuedBy:l.dulIssuedBy,dulNumber:l.dulNumber,dulSerie:l.dulSerie,dulSubdivisionCode:l.dulSubdivisionCode,birthPlace:i.birthPlace,addressRegistration:hm(r),addressFact:hm(s),esiaAccountTypeCd:a.esiaAccountType,...!n&&{snils:i.snils,inn:o.inn,wages:Math.floor(o.averageMonthlyIncome)?.toString(),beginDate:o.startWorkDate,experience5Years:pm(o.workLengthInFiveYears).toString(),generalSeniority:pm(o.workLength).toString(),lastJobExperience:pm(o.workLengthLastJob).toString(),jobsNumber:o.jobsNumberInFiveYears.toString(),files:c}}})(a,m.taskId.toString(),"debitCard"===n);u((t=>({...t,...e})))}s.assign(t)}catch{a()}finally{d()}var r}),[t]);return i((()=>{m.productType=n;const e=$s(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),a=t.get("code"),i=t.get("state");e&&a&&i?f(e,a,i):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[g,{isLoading:o}]},bm=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,productType:s="credit",data:d,...m})=>{const[h,{setTrue:p}]=ln(!1),g=r((()=>(e=>{const t=er[e];return[{columns:2,inputs:[{name:"surname",required:!0,dadata:!0},{name:"name",required:!0,dadata:!0},{name:"middleName",dadata:!0},{name:"limitedBirthday",required:!0},{name:"phone",required:!0},{name:"email",required:!0,dadata:!0}]},{inputs:[{name:"processPersonalDataFlg",required:!0},{name:"consentProviderFlg",required:!0},{name:"consentOthersFlg",required:!0},{name:"consentInformFlg"},{name:"consentPfrFlg"},{name:"consentInformMaterialsFlg"},{name:"consentPhotoFlg"},{name:"consentFATCA",required:!0}].filter((e=>e.name&&Object.keys(t).includes(e.name)))}]})(s)),[s]),f=r((()=>g?.flatMap((e=>e?.inputs))||[]),[g]),x=r((()=>Ji(f,Ql)),[f]),[y,{isLoading:b}]=ym({inputs:f,nextStepLink:a,productType:s,setEsiaError:p}),{isSending:v,ok:N,handleSubmit:w}=sm({programId:n,nextStepLink:a,productType:s,esiaError:h,data:d}),[,{field:C,onSubmit:S}]=un(y,{formValidator:x,onSubmit:w}),k=pn(kl);return i((()=>{void 0!==N&&k.open({ok:N})}),[N]),o(hn,{className:u("container space-y-m",e),title:t,...m,children:c("form",{onSubmit:S,className:"space-y-m relative",children:[b?o(_l,{blur:!1}):null,g.map(((e,t)=>c("div",{className:u(xl(e.columns),"grid gap-x-m"),children:[yl(e.title),ud({field:C,inputs:e?.inputs},s)]},`section-${t}`))),pd(l,v),h?o(Oe,{size:"text-m",font:"font-medium",color:"text-error",children:"Использовать Госуслуги для оформления заявки невозможно, необходимо заполнить поля вручную."}):null]})})})),vm=d((({title:e,description:t})=>{const n=Te();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ie,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Nm=e=>e%2!=0,wm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Cm=d((({topItemsCount:e=0,label:t,block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]],[s,{toggle:d}]=ln(!1);return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(wm),children:[B(l,{...i.options,parent:n}),Nm(l.length)?o($t,{className:"col-span-6",...i}):null]}),c(Cr,{children:[c(Sr,{className:u(wm),isUnfolded:s,children:[B(r,{...i.options,parent:n}),Nm(r.length)?o($t,{className:"col-span-6",...i}):null]}),o(wr,{className:u("text-h4",{hidden:e<1}),label:t,isUnfolded:s,disabled:!r?.length,dataTheme:i.options?.page?.colorPalette,onClick:d})]})]})})),Sm=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",km=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Im=10;function Tm(e=0){const t=Math.round(e*Im);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Rm=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Tm(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:h,role:"listitem",children:d})})),Pm=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Bm=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(_m(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Em(c,v):{},...N?km(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(Rm,{className:u(m,i?Pm[i-1]:"",{"h-full":N},t),style:w?Em(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),Em=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),_m=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Dm={"horizontal-list":"w-6","vertical-list":"h-6"},Am=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Dm[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Mm=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},Om=e=>t=>e.scrollWidth/t,zm=e=>(t,n)=>{e.scrollBy({left:n*Om(e)(t),behavior:"smooth"})},Vm=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[ko()(i),Co()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?zm(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?zm(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Fm={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Lm=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Te(),[h,p]=Vm({itemCount:s.length}),g=jm(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Bm,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Mm({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Fm[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Am({activeIndex:t,onClick:f,listType:a}))}):null})),jm=(e=!1)=>({behavior:e?"auto":"smooth"}),$m=d((({className:e,name:t,...n})=>o(wl,{className:u("w-12 h-12 min-w-12 min-h-12",e),shape:"round",...n,children:o(G,{name:t,iconVersion:"",size:"small"})}))),Um=d((e=>o($m,{name:"ArrowLeftIcon",version:"secondary",ariaLabel:"Пролистать влево",...e}))),qm=d((e=>o($m,{name:"ArrowRightIcon",version:"secondary",ariaLabel:"Пролистать вправо",...e}))),Wm="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Hm=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?Ym(t):null,l?o(Um,{wcmsIgnore:!0,className:u(Gm(i),m?"left-1":"left-0"),onClick:s}):null,r?o(qm,{wcmsIgnore:!0,className:u(Gm(i),m?"right-1":"right-0"),onClick:d}):null]})})),Ym=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Wm,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Wm,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Gm=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Km=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Vm({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Bm,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Hm,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Lm,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Xm=({blocksToRender:e,...t})=>o(Km,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:B(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Sm(!0)),children:R(e,t)},String(n))})}),Jm=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[Zm(n,t),o(Cm,{...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Zm(n,t),Xm({...a,blocksToRender:t})]});default:return null}})),Zm=(e,t)=>e&&!t.length?o(vm,{...e}):null,Qm=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),eu=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(gi,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),tu=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,Qm(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(nu(a)).filter(Boolean))]}),n?o("div",{children:o(wl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),nu=e=>([t,n])=>{const a=n?.type;return"array"===a?au(t,e)(n):null},au=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Oe,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(eu,{items:a,multiple:!n?.single,...t(e)})]},e)},iu=e=>e;function lu(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const ru=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,su=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>ru(t[e])||ru(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>ru(t[e])||ru(n[e])||ou(t[e])<=ou(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>ru(t[e])||ru(n[e])||ou(t[e]?.min)>=ou(n[e]?.min)&&ou(t[e]?.min)<=ou(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>ru(t[e])||ru(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>ru(t[e])||ru(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),ou=e=>Number(e||0),cu=(e,{block:t,page:n,normalize:a=iu})=>{const i=t?.blocks||[],[l,s]=un(e),o=r((()=>lu(i,i.map((e=>zt(e.content,n?.fallback))))),[i,n?.fallback]),c=l===e?i:((e,t)=>(n=iu)=>e?.filter((([,e])=>su(t,n(e)||{}))).map((([e])=>e)))(o,l)(a);return[l,{blocksToRender:c,blocksWithProps:o},s]},du={},mu={},uu=Lt((({className:e,filtrationSchema:t=du,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=cu(mu,{block:i.block,page:i.options?.page}),d=o(_n,{className:"w-64",label:n?.title,options:hu(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>hu(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(tu,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(wl,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Jm,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),hu=e=>lu(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),pu=(e=!1)=>e?"text-left":"text-center",gu={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},fu=d((({className:e,iconBgVersion:t="primary",size:n,icon:a,...i})=>{const l=`${n?.width??44}px`;return a?o("div",{className:u("rounded-icon object-fit flex justify-center items-center",gu[t],e),style:{width:l,height:l},role:"figure",children:o(G,{name:a,width:"54%",...i})}):null})),xu=d((({className:e="",title:t,benefitList:n,...a})=>{const i=Te();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:pu(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(yu)}):null]})})),yu=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(fu,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ie,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Oe,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Ae,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),bu=(e,t,n)=>{return o(Km,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Oe,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ie,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Oe,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},vu=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?bu(e,0,t):null]}))),Nu={start:"justify-start",center:"justify-center",end:"justify-end"},wu=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Nu[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:qe(e)})})),Cu=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Oe,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text gap-xs",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Ge(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),Su=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Oe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(G,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),ku=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(Cu,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(so,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(Su,{title:e,...r}),Iu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Tu={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ru=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Iu.prefMonthsNum,prefTravelBonusRate:l=Iu.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Tu,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Pu=Lt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=un({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=Ru(r,n);return o(no,{className:e,title:t,...l,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),bo({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?ku({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:lo,children:[f>=0?o(so,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,qe(a,{isVertical:!0}),po(i)]})]})})})),Bu=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Eu=e=>xo({...e,title:"Выплата процентов",orientation:"vertical",items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),_u=" (c капитализацией)",Du=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:lo,children:[o(so,{title:`Доход в конце срока${l?_u:""}`,value:e,postfix:n,prefix:"+"}),o(so,{title:`Сумма в конце срока${l?_u:""}`,value:t,postfix:n}),qe(a,{isVertical:!0}),i?.map(po)]}),Au={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Mu={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Ou=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Au[e?.rateType]:"",{data:n}=Hn(t?`${Ht}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&zu(s,e)&&Po(a,["minSum","maxSum"],e)&&Po(n,["minDays","maxDays"],e)))||Mu,{rate:m}=d,u=Vu(m,e),h=a+u,p=c||[Mu];return{...d,...Ro(["minSum","maxSum"],p),...Ro(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},zu=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Vu=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},Fu=Lt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=un({moneyValue:uo(r,1e5),daysValue:ho(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Ou(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(no,{className:e,title:t,...d,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ra,{items:[`От ${Bu(b.min||0)}`,`До ${Bu(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Lu(p,h),Eu({...h("isMonthlyInterestPayment")})]})]}),ku({rate:x,depositeName:y,isShowDepositeName:l}),Du({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),Lu=(e,t)=>c("div",{className:"space-y-s",children:[o(Oe,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ti,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ti,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),ju=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},$u={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Uu=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?Hu(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[Wu({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Wu({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Wu({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Wu({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Po(a,["minSum","maxSum"],t),Po(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||$u,{rate:u}=m,h=e?.extraPercent?.key??0,p=Number(u)+Number(h),g=qu(p,e),f=a+g,x=t||[$u];return{...m,...Ro(["minSum","maxSum"],x),...Ro(["minMonths","maxMonths"],x),availableMonths:ju(x.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:l,income:g,finalSum:f}},qu=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},Wu=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],Hu=(e,t)=>e+Math.round((t-e)/2),Yu=(e="rub")=>"rub"===e,Gu=(e,t)=>{const{minMonths:n,maxMonths:a}=Ro(["minMonths","maxMonths"],Zu(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:ta(i,n,a)}},Ku=(e,t)=>{const{minSum:n,maxSum:a}=Ro(["minSum","maxSum"],Zu(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:ta(i,n,a)}},Xu=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Ju=e=>{const t=Yu(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Zu=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Qu=(e,t=!1)=>t?xo({...e,title:"Оформление",orientation:"vertical",items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]}):null,eh=(e,t,n)=>{const a="rub"!==e?.currency?.key;return c("div",{className:"grid grid-cols-2 gap-lg",children:[th(t("isReplenish"),e,a),nh(t("isWithdrawn"),e,a),ah(e.isShowReplenish||e.isShowWithdrawn),e.isShowMonthlyInterestPayment?Eu(t("isMonthlyInterestPayment")):null,Qu(t("isRemoteRegistration"),e.isShowRemoteRegistration),ih(t("extraPercent"),n),e.isShowNewClient?o(ti,{text:"Новый сберегатель",...t("isNewClient")}):null]})},th=(e,t,n=!1)=>t.isShowReplenish?xo({...e,title:"Пополнение",orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,nh=(e,t,n=!1)=>t.isShowWithdrawn?xo({...e,title:"Снятие",orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null,ah=(e=!1)=>e?o("div",{className:"border-b border-main-divider col-span-2 w-full"}):null,ih=(e,t)=>t?.length?c("div",{className:"w-full space-y-s col-span-2",children:[o(Oe,{color:"text-secondary-text",font:"font-light",children:"Надбавка за операции по карте"}),o(_n,{options:t,...e})]}):null,lh={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum",extraPercent:"extraPercent"},rh={text:"₽",key:"rub"},sh={text:"Без учета надбавки",key:"0"},oh=Lt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[rh],g=l((e=>t=>e?{...t,...Ju(t),...Ku(t,e),...Gu(t,e),...Xu(t,e)}:t)(h),[h]),[f,{field:x}]=un({moneyValue:uo(d,2e4),monthsValue:ho(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:rh,extraPercent:d?.extraPercent??sh},{normalizer:g}),y=hh(x),b=Boolean(x?.("isNewClient")?.value),v=h?.find((e=>e?.extraPercents))?.extraPercents,N=Zu(h,y),w=Uu(f,N,s),{rate:C,income:S,finalSum:k,type:I=""}=w,T=l((()=>{vo({field:x,defParams:co(N,b,v),calcParams:w,monthsValue:"minMonths",map:lh})}),[x,h,v]);i((()=>{!Ao(d)&&N&&T()}),[d,h]);const R=x?.("extraPercent")?.value?.key,P=uh(C,R),B=C===co(N,b)?.rate&&R===v?.at(-1)?.key;return o(no,{className:e,title:t,...m,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[c("div",{className:"flex gap-m",children:[bo({className:"w-full",title:`Сумма, ${y?.text}`,min:w.minSum,max:w.maxSum,...x("moneyValue"),value:w.moneyValue,postfix:y?.text,step:ch(y?.key)}),h&&h?.length>1?o(On,{label:"Валюта",options:p,...x("currency")}):null]}),go({title:"Срок, месяцев",min:w.minMonths,max:w.maxMonths,availableMonths:w.availableMonths,...x("monthsValue"),value:w.monthsValue}),eh({...w,...s},x,v)]}),ku({rate:P,children:mh(T,B)}),Du({income:S,finalSum:k,buttons:[...a,dh(n?.buttons,I)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),ch=(e="")=>Yu(e)?1e3:100,dh=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},mh=(e,t=!1)=>t?null:o(wl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),uh=(e,t)=>Number(e)+Number(t??0),hh=e=>e?.("currency")?.value??rh,ph=e=>gh({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&gh({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),gh=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],fh={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},xh=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[fh],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>ph({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=To(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=To(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>ph({row:e,userInputParams:t,paramsViewSettings:n})&&Po(a+r,["minSum","maxSum"],e)&&Po(l,["minSumOld","maxSumOld"],e)&&Po(r,["minSumExtra","maxSumExtra"],e)&&Po(i,["minMonths","maxMonths"],e)))||fh)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=No(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},yh=Lt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...s})=>{const[d,{field:m}]=un({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),h=xh(d,n,l),p=r((()=>oo(n?.rateRows)?.rate),[n?.rateRows]),g=yo({...m("isAnnuity")});return o(no,{className:e,title:t,...s,children:c("section",{className:u(ao,e),children:[c("div",{className:io,children:[bo({title:"Остаток долга в других банках, ₽ ",step:500,min:h.minSum,max:h.maxSum-h.maxSumExtra,...m("moneyValue"),value:h.moneyValue}),bo({title:"Ежемесячный платёж в других банках, ₽",step:500,min:h.minSumOld,max:h.maxSumOld,...m("oldMonthlyPayment"),value:h.oldMonthlyPayment}),go({title:"Новый срок кредита, месяцев",min:h.minMonths,max:h.maxMonths,...m("monthsValue"),value:h.monthsValue}),bh({...h,...l},m),h.isExtraMoney?bo({title:"Дополнительная сумма, ₽ ",step:500,min:h.minSumExtra,max:h.maxSumExtra,...m("moneyExtra"),value:h.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:g})]}),c("div",{className:u(lo,"@4xl:w-1/2"),children:[o(so,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(so,{title:"Ставка от",value:p,fractionDigits:2,postfix:"%"}),o(so,{title:"Ежемесячный платёж",value:h.monthlyPayment,postfix:"₽"}),h.benefit>0?o(so,{title:"Выгода в месяц",value:h.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:g}),qe(a,{isVertical:!0}),po(i)]})]})})})),bh=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ti,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ti,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ti,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),vh=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=ea(e,{normalize:(e=i)=>n&&a?String(ta(Number(Nh(e)),n,a)):Nh(e),format:Ge(r)}),d=l((e=>t&&t(Nh(e))),[t]);return o(wn,{onChange:d,...s,...c})})),Nh=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),wh=d((e=>o(vh,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Oe,{size:"text-xl",font:"font-light",children:"₽"})})}))),Ch=new Ps;function Sh(){return Es(Ch)}Ts(Ch,new Rs(globalThis?.sessionStorage));const kh={private:"p2p/registerP2P",business:"b2c/registerB2C"},Ih=({onClose:e,errorCode:t,errorMessage:n})=>{const a=t?`Код ошибки - ${t}`:"Пожалуйста, повторите позднее";return o(Sl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:"Ошибка перевода",description:a,headlineVersion:"XS",isEmbedded:!0}),n?c("div",{className:"bg-secondary-dark rounded-xl px-4 pt-4 pb-8 grid gap-4 grid-cols-12",children:[c("div",{className:"col-span-8",children:[" ",n]}),o("div",{className:"col-span-4",children:o(ie,{image:{icon:"ResponseFailIcon",iconVersion:"normal"}})})]}):null]})})},Th=e=>{const t=pn(Ih),n=Sh(),a=Qt(),i="private"===e?"p2p":"b2c";return l((async({amount:l})=>{const r=await(async(e,t)=>{const n=Qt(),a={amount:String(t),currency:"643",returnUrl:`${n.origin}/p2p/success`,failUrl:`${n.origin}/p2p/failed`,language:"ru"},i=`${Ht}/payment/${kh[e]}`;try{const e=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(a)});return e.ok?await e.json():null}catch(e){return null}})(e,l);(e=>Boolean(e?.formUrl)&&Boolean(e?.orderId))(r)&&(n.transaction={orderId:r.orderId,type:i,url:a.href},a.assign(`${i}/?formUrl=${encodeURIComponent(r.formUrl)}`)),(e=>Boolean(e?.errorMessage)&&0!==e?.errorCode)(r)&&t.open({errorCode:r.errorCode,errorMessage:r.errorMessage})}),[e])},Rh={amount:1500},Ph=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:l="private",...r})=>{const[s,{setValue:d}]=ln(!1),m=Th(l),[{amount:h},{field:p,onSubmit:f}]=un(Rh,{onSubmit:m});return i((()=>{d(h<=0)}),[h]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...r,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",onSubmit:f,children:[o(wh,{valid:!s,label:n,max:3e5,min:1,...p("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:h}),a?.text?o(Dl,{className:"w-full mt-lg",disabled:s,children:a.text}):null]})]})})),Bh=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(G,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Eh="relative h-full",_h={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Dh=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Oh),r=n?{defaultPadding:"p-6xl pb-m"}:{};return E({...a,renderProps:(n,a,i)=>c("div",{className:Ah(n,{someCardsHighlighted:l}),children:[R(n,a,{className:Mh(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Oh(n)?Bh({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Ah=(e,{someCardsHighlighted:t})=>u(Eh,t&&(Oh(e)?"pt-3xl":"pt-3xl sm:pt-16")),Mh=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Eh,"min-w-80",_h[a],t&&(Oh(e)?"pt-3xl sm:pt-16":"pt-3xl"),Sm(n),n&&"h-full"),Oh=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,zh=Lt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Km,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Vh(s?.block?.blocks):[],hasBlur:!0,children:Dh({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Vh=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Fh="z-10 border border-solid w-full h-full",Lh=u(Fh,"absolute hidden @xl:block border-transparent"),jh=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u(Lh,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Lh,"top-6 right-8 bg-green")}),o("div",{className:u(Lh,"top-3 right-4 bg-green-light")}),c("div",{className:u(Fh,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),qe([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),$h={black:"bg-black",white:"bg-white"},Uh=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Be,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ie,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:qe([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Oe,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(qh)]}):null,i?c(Oe,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),qh=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${$h[e]}`},String(t)),Wh=d((({icon:e,...t})=>{const n=fe(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ie,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Hh=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?Yh(a):null]})}))),Yh=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Wh,{...e},String(t))))}),Gh=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=fe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ye(i),children:l})})),Kh=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],Xh=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>Kh.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Ue(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},Jh(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:qe(m,{className:Zh(s??!1,i??!1,n),buttonClassName:h})}),r?o(Oe,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Jh=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Zh=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Qh=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(Gh,{href:i,target:m,className:"h-full",data:rm(v),children:c(Be,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...tt(Ue(l)?o(ie,{image:l}):null,x),buttons:d.length?o(Xh,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o($e,{benefits:f}),s?o(Ae,{__html:s,isDotted:r,itemSize:"list-s"}):null,ep(a,p)]})})}))),ep=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,tp=new he,np=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Oe,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Oe,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:qe(i)}):null]},String(t))},ap=d((({className:e="",title:t,align:n="text-center",icon:s,button:d,visibleCellsCount:m=1,cardCells:h=[],options:p,data:f,...x})=>{const y=r((()=>h.map(np)),[h]),[b,v]=r((()=>m>0?[y.slice(0,m),y.slice(m)]:[y,[]]),[m,y]),[N,C]=a(!1);i((()=>tp.subscribe("fold",(e=>{e&&p?.parent&&e.parent===p?.parent&&C(e.isUnfolded)}))),[p?.parent]);const S=l((()=>{tp.fire("fold",{type:"fold",isUnfolded:!N,parent:p?.parent})}),[N,p?.parent]);return c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...x,children:[o(ie,{className:"self-center",image:s}),t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,d?.text?o(Ce,{className:"w-full mt-m mb-lg",...d}):null,v.length?c(Cr,{children:[c("div",{children:[b,o(Sr,{isUnfolded:N,children:v})]}),h.length>=m?o(wr,{className:"mt-m",label:N?"Скрыть":"Подробнее о тарифе",isUnfolded:N,embedded:!0,data:f,onClick:S}):null]}):o("div",{children:b})]})})),ip=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=Qt();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await vs("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},lp=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),rp=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(lp,{step:a,showPercentage:!1})]})})}));var sp;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION",e.dboClient="DBO_CLIENT",e.clientNotOk="CLIENT_NOT_OK",e.notFound="NOT_FOUND"}(sp||(sp={}));const op=e=>bs("/user-data/getTaskStatus","POST",e),cp=async e=>{const t=await bs("/user-data/sendSignalToProcess","POST",e);return t?.statusCd||null},dp=d((({title:e,interval:t=0,onEnd:n=yn})=>{const[i,l]=a(t);vd({seconds:t,onTick:l,onEnd:n});const r=100-(t-i)/t*100;return c("div",{children:[e?o(k,{title:e,headlineVersion:"S"}):null,c("div",{className:"relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5",children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${r}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center w-20 h-20 rounded-full bg-white text-primary-text text-m",children:o(xd,{seconds:i})})]})]})})),mp=d((({title:e,description:t,sectionInfoTitle:n,sectionInfo:a,sectionAdditionalTitle:i,sectionInfoAdditional:l,buttonText:r,interval:s,onExpire:d=yn,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),s?o(dp,{interval:s,onEnd:d}):null]}),o(up,{title:n,items:a}),o(up,{title:i,items:l,countColumns:!0}),r?o(Ml,{href:"/natural",text:r,version:"primary",className:"w-full mt-lg"}):null]}))),up=({title:e,items:t,countColumns:n=!1})=>{const a=Te();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Oe,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",xl(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:hp(e)},t)))}):null]})]}):null},hp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Oe,{color:"text-secondary-text",size:"text-l",children:e}),o(Oe,{color:"text-primary-text",size:"text-xl",children:t})]}),pp=d((()=>o(mp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),gp=d((({onExpire:e})=>{const{statusInfo:t}=As();return o(mp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}],onExpire:e})})),fp=d((()=>{const{statusInfo:e}=As(),t="courier"===e?.methodObtain;return o(mp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:t?"":"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:t?"Адрес доставки":"В отделении Банка",sectionInfoAdditional:t?[{description:e?.deliveryAddress}]:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),xp=d((()=>{const{statusInfo:e}=As();return o(mp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:yp(e),buttonText:"Вернуться на главную"})})),yp=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:qt(e?.deliveryDate)}]):t},bp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],vp=d((()=>{const[e,t]=a(sp.process),{taskId:n}=As();i((()=>{(async()=>{for(const e of bp)await cp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await op({taskId:n});a&&a?.statusCd!==sp.process&&(e(),t(a.statusCd))}),[n]);bd(r,3e4);const s=l((()=>t(sp.rework)),[]);return Np(e,s)})),Np=(e,t)=>({IN_PROCESS:o(gp,{onExpire:t}),CANCELLED:o(pp,{}),FAILED:o(pp,{}),DRAFT:o(pp,{}),APPROVED:o(xp,{}),PRE_DECISION:o(xp,{}),REVISION:o(fp,{})}[e]||o(fp,{})),wp=e=>(t,n)=>t.filter((e=>e)).map((t=>[Cp(n,e),Sp(t,e),Rp(t,e),kp(t,e),Ip(t,e),Tp(t,e)].some(Boolean)?{...t,required:!1}:t)),Cp=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Sp=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,kp=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ip=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Tp=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Rp=({name:e},t)=>"snils"===e&&Pp(t),Pp=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Bp={...od,...cd},Ep=({field:e,inputs:t,params:n})=>t.map(fl(e,n,Bp)),_p=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l,condition:r},s)=>{const o=wp(Dp(t))(e,n);return c("div",{className:u(xl(i),"grid gap-x-m"),children:[Tp({condition:r},Dp(t))?null:yl(l),Ep({field:t,inputs:o,params:a})]},`section-${s}`)})),Dp=e=>t=>e(t)?.value,Ap=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(wl,{version:"secondary",disabled:0===e,onClick:n,children:"Назад"}),o(Dl,{isLoading:t,children:a?"Отправить заявку":"Далее"})]})})),Mp=(e,t,n)=>({...n[e],...t,limitedBirthday:Op(t?.limitedBirthday),dulIssueDate:Op(t?.dulIssueDate),participantDateRegistration:Op(t?.participantDateRegistration),beginDate:Op(t?.beginDate),deliveryDate:Op(t?.deliveryDate)}),Op=e=>{try{return e?new Date(e):void 0}catch(e){return}},zp=[{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDate:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0}],Vp=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},...zp,{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:void 0,deliveryDate:void 0}],Fp=e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}},Lp=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},jp=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:x}=e;return{employmentContractDate:qt(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:qd({organizationPhone:p&&Wt(p)}),participantAddresses:Wd({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?x:""}},$p=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDate:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y,addressMatch:b}=e;return{birthDate:qt(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:qt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:qt(g,!0),homeMatchFlg:b,houseTypeCd:f,participantContacts:qd({phone:Wt(l),email:r}),participantAddresses:Wd({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Up=e=>{const{methodObtain:t,deliveryDate:n="",deliveryTime:a}=e,i="courier"===t,l=a?{deliveryTimeCd:{key:a}}:{};return i?{courierDeliveryFlg:i,deliveryDate:(r=n.toString().replace(/(GMT)[+-]\d{4}/,"GMT+0000"),r?new Date(r).toISOString().split(".")[0]:""),office:{id:"3"},...l}:{};var r},qp=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Wp=(e,t)=>{switch(e){case 0:default:return{};case 1:return $p(t);case 2:return jp(t);case 3:return Hd(t);case 4:return Fp(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:Wd({addressCourier:t})}:{}})(t)}},Hp=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=ln(!1),o=5===e,c=As(),d=r((()=>Mp(e,c.leadForm,Vp)),[e,c.leadForm]),m=l((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},c.leadForm=d)}),[o,d]),u=l((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:l,participantId:r}=c;if(i&&l&&r){const t=await fd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Qt().origin,id:t,...qp(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Wp(i,a)}],...Lp(a),...Up(a),files:a?.files}}))({participantId:r,taskId:i,profileId:l,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},Yp=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,onFinish:i})=>{const s=r((()=>t?.flatMap((e=>e?.inputs||[]))),[t]),d=l((t=>Ji(wp((e=>t[e]))(s,e),Ql)(t)),[s]),[m,u,h]=Hp({step:e,onNextStep:a,onFinish:i}),[,{field:p,onSubmit:g}]=un(m,{formValidator:d,onSubmit:u});return c("form",{onSubmit:g,className:"space-y-m",children:[_p({sections:t,field:p,step:e}),o(Ap,{isSending:h,step:e,onPrevStep:n})]})})),Gp=[[{title:"Персональные данные",columns:2,inputs:[{name:"surname",required:!0,dadata:!0,filledByEsia:!0},{name:"name",required:!0,dadata:!0,filledByEsia:!0},{name:"middleName",dadata:!0,filledByEsia:!0},{name:"sex",required:!0},{name:"limitedBirthday",required:!0,filledByEsia:!0},{name:"birthPlace",required:!0,filledByEsia:!0},{name:"phone",disabled:!0,required:!0},{name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{name:"dulSerie",required:!0,filledByEsia:!0},{name:"dulNumber",required:!0,filledByEsia:!0},{name:"dulIssueDate",required:!0,filledByEsia:!0},{name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{name:"addressMatch"}]},{columns:2,inputs:[{name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{name:"housing",required:!0}]},{inputs:[{name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{name:"employment",required:!0},{name:"organizationName",required:!0,dadata:!0,filledByEsia:!0}]},{columns:2,inputs:[{name:"inn",required:!0,dadata:!0,filledByEsia:!0},{name:"legalForm",required:!0}]},{inputs:[{name:"organization",required:!0},{name:"amountWorkers",required:!0}]},{columns:2,inputs:[{name:"employerActivities",required:!0},{name:"employerOrganization",required:!0},{name:"generalSeniority",required:!0,filledByEsia:!0},{name:"lastJobExperience",required:!0,filledByEsia:!0},{name:"experience5Years",required:!0,filledByEsia:!0},{name:"jobsNumber",required:!0,filledByEsia:!0}]},{inputs:[{name:"organizationPhone",label:"Телефон работодателя",required:!0},{name:"beginDate",required:!0}]},{columns:2,inputs:[{name:"positionOrganization",required:!0},{name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{name:"familyStatus",required:!0}]},{columns:1,inputs:[{name:"children",required:!0}]},{columns:2,inputs:[{name:"dependents",required:!0},{name:"familyMembers"}]},{title:"Совокупный доход"},{inputs:[{name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{name:"wages",required:!0,filledByEsia:!0}]},{columns:1,inputs:[{name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{name:"snils",required:!0}]},{columns:1,inputs:[{name:"conscription",required:!0}]},{columns:2,inputs:[{name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{name:"bankruptcyFlg"}]},{inputs:[{name:"shareholderFlg"}]},{inputs:[{name:"legalEntityName"}]},{inputs:[{name:"creditInRshbCd"}]}]],Kp=[{title:"Регион обслуживания карты",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{title:"Способ получения",columns:1,inputs:[],condition:{name:"regionHasDelivery",values:[!0]}},{inputs:[{name:"methodObtain",condition:{name:"regionHasDelivery",values:[!0]}}]},{title:"Выбор офиса",columns:1,inputs:[],condition:{name:"methodObtain",values:["office"]}},{title:"Адрес доставки",columns:1,inputs:[],condition:{name:"methodObtain",values:["courier"]}},{inputs:[{name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0}]},{columns:2,inputs:[{name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{name:"deliveryTime",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}],Xp=[[{title:"Параметры карты",inputs:[]},{inputs:[{name:"currency",required:!0},{name:"paymentSystem",required:!0},{name:"cardCategory",required:!0},{name:"codeWord",required:!0}]}],...Gp,Kp],Jp=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Zp=d((({className:e,...t})=>{const[n,r]=a(0),d=s(null),m=l((()=>d?.current?.scrollIntoView({behavior:"smooth"})),[d]);i(ip,[]);const u=l((()=>{r((e=>Math.min(e+1,6))),m()}),[]),h=l((()=>{r((e=>Math.max(e-1,0))),m()}),[]),p=Xp[n],[f,{setTrue:x}]=ln(!1);return o(g,{className:e,...t,children:c("div",{ref:d,className:"container grid grid-cols-12",children:[f?null:o(rp,{stepsTitles:Jp,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:f?o(vp,{}):o(Yp,{step:n,sections:p,onNextStep:u,onPrevStep:h,onFinish:x},String(n))})]})})})),Qp=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(lp,{step:a,showPercentage:!1})]})})})),eg=d((()=>o(mp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),tg=d((({onExpire:e})=>{const{statusInfo:t}=As();return o(mp,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],onExpire:e})})),ng=d((()=>{const{statusInfo:e}=As();return o(mp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),ag=d((()=>{const{statusInfo:e}=As();return o(mp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),ig=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],lg=d((()=>{const[e,t]=a(sp.process),{taskId:n}=As();i((()=>{(async()=>{for(const e of ig)await cp({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await op({taskId:n});a&&a?.statusCd!==sp.process&&(e(),t(a.statusCd))}),[n]);bd(r,3e4);const s=l((()=>t(sp.rework)),[]);return rg(e,s)})),rg=(e,t)=>({IN_PROCESS:o(tg,{onExpire:t}),CANCELLED:o(eg,{}),FAILED:o(eg,{}),DRAFT:o(eg,{}),APPROVED:o(ag,{}),PRE_DECISION:o(ag,{}),REVISION:o(ng,{})}[e]||o(ng,{})),sg=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(wl,{version:"secondary",disabled:0===e,onClick:t,children:"Назад"}),o(Dl,{isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),og={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},cg=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:og[a?"annuity":"differential"]}},dg=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},mg=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:n,consentInsuranceFlg:t}})(t);case 1:return $p(t);case 2:return jp(t);case 3:return Hd(t);case 4:return Fp(t);default:return{}}},ug=[{calculator:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},...zp,{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],hg=({step:e,onNextStep:t,onFinish:n})=>{const[a,{setTrue:i,setFalse:s}]=ln(!1),o=5===e,c=As(),d=r((()=>Mp(e,c.leadForm,ug)),[e,c.leadForm]),m=l((e=>{const{leadForm:t}=c;o&&e.ok&&t&&(c.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity}},c.leadForm=d)}),[o,d]),u=l((async a=>{i(),c.leadForm=a;try{const{taskId:i,profileId:l,participantId:r}=c;if(i&&l&&r){const t=await fd((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Qt().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...mg(i,a)}],...cg(a),...dg(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key},files:a?.files}}))({participantId:r,taskId:i,profileId:l,step:e,formData:a}));m(t)}o?n?.():t()}catch(e){}finally{s()}}),[o,m]);return[d,u,a]},pg=d((({step:e,sections:t,programsSource:n,onPrevStep:a,onNextStep:i,onFinish:s})=>{const{programId:d}=As(),m=n?.[d??""],u=r((()=>t?.flatMap((e=>e?.inputs??[]))),[t]),h=l((t=>Ji(wp((e=>t[e]))(u,e),Ql)(t)),[u]),[p,g,f]=hg({step:e,onNextStep:i,onFinish:s}),[,{field:x,onSubmit:y}]=un(p,{formValidator:h,onSubmit:g});return c("form",{onSubmit:y,className:"space-y-m",children:[_p({sections:t,field:x,step:e,params:{calcData:m}}),o(sg,{step:e,isSending:f,onPrevStep:a})]})})),gg=[[{columns:1,inputs:[{name:"calculator"}]}],...Gp,[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{name:"regionRetail",required:!0}]},{inputs:[{name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{name:"bankEmployeeCode"}]}]],fg=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],xg=Lt((({className:e,programsSource:t,...n})=>{const[r,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(ip,[]);const h=l((()=>{d((e=>Math.min(e+1,5))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=gg[r],x=0===r,[y,{setTrue:b}]=ln(!1);return o(g,{className:e,...n,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x||y?null:o(Qp,{stepsTitles:fg,step:r,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:y?o(lg,{}):o(pg,{step:r,sections:f,programsSource:t,onNextStep:h,onPrevStep:p,onFinish:b},String(r))})]})})})),yg=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,bg=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),vg=1e9,Ng={sum:{min:1e4,max:vg},period:3},wg=Lt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=cu(Ng,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Cg(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Sg(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(tu,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(wh,{label:a?.title,min:500,max:vg,...d("sum",{parse:e=>({min:Number(e),max:vg}),format:({min:e})=>String(e)})}),o(ra,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Jm,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Cg=e=>At((e?.paramsSource?.rateRows||[]).filter(yg).flatMap((e=>bg(e.minMonths,e.maxMonths)))),Sg=e=>At(e.flatMap((e=>e||[])).filter(yg).flatMap((e=>bg(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],kg=[{key:"10"},{key:"50"},{key:"100"}],Ig=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(_n,{className:"min-w-20",onChange:n,value:{key:String(e)},options:kg,iconVersion:"black"})]})},Tg="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Rg=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:Tg,"aria-label":`Страница ${l}`,children:l},String(t)):null},Pg={width:"24",height:"24"},Bg=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(G,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Eg(1===e),...Pg})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Tg,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Rg),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Tg,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(G,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Eg(e===n),...Pg})})]})},Eg=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",_g=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Bg,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(Ig,{itemCount:a,onItemCountChange:i}):null]}),Dg=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ie,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",bn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),Ag=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Dg,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Fa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Fa,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(wl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Mg=d((({title:e,timestamp:t,publicId:n})=>{const a=fe(),{href:i}=a({href:`${Ht}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[o(fu,{className:"shrink-0",icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Oe,{size:"text-m","font-weight":"font-light",children:qt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),Og=`${Ht}/depository`,zg={startDate:void 0,endDate:void 0,query:""},Vg=Lt((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=un(zg),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?qt(a,!0):"",r=i?qt(i,!0):"",s=new URLSearchParams(Og);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=Hn(Og+o,Dt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),y=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Ag,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Oe,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Oe,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Mg,{...e},String(e.publicId)))):o(vm,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(_g,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Fg=e=>"Image"===e?.contentType&&e?.image?o(ie,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Lg=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:Fg(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ce,{version:i?.version,text:i?.text,...i}):null]}))),jg=`${Ht}/region`;function $g(e="Москва"){return Ds().location??{name:e}}function Ug(e="Москва"){const t=Ds(),n=l((async()=>{if(!t.location){const n=await _t(jg);t.location=n??{name:e}}}),[t,e]);return Hn(jg,n),t}var qg;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(qg||(qg={}));const Wg=new Intl.NumberFormat("ru",{style:"currency",currency:qg.RUB}),Hg=e=>e?Wg.format(e):"",Yg="text-m font-light text-secondary-text ",Gg=`${Yg} text-left`,Kg=`${Yg} pl-5xl text-center`,Xg=`${Yg} pl-5xl text-right`,Jg={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Zg=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Gg,children:o(Oe,{size:"text-m",children:"Валюта"})}),o("th",{className:Kg,children:o(Oe,{size:"text-m",children:"Купить"})}),o("th",{className:Xg,children:o(Oe,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Qg)})]}))),Qg=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ie,{image:{icon:Jg[t]},width:"24",height:"24"}):null,o(Oe,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Oe,{size:"text-h6",children:Hg(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Oe,{size:"text-h6",children:Hg(e?.buyExchangeRate)})})]},t)},ef={icon:"GpsIcon"},tf=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(fu,{...ef,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),nf=(e,t,n)=>{const a=Number(af(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},af=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function lf(e){if(!e)throw new Error("Value should be fulfilled");return e}const rf=e=>t=>{const[,n]=lf(e.find((([e])=>e(t))));return n(t)},sf=e=>rf(e.map((([e,t])=>[e,()=>t])));sf.if=e=>new of(void 0,e);class of{parent;predicate;unit;get entry(){return[lf(this.predicate),lf(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new of(this,e)}then(e){return new of(this.parent,this.predicate,e)}else(e){return rf([...cf(this),[()=>!0,e]])}}const cf=e=>[...e?.parent?cf(e.parent):[],e.entry],df=e=>sf([[e=>e.value!==qg.RUB&&e.oppositeValue!==qg.RUB,()=>e.handleConvert(e.value,qg.RUB)],[e=>e.value===qg.RUB&&e.oppositeValue===qg.RUB,()=>e.handleConvert(e.value,qg.USD)],[e=>e.value===qg.RUB&&e.oppositeValue===qg.RUB,()=>e.handleConvert(e.value,qg.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function mf(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(wn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(_n,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const uf=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||qg.RUB,selectBuy:n?.[0]?.currency?.currency||qg.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[mf({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:hf(r,d,n),value:r.inputSell,setValue:e=>gf(d,n)(e,r.selectSell,r.selectBuy)}),mf({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:pf(r,d,t),value:r.inputBuy,setValue:e=>ff(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ce,{text:i.text,version:i?.version,...i}):null]})})),hf=(e,t,n)=>a=>{t({selectSell:a}),df({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{gf(t,n)(e.inputSell,a,i)}})},pf=(e,t,n)=>a=>{t({selectBuy:a}),df({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>ff(t,n)(e.inputBuy,a,i)})},gf=(e,t)=>(n,a,i)=>{e({inputSell:af(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(nf(n,l,a===qg.RUB)||"")})},ff=(e,t)=>(n,a,i)=>{e({inputBuy:af(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(nf(n,l,a===qg.RUB)||"")})},xf=`${Ht}/exchangerates`;const yf=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=Hn(xf+`?regionCode=${t}`,Dt);return n||{}}($g()),l=bf(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:qg.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:qg.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Be,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(Zg,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(tf,{address:i?.address})]}),o(uf,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),bf=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],vf=d((({className:e="",items:t})=>{const n=fe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Nf(n))})})),Nf=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ye(t),children:i||null})},String(a)):null},wf=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Cf(e)}))),Cf=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Sf,{className:"w-full border-0 border-b border-solid border-main-divider last:border-b-0",item:e},String(t)))),Sf=d((({className:e,item:t})=>{const[n,{toggle:a}]=ln(!1);return c(Cr,{className:e,role:"menuitem",children:[c(wl,{className:u("w-full",t.icon?.icon?"py-xs":"py-lg"),embedded:!0,onClick:a,children:[c(vr,{children:[o(fu,{className:"shrink-0",...t.icon}),o(Oe,{size:"text-h6",font:"font-normal",color:"text-primary-text",children:t.text})]}),o(Nr,{iconVersion:"color",size:"medium",isUnfolded:n})]}),o(Sr,{className:"flex flex-wrap gap-lg group-last:last:pb-0",isUnfolded:n,children:t.items?o(vf,{items:t.items}):null})]})})),kf=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(If)}):null)),If=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Oe,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Tf)})]},String(t)),Tf=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Rf(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Rf=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Pf(t)}`,children:o(Oe,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Pf=e=>e.replaceAll(/\D/g,""),Bf=d((({className:e="",index:t,text:n,...a})=>{const i=fe(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Ef=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Oe,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Bf,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),_f=d((({className:e="",index:t,...n})=>{const a=fe(),{href:i,target:l,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),Df=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Oe,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(_f,{index:t,...e},String(t))))}):null]}))),Af=Lt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(wf,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(kf,{items:r}),m?o(Ce,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(Xh,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ml,{className:"text-s font-light",...e},`${e.href}_${t}`)))]})]}),o(Ef,{title:d,links:l}),o(Df,{links:i,license:h})]})})),Mf=Lt((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=m?.find((e=>e.name===s.key))?.href;return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(On,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,h?o("div",{className:"text-center",children:o(Ml,{className:u("w-full @xl:w-auto"),href:h,target:"_blank",version:n?.version??"primary",data:rm(l,s?.key),children:n?.text?n.text:"Перейти"})}):null]})})})),Of={default:"w-6 h-6",medium:"w-10 h-10",large:"w-12 h-12"},zf=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:i,ariaLabel:l="Меню второго уровня",image:r,data:s,onClick:c,version:d,isLoading:m,dataTestId:h=""})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Of[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:i,"aria-label":l,onClick:c,...Vf(h),...ye(s),children:m?o("div",{className:"w-full h-full rounded-full border-4 border-r-transparent animate-spin text-primary-main"}):o(ie,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Vf=e=>e?{"data-test-id":e}:null,Ff="chatbot",Lf="text-page__btn-chat",jf="webchat-js-container:webchat_rshb",$f={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:"/webchat"},Uf=async(e,t)=>{const n=e.target;n?.classList.contains(Lf)||n?.classList.add(Lf);globalThis.document.getElementById(jf)||await ds(Ff,t)},qf=async e=>{const t=await ds(Ff,`${e}/bundle.js`,!0);((e="")=>{if(!globalThis.document.getElementById(e)){const t=globalThis.document.createElement("link");t.href=e,t.id=e,t.rel="stylesheet",globalThis.document.head.appendChild(t)}})(`${e}/bundle.css`);globalThis.document.getElementById(jf)?t?.chatOpen?.():(Wf(),t?.render?.(jf,!0,"/webchat-api","@container fixed right-0 bottom-0 h-full w-full z-[100] @3xl:w-auto h-fit"))},Wf=()=>{const e=globalThis.document.createElement("div");e.id=jf,globalThis.document.body.appendChild(e)},Hf=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:r="Чат",version:s,buttonSize:c="large"})=>{const{load:d,isLoading:m}=(e=>{const[t,n]=a(!1);i((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const r=$f[e??""];return{load:l((t=>{r&&(n(!0),"business"===e?qf(r).finally((()=>n(!1))):Uf(t,r).finally((()=>n(!1))))}),[r,e]),isLoading:t}})(e);return o(zf,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:r,onClick:d,buttonSize:c,isGrayBg:!0,version:s,isLoading:m,dataTestId:"chat icon"})})),Yf={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},Gf=d((({version:e,text:t,mobileText:n,...a})=>{const i=Te()?n:t;return i?o(Ce,{className:u("py-s px-lg font-light whitespace-nowrap",Yf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),Kf=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:r})=>{const s=_(),d="/"===s.pathname,m="transparent"===i?"white":"black",{dataFooter:u,dataHeader:h,...p}=t??{},g=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Id,{className:"my-2xs",bgColor:e,logo:p,data:h,showTitle:!1})}):Xf(g,r),c("div",{className:"flex gap-lg items-center",children:[A.CHAT_BOT?o(Hf,{version:i,iconVersion:m,chat:A.CHAT_BOT,buttonSize:"medium"}):null,o(Gf,{version:i,...a})]})]})})),Xf=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(G,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,Jf={"bg-white":"primary",transparent:"transparent"},Zf=Lt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Jf[e],portal:a,logo:i={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(Kf,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),Qf=(e=!1)=>e?{}:{padding:"p-0"},ex={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},tx=Lt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=_();return o(g,{className:u("relative flex flex-col",ex[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Q(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:E({...c,extraProps:{className:u("w-full",Sm(r)),...Qf(a)}})})}),{childrenTypes:[]}),nx=Lt((e=>o(tx,{...e})),{childrenTypes:[]}),ax=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Nu[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ie,{image:a})})})),ix=["байт","Кб","Мб","Гб","Тб","Пб"],lx=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...ye(l),children:[e,t?c(Oe,{size:"text-l",font:"font-light",children:[t," ",rx(d,m),o(Oe,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),rx=(e,t)=>e||t?o("span",{children:", "}):"",sx=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="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))} ${ix[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?cx(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(lx,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:ox(t),data:n?.data}),o(Ae,{__html:n?.__html})]},String(a))},ox=e=>e?o(ie,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,cx=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},dx=d((({href:e,__html:t,target:n,onClose:a})=>c(Sl,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(Ae,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ml,{href:e,target:n,version:"primary",ariaLabel:"Ссылка на согласие",onClick:a,children:"Я согласен"}),o(wl,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]}))),mx=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=pn(dx),s=l((()=>r({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[ox(i),o(Oe,{font:"font-light",children:e})]}):null})),ux={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},hx=Lt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=_();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",ux[r]),role:"list",children:i.map(px(d,l))}):null]})})),px=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?gx(t)(n,a):sx(e,t)(n,a)},gx=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(mx,{...a,icon:e,href:fx(t)?t?.href:t?.attachment?.src}),o(Ae,{__html:t?.__html})]},String(n)):null},fx=e=>"href"in e,xx=Lt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ie,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Be,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:qe(a,{className:"flex-wrap"}),children:[i?o(Oe,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Ae,{__html:r,itemSize:"list-m"}):null,o(Oe,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ie,{className:"w-fit",image:d})}):null,l?.src?o(ie,{className:"lg:hidden",image:l}):null]})]})})})),yx=(e,t)=>e&&"underlined"!==t?"primary":"secondary",bx=(e=[],t={})=>e.filter((({content:e={}})=>su(t,e))).length,vx=(e,t)=>e===t;const Nx=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,a])=>e(a,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(vx,((e=vx)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),wx=[],Cx={},Sx={primary:"bg-white/30",secondary:"bg-main-divider"},kx={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Ix=d((({count:e,version:t="secondary"})=>{const n=Te(),a=n?"bg-main-divider":Sx[t],i=kx[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Oe,{size:"text-xs",color:i,children:e})})})),Tx=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ie,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},Rx={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Px={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Bx={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Ex={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},_x=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Rx[a],n?Ex[a]:Bx[a]),"aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Px[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Tx({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Ix,{count:m,version:yx(n,a)})}):null]})})})),Dx=d((e=>o(e?.item?.href?Ax:Mx,{...e}))),Ax=d((e=>{const t=fe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(_x,{...e,tag:"a",item:i,onClick:a})})),Mx=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(_x,{item:e,onClick:a,...n})})),Ox=(e,t,n)=>(a,i)=>o(Dx,{isActive:a===e,onClick:t,type:n,item:a},String(i)),zx=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Ox(a,i,t))}))),Vx={categories:[],extraOptions:[],propertyType:[],stage:[]},Fx=Lt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=cu(Vx,{block:i.block,page:i.options?.page}),f=l(((e=Vx)=>p(e)),[]),x=(({hotFilters:e=wx,filtrationState:t=Cx,blocks:n=wx,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Nx(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:bx(n,t.filter),version:yx(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(zx,{...x}),o(tu,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(Jm,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Lx="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",jx=d((({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(ti,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]],[m,{toggle:u}]=ln(!1);return o("div",{children:e?.length?o("div",{children:c(Cr,{children:[c("div",{children:[o("div",{className:Lx,children:s}),o(Sr,{className:Lx,isUnfolded:m,children:d})]}),c("div",{className:"flex space-x-lg",children:[a?o(wr,{label:m?"Меньше фильтров":"Больше фильтров",isUnfolded:m,embedded:!0,short:!0,onClick:u}):null,c(wl,{embedded:!0,onClick:n,children:[o(vr,{children:"Очистить фильтр"}),o(G,{name:"CloseIcon",size:"small"})]})]})]})}):null})})),$x=(e,t,n)=>{const a=yx("all"===t),i=yx("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(wl,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(wl,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},Ux=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Ae,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ie,{image:e.image}):null,e?.text?o(Oe,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,qx=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Oe,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Wx=()=>{},Hx=e=>"all"===e?"block":"hidden",Yx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=Wx,renderRemoteWorkplaceCard:r=Wx,getBalloon:s=Wx,getBalloonRemoteWorkplaces:d=Wx,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=un(Yr),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=Zr({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all");return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[qx(h,N),m?Ux(m):null,p&&$x(t,w,C),o("div",{className:u("pb-3xl",Hx(w)),children:o(jx,{filters:Gx([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:Gr})})]}),o("div",{className:"h-[600px]",children:o(es,{children:o(gs,{points:b,isLoad:n,className:"h-full"})})})]}),c(es,{children:[y.map(l),v.map(r)]})]})})),Gx=e=>Object.keys(Yr).filter((t=>e.filter((e=>Kr[t](e))).length)),Kx=e=>e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"",Xx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Kx(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Oe,{size:"text-h4",children:Kx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Oe,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Or,{color:"green",children:Kx(s)})})]}),o(kr,{children:o(br,{className:"flex-wrap",children:m?.map(((e,t)=>o(gr,{...e},String(t))))})})]},String(d))},Jx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Kx(t)} №${n}`,body:e.toUpperCase()}),Zx=[];const Qx=async e=>{const t=await _t(e,{method:"GET"});return Array.isArray(t)?t:Zx},ey={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ty={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},ny=d((({descriptionData:e,className:t})=>{const n=$g(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=Hn(`${Ht}/atms?regionCode=${e}`,Qx);return{data:t||Zx,isLoad:!t&&!n}}(a);return o(Yx,{className:t,filterItems:ay,data:i,isLoad:l,initFilterState:ey,renderCard:Xx,getBalloon:Jx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),ay=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>ty[t](e))),n=!a.length||a.some((t=>ty[t](e)));return t&&n}))},iy=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Oe,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(G,{name:"GeolocationIcon",width:"24",height:"24"}),o(Oe,{size:"text-l",children:e})]}):null]})}),o(kr,{children:ly(t)})]},String(n)):null,ly=e=>c("div",{children:[c(br,{className:"flex",children:[o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Оформление и обслуживание банковских карт"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Инвестиционное и накопительное страхование"})}),o(gr,{label:"Операции для физических лиц",children:o(Oe,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(gr,{label:"Режим работы",className:"max-w-none",children:o(Oe,{children:e})})]}),ry=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),sy={branches:[],remoteWorkplaces:[]};const oy=async e=>await _t(e,{method:"GET"})||sy,cy=d((({className:e})=>{const t=$g(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=Hn(`${Ht}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,oy);return{data:t||sy,isLoad:!t&&!n}}(n);return o(Yx,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:qr,renderRemoteWorkplaceCard:iy,getBalloon:Hr,getBalloonRemoteWorkplaces:ry,title:`Офисы филиала ${t?.name}`})})),dy=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(cy,{}):o(ny,{descriptionData:e})})})),my=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),uy=d((({className:e,padding:t,slides:n=[],...a})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...a,children:o(Km,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(et,{className:"px-5 h-full",headlineVersion:"L",...e,...a})},String(t))))})}))),hy=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Ue(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ie,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?py({__html:l,richVersion:r}):null,gy({label:"Адрес",data:e,iconName:"GeolocationIcon"}),gy({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),gy({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?qe([a]):null]})]}))),py=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ae,{...e,itemSize:"list-s"})}),gy=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(G,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Oe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Oe,{size:"text-xl",color:a,children:t})]})]}):null,fy=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Ae,{__html:t,richVersion:n})})})),xy=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",yy=Lt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,foldButtonVersion:a="default",label:i,version:l,role:r,...s})=>{const d=Te(),[m,{toggle:h}]=ln(t),p=o(Sr,{className:u("gap-lg",xy(d)),isUnfolded:m,children:E({...s,extraProps:{className:"w-full",padding:"p-0"}})}),f="accordion"===a,x=o(wr,{className:u(f?"text-h6 my-lg":"text-h4"),label:i,isUnfolded:m,embedded:f,onClick:h});return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:r,...s,children:c(Cr,{children:[n?x:p,n?p:x]})})}),{childrenTypes:{exclude:["RollupItem"]}}),by=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(bn.split(" ").filter((e=>"rounded"!==e)),Qa,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(Oe,{color:"text-primary-text",children:t}):null]})}))),vy=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(by,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(by,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Ny=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(_n,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),wy=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Cy=["От 1 дня","До 365 дней"],Sy=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Oe,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ra,{min:1,max:365,value:e,items:Cy,onChange:t})]}))),ky=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Ny,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Iy=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(wy,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Ty(m)}),o(Sy,{days:i,setDays:e=>m({days:e})}),o(ky,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Ry(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Oe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(vy,{}),o(wl,{className:"order-6",version:"primary",onClick:u,children:"Офисы на карте"})]})]}))),Ty=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Ry=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Py=d((({days:e,tariffs:t=[]})=>{const n=Ey(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[By("Аренда за",e),By("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(G,{className:"@xl:h-60",name:"PackA4Icon"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),By=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Oe,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Ey=(e,t)=>{const n=_y(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},_y=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},Dy=(e,t)=>e.find((e=>e.branchCode===t)),Ay=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Dy(a,n.selectedBranch),d=My(s?.safeBoxCaseVolumes),m=Oy(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=zy(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Iy,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(Py,{days:n.days,tariffs:u})]})})),My=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Oy=(e,t)=>e?.find((e=>e.volume===t)),zy=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Vy=`${Ht}/safeboxes`,Fy=[];const Ly=async e=>await _t(e,{method:"GET"})||Fy,jy=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Di(),p=$y(m.selectedRegion,h),f=function(e){const{data:t}=Hn(e?`${Vy}?regionCode=${e}`:null,Ly);return t||Fy}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Dy(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Ay,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(gs,{points:y,className:"h-[640px]"}):null]})})),$y=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Uy={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"},qy=(e,t,n)=>(a,i)=>{const{button:l}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:Wy(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Hy(a),l?.text?o(Ce,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(i))},Wy=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=Yy(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:Gy({step:n,iconVersion:i,i:a,stepVersion:t})})})},Hy=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",Uy.description),children:e.description}):null,o(Ae,{__html:e.__html})]}),Yy=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Gy=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return Ue(e?.icon)?o(ie,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?Uy.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},Ky=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:l="gray",version:r="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(qy(d,r,l))}):null,qe(i,{isVertical:!0})]})})),Xy=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(G,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Jy=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Cl,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function Zy(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const Qy=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}();return Zy(pe.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},eb=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let l=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++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/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 tb=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Oe,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(nb,{...e},String(t))))})]}):null,nb=d((({icon:e,...t})=>{const n=fe(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ie,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(Oe,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),ab=(e,t)=>n=>n.name?o(Gh,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:rm(e,n.name),children:o(Oe,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,ib=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(bn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),lb=d((({defaultLocation:e})=>{const t=$g(e),n=fe(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Gh,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),rb=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=Ug(t?.default),[s,d]=a(""),m=Di(),u=r((()=>ob(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,sb)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(Sl,{className:"pb-20",head:c("div",{children:[o(Oe,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(lb,{defaultLocation:t?.default}),o(ib,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&eb(e.toLowerCase())(s.toLowerCase())>=.8)).map(ab(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Oe,{size:"text-h6",children:e})}),t.map(ab(f,g))]},e)))}),tb(e)]});var g,f})),sb=e=>e.name?.charAt(0)??"",ob=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),cb=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=pn(rb,n),{name:r}=$g(),s=e?.current?.getBoundingClientRect(),c=Z(J.SITE_URL);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(Jy,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),db="burgerMenuDialog",mb=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=yn})=>{const{open:i}=pn(cb),[r]=Qy(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(db,r),o=l((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:db})),[e,n,t,a]);return[s,{toggle:s?a:o}]},ub=[],hb=Lt((({sticky:e,...t})=>{const{menuItems:n=ub}=e??{},i=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=a(-1),[f,x]=a(""),{closeAll:y}=ge(),b=l((()=>{p(-1),x(""),y()}),[y]),v=fn(b),N=s(null),[C,{toggle:S}]=mb({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:r,close:s}=ge(),c=l((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return l(((l,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();r({id:"left"===d?n[l].title:a[l].title,dialog:o(Jy,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[l].description||m[l].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[l]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=l((e=>{e.stopPropagation(),b(),S()}),[b,S]),T=l(((e,t)=>{x(t),p(e),y(),k(e,t)}),[y,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(pb(T,"left",{activeIndex:h,currentItemPosition:f})),o(Xy,{item:i,isActive:C,onClick:e=>I(e)}),u.map(pb(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),pb=(e,t,n)=>(a,i,l)=>o(Xy,{item:a,isActive:l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||r.stopPropagation(),e(i,t)}},a.title||String(i)),gb="hidden sm:flex absolute z-40",fb={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},xb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=Vm({itemCount:t?.length||0});return i((()=>yb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Bm,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:fb[l].item,gap:fb[l].gap,children:t.map(Ox(n,a,l))}),s.canScrollLeft?o(Um,{wcmsIgnore:!0,className:u("left-6",gb,fb[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(qm,{wcmsIgnore:!0,className:u("right-6",gb,fb[l].buttonTop),onClick:s.scrollRight}):null]})})),yb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},bb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},vb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(bb[t].wrapper,e),children:o(xb,{className:bb[t].component,tabsType:t,...n})}):null,Nb=Lt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=wb(n??{}),p=_(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=a(kb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=Sb(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[vb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Cb(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>B(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Sb)?.filter(Boolean)||[]}),wb=({__id:e,anchor:t})=>t??e??"tabs",Cb=(e,t)=>t?.length?t:e,Sb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",kb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Ib={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Tb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ib[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),Rb=d((({className:e="",isOpen:t,onClick:n})=>o(wr,{className:e,label:t?"Скрыть":"Показать",isUnfolded:t,version:"secondary",short:!0,onClick:n}))),Pb={Buttons:({buttons:e})=>qe(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ie,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Ae,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Oe,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Oe,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(Rb,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},Bb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return Eb({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Eb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in Pb))return null;return o(Pb[n],{...t,...a})},_b=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(Bb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Db=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Ab=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Oe,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Mb=d((({rows:e})=>{return o(Bm,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Oe,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Db(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Oe,{size:"text-xl",children:e.data}):null,e?.cols?Ab(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Ob=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Oe,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Mb,{rows:t.rowsData})})})]},a)}))}))),zb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Vb=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Oe,{size:"text-xl",font:"font-light",color:zb(t===n),children:e||t+1})},e)))}):null,t?o(Ce,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(G,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Fb=Lt((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Vb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Ob,{activeTabIndex:r,items:m}),o(Rb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Oe,{size:"text-h6",children:"Данных нет"}),o(Rb,{onClick:n,isOpen:!0})]})})),Lb=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Fb,{...t,onClick:n})}):null]}))),jb=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(Lb,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ie,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Oe,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Tb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(_b,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),$b=({className:e,btnClass:t,canDec:n,canInc:a,dec:i,inc:l})=>n||a?c("div",{children:[n?o(Um,{wcmsIgnore:!0,className:u("absolute z-40",t[0],e),onClick:i}):null,a?o(qm,{wcmsIgnore:!0,className:u("absolute z-40",t[1],e),onClick:l}):null]}):null,Ub=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,$b({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),qb=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(jb,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]],[N,{toggle:w}]=ln(!1);return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?c(Cr,{children:[c(Ub,{controls:x,children:[b,o(Sr,{isUnfolded:N,children:v})]}),o(wr,{className:"text-h4",isUnfolded:N,onClick:w})]}):o(Ub,{controls:x,children:y})})]})})),Wb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?Hb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Oe,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Yb(n):null,i?o(Ae,{richVersion:l,__html:i}):null]})]}))),Hb=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),Yb=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Gb=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Oe,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Oe,{size:"text-h2",children:n})}):null]}))),Kb=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Gb,{prefix:t,unit:n,suffix:a})})})),Xb={AdTile:$t,ApplicationForm:Ll,BankAccountFiltration:uu,BenefitsBlock:xu,BonusBenefitsBlock:vu,ButtonsBlock:wu,CalculatorBonus:Pu,CalculatorBusinessDeposit:Fu,CalculatorCredit:Oo,CalculatorDeposit:oh,CalculatorRefinancing:yh,CardTransfer:Ph,Carousel:zh,CarouselCard:jh,CarouselCatalogCard:Uh,CarouselLinks:Hh,CarouselRecommendationCard:Qh,CarouselTariffsCard:ap,DepositFiltration:wg,Depository:Vg,ErrorBlock:Lg,ExchangeRateTile:yf,Footer:Af,GrantSupport:Mf,Header:Zf,Headline:k,HorizontalLayout:nx,ImgBlock:ax,LinkDocs:hx,MobileAppTile:xx,MortgageFiltration:Fx,OfficesAtmsMap:dy,Placeholder:my,ProductBlock:jt,ProductGallery:uy,RepresentativeOfficeInfo:hy,RichTextBlock:fy,RollupItem:yy,SafeDepositRental:jy,StepsBlock:Ky,StickyBottomMenu:hb,TabsLayout:Nb,TariffsTable:qb,TextBlock:Wb,UnitBlock:Kb,VerticalLayout:tx,ApplicationLeadForm:bm,CreditCardForm:Zp,CreditForm:xg},Jb=me((()=>{i((()=>{tn()}),[]);const e=an();gn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Zt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Zb="cookie",Qb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=ln();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(Zb)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(Zb,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Ae,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Cl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function ev(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);gn(globalThis.document,"keydown",t)}const tv=d((()=>{const[e,{close:t}]=Qy(),n=Boolean(e.length);return ev(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),nv=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return Zy(pe.observable,"popup",{open:t,close:n}),ev(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",title:"Всплывающее окно",children:e.popup}):null})),av="header",iv="footer",lv="sticky-footer",rv={},sv=d((({className:e,data:t=rv,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Vt(s,r);Jb(),Ug();const m={key:"",page:{slots:i,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[av]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:B(i?.[av],{...m,slotName:av})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[E({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),B(i?.[iv],{...m,slotName:iv})]})]}),i?.[lv]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:B(i?.[lv],{...m,slotName:lv})}):null,o(tv,{}),o(nv,{}),o(Qb,{__html:d?.cookieContent?.__html})]})}));Object.assign(sv,{childrenTypes:[],slots:()=>[av,iv,lv]});e.Blocks=Xb,e.ContentPage=sv,e.handlerDecorator=me,e.joinList=Qm,e.locationNavigator=Qt,e.packageVersion="0.14.809",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=_,Object.defineProperty(e,"__esModule",{value:!0})}));
|