1import{r as p,j as e,e as Re}from"./index-1cd9a41c.js";import{c as a,be as g,B as we,s as ae,w as _,aC as V,v as Se,g as ee,cf as le,cg as F,a1 as Ne,bh as Ee,P as Me,F as C,ch as je,a2 as D,aU as We,H as q,a4 as fe,ae as He,a7 as Fe,ci as qe,cj as Ye,ck as k,cl as $e,cm as $,cn as R,n as Xe,co as Pe,r as Ge,cp as E,ac as Ke,cq as Je,cr as Qe,bw as Ze,f as Ve,aK as et,at as tt,S as nt,cs as rt,ct as it,cu as ne,cv as re}from"./app-loader.container-fe4c55c6.js";import{S as st}from"./dropdown-up-24-03e0cfd2.js";function ie(){return ie=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)({}).hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},ie.apply(null,arguments)}var ot={name:"18fb10z",styles:"transform:translateX(-50%) translateY(20px)"},at={name:"1elrbth",styles:"transform:translateX(-50%) translateY(0)"},lt={name:"18cyu2u",styles:"opacity:0;transform:translateX(-50%) translateY(20px);pointer-events:none"},ct={name:"1cmlyo8",styles:"opacity:1;transform:translateX(-50%) translateY(0);pointer-events:auto"};const pt=a("div",ie({},{target:"edesjki1"},ae(["isVisible"])))("position:fixed;bottom:24px;left:50%;transform:translateX(-50%);z-index:1000;transition:opacity 0.3s ease-in-out,transform 0.3s ease-in-out;",({isVisible:t})=>t?ct:lt," ",g.mobileDown,"{bottom:80px;",({isVisible:t})=>t?at:ot,";}"),dt=a(we,{target:"edesjki0"})("width:300px;",g.desktopUp,"{width:540px;}"),ut=p.memo(({isVisible:t,buttonText:n,onClick:r,isLoading:o=!1})=>e.jsx(pt,{isVisible:t,children:e.jsx(dt,{colorScheme:"ultra",size:"lg",variant:"solid",onClick:r,disabled:o,loading:o,children:n})})),gt=p.memo(({allBenefitsTitleRef:t,planCardsWrapperRef:n})=>{const{t:r}=_(),[o,l]=p.useState(!1),x=V(),d=Se(),{user:s}=ee(),y=le(),{currency:f}=F(),[i,c]=Ne(!1),h=s.type==="LoggedIn"&&s.trial_used===!1&&s.subscription_level==="BASIC",u=s.type==="LoggedIn"&&s.subscription_level==="ULTRA";p.useEffect(()=>{h&&y.initialize()},[h,y]),p.useEffect(()=>{const v=t.current;if(!v)return;const U=()=>{if(!v){l(!1);return}const b=v.getBoundingClientRect().top<=0;l(b)},T=new IntersectionObserver(()=>{requestAnimationFrame(U)},{root:null,rootMargin:"0px",threshold:[0,.01,.1,.5,1]});T.observe(v),U();const B=()=>{U()};return window.addEventListener("resize",B,{passive:!0}),()=>{T.disconnect(),window.removeEventListener("resize",B)}},[t]);const P=p.useCallback(async()=>{if(h&&f==="rub"){x.openPaywallWithParams({feature:"general"});return}if(h&&f==="usd"){c.on();const v=await d.startTrial();v.type==="success"&&x.showTrialModal(),v.type==="failure"&&Ee("Unable to start trial",""),c.off();return}n.current&&n.current.scrollIntoView({behavior:"smooth",block:"start"})},[h,f,x,d,n,c]);let S=r("plans-page/choose-plan");return s.type==="LoggedIn"&&s.subscription_level==="PLUS"&&(S=r("plans-page/button-upgrade-to-ultra")),h&&(S=r("plans-page/button-try-for-free")),p.createElement(ut,{isVisible:o&&!u,buttonText:S??"",onClick:P,isLoading:i})}),xt="/assets/hero-background-88f8d106.jpg",ht=a("button",{target:"e1ee5b8q2"})("display:flex;align-items:center;padding:4px 4px 4px 10px;width:50px;background-color:var(--basic-dark-grey);border:none;border-radius:8px;color:white;font-size:20px;line-height:20px;font-weight:600;cursor:pointer;transition:background-color 0.2s;&:hover{background-color:#707070;}svg{width:16px;height:16px;color:white;transition:transform 0.2s;transform:",t=>t.isOpen?"rotate(0deg)":"rotate(180deg)",";}span{color:white;}"),mt=a(Me,{target:"e1ee5b8q1"})({name:"1ut2ocb",styles:"background-color:var(--basic-dark-grey);border:none;border-radius:8px;padding:16px;
1min-width:200px"}),ft=a("button",{target:"e1ee5b8q0"})("background:transparent;display:flex;align-items:center;gap:8px;width:100%;padding:8px 12px;border:none;border-radius:8px;color:white;",C.body2_main_regular," cursor:pointer;text-align:left;transition:background-color 0.2s;&:hover{background-color:var(--button-dark-hovered);}span{color:white;}"),Te=p.memo(p.forwardRef((t,n)=>{const{item:r,onClick:o,isOpen:l}=t,x=je(r.value),d=s=>{s&&typeof n=="function"&&n(s)};return e.jsxs(ht,{ref:d,onClick:o,isOpen:l,children:[e.jsx("span",{children:x}),e.jsx(D,{Svg:st})]})}));Te.displayName="CurrencyAnchor";const Ae=p.memo(({item:t,onClick:n})=>{const{t:r}=_(),o=je(t.value),l=t.value==="rub"?"plans-page/currency/ruble":"plans-page/currency/dollar",x=r(l);return e.jsxs(ft,{onClick:n,children:[e.jsx("span",{children:o}),e.jsx("span",{children:x})]})});Ae.displayName="CurrencyItem";const bt=We,Le=p.memo(({currency:t,setCurrency:n})=>{const{t:r}=_(),o=p.useMemo(()=>[{value:"rub",title:r("plans-page/currency/ruble")??""},{value:"usd",title:r("plans-page/currency/dollar")??""}],[r]),l=p.useMemo(()=>o.find(x=>x.value===t)??o[0],[o,t]);return l?e.jsx(bt,{Anchor:Te,Item:Ae,Popover:mt,itemGroups:[o],selectedItem:l,onChange:n}):null});Le.displayName="CurrencySwitcherComponent";const yt=()=>{const{setCurrency:t}=le(),{currency:n,isCurrencyLocked:r}=F(),o=p.useCallback(l=>{q.emit("plans_page.currency_changed",{currency:l}),t(l)},[t]);return r||!n?null:p.createElement(Le,{currency:n,setCurrency:o})};function se(){return se=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)({}).hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},se.apply(null,arguments)}const vt=a("div",{target:"e106mp2o28"})("position:relative;z-index:1;color:var(--black);margin:0 auto;display:flex;justify-content:center;align-items:stretch;flex-wrap:wrap;gap:32px;",g.mobileDown,"{gap:20px;}"),wt=a("div",{target:"e106mp2o27"})("display:flex;flex-direction:column;gap:24px;background-color:var(--bg-white);padding:28px;border-radius:28px;height:100%;width:100%;",g.mobileDown,"{padding:16px;}"),St=a("div",se({},{target:"e106mp2o26"},ae(["level","hasBorder"])))("width:360px;position:relative;display:flex;flex-direction:column;gap:24px;background-color:var(--bg-white);padding:32px;border-radius:32px;font-weight:400;",g.mobileDown,"{width:300px;padding:16px;}",({level:t,hasBorder:n})=>n&&t==="ULTRA"&&fe("padding:4px;background:linear-gradient(80deg, var(--plan-ultra-start-color) 0%, var(--plan-ultra-end-color) 100%);",g.mobileDown,"{padding:4px;}")," ",({level:t,hasBorder:n})=>n&&t==="BOOST"&&fe("padding:4px;background:linear-gradient(80deg, var(--plan-boost-start-color) 0%, var(--plan-boost-end-color) 100%);",g.mobileDown,"{padding:4px;}"),";"),jt=a("div",{target:"e106mp2o25"})({name:"1d6yh3j",styles:"display:flex;flex-direction:column;gap:20px;flex-grow:1"}),Pt=a("h2",{target:"e106mp2o24"})(C.heading1," margin:0;",g.mobileDown,"{",C.button_medium,";}"),Tt=a("p",{target:"e106mp2o23"})(C.body_medium," margin:8px 0;color:var(--text-main);",g.mobileDown,"{",C.body_small,";}"),At=a("p",{target:"e106mp2o22"})(C.body_small," margin:0;",g.mobileDown,"{",C.body_small,";}"),Lt=a("div",{target:"e106mp2o21"})({name:"urqszi",styles:"display:flex;flex-direction:column;gap:4px"}),Ct=a("div",{target:"e106mp2o20"})({name:"budh8k",styles:"display:flex;flex-direction:column;gap:16px"}),X=a("div",{target:"e106mp2o19"})("display:flex;align-items:center;gap:12px;",C.heading1," font-weight:bold;",g.mobileDown,"{font-size:24px;}"),_t=a("div",{target:"e106mp2o18"})("min-height:104px;",g.mobileDown,"{min-height:72px;}"),Ce=a("div",{target:"e106mp2o17"})("font-size:18px;line-height:24px;padding:16px 12px;border-radius:16px;background-color:var(--bg-gray-light-2);",g.mobileDown,"{font-size:13px;line-height:18px;}");var Ut={name:"5fpdgn",styles:"height:72px"};const kt=a("div",{target:"e106mp2o16"})(({isCurrentPlan:t})=>!t&&Ut," ",g.mobileDown,"{height:unset;}"),It=a("div",{target:"e106mp2o15"})("text-align:center;font-size:22px;line-height:30px;font-weight:500;padding:16px;padding-top:0;",g.mobileDown,"{font-size:15px;line-height:20px;padding:12px;}"),G=a("span",{target:"e106mp2o14"})("display:flex;align-items:flex-start;gap:4px;font-size:32px;line-height:36px;font-weight:bold;",g.mobileDown,"{font-size:20px;line-height:28px;}"),be=a("span",{target:"e106mp2o13"})("font-size:18px;line-height:24px;font-weight:400;",g.mobileDown,"{font-size:13px;line-height:18px;}"),Bt=a("div",{target:"e106mp2o12"})({name:"urqszi",styles:"display:flex;flex-direction:column;gap:4px"}),ye=a("div",{target:"e106mp2o11"})({name:"1j5vobt",styles:"display:flex;align-items:center;gap:4px"}),Ot=a("span",{target:"e106mp2o10"})("font-size:18px;color:var(--text-third);text-decoration:line-through;",g.mobileDown,"{font-size:16px;}"),ce=a("div",{target:"e106mp2o9"})("text-transform:capitalize;height:27px;padding:8px 12px;font-size:16px;line-height:18px;display:flex;align-items:center;justify-content:center;font-weight:500;border-radius:20px;background-color:var(--primary-color);",g.mobileDown,"{font-size:13px;line-height:18px;}"),zt=a("div",{target:"e106mp2o8"})({name:"1kqmtx",styles:"font-size:16px;line-height:20px;font-weight:400;color:var(--text-third)"}),M=a("div",{target:"e106mp2o7"})(),W=a("div",{target:"e106mp2o6"})({name:"asx97m",styles:"display:flex;align-items:flex-start;gap:12px"}),K=a("div",{target:"e106mp2o5"})({name:"3w0yoi",styles:"display:flex;flex-direction:column;gap:8px"}),J=a("div",{target:"e106mp2o4"})(C.body_medium," flex-grow:1;",g.mobileDown,"{font-size:13px;line-height:18px;}"),Dt=a("div",{target:"e106mp2o3"})({name:"6kqe9x",styles:"display:flex;flex-direction:column;align-items:center;gap:12px"}),Rt=a("button",{target:"e106mp2o2"})(C.body_small," margin:0;padding:0;border:0;color:var(--text-secondary);background:transparent;text-decoration:underline;cursor:pointer;"),Q=a(we,{target:"e106mp2o1"})("width:100%;padding:16px;font-size:20px;line-height:28px;font-weight:500;height:unset;border-radius:32px;",g.mobileDown,"{font-size:15px;line-height:20px;padding:12px;}"),Nt=a("div",{target:"e106mp2o0"})("position:absolute;top:-20px;left:50%;transform:translateX(-50%);display:flex;white-space:nowrap;align-items:center;justify-content:center;padding:8px 16px;background:linear-gradient(80deg, var(--plan-ultra-start-color) 0%, var(--plan-ultra-end-color) 100%);border-radius:30px;color:white;font-size:18px;font-weight:700;line-height:24px;z-index:10;",g.mobileDown,"{font-size:12px;line-height:16px;padding:6px 12px;gap:4px;top:-14px;}");function oe(){return oe=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var o in r)({}).hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},oe.apply(null,arguments)}const Et=a("div",{target:"e1pe82v24"})("display:flex;flex-direction:column;align-items:center;justify-content:flex-end;position:relative;padding-bottom:92px;max-width:1920px;height:748px;background-size:cover;background-position-x:50%;background-position-y:60%;background-repeat:no-repeat;@media (max-width: 930px){height:600px;}@media (min-width: 1920px){border-bottom-left-radius:30px;border-bottom-right-radius:30px;}",g.mobileDown,"{height:450px;padding-bottom:60px;}width:100%;gap:16px;&::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 50%);z-index:1;pointer-events:none;@media (min-width: 1920px){border-bottom-left-radius:30px;border-bottom-right-radius:30px;}}"),Mt=a("div",oe({},{target:"e1pe82v23"},ae(["isWide"])))("position:relative;z-index:2;font-size:48px;font-weight:bold;line-height:60px;text-align:center;color:var(--white);width:calc(100% - 32px);max-width:",({isWide:t})=>t?"1300px":"900px",";@media (max-width: 930px){font-size:36px;line-height:40px;max-width:",({isWide:t})=>t?"100%":"500px",";}",g.mobileDown,"{font-size:24px;line-height:28px;max-width:",({isWide:t})=>t?"100%":"450px",";}"),Wt=a("div",{target:"e1pe82v22"})({name:"bd7uh9",styles:"position:relative;z-index:2;display:flex;align-items:center;gap:16px"}),ve=a("div",{target:"e1pe82v21"})("display:flex;align-items:center;gap:8px;font-size:16px;font-weight:500;line-height:24px;color:var(--white);",ce,"{color:var(--black);}"),Ht=a("div",{target:"e1pe82v20"})("position:absolute;top:8px;right:8px;z-index:2;",g.mobileDown,"{top:16px;left:16px;}"),Ft=({priceType:t,onPriceTypeChange:n,discount:r,hasActiveCloudPayments:o,hidePeriodToggle:l,hideDiscount:x})=>{const{t:d}=_(),{user:s}=ee(),{currency:y}=F(),i=V().isTrial(),c=s.type==="LoggedIn",h=c&&s.trial_used===!1&&s.subscription_level==="BASIC",u=c&&!i&&s.subscription_level==="BOOST",P=c&&s.subscription_level==="ULTRA",v=c&&!i&&s.subscription_level==="ULTRA"||P&&o,U=p.useMemo(()=>d(v?"plans-page/hero-title-ultra-active":h&&y==="rub"&&t==="ANNUAL"?"plans-page/hero-title-basic-trial-annual":u?"plans-page/hero-title-thanks":"plans-page/hero-title"),[v,h,y,t,u,d]);return e.jsxs(Et,{style:{backgroundImage:`url(${xt})`},children:[e.jsx(Ht,{children:e.jsx(yt,{})}),e.jsx(Mt,{isWide:v,children:U}),!l&&r!==void 0&&e.jsxs(Wt,{style:{cursor:"pointer"},onClick:()=>{const T=t==="ANNUAL"?"MONTHLY":"ANNUAL";q.emit("plans_page.period_toggle_clicked",{period:T}),n(T)},children:[e.jsx(ve,{children:d("plans-page/period-toggle/month")}),e.jsx(He,{onToggle:Fe,value:t==="ANNUAL"}),e.jsxs(ve,{children:[d("plans-page/period-toggle/year"),!x&&e.jsx(ce,{children:d("plans-page/discount",{count:r})})]})]})]})},H={BASIC:["store-and-organize-routes","sync-routes-across-platforms","save-routes-in-collections"],PLUS:["export-gpx-kml-tcx","send-to-garmin","download-offline-maps"],ULTRA:["strava-heatmap","build-multiday-routes","allow-export-without-reg"],BOOST:["support-mapmagic-team","top-users-card"]},qt=({cards:t,currentSubscriptionLevel:n,planCardsWrapperRef:r,isTrialAvailable:o,subscriptionCancelledAtPeriodEnd:l,showPromoCode:x,onPromoCodeClick:d})=>{const{t:s}=_(),y=V(),f="ULTRA";return e.jsx(vt,{ref:r,children:t.map(i=>{const c=Jt(i,o),h=e.jsxs(e.Fragment,{children:[e.jsxs(Ct,{children:[e.jsx(Yt,{level:i.id}),e.jsx($t,{level:i.id})]}),c?e.jsxs(jt,{children:[e.jsxs(Lt,{children:[e.jsx(Pt,{children:s("plans-page/trial-card/title",{days:qe})}),e.jsx(Tt,{children:i.id==="PLUS"?s("plans-page/trial-card/description-plus"):s("plans-page/trial-card/description-ultra")}),e.jsx(At,{children:e.jsx(Ye,{annualPrice:k(i.promoOriginalPrice??i.price,i.currency),monthlyPrice:k(i.price/12,i.currency),discountedAnnualPrice:i.promoOriginalPrice?k(i.price,i.currency):void 0,discountedMonthlyPrice:i.promoOriginalPrice?k(i.price/12,i.currency):void 0})})]}),e.jsx($e,{level:i.id,annualPrice:k(i.promoOriginalPrice??i.price,i.currency),discountedAnnualPrice:i.promoOriginalPrice?k(i.price,i.currency):void 0})]}):e.jsxs(e.Fragment,{children:[e.jsx(kt,{isCurrentPlan:i.price==="current-plan",children:e.jsx(Gt,{price:i.price,currency:i.currency,fullPrice:i.fullPrice,discount:i.discount,priceType:i.priceType,subscriptionLevel:i.id})}),i.promoOriginalPrice&&typeof i.price=="number"&&e.jsx(Ce,{children:s(i.priceType==="ANNUAL"?"plans-page/trial-card/renewal-price":"plans-page/promo-renewal-month",{price:k(i.promoOriginalPrice,i.currency)})}),e.jsx(Kt,{level:i.id})]}),e.jsxs(Dt,{children:[e.jsx(Xt,{subscriptionId:i.subscriptionId,level:i.id,activeSubscriptionLevel:n,isTrialAvailable:o,priceType:i.priceType,currency:i.currency,subscriptionCancelledAtPeriodEnd:l,promocode:i.promocode,onShowUpgradeUnavailableModal:()=>{y.openPaywallWithParams({feature:"general"})}}),x&&e.jsx(Rt,{type:"button",onClick:()=>d(i),children:s("discount-promocode/have-code")})]})]}),u=i.id===f,P=i.id==="ULTRA"&&u;return e.jsxs(St,{level:i.id,hasBorder:u,children:[P&&e.jsxs(Nt,{children:["ð¥ ",s("plans-page/most-popular")]}),u?e.jsx(wt,{children:h}):h]},i.id)})})};function Yt({level:t}){const{t:n}=_();switch(t){case"BASIC":return e.jsxs(X,{children:[e.jsx($,{size:"xl",level:"BASIC"}),e.jsx(R,{type:"BASIC",children:n("general/basic")})]});case"PLUS":return e.jsxs(X,{children:[e.jsx($,{size:"xl",level:"PLUS"}),e.jsx(R,{type:"PLUS",children:n("general/plus")})]});case"ULTRA":return e.jsxs(X,{children:[e.jsx($,{size:"xl",level:"ULTRA"}),e.jsx(R,{type:"ULTRA",children:n("general/ultra")})]});case"BOOST":return e.jsxs(X,{children:[e.jsx($,{size:"xl",level:"BOOST"}),e.jsx(R,{type:"BOOST",children:n("general/boost")})]})}}function $t({level:t}){const{t:n}=_();switch(t){case"BASIC":return null;case"PLUS":return null;case"ULTRA":return null;case"BOOST":return e.jsx(_t,{children:e.jsx(Ce,{children:n("plans-page/boost-short-description")})})}}function Xt({subscriptionId:t,level:n,activeSubscriptionLevel:r,isTrialAvailable:o,priceType:l,currency:x,subscriptionCancelledAtPeriodEnd:d,onShowUpgradeUnavailableModal:s,promocode:y}){const{t:f}=_(),{push:i}=Xe(),c=o&&x==="rub"&&l==="ANNUAL",[h,u]=Pe({fromUrl:window.location.pathname,onBeforeLeavePage:()=>Promise.resolve(),useTrial:c,promocode:y}),P=c,S=p.useCallback(()=>
1{if(q.emit("plans_page.payment_button_clicked",{plan:n,period:l,currency:x}),r==="PLUS"&&n==="ULTRA"){s();return}if(r!=="BASIC"&&!o){s();return}h(t)},[r,x,o,n,h,s,l,t]);if(r===n)return n==="BASIC"?e.jsx(It,{children:f("plans-page/button-your-plan")}):n==="PLUS"&&d?e.jsx(Q,{colorScheme:"plus",onClick:()=>i(Ge.settings.subscription),children:f("profile-settings/subscription-cancelled-modal/restore-button")}):null;switch(n){case"BASIC":return null;case"PLUS":return e.jsx(Q,{colorScheme:"plus",onClick:S,loading:u,children:f(P?"plans-page/button-try-for-free":"plans-page/button-continue-with-plus")});case"ULTRA":return e.jsx(Q,{colorScheme:"ultra",onClick:S,loading:u,children:f(P?"plans-page/button-try-for-free":r==="PLUS"?"plans-page/button-upgrade-to-ultra":"plans-page/button-continue-with-ultra")});case"BOOST":return e.jsx(Q,{colorScheme:"boost",onClick:S,loading:u,children:f("plans-page/button-support-mapmagic")})}}function Gt({price:t,currency:n,fullPrice:r,discount:o,priceType:l,subscriptionLevel:x}){const{t:d}=_();if(t==="current-plan")return e.jsx(G,{children:d("plans-page/button-your-plan")});if(t==="free")return e.jsx(G,{children:d("plans-page/price-free-forever")});const s=d(l==="MONTHLY"?"plans-page/price-per-month":"plans-page/price-per-year");if(x==="BOOST")return e.jsxs(G,{children:[k(t,n)," ",e.jsx(be,{children:s})]});const y=x==="ULTRA"&&l==="MONTHLY";return e.jsxs(Bt,{children:[e.jsxs(G,{children:[k(t,n)," ",e.jsx(be,{children:s})]}),r!==void 0&&r>0&&o!==void 0&&o>0&&!y&&e.jsxs(ye,{children:[e.jsx(Ot,{children:k(r,n)}),e.jsx(ce,{children:d("plans-page/discount",{count:o.toString()})})]}),y&&o!==void 0&&e.jsx(ye,{children:e.jsx(zt,{children:d("plans-page/missing-discount",{count:o})})})]})}function Kt({level:t}){const{t:n}=_();switch(t){case"BASIC":return e.jsx(J,{children:e.jsx(K,{children:H.BASIC.map(r=>e.jsxs(W,{children:[e.jsx(D,{Svg:E}),e.jsx(M,{children:n(`level-advantages/${r}`)})]},r))})});case"PLUS":return e.jsx(J,{children:e.jsx(K,{children:H.PLUS.map(r=>e.jsxs(W,{children:[e.jsx(D,{Svg:E}),e.jsx(M,{children:n(`level-advantages/${r}`)})]},r))})});case"ULTRA":return e.jsx(J,{children:e.jsxs(K,{children:[e.jsxs("div",{children:[e.jsx("span",{children:n("plans-page/get-all-from")})," ",e.jsx(R,{type:"PLUS",style:{fontWeight:"bold"},children:n("plans-page/get-all-from/plus")})," ",e.jsx("span",{children:n("plans-page/and-also")})]}),H.ULTRA.map(r=>e.jsxs(W,{children:[e.jsx(D,{Svg:E}),e.jsx(M,{children:n(`level-advantages/${r}`)})]},r)),e.jsxs(W,{children:[e.jsx(D,{Svg:E}),e.jsxs(M,{children:[n("plans-page/and")," ",e.jsx(Ke,{href:"#advantages-table",type:"text-link",onClick:r=>{r==null||r.preventDefault();const o=document.getElementById("advantages-table");o&&o.scrollIntoView({behavior:"smooth",block:"start"})},children:n("plans-page/more",{count:Je.reduce((r,o)=>o.levels.includes("ULTRA")&&!o.levels.includes("PLUS")?r+1:r,0)-H.ULTRA.length})})]})]})]})});case"BOOST":return e.jsx(J,{children:e.jsxs(K,{children:[e.jsxs("div",{children:[e.jsx("span",{children:n("plans-page/get-all-from")})," ",e.jsx(R,{type:"ULTRA",style:{fontWeight:"bold"},children:n("plans-page/get-all-from/ultra")})," ",e.jsx("span",{children:n("plans-page/and-also")})]}),H.BOOST.map(r=>e.jsxs(W,{children:[e.jsx(D,{Svg:E}),e.jsx(M,{children:n(`level-advantages/${r}`)})]},r))]})})}}function Jt(t,n){return n&&t.currency==="rub"&&t.priceType==="ANNUAL"&&typeof t.price=="number"}const Z=[{id:"PLUS",type:["ANNUAL"]},{id:"ULTRA",type:["MONTHLY","ANNUAL"]}],Qt=({type:t,planCardsWrapperRef:n,hasActiveCloudPayments:r,subscriptionCancelledAtPeriodEnd:o,promoValidation:l,showPromoCode:x,onPromoCodeClick:d})=>{var S;const{user:s}=ee(),f=V().isTrial(),i=s.type==="LoggedIn"&&s.trial_used===!1&&s.subscription_level==="BASIC";let c="BASIC";s.type==="LoggedIn"&&(s.subscription_level!=="BASIC"||r||!f)&&(c=s.subscription_level);const{prices:h}=F(),u=p.useMemo(()=>{if(h.type!=="success")return[];const v=Z.findIndex(b=>b.id===c),U=v!==-1?Z.slice(v):Z,T=Z.find(b=>b.id===c),B=T==null?void 0:T.type.includes(t);return U.map(b=>{const j=h.value.find(L=>L.subscription_level===b.id&&L.type===t||!B&&b.id===c);if(!j)return;let O;if(j.full_price&&j.full_price!==j.price&&(O=100-Math.round(j.price/j.full_price*100)),b.id==="ULTRA"&&t==="MONTHLY"){const L=h.value.find(z=>z.type==="ANNUAL"&&z.subscription_level==="ULTRA");L&&(O=100-Math.round(L.price/L.full_price*100))}let I;b.id===c?I="current-plan":b.price?I=b.price:I=j.price;const A=l==null?void 0:l.plans.find(L=>L.subscription_id===j.id);return A&&I!=="current-plan"&&I!=="free"&&(I=A.discounted_amount,O=l==null?void 0:l.discount_percent),{id:b.id,price:I,fullPrice:(A==null?void 0:A.original_amount)??j.full_price??0,discount:O,currency:j.currency,priceType:t,subscriptionId:j.id,...A&&(l==null?void 0:l.promocode)&&{promocode:l.promocode}
1,...A&&{promoOriginalPrice:A.original_amount}}}).filter(b=>b!==void 0)},[c,h,l,t]);if(h.type!=="success")return null;const P=u.length===1&&((S=u[0])==null?void 0:S.id)==="ULTRA";return p.createElement(qt,{cards:u,currentSubscriptionLevel:c,planCardsWrapperRef:n,isTrialAvailable:i,isUltraSingle:P,subscriptionCancelledAtPeriodEnd:o,showPromoCode:x,onPromoCodeClick:d})},Zt=a("div",{target:"e1noz2e35"})("background:var(--bg-gray-light);padding-bottom:40px;",g.mobileDown,"{padding-bottom:24px;}display:flex;flex-direction:column;align-items:center;"),Vt=a("div",{target:"e1noz2e34"})({name:"3egux5",styles:"position:relative;top:-32px;width:100%;display:flex;flex-direction:column;align-items:center;gap:16px"}),en=a(Qe,{target:"e1noz2e33"})("padding:32px 47px 32px 32px;border-radius:32px;width:819px;background:var(--bg-white);margin:0 auto;",g.mobileDown,"{padding:16px;}"),tn=a("div",{target:"e1noz2e31"})(C.heading1," text-align:center;color:var(--black);margin:16px 0 20px;",g.mobileDown,"{font-size:24px;line-height:24px;margin:32px 0 20px;}"),nn=a("div",{target:"e1noz2e30"})("position:sticky;top:0;left:0px;right:0px;width:819px;max-width:calc(100% - 16px);height:48px;background-color:var(--bg-white);",Ze.app_new," z-index:10;display:grid;grid-template-columns:1fr repeat(3, minmax(0, 100px));gap:8px;align-items:center;padding:0 47px 0 32px;margin:0 auto;",g.mobileDown,"{align-items:center;grid-template-columns:1fr repeat(3, minmax(0, 56px));padding:0 16px;width:calc(100% - 16px);height:60px;}"),rn=()=>{var ue;const{user:t}=ee(),n=t.type==="LoggedIn"&&t.subscription_level==="PLUS",r=le(),{paymentService:o}=Ve(),l=(ue=new URLSearchParams(window.location.search).get("promo"))==null?void 0:ue.trim(),[x,d]=p.useState(l??""),[s,y]=p.useState(),[f,i]=p.useState(!1),[c,h]=p.useState();p.useEffect(()=>{r.initialize()},[r]);const{prices:u,priceType:P}=F(),S=p.useCallback(m=>{d(m),y(void 0)},[]),v=p.useCallback(async()=>{if(!x.trim()||u.type!=="success")return;i(!0);const m=await o.validateDiscountPromocode({promocode:x,subscriptionIds:u.value.map(w=>w.id)});y(m.type==="success"?m.value:{status:"invalid",plans:[]}),i(!1)},[o,u,x]);p.useEffect(()=>{if(!l)return;if(t.type==="NotLoggedIn"){window.location.href=`/login?page=${encodeURIComponent(window.location.pathname+window.location.search)}`;return}if(t.type!=="LoggedIn"||u.type!=="success")return;let m=!0;return d(l),i(!0),o.validateDiscountPromocode({promocode:l,subscriptionIds:u.value.map(w=>w.id)}).then(w=>{m&&(y(w.type==="success"?w.value:{status:"invalid",plans:[]}),i(!1))}),()=>{m=!1}},[o,u,l,t.type]);const U=n?"ANNUAL":P,T=t.type==="LoggedIn"&&t.subscription_level==="BASIC",B=T&&t.trial_used===!1&&(c==null?void 0:c.currency)==="rub"&&c.priceType==="ANNUAL",te=(s==null?void 0:s.status)==="valid"&&c&&s.plans.some(m=>m.subscription_id===c.subscriptionId)?s.promocode:void 0,[b,j]=Pe({fromUrl:window.location.pathname,onBeforeLeavePage:()=>Promise.resolve(),useTrial:B,promocode:te}),O=p.useMemo(()=>(s==null?void 0:s.status)!=="valid"||!c||s.plans.some(m=>m.subscription_id===c.subscriptionId)?s:{status:"not_applicable",plans:[]},[s,c]),I=p.useCallback(()=>{c&&(q.emit("plans_page.payment_button_clicked",{plan:c.id,period:c.priceType,currency:c.currency}),b(c.subscriptionId))},[c,b]),A=p.useRef(null),L=p.useRef(null),[z,_e]=p.useState(null),[Ue,ke]=p.useState(!1),Ie=et();p.useEffect(()=>{if(!z)return;const m=new IntersectionObserver(([w])=>{w&&ke(w.intersectionRatio<.99&&w.boundingClientRect.y<300)},{threshold:.99});return m.observe(z),()=>{m.disconnect()}},[z]);const Be=p.useMemo(()=>{if(t.type==="LoggedIn"&&tt({currentLevel:t.subscription_level,requiredLevel:"ULTRA"}))return;if(u.type!=="success")return 0;const m=u.value.find(w=>w.type==="ANNUAL"&&w.subscription_level==="ULTRA");return!(m!=null&&m.price)||!m.full_price?0:100-Math.round(m.price/m.full_price*100)},[u,t]),{t:N}=_(),pe=Se(),[de,Oe]=p.useState(!1),[ze,De]=p.useState(!1);return p.useEffect(()=>{let m=!0;return pe.getActiveSubscriptionDetails().then(w=>{var xe,he,me;if(!m||w.type!=="success")return;const Y=w.value,ge=Y.cloudpayments;Oe(!!(ge&&!ge.cancel_at_period_end)),De(((xe=Y.cloudpayments)==null?void 0:xe.cancel_at_period_end)===!0||((he=Y.tinkoff)==null?void 0:he.cancel_at_period_end)===!0||((me=Y.stripe)==null?void 0:me.cancel_at_period_end)===!0)}),()=>{m=!1}},[pe]),u.type==="pending"?e.jsx(nt,{fullScreen:!0}):u.type==="failure"?e.jsx(Re,{error:u.error}):e.jsxs(e.Fragment,{children:[e.jsx(Ft,{priceType:U,onPriceTypeChange:r.setPriceType,discount:Be,hasActiveCloudPayments:de,hidePeriodToggle:n,hideDiscount:(s==null?void 0:s.status)==="valid"}),e.jsx(Vt,{children:e.jsx(Qt,{type:U,planCardsWrapperRef:L,hasActiveCloudPayments:de,subscriptionCancelledAtPeriodEnd:ze,promoValidation:(s==null?void 0:s.status)==="valid"?s:void 0,showPromoCode:T,onPromoCodeClick:h})}),c&&e.jsx(rt,{open:!0,onClose:()=>h(void 0),code:x,onChange:S,onApply:v,validation:O,isChecking:f,isTrial:B,primaryActionText:(B?N("paywall/trial-v3/button"):c.id==="PLUS"?N("plans-page/button-continue-with-plus"):N("plans-page/button-continue-with-ultra"))??"",primaryActionColorScheme:sn(c.id),primaryActionLoading:j,onPrimaryAction:I}),e.jsxs(e.Fragment,{children:[e.jsx(tn,{ref:A,children:N("plans-page/all-benefits-title")}),Ue&&e.jsxs(nn,{children:[e.jsx(it,{children:N("plans-page/what-else-title")}),e.jsx(ne,{children:e.jsx(re,{level:"BASIC",short:Ie})}),e.jsx(ne,{children:e.jsx(re,{level:"PLUS"})}),e.jsx(ne,{children:e.jsx(re,{level:"ULTRA"})})]}),e.jsx(en,{highlightedLevel:"ULTRA",headerRef:_e}),e.jsx(gt,{allBenefitsTitleRef:A,planCardsWrapperRef:L})]})]})};function sn(t){switch(t){case"ULTRA":return"ultra";
1case"BOOST":return"boost";default:return"plus"}}const cn=()=>(p.useEffect(()=>{q.pageViewed("plans")},[]),e.jsx(Zt,{children:e.jsx(rn,{})}));export{cn as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.