@redneckz/wildless-cms-uni-blocks 0.3.89 → 0.3.90

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/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +73 -12
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/dist/EventBus/EventBus.d.ts +10 -0
  5. package/dist/EventBus/EventBus.js +30 -0
  6. package/dist/EventBus/EventBus.js.map +1 -0
  7. package/dist/EventBus/EventMap.d.ts +4 -0
  8. package/dist/EventBus/EventMap.js +2 -0
  9. package/dist/EventBus/EventMap.js.map +1 -0
  10. package/dist/components/Blocks.d.ts +1 -0
  11. package/dist/components/Blocks.js +2 -0
  12. package/dist/components/Blocks.js.map +1 -1
  13. package/dist/components/ContentPage/ContentPage.d.ts +1 -0
  14. package/dist/components/ContentPage/ContentPage.js +4 -4
  15. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  16. package/dist/components/ContentPage/ContentPageContext.d.ts +1 -0
  17. package/dist/components/ContentPage/normalizeBlock.d.ts +1 -0
  18. package/dist/components/Tabs/Tabs.d.ts +8 -0
  19. package/dist/components/Tabs/Tabs.js +18 -0
  20. package/dist/components/Tabs/Tabs.js.map +1 -0
  21. package/dist/components/Tabs/TabsContent.d.ts +18 -0
  22. package/dist/components/Tabs/TabsContent.js +2 -0
  23. package/dist/components/Tabs/TabsContent.js.map +1 -0
  24. package/dist/components/Tabs/renderTab.d.ts +12 -0
  25. package/dist/components/Tabs/renderTab.js +19 -0
  26. package/dist/components/Tabs/renderTab.js.map +1 -0
  27. package/dist/react/setup-fixture.js +1 -0
  28. package/dist/react/setup-fixture.js.map +1 -1
  29. package/dist/types.d.ts +3 -0
  30. package/dist/ui-kit/BlockWrapper.d.ts +3 -2
  31. package/dist/ui-kit/BlockWrapper.js +10 -2
  32. package/dist/ui-kit/BlockWrapper.js.map +1 -1
  33. package/lib/EventBus/EventBus.d.ts +10 -0
  34. package/lib/EventBus/EventBus.js +27 -0
  35. package/lib/EventBus/EventBus.js.map +1 -0
  36. package/lib/EventBus/EventMap.d.ts +4 -0
  37. package/lib/EventBus/EventMap.js +2 -0
  38. package/lib/EventBus/EventMap.js.map +1 -0
  39. package/lib/common.css +1 -1
  40. package/lib/components/Blocks.d.ts +1 -0
  41. package/lib/components/Blocks.js +2 -0
  42. package/lib/components/Blocks.js.map +1 -1
  43. package/lib/components/ContentPage/ContentPage.d.ts +1 -0
  44. package/lib/components/ContentPage/ContentPage.js +4 -4
  45. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  46. package/lib/components/ContentPage/ContentPageContext.d.ts +1 -0
  47. package/lib/components/ContentPage/normalizeBlock.d.ts +1 -0
  48. package/lib/components/Tabs/Tabs.d.ts +8 -0
  49. package/lib/components/Tabs/Tabs.fixture.d.ts +5 -0
  50. package/lib/components/Tabs/Tabs.js +16 -0
  51. package/lib/components/Tabs/Tabs.js.map +1 -0
  52. package/lib/components/Tabs/TabsContent.d.ts +18 -0
  53. package/lib/components/Tabs/TabsContent.js +2 -0
  54. package/lib/components/Tabs/TabsContent.js.map +1 -0
  55. package/lib/components/Tabs/renderTab.d.ts +12 -0
  56. package/lib/components/Tabs/renderTab.js +16 -0
  57. package/lib/components/Tabs/renderTab.js.map +1 -0
  58. package/lib/react/setup-fixture.js +1 -0
  59. package/lib/react/setup-fixture.js.map +1 -1
  60. package/lib/types.d.ts +3 -0
  61. package/lib/ui-kit/BlockWrapper.d.ts +3 -2
  62. package/lib/ui-kit/BlockWrapper.js +10 -2
  63. package/lib/ui-kit/BlockWrapper.js.map +1 -1
  64. package/mobile/bundle/bundle.umd.js +40 -6
  65. package/mobile/bundle/bundle.umd.min.js +1 -1
  66. package/mobile/dist/EventBus/EventBus.d.ts +10 -0
  67. package/mobile/dist/EventBus/EventBus.js +30 -0
  68. package/mobile/dist/EventBus/EventBus.js.map +1 -0
  69. package/mobile/dist/EventBus/EventMap.d.ts +4 -0
  70. package/mobile/dist/EventBus/EventMap.js +2 -0
  71. package/mobile/dist/EventBus/EventMap.js.map +1 -0
  72. package/mobile/dist/components/ContentPage/ContentPage.d.ts +1 -0
  73. package/mobile/dist/components/ContentPage/ContentPage.js +4 -4
  74. package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
  75. package/mobile/dist/components/ContentPage/ContentPageContext.d.ts +1 -0
  76. package/mobile/dist/components/Tabs/Tabs.d.ts +8 -0
  77. package/mobile/dist/components/Tabs/Tabs.js +18 -0
  78. package/mobile/dist/components/Tabs/Tabs.js.map +1 -0
  79. package/mobile/dist/components/Tabs/TabsContent.d.ts +18 -0
  80. package/mobile/dist/components/Tabs/TabsContent.js +2 -0
  81. package/mobile/dist/components/Tabs/TabsContent.js.map +1 -0
  82. package/mobile/dist/components/Tabs/renderTab.d.ts +12 -0
  83. package/mobile/dist/components/Tabs/renderTab.js +19 -0
  84. package/mobile/dist/components/Tabs/renderTab.js.map +1 -0
  85. package/mobile/dist/react/setup-fixture.js +1 -0
  86. package/mobile/dist/react/setup-fixture.js.map +1 -1
  87. package/mobile/dist/types.d.ts +3 -0
  88. package/mobile/dist/ui-kit/BlockWrapper.d.ts +3 -2
  89. package/mobile/dist/ui-kit/BlockWrapper.js +10 -2
  90. package/mobile/dist/ui-kit/BlockWrapper.js.map +1 -1
  91. package/mobile/lib/EventBus/EventBus.d.ts +10 -0
  92. package/mobile/lib/EventBus/EventBus.js +27 -0
  93. package/mobile/lib/EventBus/EventBus.js.map +1 -0
  94. package/mobile/lib/EventBus/EventMap.d.ts +4 -0
  95. package/mobile/lib/EventBus/EventMap.js +2 -0
  96. package/mobile/lib/EventBus/EventMap.js.map +1 -0
  97. package/mobile/lib/components/ContentPage/ContentPage.d.ts +1 -0
  98. package/mobile/lib/components/ContentPage/ContentPage.js +4 -4
  99. package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
  100. package/mobile/lib/components/ContentPage/ContentPageContext.d.ts +1 -0
  101. package/mobile/lib/components/Tabs/Tabs.d.ts +8 -0
  102. package/mobile/lib/components/Tabs/Tabs.js +16 -0
  103. package/mobile/lib/components/Tabs/Tabs.js.map +1 -0
  104. package/mobile/lib/components/Tabs/TabsContent.d.ts +18 -0
  105. package/mobile/lib/components/Tabs/TabsContent.js +2 -0
  106. package/mobile/lib/components/Tabs/TabsContent.js.map +1 -0
  107. package/mobile/lib/components/Tabs/renderTab.d.ts +12 -0
  108. package/mobile/lib/components/Tabs/renderTab.js +16 -0
  109. package/mobile/lib/components/Tabs/renderTab.js.map +1 -0
  110. package/mobile/lib/react/setup-fixture.js +1 -0
  111. package/mobile/lib/react/setup-fixture.js.map +1 -1
  112. package/mobile/lib/types.d.ts +3 -0
  113. package/mobile/lib/ui-kit/BlockWrapper.d.ts +3 -2
  114. package/mobile/lib/ui-kit/BlockWrapper.js +10 -2
  115. package/mobile/lib/ui-kit/BlockWrapper.js.map +1 -1
  116. package/mobile/src/EventBus/EventBus.ts +38 -0
  117. package/mobile/src/EventBus/EventMap.ts +5 -0
  118. package/mobile/src/components/Blocks.spec.tsx +2 -1
  119. package/mobile/src/components/ContentPage/ContentPage.tsx +7 -4
  120. package/mobile/src/components/ContentPage/ContentPageContext.tsx +1 -0
  121. package/mobile/src/components/Tabs/Tabs.example.json +17 -0
  122. package/mobile/src/components/Tabs/Tabs.tsx +35 -0
  123. package/mobile/src/components/Tabs/TabsContent.ts +19 -0
  124. package/mobile/src/components/Tabs/renderTab.tsx +51 -0
  125. package/mobile/src/components/__snapshots__/Blocks.spec.tsx.snap +6 -0
  126. package/mobile/src/react/setup-fixture.ts +1 -0
  127. package/mobile/src/types.ts +3 -0
  128. package/mobile/src/ui-kit/BlockWrapper.tsx +19 -4
  129. package/package.json +1 -1
  130. package/src/EventBus/EventBus.ts +38 -0
  131. package/src/EventBus/EventMap.ts +5 -0
  132. package/src/components/Blocks.spec.tsx +2 -1
  133. package/src/components/Blocks.ts +2 -0
  134. package/src/components/ContentPage/ContentPage.tsx +7 -4
  135. package/src/components/ContentPage/ContentPageContext.tsx +1 -0
  136. package/src/components/Tabs/Tabs.example.json +17 -0
  137. package/src/components/Tabs/Tabs.fixture.tsx +18 -0
  138. package/src/components/Tabs/Tabs.tsx +35 -0
  139. package/src/components/Tabs/TabsContent.ts +19 -0
  140. package/src/components/Tabs/renderTab.tsx +51 -0
  141. package/src/components/__snapshots__/Blocks.spec.tsx.snap +6 -0
  142. package/src/react/setup-fixture.ts +1 -0
  143. package/src/types.ts +3 -0
  144. package/src/ui-kit/BlockWrapper.tsx +19 -4
@@ -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";const t=(e,n)=>{t._jsx=e,t._jsxs=n||e};t.vue=e=>{t(((t,{children:n,dangerouslySetInnerHTML:r,...l}={})=>{const a=Object.assign({},l,r?{innerHTML:r.__html}:{});return e(t,a,"string"!=typeof t?()=>n:n)}))};const n=(...e)=>t._jsx(...e),r=(...e)=>t._jsxs(...e),l=e=>(e._tmpl||(e._tmpl=function(t,n){const{children:r,...l}=t||{},a=n?.slots?.default,o=r||a&&a();return e(Object.assign(l,o&&{children:o}),n)},e._tmpl.inheritAttrs=!1),e._tmpl);const a="likesToken";const o={h0:"text-m-title",h1:"text-m-title",h2:"text-m-title",h3:"text-h6",h4:"text-m-title-xs",h5:"text-m-title-xs",h6:"text-m-title-xs"},i=l((e=>{const{className:t,headingType:r="h3",title:l,as:a="h3"}=e;return n(a,{className:`font-sans font-medium m-0 ${o[r]} ${t||""}`,children:l})}));var c,s;!function(e){e.ActualBalanceIcon="ActualBalanceIcon",e.AirPlane="AirPlane",e.AppleIcon="AppleIcon",e.ArrowDownIcon="ArrowDownIcon",e.ArrowLeftIcon="ArrowLeftIcon",e.ArrowUpIcon="ArrowUpIcon",e.AtmIcon="AtmIcon",e.BankIcon="BankIcon",e.BurgerIcon="BurgerIcon",e.Calendar2Icon="Calendar2Icon",e.CalendarCircleIcon="CalendarCircleIcon",e.CalendarIcon="CalendarIcon",e.CalendarTickIcon="CalendarTickIcon",e.CardIcon="CardIcon",e.CardPosIcon="CardPosIcon",e.CardTickIcon="CardTickIcon",e.CardWithGemIcon="CardWithGemIcon",e.CarIcon="CarIcon",e.ChartSquareIcon="ChartSquareIcon",e.CinemaIcon="CinemaIcon",e.ClockIcon="ClockIcon",e.CloseIcon="CloseIcon",e.ComfortableCompIcon="ComfortableCompIcon",e.CreditCardsIcon="CreditCardsIcon",e.DiscountShapeIcon="DiscountShapeIcon",e.DocIcon="DocIcon",e.DocIconMonoColor="DocIconMonoColor",e.DocsIcon="DocsIcon",e.DocumentTextIcon="DocumentTextIcon",e.DollarIcon="DollarIcon",e.DoneIcon="DoneIcon",e.EarthIcon="EarthIcon",e.EmptyWalletChangeIcon="EmptyWalletChangeIcon",e.EmptyWalletIcon="EmptyWalletIcon",e.EuroIcon="EuroIcon",e.GeolocationIcon="GeolocationIcon",e.GlassIcon="GlassIcon",e.GlobalIcon="GlobalIcon",e.GpsIcon="GpsIcon",e.GridIcon="GridIcon",e.InterestGrowthIcon="InterestGrowthIcon",e.InterestIcon="InterestIcon",e.JCBIcon="JCBIcon",e.Logo="Logo",e.LoupeIcon="LoupeIcon",e.MasterCardIcon="MasterCardIcon",e.MinusIcon="MinusIcon",e.MirIcon="MirIcon",e.MoneyIcon="MoneyIcon",e.MoneyInsuranceIcon="MoneyInsuranceIcon",e.MonitorMobileIcon="MonitorMobileIcon",e.NewDocIcon="NewDocIcon",e.OfficeIcon="OfficeIcon",e.OkIcon="OkIcon",e.PassSendIcon="PassSendIcon",e.PercentageRoundIcon="PercentageRoundIcon",e.PercentageSquareIcon="PercentageSquareIcon",e.PersonalCardIcon="PersonalCardIcon",e.PlayMarketIcon="PlayMarketIcon",e.PlusIcon="PlusIcon",e.PowerIcon="PowerIcon",e.Profile2UserIcon="Profile2UserIcon",e.ProfileIcon="ProfileIcon",e.PumpkinIcon="PumpkinIcon",e.RoundRubleIcon="RoundRubleIcon",e.SafeIcon="SafeIcon",e.ShieldTickIcon="ShieldTickIcon",e.SignDocsIcon="SignDocsIcon",e.SmallClockIcon="SmallClockIcon",e.SoundIcon="SoundIcon",e.TelegramIcon="TelegramIcon",e.UnionPayIcon="UnionPayIcon",e.UserTickIcon="UserTickIcon",e.VisaIcon="VisaIcon",e.VKIcon="VKIcon",e.WalletAdd2Icon="WalletAdd2Icon",e.WalletAddIcon="WalletAddIcon",e.WalletIcon="WalletIcon",e.WalletWithMoneyIcon="WalletWithMoneyIcon",e.WateringCan="WateringCan"}(c||(c={})),function(e){e.ActualBalanceIcon="Деньги",e.AirPlane="Самолет",e.AppleIcon="Лого «Apple»",e.ArrowDownIcon="Стрелка 'Вниз'",e.ArrowLeftIcon="Стрелка",e.ArrowUpIcon="Стрелка вверх",e.AtmIcon="Банкомат",e.BankIcon="Банк",e.BurgerIcon="Бургер",e.Calendar2Icon="Календарь 2",e.CalendarCircleIcon="Скруглённый календарь",e.CalendarIcon="Календарь",e.CalendarTickIcon="Календарь с галочкой",e.CardIcon="Кред. карта",e.CardPosIcon="Кред. карта под наклоном",e.CardTickIcon="Кред. карта с галочкой",e.CardWithGemIcon="Карта с драгоценностями",e.CarIcon="Машина",e.ChartSquareIcon="Деньги внутри кошелька",e.CinemaIcon="Кино",e.ClockIcon="Часы",e.CloseIcon="Крестик",e.ComfortableCompIcon="Кресло",e.CreditCardsIcon="Кредитные карты",e.DiscountShapeIcon="Скидка",e.DocIcon="Документ",e.DocIconMonoColor="Документ (одноцветный)",e.DocsIcon="Документы",e.DocumentTextIcon="Документ с текстом",e.DollarIcon="Доллар",e.DoneIcon="Зелёная 'галочка'",e.EarthIcon="Земля",e.EmptyWalletChangeIcon="Пустой кошелёк с возвратом",e.EmptyWalletIcon="Пустой кошелёк",e.EuroIcon="Евро",e.GeolocationIcon="Геолокация",e.GlassIcon="Зеркало",e.GlobalIcon="Глобус",e.GpsIcon="Gps",e.GridIcon="Сетка (белая)",e.InterestGrowthIcon="Диаграмма роста",e.InterestIcon="Скидка",e.JCBIcon="JCB",e.Logo="Logo",e.LoupeIcon="Лупа",e.MasterCardIcon="MasterCard",e.MinusIcon="Минус",e.MirIcon="МИР",e.MoneyIcon="Деньги",e.MoneyInsuranceIcon="Денежное страхование",e.MonitorMobileIcon="Монитор и мобильный",e.NewDocIcon="Новый документ",e.OfficeIcon="Офис",e.OkIcon="Лого «Одноклассники»",e.PassSendIcon="Бизнес",e.PercentageRoundIcon="Проценты (круг.)",e.PercentageSquareIcon="Проценты",e.PersonalCardIcon="Персональная карта",e.PlayMarketIcon="Лого «PlayMarket»",e.PlusIcon="Плюс",e.PowerIcon="Щит",e.Profile2UserIcon="Профиль, 2 персоны",e.ProfileIcon="Профиль",e.PumpkinIcon="Тыква",e.RoundRubleIcon="Рубль (круг.)",e.SafeIcon="Сейф",e.ShieldTickIcon="Безопасность",e.SignDocsIcon="Подписанные документы",e.SmallClockIcon="Маленькие часы",e.SoundIcon="Звук",e.TelegramIcon="Лого «Telegram»",e.UnionPayIcon="UnionPay",e.UserTickIcon="Пользователь",e.VisaIcon="Visa",e.VKIcon="Лого «VK»",e.WalletAdd2Icon="Пополнение карты",e.WalletAddIcon="Кошелёк с плюсом",e.WalletIcon="Кошелёк",e.WalletWithMoneyIcon="Кошелёк с деньгами",e.WateringCan="Добавить продукт"}(s||(s={}));const d=new class{_={PROD_BRANCH:"master",FORCED_DRAFT_FLOW:!1};setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ENABLE_ASSIST(){return this._.ENABLE_ASSIST}get SITEMAP(){return this._.SITEMAP}get CDN(){return this._.CDN}},m={normal:"text-primary-main",black:"text-black",white:"text-black invert"},h=l((({className:e="",imageClassName:t="",name:l="",alt:a=`Иконка ${s[l]||l}`,title:o=a,iconVersion:i="normal",asSVG:c,...h})=>{const u=`${d.CDN||""}icons/${l}.svg`;return c?r("svg",{className:e,...h,"aria-hidden":"true",children:[o?n("title",{children:o}):null,a?n("desc",{children:a}):null,n("use",{className:`${m[i]} ${t}`,href:`${u}#icon`,xlinkHref:`${u}#icon`})]}):n("img",{className:e,src:u,alt:a,title:o,...h,"aria-hidden":"true"})}));function u(e){return"string"==typeof e?"normal":e.iconVersion||"normal"}const p=(e,t)=>e.media&&t.media?e.media-t.media:0,x=l((({className:e="",image:t,imageClassName:l="",isMobile:a=!1})=>{if(!t)return null;return r("picture",{className:`${a?"flex":"flex-none"} ${e}`,children:[t?.sources?.length?t.sources.sort(p).map((({src:e,format:t,media:r,size:l},a)=>n("source",{srcSet:e,type:b(t),media:r?`(max-width: ${r}px)`:"",...l},`${a}_${e}`))):null,g(t,l,a)]})})),g=(e,t="",r=!1)=>{const l=e.title||"",a=e.alt||e.title,o=r?"m-auto":"m-0";return n("img",{src:e.src,className:`${o} ${t}`,alt:a,title:l,...e.size})};function b(e){return e?`image/${String(e)}`:void 0}const f=l((({className:e="",image:t,imageClassName:r="",isMobile:l,...a})=>{if(!t)return null;const o="string"==typeof t?t:t.icon;return o||""===o?o.length?n(h,{className:e,imageClassName:r,iconVersion:u(t),name:o,...a}):null:n(x,{className:e,imageClassName:r,image:t,isMobile:l})})),y=l((({className:e="",image:t})=>n(f,{className:e,image:t,isMobile:!0})));function N(e){return e?e.filter(Boolean).join(" "):""}const v={left:"text-left",center:"text-center",right:"text-right"},I={transparent:{background:"bg-transparent",text:"text-primary-text",description:"text-primary-text"},primary:{background:"bg-white",text:"text-primary-text",description:"text-primary-text"},secondary:{background:"bg-primary-main",text:"text-white",description:"text-white/80"}},w=l((({bgColorHeadline:e="transparent",className:t="",title:l,description:a,image:o,align:c="left"})=>{const s=I[e];return r("section",{className:`px-4 py-6 flex flex-col gap-2.5 ${s.background} ${t}`,children:[l?n(i,{headingType:"h2",className:`${s.text} ${v[c]}`,title:l}):null,a?n("p",{className:`font-normal text-m ${s.description} ${v[c]} `,children:a}):null,o?.src&&n("div",{className:"mt-2.5 mx-auto flex justify-center",children:n(y,{image:o})})]})})),C=l((({children:e,activeIndex:t,indexFraction:r,showDots:l})=>{const a=e=>n=>{if(e===t)return;const r=n.currentTarget.parentElement?.previousElementSibling;r?.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})};return l&&e?.length?n("div",{className:"flex gap-2 mx-auto mt-5 w-fit",children:e?.map(((e,l)=>n("div",{onClick:a(l),className:"bg-primary-main opacity-30 w-1.5 h-1.5 min-w-1.5 min-h-1.5 rounded-full",style:k(l,t,r),"aria-hidden":!0},String(l))))}):null})),k=(e,t,n)=>{if(e<t||e>t+1)return;const r=1-n;return e===t?{opacity:""+(.3+.7*r),width:6+16*r+"px"}:{opacity:""+(.3+.7*n),width:6+16*n+"px"}},S=l((({className:e="",children:t,...r})=>n("div",{className:`snap-center snap-always min-w-full box-border ${e}`,role:"listitem",...r,children:t}))),$=e=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e}px`}),D=l((({className:e="",children:t,activeIndex:r,onScroll:l,gap:a=14,padding:o=16})=>n("div",{className:`overflow-auto flex horizontal-list no-scrollbar ${e}`,style:{...$(o),gap:`${a}px`},role:"list",onScroll:l,children:t?.length?t?.map(((e,t)=>n(S,{style:$(o/4),"aria-current":Boolean(r===t),children:e},String(t)))):n(S,{children:t})}))),T=l((({className:e,context:t,children:l,gap:a=14,padding:o=16,showDots:i=!0,onSlideChange:c})=>{const[s,d]=t.useState(0),[m,h]=t.useState(0),u={activeIndex:s,indexFraction:m,showDots:i,children:l};return r("div",{className:e,children:[n(D,{gap:a,padding:o,activeIndex:s,onScroll:e=>{const{scrollLeft:t,clientWidth:n,childElementCount:r,scrollWidth:l,children:i}=e?.currentTarget,m=i[0].offsetWidth-o/2,u=(({gap:e,padding:t,clientWidth:n,scrollWidth:r,childElementCount:l,itemWidth:a})=>{const o=r-n;if(2===l)return[[0,o],[o,r]];const i=a+e,c=n-e-t,s=l-2,d=new Array(l).fill(0).map(((e,t)=>0===t||t===s?[t>0?o-c:0,t>0?o:c]:[(t-1)*i+c,t*i+c]));return d[l-1]=[o,r],d})({gap:a,padding:o,clientWidth:n,scrollWidth:l,childElementCount:r,itemWidth:m}),{index:p,fraction:x}=((e,t)=>{const n=t.findIndex((([t,n])=>t<=e&&e<n));if(n<0)return{index:n,fraction:0};const[r,l]=t[n];return{index:n,fraction:(e-r)/(l-r)}})(t,u);p!==s&&c&&c(),d(p),h(x)},children:l}),n(C,{...u})]})})),R=l((({className:e,iconClassName:t,textClassName:l,suffixClassName:a,doc:o,icon:i})=>{const{text:c,fileSize:s,...d}=o;return r("a",{className:e,role:"link",...d,children:[i?n(y,{className:t,image:i,width:"24px",height:"24px",asSVG:!0}):null,c?r("span",{className:l,children:[c,n("span",{className:a,children:d?.href&&B(_(d.href),s)})]}):null]})})),B=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),_=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},P=l((({className:e="",doc:t,icon:r})=>n(R,{className:`flex h-full box-border ${e}`,iconClassName:"mr-3 min-w-6 min-h-6",doc:t,icon:r}))),L=l((({context:e,hasBorder:t=!0,documents:r,icon:l})=>n(T,{context:e,className:"text-s text-primary-main mt-5",children:r?.length?r.map(((e,r)=>n(P,{className:t?"rounded-md border-main-stroke border border-solid p-4":"",doc:e,icon:l},String(r)))):null}))),A=l((({hasBorder:e=!0,documents:t,icon:r})=>n("div",{className:"text-s text-primary-main flex flex-col mt-5 "+(e?"gap-3.5":"gap-2"),role:"list",children:t?.length?t.map(((t,l)=>n("div",{role:"listitem",children:n(P,{className:e?"rounded-md border-main-stroke border border-solid p-4":"",doc:t,icon:r})},String(l)))):null}))),M=l((({className:e="",context:t,title:l,description:a,icon:o={icon:"DocIconMonoColor"},documents:i,orientation:c="vertical",hasBorder:s=!0})=>r("section",{className:`font-sans text-primary-text py-6 px-4 bg-white overflow-x-hidden ${e}`,children:[n(w,{className:"!p-0 "+(a?"gap-2":"gap-5"),title:l,description:a,context:t,align:"center"}),"vertical"===c?n(A,{hasBorder:s,documents:i,icon:o}):n(L,{context:t,hasBorder:s,documents:i,icon:o})]}))),V=e=>e?.includes("//"),G=e=>(e||"").replace(/\/?\?.*/,""),j=e=>{if(!e||!V(e))return;const t=e,n=t.indexOf("//"),r=t.indexOf("/",n+"//".length);return-1!==r?t.substring(0,r):t};var W=Object.freeze({__proto__:null,isURL:V,withoutQuery:G,getOrigin:j,getHash:e=>{if(!e||!V(e))return;const t=e.indexOf("#");return-1!==t?e.substring(t,e.length):void 0},isHash:e=>e?.startsWith("#")});const O="/mobile",U=(e,t)=>{if(!e)return e;const n=j(t?.href);return n?e.replace(n,"")||"/":e},E=e=>e;function F({router:e,handlerDecorator:t=E},n){const r=((e,t)=>{if(!e)return e;const n=U(e,t)||"",r=t?.pathname.startsWith(O);return r&&!V(n)?`/mobile${n}`:n})(n.href,e);return{...n,href:r,"aria-label":n.text,onClick:t((t=>{const l=r&&!V(r),a=!n.target||"_self"===n.target;l&&a&&(t?.preventDefault(),e.push(r))}),n)}}const H=l((e=>{const{text:t,aboveText:l,appendLeft:a,appendRight:o}=e;return r("div",{className:z(e),children:[a||null,J(e)?r("div",{children:[n("div",{className:"text-xs text-left",children:l}),n("div",{className:"text-left "+(l?"text-s -mt-0.5":"text-l"),children:t})]}):null,o||null]})})),z=e=>{const{version:t,aboveText:n,rounded:r}=e;if("link"===t)return"";const l="gap-2 "+(n?"py-2.5 px-7":"py-4 px-9");return["flex items-center justify-center",J(e)?l:"h-12 w-12",r?"rounded-full":""].join(" ")},J=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),q={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active",link:"text-primary-main"},K={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text",link:""},Q="w-full text-center font-sans select-none",Y=l((({className:e,text:t,aboveText:r,appendLeft:l,href:a,target:o,onClick:i,children:c,disabled:s,rounded:d,version:m="primary",ariaLabel:h,...u})=>{const p=c??n(H,{text:t,aboveText:r,appendLeft:l,rounded:d,version:m});return s?n("div",{role:"button","aria-disabled":"true","aria-label":h,tabIndex:-1,className:`inline-block ${Q} ${K[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,children:p}):n("a",{className:`${Q} inline-block cursor-pointer no-underline ${q[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,href:a,target:o,onClick:i,"aria-label":h,role:a?"link":"button",...u,children:p})})),Z=l((({context:e,className:t="",buttons:r})=>{const{handlerDecorator:l}=e,a=e.useRouter();return r&&r?.length?n("div",{className:t,children:r.map(((e,t)=>function({icon:e,iconRight:t,...r},l){if(!r?.text)return null;return n(Y,e?{appendLeft:n(y,{image:e,width:"24",height:"24",asSVG:!0}),appendRight:n(y,{image:t,width:"24",height:"24",asSVG:!0}),...r}:{...r},String(l))}(F({router:a,handlerDecorator:l},e),t)))}):null}));const X={primary:"rounded-full inline-block mr-3 mt-2",secondary:"rounded-full inline-block mr-3 mt-2",gray:"rounded-full inline-block mr-3 mt-2",tile:"rounded-full inline-block mr-4 mt-3","tile-white":"rounded-full inline-block mr-4 mt-3"},ee={primary:"bg-primary-text",secondary:"bg-white",gray:"bg-secondary-text",tile:"bg-black","tile-white":"bg-white"},te=l((({className:e="",isDotted:t=!0,children:l,version:a="primary"})=>r("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t?n("div",{className:ne(a)}):null,n("span",{children:l})]}))),ne=e=>`${X[e]} ${ee[e]} ${{primary:"w-2 h-2 min-w-2 min-h-2",secondary:"w-2 h-2 min-w-2 min-h-2",gray:"w-1.5 h-1.5 min-w-1.5 min-h-1.5",tile:"w-[7px] h-[7px] min-w-[7px] min-h-[7px]","tile-white":"w-[7px] h-[7px] min-w-[7px] min-h-[7px]"}[e]}`,re={primary:"text-primary-text",secondary:"text-white",gray:"text-secondary-text",tile:"text-primary-text","tile-white":"text-white"},le=l((e=>{const{className:t="",itemClassName:r,isDotted:l,items:a,version:o="primary"}=e;return n("section",{className:`${re[o]} ${t}`,role:"list",children:a?.length?a.map(((e,t)=>n(te,{className:r,isDotted:l,version:o,children:e},String(t)))):null})})),ae=l((({className:e="",title:t="",children:l,buttons:a,image:o})=>r("div",{className:`font-sans flex flex-col grow h-full items-start ${e}`,children:[t,r("div",{className:"flex grow w-full justify-between",children:[r("div",{className:"flex flex-col justify-between w-full",children:[n("div",{children:l}),a?n("div",{children:a}):null]}),o]})]}))),oe={primary:"text-primary-text",secondary:"text-white"},ie={primary:"text-secondary-text",secondary:"text-white"};function ce(e){let t="text-primary-main";return"secondary"===e&&(t="text-black"),`w-6 h-6 rounded-full box-border ${t}`}const se=l((({className:e="",context:t,title:l,headlineVersion:a="L",description:o,benefits:i,benefitsVersion:c="normal",buttons:s,image:d,items:m,version:h="primary",isDotted:u=!0,label:p})=>r("div",{className:`w-full ${e}`,children:[r("div",{children:[p?he(p,h):null,n(w,{context:t,className:"!p-0 max-w-[600px]",title:l,description:o,bgColorHeadline:h,headlineVersion:a}),r(ae,{context:t,buttons:s?.length?n(Z,{context:t,buttons:s,className:"flex flex-col mt-5 gap-2.5"}):null,children:[i?.filter((e=>e.label))?.length?n("div",{className:"mt-3",children:i.map(((e,t)=>function({benefit:e,version:t="primary"},l){const a="secondary"===t;return r("div",{className:"flex gap-3 items-center mb-2.5 last:mb-0",children:[e.icon?n(y,{className:ce(t),image:{...e?.icon,iconVersion:a?"white":"normal"},width:"24",height:"24",asSVG:!0}):null,n("div",{className:`text-l m-0 ${oe[t]}`,children:e.label}),e.description&&n("div",{className:`text-s ${ie[t]}`,children:e.description})]},String(l))}({benefit:e,version:h,benefitsVersion:c},t)))}):null,m?.length?n(le,{className:"mt-3 text-m",items:m,version:h,isDotted:u}):null]})]}),de(d)]})));function de(e){return e?.src?n(y,{imageClassName:"mt-5 mx-auto block",image:{className:"block",...e}}):null}const me={primary:"text-primary-main border-secondary-hover",secondary:"text-white/80"},he=(e,t)=>n("div",{className:`px-2.5 py-1.5 mb-5 rounded-md border-2 border-solid w-fit ${me[t]}`,children:e}),ue={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},pe=l((e=>{const{className:t="",version:r="primary"}=e;return n("section",{className:`font-sans bg-white px-4 py-6 ${ue[r]} ${t}`,children:n(se,{...e})})})),xe={primary:{background:"bg-white",icon:"bg-primary-main text-white",title:"text-primary-text",description:"text-secondary-text"},secondary:{background:"bg-primary-main",icon:"bg-white text-primary-main",title:"text-white",description:"text-white"},"secondary-light":{background:"bg-primary-main/10",icon:"bg-primary-main text-white",title:"text-primary-text",description:"text-secondary-text"}},ge=l((({title:e,description:t,blockVersion:l="primary",iconVersion:a,image:o,className:i="",items:c,isDotted:s=!0})=>{const d=xe[l],m="secondary"===l?"secondary":"gray";return r("section",{className:`font-sans px-4 py-[18px] flex flex-col ${d.background} ${i}`,children:["small"===a?be(d.icon):null,"big"===a?fe(o):null,r("div",{className:"py-0.5",children:[e?n("div",{className:`font-medium text-base mb-1 ${d.title}`,children:e}):null,t?n("div",{className:`text-sm ${d.description}`,children:t}):null,c?.length?n(le,{className:"mt-1 text-m-md",items:c,isDotted:s,version:m}):null]})]})}));function be(e){return n("div",{className:"mb-3",children:n("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function fe(e){return e?.src?n(y,{className:"pb-3 mr-auto",image:e}):null}const ye={primary:"bg-white",secondary:"bg-primary-main text-white"},Ne=l((({context:e,title:t,description:l,cards:a=[],className:o,orientation:c="horizontal"})=>r("section",{className:`relative font-sans text-primary-text bg-white px-4 py-6 overflow-hidden ${o}`,children:[r("div",{className:"flex flex-col items-center mb-5",children:[t?n(i,{headingType:"h3",className:`text-center ${l?"mb-2":"mb-5"}`,title:t}):null,l?n("div",{className:"font-normal text-m-md max-w-[600px] text-center mb-5",children:l}):null]}),ve(c,a,e)]})));function ve(e,t,r){return"horizontal"===e?n(T,{context:r,children:t?.map(Ie)}):n("div",{className:"grid gap-[14px]",children:t?.map(Ie)})}function Ie(e,t){return r("div",{className:`h-full justify-between box-border horizontal-list-item border-solid border rounded-md border-main-stroke p-4 flex flex-col\n ${ye[e.version??"primary"]}`,children:[r("div",{children:[e.image?.src?n("div",{className:"flex justify-center",children:n(y,{className:"mb-3.5",image:e.image})}):null,e.title?n("h3",{className:"font-medium text-m-title-xs m-0",children:e.title}):null,e.description?we(e):null,e.items?.length?Ce(e.items,e.isDotted,e.version):null]}),e?.button?.text?(l=e.button,n(Y,{className:"mt-3",appendLeft:l?.icon&&n(y,{image:l?.icon,width:"24px",height:"24px",asSVG:!0}),...l})):null]},t);var l}function we(e){return n("div",{className:"text-secondary-text mt-1 text-m-sm "+("secondary"===e.version?"text-white opacity-80":""),children:e.description})}function Ce(e,t,l="primary"){return n("section",{className:"mt-3",children:e.map(((e,a)=>r("div",{children:[t?n("div",{className:ne(l)}):null,n("span",{className:"text-m-md font-medium",children:e.title}),n("span",{className:"text-m-sm pl-2 "+("primary"===l?"text-secondary-text":""),children:e.text})]},String(a))))})}const ke=e=>{if(!e.length)return;const[t]=e;t.isIntersecting},Se=l((({anchor:e,className:t,context:r,children:l,tag:a="section"})=>{const{IntersectionObserverTag:o}=r,i=a;return e?n(o,{tag:a,className:t,observerCallback:ke,observerOptions:{threshold:1},anchor:e,children:l}):n(i,{className:t,children:l})})),$e=l((({className:e="",documents:t,...r})=>n(Se,{className:`font-sans bg-white mt-[10px] ${e}`,...r,children:n("ul",{className:"flex flex-col text-sm text-secondary-text p-0",children:t?.length?De(t):null})}))),De=e=>e.map(((e,t)=>{const{text:r,...l}=e;return n("li",{className:"mb-4 list-none",children:n("a",{className:"hover:text-primary-main",role:"link",...l,children:r||null})},`list_item_${String(t)}`)})),Te={Headline:w,LinkDocs:M,TextBlock:ge,ProductBlock:pe,Gallery:Ne,LinkList:$e},Re=({blocks:e,context:t,className:n=""})=>e?.length?e.map(Be({context:t,className:n})):null,Be=({context:e,className:t})=>(r,l)=>{if(!r)return null;const{style:a,blockListType:o,...i}=r;if(!o||!(o in Te))return null;const c=N(a);return n(Te[o],{className:`${t} ${c}`,context:e,...i},`block_${l}`)},_e=l((({blocks:e,context:t})=>n("div",{className:"flex flex-wrap transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0",children:Re({context:t,blocks:e,className:"!px-0"})}))),Pe=l((({label:e,labelIcon:t,blocks:l,bordered:a,context:o})=>{const{hasContent:i,icon:c,handleToggle:s}=(({context:e,blocks:t,initialState:n=!1})=>{const[r,l]=e.useState(n),a=t?.length;return{isActive:r,hasContent:a,icon:r?"MinusIcon":"PlusIcon",handleToggle:e=>{const t=e.currentTarget;if(!t)return;l(!r);const n=t.nextSibling;n.style.maxHeight=n.style.maxHeight?"":`${n.scrollHeight}px`}}})({context:o,blocks:l});return r("li",{className:`${Le(a)} border-solid border-main-divider`,children:[r("button",{className:`border-none bg-transparent flex justify-between text-left w-full font-sans text-primary-text\n ${a?"":"py-[14px] px-0"}\n ${i?"group cursor-pointer":""}`,onClick:s,children:[r("span",{className:"text-m-title-xs pr-2.5 font-medium flex "+(i?"group-hover:text-primary-main":""),children:[t?n(y,{image:t,width:"24",height:"24",asSVG:!0,className:"mr-3"}):null,e]}),i?n(y,{image:c,width:"24",height:"24",asSVG:!0}):null]}),i?n(_e,{blocks:l,context:o}):null]})}));function Le(e){return e?"border p-4 rounded mb-4":"border-0 border-b last:border-b-0"}const Ae=l((({title:e,description:t,accordionItems:l,context:a,className:o="",bordered:c})=>r("section",{className:`py-6 px-4 font-sans bg-white text-primary-text ${o}`,children:[e?n(i,{headingType:"h3",className:"mb-2 text-center",title:e}):null,t?n("div",{className:"mb-5 text-m-md text-center",children:t}):null,l?.length?n("ul",{className:"list-none m-0 p-0",children:l.map(((e,t)=>n(Pe,{...e,context:a,bordered:c},`AccordionItem_${t}`)))}):null]}))),Me=(e=!1)=>e?"text-white":"",Ve=(e=!1)=>"text-m-sm mb-3.5 "+(e?"text-white":"text-secondary-text/80"),Ge=l((({icon:e,image:t,title:l,subtitle:a,isFillGradient:o})=>r("div",{role:"columnheader",children:[e?n(y,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",image:e,width:"63",height:"63"}):null,t?.src&&n("div",{className:"mb-3.5",children:n(y,{image:t})}),l?n(i,{headingType:"h4",className:Me(o),title:l}):null,a?n("div",{className:Ve(o),children:a}):null]}))),je=l((({cell:e,rowHeader:t,isFillGradient:r=!1})=>n("div",{className:"box-border flex flex-col",role:"cell",children:n("div",{className:"h-full border-main-divider border border-t-0 border-x-0",children:e.map(We(r,t))})}))),We=(e,t)=>({label:l,description:a},o)=>r("div",{className:"flex justify-between text-m-sm py-3.5",children:[n("div",{className:""+(e?"text-white/80":"text-secondary-text"),children:t}),r("div",{className:"basis-1/2",children:[l?n("div",{className:"text-right "+(e?"text-white":""),children:l}):null,a?n("div",{className:"text-right "+(e?"text-white/80":"text-secondary-text"),children:a}):null]})]},String(o)),Oe=l((({header:e,columnData:t,visibleRowLength:l=0,isFillGradient:a,showRow:o,onToggleColumn:i})=>{const c=t?.slice(0,o?t.length:l),s=a?"secondary":"primary";return r("div",{className:`border border-main-stroke rounded-md p-4 mb-3.5 ${a?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""}`,role:"row",children:[n(Ge,{...e,isFillGradient:a}),c?.length?c.map((({rowHeader:e,cell:t},r)=>n(je,{cell:t,rowHeader:e,isFillGradient:a},String(r)))):null,o&&Ue({header:e,buttonVersion:s}),Ee({onToggleColumn:i,isFillGradient:a,showRow:o})]})})),Ue=({header:e,buttonVersion:t})=>n(Y,{href:e.link.href,target:e.link.target,version:t,className:"font-medium text-m-sm mt-4 py-[11px]",children:e.link.text}),Ee=({onToggleColumn:e,isFillGradient:t,showRow:r})=>n("div",{className:"mt-5",role:"cell",children:n("a",{role:"link",onClick:e,className:"font-medium text-m-sm cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:r?"Скрыть":"Показать описание"})}),Fe=l((({className:e,context:t,title:l,rowHeaders:a,columns:o,visibleRowLength:c=0,isColoredFirstColumn:s=!1,orientation:d="vertical"})=>{const m=o?.map((({data:e,header:t})=>({header:t,column:e?.map(((e,t)=>({cell:e,rowHeader:a?.[t]?.title})))})))||[],[h,u]=t.useState(new Array(o?.length).fill(!c));return r("section",{className:`bg-white font-sans px-4 py-6 overflow-hidden text-primary-text relative ${e||""}`,children:[l?n(i,{headingType:"h3",className:"font-medium text-center m-0 mb-5",title:l}):null,He({tableData:m,context:t,visibleRowLength:c,isColoredFirstColumn:s,columnsViewState:h,handleToggleColumn:e=>{h[e]=!h[e],u([...h])},orientation:d,setColumnsViewState:u})]})})),He=({context:e,tableData:t,visibleRowLength:r,isColoredFirstColumn:l,columnsViewState:a,handleToggleColumn:o,orientation:i="horizontal",setColumnsViewState:c})=>n("div",{role:"table",children:t?.length?ze({orientation:i,context:e,columnsViewState:a,setColumnsViewState:c,tableData:t,visibleRowLength:r,isColoredFirstColumn:l,handleToggleColumn:o}):null}),ze=({orientation:e,context:t,columnsViewState:r,setColumnsViewState:l,tableData:a,visibleRowLength:o,isColoredFirstColumn:i,handleToggleColumn:c})=>"horizontal"===e?n(T,{context:t,onSlideChange:qe(r,l),children:a.map(Je({context:t,visibleRowLength:o,isColoredFirstColumn:i,columnsViewState:r,handleToggleColumn:c}))}):a.map(Je({context:t,visibleRowLength:o,isColoredFirstColumn:i,columnsViewState:r,handleToggleColumn:c})),Je=({context:e,visibleRowLength:t,isColoredFirstColumn:r,columnsViewState:l,handleToggleColumn:a})=>(o,i)=>n(Oe,{context:e,visibleRowLength:t,showRow:l[i],header:o.header,columnData:o.column,isFillGradient:0===i&&r,onToggleColumn:()=>a(i)},String(i)),qe=(e,t)=>()=>{t(new Array(e.length).fill(!1))};async function Ke(){try{const e=await fetch(Qe,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ye)});return await e.json()}catch(e){return console.error(e),Promise.resolve()}}const Qe="https://coins.rshb.ru/api/catalog/vue_storefront_magento_1_currency_rates_average/currency_rates_average/_search?size=10000",Ye={query:{bool:{must:[{term:{russian_region_code:"77"}},{term:{from_volume:"0"}},{terms:{currency_pair:["USD/RUB","EUR/RUB"]}}]}}},Ze=e=>e.reduce(((e,t)=>{const n=t.currency_first?.code;return e.some((e=>e.code===n))||e.push({code:n,buy:Xe(Number(t.rate_buy)),sell:Xe(Number(t.rate_sell))}),e}),[]),Xe=e=>Math.round(1e3*e)/1e3;var et;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD"}(et||(et={}));const tt=new Intl.NumberFormat("ru",{style:"currency",currency:et.RUB}),nt=e=>e?tt.format(e):"",rt="text-left text-m text-secondary-text",lt={USD:"DollarIcon",EUR:"EuroIcon"},at=l((({className:e,exchangeCurrencyItems:t})=>r("table",{className:`h-fit w-fit ${e}`,children:[n("thead",{children:r("tr",{children:[n("th",{className:rt,children:"Валюта"}),n("th",{className:`${rt} pl-11`,children:"Купить"}),n("th",{className:`${rt} pl-11`,children:"Продать"})]})}),n("tbody",{children:t.map((e=>ot(e)))})]}))),ot=e=>{const t=e?.code;return r("tr",{className:"pb-1 text-h6",children:[n("td",{className:"pt-4",children:r("div",{className:"flex items-center",children:[t?n(y,{image:{icon:lt[t]},width:"24",height:"24"}):null,n("span",{className:"ml-2",children:t})]})}),n("td",{className:"pt-4 pl-11",children:nt(e?.sell)}),n("td",{className:"pt-4 pl-11",children:nt(e?.buy)})]},t)},it=l((({className:e="",address:t,distance:l})=>r("div",{className:`flex ${e}`,children:[n(y,{image:{icon:"GpsIcon"},width:"24",height:"24",asSVG:!0}),r("div",{className:"ml-3",children:[t?n("p",{className:"text-primary-main m-0 mb-1 text-l",children:t}):null,l?r("p",{className:"text-secondary-text m-0 text-m",children:["Курс указан для ближайшего офиса - ",l]}):null]})]}))),ct=(e,t,n)=>{const r=Number(st(e))*Math.pow(t,n?-1:1);return Number.isInteger(r)?r:((e,t=2)=>{const n=Math.pow(10,t);return Math.round(parseFloat(String(e))*n)/n})(r)},st=e=>e.replace(/[^\d.,]/g,"").replace(",","."),dt=e=>{return(t=[[e=>e.value!==et.RUB&&e.oppositeValue!==et.RUB,()=>e.handleConvert(e.value,et.RUB)],[e=>e.value===et.RUB&&e.oppositeValue===et.RUB,()=>e.handleConvert(e.value,et.USD)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,n]=t.find((([t])=>t(e)))||[];return n})(e)?.();var t};function mt(e){return n(Y,{className:"py-4 mr-1",version:e?.version,href:e?.href,target:"_blank",children:e?.text})}const ht=l((({className:e="",id:t,name:r,type:l="text",placeholder:a,pattern:o,value:i,onChange:c})=>n("input",{className:e,id:t,name:r||t,type:l,pattern:o,placeholder:a,value:i,onChange:e=>{const t=e.target.validity.valid?e.target.value:i;c(t)}}))),ut=l((({className:e="",id:t,name:r,children:l,value:a,onChange:o})=>n("select",{className:e,id:t,name:r||t,value:a,onChange:e=>o(e.target.value),children:l}))),pt=l((({className:e="",value:t,selected:r,children:l})=>n("option",{className:e,value:`${t}`,selected:r,children:l})));function xt(e){const{placeholder:t,rates:l,selected:a,value:o,setValue:i,setSelected:c}=e;return r("div",{className:"relative flex items-center",children:[n(ht,{className:"h-13 border pl-4 pt-4 pb-4 rounded-md text-l w-full appearance-none -mr-12",placeholder:t,type:"text",value:o,onChange:i}),l.length?n(ut,{className:"h-9 -translate-x-4 bg-transparent",value:a,onChange:e=>c(e),children:l.map(((e,t)=>n(pt,{value:e.code,children:e.code},String(t))))}):null]})}const gt=l((({context:e,className:t="",currencyRatesBuy:n,currencyRatesSell:l,button:a})=>{const[o,i]=e.useState({inputSell:"",inputBuy:"",selectSell:n?.[0]?.code||et.RUB,selectBuy:l?.[0]?.code||et.USD}),c=e=>{i((t=>({...t,...e})))};return r("div",{className:`grid gap-[18px] pt-2 ${t}`,children:[xt({placeholder:"Хочу продать",rates:n,selected:o.selectSell,setSelected:bt(o,c,l),value:o.inputSell,setValue:e=>yt(c,l)(e,o.selectSell,o.selectBuy)}),xt({placeholder:"Получу",rates:l,selected:o.selectBuy,setSelected:ft(o,c,n),value:o.inputBuy,setValue:e=>Nt(c,n)(e,o.selectBuy,o.selectSell)}),a?.text?mt(a):null]})})),bt=(e,t,n)=>r=>{t({selectSell:r}),dt({value:r,oppositeValue:e.selectBuy,handleConvert:(r=e.selectSell,l=e.selectBuy)=>{yt(t,n)(e.inputSell,r,l)}})},ft=(e,t,n)=>r=>{t({selectBuy:r}),dt({value:r,oppositeValue:e.selectSell,handleConvert:(r=e.selectBuy,l=e.selectSell)=>Nt(t,n)(e.inputBuy,r,l)})},yt=(e,t)=>(n,r,l)=>{e({inputSell:st(n),selectBuy:l});const a=t.find((e=>e.code===l))?.buy||t.find((e=>e.code===r))?.sell;a&&e({inputBuy:String(ct(n,a,r===et.RUB)||"")})},Nt=(e,t)=>(n,r,l)=>{e({inputBuy:st(n),selectSell:l});const a=t.find((e=>e.code===l))?.sell||t.find((e=>e.code===r))?.buy;a&&e({inputSell:String(ct(n,a,r===et.RUB)||"")})},vt={address:"Москва, ул.Ленина д.28",distance:"6км"},It=l((({className:e="",context:t,title:l="Курсы обмена валют",button:a,...o})=>{const c=function(e){const{data:t}=e(Qe,Ke),n=t?.hits?.hits?.map((e=>e._source))||[];return n.length?Ze(n):n}(t.useAsyncData),s=c.filter((e=>e.buy));s.unshift({code:et.RUB});const d=c.filter((e=>e.sell));return d.push({code:et.RUB}),n(Se,{context:t,className:`bg-white text-primary-text font-sans p-9 box-border ${e}`,...o,children:n(ae,{context:t,title:n(i,{headingType:"h4",title:l,className:"whitespace-pre-wrap text-h4"}),children:r("div",{className:"flex",children:[r("div",{className:"mr-14 pt-4",children:[c?n(at,{className:"mb-[30px]",exchangeCurrencyItems:c}):null,n(it,{...vt})]}),c.length&&s.length&&d.length?n(gt,{className:"grow",context:t,currencyRatesBuy:s,currencyRatesSell:d,button:a}):null]})})})})),wt={"bg-white":"text-primary-main",transparent:"text-white"},Ct={"bg-white":"text-black",transparent:"text-white"},kt=l((({className:e="",href:t,children:l,targetBlank:a,bgColor:o="bg-white",hideTitle:i})=>r("a",{className:`inline-flex items-center font-sans no-underline ${e}`,href:t||"https://rshb.ru/",target:a?"_blank":"_self","aria-label":"Россельхозбанк",children:[n(y,{image:{icon:"Logo"},className:`${wt[o]} w-10 h-[38px]`,asSVG:!0}),i?null:n("span",{className:`${Ct[o]} text-sm font-medium ml-2.5`,children:l||"Россельхозбанк"})]}))),St=l((({className:e="",title:t="Мобильное приложение",description:l,href:a="#"})=>n("div",{className:`col-span-12 rounded-md cursor-pointer p-4 mt-6 mb-6 bg-secondary-light ${e}`,children:a?r("div",{className:"flex",children:[n("div",{className:"flex justify-center align-middle rounded-md bg-primary-main w-[50px] h-[50px]",children:n(kt,{className:"w-[33px]",bgColor:"transparent",hideTitle:!0})}),r("a",{href:a,target:"_blank",className:"flex flex-col justify-center pl-3 font-sans",children:[n("div",{className:"text-s font-medium mb-[3px]",children:t}),n("div",{className:"text-s text-secondary-text",children:l})]})]}):null}))),$t=l((({className:e="",items:t,hasButton:l,context:a})=>{const o=a.useRouter(),{handlerDecorator:i}=a;return r("div",{className:e,children:[t?.length?t.map(Dt):null,l?n(Y,{version:"primary",className:"mb-6 w-full",...F({router:o,handlerDecorator:i},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),Dt=(e,t)=>{const{type:l,text:a,description:o}=e;return r("div",{className:"mb-4",children:[n("div",{children:Tt(l,a)}),n("div",{className:"mt-1 font-sans text-s-light text-secondary-text",children:o})]},String(t))},Tt=(e,t="")=>{switch(e){case"tel":return n("a",{className:"font-sans text-xl-light text-primary-text no-underline",href:`tel:${Rt(t)}`,children:t});case"email":return n("a",{className:"font-sans text-xl-light text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return n("span",{children:t})}},Rt=e=>e.replaceAll(/\D/g,""),Bt=l((({className:e="",index:t,text:r,href:l,target:a,onClick:o})=>n("a",{className:`font-sans text-secondary-text hover:text-primary-main inline-block no-underline ${e}`,href:l,target:a,onClick:o,children:r||`Документ ${t}`}))),_t=l((({title:e,links:t,className:l="",context:a})=>{const o=a.useRouter(),{handlerDecorator:i}=a;return r("div",{className:l,children:[n("span",{className:"text-primary-text font-sans font-medium text-sm",children:e}),t?.length?n("div",{className:"flex flex-col gap-2 pt-3",children:t.map(((e,t)=>n(Bt,{index:t,className:"font-normal text-sm",...F({router:o,handlerDecorator:i},e)},String(t))))}):null]})})),Pt=[{origins:["t.me","telegram.org"],icon:{icon:"TelegramIcon"},label:"Телеграм"},{origins:["vk.com"],icon:{icon:"VKIcon"},label:"ВКонтакте"},{origins:["ok.ru"],icon:{icon:"OkIcon"},label:"Одноклассники"},{origins:["apps.apple.com"],icon:{icon:"AppleIcon"},label:"App Store"},{origins:["play.google.com"],icon:{icon:"PlayMarketIcon"},label:"Google Play"}],Lt=l((({href:e,version:t="primary"})=>{const{icon:r,label:l}=Pt.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};if(!r)return null;return n("a",{className:`flex items-center justify-center rounded-md w-14 h-14 group box-border ${"secondary"===t?"bg-secondary-light hover:bg-secondary-hover":"border-main-divider border-solid border-[1px] hover:bg-primary-main"} ${"primary"===t?"hover:text-black":""}`,href:e,"aria-label":l,target:"_blank",rel:"noopener noreferrer",children:r?n(y,{image:r,imageClassName:"group-hover:text-white",width:"24",height:"24",asSVG:!0}):null})})),At=l((({className:e,media:t,version:r,context:l})=>{const a=l.useRouter(),{handlerDecorator:o}=l;return n("div",{className:`flex gap-2 items-start justify-start pt-6 pb-6 ${e||""}`,children:t?.map(((e,t)=>n(Lt,{version:r,...F({router:a,handlerDecorator:o},e)},String(t))))})})),Mt=l((({className:e="",index:t,text:r,href:l,target:a,onClick:o})=>n("a",{className:`font-sans text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e}`,href:l,target:a,onClick:o,children:r||`Документ ${t}`}))),Vt=l((({className:e,links:t,context:l})=>{const a=l.useRouter(),{handlerDecorator:o}=l;return r("div",{className:`${e||""}`,children:[n("div",{className:"py-6",children:n("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?n("div",{className:"flex flex-col justify-start items-start gap-2",children:t.map(((e,t)=>n(Mt,{index:t,className:"font-normal",...F({router:a,handlerDecorator:o},e)},String(t))))}):null]})}));function Gt(e){const{data:t}=e(Wt(),jt);return t||{}}async function jt(){const e=await fetch(Wt());return await e.json()}function Wt(){return`/wcms-resources/${d.SITEMAP||"sitemap"}.json`}const Ot=l((({className:e,context:t,isMobile:l=!1})=>{const{term:a,setTerm:o}=t.useSearch(),i=l?"font-normal text-sm":"text-l-light",c=l?" placeholder-transparent font-normal":"font-light h-full",s=l?"some search":void 0;return r("form",{className:`font-sans relative ${e}`,children:[r("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[n("div",{className:l?"w-[20px] h-[20px]":"w-[24px] h-[24px]",children:n(y,{image:"LoupeIcon",width:"24",height:"24"})}),a?null:n("label",{htmlFor:"search-bar-input",className:`text-secondary-text ${i}`,children:"Поиск по сайту"})]}),n("input",{id:"search-bar-input",className:`h-12 pl-12 w-full peer text-l text-black border border-solid rounded box-border\n outline-none pr-[6%] border-main-divider focus:border-primary-text ${c}`,value:a,onChange:e=>o(e.target.value),type:"text",name:"search-bar-input",placeholder:s}),l?n("button",{className:"visible peer-placeholder-shown:invisible absolute top-2 right-3 w-6 h-6 p-1 bg-transparent cursor-pointer border-none",onClick:e=>{e.preventDefault(),o("")},children:n(y,{image:"CloseIcon",width:"24",height:"24"})}):n(Y,{version:"primary",text:"Найти",className:"invisible peer-focus:visible absolute top-1 right-1",onClick:e=>{e?.preventDefault(),console.log("click")},children:n("div",{className:"font-normal text-sm px-9 py-[9px]",children:"Найти"})})]})})),Ut=l((({className:e="",context:t})=>n(Ot,{context:t,className:e,isMobile:!0}))),Et=e=>e?.map((e=>({label:e.text||"",blocks:[{accordionBlockType:"LinkList",documents:e.items||[]}]}))),Ft=l((({className:e="",documents:t,relatedEnterprises:l,contacts:a,socialMedia:o,context:i,horizontalNavigationTitle:c})=>{const s=Gt(i.useAsyncData),d=s?.dispositions;return r("footer",{className:`px-4 py-[26px] bg-white ${e}`,children:[n($t,{className:"overflow-hidden",items:a,context:i,hasButton:!0}),n(Ae,{context:i,className:"!p-0 mb-4",accordionItems:Et(s.topItems)}),n("div",{children:d?.map(Ht)}),n(St,{context:i,title:"Мобильное приложение",description:"Загрузить для IOS и Android"}),n(Ut,{context:i,className:"grow"}),n(At,{className:"pb-4",media:o,context:i}),n(_t,{title:c,links:l,context:i}),n(Vt,{links:t,context:i})]})})),Ht=(e,t)=>{const{icon:l,href:a,text:o}=e;return r(Y,{version:"link",href:a,className:"flex text-sm mb-4",children:[l?n(y,{className:"pr-1",image:l,width:"24",height:"24",asSVG:!0}):null,n("span",{className:"pl-2.5 font-medium text-primary-text",children:o})]},`footer-${t}`)},zt=(e,t,n=((e,t)=>t.startsWith(e)))=>n(G(e),(e=>(e||"").replace(O,""))(G(V(e)?t.href:t.pathname))),Jt=e=>t=>zt(t.href,e),qt=e=>t=>t.items?.some(Jt(e))||zt(t.href,e)||((e,t)=>j(e)===j(t.href))(t.href,e),Kt=e=>t=>e?.href===t?.href,Qt=(e,t)=>{return(r=e,l=t,(r||[]).map((e=>l?.find(Kt(e))||e))).concat((n=e,(t||[]).filter((e=>!n?.find(Kt(e))))));var n,r,l},Yt="absolute left-0 -bottom-3 w-full h-[2px]",Zt=l((({className:e="",text:t,href:l,target:a,active:o,onClick:i,children:c,bgColor:s="bg-white"})=>r("a",{className:`relative inline-block bg-transparent text-center no-underline ${e}`,href:l,target:a,onClick:i,children:[n("span",{className:Xt(s,o),children:t||c}),o?n("div",{className:en(s,o)}):null]}))),Xt=(e,t=!1)=>{let n="text-white";return"bg-white"===e&&(n=t?"text-primary-main":"text-secondary-text hover:text-primary-main"),`${n} font-sans font-normal text-sm`},en=(e,t=!1)=>t?`${"bg-white"===e?"bg-primary-main":e} ${Yt}`:Yt,tn=l((({context:e,burgerSubMenu:t,onClick:l,defaultLocation:a="",children:o})=>{const[i,c]=e.useGeolocation(a);return r("div",{className:"absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20",children:[n("button",{className:"absolute top-4 right-4 border-none bg-transparent cursor-pointer",onClick:l,children:n(y,{image:"CloseIcon",width:"24",height:"24",asSVG:!0})}),r("button",{onClick:c,className:"flex items-center text-sm text-secondary-text p-0 mb-4 bg-transparent cursor-pointer",children:[n(y,{image:"GeolocationIcon",width:"20",height:"20",className:"text-primary-main box-border mr-2",asSVG:!0}),i]}),o,n("div",{className:"mb-7",children:t?.map(nn)}),n(Ut,{context:e,className:"grow"})]})})),nn=(e,t)=>{const{icon:l,href:a,text:o}=e;return r("a",{href:a,className:"flex text-sm mb-4 hover:text-primary-main",children:[l?n(y,{className:"text-primary-main pr-1",image:l,width:"24",height:"24",asSVG:!0}):null,n("span",{className:"pl-0.5 font-medium",children:o})]},`headerSubMenu-${t}`)},rn=l((({onClick:e,bgColor:t})=>r("div",{className:"flex items-center justify-between border-0 border-b border-main-divider h-[50px]",children:[r("div",{className:"flex items-center",children:[n("button",{className:"pl-0 pr-4 border-0 bg-transparent cursor-pointer",onClick:e,"aria-label":"Открыть меню",children:n(y,{image:{icon:"BurgerIcon",iconVersion:"bg-white"===t?"black":"white"},className:"text-primary-text",width:"24",height:"24",asSVG:!0})}),n(kt,{bgColor:t})]}),n("button",{className:("bg-white"===t?"text-primary-main":"text-white")+" text-sm border-0 bg-transparent cursor-pointer",children:"Войти"})]}))),ln=l((({className:e="",defaultLocation:t,bgColor:l="bg-white",context:a,topItems:o})=>{const i=a.useRouter(),c=Gt(a.useAsyncData),s=c?.dispositions,{handlerDecorator:d}=a,m=Qt(c.topItems,o).find(qt(i))?.items,h=(e=>(t=[])=>{const n=t?.filter(Jt(e));return n?.length?(r=e=>e.href?.length||0,e=>e.reduceRight(((e,t)=>r(e)>r(t)?e:t)))(n):void 0;var r})(i)(m),[u,p]=a.useState(!1),x=()=>p(!u);return r("header",{className:`${l} ${e}`,children:[r("div",{className:"container px-4 py-0 box-border",children:[n(rn,{onClick:x,bgColor:l}),n("nav",{className:"flex items-center m-0 p-0 overflow-y-hidden w-full h-[50px]",children:n("div",{className:"flex no-scrollbar horizontal-list h-full items-center",children:m?.map(((e,t)=>an({...F({router:i,handlerDecorator:d},e),active:e===h,bgColor:l},t)))})})]}),u?n(tn,{context:a,onClick:x,burgerSubMenu:s,defaultLocation:t,children:n(Ae,{context:a,accordionItems:Et(c.topItems),className:"!p-0 mb-4"})}):null]})})),an=(e,t)=>n(Zt,{className:"mr-8 whitespace-nowrap text-sm",...e},String(t)),on=e=>{const t="col-span-",n=e.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12};function cn(e=""){const t=on(e);return t<=4?"S":t<=8?"M":"L"}function sn(e=""){const t=on(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}function dn(e=""){const t=on(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const mn=l((({className:e,context:t,title:l,description:a="Блок в разработке...",...o})=>r(Se,{context:t,className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${dn(e)} ${sn(e)} `,...o,children:[n(w,{context:t,className:"!p-0 max-w-[600px]",title:l,description:a,headlineVersion:cn(e)}),n("figure",{className:"m-0 min-w-[600px]",children:hn()})]}))),hn=(e=3)=>pn(100,e).map((e=>Math.floor(e))).map(un),un=(e,t)=>n("div",{style:{width:`${e||100}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),pn=(e,t)=>[e].concat(t>0?pn(e/1.618,t-1):[]),xn={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},gn=l((({block:e,context:t,className:r=""})=>n("section",{className:`flex grow-0 shrink-0 basis-full px-4 pt-6 ${xn[e?.version??"primary"]} ${r}`,role:"listitem",children:n("div",{className:"flex grow",children:n(se,{context:t,...e})})}))),bn=l((({className:e,context:t,slides:r=[]})=>{const l=r.map((e=>e.productBlock));return n("section",{className:`font-sans bg-white overflow-hidden w-100 pb-6 ${e||""}`,children:n(T,{context:t,children:l.map(((e,r)=>n(gn,{block:e,context:t},String(r))))})})})),fn={primary:{background:"bg-white",title:"text-primary-text",description:"text-secondary-text",iconText:"text-secondary-text",iconBackground:"bg-main-divider",iconConnector:"bg-secondary-light"},secondary:{background:"bg-primary-main",title:"text-white",description:"text-white/80",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white"}},yn=e=>fn[e],Nn={normal:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",small:"h-[50px] w-[50px] min-w-[50px] min-h-[50px]"},vn={normal:"min-h-[70px]",small:"min-h-[50px]"},In=l((({className:e,title:t,description:l,showLines:a=!0,steps:o,size:c="normal",version:s="primary"})=>{const d=yn(s);return r("section",{className:`box-border font-sans bg-white px-4 py-6 flex flex-col\n ${d.background} ${d.title} ${e||""}`,children:[t?n(i,{headingType:"h3",className:`text-center ${d.title}`,title:t}):null,l?n("p",{className:`text-m text-center ${d.description} ${t?"mt-2":""}`,children:l}):null,o?.length?n("div",{className:"box-border py-0.5 mb-0.5 mt-5",children:n("div",{className:"flex flex-col justify-between gap-x-[101px]",children:o.map(wn(c,s,a))})}):null]})})),wn=(e,t,l)=>(a,o,i)=>{const c=i.length-1===o,s="normal"===e?"ml-[34px]":"ml-6",d=yn(t);return n("div",{children:r("div",{className:"flex flex-row text-center relative",children:[r("div",{className:"overflow-hidden",children:[Cn(e,t),c?null:n("div",{className:`min-h-8 h-full w-[2px] ${l?d.iconConnector:""} ${s}`})]}),r("div",{className:`flex flex-col justify-center h-fit ${vn[e]}`,children:[a.label?n("div",{className:"font-medium text-m-title-xs m-0 text-left mb-1",children:a.label}):null,a.description?n("div",{className:`text-s ${d.description} text-left`,children:a.description}):null]})]})},String(o))},Cn=(e,t)=>(r,l)=>{const a=yn(t),o="normal"===e?"38":"27",i="normal"===e?"text-m-title":"text-m-title-xs";return n("div",{className:`${Nn[e]} ${a.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`,children:n("span",{className:`font-medium flex self-center ${a.title} ${i}`,children:(c=r?.icon,Boolean(c?.icon||c?.src)?n(y,{image:r.icon,width:o,height:o,asSVG:!0}):n("span",{children:l+1}))})});var c},kn=l((({title:e,icon:t})=>r("div",{className:"flex gap-2.5 mb-2",children:[e?n(i,{headingType:"h3",className:"font-medium",title:e}):null,t?n(y,{className:"ml-auto max-w-6 max-h-6",image:t,width:"24px",height:"24px"}):null]}))),Sn=e=>e?.alt||e?.title||s[e?.icon?e.icon:""],$n=l((({header:e,data:t})=>r("div",{className:"rounded-md border-main-stroke h-full box-border border p-4",children:[n(kn,{...e}),t?.length?t.map(Dn):null]}))),Dn=({label:e,description:t,list:l,image:a,buttons:o},i)=>r("div",{children:[i>0&&n("div",{className:"border-main-divider border border-solid border-t-0 border-x-0 my-2"}),e?n("div",{className:"text-m-sm m-0",children:e}):null,t?n("div",{className:"text-m-sm text-secondary-text mt-[3px]",children:t}):null,l?.items?.length?Tn(l):null,a?n(y,{image:{...a,className:"m-0"}}):null,o?.length?Rn(o):null]},String(i)),Tn=e=>n(le,{className:"flex flex-col justify-between items-start text-m-sm",version:"gray",items:e.items,isDotted:e.isDotted??!0}),Rn=e=>n("div",{children:e.map((({icon:e,rounded:t,...r},l)=>n(Y,{className:`mt-3 ${l>0&&t?"ml-2.5":""} ${e?"w-12 h-12":""}`,ariaLabel:Sn(e),rounded:t,appendLeft:e?n(y,{image:e,width:"24px",height:"24px",asSVG:!0}):null,...r,"aria-label":e},String(l))))}),Bn=l((({tiles:e,context:t})=>n(T,{context:t,children:e.map(((e,t)=>n($n,{...e},String(t))))}))),_n=l((({tiles:e})=>n("div",{className:"flex flex-col gap-3.5",children:e.map(((e,t)=>n($n,{...e},String(t))))}))),Pn=l((({className:e,context:t,title:l,description:a,columns:o,rowHeaders:c,orientation:s="vertical"})=>{const d=An(o),m=Mn(c,d);return r("section",{className:`px-4 py-6 bg-white font-sans text-primary-text overflow-x-hidden ${e}`,children:[l?n(i,{headingType:"h2",className:`text-center ${a?"mb-2":"mb-5"}`,title:l}):null,a?n("div",{className:"mb-5 text-center text-m-md",children:a}):null,m?.length?Ln(s,m,t):null]})}));function Ln(e,t,r){return"vertical"===e?n(_n,{tiles:t}):n(Bn,{context:r,tiles:t})}const An=e=>e?.[0].data?e[0].data:[],Mn=(e,t)=>e?.map(((e,n)=>({header:e,data:t?.[n]||[{}]}))),Vn={Accordion:Ae,ComparisonTable:Fe,ExchangeRateTile:It,Footer:Ft,Gallery:Ne,Header:ln,Headline:w,LinkDocs:M,LinkList:$e,MobileAppTile:St,ProductBlock:pe,ProductGallery:bn,StepsBlock:In,TariffsTable:Pn,TextBlock:ge,Placeholder:mn},Gn=l((({className:e,onClick:t,ariaLabel:r})=>n("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":r,children:jn()}))),jn=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n("path",{...e,strokeMiterlimit:"10",d:"M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"}),n("path",{...e,d:"M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"})]})},Wn=l((({className:e,context:t,...l})=>{const a=t.useLikeService();return r(Se,{tag:"div",context:t,className:`border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${e||""}`,...l,children:[n(Gn,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),n(Gn,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),n("span",{className:"select-none",children:a.likeCount})]})})),On=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),Un=l((({className:e="",context:t,blocksRegistry:l,data:a={},blockDecorator:o=On})=>{const{style:i,blocks:c,slots:s={},likeControl:d,colorPalette:m="pc"}=a,{header:h}=s;return r("section",{className:`relative ${N(i)} ${e}`,"data-theme":m,children:[h?.blocks?.length?n("div",{className:`${N(h?.style)}`,children:h.blocks.map(((e,n)=>En({block:e,blockDecorator:o,blocksRegistry:l,context:t},n)))}):null,c?.length?n("div",{className:"container grid grid-cols-12 gap-1",children:c.map(((e,n)=>En({block:e,blockDecorator:o,blocksRegistry:l,context:t},n)))}):null,d?n("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:n(Wn,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t},"LikeControl")}):null]})}));function En({block:e,blockDecorator:t,blocksRegistry:r,context:l},a){const{type:o}=e;o&&o in r||console.warn(`No block with "${o}" is registered`);const i=r[o||"Placeholder"]||mn;return t({blockClassName:`scroll-mt-12 ${N(e.style)}`,block:e,render:e=>{const{version:t,content:r,anchor:c}=e.block;return n(i,{className:e.blockClassName,version:t,context:l,anchor:c,...r},`${o}-${a}`)}},`block-${a}`)}e.Blocks=Vn,e.ContentPage=Un,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=function(e,t=""){async function n(){try{const e=JSON.parse(globalThis.localStorage.getItem(a)||"");if(e?.token)return e}catch(e){}try{const e=await fetch(`${t}/assist/v1/public/auth`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:n,name:r}=await e.json();return globalThis.localStorage.setItem(a,JSON.stringify({token:n,name:r})),{token:n,name:r}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...r){if(!r.length)return[];const{token:l}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l},body:JSON.stringify({node_ids:r})}),{likes:a}=await n.json();return a||[]}catch(e){return console.error(e),[]}},like:async function(r){if(!r)return 0;const{token:l,name:a}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l,UserID:a},body:JSON.stringify({node_id:r,user_name:a})}),{likes:o}=await n.json();return o||0}catch(e){return console.error(e),0}},dislike:async function(r){if(!r)return 0;const{token:l,name:a}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l,UserID:a},body:JSON.stringify({node_id:r,user_name:a})}),{likes:o}=await n.json();return o||0}catch(e){return console.error(e),0}}}},e.joinList=function(e){return t=>t.reduce(((t,n,r)=>t.length?t.concat({...e,key:r},n):[n]),[])},e.projectSettings=d,e.setup=t,e.url=W,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";const t=(e,n)=>{t._jsx=e,t._jsxs=n||e};t.vue=e=>{t(((t,{children:n,dangerouslySetInnerHTML:r,...l}={})=>{const a=Object.assign({},l,r?{innerHTML:r.__html}:{});return e(t,a,"string"!=typeof t?()=>n:n)}))};const n=(...e)=>t._jsx(...e),r=(...e)=>t._jsxs(...e),l=e=>(e._tmpl||(e._tmpl=function(t,n){const{children:r,...l}=t||{},a=n?.slots?.default,i=r||a&&a();return e(Object.assign(l,i&&{children:i}),n)},e._tmpl.inheritAttrs=!1),e._tmpl);const a="likesToken";const i={h0:"text-m-title",h1:"text-m-title",h2:"text-m-title",h3:"text-h6",h4:"text-m-title-xs",h5:"text-m-title-xs",h6:"text-m-title-xs"},o=l((e=>{const{className:t,headingType:r="h3",title:l,as:a="h3"}=e;return n(a,{className:`font-sans font-medium m-0 ${i[r]} ${t||""}`,children:l})}));var s,c;!function(e){e.ActualBalanceIcon="ActualBalanceIcon",e.AirPlane="AirPlane",e.AppleIcon="AppleIcon",e.ArrowDownIcon="ArrowDownIcon",e.ArrowLeftIcon="ArrowLeftIcon",e.ArrowUpIcon="ArrowUpIcon",e.AtmIcon="AtmIcon",e.BankIcon="BankIcon",e.BurgerIcon="BurgerIcon",e.Calendar2Icon="Calendar2Icon",e.CalendarCircleIcon="CalendarCircleIcon",e.CalendarIcon="CalendarIcon",e.CalendarTickIcon="CalendarTickIcon",e.CardIcon="CardIcon",e.CardPosIcon="CardPosIcon",e.CardTickIcon="CardTickIcon",e.CardWithGemIcon="CardWithGemIcon",e.CarIcon="CarIcon",e.ChartSquareIcon="ChartSquareIcon",e.CinemaIcon="CinemaIcon",e.ClockIcon="ClockIcon",e.CloseIcon="CloseIcon",e.ComfortableCompIcon="ComfortableCompIcon",e.CreditCardsIcon="CreditCardsIcon",e.DiscountShapeIcon="DiscountShapeIcon",e.DocIcon="DocIcon",e.DocIconMonoColor="DocIconMonoColor",e.DocsIcon="DocsIcon",e.DocumentTextIcon="DocumentTextIcon",e.DollarIcon="DollarIcon",e.DoneIcon="DoneIcon",e.EarthIcon="EarthIcon",e.EmptyWalletChangeIcon="EmptyWalletChangeIcon",e.EmptyWalletIcon="EmptyWalletIcon",e.EuroIcon="EuroIcon",e.GeolocationIcon="GeolocationIcon",e.GlassIcon="GlassIcon",e.GlobalIcon="GlobalIcon",e.GpsIcon="GpsIcon",e.GridIcon="GridIcon",e.InterestGrowthIcon="InterestGrowthIcon",e.InterestIcon="InterestIcon",e.JCBIcon="JCBIcon",e.Logo="Logo",e.LoupeIcon="LoupeIcon",e.MasterCardIcon="MasterCardIcon",e.MinusIcon="MinusIcon",e.MirIcon="MirIcon",e.MoneyIcon="MoneyIcon",e.MoneyInsuranceIcon="MoneyInsuranceIcon",e.MonitorMobileIcon="MonitorMobileIcon",e.NewDocIcon="NewDocIcon",e.OfficeIcon="OfficeIcon",e.OkIcon="OkIcon",e.PassSendIcon="PassSendIcon",e.PercentageRoundIcon="PercentageRoundIcon",e.PercentageSquareIcon="PercentageSquareIcon",e.PersonalCardIcon="PersonalCardIcon",e.PlayMarketIcon="PlayMarketIcon",e.PlusIcon="PlusIcon",e.PowerIcon="PowerIcon",e.Profile2UserIcon="Profile2UserIcon",e.ProfileIcon="ProfileIcon",e.PumpkinIcon="PumpkinIcon",e.RoundRubleIcon="RoundRubleIcon",e.SafeIcon="SafeIcon",e.ShieldTickIcon="ShieldTickIcon",e.SignDocsIcon="SignDocsIcon",e.SmallClockIcon="SmallClockIcon",e.SoundIcon="SoundIcon",e.TelegramIcon="TelegramIcon",e.UnionPayIcon="UnionPayIcon",e.UserTickIcon="UserTickIcon",e.VisaIcon="VisaIcon",e.VKIcon="VKIcon",e.WalletAdd2Icon="WalletAdd2Icon",e.WalletAddIcon="WalletAddIcon",e.WalletIcon="WalletIcon",e.WalletWithMoneyIcon="WalletWithMoneyIcon",e.WateringCan="WateringCan"}(s||(s={})),function(e){e.ActualBalanceIcon="Деньги",e.AirPlane="Самолет",e.AppleIcon="Лого «Apple»",e.ArrowDownIcon="Стрелка 'Вниз'",e.ArrowLeftIcon="Стрелка",e.ArrowUpIcon="Стрелка вверх",e.AtmIcon="Банкомат",e.BankIcon="Банк",e.BurgerIcon="Бургер",e.Calendar2Icon="Календарь 2",e.CalendarCircleIcon="Скруглённый календарь",e.CalendarIcon="Календарь",e.CalendarTickIcon="Календарь с галочкой",e.CardIcon="Кред. карта",e.CardPosIcon="Кред. карта под наклоном",e.CardTickIcon="Кред. карта с галочкой",e.CardWithGemIcon="Карта с драгоценностями",e.CarIcon="Машина",e.ChartSquareIcon="Деньги внутри кошелька",e.CinemaIcon="Кино",e.ClockIcon="Часы",e.CloseIcon="Крестик",e.ComfortableCompIcon="Кресло",e.CreditCardsIcon="Кредитные карты",e.DiscountShapeIcon="Скидка",e.DocIcon="Документ",e.DocIconMonoColor="Документ (одноцветный)",e.DocsIcon="Документы",e.DocumentTextIcon="Документ с текстом",e.DollarIcon="Доллар",e.DoneIcon="Зелёная 'галочка'",e.EarthIcon="Земля",e.EmptyWalletChangeIcon="Пустой кошелёк с возвратом",e.EmptyWalletIcon="Пустой кошелёк",e.EuroIcon="Евро",e.GeolocationIcon="Геолокация",e.GlassIcon="Зеркало",e.GlobalIcon="Глобус",e.GpsIcon="Gps",e.GridIcon="Сетка (белая)",e.InterestGrowthIcon="Диаграмма роста",e.InterestIcon="Скидка",e.JCBIcon="JCB",e.Logo="Logo",e.LoupeIcon="Лупа",e.MasterCardIcon="MasterCard",e.MinusIcon="Минус",e.MirIcon="МИР",e.MoneyIcon="Деньги",e.MoneyInsuranceIcon="Денежное страхование",e.MonitorMobileIcon="Монитор и мобильный",e.NewDocIcon="Новый документ",e.OfficeIcon="Офис",e.OkIcon="Лого «Одноклассники»",e.PassSendIcon="Бизнес",e.PercentageRoundIcon="Проценты (круг.)",e.PercentageSquareIcon="Проценты",e.PersonalCardIcon="Персональная карта",e.PlayMarketIcon="Лого «PlayMarket»",e.PlusIcon="Плюс",e.PowerIcon="Щит",e.Profile2UserIcon="Профиль, 2 персоны",e.ProfileIcon="Профиль",e.PumpkinIcon="Тыква",e.RoundRubleIcon="Рубль (круг.)",e.SafeIcon="Сейф",e.ShieldTickIcon="Безопасность",e.SignDocsIcon="Подписанные документы",e.SmallClockIcon="Маленькие часы",e.SoundIcon="Звук",e.TelegramIcon="Лого «Telegram»",e.UnionPayIcon="UnionPay",e.UserTickIcon="Пользователь",e.VisaIcon="Visa",e.VKIcon="Лого «VK»",e.WalletAdd2Icon="Пополнение карты",e.WalletAddIcon="Кошелёк с плюсом",e.WalletIcon="Кошелёк",e.WalletWithMoneyIcon="Кошелёк с деньгами",e.WateringCan="Добавить продукт"}(c||(c={}));const d=new class{_={PROD_BRANCH:"master",FORCED_DRAFT_FLOW:!1};setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ENABLE_ASSIST(){return this._.ENABLE_ASSIST}get SITEMAP(){return this._.SITEMAP}get CDN(){return this._.CDN}},m={normal:"text-primary-main",black:"text-black",white:"text-black invert"},h=l((({className:e="",imageClassName:t="",name:l="",alt:a=`Иконка ${c[l]||l}`,title:i=a,iconVersion:o="normal",asSVG:s,...h})=>{const u=`${d.CDN||""}icons/${l}.svg`;return s?r("svg",{className:e,...h,"aria-hidden":"true",children:[i?n("title",{children:i}):null,a?n("desc",{children:a}):null,n("use",{className:`${m[o]} ${t}`,href:`${u}#icon`,xlinkHref:`${u}#icon`})]}):n("img",{className:e,src:u,alt:a,title:i,...h,"aria-hidden":"true"})}));function u(e){return"string"==typeof e?"normal":e.iconVersion||"normal"}const p=(e,t)=>e.media&&t.media?e.media-t.media:0,x=l((({className:e="",image:t,imageClassName:l="",isMobile:a=!1})=>{if(!t)return null;return r("picture",{className:`${a?"flex":"flex-none"} ${e}`,children:[t?.sources?.length?t.sources.sort(p).map((({src:e,format:t,media:r,size:l},a)=>n("source",{srcSet:e,type:b(t),media:r?`(max-width: ${r}px)`:"",...l},`${a}_${e}`))):null,g(t,l,a)]})})),g=(e,t="",r=!1)=>{const l=e.title||"",a=e.alt||e.title,i=r?"m-auto":"m-0";return n("img",{src:e.src,className:`${i} ${t}`,alt:a,title:l,...e.size})};function b(e){return e?`image/${String(e)}`:void 0}const f=l((({className:e="",image:t,imageClassName:r="",isMobile:l,...a})=>{if(!t)return null;const i="string"==typeof t?t:t.icon;return i||""===i?i.length?n(h,{className:e,imageClassName:r,iconVersion:u(t),name:i,...a}):null:n(x,{className:e,imageClassName:r,image:t,isMobile:l})})),y=l((({className:e="",image:t})=>n(f,{className:e,image:t,isMobile:!0})));function N(e){return e?e.filter(Boolean).join(" "):""}const v={left:"text-left",center:"text-center",right:"text-right"},I={transparent:{background:"bg-transparent",text:"text-primary-text",description:"text-primary-text"},primary:{background:"bg-white",text:"text-primary-text",description:"text-primary-text"},secondary:{background:"bg-primary-main",text:"text-white",description:"text-white/80"}},w=l((({bgColorHeadline:e="transparent",className:t="",title:l,description:a,image:i,align:s="left"})=>{const c=I[e];return r("section",{className:`px-4 py-6 flex flex-col gap-2.5 ${c.background} ${t}`,children:[l?n(o,{headingType:"h2",className:`${c.text} ${v[s]}`,title:l}):null,a?n("p",{className:`font-normal text-m ${c.description} ${v[s]} `,children:a}):null,i?.src&&n("div",{className:"mt-2.5 mx-auto flex justify-center",children:n(y,{image:i})})]})})),C=l((({children:e,activeIndex:t,indexFraction:r,showDots:l})=>{const a=e=>n=>{if(e===t)return;const r=n.currentTarget.parentElement?.previousElementSibling;r?.children[e]?.scrollIntoView({behavior:"smooth",block:"nearest"})};return l&&e?.length?n("div",{className:"flex gap-2 mx-auto mt-5 w-fit",children:e?.map(((e,l)=>n("div",{onClick:a(l),className:"bg-primary-main opacity-30 w-1.5 h-1.5 min-w-1.5 min-h-1.5 rounded-full",style:k(l,t,r),"aria-hidden":!0},String(l))))}):null})),k=(e,t,n)=>{if(e<t||e>t+1)return;const r=1-n;return e===t?{opacity:""+(.3+.7*r),width:6+16*r+"px"}:{opacity:""+(.3+.7*n),width:6+16*n+"px"}},S=l((({className:e="",children:t,...r})=>n("div",{className:`snap-center snap-always min-w-full box-border ${e}`,role:"listitem",...r,children:t}))),$=e=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e}px`}),D=l((({className:e="",children:t,activeIndex:r,onScroll:l,gap:a=14,padding:i=16})=>n("div",{className:`overflow-auto flex horizontal-list no-scrollbar ${e}`,style:{...$(i),gap:`${a}px`},role:"list",onScroll:l,children:t?.length?t?.map(((e,t)=>n(S,{style:$(i/4),"aria-current":Boolean(r===t),children:e},String(t)))):n(S,{children:t})}))),T=l((({className:e,context:t,children:l,gap:a=14,padding:i=16,showDots:o=!0,onSlideChange:s})=>{const[c,d]=t.useState(0),[m,h]=t.useState(0),u={activeIndex:c,indexFraction:m,showDots:o,children:l};return r("div",{className:e,children:[n(D,{gap:a,padding:i,activeIndex:c,onScroll:e=>{const{scrollLeft:t,clientWidth:n,childElementCount:r,scrollWidth:l,children:o}=e?.currentTarget,m=o[0].offsetWidth-i/2,u=(({gap:e,padding:t,clientWidth:n,scrollWidth:r,childElementCount:l,itemWidth:a})=>{const i=r-n;if(2===l)return[[0,i],[i,r]];const o=a+e,s=n-e-t,c=l-2,d=new Array(l).fill(0).map(((e,t)=>0===t||t===c?[t>0?i-s:0,t>0?i:s]:[(t-1)*o+s,t*o+s]));return d[l-1]=[i,r],d})({gap:a,padding:i,clientWidth:n,scrollWidth:l,childElementCount:r,itemWidth:m}),{index:p,fraction:x}=((e,t)=>{const n=t.findIndex((([t,n])=>t<=e&&e<n));if(n<0)return{index:n,fraction:0};const[r,l]=t[n];return{index:n,fraction:(e-r)/(l-r)}})(t,u);p!==c&&s&&s(),d(p),h(x)},children:l}),n(C,{...u})]})})),R=l((({className:e,iconClassName:t,textClassName:l,suffixClassName:a,doc:i,icon:o})=>{const{text:s,fileSize:c,...d}=i;return r("a",{className:e,role:"link",...d,children:[o?n(y,{className:t,image:o,width:"24px",height:"24px",asSVG:!0}):null,s?r("span",{className:l,children:[s,n("span",{className:a,children:d?.href&&B(_(d.href),c)})]}):null]})})),B=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),_=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},P=l((({className:e="",doc:t,icon:r})=>n(R,{className:`flex h-full box-border ${e}`,iconClassName:"mr-3 min-w-6 min-h-6",doc:t,icon:r}))),L=l((({context:e,hasBorder:t=!0,documents:r,icon:l})=>n(T,{context:e,className:"text-s text-primary-main mt-5",children:r?.length?r.map(((e,r)=>n(P,{className:t?"rounded-md border-main-stroke border border-solid p-4":"",doc:e,icon:l},String(r)))):null}))),M=l((({hasBorder:e=!0,documents:t,icon:r})=>n("div",{className:"text-s text-primary-main flex flex-col mt-5 "+(e?"gap-3.5":"gap-2"),role:"list",children:t?.length?t.map(((t,l)=>n("div",{role:"listitem",children:n(P,{className:e?"rounded-md border-main-stroke border border-solid p-4":"",doc:t,icon:r})},String(l)))):null}))),A=l((({className:e="",context:t,title:l,description:a,icon:i={icon:"DocIconMonoColor"},documents:o,orientation:s="vertical",hasBorder:c=!0})=>r("section",{className:`font-sans text-primary-text py-6 px-4 bg-white overflow-x-hidden ${e}`,children:[n(w,{className:"!p-0 "+(a?"gap-2":"gap-5"),title:l,description:a,context:t,align:"center"}),"vertical"===s?n(M,{hasBorder:c,documents:o,icon:i}):n(L,{context:t,hasBorder:c,documents:o,icon:i})]}))),V=e=>e?.includes("//"),j=e=>(e||"").replace(/\/?\?.*/,""),G=e=>{if(!e||!V(e))return;const t=e,n=t.indexOf("//"),r=t.indexOf("/",n+"//".length);return-1!==r?t.substring(0,r):t};var W=Object.freeze({__proto__:null,isURL:V,withoutQuery:j,getOrigin:G,getHash:e=>{if(!e||!V(e))return;const t=e.indexOf("#");return-1!==t?e.substring(t,e.length):void 0},isHash:e=>e?.startsWith("#")});const O="/mobile",U=(e,t)=>{if(!e)return e;const n=G(t?.href);return n?e.replace(n,"")||"/":e},E=e=>e;function F({router:e,handlerDecorator:t=E},n){const r=((e,t)=>{if(!e)return e;const n=U(e,t)||"",r=t?.pathname.startsWith(O);return r&&!V(n)?`/mobile${n}`:n})(n.href,e);return{...n,href:r,"aria-label":n.text,onClick:t((t=>{const l=r&&!V(r),a=!n.target||"_self"===n.target;l&&a&&(t?.preventDefault(),e.push(r))}),n)}}const H=l((e=>{const{text:t,aboveText:l,appendLeft:a,appendRight:i}=e;return r("div",{className:z(e),children:[a||null,J(e)?r("div",{children:[n("div",{className:"text-xs text-left",children:l}),n("div",{className:"text-left "+(l?"text-s -mt-0.5":"text-l"),children:t})]}):null,i||null]})})),z=e=>{const{version:t,aboveText:n,rounded:r}=e;if("link"===t)return"";const l="gap-2 "+(n?"py-2.5 px-7":"py-4 px-9");return["flex items-center justify-center",J(e)?l:"h-12 w-12",r?"rounded-full":""].join(" ")},J=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),q={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active",link:"text-primary-main"},K={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text",link:""},Q="w-full text-center font-sans select-none",Y=l((({className:e,text:t,aboveText:r,appendLeft:l,href:a,target:i,onClick:o,children:s,disabled:c,rounded:d,version:m="primary",ariaLabel:h,...u})=>{const p=s??n(H,{text:t,aboveText:r,appendLeft:l,rounded:d,version:m});return c?n("div",{role:"button","aria-disabled":"true","aria-label":h,tabIndex:-1,className:`inline-block ${Q} ${K[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,children:p}):n("a",{className:`${Q} inline-block cursor-pointer no-underline ${q[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,href:a,target:i,onClick:o,"aria-label":h,role:a?"link":"button",...u,children:p})})),Z=l((({context:e,className:t="",buttons:r})=>{const{handlerDecorator:l}=e,a=e.useRouter();return r&&r?.length?n("div",{className:t,children:r.map(((e,t)=>function({icon:e,iconRight:t,...r},l){if(!r?.text)return null;return n(Y,e?{appendLeft:n(y,{image:e,width:"24",height:"24",asSVG:!0}),appendRight:n(y,{image:t,width:"24",height:"24",asSVG:!0}),...r}:{...r},String(l))}(F({router:a,handlerDecorator:l},e),t)))}):null}));const X={primary:"rounded-full inline-block mr-3 mt-2",secondary:"rounded-full inline-block mr-3 mt-2",gray:"rounded-full inline-block mr-3 mt-2",tile:"rounded-full inline-block mr-4 mt-3","tile-white":"rounded-full inline-block mr-4 mt-3"},ee={primary:"bg-primary-text",secondary:"bg-white",gray:"bg-secondary-text",tile:"bg-black","tile-white":"bg-white"},te=l((({className:e="",isDotted:t=!0,children:l,version:a="primary"})=>r("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t?n("div",{className:ne(a)}):null,n("span",{children:l})]}))),ne=e=>`${X[e]} ${ee[e]} ${{primary:"w-2 h-2 min-w-2 min-h-2",secondary:"w-2 h-2 min-w-2 min-h-2",gray:"w-1.5 h-1.5 min-w-1.5 min-h-1.5",tile:"w-[7px] h-[7px] min-w-[7px] min-h-[7px]","tile-white":"w-[7px] h-[7px] min-w-[7px] min-h-[7px]"}[e]}`,re={primary:"text-primary-text",secondary:"text-white",gray:"text-secondary-text",tile:"text-primary-text","tile-white":"text-white"},le=l((e=>{const{className:t="",itemClassName:r,isDotted:l,items:a,version:i="primary"}=e;return n("section",{className:`${re[i]} ${t}`,role:"list",children:a?.length?a.map(((e,t)=>n(te,{className:r,isDotted:l,version:i,children:e},String(t)))):null})})),ae=l((({className:e="",title:t="",children:l,buttons:a,image:i})=>r("div",{className:`font-sans flex flex-col grow h-full items-start ${e}`,children:[t,r("div",{className:"flex grow w-full justify-between",children:[r("div",{className:"flex flex-col justify-between w-full",children:[n("div",{children:l}),a?n("div",{children:a}):null]}),i]})]}))),ie={primary:"text-primary-text",secondary:"text-white"},oe={primary:"text-secondary-text",secondary:"text-white"};function se(e){let t="text-primary-main";return"secondary"===e&&(t="text-black"),`w-6 h-6 rounded-full box-border ${t}`}const ce=l((({className:e="",context:t,title:l,headlineVersion:a="L",description:i,benefits:o,benefitsVersion:s="normal",buttons:c,image:d,items:m,version:h="primary",isDotted:u=!0,label:p})=>r("div",{className:`w-full ${e}`,children:[r("div",{children:[p?he(p,h):null,n(w,{context:t,className:"!p-0 max-w-[600px]",title:l,description:i,bgColorHeadline:h,headlineVersion:a}),r(ae,{context:t,buttons:c?.length?n(Z,{context:t,buttons:c,className:"flex flex-col mt-5 gap-2.5"}):null,children:[o?.filter((e=>e.label))?.length?n("div",{className:"mt-3",children:o.map(((e,t)=>function({benefit:e,version:t="primary"},l){const a="secondary"===t;return r("div",{className:"flex gap-3 items-center mb-2.5 last:mb-0",children:[e.icon?n(y,{className:se(t),image:{...e?.icon,iconVersion:a?"white":"normal"},width:"24",height:"24",asSVG:!0}):null,n("div",{className:`text-l m-0 ${ie[t]}`,children:e.label}),e.description&&n("div",{className:`text-s ${oe[t]}`,children:e.description})]},String(l))}({benefit:e,version:h,benefitsVersion:s},t)))}):null,m?.length?n(le,{className:"mt-3 text-m",items:m,version:h,isDotted:u}):null]})]}),de(d)]})));function de(e){return e?.src?n(y,{imageClassName:"mt-5 mx-auto block",image:{className:"block",...e}}):null}const me={primary:"text-primary-main border-secondary-hover",secondary:"text-white/80"},he=(e,t)=>n("div",{className:`px-2.5 py-1.5 mb-5 rounded-md border-2 border-solid w-fit ${me[t]}`,children:e}),ue={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},pe=l((e=>{const{className:t="",version:r="primary"}=e;return n("section",{className:`font-sans bg-white px-4 py-6 ${ue[r]} ${t}`,children:n(ce,{...e})})})),xe={primary:{background:"bg-white",icon:"bg-primary-main text-white",title:"text-primary-text",description:"text-secondary-text"},secondary:{background:"bg-primary-main",icon:"bg-white text-primary-main",title:"text-white",description:"text-white"},"secondary-light":{background:"bg-primary-main/10",icon:"bg-primary-main text-white",title:"text-primary-text",description:"text-secondary-text"}},ge=l((({title:e,description:t,blockVersion:l="primary",iconVersion:a,image:i,className:o="",items:s,isDotted:c=!0})=>{const d=xe[l],m="secondary"===l?"secondary":"gray";return r("section",{className:`font-sans px-4 py-[18px] flex flex-col ${d.background} ${o}`,children:["small"===a?be(d.icon):null,"big"===a?fe(i):null,r("div",{className:"py-0.5",children:[e?n("div",{className:`font-medium text-base mb-1 ${d.title}`,children:e}):null,t?n("div",{className:`text-sm ${d.description}`,children:t}):null,s?.length?n(le,{className:"mt-1 text-m-md",items:s,isDotted:c,version:m}):null]})]})}));function be(e){return n("div",{className:"mb-3",children:n("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function fe(e){return e?.src?n(y,{className:"pb-3 mr-auto",image:e}):null}const ye={primary:"bg-white",secondary:"bg-primary-main text-white"},Ne=l((({context:e,title:t,description:l,cards:a=[],className:i,orientation:s="horizontal"})=>r("section",{className:`relative font-sans text-primary-text bg-white px-4 py-6 overflow-hidden ${i}`,children:[r("div",{className:"flex flex-col items-center mb-5",children:[t?n(o,{headingType:"h3",className:`text-center ${l?"mb-2":"mb-5"}`,title:t}):null,l?n("div",{className:"font-normal text-m-md max-w-[600px] text-center mb-5",children:l}):null]}),ve(s,a,e)]})));function ve(e,t,r){return"horizontal"===e?n(T,{context:r,children:t?.map(Ie)}):n("div",{className:"grid gap-[14px]",children:t?.map(Ie)})}function Ie(e,t){return r("div",{className:`h-full justify-between box-border horizontal-list-item border-solid border rounded-md border-main-stroke p-4 flex flex-col\n ${ye[e.version??"primary"]}`,children:[r("div",{children:[e.image?.src?n("div",{className:"flex justify-center",children:n(y,{className:"mb-3.5",image:e.image})}):null,e.title?n("h3",{className:"font-medium text-m-title-xs m-0",children:e.title}):null,e.description?we(e):null,e.items?.length?Ce(e.items,e.isDotted,e.version):null]}),e?.button?.text?(l=e.button,n(Y,{className:"mt-3",appendLeft:l?.icon&&n(y,{image:l?.icon,width:"24px",height:"24px",asSVG:!0}),...l})):null]},t);var l}function we(e){return n("div",{className:"text-secondary-text mt-1 text-m-sm "+("secondary"===e.version?"text-white opacity-80":""),children:e.description})}function Ce(e,t,l="primary"){return n("section",{className:"mt-3",children:e.map(((e,a)=>r("div",{children:[t?n("div",{className:ne(l)}):null,n("span",{className:"text-m-md font-medium",children:e.title}),n("span",{className:"text-m-sm pl-2 "+("primary"===l?"text-secondary-text":""),children:e.text})]},String(a))))})}class ke{static inst=new ke;subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]||=[],this.subscribers[e]?.push(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){this.subjectsStateMap[e]=t,this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}}const Se=e=>{if(!e.length)return;const[t]=e;t.isIntersecting},$e=l((({anchor:e,className:t,context:r,children:l,tag:a="section",labels:i})=>{const o=a,{IntersectionObserverTag:s}=r,[c,d]=r.useState(!0);return r.useEffect((()=>ke.inst.subscribe("tab",(e=>{d(!i?.length||!e.label||i.includes(e.label))}))),[i]),c?e?n(s,{tag:a,className:t,observerCallback:Se,observerOptions:{threshold:1},anchor:e,children:l}):n(o,{className:t,children:l}):null})),De=l((({className:e="",documents:t,...r})=>n($e,{className:`font-sans bg-white mt-[10px] ${e}`,...r,children:n("ul",{className:"flex flex-col text-sm text-secondary-text p-0",children:t?.length?Te(t):null})}))),Te=e=>e.map(((e,t)=>{const{text:r,...l}=e;return n("li",{className:"mb-4 list-none",children:n("a",{className:"hover:text-primary-main",role:"link",...l,children:r||null})},`list_item_${String(t)}`)})),Re={Headline:w,LinkDocs:A,TextBlock:ge,ProductBlock:pe,Gallery:Ne,LinkList:De},Be=({blocks:e,context:t,className:n=""})=>e?.length?e.map(_e({context:t,className:n})):null,_e=({context:e,className:t})=>(r,l)=>{if(!r)return null;const{style:a,blockListType:i,...o}=r;if(!i||!(i in Re))return null;const s=N(a);return n(Re[i],{className:`${t} ${s}`,context:e,...o},`block_${l}`)},Pe=l((({blocks:e,context:t})=>n("div",{className:"flex flex-wrap transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0",children:Be({context:t,blocks:e,className:"!px-0"})}))),Le=l((({label:e,labelIcon:t,blocks:l,bordered:a,context:i})=>{const{hasContent:o,icon:s,handleToggle:c}=(({context:e,blocks:t,initialState:n=!1})=>{const[r,l]=e.useState(n),a=t?.length;return{isActive:r,hasContent:a,icon:r?"MinusIcon":"PlusIcon",handleToggle:e=>{const t=e.currentTarget;if(!t)return;l(!r);const n=t.nextSibling;n.style.maxHeight=n.style.maxHeight?"":`${n.scrollHeight}px`}}})({context:i,blocks:l});return r("li",{className:`${Me(a)} border-solid border-main-divider`,children:[r("button",{className:`border-none bg-transparent flex justify-between text-left w-full font-sans text-primary-text\n ${a?"":"py-[14px] px-0"}\n ${o?"group cursor-pointer":""}`,onClick:c,children:[r("span",{className:"text-m-title-xs pr-2.5 font-medium flex "+(o?"group-hover:text-primary-main":""),children:[t?n(y,{image:t,width:"24",height:"24",asSVG:!0,className:"mr-3"}):null,e]}),o?n(y,{image:s,width:"24",height:"24",asSVG:!0}):null]}),o?n(Pe,{blocks:l,context:i}):null]})}));function Me(e){return e?"border p-4 rounded mb-4":"border-0 border-b last:border-b-0"}const Ae=l((({title:e,description:t,accordionItems:l,context:a,className:i="",bordered:s})=>r("section",{className:`py-6 px-4 font-sans bg-white text-primary-text ${i}`,children:[e?n(o,{headingType:"h3",className:"mb-2 text-center",title:e}):null,t?n("div",{className:"mb-5 text-m-md text-center",children:t}):null,l?.length?n("ul",{className:"list-none m-0 p-0",children:l.map(((e,t)=>n(Le,{...e,context:a,bordered:s},`AccordionItem_${t}`)))}):null]}))),Ve=(e=!1)=>e?"text-white":"",je=(e=!1)=>"text-m-sm mb-3.5 "+(e?"text-white":"text-secondary-text/80"),Ge=l((({icon:e,image:t,title:l,subtitle:a,isFillGradient:i})=>r("div",{role:"columnheader",children:[e?n(y,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",image:e,width:"63",height:"63"}):null,t?.src&&n("div",{className:"mb-3.5",children:n(y,{image:t})}),l?n(o,{headingType:"h4",className:Ve(i),title:l}):null,a?n("div",{className:je(i),children:a}):null]}))),We=l((({cell:e,rowHeader:t,isFillGradient:r=!1})=>n("div",{className:"box-border flex flex-col",role:"cell",children:n("div",{className:"h-full border-main-divider border border-t-0 border-x-0",children:e.map(Oe(r,t))})}))),Oe=(e,t)=>({label:l,description:a},i)=>r("div",{className:"flex justify-between text-m-sm py-3.5",children:[n("div",{className:""+(e?"text-white/80":"text-secondary-text"),children:t}),r("div",{className:"basis-1/2",children:[l?n("div",{className:"text-right "+(e?"text-white":""),children:l}):null,a?n("div",{className:"text-right "+(e?"text-white/80":"text-secondary-text"),children:a}):null]})]},String(i)),Ue=l((({header:e,columnData:t,visibleRowLength:l=0,isFillGradient:a,showRow:i,onToggleColumn:o})=>{const s=t?.slice(0,i?t.length:l),c=a?"secondary":"primary";return r("div",{className:`border border-main-stroke rounded-md p-4 mb-3.5 ${a?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""}`,role:"row",children:[n(Ge,{...e,isFillGradient:a}),s?.length?s.map((({rowHeader:e,cell:t},r)=>n(We,{cell:t,rowHeader:e,isFillGradient:a},String(r)))):null,i&&Ee({header:e,buttonVersion:c}),Fe({onToggleColumn:o,isFillGradient:a,showRow:i})]})})),Ee=({header:e,buttonVersion:t})=>n(Y,{href:e.link.href,target:e.link.target,version:t,className:"font-medium text-m-sm mt-4 py-[11px]",children:e.link.text}),Fe=({onToggleColumn:e,isFillGradient:t,showRow:r})=>n("div",{className:"mt-5",role:"cell",children:n("a",{role:"link",onClick:e,className:"font-medium text-m-sm cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:r?"Скрыть":"Показать описание"})}),He=l((({className:e,context:t,title:l,rowHeaders:a,columns:i,visibleRowLength:s=0,isColoredFirstColumn:c=!1,orientation:d="vertical"})=>{const m=i?.map((({data:e,header:t})=>({header:t,column:e?.map(((e,t)=>({cell:e,rowHeader:a?.[t]?.title})))})))||[],[h,u]=t.useState(new Array(i?.length).fill(!s));return r("section",{className:`bg-white font-sans px-4 py-6 overflow-hidden text-primary-text relative ${e||""}`,children:[l?n(o,{headingType:"h3",className:"font-medium text-center m-0 mb-5",title:l}):null,ze({tableData:m,context:t,visibleRowLength:s,isColoredFirstColumn:c,columnsViewState:h,handleToggleColumn:e=>{h[e]=!h[e],u([...h])},orientation:d,setColumnsViewState:u})]})})),ze=({context:e,tableData:t,visibleRowLength:r,isColoredFirstColumn:l,columnsViewState:a,handleToggleColumn:i,orientation:o="horizontal",setColumnsViewState:s})=>n("div",{role:"table",children:t?.length?Je({orientation:o,context:e,columnsViewState:a,setColumnsViewState:s,tableData:t,visibleRowLength:r,isColoredFirstColumn:l,handleToggleColumn:i}):null}),Je=({orientation:e,context:t,columnsViewState:r,setColumnsViewState:l,tableData:a,visibleRowLength:i,isColoredFirstColumn:o,handleToggleColumn:s})=>"horizontal"===e?n(T,{context:t,onSlideChange:Ke(r,l),children:a.map(qe({context:t,visibleRowLength:i,isColoredFirstColumn:o,columnsViewState:r,handleToggleColumn:s}))}):a.map(qe({context:t,visibleRowLength:i,isColoredFirstColumn:o,columnsViewState:r,handleToggleColumn:s})),qe=({context:e,visibleRowLength:t,isColoredFirstColumn:r,columnsViewState:l,handleToggleColumn:a})=>(i,o)=>n(Ue,{context:e,visibleRowLength:t,showRow:l[o],header:i.header,columnData:i.column,isFillGradient:0===o&&r,onToggleColumn:()=>a(o)},String(o)),Ke=(e,t)=>()=>{t(new Array(e.length).fill(!1))};async function Qe(){try{const e=await fetch(Ye,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Ze)});return await e.json()}catch(e){return console.error(e),Promise.resolve()}}const Ye="https://coins.rshb.ru/api/catalog/vue_storefront_magento_1_currency_rates_average/currency_rates_average/_search?size=10000",Ze={query:{bool:{must:[{term:{russian_region_code:"77"}},{term:{from_volume:"0"}},{terms:{currency_pair:["USD/RUB","EUR/RUB"]}}]}}},Xe=e=>e.reduce(((e,t)=>{const n=t.currency_first?.code;return e.some((e=>e.code===n))||e.push({code:n,buy:et(Number(t.rate_buy)),sell:et(Number(t.rate_sell))}),e}),[]),et=e=>Math.round(1e3*e)/1e3;var tt;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD"}(tt||(tt={}));const nt=new Intl.NumberFormat("ru",{style:"currency",currency:tt.RUB}),rt=e=>e?nt.format(e):"",lt="text-left text-m text-secondary-text",at={USD:"DollarIcon",EUR:"EuroIcon"},it=l((({className:e,exchangeCurrencyItems:t})=>r("table",{className:`h-fit w-fit ${e}`,children:[n("thead",{children:r("tr",{children:[n("th",{className:lt,children:"Валюта"}),n("th",{className:`${lt} pl-11`,children:"Купить"}),n("th",{className:`${lt} pl-11`,children:"Продать"})]})}),n("tbody",{children:t.map((e=>ot(e)))})]}))),ot=e=>{const t=e?.code;return r("tr",{className:"pb-1 text-h6",children:[n("td",{className:"pt-4",children:r("div",{className:"flex items-center",children:[t?n(y,{image:{icon:at[t]},width:"24",height:"24"}):null,n("span",{className:"ml-2",children:t})]})}),n("td",{className:"pt-4 pl-11",children:rt(e?.sell)}),n("td",{className:"pt-4 pl-11",children:rt(e?.buy)})]},t)},st=l((({className:e="",address:t,distance:l})=>r("div",{className:`flex ${e}`,children:[n(y,{image:{icon:"GpsIcon"},width:"24",height:"24",asSVG:!0}),r("div",{className:"ml-3",children:[t?n("p",{className:"text-primary-main m-0 mb-1 text-l",children:t}):null,l?r("p",{className:"text-secondary-text m-0 text-m",children:["Курс указан для ближайшего офиса - ",l]}):null]})]}))),ct=(e,t,n)=>{const r=Number(dt(e))*Math.pow(t,n?-1:1);return Number.isInteger(r)?r:((e,t=2)=>{const n=Math.pow(10,t);return Math.round(parseFloat(String(e))*n)/n})(r)},dt=e=>e.replace(/[^\d.,]/g,"").replace(",","."),mt=e=>{return(t=[[e=>e.value!==tt.RUB&&e.oppositeValue!==tt.RUB,()=>e.handleConvert(e.value,tt.RUB)],[e=>e.value===tt.RUB&&e.oppositeValue===tt.RUB,()=>e.handleConvert(e.value,tt.USD)],[()=>!0,()=>e.handleConvert(e.value)]],e=>{const[,n]=t.find((([t])=>t(e)))||[];return n})(e)?.();var t};function ht(e){return n(Y,{className:"py-4 mr-1",version:e?.version,href:e?.href,target:"_blank",children:e?.text})}const ut=l((({className:e="",id:t,name:r,type:l="text",placeholder:a,pattern:i,value:o,onChange:s})=>n("input",{className:e,id:t,name:r||t,type:l,pattern:i,placeholder:a,value:o,onChange:e=>{const t=e.target.validity.valid?e.target.value:o;s(t)}}))),pt=l((({className:e="",id:t,name:r,children:l,value:a,onChange:i})=>n("select",{className:e,id:t,name:r||t,value:a,onChange:e=>i(e.target.value),children:l}))),xt=l((({className:e="",value:t,selected:r,children:l})=>n("option",{className:e,value:`${t}`,selected:r,children:l})));function gt(e){const{placeholder:t,rates:l,selected:a,value:i,setValue:o,setSelected:s}=e;return r("div",{className:"relative flex items-center",children:[n(ut,{className:"h-13 border pl-4 pt-4 pb-4 rounded-md text-l w-full appearance-none -mr-12",placeholder:t,type:"text",value:i,onChange:o}),l.length?n(pt,{className:"h-9 -translate-x-4 bg-transparent",value:a,onChange:e=>s(e),children:l.map(((e,t)=>n(xt,{value:e.code,children:e.code},String(t))))}):null]})}const bt=l((({context:e,className:t="",currencyRatesBuy:n,currencyRatesSell:l,button:a})=>{const[i,o]=e.useState({inputSell:"",inputBuy:"",selectSell:n?.[0]?.code||tt.RUB,selectBuy:l?.[0]?.code||tt.USD}),s=e=>{o((t=>({...t,...e})))};return r("div",{className:`grid gap-[18px] pt-2 ${t}`,children:[gt({placeholder:"Хочу продать",rates:n,selected:i.selectSell,setSelected:ft(i,s,l),value:i.inputSell,setValue:e=>Nt(s,l)(e,i.selectSell,i.selectBuy)}),gt({placeholder:"Получу",rates:l,selected:i.selectBuy,setSelected:yt(i,s,n),value:i.inputBuy,setValue:e=>vt(s,n)(e,i.selectBuy,i.selectSell)}),a?.text?ht(a):null]})})),ft=(e,t,n)=>r=>{t({selectSell:r}),mt({value:r,oppositeValue:e.selectBuy,handleConvert:(r=e.selectSell,l=e.selectBuy)=>{Nt(t,n)(e.inputSell,r,l)}})},yt=(e,t,n)=>r=>{t({selectBuy:r}),mt({value:r,oppositeValue:e.selectSell,handleConvert:(r=e.selectBuy,l=e.selectSell)=>vt(t,n)(e.inputBuy,r,l)})},Nt=(e,t)=>(n,r,l)=>{e({inputSell:dt(n),selectBuy:l});const a=t.find((e=>e.code===l))?.buy||t.find((e=>e.code===r))?.sell;a&&e({inputBuy:String(ct(n,a,r===tt.RUB)||"")})},vt=(e,t)=>(n,r,l)=>{e({inputBuy:dt(n),selectSell:l});const a=t.find((e=>e.code===l))?.sell||t.find((e=>e.code===r))?.buy;a&&e({inputSell:String(ct(n,a,r===tt.RUB)||"")})},It={address:"Москва, ул.Ленина д.28",distance:"6км"},wt=l((({className:e="",context:t,title:l="Курсы обмена валют",button:a,...i})=>{const s=function(e){const{data:t}=e(Ye,Qe),n=t?.hits?.hits?.map((e=>e._source))||[];return n.length?Xe(n):n}(t.useAsyncData),c=s.filter((e=>e.buy));c.unshift({code:tt.RUB});const d=s.filter((e=>e.sell));return d.push({code:tt.RUB}),n($e,{context:t,className:`bg-white text-primary-text font-sans p-9 box-border ${e}`,...i,children:n(ae,{context:t,title:n(o,{headingType:"h4",title:l,className:"whitespace-pre-wrap text-h4"}),children:r("div",{className:"flex",children:[r("div",{className:"mr-14 pt-4",children:[s?n(it,{className:"mb-[30px]",exchangeCurrencyItems:s}):null,n(st,{...It})]}),s.length&&c.length&&d.length?n(bt,{className:"grow",context:t,currencyRatesBuy:c,currencyRatesSell:d,button:a}):null]})})})})),Ct={"bg-white":"text-primary-main",transparent:"text-white"},kt={"bg-white":"text-black",transparent:"text-white"},St=l((({className:e="",href:t,children:l,targetBlank:a,bgColor:i="bg-white",hideTitle:o})=>r("a",{className:`inline-flex items-center font-sans no-underline ${e}`,href:t||"https://rshb.ru/",target:a?"_blank":"_self","aria-label":"Россельхозбанк",children:[n(y,{image:{icon:"Logo"},className:`${Ct[i]} w-10 h-[38px]`,asSVG:!0}),o?null:n("span",{className:`${kt[i]} text-sm font-medium ml-2.5`,children:l||"Россельхозбанк"})]}))),$t=l((({className:e="",title:t="Мобильное приложение",description:l,href:a="#"})=>n("div",{className:`col-span-12 rounded-md cursor-pointer p-4 mt-6 mb-6 bg-secondary-light ${e}`,children:a?r("div",{className:"flex",children:[n("div",{className:"flex justify-center align-middle rounded-md bg-primary-main w-[50px] h-[50px]",children:n(St,{className:"w-[33px]",bgColor:"transparent",hideTitle:!0})}),r("a",{href:a,target:"_blank",className:"flex flex-col justify-center pl-3 font-sans",children:[n("div",{className:"text-s font-medium mb-[3px]",children:t}),n("div",{className:"text-s text-secondary-text",children:l})]})]}):null}))),Dt=l((({className:e="",items:t,hasButton:l,context:a})=>{const i=a.useRouter(),{handlerDecorator:o}=a;return r("div",{className:e,children:[t?.length?t.map(Tt):null,l?n(Y,{version:"primary",className:"mb-6 w-full",...F({router:i,handlerDecorator:o},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),Tt=(e,t)=>{const{type:l,text:a,description:i}=e;return r("div",{className:"mb-4",children:[n("div",{children:Rt(l,a)}),n("div",{className:"mt-1 font-sans text-s-light text-secondary-text",children:i})]},String(t))},Rt=(e,t="")=>{switch(e){case"tel":return n("a",{className:"font-sans text-xl-light text-primary-text no-underline",href:`tel:${Bt(t)}`,children:t});case"email":return n("a",{className:"font-sans text-xl-light text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return n("span",{children:t})}},Bt=e=>e.replaceAll(/\D/g,""),_t=l((({className:e="",index:t,text:r,href:l,target:a,onClick:i})=>n("a",{className:`font-sans text-secondary-text hover:text-primary-main inline-block no-underline ${e}`,href:l,target:a,onClick:i,children:r||`Документ ${t}`}))),Pt=l((({title:e,links:t,className:l="",context:a})=>{const i=a.useRouter(),{handlerDecorator:o}=a;return r("div",{className:l,children:[n("span",{className:"text-primary-text font-sans font-medium text-sm",children:e}),t?.length?n("div",{className:"flex flex-col gap-2 pt-3",children:t.map(((e,t)=>n(_t,{index:t,className:"font-normal text-sm",...F({router:i,handlerDecorator:o},e)},String(t))))}):null]})})),Lt=[{origins:["t.me","telegram.org"],icon:{icon:"TelegramIcon"},label:"Телеграм"},{origins:["vk.com"],icon:{icon:"VKIcon"},label:"ВКонтакте"},{origins:["ok.ru"],icon:{icon:"OkIcon"},label:"Одноклассники"},{origins:["apps.apple.com"],icon:{icon:"AppleIcon"},label:"App Store"},{origins:["play.google.com"],icon:{icon:"PlayMarketIcon"},label:"Google Play"}],Mt=l((({href:e,version:t="primary"})=>{const{icon:r,label:l}=Lt.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};if(!r)return null;return n("a",{className:`flex items-center justify-center rounded-md w-14 h-14 group box-border ${"secondary"===t?"bg-secondary-light hover:bg-secondary-hover":"border-main-divider border-solid border-[1px] hover:bg-primary-main"} ${"primary"===t?"hover:text-black":""}`,href:e,"aria-label":l,target:"_blank",rel:"noopener noreferrer",children:r?n(y,{image:r,imageClassName:"group-hover:text-white",width:"24",height:"24",asSVG:!0}):null})})),At=l((({className:e,media:t,version:r,context:l})=>{const a=l.useRouter(),{handlerDecorator:i}=l;return n("div",{className:`flex gap-2 items-start justify-start pt-6 pb-6 ${e||""}`,children:t?.map(((e,t)=>n(Mt,{version:r,...F({router:a,handlerDecorator:i},e)},String(t))))})})),Vt=l((({className:e="",index:t,text:r,href:l,target:a,onClick:i})=>n("a",{className:`font-sans text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e}`,href:l,target:a,onClick:i,children:r||`Документ ${t}`}))),jt=l((({className:e,links:t,context:l})=>{const a=l.useRouter(),{handlerDecorator:i}=l;return r("div",{className:`${e||""}`,children:[n("div",{className:"py-6",children:n("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?n("div",{className:"flex flex-col justify-start items-start gap-2",children:t.map(((e,t)=>n(Vt,{index:t,className:"font-normal",...F({router:a,handlerDecorator:i},e)},String(t))))}):null]})}));function Gt(e){const{data:t}=e(Ot(),Wt);return t||{}}async function Wt(){const e=await fetch(Ot());return await e.json()}function Ot(){return`/wcms-resources/${d.SITEMAP||"sitemap"}.json`}const Ut=l((({className:e,context:t,isMobile:l=!1})=>{const{term:a,setTerm:i}=t.useSearch(),o=l?"font-normal text-sm":"text-l-light",s=l?" placeholder-transparent font-normal":"font-light h-full",c=l?"some search":void 0;return r("form",{className:`font-sans relative ${e}`,children:[r("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[n("div",{className:l?"w-[20px] h-[20px]":"w-[24px] h-[24px]",children:n(y,{image:"LoupeIcon",width:"24",height:"24"})}),a?null:n("label",{htmlFor:"search-bar-input",className:`text-secondary-text ${o}`,children:"Поиск по сайту"})]}),n("input",{id:"search-bar-input",className:`h-12 pl-12 w-full peer text-l text-black border border-solid rounded box-border\n outline-none pr-[6%] border-main-divider focus:border-primary-text ${s}`,value:a,onChange:e=>i(e.target.value),type:"text",name:"search-bar-input",placeholder:c}),l?n("button",{className:"visible peer-placeholder-shown:invisible absolute top-2 right-3 w-6 h-6 p-1 bg-transparent cursor-pointer border-none",onClick:e=>{e.preventDefault(),i("")},children:n(y,{image:"CloseIcon",width:"24",height:"24"})}):n(Y,{version:"primary",text:"Найти",className:"invisible peer-focus:visible absolute top-1 right-1",onClick:e=>{e?.preventDefault(),console.log("click")},children:n("div",{className:"font-normal text-sm px-9 py-[9px]",children:"Найти"})})]})})),Et=l((({className:e="",context:t})=>n(Ut,{context:t,className:e,isMobile:!0}))),Ft=e=>e?.map((e=>({label:e.text||"",blocks:[{accordionBlockType:"LinkList",documents:e.items||[]}]}))),Ht=l((({className:e="",documents:t,relatedEnterprises:l,contacts:a,socialMedia:i,context:o,horizontalNavigationTitle:s})=>{const c=Gt(o.useAsyncData),d=c?.dispositions;return r("footer",{className:`px-4 py-[26px] bg-white ${e}`,children:[n(Dt,{className:"overflow-hidden",items:a,context:o,hasButton:!0}),n(Ae,{context:o,className:"!p-0 mb-4",accordionItems:Ft(c.topItems)}),n("div",{children:d?.map(zt)}),n($t,{context:o,title:"Мобильное приложение",description:"Загрузить для IOS и Android"}),n(Et,{context:o,className:"grow"}),n(At,{className:"pb-4",media:i,context:o}),n(Pt,{title:s,links:l,context:o}),n(jt,{links:t,context:o})]})})),zt=(e,t)=>{const{icon:l,href:a,text:i}=e;return r(Y,{version:"link",href:a,className:"flex text-sm mb-4",children:[l?n(y,{className:"pr-1",image:l,width:"24",height:"24",asSVG:!0}):null,n("span",{className:"pl-2.5 font-medium text-primary-text",children:i})]},`footer-${t}`)},Jt=(e,t,n=((e,t)=>t.startsWith(e)))=>n(j(e),(e=>(e||"").replace(O,""))(j(V(e)?t.href:t.pathname))),qt=e=>t=>Jt(t.href,e),Kt=e=>t=>t.items?.some(qt(e))||Jt(t.href,e)||((e,t)=>G(e)===G(t.href))(t.href,e),Qt=e=>t=>e?.href===t?.href,Yt=(e,t)=>{return(r=e,l=t,(r||[]).map((e=>l?.find(Qt(e))||e))).concat((n=e,(t||[]).filter((e=>!n?.find(Qt(e))))));var n,r,l},Zt="absolute left-0 -bottom-3 w-full h-[2px]",Xt=l((({className:e="",text:t,href:l,target:a,active:i,onClick:o,children:s,bgColor:c="bg-white"})=>r("a",{className:`relative inline-block bg-transparent text-center no-underline ${e}`,href:l,target:a,onClick:o,children:[n("span",{className:en(c,i),children:t||s}),i?n("div",{className:tn(c,i)}):null]}))),en=(e,t=!1)=>{let n="text-white";return"bg-white"===e&&(n=t?"text-primary-main":"text-secondary-text hover:text-primary-main"),`${n} font-sans font-normal text-sm`},tn=(e,t=!1)=>t?`${"bg-white"===e?"bg-primary-main":e} ${Zt}`:Zt,nn=l((({context:e,burgerSubMenu:t,onClick:l,defaultLocation:a="",children:i})=>{const[o,s]=e.useGeolocation(a);return r("div",{className:"absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20",children:[n("button",{className:"absolute top-4 right-4 border-none bg-transparent cursor-pointer",onClick:l,children:n(y,{image:"CloseIcon",width:"24",height:"24",asSVG:!0})}),r("button",{onClick:s,className:"flex items-center text-sm text-secondary-text p-0 mb-4 bg-transparent cursor-pointer",children:[n(y,{image:"GeolocationIcon",width:"20",height:"20",className:"text-primary-main box-border mr-2",asSVG:!0}),o]}),i,n("div",{className:"mb-7",children:t?.map(rn)}),n(Et,{context:e,className:"grow"})]})})),rn=(e,t)=>{const{icon:l,href:a,text:i}=e;return r("a",{href:a,className:"flex text-sm mb-4 hover:text-primary-main",children:[l?n(y,{className:"text-primary-main pr-1",image:l,width:"24",height:"24",asSVG:!0}):null,n("span",{className:"pl-0.5 font-medium",children:i})]},`headerSubMenu-${t}`)},ln=l((({onClick:e,bgColor:t})=>r("div",{className:"flex items-center justify-between border-0 border-b border-main-divider h-[50px]",children:[r("div",{className:"flex items-center",children:[n("button",{className:"pl-0 pr-4 border-0 bg-transparent cursor-pointer",onClick:e,"aria-label":"Открыть меню",children:n(y,{image:{icon:"BurgerIcon",iconVersion:"bg-white"===t?"black":"white"},className:"text-primary-text",width:"24",height:"24",asSVG:!0})}),n(St,{bgColor:t})]}),n("button",{className:("bg-white"===t?"text-primary-main":"text-white")+" text-sm border-0 bg-transparent cursor-pointer",children:"Войти"})]}))),an=l((({className:e="",defaultLocation:t,bgColor:l="bg-white",context:a,topItems:i})=>{const o=a.useRouter(),s=Gt(a.useAsyncData),c=s?.dispositions,{handlerDecorator:d}=a,m=Yt(s.topItems,i).find(Kt(o))?.items,h=(e=>(t=[])=>{const n=t?.filter(qt(e));return n?.length?(r=e=>e.href?.length||0,e=>e.reduceRight(((e,t)=>r(e)>r(t)?e:t)))(n):void 0;var r})(o)(m),[u,p]=a.useState(!1),x=()=>p(!u);return r("header",{className:`${l} ${e}`,children:[r("div",{className:"container px-4 py-0 box-border",children:[n(ln,{onClick:x,bgColor:l}),n("nav",{className:"flex items-center m-0 p-0 overflow-y-hidden w-full h-[50px]",children:n("div",{className:"flex no-scrollbar horizontal-list h-full items-center",children:m?.map(((e,t)=>on({...F({router:o,handlerDecorator:d},e),active:e===h,bgColor:l},t)))})})]}),u?n(nn,{context:a,onClick:x,burgerSubMenu:c,defaultLocation:t,children:n(Ae,{context:a,accordionItems:Ft(s.topItems),className:"!p-0 mb-4"})}):null]})})),on=(e,t)=>n(Xt,{className:"mr-8 whitespace-nowrap text-sm",...e},String(t)),sn=e=>{const t="col-span-",n=e.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12};function cn(e=""){const t=sn(e);return t<=4?"S":t<=8?"M":"L"}function dn(e=""){const t=sn(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}function mn(e=""){const t=sn(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const hn=l((({className:e,context:t,title:l,description:a="Блок в разработке...",...i})=>r($e,{context:t,className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${mn(e)} ${dn(e)} `,...i,children:[n(w,{context:t,className:"!p-0 max-w-[600px]",title:l,description:a,headlineVersion:cn(e)}),n("figure",{className:"m-0 min-w-[600px]",children:un()})]}))),un=(e=3)=>xn(100,e).map((e=>Math.floor(e))).map(pn),pn=(e,t)=>n("div",{style:{width:`${e||100}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),xn=(e,t)=>[e].concat(t>0?xn(e/1.618,t-1):[]),gn={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},bn=l((({block:e,context:t,className:r=""})=>n("section",{className:`flex grow-0 shrink-0 basis-full px-4 pt-6 ${gn[e?.version??"primary"]} ${r}`,role:"listitem",children:n("div",{className:"flex grow",children:n(ce,{context:t,...e})})}))),fn=l((({className:e,context:t,slides:r=[]})=>{const l=r.map((e=>e.productBlock));return n("section",{className:`font-sans bg-white overflow-hidden w-100 pb-6 ${e||""}`,children:n(T,{context:t,children:l.map(((e,r)=>n(bn,{block:e,context:t},String(r))))})})})),yn={primary:{background:"bg-white",title:"text-primary-text",description:"text-secondary-text",iconText:"text-secondary-text",iconBackground:"bg-main-divider",iconConnector:"bg-secondary-light"},secondary:{background:"bg-primary-main",title:"text-white",description:"text-white/80",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white"}},Nn=e=>yn[e],vn={normal:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",small:"h-[50px] w-[50px] min-w-[50px] min-h-[50px]"},In={normal:"min-h-[70px]",small:"min-h-[50px]"},wn=l((({className:e,title:t,description:l,showLines:a=!0,steps:i,size:s="normal",version:c="primary"})=>{const d=Nn(c);return r("section",{className:`box-border font-sans bg-white px-4 py-6 flex flex-col\n ${d.background} ${d.title} ${e||""}`,children:[t?n(o,{headingType:"h3",className:`text-center ${d.title}`,title:t}):null,l?n("p",{className:`text-m text-center ${d.description} ${t?"mt-2":""}`,children:l}):null,i?.length?n("div",{className:"box-border py-0.5 mb-0.5 mt-5",children:n("div",{className:"flex flex-col justify-between gap-x-[101px]",children:i.map(Cn(s,c,a))})}):null]})})),Cn=(e,t,l)=>(a,i,o)=>{const s=o.length-1===i,c="normal"===e?"ml-[34px]":"ml-6",d=Nn(t);return n("div",{children:r("div",{className:"flex flex-row text-center relative",children:[r("div",{className:"overflow-hidden",children:[kn(e,t),s?null:n("div",{className:`min-h-8 h-full w-[2px] ${l?d.iconConnector:""} ${c}`})]}),r("div",{className:`flex flex-col justify-center h-fit ${In[e]}`,children:[a.label?n("div",{className:"font-medium text-m-title-xs m-0 text-left mb-1",children:a.label}):null,a.description?n("div",{className:`text-s ${d.description} text-left`,children:a.description}):null]})]})},String(i))},kn=(e,t)=>(r,l)=>{const a=Nn(t),i="normal"===e?"38":"27",o="normal"===e?"text-m-title":"text-m-title-xs";return n("div",{className:`${vn[e]} ${a.iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`,children:n("span",{className:`font-medium flex self-center ${a.title} ${o}`,children:(s=r?.icon,Boolean(s?.icon||s?.src)?n(y,{image:r.icon,width:i,height:i,asSVG:!0}):n("span",{children:l+1}))})});var s},Sn=l((({title:e,icon:t})=>r("div",{className:"flex gap-2.5 mb-2",children:[e?n(o,{headingType:"h3",className:"font-medium",title:e}):null,t?n(y,{className:"ml-auto max-w-6 max-h-6",image:t,width:"24px",height:"24px"}):null]}))),$n=e=>e?.alt||e?.title||c[e?.icon?e.icon:""],Dn=l((({header:e,data:t})=>r("div",{className:"rounded-md border-main-stroke h-full box-border border p-4",children:[n(Sn,{...e}),t?.length?t.map(Tn):null]}))),Tn=({label:e,description:t,list:l,image:a,buttons:i},o)=>r("div",{children:[o>0&&n("div",{className:"border-main-divider border border-solid border-t-0 border-x-0 my-2"}),e?n("div",{className:"text-m-sm m-0",children:e}):null,t?n("div",{className:"text-m-sm text-secondary-text mt-[3px]",children:t}):null,l?.items?.length?Rn(l):null,a?n(y,{image:{...a,className:"m-0"}}):null,i?.length?Bn(i):null]},String(o)),Rn=e=>n(le,{className:"flex flex-col justify-between items-start text-m-sm",version:"gray",items:e.items,isDotted:e.isDotted??!0}),Bn=e=>n("div",{children:e.map((({icon:e,rounded:t,...r},l)=>n(Y,{className:`mt-3 ${l>0&&t?"ml-2.5":""} ${e?"w-12 h-12":""}`,ariaLabel:$n(e),rounded:t,appendLeft:e?n(y,{image:e,width:"24px",height:"24px",asSVG:!0}):null,...r,"aria-label":e},String(l))))}),_n=l((({tiles:e,context:t})=>n(T,{context:t,children:e.map(((e,t)=>n(Dn,{...e},String(t))))}))),Pn=l((({tiles:e})=>n("div",{className:"flex flex-col gap-3.5",children:e.map(((e,t)=>n(Dn,{...e},String(t))))}))),Ln=l((({className:e,context:t,title:l,description:a,columns:i,rowHeaders:s,orientation:c="vertical"})=>{const d=An(i),m=Vn(s,d);return r("section",{className:`px-4 py-6 bg-white font-sans text-primary-text overflow-x-hidden ${e}`,children:[l?n(o,{headingType:"h2",className:`text-center ${a?"mb-2":"mb-5"}`,title:l}):null,a?n("div",{className:"mb-5 text-center text-m-md",children:a}):null,m?.length?Mn(c,m,t):null]})}));function Mn(e,t,r){return"vertical"===e?n(Pn,{tiles:t}):n(_n,{context:r,tiles:t})}const An=e=>e?.[0].data?e[0].data:[],Vn=(e,t)=>e?.map(((e,n)=>({header:e,data:t?.[n]||[{}]}))),jn={Accordion:Ae,ComparisonTable:He,ExchangeRateTile:wt,Footer:Ht,Gallery:Ne,Header:an,Headline:w,LinkDocs:A,LinkList:De,MobileAppTile:$t,ProductBlock:pe,ProductGallery:fn,StepsBlock:wn,TariffsTable:Ln,TextBlock:ge,Placeholder:hn},Gn=l((({className:e,onClick:t,ariaLabel:r})=>n("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":r,children:Wn()}))),Wn=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n("path",{...e,strokeMiterlimit:"10",d:"M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"}),n("path",{...e,d:"M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"})]})},On=l((({className:e,context:t,...l})=>{const a=t.useLikeService();return r($e,{tag:"div",context:t,className:`border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${e||""}`,...l,children:[n(Gn,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),n(Gn,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),n("span",{className:"select-none",children:a.likeCount})]})})),Un=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),En=l((({className:e="",context:t,blocksRegistry:l,data:a={},blockDecorator:i=Un})=>{const{style:o,blocks:s,slots:c={},likeControl:d,colorPalette:m="pc"}=a,{header:h}=c;return r("section",{className:`relative ${N(o)} ${e}`,"data-theme":m,children:[h?.blocks?.length?n("div",{className:`${N(h?.style)}`,children:h.blocks.map(((e,n)=>Fn({block:e,page:a,blockDecorator:i,blocksRegistry:l,context:t},n)))}):null,s?.length?n("div",{className:"container grid grid-cols-12 gap-1",children:s.map(((e,n)=>Fn({block:e,blockDecorator:i,blocksRegistry:l,context:t,page:a},n)))}):null,d?n("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:n(On,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t},"LikeControl")}):null]})}));function Fn({block:e,blockDecorator:t,blocksRegistry:r,context:l,page:a},i){const{type:o}=e;o&&o in r||console.warn(`No block with "${o}" is registered`);const s=r[o||"Placeholder"]||hn;return t({blockClassName:`scroll-mt-12 ${N(e.style)}`,block:e,render:e=>{const{version:t,content:r,anchor:c,labels:d}=e.block;return n(s,{className:e.blockClassName,version:t,context:l,page:a,anchor:c,labels:d,...r},`${o}-${i}`)}},`block-${i}`)}e.Blocks=jn,e.ContentPage=En,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=function(e,t=""){async function n(){try{const e=JSON.parse(globalThis.localStorage.getItem(a)||"");if(e?.token)return e}catch(e){}try{const e=await fetch(`${t}/assist/v1/public/auth`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:n,name:r}=await e.json();return globalThis.localStorage.setItem(a,JSON.stringify({token:n,name:r})),{token:n,name:r}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...r){if(!r.length)return[];const{token:l}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l},body:JSON.stringify({node_ids:r})}),{likes:a}=await n.json();return a||[]}catch(e){return console.error(e),[]}},like:async function(r){if(!r)return 0;const{token:l,name:a}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l,UserID:a},body:JSON.stringify({node_id:r,user_name:a})}),{likes:i}=await n.json();return i||0}catch(e){return console.error(e),0}},dislike:async function(r){if(!r)return 0;const{token:l,name:a}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:l,UserID:a},body:JSON.stringify({node_id:r,user_name:a})}),{likes:i}=await n.json();return i||0}catch(e){return console.error(e),0}}}},e.joinList=function(e){return t=>t.reduce(((t,n,r)=>t.length?t.concat({...e,key:r},n):[n]),[])},e.projectSettings=d,e.setup=t,e.url=W,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -0,0 +1,10 @@
1
+ import type { EventMap } from './EventMap';
2
+ export declare class EventBus {
3
+ static readonly inst: EventBus;
4
+ private subscribers;
5
+ private subjectsStateMap;
6
+ subscribe<T extends keyof EventMap>(type: T, listener: (event: EventMap[T]) => void): () => void;
7
+ private unsubscribe;
8
+ fire<T extends keyof EventMap>(type: T, event: EventMap[T]): void;
9
+ subject<T extends keyof EventMap>(type: T, event: EventMap[T]): void;
10
+ }
@@ -0,0 +1,30 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.EventBus = void 0;
3
+ class EventBus {
4
+ static inst = new EventBus();
5
+ subscribers = {};
6
+ subjectsStateMap = {};
7
+ subscribe(type, listener) {
8
+ this.subscribers[type] ||= [];
9
+ this.subscribers[type]?.push(listener);
10
+ const latestEvent = this.subjectsStateMap[type];
11
+ if (latestEvent) {
12
+ listener(latestEvent);
13
+ }
14
+ return () => {
15
+ this.unsubscribe(type, listener);
16
+ };
17
+ }
18
+ unsubscribe(type, listener) {
19
+ this.subscribers[type] = this.subscribers[type]?.filter((s) => s !== listener);
20
+ }
21
+ fire(type, event) {
22
+ this.subjectsStateMap[type] = event;
23
+ this.subscribers[type]?.forEach((s) => s(event));
24
+ }
25
+ subject(type, event) {
26
+ this.subjectsStateMap[type] = event;
27
+ }
28
+ }
29
+ exports.EventBus = EventBus;
30
+ //# sourceMappingURL=EventBus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventBus.js","sourceRoot":"","sources":["../../src/EventBus/EventBus.ts"],"names":[],"mappings":";;AAIA,MAAa,QAAQ;IACZ,MAAM,CAAU,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;IAErC,WAAW,GAAkD,EAAE,CAAC;IAChE,gBAAgB,GAAsB,EAAE,CAAC;IAEjD,SAAS,CAA2B,IAAO,EAAE,QAAsC;QACjF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEvC,MAAM,WAAW,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAEhD,IAAI,WAAW,EAAE;YACf,QAAQ,CAAC,WAA0B,CAAC,CAAC;SACtC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QACnC,CAAC,CAAC;IACJ,CAAC;IAEO,WAAW,CAA2B,IAAO,EAAE,QAAsC;QAC3F,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC;IACjF,CAAC;IAED,IAAI,CAA2B,IAAO,EAAE,KAAkB;QACxD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QACpC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,CAA2B,IAAO,EAAE,KAAkB;QAC3D,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IACtC,CAAC;;AAhCH,4BAiCC"}
@@ -0,0 +1,4 @@
1
+ import type { TabActivationEvent } from '../components/Tabs/Tabs';
2
+ export interface EventMap {
3
+ tab: TabActivationEvent;
4
+ }
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ //# sourceMappingURL=EventMap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventMap.js","sourceRoot":"","sources":["../../src/EventBus/EventMap.ts"],"names":[],"mappings":""}
@@ -20,6 +20,7 @@ export interface ContentPageProps extends UniBlockProps {
20
20
  }
21
21
  export interface RenderBlockFunc {
22
22
  block: BlockDef;
23
+ page: ContentPageDef;
23
24
  blockDecorator: BlockDecorator;
24
25
  blocksRegistry: BlocksRegistry;
25
26
  context: ContentPageContext;
@@ -9,9 +9,9 @@ const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ bl
9
9
  exports.ContentPage = (0, uni_jsx_1.JSX)(({ className = '', context, blocksRegistry, data = {}, blockDecorator = defaultBlockDecorator, }) => {
10
10
  const { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' } = data;
11
11
  const { header } = slots;
12
- return ((0, jsx_runtime_1.jsxs)("section", { className: `relative ${(0, style2className_1.style2className)(pageStyle)} ${className}`, "data-theme": colorPalette, children: [header?.blocks?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `${(0, style2className_1.style2className)(header?.style)}`, children: header.blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i)) })) : null, blocks?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "container grid grid-cols-12 gap-1", children: blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i)) })) : null, likeControl ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: (0, jsx_runtime_1.jsx)(LikeControl_1.LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }, "LikeControl") })) : null] }));
12
+ return ((0, jsx_runtime_1.jsxs)("section", { className: `relative ${(0, style2className_1.style2className)(pageStyle)} ${className}`, "data-theme": colorPalette, children: [header?.blocks?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `${(0, style2className_1.style2className)(header?.style)}`, children: header.blocks.map((block, i) => renderBlock({ block, page: data, blockDecorator, blocksRegistry, context }, i)) })) : null, blocks?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "container grid grid-cols-12 gap-1", children: blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context, page: data }, i)) })) : null, likeControl ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: (0, jsx_runtime_1.jsx)(LikeControl_1.LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }, "LikeControl") })) : null] }));
13
13
  });
14
- function renderBlock({ block, blockDecorator, blocksRegistry, context }, i) {
14
+ function renderBlock({ block, blockDecorator, blocksRegistry, context, page }, i) {
15
15
  const { type } = block;
16
16
  if (!(type && type in blocksRegistry)) {
17
17
  console.warn(`No block with "${type}" is registered`);
@@ -21,8 +21,8 @@ function renderBlock({ block, blockDecorator, blocksRegistry, context }, i) {
21
21
  blockClassName: `scroll-mt-12 ${(0, style2className_1.style2className)(block.style)}`,
22
22
  block,
23
23
  render: (props) => {
24
- const { version, content, anchor } = props.block;
25
- return ((0, jsx_runtime_1.jsx)(BlockComponent, { className: props.blockClassName, version: version, context: context, anchor: anchor, ...content }, `${type}-${i}`));
24
+ const { version, content, anchor, labels } = props.block;
25
+ return ((0, jsx_runtime_1.jsx)(BlockComponent, { className: props.blockClassName, version: version, context: context, page: page, anchor: anchor, labels: labels, ...content }, `${type}-${i}`));
26
26
  },
27
27
  }, `block-${i}`);
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPage.tsx"],"names":[],"mappings":";;;AAAA,+CAA2D;AAE3D,iEAA8D;AAE9D,4DAAyD;AACzD,4DAAyD;AAkCzD,MAAM,qBAAqB,GAAmB,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAClF,MAAM,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;AAEvB,QAAA,WAAW,GAAG,IAAA,aAAG,EAC5B,CAAC,EACC,SAAS,GAAG,EAAE,EACd,OAAO,EACP,cAAc,EACd,IAAI,GAAG,EAAE,EACT,cAAc,GAAG,qBAAqB,GACvC,EAAE,EAAE;IACH,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACxF,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEzB,OAAO,CACL,qCACE,SAAS,EAAE,YAAY,IAAA,iCAAe,EAAC,SAAS,CAAC,IAAI,SAAS,EAAE,gBACpD,YAAY,aA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yBAAW,CAAC;IAE5E,OAAO,cAAc,CACnB;QACE,cAAc,EAAE,gBAAgB,IAAA,iCAAe,EAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QAC9D,KAAK;QACL,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;YAEzD,OAAO,CACL,uBAAC,cAAc,IAEb,SAAS,EAAE,KAAK,CAAC,cAAc,EAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,KACV,OAAO,IAPN,GAAG,IAAI,IAAI,CAAC,EAAE,CAQnB,CACH,CAAC;QACJ,CAAC;KACF,EACD,SAAS,CAAC,EAAE,CACb,CAAC;AACJ,CAAC"}
@@ -40,6 +40,7 @@ export interface ContentPageContext {
40
40
  useGeolocation: GeolocationHook;
41
41
  useLikeService: () => LikeService;
42
42
  useSearch: () => Search;
43
+ useEffect: <Deps extends any[]>(effect: () => (() => void) | void, deps?: Deps) => void;
43
44
  handlerDecorator?: HandlerDecorator;
44
45
  IntersectionObserverTag: IntersectionObserverComponent;
45
46
  }
@@ -0,0 +1,8 @@
1
+ import type { UniBlockProps } from '../../types';
2
+ import type { TabsContent } from './TabsContent';
3
+ export interface TabActivationEvent {
4
+ label?: string;
5
+ }
6
+ export interface TabsProps extends TabsContent, UniBlockProps {
7
+ }
8
+ export declare const Tabs: (props: import("@redneckz/uni-jsx").PropsWithChildren<TabsProps, any>, context?: any) => any;
@@ -0,0 +1,18 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.Tabs = void 0;
3
+ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
+ const uni_jsx_1 = require("@redneckz/uni-jsx");
5
+ const EventBus_1 = require("../../EventBus/EventBus");
6
+ const BlockWrapper_1 = require("../../ui-kit/BlockWrapper");
7
+ const renderTab_1 = require("./renderTab");
8
+ exports.Tabs = (0, uni_jsx_1.JSX)((props) => {
9
+ const { context, className, tabs, page, showCounter } = props;
10
+ const [currentTab, setCurrentTab] = context.useState(tabs ? tabs[0] : undefined);
11
+ context.useEffect(() => EventBus_1.EventBus.inst.subject('tab', { label: currentTab?.id }), [currentTab]);
12
+ const handleClick = (selectedTab) => {
13
+ EventBus_1.EventBus.inst.fire('tab', { label: selectedTab.id });
14
+ setCurrentTab(selectedTab);
15
+ };
16
+ return ((0, jsx_runtime_1.jsx)(BlockWrapper_1.BlockWrapper, { context: context, className: `mb-2 box-border flex gap-x-1 ${className}`, role: "tablist", children: tabs?.map((0, renderTab_1.renderTab)({ onClick: handleClick, currentTab, page, showCounter })) }));
17
+ });
18
+ //# sourceMappingURL=Tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tabs.js","sourceRoot":"","sources":["../../../src/components/Tabs/Tabs.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,sDAAmD;AAEnD,4DAAyD;AACzD,2CAAwC;AAS3B,QAAA,IAAI,GAAG,IAAA,aAAG,EAAY,CAAC,KAAK,EAAE,EAAE;IAC3C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAE9D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAEjF,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,mBAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAE/F,MAAM,WAAW,GAAG,CAAC,WAAgB,EAAE,EAAE;QACvC,mBAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;QACrD,aAAa,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO,CACL,uBAAC,2BAAY,IACX,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,gCAAgC,SAAS,EAAE,EACtD,IAAI,EAAC,SAAS,YAEb,IAAI,EAAE,GAAG,CAAC,IAAA,qBAAS,EAAC,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,GACjE,CAChB,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @title Таб
3
+ */
4
+ export interface Tab {
5
+ /** @title Tег */
6
+ id?: string;
7
+ /** @title Название */
8
+ title?: string;
9
+ }
10
+ /**
11
+ * @title Вкладки
12
+ */
13
+ export interface TabsContent {
14
+ /** @title Табы */
15
+ tabs?: Tab[];
16
+ /** @title Показывать счетчик блоков во вкладках */
17
+ showCounter?: boolean;
18
+ }
@@ -0,0 +1,2 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ //# sourceMappingURL=TabsContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TabsContent.js","sourceRoot":"","sources":["../../../src/components/Tabs/TabsContent.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import type { ContentPageDef } from '../../types';
3
+ import type { Tab } from './TabsContent';
4
+ interface RenderTabProps {
5
+ onClick: OnTabClick;
6
+ currentTab?: Tab;
7
+ page?: ContentPageDef;
8
+ showCounter?: boolean;
9
+ }
10
+ declare type OnTabClick = (tab: Tab) => void;
11
+ export declare const renderTab: ({ onClick, currentTab, showCounter, page }: RenderTabProps) => (tab: Tab, i: number) => JSX.Element;
12
+ export {};
@@ -0,0 +1,19 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.renderTab = void 0;
3
+ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
+ const badgeStyle = 'min-w-[22px] w-[22px] h-[22px] rounded-full text-xs ml-2';
5
+ const renderTab = ({ onClick, currentTab, showCounter, page }) => (tab, i) => {
6
+ const isActive = currentTab === tab;
7
+ const tabBg = isActive ? 'bg-primary-main' : 'group bg-white';
8
+ const tabText = `text-m ${isActive ? 'text-white' : 'text-secondary-text group-hover:text-primary-main'}`;
9
+ const counterBlockStyle = `${badgeStyle}
10
+ ${isActive
11
+ ? 'bg-white/30 text-white'
12
+ : 'bg-main-divider text-secondary-text group-hover:text-primary-main'}`;
13
+ const count = tab.id
14
+ ? page?.blocks?.filter((block) => block?.labels?.includes(tab.id)).length
15
+ : page?.blocks?.length;
16
+ return ((0, jsx_runtime_1.jsx)("div", { className: `flex h-12 w-full flex-1 cursor-pointer mr-2 last:mr-0 box-content ${tabBg}`, role: "tab", "aria-selected": isActive, onClick: () => onClick(tab), children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 items-center justify-center", children: [tab?.title ? (0, jsx_runtime_1.jsx)("h3", { className: tabText, children: tab?.title }) : null, showCounter ? ((0, jsx_runtime_1.jsx)("div", { className: `flex items-center justify-center ${counterBlockStyle}`, children: count })) : null] }) }, String(i)));
17
+ };
18
+ exports.renderTab = renderTab;
19
+ //# sourceMappingURL=renderTab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderTab.js","sourceRoot":"","sources":["../../../src/components/Tabs/renderTab.tsx"],"names":[],"mappings":";;;AAYA,MAAM,UAAU,GAAG,0DAA0D,CAAC;AAEvE,MAAM,SAAS,GACpB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAkB,EAAE,EAAE,CAC/D,CAAC,GAAQ,EAAE,CAAS,EAAE,EAAE;IACtB,MAAM,QAAQ,GAAG,UAAU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ag: IntersectionObserverTag_1.IntersectionObserverTag,
76
77
  };
77
78
  exports.mobileContext = {
@@ -1 +1 @@
1
- {"version":3,"file":"setup-fixture.js","sourceRoot":"","sources":["../../src/react/setup-fixture.ts"],"names":[],"mappings":";;;;;AAAA,+CAA0C;AAC1C,iCAA4C;AAC5C,oEAAwC;AACxC,gDAA6C;AAE7C,uEAAoE;AAEpE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,qBAAc,CAAC;AAErC,iEAAiE;AACjE,IAAA,eAAK,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAEjB,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,mBAAmB,CAAC,CAAC;AAE9C,MAAM,MAAM,GAAG,GAAG,EAAE;IAClB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAS,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEnE,OAAO;QACL,IAAI,EAAE,IAAI;QACV,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;YACpB,UAAU,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;YAC5C,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;QACD,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE;YACvB,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC;YAC/C,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,OAAO,GAAuB;IACzC,QAAQ,EAAR,gBAAQ;IACR,SAAS,EAAE,MAAM;IACjB,YAAY,EAAE,CAAC,GAA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vB,iDAAuB;CACxB,CAAC;AAEW,QAAA,aAAa,GAAuB;IAC/C,GAAG,eAAO;IACV,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;QAChB,IAAI,EAAE,GAAG,WAAW,iBAAiB;QACrC,QAAQ,EAAE,iBAAiB;QAC3B,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;QACD,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE;YACvB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC;CACH,CAAC"}
@@ -13,6 +13,7 @@ export interface BaseBlockDef {
13
13
  version?: BlockVersion;
14
14
  hidden?: boolean;
15
15
  anchor?: string;
16
+ labels?: string[];
16
17
  }
17
18
  export interface BlockDef extends BaseBlockDef {
18
19
  mobile?: BaseBlockDef;
@@ -48,6 +49,8 @@ export interface ContentPageDef extends ContentPageMeta {
48
49
  export interface UniBlockProps {
49
50
  className?: string;
50
51
  context: ContentPageContext;
52
+ page?: ContentPageDef;
53
+ labels?: string[];
51
54
  anchor?: string;
52
55
  }
53
56
  export interface DaDataResult {
@@ -1,5 +1,6 @@
1
- import { ContentPageContext } from '../components/ContentPage/ContentPageContext';
2
- interface BlockWrapperProps {
1
+ import type { ContentPageContext } from '../components/ContentPage/ContentPageContext';
2
+ import type { UniBlockProps } from '../types';
3
+ interface BlockWrapperProps extends UniBlockProps, Record<string, any> {
3
4
  context: ContentPageContext;
4
5
  className?: string;
5
6
  anchor?: string;