@redneckz/wildless-cms-uni-blocks 0.14.261 → 0.14.263

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.
Files changed (83) hide show
  1. package/bundle/bundle.umd.js +6 -4
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
  4. package/bundle/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
  5. package/bundle/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
  6. package/bundle/data/StickyMobileData.d.ts +2 -2
  7. package/dist/components/OfficesAtmsMap/renderWorkSchedule.js +5 -3
  8. package/dist/components/OfficesAtmsMap/renderWorkSchedule.js.map +1 -1
  9. package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js +22 -42
  10. package/dist/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
  11. package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
  12. package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +17 -0
  13. package/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -0
  14. package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
  15. package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js +15 -0
  16. package/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -0
  17. package/dist/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
  18. package/dist/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
  19. package/dist/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
  20. package/dist/data/StickyMobileData.d.ts +2 -2
  21. package/lib/common.css +1 -1
  22. package/lib/components/OfficesAtmsMap/renderWorkSchedule.js +5 -3
  23. package/lib/components/OfficesAtmsMap/renderWorkSchedule.js.map +1 -1
  24. package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js +23 -43
  25. package/lib/components/StickyBottomMenu/StickyBottomMenu.mobile.js.map +1 -1
  26. package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
  27. package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +15 -0
  28. package/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -0
  29. package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
  30. package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js +12 -0
  31. package/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -0
  32. package/lib/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
  33. package/lib/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
  34. package/lib/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
  35. package/lib/data/StickyMobileData.d.ts +2 -2
  36. package/mobile/bundle/bundle.umd.js +54 -52
  37. package/mobile/bundle/bundle.umd.min.js +1 -1
  38. package/mobile/bundle/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
  39. package/mobile/bundle/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
  40. package/mobile/bundle/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
  41. package/mobile/bundle/data/StickyMobileData.d.ts +2 -2
  42. package/mobile/dist/components/OfficesAtmsMap/renderWorkSchedule.js +5 -3
  43. package/mobile/dist/components/OfficesAtmsMap/renderWorkSchedule.js.map +1 -1
  44. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js +22 -42
  45. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
  46. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
  47. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js +17 -0
  48. package/mobile/dist/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -0
  49. package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
  50. package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js +15 -0
  51. package/mobile/dist/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -0
  52. package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
  53. package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
  54. package/mobile/dist/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
  55. package/mobile/dist/data/StickyMobileData.d.ts +2 -2
  56. package/mobile/lib/common.css +1 -1
  57. package/mobile/lib/components/OfficesAtmsMap/renderWorkSchedule.js +5 -3
  58. package/mobile/lib/components/OfficesAtmsMap/renderWorkSchedule.js.map +1 -1
  59. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js +23 -43
  60. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenu.js.map +1 -1
  61. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.d.ts +9 -0
  62. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js +15 -0
  63. package/mobile/lib/components/StickyBottomMenu/StickyBottomMenuDialog.js.map +1 -0
  64. package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.d.ts +19 -0
  65. package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js +12 -0
  66. package/mobile/lib/components/StickyBottomMenu/useBottomMenuItemDialog.js.map +1 -0
  67. package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.d.ts +0 -1
  68. package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.js +1 -1
  69. package/mobile/lib/components/StickyBottomMenu/useBurgerMenuDialog.js.map +1 -1
  70. package/mobile/lib/data/StickyMobileData.d.ts +2 -2
  71. package/mobile/src/components/OfficesAtmsMap/renderWorkSchedule.tsx +12 -5
  72. package/mobile/src/components/StickyBottomMenu/StickyBottomMenu.tsx +27 -67
  73. package/mobile/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +39 -0
  74. package/mobile/src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx +54 -0
  75. package/mobile/src/components/StickyBottomMenu/useBurgerMenuDialog.tsx +1 -2
  76. package/mobile/src/data/StickyMobileData.ts +2 -2
  77. package/package.json +1 -1
  78. package/src/components/OfficesAtmsMap/renderWorkSchedule.tsx +12 -5
  79. package/src/components/StickyBottomMenu/StickyBottomMenu.mobile.tsx +27 -67
  80. package/src/components/StickyBottomMenu/StickyBottomMenuDialog.tsx +39 -0
  81. package/src/components/StickyBottomMenu/useBottomMenuItemDialog.tsx +54 -0
  82. package/src/components/StickyBottomMenu/useBurgerMenuDialog.tsx +1 -2
  83. package/src/data/StickyMobileData.ts +2 -2
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),r=l("useCallback"),i=l("useMemo"),s=l("useRef");const o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,l){const{children:n,...a}=t||{},r=l?.slots?.default,i=n||r&&r();return e(Object.assign(a,i&&{children:i}),l)}return t.inheritAttrs=!1,t};const h=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const l=this.subjectsStateMap[e];return l&&t(l),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}};function u(){return u._impl()}u._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),u.setup=e=>{u._impl=e};const p=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),g={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},x=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:r="p-xl",padding:i,block:s,tag:c="section",role:d,children:m,style:x})=>{const f=c,b=u(),[y,v]=n(!1);a((()=>h.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||v(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,b]);const N=t&&l;return o(f,{className:p("@container font-sans",N?"group":"",g[t],y?"hidden":"",i||r,e),...N?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:d,style:x,children:m})})),f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=d((({children:e})=>f?e:null)),y=d((({className:e,size:t})=>o("figure",{className:p("m-0 mt-xl min-w-[80%]",e),children:v(t)}))),v=(e=3)=>w(100,e).map((e=>Math.floor(e))).map(N),N=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),w=(e,t)=>[e].concat(t>0?w(e/1.618,t-1):[]),C={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},k=d((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>o(l,{role:"heading",className:p("font-sans m-0",C[t],e),children:n||a}))),S=d((({children:e,...t})=>o("p",{className:p("font-sans",Object.values(t)),children:e}))),I={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},T=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:r="text-center",as:i,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=I[l],u={marginTop:h.descriptionStyle};return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(k,{className:p("whitespace-pre-wrap",r),...h?.title,as:i||h?.title.as,title:n}):null,a?o(S,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...u,children:a}):null]})})),B=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),M=[];function P(e,t,{className:l,...n}={}){const{key:a,blockDecorator:r=B,blocksRegistry:i={},ancestors:s=M}=t,{type:c}=e;c&&c in i||console.warn(`No block with "${c}" is registered`);const d=c&&i[c];return r({blockClassName:p(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:r})=>{const{content:i}=l;return d?o(d,{className:r,block:e,options:t,...i,...n},a):null}},a)}const R=[],V=(e,{key:t,ancestors:l=R,slotName:n=null,extraProps:a,renderProps:r=P,...i})=>{const s=a?(e,t)=>P(e,t,a):r;return(e||[]).map(((e,a)=>s(e,{...i,key:`${t||e.type}-${a}`,ancestors:i.parent?[...l||R,[i.parent,n]]:l},a)))};function z({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?V(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const A=e=>e&&!e.endsWith("/")?`${e}/`:e,D=["CDN","BASE_PATH"],j=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return D.includes(t)?A(l):l}}),$=e=>Boolean(e?.includes(":")),L=(e,t)=>Boolean(e&&!$(e)&&(!t||"_self"===t)),E=e=>Boolean(e?.startsWith("#")),O=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var _=Object.freeze({__proto__:null,isURL:$,isLocalURL:L,isHash:E,withoutQuery:O,joinPath:F});const U="/api/",H=`${U}v1/storage`,W=e=>(t,l=j.BASE_PATH)=>{if([!t,$(t),E(t),[j.CDN,U].some((e=>K(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${H}/${t}/attachment`;const n=t?.startsWith("/");return F(K(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},K=(e,t)=>t&&e&&e.startsWith(t),q={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},X=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:r="color",width:i,height:s})=>{const d=u(),m="normal"===r?`${l}.svg`:`sprites.svg#${l}`,h=W(d)(F(j.CDN,"/icons/",m));return"normal"===r?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:i,height:s,style:Y(e,s)}):o(Q,{className:e,children:c("svg",{className:p(G(i),q[r],"white"===r?"invert":"",t),width:i,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,n?o("desc",{children:n}):null,o("use",{href:h,xlinkHref:h})]})})})),Y=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},G=e=>e?"":"w-full h-full",Q=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),Z=(e,t)=>l=>l&&!$(l)?W(e)(F(t,l)):l,J=(e,t)=>e?.media&&t?.media?e.media-t.media:0,ee=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=u();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(J).map((({src:e,format:l,media:r},i)=>o("source",{srcSet:Z(a,n)(e),type:le(l),media:r?`(max-width: ${r}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?te({...t,src:Z(a,n)(t.src)},l):null]})})),te=(e,t="")=>o("img",{src:e.src,className:p("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),le=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?o(X,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):o(ee,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),ae={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",ie={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},se="text-center font-sans select-none",oe={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","":""},ce=({className:e,rounded:t,version:l})=>[se,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?ae[l]:"",t?"rounded-full":"rounded-md",e].join(" "),de=()=>({open:(e,t={})=>h.fire("dialog",{type:"open",dialog:e,...t}),close:()=>h.fire("dialog",{type:"close"}),closeAll:()=>h.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function he(e={}){const{isRemote:t,basePath:l}=e,n=u(),{closeAll:a}=de();return e=>({...e,href:t&&!l?e.href:W(n)(e.href,l),"aria-label":e.text,onClick:me(r(e))});function r({href:e,target:l,onClick:r}){return i=>{r&&r(i),e&&!t&&L(e,l)&&(a(),i?.preventDefault(),n.push(e))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const ue=(e={})=>Object.entries(e).reduce(((e,[t,l])=>({...e,[`data-${t.toLowerCase()}`]:l})),{}),pe=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:r="primary"}=e,i=xe(e)?"hidden lg:block":"";return c("div",{className:p(ge(e),"flex gap-xs"),children:[n?o("div",{className:p(i,oe[r]),children:n}):null,xe(e)?c("div",{className:"whitespace-pre",children:[l?o("div",{className:"text-xs font-light text-left",children:l}):null,o("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:p(i,oe[r]),children:a}):null]})})),ge=e=>{const{version:t,aboveText:l,rounded:n}=e;if("link"===t)return"";const a=""+(l?"py-2.5 px-9":"py-4 px-9");return p("group/btn items-center justify-center",xe(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},xe=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),fe=({className:e,rounded:t,version:l})=>["inline-block",se,l?ie[l]:"",t?"rounded-full":"rounded-md",e].join(" "),be=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const i=(({method:e,href:t})=>r((l=>{if("POST"!==e||!t)return;l.preventDefault(),l.stopPropagation();const{origin:n,pathname:a,searchParams:r}=new URL(t||""),i=document.createElement("form");i.setAttribute("method","POST"),i.setAttribute("action",[n,a].join(""));for(const[e,t]of r.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),i.appendChild(l)}document.body.appendChild(i),i.submit()}),[]))({method:l,href:n}),s=he()({onClick:i,href:n,...a}),c=t??o(pe,{...s});return o(e?ve:ye,{...s,children:c})})),ye=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:r,rounded:i,onClick:s,type:c,data:d,children:m})=>o("a",{className:ce({className:e,version:r,rounded:i}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,...ue(d),children:m}))),ve=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:fe({className:e,rounded:n,version:l}),children:a})));function Ne(e,t,l=!1){const n="primary"===e?"white":"black",a="Вернуться назад";return c("div",{className:p(l?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:ce({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:n}})}),o(be,{version:"link",className:"group-data-secondary:text-white/80",text:a,ariaLabel:a,onClick:t,type:"button"})]})}const we={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ce=d((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a="",insetTitle:i="",buttons:s,leftImage:d,rightImage:m,imageAlign:h,isImageAlwaysOnRight:g=!1,isImageSecondary:x=!1,backwardButton:f,children:b,...y})=>{const v=u(),N=r((()=>{v.back()}),[]);return c("div",{className:ke(n,l,e),children:[f?Ne(t,N):null,a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:p("grow relative flex flex-col @xl:flex-row gap-3xl w-full",d?"self-start @xl:w-auto":""),children:[Me(d,{imageAlign:h,className:"mx-auto"}),c("div",{className:p("grid gap-3xl",m?"@xl:grid-cols-2":"",d?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[i,b]}),Be(z({...y,extraProps:{className:"@container-normal"}})),Me(m,{className:p("@xl:justify-self-end @xl:col-start-2",s?Se(g):"",Ie(g),Pe(x)),imageAlign:h}),Te(s)]})]})]})})),ke=(e="",t="",l="")=>p("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Se=e=>e?"row-span-2":"@xl:row-span-2",Ie=e=>e?"col-start-2 self-center":"",Te=e=>e?o("div",{className:"self-end",children:e}):null,Be=e=>e&&e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Me=(e,{className:t,imageAlign:l})=>e?o("div",{className:p("shrink-1/2 justify-self-center",l&&we[l],t),children:e}):null,Pe=e=>e?"hidden @xl:block":"",Re=(e=[])=>e.reduce(((e,t)=>e+t),0),Ve=(e=[])=>e?.length?Re(e)/e.length:0,ze=(e,t="normal")=>e?o("div",{className:p("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Ae=d((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:p(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(S,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,je=d((({children:e,...t})=>o("span",{className:p("font-sans",Object.values(t)),children:e}))),$e=(e,t)=>e?o(je,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Le=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?o(Ae,{...e},`rte-${t}`):["label"in e?$e(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null],Ee=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:p("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?ze(l.icon,t):null,o("div",{children:Le(l)})]}))),Oe=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),Fe=e=>{return((t=e.map(Oe))?.length?Math.sqrt(Math.abs(Ve(t.map((e=>e**2)))-Ve(t)**2)):0)>16;var t},_e=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Ue=e=>!e.some(_e),He=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:p("flex gap-x-m gap-y-s",Fe(l)||Ue(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Ee,{benefitsVersion:t,...e},String(l))))}):null)),We=d((({className:e,benefits:t})=>t?.length?o("div",{className:p("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Le)}):null)),Ke=d((({isTabularBenefits:e,...t})=>o(e?We:He,{...t}))),qe=e=>Boolean(e?.src||e?.icon),Xe=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:p("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),role:"group",children:e.map(Ye(l))}):null,Ye=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:r,version:i,...s}=t||{},c=Ge(a,i),d=Ge(r,i);return n||a?.icon?o(be,{className:p("basis-full @lg:basis-auto",e),appendLeft:Qe({...a,iconVersion:c}),appendRight:Qe({...r,iconVersion:d}),version:i,text:n,...s},l?String(l):""):null},Ge=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Qe=e=>qe(e)?o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Ze=d((({className:e,isDotted:t,dotClassName:l,children:n})=>c("div",{className:p("font-sans flex",e),role:"listitem",children:[t?o("div",{className:"shrink-0",children:o("div",{className:p("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,o("span",{children:n})]}))),Je={S:{textSize:"text-l font-light",indentStyle:"ml-xs",dotStyle:"w-1 h-1 mr-xs"},M:{textSize:"text-h6",indentStyle:"ml-s",dotStyle:"w-1.5 h-1.5 mr-s"},L:{textSize:"text-h5",indentStyle:"ml-m",dotStyle:"w-1.5 h-1.5 mr-m"}},et=d((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const r=Je[n];return l?.length?o("section",{className:p("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",r.textSize,e),role:"list",children:l.map(((e,l)=>o(Ze,{isDotted:t,dotClassName:p(a||"bg-primary-text",r.dotStyle),children:e},String(l))))}):null})),tt=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),lt=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(nt)}):null)),nt=({label:e,amount:t},l)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(je,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[tt(2)(t)," ₽"]}):null]},String(l)),at=d((({className:e,tags:t})=>t?.length?o("div",{className:p("flex flex-wrap gap-xs",e),role:"list",children:t.map(rt)}):null)),rt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(je,{size:"text-m",font:"font-light",children:e})},String(t)),it={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},st=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:r="L",align:i="text-left",benefitsVersion:s,isTabularBenefits:d,benefits:m,__html:h,isFullWidthTitle:u,items:p,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:k,children:S,...I})=>{const B=y?.src?o(ne,{image:y}):null,M=o(T,{title:n,description:a,headlineVersion:r,align:i,isEmbedded:!0}),P=m?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return o(Ce,{className:e,padding:t,defaultPadding:l,...u?{title:M}:{insetTitle:M},...ot(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Xe(b),backwardButton:k,...I,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Ke,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Ae,{__html:h}):null,p?.length?o(et,{items:p,isDotted:g,listItemSize:it[r]}):null,S,x?.length?o(lt,{priceList:x}):null,ct(f)]})})})),ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(at,{tags:e}):null,dt=e=>Boolean(e&&Array.isArray(e)),mt=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),ht=(e,t)=>{return l=e,Boolean(mt(l)&&"string"==typeof l.$ref)?t.ref(e):mt(e)?t.record(e):dt(e)?t.array(e):t.scalar?t.scalar(e):e;var l},ut=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(pt,e),pt=(e,t)=>e&&t?mt(e)?e[t]:dt(e)?e[parseInt(t,10)]:e:e,gt=(e,t)=>ht(e,{ref:({$ref:e,...l})=>gt(e?ut(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:gt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>gt(e,t)))}),xt=(e,t,l=[])=>{ht(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)xt(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)xt(e[n],t,[...l,n])}})};async function ft(e,t){try{return e?await bt(e,t):null}catch(e){console.error(e)}return null}const bt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),yt=e=>[...new Set(e)],vt={},Nt=["/portal-resources"],wt=(e,t)=>gt(e,(e=>t?.[e])),Ct=(e,t)=>{const l=(e=>{const t=[];return xt(e,(e=>t.push(e))),t})(e),[r,i]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(yt(e).filter((e=>!Nt.some((t=>e.startsWith(t))))).map((async e=>[e,vt[e]||=await bt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(i)}),[l.join()]),l.length?wt(e,{...t,...r}):e};function kt(e,t={}){const l=d((t=>{const l=Ct((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:r,version:i,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const St=kt((({className:e,padding:t,...l})=>o(x,{className:p("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(st,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),It=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=i((()=>Tt(0,t?.length)),[t]),n=t?.[l];return n?o(b,{children:o(St,{...n,...e})}):o(x,{...e,children:o(y,{})})})),Tt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Bt=e=>e?.replace(/[^+\d]/g,"");function Mt(){return{send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead",{typeForm:n,region:a,phone:r="",email:i,birthday:s,inn:o,fullName:c,addressBranch:d,secondaryPhone:m="",bankEmpolee:h,applicationDate:u,...p}=e,g={typeForm:n,[t?"regionBranch":"region"]:a,[t?"email":"mail"]:i,...Pt(r),...t?{birthday:s?.toLocaleString()}:{inn:o,fullName:c},..."FEEDBACK"===n?{}:{addressBranch:d,bankEmpolee:h,applicationDate:u,...Rt(m)},...p};try{const e=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(g)});if(!e?.ok)return null;return await e.json()}catch(e){return null}}}}const Pt=(e,t)=>e?{[t?"phoneNumber":"phone"]:Bt(e)}:{},Rt=e=>e&&"+7 ("!==e?{secondaryPhoneNumber:Bt(e)}:{},Vt=d((({responseType:e})=>{const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon";return c("div",{className:p("flex items-center p-lg rounded-md space-x-m",t?"bg-ok":"bg-fail"),children:[o(ne,{image:{icon:l,iconVersion:"normal"},width:"42",height:"42"}),c("div",{children:[o(k,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),o(je,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),zt=e=>e,At=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,i]=n(e),[o,c]=n(!1),[d,m]=n({}),h=s({}),u=r(((e,t)=>{const{parse:l=zt,format:n=zt}=t||{};return h.current||(h.current={}),h.current[e]||=t=>{i((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:h.current[e]}}),[a,o,d]),p=r((e=>{i(e),m(e)}),[]),g=r((()=>{i(e),c(!1),m({})}),[e]),x=r((e=>{e.preventDefault(),t?g():c(!0),l&&l(a)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:u,update:p,reset:g,onSubmit:x}]},Dt=e=>o("div",{className:"h-6",children:e?o(je,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null});function jt(e=!1){const[t,l]=n(e),a=r((()=>l(!0)),[]),i=r((()=>l(!1)),[]),s=r((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:i,toggle:s}]}const $t=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const l=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},Lt=e=>e?o(je,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Et=d((({key:e,className:t="",id:l,name:n,type:i="text",label:d,placeholder:m,value:h="",valid:u=!0,children:g,onChange:x,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),C=r((e=>{x&&x(e.target?.value||"")}),[x]);a((()=>{v&&w.current?.focus()}),[v,w]);const k="w-full border rounded-md text-primary-text outline-none p-m",S=g?"pr-3xl":"",I=Ot(u);return c("div",{className:p("relative",t),children:[c("label",{className:"space-y-xs",children:[Lt(d),N?o("textarea",{className:p("block resize-y min-h-24",k,I),id:p("textarea",l),name:n||l,placeholder:m,value:h,onInput:C,onFocus:f,onBlur:b},e):o("input",{type:i,className:p("h-14",k,S,I),ref:w,id:l,name:n||l,placeholder:m,value:h,onInput:C,onFocus:f,onBlur:b,pattern:y},e)]}),g]})})),Ot=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Ft=e=>e?.text||e?.key||"";function _t(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function Ut(e){const t=s(null),l=r((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return _t(globalThis.document,"click",l),t}const Ht=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Wt=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:r})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Ht(t,n).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Ft(e)}),o(X,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:r,className:p("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function Kt({isOpen:e,options:t,value:l,query:n,onChange:i,onClose:c,iconVersion:d}){const m={open:(e,t)=>h.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>h.fire("popup",{type:"update",popup:e,...t}),close:()=>h.fire("popup",{type:"close"})},u=r((()=>{m.close(),c&&c()}),[c]),p=r((e=>{u(),i&&i(e)}),[u,i]),g=s(null),x=Ut(u);return a((()=>{if(!e||!g.current)return;const a=g.current,{top:r,left:i,width:s,height:c}=a.getBoundingClientRect();m.update(o(Wt,{popupRef:x,options:t,value:l,query:n,onChange:p,iconVersion:d}),{top:r+window.scrollY+c,left:i,width:s})}),[e,t,l,n,p]),g}const qt=d((({className:e,label:t,options:l=[],value:a,valid:i=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h="black",onChange:u,disabled:g})=>{const[x,{setFalse:f,setTrue:b}]=jt(),[y,v]=n(""),N=g||0===l.length,w=x&&!N,C=r((()=>{v(""),f()}),[]),k=Kt({isOpen:x,options:l,value:a,query:y,onChange:u,onClose:C,iconVersion:h});return c("div",{className:p("space-y-xs",e),children:[Lt(t),c("div",{className:p("relative",w?"z-20":"z-10"),ref:k,children:[c("div",{className:p("h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Yt(s,i,N)),onClick:w?C:b,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Ft(a)||d}),Xt(w,h)]}),m&&w?o("div",{className:p("absolute top-0 w-full z-20"),children:o(Et,{type:"text",autoFocus:!0,value:y,onChange:v})}):null]})]})})),Xt=(e,t)=>o(X,{className:p("absolute right-3 flex self-center",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Yt=(e,t,l)=>p(e?"border rounded-md ":"",e&&!l?"hover:border-primary-hover":"",l?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Gt=()=>{},Qt=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:r,max:i,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const h=[];for(let c=0;c<7;c++)if(0===m&&c<t)h.push(o("td",{},`empty-${c}`));else if(d>l)h.push(o("td",{},`empty-${c}`));else{const t=new Date(a,n,d),l=Zt(t,e),c=Jt(t,r,i);h.push(o("td",{children:o("div",{className:el(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},Zt=(e,t)=>t&&e.toDateString()===t.toDateString(),Jt=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),el=(e,t)=>p("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),tl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],ll=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=Gt})=>{const d=r((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=i((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:tl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Qt({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),nl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],al=nl.map((e=>({key:e}))),rl=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),il={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},sl={className:"min-w-32",iconVersion:"black",isBorder:!1},ol=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:i,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=jt(!1),[u,g]=n(l?.getMonth()||(new Date).getMonth()),[x,f]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:b,handleNextMonth:y,handleSelectMonth:v,handleSelectYear:N,monthsOptions:w,yearsOptions:C,handleChangeVisibleCalendar:k,ref:S}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:i})=>{const s=Ut(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{l+1<=11?n(l+1):(n(0),a(i+1))}),[l]),handlePrevMonth:r((()=>{l-1>=0?n(l-1):(n(11),a(i-1))}),[l]),handleSelectMonth:r((({key:e})=>n(nl.indexOf(e))),[]),handleSelectYear:r((({key:e})=>a(Number(e))),[]),monthsOptions:al,yearsOptions:rl,ref:s}})({onYearSelect:f,onMonthSelect:g,onShowCalendar:h,selectedYear:x,selectedMonth:u,showCalendar:m});return c("div",{className:p("space-y-xs",e),ref:S,children:[Lt(t),c("div",{className:"relative",children:[cl(k,l,a),m?c("div",{className:"absolute bg-white z-20 select-none",children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:b,children:o(X,{...il,className:"-rotate-90 cursor-pointer"})}),o(qt,{onChange:v,value:{key:nl[u]},options:w,...sl}),o(qt,{onChange:N,value:{key:String(x)},options:C,...sl}),o("div",{className:"my-auto",onClick:y,children:o(X,{...il,className:"rotate-90 cursor-pointer"})})]}),o(ll,{today:l,currentMonth:u,currentYear:x,onDateSelect:d,min:i,max:s})]}):null]})]})})),cl=(e,t,l)=>c("div",{onClick:e,className:p("flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",l?"border-gray":"border-error"),children:[o(S,{children:t&&$t(t)}),o(X,{...il,name:"CalendarIcon"})]}),dl=d((({className:e,label:t,error:l,...n})=>c("div",{className:p("shrink-0 w-full",e),children:[o(ol,{label:t&&n?.errors?`${t}*`:t,valid:Boolean(!l),...n}),Dt(l)]}))),ml=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:r,onBlur:i,isTextarea:s,type:d,...m})=>c("div",{className:p("shrink-0 w-full",e),children:[o(Et,{type:d||"text","aria-label":t,label:t&&m?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:r,onBlur:i,isTextarea:s,placeholder:m?.errors&&!t?`${n}*`:n}),Dt(a)]}))),hl=e=>"_"===e,ul=e=>/\d/.test(e),pl=e=>hl(e)||ul(e),gl=[..."+7 (___) ___-__-__"],xl=gl.findIndex(hl),fl=gl.map(((e,t)=>pl(e)?gl.slice(0,t).filter(pl).length:-1));const bl=d((({children:e,onChange:t,...l})=>{const n=r((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=gl.map(((e,l)=>ul(e)?e:t.charAt(fl[l])||e)),n=fl.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(xl,n)):l).join("")}(e))),[t]);return o(Et,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),yl=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:r,...i})=>c("div",{className:p("shrink-0 w-full",e),children:[o(bl,{"aria-label":t,label:i?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:r,placeholder:"+7 (___) ___-__-__"}),Dt(n)]}))),vl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(qt,{...n,valid:!l,label:n?.errors?`${t}*`:t}),Dt(l)]}))),Nl=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],wl=e=>!e?.length,Cl=e=>t=>l=>e(l)?[]:[t],kl=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},Sl=e=>null!=e,Il=new Map,Tl=e=>Boolean(e?.every((e=>Array.isArray(e)?Tl(e):!e||"string"==typeof e))),Bl=e=>Tl(e)?e.toString():"";function Ml(e,t,{fallback:l,cache:r}={}){const s=i((()=>Pl(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(Sl))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=Il)=>l=>{const n=Bl(l),a=t.get(n);if(n&&Sl(a))return a;const r=e(...l);return n&&Sl(r)&&t.set(n,Promise.resolve(r)),r})(t,r)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const h=l&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&l[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Pl(e){return Array.isArray(e)?e:e instanceof Function?Pl(e()):[e]}const Rl=[];const Vl=async e=>await ft(e,{method:"GET"})||Rl;function zl(){const{data:e}=Ml("/api/v1/branchesByRegions",bt);return Array.isArray(e)?e:[]}const Al=e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)),Dl="Некорректно заполненное поле",jl=Cl((e=>null!=e&&""!==e))(Dl),$l=Cl((e=>e?.key&&""!==e?.key))(Dl),Ll=Cl((e=>"string"==typeof e&&e.length>1))(Dl),El=Cl((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Dl),Ol=(Fl=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Cl((e=>"string"==typeof e&&Fl.test(e))))(Dl);var Fl;const _l=Cl((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Ul={typeForm:jl,surname:Ll,name:Ll,region:$l,addressBranch:$l,phone:Ol,birthday:jl,email:jl,fullName:Ll,inn:El,partnerComments:jl,collectionCount:jl,comment:jl,acquiringType:$l,serviceType:$l,consentDataProcessing:_l,annualRevenue:jl},Hl=(e,t,l=!1)=>l?kl(e,t):e,Wl=d((({field:e,input:t,isPremium:l=!1})=>{const n=e("region")?.value?.key,r=e("region")?.value?.text,i=l?zl()?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=Ml(e?`/api/v1/branches?regionCode=${e}`:null,Vl);return t||Rl}(n)?.filter((e=>e?.address));return a((()=>{""!==e("region")?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[e("region")?.value]),o(vl,{label:"Адрес",placeholder:"Выберите адрес",options:(i||[]).map((({address:e=""})=>({key:e,text:e}))),...Hl(e("addressBranch"),Ul.addressBranch,t?.required)})}));function Kl(){const{data:e}=Ml("/api/v1/regions",bt);return Array.isArray(e)?e:[]}const ql=d((({field:e,input:t})=>{const l=Kl();return o(vl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:i((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),...Hl(e("region"),Ul.region,t?.required)})})),Xl=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:r,...i})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:r.map((({d:e,fill:t,...l},n)=>{const a={...i,...l};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),Yl=[{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"}],Gl=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:i})=>{const s=r((e=>{n||(e.preventDefault(),i&&i(!t))}),[i,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Xl,{paths:Yl,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:"flex items-center relative cursor-pointer group/box",onClick:s,children:[o("div",{className:p("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":Zl(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Ql(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,l?o("div",{className:"ml-s",children:o(je,{size:"text-l",font:"font-light",children:l})}):null]})})})),Ql=e=>e?"radio":"checkbox",Zl=e=>p("rounded border",e?"bg-primary-main":""),Jl=d((({text:e,link:t})=>c(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[o(je,{children:e}),t?o(be,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:o(je,{children:t.text})}):null]})));function en({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const tn={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"},ln={primary:p("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:p("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},nn=d((({children:e,...t})=>{const l=e=>({...e,onClick:me(en(e))}),{className:n,version:a="primary",active:r,disabled:i,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:p("font-sans px-9 py-4","flex justify-center items-center gap-xs",r?"text-white bg-primary-active":"",i?"bg-main-gray text-main-disabled cursor-not-allowed":"",r||i?"":p(tn[a],ln[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),an=(e,t)=>o(nn,{className:p("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),rn=(e,t,l)=>c("div",{className:"flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3",children:[o(Gl,{...e}),o(Jl,{link:t})]}),Dt(kl(e,_l).error)]}):o(Jl,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),an(l)]}),sn=d((({title:e,children:t})=>c("fieldset",{className:"grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none",children:[e?o("legend",{className:"w-full",children:o(k,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),on=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],cn=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],dn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],mn={surname:"",name:"",middleName:"",typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},hn={typeForm:jl,region:jl,surname:jl,name:Ll,feedbackMethod:jl,phone:Ol,email:jl,comment:jl,consentDataProcessing:_l},un=d((({button:e,link:t,onSubmit:l})=>{const n=r((e=>{pn(e,l)}),[l]),[,{field:a,...i}]=At(mn,{onSubmit:n}),s="FEEDBACK_QS"===a("typeForm").value?.key,d=xn(a("typeForm").value?.key,a("serviceDirection").value?.key);return o("form",{className:"container space-y-m",onSubmit:i.onSubmit,children:o(sn,{children:c("div",{className:"w-full max-w-xl space-y-s m-auto",children:[o(vl,{label:"Тема",placeholder:"Выберите тему",options:on,...kl(a("typeForm"),jl)}),s?o(vl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:dn,...kl(a("serviceDirection"),jl)}):null,o(ql,{field:a}),s?o(Wl,{field:a}):null,c("div",{className:"space-y-s",children:[o(ml,{label:"Фамилия",...kl(a("surname"),Ll)}),o(ml,{label:"Имя",...kl(a("name"),Ll)}),o(ml,{label:"Отчество (Обязательно, при наличии)",...a("middleName")}),o(dl,{label:"Дата рождения",...kl(a("birthday"),jl)})]}),d?c("div",{children:[o(ml,{label:"ИНН",...kl(a("inn"),El)}),o(ml,{label:"Наименование организации",...a("fullName")})]}):null,o(vl,{label:"Способ получения ответа",options:cn,...kl(a("feedbackMethod"),jl)}),o(yl,{label:"Телефон",...kl(a("phone"),Ol)}),s?c("div",{children:[o(yl,{label:"Дополнительный телефон",...a("secondaryPhone").value&&"+7 ("!==a("secondaryPhone").value?kl(a("secondaryPhone"),Ol):a("secondaryPhone")}),o(ml,{label:"Электронная почта",...kl(a("email"),jl)}),o(ml,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...a("bankEmpolee")}),o(ml,{label:"Дата и время обращения в Банк",...a("applicationDate")})]}):o(ml,{label:"Электронная почта",...kl(a("email"),jl)}),o(ml,{...kl(a("comment"),jl),placeholder:"Ваше сообщение",isTextarea:!0}),rn(a("consentDataProcessing"),t,e)]})})})})),pn=(e,t)=>{const l=xn(e?.typeForm.key,e?.serviceDirection?.key),n=Nl({...hn,...gn(e,l)});wl(n(e))&&t(e,!l)},gn=(e,t)=>t?{addressBranch:jl,inn:El}:"FEEDBACK"===e.typeForm.key?{birthday:jl}:{addressBranch:jl},xn=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,fn={ApplicationFormFeedback:un},bn=Mt(),yn=kt((({className:e,formBlock:t,...l})=>{const[a,i]=n(""),s=r((async(e,t=!1)=>{const l=Nn(e),n=await bn.send(l,t)?"OK":"Fail";return i(n),n}),[]);return o(x,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?.title?o(k,{headingType:"h3",title:t.title,className:"@xl:text-center"}):null,t?vn(t,s):null,a?o(Vt,{responseType:a}):null]})})})),vn=(e,t)=>{const l=e?.formType;if(!l||!(l in fn))return null;return o(fn[l],{...e,onSubmit:t})},Nn=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(t?.region?t?.text:t?.key)||t]))),wn=d((e=>{const{className:t,title:l,responseType:n,children:a,...r}=e;return o(x,{className:t,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(k,{headingType:"h3",title:l,className:"@xl:text-center"}):null,a,n?o(Vt,{responseType:n}):null]})})})),Cn=d((({className:e,text:t,value:l,key:n,disabled:a,error:r,onChange:i})=>c("div",{className:p("shrink-0 w-full",e),children:[o(Gl,{text:t,value:l,disabled:a,onChange:i},n),Dt(r)]}))),kn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Sn=d((({field:e,input:t})=>o(vl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:kn,...Hl(e("acquiringType"),Ul.acquiringType,t?.required)}))),In=(e="")=>Boolean("trade"===e||"all"===e),Tn=(e,{normalize:t,format:l})=>{const{value:a,onFocus:i,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=r((e=>{d(!0),i&&i(e)}),[]),h=r((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},Bn=(e,t,l)=>Math.max(t,Math.min(e,l));function Mn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function Pn({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:r,onChange:i}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(l-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:p("w-2 h-2 rounded-full",s<=t||r?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:l,step:n,value:s,disabled:r,onInput:t=>{const l=Mn(t.target?.value),n=e.length?e[l]:l;i&&i(n||0)}})})]})}const Rn=1,Vn=100,zn=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:i=(a.length?0:Rn),max:s=(a.length?a.length-1:Vn),step:d=1,value:m=a[0]||i,disabled:h=!1,onChange:u}=e,g=Tn(e,{normalize:(e=0)=>a.length?An(a)(e):Bn(e,i,s),format:tt()}),x=r((e=>{u&&u(Mn(e.target?.value))}),[u]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(je,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:p("mt-xs font-sans text-h3 w-full h-14","border border-solid border-gray rounded-md outline-none","pl-m box-border","text-primary-text hover:border-primary-hover focus:border-primary-text","disabled:border-gray disabled:bg-main-divider"),disabled:h,onInput:x,...g}),Pn({list:a,min:i,max:s,step:d,disabled:h,value:m,onChange:u})]}),Dn(n)]})})),An=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),Dn=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(je,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),jn=["От 1 000 ₽","До 1 000 000 000 ₽"],$n=d((({field:e})=>o(zn,{title:"Сумма, ₽",items:jn,min:1e3,max:1e9,...e("amount")}))),Ln=d((({field:e,input:t})=>o(ml,{className:"col-span-2",...Hl(e("comment"),Ul.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),En=d((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>c("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[o("div",{className:p("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:p("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(je,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),On=d((({field:e})=>In(e("acquiringType")?.value?.key)?o(En,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Fn=d((({field:e})=>In(e("acquiringType")?.value?.key)?o(En,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),_n=d((({field:e,input:t})=>{const l=zl(),n=i((()=>l?.map((({region:e})=>({key:e,text:e})))),[l]);return o(vl,{label:"Регион",placeholder:"Выберите регион",options:n,...Hl(e("region"),Ul.region,t?.required)})})),Un=["От 1 мес","До 15 лет"],Hn=d((({field:e})=>o(zn,{title:"Срок, месяцев",items:Un,min:1,max:180,...e("term")}))),Wn=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Kn=d((({field:e})=>o(vl,{label:"Тип обслуживания",options:Wn,...kl(e("serviceType"),jl)}))),qn=d((({name:e,text:t,value:l,checked:n,onChange:a,className:r})=>o("div",{className:r,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:"appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer",type:"radio",value:l,name:e,checked:n,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(je,{color:"text-primary-text",children:t}):null]})}))),Xn=["currencyControl","documentOperations","conversionTransactions","otherIssues"],Yn=d((({field:e})=>{const{value:t,onChange:l}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),c("div",{className:"py-m space-x-m grid @xl:flex @xl:items-center",children:[o(qn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:l}),o(qn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:l}),o(qn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:l}),o(qn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:l})]})})),Gn=(e,t)=>(l,n)=>{const{required:a,...r}=l,i="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,s={surname:o(ml,{label:"Фамилия",...Hl(e("surname"),Ul.surname,a)}),name:o(ml,{label:"Имя",...Hl(e("name"),Ul.name,a),...r}),middleName:o(ml,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),phone:o(yl,{label:"Телефон",...Hl(e("phone"),Ul.phone,a)}),email:o(ml,{label:"Электронная почта",...Hl(e("email"),Ul.email,a)}),fullName:o(ml,{label:"ФИО",...Hl(e("fullName"),Ul.fullName,a),...r}),inn:o(ml,{label:"ИНН",type:"number",...Hl(e("inn"),Ul.inn,a)}),comment:o(Ln,{field:e,input:l}),region:i?o(_n,{field:e}):o(ql,{field:e,input:l}),addressBranch:o(Wl,{field:e,input:l,isPremium:i}),birthday:o(dl,{label:"Дата рождения",...Hl(e("birthday"),Ul.birthday,a)}),isClient:o(Cn,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),consentToReceiveMaterials:o(Cn,{...e("consentToReceiveMaterials"),text:"Согласен на получение информационных и аналитических материалов по электронной почте"}),partnerComments:o(ml,{...Hl(e("partnerComments"),Ul.partnerComments,a),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...r}),collectionCount:o(ml,{label:"Количество объектов инкассации",type:"number",...Hl(e("collectionCount"),Ul.collectionCount,a)}),acquiringType:o(Sn,{field:e,input:l}),onlineCheckout:o(On,{field:e}),posTerminal:o(Fn,{field:e}),serviceType:o(Kn,{field:e}),term:o(Hn,{field:e}),amount:o($n,{field:e}),annualRevenue:o(ml,{label:"Годовая выручка, ₽",...Hl(e("annualRevenue"),Ul.annualRevenue,a)}),vedTypes:o(Yn,{field:e})};return function({input:e,field:t}){const{condition:l}=e,{value:n}=t(l?.name||"");return!l||l?.values?.find((e=>e===n))}({input:l,field:e})?o("div",{children:s[l?.name]},String(n)):null};const Qn=e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:n,amount:a,term:r,annualRevenue:i,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||i?(e=>{const{acquiringType:t,onlineCheckout:l=!1,posTerminal:n=!1,term:a,amount:r,annualRevenue:i}=e;return t?`Вид эквайринга=${t?.text||""}${In(t?.key)?`/Онлайн касса=${l}/POS-терминал=${n}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${a}/Выручка=${i}`})(e):null,h={...d,...Jn(o),...Zn(c),...m?{partnerComments:m}:{}};return Object.fromEntries(Object.entries(h)?.map((([e,t])=>[e,t?.key||t])))},Zn=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Jn=e=>e?{vedTypes:Object.fromEntries(Xn.map((t=>[t,t===e])))}:{},ea={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",middleName:"",phone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e3,acquiringType:kn[0],serviceType:Wn[0],vedTypes:Xn[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},ta=(e,t="")=>{const l=Object.fromEntries(Al(e).map((e=>[e,ea[e]])));return l?.serviceType&&"PREMIUMSERVICE"===t&&(l.serviceType=Wn[1]),{...l,typeForm:{key:t,text:""}}},la=Mt(),na=d((({className:e,title:t,typeForm:l="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,...u})=>{const g=a?.flatMap((e=>e?.inputs))||[],x=ta(g,l),[f,b]=n(""),y=r((async e=>{const t=ia(g,e),l=Nl((e=>{const t=Al(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,Ul?.[e]])))})(t));if(!wl(l(e)))return"Fail";const n=Qn({...e,...m}),a=await la.send(n,"lead"===d)?"OK":"Fail";return b(a),a}),[]),[,{field:v,onSubmit:N}]=At(x,{onSubmit:y}),w=ra(g)?.name;return c(wn,{className:p("container space-y-m",e),title:t,responseType:f,...u,children:[c("form",{onSubmit:N,children:[a.map(((e,t)=>c("div",{className:p(aa(e.columns),"grid gap-x-m"),children:[e?.title?o("div",{className:"@xl:text-center @xl:col-span-2",children:e.title}):null,(e?.inputs||[])?.map(Gn(v,l))]},`section-${t}`))),rn(w?v("consentDataProcessing"):void 0,s,i)]}),h?c("div",{className:"space-y-m",children:[o(k,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"8 (800) 200-78-70",children:[o(ne,{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(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),aa=e=>2===e?"@xl:grid-cols-2":"",ra=e=>e?.find((e=>"consentDataProcessing"===e?.name)),ia=(e,t)=>e.filter((e=>e)).filter((e=>!e?.condition||e?.condition.values.find((l=>l===t?.[e?.condition?.name])))),sa=kt((({className:e,title:t,button:l,regionSource:a,...r})=>{const[i,s]=n({key:""}),d=a?.regions??[],m=ce({className:"text-white",version:l?.version||"primary"}),h=d?.find((e=>e.name===i.key))?.href,u=l?.text?l.text:"Перейти";return o(x,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(k,{headingType:"h3",title:t,className:"@xl:text-center"}):null,d?o(vl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:d.map((({name:e=""})=>({key:e,text:e}))),value:i,onChange:s}):null,h?o("div",{className:"text-center",children:o(be,{href:h,target:"_blank",className:p("p-m w-full @xl:w-auto",m),children:u})}):null]})})})),oa=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),ca=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(En,{text:l?.title,value:[e].flatMap((e=>e)).includes(l.value),onChange:()=>(l=>{if(!t)return;const a=e?.includes(l);t(n?a?(e||[]).filter((e=>e!==l)):[...e||[],l]:a?[]:[l])})(l.value),type:n?"checkbox":"radio"},l.value))))),da=d((({children:e,filtrationSchema:t,resetButton:l,field:n,reset:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,oa(o("div",{className:"h-full w-px bg-gray"}))(Object.entries(t).map(ma(n)).filter(Boolean))]}),l?o("div",{children:o(nn,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:l?.text})}):null]}))),ma=e=>([t,l])=>{const n=l?.type;return"array"===n?ha(t,e)(l):null},ha=(e,t)=>l=>"dropdown"!==l?.ui?ua(e,t)(l):null,ua=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[l?.title?o("div",{className:"mb-m",children:o(je,{size:"text-m",font:"font-medium",color:"text-primary-text",children:l.title})}):null,o(ca,{items:n,multiple:!l?.single,...t(e)})]},e)};function pa(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const ga=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,xa=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>ga(t[e])||ga(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>ga(t[e])||ga(l[e])||fa(t[e])<=fa(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>ga(t[e])||ga(l[e])||fa(t[e]?.min)>=fa(l[e]?.min)&&fa(t[e]?.min)<=fa(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>ga(t[e])||ga(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>ga(t[e])||ga(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),fa=e=>Number(e||0),ba=(e,{block:t,page:l,normalize:n=zt})=>{const a=t?.blocks||[],[r,{field:s,reset:o,update:c}]=At(e),d=i((()=>pa(a,a.map((e=>wt(e.content,l?.fallback))))),[a,l?.fallback]),m=r===e?a:((e,t)=>(l=zt)=>e?.filter((([,e])=>xa(t,l(e)||{}))).map((([e])=>e)))(d,r)(n);return[r,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},ya="text-center",va=d((({title:e,description:t})=>c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(T,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:ya})]}))),Na=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",wa=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[i,s]=n(t),o=r((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=r((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&i<l-a:i<l-1,m=i>0;return[i,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},Ca=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function ka(e,{sensitivity:t,rootRef:l}={}){const n=s(null),r=i((()=>({threshold:Sa(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,r);return t.observe(n.current),()=>{t.disconnect()}}),[e,r]),n}function Sa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,l)=>Math.min(l/t)),1).concat(1)}const Ia=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:a,children:i,onIntersection:s})=>{const c=ka(r((e=>{e.length&&s&&s(l||0,e[e.length-1])}),[s,l]),a);return o("div",{className:p("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:c,role:"listitem",children:i})})),Ta=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],Ba=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:i=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:u,onVisibleItemsChange:g,onVisibleIndicesChange:x})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=r(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,g&&g(l),x&&x(Pa(l))}),[g,x]),v=a>0?i*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Ma(c,v):{},...N?Ca(h):{},gap:`${i}px`};return o("div",{className:p("box-border overflow-auto no-scrollbar",d,e),style:C,ref:l,role:"list",children:(k=(e,l)=>o(Ia,{className:p(m,a?Ta[a-1]:"",N?"h-full":"",t),style:w?Ma(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(u)});var k})),Ma=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Pa=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ra={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Va={"horizontal-list":"w-6","vertical-list":"h-6"},za=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:r})=>n?o("div",{className:p("flex gap-xs",Ra[a],r?"group":"",e),"data-ver":r,children:Array.from({length:n}).fill(null).map(((e,n)=>o("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white ${n===l?Va[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==l&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(n)},String(n))))}):null)),Aa=e=>e,Da=(e=Aa)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),ja=Da(),$a=(e=Aa)=>Da((t=>-e(t))),La=$a(),Ea=e=>t=>e.scrollWidth/t,Oa=e=>(t,l)=>{e.scrollBy({left:l*Ea(e)(t),behavior:"smooth"})},Fa=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,i]=n([]),o=r((e=>{i((t=>{return(l=t)===(n=e)||Boolean(l&&n&&l?.length===n?.length&&l.every(((e,t)=>e===n[t])))?t:e;var l,n})),t&&t(e)}),[e]),[c,d]=a.length?[$a()(a),Da()(a)]:[-1,-1],m=c>0,h=d<e-1,u=r((()=>{var t;l.current&&(m?Oa(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{l.current&&(h?Oa(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=r(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{l?.current&&l.current.children[e]?.scrollIntoView(t)}),[l]);return[l,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},_a=d((({className:e,disabled:t,...l})=>o(be,{rounded:!0,className:p("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e||""),disabled:t,...l,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),Ua=d((e=>o(_a,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Ha=d((e=>o(_a,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Wa="absolute top-[calc(50%-24px)] z-40",Ka="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",qa=d((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:i,onScrollRight:s})=>{const{canScrollLeft:d,canScrollRight:m,scrollLeft:h,scrollRight:u}=e,g=a?t>0:d,x=a?t<l-1:m,f=r((()=>{a?(d&&t!==l-1&&h(),i()):h()}),[h,i,a,d,t,l]),b=r((()=>{a?(m&&0!==t&&u(),s()):u()}),[u,s,a,d,t,l]);return c("div",{className:"m:hidden block",children:[Xa(e),g?o(Ua,{className:p(Wa,n?"left-1 m:left-8":"left-0"),onClick:f}):null,x?o(Ha,{className:p(Wa,n?"right-1 m:right-8":"right-0"),onClick:b}):null]})})),Xa=e=>c("div",{children:[e.canScrollLeft?o("div",{className:p(Ka,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:p(Ka,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Ya=({className:e,text:t="ХИТ"}={})=>c("div",{className:p("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(X,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(S,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Ga="relative h-full",Qa={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},Za=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},r=a?.some(tr);return z({...n,renderProps:(n,a,i)=>c("div",{className:Ja(n,{someCardsHighlighted:r}),children:[P(n,a,{className:er(n,{someCardsHighlighted:r,showBorder:!e,cardSize:l}),blockIndex:i,isActive:i===t}),tr(n)?Ya({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Ja=(e,{someCardsHighlighted:t})=>p(Ga,t&&(tr(e)?"pt-3xl":"pt-3xl sm:pt-16")),er=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>p(Ga,"min-w-80",Qa[n],t&&(tr(e)?"pt-3xl sm:pt-16":"pt-3xl"),Na(l),l&&"h-full"),tr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,lr=kt((({className:e,itemCount:t,visibleItemCount:l=1,noCardBorder:n,isAlignCenter:a,arrowsPadded:r=!0,isGap:i=!0,isEmbedded:s=!1,cardSize:d="normal",...m})=>{const{blocks:h=[]}=m.block||{},u=t||h?.length,[g,{inc:f,dec:b}]=wa({itemCount:u,visibleItemCount:l},Math.floor(l/2)),[y,v]=Fa({itemCount:u}),[N]=v.visibleIndicesRange,w=h&&"CarouselBankHistoryCard"===h[0]?.type;return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:"p-6xl",...m,children:[c("div",{className:p(a?"flex justify-center":"","relative max-w-full"),children:[o(Ba,{containerRef:y,visibleItemCount:l,snapAlign:"snap-start",gap:i?16:void 0,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:Za({noCardBorder:n,activeIndex:g,cardSize:d,...m})}),o(qa,{scroll:v,arrowsPadded:r,onScrollLeft:b,onScrollRight:f,hasEdgeBlocks:w,activeIndex:g,itemCount:u})]}),o(za,{className:"@5xl:hidden",containerRef:y,activeIndex:N,dotCount:u,listType:"horizontal-list"})]})}),{childrenTypes:["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),nr={},ar={},rr=kt((({className:e,filtrationSchema:t=nr,resetButton:l,notFound:n,...a})=>{const[,{blocksToRender:r},{field:i,reset:s}]=ba(ar,{block:a.block,page:a.options?.page}),d=Object.entries(t).filter((([,e])=>"array"===e.type&&"dropdown"===e.ui)).map((([e,t])=>({className:"w-64",label:t.title,options:ir(t),...i(e,{parse:({key:e})=>[e],format:([e]=[])=>ir(t).find((t=>t.key===e))||{key:""}})}))).map(((e,t)=>o(qt,{...e},String(t))));return c(x,{className:p(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(da,{filtrationSchema:t,field:i,reset:s,children:c("div",{children:[d,o("div",{children:o(nn,{type:"reset",className:"mt-lg w-64",onClick:s,version:l?.version,children:l?.text})})]})}),o("div",{className:p(r?.length?"hidden":"block"),children:n?o(va,{...n}):null}),o(lr,{padding:"p-0",isEmbedded:!0,itemCount:r?.length,visibleItemCount:0,isAlignCenter:!0,isGap:!1,children:V(r,{...a.options,parent:a.block,renderProps:(e,t,l)=>o("div",{className:p("relative min-w-80",Na(!0)),children:P(e,t)},String(l))})})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>e?.filtrationSchema||{}}),ir=e=>pa(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),sr={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},or=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...r})=>{const i=String(n?.width||t);return a?o("div",{style:{width:`${i}px`,height:`${i}px`},className:p("rounded-icon object-fit flex justify-center items-center",sr[l],e),children:o(X,{...r,width:"54%",height:"54%",name:a})}):null})),cr=d((({className:e="",title:t,benefitList:l,...n})=>c(x,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(k,{headingType:"h3",as:"h2",className:ya,title:t}):null,l?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(dr)}):null]}))),dr=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:r=!1},i)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(or,{className:"shrink-0",defaultIconSize:44,iconBgVersion:a||"",...n}):null,n?.src?o(ne,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(k,{headingType:"h6",children:e}),o(je,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),o(et,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:r})]}):null]},String(i)),mr=e=>({icon:t,title:l,description:n},a)=>c("div",{className:p("flex flex-col gap-1","items-center",n||l?"":"justify-center"),children:[l?o(je,{size:"text-h6",font:"font-normal",align:e,children:l}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,n?o(je,{size:"text-h6",font:"font-normal",align:e,children:n}):null]},String(a)),hr=(e,t,l)=>o("div",{className:`grid gap-2xs ${ur(t)}`,children:e.map(mr(l))}),ur=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},pr=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:r,...i})=>c(x,{className:p("space-y-3xl",l),defaultPadding:"p-6xl",...i,children:[o(T,{defaultPadding:"",title:r,description:a,headlineVersion:"M"}),e?.length?hr(e,n,t):null]}))),gr={start:"justify-start",center:"justify-center",end:"justify-end"},xr=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?p("flex",gr[l]):"";return o(x,{className:p("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Xe(e)})}));function fr({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:r=""}){return l||n?c("div",{children:[l?o(_a,{className:p("absolute z-40",a[0],r),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(_a,{className:p("absolute z-40 rotate-180",a[1],r),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const br=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:r,postfix:i})=>c("div",{className:p("flex justify-between @xl:flex-col",e),children:[t?o(je,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,o("div",l?{children:o(je,{size:"text-h3",children:[r,tt(n,{fixed:a})(l),i].filter(Boolean).join(" ")})}:{children:o(je,{size:"text-h3",children:"-"})})]}))),yr=Math.round(29.5),vr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Nr={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},wr={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Cr={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},kr={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Sr=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,r]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=wr.prefMonthsNum,prefTravelBonusRate:r=wr.prefTravelBonusRate,prefRestBonusRate:i=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(i*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||wr,l,n);return{...t,...e,monthBonus:a,yearBonus:r}},Ir=e=>e?o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,Tr=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:r})=>c("div",{children:[o(je,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),c("div",{className:"relative",children:[c("div",{className:"flex justify-start gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:tt(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl",children:l}):null]}),a&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Br=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s",children:[o(je,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(X,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Mr=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...r})=>a&&0===t?o(Br,{title:e,...r}):c("div",{children:[o("div",{className:"hidden @xl:block",children:o(Tr,{title:e,rate:t,unit:l,fractionDigits:n,...r})}),o("div",{className:"@xl:hidden",children:o(br,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...r})})]});function Pr({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${tt(2)(l.min||0)} ₽`,`До ${tt(2)(l.max||0)} ₽`];return o(zn,{items:e?n:[],step:t,...l})}const Rr=d((({className:e="",calcSource:t,buttons:l,footnote:n})=>{const[a,{field:r}]=At({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:i,maxSumTravel:s,minSumOther:d,maxSumOther:m,monthBonus:h,yearBonus:u}=Sr(a,t);return c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[c("div",{className:"flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",children:[Pr({title:"Сумма покупок в категории путешествия, ₽",min:i,max:s,step:500,isShowItems:!1,...r("travelExpenseValue")}),Pr({title:"Сумма покупок в остальных категориях, ₽",min:d,max:m,step:500,isShowItems:!1,...r("restExpenseValue")})]}),h>=0?Mr({title:"Баллов за месяц",rate:h,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,c("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[u>=0?o(br,{title:"Баллов за год",value:u}):null,Xe(l,{isVertical:!0}),Ir(n)]})]})})),Vr=d((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[o("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),o("div",{className:"border-b border-main-divider md:hidden"}),l,o("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),zr=(e,t=0)=>e?.sum?e.sum:t,Ar=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Dr=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,jr={horizontal:"gap-5xl",vertical:"flex-col gap-s"},$r=d((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>o("div",{className:p(`flex ${jr[a]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(Gl,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),Lr=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:r,onChange:i})=>c("div",{className:"space-y-s",children:[t?o("div",{className:"hidden @5xl:block",children:o(je,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(je,{color:"text-secondary-text",font:"font-light",children:l})}):null,o($r,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:p("flex-col sm:flex-row",r),onChange:t=>i&&i(t===e[0].id)})]}),Er=e=>Lr({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Or=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:Fr([e,t],n),Fr=([e,t],l=[])=>({[e]:l.length?La(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?ja(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),_r=(e,[t,l],n)=>e>=n[t]&&e<=n[l],Ur={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Hr=(e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:r,isMonthlyInterestPayment:i}=e,s=r||a,o=l<90||l>730,c=function(e){const t=e?.rateType?Ur[e?.rateType]:"",{data:l}=Ml(t?`/api/v1/depositrates/${t}`:null,bt);return Array.isArray(l)?l:[]}(t);if(l<=30)return{...kr,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const d=c?.find((e=>i===e.isMonthlyInterestPayment&&Wr(s,e)&&_r(n,["minSum","maxSum"],e)&&_r(l,["minDays","maxDays"],e)))||kr,{rate:m}=d,h=Kr(m,e),u=n+h,p=c||[kr];return{...d,...Fr(["minSum","maxSum"],p),...Fr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:h,finalSum:u}},Wr=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Kr=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,daysValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a/30)-n):Math.round(n*e*a/365/100)},qr=d((({className:e="",buttons:t,footnote:l,bottomFootnote:n,isShowDepositeName:a,defaultParams:r,rateParams:i})=>{const[s,{field:d}]=At({moneyValue:zr(r,1e5),daysValue:Ar(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),m=Hr(s,i),{income:h,finalSum:u,rate:p,isUnavailableByTerm:g,depositeName:x}=m;return o(Vr,{className:e,inputChildren:c("div",{children:[Pr({title:"Сумма, ₽",min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),(f={title:"Срок, дней",min:m.minDays,max:m.maxDays,...d("daysValue"),value:m.daysValue},o(zn,{items:[`От ${Dr(f.min||0)}`,`До ${Dr(f.max||0)}`],step:1,...f})),c("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[Xr(m,d),Er({title:"Выплата процентов",orientation:"vertical",...d("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Mr({rate:p,depositeName:x,isShowDepositeName:a,isUnavailableByTerm:g}),resultChildren:c("div",{children:[Yr(u,h),Xe(t,{isVertical:!0}),Ir(l),Ir(n)]})});var f})),Xr=(e,t)=>c("div",{className:"space-y-s",children:[o(je,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[o(Gl,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Gl,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Yr=(e,t)=>c("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[o(br,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),o(br,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),Gr=e=>Qr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Qr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Qr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Qr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Qr=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Zr=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:r}=t;if(0===e)return 0;if(l){const t=e/1200;return r?(n+r)*(t+t/(Math.pow(1+t,a)-1)):n*(t+t/(Math.pow(1+t,a)-1))}return Math.round(n/a)+n*(e/1200)},Jr=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,r=t?.rateRows||[vr],i=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Gr({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=Or(["minSum","maxSum"],i,r),{minMonths:c,maxMonths:d}=Or(["minMonths","maxMonths"],i,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>Gr({row:e,userInputParams:t,paramsViewSettings:l})&&_r(n,["minSum","maxSum"],e)&&_r(a,["minMonths","maxMonths"],e)))||vr)({rateRows:r,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=Zr(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},ei=({min:e=0,max:t=0,availableMonths:l,...n})=>o(zn,{items:[`От ${ti(e)}`,`До ${ti(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),ti=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,li=e=>Lr({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),ni=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:r,defaultParams:i})=>{const[s,{field:d}]=At({moneyValue:zr(i,2e5),monthsValue:Ar(i,yr),isAnnuity:Boolean(i?.isAnnuity),isInsurance:Boolean(i?.isEnableInsurance),isSalaryClient:Boolean(i?.isEnableSalaryClient),isPensionClient:Boolean(i?.isEnablePensionClient),isStateEmployee:Boolean(i?.isEnableStateEmployee)}),m=Jr(s,t,r),h=li({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")}),{onChange:u}=d("moneyValue"),{onChange:p}=d("monthsValue");return a((()=>{u&&u(Bn(s.moneyValue,m.minSum,m.maxSum))}),[m.minSum,m.maxSum]),a((()=>{p&&p(Bn(s.monthsValue,m.minMonths,m.maxMonths))}),[m.minMonths,m.maxMonths]),o(Vr,{className:e,inputChildren:c("div",{children:[Pr({title:"Сумма кредита, ₽",step:500,min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),ei({title:"Срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),ai({...m,...r},d),o("div",{className:"sm:hidden",children:h})]}),rateChildren:Mr({rate:m.rate}),resultChildren:c("div",{children:[o(br,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:h}),Xe(l,{isVertical:!0}),Ir(n)]})})})),ai=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Gl,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Gl,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Gl,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Gl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),ri=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,r]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,r)]):l++}return t},ii=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,r=t?.rateRows?.[0]?ci(t.rateRows[0].minMonths,t.rateRows[0].maxMonths):0,i=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=t?.rateRows?.find((t=>oi({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:i})&&oi({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&_r(n,["minSum","maxSum"],t)&&_r(a||r,["minMonths","maxMonths"],t)))||Cr,{rate:c}=o,d=si(c,e),m=n+d,h=t?.rateRows||[Cr];return{...o,...Fr(["minSum","maxSum"],h),...Fr(["minMonths","maxMonths"],h),availableMonths:ri(h.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,l=1)=>Array.from({length:Math.abs(t-e)/l+1},((n,a)=>t>=e?e+a*l:e-a*l)))(e,t))),...e,defaultMonth:r,income:d,finalSum:m}},si=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,monthsValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a)-n):Math.round(n*e*30*a/365/100)},oi=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],ci=(e,t)=>e+Math.round((t-e)/2),di=d((e=>{const{className:t,calcSource:l,buttons:n,footnote:r,paramsViewSettings:i,defaultParams:s}=e,[d,{field:m}]=At({moneyValue:zr(s,2e4),monthsValue:Ar(s),isMonthlyInterestPayment:Boolean(s?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(s?.isRemoteRegistration)}),h=ii(d,l,i),{defaultMonth:u,rate:p,income:g,finalSum:x}=h,{onChange:f}=m("monthsValue"),{onChange:b}=m("moneyValue");return a((()=>{!d.monthsValue&&f&&f(u)}),[u]),a((()=>{b&&b(Bn(d.moneyValue,h.minSum,h.maxSum))}),[h.minSum,h.maxSum]),o(Vr,{className:t,inputChildren:c("div",{children:[Pr({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...m("moneyValue"),value:h.moneyValue}),ei({title:"Срок, месяцев",min:h.minMonths,max:h.maxMonths,availableMonths:h.availableMonths,...m("monthsValue"),value:h.monthsValue}),mi({...h,...i},m)]}),rateChildren:Mr({rate:p}),resultChildren:c("div",{children:[o(br,{title:"Доход в конце срока",value:g,postfix:"₽",prefix:"+"}),o(br,{title:"Сумма в конце срока",value:x,postfix:"₽"}),Xe(n,{isVertical:!0}),Ir(r)]})})})),mi=(e,t)=>{return c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?Er({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},Lr({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},hi=e=>ui({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&ui({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),ui=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],pi=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i}=e,s=t?.rateRows||[Nr],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>hi({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=Or(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=Or(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i})=>e?.find((e=>hi({row:e,userInputParams:t,paramsViewSettings:l})&&_r(n+i,["minSum","maxSum"],e)&&_r(r,["minSumOld","maxSumOld"],e)&&_r(i,["minSumExtra","maxSumExtra"],e)&&_r(a,["minMonths","maxMonths"],e)))||Nr)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i}),{rate:p}=u,g=Zr(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i,monthlyPayment:g,benefit:x}},gi=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[r,{field:i}]=At({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=pi(r,t,a),d=li({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...i("isAnnuity")});return o(Vr,{className:e,inputChildren:c("div",{children:[Pr({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...i("moneyValue"),value:s.moneyValue}),Pr({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...i("oldMonthlyPayment"),value:s.oldMonthlyPayment}),ei({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...i("monthsValue"),value:s.monthsValue}),xi({...s,...a},i),s.isExtraMoney?Pr({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...i("moneyExtra"),value:s.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:d})]}),rateChildren:Mr({rate:s.rate,fractionDigits:1}),resultChildren:c("div",{children:[o(br,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?o(br,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:d}),Xe(l,{isVertical:!0}),Ir(n)]})})})),xi=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Gl,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Gl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Gl,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),fi={CreditCalculatorForm:ni,DepositCalculatorForm:di,BusinessDepositCalculatorForm:qr,BonusCalculatorForm:Rr,RefinancingCalculatorForm:gi},bi=(e,t)=>{const l=e?.calcType;if(!l||!(l in fi))return null;const n=fi[l];return o("section",{className:"box-border relative bg-white flex shrink-0 self-start basis-full",role:"listitem",children:c("div",{className:"box-border p-4xl w-full space-y-xl",children:[e?.title?o(k,{className:"text-center",title:e.title}):null,o(n,{...e})]})},String(t))},yi=kt((({className:e="",tabAlign:t,calculatorTabs:l=[],...a})=>{const i=l.map((e=>e.nav||{})),s=l.map((({calculatorBlock:e})=>e||{})),[d,m]=n(0),h=r((e=>m(e)),[]),[u,g]=wa({itemCount:l?.length,visibleItemCount:3});return c(x,{className:p("box-border overflow-hidden relative",e),defaultPadding:"p-0",...a,children:[c("div",{className:"bg-white",children:[i.length>1?vi({activeIndex:u,tabsNav:i,tabAlign:t,slideIndexShift:d,onClick:h}):null,fr({...g,btnClass:["left-3","right-3"],className:"top-10"})]}),o("div",{className:"flex",style:{transform:`translateX(-${d}00%)`},role:"list",children:s?.length?s.map(bi):null})]})}));function vi({activeIndex:e,tabsNav:t,tabAlign:l,slideIndexShift:n,onClick:a}){return c("div",{children:[o("div",{style:{transform:`translateX(-${388*e}px)`},className:"flex flex-col justify-end items-center h-32 pt-4xl box-border duration-1000",children:o("div",{className:p("w-full flex flex-nowrap items-end gap-xs",l?gr[l]:""),children:t.map(((e,t)=>function({tab:e,i:t,isActive:l,onClick:n}){const a=l?"w-96 p-m border-none bg-primary-main text-white":"w-96 p-s ease-in duration-300 bg-white text-primary-text",r=l?"text-xl mb-xs":"text-l mb-2xs",i=l?"text-l font-light text-white":"text-m font-light text-secondary-text",s=l?"":"text-primary-main",d=e?.icon?.iconVersion,m=l?"white":"normal";return c("button",{type:"button",onClick:n,"aria-label":e?.title,className:p("box-border relative border border-gray cursor-pointer text-left border-b-0 flex space-x-m min-h-20",a),children:[o(ne,{className:p("h-6 w-6 min-w-6 min-h-6",s),image:{...e?.icon,iconVersion:d??m},width:"24",height:"24"}),c("div",{className:"border-0",children:[o("div",{className:r,children:e?.title}),o("div",{className:i,children:e.description})]})]},String(t))}({tab:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})}),o("div",{className:"w-full h-2 bg-primary-main"})]})}const Ni=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:i=0,...s}=e,c=Tn(e,{normalize:(e=a)=>l&&n?String(Bn(Number(wi(e)),l,n)):wi(e),format:tt(i)}),d=r((e=>t&&t(wi(e))),[t]);return o(Et,{onChange:d,...s,...c})})),wi=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Ci=d((e=>o(Ni,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(je,{size:"text-xl",font:"font-light",children:"₽"})})}))),ki={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Si={amount:1500},Ii=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:r="1500",button:i,formType:s="private",...d})=>{const[{amount:m},{field:h}]=At(Si),[u,g]=n(!1);return a((()=>{g(m<=0)}),[m]),c(x,{className:p("flex flex-col items-center",e),defaultPadding:"p-6xl",...d,children:[t?o(k,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:ki[s],children:[o(Ci,{valid:!u,placeholder:r,label:l,max:3e5,min:1,...h("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:m}),i?.text?o(nn,{className:"w-full mt-lg",type:"submit",disabled:u,children:i.text}):null]})]})})),Ti=d((({className:e,title:t,description:l,blockIndex:n=0,isActive:a,...r})=>o(x,{className:p("relative flex h-[485px]",a?"w-[440px] z-10":"w-[340px]",e),defaultPadding:"p-0",...r,children:o("div",{className:p("basis-full self-center",Bi(n)),children:a?o(T,{headlineVersion:"M",title:t,description:l,padding:"p-3xl",align:"text-left",className:"h-96 text-white shadow-dark-blue"}):o("div",{className:"h-[300px] flex justify-center items-center font-mohave text-title-large",children:o("span",{className:Mi(n),children:t})})})}))),Bi=e=>["bg-primary-main","bg-green-light","bg-yellow-light"][e%3],Mi=e=>["gradient-color-text-on-green","gradient-color-text-on-yellow","gradient-color-text-on-yellow"][e%3],Pi="z-10 border border-solid w-full h-full",Ri=p(Pi,"absolute hidden @xl:block border-transparent"),Vi=d((({className:e,title:t,description:l,button:n,...a})=>o(x,{className:p("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:p(Ri,"top-9 right-12 bg-green-dark")}),o("div",{className:p(Ri,"top-6 right-8 bg-green")}),o("div",{className:p(Ri,"top-3 right-4 bg-green-light")}),c("div",{className:p(Pi,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(T,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Xe([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),zi={black:"bg-black",white:"bg-white"},Ai=d((({className:e="",title:t,description:l,image:n,price:a,button:r,colors:i=[],align:s="text-left",padding:d,...m})=>o(x,{className:p("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ce,{className:"h-full",padding:d,title:o(T,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:Xe([r],{buttonClassName:"w-full self-end"}),children:[i?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(je,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),i.map(Di)]}):null,a?c(je,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Di=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${zi[e]}`},String(t)),ji="24",$i="absolute w-full h-full border border-white",Li=d((({className:e="",icon:t,...l})=>{const n=he(),{text:a,href:r,target:i,onClick:s}=n(l);return a?o("div",{className:p("flex relative group/link pl-s pb-s sm:pr-2xs min-w-64 sm:min-w-72",e),children:c("div",{className:"relative min-h-16 w-full pb-lg sm:pb-0",children:[c("a",{className:p("absolute border\n bg-white flex items-center justify-between group-hover/link:text-primary-main","flex rounded-md lg:rounded-none w-full w-full p-lg whitespace-nowrap z-10"),role:"link",href:r,target:i,onClick:s,children:[c("div",{className:"flex items-center space-x-lg",children:[t?o(ne,{imageClassName:"text-green-dark",image:t,width:ji,height:ji}):null,o(je,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),o(ne,{className:"group-hover/link:brightness-100 sm:ml-2xs",image:{icon:"ArrowRightIcon",iconVersion:"black"},imageClassName:"group-hover/link:text-primary-main",width:ji,height:ji})]}),o("div",{className:p($i,"-bottom-1 -left-1")}),o("div",{className:p($i,"-bottom-2 -left-2")})]})}):null})),Ei=d((({className:e,additionalDescription:t,description:l,links:n,title:a,...r})=>o(x,{defaultPadding:"p-5xl",className:p("overflow-hidden",e),...r,children:c("div",{className:"flex flex-col lg:flex-row sm:items-center gap-s justify-between",children:[c("div",{children:[o(T,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),o(T,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Oi(n,"sm:self-end sm:pt-s"):null]})}))),Oi=(e,t="")=>{const l=Math.ceil(e.length/5);return o(lr,{className:t,version:"secondary",itemCount:l,arrowsPadded:!1,padding:"p-0",visibleItemCount:0,isEmbedded:!0,children:Array.from({length:l}).fill(null).map(((t,l)=>o("div",{className:"flex flex-wrap gap-2xs sm:gap-0 sm:justify-center",children:e.slice(5*l,5*(l+1)).map(((e,t)=>o(Li,{...e},String(t))))},String(l))))})},Fi=d((({className:e="",href:t,target:l,isRemote:n=!1,onClick:a,children:r})=>{const i=he({isRemote:n})({href:t,target:l,onClick:a});return o(t?"a":"div",{className:p("block",e),...t?i:{},role:t?"link":"none",children:r})})),_i=[{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"}}],Ui=d((({className:e="",media:t,showButtonText:l,stretched:a,version:r="white",children:i})=>{const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:i}=(e=>_i.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=qe(n)?n:i,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??r}})),h=p("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",l&&s?"":"basis-auto",a?"flex-1 justify-center":"");return c("div",{className:p("flex flex-col gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Xe(m,{className:p(a||s?"basis-full":""),buttonClassName:h})}),i?o(je,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i}):null]})})),Hi=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:r,items:i=[],isDotted:s,socialMedia:d=[],target:m,title:h,align:u="text-left",benefits:g,imageOptions:{directionRight:f=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!1}={},...v})=>o(x,{className:p("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...v,children:o(Fi,{href:a,target:m,className:"h-full",children:c(Ce,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(T,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:u}),...ot(qe(r)?o(ne,{image:r}):null,f),buttons:d.length?o(Ui,{media:d,showButtonText:!0,version:v?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Ke,{benefits:g}),o(et,{items:i,isDotted:s,listItemSize:"S"}),Wi(n,u)]})})}))),Wi=(e,t)=>e?o(S,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Ki=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:i})=>{const[s,o]=n(l),d=r((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=i?i({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const qi=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),r=function(e,t){const l=s(null);return a((()=>{const t=l?.current;if(!t)return;const n=new ResizeObserver((l=>{e(t,l[0])}));return n.observe(t),()=>{n.disconnect()}}),[e,...t]),l}((e=>{n.current&&(n.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:r,children:l})})})),Xi=(e,t)=>{const{title:l,description:n,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[l?o("div",{className:"opacity-80",children:o(je,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(je,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Xe(a)}):null]},String(t))},Yi=d((({className:e="",title:t,align:l="text-center",icon:r,button:i,visibleCellsCount:s=1,cardCells:d=[],options:m,...u})=>{const g=d.map(Xi),[f,b]=s>0?[g.slice(0,s),g.slice(s)]:[g,[]],[y,v]=n(!1);return a((()=>h.subscribe("fold",(e=>{void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[]),c(x,{className:p("flex flex-col",e),defaultPadding:"p-2xl",...u,children:[qe(r)?o("div",{className:"self-center",children:o(ne,{image:r})}):null,t?o(k,{className:p("pt-xs",l),headingType:"h5",title:t}):null,i?.text?o(be,{className:"w-full mt-m mb-lg",...i}):null,b.length?o(Ki,{renderFoldableSection:()=>c("div",{children:[f,o(qi,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>1?Gi(y,m?.parent):null}):o("div",{children:f})]})})),Gi=(e,t)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==t&&h.fire("fold",{type:"fold",isUnfolded:!e,parent:t})},type:"button",children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(X,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Qi="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",Zi="border-gray border-solid border",Ji="border-main-divider border-b",es="w-52",ts=d((({icon:e,image:t,title:l,link:n})=>c("div",{className:p("w-80 box-border flex flex-col gap-m items-center rounded-t-md border-b-0 p-2xl",Zi,Qi),role:"columnheader",children:[e&&!t?.src&&o(ne,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}),t?.src&&o(ne,{image:t}),l?o(k,{headingType:"h4",as:"h3",className:"text-center text-white",title:l}):null,n?.text&&o("div",{className:"mt-auto w-full",children:o(be,{href:n.href,target:n.target||"",className:"w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active",children:o("div",{className:"py-s",children:o(S,{size:"text-xs",font:"font-medium",children:n.text})})})})]}))),ls={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},ns=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:ls[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),as=d((({children:e})=>o("div",{className:"self-start flex flex-col",role:"row",children:o("div",{className:"flex gap-xl",children:e})}))),rs=d((({colHeaders:e,activeIndex:t})=>c(as,{children:[o("div",{className:es,role:"columnheader"}),o(ns,{activeIndex:t,columnWidth:336,children:e.map(((e,t)=>o(ts,{...e},String(t))))})]}))),is=d((({cell:e,isFirstRow:t,isLastRow:l,isFillGradient:n})=>{const a=p("w-80 box-border flex flex-col",Zi,l?"border-t-0 rounded-b-md":"border-y-0",n?Qi:""),r=p("mx-2xl h-full",Ji,n&&t?"border-t":"",l?"border-b-0":"border-solid");return o("div",{className:a,role:"cell",children:o("div",{className:r,children:e?e.map(((e,t)=>cs(e,t,n))):null})})})),ss=(e=!1)=>"text-xl m-0 "+(e?"text-white":""),os=(e=!1)=>"text-s opacity-80 "+(e?"text-white":"text-secondary-text"),cs=({label:e,description:t},l,n)=>c("div",{className:"first:pt-2xl pt-xl last:pb-2xl",children:[e?o("h4",{className:ss(n),children:e}):null,t?o("div",{className:os(n),children:t}):null]},String(l)),ds=(e=!1)=>p("py-2xl",Ji,es,e?"border-b-0":"border-solid"),ms=d((({row:{header:e,data:t},activeIndex:l,isColoredFirstColumn:n,isFirstRow:a,isLastRow:r})=>c(as,{children:[e?.title?o("div",{className:ds(r),children:o(S,{size:"text-s",children:e.title})}):null,t?.length?o(ns,{activeIndex:l,columnWidth:336,children:t.map(((e,t)=>o(is,{cell:e,isFirstRow:a,isLastRow:r,isFillGradient:n&&0===t},String(t))))}):null]}))),hs=d((({rowData:e,isColoredFirstColumn:t,activeIndex:l,controls:n})=>{const{isScrollAvailable:a}=n;return c("div",{className:"relative",children:[e.map(((e,n,{length:a})=>o(ms,{row:e,isFirstRow:0===n,isLastRow:n+1===a,activeIndex:l,isColoredFirstColumn:t},String(n)))),a?fr({...n,btnClass:["top-28","top-12"],className:"right-7",isDisabled:!0}):null]})})),us=d((({columns:e=[],rowHeaders:t,isShowAllRow:l,visibleRowLength:n,isColoredFirstColumn:a})=>{const r=e?.map((({header:e})=>e||{})),i=e?.map((({data:e})=>e))||[],s=t?.map(((e,t)=>({header:e,data:i.map((e=>e?.[t]||[{}]))}))).slice(0,l?t.length:n),[d,m]=wa({itemCount:e.length,visibleItemCount:3}),{isScrollAvailable:h}=m;return c("div",{children:[c("div",{role:"table",children:[r?.length?o(rs,{colHeaders:r,activeIndex:d}):null,s?.length?o(hs,{rowData:s,isColoredFirstColumn:a,activeIndex:d,controls:m}):null]}),h?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),ps=d((({className:e="",title:t,rowHeaders:l,columns:a,visibleRowLength:i=0,isColoredFirstColumn:s=!1,...d})=>{const[m,h]=n(!i),u=r((()=>h((e=>!e))),[]);return c(x,{className:p("overflow-hidden relative",e),defaultPadding:"p-6xl",...d,children:[o(k,{headingType:"h2",className:"text-center mb-4xl mx-auto",title:t}),o(us,{columns:a,rowHeaders:l,isShowAllRow:m,isColoredFirstColumn:s,visibleRowLength:i}),i?gs({isShowAllRow:m,onClick:u}):null]})})),gs=({isShowAllRow:e,onClick:t})=>o("div",{className:"pr-6xl",children:c("div",{className:"flex gap-m w-full",children:[o("div",{className:es}),o("button",{type:"button",onClick:t,className:"py-xs flex-1 border-gray border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main",children:o(je,{size:"text-xs",font:"font-medium",children:e?"Скрыть":"Показать все параметры"})})]})}),xs=d((({className:e,contacts:t,info:l,version:n="secondary",...a})=>c(x,{className:p("flex",e),defaultPadding:"p-6xl",version:n,...a,children:[l?.length?fs(l):null,t?.length?fs(t):null]}))),fs=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>bs({column:e,index:t})))}),bs=({column:e,index:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:l,button:n},a)=>c("div",{children:[o(T,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),l?o("div",{className:"mt-xs opacity-80",children:o(S,{size:"text-m",font:"font-light",children:l})}):null,n?.href?o(be,{className:"mt-xl",...n}):null]},String(a))))},`col-${String(t)}`):null,ys=e=>e%2!=0,vs=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:r,role:i,...s})=>c(l,{tag:l,className:p("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",r),onClick:n,role:i,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Ns=d((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:r})=>o(vs,{tag:"button",onClick:r,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:p("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(je,{size:"text-h4",children:t}),iconNode:l?o(ne,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),ws=({isUnfolded:e,onToggle:t})=>o(Ns,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Cs=["ArrowDownIcon","ArrowUpIcon"],ks="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",Ss=d((({label:e="",blocksToRender:t=[],topItemsCount:l=0,block:n,notFound:a,...r})=>{const[i,s]=l>0?[t.slice(0,l),t.slice(l)]:[t,[]];return c("div",{children:[o("div",{className:p(t.length?"hidden":"block"),children:a?o(va,{...a}):null}),c("div",{className:p("space-y-2xs",t.length?"":"hidden"),children:[c("div",{className:p(ks),children:[V(i,{...r.options,parent:n}),ys(i.length)?o(It,{className:"col-span-6",...r}):null]}),o(Ki,{renderFoldableSection:({isUnfolded:e})=>c(qi,{className:p(ks),isUnfolded:e,children:[V(s,{...r.options,parent:n}),ys(s.length)?o(It,{className:"col-span-6",...r}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>o(Ns,{className:p(l<1?"hidden":""),disabled:!s?.length,label:e,icon:Cs[Number(t)],dataTheme:r.options?.page?.colorPalette,onClick:n})})]})]})})),Is=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Ts=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),Bs=1e9,Ms={sum:{min:1e4,max:Bs},period:3},Ps=kt((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...r})=>{const[,{blocksToRender:i,blocksWithProps:s},{field:d,reset:m}]=ba(Ms,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:Rs(e)})}),h=s.map((([,e])=>e?.paramsSource?.rateRows)),u=Vs(h);return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(da,{filtrationSchema:t,resetButton:l,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs",children:[o(Ci,{label:n?.title,min:500,max:Bs,...d("sum",{parse:e=>({min:Number(e),max:Bs}),format:({min:e})=>String(e)})}),o(zn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:u,...d("period")})]})}),o(Ss,{blocksToRender:i,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Rs=e=>yt((e?.paramsSource?.rateRows||[]).filter(Is).flatMap((e=>Ts(e.minMonths,e.maxMonths)))),Vs=e=>yt(e.flatMap((e=>e||[])).filter(Is).flatMap((e=>Ts(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],zs=[{key:"10"},{key:"50"},{key:"100"}],As=({itemCount:e,onItemCountChange:t})=>{const l=r((({key:e})=>t(Number(e))),[]);return c("div",{className:"flex items-center gap-s",children:[o("span",{children:"Показать по"}),o(qt,{className:"min-w-20",onChange:l,value:{key:String(e)},options:zs,iconVersion:"black"})]})},Ds="py-m px-lg rounded-md cursor-pointer hover:bg-primary-hover hover:text-white",js=(e,t)=>{const{currentPage:l,onPageChange:n,totalPages:a}=e,r=t+1;return r===l?o("div",{"aria-current":"true",className:"py-m px-lg bg-primary-main text-white rounded-md",children:r},String(t)):1!==r&&r!==a&&((e,t,l)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,l)=>t<=2&&e<=t+2||t>=l-1&&e>=l-3)(e,t,l))(r,l,a)?o("div",{onClick:()=>n(r),className:Ds,"aria-label":`Страница ${r}`,children:r},String(t)):null},$s={width:"24",height:"24"},Ls=({currentPage:e,onPageChange:t,totalPages:l})=>{const n=i((()=>Array.from({length:l}).fill({currentPage:e,onPageChange:t,totalPages:l})),[l,e]),a=r((()=>{e>1&&t(e-1)}),[e]),s=r((()=>{e<l&&t(e+1)}),[e,l]),d=r((()=>t(1)),[]),m=r((()=>t(l)),[l]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(X,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Es(1===e),...$s})}),c("div",{className:"flex gap-2xs",children:[e>1?o("div",{onClick:d,className:Ds,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m px-s",children:"..."}):null,n.map(js),e<l-2?o("div",{className:"py-m px-s",children:"..."}):null,e<l?o("div",{onClick:m,className:Ds,"aria-label":`Страница ${l}`,children:l}):null]}),o("div",{onClick:s,children:o(X,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Es(e===l),...$s})})]})},Es=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Os=({currentPage:e,onPageChange:t,totalPages:l,itemCount:n,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Ls,{currentPage:e,onPageChange:t,totalPages:l}),n&&a?o(As,{itemCount:n,onItemCountChange:a}):null]}),Fs=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:i="Поиск по сайту"})=>{const s=r((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:p("font-sans relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:p("h-14 w-full px-10 text-l text-black outline-none box-border border border-solid rounded-md","border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text"),value:t,type:"text",name:"search-bar-input",placeholder:i,autoFocus:l,onChange:s,onFocus:a})]})})),_s=d((({field:e,onClearFilter:t,filtrationState:l})=>c("div",{className:"grid grid-cols-12 mb-3xl space-x-xl",children:[o(Fs,{className:"col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(ol,{className:"col-span-3",label:"Период от",maxDate:l.endDate,...e("startDate")}),o(ol,{className:"col-span-3",label:"Период до",minDate:l.startDate,...e("endDate")}),o("div",{className:"col-span-2 mt-auto",children:o(nn,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Us=({title:e,timestamp:t,publicId:l})=>{const n=he({basePath:"/"}),{href:a}=n({href:`/api/v1/depository/${l}/file`});return c("div",{className:"grid grid-cols-12 py-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-2",children:t?o(je,{size:"text-m","font-weight":"font-light",children:$t(t)}):null}),o("div",{className:"col-span-10 text-h6 hover:text-primary-active",children:o("a",{href:a,download:!0,"aria-label":"Скачать",children:e})})]},l)},Hs="/api/v1/depository",Ws={startDate:void 0,endDate:void 0,query:""},Ks=kt((({className:e,...t})=>{const[l,a]=n(0),[i,s]=n(10),[d,{field:m,reset:h}]=At(Ws),{totalPages:u=0,items:g=[]}=(({size:e,page:t,query:l,startDate:n,endDate:a})=>{const r=n?$t(n,!0):"",i=a?$t(a,!0):"",s=new URLSearchParams(Hs);s.set("page",String(t)),s.set("size",String(e)),s.set("query",l),s.set("timestampStart",r),s.set("timestampEnd",i);const o=`?${s.toString()}`,{data:c}=Ml(Hs+o,bt);return{items:c?.content,totalPages:c?.totalPages}})({size:i,page:l,...d}),f=r((e=>a(e-1)),[]),b=r((e=>{i!==e?(s(e),a(0)):s(e)}),[]);return c(x,{className:p(e,"container p-6xl"),...t,children:[o(_s,{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-2",children:o(je,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-10",children:o(je,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),g.length?g.map((e=>o(Us,{...e},String(e.publicId)))):o(va,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Os,{currentPage:l+1,onPageChange:f,totalPages:u,itemCount:i,onItemCountChange:b})]})]})})),qs=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Xs=d((({className:e="",title:t,description:l,error:n,button:a,...r})=>c(x,{className:p("flex flex-col justify-center items-center",e),defaultPadding:p("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:qs(n)}),o(T,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(be,{version:a?.version,text:a?.text,...a}):null]}))),Ys="location";function Gs(e="Москва"){const[t,l]=((e,t,l)=>{const[i,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[i,r((l=>e.fire(t,l)),[e,t])]})(h,"location",Zs()??{name:e}),i=r((e=>{Js(e),l(e)}),[]),{data:s}=Ml(Qs()?null:"/api/v1/region",bt);return a((()=>{s&&!Qs()&&l(s)}),[s]),[t??{name:e},i]}const Qs=()=>Boolean(globalThis.localStorage?.getItem(Ys)),Zs=()=>{try{const e=globalThis.localStorage?.getItem(Ys);return e&&JSON.parse(e)}catch(e){return null}},Js=e=>{try{globalThis.localStorage?.setItem(Ys,JSON.stringify(e))}catch(e){}};var eo;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(eo||(eo={}));const to=new Intl.NumberFormat("ru",{style:"currency",currency:eo.RUB}),lo=e=>e?to.format(e):"",no="text-left text-m font-light text-secondary-text",ao=`${no} pl-5xl`,ro={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},io=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:`h-fit w-fit ${e}`,children:[o("thead",{children:c("tr",{children:[o("th",{className:no,children:o(je,{size:"text-m",children:"Валюта"})}),o("th",{className:ao,children:o(je,{size:"text-m",children:"Купить"})}),o("th",{className:ao,children:o(je,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(so)})]}))),so=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:ro[t]},width:"24",height:"24"}):null,o(je,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl",children:o(je,{size:"text-h6",children:lo(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl",children:o(je,{size:"text-h6",children:lo(e?.buyExchangeRate)})})]},t)},oo={icon:"GpsIcon"},co=d((({className:e="",address:t})=>c("div",{className:`flex gap-s ${e}`,children:[o(or,{...oo,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(S,{size:"text-l",color:"text-primary-main",children:t}):null,o(S,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),mo=(e,t,l)=>{const n=Number(ho(e))*Math.pow(t,l?-1:1);return Number.isInteger(n)?n:((e,t=2)=>{const l=10**t;return Math.round(parseFloat(String(e))*l)/l})(n)},ho=e=>e.replace(/[^\d.,]/g,"").replace(",","."),uo=e=>t=>{const[,l]=e.find((([e])=>e(t)))||[];return l},po=e=>uo([[e=>e.value!==eo.RUB&&e.oppositeValue!==eo.RUB,()=>e.handleConvert(e.value,eo.RUB)],[e=>e.value===eo.RUB&&e.oppositeValue===eo.RUB,()=>e.handleConvert(e.value,eo.USD)],[e=>e.value===eo.RUB&&e.oppositeValue===eo.RUB,()=>e.handleConvert(e.value,eo.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function go(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:r,setSelected:i}=e,s=l.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:n,text:n};return c("div",{className:"relative flex",children:[o(Et,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:r}),s.length?o(qt,{isBorder:!1,onChange:e=>i(e.key),options:s,value:d}):null]})}const xo=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[i,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||eo.RUB,selectBuy:l?.[0]?.currency?.currency||eo.USD}),d=r((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[go({placeholder:"Хочу продать",rates:l,selected:i.selectSell,setSelected:fo(i,d,l),value:i.inputSell,setValue:e=>yo(d,l)(e,i.selectSell,i.selectBuy)}),go({placeholder:"Получу",rates:t,selected:i.selectBuy,setSelected:bo(i,d,t),value:i.inputBuy,setValue:e=>vo(d,t)(e,i.selectBuy,i.selectSell)}),a?.text?o(be,{text:a.text,version:a?.version,...a}):null]})})),fo=(e,t,l)=>n=>{t({selectSell:n}),po({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{yo(t,l)(e.inputSell,n,a)}})},bo=(e,t,l)=>n=>{t({selectBuy:n}),po({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>vo(t,l)(e.inputBuy,n,a)})},yo=(e,t)=>(l,n,a)=>{e({inputSell:ho(l),selectBuy:a});const r=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;r&&e({inputBuy:String(mo(l,r,n===eo.RUB)||"")})},vo=(e,t)=>(l,n,a)=>{e({inputBuy:ho(l),selectSell:a});const r=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;r&&e({inputSell:String(mo(l,r,n===eo.RUB)||"")})};const No=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=Gs(),r=function(e){const t=e?.code||"000",{data:l}=Ml(`/api/v1/exchangerates?regionCode=${t}`,bt);return l||{}}(a),i=wo(r?.exchangeRate?.currencies),s=i.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:eo.RUB}});const d=i.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:eo.RUB}}),o(x,{className:p("box-border min-h-80",e),...n,children:o(Ce,{className:"h-full",title:o(k,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap sm:flex-nowrap",children:[c("div",{className:"max-w-1/2",children:[i?o(io,{className:"mb-xl",exchangeCurrencyItems:i}):null,o(co,{address:r?.address})]}),i.length&&s.length&&d.length?o(xo,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:l}):null]})})})})),wo=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Co={width:"40",height:"45"},ko={"bg-white":"color",transparent:"white"},So={"bg-white":"text-primary-main",transparent:"text-white"},Io=(e,t,l)=>o(ne,t?.src?{image:t,className:So[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:ko[e]},className:So[e],width:l?.width,height:l?.height}),To={"bg-white":"text-primary-text",transparent:"text-white"},Bo=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:r="bg-white",showTitle:i=!0})=>c("a",{className:p("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[Io(r,l?.image,Co),i?n??o("div",{className:"ml-s",children:o(je,{font:"font-medium",color:To[r],size:"",children:l?.title??"Россельхозбанк"})}):null]}))),Mo=d((({className:e,onClose:t})=>o("button",{className:p("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(ne,{image:{icon:"CloseIcon"},width:"24",height:"24"})})));function Po(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const Ro=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:l,s1Matches:n,s2Matches:a}=function(e,t){const l=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),n=Array.from({length:e.length}),a=Array.from({length:t.length});let r=0;for(let i=0;i<e.length;i++){const s=Math.max(0,i-l),o=Math.min(i+l,t.length-1);for(let l=s;l<=o;l++)n[i]||a[l]||e[i]!==t[l]||(r++,n[i]=!0,a[l]=!0)}return{m:r,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const r=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let r=0,i=0;r<e.length;r++){if(!l[r])continue;let s=i;for(;s<t.length;s++)if(n[s]){i=s+1;break}e[r]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),i=(l/e.length+l/t.length+(l-r/2)/l)/3,s=i>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return i+s*(1-i)};const Vo=(e,t)=>(l,n)=>{for(const[a,r]of n)l.set(a,e(l.get(a)||t,r));return l},zo=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Ao=e=>t=>e.map((([e,l])=>[Ro(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>jo(t,e))).reduce(Vo(Math.max,0),new Map),Do=e=>t=>{return pa(t,t.map((({title:e})=>e)).map((e=>t=>{const l=zo(t||"");return l.length?Re(e.map((e=>ja(l.map(Ro(e)))))):0})(e))).sort((n=([,e])=>e,l=(e,t)=>n(e)-n(t),(e,t)=>-l(e,t))).map((([e])=>e));var l,n},jo=(e,t)=>new Map(e.map((e=>[e,t]))),$o=({basePathList:e,initialQuery:t=""})=>{const[l,r]=n(t||"");a((()=>{null!=t&&r(t)}),[t]);const{data:i}=Ml(e?.length?e:null,Lo),[s,o]=n(null);return Po((()=>{i&&o(i.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=zo(e);if(!a.length)return[];const r=Object.entries(n),i=[...a.map(Ao(r)).reduce(Vo(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return Do(a)(i)})(l)))}),[i,l]),[s,{value:l,onChange:r}]},Lo=async(...e)=>(await Promise.allSettled(e.map((e=>ft(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Eo=d((({className:e,head:t,children:l,onClose:n,onClick:a})=>{const{close:i}=de(),s=r((()=>{i(),n&&n()}),[n]);return c("div",{onClick:a,className:p("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Mo,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),Oo=["all","footer"],Fo=d((({className:e,topItems:t})=>{const l=he({isRemote:!0});return o("div",{className:p("flex items-start justify-between",e),children:t?.filter(Ho).map(l).map(_o)})})),_o=(e,t)=>{const{text:l,items:n=[],href:a,target:r,onClick:i}=e,s=n.filter(Ho);return c("div",{className:"flex flex-col gap-s w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:r||"_self",onClick:i,children:l||`Раздел ${t}`}),s.map(((e,t)=>o(Uo,{...e,basePath:A(a),index:t},String(t))))]},String(t))},Uo=d((({text:e,index:t,basePath:l,...n})=>{const a=he({isRemote:!(!j.BASE_PATH||!l)&&!j.BASE_PATH.startsWith(l),basePath:l}),{href:r,target:i,onClick:s}=a(n);return o("a",{className:p("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:r,target:i||"_self",onClick:s,children:e||`Раздел ${t}`})})),Ho=e=>!e.displayArea||Oo.includes(e.displayArea.toLowerCase()),Wo=d((({initialQuery:e,topItems:t})=>{const l=i((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=$o({basePathList:l,initialQuery:e}),r=i((()=>Ko(t)(n)),[t,n]);return o(Eo,{head:o(Fs,{autoFocus:!0,...a}),children:o(Fo,{topItems:r})})})),Ko=e=>t=>e?.length&&t?.length?pa(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],qo=(e={})=>{const{open:t,close:l}=de();return{open:(l={},n={})=>t(o(Wo,{...e,...l}),n),close:l}},Xo=d((({className:e,...t})=>{const[l,a]=n(""),i=r((()=>a("")),[]),s=qo(t),d=r((e=>{a(e),Yo(e)&&s.open({initialQuery:e},{onClose:i})}),[i,s]);return c("div",{className:p("relative",e),role:"search",children:[o(Fs,{value:l,onChange:d}),o(Mo,{className:"absolute top-0 right-0 sm:hidden",onClose:i})]})})),Yo=e=>e&&e.length>=3,Go=d((({className:e="",items:t})=>c("div",{className:e,children:[t?.length?t.map(Qo):null,o(be,{version:"primary",className:"w-full",href:"https://www.rshb.ru/natural/feedback/question",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),Qo=(e,t)=>c("div",{className:"mb-m space-y-m",children:[o("div",{children:o(je,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Zo)})]},String(t)),Zo=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Jo(e.type,e.text)}),o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Jo=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${ec(t)}`,children:o(je,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},ec=e=>e.replaceAll(/\D/g,""),tc=["split_version","New","Old"],lc=d((({className:e="",index:t,text:l,...n})=>{const a=he(),{href:r,target:i,onClick:s}=a(n);return o("a",{className:p("text-secondary-text",e),href:r,target:i,onClick:s,children:l||`Документ ${t}`})})),nc=d((({className:e="",links:t})=>o("div",{className:e,children:t?.length?o("div",{className:"flex justify-between items-center gap-lg py-lg border-solid border-x-0 border-y border-y-main-divider",children:t.map(((e,t)=>o(lc,{index:t,className:"text-l font-light max-w-[292px]",...e},String(t))))}):null}))),ac=d((({className:e="",index:t,...l})=>{const n=he({isRemote:!0}),{href:a,target:r,text:i,onClick:s}=n(l);return o("a",{className:`text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e}`,href:a,target:r,onClick:s,children:i||`Документ ${t}`})})),rc=d((({className:e="",links:t})=>c("div",{className:p("@container",e),children:[o("div",{className:"pt-lg",children:o(je,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg",children:t.map(((e,t)=>o(ac,{index:t,...e},String(t))))}):null]}))),ic="w-52",sc=kt((({className:e,footer:t,...l})=>{const n=l.options?.page?.sitemap??{},{logo:a}=n,{documents:i,relatedEnterprises:s,contacts:d,socialMedia:m,mobileApps:h}=t??{},u=r((()=>{const[e,t,l]=tc;((e,t)=>{const l=globalThis.document?.cookie.split(";")??[],[,n]=l.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(n)&&(globalThis.document.cookie=`${e}=${t(n)}`)})(e,(e=>e?.replace(t,l)))}),[]);return c(x,{tag:"footer",className:e,...l,children:[c("div",{className:"flex items-stretch gap-3xl pb-3xl ",children:[o(Bo,{className:ic,logo:a}),o(Xo,{className:"grow",...n})]}),c("div",{className:"flex items-stretch gap-6xl",children:[c("div",{className:p(ic,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Go,{items:d}),o(Ui,{media:m,children:"Соцсети"}),o(Ui,{media:h,showButtonText:!1,children:"Мобильное приложение"}),o(be,{version:"link",href:"https://old.rshb.ru",className:"!text-left text-s font-light",onClick:u,children:"Вернуться на прежнюю версию сайта"})]}),o(Fo,{className:"flex-grow",...n})]}),o(nc,{className:"mt-xl",links:s}),o(rc,{links:i})]})})),oc=d((({className:e="",title:t,description:l,calendar:n,...a})=>c(x,{className:p("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(T,{title:t,description:l,headlineVersion:"M",isEmbedded:!0}),n?cc(n):null]}))),cc=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),l=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:l.map((e=>dc(e,t)))}),o("div",{className:"flex gap-s w-full",children:l.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:mc(e)}),c("div",{className:"text-s",children:[o(je,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(je,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},dc=(e,t)=>e.month?.map(((e,l)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${l}`))),mc=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),hc=e=>({href:t})=>!!t&&O(uc(t,e)).startsWith(O(t)),uc=(e,t)=>$(e)?t.href:t.pathname;function pc(e=[]){const t=u(),l=e.findIndex((e=>hc(j.BASE_PATH?{pathname:j.BASE_PATH}:e))(t));return[l,e[l]]}const gc=d((({className:e="",active:t,flat:l,children:n,...a})=>{const r=he({isRemote:!0}),{href:i,target:s,text:c,onClick:d}=r(a);return o("a",{className:p(xc(t,l),e),href:i,target:s,onClick:d,rel:"noopener noreferrer","aria-label":c,children:o("span",{className:fc(t,l),children:c||n})})})),xc=(e=!1,t=!1)=>p("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",t?"":"px-m py-xs"),fc=(e=!1,t=!1)=>p("font-sans text-s font-light",e?"text-primary-main":p(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),bc=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(je,{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(yc,{...e},String(t))))})]}):null,yc=d((({icon:e,...t})=>{const l=he(),{text:n,target:a,href:r,onClick:i}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{pathPrefix:"/wcms-resources/",image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:r,target:a,onClick:i,children:o(je,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),vc=e=>t=>t.name?o(Fi,{isRemote:!0,href:`/branches/${t.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>{e&&e(t)},children:o(je,{size:"text-l",font:"font-light",children:t.name})},String(t.id)):null,Nc=d((({className:e,searchTerm:t,onSearch:l})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:"h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text",value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),wc=d((({foreignOffices:e,defaultLocation:t})=>{const[l,a]=Gs(t),i=he({isRemote:!0}),{href:s}=i({href:`/branches/${l.slug}`}),[d,m]=n(""),h=kc(Kl()).sort(((e,t)=>e.name.localeCompare(t.name))),u=((e,t)=>{const l=new Map;for(const n of e){const e=t(n),a=l.get(e)||[];l.set(e,[...a,n])}return l})(h,Cc),{close:p}=de(),g=r((e=>{a(e),p()}),[]);return c(Eo,{className:"pb-20",head:c("div",{children:[o(je,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?o("div",{className:"mb-s",children:c(S,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Fi,{isRemote:!0,href:s,className:"inline mx-2xs text-primary-main",children:l.name})]})}):null,o(Nc,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:h.filter((({name:e})=>e&&Ro(e.toLowerCase())(d.toLowerCase())>=.8)).map(vc(g))}):o("div",{className:"columns-1 sm:columns-5",children:Array.from(u.entries()).map((x=g,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(je,{size:"text-h6",children:e})}),t.map(vc(x))]},e)))}),bc(e)]});var x})),Cc=e=>e.name?.charAt(0)||"",kc=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Sc={default:"w-6 h-6",large:"w-12 h-12"},Ic=d((({className:e,isRounded:t,buttonSize:l="default",isGrayBg:n=!1,disabled:a,ariaLabel:r,image:i,onClick:s})=>o("button",{className:p("group/btn border-0 flex shrink-0 items-center",n?"p-s rounded-full":"p-0 bg-inherit",n&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Sc[l]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":r,onClick:s,children:o(ne,{image:i,className:p("h-full",t?"bg-main-divider/20 rounded-full":""),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Tc=d((({className:e,version:t,...l})=>{const n="transparent"===t?"white":"black",[a]=Gs(l.defaultLocation),r=qo(l),i=(e=>{const{open:t,close:l}=de();return{open:(l={})=>t(o(wc,{...e}),l),close:l}})(l);return c("div",{className:p("flex items-center gap-lg",e),role:"navigation",children:[o(gc,{flat:!0,href:"#",text:a?.name,onClick:()=>i.open()}),l.officesLink?o(gc,{flat:!0,href:l.officesLink,text:"Офисы и банкоматы"}):null,o(Ic,{image:{icon:"LoupeIcon",iconVersion:n},ariaLabel:"Поиск",onClick:()=>r.open()})]})})),Bc=d((({className:e="",items:t,activeItem:l})=>{const a=he(),[i,s]=n(!1),d=r((()=>s((e=>!e))),[]),m=Ut(r((()=>s(!1)),[]));return c("div",{className:p(i?"bg-white rounded-md shadow-blue-gray":"",e),ref:m,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":""+(i?"Скрыть другие разделы":"Показать другие разделы"),onClick:d,children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{className:p("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56",i?"":"hidden"),"aria-hidden":!i,children:t?.map(((e,t)=>{const{text:n,...r}=e,{href:i,target:s,onClick:c}=a(r);return o("a",{className:p("text-l font-light pb-m hover:text-primary-main",e===l?"text-primary-main":""),href:i,target:s,onClick:c,role:"menuitem",children:n},i||String(t))}))})]})})),Mc=e=>globalThis[e],Pc=(e,t)=>{const l=document.getElementById(t);if(l){const t=Mc(e);return t?Promise.resolve(t):new Promise((t=>{l.addEventListener("load",(()=>{t(Mc(e))}))}))}return new Promise(((l,n)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{l(Mc(e))})),a.addEventListener("error",(e=>{n(e)})),document.head.appendChild(a)}))};const Rc="chatbot",Vc="text-page__btn-chat",zc={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Ac=e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=zc[e??""];return l=>{if(t)if("personal"!==e)Pc(Rc,t);else{const e=l.target;e?.classList.contains(Vc)||e?.classList.add(Vc);document.getElementById("webchat-js-container:webchat_rshb")||Pc(Rc,t)}}},Dc=d((({chat:e="personal",iconVersion:t,className:l})=>{const n=Ac(e);return o(Ic,{className:l,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:"Чат",onClick:n,buttonSize:"large",isGrayBg:!0})})),jc=d((({className:e="",active:t,dataItemName:l,children:n,...a})=>{const r=he(),{href:i,target:s,text:d,onClick:m}=r(a);return c("a",{className:p("relative inline-block bg-transparent text-center no-underline",e),href:i,target:s,"data-item-name":l,onClick:m,children:[o("span",{className:$c(t),children:d||n}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]})})),$c=(e=!1)=>p("font-sans text-l font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Lc=d((({observerOptions:e,onVisibilityChange:t,children:l,className:n,...a})=>{const i=ka(r((e=>{if(!e.length||!t)return;const l=e[e.length-1];t(l.isIntersecting)}),[t]),e);return o("span",{ref:i,className:n,role:"menuitem",children:o(jc,{...a,children:l})})})),Ec={default:"px-lg bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},Oc=d((({version:e,internetBankUrl:t})=>t?o(be,{href:t,ariaLabel:"Интернет-банк",target:"_blank",className:p("py-s ml-s text-l font-light whitespace-nowrap hover:text-primary-main",Ec["transparent"===e?"transparent":"default"]),children:"Интернет-банк"}):null)),Fc=["all","header"],_c=e=>!e.displayArea||Fc.includes(e.displayArea.toLowerCase()),Uc=d((({subItems:e=[],version:t,internetBankUrl:l})=>{const a="transparent"===t?"white":"black",r=u(),d=i((()=>e.filter(_c)),[e]),m=(e=>(t=[])=>{const l=t?.filter(hc(e));return l?.length?Da((e=>e.href?.length||0))(l):void 0})(r)(e),[h,p]=n(d.length),g=d.slice(h),x=s(null),f={rootRef:x},b=i((()=>d.map(((e,t)=>e=>{p(e?Hc(t):Wc(t))}))),[d]);return c("nav",{className:"relative mt-s flex items-center justify-between",children:[o("div",{ref:x,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-3xl",role:"menu",children:d.map(((e,t)=>o(Lc,{className:h-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:b[t],...e},String(t))))}),g.length?o(Bc,{className:"relative w-auto z-40",items:g,activeItem:m}):null,c("div",{className:"flex",children:[j.CHAT_BOT?o(Dc,{className:"ml-4xl",iconVersion:a,chat:j.CHAT_BOT}):null,o(Oc,{version:t,internetBankUrl:l})]})]})})),Hc=e=>t=>Math.max(t,e+1),Wc=e=>t=>Math.min(t,e),Kc={"bg-white":"primary",transparent:"transparent"},qc=kt((({className:e,bgColor:t="bg-white",logo:l,version:n=Kc[t],portal:a,...r})=>{const i=r.options?.page?.sitemap??{},{topItems:s,logo:d}=i,[,m]=pc(s),{internetBankUrl:h}=a||{};return o(x,{tag:"header",className:p("pt-3xl px-20",m?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:n,...r,children:c("div",{className:"container",children:[c("div",{className:"flex items-center",children:[o(Bo,{className:"mr-3xl",bgColor:t,logo:l??d}),s?.filter(_c).map(((e,t)=>o(gc,{active:e===m,...e},String(t)))),o(Tc,{version:n,className:"ml-auto",...i})]}),o("div",{className:p("mt-xl h-px bg-main-divider","transparent"===n?"opacity-30":"")}),m?.items?.length?o(Uc,{subItems:m.items,version:n,internetBankUrl:h}):null]})})})),Xc={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Yc=kt((({className:e="",padding:t="p-0",gap:l="XS",version:n="transparent",isTheme:a=!1,isCardBorder:r,...i})=>o(x,{className:p("relative","grid grid-cols-12",Xc[l],e),padding:t,version:n,isTheme:a,...i,children:z({...i,extraProps:{className:Na(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),Gc=d((e=>{const{className:t,align:l,image:n,...a}=e,r=l?p("flex",gr[l]):"";return o(x,{className:p(r,t),defaultPadding:"p-0",...a,children:o(ne,{image:n})})})),Qc=d((({className:e="",cards:t=[],button:l})=>{const[a,i]=n(0),s=r((e=>i(e)),[]),d=t.length,[m,h]=wa({itemCount:d,visibleItemCount:2}),{canDec:u,canInc:p}=h,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden",children:[d?Zc({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,fr({...h,btnClass:["left-12","right-12"],className:"top-16"}),u?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(be,{className:"w-60 text-center",version:"primary",...l,href:g})]})}));function Zc({activeIndex:e,cards:t,selectedCardIndex:l,onClick:n}){const a=460*e,r=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${r}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:l,onClick:n}){return c("button",{type:"button",onClick:n,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(l?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?Jc("страховая сумма",e.sum):null,e?.fee?Jc("страховой взнос",e.fee):null]}),ed(l)]},String(t))}({slide:e,i:t,isActive:Boolean(t===l),onClick:()=>n(t)})))})})}function Jc(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(je,{size:"text-h6",children:[tt(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(je,{size:"text-l",color:"text-secondary-text",children:e})})]})}function ed(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const td=d((({className:e="",title:t,insuranceTabs:l=[],button:a,...i})=>{const[s,d]=n(0),m=r((e=>d(e)),[]);return c(x,{className:p("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...i,children:[t?o(k,{className:"text-center",title:t,headingType:"h3"}):null,l?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:l.map(((e,t)=>function({title:e,i:t,isActive:l,onClick:n}){return o("button",{type:"button",onClick:n,"aria-label":e,className:"box-border px-m py-s text-m font-light "+(l?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:ld({insuranceTabs:l,button:a})})]})})),ld=({insuranceTabs:e,button:t})=>{const l=e?.map((e=>e.cards));return l?.length?l.map(((e,l)=>o(Qc,{button:t,cards:e},String(l)))):null};const nd={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},ad={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},rd=d((e=>{const{className:t="",items:l,isDotted:n,investmentZeroColumn:a,investmentColumns:r,...i}=e,s=r?[...r]:[];return a&&s.unshift(a),o(x,{className:t,defaultPadding:"p-4xl",...i,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[oa(o("div",{className:"w-px h-4 bg-gray"}))(s.map(id)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(cd)})]}):null,l?.length?o(et,{className:"max-w-[657px]",items:l,isDotted:n,listItemSize:"M"}):null]})})})),id=(e,t,l)=>{const n=1===t,a=t===l.length-1;return o("div",{className:`${sd(n,a,e.cells)}`,children:e.cells?.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-2xs min-w-72":""),children:e.cells.reverse().map(od)}):null},`column_${t}`)},sd=(e,t,l=[])=>[l.length?"flex-1":"flex-0",!l.length||e||t?"":"pl-s",l.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),od=(e,t)=>{const l=e.cellSize||"XS",n=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${ad[l]} ${nd[n]} ${"XS"===l?"px-s":"px-5xl"}`,children:o(je,{align:"text-center",children:e.text})},`cell_${t}`):null},cd=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-[180px] text-center px-xs last:pr-3xl",children:e.title},`title_${t}`):null,dd=["байт","Кб","Мб","Гб","Тб","Пб"],md=d((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:r})=>{const i=r&&a?",":"",s=r??"",d=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:l,target:n,children:[e,t?c(je,{size:"text-l",font:"font-light",children:[t," ",hd(s,d),o(je,{color:"text-secondary-text",children:l&&`${s+i+d}`})]}):null]})})),hd=(e,t)=>e||t?o("span",{children:", "}):"",ud={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},pd=d((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:r={icon:"DocIcon"},columnsMode:i="double",...s})=>{const d=u();return c(x,{className:p("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(T,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:p("grid gap-xl","double"===i?"@md:grid-cols-2":"grid-cols-1",ud[i]),role:"list",children:a.map(gd(d,r))}):null]})})),gd=(e,t)=>(l,n)=>{if(""===l?.docType)return null;const a="Attachment"===l?.docType?W(e)(l?.attachment?.src):l?.href,r="Attachment"===l?.docType?((e,t=2)=>{if(0===e)return"";const l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(t))} ${dd[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,i="Attachment"===l?.docType?xd(a):l?.fileFormat;return o("div",{role:"listitem",children:o(md,{text:l?.text,target:l?.target,href:a,fileFormat:i,fileSize:r,icon:t?o(ne,{className:"min-w-6 min-h-6",image:t,width:"24",height:"24"}):null})},String(n))},xd=e=>{if(!e)return"";const t=e.lastIndexOf("."),l=new RegExp(/\/(.*)/),n=-1!==t?e.substring(t+1):"";return n.includes("/")?n.replace(l,""):n},fd=kt((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:r,items:i,qr:s,headingType:d,additionalDescription:m="",title:h="Мобильное приложение",version:u="primary",...g})=>{const f="secondary"===u?"p-m min-w-32":"min-w-24",b=r?.src?o(ne,{className:"hidden lg:block",image:r}):null;return o(x,{className:p("min-h-80",e),padding:"p-0",version:u,...g,children:c(Ce,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(k,{headingType:d,title:h,className:p("whitespace-pre-wrap",l)}),rightImage:b,buttons:Xe(n,{className:"flex-wrap"}),children:[a?o(je,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:p("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[o(et,{items:i,listItemSize:"M"}),o(je,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),s?.src?o("div",{className:p("flex justify-center bg-white rounded-md @xl:-order-1",f),children:o(ne,{className:"w-fit",image:s})}):null,r?.src?o(ne,{className:"lg:hidden",image:r}):null]})]})})})),bd={primary:"bg-white/30",secondary:"bg-main-divider"},yd={primary:"text-white",secondary:"text-secondary-text"},vd=d((({count:e,version:t="secondary"})=>o("div",{className:p("w-6 h-6 rounded-full flex items-center justify-center",bd[t]),role:"status",children:o(je,{size:"text-xs",color:yd[t],children:e})}))),Nd=(e=[],t={})=>e.filter((({content:e={}})=>xa(t,e))).length,wd=(e,t)=>e===t;const Cd=(kd=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(wd,((e=wd)=>(t,l)=>t===l||Boolean(t&&l&&t.length===l.length&&t.every(((t,n)=>e(t,l[n])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,l])=>kd(l,t[e])))));var kd;const Sd=[],Id={},Td={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},Bd={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},Md={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Pd={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Rd=d((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const r=e,{text:i,appendRight:s,...d}=t;return o(r,{className:p("h-12","block flex-1","cursor-pointer",Td[n],l?Pd[n]:Md[n]),role:"tab","aria-selected":l,onClick:a,...d,children:c("div",{className:p("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?Bd[n]:"text-secondary-text hover:text-primary-main"),children:[o(je,{size:"text-m",children:i}),s?o("div",{className:"ml-xs",children:s}):null]})})})),Vd=d((e=>o(e?.item?.href?zd:Ad,{...e}))),zd=d((e=>{const t=he(),l=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(Rd,{...e,tag:"a",item:a,onClick:n})})),Ad=d((({item:e={},onClick:t,...l})=>{const n=r((()=>{t&&t(e)}),[t,e]);return o(Rd,{item:e,onClick:n,...l})})),Dd=(e,t,l)=>(n,a)=>o(Vd,{isActive:n===e,onClick:t,type:l,item:n},String(a)),jd=d((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>o("div",{className:p("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(Dd(n,a,t))}))),$d={categories:[],extraOptions:[],propertyType:[],stage:[]},Ld=kt((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:u}]=ba($d,{block:a.block,page:a.options?.page}),g=r(((e=$d)=>u(e)),[]),f=(({hotFilters:e=Sd,filtrationState:t=Id,blocks:l=Sd,onFiltrationStateChange:n})=>{const a=i((()=>Math.max(0,e.findIndex((e=>Cd(e.filter,t))))),[e,t]),s=i((()=>e.map((t=>({text:t.text,appendRight:o(vd,{version:t===e[a]?"primary":"secondary",count:Nd(l,t.filter)})})))),[e,l,a]),c=r((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:c}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:g});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(jd,{...f}),o(da,{filtrationSchema:l,resetButton:n,field:m,reset:h}),o(Ss,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}});function Ed(e,t,l){t.geoObjects.removeAll();const n=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=new e.Clusterer({clusterIcons:[{href:"/icons/MapMarkerClusterIcon.svg",size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),r=l.map((({coords:t,content:l})=>new e.Placemark(t,{balloonContentHeader:l?.header,balloonContentBody:l?.body,balloonContentFooter:l?.footer,hintContent:l?.hint},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(r),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(l.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Od={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center",font:"text-center font-sans"},Fd=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Od).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:o(X,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),_d=()=>function(e,t,l=!0){const[r,i]=n(void 0);return a((()=>{let n=!0;return Pc(e,t).then((e=>{n&&i(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(n=!1,l){const e=document.getElementById(t);e&&document.head.removeChild(e),i(void 0)}}}),[e,t,l]),r}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${j.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Ud={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center",font:"text-center font-sans text-l"},Hd=d((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(Ud).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(X,{name:l,width:"20",height:"16"})})})),Wd={border:"border border-transparent rounded-md ",position:"absolute flex items-center justify-center",size:"w-12 h-12",focus:"focus:border-primary-text focus:border",font:"text-center font-sans",active:"active:bg-primary-active",hover:"hover:bg-primary-hover",other:"select-none cursor-pointer"},Kd=[55.753995,37.614069],qd=d((({points:e,className:t="",zoom:l=5})=>{const r=s(null),i=_d(),[d,m]=n();if(a((()=>{r?.current?i&&(Ed(i,r.current,e),e?.length||r.current.setCenter(Kd)):i?.ready((()=>{r.current||(r.current=new i.Map("map",{center:e?Xd(e):Kd,zoom:l,controls:[],suppressMapOpenBlock:!0}),Ed(i,r.current,e))}))}),[i,r,e,l]),!i)return null;const h=d?"z-[100000]":"z-10";return c("div",{id:"map",className:p(!d&&"relative","w-full",t),children:[o("div",{className:p(Object.values(Wd),h,"right-2 top-4 bg-white"),onClick:()=>{const e=r.current.container;d?e.exitFullscreen():e.enterFullscreen(),m(e.isFullscreen())},children:o(X,{name:"FullScreenIcon",width:"16",height:"16"})}),c("div",{className:p("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Hd,{yandexMaps:r}),o(Hd,{yandexMaps:r,direction:"out"})]}),Fd(r.current,i,p("right-2 top-80",h))]})})),Xd=e=>[Gd(Yd(e,0)),Gd(Yd(e,1))],Yd=(e,t)=>e.map((e=>e.coords[t])),Gd=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Qd={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему"},Zd="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Jd=(e,{field:t,reset:l},n=3)=>{const a=(e||[]).map((e=>o(Gl,{text:Qd[e],...t(e)},e))),[r,i]=n>0?[a.slice(0,n),a.slice(n)]:[a,[]];return o("div",{children:e?.length?o("div",{children:i.length>0?o(Ki,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Zd,children:r}),o(qi,{className:Zd,isUnfolded:e,children:i})]}),renderFoldButton:em(l)}):o("div",{className:Zd,children:r})}):null})},em=e=>({isUnfolded:t,onToggle:l})=>c("div",{className:"flex",children:[o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0 mr-lg",appendRight:o(X,{name:["ArrowDownIcon","ArrowUpIcon"][Number(t)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(t)],onClick:l}),o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,text:"Очистить фильтр",appendRight:o(X,{name:"CloseIcon",width:"16",height:"16"})})]}),tm=()=>{},lm=()=>[],nm=e=>"all"===e?"block":"hidden",am=d((({className:e,data:t=[],renderCard:l=tm,filterItems:a=lm,getBalloon:r=tm,initFilterState:s={},descriptionData:d,title:m})=>{const[h,{field:u,reset:g}]=At(s),[x,f,y]=i((()=>{const e=a(t,h),l=e.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:r(e)}))).filter((e=>e.coords&&2===e.coords.length));return[e,l,e.length]}),[t,h]),[v,N]=n("all");return c("div",{className:p("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-6xl pb-0",children:[c("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:[o(k,{headingType:"h2",children:m}),y?o(je,{size:"text-h2",color:"text-secondary-text",children:`(${y})`}):null]}),d?im(d):null,rm(t,v,N),o("div",{className:p("pb-2xl",nm(v)),children:Jd(Object.keys(s),{field:u,reset:g})})]}),o("div",{className:"h-[600px]",children:o(b,{children:o(qd,{points:f,className:"h-full"})})})]}),x.map(l)]})})),rm=(e,t,l)=>{const n="business"===t?"primary":"secondary",a=(e,t,n)=>(e.currentTarget===e.target&&"business"===t&&n.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription)),l(t),n);return c("div",{className:"flex pb-lg",children:[o(nn,{className:"mr-m","data-id":"all",onClick:t=>a(t,"all",e),version:"all"===t?"primary":"secondary",children:"Для физических лиц"}),o(nn,{"data-id":"business",onClick:t=>a(t,"business",e),version:n,children:"Для юридических лиц"})]})},im=({__html:e,list:t})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Ae,{__html:e})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(je,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,sm={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"}},om=d((({className:e,children:t,color:l="gray"})=>c("div",{className:p("sm:p-s sm:border sm:border-gray rounded-md flex items-center",sm[l].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(je,{size:"text-m",color:sm[l].text,children:t})]}))),cm=d((({value:e,subText:t,children:l,...n})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,l,t].every((e=>!e))?null:dm({textItems:a,subText:t,children:l,...n})})),dm=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:r,children:i})=>c("div",{className:p("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(je,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,i||l.filter(Boolean).map(((e,t)=>o(je,{size:"text-l",children:e.trim()},String(t)))),a?o(je,{color:n,size:"text-m",children:a}):null]}),mm=d((({className:e,children:t})=>o("div",{className:p("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),hm=["ArrowDownIcon","ArrowUpIcon"],um=["Подробнее","Скрыть"],pm=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:um[Number(e)]}),o(X,{className:"text-primary-text",name:hm[Number(e)],width:"16",height:"16"})]}),gm=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:r="",atmAccess:i="",workTime:s},d)=>{const m=[{label:"Устройство",value:bm(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(i)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(je,{size:"text-h4",children:bm(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(X,{name:"GeolocationIcon",width:"24",height:"24"}),o(je,{size:"text-l",children:t})]}):null]}),o(om,{color:"green",children:bm(s)})]}),o("div",{className:"hidden sm:block",children:o(mm,{className:"flex-wrap",children:m?.map(fm)})}),o(Ki,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(qi,{isUnfolded:e,children:o(mm,{className:"flex-wrap",children:m?.map(fm)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>pm({isUnfolded:e,onToggle:t})})]},String(d))},xm=({address:e="",terminalType:t,atmCode:l=""})=>({header:`${bm(t)} №${l}`,body:e.toUpperCase()}),fm=(e,t)=>o(cm,{...e},String(t)),bm=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",ym=[];const vm=async e=>{const t=await ft(e,{method:"GET"});return Array.isArray(t)?t:ym},Nm={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},wm={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},Cm=d((({data:e,className:t})=>{const[l]=Gs(),n=function(e){const{data:t=ym}=Ml(`/api/v1/atms?regionCode=${e}`,vm);return t}(l?.code??"000");return o(am,{className:t,filterItems:km,data:n,initFilterState:Nm,renderCard:gm,getBalloon:xm,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),km=(e,t)=>{const l=Object.keys(t).filter((e=>t[e])),n=l.filter((e=>e.startsWith("terminalType"))),a=l.filter((e=>!n.includes(e)));return e.filter((e=>{const t=a.every((t=>wm[t](e))),l=!n.length||n.some((t=>wm[t](e)));return t&&l}))},Sm=e=>{const t=Tm(e);return o(cm,{label:"Режим работы",value:t,className:"max-w-none"})},Im=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",Tm=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Im({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),Im({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean)},Bm=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Mm=e=>Bm.map((([t,l,n])=>({key:t,title:n,short:l,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),Pm=e=>{if(!e)return null;const t=Rm(e);return c(mm,{className:"border-none",children:[o(cm,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Vm)})}),o(cm,{label:"Режим работы",className:"max-w-none",children:o(je,{children:e})})]})},Rm=e=>{const t=Bm.map((([,e])=>({short:e,status:!0}))),l=e.split("/")??[],n=l[l.length-1]?.toLowerCase();return n?.includes("выходной")?t.map((e=>({...e,status:!n?.includes(e.short.toLowerCase())}))):t},Vm=({short:e,status:t},l)=>o("div",{className:p("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(je,{size:"text-xs",children:e})},String(l)),zm=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(cm,{label:"Валюта",value:e.currency}):null,t?o(cm,{label:"Купить",value:String(t)}):null,l?o(cm,{label:"Продать",value:String(l)}):null]},String(n)),Am=(new Date).getDay(),Dm=e=>{const[t]=e?.slice(Am-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:r}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(om,{color:"green",children:a}):null,l&&r?o(om,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(om,{color:"red",children:"Выходной"})},jm=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",$m=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},r)=>o(cm,{label:e,value:t&&l?l:"",subText:jm({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(r)),Lm=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Em=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${e}</p>`,Om=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Fm=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=Mm(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(je,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(X,{name:"GeolocationIcon",width:"24",height:"24"}),o(je,{size:"text-l",children:t})]}):null]}),Dm(u)]}),o("div",{className:"hidden sm:block",children:_m({phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Ki,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(qi,{isUnfolded:e,children:_m({phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>pm({isUnfolded:e,onToggle:t})})]},String(h))},_m=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:r,workSchedule:i,exchangeRate:s})=>{const d=Mm(i),m=i?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(mm,{className:"flex-wrap",children:[o(cm,{label:"Факс",value:t}),o(cm,{label:"Телефон филиала",value:e}),o(cm,{label:"Для обращений юридических лиц",value:l}),o(cm,{label:"Обслуживание физических лиц",value:n}),o(cm,{label:"Для консультаций по валютному контролю",value:r}),o(cm,{label:"Контакт-центр",value:a})]}),i?.isMatchesPattern?o(mm,{children:o(cm,{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($m)})})}):c(mm,{children:[o(cm,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Vm)})}),Sm(d)]}),i?.businessScheduleVisibleTag?Pm(i?.businessScheduleDescription):null,s?.currencies?.length?o(mm,{className:"flex-wrap",children:s?.currencies?.map(zm)}):null]})},Um=({name:e="",address:t="",workSchedule:l})=>{const n=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const r=`${t} ${(e=>{const t=Mm(e),l=e?Tm(t):"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&!e.businessScheduleDescription?Lm(l):Em(l):Om(l):null})(l)}`;return{header:n,body:r}},Hm=[];const Wm=async e=>{const t=await ft(e,{method:"GET"});return Array.isArray(t)?t:Hm},Km={workingSaturday:!1,premiumService:!1,privateBanking:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},qm={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday),premiumService:e=>Boolean(e.premiumService),privateBanking:e=>Boolean(e.privateBanking),sellingCoins:e=>Boolean(e.sellingCoins),buyingCoins:e=>Boolean(e.buyingCoins),bullionOperations:e=>Boolean(e.bullionOperations),preciousMetalsOperations:e=>Boolean(e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean(e.transferringDataToBiometricSystem)},Xm=d((({className:e})=>{const[t]=Gs(),l=function(e){const{data:t=Hm}=Ml(`/api/v1/branches?regionCode=${e}`,Wm);return t}(t?.code??"000");return o(am,{className:e,filterItems:Ym,data:l,initFilterState:Km,renderCard:Fm,getBalloon:Um,title:`Офисы филиала ${t?.name}`})})),Ym=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>qm[t](e)))))},Gm=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(x,{version:"transparent",className:p(t),defaultPadding:"p-0",...l,children:"offices"===n?o(Xm,{}):o(Cm,{data:e})})})),Qm=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(x,{className:p("box-border",e),...n,children:[o(T,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(y,{})]}))),Zm=d((({className:e="",padding:t,slides:l=[],...a})=>{const[r,i]=n(0);return c(x,{className:p("box-border overflow-hidden",e),defaultPadding:"py-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*r}%)`},role:"list",children:l.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(st,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),o("div",{className:"h-28 px-xs mt-m -mb-m flex gap-xs box-border",children:l.map(Jm({activeSlideIndex:r,onClick:i}))})]})})),Jm=({activeSlideIndex:e,onClick:t})=>({nav:l},n)=>{const a=n===e,r=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:py-xl backdrop-blur",i=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(n),"aria-label":l?.title,className:p("relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50",r),children:[o("div",{className:i,children:l?.title}),o("div",{className:s,children:l?.description})]},String(n))},eh=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:r,icon:i,title:s,version:d="primary",...m})=>c(x,{className:p("box-border text-left space-y-s",a),version:d,...m,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[qe(i)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:i})}):null,s?o(k,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[r?th(r):null,lh({label:"Адрес",data:e,iconName:"GeolocationIcon"}),lh({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),lh({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Xe([n]):null]})]}))),th=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ae,{__html:e})}),lh=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(X,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(je,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(je,{size:"text-xl",color:n,children:t})]})]}):null,nh=d((e=>{const{__html:t,richVersion:l,...n}=e;return o(x,{defaultPadding:"p-0",...n,children:o(Ae,{__html:t,richVersion:l})})})),ah=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(vs,{tag:"button",className:p("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(je,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(X,{name:l,iconVersion:"color",width:"24",height:"24"}):null}))),rh=kt((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:r,foldButtonVersion:i="default",version:s,role:c,...d})=>o(x,{className:p("w-full","border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Ki,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(qi,{className:p("gap-lg","grid grid-cols-12 [&>*]:pb-m"),isUnfolded:e,children:z({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ih({foldButtonVersion:i,label:n,labelIcon:a,labelIconBgVersion:r,isUnfolded:e,onToggle:t})})})),{childrenTypes:{exclude:["RollupItem"]}}),ih=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:r})=>{const i=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"MinusIcon":"PlusIcon")(a);return"accordion"===e?o(ah,{label:i,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:r}):o(Ns,{label:i,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:r})},sh=d((({className:e=""})=>{const[t,l]=n("option2"),a=r((e=>l(e)),[]);return c("div",{className:p("order-4",e),role:"radiogroup",children:[o(qn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(qn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),oh=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:r,label:i})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(qt,{options:s,label:i,placeholder:a||n,onChange:e=>r(e.key),value:c})})),ch=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:r})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(oh,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(oh,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:r,label:"Отделение",placeholder:"Выберите отделение"})})]}))),dh=["От 1 дня","До 365 дней"],mh=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(je,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(zn,{min:1,max:365,value:e,items:dh,onChange:t})]}))),hh=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:r})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(oh,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(oh,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:r,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),uh=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:r,selectedBoxSize:i,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(ch,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:ph(m)}),o(mh,{days:a,setDays:e=>m({days:e})}),o(hh,{caseVolumes:d,selectedCaseVolume:r,onSelectedCaseVolume:gh(m),safeBoxCases:s,selectedBoxSize:i,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(je,{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(sh,{}),o(be,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),ph=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},gh=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},xh=d((({days:e,tariffs:t=[]})=>{const l=bh(e,t),n="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[fh("Аренда за",e),fh("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(S,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),fh=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(je,{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})]}),bh=(e,t)=>{const l=yh(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},yh=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},vh=(e,t)=>e.find((e=>e.branchCode===t)),Nh=d((e=>{const{regions:t,data:l,branches:n,onChange:r,onClick:i}=e;a((()=>{r({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,r]);const s=vh(n,l.selectedBranch),d=wh(s?.safeBoxCaseVolumes),m=Ch(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=kh(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(uh,{...l,regions:t,onClick:i,branches:n,caseVolumes:d,safeBoxCases:m,onChange:r}),o(xh,{days:l.days,tariffs:h})]})})),wh=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Ch=(e,t)=>e?.find((e=>e.volume===t)),kh=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Sh=[];const Ih=async e=>await ft(e,{method:"GET"})||Sh,Th=d((({title:e,footnote:t,className:l="",...a})=>{const[i,s]=n(!1),d=r((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=Kl(),p=Bh(m.selectedRegion,u),g=function(e){const{data:t}=Ml(e?`/api/v1/safeboxes?regionCode=${e}`:null,Ih);return t||Sh}(p),f=r((e=>h((t=>({...t,...e})))),[h]),b=(y=vh(g,m.selectedBranch)||g,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(x,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(k,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Nh,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:f}),t?o(S,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&i?o(qd,{points:b,className:"h-[640px]"}):null]})})),Bh=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Mh=({styleMap:e,isMainButton:t,version:l})=>(n,a,r)=>{const{label:i,description:s,button:d,items:m,isDotted:h}=n;return c("div",{className:p("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",Ph(r.length)),children:[c("div",{className:"space-y-xs",children:[i?o(je,{size:"text-h6",align:"text-center",children:i}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[s?o("div",{className:e.description,children:s}):null,o(et,{className:e.description,items:m,listItemSize:"M",isDotted:h})]})]}),d?.text&&!t?o(be,{className:"box-border py-s w-full max-w-60 mt-auto",version:l,...d,children:d?.text}):null]},String(a))},Ph=e=>e<5?"w-72":"w-52",Rh={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"},Vh=d((({buttons:e,className:t="",description:l,showLines:n=!0,size:a="normal",steps:r=[],stepVersion:i="gray",title:s,version:d="primary",...m})=>{const h=r.length>3,u=Rh,g=(e=>e?"":"opacity-0")(n),f=(e=>e<5?"px-24":"px-16")(r.length),b=Boolean(e?.every((e=>e?.text)));return c(x,{className:p("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:d,...m,children:[o(T,{headlineVersion:"S",title:s,description:l,isEmbedded:!0,className:"w-full",align:ya}),r?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:p("flex items-center",f),children:oa(o("div",{className:p("h-0.5 w-full bg-secondary-light flex-1",g)}))(r.map(zh(u,a,i)))}),o("div",{className:p("flex justify-between",h?"gap-x-s":"gap-x-20"),children:r.map((y={styleMap:u,isMainButton:b,version:d},(e,t,l)=>{const{type:n}=e;if("default"!==n&&"rte"!==n)return null;switch(n){case"default":return Mh(y)(e,t,l);case"rte":return o("div",{className:p("text-center",Ph(l.length)),children:o(Ae,{__html:e.__html})},String(t));default:return null}}))})]}):null,Xe(e)]});var y})),zh=(e,t,l)=>({icon:n},a)=>{const r="secondary"===l?"white":"color";return o(x,{defaultPadding:"",className:`${Ah(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:l,children:qe(n)?o(ne,{image:{...n,iconVersion:n?.iconVersion||r},width:"48",height:"48"}):o("span",{className:p("text-h4","transparent"===l?e.iconText:(i=l,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var i},Ah=e=>"normal"===e?"h-24 w-24":"h-16 w-16",Dh=d((()=>o("div",{className:"hidden",role:"none"}))),jh=d((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=false,minHeight:r,children:i,onVisibleIndicesChange:s,listType:d="horizontal-list"})=>{const m=Array.isArray(i)?i.length:0,[h,u]=Fa({itemCount:m,onVisibleIndicesChange:s}),[g]=u.visibleIndicesRange;return c("div",{className:p(e,"vertical-list"===d?"relative h-full":""),children:[o(Ba,{containerRef:h,activeIndex:g,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:u.handleVisibleIndicesChange,listType:d,minHeight:r,children:i}),a?o(za,{containerRef:h,activeIndex:g,dotCount:m,listType:d,version:t}):null]})})),$h=kt((({listType:e,showDots:t,options:l,version:n,...a})=>o(x,{version:n,defaultPadding:"p-0",...a,children:o(jh,{listType:e,showDots:t,version:n,children:z({...a,options:l})})})),{childrenTypes:{exclude:["SwipeListControlBlock"]}}),Lh="hidden sm:flex absolute z-40 top-0",Eh=d((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[r,i]=Fa({itemCount:t?.length||0});return c("div",{className:p("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[o(Ba,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:i.handleVisibleIndicesChange,children:t.map(Dd(l,n,a))}),i.canScrollLeft?o(Ua,{className:p("left-6",Lh),onClick:i.scrollLeft}):null,i.canScrollRight?o(Ha,{className:p("right-6",Lh),onClick:i.scrollRight}):null]})})),Oh=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return o(jd,{...t});case"centered":return o("div",{className:"flex",children:o(jd,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return o("div",{className:"flex",children:o(Eh,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Fh="tab",_h=d((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...c})=>{const d=u(),{isReady:m}=d,g=i((()=>l.map(Hh)),[l]),[f,b]=n(0);a((()=>{if(!l||!l[0])return;const e=d.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===d.query.tab))||0,t=l[e]||l[0];b(e),Uh(t)}),[m]),a((()=>{const e=l[f];"group"===e?.type&&h.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,f]);const y=r((e=>{const t=g.indexOf(e),n=l[t];b(t),Uh(n),"group"===n.type&&(e=>{const t=new URLSearchParams(d.query);e.name?t.set(Fh,e.name):t.delete(Fh),d.replace(`${d.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,g]);return o(x,{className:p(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...c,children:Oh({items:g,value:g[f],tabsMode:s,onChange:y})})})),Uh=e=>{"group"===e.type&&h.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&h.fire("tab",{type:e.type,label:e.href})},Hh=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,Wh={start:"text-start",center:"text-center",end:"text-end"},Kh=d((({tab:e,className:t,onClick:l,isActive:n})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white text-primary-text"),title:e?"mb-xs text-xl":"mb-2xs text-l",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal"}))(n);return c("button",{type:"button",onClick:l,"aria-label":e?.title,className:p("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?o(ne,{className:p("h-6 w-6 min-w-6 min-h-6",a.icon),image:{...e?.icon,iconVersion:e?.icon?.iconVersion??a.iconVersion},width:"24",height:"24"}):null,c("div",{className:"border-0",children:[e?.title?o("div",{className:a.title,children:e.title}):null,e?.description?o("div",{className:a.desc,children:e.description}):null]})]})})),qh=d((({tab:e})=>{const t=he(),{onClick:l}=t({...e,onClick:()=>{e.href&&!L(e.href)&&(globalThis.location.href=e.href)}});return Po(l,[],800),o(y,{className:"col-span-12 p-xl",size:5})})),Xh=kt((({className:e="",tabs:t=[],block:l,tabAlign:a,...r})=>{const[i,s]=n(Gh(t)),d=Yh(t[i],i),m=t.length,[h,{inc:u,dec:g}]=wa({itemCount:m},i),[f,b]=Fa({itemCount:m});return c(x,{className:p(e),defaultPadding:"p-0",...r,children:[c("div",{className:"relative border-b-8 border-primary-main",children:[o(Ba,{itemClassName:"flex",containerRef:f,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:b.handleVisibleIndicesChange,children:t.map(Qh(i,s,a))}),o(qa,{scroll:b,arrowsPadded:!0,onScrollLeft:g,onScrollRight:u,activeIndex:h,itemCount:m})]}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[i]?.href?o(qh,{tab:t[i]}):V(l?.slots?.[d],{...r?.options,slotName:d,parent:l})})]})}),{slots:({tabs:e})=>e?.filter((e=>!e.href)).map(Yh)||[],childrenTypes:{exclude:["TabsLayout"]}}),Yh=(e,t)=>e?.title||`Слот №${t}`,Gh=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),Qh=(e,t,l="start")=>(n,a)=>o(Kh,{className:Wh[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),Zh=d((({className:e="",isOpen:t,onClick:l})=>o(be,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),Jh={Buttons:({buttons:e})=>Xe(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,List:({isDotted:e,...t})=>o(et,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(je,{size:"text-h6",children:e})}):null,t?o("div",{children:o(je,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?o(Zh,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},eu=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:r,setTableInner:i,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{r===o&&s||m(!0)}),[s,o]);return tu({cell:e,cellProps:{rowIdx:l,cellIdx:r,fieldIdx:t,displayTable:e=>{m(!1),c(r),i(e)},isVisible:d}})})),tu=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in Jh))return null;return o(Jh[l],{...t,...n})},lu=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:r,setOpenTableInnerIdx:i})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(eu,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:r,setOpenTableInnerIdx:i},String(s)))):null}))),nu=(e,t)=>140*Re(e.slice(0,t).map((e=>e?.cols?.length??1))),au=(e,t)=>e?.length>0?o("div",{className:p("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(je,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,ru=d((({rows:e})=>{const t=e?.[0]?.length??0,[l,n]=wa({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=l,(e,t)=>{if(!e?.length)return null;const[l,...n]=e,r=p("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[l?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(je,{size:"text-xl",font:"font-light",children:l.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:r,style:{transform:`translateX(-${nu(n,a)}px)`},children:n?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(je,{size:"text-xl",children:e.data}):null,e?.cols?au(e.cols,a):null]},`row${t}`)))})})]},String(t))})),fr({...n,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),iu=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(je,{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(ru,{rows:t.rowsData})})})]},n)}))}))),su=(e=!1)=>""+(e?"text-white":"text-secondary-text"),ou=d((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:p("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(je,{size:"text-xl",font:"font-light",color:su(t===l),children:e||t+1})},e)))}):null,t?o(be,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(X,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function cu(e){const t=await fetch(e);return await t.json()}const du=d((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=Ml(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),cu);return t||{}}(e),[i,s]=n(0),d=r((e=>s(e)),[]),m=a?.[i]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(ou,{currencies:h,activeTabIndex:i,setActiveTabIndex:d,linkToPDF:t}),o(iu,{activeTabIndex:i,items:m}),o(Zh,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(je,{size:"text-h6",children:"Данных нет"}),o(Zh,{onClick:l,isOpen:!0})]})})),mu=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:p("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(du,{...t,onClick:l})}):null]}))),hu=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...i})=>{const[s,d]=n(void 0),m=r((e=>d(e)),[]),[h,u]=n(void 0),g=r((e=>u(e)),[]);return c(mu,{onHideContentClick:()=>d(void 0),tableInner:s,...i,children:[o("div",{className:p("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(je,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(ns,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(lu,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...i},String(t))))}):null]})})),uu=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",children:[c("div",{className:"relative space-y-xs",children:[e,fr({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),pu=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:r=0,...i})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,u]=wa({itemCount:m,visibleItemCount:2}),g=(d||[]).map(((e,t)=>o(hu,{row:e,activeIndex:h,rowIdx:t,...i},String(t)))),[f,b]=r>0?[g.slice(0,-r),g.slice(-r)]:[g,[]];return c(x,{className:p("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...i,children:[o(T,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m",children:r>0?o(Ki,{renderFoldableSection:({isUnfolded:e})=>c(uu,{controls:u,children:[f,o(qi,{isUnfolded:e,children:b})]}),renderFoldButton:ws}):o(uu,{controls:u,children:g})})]})})),gu=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...r})=>c(x,{className:p("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===n?xu():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(je,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?fu(l):null,a?o(Ae,{__html:a}):null]})]}))),xu=()=>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"}),fu=e=>o(S,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),bu=d((({prefix:e,unit:t,suffix:l})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(je,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,l?o("div",{className:"gradient-color-text",children:o(je,{size:"text-h2",children:l})}):null]}))),yu=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(x,{defaultPadding:"p-0",...a,children:o(bu,{prefix:t,unit:l,suffix:n})})})),vu=kt((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:r=!1,isCardBorder:i=!1,image:s,...c})=>{const d=u();return o(x,{className:p("relative flex flex-col",Xc[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:r,...c,children:z({...c,extraProps:{className:p("w-full",Na(i)),padding:n?"":"p-0"}})})}),{childrenTypes:[]}),Nu=e=>(e=>{const t="col-span-",l=e?.split(/\s+/).find((e=>e.startsWith(t)));return l?parseInt(l.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",wu=d((({className:e,title:t,url:l,previewImg:n,...a})=>{const r=u();return c(x,{className:e,defaultPadding:Nu(e),...a,children:[o(T,{title:t,headlineVersion:"M"}),l?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:W(r)(n?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:W(r)(l)})}):null]})})),Cu={AdTile:It,ApplicationForm:yn,ApplicationFormCustom:na,ApplicationFormGrantSupport:sa,BankAccountFiltration:rr,BenefitsBlock:cr,BonusBenefitsBlock:pr,ButtonsBlock:xr,Calculator:yi,CardTransfer:Ii,Carousel:lr,CarouselBankHistoryCard:Ti,CarouselCard:Vi,CarouselCatalogCard:Ai,CarouselLinks:Ei,CarouselRecommendationCard:Hi,CarouselTariffsCard:Yi,ComparisonTable:ps,ContactsBlock:xs,DepositFiltration:Ps,Depository:Ks,ErrorBlock:Xs,ExchangeRateTile:No,Footer:sc,GracePeriod:oc,Header:qc,Headline:T,HorizontalLayout:Yc,ImgBlock:Gc,InsuranceAmountBlock:td,InvestmentInfo:rd,LinkDocs:pd,MobileAppTile:fd,MortgageFiltration:Ld,OfficesAtmsMap:Gm,Placeholder:Qm,ProductBlock:St,ProductGallery:Zm,RepresentativeOfficeInfo:eh,RichTextBlock:nh,RollupItem:rh,SafeDepositRental:Th,StepsBlock:Vh,StickyBottomMenu:Dh,SwipeListControlBlock:$h,Tabs:_h,TabsLayout:Xh,TariffsTable:pu,TextBlock:gu,UnitBlock:yu,VerticalLayout:vu,Video:wu},ku="rshb-query-params";function Su(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(ku)||"";return e&&globalThis.sessionStorage?.setItem(ku,e),e}const Iu=me((()=>{a((()=>{Su()}),[]);const e=Ac(j.CHAT_BOT);_t(globalThis,"click",Tu({loadBot:e,reachGoalYM:e=>{const[t]=j.YANDEX_METRIKA_ID?.split(",").reverse()??[];[t,e,globalThis.ym].every(Boolean)&&globalThis.ym(t,"reachGoal",e)}}))})),Tu=e=>t=>{const l=Bu(t.target);for(const t in l?.dataset)Pu(t)?.(l,e);if($(l?.href)&&!l?.href?.startsWith(globalThis.location?.origin)){t.preventDefault(),t.stopPropagation();const e=(e=>{const t=Su();if(!$(e)||!t)return e;const l=new URL(e);for(const[e,n]of new URLSearchParams(t))l.searchParams.set(e,n);return l.toString()})(l?.href)||l?.href;if(e){Mu(l?.target)?.(e)}}},Bu=e=>{let t=e;for(;Boolean(t)&&"A"!==t.tagName;)t=t?.parentNode;return t},Mu=uo([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]),Pu=uo([[e=>"ymtarget"===e,(e,t)=>t?.reachGoalYM(e?.dataset?.ymtarget)],[e=>"chatbot"===e,(e,t)=>t?.loadBot({target:e})]]),Ru="cookie",Vu=d((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=jt();Po((()=>{globalThis.localStorage?.getItem(Ru)||n()}),[],3e3);const i=r((()=>{globalThis.localStorage?.setItem(Ru,"true"),a()}),[]);return l?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:c(S,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",o(Fi,{isRemote:!0,className:zu(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",o(Fi,{isRemote:!0,className:zu(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),o("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:o(Mo,{className:"bg-main-gray rounded-md",onClose:i})})]})}):null})),zu=e=>p("inline mx-2xs",e?"text-green-dark":"");function Au(e){throw new Error(e)}const Du=({onCloseAll:e,onClose:t}={})=>{const[l,{push:i,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=r((e=>l((t=>[...t,e]))),[]),i=r((()=>l((e=>e.slice(0,-1)))),[]),s=r((e=>l((t=>t.filter((t=>t!==e))))),[]),o=r((()=>l([])),[]);return[t,{setList:l,push:a,pop:i,remove:s,clear:o}]}(),c=r((()=>{e&&e(l),o()}),[l,e]),d=r((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>h.subscribe("dialog",(e=>{switch(e.type){case"open":i(e);break;case"close":e.all?c():d();break;default:Au(e)}}))),[c,d]),l},ju=d((()=>{const e=r((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=r((e=>{e?.onClose&&e.onClose()}),[]),l=Du({onCloseAll:e,onClose:t}),{close:n}=de(),i=r((({key:e})=>{"Escape"===e&&n()}),[]);return _t(globalThis.document,"keydown",i),a((()=>{l.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[l]),l.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>o("div",{className:p("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),$u=d((()=>{const[e,t]=n(null),l=r((()=>{t(null)}),[]);a((()=>h.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:Au(e)}}))),[]);const i=r((({key:e})=>{"Escape"===e&&l()}),[l]);return _t(globalThis.document,"keydown",i),e?o("div",{className:p("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Lu="header",Eu="footer",Ou="sticky-footer",Fu={},_u=d((({className:e,data:t=Fu,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:r,fallback:i,...s}=t,d=Ct(s,i);Iu();const m={key:"",page:{slots:a,blocks:r,fallback:i,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:p("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:V(a?.header,{...m,slotName:Lu})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[z({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),V(a?.footer,{...m,slotName:Eu})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:V(a?.["sticky-footer"],{...m,slotName:Ou})}):null,o(ju,{}),o($u,{}),o(Vu,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Object.assign(_u,{childrenTypes:[],slots:()=>[Lu,Eu,Ou]});e.Blocks=Cu,e.ContentPage=_u,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),l=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await l.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.handlerDecorator=me,e.joinList=oa,e.packageVersion="0.14.260",e.projectSettings=j,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=_,e.useRouter=u,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";let t;const l=e=>(...l)=>t[e](...l),n=l("useState"),a=l("useEffect"),r=l("useCallback"),i=l("useMemo"),s=l("useRef");const o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,l){const{children:n,...a}=t||{},r=l?.slots?.default,i=n||r&&r();return e(Object.assign(a,i&&{children:i}),l)}return t.inheritAttrs=!1,t};const h=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const l=this.subjectsStateMap[e];return l&&t(l),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}};function u(){return u._impl()}u._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),u.setup=e=>{u._impl=e};const p=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),g={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},x=d((({className:e,version:t="primary",isTheme:l=!0,defaultPadding:r="p-xl",padding:i,block:s,tag:c="section",role:d,children:m,style:x})=>{const f=c,b=u(),[y,v]=n(!1);a((()=>h.subscribe("tab",(e=>{e.groupName&&e.groupName!==s?.labelGroup||v(Boolean(e.label&&s?.labels?.length&&!s.labels.includes(e.label)))}))),[s,b]);const N=t&&l;return o(f,{className:p("@container font-sans",N?"group":"",g[t],y?"hidden":"",i||r,e),...N?{"data-ver":t}:{},...s?.anchor?{id:s.anchor}:{},role:d,style:x,children:m})})),f=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),b=d((({children:e})=>f?e:null)),y=d((({className:e,size:t})=>o("figure",{className:p("m-0 mt-xl min-w-[80%]",e),children:v(t)}))),v=(e=3)=>w(100,e).map((e=>Math.floor(e))).map(N),N=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),w=(e,t)=>[e].concat(t>0?w(e/1.618,t-1):[]),C={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},k=d((({className:e="",headingType:t="h3",as:l="h3",title:n,children:a})=>o(l,{role:"heading",className:p("font-sans m-0",C[t],e),children:n||a}))),S=d((({children:e,...t})=>o("p",{className:p("font-sans",Object.values(t)),children:e}))),I={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},T=d((({className:e,version:t="",headlineVersion:l="XL",title:n,description:a,align:r="text-center",as:i,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=I[l],u={marginTop:h.descriptionStyle};return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[n?o(k,{className:p("whitespace-pre-wrap",r),...h?.title,as:i||h?.title.as,title:n}):null,a?o(S,{size:h.descriptionSize,font:h.descriptionWeight,align:r,...u,children:a}):null]})})),B=({blockClassName:e,block:t,render:l})=>l({blockClassName:e,block:t}),M=[];function P(e,t,{className:l,...n}={}){const{key:a,blockDecorator:r=B,blocksRegistry:i={},ancestors:s=M}=t,{type:c}=e;c&&c in i||console.warn(`No block with "${c}" is registered`);const d=c&&i[c];return r({blockClassName:p(e.style?.length?e.style:"col-span-12",l),block:e,ancestors:s,render:({block:l,blockClassName:r})=>{const{content:i}=l;return d?o(d,{className:r,block:e,options:t,...i,...n},a):null}},a)}const R=[],V=(e,{key:t,ancestors:l=R,slotName:n=null,extraProps:a,renderProps:r=P,...i})=>{const s=a?(e,t)=>P(e,t,a):r;return(e||[]).map(((e,a)=>s(e,{...i,key:`${t||e.type}-${a}`,ancestors:i.parent?[...l||R,[i.parent,n]]:l},a)))};function z({block:e,options:t,children:l,extraProps:n,renderProps:a}){return l||(e&&t?V(e.blocks,{...t,parent:e,extraProps:n,renderProps:a}):null)}const A=e=>e&&!e.endsWith("/")?`${e}/`:e,D=["CDN","BASE_PATH"],j=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const l=e._[t]||e[t];return D.includes(t)?A(l):l}}),$=e=>Boolean(e?.includes(":")),L=(e,t)=>Boolean(e&&!$(e)&&(!t||"_self"===t)),E=e=>Boolean(e?.startsWith("#")),O=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),F=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/");var _=Object.freeze({__proto__:null,isURL:$,isLocalURL:L,isHash:E,withoutQuery:O,joinPath:F});const U="/api/",H=`${U}v1/storage`,W=e=>(t,l=j.BASE_PATH)=>{if([!t,$(t),E(t),[j.CDN,U].some((e=>K(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${H}/${t}/attachment`;const n=t?.startsWith("/");return F(K(t,l)?"":l,n?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},K=(e,t)=>t&&e&&e.startsWith(t),q={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},X=d((({className:e="",imageClassName:t="",name:l="",alt:n=`Иконка ${l}`,title:a=n,iconVersion:r="color",width:i,height:s})=>{const d=u(),m="normal"===r?`${l}.svg`:`sprites.svg#${l}`,h=W(d)(F(j.CDN,"/icons/",m));return"normal"===r?o("img",{className:e,src:h,alt:n,title:a,"aria-hidden":"true",width:i,height:s,style:Y(e,s)}):o(Q,{className:e,children:c("svg",{className:p(G(i),q[r],"white"===r?"invert":"",t),width:i,height:s,"aria-hidden":"true",children:[a?o("title",{children:a}):null,n?o("desc",{children:n}):null,o("use",{href:h,xlinkHref:h})]})})})),Y=(e,t)=>{return e?.includes("h-")?{}:{height:(l=t,l&&!/\D/.test(l)?`${t}px`:t),width:"auto"};var l},G=e=>e?"":"w-full h-full",Q=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),Z=(e,t)=>l=>l&&!$(l)?W(e)(F(t,l)):l,J=(e,t)=>e?.media&&t?.media?e.media-t.media:0,ee=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n})=>{const a=u();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(J).map((({src:e,format:l,media:r},i)=>o("source",{srcSet:Z(a,n)(e),type:le(l),media:r?`(max-width: ${r}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?te({...t,src:Z(a,n)(t.src)},l):null]})})),te=(e,t="")=>o("img",{src:e.src,className:p("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),le=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:l="",pathPrefix:n,...a})=>t?.src||t?.icon?t.icon?o(X,{className:e,imageClassName:l,iconVersion:t?.iconVersion,name:t.icon,...a}):o(ee,{className:e,imageClassName:l,image:t,pathPrefix:n}):null)),ae={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",ie={primary:re,secondary:re,white:re,link:"",transparent:"",gray:re,"":""},se="text-center font-sans select-none",oe={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","":""},ce=({className:e,rounded:t,version:l})=>[se,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",l?ae[l]:"",t?"rounded-full":"rounded-md",e].join(" "),de=()=>({open:(e,t={})=>h.fire("dialog",{type:"open",dialog:e,...t}),close:()=>h.fire("dialog",{type:"close"}),closeAll:()=>h.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function he(e={}){const{isRemote:t,basePath:l}=e,n=u(),{closeAll:a}=de();return e=>({...e,href:t&&!l?e.href:W(n)(e.href,l),"aria-label":e.text,onClick:me(r(e))});function r({href:e,target:l,onClick:r}){return i=>{r&&r(i),e&&!t&&L(e,l)&&(a(),i?.preventDefault(),n.push(e))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const ue=(e={})=>Object.entries(e).reduce(((e,[t,l])=>({...e,[`data-${t.toLowerCase()}`]:l})),{}),pe=d((e=>{const{text:t,aboveText:l,appendLeft:n,appendRight:a,version:r="primary"}=e,i=xe(e)?"hidden lg:block":"";return c("div",{className:p(ge(e),"flex gap-xs"),children:[n?o("div",{className:p(i,oe[r]),children:n}):null,xe(e)?c("div",{className:"whitespace-pre",children:[l?o("div",{className:"text-xs font-light text-left",children:l}):null,o("div",{className:"text-left "+(l?"text-s -mt-3xs":"text-l"),children:t})]}):null,a?o("div",{className:p(i,oe[r]),children:a}):null]})})),ge=e=>{const{version:t,aboveText:l,rounded:n}=e;if("link"===t)return"";const a=""+(l?"py-2.5 px-9":"py-4 px-9");return p("group/btn items-center justify-center",xe(e)?a:"h-12 w-12 m-auto",n?"rounded-full":"")},xe=({text:e,aboveText:t,appendLeft:l})=>Boolean(e||t||!l),fe=({className:e,rounded:t,version:l})=>["inline-block",se,l?ie[l]:"",t?"rounded-full":"rounded-md",e].join(" "),be=d((({disabled:e,children:t,method:l="LINK",href:n,...a})=>{const i=(({method:e,href:t})=>r((l=>{if("POST"!==e||!t)return;l.preventDefault(),l.stopPropagation();const{origin:n,pathname:a,searchParams:r}=new URL(t||""),i=document.createElement("form");i.setAttribute("method","POST"),i.setAttribute("action",[n,a].join(""));for(const[e,t]of r.entries()){const l=document.createElement("input");l.setAttribute("type","hidden"),l.setAttribute("name",e),l.setAttribute("value",t),i.appendChild(l)}document.body.appendChild(i),i.submit()}),[]))({method:l,href:n}),s=he()({onClick:i,href:n,...a}),c=t??o(pe,{...s});return o(e?ve:ye,{...s,children:c})})),ye=d((({className:e="",href:t,rel:l,target:n,ariaLabel:a,version:r,rounded:i,onClick:s,type:c,data:d,children:m})=>o("a",{className:ce({className:e,version:r,rounded:i}),href:t,rel:l,target:n,"aria-label":a,role:t?"link":"button",onClick:s,type:c,...ue(d),children:m}))),ve=d((({className:e,ariaLabel:t,version:l,rounded:n,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:fe({className:e,rounded:n,version:l}),children:a})));function Ne(e,t,l=!1){const n="primary"===e?"white":"black",a="Вернуться назад";return c("div",{className:p(l?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:ce({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",version:e,rounded:!0}),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:n}})}),o(be,{version:"link",className:"group-data-secondary:text-white/80",text:a,ariaLabel:a,onClick:t,type:"button"})]})}const we={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ce=d((({className:e,version:t="primary",defaultPadding:l,padding:n="",title:a="",insetTitle:i="",buttons:s,leftImage:d,rightImage:m,imageAlign:h,isImageAlwaysOnRight:g=!1,isImageSecondary:x=!1,backwardButton:f,children:b,...y})=>{const v=u(),N=r((()=>{v.back()}),[]);return c("div",{className:ke(n,l,e),children:[f?Ne(t,N):null,a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:p("grow relative flex flex-col @xl:flex-row gap-3xl w-full",d?"self-start @xl:w-auto":""),children:[Me(d,{imageAlign:h,className:"mx-auto"}),c("div",{className:p("grid gap-3xl",m?"@xl:grid-cols-2":"",d?"":"grow","h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[i,b]}),Be(z({...y,extraProps:{className:"@container-normal"}})),Me(m,{className:p("@xl:justify-self-end @xl:col-start-2",s?Se(g):"",Ie(g),Pe(x)),imageAlign:h}),Te(s)]})]})]})})),ke=(e="",t="",l="")=>p("relative flex flex-col gap-3xl overflow-hidden",e||t,l),Se=e=>e?"row-span-2":"@xl:row-span-2",Ie=e=>e?"col-start-2 self-center":"",Te=e=>e?o("div",{className:"self-end",children:e}):null,Be=e=>e&&e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Me=(e,{className:t,imageAlign:l})=>e?o("div",{className:p("shrink-1/2 justify-self-center",l&&we[l],t),children:e}):null,Pe=e=>e?"hidden @xl:block":"",Re=(e=[])=>e.reduce(((e,t)=>e+t),0),Ve=(e=[])=>e?.length?Re(e)/e.length:0,ze=(e,t="normal")=>e?o("div",{className:p("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Ae=d((e=>{const{__html:t="",richVersion:l=""}=e;return t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:p(l,"md-container"),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(S,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,je=d((({children:e,...t})=>o("span",{className:p("font-sans",Object.values(t)),children:e}))),$e=(e,t)=>e?o(je,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Le=(e,t)=>"rte"===e.type&&"__html"in e&&e.__html?o(Ae,{...e},`rte-${t}`):["label"in e?$e(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null],Ee=d((({className:e,benefitsVersion:t,...l})=>c("div",{className:p("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in l?ze(l.icon,t):null,o("div",{children:Le(l)})]}))),Oe=e=>"rte"===e.type?e?.__html?.length||0:Math.max(e?.label?.length||0,e?.description?.length||0),Fe=e=>{return((t=e.map(Oe))?.length?Math.sqrt(Math.abs(Ve(t.map((e=>e**2)))-Ve(t)**2)):0)>16;var t},_e=e=>e&&"icon"in e&&e.icon&&(e.icon.icon||e.icon.src),Ue=e=>!e.some(_e),He=d((({className:e,benefitsVersion:t="normal",benefits:l})=>l?.length?o("div",{className:p("flex gap-x-m gap-y-s",Fe(l)||Ue(l)?"flex-col":"flex-wrap",e),role:"list",children:l.map(((e,l)=>o(Ee,{benefitsVersion:t,...e},String(l))))}):null)),We=d((({className:e,benefits:t})=>t?.length?o("div",{className:p("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Le)}):null)),Ke=d((({isTabularBenefits:e,...t})=>o(e?We:He,{...t}))),qe=e=>Boolean(e?.src||e?.icon),Xe=(e,{className:t,buttonClassName:l,isVertical:n}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:p("flex",n?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m",t),role:"group",children:e.map(Ye(l))}):null,Ye=(e="")=>(t,l)=>{const{text:n,icon:a,iconRight:r,version:i,...s}=t||{},c=Ge(a,i),d=Ge(r,i);return n||a?.icon?o(be,{className:p("basis-full @lg:basis-auto",e),appendLeft:Qe({...a,iconVersion:c}),appendRight:Qe({...r,iconVersion:d}),version:i,text:n,...s},l?String(l):""):null},Ge=(e,t="secondary")=>{const l="secondary"===t?"color":"white";return e?.iconVersion?e?.iconVersion:l},Qe=e=>qe(e)?o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}):null,Ze=d((({className:e,isDotted:t,dotClassName:l,children:n})=>c("div",{className:p("font-sans flex",e),role:"listitem",children:[t?o("div",{className:"shrink-0",children:o("div",{className:p("align-middle inline-block rounded-full group-data-secondary:bg-white",l)})}):null,o("span",{children:n})]}))),Je={S:{textSize:"text-l font-light",indentStyle:"ml-xs",dotStyle:"w-1 h-1 mr-xs"},M:{textSize:"text-h6",indentStyle:"ml-s",dotStyle:"w-1.5 h-1.5 mr-s"},L:{textSize:"text-h5",indentStyle:"ml-m",dotStyle:"w-1.5 h-1.5 mr-m"}},et=d((({className:e,isDotted:t=!0,items:l=[],listItemSize:n="M",dotClassName:a=""})=>{const r=Je[n];return l?.length?o("section",{className:p("flex flex-col gap-xs text-left text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text",r.textSize,e),role:"list",children:l.map(((e,l)=>o(Ze,{isDotted:t,dotClassName:p(a||"bg-primary-text",r.dotStyle),children:e},String(l))))}):null})),tt=(e=0,{fixed:t}={})=>(l=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(l)||0),lt=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(nt)}):null)),nt=({label:e,amount:t},l)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(je,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[tt(2)(t)," ₽"]}):null]},String(l)),at=d((({className:e,tags:t})=>t?.length?o("div",{className:p("flex flex-wrap gap-xs",e),role:"list",children:t.map(rt)}):null)),rt=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(je,{size:"text-m",font:"font-light",children:e})},String(t)),it={XXL:"L",XL:"L",L:"M",M:"M",S:"S",XS:"S"},st=d((({className:e,padding:t,defaultPadding:l,title:n,description:a,headlineVersion:r="L",align:i="text-left",benefitsVersion:s,isTabularBenefits:d,benefits:m,__html:h,isFullWidthTitle:u,items:p,isDotted:g=!0,priceList:x=[],tags:f=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:k,children:S,...I})=>{const B=y?.src?o(ne,{image:y}):null,M=o(T,{title:n,description:a,headlineVersion:r,align:i,isEmbedded:!0}),P=m?.filter((e=>"rte"===e?.type||"label"in e||"description"in e));return o(Ce,{className:e,padding:t,defaultPadding:l,...u?{title:M}:{insetTitle:M},...ot(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Xe(b),backwardButton:k,...I,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Ke,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Ae,{__html:h}):null,p?.length?o(et,{items:p,isDotted:g,listItemSize:it[r]}):null,S,x?.length?o(lt,{priceList:x}):null,ct(f)]})})})),ot=(e,t)=>t?{rightImage:e}:{leftImage:e},ct=e=>e?.length?o(at,{tags:e}):null,dt=e=>Boolean(e&&Array.isArray(e)),mt=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),ht=(e,t)=>{return l=e,Boolean(mt(l)&&"string"==typeof l.$ref)?t.ref(e):mt(e)?t.record(e):dt(e)?t.array(e):t.scalar?t.scalar(e):e;var l},ut=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(pt,e),pt=(e,t)=>e&&t?mt(e)?e[t]:dt(e)?e[parseInt(t,10)]:e:e,gt=(e,t)=>ht(e,{ref:({$ref:e,...l})=>gt(e?ut(t(e),e):l,t),record:e=>Object.entries(e).map((([e,l])=>({[e]:gt(l,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>gt(e,t)))}),xt=(e,t,l=[])=>{ht(e,{ref:e=>t(e.$ref,l),record:e=>{for(const n in e)xt(e[n],t,[...l,n])},array:e=>{for(let n=0;n<e.length;n++)xt(e[n],t,[...l,n])}})};async function ft(e,t){try{return e?await bt(e,t):null}catch(e){console.error(e)}return null}const bt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),yt=e=>[...new Set(e)],vt={},Nt=["/portal-resources"],wt=(e,t)=>gt(e,(e=>t?.[e])),Ct=(e,t)=>{const l=(e=>{const t=[];return xt(e,(e=>t.push(e))),t})(e),[r,i]=n({});return a((()=>{l.length&&(async e=>Object.fromEntries((await Promise.allSettled(yt(e).filter((e=>!Nt.some((t=>e.startsWith(t))))).map((async e=>[e,vt[e]||=await bt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(l).then(i)}),[l.join()]),l.length?wt(e,{...t,...r}):e};function kt(e,t={}){const l=d((t=>{const l=Ct((({block:e,options:t,className:l,defaultPadding:n,padding:a,isTheme:r,version:i,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...l})}));return Object.assign(l,t),l}const St=kt((({className:e,padding:t,...l})=>o(x,{className:p("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...l,children:o(st,{defaultPadding:"p-6xl",padding:t,className:"grow h-full",...l})})),{childrenTypes:["UnitBlock"]}),It=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},l=i((()=>Tt(0,t?.length)),[t]),n=t?.[l];return n?o(b,{children:o(St,{...n,...e})}):o(x,{...e,children:o(y,{})})})),Tt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Bt=e=>e?.replace(/[^+\d]/g,"");function Mt(){return{send:async function(e,t=!1){const l=t?"/api/v1/lead":"/api/v1/sendcorporatelead",{typeForm:n,region:a,phone:r="",email:i,birthday:s,inn:o,fullName:c,addressBranch:d,secondaryPhone:m="",bankEmpolee:h,applicationDate:u,...p}=e,g={typeForm:n,[t?"regionBranch":"region"]:a,[t?"email":"mail"]:i,...Pt(r),...t?{birthday:s?.toLocaleString()}:{inn:o,fullName:c},..."FEEDBACK"===n?{}:{addressBranch:d,bankEmpolee:h,applicationDate:u,...Rt(m)},...p};try{const e=await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(g)});if(!e?.ok)return null;return await e.json()}catch(e){return null}}}}const Pt=(e,t)=>e?{[t?"phoneNumber":"phone"]:Bt(e)}:{},Rt=e=>e&&"+7 ("!==e?{secondaryPhoneNumber:Bt(e)}:{},Vt=d((({responseType:e})=>{const t="OK"===e,l=t?"ResponseOKIcon":"ResponseFailIcon";return c("div",{className:p("flex items-center p-lg rounded-md space-x-m",t?"bg-ok":"bg-fail"),children:[o(ne,{image:{icon:l,iconVersion:"normal"},width:"42",height:"42"}),c("div",{children:[o(k,{headingType:"h6",title:t?"Ваша заявка отправлена":"Не удалось отправить заявку",className:"mb-2xs"}),o(je,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t?"Совсем скоро мы с вами свяжемся":"Пожалуйста, повторите позднее"})]})]})})),zt=e=>e,At=(e,{resetOnSubmit:t,onSubmit:l}={})=>{const[a,i]=n(e),[o,c]=n(!1),[d,m]=n({}),h=s({}),u=r(((e,t)=>{const{parse:l=zt,format:n=zt}=t||{};return h.current||(h.current={}),h.current[e]||=t=>{i((n=>({...n,[e]:l(t)}))),m((t=>({...t,[e]:!0})))},{value:n(a[e]),isDirty:o||d[e],onChange:h.current[e]}}),[a,o,d]),p=r((e=>{i(e),m(e)}),[]),g=r((()=>{i(e),c(!1),m({})}),[e]),x=r((e=>{e.preventDefault(),t?g():c(!0),l&&l(a)}),[l,a]);return[a,{isDirty:o||Object.values(d).some(Boolean),field:u,update:p,reset:g,onSubmit:x}]},Dt=e=>o("div",{className:"h-6",children:e?o(je,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null});function jt(e=!1){const[t,l]=n(e),a=r((()=>l(!0)),[]),i=r((()=>l(!1)),[]),s=r((()=>l((e=>!e))),[]);return[t,{setValue:l,setTrue:a,setFalse:i,toggle:s}]}const $t=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const l=String(e.getDate()).padStart(2,"0"),n=String(e.getMonth()+1).padStart(2,"0"),a=t?String(e.getFullYear()):String(e.getFullYear()).slice(-2);return t?`${a}-${n}-${l}`:`${l}.${n}.${a}`}},Lt=e=>e?o(je,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Et=d((({key:e,className:t="",id:l,name:n,type:i="text",label:d,placeholder:m,value:h="",valid:u=!0,children:g,onChange:x,onFocus:f,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1})=>{const w=s(null),C=r((e=>{x&&x(e.target?.value||"")}),[x]);a((()=>{v&&w.current?.focus()}),[v,w]);const k="w-full border rounded-md text-primary-text outline-none p-m",S=g?"pr-3xl":"",I=Ot(u);return c("div",{className:p("relative",t),children:[c("label",{className:"space-y-xs",children:[Lt(d),N?o("textarea",{className:p("block resize-y min-h-24",k,I),id:p("textarea",l),name:n||l,placeholder:m,value:h,onInput:C,onFocus:f,onBlur:b},e):o("input",{type:i,className:p("h-14",k,S,I),ref:w,id:l,name:n||l,placeholder:m,value:h,onInput:C,onFocus:f,onBlur:b,pattern:y},e)]}),g]})})),Ot=e=>e?"border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text":"border-error",Ft=e=>e?.text||e?.key||"";function _t(e,t,l,n){a((()=>{if(e&&l)return e.addEventListener(t,l,n),()=>{e.removeEventListener(t,l,n)}}),[e,t,l])}function Ut(e){const t=s(null),l=r((l=>{t&&t.current&&l.target instanceof Node&&!t.current.contains(l.target)&&e()}),[e]);return _t(globalThis.document,"click",l),t}const Ht=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Wt=d((({popupRef:e,options:t,value:l,query:n,onChange:a,iconVersion:r})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Ht(t,n).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===l?.key,onClick:t=>{t.stopPropagation(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Ft(e)}),o(X,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:r,className:p("absolute right-4 pt-3xs",e.key===l?.key?"":"hidden")})]},e.key)))}):null));function Kt({isOpen:e,options:t,value:l,query:n,onChange:i,onClose:c,iconVersion:d}){const m={open:(e,t)=>h.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>h.fire("popup",{type:"update",popup:e,...t}),close:()=>h.fire("popup",{type:"close"})},u=r((()=>{m.close(),c&&c()}),[c]),p=r((e=>{u(),i&&i(e)}),[u,i]),g=s(null),x=Ut(u);return a((()=>{if(!e||!g.current)return;const a=g.current,{top:r,left:i,width:s,height:c}=a.getBoundingClientRect();m.update(o(Wt,{popupRef:x,options:t,value:l,query:n,onChange:p,iconVersion:d}),{top:r+window.scrollY+c,left:i,width:s})}),[e,t,l,n,p]),g}const qt=d((({className:e,label:t,options:l=[],value:a,valid:i=!0,isBorder:s=!0,placeholder:d="",isSearch:m=!1,iconVersion:h="black",onChange:u,disabled:g})=>{const[x,{setFalse:f,setTrue:b}]=jt(),[y,v]=n(""),N=g||0===l.length,w=x&&!N,C=r((()=>{v(""),f()}),[]),k=Kt({isOpen:x,options:l,value:a,query:y,onChange:u,onClose:C,iconVersion:h});return c("div",{className:p("space-y-xs",e),children:[Lt(t),c("div",{className:p("relative",w?"z-20":"z-10"),ref:k,children:[c("div",{className:p("h-14 [&>*]:p-m pr-8 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",Yt(s,i,N)),onClick:w?C:b,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Ft(a)||d}),Xt(w,h)]}),m&&w?o("div",{className:p("absolute top-0 w-full z-20"),children:o(Et,{type:"text",autoFocus:!0,value:y,onChange:v})}):null]})]})})),Xt=(e,t)=>o(X,{className:p("absolute right-3 flex self-center",e?"":"rotate-180"),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),Yt=(e,t,l)=>p(e?"border rounded-md ":"",e&&!l?"hover:border-primary-hover":"",l?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),Gt=()=>{},Qt=({today:e,firstDayOfWeek:t,totalDays:l,currentMonth:n,currentYear:a,min:r,max:i,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const h=[];for(let c=0;c<7;c++)if(0===m&&c<t)h.push(o("td",{},`empty-${c}`));else if(d>l)h.push(o("td",{},`empty-${c}`));else{const t=new Date(a,n,d),l=Zt(t,e),c=Jt(t,r,i);h.push(o("td",{children:o("div",{className:el(l,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:h},`row-${m}`))}return c},Zt=(e,t)=>t&&e.toDateString()===t.toDateString(),Jt=(e,t,l)=>t&&e.getTime()<t.getTime()||l&&e.getTime()>l.getTime(),el=(e,t)=>p("p-s text-center rounded-md border",e?"":"border-transparent hover:bg-gray",t?"text-gray hover:bg-transparent":"cursor-pointer"),tl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],ll=d((({today:e,currentMonth:t,currentYear:l,min:n,max:a,onDateSelect:s=Gt})=>{const d=r((e=>s(e)),[]),{firstDayOfWeek:m,totalDays:h}=i((()=>({firstDayOfWeek:new Date(l,t,1).getDay()-1,totalDays:new Date(l,t+1,0).getDate()})),[l,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:tl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Qt({firstDayOfWeek:m,today:e,totalDays:h,currentYear:l,currentMonth:t,min:n,max:a,onDateClick:d})})]})})),nl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],al=nl.map((e=>({key:e}))),rl=Array.from({length:(new Date).getFullYear()-1940+1},((e,t)=>1940+t)).reverse().map((e=>({key:String(e)}))),il={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},sl={className:"min-w-32",iconVersion:"black",isBorder:!1},ol=d((({className:e="",label:t="",value:l,valid:a=!0,minDate:i,maxDate:s,onChange:d})=>{const[m,{setValue:h}]=jt(!1),[u,g]=n(l?.getMonth()||(new Date).getMonth()),[x,f]=n(l?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:b,handleNextMonth:y,handleSelectMonth:v,handleSelectYear:N,monthsOptions:w,yearsOptions:C,handleChangeVisibleCalendar:k,ref:S}=(({onShowCalendar:e,showCalendar:t,selectedMonth:l,onMonthSelect:n,onYearSelect:a,selectedYear:i})=>{const s=Ut(r((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:r((()=>e(!t)),[t]),handleNextMonth:r((()=>{l+1<=11?n(l+1):(n(0),a(i+1))}),[l]),handlePrevMonth:r((()=>{l-1>=0?n(l-1):(n(11),a(i-1))}),[l]),handleSelectMonth:r((({key:e})=>n(nl.indexOf(e))),[]),handleSelectYear:r((({key:e})=>a(Number(e))),[]),monthsOptions:al,yearsOptions:rl,ref:s}})({onYearSelect:f,onMonthSelect:g,onShowCalendar:h,selectedYear:x,selectedMonth:u,showCalendar:m});return c("div",{className:p("space-y-xs",e),ref:S,children:[Lt(t),c("div",{className:"relative",children:[cl(k,l,a),m?c("div",{className:"absolute bg-white z-20 select-none",children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:b,children:o(X,{...il,className:"-rotate-90 cursor-pointer"})}),o(qt,{onChange:v,value:{key:nl[u]},options:w,...sl}),o(qt,{onChange:N,value:{key:String(x)},options:C,...sl}),o("div",{className:"my-auto",onClick:y,children:o(X,{...il,className:"rotate-90 cursor-pointer"})})]}),o(ll,{today:l,currentMonth:u,currentYear:x,onDateSelect:d,min:i,max:s})]}):null]})]})})),cl=(e,t,l)=>c("div",{onClick:e,className:p("flex justify-between items-center h-14 px-m py-s border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",l?"border-gray":"border-error"),children:[o(S,{children:t&&$t(t)}),o(X,{...il,name:"CalendarIcon"})]}),dl=d((({className:e,label:t,error:l,...n})=>c("div",{className:p("shrink-0 w-full",e),children:[o(ol,{label:t&&n?.errors?`${t}*`:t,valid:Boolean(!l),...n}),Dt(l)]}))),ml=d((({className:e,label:t,value:l="",placeholder:n,error:a,onChange:r,onBlur:i,isTextarea:s,type:d,...m})=>c("div",{className:p("shrink-0 w-full",e),children:[o(Et,{type:d||"text","aria-label":t,label:t&&m?.errors?`${t}*`:t,valid:Boolean(!a),value:l,onChange:r,onBlur:i,isTextarea:s,placeholder:m?.errors&&!t?`${n}*`:n}),Dt(a)]}))),hl=e=>"_"===e,ul=e=>/\d/.test(e),pl=e=>hl(e)||ul(e),gl=[..."+7 (___) ___-__-__"],xl=gl.findIndex(hl),fl=gl.map(((e,t)=>pl(e)?gl.slice(0,t).filter(pl).length:-1));const bl=d((({children:e,onChange:t,...l})=>{const n=r((e=>t&&t(function(e){const t=e.replace(/\D/g,""),l=gl.map(((e,l)=>ul(e)?e:t.charAt(fl[l])||e)),n=fl.indexOf(t.length-1)+1;return(n?l.slice(0,Math.max(xl,n)):l).join("")}(e))),[t]);return o(Et,{onChange:n,onFocus:e=>n(e?.target?.value||""),...l,children:e})})),yl=d((({className:e,label:t,value:l,error:n,onChange:a,onBlur:r,...i})=>c("div",{className:p("shrink-0 w-full",e),children:[o(bl,{"aria-label":t,label:i?.errors?`${t}*`:t,valid:Boolean(!n),value:l,onChange:a,onBlur:r,placeholder:"+7 (___) ___-__-__"}),Dt(n)]}))),vl=d((({className:e="",label:t,error:l,...n})=>c("div",{className:e,children:[o(qt,{...n,valid:!l,label:n?.errors?`${t}*`:t}),Dt(l)]}))),Nl=e=>t=>t&&Object.entries(e).flatMap((([e,l])=>l(t[e])))||[],wl=e=>!e?.length,Cl=e=>t=>l=>e(l)?[]:[t],kl=(e,t)=>{const{value:l,isDirty:n}=e,a=n?t(l):[];return{...e,errors:a,error:a[0]}},Sl=e=>null!=e,Il=new Map,Tl=e=>Boolean(e?.every((e=>Array.isArray(e)?Tl(e):!e||"string"==typeof e))),Bl=e=>Tl(e)?e.toString():"";function Ml(e,t,{fallback:l,cache:r}={}){const s=i((()=>Pl(e)),[e]),[o,c]=n(void 0),[d,m]=n(void 0);a((()=>{if(!s.some(Sl))return;let e=!1;const l=(t,l)=>{e||(c(t),m(l))};return(async()=>{try{l(await((e,t=Il)=>l=>{const n=Bl(l),a=t.get(n);if(n&&Sl(a))return a;const r=e(...l);return n&&Sl(r)&&t.set(n,Promise.resolve(r)),r})(t,r)(s))}catch(e){l(void 0,e)}})(),()=>{e=!0}}),[t,r,s]);const h=l&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&l[s[0]];return{data:!o&&h?h:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Pl(e){return Array.isArray(e)?e:e instanceof Function?Pl(e()):[e]}const Rl=[];const Vl=async e=>await ft(e,{method:"GET"})||Rl;function zl(){const{data:e}=Ml("/api/v1/branchesByRegions",bt);return Array.isArray(e)?e:[]}const Al=e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)),Dl="Некорректно заполненное поле",jl=Cl((e=>null!=e&&""!==e))(Dl),$l=Cl((e=>e?.key&&""!==e?.key))(Dl),Ll=Cl((e=>"string"==typeof e&&e.length>1))(Dl),El=Cl((e=>"string"==typeof e&&(10===e.length||12===e.length)))(Dl),Ol=(Fl=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Cl((e=>"string"==typeof e&&Fl.test(e))))(Dl);var Fl;const _l=Cl((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Ul={typeForm:jl,surname:Ll,name:Ll,region:$l,addressBranch:$l,phone:Ol,birthday:jl,email:jl,fullName:Ll,inn:El,partnerComments:jl,collectionCount:jl,comment:jl,acquiringType:$l,serviceType:$l,consentDataProcessing:_l,annualRevenue:jl},Hl=(e,t,l=!1)=>l?kl(e,t):e,Wl=d((({field:e,input:t,isPremium:l=!1})=>{const n=e("region")?.value?.key,r=e("region")?.value?.text,i=l?zl()?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=Ml(e?`/api/v1/branches?regionCode=${e}`:null,Vl);return t||Rl}(n)?.filter((e=>e?.address));return a((()=>{""!==e("region")?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[e("region")?.value]),o(vl,{label:"Адрес",placeholder:"Выберите адрес",options:(i||[]).map((({address:e=""})=>({key:e,text:e}))),...Hl(e("addressBranch"),Ul.addressBranch,t?.required)})}));function Kl(){const{data:e}=Ml("/api/v1/regions",bt);return Array.isArray(e)?e:[]}const ql=d((({field:e,input:t})=>{const l=Kl();return o(vl,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:i((()=>l?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[l]),...Hl(e("region"),Ul.region,t?.required)})})),Xl=d((({className:e,viewBox:t,fill:l="none",width:n,height:a,paths:r,...i})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:l,width:n,height:a,children:r.map((({d:e,fill:t,...l},n)=>{const a={...i,...l};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},n)}))}))),Yl=[{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"}],Gl=d((({className:e,value:t,text:l,disabled:n,isRadio:a,onChange:i})=>{const s=r((e=>{n||(e.preventDefault(),i&&i(!t))}),[i,n,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Xl,{paths:Yl,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:"flex items-center relative cursor-pointer group/box",onClick:s,children:[o("div",{className:p("appearance-none w-5 h-5 border-solid cursor-pointer m-0",a?"rounded-full border-2":Zl(t),t?"border-primary-main":"border-gray",n?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Ql(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(n)}),t?d:null,l?o("div",{className:"ml-s",children:o(je,{size:"text-l",font:"font-light",children:l})}):null]})})})),Ql=e=>e?"radio":"checkbox",Zl=e=>p("rounded border",e?"bg-primary-main":""),Jl=d((({text:e,link:t})=>c(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:[o(je,{children:e}),t?o(be,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"text-primary-main",children:o(je,{children:t.text})}):null]})));function en({disabled:e,onClick:t}){return l=>{!e&&t&&t(l)}}const tn={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"},ln={primary:p("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:p("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},nn=d((({children:e,...t})=>{const l=e=>({...e,onClick:me(en(e))}),{className:n,version:a="primary",active:r,disabled:i,type:s="button",rounded:c=!0,role:d,onClick:m}=l(t);return o("button",{className:p("font-sans px-9 py-4","flex justify-center items-center gap-xs",r?"text-white bg-primary-active":"",i?"bg-main-gray text-main-disabled cursor-not-allowed":"",r||i?"":p(tn[a],ln[a]),c?"rounded-md":"",n),type:s,role:d,onClick:m,children:e})})),an=(e,t)=>o(nn,{className:p("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),rn=(e,t,l)=>c("div",{className:"flex col-span-2 gap-m flex-col lg:flex-row w-full justify-between items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3",children:[o(Gl,{...e}),o(Jl,{link:t})]}),Dt(kl(e,_l).error)]}):o(Jl,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),an(l)]}),sn=d((({title:e,children:t})=>c("fieldset",{className:"grid @xl:flex @xl:justify-between gap-m border-b border-b-main-divider @xl:border-none",children:[e?o("legend",{className:"w-full",children:o(k,{title:e,headingType:"h6",className:"@xl:text-center"})}):null,t]}))),on=[{text:"Задать вопрос по продуктам и услугам",key:"FEEDBACK"},{text:"Качество обслуживания",key:"FEEDBACK_QS"}],cn=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],dn=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],mn={surname:"",name:"",middleName:"",typeForm:{key:"FEEDBACK",text:"Задать вопрос по продуктам и услугам"},serviceDirection:{key:"Физическое лицо"},birthday:void 0,feedbackMethod:{key:"Телефонный звонок"},phone:"",email:"",comment:"",consentDataProcessing:!1},hn={typeForm:jl,region:jl,surname:jl,name:Ll,feedbackMethod:jl,phone:Ol,email:jl,comment:jl,consentDataProcessing:_l},un=d((({button:e,link:t,onSubmit:l})=>{const n=r((e=>{pn(e,l)}),[l]),[,{field:a,...i}]=At(mn,{onSubmit:n}),s="FEEDBACK_QS"===a("typeForm").value?.key,d=xn(a("typeForm").value?.key,a("serviceDirection").value?.key);return o("form",{className:"container space-y-m",onSubmit:i.onSubmit,children:o(sn,{children:c("div",{className:"w-full max-w-xl space-y-s m-auto",children:[o(vl,{label:"Тема",placeholder:"Выберите тему",options:on,...kl(a("typeForm"),jl)}),s?o(vl,{label:"Направление обслуживания",placeholder:"Выберите направление",options:dn,...kl(a("serviceDirection"),jl)}):null,o(ql,{field:a}),s?o(Wl,{field:a}):null,c("div",{className:"space-y-s",children:[o(ml,{label:"Фамилия",...kl(a("surname"),Ll)}),o(ml,{label:"Имя",...kl(a("name"),Ll)}),o(ml,{label:"Отчество (Обязательно, при наличии)",...a("middleName")}),o(dl,{label:"Дата рождения",...kl(a("birthday"),jl)})]}),d?c("div",{children:[o(ml,{label:"ИНН",...kl(a("inn"),El)}),o(ml,{label:"Наименование организации",...a("fullName")})]}):null,o(vl,{label:"Способ получения ответа",options:cn,...kl(a("feedbackMethod"),jl)}),o(yl,{label:"Телефон",...kl(a("phone"),Ol)}),s?c("div",{children:[o(yl,{label:"Дополнительный телефон",...a("secondaryPhone").value&&"+7 ("!==a("secondaryPhone").value?kl(a("secondaryPhone"),Ol):a("secondaryPhone")}),o(ml,{label:"Электронная почта",...kl(a("email"),jl)}),o(ml,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...a("bankEmpolee")}),o(ml,{label:"Дата и время обращения в Банк",...a("applicationDate")})]}):o(ml,{label:"Электронная почта",...kl(a("email"),jl)}),o(ml,{...kl(a("comment"),jl),placeholder:"Ваше сообщение",isTextarea:!0}),rn(a("consentDataProcessing"),t,e)]})})})})),pn=(e,t)=>{const l=xn(e?.typeForm.key,e?.serviceDirection?.key),n=Nl({...hn,...gn(e,l)});wl(n(e))&&t(e,!l)},gn=(e,t)=>t?{addressBranch:jl,inn:El}:"FEEDBACK"===e.typeForm.key?{birthday:jl}:{addressBranch:jl},xn=(e="",t="")=>"FEEDBACK_QS"===e&&"Юридическое лицо / ИП"===t,fn={ApplicationFormFeedback:un},bn=Mt(),yn=kt((({className:e,formBlock:t,...l})=>{const[a,i]=n(""),s=r((async(e,t=!1)=>{const l=Nn(e),n=await bn.send(l,t)?"OK":"Fail";return i(n),n}),[]);return o(x,{className:e,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?.title?o(k,{headingType:"h3",title:t.title,className:"@xl:text-center"}):null,t?vn(t,s):null,a?o(Vt,{responseType:a}):null]})})})),vn=(e,t)=>{const l=e?.formType;if(!l||!(l in fn))return null;return o(fn[l],{...e,onSubmit:t})},Nn=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[e,(t?.region?t?.text:t?.key)||t]))),wn=d((e=>{const{className:t,title:l,responseType:n,children:a,...r}=e;return o(x,{className:t,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[l?o(k,{headingType:"h3",title:l,className:"@xl:text-center"}):null,a,n?o(Vt,{responseType:n}):null]})})})),Cn=d((({className:e,text:t,value:l,key:n,disabled:a,error:r,onChange:i})=>c("div",{className:p("shrink-0 w-full",e),children:[o(Gl,{text:t,value:l,disabled:a,onChange:i},n),Dt(r)]}))),kn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Sn=d((({field:e,input:t})=>o(vl,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:kn,...Hl(e("acquiringType"),Ul.acquiringType,t?.required)}))),In=(e="")=>Boolean("trade"===e||"all"===e),Tn=(e,{normalize:t,format:l})=>{const{value:a,onFocus:i,onBlur:s,onChange:o}=e,[c,d]=n(!1),m=r((e=>{d(!0),i&&i(e)}),[]),h=r((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!l?a:l(a),onFocus:m,onBlur:h}},Bn=(e,t,l)=>Math.max(t,Math.min(e,l));function Mn(e){const t=(e||"").replace(/\D/g,""),l=parseInt(t,10);return Number.isNaN(l)?0:l}function Pn({list:e=[],min:t,max:l,step:n,value:a=e[0]||t,disabled:r,onChange:i}){const s=e.length?e.indexOf(a):a,d={backgroundSize:`${(100*(s>t?s-t:0)/(l-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:p("w-2 h-2 rounded-full",s<=t||r?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:l,step:n,value:s,disabled:r,onInput:t=>{const l=Mn(t.target?.value),n=e.length?e[l]:l;i&&i(n||0)}})})]})}const Rn=1,Vn=100,zn=d((e=>{const{className:t,title:l,items:n=[],list:a=[],min:i=(a.length?0:Rn),max:s=(a.length?a.length-1:Vn),step:d=1,value:m=a[0]||i,disabled:h=!1,onChange:u}=e,g=Tn(e,{normalize:(e=0)=>a.length?An(a)(e):Bn(e,i,s),format:tt()}),x=r((e=>{u&&u(Mn(e.target?.value))}),[u]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[l?o(je,{size:"text-m",font:"font-light",color:"text-primary-text",children:l}):null,o("input",{className:p("mt-xs font-sans text-h3 w-full h-14","border border-solid border-gray rounded-md outline-none","pl-m box-border","text-primary-text hover:border-primary-hover focus:border-primary-text","disabled:border-gray disabled:bg-main-divider"),disabled:h,onInput:x,...g}),Pn({list:a,min:i,max:s,step:d,disabled:h,value:m,onChange:u})]}),Dn(n)]})})),An=e=>t=>e.reduce(((e,l)=>Math.abs(l-t)<Math.abs(e-t)?l:e)),Dn=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(je,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),jn=["От 1 000 ₽","До 1 000 000 000 ₽"],$n=d((({field:e})=>o(zn,{title:"Сумма, ₽",items:jn,min:1e3,max:1e9,...e("amount")}))),Ln=d((({field:e,input:t})=>o(ml,{className:"col-span-2",...Hl(e("comment"),Ul.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),En=d((({value:e=!1,text:t,type:l="checkbox",onChange:n})=>c("div",{role:l,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>n&&n(!e),children:[o("div",{className:p("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:p("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(je,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),On=d((({field:e})=>In(e("acquiringType")?.value?.key)?o(En,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Fn=d((({field:e})=>In(e("acquiringType")?.value?.key)?o(En,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),_n=d((({field:e,input:t})=>{const l=zl(),n=i((()=>l?.map((({region:e})=>({key:e,text:e})))),[l]);return o(vl,{label:"Регион",placeholder:"Выберите регион",options:n,...Hl(e("region"),Ul.region,t?.required)})})),Un=["От 1 мес","До 15 лет"],Hn=d((({field:e})=>o(zn,{title:"Срок, месяцев",items:Un,min:1,max:180,...e("term")}))),Wn=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Kn=d((({field:e})=>o(vl,{label:"Тип обслуживания",options:Wn,...kl(e("serviceType"),jl)}))),qn=d((({name:e,text:t,value:l,checked:n,onChange:a,className:r})=>o("div",{className:r,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:"appearance-none flex justify-center items-center shrink-0 w-5 h-5 border border-gray hover:border-primary-hover\n checked:border-2 checked:!border-primary-main focus:checked:border-primary-main focus:border-primary-text active:border-primary-text\n after:block after:w-2.5 after:h-2.5 after:rounded-full checked:after:bg-primary-main outline-none rounded-full cursor-pointer",type:"radio",value:l,name:e,checked:n,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(je,{color:"text-primary-text",children:t}):null]})}))),Xn=["currencyControl","documentOperations","conversionTransactions","otherIssues"],Yn=d((({field:e})=>{const{value:t,onChange:l}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),c("div",{className:"py-m space-x-m grid @xl:flex @xl:items-center",children:[o(qn,{name:"vedTypes",text:"Валютный контроль",value:"currencyControl",checked:"currencyControl"===t,onChange:l}),o(qn,{name:"vedTypes",text:"Документарные операции",value:"documentOperations",checked:"documentOperations"===t,onChange:l}),o(qn,{name:"vedTypes",text:"Конверсионные операции",value:"conversionTransactions",checked:"conversionTransactions"===t,onChange:l}),o(qn,{name:"vedTypes",text:"Иные вопросы ВЭД",value:"otherIssues",checked:"otherIssues"===t,onChange:l})]})})),Gn=(e,t)=>(l,n)=>{const{required:a,...r}=l,i="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,s={surname:o(ml,{label:"Фамилия",...Hl(e("surname"),Ul.surname,a)}),name:o(ml,{label:"Имя",...Hl(e("name"),Ul.name,a),...r}),middleName:o(ml,{label:"Отчество (Обязательно, при наличии)",...e("middleName")}),phone:o(yl,{label:"Телефон",...Hl(e("phone"),Ul.phone,a)}),email:o(ml,{label:"Электронная почта",...Hl(e("email"),Ul.email,a)}),fullName:o(ml,{label:"ФИО",...Hl(e("fullName"),Ul.fullName,a),...r}),inn:o(ml,{label:"ИНН",type:"number",...Hl(e("inn"),Ul.inn,a)}),comment:o(Ln,{field:e,input:l}),region:i?o(_n,{field:e}):o(ql,{field:e,input:l}),addressBranch:o(Wl,{field:e,input:l,isPremium:i}),birthday:o(dl,{label:"Дата рождения",...Hl(e("birthday"),Ul.birthday,a)}),isClient:o(Cn,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}),consentToReceiveMaterials:o(Cn,{...e("consentToReceiveMaterials"),text:"Согласен на получение информационных и аналитических материалов по электронной почте"}),partnerComments:o(ml,{...Hl(e("partnerComments"),Ul.partnerComments,a),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...r}),collectionCount:o(ml,{label:"Количество объектов инкассации",type:"number",...Hl(e("collectionCount"),Ul.collectionCount,a)}),acquiringType:o(Sn,{field:e,input:l}),onlineCheckout:o(On,{field:e}),posTerminal:o(Fn,{field:e}),serviceType:o(Kn,{field:e}),term:o(Hn,{field:e}),amount:o($n,{field:e}),annualRevenue:o(ml,{label:"Годовая выручка, ₽",...Hl(e("annualRevenue"),Ul.annualRevenue,a)}),vedTypes:o(Yn,{field:e})};return function({input:e,field:t}){const{condition:l}=e,{value:n}=t(l?.name||"");return!l||l?.values?.find((e=>e===n))}({input:l,field:e})?o("div",{children:s[l?.name]},String(n)):null};const Qn=e=>{const{acquiringType:t,onlineCheckout:l,posTerminal:n,amount:a,term:r,annualRevenue:i,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||i?(e=>{const{acquiringType:t,onlineCheckout:l=!1,posTerminal:n=!1,term:a,amount:r,annualRevenue:i}=e;return t?`Вид эквайринга=${t?.text||""}${In(t?.key)?`/Онлайн касса=${l}/POS-терминал=${n}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${r}/Срок=${a}/Выручка=${i}`})(e):null,h={...d,...Jn(o),...Zn(c),...m?{partnerComments:m}:{}};return Object.fromEntries(Object.entries(h)?.map((([e,t])=>[e,t?.key||t])))},Zn=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Jn=e=>e?{vedTypes:Object.fromEntries(Xn.map((t=>[t,t===e])))}:{},ea={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",middleName:"",phone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e3,acquiringType:kn[0],serviceType:Wn[0],vedTypes:Xn[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},ta=(e,t="")=>{const l=Object.fromEntries(Al(e).map((e=>[e,ea[e]])));return l?.serviceType&&"PREMIUMSERVICE"===t&&(l.serviceType=Wn[1]),{...l,typeForm:{key:t,text:""}}},la=Mt(),na=d((({className:e,title:t,typeForm:l="",sections:a=[],button:i,link:s,endpoint:d,additionalParams:m,isContacts:h,...u})=>{const g=a?.flatMap((e=>e?.inputs))||[],x=ta(g,l),[f,b]=n(""),y=r((async e=>{const t=ia(g,e),l=Nl((e=>{const t=Al(e.filter((e=>"required"in e&&e.required)));return Object.fromEntries(t.map((e=>[e,Ul?.[e]])))})(t));if(!wl(l(e)))return"Fail";const n=Qn({...e,...m}),a=await la.send(n,"lead"===d)?"OK":"Fail";return b(a),a}),[]),[,{field:v,onSubmit:N}]=At(x,{onSubmit:y}),w=ra(g)?.name;return c(wn,{className:p("container space-y-m",e),title:t,responseType:f,...u,children:[c("form",{onSubmit:N,children:[a.map(((e,t)=>c("div",{className:p(aa(e.columns),"grid gap-x-m"),children:[e?.title?o("div",{className:"@xl:text-center @xl:col-span-2",children:e.title}):null,(e?.inputs||[])?.map(Gn(v,l))]},`section-${t}`))),rn(w?v("consentDataProcessing"):void 0,s,i)]}),h?c("div",{className:"space-y-m",children:[o(k,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"8 (800) 200-78-70",children:[o(ne,{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(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),aa=e=>2===e?"@xl:grid-cols-2":"",ra=e=>e?.find((e=>"consentDataProcessing"===e?.name)),ia=(e,t)=>e.filter((e=>e)).filter((e=>!e?.condition||e?.condition.values.find((l=>l===t?.[e?.condition?.name])))),sa=kt((({className:e,title:t,button:l,regionSource:a,...r})=>{const[i,s]=n({key:""}),d=a?.regions??[],m=ce({className:"text-white",version:l?.version||"primary"}),h=d?.find((e=>e.name===i.key))?.href,u=l?.text?l.text:"Перейти";return o(x,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(k,{headingType:"h3",title:t,className:"@xl:text-center"}):null,d?o(vl,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:d.map((({name:e=""})=>({key:e,text:e}))),value:i,onChange:s}):null,h?o("div",{className:"text-center",children:o(be,{href:h,target:"_blank",className:p("p-m w-full @xl:w-auto",m),children:u})}):null]})})})),oa=e=>t=>t.reduce(((t,l,n)=>t.length?t.concat({...e,key:`sep-${n}`},l):[l]),[]),ca=d((({value:e,onChange:t,items:l=[],multiple:n})=>l.map((l=>o(En,{text:l?.title,value:[e].flatMap((e=>e)).includes(l.value),onChange:()=>(l=>{if(!t)return;const a=e?.includes(l);t(n?a?(e||[]).filter((e=>e!==l)):[...e||[],l]:a?[]:[l])})(l.value),type:n?"checkbox":"radio"},l.value))))),da=d((({children:e,filtrationSchema:t,resetButton:l,field:n,reset:a})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,oa(o("div",{className:"h-full w-px bg-gray"}))(Object.entries(t).map(ma(n)).filter(Boolean))]}),l?o("div",{children:o(nn,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:l?.text})}):null]}))),ma=e=>([t,l])=>{const n=l?.type;return"array"===n?ha(t,e)(l):null},ha=(e,t)=>l=>"dropdown"!==l?.ui?ua(e,t)(l):null,ua=(e,t)=>l=>{const n=l?.items?.enum?.map(((e,t)=>({value:e,title:l?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[l?.title?o("div",{className:"mb-m",children:o(je,{size:"text-m",font:"font-medium",color:"text-primary-text",children:l.title})}):null,o(ca,{items:n,multiple:!l?.single,...t(e)})]},e)};function pa(e,...t){return e.map(((e,l)=>[e,...t.map((e=>e[l]))]))}const ga=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,xa=(e,t)=>Object.entries(e).map((([l,n])=>"number"==typeof n?Array.isArray(t[l])?((e,t)=>l=>ga(t[e])||ga(l[e])||l[e]?.includes(t[e]))(l,e):((e,t)=>l=>ga(t[e])||ga(l[e])||fa(t[e])<=fa(l[e]))(l,e):"object"==typeof n&&"min"in n&&"max"in n?((e,t)=>l=>ga(t[e])||ga(l[e])||fa(t[e]?.min)>=fa(l[e]?.min)&&fa(t[e]?.min)<=fa(l[e]?.max))(l,e):Array.isArray(n)?((e,t)=>l=>ga(t[e])||ga(l[e])||t[e]?.every((t=>l[e]?.includes(t))))(l,e):((e,t)=>l=>ga(t[e])||ga(l[e])||t[e]===l[e])(l,e))).every((e=>e(t))),fa=e=>Number(e||0),ba=(e,{block:t,page:l,normalize:n=zt})=>{const a=t?.blocks||[],[r,{field:s,reset:o,update:c}]=At(e),d=i((()=>pa(a,a.map((e=>wt(e.content,l?.fallback))))),[a,l?.fallback]),m=r===e?a:((e,t)=>(l=zt)=>e?.filter((([,e])=>xa(t,l(e)||{}))).map((([e])=>e)))(d,r)(n);return[r,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},ya="text-center",va=d((({title:e,description:t})=>c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(T,{title:e,description:t,headlineVersion:"S",isEmbedded:!0,align:ya})]}))),Na=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",wa=(e,t=0)=>{const{itemCount:l,visibleItemCount:a}=e,[i,s]=n(t),o=r((()=>s((e=>Math.min(e+1,l-1)))),[l]),c=r((()=>s((e=>Math.max(e-1,0)))),[l]),d=a?l>a&&i<l-a:i<l-1,m=i>0;return[i,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]},Ca=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function ka(e,{sensitivity:t,rootRef:l}={}){const n=s(null),r=i((()=>({threshold:Sa(t),root:l?.current})),[t,l?.current]);return a((()=>{if(!n.current)return;const t=new IntersectionObserver(e,r);return t.observe(n.current),()=>{t.disconnect()}}),[e,r]),n}function Sa(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,l)=>Math.min(l/t)),1).concat(1)}const Ia=d((({className:e,style:t,idx:l,activeIndex:n,observerOptions:a,children:i,onIntersection:s})=>{const c=ka(r((e=>{e.length&&s&&s(l||0,e[e.length-1])}),[s,l]),a);return o("div",{className:p("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(l===n),ref:c,role:"listitem",children:i})})),Ta=["min-w-full","@lg:min-w-[50%]","@lg:min-w-[33.3%]","@lg:min-w-[25%]"],Ba=d((({className:e,itemClassName:t,containerRef:l,activeIndex:n,visibleItemCount:a=0,gap:i=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:u,onVisibleItemsChange:g,onVisibleIndicesChange:x})=>{const f={sensitivity:1,rootRef:l},b=s([]),y=r(((e,t)=>{const l=[...b.current||[]];l[e]=t,b.current=l,g&&g(l),x&&x(Pa(l))}),[g,x]),v=a>0?i*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Ma(c,v):{},...N?Ca(h):{},gap:`${i}px`};return o("div",{className:p("box-border overflow-auto no-scrollbar",d,e),style:C,ref:l,role:"list",children:(k=(e,l)=>o(Ia,{className:p(m,a?Ta[a-1]:"",N?"h-full":"",t),style:w?Ma(c/4):{},activeIndex:n,idx:l,observerOptions:f,onIntersection:y,children:e},String(l)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(u)});var k})),Ma=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Pa=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Ra={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Va={"horizontal-list":"w-6","vertical-list":"h-6"},za=d((({className:e="",containerRef:t,activeIndex:l,dotCount:n=0,listType:a="horizontal-list",version:r})=>n?o("div",{className:p("flex gap-xs",Ra[a],r?"group":"",e),"data-ver":r,children:Array.from({length:n}).fill(null).map(((e,n)=>o("div",{className:`cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white group-data-transparent:bg-white ${n===l?Va[a]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(e=>{e!==l&&t?.current&&t.current.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(n)},String(n))))}):null)),Aa=e=>e,Da=(e=Aa)=>t=>t.reduceRight(((t,l)=>e(t)>e(l)?t:l)),ja=Da(),$a=(e=Aa)=>Da((t=>-e(t))),La=$a(),Ea=e=>t=>e.scrollWidth/t,Oa=e=>(t,l)=>{e.scrollBy({left:l*Ea(e)(t),behavior:"smooth"})},Fa=({itemCount:e,onVisibleIndicesChange:t})=>{const l=s(null),[a,i]=n([]),o=r((e=>{i((t=>{return(l=t)===(n=e)||Boolean(l&&n&&l?.length===n?.length&&l.every(((e,t)=>e===n[t])))?t:e;var l,n})),t&&t(e)}),[e]),[c,d]=a.length?[$a()(a),Da()(a)]:[-1,-1],m=c>0,h=d<e-1,u=r((()=>{var t;l.current&&(m?Oa(l.current)(e,-1):(t=l.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=r((()=>{l.current&&(h?Oa(l.current)(e,1):l.current.scrollTo({left:0,behavior:"smooth"}))}),[e,h]),g=r(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{l?.current&&l.current.children[e]?.scrollIntoView(t)}),[l]);return[l,{scrollLeft:u,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:h,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},_a=d((({className:e,disabled:t,...l})=>o(be,{rounded:!0,className:p("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e||""),disabled:t,...l,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),Ua=d((e=>o(_a,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Ha=d((e=>o(_a,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Wa="absolute top-[calc(50%-24px)] z-40",Ka="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",qa=d((({scroll:e,activeIndex:t,itemCount:l,arrowsPadded:n,hasEdgeBlocks:a,onScrollLeft:i,onScrollRight:s})=>{const{canScrollLeft:d,canScrollRight:m,scrollLeft:h,scrollRight:u}=e,g=a?t>0:d,x=a?t<l-1:m,f=r((()=>{a?(d&&t!==l-1&&h(),i()):h()}),[h,i,a,d,t,l]),b=r((()=>{a?(m&&0!==t&&u(),s()):u()}),[u,s,a,d,t,l]);return c("div",{className:"m:hidden block",children:[Xa(e),g?o(Ua,{className:p(Wa,n?"left-1 m:left-8":"left-0"),onClick:f}):null,x?o(Ha,{className:p(Wa,n?"right-1 m:right-8":"right-0"),onClick:b}):null]})})),Xa=e=>c("div",{children:[e.canScrollLeft?o("div",{className:p(Ka,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:p(Ka,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),Ya=({className:e,text:t="ХИТ"}={})=>c("div",{className:p("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(X,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(S,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Ga="relative h-full",Qa={small:"sm:min-w-64",normal:"sm:min-w-96",big:"sm:min-w-[515px]"},Za=({noCardBorder:e,activeIndex:t,cardSize:l="normal",...n})=>{const{blocks:a}=n.block||{},r=a?.some(tr);return z({...n,renderProps:(n,a,i)=>c("div",{className:Ja(n,{someCardsHighlighted:r}),children:[P(n,a,{className:er(n,{someCardsHighlighted:r,showBorder:!e,cardSize:l}),blockIndex:i,isActive:i===t}),tr(n)?Ya({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},Ja=(e,{someCardsHighlighted:t})=>p(Ga,t&&(tr(e)?"pt-3xl":"pt-3xl sm:pt-16")),er=(e,{someCardsHighlighted:t,showBorder:l,cardSize:n="normal"})=>p(Ga,"min-w-80",Qa[n],t&&(tr(e)?"pt-3xl sm:pt-16":"pt-3xl"),Na(l),l&&"h-full"),tr=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,lr=kt((({className:e,itemCount:t,visibleItemCount:l=1,noCardBorder:n,isAlignCenter:a,arrowsPadded:r=!0,isGap:i=!0,isEmbedded:s=!1,cardSize:d="normal",...m})=>{const{blocks:h=[]}=m.block||{},u=t||h?.length,[g,{inc:f,dec:b}]=wa({itemCount:u,visibleItemCount:l},Math.floor(l/2)),[y,v]=Fa({itemCount:u}),[N]=v.visibleIndicesRange,w=h&&"CarouselBankHistoryCard"===h[0]?.type;return c(x,{className:p(s?"@container-normal":"",e),defaultPadding:"p-6xl",...m,children:[c("div",{className:p(a?"flex justify-center":"","relative max-w-full"),children:[o(Ba,{containerRef:y,visibleItemCount:l,snapAlign:"snap-start",gap:i?16:void 0,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:Za({noCardBorder:n,activeIndex:g,cardSize:d,...m})}),o(qa,{scroll:v,arrowsPadded:r,onScrollLeft:b,onScrollRight:f,hasEdgeBlocks:w,activeIndex:g,itemCount:u})]}),o(za,{className:"@5xl:hidden",containerRef:y,activeIndex:N,dotCount:u,listType:"horizontal-list"})]})}),{childrenTypes:["CarouselCard","CarouselBankHistoryCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),nr={},ar={},rr=kt((({className:e,filtrationSchema:t=nr,resetButton:l,notFound:n,...a})=>{const[,{blocksToRender:r},{field:i,reset:s}]=ba(ar,{block:a.block,page:a.options?.page}),d=Object.entries(t).filter((([,e])=>"array"===e.type&&"dropdown"===e.ui)).map((([e,t])=>({className:"w-64",label:t.title,options:ir(t),...i(e,{parse:({key:e})=>[e],format:([e]=[])=>ir(t).find((t=>t.key===e))||{key:""}})}))).map(((e,t)=>o(qt,{...e},String(t))));return c(x,{className:p(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(da,{filtrationSchema:t,field:i,reset:s,children:c("div",{children:[d,o("div",{children:o(nn,{type:"reset",className:"mt-lg w-64",onClick:s,version:l?.version,children:l?.text})})]})}),o("div",{className:p(r?.length?"hidden":"block"),children:n?o(va,{...n}):null}),o(lr,{padding:"p-0",isEmbedded:!0,itemCount:r?.length,visibleItemCount:0,isAlignCenter:!0,isGap:!1,children:V(r,{...a.options,parent:a.block,renderProps:(e,t,l)=>o("div",{className:p("relative min-w-80",Na(!0)),children:P(e,t)},String(l))})})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>e?.filtrationSchema||{}}),ir=e=>pa(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),sr={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},or=d((({className:e,defaultIconSize:t=44,iconBgVersion:l="primary",size:n,icon:a,...r})=>{const i=String(n?.width||t);return a?o("div",{style:{width:`${i}px`,height:`${i}px`},className:p("rounded-icon object-fit flex justify-center items-center",sr[l],e),children:o(X,{...r,width:"54%",height:"54%",name:a})}):null})),cr=d((({className:e="",title:t,benefitList:l,...n})=>c(x,{className:e,defaultPadding:"p-6xl",...n,children:[t?o(k,{headingType:"h3",as:"h2",className:ya,title:t}):null,l?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:l.map(dr)}):null]}))),dr=({label:e,description:t,items:l,icon:n,iconBgVersion:a,isDotted:r=!1},i)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[n?.icon?o(or,{className:"shrink-0",defaultIconSize:44,iconBgVersion:a||"",...n}):null,n?.src?o(ne,{className:"shrink-0",image:n}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(k,{headingType:"h6",children:e}),o(je,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),o(et,{dotClassName:"bg-secondary-text",listItemSize:"S",items:l,isDotted:r})]}):null]},String(i)),mr=e=>({icon:t,title:l,description:n},a)=>c("div",{className:p("flex flex-col gap-1","items-center",n||l?"":"justify-center"),children:[l?o(je,{size:"text-h6",font:"font-normal",align:e,children:l}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,n?o(je,{size:"text-h6",font:"font-normal",align:e,children:n}):null]},String(a)),hr=(e,t,l)=>o("div",{className:`grid gap-2xs ${ur(t)}`,children:e.map(mr(l))}),ur=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},pr=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:l="",columnsCount:n="4",subtitle:a,title:r,...i})=>c(x,{className:p("space-y-3xl",l),defaultPadding:"p-6xl",...i,children:[o(T,{defaultPadding:"",title:r,description:a,headlineVersion:"M"}),e?.length?hr(e,n,t):null]}))),gr={start:"justify-start",center:"justify-center",end:"justify-end"},xr=d((({buttons:e,className:t="",align:l,...n})=>{const a=l?p("flex",gr[l]):"";return o(x,{className:p("!bg-transparent",a,t),defaultPadding:"p-0",...n,children:Xe(e)})}));function fr({dec:e,inc:t,canDec:l,canInc:n,btnClass:a,className:r=""}){return l||n?c("div",{children:[l?o(_a,{className:p("absolute z-40",a[0],r),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!l}):null,n?o(_a,{className:p("absolute z-40 rotate-180",a[1],r),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!n}):null]}):null}const br=d((({className:e,title:t,value:l,fractionDigits:n,fixed:a,prefix:r,postfix:i})=>c("div",{className:p("flex justify-between @xl:flex-col",e),children:[t?o(je,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}):null,o("div",l?{children:o(je,{size:"text-h3",children:[r,tt(n,{fixed:a})(l),i].filter(Boolean).join(" ")})}:{children:o(je,{size:"text-h3",children:"-"})})]}))),yr=Math.round(29.5),vr={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Nr={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},wr={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Cr={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0},kr={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Sr=(e,t)=>{const{travelExpenseValue:l,restExpenseValue:n}=e,[a,r]=((e,t,l)=>{const{maxBonus:n=5e3,prefMonthsNum:a=wr.prefMonthsNum,prefTravelBonusRate:r=wr.prefTravelBonusRate,prefRestBonusRate:i=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(r*t)+Math.round(i*l),n);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*l),n)*(12-a)]})(t||wr,l,n);return{...t,...e,monthBonus:a,yearBonus:r}},Ir=e=>e?o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e}):null,Tr=d((({rate:e=0,title:t="Ставка",unit:l,fractionDigits:n=2,depositeName:a,isShowDepositeName:r})=>c("div",{children:[o(je,{size:"text-l",font:"font-light",color:"text-secondary-text",children:t}),c("div",{className:"relative",children:[c("div",{className:"flex justify-start gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge pr-xl -mt-m tracking-[-15px]",children:tt(n,{fixed:!0})(e)}),l?o("span",{className:"text-7xl",children:l}):null]}),a&&r?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Br=d((({title:e="Ставка",isUnavailableByTerm:t=!1})=>c("div",{className:"space-y-s",children:[o(je,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(X,{className:"w-10 h-10 @5xl:h-auto @5xl:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:t?c(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:["Процентная ставка для срока ",o("strong",{children:"1-30 дней"})," устанавливается при обращении в Банк"]}):o(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Выберите другую сумму или срок"})})]}))),Mr=({title:e="Ставка",rate:t=0,unit:l="%",fractionDigits:n=2,isUnknownRateShown:a=!0,...r})=>a&&0===t?o(Br,{title:e,...r}):c("div",{children:[o("div",{className:"hidden @xl:block",children:o(Tr,{title:e,rate:t,unit:l,fractionDigits:n,...r})}),o("div",{className:"@xl:hidden",children:o(br,{title:e,value:t,postfix:l,fractionDigits:n,fixed:!0,...r})})]});function Pr({isShowItems:e=!0,step:t=1e3,...l}){const n=[`От ${tt(2)(l.min||0)} ₽`,`До ${tt(2)(l.max||0)} ₽`];return o(zn,{items:e?n:[],step:t,...l})}const Rr=d((({className:e="",calcSource:t,buttons:l,footnote:n})=>{const[a,{field:r}]=At({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:i,maxSumTravel:s,minSumOther:d,maxSumOther:m,monthBonus:h,yearBonus:u}=Sr(a,t);return c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-y-4xl",e),children:[c("div",{className:"flex flex-col @xl:max-w-md gap-2xl border-b border-b-main-divider @xl:border-none pb-3xl @xl:pb-0",children:[Pr({title:"Сумма покупок в категории путешествия, ₽",min:i,max:s,step:500,isShowItems:!1,...r("travelExpenseValue")}),Pr({title:"Сумма покупок в остальных категориях, ₽",min:d,max:m,step:500,isShowItems:!1,...r("restExpenseValue")})]}),h>=0?Mr({title:"Баллов за месяц",rate:h,fractionDigits:0,isUnknownRateShown:!1,unit:""}):null,c("div",{className:"flex flex-col gap-y-xl @xl:w-96",children:[u>=0?o(br,{title:"Баллов за год",value:u}):null,Xe(l,{isVertical:!0}),Ir(n)]})]})})),Vr=d((({className:e,inputChildren:t,rateChildren:l,resultChildren:n})=>c("section",{className:p("flex flex-col justify-between @5xl:flex-row gap-m",e),children:[o("div",{className:"flex flex-col gap-y-m sm:max-w-md gap-2xl",children:t}),o("div",{className:"border-b border-main-divider md:hidden"}),l,o("div",{className:"flex flex-col gap-2xl sm:w-96 max-w-full",children:n})]}))),zr=(e,t=0)=>e?.sum?e.sum:t,Ar=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Dr=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,jr={horizontal:"gap-5xl",vertical:"flex-col gap-s"},$r=d((({items:e,checkedItem:t,className:l,onChange:n,orientation:a="horizontal"})=>o("div",{className:p(`flex ${jr[a]}`,l),role:"radiogroup",children:e?.map((({id:e,text:l})=>o(Gl,{isRadio:!0,text:l,value:t===e,onChange:()=>n&&n(e)},String(e))))}))),Lr=({items:e,title:t,mobileTitle:l=t,orientation:n="horizontal",value:a,radioGroupClassName:r,onChange:i})=>c("div",{className:"space-y-s",children:[t?o("div",{className:"hidden @5xl:block",children:o(je,{color:"text-secondary-text",font:"font-light",children:t})}):null,l?o("div",{className:"@5xl:hidden",children:o(je,{color:"text-secondary-text",font:"font-light",children:l})}):null,o($r,{orientation:n,items:e,checkedItem:e[a?0:1].id,className:p("flex-col sm:flex-row",r),onChange:t=>i&&i(t===e[0].id)})]}),Er=e=>Lr({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Or=([e,t],l,n=[])=>l&&l[e]&&l[t]?{[e]:l[e],[t]:l[t]}:Fr([e,t],n),Fr=([e,t],l=[])=>({[e]:l.length?La(l.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:l.length?ja(l.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),_r=(e,[t,l],n)=>e>=n[t]&&e<=n[l],Ur={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Hr=(e,t)=>{const{daysValue:l,moneyValue:n,isPartialWithdrawal:a,isReplenished:r,isMonthlyInterestPayment:i}=e,s=r||a,o=l<90||l>730,c=function(e){const t=e?.rateType?Ur[e?.rateType]:"",{data:l}=Ml(t?`/api/v1/depositrates/${t}`:null,bt);return Array.isArray(l)?l:[]}(t);if(l<=30)return{...kr,...e,isDisabledOperatingDeposit:o,isUnavailableByTerm:!0};const d=c?.find((e=>i===e.isMonthlyInterestPayment&&Wr(s,e)&&_r(n,["minSum","maxSum"],e)&&_r(l,["minDays","maxDays"],e)))||kr,{rate:m}=d,h=Kr(m,e),u=n+h,p=c||[kr];return{...d,...Fr(["minSum","maxSum"],p),...Fr(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:h,finalSum:u}},Wr=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Kr=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,daysValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a/30)-n):Math.round(n*e*a/365/100)},qr=d((({className:e="",buttons:t,footnote:l,bottomFootnote:n,isShowDepositeName:a,defaultParams:r,rateParams:i})=>{const[s,{field:d}]=At({moneyValue:zr(r,1e5),daysValue:Ar(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),m=Hr(s,i),{income:h,finalSum:u,rate:p,isUnavailableByTerm:g,depositeName:x}=m;return o(Vr,{className:e,inputChildren:c("div",{children:[Pr({title:"Сумма, ₽",min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),(f={title:"Срок, дней",min:m.minDays,max:m.maxDays,...d("daysValue"),value:m.daysValue},o(zn,{items:[`От ${Dr(f.min||0)}`,`До ${Dr(f.max||0)}`],step:1,...f})),c("div",{className:"flex flex-col sm:flex-row gap-y-4 gap-x-14",children:[Xr(m,d),Er({title:"Выплата процентов",orientation:"vertical",...d("isMonthlyInterestPayment"),radioGroupClassName:"sm:flex-col"})]})]}),rateChildren:Mr({rate:p,depositeName:x,isShowDepositeName:a,isUnavailableByTerm:g}),resultChildren:c("div",{children:[Yr(u,h),Xe(t,{isVertical:!0}),Ir(l),Ir(n)]})});var f})),Xr=(e,t)=>c("div",{className:"space-y-s",children:[o(je,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-xl sm:gap-y-s",children:[o(Gl,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Gl,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Yr=(e,t)=>c("div",{className:"flex flex-col gap-2xl sm:gap-0 mb-lg",children:[o(br,{title:"Доход в конце срока",value:t,postfix:"₽",prefix:"+"}),o(br,{title:"Сумма в конце срока",value:e,postfix:"₽"})]}),Gr=e=>Qr({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Qr({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Qr({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Qr({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Qr=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],Zr=(e,t)=>{const{isAnnuity:l,moneyValue:n,monthsValue:a,moneyExtra:r}=t;if(0===e)return 0;if(l){const t=e/1200;return r?(n+r)*(t+t/(Math.pow(1+t,a)-1)):n*(t+t/(Math.pow(1+t,a)-1))}return Math.round(n/a)+n*(e/1200)},Jr=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,r=t?.rateRows||[vr],i=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>Gr({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:s,maxSum:o}=Or(["minSum","maxSum"],i,r),{minMonths:c,maxMonths:d}=Or(["minMonths","maxMonths"],i,r),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a})=>e?.find((e=>Gr({row:e,userInputParams:t,paramsViewSettings:l})&&_r(n,["minSum","maxSum"],e)&&_r(a,["minMonths","maxMonths"],e)))||vr)({rateRows:r,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a}),{rate:h}=m,u=Zr(h,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:n,monthsValue:a,monthlyPayment:u}},ei=({min:e=0,max:t=0,availableMonths:l,...n})=>o(zn,{items:[`От ${ti(e)}`,`До ${ti(t)}`],step:1,...l?.length?{list:l}:{min:e,max:t},...n}),ti=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,li=e=>Lr({...e,radioGroupClassName:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),ni=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:r,defaultParams:i})=>{const[s,{field:d}]=At({moneyValue:zr(i,2e5),monthsValue:Ar(i,yr),isAnnuity:Boolean(i?.isAnnuity),isInsurance:Boolean(i?.isEnableInsurance),isSalaryClient:Boolean(i?.isEnableSalaryClient),isPensionClient:Boolean(i?.isEnablePensionClient),isStateEmployee:Boolean(i?.isEnableStateEmployee)}),m=Jr(s,t,r),h=li({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")}),{onChange:u}=d("moneyValue"),{onChange:p}=d("monthsValue");return a((()=>{u&&u(Bn(s.moneyValue,m.minSum,m.maxSum))}),[m.minSum,m.maxSum]),a((()=>{p&&p(Bn(s.monthsValue,m.minMonths,m.maxMonths))}),[m.minMonths,m.maxMonths]),o(Vr,{className:e,inputChildren:c("div",{children:[Pr({title:"Сумма кредита, ₽",step:500,min:m.minSum,max:m.maxSum,...d("moneyValue"),value:m.moneyValue}),ei({title:"Срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),ai({...m,...r},d),o("div",{className:"sm:hidden",children:h})]}),rateChildren:Mr({rate:m.rate}),resultChildren:c("div",{children:[o(br,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:h}),Xe(l,{isVertical:!0}),Ir(n)]})})})),ai=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Gl,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Gl,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Gl,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Gl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),ri=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let l=1;for(;l<t.length;){const[e,n]=t[l-1],[a,r]=t[l];n>=a?t.splice(l-1,2,[e,Math.max(n,r)]):l++}return t},ii=(e,t,l)=>{const{moneyValue:n,monthsValue:a}=e,r=t?.rateRows?.[0]?ci(t.rateRows[0].minMonths,t.rateRows[0].maxMonths):0,i=!l?.isShowMonthlyInterestPayment,s=!l?.isShowRemoteRegistration,o=t?.rateRows?.find((t=>oi({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:i})&&oi({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s})&&_r(n,["minSum","maxSum"],t)&&_r(a||r,["minMonths","maxMonths"],t)))||Cr,{rate:c}=o,d=si(c,e),m=n+d,h=t?.rateRows||[Cr];return{...o,...Fr(["minSum","maxSum"],h),...Fr(["minMonths","maxMonths"],h),availableMonths:ri(h.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,l=1)=>Array.from({length:Math.abs(t-e)/l+1},((n,a)=>t>=e?e+a*l:e-a*l)))(e,t))),...e,defaultMonth:r,income:d,finalSum:m}},si=(e,t)=>{const{isMonthlyInterestPayment:l,moneyValue:n,monthsValue:a}=t;return l?Math.round(n*Math.pow((1200+e)/1200,a)-n):Math.round(n*e*30*a/365/100)},oi=({row:e,userInputParams:t,paramKey:l,isExclude:n})=>n||t[l]===e[l],ci=(e,t)=>e+Math.round((t-e)/2),di=d((e=>{const{className:t,calcSource:l,buttons:n,footnote:r,paramsViewSettings:i,defaultParams:s}=e,[d,{field:m}]=At({moneyValue:zr(s,2e4),monthsValue:Ar(s),isMonthlyInterestPayment:Boolean(s?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(s?.isRemoteRegistration)}),h=ii(d,l,i),{defaultMonth:u,rate:p,income:g,finalSum:x}=h,{onChange:f}=m("monthsValue"),{onChange:b}=m("moneyValue");return a((()=>{!d.monthsValue&&f&&f(u)}),[u]),a((()=>{b&&b(Bn(d.moneyValue,h.minSum,h.maxSum))}),[h.minSum,h.maxSum]),o(Vr,{className:t,inputChildren:c("div",{children:[Pr({title:"Сумма, ₽",min:h.minSum,max:h.maxSum,...m("moneyValue"),value:h.moneyValue}),ei({title:"Срок, месяцев",min:h.minMonths,max:h.maxMonths,availableMonths:h.availableMonths,...m("monthsValue"),value:h.monthsValue}),mi({...h,...i},m)]}),rateChildren:Mr({rate:p}),resultChildren:c("div",{children:[o(br,{title:"Доход в конце срока",value:g,postfix:"₽",prefix:"+"}),o(br,{title:"Сумма в конце срока",value:x,postfix:"₽"}),Xe(n,{isVertical:!0}),Ir(r)]})})})),mi=(e,t)=>{return c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowMonthlyInterestPayment?Er({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment}):null,e.isShowRemoteRegistration?(l={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration},Lr({...l,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]});var l},hi=e=>ui({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&ui({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),ui=({row:e,userInputParams:t,paramsViewSettings:l,fieldKey:n,viewSettingFieldKey:a})=>!!l&&!l[a]||t[n]===e[n],pi=(e,t,l)=>{const{moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i}=e,s=t?.rateRows||[Nr],o=(({limitRows:e,userInputParams:t,paramsViewSettings:l})=>e?.find((e=>hi({row:e,userInputParams:t,paramsViewSettings:l}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:l}),{minSum:c,maxSum:d}=Or(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:h}=Or(["minMonths","maxMonths"],o,s),u=(({rateRows:e=[],userInputParams:t,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i})=>e?.find((e=>hi({row:e,userInputParams:t,paramsViewSettings:l})&&_r(n+i,["minSum","maxSum"],e)&&_r(r,["minSumOld","maxSumOld"],e)&&_r(i,["minSumExtra","maxSumExtra"],e)&&_r(a,["minMonths","maxMonths"],e)))||Nr)({rateRows:s,userInputParams:e,paramsViewSettings:l,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i}),{rate:p}=u,g=Zr(p,e),x=e.oldMonthlyPayment-g;return{...u,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:h,moneyValue:n,monthsValue:a,oldMonthlyPayment:r,moneyExtra:i,monthlyPayment:g,benefit:x}},gi=d((({className:e,calcSource:t,buttons:l,footnote:n,paramsViewSettings:a})=>{const[r,{field:i}]=At({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),s=pi(r,t,a),d=li({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...i("isAnnuity")});return o(Vr,{className:e,inputChildren:c("div",{children:[Pr({title:"Остаток долга в других банках, ₽ ",step:500,min:s.minSum,max:s.maxSum-s.maxSumExtra,...i("moneyValue"),value:s.moneyValue}),Pr({title:"Ежемесячный платёж в других банках, ₽",step:500,min:s.minSumOld,max:s.maxSumOld,...i("oldMonthlyPayment"),value:s.oldMonthlyPayment}),ei({title:"Новый срок кредита, месяцев",min:s.minMonths,max:s.maxMonths,...i("monthsValue"),value:s.monthsValue}),xi({...s,...a},i),s.isExtraMoney?Pr({title:"Дополнительная сумма, ₽ ",step:500,min:s.minSumExtra,max:s.maxSumExtra,...i("moneyExtra"),value:s.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:d})]}),rateChildren:Mr({rate:s.rate,fractionDigits:1}),resultChildren:c("div",{children:[o(br,{title:"Ежемесячный платёж",value:s.monthlyPayment,postfix:"₽"}),s.benefit>0?o(br,{title:"Выгода в месяц",value:s.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:d}),Xe(l,{isVertical:!0}),Ir(n)]})})})),xi=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Gl,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Gl,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Gl,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),fi={CreditCalculatorForm:ni,DepositCalculatorForm:di,BusinessDepositCalculatorForm:qr,BonusCalculatorForm:Rr,RefinancingCalculatorForm:gi},bi=(e,t)=>{const l=e?.calcType;if(!l||!(l in fi))return null;const n=fi[l];return o("section",{className:"box-border relative bg-white flex shrink-0 self-start basis-full",role:"listitem",children:c("div",{className:"box-border p-4xl w-full space-y-xl",children:[e?.title?o(k,{className:"text-center",title:e.title}):null,o(n,{...e})]})},String(t))},yi=kt((({className:e="",tabAlign:t,calculatorTabs:l=[],...a})=>{const i=l.map((e=>e.nav||{})),s=l.map((({calculatorBlock:e})=>e||{})),[d,m]=n(0),h=r((e=>m(e)),[]),[u,g]=wa({itemCount:l?.length,visibleItemCount:3});return c(x,{className:p("box-border overflow-hidden relative",e),defaultPadding:"p-0",...a,children:[c("div",{className:"bg-white",children:[i.length>1?vi({activeIndex:u,tabsNav:i,tabAlign:t,slideIndexShift:d,onClick:h}):null,fr({...g,btnClass:["left-3","right-3"],className:"top-10"})]}),o("div",{className:"flex",style:{transform:`translateX(-${d}00%)`},role:"list",children:s?.length?s.map(bi):null})]})}));function vi({activeIndex:e,tabsNav:t,tabAlign:l,slideIndexShift:n,onClick:a}){return c("div",{children:[o("div",{style:{transform:`translateX(-${388*e}px)`},className:"flex flex-col justify-end items-center h-32 pt-4xl box-border duration-1000",children:o("div",{className:p("w-full flex flex-nowrap items-end gap-xs",l?gr[l]:""),children:t.map(((e,t)=>function({tab:e,i:t,isActive:l,onClick:n}){const a=l?"w-96 p-m border-none bg-primary-main text-white":"w-96 p-s ease-in duration-300 bg-white text-primary-text",r=l?"text-xl mb-xs":"text-l mb-2xs",i=l?"text-l font-light text-white":"text-m font-light text-secondary-text",s=l?"":"text-primary-main",d=e?.icon?.iconVersion,m=l?"white":"normal";return c("button",{type:"button",onClick:n,"aria-label":e?.title,className:p("box-border relative border border-gray cursor-pointer text-left border-b-0 flex space-x-m min-h-20",a),children:[o(ne,{className:p("h-6 w-6 min-w-6 min-h-6",s),image:{...e?.icon,iconVersion:d??m},width:"24",height:"24"}),c("div",{className:"border-0",children:[o("div",{className:r,children:e?.title}),o("div",{className:i,children:e.description})]})]},String(t))}({tab:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})}),o("div",{className:"w-full h-2 bg-primary-main"})]})}const Ni=d((e=>{const{onChange:t,min:l,max:n,defaultValue:a="0",fractionDigits:i=0,...s}=e,c=Tn(e,{normalize:(e=a)=>l&&n?String(Bn(Number(wi(e)),l,n)):wi(e),format:tt(i)}),d=r((e=>t&&t(wi(e))),[t]);return o(Et,{onChange:d,...s,...c})})),wi=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Ci=d((e=>o(Ni,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(je,{size:"text-xl",font:"font-light",children:"₽"})})}))),ki={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Si={amount:1500},Ii=d((({className:e="",title:t="Укажите сумму перевода",label:l="Сумма перевода",placeholder:r="1500",button:i,formType:s="private",...d})=>{const[{amount:m},{field:h}]=At(Si),[u,g]=n(!1);return a((()=>{g(m<=0)}),[m]),c(x,{className:p("flex flex-col items-center",e),defaultPadding:"p-6xl",...d,children:[t?o(k,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:ki[s],children:[o(Ci,{valid:!u,placeholder:r,label:l,max:3e5,min:1,...h("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:m}),i?.text?o(nn,{className:"w-full mt-lg",type:"submit",disabled:u,children:i.text}):null]})]})})),Ti=d((({className:e,title:t,description:l,blockIndex:n=0,isActive:a,...r})=>o(x,{className:p("relative flex h-[485px]",a?"w-[440px] z-10":"w-[340px]",e),defaultPadding:"p-0",...r,children:o("div",{className:p("basis-full self-center",Bi(n)),children:a?o(T,{headlineVersion:"M",title:t,description:l,padding:"p-3xl",align:"text-left",className:"h-96 text-white shadow-dark-blue"}):o("div",{className:"h-[300px] flex justify-center items-center font-mohave text-title-large",children:o("span",{className:Mi(n),children:t})})})}))),Bi=e=>["bg-primary-main","bg-green-light","bg-yellow-light"][e%3],Mi=e=>["gradient-color-text-on-green","gradient-color-text-on-yellow","gradient-color-text-on-yellow"][e%3],Pi="z-10 border border-solid w-full h-full",Ri=p(Pi,"absolute hidden @xl:block border-transparent"),Vi=d((({className:e,title:t,description:l,button:n,...a})=>o(x,{className:p("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:p(Ri,"top-9 right-12 bg-green-dark")}),o("div",{className:p(Ri,"top-6 right-8 bg-green")}),o("div",{className:p(Ri,"top-3 right-4 bg-green-light")}),c("div",{className:p(Pi,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(T,{title:t,description:l,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Xe([n],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),zi={black:"bg-black",white:"bg-white"},Ai=d((({className:e="",title:t,description:l,image:n,price:a,button:r,colors:i=[],align:s="text-left",padding:d,...m})=>o(x,{className:p("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Ce,{className:"h-full",padding:d,title:o(T,{title:t,description:l,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:n?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:n}):null,buttons:Xe([r],{buttonClassName:"w-full self-end"}),children:[i?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(je,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),i.map(Di)]}):null,a?c(je,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Di=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${zi[e]}`},String(t)),ji="24",$i="absolute w-full h-full border border-white",Li=d((({className:e="",icon:t,...l})=>{const n=he(),{text:a,href:r,target:i,onClick:s}=n(l);return a?o("div",{className:p("flex relative group/link pl-s pb-s sm:pr-2xs min-w-64 sm:min-w-72",e),children:c("div",{className:"relative min-h-16 w-full pb-lg sm:pb-0",children:[c("a",{className:p("absolute border\n bg-white flex items-center justify-between group-hover/link:text-primary-main","flex rounded-md lg:rounded-none w-full w-full p-lg whitespace-nowrap z-10"),role:"link",href:r,target:i,onClick:s,children:[c("div",{className:"flex items-center space-x-lg",children:[t?o(ne,{imageClassName:"text-green-dark",image:t,width:ji,height:ji}):null,o(je,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})]}),o(ne,{className:"group-hover/link:brightness-100 sm:ml-2xs",image:{icon:"ArrowRightIcon",iconVersion:"black"},imageClassName:"group-hover/link:text-primary-main",width:ji,height:ji})]}),o("div",{className:p($i,"-bottom-1 -left-1")}),o("div",{className:p($i,"-bottom-2 -left-2")})]})}):null})),Ei=d((({className:e,additionalDescription:t,description:l,links:n,title:a,...r})=>o(x,{defaultPadding:"p-5xl",className:p("overflow-hidden",e),...r,children:c("div",{className:"flex flex-col lg:flex-row sm:items-center gap-s justify-between",children:[c("div",{children:[o(T,{isEmbedded:!0,title:a,description:l,as:"h1",align:"text-left"}),o(T,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),n?.length?Oi(n,"sm:self-end sm:pt-s"):null]})}))),Oi=(e,t="")=>{const l=Math.ceil(e.length/5);return o(lr,{className:t,version:"secondary",itemCount:l,arrowsPadded:!1,padding:"p-0",visibleItemCount:0,isEmbedded:!0,children:Array.from({length:l}).fill(null).map(((t,l)=>o("div",{className:"flex flex-wrap gap-2xs sm:gap-0 sm:justify-center",children:e.slice(5*l,5*(l+1)).map(((e,t)=>o(Li,{...e},String(t))))},String(l))))})},Fi=d((({className:e="",href:t,target:l,isRemote:n=!1,onClick:a,children:r})=>{const i=he({isRemote:n})({href:t,target:l,onClick:a});return o(t?"a":"div",{className:p("block",e),...t?i:{},role:t?"link":"none",children:r})})),_i=[{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"}}],Ui=d((({className:e="",media:t,showButtonText:l,stretched:a,version:r="white",children:i})=>{const[s,d]=n(),m=t?.map((e=>{const{href:t,icon:n,text:a}=e,{iconMapped:i}=(e=>_i.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=qe(n)?n:i,c=l?{text:a}:{text:""};return!s&&a&&d(!0),{...e,...c,icon:{...o,iconVersion:"color"},version:e?.version??r}})),h=p("border border-solid hover:border-transparent group-data-primary:border-main-divider border-main-divider group-data-gray:border-green group/media",l&&s?"":"basis-auto",a?"flex-1 justify-center":"");return c("div",{className:p("flex flex-col gap-xs",e),children:[o("div",{className:"flex gap-xs",children:Xe(m,{className:p(a||s?"basis-full":""),buttonClassName:h})}),i?o(je,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i}):null]})})),Hi=d((({className:e,padding:t,description:l,additionalDescription:n,href:a,icon:r,items:i=[],isDotted:s,socialMedia:d=[],target:m,title:h,align:u="text-left",benefits:g,imageOptions:{directionRight:f=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!1}={},...v})=>o(x,{className:p("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...v,children:o(Fi,{href:a,target:m,className:"h-full",children:c(Ce,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(T,{title:h,description:l,headlineVersion:"XS",isEmbedded:!0,align:u}),...ot(qe(r)?o(ne,{image:r}):null,f),buttons:d.length?o(Ui,{media:d,showButtonText:!0,version:v?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Ke,{benefits:g}),o(et,{items:i,isDotted:s,listItemSize:"S"}),Wi(n,u)]})})}))),Wi=(e,t)=>e?o(S,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Ki=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:l=!1,renderFoldableSection:a,renderFoldButton:i})=>{const[s,o]=n(l),d=r((()=>{o((e=>!e))}),[]),m=a({isUnfolded:s,onToggle:d}),h=i?i({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[h,m]}:{className:e,role:"group",children:[m,h]})}));const qi=d((({className:e="",isUnfolded:t,children:l})=>{const n=s(null),r=function(e,t){const l=s(null);return a((()=>{const t=l?.current;if(!t)return;const n=new ResizeObserver((l=>{e(t,l[0])}));return n.observe(t),()=>{n.disconnect()}}),[e,...t]),l}((e=>{n.current&&(n.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:n,className:`transition-max-h duration-300 overflow-hidden ${n.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:r,children:l})})})),Xi=(e,t)=>{const{title:l,description:n,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[l?o("div",{className:"opacity-80",children:o(je,{size:"text-m",color:"text-secondary-text",children:l})}):null,n?o("div",{className:"mt-2xs",children:o(je,{size:"text-xl",color:"text-primary-text",children:n})}):null,a?.length?o("div",{className:"text-primary-main",children:Xe(a)}):null]},String(t))},Yi=d((({className:e="",title:t,align:l="text-center",icon:r,button:i,visibleCellsCount:s=1,cardCells:d=[],options:m,...u})=>{const g=d.map(Xi),[f,b]=s>0?[g.slice(0,s),g.slice(s)]:[g,[]],[y,v]=n(!1);return a((()=>h.subscribe("fold",(e=>{void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[]),c(x,{className:p("flex flex-col",e),defaultPadding:"p-2xl",...u,children:[qe(r)?o("div",{className:"self-center",children:o(ne,{image:r})}):null,t?o(k,{className:p("pt-xs",l),headingType:"h5",title:t}):null,i?.text?o(be,{className:"w-full mt-m mb-lg",...i}):null,b.length?o(Ki,{renderFoldableSection:()=>c("div",{children:[f,o(qi,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>1?Gi(y,m?.parent):null}):o("div",{children:f})]})})),Gi=(e,t)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==t&&h.fire("fold",{type:"fold",isUnfolded:!e,parent:t})},type:"button",children:[o("div",{children:e?"Скрыть":"Подробнее о тарифе"}),o(X,{className:"text-primary-text",name:e?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Qi="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",Zi="border-gray border-solid border",Ji="border-main-divider border-b",es="w-52",ts=d((({icon:e,image:t,title:l,link:n})=>c("div",{className:p("w-80 box-border flex flex-col gap-m items-center rounded-t-md border-b-0 p-2xl",Zi,Qi),role:"columnheader",children:[e&&!t?.src&&o(ne,{className:"h-16 w-16 min-w-16 min-h-16",image:e,width:"64",height:"64"}),t?.src&&o(ne,{image:t}),l?o(k,{headingType:"h4",as:"h3",className:"text-center text-white",title:l}):null,n?.text&&o("div",{className:"mt-auto w-full",children:o(be,{href:n.href,target:n.target||"",className:"w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active",children:o("div",{className:"py-s",children:o(S,{size:"text-xs",font:"font-medium",children:n.text})})})})]}))),ls={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},ns=d((({children:e,activeIndex:t,columnWidth:l,version:n="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:ls[n],style:{transform:`translateX(-${t*l}px)`},children:e})}))),as=d((({children:e})=>o("div",{className:"self-start flex flex-col",role:"row",children:o("div",{className:"flex gap-xl",children:e})}))),rs=d((({colHeaders:e,activeIndex:t})=>c(as,{children:[o("div",{className:es,role:"columnheader"}),o(ns,{activeIndex:t,columnWidth:336,children:e.map(((e,t)=>o(ts,{...e},String(t))))})]}))),is=d((({cell:e,isFirstRow:t,isLastRow:l,isFillGradient:n})=>{const a=p("w-80 box-border flex flex-col",Zi,l?"border-t-0 rounded-b-md":"border-y-0",n?Qi:""),r=p("mx-2xl h-full",Ji,n&&t?"border-t":"",l?"border-b-0":"border-solid");return o("div",{className:a,role:"cell",children:o("div",{className:r,children:e?e.map(((e,t)=>cs(e,t,n))):null})})})),ss=(e=!1)=>"text-xl m-0 "+(e?"text-white":""),os=(e=!1)=>"text-s opacity-80 "+(e?"text-white":"text-secondary-text"),cs=({label:e,description:t},l,n)=>c("div",{className:"first:pt-2xl pt-xl last:pb-2xl",children:[e?o("h4",{className:ss(n),children:e}):null,t?o("div",{className:os(n),children:t}):null]},String(l)),ds=(e=!1)=>p("py-2xl",Ji,es,e?"border-b-0":"border-solid"),ms=d((({row:{header:e,data:t},activeIndex:l,isColoredFirstColumn:n,isFirstRow:a,isLastRow:r})=>c(as,{children:[e?.title?o("div",{className:ds(r),children:o(S,{size:"text-s",children:e.title})}):null,t?.length?o(ns,{activeIndex:l,columnWidth:336,children:t.map(((e,t)=>o(is,{cell:e,isFirstRow:a,isLastRow:r,isFillGradient:n&&0===t},String(t))))}):null]}))),hs=d((({rowData:e,isColoredFirstColumn:t,activeIndex:l,controls:n})=>{const{isScrollAvailable:a}=n;return c("div",{className:"relative",children:[e.map(((e,n,{length:a})=>o(ms,{row:e,isFirstRow:0===n,isLastRow:n+1===a,activeIndex:l,isColoredFirstColumn:t},String(n)))),a?fr({...n,btnClass:["top-28","top-12"],className:"right-7",isDisabled:!0}):null]})})),us=d((({columns:e=[],rowHeaders:t,isShowAllRow:l,visibleRowLength:n,isColoredFirstColumn:a})=>{const r=e?.map((({header:e})=>e||{})),i=e?.map((({data:e})=>e))||[],s=t?.map(((e,t)=>({header:e,data:i.map((e=>e?.[t]||[{}]))}))).slice(0,l?t.length:n),[d,m]=wa({itemCount:e.length,visibleItemCount:3}),{isScrollAvailable:h}=m;return c("div",{children:[c("div",{role:"table",children:[r?.length?o(rs,{colHeaders:r,activeIndex:d}):null,s?.length?o(hs,{rowData:s,isColoredFirstColumn:a,activeIndex:d,controls:m}):null]}),h?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),ps=d((({className:e="",title:t,rowHeaders:l,columns:a,visibleRowLength:i=0,isColoredFirstColumn:s=!1,...d})=>{const[m,h]=n(!i),u=r((()=>h((e=>!e))),[]);return c(x,{className:p("overflow-hidden relative",e),defaultPadding:"p-6xl",...d,children:[o(k,{headingType:"h2",className:"text-center mb-4xl mx-auto",title:t}),o(us,{columns:a,rowHeaders:l,isShowAllRow:m,isColoredFirstColumn:s,visibleRowLength:i}),i?gs({isShowAllRow:m,onClick:u}):null]})})),gs=({isShowAllRow:e,onClick:t})=>o("div",{className:"pr-6xl",children:c("div",{className:"flex gap-m w-full",children:[o("div",{className:es}),o("button",{type:"button",onClick:t,className:"py-xs flex-1 border-gray border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main",children:o(je,{size:"text-xs",font:"font-medium",children:e?"Скрыть":"Показать все параметры"})})]})}),xs=d((({className:e,contacts:t,info:l,version:n="secondary",...a})=>c(x,{className:p("flex",e),defaultPadding:"p-6xl",version:n,...a,children:[l?.length?fs(l):null,t?.length?fs(t):null]}))),fs=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>bs({column:e,index:t})))}),bs=({column:e,index:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:l,button:n},a)=>c("div",{children:[o(T,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),l?o("div",{className:"mt-xs opacity-80",children:o(S,{size:"text-m",font:"font-light",children:l})}):null,n?.href?o(be,{className:"mt-xl",...n}):null]},String(a))))},`col-${String(t)}`):null,ys=e=>e%2!=0,vs=d((({textNode:e,iconNode:t,tag:l,onClick:n,justifyContent:a="between",className:r,role:i,...s})=>c(l,{tag:l,className:p("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",r),onClick:n,role:i,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Ns=d((({className:e="",label:t,icon:l,dataTheme:n="",disabled:a=!1,onClick:r})=>o(vs,{tag:"button",onClick:r,disabled:a,"data-theme":n,justifyContent:"center",role:"button",className:p("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(je,{size:"text-h4",children:t}),iconNode:l?o(ne,{image:{icon:l,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),ws=({isUnfolded:e,onToggle:t})=>o(Ns,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Cs=["ArrowDownIcon","ArrowUpIcon"],ks="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs border-box",Ss=d((({label:e="",blocksToRender:t=[],topItemsCount:l=0,block:n,notFound:a,...r})=>{const[i,s]=l>0?[t.slice(0,l),t.slice(l)]:[t,[]];return c("div",{children:[o("div",{className:p(t.length?"hidden":"block"),children:a?o(va,{...a}):null}),c("div",{className:p("space-y-2xs",t.length?"":"hidden"),children:[c("div",{className:p(ks),children:[V(i,{...r.options,parent:n}),ys(i.length)?o(It,{className:"col-span-6",...r}):null]}),o(Ki,{renderFoldableSection:({isUnfolded:e})=>c(qi,{className:p(ks),isUnfolded:e,children:[V(s,{...r.options,parent:n}),ys(s.length)?o(It,{className:"col-span-6",...r}):null]}),renderFoldButton:({isUnfolded:t,onToggle:n})=>o(Ns,{className:p(l<1?"hidden":""),disabled:!s?.length,label:e,icon:Cs[Number(t)],dataTheme:r.options?.page?.colorPalette,onClick:n})})]})]})})),Is=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Ts=(e,t)=>Array.from({length:t-e+1},((t,l)=>e+l)),Bs=1e9,Ms={sum:{min:1e4,max:Bs},period:3},Ps=kt((({className:e,filtrationSchema:t={},resetButton:l,sumInput:n,periodInput:a,...r})=>{const[,{blocksToRender:i,blocksWithProps:s},{field:d,reset:m}]=ba(Ms,{block:r.block,page:r.options?.page,normalize:e=>({...e,period:Rs(e)})}),h=s.map((([,e])=>e?.paramsSource?.rateRows)),u=Vs(h);return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...r,children:[o(da,{filtrationSchema:t,resetButton:l,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs",children:[o(Ci,{label:n?.title,min:500,max:Bs,...d("sum",{parse:e=>({min:Number(e),max:Bs}),format:({min:e})=>String(e)})}),o(zn,{title:a?.title,items:["От 3 мес","До 5 лет"],list:u,...d("period")})]})}),o(Ss,{blocksToRender:i,...r})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Rs=e=>yt((e?.paramsSource?.rateRows||[]).filter(Is).flatMap((e=>Ts(e.minMonths,e.maxMonths)))),Vs=e=>yt(e.flatMap((e=>e||[])).filter(Is).flatMap((e=>Ts(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],zs=[{key:"10"},{key:"50"},{key:"100"}],As=({itemCount:e,onItemCountChange:t})=>{const l=r((({key:e})=>t(Number(e))),[]);return c("div",{className:"flex items-center gap-s",children:[o("span",{children:"Показать по"}),o(qt,{className:"min-w-20",onChange:l,value:{key:String(e)},options:zs,iconVersion:"black"})]})},Ds="py-m px-lg rounded-md cursor-pointer hover:bg-primary-hover hover:text-white",js=(e,t)=>{const{currentPage:l,onPageChange:n,totalPages:a}=e,r=t+1;return r===l?o("div",{"aria-current":"true",className:"py-m px-lg bg-primary-main text-white rounded-md",children:r},String(t)):1!==r&&r!==a&&((e,t,l)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,l)=>t<=2&&e<=t+2||t>=l-1&&e>=l-3)(e,t,l))(r,l,a)?o("div",{onClick:()=>n(r),className:Ds,"aria-label":`Страница ${r}`,children:r},String(t)):null},$s={width:"24",height:"24"},Ls=({currentPage:e,onPageChange:t,totalPages:l})=>{const n=i((()=>Array.from({length:l}).fill({currentPage:e,onPageChange:t,totalPages:l})),[l,e]),a=r((()=>{e>1&&t(e-1)}),[e]),s=r((()=>{e<l&&t(e+1)}),[e,l]),d=r((()=>t(1)),[]),m=r((()=>t(l)),[l]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:a,children:o(X,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Es(1===e),...$s})}),c("div",{className:"flex gap-2xs",children:[e>1?o("div",{onClick:d,className:Ds,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m px-s",children:"..."}):null,n.map(js),e<l-2?o("div",{className:"py-m px-s",children:"..."}):null,e<l?o("div",{onClick:m,className:Ds,"aria-label":`Страница ${l}`,children:l}):null]}),o("div",{onClick:s,children:o(X,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Es(e===l),...$s})})]})},Es=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Os=({currentPage:e,onPageChange:t,totalPages:l,itemCount:n,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Ls,{currentPage:e,onPageChange:t,totalPages:l}),n&&a?o(As,{itemCount:n,onItemCountChange:a}):null]}),Fs=d((({className:e,value:t,autoFocus:l,onChange:n,onFocus:a,placeholder:i="Поиск по сайту"})=>{const s=r((e=>{n&&n(e.target?.value||"")}),[n]);return c("div",{className:p("font-sans relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:p("h-14 w-full px-10 text-l text-black outline-none box-border border border-solid rounded-md","border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text"),value:t,type:"text",name:"search-bar-input",placeholder:i,autoFocus:l,onChange:s,onFocus:a})]})})),_s=d((({field:e,onClearFilter:t,filtrationState:l})=>c("div",{className:"grid grid-cols-12 mb-3xl space-x-xl",children:[o(Fs,{className:"col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(ol,{className:"col-span-3",label:"Период от",maxDate:l.endDate,...e("startDate")}),o(ol,{className:"col-span-3",label:"Период до",minDate:l.startDate,...e("endDate")}),o("div",{className:"col-span-2 mt-auto",children:o(nn,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Us=({title:e,timestamp:t,publicId:l})=>{const n=he({basePath:"/"}),{href:a}=n({href:`/api/v1/depository/${l}/file`});return c("div",{className:"grid grid-cols-12 py-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-2",children:t?o(je,{size:"text-m","font-weight":"font-light",children:$t(t)}):null}),o("div",{className:"col-span-10 text-h6 hover:text-primary-active",children:o("a",{href:a,download:!0,"aria-label":"Скачать",children:e})})]},l)},Hs="/api/v1/depository",Ws={startDate:void 0,endDate:void 0,query:""},Ks=kt((({className:e,...t})=>{const[l,a]=n(0),[i,s]=n(10),[d,{field:m,reset:h}]=At(Ws),{totalPages:u=0,items:g=[]}=(({size:e,page:t,query:l,startDate:n,endDate:a})=>{const r=n?$t(n,!0):"",i=a?$t(a,!0):"",s=new URLSearchParams(Hs);s.set("page",String(t)),s.set("size",String(e)),s.set("query",l),s.set("timestampStart",r),s.set("timestampEnd",i);const o=`?${s.toString()}`,{data:c}=Ml(Hs+o,bt);return{items:c?.content,totalPages:c?.totalPages}})({size:i,page:l,...d}),f=r((e=>a(e-1)),[]),b=r((e=>{i!==e?(s(e),a(0)):s(e)}),[]);return c(x,{className:p(e,"container p-6xl"),...t,children:[o(_s,{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-2",children:o(je,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-10",children:o(je,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),g.length?g.map((e=>o(Us,{...e},String(e.publicId)))):o(va,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Os,{currentPage:l+1,onPageChange:f,totalPages:u,itemCount:i,onItemCountChange:b})]})]})})),qs=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,Xs=d((({className:e="",title:t,description:l,error:n,button:a,...r})=>c(x,{className:p("flex flex-col justify-center items-center",e),defaultPadding:p("p-6xl"),version:"transparent",...r,children:[o("div",{className:"flex justify-center",children:qs(n)}),o(T,{title:t,description:l,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(be,{version:a?.version,text:a?.text,...a}):null]}))),Ys="location";function Gs(e="Москва"){const[t,l]=((e,t,l)=>{const[i,s]=n(l||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[i,r((l=>e.fire(t,l)),[e,t])]})(h,"location",Zs()??{name:e}),i=r((e=>{Js(e),l(e)}),[]),{data:s}=Ml(Qs()?null:"/api/v1/region",bt);return a((()=>{s&&!Qs()&&l(s)}),[s]),[t??{name:e},i]}const Qs=()=>Boolean(globalThis.localStorage?.getItem(Ys)),Zs=()=>{try{const e=globalThis.localStorage?.getItem(Ys);return e&&JSON.parse(e)}catch(e){return null}},Js=e=>{try{globalThis.localStorage?.setItem(Ys,JSON.stringify(e))}catch(e){}};var eo;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(eo||(eo={}));const to=new Intl.NumberFormat("ru",{style:"currency",currency:eo.RUB}),lo=e=>e?to.format(e):"",no="text-left text-m font-light text-secondary-text",ao=`${no} pl-5xl`,ro={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},io=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:`h-fit w-fit ${e}`,children:[o("thead",{children:c("tr",{children:[o("th",{className:no,children:o(je,{size:"text-m",children:"Валюта"})}),o("th",{className:ao,children:o(je,{size:"text-m",children:"Купить"})}),o("th",{className:ao,children:o(je,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(so)})]}))),so=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:ro[t]},width:"24",height:"24"}):null,o(je,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl",children:o(je,{size:"text-h6",children:lo(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl",children:o(je,{size:"text-h6",children:lo(e?.buyExchangeRate)})})]},t)},oo={icon:"GpsIcon"},co=d((({className:e="",address:t})=>c("div",{className:`flex gap-s ${e}`,children:[o(or,{...oo,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(S,{size:"text-l",color:"text-primary-main",children:t}):null,o(S,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),mo=(e,t,l)=>{const n=Number(ho(e))*Math.pow(t,l?-1:1);return Number.isInteger(n)?n:((e,t=2)=>{const l=10**t;return Math.round(parseFloat(String(e))*l)/l})(n)},ho=e=>e.replace(/[^\d.,]/g,"").replace(",","."),uo=e=>t=>{const[,l]=e.find((([e])=>e(t)))||[];return l},po=e=>uo([[e=>e.value!==eo.RUB&&e.oppositeValue!==eo.RUB,()=>e.handleConvert(e.value,eo.RUB)],[e=>e.value===eo.RUB&&e.oppositeValue===eo.RUB,()=>e.handleConvert(e.value,eo.USD)],[e=>e.value===eo.RUB&&e.oppositeValue===eo.RUB,()=>e.handleConvert(e.value,eo.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function go(e){const{placeholder:t,rates:l,selected:n,value:a,setValue:r,setSelected:i}=e,s=l.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:n,text:n};return c("div",{className:"relative flex",children:[o(Et,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:r}),s.length?o(qt,{isBorder:!1,onChange:e=>i(e.key),options:s,value:d}):null]})}const xo=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:l,button:a})=>{const[i,s]=n({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||eo.RUB,selectBuy:l?.[0]?.currency?.currency||eo.USD}),d=r((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[go({placeholder:"Хочу продать",rates:l,selected:i.selectSell,setSelected:fo(i,d,l),value:i.inputSell,setValue:e=>yo(d,l)(e,i.selectSell,i.selectBuy)}),go({placeholder:"Получу",rates:t,selected:i.selectBuy,setSelected:bo(i,d,t),value:i.inputBuy,setValue:e=>vo(d,t)(e,i.selectBuy,i.selectSell)}),a?.text?o(be,{text:a.text,version:a?.version,...a}):null]})})),fo=(e,t,l)=>n=>{t({selectSell:n}),po({value:n,oppositeValue:e.selectBuy,handleConvert:(n=e.selectSell,a=e.selectBuy)=>{yo(t,l)(e.inputSell,n,a)}})},bo=(e,t,l)=>n=>{t({selectBuy:n}),po({value:n,oppositeValue:e.selectSell,handleConvert:(n=e.selectBuy,a=e.selectSell)=>vo(t,l)(e.inputBuy,n,a)})},yo=(e,t)=>(l,n,a)=>{e({inputSell:ho(l),selectBuy:a});const r=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===n))?.buyExchangeRate;r&&e({inputBuy:String(mo(l,r,n===eo.RUB)||"")})},vo=(e,t)=>(l,n,a)=>{e({inputBuy:ho(l),selectSell:a});const r=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===n))?.saleExchangeRate;r&&e({inputSell:String(mo(l,r,n===eo.RUB)||"")})};const No=d((({className:e="",title:t="Курсы обмена валют",button:l,...n})=>{const[a]=Gs(),r=function(e){const t=e?.code||"000",{data:l}=Ml(`/api/v1/exchangerates?regionCode=${t}`,bt);return l||{}}(a),i=wo(r?.exchangeRate?.currencies),s=i.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:eo.RUB}});const d=i.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:eo.RUB}}),o(x,{className:p("box-border min-h-80",e),...n,children:o(Ce,{className:"h-full",title:o(k,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap sm:flex-nowrap",children:[c("div",{className:"max-w-1/2",children:[i?o(io,{className:"mb-xl",exchangeCurrencyItems:i}):null,o(co,{address:r?.address})]}),i.length&&s.length&&d.length?o(xo,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:l}):null]})})})})),wo=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Co={width:"40",height:"45"},ko={"bg-white":"color",transparent:"white"},So={"bg-white":"text-primary-main",transparent:"text-white"},Io=(e,t,l)=>o(ne,t?.src?{image:t,className:So[e],width:l?.width,height:l?.height}:{image:{icon:t?.icon||"LogoIcon",iconVersion:ko[e]},className:So[e],width:l?.width,height:l?.height}),To={"bg-white":"text-primary-text",transparent:"text-white"},Bo=d((({className:e,href:t="/",logo:l,children:n,targetBlank:a,bgColor:r="bg-white",showTitle:i=!0})=>c("a",{className:p("inline-flex items-center font-sans no-underline",e),href:t,target:a?"_blank":"_self","aria-label":l?.title??"Россельхозбанк",children:[Io(r,l?.image,Co),i?n??o("div",{className:"ml-s",children:o(je,{font:"font-medium",color:To[r],size:"",children:l?.title??"Россельхозбанк"})}):null]}))),Mo=d((({className:e,onClose:t})=>o("button",{className:p("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(ne,{image:{icon:"CloseIcon"},width:"24",height:"24"})})));function Po(e,t,l=300){a((()=>{const t=globalThis.setTimeout(e,l);return()=>{globalThis.clearTimeout(t)}}),t)}const Ro=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:l,s1Matches:n,s2Matches:a}=function(e,t){const l=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),n=Array.from({length:e.length}),a=Array.from({length:t.length});let r=0;for(let i=0;i<e.length;i++){const s=Math.max(0,i-l),o=Math.min(i+l,t.length-1);for(let l=s;l<=o;l++)n[i]||a[l]||e[i]!==t[l]||(r++,n[i]=!0,a[l]=!0)}return{m:r,s1Matches:n,s2Matches:a}}(e,t);if(0===l)return 0;const r=function(e,t,{s1Matches:l,s2Matches:n}){let a=0;for(let r=0,i=0;r<e.length;r++){if(!l[r])continue;let s=i;for(;s<t.length;s++)if(n[s]){i=s+1;break}e[r]!==t[s]&&a++}return a}(e,t,{s1Matches:n,s2Matches:a}),i=(l/e.length+l/t.length+(l-r/2)/l)/3,s=i>.7?.1*function(e,t){let l=0;for(;e[l]===t[l]&&l<4;)l++;return l}(e,t):0;return i+s*(1-i)};const Vo=(e,t)=>(l,n)=>{for(const[a,r]of n)l.set(a,e(l.get(a)||t,r));return l},zo=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Ao=e=>t=>e.map((([e,l])=>[Ro(t)(e),l])).filter((([e])=>e>=.8)).map((([e,t])=>jo(t,e))).reduce(Vo(Math.max,0),new Map),Do=e=>t=>{return pa(t,t.map((({title:e})=>e)).map((e=>t=>{const l=zo(t||"");return l.length?Re(e.map((e=>ja(l.map(Ro(e)))))):0})(e))).sort((n=([,e])=>e,l=(e,t)=>n(e)-n(t),(e,t)=>-l(e,t))).map((([e])=>e));var l,n},jo=(e,t)=>new Map(e.map((e=>[e,t]))),$o=({basePathList:e,initialQuery:t=""})=>{const[l,r]=n(t||"");a((()=>{null!=t&&r(t)}),[t]);const{data:i}=Ml(e?.length?e:null,Lo),[s,o]=n(null);return Po((()=>{i&&o(i.map((e=>t=>{const{corpus:l,dictionary:n}=t||{};if(!(e&&l?.length&&n&&Object.keys(n).length))return[];const a=zo(e);if(!a.length)return[];const r=Object.entries(n),i=[...a.map(Ao(r)).reduce(Vo(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*a.length)).map((([e])=>l[e]));return Do(a)(i)})(l)))}),[i,l]),[s,{value:l,onChange:r}]},Lo=async(...e)=>(await Promise.allSettled(e.map((e=>ft(F(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Eo=d((({className:e,head:t,children:l,onClose:n,onClick:a})=>{const{close:i}=de(),s=r((()=>{i(),n&&n()}),[n]);return c("div",{onClick:a,className:p("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Mo,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:l})]})})),Oo=["all","footer"],Fo=d((({className:e,topItems:t})=>{const l=he({isRemote:!0});return o("div",{className:p("flex items-start justify-between",e),children:t?.filter(Ho).map(l).map(_o)})})),_o=(e,t)=>{const{text:l,items:n=[],href:a,target:r,onClick:i}=e,s=n.filter(Ho);return c("div",{className:"flex flex-col gap-s w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:a,target:r||"_self",onClick:i,children:l||`Раздел ${t}`}),s.map(((e,t)=>o(Uo,{...e,basePath:A(a),index:t},String(t))))]},String(t))},Uo=d((({text:e,index:t,basePath:l,...n})=>{const a=he({isRemote:!(!j.BASE_PATH||!l)&&!j.BASE_PATH.startsWith(l),basePath:l}),{href:r,target:i,onClick:s}=a(n);return o("a",{className:p("text-l font-light text-secondary-text hover:text-primary-main no-underline","overflow-x-hidden overflow-ellipsis whitespace-nowrap"),href:r,target:i||"_self",onClick:s,children:e||`Раздел ${t}`})})),Ho=e=>!e.displayArea||Oo.includes(e.displayArea.toLowerCase()),Wo=d((({initialQuery:e,topItems:t})=>{const l=i((()=>t?.map((e=>e.href||"/"))),[t]),[n,a]=$o({basePathList:l,initialQuery:e}),r=i((()=>Ko(t)(n)),[t,n]);return o(Eo,{head:o(Fs,{autoFocus:!0,...a}),children:o(Fo,{topItems:r})})})),Ko=e=>t=>e?.length&&t?.length?pa(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:F("/",t)})))}))):[],qo=(e={})=>{const{open:t,close:l}=de();return{open:(l={},n={})=>t(o(Wo,{...e,...l}),n),close:l}},Xo=d((({className:e,...t})=>{const[l,a]=n(""),i=r((()=>a("")),[]),s=qo(t),d=r((e=>{a(e),Yo(e)&&s.open({initialQuery:e},{onClose:i})}),[i,s]);return c("div",{className:p("relative",e),role:"search",children:[o(Fs,{value:l,onChange:d}),o(Mo,{className:"absolute top-0 right-0 sm:hidden",onClose:i})]})})),Yo=e=>e&&e.length>=3,Go=d((({className:e="",items:t})=>c("div",{className:e,children:[t?.length?t.map(Qo):null,o(be,{version:"primary",className:"w-full",href:"https://www.rshb.ru/natural/feedback/question",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"})]}))),Qo=(e,t)=>c("div",{className:"mb-m space-y-m",children:[o("div",{children:o(je,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Zo)})]},String(t)),Zo=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Jo(e.type,e.text)}),o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Jo=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${ec(t)}`,children:o(je,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(S,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},ec=e=>e.replaceAll(/\D/g,""),tc=["split_version","New","Old"],lc=d((({className:e="",index:t,text:l,...n})=>{const a=he(),{href:r,target:i,onClick:s}=a(n);return o("a",{className:p("text-secondary-text",e),href:r,target:i,onClick:s,children:l||`Документ ${t}`})})),nc=d((({className:e="",links:t})=>o("div",{className:e,children:t?.length?o("div",{className:"flex justify-between items-center gap-lg py-lg border-solid border-x-0 border-y border-y-main-divider",children:t.map(((e,t)=>o(lc,{index:t,className:"text-l font-light max-w-[292px]",...e},String(t))))}):null}))),ac=d((({className:e="",index:t,...l})=>{const n=he({isRemote:!0}),{href:a,target:r,text:i,onClick:s}=n(l);return o("a",{className:`text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e}`,href:a,target:r,onClick:s,children:i||`Документ ${t}`})})),rc=d((({className:e="",links:t})=>c("div",{className:p("@container",e),children:[o("div",{className:"pt-lg",children:o(je,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs pt-lg",children:t.map(((e,t)=>o(ac,{index:t,...e},String(t))))}):null]}))),ic="w-52",sc=kt((({className:e,footer:t,...l})=>{const n=l.options?.page?.sitemap??{},{logo:a}=n,{documents:i,relatedEnterprises:s,contacts:d,socialMedia:m,mobileApps:h}=t??{},u=r((()=>{const[e,t,l]=tc;((e,t)=>{const l=globalThis.document?.cookie.split(";")??[],[,n]=l.map((e=>e.split("="))).find((([t])=>t.trim()===e))||[];t(n)&&(globalThis.document.cookie=`${e}=${t(n)}`)})(e,(e=>e?.replace(t,l)))}),[]);return c(x,{tag:"footer",className:e,...l,children:[c("div",{className:"flex items-stretch gap-3xl pb-3xl ",children:[o(Bo,{className:ic,logo:a}),o(Xo,{className:"grow",...n})]}),c("div",{className:"flex items-stretch gap-6xl",children:[c("div",{className:p(ic,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Go,{items:d}),o(Ui,{media:m,children:"Соцсети"}),o(Ui,{media:h,showButtonText:!1,children:"Мобильное приложение"}),o(be,{version:"link",href:"https://old.rshb.ru",className:"!text-left text-s font-light",onClick:u,children:"Вернуться на прежнюю версию сайта"})]}),o(Fo,{className:"flex-grow",...n})]}),o(nc,{className:"mt-xl",links:s}),o(rc,{links:i})]})})),oc=d((({className:e="",title:t,description:l,calendar:n,...a})=>c(x,{className:p("space-y-m",e),defaultPadding:"p-6xl",...a,children:[o(T,{title:t,description:l,headlineVersion:"M",isEmbedded:!0}),n?cc(n):null]}))),cc=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),l=e.filter((e=>e?.month?.length)).map((e=>({...e,flexBasis:`${e?.month?.length?e.month.length*t:""}%`})));return c("div",{className:"w-full flex flex-col justify-center gap-s",children:[o("div",{className:"flex w-full text-h6 text-center",children:l.map((e=>dc(e,t)))}),o("div",{className:"flex gap-s w-full",children:l.map(((e,t)=>c("div",{className:"border-r border-main-divider last:border-r-0 space-y-s",style:{flexBasis:e.flexBasis},children:[o("div",{className:"flex gap-s",children:mc(e)}),c("div",{className:"text-s",children:[o(je,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(je,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},dc=(e,t)=>e.month?.map(((e,l)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${l}`))),mc=e=>e.month?.map((e=>e.image?.src?o("div",{className:"h-52 border-r pr-s border-main-divider last:border-r-0",children:o(ne,{image:e.image,className:"flex"})},`monthImage-${e.image.src}`):null)),hc=e=>({href:t})=>!!t&&O(uc(t,e)).startsWith(O(t)),uc=(e,t)=>$(e)?t.href:t.pathname;function pc(e=[]){const t=u(),l=e.findIndex((e=>hc(j.BASE_PATH?{pathname:j.BASE_PATH}:e))(t));return[l,e[l]]}const gc=d((({className:e="",active:t,flat:l,children:n,...a})=>{const r=he({isRemote:!0}),{href:i,target:s,text:c,onClick:d}=r(a);return o("a",{className:p(xc(t,l),e),href:i,target:s,onClick:d,rel:"noopener noreferrer","aria-label":c,children:o("span",{className:fc(t,l),children:c||n})})})),xc=(e=!1,t=!1)=>p("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",t?"":"px-m py-xs"),fc=(e=!1,t=!1)=>p("font-sans text-s font-light",e?"text-primary-main":p(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),bc=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(je,{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(yc,{...e},String(t))))})]}):null,yc=d((({icon:e,...t})=>{const l=he(),{text:n,target:a,href:r,onClick:i}=l(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{pathPrefix:"/wcms-resources/",image:e}):null,n?o("a",{className:"hover:text-primary-hover",href:r,target:a,onClick:i,children:o(je,{size:"text-l",font:"font-light",color:"text-primary-text",children:n})}):null]})})),vc=e=>t=>t.name?o(Fi,{isRemote:!0,href:`/branches/${t.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>{e&&e(t)},children:o(je,{size:"text-l",font:"font-light",children:t.name})},String(t.id)):null,Nc=d((({className:e,searchTerm:t,onSearch:l})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:"h-12 pl-m w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text",value:t,onChange:e=>l(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),wc=d((({foreignOffices:e,defaultLocation:t})=>{const[l,a]=Gs(t),i=he({isRemote:!0}),{href:s}=i({href:`/branches/${l.slug}`}),[d,m]=n(""),h=kc(Kl()).sort(((e,t)=>e.name.localeCompare(t.name))),u=((e,t)=>{const l=new Map;for(const n of e){const e=t(n),a=l.get(e)||[];l.set(e,[...a,n])}return l})(h,Cc),{close:p}=de(),g=r((e=>{a(e),p()}),[]);return c(Eo,{className:"pb-20",head:c("div",{children:[o(je,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),l?o("div",{className:"mb-s",children:c(S,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Fi,{isRemote:!0,href:s,className:"inline mx-2xs text-primary-main",children:l.name})]})}):null,o(Nc,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:h.filter((({name:e})=>e&&Ro(e.toLowerCase())(d.toLowerCase())>=.8)).map(vc(g))}):o("div",{className:"columns-1 sm:columns-5",children:Array.from(u.entries()).map((x=g,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(je,{size:"text-h6",children:e})}),t.map(vc(x))]},e)))}),bc(e)]});var x})),Cc=e=>e.name?.charAt(0)||"",kc=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Sc={default:"w-6 h-6",large:"w-12 h-12"},Ic=d((({className:e,isRounded:t,buttonSize:l="default",isGrayBg:n=!1,disabled:a,ariaLabel:r,image:i,onClick:s})=>o("button",{className:p("group/btn border-0 flex shrink-0 items-center",n?"p-s rounded-full":"p-0 bg-inherit",n&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${Sc[l]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:a,"aria-label":r,onClick:s,children:o(ne,{image:i,className:p("h-full",t?"bg-main-divider/20 rounded-full":""),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),Tc=d((({className:e,version:t,...l})=>{const n="transparent"===t?"white":"black",[a]=Gs(l.defaultLocation),r=qo(l),i=(e=>{const{open:t,close:l}=de();return{open:(l={})=>t(o(wc,{...e}),l),close:l}})(l);return c("div",{className:p("flex items-center gap-lg",e),role:"navigation",children:[o(gc,{flat:!0,href:"#",text:a?.name,onClick:()=>i.open()}),l.officesLink?o(gc,{flat:!0,href:l.officesLink,text:"Офисы и банкоматы"}):null,o(Ic,{image:{icon:"LoupeIcon",iconVersion:n},ariaLabel:"Поиск",onClick:()=>r.open()})]})})),Bc=d((({className:e="",items:t,activeItem:l})=>{const a=he(),[i,s]=n(!1),d=r((()=>s((e=>!e))),[]),m=Ut(r((()=>s(!1)),[]));return c("div",{className:p(i?"bg-white rounded-md shadow-blue-gray":"",e),ref:m,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":""+(i?"Скрыть другие разделы":"Показать другие разделы"),onClick:d,children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{className:p("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56",i?"":"hidden"),"aria-hidden":!i,children:t?.map(((e,t)=>{const{text:n,...r}=e,{href:i,target:s,onClick:c}=a(r);return o("a",{className:p("text-l font-light pb-m hover:text-primary-main",e===l?"text-primary-main":""),href:i,target:s,onClick:c,role:"menuitem",children:n},i||String(t))}))})]})})),Mc=e=>globalThis[e],Pc=(e,t)=>{const l=document.getElementById(t);if(l){const t=Mc(e);return t?Promise.resolve(t):new Promise((t=>{l.addEventListener("load",(()=>{t(Mc(e))}))}))}return new Promise(((l,n)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{l(Mc(e))})),a.addEventListener("error",(e=>{n(e)})),document.head.appendChild(a)}))};const Rc="chatbot",Vc="text-page__btn-chat",zc={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Ac=e=>{a((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=zc[e??""];return l=>{if(t)if("personal"!==e)Pc(Rc,t);else{const e=l.target;e?.classList.contains(Vc)||e?.classList.add(Vc);document.getElementById("webchat-js-container:webchat_rshb")||Pc(Rc,t)}}},Dc=d((({chat:e="personal",iconVersion:t,className:l})=>{const n=Ac(e);return o(Ic,{className:l,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:"Чат",onClick:n,buttonSize:"large",isGrayBg:!0})})),jc=d((({className:e="",active:t,dataItemName:l,children:n,...a})=>{const r=he(),{href:i,target:s,text:d,onClick:m}=r(a);return c("a",{className:p("relative inline-block bg-transparent text-center no-underline",e),href:i,target:s,"data-item-name":l,onClick:m,children:[o("span",{className:$c(t),children:d||n}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-transparent"}):null]})})),$c=(e=!1)=>p("font-sans text-l font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Lc=d((({observerOptions:e,onVisibilityChange:t,children:l,className:n,...a})=>{const i=ka(r((e=>{if(!e.length||!t)return;const l=e[e.length-1];t(l.isIntersecting)}),[t]),e);return o("span",{ref:i,className:n,role:"menuitem",children:o(jc,{...a,children:l})})})),Ec={default:"px-lg bg-main-divider rounded hover:text-primary-main",transparent:"text-white hover:text-primary-hover"},Oc=d((({version:e,internetBankUrl:t})=>t?o(be,{href:t,ariaLabel:"Интернет-банк",target:"_blank",className:p("py-s ml-s text-l font-light whitespace-nowrap hover:text-primary-main",Ec["transparent"===e?"transparent":"default"]),children:"Интернет-банк"}):null)),Fc=["all","header"],_c=e=>!e.displayArea||Fc.includes(e.displayArea.toLowerCase()),Uc=d((({subItems:e=[],version:t,internetBankUrl:l})=>{const a="transparent"===t?"white":"black",r=u(),d=i((()=>e.filter(_c)),[e]),m=(e=>(t=[])=>{const l=t?.filter(hc(e));return l?.length?Da((e=>e.href?.length||0))(l):void 0})(r)(e),[h,p]=n(d.length),g=d.slice(h),x=s(null),f={rootRef:x},b=i((()=>d.map(((e,t)=>e=>{p(e?Hc(t):Wc(t))}))),[d]);return c("nav",{className:"relative mt-s flex items-center justify-between",children:[o("div",{ref:x,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-3xl",role:"menu",children:d.map(((e,t)=>o(Lc,{className:h-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:b[t],...e},String(t))))}),g.length?o(Bc,{className:"relative w-auto z-40",items:g,activeItem:m}):null,c("div",{className:"flex",children:[j.CHAT_BOT?o(Dc,{className:"ml-4xl",iconVersion:a,chat:j.CHAT_BOT}):null,o(Oc,{version:t,internetBankUrl:l})]})]})})),Hc=e=>t=>Math.max(t,e+1),Wc=e=>t=>Math.min(t,e),Kc={"bg-white":"primary",transparent:"transparent"},qc=kt((({className:e,bgColor:t="bg-white",logo:l,version:n=Kc[t],portal:a,...r})=>{const i=r.options?.page?.sitemap??{},{topItems:s,logo:d}=i,[,m]=pc(s),{internetBankUrl:h}=a||{};return o(x,{tag:"header",className:p("pt-3xl px-20",m?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:n,...r,children:c("div",{className:"container",children:[c("div",{className:"flex items-center",children:[o(Bo,{className:"mr-3xl",bgColor:t,logo:l??d}),s?.filter(_c).map(((e,t)=>o(gc,{active:e===m,...e},String(t)))),o(Tc,{version:n,className:"ml-auto",...i})]}),o("div",{className:p("mt-xl h-px bg-main-divider","transparent"===n?"opacity-30":"")}),m?.items?.length?o(Uc,{subItems:m.items,version:n,internetBankUrl:h}):null]})})})),Xc={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Yc=kt((({className:e="",padding:t="p-0",gap:l="XS",version:n="transparent",isTheme:a=!1,isCardBorder:r,...i})=>o(x,{className:p("relative","grid grid-cols-12",Xc[l],e),padding:t,version:n,isTheme:a,...i,children:z({...i,extraProps:{className:Na(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),Gc=d((e=>{const{className:t,align:l,image:n,...a}=e,r=l?p("flex",gr[l]):"";return o(x,{className:p(r,t),defaultPadding:"p-0",...a,children:o(ne,{image:n})})})),Qc=d((({className:e="",cards:t=[],button:l})=>{const[a,i]=n(0),s=r((e=>i(e)),[]),d=t.length,[m,h]=wa({itemCount:d,visibleItemCount:2}),{canDec:u,canInc:p}=h,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden",children:[d?Zc({activeIndex:m,cards:t,selectedCardIndex:a,onClick:s}):null,fr({...h,btnClass:["left-12","right-12"],className:"top-16"}),u?o("div",{className:"absolute top-0 left-0 h-full w-32 bg-opacity-from-white"}):null,p?o("div",{className:"absolute top-0 right-0 h-full w-32 bg-opacity-to-white"}):null]}),o(be,{className:"w-60 text-center",version:"primary",...l,href:g})]})}));function Zc({activeIndex:e,cards:t,selectedCardIndex:l,onClick:n}){const a=460*e,r=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${a}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${r}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:l,onClick:n}){return c("button",{type:"button",onClick:n,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(l?"shadow-dark-blue border-primary-main":"ease-in duration-300 border-gray"),children:[e?.icon?o(ne,{className:"p-lg rounded-full bg-secondary-light",image:e.icon,width:"108",height:"108"}):null,c("div",{className:"flex gap-s",children:[e?.sum?Jc("страховая сумма",e.sum):null,e?.fee?Jc("страховой взнос",e.fee):null]}),ed(l)]},String(t))}({slide:e,i:t,isActive:Boolean(t===l),onClick:()=>n(t)})))})})}function Jc(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(je,{size:"text-h6",children:[tt(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(je,{size:"text-l",color:"text-secondary-text",children:e})})]})}function ed(e){return e?o(ne,{className:"h-6 w-6 min-w-6 min-h-6 absolute right-4 top-4",image:{icon:"DoneIcon"},width:"24",height:"24"}):null}const td=d((({className:e="",title:t,insuranceTabs:l=[],button:a,...i})=>{const[s,d]=n(0),m=r((e=>d(e)),[]);return c(x,{className:p("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...i,children:[t?o(k,{className:"text-center",title:t,headingType:"h3"}):null,l?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:l.map(((e,t)=>function({title:e,i:t,isActive:l,onClick:n}){return o("button",{type:"button",onClick:n,"aria-label":e,className:"box-border px-m py-s text-m font-light "+(l?"bg-primary-main text-white rounded-md":"text-secondary-text"),children:e},String(t))}({title:e?.title,i:t,isActive:Boolean(t===s),onClick:()=>m(t)})))}):null,o("div",{className:"flex",style:{transform:`translateX(-${s}00%)`},role:"list",children:ld({insuranceTabs:l,button:a})})]})})),ld=({insuranceTabs:e,button:t})=>{const l=e?.map((e=>e.cards));return l?.length?l.map(((e,l)=>o(Qc,{button:t,cards:e},String(l)))):null};const nd={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},ad={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},rd=d((e=>{const{className:t="",items:l,isDotted:n,investmentZeroColumn:a,investmentColumns:r,...i}=e,s=r?[...r]:[];return a&&s.unshift(a),o(x,{className:t,defaultPadding:"p-4xl",...i,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[oa(o("div",{className:"w-px h-4 bg-gray"}))(s.map(id)),o("div",{className:"absolute right-3xl w-px h-4 bg-gray"})]}),o("div",{className:"border-t border-gray -mt-xs mx-3xl"}),o("div",{className:"flex justify-between text-primary-text mt-s -mx-5xl",children:s.map(cd)})]}):null,l?.length?o(et,{className:"max-w-[657px]",items:l,isDotted:n,listItemSize:"M"}):null]})})})),id=(e,t,l)=>{const n=1===t,a=t===l.length-1;return o("div",{className:`${sd(n,a,e.cells)}`,children:e.cells?.length?o("div",{className:"w-full "+(a?"border-4 border-green-more-dark p-2xs min-w-72":""),children:e.cells.reverse().map(od)}):null},`column_${t}`)},sd=(e,t,l=[])=>[l.length?"flex-1":"flex-0",!l.length||e||t?"":"pl-s",l.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),od=(e,t)=>{const l=e.cellSize||"XS",n=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${ad[l]} ${nd[n]} ${"XS"===l?"px-s":"px-5xl"}`,children:o(je,{align:"text-center",children:e.text})},`cell_${t}`):null},cd=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-[180px] text-center px-xs last:pr-3xl",children:e.title},`title_${t}`):null,dd=["байт","Кб","Мб","Гб","Тб","Пб"],md=d((({icon:e,text:t,href:l,target:n,fileFormat:a,fileSize:r})=>{const i=r&&a?",":"",s=r??"",d=a?String(a):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:l,target:n,children:[e,t?c(je,{size:"text-l",font:"font-light",children:[t," ",hd(s,d),o(je,{color:"text-secondary-text",children:l&&`${s+i+d}`})]}):null]})})),hd=(e,t)=>e||t?o("span",{children:", "}):"",ud={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},pd=d((({className:e="",title:t,description:l,align:n="text-center",documents:a,icon:r={icon:"DocIcon"},columnsMode:i="double",...s})=>{const d=u();return c(x,{className:p("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(T,{title:t,description:l,align:n,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:p("grid gap-xl","double"===i?"@md:grid-cols-2":"grid-cols-1",ud[i]),role:"list",children:a.map(gd(d,r))}):null]})})),gd=(e,t)=>(l,n)=>{if(""===l?.docType)return null;const a="Attachment"===l?.docType?W(e)(l?.attachment?.src):l?.href,r="Attachment"===l?.docType?((e,t=2)=>{if(0===e)return"";const l=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,l)).toFixed(t))} ${dd[l]}`})(l?.attachment?.fileSize||0):l?.fileSize,i="Attachment"===l?.docType?xd(a):l?.fileFormat;return o("div",{role:"listitem",children:o(md,{text:l?.text,target:l?.target,href:a,fileFormat:i,fileSize:r,icon:t?o(ne,{className:"min-w-6 min-h-6",image:t,width:"24",height:"24"}):null})},String(n))},xd=e=>{if(!e)return"";const t=e.lastIndexOf("."),l=new RegExp(/\/(.*)/),n=-1!==t?e.substring(t+1):"";return n.includes("/")?n.replace(l,""):n},fd=kt((({className:e,padding:t,align:l="text-left",buttons:n=[],description:a,image:r,items:i,qr:s,headingType:d,additionalDescription:m="",title:h="Мобильное приложение",version:u="primary",...g})=>{const f="secondary"===u?"p-m min-w-32":"min-w-24",b=r?.src?o(ne,{className:"hidden lg:block",image:r}):null;return o(x,{className:p("min-h-80",e),padding:"p-0",version:u,...g,children:c(Ce,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(k,{headingType:d,title:h,className:p("whitespace-pre-wrap",l)}),rightImage:b,buttons:Xe(n,{className:"flex-wrap"}),children:[a?o(je,{size:"text-xl","font-weight":"font-light",children:a}):null,c("div",{className:p("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[o(et,{items:i,listItemSize:"M"}),o(je,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),s?.src?o("div",{className:p("flex justify-center bg-white rounded-md @xl:-order-1",f),children:o(ne,{className:"w-fit",image:s})}):null,r?.src?o(ne,{className:"lg:hidden",image:r}):null]})]})})})),bd={primary:"bg-white/30",secondary:"bg-main-divider"},yd={primary:"text-white",secondary:"text-secondary-text"},vd=d((({count:e,version:t="secondary"})=>o("div",{className:p("w-6 h-6 rounded-full flex items-center justify-center",bd[t]),role:"status",children:o(je,{size:"text-xs",color:yd[t],children:e})}))),Nd=(e=[],t={})=>e.filter((({content:e={}})=>xa(t,e))).length,wd=(e,t)=>e===t;const Cd=(kd=function(...e){return(t,l)=>e.some((e=>e(t,l)))}(wd,((e=wd)=>(t,l)=>t===l||Boolean(t&&l&&t.length===l.length&&t.every(((t,n)=>e(t,l[n])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,l])=>kd(l,t[e])))));var kd;const Sd=[],Id={},Td={default:"px-xs",underlined:"px-m",rounded:"px-lg rounded-md"},Bd={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",rounded:"text-white"},Md={default:"bg-white",underlined:"bg-white",rounded:"bg-transparent"},Pd={default:"sm:bg-primary-main",underlined:"bg-white",rounded:"bg-primary-main"},Rd=d((({tag:e="div",item:t={},isActive:l,type:n="default",onClick:a})=>{const r=e,{text:i,appendRight:s,...d}=t;return o(r,{className:p("h-12","block flex-1","cursor-pointer",Td[n],l?Pd[n]:Md[n]),role:"tab","aria-selected":l,onClick:a,...d,children:c("div",{className:p("h-full","flex justify-center items-center","text-center whitespace-nowrap",l?Bd[n]:"text-secondary-text hover:text-primary-main"),children:[o(je,{size:"text-m",children:i}),s?o("div",{className:"ml-xs",children:s}):null]})})})),Vd=d((e=>o(e?.item?.href?zd:Ad,{...e}))),zd=d((e=>{const t=he(),l=r((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:n,...a}=t({...e.item,onClick:l});return o(Rd,{...e,tag:"a",item:a,onClick:n})})),Ad=d((({item:e={},onClick:t,...l})=>{const n=r((()=>{t&&t(e)}),[t,e]);return o(Rd,{item:e,onClick:n,...l})})),Dd=(e,t,l)=>(n,a)=>o(Vd,{isActive:n===e,onClick:t,type:l,item:n},String(a)),jd=d((({className:e,tabsType:t="default",items:l=[],value:n,onChange:a})=>o("div",{className:p("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tablist",children:l.map(Dd(n,a,t))}))),$d={categories:[],extraOptions:[],propertyType:[],stage:[]},Ld=kt((({className:e,hotFilters:t,filtrationSchema:l={},resetButton:n,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:u}]=ba($d,{block:a.block,page:a.options?.page}),g=r(((e=$d)=>u(e)),[]),f=(({hotFilters:e=Sd,filtrationState:t=Id,blocks:l=Sd,onFiltrationStateChange:n})=>{const a=i((()=>Math.max(0,e.findIndex((e=>Cd(e.filter,t))))),[e,t]),s=i((()=>e.map((t=>({text:t.text,appendRight:o(vd,{version:t===e[a]?"primary":"secondary",count:Nd(l,t.filter)})})))),[e,l,a]),c=r((t=>{n(e[s.indexOf(t)].filter)}),[e,s]);return{value:s[a],items:s,onChange:c}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:g});return c(x,{className:p("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(jd,{...f}),o(da,{filtrationSchema:l,resetButton:n,field:m,reset:h}),o(Ss,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}});function Ed(e,t,l){t.geoObjects.removeAll();const n=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=new e.Clusterer({clusterIcons:[{href:"/icons/MapMarkerClusterIcon.svg",size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),r=l.map((({coords:t,content:l})=>new e.Placemark(t,{balloonContentHeader:l?.header,balloonContentBody:l?.body,balloonContentFooter:l?.footer,hintContent:l?.hint},{iconLayout:"default#image",iconImageHref:"/icons/MapMarkerSingleIcon.svg",iconImageSize:[78,84],iconImageOffset:[-35,-50]})));a.add(r),t.geoObjects.add(a),t.setBounds(e.util.bounds.fromPoints(l.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const Od={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center",font:"text-center font-sans"},Fd=(e,t,l)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Od).join(" ")} ${l}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.geoObjects.add(t.geoObjects)}))},children:o(X,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),_d=()=>function(e,t,l=!0){const[r,i]=n(void 0);return a((()=>{let n=!0;return Pc(e,t).then((e=>{n&&i(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(n=!1,l){const e=document.getElementById(t);e&&document.head.removeChild(e),i(void 0)}}}),[e,t,l]),r}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${j.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Ud={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center",font:"text-center font-sans text-l"},Hd=d((({yandexMaps:e,direction:t="in"})=>{const l="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const l=e.current.getZoom(),n="in"===t?l+1:l-1;e.current.setZoom(n,{checkZoomRange:!0})},className:`${Object.values(Ud).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(X,{name:l,width:"20",height:"16"})})})),Wd={border:"border border-transparent rounded-md ",position:"absolute flex items-center justify-center",size:"w-12 h-12",focus:"focus:border-primary-text focus:border",font:"text-center font-sans",active:"active:bg-primary-active",hover:"hover:bg-primary-hover",other:"select-none cursor-pointer"},Kd=[55.753995,37.614069],qd=d((({points:e,className:t="",zoom:l=5})=>{const r=s(null),i=_d(),[d,m]=n();if(a((()=>{r?.current?i&&(Ed(i,r.current,e),e?.length||r.current.setCenter(Kd)):i?.ready((()=>{r.current||(r.current=new i.Map("map",{center:e?Xd(e):Kd,zoom:l,controls:[],suppressMapOpenBlock:!0}),Ed(i,r.current,e))}))}),[i,r,e,l]),!i)return null;const h=d?"z-[100000]":"z-10";return c("div",{id:"map",className:p(!d&&"relative","w-full",t),children:[o("div",{className:p(Object.values(Wd),h,"right-2 top-4 bg-white"),onClick:()=>{const e=r.current.container;d?e.exitFullscreen():e.enterFullscreen(),m(e.isFullscreen())},children:o(X,{name:"FullScreenIcon",width:"16",height:"16"})}),c("div",{className:p("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Hd,{yandexMaps:r}),o(Hd,{yandexMaps:r,direction:"out"})]}),Fd(r.current,i,p("right-2 top-80",h))]})})),Xd=e=>[Gd(Yd(e,0)),Gd(Yd(e,1))],Yd=(e,t)=>e.map((e=>e.coords[t])),Gd=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Qd={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему"},Zd="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Jd=(e,{field:t,reset:l},n=3)=>{const a=(e||[]).map((e=>o(Gl,{text:Qd[e],...t(e)},e))),[r,i]=n>0?[a.slice(0,n),a.slice(n)]:[a,[]];return o("div",{children:e?.length?o("div",{children:i.length>0?o(Ki,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Zd,children:r}),o(qi,{className:Zd,isUnfolded:e,children:i})]}),renderFoldButton:em(l)}):o("div",{className:Zd,children:r})}):null})},em=e=>({isUnfolded:t,onToggle:l})=>c("div",{className:"flex",children:[o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0 mr-lg",appendRight:o(X,{name:["ArrowDownIcon","ArrowUpIcon"][Number(t)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(t)],onClick:l}),o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,text:"Очистить фильтр",appendRight:o(X,{name:"CloseIcon",width:"16",height:"16"})})]}),tm=()=>{},lm=()=>[],nm=e=>"all"===e?"block":"hidden",am=d((({className:e,data:t=[],renderCard:l=tm,filterItems:a=lm,getBalloon:r=tm,initFilterState:s={},descriptionData:d,title:m})=>{const[h,{field:u,reset:g}]=At(s),[x,f,y]=i((()=>{const e=a(t,h),l=e.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:r(e)}))).filter((e=>e.coords&&2===e.coords.length));return[e,l,e.length]}),[t,h]),[v,N]=n("all");return c("div",{className:p("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-6xl pb-0",children:[c("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:[o(k,{headingType:"h2",children:m}),y?o(je,{size:"text-h2",color:"text-secondary-text",children:`(${y})`}):null]}),d?im(d):null,rm(t,v,N),o("div",{className:p("pb-2xl",nm(v)),children:Jd(Object.keys(s),{field:u,reset:g})})]}),o("div",{className:"h-[600px]",children:o(b,{children:o(qd,{points:f,className:"h-full"})})})]}),x.map(l)]})})),rm=(e,t,l)=>{const n="business"===t?"primary":"secondary",a=(e,t,n)=>(e.currentTarget===e.target&&"business"===t&&n.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription)),l(t),n);return c("div",{className:"flex pb-lg",children:[o(nn,{className:"mr-m","data-id":"all",onClick:t=>a(t,"all",e),version:"all"===t?"primary":"secondary",children:"Для физических лиц"}),o(nn,{"data-id":"business",onClick:t=>a(t,"business",e),version:n,children:"Для юридических лиц"})]})},im=({__html:e,list:t})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Ae,{__html:e})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(je,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,sm={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"}},om=d((({className:e,children:t,color:l="gray"})=>c("div",{className:p("sm:p-s sm:border sm:border-gray rounded-md flex items-center",sm[l].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(je,{size:"text-m",color:sm[l].text,children:t})]}))),cm=d((({value:e,subText:t,children:l,...n})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,l,t].every((e=>!e))?null:dm({textItems:a,subText:t,children:l,...n})})),dm=({label:e,labelSize:t="text-m",textItems:l,subColor:n,subText:a,className:r,children:i})=>c("div",{className:p("flex gap-2xs flex-col h-full max-w-[300px]",r),children:[e?o(je,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,i||l.filter(Boolean).map(((e,t)=>o(je,{size:"text-l",children:e.trim()},String(t)))),a?o(je,{color:n,size:"text-m",children:a}):null]}),mm=d((({className:e,children:t})=>o("div",{className:p("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),hm=["ArrowDownIcon","ArrowUpIcon"],um=["Подробнее","Скрыть"],pm=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:um[Number(e)]}),o(X,{className:"text-primary-text",name:hm[Number(e)],width:"16",height:"16"})]}),gm=({location:e,address:t,billAcceptorType:l,terminalType:n,billAcceptorEnable:a,atmCode:r="",atmAccess:i="",workTime:s},d)=>{const m=[{label:"Устройство",value:bm(n)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===l?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(i)?"Общедоступный":""},{label:"Регистрационный номер",value:r}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(je,{size:"text-h4",children:bm(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(X,{name:"GeolocationIcon",width:"24",height:"24"}),o(je,{size:"text-l",children:t})]}):null]}),o(om,{color:"green",children:bm(s)})]}),o("div",{className:"hidden sm:block",children:o(mm,{className:"flex-wrap",children:m?.map(fm)})}),o(Ki,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(qi,{isUnfolded:e,children:o(mm,{className:"flex-wrap",children:m?.map(fm)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>pm({isUnfolded:e,onToggle:t})})]},String(d))},xm=({address:e="",terminalType:t,atmCode:l=""})=>({header:`${bm(t)} №${l}`,body:e.toUpperCase()}),fm=(e,t)=>o(cm,{...e},String(t)),bm=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",ym=[];const vm=async e=>{const t=await ft(e,{method:"GET"});return Array.isArray(t)?t:ym},Nm={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1},wm={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable)},Cm=d((({data:e,className:t})=>{const[l]=Gs(),n=function(e){const{data:t=ym}=Ml(`/api/v1/atms?regionCode=${e}`,vm);return t}(l?.code??"000");return o(am,{className:t,filterItems:km,data:n,initFilterState:Nm,renderCard:gm,getBalloon:xm,title:`Банкоматы филиала ${l?.name}`,descriptionData:e})})),km=(e,t)=>{const l=Object.keys(t).filter((e=>t[e])),n=l.filter((e=>e.startsWith("terminalType"))),a=l.filter((e=>!n.includes(e)));return e.filter((e=>{const t=a.every((t=>wm[t](e))),l=!n.length||n.some((t=>wm[t](e)));return t&&l}))},Sm=e=>{const t=Tm(e);return o(cm,{label:"Режим работы",value:t,className:"max-w-none"})},Im=({workTime:e="",lunchHour:t="",daysOff:l=""},n=!1)=>e?[`${n?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",l?`не работает: ${l}`:""].filter(Boolean).join("; "):"",Tm=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),l=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Im({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:l?"":n}),Im({workTime:l?.workTime,lunchHour:l?.lunchHour,daysOff:n},!0)].filter(Boolean)},Bm=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Mm=e=>Bm.map((([t,l,n])=>({key:t,title:n,short:l,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),Pm=e=>{if(!e)return null;const t=Rm(e);return c(mm,{className:"border-none",children:[o(cm,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Vm)})}),o(cm,{label:"Режим работы",className:"max-w-none",children:o(je,{children:e})})]})},Rm=e=>{const t=Bm.map((([,e])=>({short:e,status:!0}))),l=e.split("/")??[],n=l[l.length-1]?.toLowerCase();return n?.includes("выходной")?t.map((e=>({...e,status:!n?.includes(e.short.toLowerCase())}))):t},Vm=({short:e,status:t},l)=>o("div",{className:p("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(je,{size:"text-xs",children:e})},String(l)),zm=({currency:e,buyExchangeRate:t,saleExchangeRate:l},n)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(cm,{label:"Валюта",value:e.currency}):null,t?o(cm,{label:"Купить",value:String(t)}):null,l?o(cm,{label:"Продать",value:String(l)}):null]},String(n)),Am=(new Date).getDay(),Dm=e=>{const[t]=e?.slice(Am-1)??[];if(!t)return null;const{lunchHour:l,status:n,workTime:a,hasLunch:r}=t;return n?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(om,{color:"green",children:a}):null,l&&r?o(om,{color:"yellow",children:`перерыв: ${l}`}):null]}):o(om,{color:"red",children:"Выходной"})},jm=({lunchHour:e,hasLunch:t=!1,status:l=!1})=>l?e&&t?`Перерыв ${e}`:e:"Не работает",$m=({title:e,status:t,workTime:l,lunchHour:n,hasLunch:a},r)=>o(cm,{label:e,value:t&&l?l:"",subText:jm({lunchHour:n,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(r)),Lm=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Em=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Om=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Fm=({name:e,address:t,phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},h)=>{if(!d)return null;const u=Mm(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(je,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(X,{name:"GeolocationIcon",width:"24",height:"24"}),o(je,{size:"text-l",children:t})]}):null]}),Dm(u)]}),o("div",{className:"hidden sm:block",children:_m({phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Ki,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(qi,{isUnfolded:e,children:_m({phone:l,fax:n,phoneBusiness:a,phoneNatural:r,phoneCallCentre:i,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>pm({isUnfolded:e,onToggle:t})})]},String(h))},_m=({phone:e,fax:t,phoneBusiness:l,phoneNatural:n,phoneCallCentre:a,phoneCurrencyControl:r,workSchedule:i,exchangeRate:s})=>{const d=Mm(i),m=i?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(mm,{className:"flex-wrap",children:[o(cm,{label:"Факс",value:t}),o(cm,{label:"Телефон филиала",value:e}),o(cm,{label:"Для обращений юридических лиц",value:l}),o(cm,{label:"Обслуживание физических лиц",value:n}),o(cm,{label:"Для консультаций по валютному контролю",value:r}),o(cm,{label:"Контакт-центр",value:a})]}),i?.isMatchesPattern?o(mm,{children:o(cm,{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($m)})})}):c(mm,{children:[o(cm,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Vm)})}),Sm(d)]}),i?.businessScheduleVisibleTag?Pm(i?.businessScheduleDescription):null,s?.currencies?.length?o(mm,{className:"flex-wrap",children:s?.currencies?.map(zm)}):null]})},Um=({name:e="",address:t="",workSchedule:l})=>{const n=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const r=`${t} ${(e=>{const t=Mm(e),l=e?Tm(t):"",n=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?Lm(l):Om(l,n):Em(l):null})(l)}`;return{header:n,body:r}},Hm=[];const Wm=async e=>{const t=await ft(e,{method:"GET"});return Array.isArray(t)?t:Hm},Km={workingSaturday:!1,premiumService:!1,privateBanking:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},qm={workingSaturday:e=>Boolean(e.workSchedule?.workingSaturday),premiumService:e=>Boolean(e.premiumService),privateBanking:e=>Boolean(e.privateBanking),sellingCoins:e=>Boolean(e.sellingCoins),buyingCoins:e=>Boolean(e.buyingCoins),bullionOperations:e=>Boolean(e.bullionOperations),preciousMetalsOperations:e=>Boolean(e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean(e.transferringDataToBiometricSystem)},Xm=d((({className:e})=>{const[t]=Gs(),l=function(e){const{data:t=Hm}=Ml(`/api/v1/branches?regionCode=${e}`,Wm);return t}(t?.code??"000");return o(am,{className:e,filterItems:Ym,data:l,initFilterState:Km,renderCard:Fm,getBalloon:Um,title:`Офисы филиала ${t?.name}`})})),Ym=(e,t)=>{const l=Object.keys(t).filter((e=>t[e]));return e.filter((e=>l.every((t=>qm[t](e)))))},Gm=d((({data:e,className:t,...l})=>{const n=e?.dataType??"offices";return o(x,{version:"transparent",className:p(t),defaultPadding:"p-0",...l,children:"offices"===n?o(Xm,{}):o(Cm,{data:e})})})),Qm=d((({className:e,title:t,description:l="Блок в разработке...",...n})=>c(x,{className:p("box-border",e),...n,children:[o(T,{className:"max-w-[600px]",title:t,description:l,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(y,{})]}))),Zm=d((({className:e="",padding:t,slides:l=[],...a})=>{const[r,i]=n(0);return c(x,{className:p("box-border overflow-hidden",e),defaultPadding:"py-6xl",padding:t,...a,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*r}%)`},role:"list",children:l.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(st,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...a})},String(t))))}),o("div",{className:"h-28 px-xs mt-m -mb-m flex gap-xs box-border",children:l.map(Jm({activeSlideIndex:r,onClick:i}))})]})})),Jm=({activeSlideIndex:e,onClick:t})=>({nav:l},n)=>{const a=n===e,r=a?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:py-xl backdrop-blur",i=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-secondary-text text-l font-light":"text-secondary-text text-m font-light group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(n),"aria-label":l?.title,className:p("relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50",r),children:[o("div",{className:i,children:l?.title}),o("div",{className:s,children:l?.description})]},String(n))},eh=d((({address:e,email:t,telephone:l,button:n,className:a="",__html:r,icon:i,title:s,version:d="primary",...m})=>c(x,{className:p("box-border text-left space-y-s",a),version:d,...m,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[qe(i)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:i})}):null,s?o(k,{headingType:"h3",as:"h3",title:s}):null]}),c("div",{className:"w-full space-y-m",children:[r?th(r):null,lh({label:"Адрес",data:e,iconName:"GeolocationIcon"}),lh({label:"Телефон(факс)",data:l,iconName:"PhoneIcon"}),lh({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),n?.text?Xe([n]):null]})]}))),th=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Ae,{__html:e})}),lh=({label:e,data:t,iconName:l,dataColor:n=""})=>t?c("div",{className:"flex gap-s",children:[o(X,{iconVersion:"black",name:l,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(je,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(je,{size:"text-xl",color:n,children:t})]})]}):null,nh=d((e=>{const{__html:t,richVersion:l,...n}=e;return o(x,{defaultPadding:"p-0",...n,children:o(Ae,{__html:t,richVersion:l})})})),ah=d((({label:e,labelIconBgVersion:t,icon:l,onToggle:n,labelIcon:a})=>o(vs,{tag:"button",className:p("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:n,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(je,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:l?o(X,{name:l,iconVersion:"color",width:"24",height:"24"}):null}))),rh=kt((({className:e="",isExpanded:t,isFoldButtonOnTop:l=!0,label:n="Развернуть",labelIcon:a,labelIconBgVersion:r,foldButtonVersion:i="default",version:s,role:c,...d})=>o(x,{className:p("w-full","border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Ki,{isFoldButtonOnTop:l,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(qi,{className:p("gap-lg","grid grid-cols-12 [&>*]:pb-m"),isUnfolded:e,children:z({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ih({foldButtonVersion:i,label:n,labelIcon:a,labelIconBgVersion:r,isUnfolded:e,onToggle:t})})})),{childrenTypes:{exclude:["RollupItem"]}}),ih=({foldButtonVersion:e,label:t,labelIcon:l,labelIconBgVersion:n,isUnfolded:a,onToggle:r})=>{const i=t||(a?"Скрыть":"Развернуть"),s=((e=!1)=>e?"MinusIcon":"PlusIcon")(a);return"accordion"===e?o(ah,{label:i,labelIcon:l,labelIconBgVersion:n,icon:s,onToggle:r}):o(Ns,{label:i,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:r})},sh=d((({className:e=""})=>{const[t,l]=n("option2"),a=r((e=>l(e)),[]);return c("div",{className:p("order-4",e),role:"radiogroup",children:[o(qn,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(qn,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),oh=d((({data:e,fieldLabel:t,fieldValue:l,selected:n,placeholder:a="",setSelected:r,label:i})=>{const s=e.filter(Boolean).map((e=>({key:e?.[l||t],text:e?.[t]}))),c=s.find((e=>e.key===n));return o(qt,{options:s,label:i,placeholder:a||n,onChange:e=>r(e.key),value:c})})),ch=d((({regions:e=[],selectedRegion:t,onSelectedRegion:l,branches:n=[],selectedBranch:a,onSelectedBranch:r})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(oh,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:l,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(oh,{data:n,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:r,label:"Отделение",placeholder:"Выберите отделение"})})]}))),dh=["От 1 дня","До 365 дней"],mh=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(je,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(zn,{min:1,max:365,value:e,items:dh,onChange:t})]}))),hh=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:l,safeBoxCases:n=[],selectedBoxSize:a,onSelectedBoxSize:r})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(oh,{data:e,fieldLabel:"volume",selected:t,setSelected:l,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(oh,{data:n,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:r,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),uh=d((({regions:e,selectedRegion:t,branches:l,selectedBranch:n,days:a,selectedCaseVolume:r,selectedBoxSize:i,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:h})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(ch,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:l,selectedBranch:n,onSelectedBranch:ph(m)}),o(mh,{days:a,setDays:e=>m({days:e})}),o(hh,{caseVolumes:d,selectedCaseVolume:r,onSelectedCaseVolume:gh(m),safeBoxCases:s,selectedBoxSize:i,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(je,{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(sh,{}),o(be,{text:"Офисы на карте",version:"primary",onClick:h,className:"order-6"})]})]}))),ph=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},gh=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},xh=d((({days:e,tariffs:t=[]})=>{const l=bh(e,t),n="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[fh("Аренда за",e),fh("Цена",l+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(S,{size:"text-s",font:"font-light",color:"text-secondary-text",children:n})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(S,{size:"text-s",font:"font-light",color:"text-white",children:n})})]})]})})),fh=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(je,{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})]}),bh=(e,t)=>{const l=yh(e);return e*(t?.find((e=>e.tariffType===String(l)))?.tariffValue||0)},yh=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},vh=(e,t)=>e.find((e=>e.branchCode===t)),Nh=d((e=>{const{regions:t,data:l,branches:n,onChange:r,onClick:i}=e;a((()=>{r({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[l.selectedRegion,r]);const s=vh(n,l.selectedBranch),d=wh(s?.safeBoxCaseVolumes),m=Ch(s?.safeBoxCaseVolumes,l.selectedCaseVolume)?.safeBoxCases,h=kh(m,l.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(uh,{...l,regions:t,onClick:i,branches:n,caseVolumes:d,safeBoxCases:m,onChange:r}),o(xh,{days:l.days,tariffs:h})]})})),wh=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Ch=(e,t)=>e?.find((e=>e.volume===t)),kh=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Sh=[];const Ih=async e=>await ft(e,{method:"GET"})||Sh,Th=d((({title:e,footnote:t,className:l="",...a})=>{const[i,s]=n(!1),d=r((()=>s((e=>!e))),[]),[m,h]=n({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),u=Kl(),p=Bh(m.selectedRegion,u),g=function(e){const{data:t}=Ml(e?`/api/v1/safeboxes?regionCode=${e}`:null,Ih);return t||Sh}(p),f=r((e=>h((t=>({...t,...e})))),[h]),b=(y=vh(g,m.selectedBranch)||g,Array.isArray(y)?y.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):y?.gpsLatitude&&y?.gpsLongitude?[{coords:[y.gpsLatitude,y.gpsLongitude]}]:[]);var y;return c(x,{className:l,defaultPadding:"",...a,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(k,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Nh,{regions:u,branches:g,data:{...m,selectedRegion:p},onClick:d,onChange:f}),t?o(S,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&i?o(qd,{points:b,className:"h-[640px]"}):null]})})),Bh=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Mh=({styleMap:e,isMainButton:t,version:l})=>(n,a,r)=>{const{label:i,description:s,button:d,items:m,isDotted:h}=n;return c("div",{className:p("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",Ph(r.length)),children:[c("div",{className:"space-y-xs",children:[i?o(je,{size:"text-h6",align:"text-center",children:i}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[s?o("div",{className:e.description,children:s}):null,o(et,{className:e.description,items:m,listItemSize:"M",isDotted:h})]})]}),d?.text&&!t?o(be,{className:"box-border py-s w-full max-w-60 mt-auto",version:l,...d,children:d?.text}):null]},String(a))},Ph=e=>e<5?"w-72":"w-52",Rh={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"},Vh=d((({buttons:e,className:t="",description:l,showLines:n=!0,size:a="normal",steps:r=[],stepVersion:i="gray",title:s,version:d="primary",...m})=>{const h=r.length>3,u=Rh,g=(e=>e?"":"opacity-0")(n),f=(e=>e<5?"px-24":"px-16")(r.length),b=Boolean(e?.every((e=>e?.text)));return c(x,{className:p("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:d,...m,children:[o(T,{headlineVersion:"S",title:s,description:l,isEmbedded:!0,className:"w-full",align:ya}),r?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:p("flex items-center",f),children:oa(o("div",{className:p("h-0.5 w-full bg-secondary-light flex-1",g)}))(r.map(zh(u,a,i)))}),o("div",{className:p("flex justify-between",h?"gap-x-s":"gap-x-20"),children:r.map((y={styleMap:u,isMainButton:b,version:d},(e,t,l)=>{const{type:n}=e;if("default"!==n&&"rte"!==n)return null;switch(n){case"default":return Mh(y)(e,t,l);case"rte":return o("div",{className:p("text-center",Ph(l.length)),children:o(Ae,{__html:e.__html})},String(t));default:return null}}))})]}):null,Xe(e)]});var y})),zh=(e,t,l)=>({icon:n},a)=>{const r="secondary"===l?"white":"color";return o(x,{defaultPadding:"",className:`${Ah(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:l,children:qe(n)?o(ne,{image:{...n,iconVersion:n?.iconVersion||r},width:"48",height:"48"}):o("span",{className:p("text-h4","transparent"===l?e.iconText:(i=l,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:a+1})},String(a));var i},Ah=e=>"normal"===e?"h-24 w-24":"h-16 w-16",Dh=d((()=>o("div",{className:"hidden",role:"none"}))),jh=d((({className:e,version:t,gap:l=14,padding:n=16,showDots:a=false,minHeight:r,children:i,onVisibleIndicesChange:s,listType:d="horizontal-list"})=>{const m=Array.isArray(i)?i.length:0,[h,u]=Fa({itemCount:m,onVisibleIndicesChange:s}),[g]=u.visibleIndicesRange;return c("div",{className:p(e,"vertical-list"===d?"relative h-full":""),children:[o(Ba,{containerRef:h,activeIndex:g,visibleItemCount:1,gap:l,padding:n,onVisibleIndicesChange:u.handleVisibleIndicesChange,listType:d,minHeight:r,children:i}),a?o(za,{containerRef:h,activeIndex:g,dotCount:m,listType:d,version:t}):null]})})),$h=kt((({listType:e,showDots:t,options:l,version:n,...a})=>o(x,{version:n,defaultPadding:"p-0",...a,children:o(jh,{listType:e,showDots:t,version:n,children:z({...a,options:l})})})),{childrenTypes:{exclude:["SwipeListControlBlock"]}}),Lh="hidden sm:flex absolute z-40 top-0",Eh=d((({className:e,items:t=[],value:l,onChange:n,tabsType:a})=>{const[r,i]=Fa({itemCount:t?.length||0});return c("div",{className:p("relative overflow-x-auto no-scrollbar",e),role:"tablist",children:[o(Ba,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:i.handleVisibleIndicesChange,children:t.map(Dd(l,n,a))}),i.canScrollLeft?o(Ua,{className:p("left-6",Lh),onClick:i.scrollLeft}):null,i.canScrollRight?o(Ha,{className:p("right-6",Lh),onClick:i.scrollRight}):null]})})),Oh=({tabsMode:e,...t})=>{switch(e){case"wideScreen":return o(jd,{...t});case"centered":return o("div",{className:"flex",children:o(jd,{className:"m-auto p-xs rounded-md bg-main-gray",tabsType:"rounded",...t})});case"scrollable":return o("div",{className:"flex",children:o(Eh,{className:"m-auto",tabsType:"underlined",...t})});default:return null}},Fh="tab",_h=d((({className:e="",isSticky:t,tabs:l=[],tabsMode:s,...c})=>{const d=u(),{isReady:m}=d,g=i((()=>l.map(Hh)),[l]),[f,b]=n(0);a((()=>{if(!l||!l[0])return;const e=d.query.tab&&l.findIndex((e=>"group"===e.type&&e.ref===d.query.tab))||0,t=l[e]||l[0];b(e),Uh(t)}),[m]),a((()=>{const e=l[f];"group"===e?.type&&h.subject("tab",{type:e.type,label:e.ref,groupName:e.name})}),[l,f]);const y=r((e=>{const t=g.indexOf(e),n=l[t];b(t),Uh(n),"group"===n.type&&(e=>{const t=new URLSearchParams(d.query);e.name?t.set(Fh,e.name):t.delete(Fh),d.replace(`${d.pathname}?${t}`,"",{scroll:!1})})(e)}),[l,g]);return o(x,{className:p(t?"sticky top-1 z-20":"",e),defaultPadding:"p-0",...c,children:Oh({items:g,value:g[f],tabsMode:s,onChange:y})})})),Uh=e=>{"group"===e.type&&h.fire("tab",{type:e.type,label:e.ref,groupName:e.name}),"link"===e.type&&h.fire("tab",{type:e.type,label:e.href})},Hh=e=>"group"===e?.type?{text:e.title,name:e.ref}:e,Wh={start:"text-start",center:"text-center",end:"text-end"},Kh=d((({tab:e,className:t,onClick:l,isActive:n})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white text-primary-text"),title:e?"mb-xs text-xl":"mb-2xs text-l",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal"}))(n);return c("button",{type:"button",onClick:l,"aria-label":e?.title,className:p("border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs",a.btn,t),children:[e?.icon?o(ne,{className:p("h-6 w-6 min-w-6 min-h-6",a.icon),image:{...e?.icon,iconVersion:e?.icon?.iconVersion??a.iconVersion},width:"24",height:"24"}):null,c("div",{className:"border-0",children:[e?.title?o("div",{className:a.title,children:e.title}):null,e?.description?o("div",{className:a.desc,children:e.description}):null]})]})})),qh=d((({tab:e})=>{const t=he(),{onClick:l}=t({...e,onClick:()=>{e.href&&!L(e.href)&&(globalThis.location.href=e.href)}});return Po(l,[],800),o(y,{className:"col-span-12 p-xl",size:5})})),Xh=kt((({className:e="",tabs:t=[],block:l,tabAlign:a,...r})=>{const[i,s]=n(Gh(t)),d=Yh(t[i],i),m=t.length,[h,{inc:u,dec:g}]=wa({itemCount:m},i),[f,b]=Fa({itemCount:m});return c(x,{className:p(e),defaultPadding:"p-0",...r,children:[c("div",{className:"relative border-b-8 border-primary-main",children:[o(Ba,{itemClassName:"flex",containerRef:f,snapAlign:"snap-end",gap:8,onVisibleIndicesChange:b.handleVisibleIndicesChange,children:t.map(Qh(i,s,a))}),o(qa,{scroll:b,arrowsPadded:!0,onScrollLeft:g,onScrollRight:u,activeIndex:h,itemCount:m})]}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:t[i]?.href?o(qh,{tab:t[i]}):V(l?.slots?.[d],{...r?.options,slotName:d,parent:l})})]})}),{slots:({tabs:e})=>e?.filter((e=>!e.href)).map(Yh)||[],childrenTypes:{exclude:["TabsLayout"]}}),Yh=(e,t)=>e?.title||`Слот №${t}`,Gh=e=>e.reduce(((e,t,l)=>t.selected?l:e),0),Qh=(e,t,l="start")=>(n,a)=>o(Kh,{className:Wh[l],tab:n,isActive:e===a,onClick:()=>t(a)},String(a)),Zh=d((({className:e="",isOpen:t,onClick:l})=>o(be,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"20",height:"20"}),text:t?"Скрыть":"Показать",version:"gray",onClick:l}))),Jh={Buttons:({buttons:e})=>Xe(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,List:({isDotted:e,...t})=>o(et,{className:"flex flex-col justify-between items-start text-h6",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(je,{size:"text-h6",children:e})}):null,t?o("div",{children:o(je,{size:"text-l",color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,dataUrl:l,pdfUrl:n,isOpen:a})=>e?o(Zh,{isOpen:a,onClick:()=>{t({dataUrl:l,pdfUrl:n})}}):null},eu=d((({cell:e,fieldIdx:t,rowIdx:l,cellIdx:r,setTableInner:i,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=n(!0);a((()=>{r===o&&s||m(!0)}),[s,o]);return tu({cell:e,cellProps:{rowIdx:l,cellIdx:r,fieldIdx:t,displayTable:e=>{m(!1),c(r),i(e)},isVisible:d}})})),tu=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:l,...n}=e;if(!l||!(l in Jh))return null;return o(Jh[l],{...t,...n})},lu=d((({cells:e,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:r,setOpenTableInnerIdx:i})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(eu,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:l,setTableInner:n,tableInner:a,openTableInnerIdx:r,setOpenTableInnerIdx:i},String(s)))):null}))),nu=(e,t)=>140*Re(e.slice(0,t).map((e=>e?.cols?.length??1))),au=(e,t)=>e?.length>0?o("div",{className:p("flex",0===t?"text-secondary-text":""),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(je,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,ru=d((({rows:e})=>{const t=e?.[0]?.length??0,[l,n]=wa({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((a=l,(e,t)=>{if(!e?.length)return null;const[l,...n]=e,r=p("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[l?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(je,{size:"text-xl",font:"font-light",children:l.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:r,style:{transform:`translateX(-${nu(n,a)}px)`},children:n?.map(((e,t)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(je,{size:"text-xl",children:e.data}):null,e?.cols?au(e.cols,a):null]},`row${t}`)))})})]},String(t))})),fr({...n,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var a})),iu=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,l)=>{const n=`activeTabIdx:${e}-tableIdx:${l}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(je,{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(ru,{rows:t.rowsData})})})]},n)}))}))),su=(e=!1)=>""+(e?"text-white":"text-secondary-text"),ou=d((({currencies:e,linkToPDF:t,activeTabIndex:l,setActiveTabIndex:n})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:p("rounded-md px-4 py-3 cursor-pointer",t===l?"bg-primary-main":""),onClick:()=>n(t),children:o(je,{size:"text-xl",font:"font-light",color:su(t===l),children:e||t+1})},e)))}):null,t?o(be,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(X,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]})));async function cu(e){const t=await fetch(e);return await t.json()}const du=d((({dataUrl:e,pdfUrl:t,onClick:l})=>{const{tableData:a}=function(e){const{data:t}=Ml(function(e){return`/wcms-resources/${e||"tariffs-inner-table-data"}.json`}(e),cu);return t||{}}(e),[i,s]=n(0),d=r((e=>s(e)),[]),m=a?.[i]?.items??[],h=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(ou,{currencies:h,activeTabIndex:i,setActiveTabIndex:d,linkToPDF:t}),o(iu,{activeTabIndex:i,items:m}),o(Zh,{className:"mt-xl",onClick:l,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(je,{size:"text-h6",children:"Данных нет"}),o(Zh,{onClick:l,isOpen:!0})]})})),mu=d((({children:e,tableInner:t,onHideContentClick:l})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:p("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(du,{...t,onClick:l})}):null]}))),hu=d((({row:{header:e,data:t},activeIndex:l,rowIdx:a,...i})=>{const[s,d]=n(void 0),m=r((e=>d(e)),[]),[h,u]=n(void 0),g=r((e=>u(e)),[]);return c(mu,{onHideContentClick:()=>d(void 0),tableInner:s,...i,children:[o("div",{className:p("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(je,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(ns,{activeIndex:l,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(lu,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...i},String(t))))}):null]})})),uu=d((({children:e,controls:t})=>{const{isScrollAvailable:l}=t;return c("div",{role:"table",children:[c("div",{className:"relative space-y-xs",children:[e,fr({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),l?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),pu=d((({className:e="",title:t,description:l,rowHeaders:n,tariffsColumns:a,hiddenRowsNum:r=0,...i})=>{const s=a?.map((({data:e})=>e))||[],d=n?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,u]=wa({itemCount:m,visibleItemCount:2}),g=(d||[]).map(((e,t)=>o(hu,{row:e,activeIndex:h,rowIdx:t,...i},String(t)))),[f,b]=r>0?[g.slice(0,-r),g.slice(-r)]:[g,[]];return c(x,{className:p("overflow-hidden relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...i,children:[o(T,{title:t,description:l,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m",children:r>0?o(Ki,{renderFoldableSection:({isUnfolded:e})=>c(uu,{controls:u,children:[f,o(qi,{isUnfolded:e,children:b})]}),renderFoldButton:ws}):o(uu,{controls:u,children:g})})]})})),gu=d((({className:e="",title:t,description:l,iconVersion:n,__html:a,...r})=>c(x,{className:p("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===n?xu():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(je,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,l?fu(l):null,a?o(Ae,{__html:a}):null]})]}))),xu=()=>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"}),fu=e=>o(S,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),bu=d((({prefix:e,unit:t,suffix:l})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(je,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,l?o("div",{className:"gradient-color-text",children:o(je,{size:"text-h2",children:l})}):null]}))),yu=d((e=>{const{prefix:t,unit:l,suffix:n,...a}=e;return o(x,{defaultPadding:"p-0",...a,children:o(bu,{prefix:t,unit:l,suffix:n})})})),vu=kt((({className:e="",padding:t="p-0",gap:l="",isInnerPadding:n=!0,version:a="transparent",isTheme:r=!1,isCardBorder:i=!1,image:s,...c})=>{const d=u();return o(x,{className:p("relative flex flex-col",Xc[l],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${Z(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:r,...c,children:z({...c,extraProps:{className:p("w-full",Na(i)),padding:n?"":"p-0"}})})}),{childrenTypes:[]}),Nu=e=>(e=>{const t="col-span-",l=e?.split(/\s+/).find((e=>e.startsWith(t)));return l?parseInt(l.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",wu=d((({className:e,title:t,url:l,previewImg:n,...a})=>{const r=u();return c(x,{className:e,defaultPadding:Nu(e),...a,children:[o(T,{title:t,headlineVersion:"M"}),l?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:W(r)(n?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:W(r)(l)})}):null]})})),Cu={AdTile:It,ApplicationForm:yn,ApplicationFormCustom:na,ApplicationFormGrantSupport:sa,BankAccountFiltration:rr,BenefitsBlock:cr,BonusBenefitsBlock:pr,ButtonsBlock:xr,Calculator:yi,CardTransfer:Ii,Carousel:lr,CarouselBankHistoryCard:Ti,CarouselCard:Vi,CarouselCatalogCard:Ai,CarouselLinks:Ei,CarouselRecommendationCard:Hi,CarouselTariffsCard:Yi,ComparisonTable:ps,ContactsBlock:xs,DepositFiltration:Ps,Depository:Ks,ErrorBlock:Xs,ExchangeRateTile:No,Footer:sc,GracePeriod:oc,Header:qc,Headline:T,HorizontalLayout:Yc,ImgBlock:Gc,InsuranceAmountBlock:td,InvestmentInfo:rd,LinkDocs:pd,MobileAppTile:fd,MortgageFiltration:Ld,OfficesAtmsMap:Gm,Placeholder:Qm,ProductBlock:St,ProductGallery:Zm,RepresentativeOfficeInfo:eh,RichTextBlock:nh,RollupItem:rh,SafeDepositRental:Th,StepsBlock:Vh,StickyBottomMenu:Dh,SwipeListControlBlock:$h,Tabs:_h,TabsLayout:Xh,TariffsTable:pu,TextBlock:gu,UnitBlock:yu,VerticalLayout:vu,Video:wu},ku="rshb-query-params";function Su(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(ku)||"";return e&&globalThis.sessionStorage?.setItem(ku,e),e}const Iu=me((()=>{a((()=>{Su()}),[]);const e=Ac(j.CHAT_BOT);_t(globalThis,"click",Tu({loadBot:e,reachGoalYM:e=>{const[t]=j.YANDEX_METRIKA_ID?.split(",").reverse()??[];[t,e,globalThis.ym].every(Boolean)&&globalThis.ym(t,"reachGoal",e)}}))})),Tu=e=>t=>{const l=Bu(t.target);for(const t in l?.dataset)Pu(t)?.(l,e);if($(l?.href)&&!l?.href?.startsWith(globalThis.location?.origin)){t.preventDefault(),t.stopPropagation();const e=(e=>{const t=Su();if(!$(e)||!t)return e;const l=new URL(e);for(const[e,n]of new URLSearchParams(t))l.searchParams.set(e,n);return l.toString()})(l?.href)||l?.href;if(e){Mu(l?.target)?.(e)}}},Bu=e=>{let t=e;for(;Boolean(t)&&"A"!==t.tagName;)t=t?.parentNode;return t},Mu=uo([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]),Pu=uo([[e=>"ymtarget"===e,(e,t)=>t?.reachGoalYM(e?.dataset?.ymtarget)],[e=>"chatbot"===e,(e,t)=>t?.loadBot({target:e})]]),Ru="cookie",Vu=d((({termLink:e,personalDataPolicyLink:t})=>{const[l,{setTrue:n,setFalse:a}]=jt();Po((()=>{globalThis.localStorage?.getItem(Ru)||n()}),[],3e3);const i=r((()=>{globalThis.localStorage?.setItem(Ru,"true"),a()}),[]);return l?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:c(S,{size:"text-s",font:"font-light",color:"text-primary-text",children:["АО «Россельхозбанк» использует",o(Fi,{isRemote:!0,className:zu(e?.href),...e,children:"cookie"}),"(файлы с данными о прошлых посещениях сайта) для персонализации сервисов и удобства пользователей. Вы можете запретить сохранение cookie в настройках своего браузера.",o(Fi,{isRemote:!0,className:zu(t?.href),...t,children:"Обработка Ваших персональных данных"}),"производится в соответствии с требованиями Федерального закона от 27.07.2006 № 152-Ф3 «О персональных данных»."]})}),o("div",{className:"ml-s sm:ml-0 w-24 flex justify-end",children:o(Mo,{className:"bg-main-gray rounded-md",onClose:i})})]})}):null})),zu=e=>p("inline mx-2xs",e?"text-green-dark":"");function Au(e){throw new Error(e)}const Du=({onCloseAll:e,onClose:t}={})=>{const[l,{push:i,pop:s,clear:o}]=function(e=[]){const[t,l]=n(e),a=r((e=>l((t=>[...t,e]))),[]),i=r((()=>l((e=>e.slice(0,-1)))),[]),s=r((e=>l((t=>t.filter((t=>t!==e))))),[]),o=r((()=>l([])),[]);return[t,{setList:l,push:a,pop:i,remove:s,clear:o}]}(),c=r((()=>{e&&e(l),o()}),[l,e]),d=r((()=>{t&&t(l[l.length-1]),s()}),[l,t]);return a((()=>h.subscribe("dialog",(e=>{switch(e.type){case"open":i(e);break;case"close":e.all?c():d();break;default:Au(e)}}))),[c,d]),l},ju=d((()=>{const e=r((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=r((e=>{e?.onClose&&e.onClose()}),[]),l=Du({onCloseAll:e,onClose:t}),{close:n}=de(),i=r((({key:e})=>{"Escape"===e&&n()}),[]);return _t(globalThis.document,"keydown",i),a((()=>{l.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[l]),l.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:l.map((({dialog:e,id:t},n)=>o("div",{className:p("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar",n===l.length-1?"":"hidden"),children:e},String(t||n))))}):null})),$u=d((()=>{const[e,t]=n(null),l=r((()=>{t(null)}),[]);a((()=>h.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":l();break;default:Au(e)}}))),[]);const i=r((({key:e})=>{"Escape"===e&&l()}),[l]);return _t(globalThis.document,"keydown",i),e?o("div",{className:p("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Lu="header",Eu="footer",Ou="sticky-footer",Fu={},_u=d((({className:e,data:t=Fu,blocksRegistry:l,blockDecorator:n})=>{const{slots:a,blocks:r,fallback:i,...s}=t,d=Ct(s,i);Iu();const m={key:"",page:{slots:a,blocks:r,fallback:i,...d},blocksRegistry:l,blockDecorator:n,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:p("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:V(a?.header,{...m,slotName:Lu})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[z({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),V(a?.footer,{...m,slotName:Eu})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:V(a?.["sticky-footer"],{...m,slotName:Ou})}):null,o(ju,{}),o($u,{}),o(Vu,{termLink:{href:"/pd-policy#cookie",target:"_blank"},personalDataPolicyLink:{href:"/pd-policy",target:"_blank"}})]})}));Object.assign(_u,{childrenTypes:[],slots:()=>[Lu,Eu,Ou]});e.Blocks=Cu,e.ContentPage=_u,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),l=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await l.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.handlerDecorator=me,e.joinList=oa,e.packageVersion="0.14.262",e.projectSettings=j,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=_,e.useRouter=u,Object.defineProperty(e,"__esModule",{value:!0})}));