@redneckz/wildless-cms-uni-blocks 0.14.660 → 0.14.661

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 (144) hide show
  1. package/bundle/api/RetailAPI/getTaskStatus.d.ts +3 -3
  2. package/bundle/bundle.umd.js +37 -21
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/CreditForm/CreditFormStatus.d.ts +1 -0
  5. package/bundle/components/CreditForm/PendingStatusContent.d.ts +3 -1
  6. package/bundle/ui-kit/FormField/validators.d.ts +1 -0
  7. package/bundle/ui-kit/TimerCircle/Timer.d.ts +1 -2
  8. package/bundle/ui-kit/TimerCircle/TimerCircle.d.ts +1 -0
  9. package/dist/api/RetailAPI/getTaskStatus.d.ts +3 -3
  10. package/dist/api/RetailAPI/getTaskStatus.js +3 -3
  11. package/dist/api/RetailAPI/getTaskStatus.js.map +1 -1
  12. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
  13. package/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  14. package/dist/components/CreditCardForm/calculateInputs.js +2 -0
  15. package/dist/components/CreditCardForm/calculateInputs.js.map +1 -1
  16. package/dist/components/CreditForm/CreditFormStatus.d.ts +1 -0
  17. package/dist/components/CreditForm/CreditFormStatus.js +7 -3
  18. package/dist/components/CreditForm/CreditFormStatus.js.map +1 -1
  19. package/dist/components/CreditForm/CreditFormStatusTracker.js +7 -6
  20. package/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  21. package/dist/components/CreditForm/PendingStatusContent.d.ts +3 -1
  22. package/dist/components/CreditForm/PendingStatusContent.js +2 -2
  23. package/dist/components/CreditForm/PendingStatusContent.js.map +1 -1
  24. package/dist/components/CreditForm/calculateInputs.js +2 -0
  25. package/dist/components/CreditForm/calculateInputs.js.map +1 -1
  26. package/dist/ui-kit/FormField/getObjectValidator.js +1 -1
  27. package/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  28. package/dist/ui-kit/FormField/validators.d.ts +1 -0
  29. package/dist/ui-kit/FormField/validators.js +3 -1
  30. package/dist/ui-kit/FormField/validators.js.map +1 -1
  31. package/dist/ui-kit/TimerCircle/Timer.d.ts +1 -2
  32. package/dist/ui-kit/TimerCircle/TimerCircle.d.ts +1 -0
  33. package/dist/ui-kit/TimerCircle/TimerCircle.js +8 -2
  34. package/dist/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
  35. package/lib/api/RetailAPI/getTaskStatus.d.ts +3 -3
  36. package/lib/api/RetailAPI/getTaskStatus.js +3 -3
  37. package/lib/api/RetailAPI/getTaskStatus.js.map +1 -1
  38. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
  39. package/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  40. package/lib/components/CreditCardForm/calculateInputs.js +2 -0
  41. package/lib/components/CreditCardForm/calculateInputs.js.map +1 -1
  42. package/lib/components/CreditForm/CreditFormStatus.d.ts +1 -0
  43. package/lib/components/CreditForm/CreditFormStatus.js +7 -3
  44. package/lib/components/CreditForm/CreditFormStatus.js.map +1 -1
  45. package/lib/components/CreditForm/CreditFormStatusTracker.js +7 -6
  46. package/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  47. package/lib/components/CreditForm/PendingStatusContent.d.ts +3 -1
  48. package/lib/components/CreditForm/PendingStatusContent.js +2 -2
  49. package/lib/components/CreditForm/PendingStatusContent.js.map +1 -1
  50. package/lib/components/CreditForm/calculateInputs.js +2 -0
  51. package/lib/components/CreditForm/calculateInputs.js.map +1 -1
  52. package/lib/ui-kit/FormField/getObjectValidator.js +2 -2
  53. package/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  54. package/lib/ui-kit/FormField/validators.d.ts +1 -0
  55. package/lib/ui-kit/FormField/validators.js +1 -0
  56. package/lib/ui-kit/FormField/validators.js.map +1 -1
  57. package/lib/ui-kit/TimerCircle/Timer.d.ts +1 -2
  58. package/lib/ui-kit/TimerCircle/TimerCircle.d.ts +1 -0
  59. package/lib/ui-kit/TimerCircle/TimerCircle.js +8 -2
  60. package/lib/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
  61. package/mobile/bundle/api/RetailAPI/getTaskStatus.d.ts +3 -3
  62. package/mobile/bundle/bundle.umd.js +37 -21
  63. package/mobile/bundle/bundle.umd.min.js +1 -1
  64. package/mobile/bundle/components/CreditForm/CreditFormStatus.d.ts +1 -0
  65. package/mobile/bundle/components/CreditForm/PendingStatusContent.d.ts +3 -1
  66. package/mobile/bundle/ui-kit/FormField/validators.d.ts +1 -0
  67. package/mobile/bundle/ui-kit/TimerCircle/Timer.d.ts +1 -2
  68. package/mobile/bundle/ui-kit/TimerCircle/TimerCircle.d.ts +1 -0
  69. package/mobile/dist/api/RetailAPI/getTaskStatus.d.ts +3 -3
  70. package/mobile/dist/api/RetailAPI/getTaskStatus.js +3 -3
  71. package/mobile/dist/api/RetailAPI/getTaskStatus.js.map +1 -1
  72. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
  73. package/mobile/dist/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  74. package/mobile/dist/components/CreditCardForm/calculateInputs.js +2 -0
  75. package/mobile/dist/components/CreditCardForm/calculateInputs.js.map +1 -1
  76. package/mobile/dist/components/CreditForm/CreditFormStatus.d.ts +1 -0
  77. package/mobile/dist/components/CreditForm/CreditFormStatus.js +7 -3
  78. package/mobile/dist/components/CreditForm/CreditFormStatus.js.map +1 -1
  79. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js +7 -6
  80. package/mobile/dist/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  81. package/mobile/dist/components/CreditForm/PendingStatusContent.d.ts +3 -1
  82. package/mobile/dist/components/CreditForm/PendingStatusContent.js +2 -2
  83. package/mobile/dist/components/CreditForm/PendingStatusContent.js.map +1 -1
  84. package/mobile/dist/components/CreditForm/calculateInputs.js +2 -0
  85. package/mobile/dist/components/CreditForm/calculateInputs.js.map +1 -1
  86. package/mobile/dist/ui-kit/FormField/getObjectValidator.js +1 -1
  87. package/mobile/dist/ui-kit/FormField/getObjectValidator.js.map +1 -1
  88. package/mobile/dist/ui-kit/FormField/validators.d.ts +1 -0
  89. package/mobile/dist/ui-kit/FormField/validators.js +3 -1
  90. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  91. package/mobile/dist/ui-kit/TimerCircle/Timer.d.ts +1 -2
  92. package/mobile/dist/ui-kit/TimerCircle/TimerCircle.d.ts +1 -0
  93. package/mobile/dist/ui-kit/TimerCircle/TimerCircle.js +8 -2
  94. package/mobile/dist/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
  95. package/mobile/lib/api/RetailAPI/getTaskStatus.d.ts +3 -3
  96. package/mobile/lib/api/RetailAPI/getTaskStatus.js +3 -3
  97. package/mobile/lib/api/RetailAPI/getTaskStatus.js.map +1 -1
  98. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js +3 -3
  99. package/mobile/lib/components/CreditCardForm/CreditCardFormStatusTracker.js.map +1 -1
  100. package/mobile/lib/components/CreditCardForm/calculateInputs.js +2 -0
  101. package/mobile/lib/components/CreditCardForm/calculateInputs.js.map +1 -1
  102. package/mobile/lib/components/CreditForm/CreditFormStatus.d.ts +1 -0
  103. package/mobile/lib/components/CreditForm/CreditFormStatus.js +7 -3
  104. package/mobile/lib/components/CreditForm/CreditFormStatus.js.map +1 -1
  105. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js +7 -6
  106. package/mobile/lib/components/CreditForm/CreditFormStatusTracker.js.map +1 -1
  107. package/mobile/lib/components/CreditForm/PendingStatusContent.d.ts +3 -1
  108. package/mobile/lib/components/CreditForm/PendingStatusContent.js +2 -2
  109. package/mobile/lib/components/CreditForm/PendingStatusContent.js.map +1 -1
  110. package/mobile/lib/components/CreditForm/calculateInputs.js +2 -0
  111. package/mobile/lib/components/CreditForm/calculateInputs.js.map +1 -1
  112. package/mobile/lib/ui-kit/FormField/getObjectValidator.js +2 -2
  113. package/mobile/lib/ui-kit/FormField/getObjectValidator.js.map +1 -1
  114. package/mobile/lib/ui-kit/FormField/validators.d.ts +1 -0
  115. package/mobile/lib/ui-kit/FormField/validators.js +1 -0
  116. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  117. package/mobile/lib/ui-kit/TimerCircle/Timer.d.ts +1 -2
  118. package/mobile/lib/ui-kit/TimerCircle/TimerCircle.d.ts +1 -0
  119. package/mobile/lib/ui-kit/TimerCircle/TimerCircle.js +8 -2
  120. package/mobile/lib/ui-kit/TimerCircle/TimerCircle.js.map +1 -1
  121. package/mobile/src/api/RetailAPI/getTaskStatus.ts +3 -3
  122. package/mobile/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +3 -3
  123. package/mobile/src/components/CreditCardForm/calculateInputs.ts +4 -0
  124. package/mobile/src/components/CreditForm/CreditFormStatus.tsx +42 -29
  125. package/mobile/src/components/CreditForm/CreditFormStatusTracker.tsx +8 -6
  126. package/mobile/src/components/CreditForm/PendingStatusContent.tsx +36 -33
  127. package/mobile/src/components/CreditForm/calculateInputs.ts +4 -0
  128. package/mobile/src/ui-kit/FormField/getObjectValidator.tsx +2 -1
  129. package/mobile/src/ui-kit/FormField/validators.ts +6 -0
  130. package/mobile/src/ui-kit/TimerCircle/Timer.tsx +1 -1
  131. package/mobile/src/ui-kit/TimerCircle/TimerCircle.tsx +33 -23
  132. package/package.json +2 -2
  133. package/src/api/RetailAPI/getTaskStatus.ts +3 -3
  134. package/src/components/CreditCardForm/CreditCardFormStatusTracker.tsx +3 -3
  135. package/src/components/CreditCardForm/calculateInputs.ts +4 -0
  136. package/src/components/CreditForm/CreditForm.fixture.tsx +8 -4
  137. package/src/components/CreditForm/CreditFormStatus.tsx +42 -29
  138. package/src/components/CreditForm/CreditFormStatusTracker.tsx +8 -6
  139. package/src/components/CreditForm/PendingStatusContent.tsx +36 -33
  140. package/src/components/CreditForm/calculateInputs.ts +4 -0
  141. package/src/ui-kit/FormField/getObjectValidator.tsx +2 -1
  142. package/src/ui-kit/FormField/validators.ts +6 -0
  143. package/src/ui-kit/TimerCircle/Timer.tsx +1 -1
  144. package/src/ui-kit/TimerCircle/TimerCircle.tsx +33 -23
@@ -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 n=e=>(...n)=>t[e](...n),a=n("useState"),l=n("useEffect"),i=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...l}=t||{},i=n?.slots?.default,r=a||i&&i();return e(Object.assign(l,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:l,block:i,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],l||a,e),...m?{"data-ver":t}:{},...i?.anchor?{id:i.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>y(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),y=(e,t)=>[e].concat(t>0?y(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:l})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:a||l}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:l,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(N,{className:u("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:a}):null,l?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...p,children:l}):null]})})),S=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function I(e,t,{className:n,...a}={}){const{key:l,blockDecorator:i=S,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return i({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:i})=>{const{content:r}=n;return d?o(d,{className:i,block:e,options:t,...r,...a},l):null}},l)}const B=[],R=(e,{key:t,ancestors:n=B,slotName:a=null,extraProps:l,renderProps:i=I,...r})=>{const s=l?(e,t)=>I(e,t,l):i;return(e||[]).map(((e,l)=>s(e,{...r,key:`${t||e.type}-${l}`,ancestors:r.parent?[...n||B,[r.parent,a]]:n},l)))};function P({block:e,options:t,children:n,extraProps:a,renderProps:l}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:a,renderProps:l}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const M=["CDN","BASE_PATH"],_=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),A=e=>Boolean(e?.includes(":")),z=(e,t)=>Boolean(e&&!A(e)&&(!t||"_self"===t)),E=e=>Boolean(e?.startsWith("#")),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),O=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:A,isLocalURL:z,isHash:E,withoutQuery:F,joinPath:V,hasPrefix:O});const q="/api/",j=`${q}v1/storage`,$=e=>(t,n)=>{if([!t,A(t),E(t),[_.CDN,q].some((e=>O(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`${j}/${t}/attachment`;const a=t?.startsWith("/");return V(O(t,n)?"":n,a?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:l=a,iconVersion:i="color",width:r,height:s})=>{const d=D(),m="normal"===i?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(V(_.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:a,title:l,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[i],{invert:"white"===i},t),width:r,height:s,"aria-hidden":"true",children:[l?o("title",{children:l}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!A(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const a=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:l},i)=>o("source",{srcSet:J(a)(e),type:te(n),media:l?`(max-width: ${l}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?ee({...t,src:J(a)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(Q,{className:e,imageClassName:n,image:t}):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","":""},le="bg-main-divider text-main-disabled",ie={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},re="text-center font-sans select-none",se={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","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" ");const ce=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},de=()=>({open:(e,t={})=>ce.fire("dialog",{type:"open",dialog:e,...t}),close:()=>ce.fire("dialog",{type:"close"}),closeAll:()=>ce.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function ue(){const e=X(G.SITE_URL),t=D(),{closeAll:n}=de();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(a({...e,href:n}))}};function a({href:a,target:l,onClick:i}){return r=>{i?.(r),he(a,l,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(a,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!z(e,t))return!0;const a=G.SUB_PORTALS?.split(",");return!!a?.some((t=>O(e,t)))||!O(e,n||"/")},pe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},ge=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:l,version:i="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[a?o("div",{className:u(r,se[i]),children:a}):null,xe(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,l?o("div",{className:u(r,se[i]),children:l}):null]})})),fe=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const l=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",xe(e)?l:"h-12 w-12 m-auto",{"rounded-full":a})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:n="LINK",href:a,...l})=>{const r=(({method:e,href:t})=>i((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:l,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,l].join(""));for(const[e,t]of i.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:a}),s=ue()({onClick:r,href:a,...l}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:a,ariaLabel:l,version:i,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:i,rounded:r}),href:t,rel:n,target:a,"aria-label":l||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:n,rounded:a,children:l})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:a,version:n}),children:l})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const l="primary"===e?"white":"black",i="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),i),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),o(ye,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=a(false);return l((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Se=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:l,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...b})=>{const y=Ce(),v=D(),N=i((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!y;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&we({version:t,handleClick:N,text:w}),l?o("div",{className:"relative h-full",children:l}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Se(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Be(P({...b,extraProps:{className:"@container-normal"}})),Se(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Ie(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Ie=e=>u(e?"row-span-2":"@xl:row-span-2"),Be=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Re=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Pe=d((e=>{const{__html:t="",richVersion:n="",itemSize:a="list-m",isDotted:l=!0}=e,i=l?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,a,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",i),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Me=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),_e=(e,t)=>e?o(Me,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ae=(e,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,"__html"in e?o(Pe,{...e},`rte-${t}`):null],ze=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Re(n.icon,t):null,o("div",{children:Ae(n)})]}))),Ee=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(ze,{benefitsVersion:t,...e},String(n))))}):null)),Fe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Ae)}):null)),Ve=d((({isTabularBenefits:e,...t})=>o(e?Fe:Ee,{...t}))),Oe=e=>Boolean(e?.src||e?.icon),Le=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(qe(n))}):null,qe=(e="")=>(t,n)=>{const{text:a,icon:l,iconRight:i,version:r,...s}=t||{},c=je(l,r),d=je(i,r);return a||l?.icon?o(ye,{className:u("basis-full @lg:basis-auto",e),appendLeft:$e({...l,iconVersion:c}),appendRight:$e({...i,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},je=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},$e=e=>Oe(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ue=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),We=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(He)}):null)),He=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Me,{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:[Ue(2)(t)," ",n||"₽"]}):null]},String(a)),Ye=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ke)}):null)),Ke=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Me,{size:"text-m",font:"font-light",children:e})},String(t)),Ge={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Xe=d((({className:e,padding:t,defaultPadding:n,title:a,description:l,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:T,...I})=>{const B=y?.src?o(ne,{image:y}):null,R=o(k,{title:a,description:l,headlineVersion:i,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:R}:{insetTitle:R},...Je(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Le(b),backwardButton:S,...I,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Ve,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(Pe,{richVersion:p,__html:h,isDotted:m,itemSize:Ge[i]}):null,T,f?.length?o(We,{priceList:f}):null,Ze(x)]})})})),Je=(e,t)=>t?{rightImage:e}:{leftImage:e},Ze=e=>e?.length?o(Ye,{tags:e}):null,Qe=e=>Boolean(e&&Array.isArray(e)),et=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),tt=(e,t)=>{return n=e,Boolean(et(n)&&"string"==typeof n.$ref)?t.ref(e):et(e)?t.record(e):Qe(e)?t.array(e):t.scalar?t.scalar(e):e;var n},nt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(at,e),at=(e,t)=>e&&t?et(e)?e[t]:Qe(e)?e[parseInt(t,10)]:e:e,lt=(e,t)=>tt(e,{ref:({$ref:e,...n})=>lt(e?nt(t(e),e):n,t),record:e=>Object.entries(e).map((([e,n])=>({[e]:lt(n,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>lt(e,t)))}),it=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const a in e)it(e[a],t,[...n,a])},array:e=>{for(let a=0;a<e.length;a++)it(e[a],t,[...n,a])}})};async function rt(e,t){try{return e?await st(e,t):null}catch(e){console.error(e)}return null}const st=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),ot=e=>[...new Set(e)],ct={},dt=["/portal-resources"],mt=(e,t)=>lt(e,(e=>t?.[e])),ut=(e,t)=>{const n=(e=>{const t=[];return it(e,(e=>t.push(e))),t})(e),[i,r]=a({});return l((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(ot(e).filter((e=>!dt.some((t=>e.startsWith(t))))).map((async e=>[e,ct[e]||=await st(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?mt(e,{...t,...i}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:a,padding:l,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const pt=ht((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(Xe,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),a=t?.[n];return a?o(pt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),ft=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),xt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getFullYear());return t?`${l}-${a}-${n}`:`${n}.${a}.${l}`}},bt=e=>e?.replace(/[^+\d]/g,"");const yt=e=>e?{phone:bt(e)}:{},vt=(e,t="birthday")=>e?{[t]:xt(e)}:{},Nt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ct=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:bt(e)}:{},kt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:l}of e)t[a??""]?.(n,l)},St="rshb-query-params";function Tt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(St)||"";return e&&globalThis.sessionStorage?.setItem(St,e),e}function It(e){if(!e)throw new Error("Value should be fulfilled");return e}const Bt=e=>t=>{const[,n]=It(e.find((([e])=>e(t))));return n(t)},Rt=e=>Bt(e.map((([e,t])=>[e,()=>t])));Rt.if=e=>new Pt(void 0,e);class Pt{parent;predicate;unit;get entry(){return[It(this.predicate),It(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Pt(this,e)}then(e){return new Pt(this.parent,this.predicate,e)}else(e){return Bt([...Dt(this),[()=>!0,e]])}}const Dt=e=>[...e?.parent?Dt(e.parent):[],e.entry],Mt=e=>{const t=e.target?.closest("a");if(A(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Tt();if(!A(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;if(n){_t(t?.target)?.(n)}}},_t=Rt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function At(){return At._impl()}At._impl=()=>({forwardQuery:Mt}),At.setup=e=>{At._impl=e};const zt=e=>e,Et=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=a(e),c=i(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return Ft(t,n)?t:n}:r(e)):o,[r]);l((()=>{r&&o(r)}),[r]);const[d,m]=a(!1),[u,h]=a({}),p=i(((e,t)=>{const{parse:n=zt,format:a=zt}=t||{};return{value:a(s[e]),isDirty:d||u[e],onChange:t=>{c((a=>({...a,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=i((e=>{c(e),h(e)}),[]),f=i((()=>{c(e),m(!1),h({})}),[e]),x=i((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},Ft=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),Vt=d((e=>{const{className:t,title:n,children:a,...l}=e;return o(g,{className:t,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})})),Ot=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function Lt(e=!1){const[t,n]=a(e),l=i((()=>n(!0)),[]),r=i((()=>n(!1)),[]),s=i((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:l,setFalse:r,toggle:s}]}function qt(e,t,n,a){l((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function jt(e){const t=s(null),n=i((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return qt(globalThis.document,"click",n),t}const $t=({label:e,errors:t})=>e&&t?`${e}*`:e,Ut=()=>{},Wt="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ht=e=>e?o(Me,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Yt=d((({key:e,className:t="",id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),k=i((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);l((()=>{v&&C.current?.focus()}),[v,C]);const S=g?"pr-3xl":"",T=Kt(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ht(d),N?o("textarea",{className:u("block resize-y min-h-24",Gt,T),id:u("textarea",n),name:a||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,disabled:w},e):o("input",{type:r,className:u("h-14",Gt,S,T),ref:C,id:n,name:a||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,pattern:y,disabled:w},e)]}),g]})})),Kt=e=>e?Wt:"border-error",Gt="w-full border rounded-md text-primary-text outline-none p-m",Xt=e=>o("div",{className:"h-6",children:e?o(Me,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Jt=e=>e?.value||"",Zt={url:"suggest/address"},Qt={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:Zt,addressFact:Zt,organizationAddress:Zt,addressCourier:Zt},en=()=>({open:(e,t)=>ce.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>ce.fire("popup",{type:"update",popup:e,...t}),close:()=>ce.fire("popup",{type:"close"})}),tn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function nn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=en(),x=Qt[n],b=i((()=>{h.current=t,f.close()}),[t]),y=i((e=>{b(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[b,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:a,requestData:l={},responseItemHandler:i=Jt}=e,r=(s=i,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`;return fetch(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...l,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...l)=>{a.dispose(),n=setTimeout((()=>{e(...l)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return l((()=>{if(!e||!v.current||h.current===t)return void b();const n=v.current,{top:a,left:l,width:i,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:y}),{top:a+globalThis.scrollY+r,left:l,width:i})}),[e,p,t,y]),v}const an=d((({className:e,label:t,value:n="",placeholder:a,error:l,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:b=!1,disabled:y=!1})=>{const[v,{setFalse:N,setTrue:w}]=Lt(),C=jt(N),k=i((e=>x?e.length<=x&&s(e):s(e)),[s]),S=nn({isOpen:v&&b,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:S,children:o(Yt,{disabled:y,type:p||"text","aria-label":t,label:$t({label:t,errors:r}),valid:Boolean(!l),value:n,onChange:k,onBlur:m,isTextarea:h,placeholder:ln(a,r,t)})}),Xt(l)]})})),ln=(e,t,n)=>t&&!n?`${e}*`:e,rn=e=>e?.text||e?.key||"",sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=d((({popupRef:e,options:t,value:n,query:a,onChange:l,iconVersion:i})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:sn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),l&&l(e)},children:[o("span",{className:"min-h-6",children:rn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const cn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[b,{setFalse:y,setTrue:v}]=Lt(),[N,w]=a(""),C=un(x,n.length),k=b&&!C,S=i((()=>{w(""),y()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=i((()=>{m.close(),c&&c()}),[c]),h=i((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=jt(u);return l((()=>{if(!e||!p.current)return;const l=p.current,{top:i,left:r,width:s,height:c}=l.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:b,options:n,value:r,query:N,onChange:f,onClose:S,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[Ht(t),c("div",{className:u("relative",k?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",mn(m,d,C)),onClick:k?S:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:rn(r)||h}),dn(k,g)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Yt,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),dn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),mn=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),un=(e,t)=>e||0===t,hn=d((({className:e="",label:t,error:n,errors:a,...l})=>c("div",{className:e,children:[o(cn,{...l,valid:!n,label:$t({label:t,errors:a})}),Xt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",bn=e=>fn(e??xn),yn=e=>gn((e=>e?.key&&""!==e?.key))(e??xn),vn=e=>gn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??xn),Nn=e=>gn((e=>"string"==typeof e&&e.length>1))(e??xn),wn=(e,t)=>gn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??xn),Cn=e=>gn((e=>"string"==typeof e&&6===e.length))(e),kn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,gn((e=>"string"==typeof e&&t.test(e))))(e);var t},Sn=gn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Tn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},In=e=>Boolean("0"===e.qc&&"0"===e.qcComplete&&"2"===e.qcHouse),Bn=()=>gn(In)("Укажите регион, город/населенный пункт, улицу, дом, квартиру"),Rn={typeForm:bn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:yn(),addressBranch:yn(),phone:kn("Укажите номер телефона"),secondaryPhone:kn("Укажите номер телефона"),organizationPhone:kn("Укажите номер телефона"),birthday:bn("Укажите дату рождения"),birthPlace:bn("Укажите место рождения"),education:bn("Выберите ваше образование"),housing:bn("Выберите тип жилья"),employment:bn("Выберите информацию о трудоустройстве"),organization:bn("Выберите тип организации"),amountWorkers:bn("Выберите информацию о количестве сотрудников"),employerActivities:bn("Выберите вид деятельности организации"),employerOrganization:bn("Выберите вид организации"),positionOrganization:bn("Выберите вашу должность"),dulSerie:(Pn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Pn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:bn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:bn("Укажите организацию, выдавшую паспорт"),email:(e=>gn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Nn(),inn:(e=>gn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:bn("Укажите ОПФ"),organizationName:bn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:bn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:bn(),collectionCount:bn(),comment:bn(),acquiringType:yn(),feedbackMethod:yn(),serviceType:yn(),serviceDirection:yn(),meetingDay:bn(),product:bn(),localities:bn(),consentDataProcessing:Sn,annualRevenue:bn(),consentToReceiveMaterials:Sn,processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentInformFlg:Sn,familyStatus:bn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(Tn)(e))("Некорректный номер СНИЛС"),conscription:bn(),armyIdFlg:Sn,sex:bn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:Bn(),participantDateRegistration:bn("Укажите дату регистрации"),retirementIncome:bn(),otherIncome:bn(),mandatoryIncome:bn(),otherPayments:bn(),disablePeopleFlg:bn(),bankruptcyFlg:bn(),shareholderFlg:bn(),legalEntityName:bn(),bankEmployeeCode:bn(),partInBusiness:bn(),regionRetail:yn("Выберите филиал банка"),addressRetail:yn("Выберите адрес банка"),addressMatch:bn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&/^[\u0400-\u04FF\d]+$/u.test(e)))(e??xn))("Необходимо ввести кодовое слово"),confirmationIncome:bn(),deliveryDate:bn("Укажите дату доставки"),addressCourier:Bn()};var Pn;const Dn=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,Rn?.[e||""]])).filter((([,e])=>e)))},Mn=(e,t)=>{const{value:n,isDirty:a}=e,l=a?t(n):[];return{...e,errors:l,error:l[0]}},_n=(e,t,n=!1)=>n&&t?Mn(e,t):e,An=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],zn=d((({field:e,input:t})=>o(hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:An,..._n(e("acquiringType"),Rn.acquiringType,t?.required)}))),En=(e="")=>Boolean("trade"===e||"all"===e),Fn=e=>null!=e,Vn=new Map,On=e=>Boolean(e?.every((e=>Array.isArray(e)?On(e):!e||"string"==typeof e))),Ln=e=>On(e)?e.toString():"";function qn(e,t,{fallback:n,cache:i}={}){const s=r((()=>jn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);l((()=>{if(!s.some(Fn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=Vn)=>n=>{const a=Ln(n),l=t.get(a);if(a&&Fn(l))return l;const i=e(...n);return a&&Fn(i)&&t.set(a,Promise.resolve(i)),i})(t,i)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function jn(e){return Array.isArray(e)?e:e instanceof Function?jn(e()):[e]}const $n=[];const Un=async e=>await rt(e,{method:"GET"})||$n;function Wn(e=!1){const{data:t}=qn("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),st);return Array.isArray(t)?t:[]}const Hn=d((({field:e,input:t,isPremium:n=!1})=>{const a=e("region"),i=a?.value?.key,r=a?.value?.text,s=n?Wn(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=qn(e?`/api/v1/branches?regionCode=${e}`:null,Un);return t||$n}(i)?.filter((e=>e?.address));return l((()=>{""!==a?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[a?.value]),o(hn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),..._n(e("addressBranch"),Rn.addressBranch,t?.required),isSearch:!0})})),Yn=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");l((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);const s=i((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=i((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{label:"Адрес",disabled:r,..._n(e(n),Rn[n],t?.required),value:a.fullAddress,onChange:c,...t,onDaDataChange:s})})),Kn=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Gn=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,l=i((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),r=i((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,n),label:"Адрес",..._n(e(n),Rn[n],t?.required),value:a.fullAddress,onChange:r,...t,onDaDataChange:l})})),Xn=d((({className:e,viewBox:t,fill:n="none",width:a,height:l,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:l,children:i.map((({d:e,fill:t,...n},a)=>{const l={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:l.stroke,strokeLinecap:l.strokeLinecap,strokeLinejoin:l.strokeLinejoin,strokeWidth:l.strokeWidth,strokeMiterlimit:l.strokeMiterlimit},a)}))}))),Jn="appearance-none w-5 h-5 border-solid flex-none",Zn=[{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"}],Qn=d((({className:e,value:t,text:n,disabled:a,isRadio:l,onChange:r})=>{const s=i((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=l?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Xn,{paths:Zn,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",ta(a)),onClick:s,children:[o("div",{className:u(Jn,"m-0",l?"rounded-full border-2":aa(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:na(l),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ea(n)]})})})),ea=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,ta=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",na=(e=!1)=>e?"radio":"checkbox",aa=(e=!1)=>u("rounded border",{"bg-primary-main":e}),la=d((({className:e,text:t,value:n,key:a,disabled:l,error:i,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Qn,{text:t,value:n,disabled:l,onChange:r},a),Xt(i)]}))),ia=d((({field:e,input:t})=>o(la,{text:"Адрес фактического места жительства совпадает с адресом регистрации",..._n(e("addressMatch"),Rn.addressMatch,t?.required)}))),ra=(e,{normalize:t,format:n})=>{const{value:l,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=i((e=>{d(!0),r&&r(e)}),[]),u=i((()=>{d(!1),o&&o(t(l)),s&&s()}),[o,l]);return{value:c||!n?l:n(l),onFocus:m,onBlur:u}},sa=(e,t,n)=>Math.max(t,Math.min(e,n));function oa(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function ca({list:e=[],min:t,max:n,step:a,value:l=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(l):l,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||i?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:i,onChange:t=>{const n=oa(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const da=1,ma=100,ua=d((e=>{const{className:t,title:n,items:a=[],list:l=[],min:r=(l.length?0:da),max:s=(l.length?l.length-1:ma),step:d=1,value:m=l[0]||r,disabled:h=!1,onChange:p}=e,g=ra(e,{normalize:(e=0)=>l.length?ha(l)(e):sa(e,r,s),format:Ue()}),f=i((e=>{p&&p(oa(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",Wt,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),ca({list:l,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),pa(a)]})})),ha=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),pa=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ga=["От 1 000 ₽","До 1 000 000 000 ₽"],fa=d((({field:e})=>o(ua,{title:"Сумма, ₽",items:ga,min:1e3,max:1e9,...e("amount")}))),xa=e=>{const{data:t,error:n}=qn(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,ba);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},ba=async e=>await rt(e,{method:"POST"})||[],ya=ht((({field:e,source:t,label:n,fieldName:a,input:l})=>{const i=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:"Выберите из списка",label:n,options:i,..._n(e(a),Rn[a],l?.required)})})),va=d((({field:e,input:t})=>{const{data:n}=xa("EMPLOYEES_NUMBER");return o(ya,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Na=d((({field:e,input:t})=>o(an,{label:"Годовая выручка, ₽",..._n(e("annualRevenue"),Rn.annualRevenue,t?.required)}))),wa=d((({field:e,input:t})=>o(la,{text:"Наличие военного билета",..._n(e("armyIdFlg"),Rn.armyIdFlg,t?.required)}))),Ca=d((({field:e,input:t})=>o(an,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",..._n(e("bankEmployeeCode"),Rn.bankEmployeeCode,t?.required),...t}))),ka=d((({field:e})=>o(an,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Sa=d((({field:e,input:t})=>o(la,{text:"В отношении меня ведётся производство по делу о банкротстве",..._n(e("bankruptcyFlg"),Rn.bankruptcyFlg,t?.required)}))),Ta=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:l,min:i,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(l,a,d),n=Ia(t,e),c=Ba(t,i,r);u.push(o("td",{children:o("div",{className:Ra(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ia=(e,t)=>t&&e.toDateString()===t.toDateString(),Ba=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Ra=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Pa=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Da=d((({today:e,currentMonth:t,currentYear:n,min:a,max:l,onDateSelect:s=Ut,setValue:d=Ut})=>{const m=i((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Pa.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Ta({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:l,onDateClick:m})})]})})),Ma=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function _a(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const a=[...t],l=a.findIndex(Aa),i=a.map(((e,t)=>Ea(e)?a.slice(0,t).filter(Ea).length:-1)),r=a.map(((e,t)=>za(e)?e:n.charAt(i[t])||e)),s=i.indexOf(n.length-1)+1;return r.slice(0,Math.max(l,s)).join("")}const Aa=e=>"_"===e,za=e=>/\d/.test(e),Ea=e=>Aa(e)||za(e),Fa=1940,Va={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Oa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:i,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(i||"");return l((()=>{g(i||"")}),[i]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(_a(t,"__.__.____"))},onBlur:()=>{if(La(p)){const[n,a,l]=p.split(".");d?.(new Date(Number(l),Number(a)-1,Number(n))),e(Number(a)-1),t(Number(l))}else g(i||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Va})]})})),La=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Fa&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let l=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),l++;if(Number(t)>0&&Number(t)<=l)return!0}return!1},qa=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:l,setSelectedYear:i,disabled:r=!1})=>o(Oa,{onChange:a,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:l,setSelectedYear:i,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),ja=Ma.map((e=>({key:e}))),$a=Array.from({length:(new Date).getFullYear()-Fa+1},((e,t)=>Fa+t)).reverse().map((e=>({key:String(e)}))),Ua=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Wa=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:l})=>{a&&l?.(new Date(t,n,Math.min(e,a.getDate())))},Ha={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ya={className:"min-w-32",iconVersion:"black",isBorder:!1},Ka=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=Lt(!1),[f,x]=a(n?.getMonth()||(new Date).getMonth()),[b,y]=a(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:k,yearsOptions:S,handleChangeVisibleCalendar:T,ref:I}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:l,selectedYear:r,onChange:s,value:o})=>{const c=jt(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{n+1<=11?a(n+1):(a(0),l(r+1))}),[n]),handlePrevMonth:i((()=>{n-1>=0?a(n-1):(a(11),l(r-1))}),[n]),handleSelectMonth:i((({key:e})=>{a(Ma.indexOf(e));const t=Ua(r,Ma.indexOf(e));Wa({maxDateOfMonth:t,selectedYear:r,selectedMonth:Ma.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:i((({key:e})=>{l(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ja,yearsOptions:$a,ref:c}})({onYearSelect:y,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,i]=a(!1);return l((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();i(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(I,370);return c("div",{className:u("space-y-xs",e),ref:I,children:[Ht(t),c("div",{className:"relative",children:[qa({handleChangeVisibleCalendar:T,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:y}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Ha,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:Ma[f]},options:k,...Ya}),o(cn,{onChange:C,value:{key:String(b)},options:S,...Ya}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Ha,className:"rotate-90 cursor-pointer"})})]}),o(Da,{today:n,currentMonth:f,currentYear:b,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Ga=d((({className:e,label:t,error:n,errors:a,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ka,{label:$t({label:t,errors:a}),valid:Boolean(!n),...l}),Xt(n)]}))),Xa=d((({field:e,input:t})=>o(Ga,{label:"Дата начала работы на текущем месте",..._n(e("beginDate"),Rn.beginDate,t?.required),...t}))),Ja="birthday",Za=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:a}=e(Ja);return o(Ga,{label:"Дата рождения",..._n(e(Ja),Rn.birthday,t?.required),error:n&&a&&!Qa(a)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&Kn(e,Ja)})})),Qa=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},el=d((({field:e,input:t})=>o(an,{label:"Место рождения",..._n(e("birthPlace"),Rn.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Kn(e,"birthPlace")}))),tl=d((({field:e,input:t})=>{const{data:n}=xa("CARD_TYPE");return o(ya,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),nl=d((({field:e,input:t})=>o(an,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",..._n(e("children"),Rn.children,t?.required),...t}))),al=d((({field:e,input:t})=>o(an,{label:"Кодовое слово",..._n(e("codeWord"),Rn.codeWord,t?.required),...t}))),ll=d((({field:e,input:t})=>o(an,{label:"Количество объектов инкассации",type:"number",..._n(e("collectionCount"),Rn.collectionCount,t?.required)}))),il=d((({field:e,input:t})=>o(an,{className:"col-span-2",..._n(e("comment"),Rn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),rl=d((({field:e,input:t})=>{const{data:n}=xa("INCOME_CERT_UNITED");return o(ya,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),sl=d((({field:e,input:t})=>{const{data:n}=xa("MILITARY_STATUS");return o(ya,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ol={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};async function cl(e,t,n){const a=await fetch(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...ml()},credentials:"include",body:n?JSON.stringify(n):null});return dl(a)?a.json():a}const dl=e=>"application/json"===e.headers.get("Content-Type"),ml=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ul=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await cl(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return await n.blob()})(e,t);return URL.createObjectURL(n)},hl=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),pl=d((({className:e,head:t,children:n,onClose:a,onClick:l})=>{const{close:r}=de(),s=i((()=>{r(),a&&a()}),[a]);return c("div",{onClick:l,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(hl,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),gl=async(e,t,n=!1)=>{const a=await ul(t,n);e(o(pl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:a}):o("iframe",{src:`${a}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},fl=d((({className:e,error:t,docId:n,...a})=>{const{open:l}=de(),i=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Qn,{...a}),n?o(ye,{className:"text-primary-main",onClick:()=>gl(l,n,i),children:o(Me,{children:"Ознакомиться"})}):null]}),Xt(t)]})})),xl=d((({field:e,input:t})=>t&&t.name?o(fl,{text:ol[t.name]?.text,docId:ol[t.name]?.docId,..._n(e(t.name),Rn[t.name],t?.required)}):null)),bl=d((({field:e,input:t})=>{const{data:n}=xa("CREDIT_IN_RSHB");return o(ya,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),yl={horizontal:"@lg:flex-row",vertical:""},vl=d((({label:e,items:t,value:n,className:a,onChange:l,disabled:i=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Me,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",yl[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Qn,{isRadio:!0,text:t,value:n===e,onChange:()=>l&&l(e),disabled:i},String(e))))})]}))),Nl=d((({className:e,label:t,onChange:n,error:a,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(vl,{label:$t({label:t,errors:l?.errors}),onChange:e=>n&&n(e),...l}),Xt(a)]}))),wl=[{id:"rub",text:"Рубль"}],Cl=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency");return o(Nl,{label:"Валюта",orientation:"horizontal",items:wl,value:n,onChange:e=>a?.(e),..._n(e("currency"),Rn.currency,t?.required)})})),kl=d((({field:e,input:t})=>o(Ga,{label:"Дата доставки",..._n(e("deliveryDate"),Rn.deliveryDate,t?.required)}))),Sl=d((({field:e,input:t})=>o(an,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,..._n(e("dependents"),Rn.dependents,t?.required),...t}))),Tl=d((({field:e,input:t})=>o(Ga,{label:"Желаемая дата встречи",..._n(e("desiredMeetingDate"),Rn.meetingDay,t?.required)}))),Il=d((({field:e,input:t})=>o(la,{text:"Являюсь инвалидом",..._n(e("disablePeopleFlg"),Rn.disablePeopleFlg,t?.required)}))),Bl="dulIssueDateField",Rl=d((({field:e,input:t})=>o(Ga,{label:"Дата выдачи",..._n(e(Bl),Rn.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Kn(e,Bl)}))),Pl="dulIssuedBy",Dl=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),l=i((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,Pl),label:"Кем выдан",...t,..._n(e(Pl),Rn.dulIssuedBy,t?.required),onDaDataChange:l,daDataQueryPrefix:n})})),Ml=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Kn(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,..._n(e("dulNumber"),Rn.dulNumber,t?.required)}))),_l=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Kn(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,..._n(e("dulSerie"),Rn.dulSerie,t?.required)}))),Al="dulSubdivisionCode",zl=d((({field:e,input:t})=>{const n=i((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,Al),label:"Код подразделения",type:"number",maxLength:6,...t,..._n(e(Al),Rn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),El=d((({field:e,input:t})=>{const{data:n}=xa("EDUCATION_LEVEL");return o(ya,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Fl=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(an,{label:"Электронная почта",..._n(e("email"),Rn.email,n),...a})})),Vl=d((({field:e,input:t})=>{const{data:n}=xa("ORGANIZATION_ACTIVITY_TYPE");return o(ya,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Ol=d((({field:e,input:t})=>{const{data:n}=xa("ORGANIZATION_KIND");return o(ya,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Ll=d((({field:e,input:t})=>{const{data:n}=xa("EMPLOYMENT_INFO_UNITED");return o(ya,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),ql=d((({field:e,input:t})=>o(an,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",..._n(e("expenses"),Rn.expenses,t?.required),...t}))),jl=d((({field:e,input:t})=>o(an,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,..._n(e("experience5Years"),Rn.experience5Years,t?.required),...t}))),$l=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),a=e("familyStatus")?.value?.key,i="MARRIED"===a?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=i+r+s;return l((()=>{e?.("familyMembers")?.onChange?.(c)}),[a,r,s]),o(an,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Ul=d((({field:e,input:t})=>{const{data:n}=xa("MARITAL_STATUS");return o(ya,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Wl=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Hl=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Yl=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Kl=d((({field:e,input:t})=>o(hn,{label:"Способ получения ответа",options:Yl,..._n(e("feedbackMethod"),Rn.feedbackMethod,t?.required)}))),Gl=d((({field:e,input:t})=>o(an,{label:"ФИО",..._n(e("fullName"),Rn.fullName,t?.required),...t}))),Xl=d((({field:e,input:t})=>o(an,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",..._n(e("generalSeniority"),Rn.generalSeniority,t?.required),...t}))),Jl=d((({field:e,input:t})=>{const{data:n}=xa("HOUSE_TYPE");return o(ya,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Zl=d((({field:e,input:t})=>{const n=i((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"ИНН",type:"number",maxLength:12,...t,..._n(e("inn"),Rn.inn,t?.required),onDaDataChange:n})})),Ql=d((({field:e})=>o(la,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),ei=d((({field:e,input:t})=>o(an,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,..._n(e("jobsNumber"),Rn.jobsNumber,t?.required),...t}))),ti=d((({field:e,input:t})=>o(an,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,..._n(e("lastJobExperience"),Rn.lastJobExperience,t?.required),...t}))),ni=d((({field:e,input:t})=>o(an,{label:"Наименование юридического лица",...t,..._n(e("legalEntityName"),Rn.legalEntityName,t?.required)}))),ai=d((({field:e,input:t})=>o(an,{label:"ОПФ",placeholder:"ООО, ПАО и др.",..._n(e("legalForm"),Rn.legalForm,t?.required),...t}))),li=[];async function ii(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:li}const ri=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:a}=qn("outServiceRegions",ii),i=a?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return l((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:i,..._n(e("localities"),Rn.localities,t?.required),isSearch:!0})})),si=d((({field:e,input:t})=>o(an,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",..._n(e("mandatoryIncome"),Rn.mandatoryIncome,t?.required),...t}))),oi=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],ci=d((({field:e,input:t})=>o(Nl,{orientation:"horizontal",items:oi,..._n(e("methodObtain"),Rn.methodObtain,t?.required)}))),di="middleName",mi=d((({field:e,input:t})=>o(an,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Kn(e,di),..._n(e(di),Rn.middleName,t?.required),...t}))),ui=d((({field:e,input:t})=>o(an,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Kn(e,t.name??""),..._n(e("name"),Rn.name,t?.required),...t}))),hi=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),pi=d((({field:e})=>En(e("acquiringType")?.value?.key)?o(hi,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),gi=d((({field:e,input:t})=>{const{data:n}=xa("ORGANIZATION_TYPE");return o(ya,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),fi=d((({field:e,input:t})=>{const n=i((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"Наименование организации",...t,..._n(e("organizationName"),Rn.organizationName,t?.required),onDaDataChange:n})})),xi=d((({field:e,input:t})=>o(an,{label:"Иные доходы",placeholder:"Введите значение",type:"number",..._n(e("otherIncome"),Rn.otherIncome,t?.required),...t}))),bi=d((({field:e,input:t})=>o(an,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",..._n(e("otherPayments"),Rn.otherPayments,t?.required),...t}))),yi=d((({field:e,input:t})=>o(Ga,{label:"Дата регистрации по месту жительства",..._n(e("participantDateRegistration"),Rn.participantDateRegistration,t?.required)}))),vi=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,a={..._n(e("partInBusiness"),Rn.partInBusiness,t?.required)};return o(an,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...a,...t,onChange:e=>a?.onChange&&a?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?a?.value:"",disabled:!n})})),Ni=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(an,{..._n(e("partnerComments"),Rn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),wi=[{id:"mir",text:"Карта МИР"},{id:"union_pay",text:"UnionPay"}],Ci=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("paymentSystem");return o(Nl,{label:"Платежная система",orientation:"horizontal",items:wi,value:n,onChange:e=>a?.(e),..._n(e("paymentSystem"),Rn.paymentSystem,t?.required)})})),ki=e=>"_"===e,Si=e=>/\d/.test(e),Ti=e=>ki(e)||Si(e),Ii=[..."+7 (___) ___-__-__"],Bi=Ii.findIndex(ki),Ri=Ii.map(((e,t)=>Ti(e)?Ii.slice(0,t).filter(Ti).length:-1));function Pi(e){const t=e.replace(/\D/g,""),n=Ii.map(((e,n)=>Si(e)?e:t.charAt(Ri[n])||e)),a=Ri.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Bi,a)):n).join("")}const Di=d((({children:e,onChange:t,...n})=>{const a=i((e=>t&&t(Pi(e))),[t]),l=i((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),Mi=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Di,{"aria-label":t,label:$t({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),Xt(n)]}))),_i=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Mi,{label:"Телефон",..._n(e(n),Rn.phone,t?.required),disabled:t?.filledByEsia&&Kn(e,n),...t})})),Ai=d((({field:e,input:t})=>{const{data:n}=xa("POSITION");return o(ya,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),zi=d((({field:e})=>En(e("acquiringType")?.value?.key)?o(hi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ei=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:Fi(t?.productList),...Mn(e("product"),Rn.product)}))),Fi=e=>(e??[]).map((e=>({key:e,value:e})));function Vi(e="/api/v1/regions"){const{data:t}=qn(e,st);return Array.isArray(t)?t:[]}const Oi=d((({field:e,input:t,url:n})=>{const a=Vi(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>a?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[a]),..._n(e("region"),Rn.region,t?.required)})})),Li=d((({field:e,input:t})=>{const n=Wn(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:a,..._n(e("region"),Rn.region,t?.required)})})),qi=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:l,renderFoldButton:r})=>{const[s,o]=a(n),d=i((()=>{o((e=>!e))}),[]),m=l({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const ji=d((({className:e="",isUnfolded:t,children:n})=>{const a=s(null),i=function(e,t){const n=s(null);return l((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:`transition-max-h duration-300 overflow-hidden ${a.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:n})})})),$i=d((({value:e,subText:t,children:n,isPhone:a,...l})=>{const i=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[i.length,n,t].every((e=>!e))?null:Ui({textItems:i,subText:t,children:n,isPhone:a,...l})})),Ui=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:l,className:i,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Wi(n,s),l?o(Me,{color:a,size:"text-m",children:l}):null]}),Wi=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${Hi(e)}`,children:e.trim()}):e.trim()},String(n)))),Hi=e=>e.replace(/\D/g,""),Yi=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Ki=e=>{const t=Xi(e);return o($i,{label:"Режим работы",value:t,className:"max-w-none"})},Gi=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Xi=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Gi({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Gi({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Ji=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Zi=e=>Ji.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),Qi=e=>{if(!e)return null;const t=er(e);return c(Yi,{className:"border-none",children:[o($i,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(tr)})}),o($i,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},er=e=>{const t=Ji.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},tr=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Me,{size:"text-xs",children:e})},String(n)),nr=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o($i,{label:"Валюта",value:e.currency}):null,t?o($i,{label:"Купить",value:String(t)}):null,n?o($i,{label:"Продать",value:String(n)}):null]},String(a)),ar={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"}},lr=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",ar[n].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(Me,{size:"text-m",color:ar[n].text,children:t})]}))),ir=(new Date).getDay(),rr=e=>{const[t]=e?.slice(ir-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:l,hasLunch:i}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[l?o(lr,{color:"green",children:l}):null,n&&i?o(lr,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(lr,{color:"red",children:"Выходной"})},sr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",or=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:l},i)=>o($i,{label:e,value:t&&n?n:"",subText:sr({lunchHour:a,hasLunch:l,status:t}),subColor:!t||l?"text-error":"text-green-dark"},String(i)),cr=["ArrowDownIcon","ArrowUpIcon"],dr=["Подробнее","Скрыть"],mr=({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:dr[Number(e)]}),o(W,{className:"text-primary-text",name:cr[Number(e)],width:"16",height:"16"})]}),ur=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,hr=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,pr=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,gr=({name:e,address:t,phone:n,fax:a,phoneBusiness:l,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=Zi(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(Me,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),rr(h)]}),o("div",{className:"hidden sm:block",children:fr({phone:n,fax:a,phoneBusiness:l,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(qi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ji,{isUnfolded:e,children:fr({phone:n,fax:a,phoneBusiness:l,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(u))},fr=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:l,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=Zi(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Yi,{className:"flex-wrap border-b border-solid border-main-divider",children:[o($i,{label:"Факс",value:t,isPhone:!0}),o($i,{label:"Телефон филиала",value:e,isPhone:!0}),o($i,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o($i,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o($i,{label:"Для консультаций по валютному контролю",value:i,isPhone:!0}),o($i,{label:"Контакт-центр",value:l,isPhone:!0})]}),r?.isMatchesPattern?o(Yi,{children:o($i,{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(or)})})}):c(Yi,{children:[o($i,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(tr)})}),Ki(d)]}),r?.businessScheduleVisibleTag?Qi(r?.businessScheduleDescription):null,s?.currencies?.length?o(Yi,{className:"flex-wrap",children:s?.currencies?.map(nr)}):null]})},xr=({name:e="",address:t="",workSchedule:n})=>{const a=(l=e)?`${l?.charAt(0)?.toUpperCase()}${l?.slice(1)}`:"";var l;const i=`${t} ${(e=>{const t=Zi(e),n=e?Xi(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ur(n):pr(n,a):hr(n):null})(n)}`;return{header:a,body:i}},br=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),yr=d((({children:e})=>br?e:null)),vr=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),Nr="/icons/MapMarkerClusterIcon.svg",wr="/icons/MapMarkerClusterYellowIcon.svg";function Cr({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const l=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),i=kr("offices",e,l);if(n.length&&n.every((e=>"type"in e))){const a=kr("workplaces",e,l),r=Sr(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Sr(n.filter((e=>"offices"===e.type)),"offices",e);i.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(i)}else{const a=Sr(n,"offices",e);i.add(a),t.geoObjects.add(i)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const kr=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Nr:wr,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Sr=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?Nr:wr,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Tr={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Ir={...Tr,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Br=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Ir).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Rr=e=>globalThis[e],Pr=(e,t)=>{const n=document.getElementById(t);if(n){const t=Rr(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Rr(e))}))}))}return new Promise(((n,a)=>{const l=document.createElement("script");l.src=t,l.async=!0,l.id=t,l.addEventListener("load",(()=>{n(Rr(e))})),l.addEventListener("error",(e=>{a(e)})),document.head.appendChild(l)}))};const Dr=()=>function(e,t,n=!0){const[i,r]=a(void 0);return l((()=>{let a=!0;return Pr(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),i}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${_.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Mr={...Tr,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},_r=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(Mr).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Ar=[55.753995,37.614069],zr=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:i})=>{const r=s(null),d=Dr();if(l((()=>{r.current?Cr({yandexMaps:d,map:r.current,points:e,isLoad:a}):d?.ready((()=>{r.current||(r.current=new d.Map("map",{center:Er(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Cr({yandexMaps:d,map:r.current,points:e,isLoad:a})}))}),[d,e,n,a,i]),l((()=>{r.current&&i&&d?.geocode(i).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[i]),!d)return null;const m="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[a?o(vr,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",m),children:[o(_r,{yandexMaps:r}),o(_r,{yandexMaps:r,direction:"out"})]}),Br(r,d,u("right-2 top-80",m))]})})),Er=e=>{const t=[Vr(Fr(e,0)),Vr(Fr(e,1))];return t.every((e=>e))?t:Ar},Fr=(e,t)=>e.map((e=>e.coords?.[t])),Vr=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Or={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Lr={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},qr={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)};function jr({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const $r={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"},Ur={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Wr=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(jr(e))}),{className:a,version:l="primary",active:i,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":i,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},i||r?"":u($r[l],Ur[l]),a),type:s,role:d,onClick:m,children:e})})),Hr=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Yr=(e,t,n)=>{const a=Hr("all"===t),l=Hr("business"===t),i=(e,t,a)=>{const l=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),l},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Wr,{"data-id":"all",onClick:t=>i(t,"all",e),version:a,children:"Для физических лиц"}),o(Wr,{"data-id":"business",onClick:t=>i(t,"business",e),version:l,children:"Для юридических лиц"})]})},Kr=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Pe,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(Me,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Gr="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Xr=({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:l})=>{const i=a?5:6,r=(e||[]).map((e=>o(Qn,{text:l[e],...t(e)},e))),[s,d]=i>0?[r.slice(0,i),r.slice(i)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(qi,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Gr,children:s}),o(ji,{className:Gr,isUnfolded:e,children:d})]}),renderFoldButton:Jr(n,a)})}):null})},Jr=(e,t=!1)=>({isUnfolded:n,onToggle:a})=>c("div",{className:"flex space-x-lg",children:[t?o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:a}):null,o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Zr()})]}),Zr=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Qr=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),es=()=>{},ts=e=>"all"===e?"block":"hidden",ns=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:l=[],renderCard:i=es,renderRemoteWorkplaceCard:r=es,getBalloon:s=es,getBalloonRemoteWorkplaces:d=es,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=Et(Or),{filteredItems:b,points:y,filteredRemoteWorkplaces:v,lengthItems:N}=rs({data:t,remoteWorkplaces:l,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),k={filters:ls([...t,...l]),field:{field:f,reset:x},onlyOffice:p,labels:Lr};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Qr(h,N),m?Kr(m):null,p&&Yr(t,w,C),o("div",{className:u("pb-3xl",ts(w)),children:Xr(k)})]}),o("div",{className:"h-[600px]",children:o(yr,{children:o(zr,{points:y,isLoad:n,className:"h-full"})})})]}),c(yr,{children:[b.map(i),v.map(r)]})]})})),as=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>qr[t](e)))))},ls=e=>Object.keys(Or).filter((t=>e.filter((e=>qr[t](e))).length)),is=()=>{},rs=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=is,getBalloonRemoteWorkplaces:l=is})=>{const[i,s,o,c]=r((()=>{const i=as(e,n),r=as(t,n),s=[...i.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:l({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[i,s,r,i.length+r?.length]}),[e,t,n,a,l]);return{filteredItems:i,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},ss=d((({field:e,input:t})=>{const n=e("regionRetail"),a=e("addressRetail"),i=Wn(),r=n?.value?.key,s=i.find((({region:e})=>e===r)),d=!i,m=n?.value?.text,u=Wn()?.find((e=>e?.region===m))?.branches;l((()=>{""!==n?.value?.key&&e?.("addressRetail")?.onChange?.("")}),[n?.value]);const{points:h}=rs({data:s?.branches||[],filtrationState:{},getBalloon:xr}),p=Boolean(n?.value?.key);return c("div",{children:[o(hn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:(u||[]).map((({address:e=""})=>({key:e,text:e}))),..._n(e("addressRetail"),Rn.addressRetail,t?.required&&p),isSearch:!0}),o("div",{className:"h-[600px]",children:o(yr,{children:o(zr,{points:h,isLoad:d,className:"h-full",selectedAddress:a?.value?.text})})})]})})),os=d((({field:e,input:t})=>{const n=Wn();return o(hn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:r((()=>n?.map((({region:e=""})=>({key:e,text:e})))),[n]),..._n(e("regionRetail"),Rn.regionRetail,t?.required)})})),cs=d((({field:e,input:t})=>o(an,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",..._n(e("retirementIncome"),Rn.retirementIncome,t?.required),...t}))),ds=d((({field:e})=>{const t=e("secondaryPhone");return o(Mi,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Mn(t,Rn.secondaryPhone):t})})),ms=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Hl,..._n(e("serviceDirection"),Rn.serviceDirection,t?.required)}))),us=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],hs=d((({field:e,input:t})=>o(Nl,{label:"Пол",orientation:"horizontal",items:us,..._n(e("sex"),Rn.sex,t?.required)}))),ps=d((({field:e,input:t})=>o(la,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",..._n(e("shareholderFlg"),Rn.shareholderFlg,t?.required)}))),gs=d((({children:e,onChange:t,...n})=>{const a=i((e=>t&&t(_a(e,"___-___-___ __"))),[t]),l=i((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),fs=d((({className:e,label:t,value:n,error:a,onChange:l,onBlur:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gs,{"aria-label":t,label:$t({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:l,onBlur:i,placeholder:"___-___-___ __"}),Xt(a)]}))),xs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(fs,{label:"СНИЛС",..._n(e("snils"),Rn.snils,!!n&&t?.required),...t})})),bs=d((({field:e,input:t})=>o(an,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Kn(e,"surname"),..._n(e("surname"),Rn.surname,t?.required),...t}))),ys=["От 1 мес","До 15 лет"],vs=d((({field:e})=>o(ua,{title:"Срок, месяцев",items:ys,min:1,max:180,...e("term")}))),Ns=d((({field:e,input:t})=>o(an,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",..._n(e("totalIncome"),Rn.totalIncome,t?.required),...t}))),ws=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:Wl,..._n(e("serviceType"),Rn.serviceType,t?.required)}))),Cs=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],ks=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return l((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(vl,{className:"whitespace-normal",orientation:"horizontal",items:Cs,value:t,onChange:e=>n&&n(e)})})}));const Ss={$ref:"/wcms-resources/outservice-productlist.json"},Ts=(e,t,n=!1)=>(a,l)=>{const i="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(bs,{field:e,input:a}),name:o(ui,{field:e,input:a}),middleName:o(mi,{field:e,input:a}),phone:o(_i,{field:e,input:a}),organizationPhone:o(_i,{field:e,input:a}),email:o(Fl,{field:e,input:a}),fullName:o(Gl,{field:e,input:a}),inn:o(Zl,{field:e,input:a}),legalForm:o(ai,{field:e,input:a}),organizationName:o(fi,{field:e,input:a}),generalSeniority:o(Xl,{field:e,input:a}),lastJobExperience:o(ti,{field:e,input:a}),experience5Years:o(jl,{field:e,input:a}),jobsNumber:o(ei,{field:e,input:a}),beginDate:o(Xa,{field:e,input:a}),addressFact:o(Yn,{field:e,input:a}),organizationAddress:o(Gn,{field:e,input:a}),comment:o(il,{field:e,input:a}),addressBranch:o(Hn,{field:e,input:a,isPremium:i}),sex:o(hs,{field:e,input:a}),birthday:o(Za,{field:e,input:a,isRetailForm:n}),birthPlace:o(el,{field:e,input:a}),desiredMeetingDate:o(Tl,{field:e,input:a}),product:o(Ei,{field:e,source:Ss}),localities:o(ri,{field:e,input:a}),isClient:o(Ql,{field:e}),partnerComments:o(Ni,{field:e,input:a}),collectionCount:o(ll,{field:e,input:a}),acquiringType:o(zn,{field:e,input:a}),onlineCheckout:o(pi,{field:e}),posTerminal:o(zi,{field:e}),serviceType:o(ws,{field:e,input:a}),term:o(vs,{field:e}),amount:o(fa,{field:e}),annualRevenue:o(Na,{field:e,input:a}),vedTypes:o(ks,{field:e}),feedbackMethod:o(Kl,{field:e,input:a}),serviceDirection:o(ms,{field:e,input:a}),bankEmpolee:o(ka,{field:e}),secondaryPhone:o(ds,{field:e}),consentToReceiveMaterials:o(xl,{field:e,input:a}),processPersonalDataFlg:o(xl,{field:e,input:a}),consentProviderFlg:o(xl,{field:e,input:a}),consentOthersFlg:o(xl,{field:e,input:a}),consentInformFlg:o(xl,{field:e,input:a}),consentPfrFlg:o(xl,{field:e,input:a}),applicationDate:o(an,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:i?o(Li,{field:e}):o(Oi,{field:e,input:a,url:Ot(t)}),education:o(El,{field:e,input:a}),housing:o(Jl,{field:e,input:a}),employment:o(Ll,{field:e,input:a}),organization:o(gi,{field:e,input:a}),amountWorkers:o(va,{field:e,input:a}),employerActivities:o(Vl,{field:e,input:a}),employerOrganization:o(Ol,{field:e,input:a}),positionOrganization:o(Ai,{field:e,input:a}),familyStatus:o(Ul,{field:e,input:a}),children:o(nl,{field:e,input:a}),familyMembers:o($l,{field:e,input:a}),dependents:o(Sl,{field:e,input:a}),totalIncome:o(Ns,{field:e,input:a}),expenses:o(ql,{field:e,input:a}),snils:o(xs,{field:e,input:a}),conscription:o(sl,{field:e,input:a}),armyIdFlg:o(wa,{field:e,input:a}),dulSerie:o(_l,{field:e,input:a}),dulNumber:o(Ml,{field:e,input:a}),dulIssueDateField:o(Rl,{field:e,input:a}),dulSubdivisionCode:o(zl,{field:e,input:a}),dulIssuedBy:o(Dl,{field:e,input:a}),addressRegistration:o(Gn,{field:e,input:a}),addressCourier:o(Gn,{field:e,input:a}),participantDateRegistration:o(yi,{field:e,input:a}),retirementIncome:o(cs,{field:e,input:a}),otherIncome:o(xi,{field:e,input:a}),mandatoryIncome:o(si,{field:e,input:a}),otherPayments:o(bi,{field:e,input:a}),disablePeopleFlg:o(Il,{field:e,input:a}),bankruptcyFlg:o(Sa,{field:e,input:a}),shareholderFlg:o(ps,{field:e,input:a}),legalEntityName:o(ni,{field:e,input:a}),creditInRshbCd:o(bl,{field:e,input:a}),bankEmployeeCode:o(Ca,{field:e,input:a}),partInBusiness:o(vi,{field:e,input:a}),regionRetail:o(os,{field:e,input:a}),addressRetail:o(ss,{field:e,input:a}),addressMatch:o(ia,{field:e,input:a}),paymentSystem:o(Ci,{field:e,input:a}),currency:o(Cl,{field:e,input:a}),cardCategory:o(tl,{field:e,input:a}),codeWord:o(al,{field:e,input:a}),confirmationIncome:o(rl,{field:e,input:a}),methodObtain:o(ci,{field:e,input:a}),deliveryDate:o(kl,{field:e,input:a})};return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})?o("div",{children:r[a?.name||""]},String(l)):null},Is=e=>2===e?"@xl:grid-cols-2":"",Bs=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,Rs=d((function({responseType:e,typeForm:t}){const n="OK"===e,a=n?"ResponseOKIcon":"ResponseFailIcon",{close:l}=de(),r=i((()=>{l()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(pl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:a,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Wr,{type:"button",onClick:r,children:"Хорошо"})]})})})),Ps=e=>{const{open:t,close:n}=de();return{open:(n,a={})=>t(o(Rs,{...e,...n}),a),close:n}},Ds=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Ms=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:l,term:i,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:l,amount:i,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${En(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${i}/Срок=${l}/Выручка=${r}`})(e):null,u={...d,...As(o),..._s(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},_s=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},As=e=>e?{vedTypes:Object.fromEntries(Cs.map((({id:t})=>[t,t===e])))}:{},zs={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:An[0],serviceType:Wl[0],feedbackMethod:Yl[0],serviceDirection:Hl[0],vedTypes:Cs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},Es=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),Fs=(e,t)=>o(Wr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Vs=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Qn,{...e}),o(Es,{link:t})]}),Xt(Mn(e,Sn).error)]}):o(Es,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Fs(n)]}),Os={send:async function(e,t=!1){const{typeForm:n,region:a,phone:l="",email:i,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Nt(a,g),...wt(i,g),...yt(l),...vt(s,"desiredMeetingDate"),...g?vt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ct(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Ls=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],b=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||zs[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Wl[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[y,v]=a(""),w=Ps({typeForm:n}),C=i((async(e,t)=>{const n=qs(x,e),a=Ds(Dn(n));if(!pn(a(e)))return console.warn("validation fail");const l=Ms({...e,...h}),i=await Os.send(l,"lead"===m)?"OK":"Fail";if(v(i),i&&w.open({responseType:i}),"OK"===i&&g){const e=At();kt({aspectsAttributes:g,aspects:e,ev:t})}return i}),[]),[,{field:k,onSubmit:S,reset:T}]=Et(b,{onSubmit:C}),I=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return l((()=>{"OK"===y&&(v(""),T())}),[y]),c(Vt,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:S,children:[r.map(((e,t)=>c("div",{className:u(Is(e.columns),"grid gap-x-m"),children:[Bs(e.title),(e?.inputs||[])?.map(Ts(k,n))]},`section-${t}`))),Vs(I?k("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(N,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(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]})})),qs=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const a=t?.[e?.condition?.name??""];return n===(a?.key??a)}))));function js(e){const[t,n]=a(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,i((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const $s=d((({inputs:e=[],typeForm:t="",field:n,key:a})=>{const l=e.every((e=>Boolean(n(e.name).value))),i=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Mn(n(e?.name),Rn[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(qi,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:a})=>o(ji,{isUnfolded:a,className:"flex flex-col pl-2xl",children:e.map(Ts(n,t))}),renderFoldButton:Us(c("div",{children:[o(Qn,{value:l,onChange:t=>{for(const a of e){const e=n(a.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},a),Xt(i?"Отметьте все обязательные соглашения":"")]}))})})})),Us=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),Ws=({field:e,typeForm:t="",inputs:n,isRetailForm:a=!1})=>{const{consentInputs:l,restInputs:i}=Hs(n||[]);return l.length>2?c("div",{children:[i.map(Ts(e,t,a)),o($s,{inputs:l,field:e})]}):(n||[])?.map(Ts(e,t,a))},Hs=e=>({consentInputs:e?.filter((e=>Object.keys(ol).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ol).includes(e.name||"")))||[]}),Ys={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:An[0],serviceType:Wl[0],feedbackMethod:Yl[0],serviceDirection:Hl[0],vedTypes:Cs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:""},Ks=(e,t,n="")=>{if(t){const e={...t};return e.birthday=new Date(e?.birthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Ys[e.name||""]]))),typeForm:{key:n,text:""}}},Gs=(e,t)=>o(Wr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Xs=e=>cl("/user-data/updateUserProfile","PUT",e),Js=e=>cl("/user-data/updateUserTask","PUT",e),Zs={width:"118",height:"24"},Qs={"bg-white":"color",transparent:"white"},eo={"bg-white":"text-primary-main",transparent:"text-white"},to=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Qs[e]},className:eo[e],width:n?.width,height:n?.height}),no={"bg-white":"text-primary-text",transparent:"text-white"},ao=d((({className:e,href:t="/",logo:n,children:a,targetBlank:l,bgColor:i="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:l?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...pe(s),children:[to(i,n?.image,Zs),r?a??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:no[i],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),lo=async({code:e,setHasError:t,close:n,sendCode:a=Ut})=>{const l=await(i={captchaText:e},cl("/sms/checkCaptcha","POST",i));var i;"ERROR"===await l.text()?t(!0):(a(),n?.())},io=async(e,t)=>{const n=await(e=>cl(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET"))(t);e(URL.createObjectURL(await n.blob()))},ro=d((({phoneNumber:e,close:t,sendCode:n,onClose:i})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1);return l((()=>{io(s,e)}),[]),o(pl,{head:o(ao,{}),onClose:i,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:()=>io(s,e),className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Yt,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Wr,{onClick:t,version:"secondary",children:"Вернуться"}),o(Wr,{type:"submit",disabled:!d,onClick:()=>lo({code:d,setHasError:h,close:t,sendCode:n}),version:"secondary",children:"Отправить"})]})]})})})),so=d((({time:e,setTime:t,className:n})=>(l((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:oo(e)})))),oo=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,co=async({phoneNumber:e,captchaDialog:t,setTimeNextReq:n,setIsTimerStarted:a,setAttemps:l})=>{try{await(i={phoneNumber:e,smsCodesSetName:{key:"AUTHENTICATION"}},cl("/sms/sendCode","POST",i)).then((t=>{if("string"!=typeof t&&t.errorMessage&&t.errorMessage.startsWith(`Too many request for phoneNumber [${e}]`))throw t})),l(0),n(180),a(!0)}catch(e){t.open()}var i},mo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);l((()=>{u.current?.[d]?.focus()}),[d]);const h=i((n=>a=>{const{value:l}=a.currentTarget,i=l.slice(0,1);t(e.map(((e,t)=>t===n?i:e))),m(n+1)}),[e]),p=i((n=>a=>{const{key:l}=a;if("Backspace"===l&&!e[n]){const a=n>0?n-1:e.length-1,l=e.map(((e,t)=>t===a?"":e));t(l),m(a)}}),[e]),g=i((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),l=e.map(((e,t)=>t<a.length?a[t]:e));t(l),m(l.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:uo(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),uo=(e,t,n=!1)=>{const a=!t[e];return`w-16 h-20 text-3xl text-center p-2 m-2 border ${n&&a?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},ho=d((({isDisabled:e,onClick:t,text:n})=>o(Wr,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-medium",children:n})}))),po=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},go=({close:e,values:t})=>{const[n,s]=a(!1),[o,c]=a(""),[d,m]=a(!1),[u,h]=a(0),[p,g]=a(!1),[f,x]=a(0),b=i((()=>{s(!1),c("")}),[]),y=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||y),[t]),N=i((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>cl("/sms/checkCode","POST",e).then(po))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),b(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return l((()=>{y?(s(!0),c("Код просрочен")):s(!1)}),[y]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},fo=d((({close:e=Ut,onClose:t=Ut,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=a(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:b,isLoading:y,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=go({values:p,close:e}),T=i((()=>{co({phoneNumber:h,captchaDialog:I,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S})}),[]),I=((e,t)=>{const{open:n,close:a,closeAll:l}=de();return{open:()=>n(o(ro,{close:a,onClose:t,...e})),close:a,closeAll:l}})({phoneNumber:h,sendCode:T},t);return l((()=>{T()}),[]),o(pl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"S",isEmbedded:!0}),d?o(mo,{values:p,setValues:g,errorText:b,hasError:x}):null,bo(v,w,T),o(Pe,{itemSize:"list-s",__html:s}),xo(u,N,f),y?o(vr,{blur:!1}):null]})})})),xo=(e,t,n)=>e?o(ho,{isDisabled:t,onClick:n,text:e}):null,bo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-primary-main",children:["Получить новый код можно через",o(so,{className:"text-primary-main ml-1",time:e,setTime:t})]}):o(ye,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),yo=()=>{const{open:e,close:t}=de();return{open:(n,a)=>e(o(fo,{onClose:t,close:n,...a})),close:t}},vo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},No={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},wo=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,l]=a(""),[r,s]=a(!1),{open:d,close:m}=de(),u=Ce(),h=i((()=>{m(),e(n)}),[n]),p=i((e=>{l(e),"REFUSE"===e&&s(!0)}),[]),g=r?No:vo;return o(pl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>gl(d,ko,u),children:o(N,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(w,{align:"text-center",children:g.description}),o(vl,{className:"whitespace-normal",orientation:"horizontal",items:Co,value:n,onChange:p}),o(Wr,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Co=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],ko=2,So=e=>{const{open:t,close:n}=de(),a=yo(),l=(t,l)=>async i=>{n(),"SIGNED"===i&&t?a.open((t=>async n=>{t&&await Xs({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(l),To(t)):e()};return{open:(n,a)=>t(o(wo,{handleSubmit:l(n,a),onClose:e}))}},To=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Io=d((function({handleClose:e}){const t=i((async()=>{const e=await(t={redirectUri:globalThis.location.href},cl("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(pl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(Wr,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Wr,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Bo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Ro={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Po={mandatoryIncome:"INCOME_AVERAGE",otherPayments:"MANDATORY_PAYMENTS"},Do=e=>Object.entries(e).reduce(((e,[t,n])=>t in Bo?[...e,{contactTypeCd:{key:Bo[t]},value:n}]:e),[]),Mo=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Ro){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Ro[t]},...a}]}return e}),[]),_o=e=>Object.entries(e).reduce(((e,[t,n])=>t in Po?[...e,{incomeTypeCd:{key:Po[t]},value:n}]:e),[]),Ao=({inputs:e,programId:t,nextStepLink:n,saveForm:l})=>{const[r,s]=a(""),[,c]=js("taskId"),[,d]=js("profileId"),[,m]=js("participantId"),u=(e=>{const{open:t,close:n}=de(),a=i((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(Io,{handleClose:a}),e),close:n}})(n),h=So(u.open),p=yo(),g=i(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:i((async n=>{const a=Ds(Dn(e));if(!pn(a(n)))return console.warn("validation fail");try{const{profile:{id:e}}=await(i={profile:{phone:bt(n.phone)}},cl("/public-data/createUserProfile","POST",i));if(e&&n?.phone){const a=async()=>{try{await zo({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:l}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},i=Object.keys(ol).filter((e=>n[e])).map((e=>ol[e]?.text));p.open(a,Eo(n?.phone,i))}}catch{s("Fail")}var i}),[]),responseStatus:r}},zo=async({programId:e,profileId:t,formData:n,saveUserData:a,saveForm:l})=>{const i=Vo(n);await Xs(((e,t)=>{const{name:n="",surname:a="",middleName:l="",birthday:i="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:a,midname:l,birthDate:i&&xt(i,!0),email:s,phone:bt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,i));const{taskId:r,participantId:s}=await(o={profileId:t,programId:e},cl("/user-data/createDraftTask","POST",o));var o;await Js((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:l,surname:i,middleName:r,birthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&xt(s,!0),id:e,midname:r,name:l,surname:i,profile:{id:n},participantContacts:Do({phone:o&&bt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:i})),a(s,r,t),l(n)},Eo=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${Fo(t)}`}),Fo=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Vo=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Oo=e=>{const{profile:t,addInfo:n,document:a,addressRegistration:l,addressFact:i}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Pi(t?.phone),email:t?.email,dulIssueDateField:a?.dulIssueDate,dulIssuedBy:a?.dulIssuedBy,dulNumber:a?.dulNumber,dulSerie:a?.dulSerie,dulSubdivisionCode:a?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Lo(l),addressFact:Lo(i),esiaAccountTypeCd:t?.esiaAccountType}},Lo=e=>{const{postcode:t,region:n,regionCode:a,locality:l,city:i,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,l||i,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},qo=e=>{const[t,n]=a(!1),[r]=js("profileId"),[s,o]=js("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=i((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},cl("/esia/updateProfileEsia","POST",t));o({...s,...Oo(n)}),globalThis.location.href=e}var t}),[]);return l((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},jo=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=a(""),{isLoading:g}=qo(i),[f,x]=js("leadForm"),b=Ks(m,f),{handleSubmit:y,responseStatus:v}=Ao({inputs:m,programId:n,nextStepLink:i,saveForm:x});if(v){Ps({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=Et(b,{onSubmit:y});return l((()=>{"OK"===h&&(p(""),C())}),[h]),o(Vt,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(vr,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Is(e.columns),"grid gap-x-m"),children:[Bs(e.title),Ws({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),Gs(s)]})})})),$o=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(Pe,{__html:e}),a?.text?o(ye,{className:"text-primary-main",children:a.text}):null]})]}))),Uo=d((({interval:e=0,title:t,__html:n})=>{const[l,i]=a(e),r=100-(e-l)/e*100;return c("div",{children:[t?o(k,{title:t,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${r}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(so,{interval:e,time:l,setTime:i})})]}),n?o(Pe,{__html:n}):null]})]})})),Wo=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:l,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(Ho,{title:a,items:l}),o(Ho,{title:i,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Wr,{className:"w-full mt-lg",children:s}):null]}))),Ho=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Yo(e)},t)))}):null]})]}):null},Yo=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Ko=d((({title:e,description:t})=>{const n=Ce();return 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(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Go=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Xo=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Jo(e,{sensitivity:t,rootRef:n}={}){const a=s(null),i=r((()=>({threshold:Zo(t),root:n?.current})),[t,n?.current]);return l((()=>{if(!a.current)return;const t=new IntersectionObserver(e,i);return t.observe(a.current),()=>{t.disconnect()}}),[e,i]),a}function Zo(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Qo=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:l,children:r,onIntersection:s})=>{const c=Jo(i((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),l);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:c,role:"listitem",children:r})})),ec=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],tc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:l=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},b=s([]),y=i(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(ac(n))}),[g,f]),v=l>0?r*Number(l)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?nc(c,v):{},...N?Xo(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(Qo,{className:u(m,l?ec[l-1]:"",{"h-full":N},t),style:w?nc(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:y,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),nc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),ac=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),lc={"horizontal-list":"w-6","vertical-list":"h-6"},ic=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,l)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",l===e?lc[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(l)},String(l)),rc=({activeIndex:e,onClick:t})=>(n,a)=>{const l=a===e,i=l?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=l?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=l?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",i),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},sc=e=>e,oc=(e=sc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),cc=oc(),dc=(e=sc)=>oc((t=>-e(t))),mc=dc(),uc=e=>t=>e.scrollWidth/t,hc=e=>(t,n)=>{e.scrollBy({left:n*uc(e)(t),behavior:"smooth"})},pc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[l,r]=a([]),o=i((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=l.length?[dc()(l),oc()(l)]:[-1,-1],m=c>0,u=d<e-1,h=i((()=>{var t;n.current&&(m?hc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{n.current&&(u?hc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},gc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},fc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=pc({itemCount:s.length}),g=xc(Boolean(s?.length));l((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=i((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(tc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(rc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",gc[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(ic({activeIndex:t,onClick:f,listType:a}))}):null})),xc=(e=!1)=>({behavior:e?"auto":"smooth"}),bc=d((({className:e,disabled:t,...n})=>o(ye,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,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"})}))),yc=d((e=>o(bc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),vc=d((e=>o(bc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Nc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",wc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:l})=>{const{canScrollLeft:i,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!l;return c("div",{className:e,children:[n?Cc(t):null,i?o(yc,{className:u(kc(l),m?"left-1":"left-0"),onClick:s}):null,r?o(vc,{className:u(kc(l),m?"right-1":"right-0"),onClick:d}):null]})})),Cc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Nc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Nc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),kc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Sc=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:l=1,listType:i="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const b=Array.isArray(g)?g.length:0,[y,v]=pc({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===i?"relative h-full":""),children:[o(tc,{containerRef:y,activeIndex:N,visibleItemCount:l,gap:n,padding:a,listType:i,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(wc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(fc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:i,version:t,navButtons:x,containerRef:y,containerScroll:v})]})})),Tc=({blocksToRender:e,...t})=>o(Sc,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Go(!0)),children:I(e,t)},String(n))})}),Ic=e=>e%2!=0,Bc=d((({textNode:e,iconNode:t,tag:n,onClick:a,justifyContent:l="between",className:i,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===l?"justify-between":"justify-center",i),onClick:a,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Rc=d((({className:e="",label:t,icon:n,dataTheme:a="pc",disabled:l=!1,onClick:i})=>o(Bc,{tag:"button",onClick:i,disabled:l,"data-theme":a,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",l?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Me,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Pc=({isUnfolded:e,onToggle:t})=>o(Rc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Dc=["ArrowDownIcon","ArrowUpIcon"],Mc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",_c=({topItemsCount:e=0,label:t="",block:n,blocksToRender:a=[],...l})=>{const[i,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]];return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Mc),children:[R(i,{...l.options,parent:n}),Ic(i.length)?o(gt,{className:"col-span-6",...l}):null]}),o(qi,{renderFoldableSection:({isUnfolded:e})=>c(ji,{className:u(Mc),isUnfolded:e,children:[R(r,{...l.options,parent:n}),Ic(r.length)?o(gt,{className:"col-span-6",...l}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(Rc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Dc[Number(n)],dataTheme:l.options?.page?.colorPalette,onClick:a})})]})},Ac=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[zc(n,t),_c({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[zc(n,t),Tc({...a,blocksToRender:t})]});default:return null}})),zc=(e,t)=>e&&!t.length?o(Ko,{...e}):null,Ec=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Fc=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(hi,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const l=e?.includes(n);t(a?l?(e||[]).filter((e=>e!==n)):[...e||[],n]:l?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),Vc=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:l})=>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,Ec(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Oc(a)).filter(Boolean))]}),n?o("div",{children:o(Wr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:l,children:n?.text})}):null]}))),Oc=e=>([t,n])=>{const a=n?.type;return"array"===a?Lc(t,e)(n):null},Lc=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Me,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Fc,{items:a,multiple:!n?.single,...t(e)})]},e)};function qc(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const jc=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,$c=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>jc(t[e])||jc(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>jc(t[e])||jc(n[e])||Uc(t[e])<=Uc(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>jc(t[e])||jc(n[e])||Uc(t[e]?.min)>=Uc(n[e]?.min)&&Uc(t[e]?.min)<=Uc(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>jc(t[e])||jc(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>jc(t[e])||jc(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Uc=e=>Number(e||0),Wc=(e,{block:t,page:n,normalize:a=zt})=>{const l=t?.blocks||[],[i,{field:s,reset:o,update:c}]=Et(e),d=r((()=>qc(l,l.map((e=>mt(e.content,n?.fallback))))),[l,n?.fallback]),m=i===e?l:((e,t)=>(n=zt)=>e?.filter((([,e])=>$c(t,n(e)||{}))).map((([e])=>e)))(d,i)(a);return[i,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Hc={},Yc={},Kc=ht((({className:e,filtrationSchema:t=Hc,consumerField:n={},resetButton:a,...l})=>{const[,{blocksToRender:i},{field:r,reset:s}]=Wc(Yc,{block:l.block,page:l.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:Gc(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Gc(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Vc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Wr,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(Ac,{blocksToRender:i,...l})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Gc=e=>qc(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Xc=(e=!1)=>e?"text-left":"text-center",Jc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Zc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:a,icon:l,...i})=>{const r=String(a?.width||t);return l?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Jc[n],e),children:o(W,{...i,width:"54%",height:"54%",name:l})}):null})),Qc=d((({className:e="",title:t,benefitList:n,...a})=>{const l=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Xc(l),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(ed)}):null]})})),ed=({label:e,description:t,__html:n,icon:a,isDotted:l=!1,iconBgVersion:i},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Zc,{className:"shrink-0",iconBgVersion:i,...a}):null,a?.src?o(ne,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Me,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Pe,{__html:n,isDotted:l,itemSize:"list-s"}):null]}):null]},String(r)),td=e=>({icon:t,title:n,description:a},l)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!a&&!n}),children:[n?o(Me,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(Me,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(l)),nd=(e,t,n)=>o("div",{className:`grid gap-2xs ${ad(t)}`,children:e.map(td(n))}),ad=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},ld=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:l,title:i,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:i,description:l,headlineVersion:"M"}),e?.length?nd(e,a,t):null]}))),id={start:"justify-start",center:"justify-center",end:"justify-end"},rd=d((({buttons:e,className:t="",align:n,...a})=>{const l=n&&u("flex",id[n]);return o(g,{className:u("!bg-transparent",l,t),defaultPadding:"p-0",...a,children:Le(e)})})),sd=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),od="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",cd="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",dd="flex flex-col gap-y-xl min-w-52",md=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:l})=>o(Me,{size:"text-h3",children:"number"==typeof e?[a,Ue(t,{fixed:n})(e),l].filter(Boolean).join(" "):e}))),ud=d((({className:e,title:t,value:n,color:a="text-secondary-text",...l})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Me,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(md,{value:n,...l}):o(Me,{size:"text-h3",children:"-"})]}))),hd=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,pd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:l,isShowDepositeName:i,color:r="text-secondary-text"})=>c("div",{children:[o(Me,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Ue(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),l&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:l}):null]})]}))),gd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),fd=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:l="text-secondary-text",children:i,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(pd,{title:e,rate:t,unit:n,fractionDigits:a,color:l,...r})}),o(ud,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:l,...r}),i]}):o(gd,{title:e,...r}),xd=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ua,{items:e?[`От ${Ue(1)(a.min||0)} ${n}`,`До ${Ue(1)(a.max||0)} ${n}`]:[],step:t,...a}),bd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},yd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},vd=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[l,i]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:l=bd.prefMonthsNum,prefTravelBonusRate:i=bd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*n),a);return[c,c*l+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-l)]})(t||yd,n,a);return{...t,...e,monthBonus:l,yearBonus:i}},Nd=ht((({className:e="",title:t,calcSource:n,buttons:a,footnote:l,...i})=>{const[r,{field:s}]=Et({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=vd(r,n);return o(sd,{className:e,title:t,...i,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),xd({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?fd({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:dd,children:[f>=0?o(ud,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Le(a,{isVertical:!0}),hd(l)]})]})})})),wd=Math.round(29.5),Cd=(e,t=0)=>e?.sum?e.sum:t,kd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Sd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Td=({items:e,title:t,mobileTitle:n=t,orientation:a="horizontal",value:l,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Me,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Me,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(vl,{orientation:a,items:e,value:e[l?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Id=e=>Td({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Bd=" (c капитализацией)",Rd=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:l=[],isCapitalization:i=!1})=>c("div",{className:dd,children:[o(ud,{title:`Доход в конце срока${i?Bd:""}`,value:e,postfix:n,prefix:"+"}),o(ud,{title:`Сумма в конце срока${i?Bd:""}`,value:t,postfix:n}),Le(a,{isVertical:!0}),l?.map(hd)]}),Pd=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Dd([e,t],a),Dd=([e,t],n=[])=>({[e]:n.length?mc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?cc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Md=(e,[t,n],a)=>e>=a[t]&&e<=a[n],_d={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Ad={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},zd=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:l,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||l,o=n<90||n>730,c=function(e){const t=e?.rateType?_d[e?.rateType]:"",{data:n}=qn(t?`/api/v1/depositrates/${t}`:null,st);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Ed(s,e)&&Md(a,["minSum","maxSum"],e)&&Md(n,["minDays","maxDays"],e)))||Ad,{rate:m}=d,u=Fd(m,e),h=a+u,p=c||[Ad];return{...d,...Dd(["minSum","maxSum"],p),...Dd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Ed=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Fd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:l}=t;return n?Math.round(a*Math.pow((1200+e)/1200,l/30)-a):Math.round(a*e*l/365/100)},Vd=ht((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:l,isShowDepositeName:i,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=Et({moneyValue:Cd(r,1e5),daysValue:kd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=zd(m,s),{income:g,finalSum:f,rate:x,depositeName:b}=p;return o(sd,{className:e,title:t,...d,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(y={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ua,{items:[`От ${Sd(y.min||0)}`,`До ${Sd(y.max||0)}`],step:1,...y})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Od(p,h),Id({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),fd({rate:x,depositeName:b,isShowDepositeName:i}),Rd({income:g,finalSum:f,buttons:n,footnotes:[a,l]})]})});var y})),Od=(e,t)=>c("div",{className:"space-y-s",children:[o(Me,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Qn,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Qn,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Ld=(e=[],t=!1)=>qd([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),qd=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},jd=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ua,{items:[`От ${$d(e)}`,`До ${$d(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),$d=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ud=e=>Td({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Wd=({field:e,defParams:t,calcParams:n,map:a,monthsValue:l="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(sa(t?.[l],n.minMonths,n.maxMonths))},Hd=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:l,moneyExtra:i}=t;if(0===e)return 0;if(n){const t=e/1200;return i?(a+i)*(t+t/(Math.pow(1+t,l)-1)):a*(t+t/(Math.pow(1+t,l)-1))}return Math.round(a/l)+a*(e/1200)},Yd={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Kd=e=>Gd({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Gd({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Gd({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Gd({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Gd=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:l})=>!!n&&!n[l]||t[a]===e[a],Xd=(e,t,n)=>{const{moneyValue:a,monthsValue:l}=e,i=t?.rateRows||[Yd],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Kd({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Pd(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=Pd(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:l})=>e?.find((e=>Kd({row:e,userInputParams:t,paramsViewSettings:n})&&Md(a,["minSum","maxSum"],e)&&Md(l,["minMonths","maxMonths"],e)))||Yd)({rateRows:i,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:l}),{rate:u}=m,h=Hd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:l,monthlyPayment:h}},Jd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Zd={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Qd=ht((({className:e,title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,qd([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=Et({moneyValue:Cd(s,2e5),monthsValue:kd(s,wd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const b=Xd(g,n,r),y=Ud({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return l((()=>{v&&v(sa(g.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),l((()=>{N&&N(sa(g.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),l((()=>{!Jd(s)&&h&&Wd({field:f,defParams:h,calcParams:b,map:Zd,monthsValue:"minMonths"})}),[n,s]),o(sd,{className:e,title:t,...m,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...f("moneyValue"),value:b.moneyValue}),jd({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...f("monthsValue"),value:b.monthsValue}),em({...b,...r},f),o("div",{className:"sm:hidden",children:y})]}),c("div",{className:u(dd,"@4xl:w-1/2"),children:[o(ud,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ud,{title:"Ставка",value:b?.rate,fractionDigits:2,postfix:"%"}),o(ud,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:y}),Le(a,{isVertical:!0}),hd(i)]})]})})})),em=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Qn,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Qn,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Qn,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Qn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),tm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[l,i]=t[n];a>=l?t.splice(n-1,2,[e,Math.max(a,i)]):n++}return t},nm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},am=(e,t,n)=>{const{moneyValue:a,monthsValue:l}=e,i=t?.[0]?rm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[im({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),im({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),im({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),im({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Md(a,["minSum","maxSum"],t),Md(l||i,["minMonths","maxMonths"],t)].every(Boolean)))||nm,{rate:u}=m,h=lm(u,e),p=a+h,g=t||[nm];return{...m,...Dd(["minSum","maxSum"],g),...Dd(["minMonths","maxMonths"],g),availableMonths:tm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,l)=>t>=e?e+l*n:e-l*n)))(e,t))),...e,defaultMonth:i,income:h,finalSum:p}},lm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:l}=t;return n?Math.round(a*Math.pow((1200+e)/1200,l)-a):Math.round(a*e*30*l/365/100)},im=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],rm=(e,t)=>e+Math.round((t-e)/2),sm=(e="rub")=>"rub"===e,om=(e,t)=>{const{minMonths:n,maxMonths:a}=Dd(["minMonths","maxMonths"],um(t,e?.currency)),l=e.monthsValue||Math.round((n+a)/2);return{monthsValue:sa(l,n,a)}},cm=(e,t)=>{const{minSum:n,maxSum:a}=Dd(["minSum","maxSum"],um(t,e?.currency)),l=e.moneyValue||n;return{moneyValue:sa(l,n,a)}},dm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),mm=e=>{const t=sm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},um=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},hm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Td({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Td({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),pm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Id({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Td({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),pm(e.isShowNewClient),e.isShowNewClient?o(Qn,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},pm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,gm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},fm={text:"₽",key:"rub"},xm=ht((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[fm],g=i((e=>t=>e?{...t,...mm(t),...cm(t,e),...om(t,e),...dm(t,e)}:t)(h),[h]),[f,{field:x}]=Et({moneyValue:Cd(d,2e4),monthsValue:kd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:fm},{normalize:g}),b=x?.("currency")?.value??fm,y=x?.("isNewClient")?.value,v=um(h,b),N=am(f,v,s),{rate:w,income:C,finalSum:k,type:S=""}=N,T=i((()=>{Wd({field:x,defParams:Ld(v,y),calcParams:N,monthsValue:"minMonths",map:gm})}),[x,h]);l((()=>{!Jd(d)&&v&&T()}),[d,h]);const I=w===Ld(v,y)?.rate;return o(sd,{className:e,title:t,...m,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[c("div",{className:"flex gap-m",children:[xd({className:"w-full",title:`Сумма, ${b?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:b?.text,step:bm(b?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),jd({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),hm({...N,...s},x)]}),fd({rate:w,children:vm(T,I)}),Rd({income:C,finalSum:k,buttons:[...a,ym(n?.buttons,S)],footnotes:[r],postfix:b?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),bm=(e="")=>sm(e)?1e3:100,ym=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},vm=(e,t=!1)=>t?null:o(Wr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Nm=e=>wm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&wm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),wm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:l})=>!!n&&!n[l]||t[a]===e[a],Cm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},km=(e,t,n)=>{const{moneyValue:a,monthsValue:l,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[Cm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Pd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Pd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:l,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n})&&Md(a+r,["minSum","maxSum"],e)&&Md(i,["minSumOld","maxSumOld"],e)&&Md(r,["minSumExtra","maxSumExtra"],e)&&Md(l,["minMonths","maxMonths"],e)))||Cm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:l,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=h,g=Hd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:l,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:f}},Sm=ht((({className:e="",title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:i,...r})=>{const[s,{field:d}]=Et({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=km(s,n,i),h=Ud({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(sd,{className:e,title:t,...r,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),xd({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),jd({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Tm({...m,...i},d),m.isExtraMoney?xd({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(dd,"@4xl:w-1/2"),children:[o(ud,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ud,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(ud,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(ud,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Le(a,{isVertical:!0}),hd(l)]})]})})})),Tm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Qn,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Qn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Qn,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Im=d((e=>{const{onChange:t,min:n,max:a,defaultValue:l="0",fractionDigits:r=0,...s}=e,c=ra(e,{normalize:(e=l)=>n&&a?String(sa(Number(Bm(e)),n,a)):Bm(e),format:Ue(r)}),d=i((e=>t&&t(Bm(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),Bm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Rm=d((e=>o(Im,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),Pm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Dm={amount:1500},Mm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:i,formType:r="private",...s})=>{const[{amount:d},{field:m}]=Et(Dm),[h,p]=a(!1);return l((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{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:Pm[r],children:[o(Rm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),i?.text?o(Wr,{className:"w-full mt-lg",type:"submit",disabled:h,children:i.text}):null]})]})})),_m=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Am="relative h-full",zm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Em=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:l}=a.block||{},i=l?.some(Om),r=n?{defaultPadding:"p-6xl pb-m"}:{};return P({...a,renderProps:(n,a,l)=>c("div",{className:Fm(n,{someCardsHighlighted:i}),children:[I(n,a,{className:Vm(n,{someCardsHighlighted:i,showBorder:!e,cardSize:t}),...r,blockIndex:l}),Om(n)?_m({className:"absolute top-0 -right-4 z-40"}):null]},String(l))})},Fm=(e,{someCardsHighlighted:t})=>u(Am,t&&(Om(e)?"pt-3xl":"pt-3xl sm:pt-16")),Vm=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Am,"min-w-80",zm[a],t&&(Om(e)?"pt-3xl sm:pt-16":"pt-3xl"),Go(n),n&&"h-full"),Om=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Lm=ht((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:l=!0,cardSize:i="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Sc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:l?16:0,padding:0,arrowsPadded:a,navButtons:r?qm(s?.block?.blocks):[],hasBlur:!0,children:Em({noCardBorder:n,cardSize:i,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),qm=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],jm="z-10 border border-solid w-full h-full",$m=u(jm,"absolute hidden @xl:block border-transparent"),Um=d((({className:e,title:t,description:n,button:a,...l})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...l,children:c("div",{className:"relative h-full",children:[o("div",{className:u($m,"top-9 right-12 bg-green-dark")}),o("div",{className:u($m,"top-6 right-8 bg-green")}),o("div",{className:u($m,"top-3 right-4 bg-green-light")}),c("div",{className:u(jm,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Le([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Wm={black:"bg-black",white:"bg-white"},Hm=d((({className:e="",title:t,description:n,image:a,price:l,button:i,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Te,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:Le([i],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Me,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Ym)]}):null,l?c(Me,{size:"text-h3",align:"text-left",children:[l," ₽"]}):null]})}))),Ym=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Wm[e]}`},String(t)),Km=d((({icon:e,...t})=>{const n=ue(),{text:a,href:l,target:i,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:l,target:i,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Gm=d((({className:e,additionalDescription:t,description:n,links:a,title:l,...i})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...i,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:l,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?Xm(a):null]})}))),Xm=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Km,{...e},String(t))))}),Jm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),Zm=d((({className:e="",href:t,target:n,onClick:a,data:l,children:i})=>{const r=ue()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(l),children:i})})),Qm=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],eu=d((({className:e="",media:t,showButtonText:n,stretched:l,version:i="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:l}=e,{iconMapped:r}=(e=>Qm.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Oe(a)?a:r,c=n?{text:l}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&l&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??i}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},tu(l));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:Le(m,{className:nu(s??!1,l??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),tu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",nu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),au=d((({className:e,padding:t,description:n,additionalDescription:a,href:l,icon:i,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(Zm,{href:l,target:m,className:"h-full",data:Jm(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Oe(i)?o(ne,{image:i}):null,x),buttons:d.length?o(eu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Ve,{benefits:f}),s?o(Pe,{__html:s,isDotted:r,itemSize:"list-s"}):null,lu(a,p)]})})}))),lu=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,iu=(e,t)=>{const{title:n,description:a,buttons:l}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Me,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:a})}):null,l?.length?o("div",{className:"text-primary-main",children:Le(l)}):null]},String(t))},ru=d((({className:e="",title:t,align:n="text-center",icon:i,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(iu),[x,b]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[y,v]=a(!1);return l((()=>ce.subscribe("fold",(e=>{void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Oe(i)?o("div",{className:"self-center",children:o(ne,{image:i})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ye,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(qi,{renderFoldableSection:()=>c("div",{children:[x,o(ji,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?su(m?.parent,h,y):null}):o("div",{children:x})]})})),su=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ce.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?pe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),ou=d((({className:e,contacts:t,info:n,version:a="secondary",...l})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:a,...l,children:[n?.length?cu(n):null,t?.length?cu(t):null]}))),cu=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>du({column:e,i:t})))}),du=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:a},l)=>c("div",{children:[o(k,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(a?.text)}),children:Le([a])})]},String(l))))},`col-${String(t)}`):null,mu=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),uu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(mu,{step:a,showPercentage:!1})]})})}));var hu;!function(e){e.process="IN_PROCESS",e.ok="OK",e.fail="FAILED",e.rework="REWORK"}(hu||(hu={}));const pu=e=>cl("/user-data/getTaskStatus","POST",e),gu=e=>cl("/user-data/sendSignalToProcess","POST",e),fu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:l,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(xu,{title:a,items:l}),o(xu,{title:i,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),xu=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:bu(e)},t)))}):null]})]}):null},bu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),yu=d((()=>o(fu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),vu=d((()=>{const[e]=js("leadForm");return o(fu,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:e?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),Nu=d((()=>{const[e]=js("leadForm");return o(fu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),wu=d((()=>{const[e]=js("leadForm");return o(fu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Cu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ku=d((()=>{const[e,t]=a(hu.process),[n]=js("taskId");return l((()=>{for(const e of Cu)gu({signalType:e,taskId:n});const e=setInterval((()=>pu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==hu.process&&(clearInterval(e),t(n.statusCd))}))),3e4)}),[]),Su(e)})),Su=e=>({IN_PROCESS:o(vu,{}),FAILED:o(yu,{}),OK:o(wu,{}),REWORK:o(Nu,{})}[e]||null),Tu=[{paymentSystem:wi[0].id,currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},mandatoryIncome:void 0,otherPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{fullAddress:"",fiasCode:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Iu=e=>{if(e)try{return new Date(e)}catch(e){return}},Bu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Ru(n,e),Pu(t,e),Du(t,e),Mu(t,e),_u(t,e)].some(Boolean)?{...t,required:!1}:t)),Ru=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Pu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Du=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Mu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,_u=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),Au=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($o,{__html:e},`${t}_${n}`))):null},zu=({field:e,inputs:t})=>t.map(Ts(e,"")),Eu=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:a,title:l},i)=>{const r=Bu(Fu(t))(e,n),s=r.filter((e=>!_u(e,Fu(t))));return c("div",{className:u(Is(a),"grid gap-x-m"),children:[Au(s),Bs(l),zu({field:t,inputs:r})]},`section-${i}`)})),Fu=e=>t=>e(t)?.value,Vu=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between gap-m",children:[o(Wr,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Wr,{className:"w-full @xl:w-auto",type:"submit",children:"Далее"})]})})),Ou=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:l}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:a,codeWord:l}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:a,birthday:l="",phone:i="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:xt(l,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Do({phone:bt(i),email:r}),participantAddresses:Mo({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:a,legalForm:l,organization:i,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:a,organizationActivityTypeCd:s,organizationTypeCd:i,organizationKindCd:o,employeesNumberCd:r,opf:l,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Do({organizationPhone:h&&bt(h)}),participantAddresses:Mo({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,mandatoryIncome:l,otherPayments:i,snils:r,armyIdFlg:s}=e;return{maritalStatusCd:t,totalDependents:a,otherDependents:n,participantIncomes:_o({mandatoryIncome:l,otherPayments:i}),snils:r?.replaceAll(" ",""),armyIdFlg:s}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:l}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:l}})(t);default:return{}}},Lu=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:l})=>{const[r]=js("taskId"),[s]=js("profileId"),[o]=js("participantId"),c=i((async i=>{const c=Ds(Dn(Bu(qu(i))(t,e)));if(console.log(Dn(Bu(qu(i))(t,e))),!pn(c(i)))return console.warn("validation fail");a(i);try{r&&s&&o&&await Js((({participantId:e,taskId:t,profileId:n,formData:a,step:l=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Ou(l,a)}]}}))({participantId:o,taskId:r,profileId:s,step:e,formData:i}))}catch(e){return"Fail"}return n(),5===e&&l?.(!0),"OK"}),[]);return{handleSubmit:c}},qu=e=>t=>e[t],ju=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:l,finishForm:r})=>{const[d,m]=js("leadForm"),u=((e,t)=>({...Tu[e],...t,birthday:Iu(t?.birthday),dulIssueDateField:Iu(t?.dulIssueDateField),participantDateRegistration:Iu(t?.participantDateRegistration),beginDate:Iu(t?.beginDate),deliveryDate:Iu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=i((e=>{h.current=e}),[]),{handleSubmit:f}=Lu({step:e,inputs:p,onNextStep:a,saveStep:m,finishForm:r}),[,{field:x,onSubmit:b}]=Et(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return l?o(ku,{}):c("form",{onSubmit:b,className:"space-y-m",children:[Eu({sections:t,field:x,step:e,registerSubmit:g}),o(Vu,{step:e,onPrevStep:n})]})})),$u=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"otherPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],Uu=["Параметры карты","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Выбор способа получения"],Wu=d((({className:e,...t})=>{const[n,l]=a(0),s=i((()=>{l((e=>Math.min(e+1,6)))}),[]),d=i((()=>{l((e=>Math.max(e-1,0)))}),[]),m=r((()=>$u[n]),[n]),[h,p]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{className:"container grid grid-cols-12",children:[h?null:o(uu,{stepsTitles:Uu,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(ju,{step:n,sections:m,onNextStep:s,onPrevStep:d,isFormFinished:h,finishForm:p},String(n))})]})})})),Hu=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId");if(!t||!e||!n)return globalThis.location.href="/",()=>null;const a=async()=>{const n=await cl("/auth/refresh","POST",{refresh_token:e,access_token:t});n instanceof Response?Yu(n.status):(globalThis.sessionStorage.setItem("refreshToken",n.refresh_token),globalThis.sessionStorage.setItem("accessToken",n.access_token))};a();const l=setInterval(a,24e4);return()=>clearInterval(l)},Yu=e=>{401==e&&(globalThis.location.href="/")},Ku=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(mu,{step:a,showPercentage:!1})]})})})),Gu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:l,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(Xu,{title:a,items:l}),o(Xu,{title:i,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Xu=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Ju(e)},t)))}):null]})]}):null},Ju=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Zu=d((()=>o(Gu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Qu=d((()=>{const[e]=js("leadForm");return o(Gu,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:e?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),eh=d((()=>{const[e]=js("leadForm");return o(Gu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),th=d((()=>{const[e]=js("leadForm");return o(Gu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),nh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ah=d((()=>{const[e,t]=a(hu.process),[n]=js("taskId");return l((()=>{for(const e of nh)gu({signalType:e,taskId:n});const e=setInterval((()=>n&&pu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==hu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]),lh(e)})),lh=e=>({IN_PROCESS:o(Qu,{}),FAILED:o(Zu,{}),OK:o(th,{}),REWORK:o(eh,{})}[e]||null),ih=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},mandatoryIncome:void 0,otherPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],rh=e=>{if(e)try{return new Date(e)}catch(e){return}},sh=e=>(t,n)=>t.filter((e=>e)).map((t=>[oh(n,e),ch(t,e),dh(t,e),mh(t,e),uh(t,e)].some(Boolean)?{...t,required:!1}:t)),oh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,ch=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,dh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),mh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,uh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),hh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($o,{__html:e},`${t}_${n}`))):null},ph=({field:e,inputs:t})=>t.map(Ts(e,"")),gh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:a,title:l},i)=>{const r=sh(fh(t))(e,n);return c("div",{className:u(Is(a),"grid gap-x-m"),children:[hh(r),Bs(l),ph({field:t,inputs:r})]},`section-${i}`)})),fh=e=>t=>e(t)?.value,xh=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between",children:[o(Wr,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Wr,{className:u("w-full @xl:w-auto"),type:"submit",children:"Далее"})]})})),bh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},yh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:bh[a?"annuity":"differential"]}},vh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:a,birthday:l="",phone:i="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:xt(l,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Do({phone:bt(i),email:r}),participantAddresses:Mo({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:a,legalForm:l,organization:i,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:a,organizationActivityTypeCd:s,organizationTypeCd:i,organizationKindCd:o,employeesNumberCd:r,opf:l,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Do({organizationPhone:h&&bt(h)}),participantAddresses:Mo({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,confirmationIncome:l,mandatoryIncome:i,otherPayments:r,snils:s,armyIdFlg:o}=e;return{maritalStatusCd:t,totalDependents:a,incomeCertificateCd:l,otherDependents:n,participantIncomes:_o({mandatoryIncome:i,otherPayments:r}),snils:s?.replaceAll(" ",""),armyIdFlg:o}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:l}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:l}})(t)}},Nh=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:l})=>{const[r]=js("taskId"),[s]=js("profileId"),[o]=js("participantId"),c=i((async i=>{const c=Ds(Dn(sh(wh(i))(t,e)));if(!pn(c(i)))return console.warn("validation fail");a(i);try{r&&s&&o&&await Js((({participantId:e,taskId:t,profileId:n,formData:a,step:l=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...vh(l,a)}],...yh(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:i}))}catch(e){return"Fail"}return n(),5===e&&l?.(!0),"OK"}),[]);return{handleSubmit:c}},wh=e=>t=>e[t],Ch=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,renderStep:l=gh,isFormFinished:r,finishForm:d})=>{const[m,u]=js("leadForm"),h=((e,t)=>({...ih[e],...t,birthday:rh(t?.birthday),dulIssueDateField:rh(t?.dulIssueDateField),participantDateRegistration:rh(t?.participantDateRegistration),beginDate:rh(t?.beginDate),deliveryDate:rh(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=i((e=>{p.current=e}),[]),{handleSubmit:x}=Nh({step:e,inputs:g,onNextStep:a,saveStep:u,finishForm:d}),[,{field:b,onSubmit:y}]=Et(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(ah,{}):c("form",{onSubmit:y,className:"space-y-m",children:[l({sections:t,field:b,step:e,registerSubmit:f}),o(xh,{step:e,onPrevStep:n})]})})),kh=[[],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"otherPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Sh=["","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Отделение Банка"],Th=d((({className:e,...t})=>{const[n,s]=a(0);l(Hu,[]);const d=i((()=>{s((e=>Math.min(e+1,5)))}),[]),m=i((()=>{s((e=>Math.max(e-1,0)))}),[]),h=r((()=>kh[n]),[n]),p=0===n,[f,x]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{className:"container grid grid-cols-12",children:[p||f?null:o(Ku,{stepsTitles:Sh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Ch,{step:n,sections:h,onNextStep:d,onPrevStep:m,isFormFinished:f,finishForm:x,renderStep:p?({registerSubmit:e,field:t})=>o(Qd,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Ih=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Bh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Rh=1e9,Ph={sum:{min:1e4,max:Rh},period:3},Dh=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:l,...i})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Wc(Ph,{block:i.block,page:i.options?.page,normalize:e=>({...e,period:Mh(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=_h(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Vc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Rm,{label:a?.title,min:500,max:Rh,...d("sum",{parse:e=>({min:Number(e),max:Rh}),format:({min:e})=>String(e)})}),o(ua,{title:l?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Ac,{blocksToRender:r,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Mh=e=>ot((e?.paramsSource?.rateRows||[]).filter(Ih).flatMap((e=>Bh(e.minMonths,e.maxMonths)))),_h=e=>ot(e.flatMap((e=>e||[])).filter(Ih).flatMap((e=>Bh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Ah=[{key:"10"},{key:"50"},{key:"100"}],zh=({itemCount:e,onItemCountChange:t})=>{const n=i((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(cn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Ah,iconVersion:"black"})]})},Eh="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Fh=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:l}=e,i=t+1;return i===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:i},String(t)):1!==i&&i!==l&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(i,n,l)?o("div",{onClick:()=>a(i),className:Eh,"aria-label":`Страница ${i}`,children:i},String(t)):null},Vh={width:"24",height:"24"},Oh=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),l=i((()=>{e>1&&t(e-1)}),[e]),s=i((()=>{e<n&&t(e+1)}),[e,n]),d=i((()=>t(1)),[]),m=i((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:l,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Lh(1===e),...Vh})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Eh,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Fh),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Eh,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Lh(e===n),...Vh})})]})},Lh=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",qh=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:l})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Oh,{currentPage:e,onPageChange:t,totalPages:n}),a&&l?o(zh,{itemCount:a,onItemCountChange:l}):null]}),jh=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:l,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",Wt),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:l})]})})),$h=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(jh,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ka,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ka,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Wr,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Uh=({title:e,timestamp:t,publicId:n})=>{const a=ue(),{href:l}=a({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Me,{size:"text-m","font-weight":"font-light",children:xt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:l,download:!0,"aria-label":"Скачать",children:e})]})]},n)},Wh="/api/v1/depository",Hh={startDate:void 0,endDate:void 0,query:""},Yh=ht((({className:e,...t})=>{const[n,l]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=Et(Hh),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:l})=>{const i=a?xt(a,!0):"",r=l?xt(l,!0):"",s=new URLSearchParams(Wh);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",i),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=qn(Wh+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=i((e=>l(e-1)),[]),b=i((e=>{r!==e?(s(e),l(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o($h,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Uh,{...e},String(e.publicId)))):o(Ko,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(qh,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),Kh=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,Gh=d((({className:e="",title:t,description:n,error:a,button:l,...i})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:Kh(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),l?.text?o(ye,{version:l?.version,text:l?.text,...l}):null]}))),Xh="location";function Jh(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=a(n||null);return l((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((n=>e.fire(t,n)),[e,t])]})(ce,"location",Qh()??{name:e}),r=i((e=>{ep(e),n(e)}),[]),{data:s}=qn(Zh()?null:"/api/v1/region",st);return l((()=>{s&&!Zh()&&n(s)}),[s]),[t??{name:e},r]}const Zh=()=>Boolean(globalThis.localStorage?.getItem(Xh)),Qh=()=>{try{const e=globalThis.localStorage?.getItem(Xh);return e&&JSON.parse(e)}catch(e){return null}},ep=e=>{try{globalThis.localStorage?.setItem(Xh,JSON.stringify(e))}catch(e){}};var tp;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(tp||(tp={}));const np=new Intl.NumberFormat("ru",{style:"currency",currency:tp.RUB}),ap=e=>e?np.format(e):"",lp="text-m font-light text-secondary-text ",ip=`${lp} text-left`,rp=`${lp} pl-5xl text-center`,sp=`${lp} pl-5xl text-right`,op={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},cp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:ip,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:rp,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:sp,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(dp)})]}))),dp=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:op[t]},width:"24",height:"24"}):null,o(Me,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Me,{size:"text-h6",children:ap(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:ap(e?.buyExchangeRate)})})]},t)},mp={icon:"GpsIcon"},up=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Zc,{...mp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),hp=(e,t,n)=>{const a=Number(pp(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},pp=e=>e.replace(/[^\d.,]/g,"").replace(",","."),gp=e=>Rt([[e=>e.value!==tp.RUB&&e.oppositeValue!==tp.RUB,()=>e.handleConvert(e.value,tp.RUB)],[e=>e.value===tp.RUB&&e.oppositeValue===tp.RUB,()=>e.handleConvert(e.value,tp.USD)],[e=>e.value===tp.RUB&&e.oppositeValue===tp.RUB,()=>e.handleConvert(e.value,tp.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function fp(e){const{placeholder:t,rates:n,selected:a,value:l,setValue:i,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(Yt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:l,onChange:i}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const xp=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:l})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||tp.RUB,selectBuy:n?.[0]?.currency?.currency||tp.USD}),d=i((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[fp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:bp(r,d,n),value:r.inputSell,setValue:e=>vp(d,n)(e,r.selectSell,r.selectBuy)}),fp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:yp(r,d,t),value:r.inputBuy,setValue:e=>Np(d,t)(e,r.selectBuy,r.selectSell)})]}):null,l?.text?o(ye,{text:l.text,version:l?.version,...l}):null]})})),bp=(e,t,n)=>a=>{t({selectSell:a}),gp({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,l=e.selectBuy)=>{vp(t,n)(e.inputSell,a,l)}})},yp=(e,t,n)=>a=>{t({selectBuy:a}),gp({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,l=e.selectSell)=>Np(t,n)(e.inputBuy,a,l)})},vp=(e,t)=>(n,a,l)=>{e({inputSell:pp(n),selectBuy:l});const i=t.find((e=>e.currency?.currency===l))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;i&&e({inputBuy:String(hp(n,i,a===tp.RUB)||"")})},Np=(e,t)=>(n,a,l)=>{e({inputBuy:pp(n),selectSell:l});const i=t.find((e=>e.currency?.currency===l))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;i&&e({inputSell:String(hp(n,i,a===tp.RUB)||"")})};const wp=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const[l]=Jh(),i=function(e){const t=e?.code||"000",{data:n}=qn(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(l),r=Cp(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:tp.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:tp.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Te,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(cp,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(up,{address:i?.address})]}),o(xp,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),Cp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],kp=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Sp(n))})})),Sp=e=>({dataFooter:t,...n},a)=>{const{text:l,href:i,target:r,onClick:s}=e(n);return l?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:i,target:r||"_self",onClick:s,...pe(t),children:l||null})},String(a)):null},Tp=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Ip=["all","footer"],Bp=d((({className:e,navigationItems:t})=>{const n=ue();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(Tp(Ip)).map(n).map(Rp)})})),Rp=(e,t)=>{const{text:n,items:a=[],href:l,target:i="_self",onClick:r,dataFooter:s}=e,d=a.filter(Tp(Ip));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:l,target:i,onClick:r,...pe(s),children:n}),d?o(kp,{items:d}):null]},String(t))},Pp=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Dp)}):null)),Dp=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Me,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Mp)})]},String(t)),Mp=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:_p(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),_p=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Ap(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Ap=e=>e.replaceAll(/\D/g,""),zp=d((({className:e="",index:t,text:n,...a})=>{const l=ue(),{href:i,target:r,onClick:s}=l(a);return o("a",{className:u("text-secondary-text",e),href:i,target:r,onClick:s,children:n||`Документ ${t}`})})),Ep=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Me,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(zp,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Fp="w-full lg:w-52";function Vp(e,t,n=300){l((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const Op=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:l}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),l=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||l[n]||e[r]!==t[n]||(i++,a[r]=!0,l[n]=!0)}return{m:i,s1Matches:a,s2Matches:l}}(e,t);if(0===n)return 0;const i=function(e,t,{s1Matches:n,s2Matches:a}){let l=0;for(let i=0,r=0;i<e.length;i++){if(!n[i])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[i]!==t[s]&&l++}return l}(e,t,{s1Matches:a,s2Matches:l}),r=(n/e.length+n/t.length+(n-i/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const Lp=(e,t)=>(n,a)=>{for(const[l,i]of a)n.set(l,e(n.get(l)||t,i));return n},qp=(e=[])=>e.reduce(((e,t)=>e+t),0),jp=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),$p=e=>t=>e.map((([e,n])=>[Op(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Wp(t,e))).reduce(Lp(Math.max,0),new Map),Up=e=>t=>{return qc(t,t.map((({title:e})=>e)).map((e=>t=>{const n=jp(t||"");return n.length?qp(e.map((e=>cc(n.map(Op(e)))))):0})(e))).sort((a=([,e])=>e,n=(e,t)=>a(e)-a(t),(e,t)=>-n(e,t))).map((([e])=>e));var n,a},Wp=(e,t)=>new Map(e.map((e=>[e,t]))),Hp=({basePathList:e,initialQuery:t=""})=>{const[n,i]=a(t||"");l((()=>{null!=t&&i(t)}),[t]);const{data:r}=qn(e?.length?e:null,Yp),[s,o]=a(null);return Vp((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const l=jp(e);if(!l.length)return[];const i=Object.entries(a),r=[...l.map($p(i)).reduce(Lp(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*l.length)).map((([e])=>n[e]));return Up(l)(r)})(n)))}),[r,n]),[s,{value:n,onChange:i}]},Yp=async(...e)=>(await Promise.allSettled(e.map((e=>rt(V(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Kp=d((({initialQuery:e,navigationItems:t})=>{const n=r((()=>t?.map((e=>e.href||"/"))),[t]),[a,l]=Hp({basePathList:n,initialQuery:e}),i=r((()=>Gp(t)(a)),[t,a]);return o(pl,{head:o(jh,{autoFocus:!0,...l}),children:o(Bp,{navigationItems:i})})})),Gp=e=>t=>e?.length&&t?.length?qc(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:V("/",t)})))}))):[],Xp=(e={})=>{const{open:t,close:n}=de();return{open:(n={},a={})=>t(o(Kp,{...e,...n}),a),close:n}},Jp=d((({className:e,search:t,...n})=>{const[l,r]=a(""),s=i((()=>r("")),[]),d=Xp(n),m=i((e=>{r(e),Zp(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(jh,{value:l,placeholder:t?.placeholder,onChange:m}),o(hl,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),Zp=e=>e&&e.length>=3,Qp=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:l,...i}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(ao,{className:Fp,logo:i,data:l,showTitle:!1}),o(Jp,{className:"grow",navigationItems:t,...e})]})},eg=d((({className:e="",index:t,...n})=>{const a=ue(),{href:l,target:i,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:l,target:i,onClick:s,children:r||`Документ ${t}`})})),tg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Me,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(eg,{index:t,...e},String(t))))}):null]}))),ng=ht((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},l=n.options?.page?.common??{},{documents:i,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[Qp(l,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Bp,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Fp,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Pp,{items:s}),h?o(ye,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(eu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(ye,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Ep,{title:m,links:r}),o(tg,{links:i,license:p})]})})),ag=d((({className:e="",title:t,description:n,calendar:a,...l})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...l,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),a?lg(a):null]}))),lg=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=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:n.map((e=>ig(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.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:rg(e)}),c("div",{className:"text-s",children:[o(Me,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Me,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},ig=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),rg=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)),sg=ht((({className:e,title:t,button:n,regionSource:l,data:i,...r})=>{const[s,d]=a({key:""}),m=l?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(hn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ye,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:Jm(i,s?.key),children:f})}):null]})})}));function og(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>cg(t)(e)));return n.find((([,e])=>cg(t,!0)(e)))??n[n.length-1]??[]}const cg=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(dg(e)(n));return t?a===F(n):a.startsWith(F(n))},dg=e=>t=>{const n=X(G.SITE_URL);return A(t)?e.href:V(n,e.pathname)},mg=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[r,{setFalse:d,toggle:m}]=Lt(!1),h=jt(d),p=s(null),g=i((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),a=t.current.getBoundingClientRect(),l=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${l}px`:a.left>e.left&&(l>a.left?n.current.style.left="":n.current.style.left=`${l}px`)}}),[r]);return qt(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),l((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:m,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:hg(t,n)})]})})),ug=d((({isActive:e,...t})=>{const n=ue(),{text:a,href:l,target:i,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:l,target:i,onClick:r,role:"link",...pe(t?.data),children:a})})),hg=(e,t)=>e?.map(((e,n)=>o(ug,{isActive:e===t,...e},e?.text??String(n)))),pg={default:"w-6 h-6",large:"w-12 h-12"},gg=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:l,ariaLabel:i="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${pg[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:l,"aria-label":i,onClick:c,...pe(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),fg="chatbot",xg="text-page__btn-chat",bg={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},yg=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:a="Чат",version:i})=>{const r=(e=>{l((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=bg[e??""];return n=>{if(t)if("personal"!==e)Pr(fg,t);else{const e=n.target;e?.classList.contains(xg)||e?.classList.add(xg),document.getElementById("webchat-js-container:webchat_rshb")||Pr(fg,t)}}})(e);return o(gg,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:a,onClick:r,buttonSize:"large",isGrayBg:!0,version:i})})),vg=d((({className:e="",active:t,dataItemName:n,children:a,data:l,...i})=>{const r=ue(),{href:s,target:d,text:m,onClick:h}=r(i);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...pe(l),children:[o("span",{className:Ng(t),children:m||a}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Ng=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),wg=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...l})=>{const r=Jo(i((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(vg,{...l,children:n})})})),Cg={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},kg=d((({version:e,text:t,mobileText:n,...a})=>{const l=Ce()?n:t;return l?o(ye,{className:u("py-s px-lg font-light whitespace-nowrap",Cg["transparent"===e?"transparent":"default"]),...a,children:l}):null})),Sg=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:l,chatBotAriaLabel:i})=>{const d="transparent"===t?"white":"black",[,m]=og(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?Tg(t):Ig(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(wg,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(mg,{items:p,activeItem:m,ariaLabel:l}):null,_.CHAT_BOT?o(yg,{version:t,iconVersion:d,chat:_.CHAT_BOT,ariaLabel:i}):null,o(kg,{version:t,...n})]})})),Tg=e=>t=>Math.max(t,e+1),Ig=e=>t=>Math.min(t,e),Bg=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(Me,{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(Rg,{...e},String(t))))})]}):null,Rg=d((({icon:e,...t})=>{const n=ue(),{text:a,target:l,href:i,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:i,target:l,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Pg=(e,t)=>n=>n.name?o(Zm,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Jm(e,n.name),children:o(Me,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Dg=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(Wt,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),Mg=d((({foreignOffices:e,branches:t})=>{const[n,l]=Jh(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=a(""),u=Ag(Vi()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((e,t)=>{const n=new Map;for(const a of e){const e=t(a),l=n.get(e)||[];n.set(e,[...l,a])}return n})(u,_g),{close:p}=de(),g=i((e=>{l(e),p()}),[]);return c(pl,{className:"pb-20",head:c("div",{children:[o(Me,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Zm,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(Dg,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&Op(e.toLowerCase())(d.toLowerCase())>=.8)).map(Pg(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((f=g,x=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Me,{size:"text-h6",children:e})}),t.map(Pg(x,f))]},e)))}),Bg(e)]});var f,x})),_g=e=>e.name?.charAt(0)||"",Ag=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),zg=d((({className:e="",active:t,flat:n,children:a,data:l,...i})=>{const r=ue(),{href:s,target:c,text:d,onClick:m}=r(i);return o("a",{className:u(Eg(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...pe(l),children:o("span",{suppressHydrationWarning:!0,className:Fg(t,n),children:d||a})})})),Eg=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),Fg=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Vg=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",[l]=Jh(n?.branches?.default),r=Xp(n),s=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(Mg,{...e}),n),close:n}})(n),d=i((()=>r.open()),[r]),m=i((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[n?.branches?.visible?o(zg,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:l?.name,data:Jm(n?.branches?.dataClick,l?.name??""),onClick:m}):null,n?.officesAtms?.href?o(zg,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(gg,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),Og=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...l})=>{const r=Jo(i((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(zg,{...l,children:n})})})),Lg=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:l,headerData:i,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),x={rootRef:f},b=r((()=>e.map(((e,t)=>e=>{p(e?qg(t):jg(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(ao,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(Og,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(mg,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(Vg,{version:l,className:"ml-auto",search:d,navigationItems:e,...i})]})})),qg=e=>t=>Math.max(t,e+1),jg=e=>t=>Math.min(t,e),$g={"bg-white":"primary",transparent:"transparent"},Ug=["all","header"],Wg=ht((({className:e,bgColor:t="bg-white",logo:n={},version:a=$g[t],portal:l,header:i={},...r})=>{const{common:s,navigation:d}=Yg(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=og(m),{internetBankButton:f}=l||{},x=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:a,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(Lg,{activeTopItem:p,navigationItems:m?.filter(Tp(Ug)),version:a,headerData:{...i,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Hg(a))}),p?.items?.length&&o(Sg,{subItems:p?.items?.filter(Tp(Ug)),version:a,internetBankButton:f})]})})})),Hg=e=>"transparent"===e?"opacity-30":"",Yg=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Kg=(e=!1)=>e?{}:{padding:"p-0"},Gg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Xg=ht((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:l="transparent",isTheme:i=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Gg[n],e),padding:t,version:l,isTheme:i,...s,children:P({...s,extraProps:{...Kg(a),className:Go(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),Jg=d((e=>{const{className:t,align:n,image:a,...l}=e,i=n?u("flex",id[n]):"";return o(g,{className:u(i,t),defaultPadding:"p-0",...l,children:o(ne,{image:a})})})),Zg=(e,t=0)=>{const{itemCount:n,visibleItemCount:l}=e,[r,s]=a(t),o=i((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=i((()=>s((e=>Math.max(e-1,0)))),[n]),d=l?n>l&&r<n-l:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function Qg({dec:e,inc:t,canDec:n,canInc:a,btnClass:l,className:i=""}){return n||a?c("div",{children:[n?o(bc,{className:u("absolute z-40",l[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(bc,{className:u("absolute z-40 rotate-180",l[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const ef=d((({className:e="",cards:t=[],button:n})=>{const[l,r]=a(0),s=i((e=>r(e)),[]),d=t.length,[m,u]=Zg({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?tf({activeIndex:m,cards:t,selectedCardIndex:l,onClick:s}):null,Qg({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?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(ye,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function tf({activeIndex:e,cards:t,selectedCardIndex:n,onClick:a}){const l=460*e,i=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${l}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${i}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:a}){return c("button",{type:"button",onClick:a,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"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?nf("страховая сумма",e.sum):null,e?.fee?nf("страховой взнос",e.fee):null]}),af(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})})}function nf(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Me,{size:"text-h6",children:[Ue(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Me,{size:"text-l",color:"text-secondary-text",children:e})})]})}function af(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 lf=d((({className:e="",title:t,insuranceTabs:n=[],button:l,...r})=>{const[s,d]=a(0),m=i((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:a}){return o("button",{type:"button",onClick:a,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"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:rf({insuranceTabs:n,button:l})})]})})),rf=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(ef,{button:t,cards:e},String(n)))):null};const sf={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},of={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},cf=d((e=>{const{className:t="",__html:n,isDotted:a,investmentZeroColumn:l,investmentColumns:i,...r}=e,s=i?[...i]:[];return l&&s.unshift(l),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[Ec(o("div",{className:"w-px h-4 bg-gray"}))(s.map(df)),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(hf)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Pe,{__html:n,isDotted:a,itemSize:"list-s"})}):null]})})})),df=(e,t,n)=>{const a=1===t,l=t===n.length-1,i=e.cells?.reverse()||[];return o("div",{className:`${mf(a,l,e.cells)}`,children:i.length?o("div",{className:"w-full "+(l?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:i.map(uf)}):null},`column_${t}`)},mf=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),uf=(e,t)=>{const n=e.cellSize||"XS",a=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${of[n]} ${sf[a]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(Me,{align:"text-center",children:e.text})},`cell_${t}`):null},hf=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,pf=["байт","Кб","Мб","Гб","Тб","Пб"],gf=d((({icon:e,text:t,href:n,target:a,fileFormat:l,data:i,fileSize:r})=>{const s=r&&l?",":"",d=r??"",m=l?String(l):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...pe(i),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",ff(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),ff=(e,t)=>e||t?o("span",{children:", "}):"",xf=(e,t)=>(n,a)=>{const l=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),i="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${pf[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?yf(l):n?.fileFormat;return c("div",{role:"listitem",children:[o(gf,{text:n?.text,target:n?.target,href:l,fileFormat:r,fileSize:i,icon:bf(t),data:n?.data}),o(Pe,{__html:n?.__html})]},String(a))},bf=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,yf=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},vf=d((({href:e,__html:t,target:n})=>{const{close:a}=de(),l=D(),r=$(l)(e),s=i((()=>{a()}),[]);return c(pl,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(Pe,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ye,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Wr,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Nf=d((({text:e,href:t,target:n,__html:a,icon:l})=>{if(!e&&!a)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(vf,{...e}),n),close:n}})({__html:a,href:t,target:n}),s=i((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[bf(l),o(Me,{font:"font-light",children:e})]})})),wf={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Cf=ht((({className:e="",title:t,description:n,align:a="text-center",documents:l,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),l?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",wf[r]),role:"list",children:l.map(kf(d,i))}):null]})})),kf=(e,t)=>(n,a)=>{const l=n?.docType;return""===l?null:"reportSource"in n&&n?.reportSource?.__html?Sf(t)(n,a):xf(e,t)(n,a)},Sf=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Nf,{...a,icon:e,href:Tf(t)?t?.href:t?.attachment?.src}),o(Pe,{__html:t?.__html})]},String(n)):null},Tf=e=>"href"in e,If=ht((({className:e,padding:t,align:n="text-left",buttons:a=[],description:l,image:i,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",b=i?.src?o(ne,{className:"hidden lg:block",image:i}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Le(a,{className:"flex-wrap"}),children:[l?o(Me,{size:"text-xl","font-weight":"font-light",children:l}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Pe,{__html:r,itemSize:"list-m"}):null,o(Me,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,i?.src?o(ne,{className:"lg:hidden",image:i}):null]})]})})})),Bf=(e=[],t={})=>e.filter((({content:e={}})=>$c(t,e))).length,Rf=(e,t)=>e===t;const Pf=(Df=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Rf,((e=Rf)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>Df(n,t[e])))));var Df;const Mf=[],_f={},Af={primary:"bg-white/30",secondary:"bg-main-divider"},zf={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Ef=d((({count:e,version:t="secondary"})=>{const n=Ce(),a=n?"bg-main-divider":Af[t],l=zf[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:l,children:e})})})),Ff=({text:e,description:t,icon:n,isActive:a,type:l})=>{const i=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",i.icon),image:{...n,iconVersion:n?.iconVersion??i.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===l?i.text:i.oldText,children:e}),o("div",{className:"animated"===l?i.desc:i.oldDesc,children:t})]})]})},Vf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Of={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Lf={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},qf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},jf=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:l})=>{const i=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(i,{className:u("h-12","block flex-1","cursor-pointer",Vf[a],n?qf[a]:Lf[a]),role:"tablist","aria-label":"Список табов",onClick:l,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Of[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Ff({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Ef,{count:m,version:Hr(n,a)})}):null]})})})),$f=d((e=>o(e?.item?.href?Uf:Wf,{...e}))),Uf=d((e=>{const t=ue(),n=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...l}=t({...e.item,onClick:n});return o(jf,{...e,tag:"a",item:l,onClick:a})})),Wf=d((({item:e={},onClick:t,...n})=>{const a=i((()=>{t&&t(e)}),[t,e]);return o(jf,{item:e,onClick:a,...n})})),Hf=(e,t,n)=>(a,l)=>o($f,{isActive:a===e,onClick:t,type:n,item:a},String(l)),Yf=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:l})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Hf(a,l,t))}))),Kf={categories:[],extraOptions:[],propertyType:[],stage:[]},Gf=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...l})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Wc(Kf,{block:l.block,page:l.options?.page}),f=i(((e=Kf)=>p(e)),[]),x=(({hotFilters:e=Mf,filtrationState:t=_f,blocks:n=Mf,onFiltrationStateChange:a})=>{const l=r((()=>Math.max(0,e.findIndex((e=>Pf(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Bf(n,t.filter),version:Hr(t===e[l])})))),[e,n,l]),o=i((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[l],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:l.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Yf,{...x}),o(Vc,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(Ac,{blocksToRender:d,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Xf=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:l,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Qf(a)},{label:"Модуль приема наличных",value:l?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Me,{size:"text-h4",children:Qf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(lr,{color:"green",children:Qf(s)})})]}),o("div",{className:"hidden sm:block",children:o(Yi,{className:"flex-wrap",children:m?.map(Zf)})}),o(qi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ji,{isUnfolded:e,children:o(Yi,{className:"flex-wrap",children:m?.map(Zf)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(d))},Jf=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Qf(t)} №${n}`,body:e.toUpperCase()}),Zf=(e,t)=>o($i,{...e},String(t)),Qf=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",ex=[];const tx=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:ex},nx={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ax={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},lx=d((({descriptionData:e,className:t})=>{const[n]=Jh(),a=n?.code??"000",{data:l,isLoad:i}=function(e){const{data:t,error:n}=qn(`/api/v1/atms?regionCode=${e}`,tx);return{data:t||ex,isLoad:!t&&!n}}(a);return o(ns,{className:t,filterItems:ix,data:l,isLoad:i,initFilterState:nx,renderCard:Xf,getBalloon:Jf,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),ix=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),l=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=l.every((t=>ax[t](e))),n=!a.length||a.some((t=>ax[t](e)));return t&&n}))},rx=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Me,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:sx({workScheduleDescription:t})}),o(qi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ji,{isUnfolded:e,children:sx({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(n)):null,sx=({workScheduleDescription:e})=>c("div",{children:[c(Yi,{className:"flex",children:[o($i,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o($i,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o($i,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o($i,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o($i,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),ox=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),cx={branches:[],remoteWorkplaces:[]};const dx=async e=>await rt(e,{method:"GET"})||cx,mx=d((({className:e})=>{const[t]=Jh(),n=t?.code??"000",{data:a,isLoad:l}=function(e="000"){const{data:t,error:n}=qn(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,dx);return{data:t||cx,isLoad:!t&&!n}}(n);return o(ns,{className:e,data:a?.branches,isLoad:l,remoteWorkplaces:a?.remoteWorkplaces,renderCard:gr,renderRemoteWorkplaceCard:rx,getBalloon:xr,getBalloonRemoteWorkplaces:ox,title:`Офисы филиала ${t?.name}`})})),ux=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(mx,{}):o(lx,{descriptionData:e})})})),hx=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),px="hidden sm:flex absolute z-40 top-10",gx=ht((({className:e="",padding:t,slides:n=[],...l})=>{const[i,r]=a(0),[s,d]=pc({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...l,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*i}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Xe,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...l})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(tc,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(fx({activeSlideIndex:i,onClick:r}))}),d.canScrollLeft?o(yc,{className:u("left-6",px),onClick:d.scrollLeft}):null,d.canScrollRight?o(vc,{className:u("right-6",px),onClick:d.scrollRight}):null]})]})})),fx=({activeSlideIndex:e,onClick:t})=>({nav:n},a)=>{const l=a===e,i=l?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=l?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=l?"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(a),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",i),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(a))},xx=d((({address:e,email:t,telephone:n,button:a,className:l="",__html:i,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",l),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Oe(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[i?bx({__html:i,richVersion:r}):null,yx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),yx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),yx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?Le([a]):null]})]}))),bx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Pe,{...e,itemSize:"list-s"})}),yx=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Me,{size:"text-xl",color:a,children:t})]})]}):null,vx=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Pe,{__html:t,richVersion:n})})})),Nx=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:a,labelIcon:l})=>o(Bc,{tag:"button",className:u("border-none bg-transparent items-center group/button",l?.icon?"py-xs":"py-lg"),onClick:a,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Me,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),wx=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Cx=(e=!1)=>e?"MinusIcon":"PlusIcon",kx=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Sx=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:a="Развернуть",labelIcon:l,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Ce();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(qi,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ji,{className:u("gap-lg",wx(m)),isUnfolded:e,children:P({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Tx({foldButtonVersion:r,label:a,labelIcon:l,labelIconBgVersion:i,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Tx=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:a,isUnfolded:l,onToggle:i,isMobile:r=!1})=>{const s=t||(l?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?kx(e):Cx(e))(l,r);return"accordion"===e?o(Nx,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:i}):o(Rc,{label:s,icon:l?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Ix=d((({name:e,text:t,value:n,checked:a,onChange:l,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(Wt.split(" ").filter((e=>"rounded"!==e)),Jn,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>l?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),Bx=d((({className:e=""})=>{const[t,n]=a("option2"),l=i((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Ix,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:l}),o(Ix,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:l})]})})),Rx=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:l="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(cn,{options:s,label:r,placeholder:l||a,onChange:e=>i(e.key),value:c})})),Px=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:l,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Rx,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Rx,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:l,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Dx=["От 1 дня","До 365 дней"],Mx=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ua,{min:1,max:365,value:e,items:Dx,onChange:t})]}))),_x=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:l,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Rx,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Rx,{data:a,fieldLabel:"safeBoxCasesSize",selected:l,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Ax=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:l,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Px,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:zx(m)}),o(Mx,{days:l,setDays:e=>m({days:e})}),o(_x,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:Ex(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Me,{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(Bx,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),zx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Ex=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Fx=d((({days:e,tariffs:t=[]})=>{const n=Ox(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[Vx("Аренда за",e),Vx("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),Vx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Me,{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})]}),Ox=(e,t)=>{const n=Lx(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Lx=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},qx=(e,t)=>e.find((e=>e.branchCode===t)),jx=d((e=>{const{regions:t,data:n,branches:a,onChange:i,onClick:r}=e;l((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,i]);const s=qx(a,n.selectedBranch),d=$x(s?.safeBoxCaseVolumes),m=Ux(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Wx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Ax,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:i}),o(Fx,{days:n.days,tariffs:u})]})})),$x=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Ux=(e,t)=>e?.find((e=>e.volume===t)),Wx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Hx=[];const Yx=async e=>await rt(e,{method:"GET"})||Hx,Kx=d((({title:e,footnote:t,className:n="",...l})=>{const[r,s]=a(!1),d=i((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Vi(),p=Gx(m.selectedRegion,h),f=function(e){const{data:t}=qn(e?`/api/v1/safeboxes?regionCode=${e}`:null,Yx);return t||Hx}(p),x=i((e=>u((t=>({...t,...e})))),[u]),b=(y=qx(f,m.selectedBranch)||f,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(g,{className:n,defaultPadding:"",...l,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(jx,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(zr,{points:b,className:"h-[640px]"}):null]})})),Gx=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Xx=e=>e<4?"w-72":"w-52",Jx={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"},Zx=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:l=[],stepVersion:i="gray",title:r,version:s="primary",...d})=>{const m=l.length>3,h=Jx,p=(e=>e?"":"opacity-0")(a),f=Ce();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(k,{headlineVersion:"S",title:r,description:n,isEmbedded:!0,className:"w-full",align:Xc(f)}),l?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:Ec(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(l.map(Qx(h,m,i)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:l.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:l}=x,{label:i,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",Xx(n.length)),children:[c("div",{className:"space-y-xs",children:[i?o(Me,{size:"text-h6",align:"text-center",children:i}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:a.description,children:r}):null,o(Pe,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ye,{className:"box-border py-s w-full max-w-60 mt-auto",version:l,...s,children:s?.text}):null]},String(t))}))})]}):null,Le(e)]});var x})),Qx=(e,t,n)=>({icon:a},l)=>{const i="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${eb(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:Oe(a)?o(ne,{image:{...a,iconVersion:a?.iconVersion||i},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:l+1})},String(l));var r},eb=e=>e?"h-16 w-16":"h-24 w-24",tb=d((()=>o("div",{className:"hidden",role:"none"}))),nb="hidden sm:flex absolute z-40",ab={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},lb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:i="default"})=>{const[r,s]=pc({itemCount:t?.length||0});return l((()=>ib(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(tc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:ab[i].item,gap:ab[i].gap,children:t.map(Hf(n,a,i))}),s.canScrollLeft?o(yc,{className:u("left-6",nb,ab[i].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(vc,{className:u("right-6",nb,ab[i].buttonTop),onClick:s.scrollRight}):null]})})),ib=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},rb={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},sb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(rb[t].wrapper,e),children:o(lb,{className:rb[t].component,tabsType:t,...n})}):null,ob=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=cb(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=a(ub(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],w=x.findIndex((e=>Boolean(e.selected)));l((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[b,w,h]);const C=mb(x[y],y),k=i((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[sb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:db(t,x),activeItem:N,tabsType:r,onChange:k}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(mb)?.filter(Boolean)||[]}),cb=({__id:e,anchor:t})=>t??e??"tabs",db=(e,t)=>t?.length?t:e,mb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",ub=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),hb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},pb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:hb[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),gb=d((({className:e="",isOpen:t,onClick:n})=>o(ye,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),fb={Buttons:({buttons:e})=>Le(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Pe,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Me,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Me,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:l})=>e?o(gb,{className:"w-fit",isOpen:l,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},xb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);l((()=>{i===o&&s||m(!0)}),[s,o]);return bb({cell:e,cellProps:{rowIdx:n,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),bb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in fb))return null;return o(fb[n],{...t,...a})},yb=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:l,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(xb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:l,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),vb=(e,t)=>140*qp(e.slice(0,t).map((e=>e?.cols?.length??1))),Nb=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Me,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,wb=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,a]=Zg({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((l=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,i=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Me,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${vb(a,l)}px)`},children:a?.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(Me,{size:"text-xl",children:e.data}):null,e?.cols?Nb(e.cols,l):null]},`row${t}`)))})})]},String(t))})),Qg({...a,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var l})),Cb=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Me,{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(wb,{rows:t.rowsData})})})]},a)}))}))),kb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Sb=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Me,{size:"text-xl",font:"font-light",color:kb(t===n),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Tb=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const l=e?.tableData,[r,s]=a(0),d=i((e=>s(e)),[]),m=l?.[r]?.items??[],u=l?.map((e=>e.currency??""));return c("div",l?{className:"bg-white z-10",children:[o(Sb,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Cb,{activeTabIndex:r,items:m}),o(gb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(gb,{onClick:n,isOpen:!0})]})})),Ib=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Tb,{...t,onClick:n})}):null]}))),Bb=d((({row:{header:e,data:t},activeIndex:n,rowIdx:l,...r})=>{const[s,d]=a(void 0),m=i((e=>d(e)),[]),[h,p]=a(void 0),g=i((e=>p(e)),[]);return c(Ib,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(pb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(yb,{cells:e,rowIdx:l,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Rb=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Qg({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Pb=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:l,hiddenRowsNum:i=0,...r})=>{const s=l?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=Zg({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Bb,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=i>0?[f.slice(0,-i),f.slice(-i)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:i>0?o(qi,{renderFoldableSection:({isUnfolded:e})=>c(Rb,{controls:p,children:[x,o(ji,{isUnfolded:e,children:b})]}),renderFoldButton:Pc}):o(Rb,{controls:p,children:f})})]})})),Db=d((({className:e="",title:t,description:n,iconVersion:a,__html:l,richVersion:i,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?Mb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Me,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?_b(n):null,l?o(Pe,{richVersion:i,__html:l}):null]})]}))),Mb=()=>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"}),_b=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Ab=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:n})}):null]}))),zb=d((e=>{const{prefix:t,unit:n,suffix:a,...l}=e;return o(g,{defaultPadding:"p-0",...l,children:o(Ab,{prefix:t,unit:n,suffix:a})})})),Eb=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:l="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Gg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:l,isTheme:i,...c,children:P({...c,extraProps:{className:u("w-full",Go(r)),...Kg(a)}})})}),{childrenTypes:[]}),Fb=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",Vb=d((({className:e,title:t,url:n,previewImg:a,...l})=>{const i=D();return c(g,{className:e,defaultPadding:Fb(e),...l,children:[o(k,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:$(i)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:$(i)(n)})}):null]})})),Ob={AdTile:gt,ApplicationForm:Ls,ApplicationLeadForm:jo,ApplicationStatus:Wo,BankAccountFiltration:Kc,BenefitsBlock:Qc,BonusBenefitsBlock:ld,ButtonsBlock:rd,CalculatorBonus:Nd,CalculatorBusinessDeposit:Vd,CalculatorCredit:Qd,CalculatorDeposit:xm,CalculatorRefinancing:Sm,CardTransfer:Mm,Carousel:Lm,CarouselCard:Um,CarouselCatalogCard:Hm,CarouselLinks:Gm,CarouselRecommendationCard:au,CarouselTariffsCard:ru,ContactsBlock:ou,CreditCardForm:Wu,CreditForm:Th,DepositFiltration:Dh,Depository:Yh,ErrorBlock:Gh,ExchangeRateTile:wp,Footer:ng,GracePeriod:ag,GrantSupport:sg,Header:Wg,Headline:k,HorizontalLayout:Xg,ImgBlock:Jg,InsuranceAmountBlock:lf,InvestmentInfo:cf,LinkDocs:Cf,MobileAppTile:If,MortgageFiltration:Gf,OfficesAtmsMap:ux,Placeholder:hx,ProductBlock:pt,ProductGallery:gx,RepresentativeOfficeInfo:xx,RichTextBlock:vx,RollupItem:Sx,SafeDepositRental:Kx,StepsBlock:Zx,StickyBottomMenu:tb,TabsLayout:ob,TariffsTable:Pb,TextBlock:Db,UnitBlock:zb,VerticalLayout:Eb,Video:Vb},Lb=me((()=>{l((()=>{Tt()}),[]);const e=At();qt(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");kt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),qb="cookie",jb=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=Lt();Vp((()=>{globalThis.localStorage?.getItem(qb)||n()}),[],3e3);const l=i((()=>{globalThis.localStorage?.setItem(qb,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Pe,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(hl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:l})})]})}):null}));function $b(e){throw new Error(e)}const Ub=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=a(e),l=i((e=>n((t=>[...t,e]))),[]),r=i((()=>n((e=>e.slice(0,-1)))),[]),s=i((e=>n((t=>t.filter((t=>t!==e))))),[]),o=i((()=>n([])),[]);return[t,{setList:n,push:l,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(n),o()}),[n,e]),d=i((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return l((()=>ce.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:$b(e)}}))),[c,d]),n},Wb=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),n=Ub({onCloseAll:e,onClose:t}),{close:a}=de(),r=i((({key:e})=>{"Escape"===e&&a()}),[]);return qt(globalThis.document,"keydown",r),l((()=>{n.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==n.length-1}),children:e},String(t||a))))}):null})),Hb=d((()=>{const[e,t]=a(null),n=i((()=>{t(null)}),[]);l((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:$b(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&n()}),[n]);return qt(globalThis.document,"keydown",r),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Yb="header",Kb="footer",Gb="sticky-footer",Xb={},Jb=d((({className:e,data:t=Xb,blocksRegistry:n,blockDecorator:a})=>{const{slots:l,blocks:i,fallback:r,...s}=t,d=ut(s,r);Lb();const m={key:"",page:{slots:l,blocks:i,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[l?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(l?.header,{...m,slotName:Yb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[P({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(l?.footer,{...m,slotName:Kb})]})]}),l?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(l?.["sticky-footer"],{...m,slotName:Gb})}):null,o(Wb,{}),o(Hb,{}),o(jb,{__html:d?.cookieContent?.__html})]})}));Object.assign(Jb,{childrenTypes:[],slots:()=>[Yb,Kb,Gb]});e.Blocks=Ob,e.ContentPage=Jb,e.handlerDecorator=me,e.joinList=Ec,e.packageVersion="0.14.659",e.projectSettings=_,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,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 n=e=>(...n)=>t[e](...n),a=n("useState"),l=n("useEffect"),i=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...l}=t||{},i=n?.slots?.default,r=a||i&&i();return e(Object.assign(l,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:l,block:i,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],l||a,e),...m?{"data-ver":t}:{},...i?.anchor?{id:i.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>y(100,e).map((e=>Math.floor(e))).map(b),b=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),y=(e,t)=>[e].concat(t>0?y(e/1.618,t-1):[]),v={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},N=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:l})=>o(n,{role:"heading",className:u("font-sans m-0",v[t],e),children:a||l}))),w=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),C={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:l,align:i="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=C[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(N,{className:u("whitespace-pre-wrap",i),...h?.title,as:r||h?.title.as,title:a}):null,l?o(w,{size:h.descriptionSize,font:h.descriptionWeight,align:i,...p,children:l}):null]})})),S=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function I(e,t,{className:n,...a}={}){const{key:l,blockDecorator:i=S,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return i({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:i})=>{const{content:r}=n;return d?o(d,{className:i,block:e,options:t,...r,...a},l):null}},l)}const B=[],P=(e,{key:t,ancestors:n=B,slotName:a=null,extraProps:l,renderProps:i=I,...r})=>{const s=l?(e,t)=>I(e,t,l):i;return(e||[]).map(((e,l)=>s(e,{...r,key:`${t||e.type}-${l}`,ancestors:r.parent?[...n||B,[r.parent,a]]:n},l)))};function R({block:e,options:t,children:n,extraProps:a,renderProps:l}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:a,renderProps:l}):null)}function D(){return D._impl()}D._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),D.setup=e=>{D._impl=e};const M=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return M.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),z=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),E=e=>Boolean(e?.startsWith("#")),F=e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),O=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:_,isLocalURL:z,isHash:E,withoutQuery:F,joinPath:V,hasPrefix:O});const q="/api/",j=`${q}v1/storage`,$=e=>(t,n)=>{if([!t,_(t),E(t),[A.CDN,q].some((e=>O(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`${j}/${t}/attachment`;const a=t?.startsWith("/");return V(O(t,n)?"":n,a?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:l=a,iconVersion:i="color",width:r,height:s})=>{const d=D(),m="normal"===i?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(V(A.CDN,"/icons/",m));return"normal"===i?o("img",{className:e,src:h,alt:a,title:l,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[i],{invert:"white"===i},t),width:r,height:s,"aria-hidden":"true",children:[l?o("title",{children:l}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!_(t)?$(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const a=D();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:l},i)=>o("source",{srcSet:J(a)(e),type:te(n),media:l?`(max-width: ${l}px)`:"",width:t?.size?.width,height:t?.size?.height},`${i}_${e}`))):null,t?.src?ee({...t,src:J(a)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(Q,{className:e,imageClassName:n,image:t}):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","":""},le="bg-main-divider text-main-disabled",ie={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},re="text-center font-sans select-none",se={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","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" ");const ce=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},de=()=>({open:(e,t={})=>ce.fire("dialog",{type:"open",dialog:e,...t}),close:()=>ce.fire("dialog",{type:"close"}),closeAll:()=>ce.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function ue(){const e=X(G.SITE_URL),t=D(),{closeAll:n}=de();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(a({...e,href:n}))}};function a({href:a,target:l,onClick:i}){return r=>{i?.(r),he(a,l,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(a,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!z(e,t))return!0;const a=G.SUB_PORTALS?.split(",");return!!a?.some((t=>O(e,t)))||!O(e,n||"/")},pe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},ge=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:l,version:i="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[a?o("div",{className:u(r,se[i]),children:a}):null,xe(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,l?o("div",{className:u(r,se[i]),children:l}):null]})})),fe=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const l=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",xe(e)?l:"h-12 w-12 m-auto",{"rounded-full":a})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ye=d((({disabled:e,children:t,method:n="LINK",href:a,...l})=>{const r=(({method:e,href:t})=>i((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:l,searchParams:i}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,l].join(""));for(const[e,t]of i.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:a}),s=ue()({onClick:r,href:a,...l}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:a,ariaLabel:l,version:i,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:i,rounded:r}),href:t,rel:n,target:a,"aria-label":l||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:n,rounded:a,children:l})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:a,version:n}),children:l})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const l="primary"===e?"white":"black",i="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),i),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),o(ye,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=a(false);return l((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Se=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:l,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...b})=>{const y=Ce(),v=D(),N=i((()=>v.back()),[]),w=b.options?.page?.common?.backwardButton,C=f&&!y;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&we({version:t,handleClick:N,text:w}),l?o("div",{className:"relative h-full",children:l}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Se(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Be(R({...b,extraProps:{className:"@container-normal"}})),Se(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Ie(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Ie=e=>u(e?"row-span-2":"@xl:row-span-2"),Be=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Pe=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,Re=d((e=>{const{__html:t="",richVersion:n="",itemSize:a="list-m",isDotted:l=!0}=e,i=l?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,a,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",i),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(w,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Me=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ae=(e,t)=>e?o(Me,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,_e=(e,t)=>["label"in e?Ae(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null,"__html"in e?o(Re,{...e},`rte-${t}`):null],ze=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?Pe(n.icon,t):null,o("div",{children:_e(n)})]}))),Ee=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(ze,{benefitsVersion:t,...e},String(n))))}):null)),Fe=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(_e)}):null)),Ve=d((({isTabularBenefits:e,...t})=>o(e?Fe:Ee,{...t}))),Oe=e=>Boolean(e?.src||e?.icon),Le=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(qe(n))}):null,qe=(e="")=>(t,n)=>{const{text:a,icon:l,iconRight:i,version:r,...s}=t||{},c=je(l,r),d=je(i,r);return a||l?.icon?o(ye,{className:u("basis-full @lg:basis-auto",e),appendLeft:$e({...l,iconVersion:c}),appendRight:$e({...i,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},je=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},$e=e=>Oe(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ue=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),We=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(He)}):null)),He=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Me,{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:[Ue(2)(t)," ",n||"₽"]}):null]},String(a)),Ye=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ke)}):null)),Ke=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Me,{size:"text-m",font:"font-light",children:e})},String(t)),Ge={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Xe=d((({className:e,padding:t,defaultPadding:n,title:a,description:l,headlineVersion:i="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:b,image:y,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:T,...I})=>{const B=y?.src?o(ne,{image:y}):null,P=o(k,{title:a,description:l,headlineVersion:i,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Je(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Le(b),backwardButton:S,...I,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Ve,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(Re,{richVersion:p,__html:h,isDotted:m,itemSize:Ge[i]}):null,T,f?.length?o(We,{priceList:f}):null,Ze(x)]})})})),Je=(e,t)=>t?{rightImage:e}:{leftImage:e},Ze=e=>e?.length?o(Ye,{tags:e}):null,Qe=e=>Boolean(e&&Array.isArray(e)),et=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),tt=(e,t)=>{return n=e,Boolean(et(n)&&"string"==typeof n.$ref)?t.ref(e):et(e)?t.record(e):Qe(e)?t.array(e):t.scalar?t.scalar(e):e;var n},nt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(at,e),at=(e,t)=>e&&t?et(e)?e[t]:Qe(e)?e[parseInt(t,10)]:e:e,lt=(e,t)=>tt(e,{ref:({$ref:e,...n})=>lt(e?nt(t(e),e):n,t),record:e=>Object.entries(e).map((([e,n])=>({[e]:lt(n,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>lt(e,t)))}),it=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const a in e)it(e[a],t,[...n,a])},array:e=>{for(let a=0;a<e.length;a++)it(e[a],t,[...n,a])}})};async function rt(e,t){try{return e?await st(e,t):null}catch(e){console.error(e)}return null}const st=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),ot=e=>[...new Set(e)],ct={},dt=["/portal-resources"],mt=(e,t)=>lt(e,(e=>t?.[e])),ut=(e,t)=>{const n=(e=>{const t=[];return it(e,(e=>t.push(e))),t})(e),[i,r]=a({});return l((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(ot(e).filter((e=>!dt.some((t=>e.startsWith(t))))).map((async e=>[e,ct[e]||=await st(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?mt(e,{...t,...i}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:a,padding:l,isTheme:i,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const pt=ht((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(Xe,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),a=t?.[n];return a?o(pt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),ft=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),xt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getFullYear());return t?`${l}-${a}-${n}`:`${n}.${a}.${l}`}},bt=e=>e?.replace(/[^+\d]/g,"");const yt=e=>e?{phone:bt(e)}:{},vt=(e,t="birthday")=>e?{[t]:xt(e)}:{},Nt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ct=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:bt(e)}:{},kt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:l}of e)t[a??""]?.(n,l)},St="rshb-query-params";function Tt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(St)||"";return e&&globalThis.sessionStorage?.setItem(St,e),e}function It(e){if(!e)throw new Error("Value should be fulfilled");return e}const Bt=e=>t=>{const[,n]=It(e.find((([e])=>e(t))));return n(t)},Pt=e=>Bt(e.map((([e,t])=>[e,()=>t])));Pt.if=e=>new Rt(void 0,e);class Rt{parent;predicate;unit;get entry(){return[It(this.predicate),It(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Rt(this,e)}then(e){return new Rt(this.parent,this.predicate,e)}else(e){return Bt([...Dt(this),[()=>!0,e]])}}const Dt=e=>[...e?.parent?Dt(e.parent):[],e.entry],Mt=e=>{const t=e.target?.closest("a");if(_(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Tt();if(!_(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;if(n){At(t?.target)?.(n)}}},At=Pt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function _t(){return _t._impl()}_t._impl=()=>({forwardQuery:Mt}),_t.setup=e=>{_t._impl=e};const zt=e=>e,Et=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=a(e),c=i(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return Ft(t,n)?t:n}:r(e)):o,[r]);l((()=>{r&&o(r)}),[r]);const[d,m]=a(!1),[u,h]=a({}),p=i(((e,t)=>{const{parse:n=zt,format:a=zt}=t||{};return{value:a(s[e]),isDirty:d||u[e],onChange:t=>{c((a=>({...a,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=i((e=>{c(e),h(e)}),[]),f=i((()=>{c(e),m(!1),h({})}),[e]),x=i((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},Ft=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),Vt=d((e=>{const{className:t,title:n,children:a,...l}=e;return o(g,{className:t,defaultPadding:"p-6xl",...l,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(N,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})})),Ot=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function Lt(e=!1){const[t,n]=a(e),l=i((()=>n(!0)),[]),r=i((()=>n(!1)),[]),s=i((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:l,setFalse:r,toggle:s}]}function qt(e,t,n,a){l((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function jt(e){const t=s(null),n=i((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return qt(globalThis.document,"click",n),t}const $t=({label:e,errors:t})=>e&&t?`${e}*`:e,Ut=()=>{},Wt="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ht=e=>e?o(Me,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Yt=d((({key:e,className:t="",id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:b,pattern:y,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),k=i((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);l((()=>{v&&C.current?.focus()}),[v,C]);const S=g?"pr-3xl":"",T=Kt(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ht(d),N?o("textarea",{className:u("block resize-y min-h-24",Gt,T),id:u("textarea",n),name:a||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,disabled:w},e):o("input",{type:r,className:u("h-14",Gt,S,T),ref:C,id:n,name:a||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:b,pattern:y,disabled:w},e)]}),g]})})),Kt=e=>e?Wt:"border-error",Gt="w-full border rounded-md text-primary-text outline-none p-m",Xt=e=>o("div",{className:"h-6",children:e?o(Me,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Jt=e=>e?.value||"",Zt={url:"suggest/address"},Qt={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:Zt,addressFact:Zt,organizationAddress:Zt,addressCourier:Zt},en=()=>({open:(e,t)=>ce.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>ce.fire("popup",{type:"update",popup:e,...t}),close:()=>ce.fire("popup",{type:"close"})}),tn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function nn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=en(),x=Qt[n],b=i((()=>{h.current=t,f.close()}),[t]),y=i((e=>{b(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[b,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:a,requestData:l={},responseItemHandler:i=Jt}=e,r=(s=i,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`;return fetch(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...l,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...l)=>{a.dispose(),n=setTimeout((()=>{e(...l)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return l((()=>{if(!e||!v.current||h.current===t)return void b();const n=v.current,{top:a,left:l,width:i,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:y}),{top:a+globalThis.scrollY+r,left:l,width:i})}),[e,p,t,y]),v}const an=d((({className:e,label:t,value:n="",placeholder:a,error:l,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:b=!1,disabled:y=!1})=>{const[v,{setFalse:N,setTrue:w}]=Lt(),C=jt(N),k=i((e=>x?e.length<=x&&s(e):s(e)),[s]),S=nn({isOpen:v&&b,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:S,children:o(Yt,{disabled:y,type:p||"text","aria-label":t,label:$t({label:t,errors:r}),valid:Boolean(!l),value:n,onChange:k,onBlur:m,isTextarea:h,placeholder:ln(a,r,t)})}),Xt(l)]})})),ln=(e,t,n)=>t&&!n?`${e}*`:e,rn=e=>e?.text||e?.key||"",sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=d((({popupRef:e,options:t,value:n,query:a,onChange:l,iconVersion:i})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:sn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),l&&l(e)},children:[o("span",{className:"min-h-6",children:rn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:i,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const cn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[b,{setFalse:y,setTrue:v}]=Lt(),[N,w]=a(""),C=un(x,n.length),k=b&&!C,S=i((()=>{w(""),y()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=i((()=>{m.close(),c&&c()}),[c]),h=i((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=jt(u);return l((()=>{if(!e||!p.current)return;const l=p.current,{top:i,left:r,width:s,height:c}=l.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),{top:i+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:b,options:n,value:r,query:N,onChange:f,onClose:S,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[Ht(t),c("div",{className:u("relative",k?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",mn(m,d,C)),onClick:k?S:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:rn(r)||h}),dn(k,g)]}),p&&k?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Yt,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),dn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),mn=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),un=(e,t)=>e||0===t,hn=d((({className:e="",label:t,error:n,errors:a,...l})=>c("div",{className:e,children:[o(cn,{...l,valid:!n,label:$t({label:t,errors:a})}),Xt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",bn=e=>fn(e??xn),yn=e=>gn((e=>e?.key&&""!==e?.key))(e??xn),vn=e=>gn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??xn),Nn=e=>gn((e=>"string"==typeof e&&e.length>1))(e??xn),wn=(e,t)=>gn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??xn),Cn=e=>gn((e=>"string"==typeof e&&6===e.length))(e),kn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,gn((e=>"string"==typeof e&&t.test(e))))(e);var t},Sn=gn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Tn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},In=e=>Boolean("0"===e.qc&&"0"===e.qcComplete&&"2"===e.qcHouse),Bn=()=>gn(In)("Укажите регион, город/населенный пункт, улицу, дом, квартиру"),Pn={typeForm:bn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:yn(),addressBranch:yn(),phone:kn("Укажите номер телефона"),secondaryPhone:kn("Укажите номер телефона"),organizationPhone:kn("Укажите номер телефона"),birthday:bn("Укажите дату рождения"),birthPlace:bn("Укажите место рождения"),education:bn("Выберите ваше образование"),housing:bn("Выберите тип жилья"),employment:bn("Выберите информацию о трудоустройстве"),organization:bn("Выберите тип организации"),amountWorkers:bn("Выберите информацию о количестве сотрудников"),employerActivities:bn("Выберите вид деятельности организации"),employerOrganization:bn("Выберите вид организации"),positionOrganization:bn("Выберите вашу должность"),dulSerie:(Rn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Rn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:bn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:bn("Укажите организацию, выдавшую паспорт"),email:(e=>gn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Nn(),inn:(e=>gn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:bn("Укажите ОПФ"),organizationName:bn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:bn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:bn(),collectionCount:bn(),comment:bn(),acquiringType:yn(),feedbackMethod:yn(),serviceType:yn(),serviceDirection:yn(),meetingDay:bn(),product:bn(),localities:bn(),consentDataProcessing:Sn,annualRevenue:bn(),consentToReceiveMaterials:Sn,processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentInformFlg:Sn,familyStatus:bn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(Tn)(e))("Некорректный номер СНИЛС"),conscription:bn(),armyIdFlg:Sn,sex:bn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:gn((e=>Boolean(e.fiasCode&&e.city&&e.house)))("Укажите регион, город/населенный пункт, улицу, дом"),participantDateRegistration:bn("Укажите дату регистрации"),retirementIncome:bn(),otherIncome:bn(),mandatoryIncome:bn(),otherPayments:bn(),disablePeopleFlg:bn(),bankruptcyFlg:bn(),shareholderFlg:bn(),legalEntityName:bn(),bankEmployeeCode:bn(),partInBusiness:bn(),regionRetail:yn("Выберите филиал банка"),addressRetail:yn("Выберите адрес банка"),addressMatch:bn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&/^[\u0400-\u04FF\d]+$/u.test(e)))(e??xn))("Необходимо ввести кодовое слово"),confirmationIncome:bn(),deliveryDate:bn("Укажите дату доставки"),addressCourier:Bn()};var Rn;const Dn=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,Pn?.[e||""]])).filter((([,e])=>e)))},Mn=(e,t)=>{const{value:n,isDirty:a}=e,l=a?t(n):[];return{...e,errors:l,error:l[0]}},An=(e,t,n=!1)=>n&&t?Mn(e,t):e,_n=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],zn=d((({field:e,input:t})=>o(hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:_n,...An(e("acquiringType"),Pn.acquiringType,t?.required)}))),En=(e="")=>Boolean("trade"===e||"all"===e),Fn=e=>null!=e,Vn=new Map,On=e=>Boolean(e?.every((e=>Array.isArray(e)?On(e):!e||"string"==typeof e))),Ln=e=>On(e)?e.toString():"";function qn(e,t,{fallback:n,cache:i}={}){const s=r((()=>jn(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);l((()=>{if(!s.some(Fn))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=Vn)=>n=>{const a=Ln(n),l=t.get(a);if(a&&Fn(l))return l;const i=e(...n);return a&&Fn(i)&&t.set(a,Promise.resolve(i)),i})(t,i)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,i,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function jn(e){return Array.isArray(e)?e:e instanceof Function?jn(e()):[e]}const $n=[];const Un=async e=>await rt(e,{method:"GET"})||$n;function Wn(e=!1){const{data:t}=qn("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),st);return Array.isArray(t)?t:[]}const Hn=d((({field:e,input:t,isPremium:n=!1})=>{const a=e("region"),i=a?.value?.key,r=a?.value?.text,s=n?Wn(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=qn(e?`/api/v1/branches?regionCode=${e}`:null,Un);return t||$n}(i)?.filter((e=>e?.address));return l((()=>{""!==a?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[a?.value]),o(hn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...An(e("addressBranch"),Pn.addressBranch,t?.required),isSearch:!0})})),Yn=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");l((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);const s=i((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=i((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{label:"Адрес",disabled:r,...An(e(n),Pn[n],t?.required),value:a.fullAddress,onChange:c,...t,onDaDataChange:s})})),Kn=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Gn=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,l=i((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),r=i((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,n),label:"Адрес",...An(e(n),Pn[n],t?.required),value:a.fullAddress,onChange:r,...t,onDaDataChange:l})})),Xn=d((({className:e,viewBox:t,fill:n="none",width:a,height:l,paths:i,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:l,children:i.map((({d:e,fill:t,...n},a)=>{const l={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:l.stroke,strokeLinecap:l.strokeLinecap,strokeLinejoin:l.strokeLinejoin,strokeWidth:l.strokeWidth,strokeMiterlimit:l.strokeMiterlimit},a)}))}))),Jn="appearance-none w-5 h-5 border-solid flex-none",Zn=[{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"}],Qn=d((({className:e,value:t,text:n,disabled:a,isRadio:l,onChange:r})=>{const s=i((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=l?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Xn,{paths:Zn,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",ta(a)),onClick:s,children:[o("div",{className:u(Jn,"m-0",l?"rounded-full border-2":aa(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:na(l),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,ea(n)]})})})),ea=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,ta=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",na=(e=!1)=>e?"radio":"checkbox",aa=(e=!1)=>u("rounded border",{"bg-primary-main":e}),la=d((({className:e,text:t,value:n,key:a,disabled:l,error:i,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Qn,{text:t,value:n,disabled:l,onChange:r},a),Xt(i)]}))),ia=d((({field:e,input:t})=>o(la,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...An(e("addressMatch"),Pn.addressMatch,t?.required)}))),ra=(e,{normalize:t,format:n})=>{const{value:l,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=i((e=>{d(!0),r&&r(e)}),[]),u=i((()=>{d(!1),o&&o(t(l)),s&&s()}),[o,l]);return{value:c||!n?l:n(l),onFocus:m,onBlur:u}},sa=(e,t,n)=>Math.max(t,Math.min(e,n));function oa(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function ca({list:e=[],min:t,max:n,step:a,value:l=e[0]||t,disabled:i,onChange:r}){const s=e.length?e.indexOf(l):l,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||i?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:i,onChange:t=>{const n=oa(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const da=1,ma=100,ua=d((e=>{const{className:t,title:n,items:a=[],list:l=[],min:r=(l.length?0:da),max:s=(l.length?l.length-1:ma),step:d=1,value:m=l[0]||r,disabled:h=!1,onChange:p}=e,g=ra(e,{normalize:(e=0)=>l.length?ha(l)(e):sa(e,r,s),format:Ue()}),f=i((e=>{p&&p(oa(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",Wt,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),ca({list:l,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),pa(a)]})})),ha=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),pa=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),ga=["От 1 000 ₽","До 1 000 000 000 ₽"],fa=d((({field:e})=>o(ua,{title:"Сумма, ₽",items:ga,min:1e3,max:1e9,...e("amount")}))),xa=e=>{const{data:t,error:n}=qn(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,ba);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},ba=async e=>await rt(e,{method:"POST"})||[],ya=ht((({field:e,source:t,label:n,fieldName:a,input:l})=>{const i=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:"Выберите из списка",label:n,options:i,...An(e(a),Pn[a],l?.required)})})),va=d((({field:e,input:t})=>{const{data:n}=xa("EMPLOYEES_NUMBER");return o(ya,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Na=d((({field:e,input:t})=>o(an,{label:"Годовая выручка, ₽",...An(e("annualRevenue"),Pn.annualRevenue,t?.required)}))),wa=d((({field:e,input:t})=>o(la,{text:"Наличие военного билета",...An(e("armyIdFlg"),Pn.armyIdFlg,t?.required)}))),Ca=d((({field:e,input:t})=>o(an,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...An(e("bankEmployeeCode"),Pn.bankEmployeeCode,t?.required),...t}))),ka=d((({field:e})=>o(an,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Sa=d((({field:e,input:t})=>o(la,{text:"В отношении меня ведётся производство по делу о банкротстве",...An(e("bankruptcyFlg"),Pn.bankruptcyFlg,t?.required)}))),Ta=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:l,min:i,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(l,a,d),n=Ia(t,e),c=Ba(t,i,r);u.push(o("td",{children:o("div",{className:Pa(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ia=(e,t)=>t&&e.toDateString()===t.toDateString(),Ba=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Pa=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Ra=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Da=d((({today:e,currentMonth:t,currentYear:n,min:a,max:l,onDateSelect:s=Ut,setValue:d=Ut})=>{const m=i((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Ra.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Ta({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:l,onDateClick:m})})]})})),Ma=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Aa(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const a=[...t],l=a.findIndex(_a),i=a.map(((e,t)=>Ea(e)?a.slice(0,t).filter(Ea).length:-1)),r=a.map(((e,t)=>za(e)?e:n.charAt(i[t])||e)),s=i.indexOf(n.length-1)+1;return r.slice(0,Math.max(l,s)).join("")}const _a=e=>"_"===e,za=e=>/\d/.test(e),Ea=e=>_a(e)||za(e),Fa=1940,Va={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Oa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:i,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(i||"");return l((()=>{g(i||"")}),[i]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Aa(t,"__.__.____"))},onBlur:()=>{if(La(p)){const[n,a,l]=p.split(".");d?.(new Date(Number(l),Number(a)-1,Number(n))),e(Number(a)-1),t(Number(l))}else g(i||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Va})]})})),La=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Fa&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let l=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),l++;if(Number(t)>0&&Number(t)<=l)return!0}return!1},qa=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:l,setSelectedYear:i,disabled:r=!1})=>o(Oa,{onChange:a,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:l,setSelectedYear:i,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),ja=Ma.map((e=>({key:e}))),$a=Array.from({length:(new Date).getFullYear()-Fa+1},((e,t)=>Fa+t)).reverse().map((e=>({key:String(e)}))),Ua=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},Wa=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:l})=>{a&&l?.(new Date(t,n,Math.min(e,a.getDate())))},Ha={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Ya={className:"min-w-32",iconVersion:"black",isBorder:!1},Ka=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=Lt(!1),[f,x]=a(n?.getMonth()||(new Date).getMonth()),[b,y]=a(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:k,yearsOptions:S,handleChangeVisibleCalendar:T,ref:I}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:l,selectedYear:r,onChange:s,value:o})=>{const c=jt(i((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:i((()=>e(!t)),[t]),handleNextMonth:i((()=>{n+1<=11?a(n+1):(a(0),l(r+1))}),[n]),handlePrevMonth:i((()=>{n-1>=0?a(n-1):(a(11),l(r-1))}),[n]),handleSelectMonth:i((({key:e})=>{a(Ma.indexOf(e));const t=Ua(r,Ma.indexOf(e));Wa({maxDateOfMonth:t,selectedYear:r,selectedMonth:Ma.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:i((({key:e})=>{l(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ja,yearsOptions:$a,ref:c}})({onYearSelect:y,onMonthSelect:x,onShowCalendar:g,selectedYear:b,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,i]=a(!1);return l((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();i(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(I,370);return c("div",{className:u("space-y-xs",e),ref:I,children:[Ht(t),c("div",{className:"relative",children:[qa({handleChangeVisibleCalendar:T,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:y}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...Ha,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:Ma[f]},options:k,...Ya}),o(cn,{onChange:C,value:{key:String(b)},options:S,...Ya}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Ha,className:"rotate-90 cursor-pointer"})})]}),o(Da,{today:n,currentMonth:f,currentYear:b,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Ga=d((({className:e,label:t,error:n,errors:a,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ka,{label:$t({label:t,errors:a}),valid:Boolean(!n),...l}),Xt(n)]}))),Xa=d((({field:e,input:t})=>o(Ga,{label:"Дата начала работы на текущем месте",...An(e("beginDate"),Pn.beginDate,t?.required),...t}))),Ja="birthday",Za=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:a}=e(Ja);return o(Ga,{label:"Дата рождения",...An(e(Ja),Pn.birthday,t?.required),error:n&&a&&!Qa(a)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&Kn(e,Ja)})})),Qa=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},el=d((({field:e,input:t})=>o(an,{label:"Место рождения",...An(e("birthPlace"),Pn.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Kn(e,"birthPlace")}))),tl=d((({field:e,input:t})=>{const{data:n}=xa("CARD_TYPE");return o(ya,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),nl=d((({field:e,input:t})=>o(an,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...An(e("children"),Pn.children,t?.required),...t}))),al=d((({field:e,input:t})=>o(an,{label:"Кодовое слово",...An(e("codeWord"),Pn.codeWord,t?.required),...t}))),ll=d((({field:e,input:t})=>o(an,{label:"Количество объектов инкассации",type:"number",...An(e("collectionCount"),Pn.collectionCount,t?.required)}))),il=d((({field:e,input:t})=>o(an,{className:"col-span-2",...An(e("comment"),Pn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),rl=d((({field:e,input:t})=>{const{data:n}=xa("INCOME_CERT_UNITED");return o(ya,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),sl=d((({field:e,input:t})=>{const{data:n}=xa("MILITARY_STATUS");return o(ya,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ol={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}};async function cl(e,t,n){const a=await fetch(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...ml()},credentials:"include",body:n?JSON.stringify(n):null});return dl(a)?a.json():a}const dl=e=>"application/json"===e.headers.get("Content-Type"),ml=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},ul=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await cl(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return await n.blob()})(e,t);return URL.createObjectURL(n)},hl=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),pl=d((({className:e,head:t,children:n,onClose:a,onClick:l})=>{const{close:r}=de(),s=i((()=>{r(),a&&a()}),[a]);return c("div",{onClick:l,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(hl,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),gl=async(e,t,n=!1)=>{const a=await ul(t,n);e(o(pl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:a}):o("iframe",{src:`${a}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},fl=d((({className:e,error:t,docId:n,...a})=>{const{open:l}=de(),i=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Qn,{...a}),n?o(ye,{className:"text-primary-main",onClick:()=>gl(l,n,i),children:o(Me,{children:"Ознакомиться"})}):null]}),Xt(t)]})})),xl=d((({field:e,input:t})=>t&&t.name?o(fl,{text:ol[t.name]?.text,docId:ol[t.name]?.docId,...An(e(t.name),Pn[t.name],t?.required)}):null)),bl=d((({field:e,input:t})=>{const{data:n}=xa("CREDIT_IN_RSHB");return o(ya,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),yl={horizontal:"@lg:flex-row",vertical:""},vl=d((({label:e,items:t,value:n,className:a,onChange:l,disabled:i=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Me,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",yl[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(Qn,{isRadio:!0,text:t,value:n===e,onChange:()=>l&&l(e),disabled:i},String(e))))})]}))),Nl=d((({className:e,label:t,onChange:n,error:a,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(vl,{label:$t({label:t,errors:l?.errors}),onChange:e=>n&&n(e),...l}),Xt(a)]}))),wl=[{id:"rub",text:"Рубль"}],Cl=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency");return o(Nl,{label:"Валюта",orientation:"horizontal",items:wl,value:n,onChange:e=>a?.(e),...An(e("currency"),Pn.currency,t?.required)})})),kl=d((({field:e,input:t})=>o(Ga,{label:"Дата доставки",...An(e("deliveryDate"),Pn.deliveryDate,t?.required)}))),Sl=d((({field:e,input:t})=>o(an,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...An(e("dependents"),Pn.dependents,t?.required),...t}))),Tl=d((({field:e,input:t})=>o(Ga,{label:"Желаемая дата встречи",...An(e("desiredMeetingDate"),Pn.meetingDay,t?.required)}))),Il=d((({field:e,input:t})=>o(la,{text:"Являюсь инвалидом",...An(e("disablePeopleFlg"),Pn.disablePeopleFlg,t?.required)}))),Bl="dulIssueDateField",Pl=d((({field:e,input:t})=>o(Ga,{label:"Дата выдачи",...An(e(Bl),Pn.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Kn(e,Bl)}))),Rl="dulIssuedBy",Dl=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),l=i((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,Rl),label:"Кем выдан",...t,...An(e(Rl),Pn.dulIssuedBy,t?.required),onDaDataChange:l,daDataQueryPrefix:n})})),Ml=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Kn(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...An(e("dulNumber"),Pn.dulNumber,t?.required)}))),Al=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Kn(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...An(e("dulSerie"),Pn.dulSerie,t?.required)}))),_l="dulSubdivisionCode",zl=d((({field:e,input:t})=>{const n=i((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(an,{disabled:t?.filledByEsia&&Kn(e,_l),label:"Код подразделения",type:"number",maxLength:6,...t,...An(e(_l),Pn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),El=d((({field:e,input:t})=>{const{data:n}=xa("EDUCATION_LEVEL");return o(ya,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Fl=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(an,{label:"Электронная почта",...An(e("email"),Pn.email,n),...a})})),Vl=d((({field:e,input:t})=>{const{data:n}=xa("ORGANIZATION_ACTIVITY_TYPE");return o(ya,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Ol=d((({field:e,input:t})=>{const{data:n}=xa("ORGANIZATION_KIND");return o(ya,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Ll=d((({field:e,input:t})=>{const{data:n}=xa("EMPLOYMENT_INFO_UNITED");return o(ya,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),ql=d((({field:e,input:t})=>o(an,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...An(e("expenses"),Pn.expenses,t?.required),...t}))),jl=d((({field:e,input:t})=>o(an,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...An(e("experience5Years"),Pn.experience5Years,t?.required),...t}))),$l=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),a=e("familyStatus")?.value?.key,i="MARRIED"===a?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=i+r+s;return l((()=>{e?.("familyMembers")?.onChange?.(c)}),[a,r,s]),o(an,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Ul=d((({field:e,input:t})=>{const{data:n}=xa("MARITAL_STATUS");return o(ya,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Wl=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Hl=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Yl=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Kl=d((({field:e,input:t})=>o(hn,{label:"Способ получения ответа",options:Yl,...An(e("feedbackMethod"),Pn.feedbackMethod,t?.required)}))),Gl=d((({field:e,input:t})=>o(an,{label:"ФИО",...An(e("fullName"),Pn.fullName,t?.required),...t}))),Xl=d((({field:e,input:t})=>o(an,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...An(e("generalSeniority"),Pn.generalSeniority,t?.required),...t}))),Jl=d((({field:e,input:t})=>{const{data:n}=xa("HOUSE_TYPE");return o(ya,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Zl=d((({field:e,input:t})=>{const n=i((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"ИНН",type:"number",maxLength:12,...t,...An(e("inn"),Pn.inn,t?.required),onDaDataChange:n})})),Ql=d((({field:e})=>o(la,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),ei=d((({field:e,input:t})=>o(an,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...An(e("jobsNumber"),Pn.jobsNumber,t?.required),...t}))),ti=d((({field:e,input:t})=>o(an,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...An(e("lastJobExperience"),Pn.lastJobExperience,t?.required),...t}))),ni=d((({field:e,input:t})=>o(an,{label:"Наименование юридического лица",...t,...An(e("legalEntityName"),Pn.legalEntityName,t?.required)}))),ai=d((({field:e,input:t})=>o(an,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...An(e("legalForm"),Pn.legalForm,t?.required),...t}))),li=[];async function ii(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:li}const ri=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:a}=qn("outServiceRegions",ii),i=a?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return l((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:i,...An(e("localities"),Pn.localities,t?.required),isSearch:!0})})),si=d((({field:e,input:t})=>o(an,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...An(e("mandatoryIncome"),Pn.mandatoryIncome,t?.required),...t}))),oi=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],ci=d((({field:e,input:t})=>o(Nl,{orientation:"horizontal",items:oi,...An(e("methodObtain"),Pn.methodObtain,t?.required)}))),di="middleName",mi=d((({field:e,input:t})=>o(an,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Kn(e,di),...An(e(di),Pn.middleName,t?.required),...t}))),ui=d((({field:e,input:t})=>o(an,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Kn(e,t.name??""),...An(e("name"),Pn.name,t?.required),...t}))),hi=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),pi=d((({field:e})=>En(e("acquiringType")?.value?.key)?o(hi,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),gi=d((({field:e,input:t})=>{const{data:n}=xa("ORGANIZATION_TYPE");return o(ya,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),fi=d((({field:e,input:t})=>{const n=i((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"Наименование организации",...t,...An(e("organizationName"),Pn.organizationName,t?.required),onDaDataChange:n})})),xi=d((({field:e,input:t})=>o(an,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...An(e("otherIncome"),Pn.otherIncome,t?.required),...t}))),bi=d((({field:e,input:t})=>o(an,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...An(e("otherPayments"),Pn.otherPayments,t?.required),...t}))),yi=d((({field:e,input:t})=>o(Ga,{label:"Дата регистрации по месту жительства",...An(e("participantDateRegistration"),Pn.participantDateRegistration,t?.required)}))),vi=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,a={...An(e("partInBusiness"),Pn.partInBusiness,t?.required)};return o(an,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...a,...t,onChange:e=>a?.onChange&&a?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?a?.value:"",disabled:!n})})),Ni=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(an,{...An(e("partnerComments"),Pn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),wi=[{id:"mir",text:"Карта МИР"},{id:"union_pay",text:"UnionPay"}],Ci=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("paymentSystem");return o(Nl,{label:"Платежная система",orientation:"horizontal",items:wi,value:n,onChange:e=>a?.(e),...An(e("paymentSystem"),Pn.paymentSystem,t?.required)})})),ki=e=>"_"===e,Si=e=>/\d/.test(e),Ti=e=>ki(e)||Si(e),Ii=[..."+7 (___) ___-__-__"],Bi=Ii.findIndex(ki),Pi=Ii.map(((e,t)=>Ti(e)?Ii.slice(0,t).filter(Ti).length:-1));function Ri(e){const t=e.replace(/\D/g,""),n=Ii.map(((e,n)=>Si(e)?e:t.charAt(Pi[n])||e)),a=Pi.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(Bi,a)):n).join("")}const Di=d((({children:e,onChange:t,...n})=>{const a=i((e=>t&&t(Ri(e))),[t]),l=i((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),Mi=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Di,{"aria-label":t,label:$t({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),Xt(n)]}))),Ai=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Mi,{label:"Телефон",...An(e(n),Pn.phone,t?.required),disabled:t?.filledByEsia&&Kn(e,n),...t})})),_i=d((({field:e,input:t})=>{const{data:n}=xa("POSITION");return o(ya,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),zi=d((({field:e})=>En(e("acquiringType")?.value?.key)?o(hi,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ei=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:Fi(t?.productList),...Mn(e("product"),Pn.product)}))),Fi=e=>(e??[]).map((e=>({key:e,value:e})));function Vi(e="/api/v1/regions"){const{data:t}=qn(e,st);return Array.isArray(t)?t:[]}const Oi=d((({field:e,input:t,url:n})=>{const a=Vi(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>a?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[a]),...An(e("region"),Pn.region,t?.required)})})),Li=d((({field:e,input:t})=>{const n=Wn(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:a,...An(e("region"),Pn.region,t?.required)})})),qi=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:l,renderFoldButton:r})=>{const[s,o]=a(n),d=i((()=>{o((e=>!e))}),[]),m=l({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const ji=d((({className:e="",isUnfolded:t,children:n})=>{const a=s(null),i=function(e,t){const n=s(null);return l((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:`transition-max-h duration-300 overflow-hidden ${a.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:i,children:n})})})),$i=d((({value:e,subText:t,children:n,isPhone:a,...l})=>{const i=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[i.length,n,t].every((e=>!e))?null:Ui({textItems:i,subText:t,children:n,isPhone:a,...l})})),Ui=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:l,className:i,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",i),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Wi(n,s),l?o(Me,{color:a,size:"text-m",children:l}):null]}),Wi=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${Hi(e)}`,children:e.trim()}):e.trim()},String(n)))),Hi=e=>e.replace(/\D/g,""),Yi=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),Ki=e=>{const t=Xi(e);return o($i,{label:"Режим работы",value:t,className:"max-w-none"})},Gi=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Xi=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Gi({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Gi({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},Ji=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Zi=e=>Ji.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),Qi=e=>{if(!e)return null;const t=er(e);return c(Yi,{className:"border-none",children:[o($i,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(tr)})}),o($i,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},er=e=>{const t=Ji.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},tr=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Me,{size:"text-xs",children:e})},String(n)),nr=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o($i,{label:"Валюта",value:e.currency}):null,t?o($i,{label:"Купить",value:String(t)}):null,n?o($i,{label:"Продать",value:String(n)}):null]},String(a)),ar={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"}},lr=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",ar[n].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(Me,{size:"text-m",color:ar[n].text,children:t})]}))),ir=(new Date).getDay(),rr=e=>{const[t]=e?.slice(ir-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:l,hasLunch:i}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[l?o(lr,{color:"green",children:l}):null,n&&i?o(lr,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(lr,{color:"red",children:"Выходной"})},sr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",or=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:l},i)=>o($i,{label:e,value:t&&n?n:"",subText:sr({lunchHour:a,hasLunch:l,status:t}),subColor:!t||l?"text-error":"text-green-dark"},String(i)),cr=["ArrowDownIcon","ArrowUpIcon"],dr=["Подробнее","Скрыть"],mr=({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:dr[Number(e)]}),o(W,{className:"text-primary-text",name:cr[Number(e)],width:"16",height:"16"})]}),ur=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,hr=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,pr=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,gr=({name:e,address:t,phone:n,fax:a,phoneBusiness:l,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=Zi(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(Me,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),rr(h)]}),o("div",{className:"hidden sm:block",children:fr({phone:n,fax:a,phoneBusiness:l,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(qi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ji,{isUnfolded:e,children:fr({phone:n,fax:a,phoneBusiness:l,phoneNatural:i,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(u))},fr=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:l,phoneCurrencyControl:i,workSchedule:r,exchangeRate:s})=>{const d=Zi(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Yi,{className:"flex-wrap border-b border-solid border-main-divider",children:[o($i,{label:"Факс",value:t,isPhone:!0}),o($i,{label:"Телефон филиала",value:e,isPhone:!0}),o($i,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o($i,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o($i,{label:"Для консультаций по валютному контролю",value:i,isPhone:!0}),o($i,{label:"Контакт-центр",value:l,isPhone:!0})]}),r?.isMatchesPattern?o(Yi,{children:o($i,{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(or)})})}):c(Yi,{children:[o($i,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(tr)})}),Ki(d)]}),r?.businessScheduleVisibleTag?Qi(r?.businessScheduleDescription):null,s?.currencies?.length?o(Yi,{className:"flex-wrap",children:s?.currencies?.map(nr)}):null]})},xr=({name:e="",address:t="",workSchedule:n})=>{const a=(l=e)?`${l?.charAt(0)?.toUpperCase()}${l?.slice(1)}`:"";var l;const i=`${t} ${(e=>{const t=Zi(e),n=e?Xi(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ur(n):pr(n,a):hr(n):null})(n)}`;return{header:a,body:i}},br=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),yr=d((({children:e})=>br?e:null)),vr=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),Nr="/icons/MapMarkerClusterIcon.svg",wr="/icons/MapMarkerClusterYellowIcon.svg";function Cr({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const l=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),i=kr("offices",e,l);if(n.length&&n.every((e=>"type"in e))){const a=kr("workplaces",e,l),r=Sr(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Sr(n.filter((e=>"offices"===e.type)),"offices",e);i.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(i)}else{const a=Sr(n,"offices",e);i.add(a),t.geoObjects.add(i)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const kr=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?Nr:wr,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Sr=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?Nr:wr,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Tr={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Ir={...Tr,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Br=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Ir).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),Pr=e=>globalThis[e],Rr=(e,t)=>{const n=document.getElementById(t);if(n){const t=Pr(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(Pr(e))}))}))}return new Promise(((n,a)=>{const l=document.createElement("script");l.src=t,l.async=!0,l.id=t,l.addEventListener("load",(()=>{n(Pr(e))})),l.addEventListener("error",(e=>{a(e)})),document.head.appendChild(l)}))};const Dr=()=>function(e,t,n=!0){const[i,r]=a(void 0);return l((()=>{let a=!0;return Rr(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),i}("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1),Mr={...Tr,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ar=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(Mr).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),_r=[55.753995,37.614069],zr=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:i})=>{const r=s(null),d=Dr();if(l((()=>{r.current?Cr({yandexMaps:d,map:r.current,points:e,isLoad:a}):d?.ready((()=>{r.current||(r.current=new d.Map("map",{center:Er(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Cr({yandexMaps:d,map:r.current,points:e,isLoad:a})}))}),[d,e,n,a,i]),l((()=>{r.current&&i&&d?.geocode(i).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[i]),!d)return null;const m="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[a?o(vr,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",m),children:[o(Ar,{yandexMaps:r}),o(Ar,{yandexMaps:r,direction:"out"})]}),Br(r,d,u("right-2 top-80",m))]})})),Er=e=>{const t=[Vr(Fr(e,0)),Vr(Fr(e,1))];return t.every((e=>e))?t:_r},Fr=(e,t)=>e.map((e=>e.coords?.[t])),Vr=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Or={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Lr={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},qr={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)};function jr({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const $r={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"},Ur={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Wr=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(jr(e))}),{className:a,version:l="primary",active:i,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":i,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},i||r?"":u($r[l],Ur[l]),a),type:s,role:d,onClick:m,children:e})})),Hr=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Yr=(e,t,n)=>{const a=Hr("all"===t),l=Hr("business"===t),i=(e,t,a)=>{const l=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),l},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Wr,{"data-id":"all",onClick:t=>i(t,"all",e),version:a,children:"Для физических лиц"}),o(Wr,{"data-id":"business",onClick:t=>i(t,"business",e),version:l,children:"Для юридических лиц"})]})},Kr=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(Re,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(Me,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Gr="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Xr=({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:l})=>{const i=a?5:6,r=(e||[]).map((e=>o(Qn,{text:l[e],...t(e)},e))),[s,d]=i>0?[r.slice(0,i),r.slice(i)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(qi,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Gr,children:s}),o(ji,{className:Gr,isUnfolded:e,children:d})]}),renderFoldButton:Jr(n,a)})}):null})},Jr=(e,t=!1)=>({isUnfolded:n,onToggle:a})=>c("div",{className:"flex space-x-lg",children:[t?o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:a}):null,o(ye,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Zr()})]}),Zr=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Qr=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(N,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),es=()=>{},ts=e=>"all"===e?"block":"hidden",ns=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:l=[],renderCard:i=es,renderRemoteWorkplaceCard:r=es,getBalloon:s=es,getBalloonRemoteWorkplaces:d=es,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=Et(Or),{filteredItems:b,points:y,filteredRemoteWorkplaces:v,lengthItems:N}=rs({data:t,remoteWorkplaces:l,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),k={filters:ls([...t,...l]),field:{field:f,reset:x},onlyOffice:p,labels:Lr};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Qr(h,N),m?Kr(m):null,p&&Yr(t,w,C),o("div",{className:u("pb-3xl",ts(w)),children:Xr(k)})]}),o("div",{className:"h-[600px]",children:o(yr,{children:o(zr,{points:y,isLoad:n,className:"h-full"})})})]}),c(yr,{children:[b.map(i),v.map(r)]})]})})),as=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>qr[t](e)))))},ls=e=>Object.keys(Or).filter((t=>e.filter((e=>qr[t](e))).length)),is=()=>{},rs=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=is,getBalloonRemoteWorkplaces:l=is})=>{const[i,s,o,c]=r((()=>{const i=as(e,n),r=as(t,n),s=[...i.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:l({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[i,s,r,i.length+r?.length]}),[e,t,n,a,l]);return{filteredItems:i,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},ss=d((({field:e,input:t})=>{const n=e("regionRetail"),a=e("addressRetail"),i=Wn(),r=n?.value?.key,s=i.find((({region:e})=>e===r)),d=!i,m=n?.value?.text,u=Wn()?.find((e=>e?.region===m))?.branches;l((()=>{""!==n?.value?.key&&e?.("addressRetail")?.onChange?.("")}),[n?.value]);const{points:h}=rs({data:s?.branches||[],filtrationState:{},getBalloon:xr}),p=Boolean(n?.value?.key);return c("div",{children:[o(hn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:(u||[]).map((({address:e=""})=>({key:e,text:e}))),...An(e("addressRetail"),Pn.addressRetail,t?.required&&p),isSearch:!0}),o("div",{className:"h-[600px]",children:o(yr,{children:o(zr,{points:h,isLoad:d,className:"h-full",selectedAddress:a?.value?.text})})})]})})),os=d((({field:e,input:t})=>{const n=Wn();return o(hn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:r((()=>n?.map((({region:e=""})=>({key:e,text:e})))),[n]),...An(e("regionRetail"),Pn.regionRetail,t?.required)})})),cs=d((({field:e,input:t})=>o(an,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...An(e("retirementIncome"),Pn.retirementIncome,t?.required),...t}))),ds=d((({field:e})=>{const t=e("secondaryPhone");return o(Mi,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Mn(t,Pn.secondaryPhone):t})})),ms=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Hl,...An(e("serviceDirection"),Pn.serviceDirection,t?.required)}))),us=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],hs=d((({field:e,input:t})=>o(Nl,{label:"Пол",orientation:"horizontal",items:us,...An(e("sex"),Pn.sex,t?.required)}))),ps=d((({field:e,input:t})=>o(la,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...An(e("shareholderFlg"),Pn.shareholderFlg,t?.required)}))),gs=d((({children:e,onChange:t,...n})=>{const a=i((e=>t&&t(Aa(e,"___-___-___ __"))),[t]),l=i((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),fs=d((({className:e,label:t,value:n,error:a,onChange:l,onBlur:i,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gs,{"aria-label":t,label:$t({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:l,onBlur:i,placeholder:"___-___-___ __"}),Xt(a)]}))),xs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(fs,{label:"СНИЛС",...An(e("snils"),Pn.snils,!!n&&t?.required),...t})})),bs=d((({field:e,input:t})=>o(an,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Kn(e,"surname"),...An(e("surname"),Pn.surname,t?.required),...t}))),ys=["От 1 мес","До 15 лет"],vs=d((({field:e})=>o(ua,{title:"Срок, месяцев",items:ys,min:1,max:180,...e("term")}))),Ns=d((({field:e,input:t})=>o(an,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...An(e("totalIncome"),Pn.totalIncome,t?.required),...t}))),ws=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:Wl,...An(e("serviceType"),Pn.serviceType,t?.required)}))),Cs=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],ks=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return l((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(vl,{className:"whitespace-normal",orientation:"horizontal",items:Cs,value:t,onChange:e=>n&&n(e)})})}));const Ss={$ref:"/wcms-resources/outservice-productlist.json"},Ts=(e,t,n=!1)=>(a,l)=>{const i="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(bs,{field:e,input:a}),name:o(ui,{field:e,input:a}),middleName:o(mi,{field:e,input:a}),phone:o(Ai,{field:e,input:a}),organizationPhone:o(Ai,{field:e,input:a}),email:o(Fl,{field:e,input:a}),fullName:o(Gl,{field:e,input:a}),inn:o(Zl,{field:e,input:a}),legalForm:o(ai,{field:e,input:a}),organizationName:o(fi,{field:e,input:a}),generalSeniority:o(Xl,{field:e,input:a}),lastJobExperience:o(ti,{field:e,input:a}),experience5Years:o(jl,{field:e,input:a}),jobsNumber:o(ei,{field:e,input:a}),beginDate:o(Xa,{field:e,input:a}),addressFact:o(Yn,{field:e,input:a}),organizationAddress:o(Gn,{field:e,input:a}),comment:o(il,{field:e,input:a}),addressBranch:o(Hn,{field:e,input:a,isPremium:i}),sex:o(hs,{field:e,input:a}),birthday:o(Za,{field:e,input:a,isRetailForm:n}),birthPlace:o(el,{field:e,input:a}),desiredMeetingDate:o(Tl,{field:e,input:a}),product:o(Ei,{field:e,source:Ss}),localities:o(ri,{field:e,input:a}),isClient:o(Ql,{field:e}),partnerComments:o(Ni,{field:e,input:a}),collectionCount:o(ll,{field:e,input:a}),acquiringType:o(zn,{field:e,input:a}),onlineCheckout:o(pi,{field:e}),posTerminal:o(zi,{field:e}),serviceType:o(ws,{field:e,input:a}),term:o(vs,{field:e}),amount:o(fa,{field:e}),annualRevenue:o(Na,{field:e,input:a}),vedTypes:o(ks,{field:e}),feedbackMethod:o(Kl,{field:e,input:a}),serviceDirection:o(ms,{field:e,input:a}),bankEmpolee:o(ka,{field:e}),secondaryPhone:o(ds,{field:e}),consentToReceiveMaterials:o(xl,{field:e,input:a}),processPersonalDataFlg:o(xl,{field:e,input:a}),consentProviderFlg:o(xl,{field:e,input:a}),consentOthersFlg:o(xl,{field:e,input:a}),consentInformFlg:o(xl,{field:e,input:a}),consentPfrFlg:o(xl,{field:e,input:a}),applicationDate:o(an,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:i?o(Li,{field:e}):o(Oi,{field:e,input:a,url:Ot(t)}),education:o(El,{field:e,input:a}),housing:o(Jl,{field:e,input:a}),employment:o(Ll,{field:e,input:a}),organization:o(gi,{field:e,input:a}),amountWorkers:o(va,{field:e,input:a}),employerActivities:o(Vl,{field:e,input:a}),employerOrganization:o(Ol,{field:e,input:a}),positionOrganization:o(_i,{field:e,input:a}),familyStatus:o(Ul,{field:e,input:a}),children:o(nl,{field:e,input:a}),familyMembers:o($l,{field:e,input:a}),dependents:o(Sl,{field:e,input:a}),totalIncome:o(Ns,{field:e,input:a}),expenses:o(ql,{field:e,input:a}),snils:o(xs,{field:e,input:a}),conscription:o(sl,{field:e,input:a}),armyIdFlg:o(wa,{field:e,input:a}),dulSerie:o(Al,{field:e,input:a}),dulNumber:o(Ml,{field:e,input:a}),dulIssueDateField:o(Pl,{field:e,input:a}),dulSubdivisionCode:o(zl,{field:e,input:a}),dulIssuedBy:o(Dl,{field:e,input:a}),addressRegistration:o(Gn,{field:e,input:a}),addressCourier:o(Gn,{field:e,input:a}),participantDateRegistration:o(yi,{field:e,input:a}),retirementIncome:o(cs,{field:e,input:a}),otherIncome:o(xi,{field:e,input:a}),mandatoryIncome:o(si,{field:e,input:a}),otherPayments:o(bi,{field:e,input:a}),disablePeopleFlg:o(Il,{field:e,input:a}),bankruptcyFlg:o(Sa,{field:e,input:a}),shareholderFlg:o(ps,{field:e,input:a}),legalEntityName:o(ni,{field:e,input:a}),creditInRshbCd:o(bl,{field:e,input:a}),bankEmployeeCode:o(Ca,{field:e,input:a}),partInBusiness:o(vi,{field:e,input:a}),regionRetail:o(os,{field:e,input:a}),addressRetail:o(ss,{field:e,input:a}),addressMatch:o(ia,{field:e,input:a}),paymentSystem:o(Ci,{field:e,input:a}),currency:o(Cl,{field:e,input:a}),cardCategory:o(tl,{field:e,input:a}),codeWord:o(al,{field:e,input:a}),confirmationIncome:o(rl,{field:e,input:a}),methodObtain:o(ci,{field:e,input:a}),deliveryDate:o(kl,{field:e,input:a})};return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})?o("div",{children:r[a?.name||""]},String(l)):null},Is=e=>2===e?"@xl:grid-cols-2":"",Bs=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,Ps=d((function({responseType:e,typeForm:t}){const n="OK"===e,a=n?"ResponseOKIcon":"ResponseFailIcon",{close:l}=de(),r=i((()=>{l()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(pl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:a,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Wr,{type:"button",onClick:r,children:"Хорошо"})]})})})),Rs=e=>{const{open:t,close:n}=de();return{open:(n,a={})=>t(o(Ps,{...e,...n}),a),close:n}},Ds=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Ms=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:l,term:i,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:l,amount:i,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${En(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${i}/Срок=${l}/Выручка=${r}`})(e):null,u={...d,..._s(o),...As(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},As=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},_s=e=>e?{vedTypes:Object.fromEntries(Cs.map((({id:t})=>[t,t===e])))}:{},zs={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:_n[0],serviceType:Wl[0],feedbackMethod:Yl[0],serviceDirection:Hl[0],vedTypes:Cs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},Es=d((({text:e,link:t})=>c(w,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(ye,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),Fs=(e,t)=>o(Wr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Vs=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(Qn,{...e}),o(Es,{link:t})]}),Xt(Mn(e,Sn).error)]}):o(Es,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Fs(n)]}),Os={send:async function(e,t=!1){const{typeForm:n,region:a,phone:l="",email:i,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Nt(a,g),...wt(i,g),...yt(l),...vt(s,"desiredMeetingDate"),...g?vt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ct(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},Ls=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],b=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||zs[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Wl[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[y,v]=a(""),w=Rs({typeForm:n}),C=i((async(e,t)=>{const n=qs(x,e),a=Ds(Dn(n));if(!pn(a(e)))return console.warn("validation fail");const l=Ms({...e,...h}),i=await Os.send(l,"lead"===m)?"OK":"Fail";if(v(i),i&&w.open({responseType:i}),"OK"===i&&g){const e=_t();kt({aspectsAttributes:g,aspects:e,ev:t})}return i}),[]),[,{field:k,onSubmit:S,reset:T}]=Et(b,{onSubmit:C}),I=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return l((()=>{"OK"===y&&(v(""),T())}),[y]),c(Vt,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:S,children:[r.map(((e,t)=>c("div",{className:u(Is(e.columns),"grid gap-x-m"),children:[Bs(e.title),(e?.inputs||[])?.map(Ts(k,n))]},`section-${t}`))),Vs(I?k("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(N,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(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]})})),qs=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const a=t?.[e?.condition?.name??""];return n===(a?.key??a)}))));function js(e){const[t,n]=a(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,i((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const $s=d((({inputs:e=[],typeForm:t="",field:n,key:a})=>{const l=e.every((e=>Boolean(n(e.name).value))),i=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(Mn(n(e?.name),Pn[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(qi,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:a})=>o(ji,{isUnfolded:a,className:"flex flex-col pl-2xl",children:e.map(Ts(n,t))}),renderFoldButton:Us(c("div",{children:[o(Qn,{value:l,onChange:t=>{for(const a of e){const e=n(a.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},a),Xt(i?"Отметьте все обязательные соглашения":"")]}))})})})),Us=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),Ws=({field:e,typeForm:t="",inputs:n,isRetailForm:a=!1})=>{const{consentInputs:l,restInputs:i}=Hs(n||[]);return l.length>2?c("div",{children:[i.map(Ts(e,t,a)),o($s,{inputs:l,field:e})]}):(n||[])?.map(Ts(e,t,a))},Hs=e=>({consentInputs:e?.filter((e=>Object.keys(ol).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ol).includes(e.name||"")))||[]}),Ys={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:_n[0],serviceType:Wl[0],feedbackMethod:Yl[0],serviceDirection:Hl[0],vedTypes:Cs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:""},Ks=(e,t,n="")=>{if(t){const e={...t};return e.birthday=new Date(e?.birthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Ys[e.name||""]]))),typeForm:{key:n,text:""}}},Gs=(e,t)=>o(Wr,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Xs=e=>cl("/user-data/updateUserProfile","PUT",e),Js=e=>cl("/user-data/updateUserTask","PUT",e),Zs={width:"118",height:"24"},Qs={"bg-white":"color",transparent:"white"},eo={"bg-white":"text-primary-main",transparent:"text-white"},to=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Qs[e]},className:eo[e],width:n?.width,height:n?.height}),no={"bg-white":"text-primary-text",transparent:"text-white"},ao=d((({className:e,href:t="/",logo:n,children:a,targetBlank:l,bgColor:i="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:l?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...pe(s),children:[to(i,n?.image,Zs),r?a??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:no[i],size:"",children:n?.title??"Россельхозбанк"})}):null]}))),lo=async({code:e,setHasError:t,close:n,sendCode:a=Ut})=>{const l=await(i={captchaText:e},cl("/sms/checkCaptcha","POST",i));var i;"ERROR"===await l.text()?t(!0):(a(),n?.())},io=async(e,t)=>{const n=await(e=>cl(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET"))(t);e(URL.createObjectURL(await n.blob()))},ro=d((({phoneNumber:e,close:t,sendCode:n,onClose:i})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1);return l((()=>{io(s,e)}),[]),o(pl,{head:o(ao,{}),onClose:i,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:()=>io(s,e),className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Yt,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Wr,{onClick:t,version:"secondary",children:"Вернуться"}),o(Wr,{type:"submit",disabled:!d,onClick:()=>lo({code:d,setHasError:h,close:t,sendCode:n}),version:"secondary",children:"Отправить"})]})]})})})),so=d((({time:e,setTime:t,className:n})=>(l((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:oo(e)})))),oo=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,co=async({phoneNumber:e,captchaDialog:t,setTimeNextReq:n,setIsTimerStarted:a,setAttemps:l})=>{try{await(i={phoneNumber:e,smsCodesSetName:{key:"AUTHENTICATION"}},cl("/sms/sendCode","POST",i)).then((t=>{if("string"!=typeof t&&t.errorMessage&&t.errorMessage.startsWith(`Too many request for phoneNumber [${e}]`))throw t})),l(0),n(180),a(!0)}catch(e){t.open()}var i},mo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);l((()=>{u.current?.[d]?.focus()}),[d]);const h=i((n=>a=>{const{value:l}=a.currentTarget,i=l.slice(0,1);t(e.map(((e,t)=>t===n?i:e))),m(n+1)}),[e]),p=i((n=>a=>{const{key:l}=a;if("Backspace"===l&&!e[n]){const a=n>0?n-1:e.length-1,l=e.map(((e,t)=>t===a?"":e));t(l),m(a)}}),[e]),g=i((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),l=e.map(((e,t)=>t<a.length?a[t]:e));t(l),m(l.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:uo(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),uo=(e,t,n=!1)=>{const a=!t[e];return`w-16 h-20 text-3xl text-center p-2 m-2 border ${n&&a?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},ho=d((({isDisabled:e,onClick:t,text:n})=>o(Wr,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-medium",children:n})}))),po=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},go=({close:e,values:t})=>{const[n,s]=a(!1),[o,c]=a(""),[d,m]=a(!1),[u,h]=a(0),[p,g]=a(!1),[f,x]=a(0),b=i((()=>{s(!1),c("")}),[]),y=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||y),[t]),N=i((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>cl("/sms/checkCode","POST",e).then(po))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),b(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return l((()=>{y?(s(!0),c("Код просрочен")):s(!1)}),[y]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},fo=d((({close:e=Ut,onClose:t=Ut,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=a(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:b,isLoading:y,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=go({values:p,close:e}),T=i((()=>{co({phoneNumber:h,captchaDialog:I,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S})}),[]),I=((e,t)=>{const{open:n,close:a,closeAll:l}=de();return{open:()=>n(o(ro,{close:a,onClose:t,...e})),close:a,closeAll:l}})({phoneNumber:h,sendCode:T},t);return l((()=>{T()}),[]),o(pl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"S",isEmbedded:!0}),d?o(mo,{values:p,setValues:g,errorText:b,hasError:x}):null,bo(v,w,T),o(Re,{itemSize:"list-s",__html:s}),xo(u,N,f),y?o(vr,{blur:!1}):null]})})})),xo=(e,t,n)=>e?o(ho,{isDisabled:t,onClick:n,text:e}):null,bo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-primary-main",children:["Получить новый код можно через",o(so,{className:"text-primary-main ml-1",time:e,setTime:t})]}):o(ye,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),yo=()=>{const{open:e,close:t}=de();return{open:(n,a)=>e(o(fo,{onClose:t,close:n,...a})),close:t}},vo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},No={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},wo=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,l]=a(""),[r,s]=a(!1),{open:d,close:m}=de(),u=Ce(),h=i((()=>{m(),e(n)}),[n]),p=i((e=>{l(e),"REFUSE"===e&&s(!0)}),[]),g=r?No:vo;return o(pl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>gl(d,ko,u),children:o(N,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(w,{align:"text-center",children:g.description}),o(vl,{className:"whitespace-normal",orientation:"horizontal",items:Co,value:n,onChange:p}),o(Wr,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Co=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],ko=2,So=e=>{const{open:t,close:n}=de(),a=yo(),l=(t,l)=>async i=>{n(),"SIGNED"===i&&t?a.open((t=>async n=>{t&&await Xs({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(l),To(t)):e()};return{open:(n,a)=>t(o(wo,{handleSubmit:l(n,a),onClose:e}))}},To=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Io=d((function({handleClose:e}){const t=i((async()=>{const e=await(t={redirectUri:globalThis.location.href},cl("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(pl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex items-center justify-between w-full m-0",children:[o(Wr,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Wr,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Bo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Po={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Ro={mandatoryIncome:"INCOME_AVERAGE",otherPayments:"MANDATORY_PAYMENTS"},Do=e=>Object.entries(e).reduce(((e,[t,n])=>t in Bo?[...e,{contactTypeCd:{key:Bo[t]},value:n}]:e),[]),Mo=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Po){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Po[t]},...a}]}return e}),[]),Ao=e=>Object.entries(e).reduce(((e,[t,n])=>t in Ro?[...e,{incomeTypeCd:{key:Ro[t]},value:n}]:e),[]),_o=({inputs:e,programId:t,nextStepLink:n,saveForm:l})=>{const[r,s]=a(""),[,c]=js("taskId"),[,d]=js("profileId"),[,m]=js("participantId"),u=(e=>{const{open:t,close:n}=de(),a=i((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(Io,{handleClose:a}),e),close:n}})(n),h=So(u.open),p=yo(),g=i(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:i((async n=>{const a=Ds(Dn(e));if(!pn(a(n)))return console.warn("validation fail");try{const{profile:{id:e}}=await(i={profile:{phone:bt(n.phone)}},cl("/public-data/createUserProfile","POST",i));if(e&&n?.phone){const a=async()=>{try{await zo({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:l}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},i=Object.keys(ol).filter((e=>n[e])).map((e=>ol[e]?.text));p.open(a,Eo(n?.phone,i))}}catch{s("Fail")}var i}),[]),responseStatus:r}},zo=async({programId:e,profileId:t,formData:n,saveUserData:a,saveForm:l})=>{const i=Vo(n);await Xs(((e,t)=>{const{name:n="",surname:a="",middleName:l="",birthday:i="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:a,midname:l,birthDate:i&&xt(i,!0),email:s,phone:bt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,i));const{taskId:r,participantId:s}=await(o={profileId:t,programId:e},cl("/user-data/createDraftTask","POST",o));var o;await Js((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:l,surname:i,middleName:r,birthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&xt(s,!0),id:e,midname:r,name:l,surname:i,profile:{id:n},participantContacts:Do({phone:o&&bt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:i})),a(s,r,t),l(n)},Eo=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:bt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${Fo(t)}`}),Fo=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Vo=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Oo=e=>{const{profile:t,addInfo:n,document:a,addressRegistration:l,addressFact:i}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Ri(t?.phone),email:t?.email,dulIssueDateField:a?.dulIssueDate,dulIssuedBy:a?.dulIssuedBy,dulNumber:a?.dulNumber,dulSerie:a?.dulSerie,dulSubdivisionCode:a?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Lo(l),addressFact:Lo(i),esiaAccountTypeCd:t?.esiaAccountType}},Lo=e=>{const{postcode:t,region:n,regionCode:a,locality:l,city:i,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,l||i,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},qo=e=>{const[t,n]=a(!1),[r]=js("profileId"),[s,o]=js("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=i((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},cl("/esia/updateProfileEsia","POST",t));o({...s,...Oo(n)}),globalThis.location.href=e}var t}),[]);return l((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},jo=d((({className:e,title:t,programId:n="",nextStepLink:i="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=a(""),{isLoading:g}=qo(i),[f,x]=js("leadForm"),b=Ks(m,f),{handleSubmit:y,responseStatus:v}=_o({inputs:m,programId:n,nextStepLink:i,saveForm:x});if(v){Rs({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=Et(b,{onSubmit:y});return l((()=>{"OK"===h&&(p(""),C())}),[h]),o(Vt,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(vr,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Is(e.columns),"grid gap-x-m"),children:[Bs(e.title),Ws({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),Gs(s)]})})})),$o=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(Re,{__html:e}),a?.text?o(ye,{className:"text-primary-main",children:a.text}):null]})]}))),Uo=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:l})=>{const[i,r]=a(e),s=100-(e-i)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(so,{interval:e,time:i,setTime:e=>{0===e&&t(),r(e)}})})]}),l?o(Re,{__html:l}):null]})]})})),Wo=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:l,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(Ho,{title:a,items:l}),o(Ho,{title:i,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Wr,{className:"w-full mt-lg",children:s}):null]}))),Ho=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Yo(e)},t)))}):null]})]}):null},Yo=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Ko=d((({title:e,description:t})=>{const n=Ce();return 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(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Go=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Xo=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Jo(e,{sensitivity:t,rootRef:n}={}){const a=s(null),i=r((()=>({threshold:Zo(t),root:n?.current})),[t,n?.current]);return l((()=>{if(!a.current)return;const t=new IntersectionObserver(e,i);return t.observe(a.current),()=>{t.disconnect()}}),[e,i]),a}function Zo(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Qo=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:l,children:r,onIntersection:s})=>{const c=Jo(i((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),l);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:c,role:"listitem",children:r})})),ec=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],tc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:l=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},b=s([]),y=i(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,g&&g(n),f&&f(ac(n))}),[g,f]),v=l>0?r*Number(l)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?nc(c,v):{},...N?Xo(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(k=(e,n)=>o(Qo,{className:u(m,l?ec[l-1]:"",{"h-full":N},t),style:w?nc(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:y,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),nc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),ac=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),lc={"horizontal-list":"w-6","vertical-list":"h-6"},ic=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,l)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",l===e?lc[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(l)},String(l)),rc=({activeIndex:e,onClick:t})=>(n,a)=>{const l=a===e,i=l?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=l?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=l?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",i),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},sc=e=>e,oc=(e=sc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),cc=oc(),dc=(e=sc)=>oc((t=>-e(t))),mc=dc(),uc=e=>t=>e.scrollWidth/t,hc=e=>(t,n)=>{e.scrollBy({left:n*uc(e)(t),behavior:"smooth"})},pc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[l,r]=a([]),o=i((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=l.length?[dc()(l),oc()(l)]:[-1,-1],m=c>0,u=d<e-1,h=i((()=>{var t;n.current&&(m?hc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=i((()=>{n.current&&(u?hc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=i(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},gc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},fc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=pc({itemCount:s.length}),g=xc(Boolean(s?.length));l((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=i((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(tc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(rc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",gc[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(ic({activeIndex:t,onClick:f,listType:a}))}):null})),xc=(e=!1)=>({behavior:e?"auto":"smooth"}),bc=d((({className:e,disabled:t,...n})=>o(ye,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,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"})}))),yc=d((e=>o(bc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),vc=d((e=>o(bc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Nc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",wc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:l})=>{const{canScrollLeft:i,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!l;return c("div",{className:e,children:[n?Cc(t):null,i?o(yc,{className:u(kc(l),m?"left-1":"left-0"),onClick:s}):null,r?o(vc,{className:u(kc(l),m?"right-1":"right-0"),onClick:d}):null]})})),Cc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Nc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Nc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),kc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),Sc=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:l=1,listType:i="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const b=Array.isArray(g)?g.length:0,[y,v]=pc({itemCount:b,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===i?"relative h-full":""),children:[o(tc,{containerRef:y,activeIndex:N,visibleItemCount:l,gap:n,padding:a,listType:i,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(wc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(fc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:b,listType:i,version:t,navButtons:x,containerRef:y,containerScroll:v})]})})),Tc=({blocksToRender:e,...t})=>o(Sc,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Go(!0)),children:I(e,t)},String(n))})}),Ic=e=>e%2!=0,Bc=d((({textNode:e,iconNode:t,tag:n,onClick:a,justifyContent:l="between",className:i,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===l?"justify-between":"justify-center",i),onClick:a,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Pc=d((({className:e="",label:t,icon:n,dataTheme:a="pc",disabled:l=!1,onClick:i})=>o(Bc,{tag:"button",onClick:i,disabled:l,"data-theme":a,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",l?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Me,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Rc=({isUnfolded:e,onToggle:t})=>o(Pc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Dc=["ArrowDownIcon","ArrowUpIcon"],Mc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Ac=({topItemsCount:e=0,label:t="",block:n,blocksToRender:a=[],...l})=>{const[i,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]];return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(Mc),children:[P(i,{...l.options,parent:n}),Ic(i.length)?o(gt,{className:"col-span-6",...l}):null]}),o(qi,{renderFoldableSection:({isUnfolded:e})=>c(ji,{className:u(Mc),isUnfolded:e,children:[P(r,{...l.options,parent:n}),Ic(r.length)?o(gt,{className:"col-span-6",...l}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(Pc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Dc[Number(n)],dataTheme:l.options?.page?.colorPalette,onClick:a})})]})},_c=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[zc(n,t),Ac({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[zc(n,t),Tc({...a,blocksToRender:t})]});default:return null}})),zc=(e,t)=>e&&!t.length?o(Ko,{...e}):null,Ec=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),Fc=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(hi,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const l=e?.includes(n);t(a?l?(e||[]).filter((e=>e!==n)):[...e||[],n]:l?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),Vc=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:l})=>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,Ec(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Oc(a)).filter(Boolean))]}),n?o("div",{children:o(Wr,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:l,children:n?.text})}):null]}))),Oc=e=>([t,n])=>{const a=n?.type;return"array"===a?Lc(t,e)(n):null},Lc=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Me,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Fc,{items:a,multiple:!n?.single,...t(e)})]},e)};function qc(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const jc=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,$c=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>jc(t[e])||jc(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>jc(t[e])||jc(n[e])||Uc(t[e])<=Uc(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>jc(t[e])||jc(n[e])||Uc(t[e]?.min)>=Uc(n[e]?.min)&&Uc(t[e]?.min)<=Uc(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>jc(t[e])||jc(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>jc(t[e])||jc(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Uc=e=>Number(e||0),Wc=(e,{block:t,page:n,normalize:a=zt})=>{const l=t?.blocks||[],[i,{field:s,reset:o,update:c}]=Et(e),d=r((()=>qc(l,l.map((e=>mt(e.content,n?.fallback))))),[l,n?.fallback]),m=i===e?l:((e,t)=>(n=zt)=>e?.filter((([,e])=>$c(t,n(e)||{}))).map((([e])=>e)))(d,i)(a);return[i,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Hc={},Yc={},Kc=ht((({className:e,filtrationSchema:t=Hc,consumerField:n={},resetButton:a,...l})=>{const[,{blocksToRender:i},{field:r,reset:s}]=Wc(Yc,{block:l.block,page:l.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:Gc(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Gc(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Vc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Wr,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(_c,{blocksToRender:i,...l})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Gc=e=>qc(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Xc=(e=!1)=>e?"text-left":"text-center",Jc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Zc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:a,icon:l,...i})=>{const r=String(a?.width||t);return l?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Jc[n],e),children:o(W,{...i,width:"54%",height:"54%",name:l})}):null})),Qc=d((({className:e="",title:t,benefitList:n,...a})=>{const l=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(N,{headingType:"h3",as:"h2",className:Xc(l),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(ed)}):null]})})),ed=({label:e,description:t,__html:n,icon:a,isDotted:l=!1,iconBgVersion:i},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Zc,{className:"shrink-0",iconBgVersion:i,...a}):null,a?.src?o(ne,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(N,{headingType:"h6",children:e}),o(Me,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Re,{__html:n,isDotted:l,itemSize:"list-s"}):null]}):null]},String(r)),td=e=>({icon:t,title:n,description:a},l)=>c("div",{className:u("flex flex-col gap-1","items-center",{"justify-center":!a&&!n}),children:[n?o(Me,{size:"text-h6",font:"font-normal",align:e,children:n}):null,t?o(ne,{image:t,height:"180",className:"w-auto mx-auto"}):null,a?o(Me,{size:"text-h6",font:"font-normal",align:e,children:a}):null]},String(l)),nd=(e,t,n)=>o("div",{className:`grid gap-2xs ${ad(t)}`,children:e.map(td(n))}),ad=e=>{switch(e){case"3":return"grid-cols-3";case"4":return"grid-cols-4";default:return"grid-cols-5"}},ld=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:l,title:i,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:i,description:l,headlineVersion:"M"}),e?.length?nd(e,a,t):null]}))),id={start:"justify-start",center:"justify-center",end:"justify-end"},rd=d((({buttons:e,className:t="",align:n,...a})=>{const l=n&&u("flex",id[n]);return o(g,{className:u("!bg-transparent",l,t),defaultPadding:"p-0",...a,children:Le(e)})})),sd=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(N,{className:"text-center",title:t}):null,n]}))),od="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",cd="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",dd="flex flex-col gap-y-xl min-w-52",md=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:l})=>o(Me,{size:"text-h3",children:"number"==typeof e?[a,Ue(t,{fixed:n})(e),l].filter(Boolean).join(" "):e}))),ud=d((({className:e,title:t,value:n,color:a="text-secondary-text",...l})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Me,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(md,{value:n,...l}):o(Me,{size:"text-h3",children:"-"})]}))),hd=(e,t)=>e?o(w,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,pd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:l,isShowDepositeName:i,color:r="text-secondary-text"})=>c("div",{children:[o(Me,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:Ue(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),l&&i?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:l}):null]})]}))),gd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Me,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),fd=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:l="text-secondary-text",children:i,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(pd,{title:e,rate:t,unit:n,fractionDigits:a,color:l,...r})}),o(ud,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:l,...r}),i]}):o(gd,{title:e,...r}),xd=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(ua,{items:e?[`От ${Ue(1)(a.min||0)} ${n}`,`До ${Ue(1)(a.max||0)} ${n}`]:[],step:t,...a}),bd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},yd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},vd=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[l,i]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:l=bd.prefMonthsNum,prefTravelBonusRate:i=bd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(i*t)+Math.round(r*n),a);return[c,c*l+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-l)]})(t||yd,n,a);return{...t,...e,monthBonus:l,yearBonus:i}},Nd=ht((({className:e="",title:t,calcSource:n,buttons:a,footnote:l,...i})=>{const[r,{field:s}]=Et({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=vd(r,n);return o(sd,{className:e,title:t,...i,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),xd({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?fd({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:dd,children:[f>=0?o(ud,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Le(a,{isVertical:!0}),hd(l)]})]})})})),wd=Math.round(29.5),Cd=(e,t=0)=>e?.sum?e.sum:t,kd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Sd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Td=({items:e,title:t,mobileTitle:n=t,orientation:a="horizontal",value:l,onChange:i,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Me,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Me,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(vl,{orientation:a,items:e,value:e[l?0:1].id,onChange:t=>i&&i(t===e[0].id),...r})]}),Id=e=>Td({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Bd=" (c капитализацией)",Pd=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:l=[],isCapitalization:i=!1})=>c("div",{className:dd,children:[o(ud,{title:`Доход в конце срока${i?Bd:""}`,value:e,postfix:n,prefix:"+"}),o(ud,{title:`Сумма в конце срока${i?Bd:""}`,value:t,postfix:n}),Le(a,{isVertical:!0}),l?.map(hd)]}),Rd=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Dd([e,t],a),Dd=([e,t],n=[])=>({[e]:n.length?mc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?cc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Md=(e,[t,n],a)=>e>=a[t]&&e<=a[n],Ad={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const _d={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},zd=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:l,isReplenished:i,isMonthlyInterestPayment:r}=e,s=i||l,o=n<90||n>730,c=function(e){const t=e?.rateType?Ad[e?.rateType]:"",{data:n}=qn(t?`/api/v1/depositrates/${t}`:null,st);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Ed(s,e)&&Md(a,["minSum","maxSum"],e)&&Md(n,["minDays","maxDays"],e)))||_d,{rate:m}=d,u=Fd(m,e),h=a+u,p=c||[_d];return{...d,...Dd(["minSum","maxSum"],p),...Dd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Ed=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Fd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:l}=t;return n?Math.round(a*Math.pow((1200+e)/1200,l/30)-a):Math.round(a*e*l/365/100)},Vd=ht((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:l,isShowDepositeName:i,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=Et({moneyValue:Cd(r,1e5),daysValue:kd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=zd(m,s),{income:g,finalSum:f,rate:x,depositeName:b}=p;return o(sd,{className:e,title:t,...d,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(y={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ua,{items:[`От ${Sd(y.min||0)}`,`До ${Sd(y.max||0)}`],step:1,...y})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Od(p,h),Id({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),fd({rate:x,depositeName:b,isShowDepositeName:i}),Pd({income:g,finalSum:f,buttons:n,footnotes:[a,l]})]})});var y})),Od=(e,t)=>c("div",{className:"space-y-s",children:[o(Me,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(Qn,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(Qn,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Ld=(e=[],t=!1)=>qd([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),qd=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},jd=({min:e=0,max:t=0,availableMonths:n,...a})=>o(ua,{items:[`От ${$d(e)}`,`До ${$d(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),$d=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Ud=e=>Td({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Wd=({field:e,defParams:t,calcParams:n,map:a,monthsValue:l="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(sa(t?.[l],n.minMonths,n.maxMonths))},Hd=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:l,moneyExtra:i}=t;if(0===e)return 0;if(n){const t=e/1200;return i?(a+i)*(t+t/(Math.pow(1+t,l)-1)):a*(t+t/(Math.pow(1+t,l)-1))}return Math.round(a/l)+a*(e/1200)},Yd={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Kd=e=>Gd({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Gd({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Gd({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Gd({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Gd=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:l})=>!!n&&!n[l]||t[a]===e[a],Xd=(e,t,n)=>{const{moneyValue:a,monthsValue:l}=e,i=t?.rateRows||[Yd],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Kd({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Rd(["minSum","maxSum"],r,i),{minMonths:c,maxMonths:d}=Rd(["minMonths","maxMonths"],r,i),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:l})=>e?.find((e=>Kd({row:e,userInputParams:t,paramsViewSettings:n})&&Md(a,["minSum","maxSum"],e)&&Md(l,["minMonths","maxMonths"],e)))||Yd)({rateRows:i,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:l}),{rate:u}=m,h=Hd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:l,monthlyPayment:h}},Jd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),Zd={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Qd=ht((({className:e,title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,qd([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=Et({moneyValue:Cd(s,2e5),monthsValue:kd(s,wd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const b=Xd(g,n,r),y=Ud({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return l((()=>{v&&v(sa(g.moneyValue,b.minSum,b.maxSum))}),[b.minSum,b.maxSum]),l((()=>{N&&N(sa(g.monthsValue,b.minMonths,b.maxMonths))}),[b.minMonths,b.maxMonths]),l((()=>{!Jd(s)&&h&&Wd({field:f,defParams:h,calcParams:b,map:Zd,monthsValue:"minMonths"})}),[n,s]),o(sd,{className:e,title:t,...m,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Сумма кредита, ₽",step:500,min:b.minSum,max:b.maxSum,...f("moneyValue"),value:b.moneyValue}),jd({title:"Срок кредита, месяцев",min:b.minMonths,max:b.maxMonths,...f("monthsValue"),value:b.monthsValue}),em({...b,...r},f),o("div",{className:"sm:hidden",children:y})]}),c("div",{className:u(dd,"@4xl:w-1/2"),children:[o(ud,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ud,{title:"Ставка",value:b?.rate,fractionDigits:2,postfix:"%"}),o(ud,{title:"Ежемесячный платёж",value:b.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:y}),Le(a,{isVertical:!0}),hd(i)]})]})})})),em=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(Qn,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(Qn,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(Qn,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(Qn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),tm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[l,i]=t[n];a>=l?t.splice(n-1,2,[e,Math.max(a,i)]):n++}return t},nm={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},am=(e,t,n)=>{const{moneyValue:a,monthsValue:l}=e,i=t?.[0]?rm(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[im({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),im({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),im({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),im({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Md(a,["minSum","maxSum"],t),Md(l||i,["minMonths","maxMonths"],t)].every(Boolean)))||nm,{rate:u}=m,h=lm(u,e),p=a+h,g=t||[nm];return{...m,...Dd(["minSum","maxSum"],g),...Dd(["minMonths","maxMonths"],g),availableMonths:tm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,l)=>t>=e?e+l*n:e-l*n)))(e,t))),...e,defaultMonth:i,income:h,finalSum:p}},lm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:l}=t;return n?Math.round(a*Math.pow((1200+e)/1200,l)-a):Math.round(a*e*30*l/365/100)},im=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],rm=(e,t)=>e+Math.round((t-e)/2),sm=(e="rub")=>"rub"===e,om=(e,t)=>{const{minMonths:n,maxMonths:a}=Dd(["minMonths","maxMonths"],um(t,e?.currency)),l=e.monthsValue||Math.round((n+a)/2);return{monthsValue:sa(l,n,a)}},cm=(e,t)=>{const{minSum:n,maxSum:a}=Dd(["minSum","maxSum"],um(t,e?.currency)),l=e.moneyValue||n;return{moneyValue:sa(l,n,a)}},dm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),mm=e=>{const t=sm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},um=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},hm=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Td({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Td({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),pm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Id({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Td({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),pm(e.isShowNewClient),e.isShowNewClient?o(Qn,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},pm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,gm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},fm={text:"₽",key:"rub"},xm=ht((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[fm],g=i((e=>t=>e?{...t,...mm(t),...cm(t,e),...om(t,e),...dm(t,e)}:t)(h),[h]),[f,{field:x}]=Et({moneyValue:Cd(d,2e4),monthsValue:kd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:fm},{normalize:g}),b=x?.("currency")?.value??fm,y=x?.("isNewClient")?.value,v=um(h,b),N=am(f,v,s),{rate:w,income:C,finalSum:k,type:S=""}=N,T=i((()=>{Wd({field:x,defParams:Ld(v,y),calcParams:N,monthsValue:"minMonths",map:gm})}),[x,h]);l((()=>{!Jd(d)&&v&&T()}),[d,h]);const I=w===Ld(v,y)?.rate;return o(sd,{className:e,title:t,...m,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[c("div",{className:"flex gap-m",children:[xd({className:"w-full",title:`Сумма, ${b?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:b?.text,step:bm(b?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),jd({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),hm({...N,...s},x)]}),fd({rate:w,children:vm(T,I)}),Pd({income:C,finalSum:k,buttons:[...a,ym(n?.buttons,S)],footnotes:[r],postfix:b?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),bm=(e="")=>sm(e)?1e3:100,ym=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},vm=(e,t=!1)=>t?null:o(Wr,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Nm=e=>wm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&wm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),wm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:l})=>!!n&&!n[l]||t[a]===e[a],Cm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},km=(e,t,n)=>{const{moneyValue:a,monthsValue:l,oldMonthlyPayment:i,moneyExtra:r}=e,s=t?.rateRows||[Cm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Rd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Rd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:l,oldMonthlyPayment:i,moneyExtra:r})=>e?.find((e=>Nm({row:e,userInputParams:t,paramsViewSettings:n})&&Md(a+r,["minSum","maxSum"],e)&&Md(i,["minSumOld","maxSumOld"],e)&&Md(r,["minSumExtra","maxSumExtra"],e)&&Md(l,["minMonths","maxMonths"],e)))||Cm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:l,oldMonthlyPayment:i,moneyExtra:r}),{rate:p}=h,g=Hd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:l,oldMonthlyPayment:i,moneyExtra:r,monthlyPayment:g,benefit:f}},Sm=ht((({className:e="",title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:i,...r})=>{const[s,{field:d}]=Et({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=km(s,n,i),h=Ud({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(sd,{className:e,title:t,...r,children:c("section",{className:u(od,e),children:[c("div",{className:cd,children:[xd({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),xd({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),jd({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Tm({...m,...i},d),m.isExtraMoney?xd({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(dd,"@4xl:w-1/2"),children:[o(ud,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(ud,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(ud,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(ud,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Le(a,{isVertical:!0}),hd(l)]})]})})})),Tm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(Qn,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(Qn,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(Qn,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Im=d((e=>{const{onChange:t,min:n,max:a,defaultValue:l="0",fractionDigits:r=0,...s}=e,c=ra(e,{normalize:(e=l)=>n&&a?String(sa(Number(Bm(e)),n,a)):Bm(e),format:Ue(r)}),d=i((e=>t&&t(Bm(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),Bm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Pm=d((e=>o(Im,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),Rm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Dm={amount:1500},Mm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:i,formType:r="private",...s})=>{const[{amount:d},{field:m}]=Et(Dm),[h,p]=a(!1);return l((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(N,{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:Rm[r],children:[o(Pm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),i?.text?o(Wr,{className:"w-full mt-lg",type:"submit",disabled:h,children:i.text}):null]})]})})),Am=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(w,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),_m="relative h-full",zm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Em=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:l}=a.block||{},i=l?.some(Om),r=n?{defaultPadding:"p-6xl pb-m"}:{};return R({...a,renderProps:(n,a,l)=>c("div",{className:Fm(n,{someCardsHighlighted:i}),children:[I(n,a,{className:Vm(n,{someCardsHighlighted:i,showBorder:!e,cardSize:t}),...r,blockIndex:l}),Om(n)?Am({className:"absolute top-0 -right-4 z-40"}):null]},String(l))})},Fm=(e,{someCardsHighlighted:t})=>u(_m,t&&(Om(e)?"pt-3xl":"pt-3xl sm:pt-16")),Vm=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(_m,"min-w-80",zm[a],t&&(Om(e)?"pt-3xl sm:pt-16":"pt-3xl"),Go(n),n&&"h-full"),Om=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Lm=ht((({className:e,visibleItemCount:t=1,noCardBorder:n,arrowsPadded:a=!0,isGap:l=!0,cardSize:i="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(Sc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:l?16:0,padding:0,arrowsPadded:a,navButtons:r?qm(s?.block?.blocks):[],hasBlur:!0,children:Em({noCardBorder:n,cardSize:i,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),qm=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],jm="z-10 border border-solid w-full h-full",$m=u(jm,"absolute hidden @xl:block border-transparent"),Um=d((({className:e,title:t,description:n,button:a,...l})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...l,children:c("div",{className:"relative h-full",children:[o("div",{className:u($m,"top-9 right-12 bg-green-dark")}),o("div",{className:u($m,"top-6 right-8 bg-green")}),o("div",{className:u($m,"top-3 right-4 bg-green-light")}),c("div",{className:u(jm,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Le([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Wm={black:"bg-black",white:"bg-white"},Hm=d((({className:e="",title:t,description:n,image:a,price:l,button:i,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Te,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:Le([i],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Me,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Ym)]}):null,l?c(Me,{size:"text-h3",align:"text-left",children:[l," ₽"]}):null]})}))),Ym=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Wm[e]}`},String(t)),Km=d((({icon:e,...t})=>{const n=ue(),{text:a,href:l,target:i,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:l,target:i,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Gm=d((({className:e,additionalDescription:t,description:n,links:a,title:l,...i})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...i,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:l,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?Xm(a):null]})}))),Xm=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Km,{...e},String(t))))}),Jm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),Zm=d((({className:e="",href:t,target:n,onClick:a,data:l,children:i})=>{const r=ue()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(l),children:i})})),Qm=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],eu=d((({className:e="",media:t,showButtonText:n,stretched:l,version:i="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:l}=e,{iconMapped:r}=(e=>Qm.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Oe(a)?a:r,c=n?{text:l}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&l&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??i}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},tu(l));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:Le(m,{className:nu(s??!1,l??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),tu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",nu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),au=d((({className:e,padding:t,description:n,additionalDescription:a,href:l,icon:i,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:b=true,isImageSecondary:y=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(Zm,{href:l,target:m,className:"h-full",data:Jm(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Oe(i)?o(ne,{image:i}):null,x),buttons:d.length?o(eu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:b,isImageSecondary:y,imageAlign:"center",children:[o(Ve,{benefits:f}),s?o(Re,{__html:s,isDotted:r,itemSize:"list-s"}):null,lu(a,p)]})})}))),lu=(e,t)=>e?o(w,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,iu=(e,t)=>{const{title:n,description:a,buttons:l}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Me,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:a})}):null,l?.length?o("div",{className:"text-primary-main",children:Le(l)}):null]},String(t))},ru=d((({className:e="",title:t,align:n="text-center",icon:i,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(iu),[x,b]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[y,v]=a(!1);return l((()=>ce.subscribe("fold",(e=>{void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[Oe(i)?o("div",{className:"self-center",children:o(ne,{image:i})}):null,t?o(N,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(ye,{className:"w-full mt-m mb-lg",...r}):null,b.length?o(qi,{renderFoldableSection:()=>c("div",{children:[x,o(ji,{isUnfolded:y,children:b})]}),renderFoldButton:d.length>=s?su(m?.parent,h,y):null}):o("div",{children:x})]})})),su=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ce.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?pe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),ou=d((({className:e,contacts:t,info:n,version:a="secondary",...l})=>c(g,{className:u("flex",e),defaultPadding:"p-6xl",version:a,...l,children:[n?.length?cu(n):null,t?.length?cu(t):null]}))),cu=e=>o("div",{className:"flex gap-5xl grow basis-0",children:e.map(((e,t)=>du({column:e,i:t})))}),du=({column:e,i:t})=>e?o("div",{className:"flex flex-col gap-xl grow basis-0",children:e.map((({title:e="",description:t,additionalDescription:n,button:a},l)=>c("div",{children:[o(k,{title:e,description:t,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),n?o("div",{className:"mt-xs opacity-80",children:o(w,{size:"text-m",font:"font-light",children:n})}):null,o("div",{className:u({"mt-xl":Boolean(a?.text)}),children:Le([a])})]},String(l))))},`col-${String(t)}`):null,mu=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),uu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(mu,{step:a,showPercentage:!1})]})})}));var hu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(hu||(hu={}));const pu=e=>cl("/user-data/getTaskStatus","POST",e),gu=e=>cl("/user-data/sendSignalToProcess","POST",e),fu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:l,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d}):null]}),o(xu,{title:a,items:l}),o(xu,{title:i,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),xu=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:bu(e)},t)))}):null]})]}):null},bu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),yu=d((()=>o(fu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),vu=d((()=>{const[e]=js("leadForm");return o(fu,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:e?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),Nu=d((()=>{const[e]=js("leadForm");return o(fu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),wu=d((()=>{const[e]=js("leadForm");return o(fu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Cu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ku=d((()=>{const[e,t]=a(hu.process),[n]=js("taskId");return l((()=>{for(const e of Cu)gu({signalType:e,taskId:n});const e=setInterval((()=>pu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==hu.process&&(clearInterval(e),t(n.statusCd))}))),3e4)}),[]),Su(e)})),Su=e=>({IN_PROCESS:o(vu,{}),CANCELLED:o(yu,{}),APPROVED:o(wu,{}),REVISION:o(Nu,{})}[e]||null),Tu=[{paymentSystem:wi[0].id,currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},mandatoryIncome:void 0,otherPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:{fullAddress:"",fiasCode:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Iu=e=>{if(e)try{return new Date(e)}catch(e){return}},Bu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Pu(n,e),Ru(t,e),Du(t,e),Mu(t,e),Au(t,e),_u(t,e)].some(Boolean)?{...t,required:!1}:t)),Pu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ru=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Du=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Mu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Au=({name:e},t)=>"addressFact"===e&&t("addressMatch"),_u=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),zu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($o,{__html:e},`${t}_${n}`))):null},Eu=({field:e,inputs:t})=>t.map(Ts(e,"")),Fu=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:a,title:l},i)=>{const r=Bu(Vu(t))(e,n),s=r.filter((e=>!_u(e,Vu(t))));return c("div",{className:u(Is(a),"grid gap-x-m"),children:[zu(s),Bs(l),Eu({field:t,inputs:r})]},`section-${i}`)})),Vu=e=>t=>e(t)?.value,Ou=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between gap-m",children:[o(Wr,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Wr,{className:"w-full @xl:w-auto",type:"submit",children:"Далее"})]})})),Lu=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:l}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:a,codeWord:l}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:a,birthday:l="",phone:i="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:xt(l,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Do({phone:bt(i),email:r}),participantAddresses:Mo({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:a,legalForm:l,organization:i,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:a,organizationActivityTypeCd:s,organizationTypeCd:i,organizationKindCd:o,employeesNumberCd:r,opf:l,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Do({organizationPhone:h&&bt(h)}),participantAddresses:Mo({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,mandatoryIncome:l,otherPayments:i,snils:r,armyIdFlg:s}=e;return{maritalStatusCd:t,totalDependents:a,otherDependents:n,participantIncomes:Ao({mandatoryIncome:l,otherPayments:i}),snils:r?.replaceAll(" ",""),armyIdFlg:s}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:l}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:l}})(t);default:return{}}},qu=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:l})=>{const[r]=js("taskId"),[s]=js("profileId"),[o]=js("participantId"),c=i((async i=>{const c=Ds(Dn(Bu(ju(i))(t,e)));if(console.log(Dn(Bu(ju(i))(t,e))),!pn(c(i)))return console.warn("validation fail");a(i);try{r&&s&&o&&await Js((({participantId:e,taskId:t,profileId:n,formData:a,step:l=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Lu(l,a)}]}}))({participantId:o,taskId:r,profileId:s,step:e,formData:i}))}catch(e){return"Fail"}return n(),5===e&&l?.(!0),"OK"}),[]);return{handleSubmit:c}},ju=e=>t=>e[t],$u=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,isFormFinished:l,finishForm:r})=>{const[d,m]=js("leadForm"),u=((e,t)=>({...Tu[e],...t,birthday:Iu(t?.birthday),dulIssueDateField:Iu(t?.dulIssueDateField),participantDateRegistration:Iu(t?.participantDateRegistration),beginDate:Iu(t?.beginDate),deliveryDate:Iu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=i((e=>{h.current=e}),[]),{handleSubmit:f}=qu({step:e,inputs:p,onNextStep:a,saveStep:m,finishForm:r}),[,{field:x,onSubmit:b}]=Et(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return l?o(ku,{}):c("form",{onSubmit:b,className:"space-y-m",children:[Fu({sections:t,field:x,step:e,registerSubmit:g}),o(Ou,{step:e,onPrevStep:n})]})})),Uu=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"otherPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],Wu=["Параметры карты","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Выбор способа получения"],Hu=d((({className:e,...t})=>{const[n,l]=a(0),s=i((()=>{l((e=>Math.min(e+1,6)))}),[]),d=i((()=>{l((e=>Math.max(e-1,0)))}),[]),m=r((()=>Uu[n]),[n]),[h,p]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{className:"container grid grid-cols-12",children:[h?null:o(uu,{stepsTitles:Wu,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o($u,{step:n,sections:m,onNextStep:s,onPrevStep:d,isFormFinished:h,finishForm:p},String(n))})]})})})),Yu=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId");if(!t||!e||!n)return globalThis.location.href="/",()=>null;const a=async()=>{const n=await cl("/auth/refresh","POST",{refresh_token:e,access_token:t});n instanceof Response?Ku(n.status):(globalThis.sessionStorage.setItem("refreshToken",n.refresh_token),globalThis.sessionStorage.setItem("accessToken",n.access_token))};a();const l=setInterval(a,24e4);return()=>clearInterval(l)},Ku=e=>{401==e&&(globalThis.location.href="/")},Gu=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(mu,{step:a,showPercentage:!1})]})})})),Xu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:l,sectionAdditionalTitle:i,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(Uo,{interval:d,intervalExpireAction:m}):null]}),o(Ju,{title:a,items:l}),o(Ju,{title:i,items:r,countColumns:!0}),n?.__html?o($o,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ye,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Ju=({title:e,items:t,countColumns:n=!1})=>{const a=Ce();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Me,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Is(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Zu(e)},t)))}):null]})]}):null},Zu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Qu=d((()=>o(Xu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),eh=d((({handleExpireTimer:e})=>{const[t]=js("leadForm");return o(Xu,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),th=d((()=>{const[e]=js("leadForm");return o(Xu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),nh=d((()=>{const[e]=js("leadForm");return o(Xu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),ah=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],lh=d((()=>{const[e,t]=a(hu.process),[n]=js("taskId");l((()=>{for(const e of ah)gu({signalType:e,taskId:n});const e=setInterval((()=>n&&pu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==hu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return ih(e,(()=>t(hu.rework)))})),ih=(e,t)=>({IN_PROCESS:o(eh,{handleExpireTimer:t}),CANCELLED:o(Qu,{}),APPROVED:o(nh,{}),REVISION:o(th,{})}[e]||null),rh=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",birthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},mandatoryIncome:void 0,otherPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:"",addressRetail:void 0,bankEmployeeCode:void 0}],sh=e=>{if(e)try{return new Date(e)}catch(e){return}},oh=e=>(t,n)=>t.filter((e=>e)).map((t=>[ch(n,e),dh(t,e),mh(t,e),uh(t,e),hh(t,e),ph(t,e)].some(Boolean)?{...t,required:!1}:t)),ch=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,dh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,mh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),uh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,hh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),ph=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),gh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o($o,{__html:e},`${t}_${n}`))):null},fh=({field:e,inputs:t})=>t.map(Ts(e,"")),xh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:a,title:l},i)=>{const r=oh(bh(t))(e,n);return c("div",{className:u(Is(a),"grid gap-x-m"),children:[gh(r),Bs(l),fh({field:t,inputs:r})]},`section-${i}`)})),bh=e=>t=>e(t)?.value,yh=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between",children:[o(Wr,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Wr,{className:u("w-full @xl:w-auto"),type:"submit",children:"Далее"})]})})),vh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Nh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:vh[a?"annuity":"differential"]}},wh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:a,birthday:l="",phone:i="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:b}=e;return{birthDate:xt(l,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Do({phone:bt(i),email:r}),participantAddresses:Mo({addressRegistration:x,addressFact:b}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:a,legalForm:l,organization:i,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:a,organizationActivityTypeCd:s,organizationTypeCd:i,organizationKindCd:o,employeesNumberCd:r,opf:l,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Do({organizationPhone:h&&bt(h)}),participantAddresses:Mo({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:a,confirmationIncome:l,mandatoryIncome:i,otherPayments:r,snils:s,armyIdFlg:o}=e;return{maritalStatusCd:t,totalDependents:a,incomeCertificateCd:l,otherDependents:n,participantIncomes:Ao({mandatoryIncome:i,otherPayments:r}),snils:s?.replaceAll(" ",""),armyIdFlg:o}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:l}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:l}})(t)}},Ch=({step:e,inputs:t,onNextStep:n,saveStep:a,finishForm:l})=>{const[r]=js("taskId"),[s]=js("profileId"),[o]=js("participantId"),c=i((async i=>{const c=Ds(Dn(oh(kh(i))(t,e)));if(!pn(c(i)))return console.warn("validation fail");a(i);try{r&&s&&o&&await Js((({participantId:e,taskId:t,profileId:n,formData:a,step:l=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...wh(l,a)}],...Nh(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:i}))}catch(e){return"Fail"}return n(),5===e&&l?.(!0),"OK"}),[]);return{handleSubmit:c}},kh=e=>t=>e[t],Sh=d((({step:e,sections:t,onPrevStep:n,onNextStep:a,renderStep:l=xh,isFormFinished:r,finishForm:d})=>{const[m,u]=js("leadForm"),h=((e,t)=>({...rh[e],...t,birthday:sh(t?.birthday),dulIssueDateField:sh(t?.dulIssueDateField),participantDateRegistration:sh(t?.participantDateRegistration),beginDate:sh(t?.beginDate),deliveryDate:sh(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=i((e=>{p.current=e}),[]),{handleSubmit:x}=Ch({step:e,inputs:g,onNextStep:a,saveStep:u,finishForm:d}),[,{field:b,onSubmit:y}]=Et(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(lh,{}):c("form",{onSubmit:y,className:"space-y-m",children:[l({sections:t,field:b,step:e,registerSubmit:f}),o(yh,{step:e,onPrevStep:n})]})})),Th=[[],[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment"},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"otherPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}],[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Ih=["","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Отделение Банка"],Bh=d((({className:e,...t})=>{const[n,s]=a(0);l(Yu,[]);const d=i((()=>{s((e=>Math.min(e+1,5)))}),[]),m=i((()=>{s((e=>Math.max(e-1,0)))}),[]),h=r((()=>Th[n]),[n]),p=0===n,[f,x]=a(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{className:"container grid grid-cols-12",children:[p||f?null:o(Gu,{stepsTitles:Ih,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Sh,{step:n,sections:h,onNextStep:d,onPrevStep:m,isFormFinished:f,finishForm:x,renderStep:p?({registerSubmit:e,field:t})=>o(Qd,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Ph=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Rh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Dh=1e9,Mh={sum:{min:1e4,max:Dh},period:3},Ah=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:l,...i})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Wc(Mh,{block:i.block,page:i.options?.page,normalize:e=>({...e,period:_h(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=zh(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Vc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Pm,{label:a?.title,min:500,max:Dh,...d("sum",{parse:e=>({min:Number(e),max:Dh}),format:({min:e})=>String(e)})}),o(ua,{title:l?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(_c,{blocksToRender:r,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),_h=e=>ot((e?.paramsSource?.rateRows||[]).filter(Ph).flatMap((e=>Rh(e.minMonths,e.maxMonths)))),zh=e=>ot(e.flatMap((e=>e||[])).filter(Ph).flatMap((e=>Rh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Eh=[{key:"10"},{key:"50"},{key:"100"}],Fh=({itemCount:e,onItemCountChange:t})=>{const n=i((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(cn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Eh,iconVersion:"black"})]})},Vh="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Oh=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:l}=e,i=t+1;return i===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:i},String(t)):1!==i&&i!==l&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(i,n,l)?o("div",{onClick:()=>a(i),className:Vh,"aria-label":`Страница ${i}`,children:i},String(t)):null},Lh={width:"24",height:"24"},qh=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),l=i((()=>{e>1&&t(e-1)}),[e]),s=i((()=>{e<n&&t(e+1)}),[e,n]),d=i((()=>t(1)),[]),m=i((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:l,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:jh(1===e),...Lh})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Vh,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Oh),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Vh,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:jh(e===n),...Lh})})]})},jh=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",$h=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:l})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(qh,{currentPage:e,onPageChange:t,totalPages:n}),a&&l?o(Fh,{itemCount:a,onItemCountChange:l}):null]}),Uh=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:l,placeholder:r="Поиск по сайту"})=>{const s=i((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",Wt),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:l})]})})),Wh=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Uh,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ka,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ka,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Wr,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Hh=({title:e,timestamp:t,publicId:n})=>{const a=ue(),{href:l}=a({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[null,c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Me,{size:"text-m","font-weight":"font-light",children:xt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:l,download:!0,"aria-label":"Скачать",children:e})]})]},n)},Yh="/api/v1/depository",Kh={startDate:void 0,endDate:void 0,query:""},Gh=ht((({className:e,...t})=>{const[n,l]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=Et(Kh),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:l})=>{const i=a?xt(a,!0):"",r=l?xt(l,!0):"",s=new URLSearchParams(Yh);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",i),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=qn(Yh+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=i((e=>l(e-1)),[]),b=i((e=>{r!==e?(s(e),l(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Wh,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Hh,{...e},String(e.publicId)))):o(Ko,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o($h,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:b})]})]})})),Xh=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,Jh=d((({className:e="",title:t,description:n,error:a,button:l,...i})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...i,children:[o("div",{className:"flex justify-center",children:Xh(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),l?.text?o(ye,{version:l?.version,text:l?.text,...l}):null]}))),Zh="location";function Qh(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=a(n||null);return l((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,i((n=>e.fire(t,n)),[e,t])]})(ce,"location",tp()??{name:e}),r=i((e=>{np(e),n(e)}),[]),{data:s}=qn(ep()?null:"/api/v1/region",st);return l((()=>{s&&!ep()&&n(s)}),[s]),[t??{name:e},r]}const ep=()=>Boolean(globalThis.localStorage?.getItem(Zh)),tp=()=>{try{const e=globalThis.localStorage?.getItem(Zh);return e&&JSON.parse(e)}catch(e){return null}},np=e=>{try{globalThis.localStorage?.setItem(Zh,JSON.stringify(e))}catch(e){}};var ap;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(ap||(ap={}));const lp=new Intl.NumberFormat("ru",{style:"currency",currency:ap.RUB}),ip=e=>e?lp.format(e):"",rp="text-m font-light text-secondary-text ",sp=`${rp} text-left`,op=`${rp} pl-5xl text-center`,cp=`${rp} pl-5xl text-right`,dp={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},mp=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:sp,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:op,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:cp,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(up)})]}))),up=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:dp[t]},width:"24",height:"24"}):null,o(Me,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Me,{size:"text-h6",children:ip(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:ip(e?.buyExchangeRate)})})]},t)},hp={icon:"GpsIcon"},pp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Zc,{...hp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(w,{size:"text-l",color:"text-primary-main",children:t}):null,o(w,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),gp=(e,t,n)=>{const a=Number(fp(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},fp=e=>e.replace(/[^\d.,]/g,"").replace(",","."),xp=e=>Pt([[e=>e.value!==ap.RUB&&e.oppositeValue!==ap.RUB,()=>e.handleConvert(e.value,ap.RUB)],[e=>e.value===ap.RUB&&e.oppositeValue===ap.RUB,()=>e.handleConvert(e.value,ap.USD)],[e=>e.value===ap.RUB&&e.oppositeValue===ap.RUB,()=>e.handleConvert(e.value,ap.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function bp(e){const{placeholder:t,rates:n,selected:a,value:l,setValue:i,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(Yt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:l,onChange:i}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const yp=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:l})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||ap.RUB,selectBuy:n?.[0]?.currency?.currency||ap.USD}),d=i((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[bp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:vp(r,d,n),value:r.inputSell,setValue:e=>wp(d,n)(e,r.selectSell,r.selectBuy)}),bp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Np(r,d,t),value:r.inputBuy,setValue:e=>Cp(d,t)(e,r.selectBuy,r.selectSell)})]}):null,l?.text?o(ye,{text:l.text,version:l?.version,...l}):null]})})),vp=(e,t,n)=>a=>{t({selectSell:a}),xp({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,l=e.selectBuy)=>{wp(t,n)(e.inputSell,a,l)}})},Np=(e,t,n)=>a=>{t({selectBuy:a}),xp({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,l=e.selectSell)=>Cp(t,n)(e.inputBuy,a,l)})},wp=(e,t)=>(n,a,l)=>{e({inputSell:fp(n),selectBuy:l});const i=t.find((e=>e.currency?.currency===l))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;i&&e({inputBuy:String(gp(n,i,a===ap.RUB)||"")})},Cp=(e,t)=>(n,a,l)=>{e({inputBuy:fp(n),selectSell:l});const i=t.find((e=>e.currency?.currency===l))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;i&&e({inputSell:String(gp(n,i,a===ap.RUB)||"")})};const kp=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const[l]=Qh(),i=function(e){const t=e?.code||"000",{data:n}=qn(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(l),r=Sp(i?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:ap.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:ap.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Te,{className:"h-full",title:o(N,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(mp,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(pp,{address:i?.address})]}),o(yp,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),Sp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Tp=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Ip(n))})})),Ip=e=>({dataFooter:t,...n},a)=>{const{text:l,href:i,target:r,onClick:s}=e(n);return l?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:i,target:r||"_self",onClick:s,...pe(t),children:l||null})},String(a)):null},Bp=e=>t=>!t.displayArea||e.includes(t.displayArea.toLowerCase()),Pp=["all","footer"],Rp=d((({className:e,navigationItems:t})=>{const n=ue();return o("div",{role:"menu",className:u("w-full flex items-start justify-between flex-col md:flex-row gap-y-m lg:order-2",e),children:t?.filter(Bp(Pp)).map(n).map(Dp)})})),Dp=(e,t)=>{const{text:n,items:a=[],href:l,target:i="_self",onClick:r,dataFooter:s}=e,d=a.filter(Bp(Pp));return c("div",{role:"menuitem",className:"flex flex-col gap-s w-full @md:w-1/4",children:[o("a",{className:"leading-5 text-l text-primary-text hover:text-primary-main no-underline",href:l,target:i,onClick:r,...pe(s),children:n}),d?o(Tp,{items:d}):null]},String(t))},Mp=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Ap)}):null)),Ap=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Me,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(_p)})]},String(t)),_p=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:zp(e.type,e.text)}),o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),zp=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Ep(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(w,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Ep=e=>e.replaceAll(/\D/g,""),Fp=d((({className:e="",index:t,text:n,...a})=>{const l=ue(),{href:i,target:r,onClick:s}=l(a);return o("a",{className:u("text-secondary-text",e),href:i,target:r,onClick:s,children:n||`Документ ${t}`})})),Vp=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Me,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Fp,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Op="w-full lg:w-52";function Lp(e,t,n=300){l((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}const qp=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:l}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),l=Array.from({length:t.length});let i=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||l[n]||e[r]!==t[n]||(i++,a[r]=!0,l[n]=!0)}return{m:i,s1Matches:a,s2Matches:l}}(e,t);if(0===n)return 0;const i=function(e,t,{s1Matches:n,s2Matches:a}){let l=0;for(let i=0,r=0;i<e.length;i++){if(!n[i])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[i]!==t[s]&&l++}return l}(e,t,{s1Matches:a,s2Matches:l}),r=(n/e.length+n/t.length+(n-i/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const jp=(e,t)=>(n,a)=>{for(const[l,i]of a)n.set(l,e(n.get(l)||t,i));return n},$p=(e=[])=>e.reduce(((e,t)=>e+t),0),Up=e=>e.toLowerCase().split(/[^0-9a-zа-я-]+/).filter((e=>e.length>=3&&!/[0-9a-z]/.test(e))),Wp=e=>t=>e.map((([e,n])=>[qp(t)(e),n])).filter((([e])=>e>=.8)).map((([e,t])=>Yp(t,e))).reduce(jp(Math.max,0),new Map),Hp=e=>t=>{return qc(t,t.map((({title:e})=>e)).map((e=>t=>{const n=Up(t||"");return n.length?$p(e.map((e=>cc(n.map(qp(e)))))):0})(e))).sort((a=([,e])=>e,n=(e,t)=>a(e)-a(t),(e,t)=>-n(e,t))).map((([e])=>e));var n,a},Yp=(e,t)=>new Map(e.map((e=>[e,t]))),Kp=({basePathList:e,initialQuery:t=""})=>{const[n,i]=a(t||"");l((()=>{null!=t&&i(t)}),[t]);const{data:r}=qn(e?.length?e:null,Gp),[s,o]=a(null);return Lp((()=>{r&&o(r.map((e=>t=>{const{corpus:n,dictionary:a}=t||{};if(!(e&&n?.length&&a&&Object.keys(a).length))return[];const l=Up(e);if(!l.length)return[];const i=Object.entries(a),r=[...l.map(Wp(i)).reduce(jp(((e,t)=>e+t),0),new Map).entries()].filter((([,e])=>e>=.799*l.length)).map((([e])=>n[e]));return Hp(l)(r)})(n)))}),[r,n]),[s,{value:n,onChange:i}]},Gp=async(...e)=>(await Promise.allSettled(e.map((e=>rt(V(e,"/","search.index.json")))))).map((e=>"fulfilled"===e.status?e.value:{})),Xp=d((({initialQuery:e,navigationItems:t})=>{const n=r((()=>t?.map((e=>e.href||"/"))),[t]),[a,l]=Kp({basePathList:n,initialQuery:e}),i=r((()=>Jp(t)(a)),[t,a]);return o(pl,{head:o(Uh,{autoFocus:!0,...l}),children:o(Rp,{navigationItems:i})})})),Jp=e=>t=>e?.length&&t?.length?qc(e,t).map((([e,t])=>({...e,items:t?.map((({title:e,uri:t})=>({text:e,href:V("/",t)})))}))):[],Zp=(e={})=>{const{open:t,close:n}=de();return{open:(n={},a={})=>t(o(Xp,{...e,...n}),a),close:n}},Qp=d((({className:e,search:t,...n})=>{const[l,r]=a(""),s=i((()=>r("")),[]),d=Zp(n),m=i((e=>{r(e),eg(e)&&d.open({initialQuery:e},{onClose:s})}),[s,d]);return c("div",{className:u("relative",e),role:"search",children:[o(Uh,{value:l,placeholder:t?.placeholder,onChange:m}),o(hl,{className:"absolute top-0 right-0 sm:hidden",onClose:s})]})})),eg=e=>e&&e.length>=3,tg=(e,t)=>{const{logo:n}=e??{},{dataHeader:a,dataFooter:l,...i}=n??{};return c("div",{className:"flex items-stretch gap-3xl",children:[o(ao,{className:Op,logo:i,data:l,showTitle:!1}),o(Qp,{className:"grow",navigationItems:t,...e})]})},ng=d((({className:e="",index:t,...n})=>{const a=ue(),{href:l,target:i,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:l,target:i,onClick:s,children:r||`Документ ${t}`})})),ag=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Me,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(ng,{index:t,...e},String(t))))}):null]}))),lg=ht((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{},l=n.options?.page?.common??{},{documents:i,relatedEnterprises:r,contacts:s,mediaLinks:d=[],horizontalNavigationTitle:m,feedbackButton:h,license:p,otherLinks:f=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[tg(l,a),c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Rp,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u(Op,"flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Mp,{items:s}),h?o(ye,{className:"w-full",version:"primary",...h}):null,d.map(((e,t)=>o(eu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),f.map(((e,t)=>o(ye,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Vp,{title:m,links:r}),o(ag,{links:i,license:p})]})})),ig=d((({className:e="",title:t,description:n,calendar:a,...l})=>c(g,{className:u("space-y-m",e),defaultPadding:"p-6xl",...l,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0}),a?rg(a):null]}))),rg=e=>{const t=100/(e.reduce(((e,t)=>t?.month?.length?e+t.month.length:e),0)||1),n=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:n.map((e=>sg(e,t)))}),o("div",{className:"flex gap-s w-full",children:n.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:og(e)}),c("div",{className:"text-s",children:[o(Me,{size:"text-s",font:"font-light",color:"text-primary-text",children:e.text})," ",o(Me,{size:"text-s",font:"font-light",color:"text-primary-main",children:e.greenText})]})]},`monthItem-${t}`)))})]})},sg=(e,t)=>e.month?.map(((e,n)=>o("div",{style:{flexBasis:`${t}%`},children:e.text},`monthName-${n}`))),og=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)),cg=ht((({className:e,title:t,button:n,regionSource:l,data:i,...r})=>{const[s,d]=a({key:""}),m=l?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container max-w-[978px] space-y-m",children:[t?o(N,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(hn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(ye,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:Jm(i,s?.key),children:f})}):null]})})}));function dg(e=[]){const t=D(),n=Array.from(e.entries()).filter((([,e])=>mg(t)(e)));return n.find((([,e])=>mg(t,!0)(e)))??n[n.length-1]??[]}const mg=(e,t=!1)=>({href:n})=>{if(!n)return!1;const a=F(ug(e)(n));return t?a===F(n):a.startsWith(F(n))},ug=e=>t=>{const n=X(G.SITE_URL);return _(t)?e.href:V(n,e.pathname)},hg=d((({className:e="",items:t,activeItem:n,ariaLabel:a="Меню"})=>{const[r,{setFalse:d,toggle:m}]=Lt(!1),h=jt(d),p=s(null),g=i((({isOpened:e,buttonRef:t,menuRef:n})=>{if(e&&t.current&&n.current){const e=n.current.getBoundingClientRect(),a=t.current.getBoundingClientRect(),l=globalThis.innerWidth-e.width;e.right>=globalThis.innerWidth?n.current.style.left=`${l}px`:a.left>e.left&&(l>a.left?n.current.style.left="":n.current.style.left=`${l}px`)}}),[r]);return qt(globalThis,"resize",(()=>g({isOpened:r,buttonRef:h,menuRef:p}))),l((()=>{g({isOpened:r,buttonRef:h,menuRef:p})}),[r]),c("div",{className:u(r?"rounded-md shadow-blue-gray":"",e),ref:h,role:"navigation",children:[o("button",{type:"button",className:"group/btn flex justify-between items-center h-6","aria-label":a,onClick:m,role:"button","aria-labelledby":"labeldiv",children:Array(3).fill(null).map(((e,t)=>o("div",{className:"w-[3px] h-[3px] rounded mr-2xs bg-primary-text group-hover/btn:bg-primary-hover group-data-transparent:bg-white"},String(t))))}),o("div",{ref:p,className:u("absolute flex flex-col rounded-md bg-white p-xl pb-xs w-56 z-40",{hidden:!r}),"aria-hidden":!r,children:gg(t,n)})]})})),pg=d((({isActive:e,...t})=>{const n=ue(),{text:a,href:l,target:i,onClick:r}=n(t);return o("a",{className:u("text-l font-light pb-m hover:text-primary-main",{"text-primary-main":e}),href:l,target:i,onClick:r,role:"link",...pe(t?.data),children:a})})),gg=(e,t)=>e?.map(((e,n)=>o(pg,{isActive:e===t,...e},e?.text??String(n)))),fg={default:"w-6 h-6",large:"w-12 h-12"},xg=d((({className:e,isRounded:t,buttonSize:n="default",isGrayBg:a=!1,disabled:l,ariaLabel:i="Меню второго уровня",image:r,data:s,onClick:c,version:d})=>o("button",{className:u("group/btn border-0 flex shrink-0 items-center",a?"p-s rounded-full":"p-0 bg-inherit","transparent"===d?"backdrop-opacity-30 bg-white/30":a&&!t?"bg-main-divider":"",t?"w-8 h-8 text-secondary-light hover:text-secondary-hove":`${fg[n]} text-primary-text hover:text-primary-main`,"group-data-transparent:text-white",e),type:"button",disabled:l,"aria-label":i,onClick:c,...pe(s),children:o(ne,{image:r,className:u("h-full",{"bg-main-divider/20 rounded-full":t}),imageClassName:"group-hover/btn:text-primary-hover group-hover/btn:invert-0"})}))),bg="chatbot",yg="text-page__btn-chat",vg={personal:"//chat.mes.rshb.ru/assets/js/webchat_rshb",business:""},Ng=d((({chat:e="personal",iconVersion:t,className:n,ariaLabel:a="Чат",version:i})=>{const r=(e=>{l((()=>globalThis.localStorage?.setItem("webchat-keep-open",String(Date.now()))),[]);const t=vg[e??""];return n=>{if(t)if("personal"!==e)Rr(bg,t);else{const e=n.target;e?.classList.contains(yg)||e?.classList.add(yg),document.getElementById("webchat-js-container:webchat_rshb")||Rr(bg,t)}}})(e);return o(xg,{className:n,image:{icon:"HeadphonesIcon",iconVersion:t},ariaLabel:a,onClick:r,buttonSize:"large",isGrayBg:!0,version:i})})),wg=d((({className:e="",active:t,dataItemName:n,children:a,data:l,...i})=>{const r=ue(),{href:s,target:d,text:m,onClick:h}=r(i);return c("a",{className:u("relative inline-block bg-transparent text-center no-underline",e),href:s,target:d,"data-item-name":n,onClick:h,...pe(l),children:[o("span",{className:Cg(t),children:m||a}),t?o("div",{className:"absolute left-0 right-0 -bottom-3 h-0.5 bg-primary-main group-data-transparent:bg-white"}):null]})})),Cg=(e=!1)=>u("font-sans text-l lg:font-light",e?"text-primary-main":"text-primary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),kg=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...l})=>{const r=Jo(i((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(wg,{...l,children:n})})})),Sg={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},Tg=d((({version:e,text:t,mobileText:n,...a})=>{const l=Ce()?n:t;return l?o(ye,{className:u("py-s px-lg font-light whitespace-nowrap",Sg["transparent"===e?"transparent":"default"]),...a,children:l}):null})),Ig=d((({subItems:e=[],version:t,internetBankButton:n,dropdownMenuAriaLabel:l,chatBotAriaLabel:i})=>{const d="transparent"===t?"white":"black",[,m]=dg(e),[u,h]=a(e.length),p=e.slice(u),g=s(null),f={rootRef:g},x=r((()=>e.map(((e,t)=>e=>{h(e?Bg(t):Pg(t))}))),[e]);return c("nav",{className:"mt-s flex gap-s items-center justify-between",children:[o("div",{ref:g,className:"overflow-hidden whitespace-nowrap pb-s mt-xs space-x-lg",role:"menu",children:e.map(((e,t)=>o(kg,{className:u-1<t?"invisible":"",active:e===m,observerOptions:f,onVisibilityChange:x[t],data:e.dataHeader,...e},String(t))))}),p.length?o(hg,{items:p,activeItem:m,ariaLabel:l}):null,A.CHAT_BOT?o(Ng,{version:t,iconVersion:d,chat:A.CHAT_BOT,ariaLabel:i}):null,o(Tg,{version:t,...n})]})})),Bg=e=>t=>Math.max(t,e+1),Pg=e=>t=>Math.min(t,e),Rg=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(Me,{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(Dg,{...e},String(t))))})]}):null,Dg=d((({icon:e,...t})=>{const n=ue(),{text:a,target:l,href:i,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:i,target:l,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),Mg=(e,t)=>n=>n.name?o(Zm,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:Jm(e,n.name),children:o(Me,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,Ag=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(Wt,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),_g=d((({foreignOffices:e,branches:t})=>{const[n,l]=Qh(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=a(""),u=Eg(Vi()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((e,t)=>{const n=new Map;for(const a of e){const e=t(a),l=n.get(e)||[];n.set(e,[...l,a])}return n})(u,zg),{close:p}=de(),g=i((e=>{l(e),p()}),[]);return c(pl,{className:"pb-20",head:c("div",{children:[o(Me,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?o("div",{className:"mb-s",children:c(w,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(Zm,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(Ag,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&qp(e.toLowerCase())(d.toLowerCase())>=.8)).map(Mg(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((f=g,x=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Me,{size:"text-h6",children:e})}),t.map(Mg(x,f))]},e)))}),Rg(e)]});var f,x})),zg=e=>e.name?.charAt(0)||"",Eg=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Fg=d((({className:e="",active:t,flat:n,children:a,data:l,...i})=>{const r=ue(),{href:s,target:c,text:d,onClick:m}=r(i);return o("a",{className:u(Vg(t,n),e),href:s,target:c,onClick:m,rel:"noopener noreferrer","aria-label":`Ссылка на ${d}`,...pe(l),children:o("span",{suppressHydrationWarning:!0,className:Og(t,n),children:d||a})})})),Vg=(e=!1,t=!1)=>u("inline-block border border-solid bg-transparent text-center no-underline",e?"rounded-md border-primary-main group-data-transparent:border-white":"border-transparent",{"px-m py-xs":!t}),Og=(e=!1,t=!1)=>u("font-sans text-s font-light",e?"text-primary-main":u(t?"text-primary-text":"text-secondary-text","hover:text-primary-main"),"group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Lg=d((({className:e,version:t,...n})=>{const a="transparent"===t?"white":"black",[l]=Qh(n?.branches?.default),r=Zp(n),s=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(_g,{...e}),n),close:n}})(n),d=i((()=>r.open()),[r]),m=i((()=>s.open()),[s]);return c("div",{className:u("flex items-center ml-5 md:max-w-[300px] xl:max-w-full gap-lg",e),role:"navigation",children:[n?.branches?.visible?o(Fg,{className:"whitespace-nowrap text-ellipsis overflow-hidden",flat:!0,href:"#",text:l?.name,data:Jm(n?.branches?.dataClick,l?.name??""),onClick:m}):null,n?.officesAtms?.href?o(Fg,{className:"whitespace-nowrap",flat:!0,...n.officesAtms}):null,o(xg,{image:{icon:"LoupeIcon",iconVersion:a},ariaLabel:n?.search?.ariaLabel??"Поиск",onClick:d,data:n?.search?.data})]})})),qg=d((({observerOptions:e,onVisibilityChange:t,children:n,className:a,...l})=>{const r=Jo(i((e=>{if(!e.length||!t)return;const n=e[e.length-1];t(n.isIntersecting)}),[t]),e);return o("span",{ref:r,className:a,role:"menuitem",children:o(Fg,{...l,children:n})})})),jg=d((({navigationItems:e=[],activeTopItem:t,dropdownMenuAriaLabel:n,version:l,headerData:i,search:d,bgColor:m,logo:u})=>{const[h,p]=a(e.length),g=e.slice(h),f=s(null),x={rootRef:f},b=r((()=>e.map(((e,t)=>e=>{p(e?$g(t):Ug(t))}))),[e]),{dataFooter:y,dataHeader:v,...N}=u??{};return c("div",{className:"flex items-center justify-between",children:[o(ao,{className:"mr-3xl",bgColor:m,logo:N,data:v,showTitle:!1}),o("div",{ref:f,className:"overflow-hidden min-w-[160px] pb-xs mt-xs",role:"menu",children:e.map(((e,n)=>o(qg,{className:h-1<n?"invisible":"",active:e===t,observerOptions:x,onVisibilityChange:b[n],data:e.dataHeader,...e},String(n))))}),g.length?o(hg,{className:"mx-xs",items:g,activeItem:t,ariaLabel:n}):null,o(Lg,{version:l,className:"ml-auto",search:d,navigationItems:e,...i})]})})),$g=e=>t=>Math.max(t,e+1),Ug=e=>t=>Math.min(t,e),Wg={"bg-white":"primary",transparent:"transparent"},Hg=["all","header"],Yg=ht((({className:e,bgColor:t="bg-white",logo:n={},version:a=Wg[t],portal:l,header:i={},...r})=>{const{common:s,navigation:d}=Gg(r?.options?.page),{navigationItems:m}=d,{logo:h={}}=s,[,p]=dg(m),{internetBankButton:f}=l||{},x=n.image?.icon||n.image?.src||n?.title?n:h;return o(g,{tag:"header",className:u("pt-m px-20",p?.items?.length?"pb-m":"pb-lg",e),defaultPadding:"",version:a,...r,children:c("div",{className:"container",children:[o("div",{className:"whitespace-nowrap",children:o(jg,{activeTopItem:p,navigationItems:m?.filter(Bp(Hg)),version:a,headerData:{...i,...d},search:s.search,bgColor:t,logo:x})}),o("div",{className:u("mt-s h-px bg-main-divider",Kg(a))}),p?.items?.length&&o(Ig,{subItems:p?.items?.filter(Bp(Hg)),version:a,internetBankButton:f})]})})})),Kg=e=>"transparent"===e?"opacity-30":"",Gg=e=>({navigation:e?.navigation??{},common:e?.common??{}}),Xg=(e=!1)=>e?{}:{padding:"p-0"},Jg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Zg=ht((({className:e="",padding:t="p-0",gap:n="XS",isInnerPadding:a=!0,version:l="transparent",isTheme:i=!1,isCardBorder:r,...s})=>o(g,{className:u("relative","grid grid-cols-12",Jg[n],e),padding:t,version:l,isTheme:i,...s,children:R({...s,extraProps:{...Xg(a),className:Go(r)}})})),{childrenTypes:{exclude:["HorizontalLayout"]}}),Qg=d((e=>{const{className:t,align:n,image:a,...l}=e,i=n?u("flex",id[n]):"";return o(g,{className:u(i,t),defaultPadding:"p-0",...l,children:o(ne,{image:a})})})),ef=(e,t=0)=>{const{itemCount:n,visibleItemCount:l}=e,[r,s]=a(t),o=i((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=i((()=>s((e=>Math.max(e-1,0)))),[n]),d=l?n>l&&r<n-l:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]};function tf({dec:e,inc:t,canDec:n,canInc:a,btnClass:l,className:i=""}){return n||a?c("div",{children:[n?o(bc,{className:u("absolute z-40",l[0],i),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(bc,{className:u("absolute z-40 rotate-180",l[1],i),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const nf=d((({className:e="",cards:t=[],button:n})=>{const[l,r]=a(0),s=i((e=>r(e)),[]),d=t.length,[m,u]=ef({itemCount:d,visibleItemCount:2}),{canDec:h,canInc:p}=u,g=t[m]?.href;return c("section",{role:"listitem",className:`min-w-full text-center ${e}`,children:[c("div",{className:"relative overflow-hidden","aria-label":"Страховые программы",children:[d?af({activeIndex:m,cards:t,selectedCardIndex:l,onClick:s}):null,tf({...u,btnClass:["left-12","right-12"],className:"top-16"}),h?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(ye,{className:"w-60 text-center",version:"primary",...n,href:g})]})}));function af({activeIndex:e,cards:t,selectedCardIndex:n,onClick:a}){const l=460*e,i=t.length>2?"justify-start":"justify-center";return o("div",{style:{transform:`translateX(-${l}px)`},className:"duration-1000 px-6xl",children:o("div",{className:`w-full flex flex-nowrap gap-s pb-6xl ${i}`,children:t.map(((e,t)=>function({slide:e,i:t,isActive:n,onClick:a}){return c("button",{type:"button",onClick:a,className:"p-3xl min-w-fit flex items-center gap-2xl bg-white border-solid border relative "+(n?"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?lf("страховая сумма",e.sum):null,e?.fee?lf("страховой взнос",e.fee):null]}),rf(n)]},String(t))}({slide:e,i:t,isActive:Boolean(t===n),onClick:()=>a(t)})))})})}function lf(e,t){return c("div",{className:"flex flex-col text-left whitespace-pre",children:[c(Me,{size:"text-h6",children:[Ue(2)(t)," ₽"]}),o("div",{className:"mt-2xs",children:o(Me,{size:"text-l",color:"text-secondary-text",children:e})})]})}function rf(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 sf=d((({className:e="",title:t,insuranceTabs:n=[],button:l,...r})=>{const[s,d]=a(0),m=i((e=>d(e)),[]);return c(g,{className:u("box-border overflow-hidden relative px-0 space-y-2xl",e),defaultPadding:"p-6xl",...r,children:[t?o(N,{className:"text-center",title:t,headingType:"h3"}):null,n?.length>1?o("div",{className:"p-xs bg-secondary-light w-fit mx-auto rounded-md",children:n.map(((e,t)=>function({title:e,i:t,isActive:n,onClick:a}){return o("button",{type:"button",onClick:a,"aria-label":`Кнопка ${e}`,className:"box-border px-m py-s text-m font-light "+(n?"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:of({insuranceTabs:n,button:l})})]})})),of=({insuranceTabs:e,button:t})=>{const n=e?.map((e=>e.cards));return n?.length?n.map(((e,n)=>o(nf,{button:t,cards:e},String(n)))):null};const cf={yellow:"bg-yellow",green:"bg-green","green-light":"bg-green-light","green-dark":"bg-green-dark"},df={XS:"h-10",S:"h-16",M:"h-24",L:"h-32",XL:"h-52"},mf=d((e=>{const{className:t="",__html:n,isDotted:a,investmentZeroColumn:l,investmentColumns:i,...r}=e,s=i?[...i]:[];return l&&s.unshift(l),o(g,{className:t,defaultPadding:"p-4xl",...r,children:c("div",{className:"container text-m font-light space-y-4xl",children:[s?.length?c("div",{children:[c("div",{className:"flex items-end relative pl-3xl pr-lg text-white",children:[Ec(o("div",{className:"w-px h-4 bg-gray"}))(s.map(uf)),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(gf)})]}):null,n?o("div",{className:"max-w-2xl font-light text-base",children:o(Re,{__html:n,isDotted:a,itemSize:"list-s"})}):null]})})})),uf=(e,t,n)=>{const a=1===t,l=t===n.length-1,i=e.cells?.reverse()||[];return o("div",{className:`${hf(a,l,e.cells)}`,children:i.length?o("div",{className:"w-full "+(l?"border-4 border-green-more-dark p-1.5 min-w-72":""),children:i.map(pf)}):null},`column_${t}`)},hf=(e,t,n=[])=>[n.length?"flex-1":"flex-0",!n.length||e||t?"":"pl-s",n.length&&!t?"pr-s pb-3xl":"pb-xl"].join(" "),pf=(e,t)=>{const n=e.cellSize||"XS",a=e.cellColor||"green";return e.text?o("div",{className:`flex-1 flex items-center justify-center relative py-xs ${df[n]} ${cf[a]} ${"XS"===n?"px-s":"px-5xl"}`,children:o(Me,{align:"text-center",children:e.text})},`cell_${t}`):null},gf=(e,t)=>e?.title?o("div",{className:"flex-1 max-w-44 text-center px-xs last:pr-4xl last:max-w-52",children:e.title},`title_${t}`):null,ff=["байт","Кб","Мб","Гб","Тб","Пб"],xf=d((({icon:e,text:t,href:n,target:a,fileFormat:l,data:i,fileSize:r})=>{const s=r&&l?",":"",d=r??"",m=l?String(l):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...pe(i),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",bf(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),bf=(e,t)=>e||t?o("span",{children:", "}):"",yf=(e,t)=>(n,a)=>{const l=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),i="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${ff[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Nf(l):n?.fileFormat;return c("div",{role:"listitem",children:[o(xf,{text:n?.text,target:n?.target,href:l,fileFormat:r,fileSize:i,icon:vf(t),data:n?.data}),o(Re,{__html:n?.__html})]},String(a))},vf=e=>e?o(ne,{className:"min-w-6 min-h-6",image:e,width:"24",height:"24"}):null,Nf=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},wf=d((({href:e,__html:t,target:n})=>{const{close:a}=de(),l=D(),r=$(l)(e),s=i((()=>{a()}),[]);return c(pl,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(Re,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ye,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Wr,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Cf=d((({text:e,href:t,target:n,__html:a,icon:l})=>{if(!e&&!a)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(wf,{...e}),n),close:n}})({__html:a,href:t,target:n}),s=i((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[vf(l),o(Me,{font:"font-light",children:e})]})})),kf={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Sf=ht((({className:e="",title:t,description:n,align:a="text-center",documents:l,icon:i={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=D();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),l?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",kf[r]),role:"list",children:l.map(Tf(d,i))}):null]})})),Tf=(e,t)=>(n,a)=>{const l=n?.docType;return""===l?null:"reportSource"in n&&n?.reportSource?.__html?If(t)(n,a):yf(e,t)(n,a)},If=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Cf,{...a,icon:e,href:Bf(t)?t?.href:t?.attachment?.src}),o(Re,{__html:t?.__html})]},String(n)):null},Bf=e=>"href"in e,Pf=ht((({className:e,padding:t,align:n="text-left",buttons:a=[],description:l,image:i,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",b=i?.src?o(ne,{className:"hidden lg:block",image:i}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(N,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:b,buttons:Le(a,{className:"flex-wrap"}),children:[l?o(Me,{size:"text-xl","font-weight":"font-light",children:l}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(Re,{__html:r,itemSize:"list-m"}):null,o(Me,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,i?.src?o(ne,{className:"lg:hidden",image:i}):null]})]})})})),Rf=(e=[],t={})=>e.filter((({content:e={}})=>$c(t,e))).length,Df=(e,t)=>e===t;const Mf=(Af=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Df,((e=Df)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>Af(n,t[e])))));var Af;const _f=[],zf={},Ef={primary:"bg-white/30",secondary:"bg-main-divider"},Ff={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Vf=d((({count:e,version:t="secondary"})=>{const n=Ce(),a=n?"bg-main-divider":Ef[t],l=Ff[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:l,children:e})})})),Of=({text:e,description:t,icon:n,isActive:a,type:l})=>{const i=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",i.icon),image:{...n,iconVersion:n?.iconVersion??i.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===l?i.text:i.oldText,children:e}),o("div",{className:"animated"===l?i.desc:i.oldDesc,children:t})]})]})},Lf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},qf={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},jf={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},$f={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Uf=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:l})=>{const i=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(i,{className:u("h-12","block flex-1","cursor-pointer",Lf[a],n?$f[a]:jf[a]),role:"tablist","aria-label":"Список табов",onClick:l,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?qf[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Of({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Vf,{count:m,version:Hr(n,a)})}):null]})})})),Wf=d((e=>o(e?.item?.href?Hf:Yf,{...e}))),Hf=d((e=>{const t=ue(),n=i((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...l}=t({...e.item,onClick:n});return o(Uf,{...e,tag:"a",item:l,onClick:a})})),Yf=d((({item:e={},onClick:t,...n})=>{const a=i((()=>{t&&t(e)}),[t,e]);return o(Uf,{item:e,onClick:a,...n})})),Kf=(e,t,n)=>(a,l)=>o(Wf,{isActive:a===e,onClick:t,type:n,item:a},String(l)),Gf=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:l})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Kf(a,l,t))}))),Xf={categories:[],extraOptions:[],propertyType:[],stage:[]},Jf=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...l})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Wc(Xf,{block:l.block,page:l.options?.page}),f=i(((e=Xf)=>p(e)),[]),x=(({hotFilters:e=_f,filtrationState:t=zf,blocks:n=_f,onFiltrationStateChange:a})=>{const l=r((()=>Math.max(0,e.findIndex((e=>Mf(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Rf(n,t.filter),version:Hr(t===e[l])})))),[e,n,l]),o=i((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[l],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:l.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Gf,{...x}),o(Vc,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(_c,{blocksToRender:d,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Zf=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:l,atmCode:i="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:tx(a)},{label:"Модуль приема наличных",value:l?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:i}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Me,{size:"text-h4",children:tx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(lr,{color:"green",children:tx(s)})})]}),o("div",{className:"hidden sm:block",children:o(Yi,{className:"flex-wrap",children:m?.map(ex)})}),o(qi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ji,{isUnfolded:e,children:o(Yi,{className:"flex-wrap",children:m?.map(ex)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(d))},Qf=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${tx(t)} №${n}`,body:e.toUpperCase()}),ex=(e,t)=>o($i,{...e},String(t)),tx=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",nx=[];const ax=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:nx},lx={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ix={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},rx=d((({descriptionData:e,className:t})=>{const[n]=Qh(),a=n?.code??"000",{data:l,isLoad:i}=function(e){const{data:t,error:n}=qn(`/api/v1/atms?regionCode=${e}`,ax);return{data:t||nx,isLoad:!t&&!n}}(a);return o(ns,{className:t,filterItems:sx,data:l,isLoad:i,initFilterState:lx,renderCard:Zf,getBalloon:Qf,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),sx=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),l=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=l.every((t=>ix[t](e))),n=!a.length||a.some((t=>ix[t](e)));return t&&n}))},ox=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Me,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:cx({workScheduleDescription:t})}),o(qi,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ji,{isUnfolded:e,children:cx({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(n)):null,cx=({workScheduleDescription:e})=>c("div",{children:[c(Yi,{className:"flex",children:[o($i,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o($i,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o($i,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o($i,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o($i,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),dx=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),mx={branches:[],remoteWorkplaces:[]};const ux=async e=>await rt(e,{method:"GET"})||mx,hx=d((({className:e})=>{const[t]=Qh(),n=t?.code??"000",{data:a,isLoad:l}=function(e="000"){const{data:t,error:n}=qn(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,ux);return{data:t||mx,isLoad:!t&&!n}}(n);return o(ns,{className:e,data:a?.branches,isLoad:l,remoteWorkplaces:a?.remoteWorkplaces,renderCard:gr,renderRemoteWorkplaceCard:ox,getBalloon:xr,getBalloonRemoteWorkplaces:dx,title:`Офисы филиала ${t?.name}`})})),px=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(hx,{}):o(rx,{descriptionData:e})})})),gx=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),fx="hidden sm:flex absolute z-40 top-10",xx=ht((({className:e="",padding:t,slides:n=[],...l})=>{const[i,r]=a(0),[s,d]=pc({itemCount:n?.length||0});return c(g,{className:u("box-border overflow-hidden",e),defaultPadding:"pt-6xl",padding:t,...l,children:[o("div",{className:"flex duration-1000",style:{transform:`translateX(-${100*i}%)`},role:"list",children:n.map((({productBlock:e},t)=>o("div",{className:"box-border grow-0 shrink-0 basis-full",role:"listitem",children:o(Xe,{className:"pl-6xl h-full",headlineVersion:"M",isFullWidthTitle:!1,...e,...l})},String(t))))}),c("div",{className:"relative pr-xs mt-m -mb-m flex gap-xs box-border",children:[o(tc,{containerRef:s,snapAlign:"snap-start",onVisibleIndicesChange:d.handleVisibleIndicesChange,itemClassName:"h-40 flex items-stretch w-screen",gap:8,children:n.map(bx({activeSlideIndex:i,onClick:r}))}),d.canScrollLeft?o(yc,{className:u("left-6",fx),onClick:d.scrollLeft}):null,d.canScrollRight?o(vc,{className:u("right-6",fx),onClick:d.scrollRight}):null]})]})})),bx=({activeSlideIndex:e,onClick:t})=>({nav:n},a)=>{const l=a===e,i=l?"min-w-[370px] mt-s h-28 bg-white shadow-dark-blue border-none p-6":"min-w-72 mt-lg h-24 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=l?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=l?"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(a),"aria-label":n?.title,className:u("relative overflow-hidden grow","ml-xs px-xl","box-border basis-0 border","border-gray group-data-secondary:border-white/50","text-left whitespace-nowrap",i),children:[o("div",{className:r,children:n?.title}),o("div",{className:s,children:n?.description})]},String(a))},yx=d((({address:e,email:t,telephone:n,button:a,className:l="",__html:i,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",l),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Oe(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(N,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[i?vx({__html:i,richVersion:r}):null,Nx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Nx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Nx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?Le([a]):null]})]}))),vx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Re,{...e,itemSize:"list-s"})}),Nx=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Me,{size:"text-xl",color:a,children:t})]})]}):null,wx=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Re,{__html:t,richVersion:n})})})),Cx=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:a,labelIcon:l})=>o(Bc,{tag:"button",className:u("border-none bg-transparent items-center group/button",l?.icon?"py-xs":"py-lg"),onClick:a,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[null,e?o(Me,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),kx=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Sx=(e=!1)=>e?"MinusIcon":"PlusIcon",Tx=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Ix=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:a="Развернуть",labelIcon:l,labelIconBgVersion:i,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Ce();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(qi,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ji,{className:u("gap-lg",kx(m)),isUnfolded:e,children:R({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Bx({foldButtonVersion:r,label:a,labelIcon:l,labelIconBgVersion:i,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Bx=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:a,isUnfolded:l,onToggle:i,isMobile:r=!1})=>{const s=t||(l?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Tx(e):Sx(e))(l,r);return"accordion"===e?o(Cx,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:i}):o(Pc,{label:s,icon:l?"ArrowUpIcon":"ArrowDownIcon",onClick:i})},Px=d((({name:e,text:t,value:n,checked:a,onChange:l,className:i})=>o("div",{className:i,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(Wt.split(" ").filter((e=>"rounded"!==e)),Jn,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>l?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),Rx=d((({className:e=""})=>{const[t,n]=a("option2"),l=i((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Px,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:l}),o(Px,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:l})]})})),Dx=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:l="",setSelected:i,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(cn,{options:s,label:r,placeholder:l||a,onChange:e=>i(e.key),value:c})})),Mx=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:l,onSelectedBranch:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Dx,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Dx,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:l,setSelected:i,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ax=["От 1 дня","До 365 дней"],_x=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ua,{min:1,max:365,value:e,items:Ax,onChange:t})]}))),zx=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:l,onSelectedBoxSize:i})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Dx,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Dx,{data:a,fieldLabel:"safeBoxCasesSize",selected:l,setSelected:i,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Ex=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:l,selectedCaseVolume:i,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Mx,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Fx(m)}),o(_x,{days:l,setDays:e=>m({days:e})}),o(zx,{caseVolumes:d,selectedCaseVolume:i,onSelectedCaseVolume:Vx(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Me,{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(Rx,{}),o(ye,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Fx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Vx=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Ox=d((({days:e,tariffs:t=[]})=>{const n=qx(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[Lx("Аренда за",e),Lx("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(w,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(w,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),Lx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Me,{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})]}),qx=(e,t)=>{const n=jx(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},jx=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},$x=(e,t)=>e.find((e=>e.branchCode===t)),Ux=d((e=>{const{regions:t,data:n,branches:a,onChange:i,onClick:r}=e;l((()=>{i({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,i]);const s=$x(a,n.selectedBranch),d=Wx(s?.safeBoxCaseVolumes),m=Hx(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Yx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Ex,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:i}),o(Ox,{days:n.days,tariffs:u})]})})),Wx=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Hx=(e,t)=>e?.find((e=>e.volume===t)),Yx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Kx=[];const Gx=async e=>await rt(e,{method:"GET"})||Kx,Xx=d((({title:e,footnote:t,className:n="",...l})=>{const[r,s]=a(!1),d=i((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Vi(),p=Jx(m.selectedRegion,h),f=function(e){const{data:t}=qn(e?`/api/v1/safeboxes?regionCode=${e}`:null,Gx);return t||Kx}(p),x=i((e=>u((t=>({...t,...e})))),[u]),b=(y=$x(f,m.selectedBranch)||f,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(g,{className:n,defaultPadding:"",...l,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(N,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Ux,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(w,{size:"text-s",font:"font-light",children:t}):null]}),b.length&&r?o(zr,{points:b,className:"h-[640px]"}):null]})})),Jx=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Zx=e=>e<4?"w-72":"w-52",Qx={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"},eb=d((({buttons:e,className:t="",description:n,showLines:a=!0,steps:l=[],stepVersion:i="gray",title:r,version:s="primary",...d})=>{const m=l.length>3,h=Qx,p=(e=>e?"":"opacity-0")(a),f=Ce();return c(g,{className:u("box-border flex flex-col items-center overflow-hidden gap-y-3xl",t),defaultPadding:"p-6xl",version:s,...d,children:[o(k,{headlineVersion:"S",title:r,description:n,isEmbedded:!0,className:"w-full",align:Xc(f)}),l?.length?c("div",{className:"box-border space-y-lg flex flex-col justify-center",children:[o("div",{className:u("flex items-center",m?"px-16":"px-24"),children:Ec(o("div",{className:u("h-0.5 w-full bg-secondary-light flex-1",p)}))(l.map(tb(h,m,i)))}),o("div",{className:u("flex justify-between",m?"gap-x-s":"gap-x-20"),children:l.map((x={styleMap:h,version:s},(e,t,n)=>{const{styleMap:a,version:l}=x,{label:i,description:r,button:s,isDotted:d}=e;return c("div",{className:u("relative flex flex-col items-center text-center justify-between whitespace-pre-line overflow-hidden space-y-3xl",Zx(n.length)),children:[c("div",{className:"space-y-xs",children:[i?o(Me,{size:"text-h6",align:"text-center",children:i}):null,c("div",{className:"flex flex-col items-center gap-3xs",children:[r?o("div",{className:a.description,children:r}):null,o(Re,{__html:e.__html,itemSize:"list-s",isDotted:d})]})]}),s?.text?o(ye,{className:"box-border py-s w-full max-w-60 mt-auto",version:l,...s,children:s?.text}):null]},String(t))}))})]}):null,Le(e)]});var x})),tb=(e,t,n)=>({icon:a},l)=>{const i="secondary"===n?"white":"color";return o(g,{defaultPadding:"",className:`${nb(t)} flex justify-center items-center text-center rounded-full box-border z-10`,version:n,children:Oe(a)?o(ne,{image:{...a,iconVersion:a?.iconVersion||i},width:"48",height:"48"}):o("span",{className:u("text-h4","transparent"===n?e.iconText:(r=n,"secondary"===r?"group-data-primary:text-white":"text-secondary-text")),children:l+1})},String(l));var r},nb=e=>e?"h-16 w-16":"h-24 w-24",ab=d((()=>o("div",{className:"hidden",role:"none"}))),lb="hidden sm:flex absolute z-40",ib={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},rb=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:i="default"})=>{const[r,s]=pc({itemCount:t?.length||0});return l((()=>sb(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(tc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:ib[i].item,gap:ib[i].gap,children:t.map(Kf(n,a,i))}),s.canScrollLeft?o(yc,{className:u("left-6",lb,ib[i].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(vc,{className:u("right-6",lb,ib[i].buttonTop),onClick:s.scrollRight}):null]})})),sb=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},ob={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},cb=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(ob[t].wrapper,e),children:o(rb,{className:ob[t].component,tabsType:t,...n})}):null,db=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=mb(n??{}),p=D(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:b}=p,[y,v]=a(pb(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[y],w=x.findIndex((e=>Boolean(e.selected)));l((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[b,w,h]);const C=hb(x[y],y),k=i((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[cb({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:ub(t,x),activeItem:N,tabsType:r,onChange:k}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(hb)?.filter(Boolean)||[]}),mb=({__id:e,anchor:t})=>t??e??"tabs",ub=(e,t)=>t?.length?t:e,hb=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",pb=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),gb={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},fb=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:gb[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),xb=d((({className:e="",isOpen:t,onClick:n})=>o(ye,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),bb={Buttons:({buttons:e})=>Le(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(Re,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Me,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Me,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:l})=>e?o(xb,{className:"w-fit",isOpen:l,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},yb=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:i,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);l((()=>{i===o&&s||m(!0)}),[s,o]);return vb({cell:e,cellProps:{rowIdx:n,cellIdx:i,fieldIdx:t,displayTable:e=>{m(!1),c(i),r(e)},isVisible:d}})})),vb=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in bb))return null;return o(bb[n],{...t,...a})},Nb=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:l,openTableInnerIdx:i,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(yb,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:l,openTableInnerIdx:i,setOpenTableInnerIdx:r},String(s)))):null}))),wb=(e,t)=>140*$p(e.slice(0,t).map((e=>e?.cols?.length??1))),Cb=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Me,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,kb=d((({rows:e})=>{const t=e?.[0]?.length??0,[n,a]=ef({itemCount:t,visibleItemCount:5});return c("div",{children:[e?.map((l=n,(e,t)=>{if(!e?.length)return null;const[n,...a]=e,i=u("flex duration-1000 text-center",0!==t?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[n?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Me,{size:"text-xl",font:"font-light",children:n.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:i,style:{transform:`translateX(-${wb(a,l)}px)`},children:a?.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(Me,{size:"text-xl",children:e.data}):null,e?.cols?Cb(e.cols,l):null]},`row${t}`)))})})]},String(t))})),tf({...a,btnClass:["left-3 top-20","right-3 top-20"],className:""})]});var l})),Sb=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Me,{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(kb,{rows:t.rowsData})})})]},a)}))}))),Tb=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Ib=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Me,{size:"text-xl",font:"font-light",color:Tb(t===n),children:e||t+1})},e)))}):null,t?o(ye,{className:"text-primary-main",href:t,version:"secondary",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Bb=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const l=e?.tableData,[r,s]=a(0),d=i((e=>s(e)),[]),m=l?.[r]?.items??[],u=l?.map((e=>e.currency??""));return c("div",l?{className:"bg-white z-10",children:[o(Ib,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Sb,{activeTabIndex:r,items:m}),o(xb,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(xb,{onClick:n,isOpen:!0})]})})),Pb=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Bb,{...t,onClick:n})}):null]}))),Rb=d((({row:{header:e,data:t},activeIndex:n,rowIdx:l,...r})=>{const[s,d]=a(void 0),m=i((e=>d(e)),[]),[h,p]=a(void 0),g=i((e=>p(e)),[]);return c(Pb,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(fb,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Nb,{cells:e,rowIdx:l,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})})),Db=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,tf({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),Mb=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:l,hiddenRowsNum:i=0,...r})=>{const s=l?.map((({data:e})=>e))||[],d=a?.map(((e,t)=>({header:e,data:s.map((e=>e?.[t]||[]))}))),m=s.length,[h,p]=ef({itemCount:m,visibleItemCount:2}),f=(d||[]).map(((e,t)=>o(Rb,{row:e,activeIndex:h,rowIdx:t,...r},String(t)))),[x,b]=i>0?[f.slice(0,-i),f.slice(-i)]:[f,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...r,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:i>0?o(qi,{renderFoldableSection:({isUnfolded:e})=>c(Db,{controls:p,children:[x,o(ji,{isUnfolded:e,children:b})]}),renderFoldButton:Rc}):o(Db,{controls:p,children:f})})]})})),Ab=d((({className:e="",title:t,description:n,iconVersion:a,__html:l,richVersion:i,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?_b():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Me,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?zb(n):null,l?o(Re,{richVersion:i,__html:l}):null]})]}))),_b=()=>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"}),zb=e=>o(w,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Eb=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Me,{size:"text-h2",children:n})}):null]}))),Fb=d((e=>{const{prefix:t,unit:n,suffix:a,...l}=e;return o(g,{defaultPadding:"p-0",...l,children:o(Eb,{prefix:t,unit:n,suffix:a})})})),Vb=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:l="transparent",isTheme:i=!1,isCardBorder:r=!1,image:s,...c})=>{const d=D();return o(g,{className:u("relative flex flex-col",Jg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:l,isTheme:i,...c,children:R({...c,extraProps:{className:u("w-full",Go(r)),...Xg(a)}})})}),{childrenTypes:[]}),Ob=e=>(e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12})(e)<10?"py-xl px-6xl":"py-6xl px-32",Lb=d((({className:e,title:t,url:n,previewImg:a,...l})=>{const i=D();return c(g,{className:e,defaultPadding:Ob(e),...l,children:[o(k,{title:t,headlineVersion:"M"}),n?o("video",{className:"m-auto w-full object-fill",preload:"metadata",poster:$(i)(a?.src),style:{maxHeight:524},controls:!0,children:o("source",{src:$(i)(n)})}):null]})})),qb={AdTile:gt,ApplicationForm:Ls,ApplicationLeadForm:jo,ApplicationStatus:Wo,BankAccountFiltration:Kc,BenefitsBlock:Qc,BonusBenefitsBlock:ld,ButtonsBlock:rd,CalculatorBonus:Nd,CalculatorBusinessDeposit:Vd,CalculatorCredit:Qd,CalculatorDeposit:xm,CalculatorRefinancing:Sm,CardTransfer:Mm,Carousel:Lm,CarouselCard:Um,CarouselCatalogCard:Hm,CarouselLinks:Gm,CarouselRecommendationCard:au,CarouselTariffsCard:ru,ContactsBlock:ou,CreditCardForm:Hu,CreditForm:Bh,DepositFiltration:Ah,Depository:Gh,ErrorBlock:Jh,ExchangeRateTile:kp,Footer:lg,GracePeriod:ig,GrantSupport:cg,Header:Yg,Headline:k,HorizontalLayout:Zg,ImgBlock:Qg,InsuranceAmountBlock:sf,InvestmentInfo:mf,LinkDocs:Sf,MobileAppTile:Pf,MortgageFiltration:Jf,OfficesAtmsMap:px,Placeholder:gx,ProductBlock:pt,ProductGallery:xx,RepresentativeOfficeInfo:yx,RichTextBlock:wx,RollupItem:Ix,SafeDepositRental:Xx,StepsBlock:eb,StickyBottomMenu:ab,TabsLayout:db,TariffsTable:Mb,TextBlock:Ab,UnitBlock:Fb,VerticalLayout:Vb,Video:Lb},jb=me((()=>{l((()=>{Tt()}),[]);const e=_t();qt(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");kt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))})),$b="cookie",Ub=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=Lt();Lp((()=>{globalThis.localStorage?.getItem($b)||n()}),[],3e3);const l=i((()=>{globalThis.localStorage?.setItem($b,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(Re,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(hl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:l})})]})}):null}));function Wb(e){throw new Error(e)}const Hb=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=a(e),l=i((e=>n((t=>[...t,e]))),[]),r=i((()=>n((e=>e.slice(0,-1)))),[]),s=i((e=>n((t=>t.filter((t=>t!==e))))),[]),o=i((()=>n([])),[]);return[t,{setList:n,push:l,pop:r,remove:s,clear:o}]}(),c=i((()=>{e&&e(n),o()}),[n,e]),d=i((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return l((()=>ce.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:Wb(e)}}))),[c,d]),n},Yb=d((()=>{const e=i((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=i((e=>{e?.onClose&&e.onClose()}),[]),n=Hb({onCloseAll:e,onClose:t}),{close:a}=de(),r=i((({key:e})=>{"Escape"===e&&a()}),[]);return qt(globalThis.document,"keydown",r),l((()=>{n.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==n.length-1}),children:e},String(t||a))))}):null})),Kb=d((()=>{const[e,t]=a(null),n=i((()=>{t(null)}),[]);l((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Wb(e)}}))),[]);const r=i((({key:e})=>{"Escape"===e&&n()}),[n]);return qt(globalThis.document,"keydown",r),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),Gb="header",Xb="footer",Jb="sticky-footer",Zb={},Qb=d((({className:e,data:t=Zb,blocksRegistry:n,blockDecorator:a})=>{const{slots:l,blocks:i,fallback:r,...s}=t,d=ut(s,r);jb();const m={key:"",page:{slots:l,blocks:i,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[l?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(l?.header,{...m,slotName:Gb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[R({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(l?.footer,{...m,slotName:Xb})]})]}),l?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(l?.["sticky-footer"],{...m,slotName:Jb})}):null,o(Yb,{}),o(Kb,{}),o(Ub,{__html:d?.cookieContent?.__html})]})}));Object.assign(Qb,{childrenTypes:[],slots:()=>[Gb,Xb,Jb]});e.Blocks=qb,e.ContentPage=Qb,e.handlerDecorator=me,e.joinList=Ec,e.packageVersion="0.14.660",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=D,Object.defineProperty(e,"__esModule",{value:!0})}));