@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).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),l=n("useEffect"),a=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:i,...l}=t||{},a=n?.slots?.default,r=i||a&&a();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:i="p-xl",padding:l,block:a,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||i,e),...m?{"data-ver":t}:{},...a?.anchor?{id:a.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:i,children:l})=>{const a=v[n]||"h3";return o(a,{role:"heading",className:u("font-sans m-0",N[t],e),children:i||l})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),k={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"}},S=d((({className:e,version:t="",headlineVersion:n="XL",title:i,description:l,align:a="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=k[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[i?o(w,{className:u("whitespace-pre-wrap",a),...h?.title,as:r||h?.title.as,title:i}):null,l?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:a,...p,children:l}):null]})})),T=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function B(e,t,{className:n,...i}={}){const{key:l,blockDecorator:a=T,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return a({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:a})=>{const{content:r}=n;return d?o(d,{className:a,block:e,options:t,...r,...i},l):null}},l)}const R=[],P=(e,{key:t,ancestors:n=R,slotName:i=null,extraProps:l,renderProps:a=B,...r})=>{const s=l?(e,t)=>B(e,t,l):a;return(e||[]).map(((e,l)=>s(e,{...r,key:`${t||e.type}-${l}`,ancestors:r.parent?[...n||R,[r.parent,i]]:n},l)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:l}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:i,renderProps:l}):null)}function M(){return M._impl()}M._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),M.setup=e=>{M._impl=e};const A=["CDN","BASE_PATH"],_=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return A.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),z=e=>Boolean(e?.includes(":")),E=(e,t)=>Boolean(e&&!z(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),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 q=Object.freeze({__proto__:null,isURL:z,isLocalURL:E,isHash:F,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:O});const L="/api/",j=`${L}v1/storage`,$=e=>(t,n)=>{if([!t,z(t),F(t),[_.CDN,L].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 i=t?.startsWith("/");return V(O(t,n)?"":n,i?"/":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:i=`Иконка ${n}`,title:l=i,iconVersion:a="color",width:r,height:s})=>{const d=M(),m="normal"===a?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(V(_.CDN,"/icons/",m));return"normal"===a?o("img",{className:e,src:h,alt:i,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[a],{invert:"white"===a},t),width:r,height:s,"aria-hidden":"true",children:[l?o("title",{children:l}):null,i?o("desc",{children:i}):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&&!z(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 i=M();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:l},a)=>o("source",{srcSet:J(i)(e),type:te(n),media:l?`(max-width: ${l}px)`:"",width:t?.size?.width,height:t?.size?.height},`${a}_${e}`))):null,t?.src?ee({...t,src:J(i)(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="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},le="bg-main-divider text-main-disabled",ae={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},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?ie[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=M(),{closeAll:n}=de();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(i({...e,href:n}))}};function i({href:i,target:l,onClick:a}){return r=>{a?.(r),he(i,l,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!E(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.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:i,appendRight:l,version:a="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[a]),children:i}):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[a]),children:l}):null]})})),fe=e=>{const{version:t,aboveText:n,rounded:i}=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":i})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ye=({className:e,rounded:t,version:n})=>["inline-block",re,n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" "),be=d((({disabled:e,children:t,method:n="LINK",href:i,...l})=>{const r=(({method:e,href:t})=>a((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:l,searchParams:a}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,l].join(""));for(const[e,t]of a.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:i}),s=ue()({onClick:r,href:i,...l}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:i,ariaLabel:l,version:a,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:a,rounded:r}),href:t,rel:n,target:i,"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:i,children:l})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ye({className:e,rounded:i,version:n}),children:l})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const l="primary"===e?"white":"black",a="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"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}),a),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),o(be,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=i(true);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:i="",title:l,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Ce(),v=M(),N=a((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||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(D({...y,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:i="list-m",isDotted:l=!0}=e,a=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,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,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(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:_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),qe=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"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(Le(n))}):null,Le=(e="")=>(t,n)=>{const{text:i,icon:l,iconRight:a,version:r,...s}=t||{},c=je(l,r),d=je(a,r);return i||l?.icon?o(be,{className:u("basis-full @lg:basis-auto",e),appendLeft:$e({...l,iconVersion:c}),appendRight:$e({...a,iconVersion:d}),version:r,text:i,...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},i)=>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(i)),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:i,description:l,headlineVersion:a="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:k,children:T,...I})=>{const B=b?.src?o(ne,{image:b}):null,R=o(S,{title:i,description:l,headlineVersion:a,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:qe(y),backwardButton:k,...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[a]}):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(it,e),it=(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)))}),at=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const i in e)at(e[i],t,[...n,i])},array:e=>{for(let i=0;i<e.length;i++)at(e[i],t,[...n,i])}})};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 at(e,(e=>t.push(e))),t})(e),[a,r]=i({});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,...a}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:i,padding:l,isTheme:a,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,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Xe,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),i=t?.[n];return i?o(pt,{suppressHydrationWarning:!0,...i,...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"),i=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getFullYear());return t?`${l}-${i}-${n}`:`${n}.${i}.${l}`}},yt=e=>e?.replace(/[^+\d]/g,"");const bt=e=>e?{phone:yt(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:yt(e)}:{},kt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:l}of e)t[i??""]?.(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(z(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Tt();if(!z(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;if(n){At(t?.target)?.(n)}}},At=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 _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]=i(e),c=a(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]=i(!1),[u,h]=i({}),p=a(((e,t)=>{const{parse:n=zt,format:i=zt}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=a((e=>{c(e),h(e)}),[]),f=a((()=>{c(e),m(!1),h({})}),[e]),x=a((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:i,...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(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})})),Ot=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function qt(e=!1){const[t,n]=i(e),l=a((()=>n(!0)),[]),r=a((()=>n(!1)),[]),s=a((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:l,setFalse:r,toggle:s}]}function Lt(e,t,n,i){l((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function jt(e){const t=s(null),n=a((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return Lt(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:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),k=a((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:i||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",Gt,S,T),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:y,pattern:b,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]=i([]),f=en(),x=Qt[n],y=a((()=>{h.current=t,f.close()}),[t]),b=a((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:l={},responseItemHandler:a=Jt}=e,r=(s=a,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${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 i=(...l)=>{i.dispose(),n=setTimeout((()=>{e(...l)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return l((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:l,width:a,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:b}),{top:i+globalThis.scrollY+r,left:l,width:a})}),[e,p,t,b]),v}const ln=d((({className:e,label:t,value:n="",placeholder:i,error:l,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:y=!1,disabled:b=!1})=>{const[v,{setFalse:N,setTrue:w}]=qt(),C=jt(N),k=a((e=>x?e.length<=x&&s(e):s(e)),[s]),S=nn({isOpen:v&&y,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:b,type:p||"text","aria-label":t,label:$t({label:t,errors:r}),valid:Boolean(!l),value:n,onChange:k,onBlur:m,isTextarea:h,placeholder:an(i,r,t)})}),Xt(l)]})})),an=(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:i,onChange:l,iconVersion:a})=>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,i).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:a,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[y,{setFalse:b,setTrue:v}]=qt(),[N,w]=i(""),C=un(x,n.length),k=y&&!C,S=a((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=a((()=>{m.close(),c&&c()}),[c]),h=a((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:a,left:r,width:s,height:c}=l.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),{top:a+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,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:i,...l})=>c("div",{className:e,children:[o(cn,{...l,valid:!n,label:$t({label:t,errors:i})}),Xt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",yn=e=>fn(e??xn),bn=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:yn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:bn(),addressBranch:bn(),phone:kn("Укажите номер телефона"),secondaryPhone:kn("Укажите номер телефона"),organizationPhone:kn("Укажите номер телефона"),birthday:yn("Укажите дату рождения"),birthPlace:yn("Укажите место рождения"),education:yn("Выберите ваше образование"),housing:yn("Выберите тип жилья"),employment:yn("Выберите информацию о трудоустройстве"),organization:yn("Выберите тип организации"),amountWorkers:yn("Выберите информацию о количестве сотрудников"),employerActivities:yn("Выберите вид деятельности организации"),employerOrganization:yn("Выберите вид организации"),positionOrganization:yn("Выберите вашу должность"),dulSerie:(Pn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Pn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:yn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:yn("Укажите организацию, выдавшую паспорт"),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:yn("Укажите ОПФ"),organizationName:yn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:yn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:yn(),collectionCount:yn(),comment:yn(),acquiringType:bn(),feedbackMethod:bn(),serviceType:bn(),serviceDirection:bn(),meetingDay:yn(),product:yn(),localities:yn(),consentDataProcessing:Sn,annualRevenue:yn(),consentToReceiveMaterials:Sn,processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentInformFlg:Sn,familyStatus:yn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(Tn)(e))("Некорректный номер СНИЛС"),conscription:yn(),armyIdFlg:Sn,sex:yn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:Bn(),participantDateRegistration:yn("Укажите дату регистрации"),retirementIncome:yn(),otherIncome:yn(),mandatoryIncome:yn(),otherPayments:yn(),disablePeopleFlg:yn(),bankruptcyFlg:yn(),shareholderFlg:yn(),legalEntityName:yn(),bankEmployeeCode:yn(),partInBusiness:yn(),regionRetail:bn("Выберите филиал банка"),addressRetail:bn("Выберите адрес банка"),addressMatch:yn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&/^[\u0400-\u04FF\d]+$/u.test(e)))(e??xn))("Необходимо ввести кодовое слово"),confirmationIncome:yn(),deliveryDate:yn("Укажите дату доставки"),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:i}=e,l=i?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"),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))),qn=e=>On(e)?e.toString():"";function Ln(e,t,{fallback:n,cache:a}={}){const s=r((()=>jn(e)),[e]),[o,c]=i(void 0),[d,m]=i(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 i=qn(n),l=t.get(i);if(i&&Fn(l))return l;const a=e(...n);return i&&Fn(a)&&t.set(i,Promise.resolve(a)),a})(t,a)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,a,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}=Ln("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),st);return Array.isArray(t)?t:[]}const Hn=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),a=i?.value?.key,r=i?.value?.text,s=n?Wn(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=Ln(e?`/api/v1/branches?regionCode=${e}`:null,Un);return t||$n}(a)?.filter((e=>e?.address));return l((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(hn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...An(e("addressBranch"),Rn.addressBranch,t?.required),isSearch:!0})})),Yn=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");l((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);const s=a((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=a((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(ln,{label:"Адрес",disabled:r,...An(e(n),Rn[n],t?.required),value:i.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",i=e(n).value,l=a((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=a((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(ln,{disabled:t?.filledByEsia&&Kn(e,n),label:"Адрес",...An(e(n),Rn[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:l})})),Xn=d((({className:e,viewBox:t,fill:n="none",width:i,height:l,paths:a,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:l,children:a.map((({d:e,fill:t,...n},i)=>{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},i)}))}))),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:i,isRadio:l,onChange:r})=>{const s=a((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,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",ti(i)),onClick:s,children:[o("div",{className:u(Jn,"m-0",l?"rounded-full border-2":ii(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ni(l),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,ei(n)]})})})),ei=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,ti=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ni=(e=!1)=>e?"radio":"checkbox",ii=(e=!1)=>u("rounded border",{"bg-primary-main":e}),li=d((({className:e,text:t,value:n,key:i,disabled:l,error:a,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Qn,{text:t,value:n,disabled:l,onChange:r},i),Xt(a)]}))),ai=d((({field:e,input:t})=>o(li,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...An(e("addressMatch"),Rn.addressMatch,t?.required)}))),ri=(e,{normalize:t,format:n})=>{const{value:l,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=a((e=>{d(!0),r&&r(e)}),[]),u=a((()=>{d(!1),o&&o(t(l)),s&&s()}),[o,l]);return{value:c||!n?l:n(l),onFocus:m,onBlur:u}},si=(e,t,n)=>Math.max(t,Math.min(e,n));function oi(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function ci({list:e=[],min:t,max:n,step:i,value:l=e[0]||t,disabled:a,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||a?"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:i,value:s,disabled:a,onChange:t=>{const n=oi(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const di=1,mi=100,ui=d((e=>{const{className:t,title:n,items:i=[],list:l=[],min:r=(l.length?0:di),max:s=(l.length?l.length-1:mi),step:d=1,value:m=l[0]||r,disabled:h=!1,onChange:p}=e,g=ri(e,{normalize:(e=0)=>l.length?hi(l)(e):si(e,r,s),format:Ue()}),f=a((e=>{p&&p(oi(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}),ci({list:l,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),pi(i)]})})),hi=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),pi=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))))}),gi=["От 1 000 ₽","До 1 000 000 000 ₽"],fi=d((({field:e})=>o(ui,{title:"Сумма, ₽",items:gi,min:1e3,max:1e9,...e("amount")}))),xi=e=>{const{data:t,error:n}=Ln(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,yi);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},yi=async e=>await rt(e,{method:"POST"})||[],bi=ht((({field:e,source:t,label:n,fieldName:i,input:l})=>{const a=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:"Выберите из списка",label:n,options:a,...An(e(i),Rn[i],l?.required)})})),vi=d((({field:e,input:t})=>{const{data:n}=xi("EMPLOYEES_NUMBER");return o(bi,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Ni=d((({field:e,input:t})=>o(ln,{label:"Годовая выручка, ₽",...An(e("annualRevenue"),Rn.annualRevenue,t?.required)}))),wi=d((({field:e,input:t})=>o(li,{text:"Наличие военного билета",...An(e("armyIdFlg"),Rn.armyIdFlg,t?.required)}))),Ci=d((({field:e,input:t})=>o(ln,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...An(e("bankEmployeeCode"),Rn.bankEmployeeCode,t?.required),...t}))),ki=d((({field:e})=>o(ln,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Si=d((({field:e,input:t})=>o(li,{text:"В отношении меня ведётся производство по делу о банкротстве",...An(e("bankruptcyFlg"),Rn.bankruptcyFlg,t?.required)}))),Ti=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:l,min:a,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,i,d),n=Ii(t,e),c=Bi(t,a,r);u.push(o("td",{children:o("div",{className:Ri(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ii=(e,t)=>t&&e.toDateString()===t.toDateString(),Bi=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Ri=(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"),Pi=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Di=d((({today:e,currentMonth:t,currentYear:n,min:i,max:l,onDateSelect:s=Ut,setValue:d=Ut})=>{const m=a((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:Pi.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Ti({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:l,onDateClick:m})})]})})),Mi=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ai(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],l=i.findIndex(_i),a=i.map(((e,t)=>Ei(e)?i.slice(0,t).filter(Ei).length:-1)),r=i.map(((e,t)=>zi(e)?e:n.charAt(a[t])||e)),s=a.indexOf(n.length-1)+1;return r.slice(0,Math.max(l,s)).join("")}const _i=e=>"_"===e,zi=e=>/\d/.test(e),Ei=e=>_i(e)||zi(e),Fi=1940,Vi={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Oi=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:a,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(a||"");return l((()=>{g(a||"")}),[a]),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(Ai(t,"__.__.____"))},onBlur:()=>{if(qi(p)){const[n,i,l]=p.split(".");d?.(new Date(Number(l),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(l))}else g(a||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Vi})]})})),qi=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=Fi&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),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},Li=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:l,setSelectedYear:a,disabled:r=!1})=>o(Oi,{onChange:i,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:l,setSelectedYear:a,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")}),ji=Mi.map((e=>({key:e}))),$i=Array.from({length:(new Date).getFullYear()-Fi+1},((e,t)=>Fi+t)).reverse().map((e=>({key:String(e)}))),Ui=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},Wi=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:l})=>{i&&l?.(new Date(t,n,Math.min(e,i.getDate())))},Hi={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Yi={className:"min-w-32",iconVersion:"black",isBorder:!1},Ki=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=qt(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(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:i,onYearSelect:l,selectedYear:r,onChange:s,value:o})=>{const c=jt(a((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:a((()=>e(!t)),[t]),handleNextMonth:a((()=>{n+1<=11?i(n+1):(i(0),l(r+1))}),[n]),handlePrevMonth:a((()=>{n-1>=0?i(n-1):(i(11),l(r-1))}),[n]),handleSelectMonth:a((({key:e})=>{i(Mi.indexOf(e));const t=Ui(r,Mi.indexOf(e));Wi({maxDateOfMonth:t,selectedYear:r,selectedMonth:Mi.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:a((({key:e})=>{l(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ji,yearsOptions:$i,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,a]=i(!1);return l((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();a(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:[Li({handleChangeVisibleCalendar:T,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),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,{...Hi,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:Mi[f]},options:k,...Yi}),o(cn,{onChange:C,value:{key:String(y)},options:S,...Yi}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Hi,className:"rotate-90 cursor-pointer"})})]}),o(Di,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Gi=d((({className:e,label:t,error:n,errors:i,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ki,{label:$t({label:t,errors:i}),valid:Boolean(!n),...l}),Xt(n)]}))),Xi=d((({field:e,input:t})=>o(Gi,{label:"Дата начала работы на текущем месте",...An(e("beginDate"),Rn.beginDate,t?.required),...t}))),Ji="birthday",Zi=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:i}=e(Ji);return o(Gi,{label:"Дата рождения",...An(e(Ji),Rn.birthday,t?.required),error:n&&i&&!Qi(i)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&Kn(e,Ji)})})),Qi=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},el=d((({field:e,input:t})=>o(ln,{label:"Место рождения",...An(e("birthPlace"),Rn.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Kn(e,"birthPlace")}))),tl=d((({field:e,input:t})=>{const{data:n}=xi("CARD_TYPE");return o(bi,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),nl=d((({field:e,input:t})=>o(ln,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...An(e("children"),Rn.children,t?.required),...t}))),il=d((({field:e,input:t})=>o(ln,{label:"Кодовое слово",...An(e("codeWord"),Rn.codeWord,t?.required),...t}))),ll=d((({field:e,input:t})=>o(ln,{label:"Количество объектов инкассации",type:"number",...An(e("collectionCount"),Rn.collectionCount,t?.required)}))),al=d((({field:e,input:t})=>o(ln,{className:"col-span-2",...An(e("comment"),Rn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),rl=d((({field:e,input:t})=>{const{data:n}=xi("INCOME_CERT_UNITED");return o(bi,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),sl=d((({field:e,input:t})=>{const{data:n}=xi("MILITARY_STATUS");return o(bi,{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 i=await fetch(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...ml()},credentials:"include",body:n?JSON.stringify(n):null});return dl(i)?i.json():i}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:i,onClick:l})=>{const{close:r}=de(),s=a((()=>{r(),i&&i()}),[i]);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 i=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:i}):o("iframe",{src:`${i}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},fl=d((({className:e,error:t,docId:n,...i})=>{const{open:l}=de(),a=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Qn,{...i}),n?o(be,{className:"text-primary-main",onClick:()=>gl(l,n,a),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),Rn[t.name],t?.required)}):null)),yl=d((({field:e,input:t})=>{const{data:n}=xi("CREDIT_IN_RSHB");return o(bi,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),bl={horizontal:"@lg:flex-row",vertical:""},vl=d((({label:e,items:t,value:n,className:i,onChange:l,disabled:a=!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",bl[r],i),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:a},String(e))))})]}))),Nl=d((({className:e,label:t,onChange:n,error:i,...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(i)]}))),wl=[{id:"rub",text:"Рубль"}],Cl=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency");return o(Nl,{label:"Валюта",orientation:"horizontal",items:wl,value:n,onChange:e=>i?.(e),...An(e("currency"),Rn.currency,t?.required)})})),kl=d((({field:e,input:t})=>o(Gi,{label:"Дата доставки",...An(e("deliveryDate"),Rn.deliveryDate,t?.required)}))),Sl=d((({field:e,input:t})=>o(ln,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...An(e("dependents"),Rn.dependents,t?.required),...t}))),Tl=d((({field:e,input:t})=>o(Gi,{label:"Желаемая дата встречи",...An(e("desiredMeetingDate"),Rn.meetingDay,t?.required)}))),Il=d((({field:e,input:t})=>o(li,{text:"Являюсь инвалидом",...An(e("disablePeopleFlg"),Rn.disablePeopleFlg,t?.required)}))),Bl="dulIssueDateField",Rl=d((({field:e,input:t})=>o(Gi,{label:"Дата выдачи",...An(e(Bl),Rn.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Kn(e,Bl)}))),Pl="dulIssuedBy",Dl=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),l=a((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(ln,{disabled:t?.filledByEsia&&Kn(e,Pl),label:"Кем выдан",...t,...An(e(Pl),Rn.dulIssuedBy,t?.required),onDaDataChange:l,daDataQueryPrefix:n})})),Ml=d((({field:e,input:t})=>o(ln,{disabled:t?.filledByEsia&&Kn(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...An(e("dulNumber"),Rn.dulNumber,t?.required)}))),Al=d((({field:e,input:t})=>o(ln,{disabled:t?.filledByEsia&&Kn(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...An(e("dulSerie"),Rn.dulSerie,t?.required)}))),_l="dulSubdivisionCode",zl=d((({field:e,input:t})=>{const n=a((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(ln,{disabled:t?.filledByEsia&&Kn(e,_l),label:"Код подразделения",type:"number",maxLength:6,...t,...An(e(_l),Rn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),El=d((({field:e,input:t})=>{const{data:n}=xi("EDUCATION_LEVEL");return o(bi,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Fl=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(ln,{label:"Электронная почта",...An(e("email"),Rn.email,n),...i})})),Vl=d((({field:e,input:t})=>{const{data:n}=xi("ORGANIZATION_ACTIVITY_TYPE");return o(bi,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Ol=d((({field:e,input:t})=>{const{data:n}=xi("ORGANIZATION_KIND");return o(bi,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),ql=d((({field:e,input:t})=>{const{data:n}=xi("EMPLOYMENT_INFO_UNITED");return o(bi,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Ll=d((({field:e,input:t})=>o(ln,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...An(e("expenses"),Rn.expenses,t?.required),...t}))),jl=d((({field:e,input:t})=>o(ln,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...An(e("experience5Years"),Rn.experience5Years,t?.required),...t}))),$l=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,a="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=a+r+s;return l((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(ln,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Ul=d((({field:e,input:t})=>{const{data:n}=xi("MARITAL_STATUS");return o(bi,{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"),Rn.feedbackMethod,t?.required)}))),Gl=d((({field:e,input:t})=>o(ln,{label:"ФИО",...An(e("fullName"),Rn.fullName,t?.required),...t}))),Xl=d((({field:e,input:t})=>o(ln,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...An(e("generalSeniority"),Rn.generalSeniority,t?.required),...t}))),Jl=d((({field:e,input:t})=>{const{data:n}=xi("HOUSE_TYPE");return o(bi,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Zl=d((({field:e,input:t})=>{const n=a((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(ln,{label:"ИНН",type:"number",maxLength:12,...t,...An(e("inn"),Rn.inn,t?.required),onDaDataChange:n})})),Ql=d((({field:e})=>o(li,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),ea=d((({field:e,input:t})=>o(ln,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...An(e("jobsNumber"),Rn.jobsNumber,t?.required),...t}))),ta=d((({field:e,input:t})=>o(ln,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...An(e("lastJobExperience"),Rn.lastJobExperience,t?.required),...t}))),na=d((({field:e,input:t})=>o(ln,{label:"Наименование юридического лица",...t,...An(e("legalEntityName"),Rn.legalEntityName,t?.required)}))),ia=d((({field:e,input:t})=>o(ln,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...An(e("legalForm"),Rn.legalForm,t?.required),...t}))),la=[];async function aa(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:la}const ra=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:i}=Ln("outServiceRegions",aa),a=i?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return l((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:a,...An(e("localities"),Rn.localities,t?.required),isSearch:!0})})),sa=d((({field:e,input:t})=>o(ln,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...An(e("mandatoryIncome"),Rn.mandatoryIncome,t?.required),...t}))),oa=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],ca=d((({field:e,input:t})=>o(Nl,{orientation:"horizontal",items:oa,...An(e("methodObtain"),Rn.methodObtain,t?.required)}))),da="middleName",ma=d((({field:e,input:t})=>o(ln,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Kn(e,da),...An(e(da),Rn.middleName,t?.required),...t}))),ua=d((({field:e,input:t})=>o(ln,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Kn(e,t.name??""),...An(e("name"),Rn.name,t?.required),...t}))),ha=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!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]}))),pa=d((({field:e})=>En(e("acquiringType")?.value?.key)?o(ha,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),ga=d((({field:e,input:t})=>{const{data:n}=xi("ORGANIZATION_TYPE");return o(bi,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),fa=d((({field:e,input:t})=>{const n=a((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(ln,{label:"Наименование организации",...t,...An(e("organizationName"),Rn.organizationName,t?.required),onDaDataChange:n})})),xa=d((({field:e,input:t})=>o(ln,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...An(e("otherIncome"),Rn.otherIncome,t?.required),...t}))),ya=d((({field:e,input:t})=>o(ln,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...An(e("otherPayments"),Rn.otherPayments,t?.required),...t}))),ba=d((({field:e,input:t})=>o(Gi,{label:"Дата регистрации по месту жительства",...An(e("participantDateRegistration"),Rn.participantDateRegistration,t?.required)}))),va=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,i={...An(e("partInBusiness"),Rn.partInBusiness,t?.required)};return o(ln,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...i,...t,onChange:e=>i?.onChange&&i?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?i?.value:"",disabled:!n})})),Na=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(ln,{...An(e("partnerComments"),Rn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),wa=[{id:"mir",text:"Карта МИР"},{id:"union_pay",text:"UnionPay"}],Ca=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("paymentSystem");return o(Nl,{label:"Платежная система",orientation:"horizontal",items:wa,value:n,onChange:e=>i?.(e),...An(e("paymentSystem"),Rn.paymentSystem,t?.required)})})),ka=e=>"_"===e,Sa=e=>/\d/.test(e),Ta=e=>ka(e)||Sa(e),Ia=[..."+7 (___) ___-__-__"],Ba=Ia.findIndex(ka),Ra=Ia.map(((e,t)=>Ta(e)?Ia.slice(0,t).filter(Ta).length:-1));function Pa(e){const t=e.replace(/\D/g,""),n=Ia.map(((e,n)=>Sa(e)?e:t.charAt(Ra[n])||e)),i=Ra.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(Ba,i)):n).join("")}const Da=d((({children:e,onChange:t,...n})=>{const i=a((e=>t&&t(Pa(e))),[t]),l=a((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),Ma=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Da,{"aria-label":t,label:$t({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),Xt(n)]}))),Aa=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Ma,{label:"Телефон",...An(e(n),Rn.phone,t?.required),disabled:t?.filledByEsia&&Kn(e,n),...t})})),_a=d((({field:e,input:t})=>{const{data:n}=xi("POSITION");return o(bi,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),za=d((({field:e})=>En(e("acquiringType")?.value?.key)?o(ha,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ea=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:Fa(t?.productList),...Mn(e("product"),Rn.product)}))),Fa=e=>(e??[]).map((e=>({key:e,value:e})));function Va(e="/api/v1/regions"){const{data:t}=Ln(e,st);return Array.isArray(t)?t:[]}const Oa=d((({field:e,input:t,url:n})=>{const i=Va(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...An(e("region"),Rn.region,t?.required)})})),qa=d((({field:e,input:t})=>{const n=Wn(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:i,...An(e("region"),Rn.region,t?.required)})})),La=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:l,renderFoldButton:r})=>{const[s,o]=i(n),d=a((()=>{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 ja=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),a=function(e,t){const n=s(null);return l((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:a,children:n})})})),$a=d((({value:e,subText:t,children:n,isPhone:i,...l})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,n,t].every((e=>!e))?null:Ua({textItems:a,subText:t,children:n,isPhone:i,...l})})),Ua=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:l,className:a,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",a),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Wa(n,s),l?o(Me,{color:i,size:"text-m",children:l}):null]}),Wa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${Ha(e)}`,children:e.trim()}):e.trim()},String(n)))),Ha=e=>e.replace(/\D/g,""),Ya=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}))),Ka=e=>{const t=Xa(e);return o($a,{label:"Режим работы",value:t,className:"max-w-none"})},Ga=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Xa=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))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Ga({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),Ga({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},Ja=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Za=e=>Ja.map((([t,n,i])=>({key:t,title:i,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??"")}}))),Qa=e=>{if(!e)return null;const t=er(e);return c(Ya,{className:"border-none",children:[o($a,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(tr)})}),o($a,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},er=e=>{const t=Ja.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.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},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o($a,{label:"Валюта",value:e.currency}):null,t?o($a,{label:"Купить",value:String(t)}):null,n?o($a,{label:"Продать",value:String(n)}):null]},String(i)),ir={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",ir[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:ir[n].text,children:t})]}))),ar=(new Date).getDay(),rr=e=>{const[t]=e?.slice(ar-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:l,hasLunch:a}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[l?o(lr,{color:"green",children:l}):null,n&&a?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:i,hasLunch:l},a)=>o($a,{label:e,value:t&&n?n:"",subText:sr({lunchHour:i,hasLunch:l,status:t}),subColor:!t||l?"text-error":"text-green-dark"},String(a)),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:i,phoneBusiness:l,phoneNatural:a,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=Za(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:i,phoneBusiness:l,phoneNatural:a,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(La,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ja,{isUnfolded:e,children:fr({phone:n,fax:i,phoneBusiness:l,phoneNatural:a,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:i,phoneCallCentre:l,phoneCurrencyControl:a,workSchedule:r,exchangeRate:s})=>{const d=Za(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Ya,{className:"flex-wrap border-b border-solid border-main-divider",children:[o($a,{label:"Факс",value:t,isPhone:!0}),o($a,{label:"Телефон филиала",value:e,isPhone:!0}),o($a,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o($a,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o($a,{label:"Для консультаций по валютному контролю",value:a,isPhone:!0}),o($a,{label:"Контакт-центр",value:l,isPhone:!0})]}),r?.isMatchesPattern?o(Ya,{children:o($a,{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(Ya,{children:[o($a,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(tr)})}),Ka(d)]}),r?.businessScheduleVisibleTag?Qa(r?.businessScheduleDescription):null,s?.currencies?.length?o(Ya,{className:"flex-wrap",children:s?.currencies?.map(nr)}):null]})},xr=({name:e="",address:t="",workSchedule:n})=>{const i=(l=e)?`${l?.charAt(0)?.toUpperCase()}${l?.slice(1)}`:"";var l;const a=`${t} ${(e=>{const t=Za(e),n=e?Xa(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ur(n):pr(n,i):hr(n):null})(n)}`;return{header:i,body:a}},yr=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),br=d((({children:e})=>yr?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:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const l=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=kr("offices",e,l);if(n.length&&n.every((e=>"type"in e))){const i=kr("workplaces",e,l),r=Sr(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Sr(n.filter((e=>"offices"===e.type)),"offices",e);a.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(a)}else{const i=Sr(n,"offices",e);a.add(i),t.geoObjects.add(a)}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:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.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];function Pr(e,t,n=!0){const[a,r]=i(void 0);return l((()=>{let i=!0;return((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,i)=>{const l=document.createElement("script");l.src=t,l.async=!0,l.id=t,l.addEventListener("load",(()=>{n(Rr(e))})),l.addEventListener("error",(e=>{i(e)})),document.head.appendChild(l)}))})(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),a}const Dr={...Tr,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Mr=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values(Dr).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],_r=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:a})=>{const r=s(null),d=Pr("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${_.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(l((()=>{r.current?Cr({yandexMaps:d,map:r.current,points:e,isLoad:i}):d?.ready((()=>{r.current||(r.current=new d.Map("map",{center:zr(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Cr({yandexMaps:d,map:r.current,points:e,isLoad:i})}))}),[d,e,n,i,a]),l((()=>{r.current&&a&&d?.geocode(a).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[a]),!d)return null;const m="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[i?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(Mr,{yandexMaps:r}),o(Mr,{yandexMaps:r,direction:"out"})]}),Br(r,d,u("right-2 top-80",m))]})})),zr=e=>{const t=[Fr(Er(e,0)),Fr(Er(e,1))];return t.every((e=>e))?t:Ar},Er=(e,t)=>e.map((e=>e.coords?.[t])),Fr=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Vr={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Or={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 Lr({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const jr={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"},$r={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")},Ur=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(Lr(e))}),{className:i,version:l="primary",active:a,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":a,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},a||r?"":u(jr[l],$r[l]),i),type:s,role:d,onClick:m,children:e})})),Wr=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Hr=(e,t,n)=>{const i=Wr("all"===t),l=Wr("business"===t),a=(e,t,i)=>{const l=e.currentTarget===e.target&&"business"===t?r(i):i;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(Ur,{"data-id":"all",onClick:t=>a(t,"all",e),version:i,children:"Для физических лиц"}),o(Ur,{"data-id":"business",onClick:t=>a(t,"business",e),version:l,children:"Для юридических лиц"})]})},Yr=({__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,Kr="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Gr=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:l})=>{const a=i?5:6,r=(e||[]).map((e=>o(Qn,{text:l[e],...t(e)},e))),[s,d]=a>0?[r.slice(0,a),r.slice(a)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(La,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Kr,children:s}),o(ja,{className:Kr,isUnfolded:e,children:d})]}),renderFoldButton:Xr(n,i)})}):null})},Xr=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Jr()})]}),Jr=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Zr=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Qr=()=>{},es=e=>"all"===e?"block":"hidden",ts=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:l=[],renderCard:a=Qr,renderRemoteWorkplaceCard:r=Qr,getBalloon:s=Qr,getBalloonRemoteWorkplaces:d=Qr,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=Et(Vr),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=as({data:t,remoteWorkplaces:l,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),k={filters:is([...t,...l]),field:{field:f,reset:x},onlyOffice:p,labels:Or};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Zr(h,N),m?Yr(m):null,p&&Hr(t,w,C),o("div",{className:u("pb-3xl",es(w)),children:Gr(k)})]}),o("div",{className:"h-[600px]",children:o(br,{children:o(_r,{points:b,isLoad:n,className:"h-full"})})})]}),c(br,{children:[y.map(a),v.map(r)]})]})})),ns=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>qr[t](e)))))},is=e=>Object.keys(Vr).filter((t=>e.filter((e=>qr[t](e))).length)),ls=()=>{},as=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=ls,getBalloonRemoteWorkplaces:l=ls})=>{const[a,s,o,c]=r((()=>{const a=ns(e,n),r=ns(t,n),s=[...a.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(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[a,s,r,a.length+r?.length]}),[e,t,n,i,l]);return{filteredItems:a,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},rs=d((({field:e,input:t})=>{const n=e("regionRetail"),i=e("addressRetail"),a=Wn(),r=n?.value?.key,s=a.find((({region:e})=>e===r)),d=!a,m=n?.value?.text,u=Wn()?.find((e=>e?.region===m))?.branches;l((()=>{""!==n?.value?.key&&e?.("addressRetail")?.onChange?.("")}),[n?.value]);const{points:h}=as({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"),Rn.addressRetail,t?.required&&p),isSearch:!0}),o("div",{className:"h-[600px]",children:o(br,{children:o(_r,{points:h,isLoad:d,className:"h-full",selectedAddress:i?.value?.text})})})]})})),ss=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"),Rn.regionRetail,t?.required)})})),os=d((({field:e,input:t})=>o(ln,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...An(e("retirementIncome"),Rn.retirementIncome,t?.required),...t}))),cs=d((({field:e})=>{const t=e("secondaryPhone");return o(Ma,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Mn(t,Rn.secondaryPhone):t})})),ds=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Hl,...An(e("serviceDirection"),Rn.serviceDirection,t?.required)}))),ms=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],us=d((({field:e,input:t})=>o(Nl,{label:"Пол",orientation:"horizontal",items:ms,...An(e("sex"),Rn.sex,t?.required)}))),hs=d((({field:e,input:t})=>o(li,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...An(e("shareholderFlg"),Rn.shareholderFlg,t?.required)}))),ps=d((({children:e,onChange:t,...n})=>{const i=a((e=>t&&t(Ai(e,"___-___-___ __"))),[t]),l=a((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),gs=d((({className:e,label:t,value:n,error:i,onChange:l,onBlur:a,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ps,{"aria-label":t,label:$t({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:l,onBlur:a,placeholder:"___-___-___ __"}),Xt(i)]}))),fs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(gs,{label:"СНИЛС",...An(e("snils"),Rn.snils,!!n&&t?.required),...t})})),xs=d((({field:e,input:t})=>o(ln,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Kn(e,"surname"),...An(e("surname"),Rn.surname,t?.required),...t}))),ys=["От 1 мес","До 15 лет"],bs=d((({field:e})=>o(ui,{title:"Срок, месяцев",items:ys,min:1,max:180,...e("term")}))),vs=d((({field:e,input:t})=>o(ln,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...An(e("totalIncome"),Rn.totalIncome,t?.required),...t}))),Ns=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:Wl,...An(e("serviceType"),Rn.serviceType,t?.required)}))),ws=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Cs=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:ws,value:t,onChange:e=>n&&n(e)})})}));const ks={$ref:"/wcms-resources/outservice-productlist.json"},Ss=(e,t,n=!1)=>(i,l)=>{const a="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(xs,{field:e,input:i}),name:o(ua,{field:e,input:i}),middleName:o(ma,{field:e,input:i}),phone:o(Aa,{field:e,input:i}),organizationPhone:o(Aa,{field:e,input:i}),email:o(Fl,{field:e,input:i}),fullName:o(Gl,{field:e,input:i}),inn:o(Zl,{field:e,input:i}),legalForm:o(ia,{field:e,input:i}),organizationName:o(fa,{field:e,input:i}),generalSeniority:o(Xl,{field:e,input:i}),lastJobExperience:o(ta,{field:e,input:i}),experience5Years:o(jl,{field:e,input:i}),jobsNumber:o(ea,{field:e,input:i}),beginDate:o(Xi,{field:e,input:i}),addressFact:o(Yn,{field:e,input:i}),organizationAddress:o(Gn,{field:e,input:i}),comment:o(al,{field:e,input:i}),addressBranch:o(Hn,{field:e,input:i,isPremium:a}),sex:o(us,{field:e,input:i}),birthday:o(Zi,{field:e,input:i,isRetailForm:n}),birthPlace:o(el,{field:e,input:i}),desiredMeetingDate:o(Tl,{field:e,input:i}),product:o(Ea,{field:e,source:ks}),localities:o(ra,{field:e,input:i}),isClient:o(Ql,{field:e}),partnerComments:o(Na,{field:e,input:i}),collectionCount:o(ll,{field:e,input:i}),acquiringType:o(zn,{field:e,input:i}),onlineCheckout:o(pa,{field:e}),posTerminal:o(za,{field:e}),serviceType:o(Ns,{field:e,input:i}),term:o(bs,{field:e}),amount:o(fi,{field:e}),annualRevenue:o(Ni,{field:e,input:i}),vedTypes:o(Cs,{field:e}),feedbackMethod:o(Kl,{field:e,input:i}),serviceDirection:o(ds,{field:e,input:i}),bankEmpolee:o(ki,{field:e}),secondaryPhone:o(cs,{field:e}),consentToReceiveMaterials:o(xl,{field:e,input:i}),processPersonalDataFlg:o(xl,{field:e,input:i}),consentProviderFlg:o(xl,{field:e,input:i}),consentOthersFlg:o(xl,{field:e,input:i}),consentInformFlg:o(xl,{field:e,input:i}),consentPfrFlg:o(xl,{field:e,input:i}),applicationDate:o(ln,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(qa,{field:e}):o(Oa,{field:e,input:i,url:Ot(t)}),education:o(El,{field:e,input:i}),housing:o(Jl,{field:e,input:i}),employment:o(ql,{field:e,input:i}),organization:o(ga,{field:e,input:i}),amountWorkers:o(vi,{field:e,input:i}),employerActivities:o(Vl,{field:e,input:i}),employerOrganization:o(Ol,{field:e,input:i}),positionOrganization:o(_a,{field:e,input:i}),familyStatus:o(Ul,{field:e,input:i}),children:o(nl,{field:e,input:i}),familyMembers:o($l,{field:e,input:i}),dependents:o(Sl,{field:e,input:i}),totalIncome:o(vs,{field:e,input:i}),expenses:o(Ll,{field:e,input:i}),snils:o(fs,{field:e,input:i}),conscription:o(sl,{field:e,input:i}),armyIdFlg:o(wi,{field:e,input:i}),dulSerie:o(Al,{field:e,input:i}),dulNumber:o(Ml,{field:e,input:i}),dulIssueDateField:o(Rl,{field:e,input:i}),dulSubdivisionCode:o(zl,{field:e,input:i}),dulIssuedBy:o(Dl,{field:e,input:i}),addressRegistration:o(Gn,{field:e,input:i}),addressCourier:o(Gn,{field:e,input:i}),participantDateRegistration:o(ba,{field:e,input:i}),retirementIncome:o(os,{field:e,input:i}),otherIncome:o(xa,{field:e,input:i}),mandatoryIncome:o(sa,{field:e,input:i}),otherPayments:o(ya,{field:e,input:i}),disablePeopleFlg:o(Il,{field:e,input:i}),bankruptcyFlg:o(Si,{field:e,input:i}),shareholderFlg:o(hs,{field:e,input:i}),legalEntityName:o(na,{field:e,input:i}),creditInRshbCd:o(yl,{field:e,input:i}),bankEmployeeCode:o(Ci,{field:e,input:i}),partInBusiness:o(va,{field:e,input:i}),regionRetail:o(ss,{field:e,input:i}),addressRetail:o(rs,{field:e,input:i}),addressMatch:o(ai,{field:e,input:i}),paymentSystem:o(Ca,{field:e,input:i}),currency:o(Cl,{field:e,input:i}),cardCategory:o(tl,{field:e,input:i}),codeWord:o(il,{field:e,input:i}),confirmationIncome:o(rl,{field:e,input:i}),methodObtain:o(ca,{field:e,input:i}),deliveryDate:o(kl,{field:e,input:i})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:i,field:e})?o("div",{children:r[i?.name||""]},String(l)):null},Ts=e=>2===e?"@xl:grid-cols-2":"",Is=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,Bs=d((function({responseType:e,typeForm:t}){const n="OK"===e,i=n?"ResponseOKIcon":"ResponseFailIcon",{close:l}=de(),r=a((()=>{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:i,iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Ur,{type:"button",onClick:r,children:"Хорошо"})]})})})),Rs=e=>{const{open:t,close:n}=de();return{open:(n,i={})=>t(o(Bs,{...e,...n}),i),close:n}},Ps=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Ds=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:l,term:a,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:l,amount:a,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${En(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${a}/Срок=${l}/Выручка=${r}`})(e):null,u={...d,...As(o),...Ms(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Ms=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},As=e=>e?{vedTypes:Object.fromEntries(ws.map((({id:t})=>[t,t===e])))}:{},_s={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:ws[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},zs=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(be,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),Es=(e,t)=>o(Ur,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Fs=(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(zs,{link:t})]}),Xt(Mn(e,Sn).error)]}):o(zs,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Es(n)]}),Vs={send:async function(e,t=!1){const{typeForm:n,region:i,phone:l="",email:a,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(i,g),...wt(a,g),...bt(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}}},Os=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))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||_s[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Wl[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=Rs({typeForm:n}),C=a((async(e,t)=>{const n=qs(x,e),i=Ps(Dn(n));if(!pn(i(e)))return console.warn("validation fail");const l=Ds({...e,...h}),a=await Vs.send(l,"lead"===m)?"OK":"Fail";if(v(a),a&&N.open({responseType:a}),"OK"===a&&g){const e=_t();kt({aspectsAttributes:g,aspects:e,ev:t})}return a}),[]),[,{field:k,onSubmit:S,reset:T}]=Et(y,{onSubmit:C}),I=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return l((()=>{"OK"===b&&(v(""),T())}),[b]),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(Ts(e.columns),"grid gap-x-m"),children:[Is(e.title),(e?.inputs||[])?.map(Ss(k,n))]},`section-${t}`))),Fs(I?k("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(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 i=t?.[e?.condition?.name??""];return n===(i?.key??i)}))));function Ls(e){const[t,n]=i(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,a((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const js=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const l=e.every((e=>Boolean(n(e.name).value))),a=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(La,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(ja,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Ss(n,t))}),renderFoldButton:$s(c("div",{children:[o(Qn,{value:l,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),Xt(a?"Отметьте все обязательные соглашения":"")]}))})})})),$s=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"})})]}),Us=({field:e,typeForm:t="",inputs:n,isRetailForm:i=!1})=>{const{consentInputs:l,restInputs:a}=Ws(n||[]);return l.length>2?c("div",{children:[a.map(Ss(e,t,i)),o(js,{inputs:l,field:e})]}):(n||[])?.map(Ss(e,t,i))},Ws=e=>({consentInputs:e?.filter((e=>Object.keys(ol).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ol).includes(e.name||"")))||[]}),Hs={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:ws[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:""},Ys=(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||Hs[e.name||""]]))),typeForm:{key:n,text:""}}},Ks=(e,t)=>o(Ur,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Gs=e=>cl("/user-data/updateUserProfile","PUT",e),Xs=e=>cl("/user-data/updateUserTask","PUT",e),Js={width:"103",height:"21"},Zs={"bg-white":"color",transparent:"white"},Qs={"bg-white":"text-primary-main",transparent:"text-white"},eo=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Zs[e]},className:Qs[e],width:n?.width,height:n?.height}),to={"bg-white":"text-primary-text",transparent:"text-white"},no=d((({className:e,href:t="/",logo:n,children:i,targetBlank:l,bgColor:a="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:[eo(a,n?.image,Js),r?i??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:to[a],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),io=async({code:e,setHasError:t,close:n,sendCode:i=Ut})=>{const l=await(a={captchaText:e},cl("/sms/checkCaptcha","POST",a));var a;"ERROR"===await l.text()?t(!0):(i(),n?.())},lo=async(e,t)=>{const n=await(e=>cl(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET"))(t);e(URL.createObjectURL(await n.blob()))},ao=d((({phoneNumber:e,close:t,sendCode:n,onClose:a})=>{const[r,s]=i(""),[d,m]=i(""),[u,h]=i(!1);return l((()=>{lo(s,e)}),[]),o(pl,{head:o(no,{}),onClose:a,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:()=>lo(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(Ur,{onClick:t,version:"secondary",children:"Вернуться"}),o(Ur,{type:"submit",disabled:!d,onClick:()=>io({code:d,setHasError:h,close:t,sendCode:n}),version:"secondary",children:"Отправить"})]})]})})})),ro=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:so(e)})))),so=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,oo=async({phoneNumber:e,captchaDialog:t,setTimeNextReq:n,setIsTimerStarted:i,setAttemps:l})=>{try{await(a={phoneNumber:e,smsCodesSetName:{key:"AUTHENTICATION"}},cl("/sms/sendCode","POST",a)).then((t=>{if("string"!=typeof t&&t.errorMessage&&t.errorMessage.startsWith(`Too many request for phoneNumber [${e}]`))throw t})),l(0),n(180),i(!0)}catch(e){t.open()}var a},co=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);l((()=>{u.current?.[d]?.focus()}),[d]);const h=a((n=>i=>{const{value:l}=i.currentTarget,a=l.slice(0,1);t(e.map(((e,t)=>t===n?a:e))),m(n+1)}),[e]),p=a((n=>i=>{const{key:l}=i;if("Backspace"===l&&!e[n]){const i=n>0?n-1:e.length-1,l=e.map(((e,t)=>t===i?"":e));t(l),m(i)}}),[e]),g=a((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),l=e.map(((e,t)=>t<i.length?i[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,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:mo(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),mo=(e,t,n=!1)=>{const i=!t[e];return`w-16 h-20 text-3xl text-center p-2 m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},uo=d((({isDisabled:e,onClick:t,text:n})=>o(Ur,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-medium",children:n})}))),ho=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},po=({close:e,values:t})=>{const[n,s]=i(!1),[o,c]=i(""),[d,m]=i(!1),[u,h]=i(0),[p,g]=i(!1),[f,x]=i(0),y=a((()=>{s(!1),c("")}),[]),b=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||b),[t]),N=a((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>cl("/sms/checkCode","POST",e).then(ho))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),y(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return l((()=>{b?(s(!0),c("Код просрочен")):s(!1)}),[b]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},go=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]=i(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:k}=po({values:p,close:e}),T=a((()=>{oo({phoneNumber:h,captchaDialog:I,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:k})}),[]),I=((e,t)=>{const{open:n,close:i,closeAll:l}=de();return{open:()=>n(o(ao,{close:i,onClose:t,...e})),close:i,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(S,{className:"w-full",title:n,description:r,headlineVersion:"S",isEmbedded:!0}),d?o(co,{values:p,setValues:g,errorText:y,hasError:x}):null,xo(v,w,T),o(Pe,{itemSize:"list-s",__html:s}),fo(u,N,f),b?o(vr,{blur:!1}):null]})})})),fo=(e,t,n)=>e?o(uo,{isDisabled:t,onClick:n,text:e}):null,xo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-primary-main",children:["Получить новый код можно через",o(ro,{className:"text-primary-main ml-1",time:e,setTime:t})]}):o(be,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),yo=()=>{const{open:e,close:t}=de();return{open:(n,i)=>e(o(go,{onClose:t,close:n,...i})),close:t}},bo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},vo={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},No=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,l]=i(""),[r,s]=i(!1),{open:d,close:m}=de(),u=Ce(),h=a((()=>{m(),e(n)}),[n]),p=a((e=>{l(e),"REFUSE"===e&&s(!0)}),[]),g=r?vo:bo;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,Co,u),children:o(w,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(C,{align:"text-center",children:g.description}),o(vl,{className:"whitespace-normal",orientation:"horizontal",items:wo,value:n,onChange:p}),o(Ur,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),wo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Co=2,ko=e=>{const{open:t,close:n}=de(),i=yo(),l=(t,l)=>async a=>{n(),"SIGNED"===a&&t?i.open((t=>async n=>{t&&await Gs({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(l),So(t)):e()};return{open:(n,i)=>t(o(No,{handleSubmit:l(n,i),onClose:e}))}},So=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:yt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),To=d((function({handleClose:e}){const t=a((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(Ur,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Ur,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Io={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Bo={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Ro={mandatoryIncome:"INCOME_AVERAGE",otherPayments:"MANDATORY_PAYMENTS"},Po=e=>Object.entries(e).reduce(((e,[t,n])=>t in Io?[...e,{contactTypeCd:{key:Io[t]},value:n}]:e),[]),Do=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Bo){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Bo[t]},...i}]}return e}),[]),Mo=e=>Object.entries(e).reduce(((e,[t,n])=>t in Ro?[...e,{incomeTypeCd:{key:Ro[t]},value:n}]:e),[]),Ao=({inputs:e,programId:t,nextStepLink:n,saveForm:l})=>{const[r,s]=i(""),[,c]=Ls("taskId"),[,d]=Ls("profileId"),[,m]=Ls("participantId"),u=(e=>{const{open:t,close:n}=de(),i=a((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(To,{handleClose:i}),e),close:n}})(n),h=ko(u.open),p=yo(),g=a(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:a((async n=>{const i=Ps(Dn(e));if(!pn(i(n)))return console.warn("validation fail");try{const{profile:{id:e}}=await(a={profile:{phone:yt(n.phone)}},cl("/public-data/createUserProfile","POST",a));if(e&&n?.phone){const i=async()=>{try{await _o({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:l}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},a=Object.keys(ol).filter((e=>n[e])).map((e=>ol[e]?.text));p.open(i,zo(n?.phone,a))}}catch{s("Fail")}var a}),[]),responseStatus:r}},_o=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:l})=>{const a=Fo(n);await Gs(((e,t)=>{const{name:n="",surname:i="",middleName:l="",birthday:a="",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:i,midname:l,birthDate:a&&xt(a,!0),email:s,phone:yt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,a));const{taskId:r,participantId:s}=await(o={profileId:t,programId:e},cl("/user-data/createDraftTask","POST",o));var o;await Xs((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:l,surname:a,middleName:r,birthday:s,phone:o,email:c}=i;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:a,profile:{id:n},participantContacts:Po({phone:o&&yt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:a})),i(s,r,t),l(n)},zo=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:yt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${Eo(t)}`}),Eo=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Fo=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Vo=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:l,addressFact:a}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Pa(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Oo(l),addressFact:Oo(a),esiaAccountTypeCd:t?.esiaAccountType}},Oo=e=>{const{postcode:t,region:n,regionCode:i,locality:l,city:a,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,l||a,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:i?.key,fullAddress:m}},qo=e=>{const[t,n]=i(!1),[r]=Ls("profileId"),[s,o]=Ls("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=a((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,...Vo(n)}),globalThis.location.href=e}var t}),[]);return l((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},Lo=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=i(""),{isLoading:g}=qo(a),[f,x]=Ls("leadForm"),y=Ys(m,f),{handleSubmit:b,responseStatus:v}=Ao({inputs:m,programId:n,nextStepLink:a,saveForm:x});if(v){Rs({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=Et(y,{onSubmit:b});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(Ts(e.columns),"grid gap-x-m"),children:[Is(e.title),Us({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),Ks(s)]})})})),jo=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(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),$o=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Uo=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Wo(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 Ho=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const i=s(null),a=r((()=>({threshold:Wo(t),root:n?.current})),[t,n?.current]);return l((()=>{if(!i.current)return;const t=new IntersectionObserver(e,a);return t.observe(i.current),()=>{t.disconnect()}}),[e,a]),i}(a((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:h,role:"listitem",children:d})})),Yo=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Ko=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,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},y=s([]),b=a(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(Xo(n))}),[g,f]),v=l>0?r*Number(l)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Go(c,v):{},...N?Uo(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(Ho,{className:u(m,l?Yo[l-1]:"",{"h-full":N},t),style:w?Go(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),Go=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Xo=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Jo={"horizontal-list":"w-6","vertical-list":"h-6"},Zo=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,l)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",l===e?Jo[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(l)},String(l)),Qo=({activeIndex:e,onClick:t})=>(n,i)=>{const l=i===e,a=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(i),"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",a),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},ec=e=>e,tc=(e=ec)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),nc=tc(),ic=(e=ec)=>tc((t=>-e(t))),lc=ic(),ac=e=>t=>e.scrollWidth/t,rc=e=>(t,n)=>{e.scrollBy({left:n*ac(e)(t),behavior:"smooth"})},sc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[l,r]=i([]),o=a((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=l.length?[ic()(l),tc()(l)]:[-1,-1],m=c>0,u=d<e-1,h=a((()=>{var t;n.current&&(m?rc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=a((()=>{n.current&&(u?rc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=a(((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}]},oc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},cc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=sc({itemCount:s.length}),g=dc(Boolean(s?.length));l((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=a((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Ko,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Qo({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",oc[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Zo({activeIndex:t,onClick:f,listType:i}))}):null})),dc=(e=!1)=>({behavior:e?"auto":"smooth"}),mc=d((({className:e,disabled:t,...n})=>o(be,{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"})}))),uc=d((e=>o(mc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),hc=d((e=>o(mc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),pc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",gc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:l})=>{const{canScrollLeft:a,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!l;return c("div",{className:e,children:[n?fc(t):null,a?o(uc,{className:u(xc(l),m?"left-1":"left-0"),onClick:s}):null,r?o(hc,{className:u(xc(l),m?"right-1":"right-0"),onClick:d}):null]})})),fc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(pc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(pc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),xc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),yc=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:l=1,listType:a="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=sc({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===a?"relative h-full":""),children:[o(Ko,{containerRef:b,activeIndex:N,visibleItemCount:l,gap:n,padding:i,listType:a,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(gc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(cc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:a,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),bc=({blocksToRender:e,...t})=>o(yc,{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",$o(!0)),children:B(e,t)},String(n))})}),vc=e=>e%2!=0,Nc=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:l="between",className:a,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===l?"justify-between":"justify-center",a),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),wc=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:l=!1,onClick:a})=>o(Nc,{tag:"button",onClick:a,disabled:l,"data-theme":i,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}))),Cc=({isUnfolded:e,onToggle:t})=>o(wc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),kc=["ArrowDownIcon","ArrowUpIcon"],Sc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Tc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...l})=>{const[a,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Sc),children:[P(a,{...l.options,parent:n}),vc(a.length)?o(gt,{className:"col-span-6",...l}):null]}),o(La,{renderFoldableSection:({isUnfolded:e})=>c(ja,{className:u(Sc),isUnfolded:e,children:[P(r,{...l.options,parent:n}),vc(r.length)?o(gt,{className:"col-span-6",...l}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(wc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:kc[Number(n)],dataTheme:l.options?.page?.colorPalette,onClick:i})})]})},Ic=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Bc(n,t),Tc({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Bc(n,t),bc({...i,blocksToRender:t})]});default:return null}})),Bc=(e,t)=>e&&!t.length?o(jo,{...e}):null,Rc=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),Pc=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(ha,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const l=e?.includes(n);t(i?l?(e||[]).filter((e=>e!==n)):[...e||[],n]:l?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),Dc=d((({children:e,filtrationSchema:t,resetButton:n,field:i,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,Rc(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Mc(i)).filter(Boolean))]}),n?o("div",{children:o(Ur,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:l,children:n?.text})}):null]}))),Mc=e=>([t,n])=>{const i=n?.type;return"array"===i?Ac(t,e)(n):null},Ac=(e,t)=>n=>{const i=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(Pc,{items:i,multiple:!n?.single,...t(e)})]},e)};function _c(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const zc=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Ec=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>zc(t[e])||zc(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>zc(t[e])||zc(n[e])||Fc(t[e])<=Fc(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>zc(t[e])||zc(n[e])||Fc(t[e]?.min)>=Fc(n[e]?.min)&&Fc(t[e]?.min)<=Fc(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>zc(t[e])||zc(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>zc(t[e])||zc(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Fc=e=>Number(e||0),Vc=(e,{block:t,page:n,normalize:i=zt})=>{const l=t?.blocks||[],[a,{field:s,reset:o,update:c}]=Et(e),d=r((()=>_c(l,l.map((e=>mt(e.content,n?.fallback))))),[l,n?.fallback]),m=a===e?l:((e,t)=>(n=zt)=>e?.filter((([,e])=>Ec(t,n(e)||{}))).map((([e])=>e)))(d,a)(i);return[a,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Oc={},qc={},Lc=ht((({className:e,filtrationSchema:t=Oc,consumerField:n={},resetButton:i,...l})=>{const[,{blocksToRender:a},{field:r,reset:s}]=Vc(qc,{block:l.block,page:l.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:jc(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>jc(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Dc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Ur,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Ic,{blocksToRender:a,...l})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),jc=e=>_c(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),$c=(e=!1)=>e?"text-left":"text-center",Uc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Wc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:l,...a})=>{const r=String(i?.width||t);return l?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Uc[n],e),children:o(W,{...a,width:"54%",height:"54%",name:l})}):null})),Hc=d((({className:e="",title:t,benefitList:n,...i})=>{const l=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(w,{headingType:"h3",as:"h2",className:$c(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(Yc)}):null]})})),Yc=({label:e,description:t,__html:n,icon:i,isDotted:l=!1,iconBgVersion:a},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(Wc,{className:"shrink-0",iconBgVersion:a,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{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)),Kc=(e,t,n)=>{return o(yc,{children:e.map((i=n,({icon:e,title:t,description:n},l)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Me,{size:"text-h6",font:"font-normal",align:i,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Me,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(l))))});var i},Gc=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:l,title:a,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:a,description:l,headlineVersion:"M"}),e?.length?Kc(e,0,t):null]}))),Xc={start:"justify-start",center:"justify-center",end:"justify-end"},Jc=d((({buttons:e,className:t="",align:n,...i})=>{const l=n&&u("flex",Xc[n]);return o(g,{className:u("!bg-transparent",l,t),defaultPadding:"p-0",...i,children:qe(e)})})),Zc=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Qc="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",ed="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",td="flex flex-col gap-y-xl min-w-52",nd=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:l})=>o(Me,{size:"text-h3",children:"number"==typeof e?[i,Ue(t,{fixed:n})(e),l].filter(Boolean).join(" "):e}))),id=d((({className:e,title:t,value:n,color:i="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:i,children:t}):null,n?o(nd,{value:n,...l}):o(Me,{size:"text-h3",children:"-"})]}))),ld=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,ad=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:l,isShowDepositeName:a,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(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),l&&a?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:l}):null]})]}))),rd=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(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),sd=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:l="text-secondary-text",children:a,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(ad,{title:e,rate:t,unit:n,fractionDigits:i,color:l,...r})}),o(id,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:l,...r}),a]}):o(rd,{title:e,...r}),od=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(ui,{items:e?[`От ${Ue(1)(i.min||0)} ${n}`,`До ${Ue(1)(i.max||0)} ${n}`]:[],step:t,...i}),cd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},dd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},md=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[l,a]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:l=cd.prefMonthsNum,prefTravelBonusRate:a=cd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(a*t)+Math.round(r*n),i);return[c,c*l+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-l)]})(t||dd,n,i);return{...t,...e,monthBonus:l,yearBonus:a}},ud=ht((({className:e="",title:t,calcSource:n,buttons:i,footnote:l,...a})=>{const[r,{field:s}]=Et({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=md(r,n);return o(Zc,{className:e,title:t,...a,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),od({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?sd({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:td,children:[f>=0?o(id,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,qe(i,{isVertical:!0}),ld(l)]})]})})})),hd=Math.round(29.5),pd=(e,t=0)=>e?.sum?e.sum:t,gd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,fd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,xd=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:l,onChange:a,...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:i,items:e,value:e[l?0:1].id,onChange:t=>a&&a(t===e[0].id),...r})]}),yd=e=>xd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),bd=" (c капитализацией)",vd=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:l=[],isCapitalization:a=!1})=>c("div",{className:td,children:[o(id,{title:`Доход в конце срока${a?bd:""}`,value:e,postfix:n,prefix:"+"}),o(id,{title:`Сумма в конце срока${a?bd:""}`,value:t,postfix:n}),qe(i,{isVertical:!0}),l?.map(ld)]}),Nd=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:wd([e,t],i),wd=([e,t],n=[])=>({[e]:n.length?lc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?nc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Cd=(e,[t,n],i)=>e>=i[t]&&e<=i[n],kd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Sd={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Td=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:l,isReplenished:a,isMonthlyInterestPayment:r}=e,s=a||l,o=n<90||n>730,c=function(e){const t=e?.rateType?kd[e?.rateType]:"",{data:n}=Ln(t?`/api/v1/depositrates/${t}`:null,st);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Id(s,e)&&Cd(i,["minSum","maxSum"],e)&&Cd(n,["minDays","maxDays"],e)))||Sd,{rate:m}=d,u=Bd(m,e),h=i+u,p=c||[Sd];return{...d,...wd(["minSum","maxSum"],p),...wd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Id=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Bd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:l}=t;return n?Math.round(i*Math.pow((1200+e)/1200,l/30)-i):Math.round(i*e*l/365/100)},Rd=ht((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:l,isShowDepositeName:a,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=Et({moneyValue:pd(r,1e5),daysValue:gd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Td(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Zc,{className:e,title:t,...d,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ui,{items:[`От ${fd(b.min||0)}`,`До ${fd(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Pd(p,h),yd({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),sd({rate:x,depositeName:y,isShowDepositeName:a}),vd({income:g,finalSum:f,buttons:n,footnotes:[i,l]})]})});var b})),Pd=(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})]})]}),Dd=(e=[],t=!1)=>Md([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),Md=(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]},Ad=({min:e=0,max:t=0,availableMonths:n,...i})=>o(ui,{items:[`От ${_d(e)}`,`До ${_d(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),_d=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,zd=e=>xd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),Ed=({field:e,defParams:t,calcParams:n,map:i,monthsValue:l="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(si(t?.[l],n.minMonths,n.maxMonths))},Fd=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:l,moneyExtra:a}=t;if(0===e)return 0;if(n){const t=e/1200;return a?(i+a)*(t+t/(Math.pow(1+t,l)-1)):i*(t+t/(Math.pow(1+t,l)-1))}return Math.round(i/l)+i*(e/1200)},Vd={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Od=e=>qd({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&qd({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&qd({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&qd({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),qd=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:l})=>!!n&&!n[l]||t[i]===e[i],Ld=(e,t,n)=>{const{moneyValue:i,monthsValue:l}=e,a=t?.rateRows||[Vd],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Od({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Nd(["minSum","maxSum"],r,a),{minMonths:c,maxMonths:d}=Nd(["minMonths","maxMonths"],r,a),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:l})=>e?.find((e=>Od({row:e,userInputParams:t,paramsViewSettings:n})&&Cd(i,["minSum","maxSum"],e)&&Cd(l,["minMonths","maxMonths"],e)))||Vd)({rateRows:a,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:l}),{rate:u}=m,h=Fd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:l,monthlyPayment:h}},jd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),$d={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Ud=ht((({className:e,title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,Md([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=Et({moneyValue:pd(s,2e5),monthsValue:gd(s,hd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const y=Ld(g,n,r),b=zd({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return l((()=>{v&&v(si(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),l((()=>{N&&N(si(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),l((()=>{!jd(s)&&h&&Ed({field:f,defParams:h,calcParams:y,map:$d,monthsValue:"minMonths"})}),[n,s]),o(Zc,{className:e,title:t,...m,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Ad({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Wd({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(td,"@4xl:w-1/2"),children:[o(id,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(id,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(id,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),qe(i,{isVertical:!0}),ld(a)]})]})})})),Wd=(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]}),Hd=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[l,a]=t[n];i>=l?t.splice(n-1,2,[e,Math.max(i,a)]):n++}return t},Yd={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Kd=(e,t,n)=>{const{moneyValue:i,monthsValue:l}=e,a=t?.[0]?Jd(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=>[Xd({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Xd({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Xd({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Xd({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Cd(i,["minSum","maxSum"],t),Cd(l||a,["minMonths","maxMonths"],t)].every(Boolean)))||Yd,{rate:u}=m,h=Gd(u,e),p=i+h,g=t||[Yd];return{...m,...wd(["minSum","maxSum"],g),...wd(["minMonths","maxMonths"],g),availableMonths:Hd(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,l)=>t>=e?e+l*n:e-l*n)))(e,t))),...e,defaultMonth:a,income:h,finalSum:p}},Gd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:l}=t;return n?Math.round(i*Math.pow((1200+e)/1200,l)-i):Math.round(i*e*30*l/365/100)},Xd=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Jd=(e,t)=>e+Math.round((t-e)/2),Zd=(e="rub")=>"rub"===e,Qd=(e,t)=>{const{minMonths:n,maxMonths:i}=wd(["minMonths","maxMonths"],im(t,e?.currency)),l=e.monthsValue||Math.round((n+i)/2);return{monthsValue:si(l,n,i)}},em=(e,t)=>{const{minSum:n,maxSum:i}=wd(["minSum","maxSum"],im(t,e?.currency)),l=e.moneyValue||n;return{moneyValue:si(l,n,i)}},tm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),nm=e=>{const t=Zd(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},im=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},lm=(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?xd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?xd({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),am(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?yd({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},xd({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),am(e.isShowNewClient),e.isShowNewClient?o(Qn,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},am=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,rm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},sm={text:"₽",key:"rub"},om=ht((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[sm],g=a((e=>t=>e?{...t,...nm(t),...em(t,e),...Qd(t,e),...tm(t,e)}:t)(h),[h]),[f,{field:x}]=Et({moneyValue:pd(d,2e4),monthsValue:gd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:sm},{normalize:g}),y=x?.("currency")?.value??sm,b=x?.("isNewClient")?.value,v=im(h,y),N=Kd(f,v,s),{rate:w,income:C,finalSum:k,type:S=""}=N,T=a((()=>{Ed({field:x,defParams:Dd(v,b),calcParams:N,monthsValue:"minMonths",map:rm})}),[x,h]);l((()=>{!jd(d)&&v&&T()}),[d,h]);const I=w===Dd(v,b)?.rate;return o(Zc,{className:e,title:t,...m,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[c("div",{className:"flex gap-m",children:[od({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:cm(y?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),Ad({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),lm({...N,...s},x)]}),sd({rate:w,children:mm(T,I)}),vd({income:C,finalSum:k,buttons:[...i,dm(n?.buttons,S)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),cm=(e="")=>Zd(e)?1e3:100,dm=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},mm=(e,t=!1)=>t?null:o(Ur,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),um=e=>hm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&hm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),hm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:l})=>!!n&&!n[l]||t[i]===e[i],pm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},gm=(e,t,n)=>{const{moneyValue:i,monthsValue:l,oldMonthlyPayment:a,moneyExtra:r}=e,s=t?.rateRows||[pm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>um({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Nd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Nd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:l,oldMonthlyPayment:a,moneyExtra:r})=>e?.find((e=>um({row:e,userInputParams:t,paramsViewSettings:n})&&Cd(i+r,["minSum","maxSum"],e)&&Cd(a,["minSumOld","maxSumOld"],e)&&Cd(r,["minSumExtra","maxSumExtra"],e)&&Cd(l,["minMonths","maxMonths"],e)))||pm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:l,oldMonthlyPayment:a,moneyExtra:r}),{rate:p}=h,g=Fd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:l,oldMonthlyPayment:a,moneyExtra:r,monthlyPayment:g,benefit:f}},fm=ht((({className:e="",title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:a,...r})=>{const[s,{field:d}]=Et({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=gm(s,n,a),h=zd({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Zc,{className:e,title:t,...r,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),od({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Ad({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),xm({...m,...a},d),m.isExtraMoney?od({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(td,"@4xl:w-1/2"),children:[o(id,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(id,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(id,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(id,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),qe(i,{isVertical:!0}),ld(l)]})]})})})),xm=(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})]}),ym=d((e=>{const{onChange:t,min:n,max:i,defaultValue:l="0",fractionDigits:r=0,...s}=e,c=ri(e,{normalize:(e=l)=>n&&i?String(si(Number(bm(e)),n,i)):bm(e),format:Ue(r)}),d=a((e=>t&&t(bm(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),bm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),vm=d((e=>o(ym,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),Nm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},wm={amount:1500},Cm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:r="private",...s})=>{const[{amount:d},{field:m}]=Et(wm),[h,p]=i(!1);return l((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Nm[r],children:[o(vm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),a?.text?o(Ur,{className:"w-full mt-lg",type:"submit",disabled:h,children:a.text}):null]})]})})),km=({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(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Sm="relative h-full",Tm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Im=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:l}=i.block||{},a=l?.some(Pm),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,l)=>c("div",{className:Bm(n,{someCardsHighlighted:a}),children:[B(n,i,{className:Rm(n,{someCardsHighlighted:a,showBorder:!e,cardSize:t}),...r,blockIndex:l}),Pm(n)?km({className:"absolute top-0 -right-4 z-40"}):null]},String(l))})},Bm=(e,{someCardsHighlighted:t})=>u(Sm,t&&(Pm(e)?"pt-3xl":"pt-3xl sm:pt-16")),Rm=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(Sm,"min-w-80",Tm[i],t&&(Pm(e)?"pt-3xl sm:pt-16":"pt-3xl"),$o(n),n&&"h-full"),Pm=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Dm=ht((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:i=!0,isGap:l=!0,cardSize:a="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(yc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:l?16:0,padding:0,arrowsPadded:i,navButtons:r?Mm(s?.block?.blocks):[],hasBlur:!0,children:Im({noCardBorder:n,cardSize:a,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Mm=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Am="z-10 border border-solid w-full h-full",_m=u(Am,"absolute hidden @xl:block border-transparent"),zm=d((({className:e,title:t,description:n,button:i,...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(Am,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),qe([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Em={black:"bg-black",white:"bg-white"},Fm=d((({className:e="",title:t,description:n,image:i,price:l,button:a,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(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:qe([a],{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(Vm)]}):null,l?c(Me,{size:"text-h3",align:"text-left",children:[l," ₽"]}):null]})}))),Vm=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Em[e]}`},String(t)),Om=d((({icon:e,...t})=>{const n=ue(),{text:i,href:l,target:a,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:l,target:a,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:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),qm=d((({className:e,additionalDescription:t,description:n,links:i,title:l,...a})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...a,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(S,{isEmbedded:!0,title:l,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?Lm(i):null]})}))),Lm=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(Om,{...e},String(t))))}),jm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),$m=d((({className:e="",href:t,target:n,onClick:i,data:l,children:a})=>{const r=ue()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(l),children:a})})),Um=[{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"}}],Wm=d((({className:e="",media:t,showButtonText:n,stretched:l,version:a="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:l}=e,{iconMapped:r}=(e=>Um.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Oe(i)?i: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??a}})),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},Hm(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:qe(m,{className:Ym(s??!1,l??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Hm=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Ym=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Km=d((({className:e,padding:t,description:n,additionalDescription:i,href:l,icon:a,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o($m,{href:l,target:m,className:"h-full",data:jm(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Oe(a)?o(ne,{image:a}):null,x),buttons:d.length?o(Wm,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Ve,{benefits:f}),s?o(Pe,{__html:s,isDotted:r,itemSize:"list-s"}):null,Gm(i,p)]})})}))),Gm=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Xm=(e,t)=>{const{title:n,description:i,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,i?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:i})}):null,l?.length?o("div",{className:"text-primary-main",children:qe(l)}):null]},String(t))},Jm=d((({className:e="",title:t,align:n="text-center",icon:a,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Xm),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!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(a)?o("div",{className:"self-center",children:o(ne,{image:a})}):null,t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(be,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(La,{renderFoldableSection:()=>c("div",{children:[x,o(ja,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Zm(m?.parent,h,b):null}):o("div",{children:x})]})})),Zm=(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"})]}),Qm=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]})]}))),eu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=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(Qm,{step:i,showPercentage:!1})]})})}));var tu;!function(e){e.process="IN_PROCESS",e.ok="OK",e.fail="FAILED",e.rework="REWORK"}(tu||(tu={}));const nu=e=>cl("/user-data/getTaskStatus","POST",e),iu=e=>cl("/user-data/sendSignalToProcess","POST",e),lu=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>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}),i?.text?o(be,{className:"text-primary-main",children:i.text}):null]})]}))),au=d((({interval:e=0,title:t,__html:n})=>{const[l,a]=i(e),r=100-(e-l)/e*100;return c("div",{children:[t?o(S,{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(ro,{interval:e,time:l,setTime:a})})]}),n?o(Pe,{__html:n}):null]})]})})),ru=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:l,sectionAdditionalTitle:a,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(au,{interval:d}):null]}),o(su,{title:i,items:l}),o(su,{title:a,items:r,countColumns:!0}),n?.__html?o(lu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(be,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),su=({title:e,items:t,countColumns:n=!1})=>{const i=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",Ts(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:ou(e)},t)))}):null]})]}):null},ou=({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})]}),cu=d((()=>o(ru,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),du=d((()=>{const[e]=Ls("leadForm");return o(ru,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:e?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),mu=d((()=>{const[e]=Ls("leadForm");return o(ru,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),uu=d((()=>{const[e]=Ls("leadForm");return o(ru,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),hu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],pu=d((()=>{const[e,t]=i(tu.process),[n]=Ls("taskId");return l((()=>{for(const e of hu)iu({signalType:e,taskId:n});const e=setInterval((()=>nu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==tu.process&&(clearInterval(e),t(n.statusCd))}))),3e4)}),[]),gu(e)})),gu=e=>({IN_PROCESS:o(du,{}),FAILED:o(cu,{}),OK:o(uu,{}),REWORK:o(mu,{})}[e]||null),fu=[{paymentSystem:wa[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}],xu=e=>{if(e)try{return new Date(e)}catch(e){return}},yu=e=>(t,n)=>t.filter((e=>e)).map((t=>[bu(n,e),vu(t,e),Nu(t,e),wu(t,e),Cu(t,e)].some(Boolean)?{...t,required:!1}:t)),bu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,vu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Nu=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),wu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Cu=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),ku=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(lu,{__html:e},`${t}_${n}`))):null},Su=({field:e,inputs:t})=>t.map(Ss(e,"")),Tu=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:l},a)=>{const r=yu(Iu(t))(e,n),s=r.filter((e=>!Cu(e,Iu(t))));return c("div",{className:u(Ts(i),"grid gap-x-m"),children:[ku(s),Is(l),Su({field:t,inputs:r})]},`section-${a}`)})),Iu=e=>t=>e(t)?.value,Bu=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between gap-m",children:[o(Ur,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Ur,{className:"w-full @xl:w-auto",type:"submit",children:"Далее"})]})})),Ru=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:l}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:i,codeWord:l}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:l="",phone:a="",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:y}=e;return{birthDate:xt(l,!0),midname:i,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:Po({phone:yt(a),email:r}),participantAddresses:Do({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:l,organization:a,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:i,organizationActivityTypeCd:s,organizationTypeCd:a,organizationKindCd:o,employeesNumberCd:r,opf:l,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Po({organizationPhone:h&&yt(h)}),participantAddresses:Do({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,mandatoryIncome:l,otherPayments:a,snils:r,armyIdFlg:s}=e;return{maritalStatusCd:t,totalDependents:i,otherDependents:n,participantIncomes:Mo({mandatoryIncome:l,otherPayments:a}),snils:r?.replaceAll(" ",""),armyIdFlg:s}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:l}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:l}})(t);default:return{}}},Pu=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:l})=>{const[r]=Ls("taskId"),[s]=Ls("profileId"),[o]=Ls("participantId"),c=a((async a=>{const c=Ps(Dn(yu(Du(a))(t,e)));if(console.log(Dn(yu(Du(a))(t,e))),!pn(c(a)))return console.warn("validation fail");i(a);try{r&&s&&o&&await Xs((({participantId:e,taskId:t,profileId:n,formData:i,step:l=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Ru(l,i)}]}}))({participantId:o,taskId:r,profileId:s,step:e,formData:a}))}catch(e){return"Fail"}return n(),5===e&&l?.(!0),"OK"}),[]);return{handleSubmit:c}},Du=e=>t=>e[t],Mu=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:l,finishForm:r})=>{const[d,m]=Ls("leadForm"),u=((e,t)=>({...fu[e],...t,birthday:xu(t?.birthday),dulIssueDateField:xu(t?.dulIssueDateField),participantDateRegistration:xu(t?.participantDateRegistration),beginDate:xu(t?.beginDate),deliveryDate:xu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=a((e=>{h.current=e}),[]),{handleSubmit:f}=Pu({step:e,inputs:p,onNextStep:i,saveStep:m,finishForm:r}),[,{field:x,onSubmit:y}]=Et(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return l?o(pu,{}):c("form",{onSubmit:y,className:"space-y-m",children:[Tu({sections:t,field:x,step:e,registerSubmit:g}),o(Bu,{step:e,onPrevStep:n})]})})),Au=[[{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"]}}]}]],_u=["Параметры карты","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Выбор способа получения"],zu=d((({className:e,...t})=>{const[n,l]=i(0),s=a((()=>{l((e=>Math.min(e+1,6)))}),[]),d=a((()=>{l((e=>Math.max(e-1,0)))}),[]),m=r((()=>Au[n]),[n]),[h,p]=i(!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(eu,{stepsTitles:_u,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Mu,{step:n,sections:m,onNextStep:s,onPrevStep:d,isFormFinished:h,finishForm:p},String(n))})]})})})),Eu=()=>{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 i=async()=>{const n=await cl("/auth/refresh","POST",{refresh_token:e,access_token:t});n instanceof Response?Fu(n.status):(globalThis.sessionStorage.setItem("refreshToken",n.refresh_token),globalThis.sessionStorage.setItem("accessToken",n.access_token))};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},Fu=e=>{401==e&&(globalThis.location.href="/")},Vu=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=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(Qm,{step:i,showPercentage:!1})]})})})),Ou=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:l,sectionAdditionalTitle:a,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(au,{interval:d}):null]}),o(qu,{title:i,items:l}),o(qu,{title:a,items:r,countColumns:!0}),n?.__html?o(lu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(be,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),qu=({title:e,items:t,countColumns:n=!1})=>{const i=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",Ts(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Lu(e)},t)))}):null]})]}):null},Lu=({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})]}),ju=d((()=>o(Ou,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),$u=d((()=>{const[e]=Ls("leadForm");return o(Ou,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:e?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),Uu=d((()=>{const[e]=Ls("leadForm");return o(Ou,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Wu=d((()=>{const[e]=Ls("leadForm");return o(Ou,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Hu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Yu=d((()=>{const[e,t]=i(tu.process),[n]=Ls("taskId");return l((()=>{for(const e of Hu)iu({signalType:e,taskId:n});const e=setInterval((()=>n&&nu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==tu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]),Ku(e)})),Ku=e=>({IN_PROCESS:o($u,{}),FAILED:o(ju,{}),OK:o(Wu,{}),REWORK:o(Uu,{})}[e]||null),Gu=[{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}],Xu=e=>{if(e)try{return new Date(e)}catch(e){return}},Ju=e=>(t,n)=>t.filter((e=>e)).map((t=>[Zu(n,e),Qu(t,e),eh(t,e),th(t,e),nh(t,e)].some(Boolean)?{...t,required:!1}:t)),Zu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Qu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,eh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),th=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,nh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),ih=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(lu,{__html:e},`${t}_${n}`))):null},lh=({field:e,inputs:t})=>t.map(Ss(e,"")),ah=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:l},a)=>{const r=Ju(rh(t))(e,n);return c("div",{className:u(Ts(i),"grid gap-x-m"),children:[ih(r),Is(l),lh({field:t,inputs:r})]},`section-${a}`)})),rh=e=>t=>e(t)?.value,sh=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between",children:[o(Ur,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Ur,{className:u("w-full @xl:w-auto"),type:"submit",children:"Далее"})]})})),oh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},ch=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:oh[i?"annuity":"differential"]}},dh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:l="",phone:a="",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:y}=e;return{birthDate:xt(l,!0),midname:i,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:Po({phone:yt(a),email:r}),participantAddresses:Do({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:l,organization:a,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:i,organizationActivityTypeCd:s,organizationTypeCd:a,organizationKindCd:o,employeesNumberCd:r,opf:l,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Po({organizationPhone:h&&yt(h)}),participantAddresses:Do({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,confirmationIncome:l,mandatoryIncome:a,otherPayments:r,snils:s,armyIdFlg:o}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:l,otherDependents:n,participantIncomes:Mo({mandatoryIncome:a,otherPayments:r}),snils:s?.replaceAll(" ",""),armyIdFlg:o}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:l}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:l}})(t)}},mh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:l})=>{const[r]=Ls("taskId"),[s]=Ls("profileId"),[o]=Ls("participantId"),c=a((async a=>{const c=Ps(Dn(Ju(uh(a))(t,e)));if(!pn(c(a)))return console.warn("validation fail");i(a);try{r&&s&&o&&await Xs((({participantId:e,taskId:t,profileId:n,formData:i,step:l=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...dh(l,i)}],...ch(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:a}))}catch(e){return"Fail"}return n(),5===e&&l?.(!0),"OK"}),[]);return{handleSubmit:c}},uh=e=>t=>e[t],hh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,renderStep:l=ah,isFormFinished:r,finishForm:d})=>{const[m,u]=Ls("leadForm"),h=((e,t)=>({...Gu[e],...t,birthday:Xu(t?.birthday),dulIssueDateField:Xu(t?.dulIssueDateField),participantDateRegistration:Xu(t?.participantDateRegistration),beginDate:Xu(t?.beginDate),deliveryDate:Xu(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=a((e=>{p.current=e}),[]),{handleSubmit:x}=mh({step:e,inputs:g,onNextStep:i,saveStep:u,finishForm:d}),[,{field:y,onSubmit:b}]=Et(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(Yu,{}):c("form",{onSubmit:b,className:"space-y-m",children:[l({sections:t,field:y,step:e,registerSubmit:f}),o(sh,{step:e,onPrevStep:n})]})})),ph=[[],[{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"}]}]],gh=["","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Отделение Банка"],fh=d((({className:e,...t})=>{const[n,s]=i(0);l(Eu,[]);const d=a((()=>{s((e=>Math.min(e+1,5)))}),[]),m=a((()=>{s((e=>Math.max(e-1,0)))}),[]),h=r((()=>ph[n]),[n]),p=0===n,[f,x]=i(!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(Vu,{stepsTitles:gh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(hh,{step:n,sections:h,onNextStep:d,onPrevStep:m,isFormFinished:f,finishForm:x,renderStep:p?({registerSubmit:e,field:t})=>o(Ud,{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))})]})})})),xh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,yh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),bh=1e9,vh={sum:{min:1e4,max:bh},period:3},Nh=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:l,...a})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Vc(vh,{block:a.block,page:a.options?.page,normalize:e=>({...e,period:wh(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Ch(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Dc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(vm,{label:i?.title,min:500,max:bh,...d("sum",{parse:e=>({min:Number(e),max:bh}),format:({min:e})=>String(e)})}),o(ui,{title:l?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Ic,{blocksToRender:r,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),wh=e=>ot((e?.paramsSource?.rateRows||[]).filter(xh).flatMap((e=>yh(e.minMonths,e.maxMonths)))),Ch=e=>ot(e.flatMap((e=>e||[])).filter(xh).flatMap((e=>yh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],kh=[{key:"10"},{key:"50"},{key:"100"}],Sh=({itemCount:e,onItemCountChange:t})=>{const n=a((({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:kh,iconVersion:"black"})]})},Th="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",Ih=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:l}=e,a=t+1;return a===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:a},String(t)):1!==a&&a!==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))(a,n,l)?o("div",{onClick:()=>i(a),className:Th,"aria-label":`Страница ${a}`,children:a},String(t)):null},Bh={width:"24",height:"24"},Rh=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),l=a((()=>{e>1&&t(e-1)}),[e]),s=a((()=>{e<n&&t(e+1)}),[e,n]),d=a((()=>t(1)),[]),m=a((()=>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:Ph(1===e),...Bh})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Th,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(Ih),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Th,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Ph(e===n),...Bh})})]})},Ph=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Dh=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,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(Rh,{currentPage:e,onPageChange:t,totalPages:n}),i&&l?o(Sh,{itemCount:i,onItemCountChange:l}):null]}),Mh=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:l,placeholder:r="Поиск по сайту"})=>{const s=a((e=>{i&&i(e.target?.value||"")}),[i]);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})]})})),Ah=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Mh,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ki,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ki,{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(Ur,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),_h=(e,t)=>o(Wc,{...e,iconBgVersion:t,className:"shrink-0"}),zh=({title:e,timestamp:t,publicId:n})=>{const i=ue(),{href:l}=i({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:[_h({icon:"DocDownloadIcon",iconVersion:"black"}),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)},Eh="/api/v1/depository",Fh={startDate:void 0,endDate:void 0,query:""},Vh=ht((({className:e,...t})=>{const[n,l]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=Et(Fh),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:l})=>{const a=i?xt(i,!0):"",r=l?xt(l,!0):"",s=new URLSearchParams(Eh);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",a),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=Ln(Eh+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=a((e=>l(e-1)),[]),y=a((e=>{r!==e?(s(e),l(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Ah,{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(zh,{...e},String(e.publicId)))):o(jo,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Dh,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),Oh=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,qh=d((({className:e="",title:t,description:n,error:i,button:l,...a})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...a,children:[o("div",{className:"flex justify-center",children:Oh(i)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),l?.text?o(be,{version:l?.version,text:l?.text,...l}):null]}))),Lh="location";function jh(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=i(n||null);return l((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,a((n=>e.fire(t,n)),[e,t])]})(ce,"location",Uh()??{name:e}),r=a((e=>{Wh(e),n(e)}),[]),{data:s}=Ln($h()?null:"/api/v1/region",st);return l((()=>{s&&!$h()&&n(s)}),[s]),[t??{name:e},r]}const $h=()=>Boolean(globalThis.localStorage?.getItem(Lh)),Uh=()=>{try{const e=globalThis.localStorage?.getItem(Lh);return e&&JSON.parse(e)}catch(e){return null}},Wh=e=>{try{globalThis.localStorage?.setItem(Lh,JSON.stringify(e))}catch(e){}};var Hh;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Hh||(Hh={}));const Yh=new Intl.NumberFormat("ru",{style:"currency",currency:Hh.RUB}),Kh=e=>e?Yh.format(e):"",Gh="text-m font-light text-secondary-text ",Xh=`${Gh} text-left`,Jh=`${Gh} pl-5xl text-center`,Zh=`${Gh} pl-5xl text-right`,Qh={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},ep=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Xh,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:Jh,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:Zh,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(tp)})]}))),tp=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:Qh[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:Kh(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:Kh(e?.buyExchangeRate)})})]},t)},np={icon:"GpsIcon"},ip=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Wc,{...np,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),lp=(e,t,n)=>{const i=Number(ap(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},ap=e=>e.replace(/[^\d.,]/g,"").replace(",","."),rp=e=>Rt([[e=>e.value!==Hh.RUB&&e.oppositeValue!==Hh.RUB,()=>e.handleConvert(e.value,Hh.RUB)],[e=>e.value===Hh.RUB&&e.oppositeValue===Hh.RUB,()=>e.handleConvert(e.value,Hh.USD)],[e=>e.value===Hh.RUB&&e.oppositeValue===Hh.RUB,()=>e.handleConvert(e.value,Hh.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function sp(e){const{placeholder:t,rates:n,selected:i,value:l,setValue:a,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};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:a}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const op=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:l})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Hh.RUB,selectBuy:n?.[0]?.currency?.currency||Hh.USD}),d=a((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:[sp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:cp(r,d,n),value:r.inputSell,setValue:e=>mp(d,n)(e,r.selectSell,r.selectBuy)}),sp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:dp(r,d,t),value:r.inputBuy,setValue:e=>up(d,t)(e,r.selectBuy,r.selectSell)})]}):null,l?.text?o(be,{text:l.text,version:l?.version,...l}):null]})})),cp=(e,t,n)=>i=>{t({selectSell:i}),rp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,l=e.selectBuy)=>{mp(t,n)(e.inputSell,i,l)}})},dp=(e,t,n)=>i=>{t({selectBuy:i}),rp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,l=e.selectSell)=>up(t,n)(e.inputBuy,i,l)})},mp=(e,t)=>(n,i,l)=>{e({inputSell:ap(n),selectBuy:l});const a=t.find((e=>e.currency?.currency===l))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;a&&e({inputBuy:String(lp(n,a,i===Hh.RUB)||"")})},up=(e,t)=>(n,i,l)=>{e({inputBuy:ap(n),selectSell:l});const a=t.find((e=>e.currency?.currency===l))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;a&&e({inputSell:String(lp(n,a,i===Hh.RUB)||"")})};const hp=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const[l]=jh(),a=function(e){const t=e?.code||"000",{data:n}=Ln(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(l),r=pp(a?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:Hh.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:Hh.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Te,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(ep,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(ip,{address:a?.address})]}),o(op,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),pp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],gp=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(fp(n))})})),fp=e=>({dataFooter:t,...n},i)=>{const{text:l,href:a,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:a,target:r||"_self",onClick:s,...pe(t),children:l||null})},String(i)):null},xp=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:l})=>o(Nc,{tag:"button",className:u("border-none bg-transparent items-center group/button",l?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[_h(l,t),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}))),yp=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",bp=(e=!1)=>e?"MinusIcon":"PlusIcon",vp=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Np=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:l,labelIconBgVersion:a,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(La,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ja,{className:u("gap-lg",yp(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>wp({foldButtonVersion:r,label:i,labelIcon:l,labelIconBgVersion:a,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),wp=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:l,onToggle:a,isMobile:r=!1})=>{const s=t||(l?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?vp(e):bp(e))(l,r);return"accordion"===e?o(xp,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:a}):o(wc,{label:s,icon:l?"ArrowUpIcon":"ArrowDownIcon",onClick:a})},Cp=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:kp(e)}))),kp=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Np,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(gp,{items:e.items}):null},String(t)))),Sp=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Tp)}):null)),Tp=(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(Ip)})]},String(t)),Ip=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Bp(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Bp=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Rp(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Rp=e=>e.replaceAll(/\D/g,""),Pp=d((({className:e="",index:t,text:n,...i})=>{const l=ue(),{href:a,target:r,onClick:s}=l(i);return o("a",{className:u("text-secondary-text",e),href:a,target:r,onClick:s,children:n||`Документ ${t}`})})),Dp=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(Pp,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Mp=d((({className:e="",index:t,...n})=>{const i=ue(),{href:l,target:a,text:r,onClick:s}=i(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:a,onClick:s,children:r||`Документ ${t}`})})),Ap=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(Mp,{index:t,...e},String(t))))}):null]}))),_p=ht((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{};n.options?.page?.common;const{documents:l,relatedEnterprises:a,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Cp,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Sp,{items:r}),m?o(be,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(Wm,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(be,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Dp,{title:d,links:a}),o(Ap,{links:l,license:h})]})})),zp=ht((({className:e,title:t,button:n,regionSource:l,data:a,...r})=>{const[s,d]=i({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(w,{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(be,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:jm(a,s?.key),children:f})}):null]})})})),Ep={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"},Fp=d((({version:e,text:t,mobileText:n,...i})=>{const l=Ce()?n:t;return l?o(be,{className:u("py-s px-lg font-light whitespace-nowrap",Ep["transparent"===e?"transparent":"default"]),...i,children:l}):null})),Vp=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:i,version:l,backwardButton:r})=>{const s=M(),d="/"===s.pathname,{dataFooter:m,dataHeader:u,...h}=t??{},p=a((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(no,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):Op(p,r),o(Fp,{version:l,...i})]})})),Op=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(W,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,qp={"bg-white":"primary",transparent:"transparent"},Lp=ht((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=qp[e],portal:i,logo:l={},...a})=>{const{backwardButton:r,logo:s={}}=a.options?.page?.common??{},{internetBankButton:c}=i||{},d=l.image?.icon||l.image?.src?l:s;return o(g,{tag:"header",defaultPadding:"",version:n,...a,children:o("div",{className:"container px-lg py-2xs box-border",children:o(Vp,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...a})})})})),jp=(e=!1)=>e?{}:{padding:"p-0"},$p={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Up=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:l="transparent",isTheme:a=!1,isCardBorder:r=!1,image:s,...c})=>{const d=M();return o(g,{className:u("relative flex flex-col",$p[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:l,isTheme:a,...c,children:D({...c,extraProps:{className:u("w-full",$o(r)),...jp(i)}})})}),{childrenTypes:[]}),Wp=ht((e=>o(Up,{...e})),{childrenTypes:[]}),Hp=d((e=>{const{className:t,align:n,image:i,...l}=e,a=n?u("flex",Xc[n]):"";return o(g,{className:u(a,t),defaultPadding:"p-0",...l,children:o(ne,{image:i})})})),Yp=["байт","Кб","Мб","Гб","Тб","Пб"],Kp=d((({icon:e,text:t,href:n,target:i,fileFormat:l,data:a,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:i,...pe(a),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",Gp(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Gp=(e,t)=>e||t?o("span",{children:", "}):"",Xp=(e,t)=>(n,i)=>{const l=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),a="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))} ${Yp[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Zp(l):n?.fileFormat;return c("div",{role:"listitem",children:[o(Kp,{text:n?.text,target:n?.target,href:l,fileFormat:r,fileSize:a,icon:Jp(t),data:n?.data}),o(Pe,{__html:n?.__html})]},String(i))},Jp=e=>e?o(ne,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,Zp=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},Qp=d((({href:e,__html:t,target:n})=>{const{close:i}=de(),l=M(),r=$(l)(e),s=a((()=>{i()}),[]);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(be,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Ur,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),eg=d((({text:e,href:t,target:n,__html:i,icon:l})=>{if(!e&&!i)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(Qp,{...e}),n),close:n}})({__html:i,href:t,target:n}),s=a((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Jp(l),o(Me,{font:"font-light",children:e})]})})),tg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},ng=ht((({className:e="",title:t,description:n,align:i="text-center",documents:l,icon:a={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=M();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),l?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",tg[r]),role:"list",children:l.map(ig(d,a))}):null]})})),ig=(e,t)=>(n,i)=>{const l=n?.docType;return""===l?null:"reportSource"in n&&n?.reportSource?.__html?lg(t)(n,i):Xp(e,t)(n,i)},lg=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(eg,{...i,icon:e,href:ag(t)?t?.href:t?.attachment?.src}),o(Pe,{__html:t?.__html})]},String(n)):null},ag=e=>"href"in e,rg=ht((({className:e,padding:t,align:n="text-left",buttons:i=[],description:l,image:a,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=a?.src?o(ne,{className:"hidden lg:block",image:a}):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(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:qe(i,{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,a?.src?o(ne,{className:"lg:hidden",image:a}):null]})]})})})),sg=(e=[],t={})=>e.filter((({content:e={}})=>Ec(t,e))).length,og=(e,t)=>e===t;const cg=(dg=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(og,((e=og)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>dg(n,t[e])))));var dg;const mg=[],ug={},hg={primary:"bg-white/30",secondary:"bg-main-divider"},pg={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},gg=d((({count:e,version:t="secondary"})=>{const n=Ce(),i=n?"bg-main-divider":hg[t],l=pg[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:l,children:e})})})),fg=({text:e,description:t,icon:n,isActive:i,type:l})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text: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"}))(i);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",a.icon),image:{...n,iconVersion:n?.iconVersion??a.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===l?a.text:a.oldText,children:e}),o("div",{className:"animated"===l?a.desc:a.oldDesc,children:t})]})]})},xg={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},yg={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},bg={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},vg={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Ng=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:l})=>{const a=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(a,{className:u("h-12","block flex-1","cursor-pointer",xg[i],n?vg[i]:bg[i]),role:"tablist","aria-label":"Список табов",onClick:l,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?yg[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[fg({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(gg,{count:m,version:Wr(n,i)})}):null]})})})),wg=d((e=>o(e?.item?.href?Cg:kg,{...e}))),Cg=d((e=>{const t=ue(),n=a((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...l}=t({...e.item,onClick:n});return o(Ng,{...e,tag:"a",item:l,onClick:i})})),kg=d((({item:e={},onClick:t,...n})=>{const i=a((()=>{t&&t(e)}),[t,e]);return o(Ng,{item:e,onClick:i,...n})})),Sg=(e,t,n)=>(i,l)=>o(wg,{isActive:i===e,onClick:t,type:n,item:i},String(l)),Tg=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:l})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Sg(i,l,t))}))),Ig={categories:[],extraOptions:[],propertyType:[],stage:[]},Bg=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...l})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Vc(Ig,{block:l.block,page:l.options?.page}),f=a(((e=Ig)=>p(e)),[]),x=(({hotFilters:e=mg,filtrationState:t=ug,blocks:n=mg,onFiltrationStateChange:i})=>{const l=r((()=>Math.max(0,e.findIndex((e=>cg(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:sg(n,t.filter),version:Wr(t===e[l])})))),[e,n,l]),o=a((t=>{i(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(Tg,{...x}),o(Dc,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Ic,{blocksToRender:d,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Rg=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:l,atmCode:a="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Mg(i)},{label:"Модуль приема наличных",value:l?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:a}];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:Mg(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:Mg(s)})})]}),o("div",{className:"hidden sm:block",children:o(Ya,{className:"flex-wrap",children:m?.map(Dg)})}),o(La,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ja,{isUnfolded:e,children:o(Ya,{className:"flex-wrap",children:m?.map(Dg)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(d))},Pg=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Mg(t)} №${n}`,body:e.toUpperCase()}),Dg=(e,t)=>o($a,{...e},String(t)),Mg=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Ag=[];const _g=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:Ag},zg={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Eg={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)},Fg=d((({descriptionData:e,className:t})=>{const[n]=jh(),i=n?.code??"000",{data:l,isLoad:a}=function(e){const{data:t,error:n}=Ln(`/api/v1/atms?regionCode=${e}`,_g);return{data:t||Ag,isLoad:!t&&!n}}(i);return o(ts,{className:t,filterItems:Vg,data:l,isLoad:a,initFilterState:zg,renderCard:Rg,getBalloon:Pg,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Vg=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),l=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=l.every((t=>Eg[t](e))),n=!i.length||i.some((t=>Eg[t](e)));return t&&n}))},Og=({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:qg({workScheduleDescription:t})}),o(La,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ja,{isUnfolded:e,children:qg({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(n)):null,qg=({workScheduleDescription:e})=>c("div",{children:[c(Ya,{className:"flex",children:[o($a,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o($a,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o($a,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o($a,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o($a,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),Lg=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),jg={branches:[],remoteWorkplaces:[]};const $g=async e=>await rt(e,{method:"GET"})||jg,Ug=d((({className:e})=>{const[t]=jh(),n=t?.code??"000",{data:i,isLoad:l}=function(e="000"){const{data:t,error:n}=Ln(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,$g);return{data:t||jg,isLoad:!t&&!n}}(n);return o(ts,{className:e,data:i?.branches,isLoad:l,remoteWorkplaces:i?.remoteWorkplaces,renderCard:gr,renderRemoteWorkplaceCard:Og,getBalloon:xr,getBalloonRemoteWorkplaces:Lg,title:`Офисы филиала ${t?.name}`})})),Wg=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Ug,{}):o(Fg,{descriptionData:e})})})),Hg=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(S,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Yg=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o(yc,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Xe,{className:"px-5 h-full",headlineVersion:"L",...e,...i})},String(t))))})}))),Kg=d((({address:e,email:t,telephone:n,button:i,className:l="",__html:a,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(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[a?Gg({__html:a,richVersion:r}):null,Xg({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Xg({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Xg({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?qe([i]):null]})]}))),Gg=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Pe,{...e,itemSize:"list-s"})}),Xg=({label:e,data:t,iconName:n,dataColor:i=""})=>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:i,children:t})]})]}):null,Jg=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Pe,{__html:t,richVersion:n})})})),Zg=d((({name:e,text:t,value:n,checked:i,onChange:l,className:a})=>o("div",{className:a,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:i,onChange:e=>l?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),Qg=d((({className:e=""})=>{const[t,n]=i("option2"),l=a((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Zg,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:l}),o(Zg,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:l})]})})),ef=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:l="",setSelected:a,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(cn,{options:s,label:r,placeholder:l||i,onChange:e=>a(e.key),value:c})})),tf=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:l,onSelectedBranch:a})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(ef,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(ef,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:l,setSelected:a,label:"Отделение",placeholder:"Выберите отделение"})})]}))),nf=["От 1 дня","До 365 дней"],lf=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ui,{min:1,max:365,value:e,items:nf,onChange:t})]}))),af=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:l,onSelectedBoxSize:a})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(ef,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(ef,{data:i,fieldLabel:"safeBoxCasesSize",selected:l,setSelected:a,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),rf=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:l,selectedCaseVolume:a,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(tf,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:sf(m)}),o(lf,{days:l,setDays:e=>m({days:e})}),o(af,{caseVolumes:d,selectedCaseVolume:a,onSelectedCaseVolume:of(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(Qg,{}),o(be,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),sf=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},of=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},cf=d((({days:e,tariffs:t=[]})=>{const n=mf(e,t),i="На рисунке изображена пачка листов\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:[df("Аренда за",e),df("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),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(C,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),df=(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})]}),mf=(e,t)=>{const n=uf(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},uf=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},hf=(e,t)=>e.find((e=>e.branchCode===t)),pf=d((e=>{const{regions:t,data:n,branches:i,onChange:a,onClick:r}=e;l((()=>{a({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,a]);const s=hf(i,n.selectedBranch),d=gf(s?.safeBoxCaseVolumes),m=ff(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=xf(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(rf,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:a}),o(cf,{days:n.days,tariffs:u})]})})),gf=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],ff=(e,t)=>e?.find((e=>e.volume===t)),xf=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,yf=[];const bf=async e=>await rt(e,{method:"GET"})||yf,vf=d((({title:e,footnote:t,className:n="",...l})=>{const[r,s]=i(!1),d=a((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Va(),p=Nf(m.selectedRegion,h),f=function(e){const{data:t}=Ln(e?`/api/v1/safeboxes?regionCode=${e}`:null,bf);return t||yf}(p),x=a((e=>u((t=>({...t,...e})))),[u]),y=(b=hf(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...l,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(pf,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(_r,{points:y,className:"h-[640px]"}):null]})})),Nf=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,wf={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"},Cf=(e,t,n)=>(i,l)=>{const{button:a}=i;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:kf(e,n)(i,l)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Sf(i),a?.text?o(be,{className:"box-border py-s w-full max-w-60 mt-lg",version:t,...a,children:a?.text}):null]})]})},String(l))},kf=(e,t)=>(n,i)=>{const l="secondary"===t?"white":"color",a=Boolean(n?.icon?.src),r=Tf(e,a),s=a?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:If({step:n,iconVersion:l,i:i,stepVersion:t})})})},Sf=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",wf.description),children:e.description}):null,o(Pe,{__html:e.__html})]}),Tf=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",If=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return Oe(e?.icon)?o(ne,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===i?wf.iconText:(l=i,"secondary"===l?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var l},Bf=d((({className:e="",title:t,description:n,steps:i=[],buttons:l,stepVersion:a="gray",version:r="primary",...s})=>{const d=i.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),i?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:i.map(Cf(d,r,a))}):null,qe(l,{isVertical:!0})]})})),Rf=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(W,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Pf=d((({className:e,head:t,children:n,onClose:i,onClick:l})=>{const{close:r}=de(),s=a((()=>{r(),i&&i()}),[i]);return c("div",{onClick:l,className:u("relative min-h-full bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(hl,{className:"absolute top-1.5 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),Df=({menuRef:e,dialogRef:t,closeDialog:n,openDialog:i,leftItems:l,rightItems:a})=>[{openBottomMenuItemDialog:(r,s)=>{const c="left"===s?l:a,d=e?.current?.getBoundingClientRect();i(o(Pf,{onClick:e=>e.stopPropagation(),onClose:n,className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:c[r].description||c[r].title})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",onLoad:()=>(()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=String(e?.contentWindow?.document.body.offsetHeight)+"px"})(),src:c[r]?.src,width:d?.width||0})})}),{id:"left"===s?l[r].title:a[r].title})}}];function Mf(e){throw new Error(e)}const Af=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=i(e),l=a((e=>n((t=>[...t,e]))),[]),r=a((()=>n((e=>e.slice(0,-1)))),[]),s=a((e=>n((t=>t.filter((t=>t!==e))))),[]),o=a((()=>n([])),[]);return[t,{setList:n,push:l,pop:r,remove:s,clear:o}]}(),c=a((()=>{e&&e(n),o()}),[n,e]),d=a((()=>{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:Mf(e)}}))),[c,d]),n},_f=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:l}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),l=Array.from({length:t.length});let a=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++)i[r]||l[n]||e[r]!==t[n]||(a++,i[r]=!0,l[n]=!0)}return{m:a,s1Matches:i,s2Matches:l}}(e,t);if(0===n)return 0;const a=function(e,t,{s1Matches:n,s2Matches:i}){let l=0;for(let a=0,r=0;a<e.length;a++){if(!n[a])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[a]!==t[s]&&l++}return l}(e,t,{s1Matches:i,s2Matches:l}),r=(n/e.length+n/t.length+(n-a/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 zf=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(Ef,{...e},String(t))))})]}):null,Ef=d((({icon:e,...t})=>{const n=ue(),{text:i,target:l,href:a,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:a,target:l,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),Ff=(e,t)=>n=>n.name?o($m,{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,Vf=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"})]}))),Of=d((({foreignOffices:e,branches:t})=>{const[n,l]=jh(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=i(""),u=Lf(Va()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((e,t)=>{const n=new Map;for(const i of e){const e=t(i),l=n.get(e)||[];n.set(e,[...l,i])}return n})(u,qf),{close:p}=de(),g=a((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(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o($m,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(Vf,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&_f(e.toLowerCase())(d.toLowerCase())>=.8)).map(Ff(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(Ff(x,f))]},e)))}),zf(e)]});var f,x})),qf=e=>e.name?.charAt(0)||"",Lf=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),jf=d((({menuRef:e,menuItem:t,locationDialogProps:n,closeAll:i})=>{const a=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(Of,{...e}),n),close:n}})(n||{}),[{name:r}]=jh(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return l((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),l((()=>{const e=e=>{if("location"===e.data.type&&a.open(),"reload"===e.data.type&&i(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[]),o(Pf,{onClick:e=>e.stopPropagation(),head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),$f="burgerMenuDialog",Uf=({menuRef:e,centralMenuItem:t,closeAll:n,openDialog:i,locationDialogProps:l})=>{const a=Af(),r=((e,t)=>Boolean(t.find((t=>t.id===e),e)))($f,a);return[r,{toggle:()=>{r?n():i(o(jf,{locationDialogProps:l,menuRef:e,menuItem:t,closeAll:n}),{id:$f})}}]},Wf=[],Hf=ht((({sticky:e,...t})=>{const{menuItems:n=Wf}=e??{},l=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=i(-1),[f,x]=i(""),{open:y,closeAll:b}=de(),v=a((()=>{p(-1),x(""),b()}),[b]),N=jt(v),w=s(null),[C,{toggle:k}]=Uf({menuRef:w,centralMenuItem:l,closeAll:b,openDialog:y,locationDialogProps:t.header}),[{openBottomMenuItemDialog:S}]=Df({menuRef:w,dialogRef:N,closeDialog:v,openDialog:y,leftItems:m,rightItems:u}),T=a((e=>{v(),e.stopPropagation(),k()}),[v,k]),I=a(((e,t)=>{x(t),p(e),b(),S(e,t)}),[b,S]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:w,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Yf(I,"left",{activeIndex:h,currentItemPosition:f})),o(Rf,{item:l,isActive:C,onClick:e=>T(e)}),u.map(Yf(I,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Yf=(e,t,n)=>(i,l,a)=>o(Rf,{item:i,isActive:a[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t,onClick:r=>{a[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t||r.stopPropagation(),e(l,t)}},i.title||String(l)),Kf="hidden sm:flex absolute z-40",Gf={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Xf=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:a="default"})=>{const[r,s]=sc({itemCount:t?.length||0});return l((()=>Jf(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Ko,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Gf[a].item,gap:Gf[a].gap,children:t.map(Sg(n,i,a))}),s.canScrollLeft?o(uc,{className:u("left-6",Kf,Gf[a].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(hc,{className:u("right-6",Kf,Gf[a].buttonTop),onClick:s.scrollRight}):null]})})),Jf=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},Zf={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Qf=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(Zf[t].wrapper,e),children:o(Xf,{className:Zf[t].component,tabsType:t,...n})}):null,ex=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=tx(n??{}),p=M(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=i(lx(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));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)}),[y,w,h]);const C=ix(x[b],b),k=a((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:[Qf({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:nx(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(ix)?.filter(Boolean)||[]}),tx=({__id:e,anchor:t})=>t??e??"tabs",nx=(e,t)=>t?.length?t:e,ix=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",lx=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),ax={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},rx=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:ax[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),sx=d((({className:e="",isOpen:t,onClick:n})=>o(be,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),ox={Buttons:({buttons:e})=>qe(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:i,isOpen:l})=>e?o(sx,{className:"w-fit",isOpen:l,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},cx=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:a,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);l((()=>{a===o&&s||m(!0)}),[s,o]);return dx({cell:e,cellProps:{rowIdx:n,cellIdx:a,fieldIdx:t,displayTable:e=>{m(!1),c(a),r(e)},isVisible:d}})})),dx=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in ox))return null;return o(ox[n],{...t,...i})},mx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:l,openTableInnerIdx:a,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(cx,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:l,openTableInnerIdx:a,setOpenTableInnerIdx:r},String(s)))):null}))),ux=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),hx=(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,px=d((({rows:e})=>{return o(Ko,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[i,...l]=e,a=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[i?.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:i.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:a,style:{transform:`translateX(-${ux(l,t)}px)`},children:l?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Me,{size:"text-xl",children:e.data}):null,e?.cols?hx(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),gx=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`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(px,{rows:t.rowsData})})})]},i)}))}))),fx=(e=!1)=>""+(e?"text-white":"text-secondary-text"),xx=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>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:()=>i(t),children:o(Me,{size:"text-xl",font:"font-light",color:fx(t===n),children:e||t+1})},e)))}):null,t?o(be,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),yx=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const l=e?.tableData,[r,s]=i(0),d=a((e=>s(e)),[]),m=l?.[r]?.items??[],u=l?.map((e=>e.currency??""));return c("div",l?{className:"bg-white z-10",children:[o(xx,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(gx,{activeTabIndex:r,items:m}),o(sx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(sx,{onClick:n,isOpen:!0})]})})),bx=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(yx,{...t,onClick:n})}):null]}))),vx=d((({row:{header:e,data:t},activeIndex:n,rowIdx:l,...r})=>{const[s,d]=i(void 0),m=a((e=>d(e)),[]),[h,p]=i(void 0),g=a((e=>p(e)),[]);return c(bx,{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(rx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(mx,{cells:e,rowIdx:l,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function Nx({dec:e,inc:t,canDec:n,canInc:i,btnClass:l,className:a=""}){return n||i?c("div",{children:[n?o(mc,{className:u("absolute z-40",l[0],a),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(mc,{className:u("absolute z-40 rotate-180",l[1],a),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const wx=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,Nx({...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]})})),Cx=d((({className:e="",title:t,description:n,rowHeaders:l,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=l?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:l}=e,[r,s]=i(t),o=a((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=a((()=>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}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(vx,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?o(La,{renderFoldableSection:({isUnfolded:e})=>c(wx,{controls:x,children:[b,o(ja,{isUnfolded:e,children:v})]}),renderFoldButton:Cc}):o(wx,{controls:x,children:y})})]})})),kx=d((({className:e="",title:t,description:n,iconVersion:i,__html:l,richVersion:a,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?Sx():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?Tx(n):null,l?o(Pe,{richVersion:a,__html:l}):null]})]}))),Sx=()=>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"}),Tx=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Ix=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]}))),Bx=d((e=>{const{prefix:t,unit:n,suffix:i,...l}=e;return o(g,{defaultPadding:"p-0",...l,children:o(Ix,{prefix:t,unit:n,suffix:i})})})),Rx={AdTile:gt,ApplicationForm:Os,ApplicationLeadForm:Lo,BankAccountFiltration:Lc,BenefitsBlock:Hc,BonusBenefitsBlock:Gc,ButtonsBlock:Jc,CalculatorBonus:ud,CalculatorBusinessDeposit:Rd,CalculatorCredit:Ud,CalculatorDeposit:om,CalculatorRefinancing:fm,CardTransfer:Cm,Carousel:Dm,CarouselCard:zm,CarouselCatalogCard:Fm,CarouselLinks:qm,CarouselRecommendationCard:Km,CarouselTariffsCard:Jm,CreditCardForm:zu,CreditForm:fh,DepositFiltration:Nh,Depository:Vh,ErrorBlock:qh,ExchangeRateTile:hp,Footer:_p,GrantSupport:zp,Header:Lp,Headline:S,HorizontalLayout:Wp,ImgBlock:Hp,LinkDocs:ng,MobileAppTile:rg,MortgageFiltration:Bg,OfficesAtmsMap:Wg,Placeholder:Hg,ProductBlock:pt,ProductGallery:Yg,RepresentativeOfficeInfo:Kg,RichTextBlock:Jg,RollupItem:Np,SafeDepositRental:vf,StepsBlock:Bf,StickyBottomMenu:Hf,TabsLayout:ex,TariffsTable:Cx,TextBlock:kx,UnitBlock:Bx,VerticalLayout:Up},Px=me((()=>{l((()=>{Tt()}),[]);const e=_t();Lt(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");kt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Dx="cookie",Mx=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=qt();!function(e,t,n=300){l((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(Dx)||n()}),[],3e3);const r=a((()=>{globalThis.localStorage?.setItem(Dx,"true"),i()}),[]);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:r})})]})}):null})),Ax=d((()=>{const e=a((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=a((e=>{e?.onClose&&e.onClose()}),[]),n=Af({onCloseAll:e,onClose:t}),{close:i}=de(),r=a((({key:e})=>{"Escape"===e&&i()}),[]);return Lt(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},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==n.length-1}),children:e},String(t||i))))}):null})),_x=d((()=>{const[e,t]=i(null),n=a((()=>{t(null)}),[]);l((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Mf(e)}}))),[]);const r=a((({key:e})=>{"Escape"===e&&n()}),[n]);return Lt(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})),zx="header",Ex="footer",Fx="sticky-footer",Vx={},Ox=d((({className:e,data:t=Vx,blocksRegistry:n,blockDecorator:i})=>{const{slots:l,blocks:a,fallback:r,...s}=t,d=ut(s,r);Px();const m={key:"",page:{slots:l,blocks:a,fallback:r,...d},blocksRegistry:n,blockDecorator:i,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:zx})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(l?.footer,{...m,slotName:Ex})]})]}),l?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(l?.["sticky-footer"],{...m,slotName:Fx})}):null,o(Ax,{}),o(_x,{}),o(Mx,{__html:d?.cookieContent?.__html})]})}));Object.assign(Ox,{childrenTypes:[],slots:()=>[zx,Ex,Fx]});e.Blocks=Rx,e.ContentPage=Ox,e.handlerDecorator=me,e.joinList=Rc,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=q,e.useRouter=M,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),l=n("useEffect"),a=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:i,...l}=t||{},a=n?.slots?.default,r=i||a&&a();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:i="p-xl",padding:l,block:a,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||i,e),...m?{"data-ver":t}:{},...a?.anchor?{id:a.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:i,children:l})=>{const a=v[n]||"h3";return o(a,{role:"heading",className:u("font-sans m-0",N[t],e),children:i||l})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),k={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"}},S=d((({className:e,version:t="",headlineVersion:n="XL",title:i,description:l,align:a="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=k[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[i?o(w,{className:u("whitespace-pre-wrap",a),...h?.title,as:r||h?.title.as,title:i}):null,l?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:a,...p,children:l}):null]})})),T=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function B(e,t,{className:n,...i}={}){const{key:l,blockDecorator:a=T,blocksRegistry:r={},ancestors:s=I}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return a({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:a})=>{const{content:r}=n;return d?o(d,{className:a,block:e,options:t,...r,...i},l):null}},l)}const P=[],R=(e,{key:t,ancestors:n=P,slotName:i=null,extraProps:l,renderProps:a=B,...r})=>{const s=l?(e,t)=>B(e,t,l):a;return(e||[]).map(((e,l)=>s(e,{...r,key:`${t||e.type}-${l}`,ancestors:r.parent?[...n||P,[r.parent,i]]:n},l)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:l}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:i,renderProps:l}):null)}function M(){return M._impl()}M._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),M.setup=e=>{M._impl=e};const A=["CDN","BASE_PATH"],E=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return A.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),z=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),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:F,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:O});const q="/api/",j=`${q}v1/storage`,$=e=>(t,n)=>{if([!t,_(t),F(t),[E.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 i=t?.startsWith("/");return V(O(t,n)?"":n,i?"/":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:i=`Иконка ${n}`,title:l=i,iconVersion:a="color",width:r,height:s})=>{const d=M(),m="normal"===a?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(V(E.CDN,"/icons/",m));return"normal"===a?o("img",{className:e,src:h,alt:i,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[a],{invert:"white"===a},t),width:r,height:s,"aria-hidden":"true",children:[l?o("title",{children:l}):null,i?o("desc",{children:i}):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 i=M();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:l},a)=>o("source",{srcSet:J(i)(e),type:te(n),media:l?`(max-width: ${l}px)`:"",width:t?.size?.width,height:t?.size?.height},`${a}_${e}`))):null,t?.src?ee({...t,src:J(i)(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="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},le="bg-main-divider text-main-disabled",ae={primary:le,secondary:le,white:le,link:"",transparent:"",gray:le,"":""},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?ie[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=M(),{closeAll:n}=de();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(i({...e,href:n}))}};function i({href:i,target:l,onClick:a}){return r=>{a?.(r),he(i,l,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!z(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.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:i,appendRight:l,version:a="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[a]),children:i}):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[a]),children:l}):null]})})),fe=e=>{const{version:t,aboveText:n,rounded:i}=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":i})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ye=({className:e,rounded:t,version:n})=>["inline-block",re,n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" "),be=d((({disabled:e,children:t,method:n="LINK",href:i,...l})=>{const r=(({method:e,href:t})=>a((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:l,searchParams:a}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,l].join(""));for(const[e,t]of a.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:i}),s=ue()({onClick:r,href:i,...l}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:i,ariaLabel:l,version:a,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:a,rounded:r}),href:t,rel:n,target:i,"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:i,children:l})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ye({className:e,rounded:i,version:n}),children:l})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const l="primary"===e?"white":"black",a="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"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}),a),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:l}})}),o(be,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=i(true);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:i="",title:l,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Ce(),v=M(),N=a((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",i||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(D({...y,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:i="list-m",isDotted:l=!0}=e,a=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,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,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,Ee=(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],_e=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:Ee(n)})]}))),ze=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(_e,{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(Ee)}):null)),Ve=d((({isTabularBenefits:e,...t})=>o(e?Fe:ze,{...t}))),Oe=e=>Boolean(e?.src||e?.icon),Le=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"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:i,icon:l,iconRight:a,version:r,...s}=t||{},c=je(l,r),d=je(a,r);return i||l?.icon?o(be,{className:u("basis-full @lg:basis-auto",e),appendLeft:$e({...l,iconVersion:c}),appendRight:$e({...a,iconVersion:d}),version:r,text:i,...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},i)=>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(i)),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:i,description:l,headlineVersion:a="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:k,children:T,...I})=>{const B=b?.src?o(ne,{image:b}):null,P=o(S,{title:i,description:l,headlineVersion:a,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(y),backwardButton:k,...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[a]}):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(it,e),it=(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)))}),at=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const i in e)at(e[i],t,[...n,i])},array:e=>{for(let i=0;i<e.length;i++)at(e[i],t,[...n,i])}})};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 at(e,(e=>t.push(e))),t})(e),[a,r]=i({});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,...a}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:i,padding:l,isTheme:a,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,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Xe,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),i=t?.[n];return i?o(pt,{suppressHydrationWarning:!0,...i,...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"),i=String(e.getMonth()+1).padStart(2,"0"),l=String(e.getFullYear());return t?`${l}-${i}-${n}`:`${n}.${i}.${l}`}},yt=e=>e?.replace(/[^+\d]/g,"");const bt=e=>e?{phone:yt(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:yt(e)}:{},kt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:l}of e)t[i??""]?.(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,i]of new URLSearchParams(t))n.searchParams.set(e,i);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 Et(){return Et._impl()}Et._impl=()=>({forwardQuery:Mt}),Et.setup=e=>{Et._impl=e};const _t=e=>e,zt=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=a(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]=i(!1),[u,h]=i({}),p=a(((e,t)=>{const{parse:n=_t,format:i=_t}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=a((e=>{c(e),h(e)}),[]),f=a((()=>{c(e),m(!1),h({})}),[e]),x=a((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:i,...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(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})})),Ot=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function Lt(e=!1){const[t,n]=i(e),l=a((()=>n(!0)),[]),r=a((()=>n(!1)),[]),s=a((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:l,setFalse:r,toggle:s}]}function qt(e,t,n,i){l((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function jt(e){const t=s(null),n=a((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:i,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),k=a((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:i||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",Gt,S,T),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:k,onFocus:x,onBlur:y,pattern:b,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]=i([]),f=en(),x=Qt[n],y=a((()=>{h.current=t,f.close()}),[t]),b=a((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:i,requestData:l={},responseItemHandler:a=Jt}=e,r=(s=a,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${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 i=(...l)=>{i.dispose(),n=setTimeout((()=>{e(...l)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return l((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:l,width:a,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:b}),{top:i+globalThis.scrollY+r,left:l,width:a})}),[e,p,t,b]),v}const ln=d((({className:e,label:t,value:n="",placeholder:i,error:l,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:y=!1,disabled:b=!1})=>{const[v,{setFalse:N,setTrue:w}]=Lt(),C=jt(N),k=a((e=>x?e.length<=x&&s(e):s(e)),[s]),S=nn({isOpen:v&&y,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:b,type:p||"text","aria-label":t,label:$t({label:t,errors:r}),valid:Boolean(!l),value:n,onChange:k,onBlur:m,isTextarea:h,placeholder:an(i,r,t)})}),Xt(l)]})})),an=(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:i,onChange:l,iconVersion:a})=>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,i).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:a,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[y,{setFalse:b,setTrue:v}]=Lt(),[N,w]=i(""),C=un(x,n.length),k=y&&!C,S=a((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=a((()=>{m.close(),c&&c()}),[c]),h=a((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:a,left:r,width:s,height:c}=l.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),{top:a+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,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:i,...l})=>c("div",{className:e,children:[o(cn,{...l,valid:!n,label:$t({label:t,errors:i})}),Xt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",yn=e=>fn(e??xn),bn=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:yn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:bn(),addressBranch:bn(),phone:kn("Укажите номер телефона"),secondaryPhone:kn("Укажите номер телефона"),organizationPhone:kn("Укажите номер телефона"),birthday:yn("Укажите дату рождения"),birthPlace:yn("Укажите место рождения"),education:yn("Выберите ваше образование"),housing:yn("Выберите тип жилья"),employment:yn("Выберите информацию о трудоустройстве"),organization:yn("Выберите тип организации"),amountWorkers:yn("Выберите информацию о количестве сотрудников"),employerActivities:yn("Выберите вид деятельности организации"),employerOrganization:yn("Выберите вид организации"),positionOrganization:yn("Выберите вашу должность"),dulSerie:(Rn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Rn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:yn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:yn("Укажите организацию, выдавшую паспорт"),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:yn("Укажите ОПФ"),organizationName:yn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:yn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:yn(),collectionCount:yn(),comment:yn(),acquiringType:bn(),feedbackMethod:bn(),serviceType:bn(),serviceDirection:bn(),meetingDay:yn(),product:yn(),localities:yn(),consentDataProcessing:Sn,annualRevenue:yn(),consentToReceiveMaterials:Sn,processPersonalDataFlg:Sn,consentProviderFlg:Sn,consentPfrFlg:Sn,consentOthersFlg:Sn,consentInformFlg:Sn,familyStatus:yn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(Tn)(e))("Некорректный номер СНИЛС"),conscription:yn(),armyIdFlg:Sn,sex:yn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:gn((e=>Boolean(e.fiasCode&&e.city&&e.house)))("Укажите регион, город/населенный пункт, улицу, дом"),participantDateRegistration:yn("Укажите дату регистрации"),retirementIncome:yn(),otherIncome:yn(),mandatoryIncome:yn(),otherPayments:yn(),disablePeopleFlg:yn(),bankruptcyFlg:yn(),shareholderFlg:yn(),legalEntityName:yn(),bankEmployeeCode:yn(),partInBusiness:yn(),regionRetail:bn("Выберите филиал банка"),addressRetail:bn("Выберите адрес банка"),addressMatch:yn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&/^[\u0400-\u04FF\d]+$/u.test(e)))(e??xn))("Необходимо ввести кодовое слово"),confirmationIncome:yn(),deliveryDate:yn("Укажите дату доставки"),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:i}=e,l=i?t(n):[];return{...e,errors:l,error:l[0]}},An=(e,t,n=!1)=>n&&t?Mn(e,t):e,En=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],_n=d((({field:e,input:t})=>o(hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:En,...An(e("acquiringType"),Pn.acquiringType,t?.required)}))),zn=(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:a}={}){const s=r((()=>jn(e)),[e]),[o,c]=i(void 0),[d,m]=i(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 i=Ln(n),l=t.get(i);if(i&&Fn(l))return l;const a=e(...n);return i&&Fn(a)&&t.set(i,Promise.resolve(a)),a})(t,a)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,a,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 i=e("region"),a=i?.value?.key,r=i?.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}(a)?.filter((e=>e?.address));return l((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.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",i=e(n).value,{value:r}=e("addressMatch");l((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);const s=a((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=a((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(ln,{label:"Адрес",disabled:r,...An(e(n),Pn[n],t?.required),value:i.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",i=e(n).value,l=a((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=a((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(ln,{disabled:t?.filledByEsia&&Kn(e,n),label:"Адрес",...An(e(n),Pn[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:l})})),Xn=d((({className:e,viewBox:t,fill:n="none",width:i,height:l,paths:a,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:l,children:a.map((({d:e,fill:t,...n},i)=>{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},i)}))}))),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:i,isRadio:l,onChange:r})=>{const s=a((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,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",ti(i)),onClick:s,children:[o("div",{className:u(Jn,"m-0",l?"rounded-full border-2":ii(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ni(l),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,ei(n)]})})})),ei=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,ti=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ni=(e=!1)=>e?"radio":"checkbox",ii=(e=!1)=>u("rounded border",{"bg-primary-main":e}),li=d((({className:e,text:t,value:n,key:i,disabled:l,error:a,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(Qn,{text:t,value:n,disabled:l,onChange:r},i),Xt(a)]}))),ai=d((({field:e,input:t})=>o(li,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...An(e("addressMatch"),Pn.addressMatch,t?.required)}))),ri=(e,{normalize:t,format:n})=>{const{value:l,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=a((e=>{d(!0),r&&r(e)}),[]),u=a((()=>{d(!1),o&&o(t(l)),s&&s()}),[o,l]);return{value:c||!n?l:n(l),onFocus:m,onBlur:u}},si=(e,t,n)=>Math.max(t,Math.min(e,n));function oi(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function ci({list:e=[],min:t,max:n,step:i,value:l=e[0]||t,disabled:a,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||a?"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:i,value:s,disabled:a,onChange:t=>{const n=oi(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const di=1,mi=100,ui=d((e=>{const{className:t,title:n,items:i=[],list:l=[],min:r=(l.length?0:di),max:s=(l.length?l.length-1:mi),step:d=1,value:m=l[0]||r,disabled:h=!1,onChange:p}=e,g=ri(e,{normalize:(e=0)=>l.length?hi(l)(e):si(e,r,s),format:Ue()}),f=a((e=>{p&&p(oi(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}),ci({list:l,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),pi(i)]})})),hi=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),pi=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))))}),gi=["От 1 000 ₽","До 1 000 000 000 ₽"],fi=d((({field:e})=>o(ui,{title:"Сумма, ₽",items:gi,min:1e3,max:1e9,...e("amount")}))),xi=e=>{const{data:t,error:n}=qn(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,yi);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},yi=async e=>await rt(e,{method:"POST"})||[],bi=ht((({field:e,source:t,label:n,fieldName:i,input:l})=>{const a=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:"Выберите из списка",label:n,options:a,...An(e(i),Pn[i],l?.required)})})),vi=d((({field:e,input:t})=>{const{data:n}=xi("EMPLOYEES_NUMBER");return o(bi,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Ni=d((({field:e,input:t})=>o(ln,{label:"Годовая выручка, ₽",...An(e("annualRevenue"),Pn.annualRevenue,t?.required)}))),wi=d((({field:e,input:t})=>o(li,{text:"Наличие военного билета",...An(e("armyIdFlg"),Pn.armyIdFlg,t?.required)}))),Ci=d((({field:e,input:t})=>o(ln,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...An(e("bankEmployeeCode"),Pn.bankEmployeeCode,t?.required),...t}))),ki=d((({field:e})=>o(ln,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Si=d((({field:e,input:t})=>o(li,{text:"В отношении меня ведётся производство по делу о банкротстве",...An(e("bankruptcyFlg"),Pn.bankruptcyFlg,t?.required)}))),Ti=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:l,min:a,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,i,d),n=Ii(t,e),c=Bi(t,a,r);u.push(o("td",{children:o("div",{className:Pi(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Ii=(e,t)=>t&&e.toDateString()===t.toDateString(),Bi=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),Pi=(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"),Ri=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Di=d((({today:e,currentMonth:t,currentYear:n,min:i,max:l,onDateSelect:s=Ut,setValue:d=Ut})=>{const m=a((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:Ri.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Ti({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:l,onDateClick:m})})]})})),Mi=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ai(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],l=i.findIndex(Ei),a=i.map(((e,t)=>zi(e)?i.slice(0,t).filter(zi).length:-1)),r=i.map(((e,t)=>_i(e)?e:n.charAt(a[t])||e)),s=a.indexOf(n.length-1)+1;return r.slice(0,Math.max(l,s)).join("")}const Ei=e=>"_"===e,_i=e=>/\d/.test(e),zi=e=>Ei(e)||_i(e),Fi=1940,Vi={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Oi=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:a,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(a||"");return l((()=>{g(a||"")}),[a]),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(Ai(t,"__.__.____"))},onBlur:()=>{if(Li(p)){const[n,i,l]=p.split(".");d?.(new Date(Number(l),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(l))}else g(a||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Vi})]})})),Li=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=Fi&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),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},qi=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:l,setSelectedYear:a,disabled:r=!1})=>o(Oi,{onChange:i,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:l,setSelectedYear:a,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")}),ji=Mi.map((e=>({key:e}))),$i=Array.from({length:(new Date).getFullYear()-Fi+1},((e,t)=>Fi+t)).reverse().map((e=>({key:String(e)}))),Ui=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},Wi=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:l})=>{i&&l?.(new Date(t,n,Math.min(e,i.getDate())))},Hi={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},Yi={className:"min-w-32",iconVersion:"black",isBorder:!1},Ki=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]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(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:i,onYearSelect:l,selectedYear:r,onChange:s,value:o})=>{const c=jt(a((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:a((()=>e(!t)),[t]),handleNextMonth:a((()=>{n+1<=11?i(n+1):(i(0),l(r+1))}),[n]),handlePrevMonth:a((()=>{n-1>=0?i(n-1):(i(11),l(r-1))}),[n]),handleSelectMonth:a((({key:e})=>{i(Mi.indexOf(e));const t=Ui(r,Mi.indexOf(e));Wi({maxDateOfMonth:t,selectedYear:r,selectedMonth:Mi.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:a((({key:e})=>{l(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ji,yearsOptions:$i,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,a]=i(!1);return l((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();a(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:[qi({handleChangeVisibleCalendar:T,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),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,{...Hi,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:Mi[f]},options:k,...Yi}),o(cn,{onChange:C,value:{key:String(y)},options:S,...Yi}),o("div",{className:"my-auto",onClick:N,children:o(W,{...Hi,className:"rotate-90 cursor-pointer"})})]}),o(Di,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Gi=d((({className:e,label:t,error:n,errors:i,...l})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ki,{label:$t({label:t,errors:i}),valid:Boolean(!n),...l}),Xt(n)]}))),Xi=d((({field:e,input:t})=>o(Gi,{label:"Дата начала работы на текущем месте",...An(e("beginDate"),Pn.beginDate,t?.required),...t}))),Ji="birthday",Zi=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:i}=e(Ji);return o(Gi,{label:"Дата рождения",...An(e(Ji),Pn.birthday,t?.required),error:n&&i&&!Qi(i)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&Kn(e,Ji)})})),Qi=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},el=d((({field:e,input:t})=>o(ln,{label:"Место рождения",...An(e("birthPlace"),Pn.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Kn(e,"birthPlace")}))),tl=d((({field:e,input:t})=>{const{data:n}=xi("CARD_TYPE");return o(bi,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),nl=d((({field:e,input:t})=>o(ln,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...An(e("children"),Pn.children,t?.required),...t}))),il=d((({field:e,input:t})=>o(ln,{label:"Кодовое слово",...An(e("codeWord"),Pn.codeWord,t?.required),...t}))),ll=d((({field:e,input:t})=>o(ln,{label:"Количество объектов инкассации",type:"number",...An(e("collectionCount"),Pn.collectionCount,t?.required)}))),al=d((({field:e,input:t})=>o(ln,{className:"col-span-2",...An(e("comment"),Pn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),rl=d((({field:e,input:t})=>{const{data:n}=xi("INCOME_CERT_UNITED");return o(bi,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),sl=d((({field:e,input:t})=>{const{data:n}=xi("MILITARY_STATUS");return o(bi,{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 i=await fetch(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...ml()},credentials:"include",body:n?JSON.stringify(n):null});return dl(i)?i.json():i}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:i,onClick:l})=>{const{close:r}=de(),s=a((()=>{r(),i&&i()}),[i]);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 i=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:i}):o("iframe",{src:`${i}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},fl=d((({className:e,error:t,docId:n,...i})=>{const{open:l}=de(),a=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(Qn,{...i}),n?o(be,{className:"text-primary-main",onClick:()=>gl(l,n,a),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)),yl=d((({field:e,input:t})=>{const{data:n}=xi("CREDIT_IN_RSHB");return o(bi,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),bl={horizontal:"@lg:flex-row",vertical:""},vl=d((({label:e,items:t,value:n,className:i,onChange:l,disabled:a=!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",bl[r],i),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:a},String(e))))})]}))),Nl=d((({className:e,label:t,onChange:n,error:i,...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(i)]}))),wl=[{id:"rub",text:"Рубль"}],Cl=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency");return o(Nl,{label:"Валюта",orientation:"horizontal",items:wl,value:n,onChange:e=>i?.(e),...An(e("currency"),Pn.currency,t?.required)})})),kl=d((({field:e,input:t})=>o(Gi,{label:"Дата доставки",...An(e("deliveryDate"),Pn.deliveryDate,t?.required)}))),Sl=d((({field:e,input:t})=>o(ln,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...An(e("dependents"),Pn.dependents,t?.required),...t}))),Tl=d((({field:e,input:t})=>o(Gi,{label:"Желаемая дата встречи",...An(e("desiredMeetingDate"),Pn.meetingDay,t?.required)}))),Il=d((({field:e,input:t})=>o(li,{text:"Являюсь инвалидом",...An(e("disablePeopleFlg"),Pn.disablePeopleFlg,t?.required)}))),Bl="dulIssueDateField",Pl=d((({field:e,input:t})=>o(Gi,{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:i}=e("dulSubdivisionCode"),l=a((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(ln,{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(ln,{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(ln,{disabled:t?.filledByEsia&&Kn(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...An(e("dulSerie"),Pn.dulSerie,t?.required)}))),El="dulSubdivisionCode",_l=d((({field:e,input:t})=>{const n=a((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(ln,{disabled:t?.filledByEsia&&Kn(e,El),label:"Код подразделения",type:"number",maxLength:6,...t,...An(e(El),Pn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),zl=d((({field:e,input:t})=>{const{data:n}=xi("EDUCATION_LEVEL");return o(bi,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Fl=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(ln,{label:"Электронная почта",...An(e("email"),Pn.email,n),...i})})),Vl=d((({field:e,input:t})=>{const{data:n}=xi("ORGANIZATION_ACTIVITY_TYPE");return o(bi,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Ol=d((({field:e,input:t})=>{const{data:n}=xi("ORGANIZATION_KIND");return o(bi,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Ll=d((({field:e,input:t})=>{const{data:n}=xi("EMPLOYMENT_INFO_UNITED");return o(bi,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),ql=d((({field:e,input:t})=>o(ln,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...An(e("expenses"),Pn.expenses,t?.required),...t}))),jl=d((({field:e,input:t})=>o(ln,{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"),i=e("familyStatus")?.value?.key,a="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=a+r+s;return l((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(ln,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Ul=d((({field:e,input:t})=>{const{data:n}=xi("MARITAL_STATUS");return o(bi,{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(ln,{label:"ФИО",...An(e("fullName"),Pn.fullName,t?.required),...t}))),Xl=d((({field:e,input:t})=>o(ln,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...An(e("generalSeniority"),Pn.generalSeniority,t?.required),...t}))),Jl=d((({field:e,input:t})=>{const{data:n}=xi("HOUSE_TYPE");return o(bi,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Zl=d((({field:e,input:t})=>{const n=a((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(ln,{label:"ИНН",type:"number",maxLength:12,...t,...An(e("inn"),Pn.inn,t?.required),onDaDataChange:n})})),Ql=d((({field:e})=>o(li,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),ea=d((({field:e,input:t})=>o(ln,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...An(e("jobsNumber"),Pn.jobsNumber,t?.required),...t}))),ta=d((({field:e,input:t})=>o(ln,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...An(e("lastJobExperience"),Pn.lastJobExperience,t?.required),...t}))),na=d((({field:e,input:t})=>o(ln,{label:"Наименование юридического лица",...t,...An(e("legalEntityName"),Pn.legalEntityName,t?.required)}))),ia=d((({field:e,input:t})=>o(ln,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...An(e("legalForm"),Pn.legalForm,t?.required),...t}))),la=[];async function aa(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:la}const ra=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:i}=qn("outServiceRegions",aa),a=i?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return l((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:a,...An(e("localities"),Pn.localities,t?.required),isSearch:!0})})),sa=d((({field:e,input:t})=>o(ln,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...An(e("mandatoryIncome"),Pn.mandatoryIncome,t?.required),...t}))),oa=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],ca=d((({field:e,input:t})=>o(Nl,{orientation:"horizontal",items:oa,...An(e("methodObtain"),Pn.methodObtain,t?.required)}))),da="middleName",ma=d((({field:e,input:t})=>o(ln,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Kn(e,da),...An(e(da),Pn.middleName,t?.required),...t}))),ua=d((({field:e,input:t})=>o(ln,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Kn(e,t.name??""),...An(e("name"),Pn.name,t?.required),...t}))),ha=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!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]}))),pa=d((({field:e})=>zn(e("acquiringType")?.value?.key)?o(ha,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),ga=d((({field:e,input:t})=>{const{data:n}=xi("ORGANIZATION_TYPE");return o(bi,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),fa=d((({field:e,input:t})=>{const n=a((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(ln,{label:"Наименование организации",...t,...An(e("organizationName"),Pn.organizationName,t?.required),onDaDataChange:n})})),xa=d((({field:e,input:t})=>o(ln,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...An(e("otherIncome"),Pn.otherIncome,t?.required),...t}))),ya=d((({field:e,input:t})=>o(ln,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...An(e("otherPayments"),Pn.otherPayments,t?.required),...t}))),ba=d((({field:e,input:t})=>o(Gi,{label:"Дата регистрации по месту жительства",...An(e("participantDateRegistration"),Pn.participantDateRegistration,t?.required)}))),va=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,i={...An(e("partInBusiness"),Pn.partInBusiness,t?.required)};return o(ln,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...i,...t,onChange:e=>i?.onChange&&i?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?i?.value:"",disabled:!n})})),Na=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(ln,{...An(e("partnerComments"),Pn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),wa=[{id:"mir",text:"Карта МИР"},{id:"union_pay",text:"UnionPay"}],Ca=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("paymentSystem");return o(Nl,{label:"Платежная система",orientation:"horizontal",items:wa,value:n,onChange:e=>i?.(e),...An(e("paymentSystem"),Pn.paymentSystem,t?.required)})})),ka=e=>"_"===e,Sa=e=>/\d/.test(e),Ta=e=>ka(e)||Sa(e),Ia=[..."+7 (___) ___-__-__"],Ba=Ia.findIndex(ka),Pa=Ia.map(((e,t)=>Ta(e)?Ia.slice(0,t).filter(Ta).length:-1));function Ra(e){const t=e.replace(/\D/g,""),n=Ia.map(((e,n)=>Sa(e)?e:t.charAt(Pa[n])||e)),i=Pa.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(Ba,i)):n).join("")}const Da=d((({children:e,onChange:t,...n})=>{const i=a((e=>t&&t(Ra(e))),[t]),l=a((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),Ma=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Da,{"aria-label":t,label:$t({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),Xt(n)]}))),Aa=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Ma,{label:"Телефон",...An(e(n),Pn.phone,t?.required),disabled:t?.filledByEsia&&Kn(e,n),...t})})),Ea=d((({field:e,input:t})=>{const{data:n}=xi("POSITION");return o(bi,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),_a=d((({field:e})=>zn(e("acquiringType")?.value?.key)?o(ha,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),za=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:Fa(t?.productList),...Mn(e("product"),Pn.product)}))),Fa=e=>(e??[]).map((e=>({key:e,value:e})));function Va(e="/api/v1/regions"){const{data:t}=qn(e,st);return Array.isArray(t)?t:[]}const Oa=d((({field:e,input:t,url:n})=>{const i=Va(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...An(e("region"),Pn.region,t?.required)})})),La=d((({field:e,input:t})=>{const n=Wn(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:i,...An(e("region"),Pn.region,t?.required)})})),qa=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:l,renderFoldButton:r})=>{const[s,o]=i(n),d=a((()=>{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 ja=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),a=function(e,t){const n=s(null);return l((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:a,children:n})})})),$a=d((({value:e,subText:t,children:n,isPhone:i,...l})=>{const a=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[a.length,n,t].every((e=>!e))?null:Ua({textItems:a,subText:t,children:n,isPhone:i,...l})})),Ua=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:l,className:a,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",a),children:[e?o(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Wa(n,s),l?o(Me,{color:i,size:"text-m",children:l}):null]}),Wa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${Ha(e)}`,children:e.trim()}):e.trim()},String(n)))),Ha=e=>e.replace(/\D/g,""),Ya=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}))),Ka=e=>{const t=Xa(e);return o($a,{label:"Режим работы",value:t,className:"max-w-none"})},Ga=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Xa=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))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Ga({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),Ga({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},Ja=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],Za=e=>Ja.map((([t,n,i])=>({key:t,title:i,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??"")}}))),Qa=e=>{if(!e)return null;const t=er(e);return c(Ya,{className:"border-none",children:[o($a,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(tr)})}),o($a,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},er=e=>{const t=Ja.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.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},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o($a,{label:"Валюта",value:e.currency}):null,t?o($a,{label:"Купить",value:String(t)}):null,n?o($a,{label:"Продать",value:String(n)}):null]},String(i)),ir={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",ir[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:ir[n].text,children:t})]}))),ar=(new Date).getDay(),rr=e=>{const[t]=e?.slice(ar-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:l,hasLunch:a}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[l?o(lr,{color:"green",children:l}):null,n&&a?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:i,hasLunch:l},a)=>o($a,{label:e,value:t&&n?n:"",subText:sr({lunchHour:i,hasLunch:l,status:t}),subColor:!t||l?"text-error":"text-green-dark"},String(a)),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:i,phoneBusiness:l,phoneNatural:a,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=Za(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:i,phoneBusiness:l,phoneNatural:a,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(qa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ja,{isUnfolded:e,children:fr({phone:n,fax:i,phoneBusiness:l,phoneNatural:a,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:i,phoneCallCentre:l,phoneCurrencyControl:a,workSchedule:r,exchangeRate:s})=>{const d=Za(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Ya,{className:"flex-wrap border-b border-solid border-main-divider",children:[o($a,{label:"Факс",value:t,isPhone:!0}),o($a,{label:"Телефон филиала",value:e,isPhone:!0}),o($a,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o($a,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o($a,{label:"Для консультаций по валютному контролю",value:a,isPhone:!0}),o($a,{label:"Контакт-центр",value:l,isPhone:!0})]}),r?.isMatchesPattern?o(Ya,{children:o($a,{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(Ya,{children:[o($a,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(tr)})}),Ka(d)]}),r?.businessScheduleVisibleTag?Qa(r?.businessScheduleDescription):null,s?.currencies?.length?o(Ya,{className:"flex-wrap",children:s?.currencies?.map(nr)}):null]})},xr=({name:e="",address:t="",workSchedule:n})=>{const i=(l=e)?`${l?.charAt(0)?.toUpperCase()}${l?.slice(1)}`:"";var l;const a=`${t} ${(e=>{const t=Za(e),n=e?Xa(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ur(n):pr(n,i):hr(n):null})(n)}`;return{header:i,body:a}},yr=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),br=d((({children:e})=>yr?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:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const l=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),a=kr("offices",e,l);if(n.length&&n.every((e=>"type"in e))){const i=kr("workplaces",e,l),r=Sr(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Sr(n.filter((e=>"offices"===e.type)),"offices",e);a.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(a)}else{const i=Sr(n,"offices",e);a.add(i),t.geoObjects.add(a)}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:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.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];function Rr(e,t,n=!0){const[a,r]=i(void 0);return l((()=>{let i=!0;return((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,i)=>{const l=document.createElement("script");l.src=t,l.async=!0,l.id=t,l.addEventListener("load",(()=>{n(Pr(e))})),l.addEventListener("error",(e=>{i(e)})),document.head.appendChild(l)}))})(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),a}const Dr={...Tr,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Mr=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values(Dr).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],Er=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:a})=>{const r=s(null),d=Rr("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${E.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(l((()=>{r.current?Cr({yandexMaps:d,map:r.current,points:e,isLoad:i}):d?.ready((()=>{r.current||(r.current=new d.Map("map",{center:_r(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Cr({yandexMaps:d,map:r.current,points:e,isLoad:i})}))}),[d,e,n,i,a]),l((()=>{r.current&&a&&d?.geocode(a).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[a]),!d)return null;const m="z-10";return c("div",{id:"map",className:u("relative","w-full",t),children:[i?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(Mr,{yandexMaps:r}),o(Mr,{yandexMaps:r,direction:"out"})]}),Br(r,d,u("right-2 top-80",m))]})})),_r=e=>{const t=[Fr(zr(e,0)),Fr(zr(e,1))];return t.every((e=>e))?t:Ar},zr=(e,t)=>e.map((e=>e.coords?.[t])),Fr=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Vr={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Or={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Lr={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 qr({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const jr={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"},$r={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")},Ur=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(qr(e))}),{className:i,version:l="primary",active:a,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":a,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},a||r?"":u(jr[l],$r[l]),i),type:s,role:d,onClick:m,children:e})})),Wr=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Hr=(e,t,n)=>{const i=Wr("all"===t),l=Wr("business"===t),a=(e,t,i)=>{const l=e.currentTarget===e.target&&"business"===t?r(i):i;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(Ur,{"data-id":"all",onClick:t=>a(t,"all",e),version:i,children:"Для физических лиц"}),o(Ur,{"data-id":"business",onClick:t=>a(t,"business",e),version:l,children:"Для юридических лиц"})]})},Yr=({__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,Kr="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Gr=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:l})=>{const a=i?5:6,r=(e||[]).map((e=>o(Qn,{text:l[e],...t(e)},e))),[s,d]=a>0?[r.slice(0,a),r.slice(a)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(qa,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Kr,children:s}),o(ja,{className:Kr,isUnfolded:e,children:d})]}),renderFoldButton:Xr(n,i)})}):null})},Xr=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Jr()})]}),Jr=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Zr=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Qr=()=>{},es=e=>"all"===e?"block":"hidden",ts=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:l=[],renderCard:a=Qr,renderRemoteWorkplaceCard:r=Qr,getBalloon:s=Qr,getBalloonRemoteWorkplaces:d=Qr,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=zt(Vr),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=as({data:t,remoteWorkplaces:l,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),k={filters:is([...t,...l]),field:{field:f,reset:x},onlyOffice:p,labels:Or};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Zr(h,N),m?Yr(m):null,p&&Hr(t,w,C),o("div",{className:u("pb-3xl",es(w)),children:Gr(k)})]}),o("div",{className:"h-[600px]",children:o(br,{children:o(Er,{points:b,isLoad:n,className:"h-full"})})})]}),c(br,{children:[y.map(a),v.map(r)]})]})})),ns=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Lr[t](e)))))},is=e=>Object.keys(Vr).filter((t=>e.filter((e=>Lr[t](e))).length)),ls=()=>{},as=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=ls,getBalloonRemoteWorkplaces:l=ls})=>{const[a,s,o,c]=r((()=>{const a=ns(e,n),r=ns(t,n),s=[...a.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(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[a,s,r,a.length+r?.length]}),[e,t,n,i,l]);return{filteredItems:a,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},rs=d((({field:e,input:t})=>{const n=e("regionRetail"),i=e("addressRetail"),a=Wn(),r=n?.value?.key,s=a.find((({region:e})=>e===r)),d=!a,m=n?.value?.text,u=Wn()?.find((e=>e?.region===m))?.branches;l((()=>{""!==n?.value?.key&&e?.("addressRetail")?.onChange?.("")}),[n?.value]);const{points:h}=as({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(br,{children:o(Er,{points:h,isLoad:d,className:"h-full",selectedAddress:i?.value?.text})})})]})})),ss=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)})})),os=d((({field:e,input:t})=>o(ln,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...An(e("retirementIncome"),Pn.retirementIncome,t?.required),...t}))),cs=d((({field:e})=>{const t=e("secondaryPhone");return o(Ma,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?Mn(t,Pn.secondaryPhone):t})})),ds=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Hl,...An(e("serviceDirection"),Pn.serviceDirection,t?.required)}))),ms=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],us=d((({field:e,input:t})=>o(Nl,{label:"Пол",orientation:"horizontal",items:ms,...An(e("sex"),Pn.sex,t?.required)}))),hs=d((({field:e,input:t})=>o(li,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...An(e("shareholderFlg"),Pn.shareholderFlg,t?.required)}))),ps=d((({children:e,onChange:t,...n})=>{const i=a((e=>t&&t(Ai(e,"___-___-___ __"))),[t]),l=a((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>l(e?.target?.value||""),children:e})})),gs=d((({className:e,label:t,value:n,error:i,onChange:l,onBlur:a,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ps,{"aria-label":t,label:$t({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:l,onBlur:a,placeholder:"___-___-___ __"}),Xt(i)]}))),fs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(gs,{label:"СНИЛС",...An(e("snils"),Pn.snils,!!n&&t?.required),...t})})),xs=d((({field:e,input:t})=>o(ln,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Kn(e,"surname"),...An(e("surname"),Pn.surname,t?.required),...t}))),ys=["От 1 мес","До 15 лет"],bs=d((({field:e})=>o(ui,{title:"Срок, месяцев",items:ys,min:1,max:180,...e("term")}))),vs=d((({field:e,input:t})=>o(ln,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...An(e("totalIncome"),Pn.totalIncome,t?.required),...t}))),Ns=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:Wl,...An(e("serviceType"),Pn.serviceType,t?.required)}))),ws=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Cs=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:ws,value:t,onChange:e=>n&&n(e)})})}));const ks={$ref:"/wcms-resources/outservice-productlist.json"},Ss=(e,t,n=!1)=>(i,l)=>{const a="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(xs,{field:e,input:i}),name:o(ua,{field:e,input:i}),middleName:o(ma,{field:e,input:i}),phone:o(Aa,{field:e,input:i}),organizationPhone:o(Aa,{field:e,input:i}),email:o(Fl,{field:e,input:i}),fullName:o(Gl,{field:e,input:i}),inn:o(Zl,{field:e,input:i}),legalForm:o(ia,{field:e,input:i}),organizationName:o(fa,{field:e,input:i}),generalSeniority:o(Xl,{field:e,input:i}),lastJobExperience:o(ta,{field:e,input:i}),experience5Years:o(jl,{field:e,input:i}),jobsNumber:o(ea,{field:e,input:i}),beginDate:o(Xi,{field:e,input:i}),addressFact:o(Yn,{field:e,input:i}),organizationAddress:o(Gn,{field:e,input:i}),comment:o(al,{field:e,input:i}),addressBranch:o(Hn,{field:e,input:i,isPremium:a}),sex:o(us,{field:e,input:i}),birthday:o(Zi,{field:e,input:i,isRetailForm:n}),birthPlace:o(el,{field:e,input:i}),desiredMeetingDate:o(Tl,{field:e,input:i}),product:o(za,{field:e,source:ks}),localities:o(ra,{field:e,input:i}),isClient:o(Ql,{field:e}),partnerComments:o(Na,{field:e,input:i}),collectionCount:o(ll,{field:e,input:i}),acquiringType:o(_n,{field:e,input:i}),onlineCheckout:o(pa,{field:e}),posTerminal:o(_a,{field:e}),serviceType:o(Ns,{field:e,input:i}),term:o(bs,{field:e}),amount:o(fi,{field:e}),annualRevenue:o(Ni,{field:e,input:i}),vedTypes:o(Cs,{field:e}),feedbackMethod:o(Kl,{field:e,input:i}),serviceDirection:o(ds,{field:e,input:i}),bankEmpolee:o(ki,{field:e}),secondaryPhone:o(cs,{field:e}),consentToReceiveMaterials:o(xl,{field:e,input:i}),processPersonalDataFlg:o(xl,{field:e,input:i}),consentProviderFlg:o(xl,{field:e,input:i}),consentOthersFlg:o(xl,{field:e,input:i}),consentInformFlg:o(xl,{field:e,input:i}),consentPfrFlg:o(xl,{field:e,input:i}),applicationDate:o(ln,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:a?o(La,{field:e}):o(Oa,{field:e,input:i,url:Ot(t)}),education:o(zl,{field:e,input:i}),housing:o(Jl,{field:e,input:i}),employment:o(Ll,{field:e,input:i}),organization:o(ga,{field:e,input:i}),amountWorkers:o(vi,{field:e,input:i}),employerActivities:o(Vl,{field:e,input:i}),employerOrganization:o(Ol,{field:e,input:i}),positionOrganization:o(Ea,{field:e,input:i}),familyStatus:o(Ul,{field:e,input:i}),children:o(nl,{field:e,input:i}),familyMembers:o($l,{field:e,input:i}),dependents:o(Sl,{field:e,input:i}),totalIncome:o(vs,{field:e,input:i}),expenses:o(ql,{field:e,input:i}),snils:o(fs,{field:e,input:i}),conscription:o(sl,{field:e,input:i}),armyIdFlg:o(wi,{field:e,input:i}),dulSerie:o(Al,{field:e,input:i}),dulNumber:o(Ml,{field:e,input:i}),dulIssueDateField:o(Pl,{field:e,input:i}),dulSubdivisionCode:o(_l,{field:e,input:i}),dulIssuedBy:o(Dl,{field:e,input:i}),addressRegistration:o(Gn,{field:e,input:i}),addressCourier:o(Gn,{field:e,input:i}),participantDateRegistration:o(ba,{field:e,input:i}),retirementIncome:o(os,{field:e,input:i}),otherIncome:o(xa,{field:e,input:i}),mandatoryIncome:o(sa,{field:e,input:i}),otherPayments:o(ya,{field:e,input:i}),disablePeopleFlg:o(Il,{field:e,input:i}),bankruptcyFlg:o(Si,{field:e,input:i}),shareholderFlg:o(hs,{field:e,input:i}),legalEntityName:o(na,{field:e,input:i}),creditInRshbCd:o(yl,{field:e,input:i}),bankEmployeeCode:o(Ci,{field:e,input:i}),partInBusiness:o(va,{field:e,input:i}),regionRetail:o(ss,{field:e,input:i}),addressRetail:o(rs,{field:e,input:i}),addressMatch:o(ai,{field:e,input:i}),paymentSystem:o(Ca,{field:e,input:i}),currency:o(Cl,{field:e,input:i}),cardCategory:o(tl,{field:e,input:i}),codeWord:o(il,{field:e,input:i}),confirmationIncome:o(rl,{field:e,input:i}),methodObtain:o(ca,{field:e,input:i}),deliveryDate:o(kl,{field:e,input:i})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:i,field:e})?o("div",{children:r[i?.name||""]},String(l)):null},Ts=e=>2===e?"@xl:grid-cols-2":"",Is=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,Bs=d((function({responseType:e,typeForm:t}){const n="OK"===e,i=n?"ResponseOKIcon":"ResponseFailIcon",{close:l}=de(),r=a((()=>{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:i,iconVersion:"normal"},width:"136",height:"136"}),o(S,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Ur,{type:"button",onClick:r,children:"Хорошо"})]})})})),Ps=e=>{const{open:t,close:n}=de();return{open:(n,i={})=>t(o(Bs,{...e,...n}),i),close:n}},Rs=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Ds=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:l,term:a,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:l,amount:a,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${zn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${a}/Срок=${l}/Выручка=${r}`})(e):null,u={...d,...As(o),...Ms(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Ms=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},As=e=>e?{vedTypes:Object.fromEntries(ws.map((({id:t})=>[t,t===e])))}:{},Es={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:En[0],serviceType:Wl[0],feedbackMethod:Yl[0],serviceDirection:Hl[0],vedTypes:ws[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1},_s=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(be,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),zs=(e,t)=>o(Ur,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Fs=(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(_s,{link:t})]}),Xt(Mn(e,Sn).error)]}):o(_s,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),zs(n)]}),Vs={send:async function(e,t=!1){const{typeForm:n,region:i,phone:l="",email:a,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(i,g),...wt(a,g),...bt(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}}},Os=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))||[],y=((e,t="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Es[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Wl[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=Ps({typeForm:n}),C=a((async(e,t)=>{const n=Ls(x,e),i=Rs(Dn(n));if(!pn(i(e)))return console.warn("validation fail");const l=Ds({...e,...h}),a=await Vs.send(l,"lead"===m)?"OK":"Fail";if(v(a),a&&N.open({responseType:a}),"OK"===a&&g){const e=Et();kt({aspectsAttributes:g,aspects:e,ev:t})}return a}),[]),[,{field:k,onSubmit:S,reset:T}]=zt(y,{onSubmit:C}),I=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return l((()=>{"OK"===b&&(v(""),T())}),[b]),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(Ts(e.columns),"grid gap-x-m"),children:[Is(e.title),(e?.inputs||[])?.map(Ss(k,n))]},`section-${t}`))),Fs(I?k("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(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]})})),Ls=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)}))));function qs(e){const[t,n]=i(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,a((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const js=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const l=e.every((e=>Boolean(n(e.name).value))),a=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(qa,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(ja,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Ss(n,t))}),renderFoldButton:$s(c("div",{children:[o(Qn,{value:l,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),Xt(a?"Отметьте все обязательные соглашения":"")]}))})})})),$s=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"})})]}),Us=({field:e,typeForm:t="",inputs:n,isRetailForm:i=!1})=>{const{consentInputs:l,restInputs:a}=Ws(n||[]);return l.length>2?c("div",{children:[a.map(Ss(e,t,i)),o(js,{inputs:l,field:e})]}):(n||[])?.map(Ss(e,t,i))},Ws=e=>({consentInputs:e?.filter((e=>Object.keys(ol).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ol).includes(e.name||"")))||[]}),Hs={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:En[0],serviceType:Wl[0],feedbackMethod:Yl[0],serviceDirection:Hl[0],vedTypes:ws[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:""},Ys=(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||Hs[e.name||""]]))),typeForm:{key:n,text:""}}},Ks=(e,t)=>o(Ur,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Gs=e=>cl("/user-data/updateUserProfile","PUT",e),Xs=e=>cl("/user-data/updateUserTask","PUT",e),Js={width:"103",height:"21"},Zs={"bg-white":"color",transparent:"white"},Qs={"bg-white":"text-primary-main",transparent:"text-white"},eo=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Zs[e]},className:Qs[e],width:n?.width,height:n?.height}),to={"bg-white":"text-primary-text",transparent:"text-white"},no=d((({className:e,href:t="/",logo:n,children:i,targetBlank:l,bgColor:a="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:[eo(a,n?.image,Js),r?i??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:to[a],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),io=async({code:e,setHasError:t,close:n,sendCode:i=Ut})=>{const l=await(a={captchaText:e},cl("/sms/checkCaptcha","POST",a));var a;"ERROR"===await l.text()?t(!0):(i(),n?.())},lo=async(e,t)=>{const n=await(e=>cl(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET"))(t);e(URL.createObjectURL(await n.blob()))},ao=d((({phoneNumber:e,close:t,sendCode:n,onClose:a})=>{const[r,s]=i(""),[d,m]=i(""),[u,h]=i(!1);return l((()=>{lo(s,e)}),[]),o(pl,{head:o(no,{}),onClose:a,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:()=>lo(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(Ur,{onClick:t,version:"secondary",children:"Вернуться"}),o(Ur,{type:"submit",disabled:!d,onClick:()=>io({code:d,setHasError:h,close:t,sendCode:n}),version:"secondary",children:"Отправить"})]})]})})})),ro=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:so(e)})))),so=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,oo=async({phoneNumber:e,captchaDialog:t,setTimeNextReq:n,setIsTimerStarted:i,setAttemps:l})=>{try{await(a={phoneNumber:e,smsCodesSetName:{key:"AUTHENTICATION"}},cl("/sms/sendCode","POST",a)).then((t=>{if("string"!=typeof t&&t.errorMessage&&t.errorMessage.startsWith(`Too many request for phoneNumber [${e}]`))throw t})),l(0),n(180),i(!0)}catch(e){t.open()}var a},co=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);l((()=>{u.current?.[d]?.focus()}),[d]);const h=a((n=>i=>{const{value:l}=i.currentTarget,a=l.slice(0,1);t(e.map(((e,t)=>t===n?a:e))),m(n+1)}),[e]),p=a((n=>i=>{const{key:l}=i;if("Backspace"===l&&!e[n]){const i=n>0?n-1:e.length-1,l=e.map(((e,t)=>t===i?"":e));t(l),m(i)}}),[e]),g=a((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),l=e.map(((e,t)=>t<i.length?i[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,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:mo(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),mo=(e,t,n=!1)=>{const i=!t[e];return`w-16 h-20 text-3xl text-center p-2 m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},uo=d((({isDisabled:e,onClick:t,text:n})=>o(Ur,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-medium",children:n})}))),ho=e=>{globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token)},po=({close:e,values:t})=>{const[n,s]=i(!1),[o,c]=i(""),[d,m]=i(!1),[u,h]=i(0),[p,g]=i(!1),[f,x]=i(0),y=a((()=>{s(!1),c("")}),[]),b=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||b),[t]),N=a((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>cl("/sms/checkCode","POST",e).then(ho))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),y(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return l((()=>{b?(s(!0),c("Код просрочен")):s(!1)}),[b]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},go=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]=i(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:k}=po({values:p,close:e}),T=a((()=>{oo({phoneNumber:h,captchaDialog:I,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:k})}),[]),I=((e,t)=>{const{open:n,close:i,closeAll:l}=de();return{open:()=>n(o(ao,{close:i,onClose:t,...e})),close:i,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(S,{className:"w-full",title:n,description:r,headlineVersion:"S",isEmbedded:!0}),d?o(co,{values:p,setValues:g,errorText:y,hasError:x}):null,xo(v,w,T),o(Re,{itemSize:"list-s",__html:s}),fo(u,N,f),b?o(vr,{blur:!1}):null]})})})),fo=(e,t,n)=>e?o(uo,{isDisabled:t,onClick:n,text:e}):null,xo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-primary-main",children:["Получить новый код можно через",o(ro,{className:"text-primary-main ml-1",time:e,setTime:t})]}):o(be,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),yo=()=>{const{open:e,close:t}=de();return{open:(n,i)=>e(o(go,{onClose:t,close:n,...i})),close:t}},bo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},vo={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},No=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,l]=i(""),[r,s]=i(!1),{open:d,close:m}=de(),u=Ce(),h=a((()=>{m(),e(n)}),[n]),p=a((e=>{l(e),"REFUSE"===e&&s(!0)}),[]),g=r?vo:bo;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,Co,u),children:o(w,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(C,{align:"text-center",children:g.description}),o(vl,{className:"whitespace-normal",orientation:"horizontal",items:wo,value:n,onChange:p}),o(Ur,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),wo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Co=2,ko=e=>{const{open:t,close:n}=de(),i=yo(),l=(t,l)=>async a=>{n(),"SIGNED"===a&&t?i.open((t=>async n=>{t&&await Gs({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(l),So(t)):e()};return{open:(n,i)=>t(o(No,{handleSubmit:l(n,i),onClose:e}))}},So=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:yt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),To=d((function({handleClose:e}){const t=a((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(Ur,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Ur,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Io={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Bo={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Po={mandatoryIncome:"INCOME_AVERAGE",otherPayments:"MANDATORY_PAYMENTS"},Ro=e=>Object.entries(e).reduce(((e,[t,n])=>t in Io?[...e,{contactTypeCd:{key:Io[t]},value:n}]:e),[]),Do=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Bo){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Bo[t]},...i}]}return e}),[]),Mo=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]=i(""),[,c]=qs("taskId"),[,d]=qs("profileId"),[,m]=qs("participantId"),u=(e=>{const{open:t,close:n}=de(),i=a((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(To,{handleClose:i}),e),close:n}})(n),h=ko(u.open),p=yo(),g=a(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:a((async n=>{const i=Rs(Dn(e));if(!pn(i(n)))return console.warn("validation fail");try{const{profile:{id:e}}=await(a={profile:{phone:yt(n.phone)}},cl("/public-data/createUserProfile","POST",a));if(e&&n?.phone){const i=async()=>{try{await Eo({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:l}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},a=Object.keys(ol).filter((e=>n[e])).map((e=>ol[e]?.text));p.open(i,_o(n?.phone,a))}}catch{s("Fail")}var a}),[]),responseStatus:r}},Eo=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:l})=>{const a=Fo(n);await Gs(((e,t)=>{const{name:n="",surname:i="",middleName:l="",birthday:a="",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:i,midname:l,birthDate:a&&xt(a,!0),email:s,phone:yt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,a));const{taskId:r,participantId:s}=await(o={profileId:t,programId:e},cl("/user-data/createDraftTask","POST",o));var o;await Xs((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:l,surname:a,middleName:r,birthday:s,phone:o,email:c}=i;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:a,profile:{id:n},participantContacts:Ro({phone:o&&yt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:a})),i(s,r,t),l(n)},_o=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:yt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${zo(t)}`}),zo=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Fo=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Vo=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:l,addressFact:a}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Ra(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Oo(l),addressFact:Oo(a),esiaAccountTypeCd:t?.esiaAccountType}},Oo=e=>{const{postcode:t,region:n,regionCode:i,locality:l,city:a,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,l||a,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:i?.key,fullAddress:m}},Lo=e=>{const[t,n]=i(!1),[r]=qs("profileId"),[s,o]=qs("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=a((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,...Vo(n)}),globalThis.location.href=e}var t}),[]);return l((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},qo=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=i(""),{isLoading:g}=Lo(a),[f,x]=qs("leadForm"),y=Ys(m,f),{handleSubmit:b,responseStatus:v}=Ao({inputs:m,programId:n,nextStepLink:a,saveForm:x});if(v){Ps({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=zt(y,{onSubmit:b});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(Ts(e.columns),"grid gap-x-m"),children:[Is(e.title),Us({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),Ks(s)]})})})),jo=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(S,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),$o=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Uo=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Wo(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 Ho=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const i=s(null),a=r((()=>({threshold:Wo(t),root:n?.current})),[t,n?.current]);return l((()=>{if(!i.current)return;const t=new IntersectionObserver(e,a);return t.observe(i.current),()=>{t.disconnect()}}),[e,a]),i}(a((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===i),ref:h,role:"listitem",children:d})})),Yo=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Ko=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,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},y=s([]),b=a(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(Xo(n))}),[g,f]),v=l>0?r*Number(l)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Go(c,v):{},...N?Uo(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(Ho,{className:u(m,l?Yo[l-1]:"",{"h-full":N},t),style:w?Go(c/4):{},activeIndex:i,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(k):k(e,0))(p)});var k})),Go=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Xo=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Jo={"horizontal-list":"w-6","vertical-list":"h-6"},Zo=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,l)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",l===e?Jo[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(l)},String(l)),Qo=({activeIndex:e,onClick:t})=>(n,i)=>{const l=i===e,a=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(i),"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",a),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(i))},ec=e=>e,tc=(e=ec)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),nc=tc(),ic=(e=ec)=>tc((t=>-e(t))),lc=ic(),ac=e=>t=>e.scrollWidth/t,rc=e=>(t,n)=>{e.scrollBy({left:n*ac(e)(t),behavior:"smooth"})},sc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[l,r]=i([]),o=a((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=l.length?[ic()(l),tc()(l)]:[-1,-1],m=c>0,u=d<e-1,h=a((()=>{var t;n.current&&(m?rc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=a((()=>{n.current&&(u?rc(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=a(((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}]},oc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},cc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=sc({itemCount:s.length}),g=dc(Boolean(s?.length));l((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=a((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(Ko,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Qo({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",oc[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Zo({activeIndex:t,onClick:f,listType:i}))}):null})),dc=(e=!1)=>({behavior:e?"auto":"smooth"}),mc=d((({className:e,disabled:t,...n})=>o(be,{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"})}))),uc=d((e=>o(mc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),hc=d((e=>o(mc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),pc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",gc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:l})=>{const{canScrollLeft:a,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!l;return c("div",{className:e,children:[n?fc(t):null,a?o(uc,{className:u(xc(l),m?"left-1":"left-0"),onClick:s}):null,r?o(hc,{className:u(xc(l),m?"right-1":"right-0"),onClick:d}):null]})})),fc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(pc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(pc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),xc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),yc=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:l=1,listType:a="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=sc({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===a?"relative h-full":""),children:[o(Ko,{containerRef:b,activeIndex:N,visibleItemCount:l,gap:n,padding:i,listType:a,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(gc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(cc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:a,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),bc=({blocksToRender:e,...t})=>o(yc,{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",$o(!0)),children:B(e,t)},String(n))})}),vc=e=>e%2!=0,Nc=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:l="between",className:a,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===l?"justify-between":"justify-center",a),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),wc=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:l=!1,onClick:a})=>o(Nc,{tag:"button",onClick:a,disabled:l,"data-theme":i,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}))),Cc=({isUnfolded:e,onToggle:t})=>o(wc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),kc=["ArrowDownIcon","ArrowUpIcon"],Sc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Tc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...l})=>{const[a,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Sc),children:[R(a,{...l.options,parent:n}),vc(a.length)?o(gt,{className:"col-span-6",...l}):null]}),o(qa,{renderFoldableSection:({isUnfolded:e})=>c(ja,{className:u(Sc),isUnfolded:e,children:[R(r,{...l.options,parent:n}),vc(r.length)?o(gt,{className:"col-span-6",...l}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(wc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:kc[Number(n)],dataTheme:l.options?.page?.colorPalette,onClick:i})})]})},Ic=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Bc(n,t),Tc({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Bc(n,t),bc({...i,blocksToRender:t})]});default:return null}})),Bc=(e,t)=>e&&!t.length?o(jo,{...e}):null,Pc=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),Rc=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(ha,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const l=e?.includes(n);t(i?l?(e||[]).filter((e=>e!==n)):[...e||[],n]:l?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),Dc=d((({children:e,filtrationSchema:t,resetButton:n,field:i,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,Pc(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Mc(i)).filter(Boolean))]}),n?o("div",{children:o(Ur,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:l,children:n?.text})}):null]}))),Mc=e=>([t,n])=>{const i=n?.type;return"array"===i?Ac(t,e)(n):null},Ac=(e,t)=>n=>{const i=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(Rc,{items:i,multiple:!n?.single,...t(e)})]},e)};function Ec(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const _c=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,zc=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>_c(t[e])||_c(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>_c(t[e])||_c(n[e])||Fc(t[e])<=Fc(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>_c(t[e])||_c(n[e])||Fc(t[e]?.min)>=Fc(n[e]?.min)&&Fc(t[e]?.min)<=Fc(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>_c(t[e])||_c(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>_c(t[e])||_c(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Fc=e=>Number(e||0),Vc=(e,{block:t,page:n,normalize:i=_t})=>{const l=t?.blocks||[],[a,{field:s,reset:o,update:c}]=zt(e),d=r((()=>Ec(l,l.map((e=>mt(e.content,n?.fallback))))),[l,n?.fallback]),m=a===e?l:((e,t)=>(n=_t)=>e?.filter((([,e])=>zc(t,n(e)||{}))).map((([e])=>e)))(d,a)(i);return[a,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Oc={},Lc={},qc=ht((({className:e,filtrationSchema:t=Oc,consumerField:n={},resetButton:i,...l})=>{const[,{blocksToRender:a},{field:r,reset:s}]=Vc(Lc,{block:l.block,page:l.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:jc(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>jc(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Dc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Ur,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Ic,{blocksToRender:a,...l})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),jc=e=>Ec(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),$c=(e=!1)=>e?"text-left":"text-center",Uc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Wc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:l,...a})=>{const r=String(i?.width||t);return l?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Uc[n],e),children:o(W,{...a,width:"54%",height:"54%",name:l})}):null})),Hc=d((({className:e="",title:t,benefitList:n,...i})=>{const l=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(w,{headingType:"h3",as:"h2",className:$c(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(Yc)}):null]})})),Yc=({label:e,description:t,__html:n,icon:i,isDotted:l=!1,iconBgVersion:a},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(Wc,{className:"shrink-0",iconBgVersion:a,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{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)),Kc=(e,t,n)=>{return o(yc,{children:e.map((i=n,({icon:e,title:t,description:n},l)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Me,{size:"text-h6",font:"font-normal",align:i,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Me,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(l))))});var i},Gc=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:l,title:a,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(S,{defaultPadding:"",title:a,description:l,headlineVersion:"M"}),e?.length?Kc(e,0,t):null]}))),Xc={start:"justify-start",center:"justify-center",end:"justify-end"},Jc=d((({buttons:e,className:t="",align:n,...i})=>{const l=n&&u("flex",Xc[n]);return o(g,{className:u("!bg-transparent",l,t),defaultPadding:"p-0",...i,children:Le(e)})})),Zc=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Qc="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",ed="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",td="flex flex-col gap-y-xl min-w-52",nd=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:l})=>o(Me,{size:"text-h3",children:"number"==typeof e?[i,Ue(t,{fixed:n})(e),l].filter(Boolean).join(" "):e}))),id=d((({className:e,title:t,value:n,color:i="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:i,children:t}):null,n?o(nd,{value:n,...l}):o(Me,{size:"text-h3",children:"-"})]}))),ld=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,ad=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:l,isShowDepositeName:a,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(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),l&&a?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:l}):null]})]}))),rd=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(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),sd=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:l="text-secondary-text",children:a,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(ad,{title:e,rate:t,unit:n,fractionDigits:i,color:l,...r})}),o(id,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:l,...r}),a]}):o(rd,{title:e,...r}),od=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(ui,{items:e?[`От ${Ue(1)(i.min||0)} ${n}`,`До ${Ue(1)(i.max||0)} ${n}`]:[],step:t,...i}),cd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},dd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},md=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[l,a]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:l=cd.prefMonthsNum,prefTravelBonusRate:a=cd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(a*t)+Math.round(r*n),i);return[c,c*l+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-l)]})(t||dd,n,i);return{...t,...e,monthBonus:l,yearBonus:a}},ud=ht((({className:e="",title:t,calcSource:n,buttons:i,footnote:l,...a})=>{const[r,{field:s}]=zt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=md(r,n);return o(Zc,{className:e,title:t,...a,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),od({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?sd({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:td,children:[f>=0?o(id,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Le(i,{isVertical:!0}),ld(l)]})]})})})),hd=Math.round(29.5),pd=(e,t=0)=>e?.sum?e.sum:t,gd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,fd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,xd=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:l,onChange:a,...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:i,items:e,value:e[l?0:1].id,onChange:t=>a&&a(t===e[0].id),...r})]}),yd=e=>xd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),bd=" (c капитализацией)",vd=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:l=[],isCapitalization:a=!1})=>c("div",{className:td,children:[o(id,{title:`Доход в конце срока${a?bd:""}`,value:e,postfix:n,prefix:"+"}),o(id,{title:`Сумма в конце срока${a?bd:""}`,value:t,postfix:n}),Le(i,{isVertical:!0}),l?.map(ld)]}),Nd=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:wd([e,t],i),wd=([e,t],n=[])=>({[e]:n.length?lc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?nc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Cd=(e,[t,n],i)=>e>=i[t]&&e<=i[n],kd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Sd={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Td=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:l,isReplenished:a,isMonthlyInterestPayment:r}=e,s=a||l,o=n<90||n>730,c=function(e){const t=e?.rateType?kd[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&&Id(s,e)&&Cd(i,["minSum","maxSum"],e)&&Cd(n,["minDays","maxDays"],e)))||Sd,{rate:m}=d,u=Bd(m,e),h=i+u,p=c||[Sd];return{...d,...wd(["minSum","maxSum"],p),...wd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Id=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Bd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:l}=t;return n?Math.round(i*Math.pow((1200+e)/1200,l/30)-i):Math.round(i*e*l/365/100)},Pd=ht((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:l,isShowDepositeName:a,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=zt({moneyValue:pd(r,1e5),daysValue:gd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Td(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Zc,{className:e,title:t,...d,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(ui,{items:[`От ${fd(b.min||0)}`,`До ${fd(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Rd(p,h),yd({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),sd({rate:x,depositeName:y,isShowDepositeName:a}),vd({income:g,finalSum:f,buttons:n,footnotes:[i,l]})]})});var b})),Rd=(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})]})]}),Dd=(e=[],t=!1)=>Md([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),Md=(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]},Ad=({min:e=0,max:t=0,availableMonths:n,...i})=>o(ui,{items:[`От ${Ed(e)}`,`До ${Ed(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),Ed=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,_d=e=>xd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),zd=({field:e,defParams:t,calcParams:n,map:i,monthsValue:l="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(si(t?.[l],n.minMonths,n.maxMonths))},Fd=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:l,moneyExtra:a}=t;if(0===e)return 0;if(n){const t=e/1200;return a?(i+a)*(t+t/(Math.pow(1+t,l)-1)):i*(t+t/(Math.pow(1+t,l)-1))}return Math.round(i/l)+i*(e/1200)},Vd={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Od=e=>Ld({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ld({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Ld({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Ld({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ld=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:l})=>!!n&&!n[l]||t[i]===e[i],qd=(e,t,n)=>{const{moneyValue:i,monthsValue:l}=e,a=t?.rateRows||[Vd],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Od({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Nd(["minSum","maxSum"],r,a),{minMonths:c,maxMonths:d}=Nd(["minMonths","maxMonths"],r,a),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:l})=>e?.find((e=>Od({row:e,userInputParams:t,paramsViewSettings:n})&&Cd(i,["minSum","maxSum"],e)&&Cd(l,["minMonths","maxMonths"],e)))||Vd)({rateRows:a,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:l}),{rate:u}=m,h=Fd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:l,monthlyPayment:h}},jd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),$d={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Ud=ht((({className:e,title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,Md([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=zt({moneyValue:pd(s,2e5),monthsValue:gd(s,hd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const y=qd(g,n,r),b=_d({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return l((()=>{v&&v(si(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),l((()=>{N&&N(si(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),l((()=>{!jd(s)&&h&&zd({field:f,defParams:h,calcParams:y,map:$d,monthsValue:"minMonths"})}),[n,s]),o(Zc,{className:e,title:t,...m,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Ad({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Wd({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(td,"@4xl:w-1/2"),children:[o(id,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(id,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(id,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),Le(i,{isVertical:!0}),ld(a)]})]})})})),Wd=(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]}),Hd=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[l,a]=t[n];i>=l?t.splice(n-1,2,[e,Math.max(i,a)]):n++}return t},Yd={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Kd=(e,t,n)=>{const{moneyValue:i,monthsValue:l}=e,a=t?.[0]?Jd(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=>[Xd({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Xd({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Xd({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Xd({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Cd(i,["minSum","maxSum"],t),Cd(l||a,["minMonths","maxMonths"],t)].every(Boolean)))||Yd,{rate:u}=m,h=Gd(u,e),p=i+h,g=t||[Yd];return{...m,...wd(["minSum","maxSum"],g),...wd(["minMonths","maxMonths"],g),availableMonths:Hd(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,l)=>t>=e?e+l*n:e-l*n)))(e,t))),...e,defaultMonth:a,income:h,finalSum:p}},Gd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:l}=t;return n?Math.round(i*Math.pow((1200+e)/1200,l)-i):Math.round(i*e*30*l/365/100)},Xd=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Jd=(e,t)=>e+Math.round((t-e)/2),Zd=(e="rub")=>"rub"===e,Qd=(e,t)=>{const{minMonths:n,maxMonths:i}=wd(["minMonths","maxMonths"],im(t,e?.currency)),l=e.monthsValue||Math.round((n+i)/2);return{monthsValue:si(l,n,i)}},em=(e,t)=>{const{minSum:n,maxSum:i}=wd(["minSum","maxSum"],im(t,e?.currency)),l=e.moneyValue||n;return{moneyValue:si(l,n,i)}},tm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),nm=e=>{const t=Zd(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},im=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},lm=(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?xd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?xd({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),am(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?yd({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},xd({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),am(e.isShowNewClient),e.isShowNewClient?o(Qn,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},am=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,rm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},sm={text:"₽",key:"rub"},om=ht((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[sm],g=a((e=>t=>e?{...t,...nm(t),...em(t,e),...Qd(t,e),...tm(t,e)}:t)(h),[h]),[f,{field:x}]=zt({moneyValue:pd(d,2e4),monthsValue:gd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:sm},{normalize:g}),y=x?.("currency")?.value??sm,b=x?.("isNewClient")?.value,v=im(h,y),N=Kd(f,v,s),{rate:w,income:C,finalSum:k,type:S=""}=N,T=a((()=>{zd({field:x,defParams:Dd(v,b),calcParams:N,monthsValue:"minMonths",map:rm})}),[x,h]);l((()=>{!jd(d)&&v&&T()}),[d,h]);const I=w===Dd(v,b)?.rate;return o(Zc,{className:e,title:t,...m,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[c("div",{className:"flex gap-m",children:[od({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:cm(y?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),Ad({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),lm({...N,...s},x)]}),sd({rate:w,children:mm(T,I)}),vd({income:C,finalSum:k,buttons:[...i,dm(n?.buttons,S)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),cm=(e="")=>Zd(e)?1e3:100,dm=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},mm=(e,t=!1)=>t?null:o(Ur,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),um=e=>hm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&hm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),hm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:l})=>!!n&&!n[l]||t[i]===e[i],pm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},gm=(e,t,n)=>{const{moneyValue:i,monthsValue:l,oldMonthlyPayment:a,moneyExtra:r}=e,s=t?.rateRows||[pm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>um({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Nd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Nd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:l,oldMonthlyPayment:a,moneyExtra:r})=>e?.find((e=>um({row:e,userInputParams:t,paramsViewSettings:n})&&Cd(i+r,["minSum","maxSum"],e)&&Cd(a,["minSumOld","maxSumOld"],e)&&Cd(r,["minSumExtra","maxSumExtra"],e)&&Cd(l,["minMonths","maxMonths"],e)))||pm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:l,oldMonthlyPayment:a,moneyExtra:r}),{rate:p}=h,g=Fd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:l,oldMonthlyPayment:a,moneyExtra:r,monthlyPayment:g,benefit:f}},fm=ht((({className:e="",title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:a,...r})=>{const[s,{field:d}]=zt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=gm(s,n,a),h=_d({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Zc,{className:e,title:t,...r,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),od({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Ad({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),xm({...m,...a},d),m.isExtraMoney?od({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(td,"@4xl:w-1/2"),children:[o(id,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(id,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(id,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(id,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Le(i,{isVertical:!0}),ld(l)]})]})})})),xm=(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})]}),ym=d((e=>{const{onChange:t,min:n,max:i,defaultValue:l="0",fractionDigits:r=0,...s}=e,c=ri(e,{normalize:(e=l)=>n&&i?String(si(Number(bm(e)),n,i)):bm(e),format:Ue(r)}),d=a((e=>t&&t(bm(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),bm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),vm=d((e=>o(ym,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),Nm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},wm={amount:1500},Cm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:a,formType:r="private",...s})=>{const[{amount:d},{field:m}]=zt(wm),[h,p]=i(!1);return l((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Nm[r],children:[o(vm,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),a?.text?o(Ur,{className:"w-full mt-lg",type:"submit",disabled:h,children:a.text}):null]})]})})),km=({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(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Sm="relative h-full",Tm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Im=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:l}=i.block||{},a=l?.some(Rm),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,l)=>c("div",{className:Bm(n,{someCardsHighlighted:a}),children:[B(n,i,{className:Pm(n,{someCardsHighlighted:a,showBorder:!e,cardSize:t}),...r,blockIndex:l}),Rm(n)?km({className:"absolute top-0 -right-4 z-40"}):null]},String(l))})},Bm=(e,{someCardsHighlighted:t})=>u(Sm,t&&(Rm(e)?"pt-3xl":"pt-3xl sm:pt-16")),Pm=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(Sm,"min-w-80",Tm[i],t&&(Rm(e)?"pt-3xl sm:pt-16":"pt-3xl"),$o(n),n&&"h-full"),Rm=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Dm=ht((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:i=!0,isGap:l=!0,cardSize:a="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(yc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:l?16:0,padding:0,arrowsPadded:i,navButtons:r?Mm(s?.block?.blocks):[],hasBlur:!0,children:Im({noCardBorder:n,cardSize:a,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Mm=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Am="z-10 border border-solid w-full h-full",Em=u(Am,"absolute hidden @xl:block border-transparent"),_m=d((({className:e,title:t,description:n,button:i,...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(Em,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Em,"top-6 right-8 bg-green")}),o("div",{className:u(Em,"top-3 right-4 bg-green-light")}),c("div",{className:u(Am,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(S,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),Le([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),zm={black:"bg-black",white:"bg-white"},Fm=d((({className:e="",title:t,description:n,image:i,price:l,button:a,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(S,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:Le([a],{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(Vm)]}):null,l?c(Me,{size:"text-h3",align:"text-left",children:[l," ₽"]}):null]})}))),Vm=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${zm[e]}`},String(t)),Om=d((({icon:e,...t})=>{const n=ue(),{text:i,href:l,target:a,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:l,target:a,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:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),Lm=d((({className:e,additionalDescription:t,description:n,links:i,title:l,...a})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...a,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(S,{isEmbedded:!0,title:l,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(S,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?qm(i):null]})}))),qm=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(Om,{...e},String(t))))}),jm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),$m=d((({className:e="",href:t,target:n,onClick:i,data:l,children:a})=>{const r=ue()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(l),children:a})})),Um=[{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"}}],Wm=d((({className:e="",media:t,showButtonText:n,stretched:l,version:a="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:l}=e,{iconMapped:r}=(e=>Um.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Oe(i)?i: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??a}})),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},Hm(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:Ym(s??!1,l??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Hm=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Ym=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Km=d((({className:e,padding:t,description:n,additionalDescription:i,href:l,icon:a,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o($m,{href:l,target:m,className:"h-full",data:jm(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(S,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Oe(a)?o(ne,{image:a}):null,x),buttons:d.length?o(Wm,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Ve,{benefits:f}),s?o(Re,{__html:s,isDotted:r,itemSize:"list-s"}):null,Gm(i,p)]})})}))),Gm=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,Xm=(e,t)=>{const{title:n,description:i,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,i?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:i})}):null,l?.length?o("div",{className:"text-primary-main",children:Le(l)}):null]},String(t))},Jm=d((({className:e="",title:t,align:n="text-center",icon:a,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(Xm),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!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(a)?o("div",{className:"self-center",children:o(ne,{image:a})}):null,t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(be,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(qa,{renderFoldableSection:()=>c("div",{children:[x,o(ja,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Zm(m?.parent,h,b):null}):o("div",{children:x})]})})),Zm=(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"})]}),Qm=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]})]}))),eu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=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(Qm,{step:i,showPercentage:!1})]})})}));var tu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(tu||(tu={}));const nu=e=>cl("/user-data/getTaskStatus","POST",e),iu=e=>cl("/user-data/sendSignalToProcess","POST",e),lu=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>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}),i?.text?o(be,{className:"text-primary-main",children:i.text}):null]})]}))),au=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:l})=>{const[a,r]=i(e),s=100-(e-a)/e*100;return c("div",{children:[n?o(S,{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(ro,{interval:e,time:a,setTime:e=>{0===e&&t(),r(e)}})})]}),l?o(Re,{__html:l}):null]})]})})),ru=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:l,sectionAdditionalTitle:a,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(au,{interval:d}):null]}),o(su,{title:i,items:l}),o(su,{title:a,items:r,countColumns:!0}),n?.__html?o(lu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(be,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),su=({title:e,items:t,countColumns:n=!1})=>{const i=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",Ts(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:ou(e)},t)))}):null]})]}):null},ou=({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})]}),cu=d((()=>o(ru,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),du=d((()=>{const[e]=qs("leadForm");return o(ru,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:e?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),mu=d((()=>{const[e]=qs("leadForm");return o(ru,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),uu=d((()=>{const[e]=qs("leadForm");return o(ru,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),hu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],pu=d((()=>{const[e,t]=i(tu.process),[n]=qs("taskId");return l((()=>{for(const e of hu)iu({signalType:e,taskId:n});const e=setInterval((()=>nu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==tu.process&&(clearInterval(e),t(n.statusCd))}))),3e4)}),[]),gu(e)})),gu=e=>({IN_PROCESS:o(du,{}),CANCELLED:o(cu,{}),APPROVED:o(uu,{}),REVISION:o(mu,{})}[e]||null),fu=[{paymentSystem:wa[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}],xu=e=>{if(e)try{return new Date(e)}catch(e){return}},yu=e=>(t,n)=>t.filter((e=>e)).map((t=>[bu(n,e),vu(t,e),Nu(t,e),wu(t,e),Cu(t,e),ku(t,e)].some(Boolean)?{...t,required:!1}:t)),bu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,vu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Nu=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),wu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Cu=({name:e},t)=>"addressFact"===e&&t("addressMatch"),ku=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Su=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(lu,{__html:e},`${t}_${n}`))):null},Tu=({field:e,inputs:t})=>t.map(Ss(e,"")),Iu=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:l},a)=>{const r=yu(Bu(t))(e,n),s=r.filter((e=>!ku(e,Bu(t))));return c("div",{className:u(Ts(i),"grid gap-x-m"),children:[Su(s),Is(l),Tu({field:t,inputs:r})]},`section-${a}`)})),Bu=e=>t=>e(t)?.value,Pu=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between gap-m",children:[o(Ur,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Ur,{className:"w-full @xl:w-auto",type:"submit",children:"Далее"})]})})),Ru=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:l}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:i,codeWord:l}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:l="",phone:a="",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:y}=e;return{birthDate:xt(l,!0),midname:i,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:Ro({phone:yt(a),email:r}),participantAddresses:Do({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:l,organization:a,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:i,organizationActivityTypeCd:s,organizationTypeCd:a,organizationKindCd:o,employeesNumberCd:r,opf:l,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Ro({organizationPhone:h&&yt(h)}),participantAddresses:Do({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,mandatoryIncome:l,otherPayments:a,snils:r,armyIdFlg:s}=e;return{maritalStatusCd:t,totalDependents:i,otherDependents:n,participantIncomes:Mo({mandatoryIncome:l,otherPayments:a}),snils:r?.replaceAll(" ",""),armyIdFlg:s}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:l}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:l}})(t);default:return{}}},Du=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:l})=>{const[r]=qs("taskId"),[s]=qs("profileId"),[o]=qs("participantId"),c=a((async a=>{const c=Rs(Dn(yu(Mu(a))(t,e)));if(console.log(Dn(yu(Mu(a))(t,e))),!pn(c(a)))return console.warn("validation fail");i(a);try{r&&s&&o&&await Xs((({participantId:e,taskId:t,profileId:n,formData:i,step:l=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Ru(l,i)}]}}))({participantId:o,taskId:r,profileId:s,step:e,formData:a}))}catch(e){return"Fail"}return n(),5===e&&l?.(!0),"OK"}),[]);return{handleSubmit:c}},Mu=e=>t=>e[t],Au=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:l,finishForm:r})=>{const[d,m]=qs("leadForm"),u=((e,t)=>({...fu[e],...t,birthday:xu(t?.birthday),dulIssueDateField:xu(t?.dulIssueDateField),participantDateRegistration:xu(t?.participantDateRegistration),beginDate:xu(t?.beginDate),deliveryDate:xu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=a((e=>{h.current=e}),[]),{handleSubmit:f}=Du({step:e,inputs:p,onNextStep:i,saveStep:m,finishForm:r}),[,{field:x,onSubmit:y}]=zt(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return l?o(pu,{}):c("form",{onSubmit:y,className:"space-y-m",children:[Iu({sections:t,field:x,step:e,registerSubmit:g}),o(Pu,{step:e,onPrevStep:n})]})})),Eu=[[{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"]}}]}]],_u=["Параметры карты","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Выбор способа получения"],zu=d((({className:e,...t})=>{const[n,l]=i(0),s=a((()=>{l((e=>Math.min(e+1,6)))}),[]),d=a((()=>{l((e=>Math.max(e-1,0)))}),[]),m=r((()=>Eu[n]),[n]),[h,p]=i(!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(eu,{stepsTitles:_u,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Au,{step:n,sections:m,onNextStep:s,onPrevStep:d,isFormFinished:h,finishForm:p},String(n))})]})})})),Fu=()=>{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 i=async()=>{const n=await cl("/auth/refresh","POST",{refresh_token:e,access_token:t});n instanceof Response?Vu(n.status):(globalThis.sessionStorage.setItem("refreshToken",n.refresh_token),globalThis.sessionStorage.setItem("accessToken",n.access_token))};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},Vu=e=>{401==e&&(globalThis.location.href="/")},Ou=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=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(Qm,{step:i,showPercentage:!1})]})})})),Lu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:l,sectionAdditionalTitle:a,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(S,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(au,{interval:d,intervalExpireAction:m}):null]}),o(qu,{title:i,items:l}),o(qu,{title:a,items:r,countColumns:!0}),n?.__html?o(lu,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(be,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),qu=({title:e,items:t,countColumns:n=!1})=>{const i=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",Ts(n||i?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})]}),$u=d((()=>o(Lu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Uu=d((({handleExpireTimer:e})=>{const[t]=qs("leadForm");return o(Lu,{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?"Аннуитетный":"Дифференцированный"}]})})),Wu=d((()=>{const[e]=qs("leadForm");return o(Lu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Hu=d((()=>{const[e]=qs("leadForm");return o(Lu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Yu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Ku=d((()=>{const[e,t]=i(tu.process),[n]=qs("taskId");l((()=>{for(const e of Yu)iu({signalType:e,taskId:n});const e=setInterval((()=>n&&nu({taskId:n}).then((n=>{n.statusCd&&n.statusCd!==tu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return Gu(e,(()=>t(tu.rework)))})),Gu=(e,t)=>({IN_PROCESS:o(Uu,{handleExpireTimer:t}),CANCELLED:o($u,{}),APPROVED:o(Hu,{}),REVISION:o(Wu,{})}[e]||null),Xu=[{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}],Ju=e=>{if(e)try{return new Date(e)}catch(e){return}},Zu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Qu(n,e),eh(t,e),th(t,e),nh(t,e),ih(t,e),lh(t,e)].some(Boolean)?{...t,required:!1}:t)),Qu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,eh=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,th=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),nh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,ih=({name:e},t)=>"addressFact"===e&&t("addressMatch"),lh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),ah=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(lu,{__html:e},`${t}_${n}`))):null},rh=({field:e,inputs:t})=>t.map(Ss(e,"")),sh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:l},a)=>{const r=Zu(oh(t))(e,n);return c("div",{className:u(Ts(i),"grid gap-x-m"),children:[ah(r),Is(l),rh({field:t,inputs:r})]},`section-${a}`)})),oh=e=>t=>e(t)?.value,ch=d((({step:e,onPrevStep:t})=>{const n=0===e;return c("div",{className:"flex justify-between",children:[o(Ur,{onClick:t,className:u("w-full @xl:w-auto"),type:"button",version:"secondary",disabled:n,children:"Назад"}),o(Ur,{className:u("w-full @xl:w-auto"),type:"submit",children:"Далее"})]})})),dh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},mh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:dh[i?"annuity":"differential"]}},uh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:l="",phone:a="",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:y}=e;return{birthDate:xt(l,!0),midname:i,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:Ro({phone:yt(a),email:r}),participantAddresses:Do({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:l,organization:a,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:i,organizationActivityTypeCd:s,organizationTypeCd:a,organizationKindCd:o,employeesNumberCd:r,opf:l,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Ro({organizationPhone:h&&yt(h)}),participantAddresses:Do({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,confirmationIncome:l,mandatoryIncome:a,otherPayments:r,snils:s,armyIdFlg:o}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:l,otherDependents:n,participantIncomes:Mo({mandatoryIncome:a,otherPayments:r}),snils:s?.replaceAll(" ",""),armyIdFlg:o}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:l}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:l}})(t)}},hh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:l})=>{const[r]=qs("taskId"),[s]=qs("profileId"),[o]=qs("participantId"),c=a((async a=>{const c=Rs(Dn(Zu(ph(a))(t,e)));if(!pn(c(a)))return console.warn("validation fail");i(a);try{r&&s&&o&&await Xs((({participantId:e,taskId:t,profileId:n,formData:i,step:l=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...uh(l,i)}],...mh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:a}))}catch(e){return"Fail"}return n(),5===e&&l?.(!0),"OK"}),[]);return{handleSubmit:c}},ph=e=>t=>e[t],gh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,renderStep:l=sh,isFormFinished:r,finishForm:d})=>{const[m,u]=qs("leadForm"),h=((e,t)=>({...Xu[e],...t,birthday:Ju(t?.birthday),dulIssueDateField:Ju(t?.dulIssueDateField),participantDateRegistration:Ju(t?.participantDateRegistration),beginDate:Ju(t?.beginDate),deliveryDate:Ju(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=a((e=>{p.current=e}),[]),{handleSubmit:x}=hh({step:e,inputs:g,onNextStep:i,saveStep:u,finishForm:d}),[,{field:y,onSubmit:b}]=zt(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(Ku,{}):c("form",{onSubmit:b,className:"space-y-m",children:[l({sections:t,field:y,step:e,registerSubmit:f}),o(ch,{step:e,onPrevStep:n})]})})),fh=[[],[{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"}]}]],xh=["","Персональные данные","Данные о трудоустройстве","Данные о доходах и расходах","Дополнительные сведения","Отделение Банка"],yh=d((({className:e,...t})=>{const[n,s]=i(0);l(Fu,[]);const d=a((()=>{s((e=>Math.min(e+1,5)))}),[]),m=a((()=>{s((e=>Math.max(e-1,0)))}),[]),h=r((()=>fh[n]),[n]),p=0===n,[f,x]=i(!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(Ou,{stepsTitles:xh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(gh,{step:n,sections:h,onNextStep:d,onPrevStep:m,isFormFinished:f,finishForm:x,renderStep:p?({registerSubmit:e,field:t})=>o(Ud,{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))})]})})})),bh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,vh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Nh=1e9,wh={sum:{min:1e4,max:Nh},period:3},Ch=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:l,...a})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Vc(wh,{block:a.block,page:a.options?.page,normalize:e=>({...e,period:kh(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Sh(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Dc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(vm,{label:i?.title,min:500,max:Nh,...d("sum",{parse:e=>({min:Number(e),max:Nh}),format:({min:e})=>String(e)})}),o(ui,{title:l?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Ic,{blocksToRender:r,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),kh=e=>ot((e?.paramsSource?.rateRows||[]).filter(bh).flatMap((e=>vh(e.minMonths,e.maxMonths)))),Sh=e=>ot(e.flatMap((e=>e||[])).filter(bh).flatMap((e=>vh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Th=[{key:"10"},{key:"50"},{key:"100"}],Ih=({itemCount:e,onItemCountChange:t})=>{const n=a((({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:Th,iconVersion:"black"})]})},Bh="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",Ph=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:l}=e,a=t+1;return a===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:a},String(t)):1!==a&&a!==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))(a,n,l)?o("div",{onClick:()=>i(a),className:Bh,"aria-label":`Страница ${a}`,children:a},String(t)):null},Rh={width:"24",height:"24"},Dh=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),l=a((()=>{e>1&&t(e-1)}),[e]),s=a((()=>{e<n&&t(e+1)}),[e,n]),d=a((()=>t(1)),[]),m=a((()=>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:Mh(1===e),...Rh})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Bh,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(Ph),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Bh,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Mh(e===n),...Rh})})]})},Mh=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Ah=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,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(Dh,{currentPage:e,onPageChange:t,totalPages:n}),i&&l?o(Ih,{itemCount:i,onItemCountChange:l}):null]}),Eh=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:l,placeholder:r="Поиск по сайту"})=>{const s=a((e=>{i&&i(e.target?.value||"")}),[i]);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(Eh,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ki,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ki,{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(Ur,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),zh=(e,t)=>o(Wc,{...e,iconBgVersion:t,className:"shrink-0"}),Fh=({title:e,timestamp:t,publicId:n})=>{const i=ue(),{href:l}=i({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:[zh({icon:"DocDownloadIcon",iconVersion:"black"}),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)},Vh="/api/v1/depository",Oh={startDate:void 0,endDate:void 0,query:""},Lh=ht((({className:e,...t})=>{const[n,l]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=zt(Oh),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:l})=>{const a=i?xt(i,!0):"",r=l?xt(l,!0):"",s=new URLSearchParams(Vh);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",a),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=qn(Vh+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=a((e=>l(e-1)),[]),y=a((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(Fh,{...e},String(e.publicId)))):o(jo,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Ah,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),qh=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:i,button:l,...a})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...a,children:[o("div",{className:"flex justify-center",children:qh(i)}),o(S,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),l?.text?o(be,{version:l?.version,text:l?.text,...l}):null]}))),$h="location";function Uh(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=i(n||null);return l((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,a((n=>e.fire(t,n)),[e,t])]})(ce,"location",Hh()??{name:e}),r=a((e=>{Yh(e),n(e)}),[]),{data:s}=qn(Wh()?null:"/api/v1/region",st);return l((()=>{s&&!Wh()&&n(s)}),[s]),[t??{name:e},r]}const Wh=()=>Boolean(globalThis.localStorage?.getItem($h)),Hh=()=>{try{const e=globalThis.localStorage?.getItem($h);return e&&JSON.parse(e)}catch(e){return null}},Yh=e=>{try{globalThis.localStorage?.setItem($h,JSON.stringify(e))}catch(e){}};var Kh;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Kh||(Kh={}));const Gh=new Intl.NumberFormat("ru",{style:"currency",currency:Kh.RUB}),Xh=e=>e?Gh.format(e):"",Jh="text-m font-light text-secondary-text ",Zh=`${Jh} text-left`,Qh=`${Jh} pl-5xl text-center`,ep=`${Jh} pl-5xl text-right`,tp={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},np=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Zh,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:Qh,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:ep,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(ip)})]}))),ip=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:tp[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:Xh(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:Xh(e?.buyExchangeRate)})})]},t)},lp={icon:"GpsIcon"},ap=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Wc,{...lp,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),rp=(e,t,n)=>{const i=Number(sp(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},sp=e=>e.replace(/[^\d.,]/g,"").replace(",","."),op=e=>Pt([[e=>e.value!==Kh.RUB&&e.oppositeValue!==Kh.RUB,()=>e.handleConvert(e.value,Kh.RUB)],[e=>e.value===Kh.RUB&&e.oppositeValue===Kh.RUB,()=>e.handleConvert(e.value,Kh.USD)],[e=>e.value===Kh.RUB&&e.oppositeValue===Kh.RUB,()=>e.handleConvert(e.value,Kh.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function cp(e){const{placeholder:t,rates:n,selected:i,value:l,setValue:a,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};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:a}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const dp=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:l})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Kh.RUB,selectBuy:n?.[0]?.currency?.currency||Kh.USD}),d=a((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:[cp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:mp(r,d,n),value:r.inputSell,setValue:e=>hp(d,n)(e,r.selectSell,r.selectBuy)}),cp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:up(r,d,t),value:r.inputBuy,setValue:e=>pp(d,t)(e,r.selectBuy,r.selectSell)})]}):null,l?.text?o(be,{text:l.text,version:l?.version,...l}):null]})})),mp=(e,t,n)=>i=>{t({selectSell:i}),op({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,l=e.selectBuy)=>{hp(t,n)(e.inputSell,i,l)}})},up=(e,t,n)=>i=>{t({selectBuy:i}),op({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,l=e.selectSell)=>pp(t,n)(e.inputBuy,i,l)})},hp=(e,t)=>(n,i,l)=>{e({inputSell:sp(n),selectBuy:l});const a=t.find((e=>e.currency?.currency===l))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;a&&e({inputBuy:String(rp(n,a,i===Kh.RUB)||"")})},pp=(e,t)=>(n,i,l)=>{e({inputBuy:sp(n),selectSell:l});const a=t.find((e=>e.currency?.currency===l))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;a&&e({inputSell:String(rp(n,a,i===Kh.RUB)||"")})};const gp=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const[l]=Uh(),a=function(e){const t=e?.code||"000",{data:n}=qn(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(l),r=fp(a?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:Kh.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:Kh.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Te,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[r?o(np,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(ap,{address:a?.address})]}),o(dp,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),fp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],xp=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(yp(n))})})),yp=e=>({dataFooter:t,...n},i)=>{const{text:l,href:a,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:a,target:r||"_self",onClick:s,...pe(t),children:l||null})},String(i)):null},bp=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:l})=>o(Nc,{tag:"button",className:u("border-none bg-transparent items-center group/button",l?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[zh(l,t),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}))),vp=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Np=(e=!1)=>e?"MinusIcon":"PlusIcon",wp=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",Cp=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:l,labelIconBgVersion:a,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(qa,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ja,{className:u("gap-lg",vp(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>kp({foldButtonVersion:r,label:i,labelIcon:l,labelIconBgVersion:a,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),kp=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:l,onToggle:a,isMobile:r=!1})=>{const s=t||(l?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?wp(e):Np(e))(l,r);return"accordion"===e?o(bp,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:a}):o(wc,{label:s,icon:l?"ArrowUpIcon":"ArrowDownIcon",onClick:a})},Sp=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Tp(e)}))),Tp=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(Cp,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(xp,{items:e.items}):null},String(t)))),Ip=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Bp)}):null)),Bp=(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(Pp)})]},String(t)),Pp=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Rp(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Rp=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Dp(t)}`,children:o(Me,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Dp=e=>e.replaceAll(/\D/g,""),Mp=d((({className:e="",index:t,text:n,...i})=>{const l=ue(),{href:a,target:r,onClick:s}=l(i);return o("a",{className:u("text-secondary-text",e),href:a,target:r,onClick:s,children:n||`Документ ${t}`})})),Ap=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(Mp,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Ep=d((({className:e="",index:t,...n})=>{const i=ue(),{href:l,target:a,text:r,onClick:s}=i(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:a,onClick:s,children:r||`Документ ${t}`})})),_p=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(Ep,{index:t,...e},String(t))))}):null]}))),zp=ht((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{};n.options?.page?.common;const{documents:l,relatedEnterprises:a,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Sp,{navigationItems:i}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Ip,{items:r}),m?o(be,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(Wm,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(be,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Ap,{title:d,links:a}),o(_p,{links:l,license:h})]})})),Fp=ht((({className:e,title:t,button:n,regionSource:l,data:a,...r})=>{const[s,d]=i({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(w,{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(be,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:jm(a,s?.key),children:f})}):null]})})})),Vp={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"},Op=d((({version:e,text:t,mobileText:n,...i})=>{const l=Ce()?n:t;return l?o(be,{className:u("py-s px-lg font-light whitespace-nowrap",Vp["transparent"===e?"transparent":"default"]),...i,children:l}):null})),Lp=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:i,version:l,backwardButton:r})=>{const s=M(),d="/"===s.pathname,{dataFooter:m,dataHeader:u,...h}=t??{},p=a((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(no,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):qp(p,r),o(Op,{version:l,...i})]})})),qp=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(W,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,jp={"bg-white":"primary",transparent:"transparent"},$p=ht((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=jp[e],portal:i,logo:l={},...a})=>{const{backwardButton:r,logo:s={}}=a.options?.page?.common??{},{internetBankButton:c}=i||{},d=l.image?.icon||l.image?.src?l:s;return o(g,{tag:"header",defaultPadding:"",version:n,...a,children:o("div",{className:"container px-lg py-2xs box-border",children:o(Lp,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...a})})})})),Up=(e=!1)=>e?{}:{padding:"p-0"},Wp={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Hp=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:l="transparent",isTheme:a=!1,isCardBorder:r=!1,image:s,...c})=>{const d=M();return o(g,{className:u("relative flex flex-col",Wp[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:l,isTheme:a,...c,children:D({...c,extraProps:{className:u("w-full",$o(r)),...Up(i)}})})}),{childrenTypes:[]}),Yp=ht((e=>o(Hp,{...e})),{childrenTypes:[]}),Kp=d((e=>{const{className:t,align:n,image:i,...l}=e,a=n?u("flex",Xc[n]):"";return o(g,{className:u(a,t),defaultPadding:"p-0",...l,children:o(ne,{image:i})})})),Gp=["байт","Кб","Мб","Гб","Тб","Пб"],Xp=d((({icon:e,text:t,href:n,target:i,fileFormat:l,data:a,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:i,...pe(a),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",Jp(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Jp=(e,t)=>e||t?o("span",{children:", "}):"",Zp=(e,t)=>(n,i)=>{const l=$(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),a="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))} ${Gp[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?eg(l):n?.fileFormat;return c("div",{role:"listitem",children:[o(Xp,{text:n?.text,target:n?.target,href:l,fileFormat:r,fileSize:a,icon:Qp(t),data:n?.data}),o(Re,{__html:n?.__html})]},String(i))},Qp=e=>e?o(ne,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,eg=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},tg=d((({href:e,__html:t,target:n})=>{const{close:i}=de(),l=M(),r=$(l)(e),s=a((()=>{i()}),[]);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(be,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Ur,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),ng=d((({text:e,href:t,target:n,__html:i,icon:l})=>{if(!e&&!i)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(tg,{...e}),n),close:n}})({__html:i,href:t,target:n}),s=a((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Qp(l),o(Me,{font:"font-light",children:e})]})})),ig={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},lg=ht((({className:e="",title:t,description:n,align:i="text-center",documents:l,icon:a={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=M();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(S,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),l?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",ig[r]),role:"list",children:l.map(ag(d,a))}):null]})})),ag=(e,t)=>(n,i)=>{const l=n?.docType;return""===l?null:"reportSource"in n&&n?.reportSource?.__html?rg(t)(n,i):Zp(e,t)(n,i)},rg=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(ng,{...i,icon:e,href:sg(t)?t?.href:t?.attachment?.src}),o(Re,{__html:t?.__html})]},String(n)):null},sg=e=>"href"in e,og=ht((({className:e,padding:t,align:n="text-left",buttons:i=[],description:l,image:a,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=a?.src?o(ne,{className:"hidden lg:block",image:a}):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(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:Le(i,{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,a?.src?o(ne,{className:"lg:hidden",image:a}):null]})]})})})),cg=(e=[],t={})=>e.filter((({content:e={}})=>zc(t,e))).length,dg=(e,t)=>e===t;const mg=(ug=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(dg,((e=dg)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>ug(n,t[e])))));var ug;const hg=[],pg={},gg={primary:"bg-white/30",secondary:"bg-main-divider"},fg={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},xg=d((({count:e,version:t="secondary"})=>{const n=Ce(),i=n?"bg-main-divider":gg[t],l=fg[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:l,children:e})})})),yg=({text:e,description:t,icon:n,isActive:i,type:l})=>{const a=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text: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"}))(i);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",a.icon),image:{...n,iconVersion:n?.iconVersion??a.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===l?a.text:a.oldText,children:e}),o("div",{className:"animated"===l?a.desc:a.oldDesc,children:t})]})]})},bg={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},vg={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Ng={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},wg={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Cg=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:l})=>{const a=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(a,{className:u("h-12","block flex-1","cursor-pointer",bg[i],n?wg[i]:Ng[i]),role:"tablist","aria-label":"Список табов",onClick:l,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?vg[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[yg({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(xg,{count:m,version:Wr(n,i)})}):null]})})})),kg=d((e=>o(e?.item?.href?Sg:Tg,{...e}))),Sg=d((e=>{const t=ue(),n=a((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...l}=t({...e.item,onClick:n});return o(Cg,{...e,tag:"a",item:l,onClick:i})})),Tg=d((({item:e={},onClick:t,...n})=>{const i=a((()=>{t&&t(e)}),[t,e]);return o(Cg,{item:e,onClick:i,...n})})),Ig=(e,t,n)=>(i,l)=>o(kg,{isActive:i===e,onClick:t,type:n,item:i},String(l)),Bg=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:l})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Ig(i,l,t))}))),Pg={categories:[],extraOptions:[],propertyType:[],stage:[]},Rg=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...l})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Vc(Pg,{block:l.block,page:l.options?.page}),f=a(((e=Pg)=>p(e)),[]),x=(({hotFilters:e=hg,filtrationState:t=pg,blocks:n=hg,onFiltrationStateChange:i})=>{const l=r((()=>Math.max(0,e.findIndex((e=>mg(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:cg(n,t.filter),version:Wr(t===e[l])})))),[e,n,l]),o=a((t=>{i(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(Bg,{...x}),o(Dc,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Ic,{blocksToRender:d,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Dg=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:l,atmCode:a="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:Eg(i)},{label:"Модуль приема наличных",value:l?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:a}];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:Eg(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:Eg(s)})})]}),o("div",{className:"hidden sm:block",children:o(Ya,{className:"flex-wrap",children:m?.map(Ag)})}),o(qa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ja,{isUnfolded:e,children:o(Ya,{className:"flex-wrap",children:m?.map(Ag)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(d))},Mg=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${Eg(t)} №${n}`,body:e.toUpperCase()}),Ag=(e,t)=>o($a,{...e},String(t)),Eg=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",_g=[];const zg=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:_g},Fg={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Vg={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)},Og=d((({descriptionData:e,className:t})=>{const[n]=Uh(),i=n?.code??"000",{data:l,isLoad:a}=function(e){const{data:t,error:n}=qn(`/api/v1/atms?regionCode=${e}`,zg);return{data:t||_g,isLoad:!t&&!n}}(i);return o(ts,{className:t,filterItems:Lg,data:l,isLoad:a,initFilterState:Fg,renderCard:Dg,getBalloon:Mg,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),Lg=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),l=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=l.every((t=>Vg[t](e))),n=!i.length||i.some((t=>Vg[t](e)));return t&&n}))},qg=({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:jg({workScheduleDescription:t})}),o(qa,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ja,{isUnfolded:e,children:jg({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>mr({isUnfolded:e,onToggle:t})})]},String(n)):null,jg=({workScheduleDescription:e})=>c("div",{children:[c(Ya,{className:"flex",children:[o($a,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o($a,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o($a,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o($a,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o($a,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),$g=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Ug={branches:[],remoteWorkplaces:[]};const Wg=async e=>await rt(e,{method:"GET"})||Ug,Hg=d((({className:e})=>{const[t]=Uh(),n=t?.code??"000",{data:i,isLoad:l}=function(e="000"){const{data:t,error:n}=qn(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Wg);return{data:t||Ug,isLoad:!t&&!n}}(n);return o(ts,{className:e,data:i?.branches,isLoad:l,remoteWorkplaces:i?.remoteWorkplaces,renderCard:gr,renderRemoteWorkplaceCard:qg,getBalloon:xr,getBalloonRemoteWorkplaces:$g,title:`Офисы филиала ${t?.name}`})})),Yg=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Hg,{}):o(Og,{descriptionData:e})})})),Kg=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(S,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Gg=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o(yc,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Xe,{className:"px-5 h-full",headlineVersion:"L",...e,...i})},String(t))))})}))),Xg=d((({address:e,email:t,telephone:n,button:i,className:l="",__html:a,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(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[a?Jg({__html:a,richVersion:r}):null,Zg({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Zg({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Zg({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?Le([i]):null]})]}))),Jg=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Re,{...e,itemSize:"list-s"})}),Zg=({label:e,data:t,iconName:n,dataColor:i=""})=>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:i,children:t})]})]}):null,Qg=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Re,{__html:t,richVersion:n})})})),ef=d((({name:e,text:t,value:n,checked:i,onChange:l,className:a})=>o("div",{className:a,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:i,onChange:e=>l?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),tf=d((({className:e=""})=>{const[t,n]=i("option2"),l=a((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(ef,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:l}),o(ef,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:l})]})})),nf=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:l="",setSelected:a,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(cn,{options:s,label:r,placeholder:l||i,onChange:e=>a(e.key),value:c})})),lf=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:l,onSelectedBranch:a})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(nf,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(nf,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:l,setSelected:a,label:"Отделение",placeholder:"Выберите отделение"})})]}))),af=["От 1 дня","До 365 дней"],rf=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(ui,{min:1,max:365,value:e,items:af,onChange:t})]}))),sf=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:l,onSelectedBoxSize:a})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(nf,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(nf,{data:i,fieldLabel:"safeBoxCasesSize",selected:l,setSelected:a,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),of=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:l,selectedCaseVolume:a,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(lf,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:cf(m)}),o(rf,{days:l,setDays:e=>m({days:e})}),o(sf,{caseVolumes:d,selectedCaseVolume:a,onSelectedCaseVolume:df(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(tf,{}),o(be,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),cf=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},df=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},mf=d((({days:e,tariffs:t=[]})=>{const n=hf(e,t),i="На рисунке изображена пачка листов\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:[uf("Аренда за",e),uf("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),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(C,{size:"text-s",font:"font-light",color:"text-white",children:i})})]})]})})),uf=(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})]}),hf=(e,t)=>{const n=pf(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},pf=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},gf=(e,t)=>e.find((e=>e.branchCode===t)),ff=d((e=>{const{regions:t,data:n,branches:i,onChange:a,onClick:r}=e;l((()=>{a({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,a]);const s=gf(i,n.selectedBranch),d=xf(s?.safeBoxCaseVolumes),m=yf(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=bf(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(of,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:a}),o(mf,{days:n.days,tariffs:u})]})})),xf=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],yf=(e,t)=>e?.find((e=>e.volume===t)),bf=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,vf=[];const Nf=async e=>await rt(e,{method:"GET"})||vf,wf=d((({title:e,footnote:t,className:n="",...l})=>{const[r,s]=i(!1),d=a((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Va(),p=Cf(m.selectedRegion,h),f=function(e){const{data:t}=qn(e?`/api/v1/safeboxes?regionCode=${e}`:null,Nf);return t||vf}(p),x=a((e=>u((t=>({...t,...e})))),[u]),y=(b=gf(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...l,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(ff,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Er,{points:y,className:"h-[640px]"}):null]})})),Cf=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,kf={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"},Sf=(e,t,n)=>(i,l)=>{const{button:a}=i;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:Tf(e,n)(i,l)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[If(i),a?.text?o(be,{className:"box-border py-s w-full max-w-60 mt-lg",version:t,...a,children:a?.text}):null]})]})},String(l))},Tf=(e,t)=>(n,i)=>{const l="secondary"===t?"white":"color",a=Boolean(n?.icon?.src),r=Bf(e,a),s=a?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:Pf({step:n,iconVersion:l,i:i,stepVersion:t})})})},If=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",kf.description),children:e.description}):null,o(Re,{__html:e.__html})]}),Bf=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Pf=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return Oe(e?.icon)?o(ne,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===i?kf.iconText:(l=i,"secondary"===l?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var l},Rf=d((({className:e="",title:t,description:n,steps:i=[],buttons:l,stepVersion:a="gray",version:r="primary",...s})=>{const d=i.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),i?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:i.map(Sf(d,r,a))}):null,Le(l,{isVertical:!0})]})})),Df=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(W,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),Mf=d((({className:e,head:t,children:n,onClose:i,onClick:l})=>{const{close:r}=de(),s=a((()=>{r(),i&&i()}),[i]);return c("div",{onClick:l,className:u("relative min-h-full bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(hl,{className:"absolute top-1.5 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),Af=({menuRef:e,dialogRef:t,closeDialog:n,openDialog:i,leftItems:l,rightItems:a})=>[{openBottomMenuItemDialog:(r,s)=>{const c="left"===s?l:a,d=e?.current?.getBoundingClientRect();i(o(Mf,{onClick:e=>e.stopPropagation(),onClose:n,className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:c[r].description||c[r].title})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",onLoad:()=>(()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=String(e?.contentWindow?.document.body.offsetHeight)+"px"})(),src:c[r]?.src,width:d?.width||0})})}),{id:"left"===s?l[r].title:a[r].title})}}];function Ef(e){throw new Error(e)}const _f=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=i(e),l=a((e=>n((t=>[...t,e]))),[]),r=a((()=>n((e=>e.slice(0,-1)))),[]),s=a((e=>n((t=>t.filter((t=>t!==e))))),[]),o=a((()=>n([])),[]);return[t,{setList:n,push:l,pop:r,remove:s,clear:o}]}(),c=a((()=>{e&&e(n),o()}),[n,e]),d=a((()=>{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:Ef(e)}}))),[c,d]),n},zf=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:l}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),l=Array.from({length:t.length});let a=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++)i[r]||l[n]||e[r]!==t[n]||(a++,i[r]=!0,l[n]=!0)}return{m:a,s1Matches:i,s2Matches:l}}(e,t);if(0===n)return 0;const a=function(e,t,{s1Matches:n,s2Matches:i}){let l=0;for(let a=0,r=0;a<e.length;a++){if(!n[a])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[a]!==t[s]&&l++}return l}(e,t,{s1Matches:i,s2Matches:l}),r=(n/e.length+n/t.length+(n-a/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 Ff=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(Vf,{...e},String(t))))})]}):null,Vf=d((({icon:e,...t})=>{const n=ue(),{text:i,target:l,href:a,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:a,target:l,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),Of=(e,t)=>n=>n.name?o($m,{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,Lf=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"})]}))),qf=d((({foreignOffices:e,branches:t})=>{const[n,l]=Uh(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=i(""),u=$f(Va()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((e,t)=>{const n=new Map;for(const i of e){const e=t(i),l=n.get(e)||[];n.set(e,[...l,i])}return n})(u,jf),{close:p}=de(),g=a((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(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o($m,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(Lf,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&zf(e.toLowerCase())(d.toLowerCase())>=.8)).map(Of(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(Of(x,f))]},e)))}),Ff(e)]});var f,x})),jf=e=>e.name?.charAt(0)||"",$f=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Uf=d((({menuRef:e,menuItem:t,locationDialogProps:n,closeAll:i})=>{const a=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(qf,{...e}),n),close:n}})(n||{}),[{name:r}]=Uh(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return l((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),l((()=>{const e=e=>{if("location"===e.data.type&&a.open(),"reload"===e.data.type&&i(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[]),o(Mf,{onClick:e=>e.stopPropagation(),head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),Wf="burgerMenuDialog",Hf=({menuRef:e,centralMenuItem:t,closeAll:n,openDialog:i,locationDialogProps:l})=>{const a=_f(),r=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Wf,a);return[r,{toggle:()=>{r?n():i(o(Uf,{locationDialogProps:l,menuRef:e,menuItem:t,closeAll:n}),{id:Wf})}}]},Yf=[],Kf=ht((({sticky:e,...t})=>{const{menuItems:n=Yf}=e??{},l=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=i(-1),[f,x]=i(""),{open:y,closeAll:b}=de(),v=a((()=>{p(-1),x(""),b()}),[b]),N=jt(v),w=s(null),[C,{toggle:k}]=Hf({menuRef:w,centralMenuItem:l,closeAll:b,openDialog:y,locationDialogProps:t.header}),[{openBottomMenuItemDialog:S}]=Af({menuRef:w,dialogRef:N,closeDialog:v,openDialog:y,leftItems:m,rightItems:u}),T=a((e=>{v(),e.stopPropagation(),k()}),[v,k]),I=a(((e,t)=>{x(t),p(e),b(),S(e,t)}),[b,S]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:w,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Gf(I,"left",{activeIndex:h,currentItemPosition:f})),o(Df,{item:l,isActive:C,onClick:e=>T(e)}),u.map(Gf(I,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Gf=(e,t,n)=>(i,l,a)=>o(Df,{item:i,isActive:a[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t,onClick:r=>{a[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t||r.stopPropagation(),e(l,t)}},i.title||String(l)),Xf="hidden sm:flex absolute z-40",Jf={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Zf=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:a="default"})=>{const[r,s]=sc({itemCount:t?.length||0});return l((()=>Qf(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Ko,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Jf[a].item,gap:Jf[a].gap,children:t.map(Ig(n,i,a))}),s.canScrollLeft?o(uc,{className:u("left-6",Xf,Jf[a].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(hc,{className:u("right-6",Xf,Jf[a].buttonTop),onClick:s.scrollRight}):null]})})),Qf=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},ex={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},tx=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(ex[t].wrapper,e),children:o(Zf,{className:ex[t].component,tabsType:t,...n})}):null,nx=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=ix(n??{}),p=M(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=i(rx(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));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)}),[y,w,h]);const C=ax(x[b],b),k=a((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:[tx({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:lx(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(ax)?.filter(Boolean)||[]}),ix=({__id:e,anchor:t})=>t??e??"tabs",lx=(e,t)=>t?.length?t:e,ax=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",rx=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),sx={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},ox=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:sx[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),cx=d((({className:e="",isOpen:t,onClick:n})=>o(be,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),dx={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:i,isOpen:l})=>e?o(cx,{className:"w-fit",isOpen:l,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},mx=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:a,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);l((()=>{a===o&&s||m(!0)}),[s,o]);return ux({cell:e,cellProps:{rowIdx:n,cellIdx:a,fieldIdx:t,displayTable:e=>{m(!1),c(a),r(e)},isVisible:d}})})),ux=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in dx))return null;return o(dx[n],{...t,...i})},hx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:l,openTableInnerIdx:a,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(mx,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:l,openTableInnerIdx:a,setOpenTableInnerIdx:r},String(s)))):null}))),px=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),gx=(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,fx=d((({rows:e})=>{return o(Ko,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[i,...l]=e,a=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[i?.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:i.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:a,style:{transform:`translateX(-${px(l,t)}px)`},children:l?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Me,{size:"text-xl",children:e.data}):null,e?.cols?gx(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),xx=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`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(fx,{rows:t.rowsData})})})]},i)}))}))),yx=(e=!1)=>""+(e?"text-white":"text-secondary-text"),bx=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>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:()=>i(t),children:o(Me,{size:"text-xl",font:"font-light",color:yx(t===n),children:e||t+1})},e)))}):null,t?o(be,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),vx=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const l=e?.tableData,[r,s]=i(0),d=a((e=>s(e)),[]),m=l?.[r]?.items??[],u=l?.map((e=>e.currency??""));return c("div",l?{className:"bg-white z-10",children:[o(bx,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(xx,{activeTabIndex:r,items:m}),o(cx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(cx,{onClick:n,isOpen:!0})]})})),Nx=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(vx,{...t,onClick:n})}):null]}))),wx=d((({row:{header:e,data:t},activeIndex:n,rowIdx:l,...r})=>{const[s,d]=i(void 0),m=a((e=>d(e)),[]),[h,p]=i(void 0),g=a((e=>p(e)),[]);return c(Nx,{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(ox,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(hx,{cells:e,rowIdx:l,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function Cx({dec:e,inc:t,canDec:n,canInc:i,btnClass:l,className:a=""}){return n||i?c("div",{children:[n?o(mc,{className:u("absolute z-40",l[0],a),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(mc,{className:u("absolute z-40 rotate-180",l[1],a),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const kx=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,Cx({...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]})})),Sx=d((({className:e="",title:t,description:n,rowHeaders:l,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=l?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:l}=e,[r,s]=i(t),o=a((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=a((()=>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}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(wx,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(S,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?o(qa,{renderFoldableSection:({isUnfolded:e})=>c(kx,{controls:x,children:[b,o(ja,{isUnfolded:e,children:v})]}),renderFoldButton:Cc}):o(kx,{controls:x,children:y})})]})})),Tx=d((({className:e="",title:t,description:n,iconVersion:i,__html:l,richVersion:a,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?Ix():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?Bx(n):null,l?o(Re,{richVersion:a,__html:l}):null]})]}))),Ix=()=>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"}),Bx=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Px=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]}))),Rx=d((e=>{const{prefix:t,unit:n,suffix:i,...l}=e;return o(g,{defaultPadding:"p-0",...l,children:o(Px,{prefix:t,unit:n,suffix:i})})})),Dx={AdTile:gt,ApplicationForm:Os,ApplicationLeadForm:qo,BankAccountFiltration:qc,BenefitsBlock:Hc,BonusBenefitsBlock:Gc,ButtonsBlock:Jc,CalculatorBonus:ud,CalculatorBusinessDeposit:Pd,CalculatorCredit:Ud,CalculatorDeposit:om,CalculatorRefinancing:fm,CardTransfer:Cm,Carousel:Dm,CarouselCard:_m,CarouselCatalogCard:Fm,CarouselLinks:Lm,CarouselRecommendationCard:Km,CarouselTariffsCard:Jm,CreditCardForm:zu,CreditForm:yh,DepositFiltration:Ch,Depository:Lh,ErrorBlock:jh,ExchangeRateTile:gp,Footer:zp,GrantSupport:Fp,Header:$p,Headline:S,HorizontalLayout:Yp,ImgBlock:Kp,LinkDocs:lg,MobileAppTile:og,MortgageFiltration:Rg,OfficesAtmsMap:Yg,Placeholder:Kg,ProductBlock:pt,ProductGallery:Gg,RepresentativeOfficeInfo:Xg,RichTextBlock:Qg,RollupItem:Cp,SafeDepositRental:wf,StepsBlock:Rf,StickyBottomMenu:Kf,TabsLayout:nx,TariffsTable:Sx,TextBlock:Tx,UnitBlock:Rx,VerticalLayout:Hp},Mx=me((()=>{l((()=>{Tt()}),[]);const e=Et();qt(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");kt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const Ax="cookie",Ex=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=Lt();!function(e,t,n=300){l((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(Ax)||n()}),[],3e3);const r=a((()=>{globalThis.localStorage?.setItem(Ax,"true"),i()}),[]);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:r})})]})}):null})),_x=d((()=>{const e=a((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=a((e=>{e?.onClose&&e.onClose()}),[]),n=_f({onCloseAll:e,onClose:t}),{close:i}=de(),r=a((({key:e})=>{"Escape"===e&&i()}),[]);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},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==n.length-1}),children:e},String(t||i))))}):null})),zx=d((()=>{const[e,t]=i(null),n=a((()=>{t(null)}),[]);l((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:Ef(e)}}))),[]);const r=a((({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})),Fx="header",Vx="footer",Ox="sticky-footer",Lx={},qx=d((({className:e,data:t=Lx,blocksRegistry:n,blockDecorator:i})=>{const{slots:l,blocks:a,fallback:r,...s}=t,d=ut(s,r);Mx();const m={key:"",page:{slots:l,blocks:a,fallback:r,...d},blocksRegistry:n,blockDecorator:i,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:Fx})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),R(l?.footer,{...m,slotName:Vx})]})]}),l?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(l?.["sticky-footer"],{...m,slotName:Ox})}):null,o(_x,{}),o(zx,{}),o(Ex,{__html:d?.cookieContent?.__html})]})}));Object.assign(qx,{childrenTypes:[],slots:()=>[Fx,Vx,Ox]});e.Blocks=Dx,e.ContentPage=qx,e.handlerDecorator=me,e.joinList=Pc,e.packageVersion="0.14.660",e.projectSettings=E,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=M,Object.defineProperty(e,"__esModule",{value:!0})}));