1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[634],{12327:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/auth",function(){return r(77221)}])},51932:(e,t,r)=>{"use strict";r.d(t,{Ij:()=>c,Ri:()=>n,TV:()=>o,Wb:()=>u,cs:()=>p,fU:()=>h,jS:()=>d,n4:()=>_,zs:()=>s});var a=r(35296),i=r(47819);let n=e=>(0,a.Ri)(e),o=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,a.TV)(e,t,{path:"/",domain:(0,i.Xx)(window.location.host),...r})},s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,i.Xx)(window.location.host);(0,a.Yj)(e,t,r)},l=()=>{let e=null;try{e=ga.getAll()[0].get("clientId")}catch(e){}return e},c=()=>{let e=l();return e?"&ga_id=".concat(e):""},d=(e,t)=>{"Enter"===e.key&&t()},_=e=>e.replace(/[^\d+]+/g,""),u=e=>{if((e=e.toString().replace(/\D/g,"")).length<10)return e;let t="",r="";if(11===e.length)t="+".concat(e[0]),r=e.slice(1);else{if(12!==e.length)return e;t="+".concat(e.slice(0,2)),r=e.slice(2)}return"".concat(t," ").concat(r.slice(0,3)," ").concat(r.slice(3,6)," ").concat(r.slice(6,8)," ").concat(r.slice(8,10))},p=()=>{window.scrollTo({top:document.documentElement.scrollHeight,behavior:"smooth"})},h=e=>{let t=Math.floor(e/60),r=e%60;return"".concat(t,":").concat(r<10?"0":"").concat(r)}},78048:(e,t,r)=>{"use strict";r.d(t,{A:()=>_});var a=r(74848),i=r(5556),n=r.n(i),o=r(96540),s=r(32850),l=r(27398),c=r.n(l);let d=o.memo(e=>{let{codeLength:t=4,onComplete:r,errorText:i="",value:n,onChange:l,disabled:d=!1,onFocus:_,onBlur:u,handleCodeEventFocus:p}=e,h=(0,o.useRef)(null),[g,m]=(0,o.useState)(!1);(0,o.useEffect)(()=>{let e=(0,s.$R)();return e&&e.promise.then(e=>{l(e.code.slice(0,t)),e.code.length===t&&r&&r(e.code)}).catch(e=>{"AbortError"===e.name||console.error("ÐÑибка WebOTP API: ".concat(e))}),null==e?void 0:e.abort},[t,r,l]);let v=()=>{h.current&&(h.current.focus({preventScroll:!0}),p&&p())};return(0,o.useEffect)(()=>{v()},[]),(0,a.jsxs)("div",{className:c().codeInputWrapper,onClick:v,children:[(0,a.jsxs)("div",{className:c().codeAndErrorWrapper,children:[(0,a.jsx)("div",{className:c().codeCells,children:Array.from({length:t}).map((e,r)=>{let o=r===n.length&&n.length<t,s=""!==i;return(0,a.jsx)("div",{className:"".concat(c().codeCell," ").concat(o?c().focused:""," ").concat(s?c().error:""),"aria-label":"Digit ".concat(r+1),children:n[r]||(o&&g?(0,a.jsx)("span",{className:c().cursor}):"")},r)})}),i&&(0,a.jsx)("div",{id:"code-error",className:c().errorText,children:i})]}),(0,a.jsx)("input",{id:"pin-0",ref:h,type:"text",value:n,onChange:e=>{let a=e.target.value;/^\d*$/.test(a)&&a.length<=t&&(l(a),a.length===t&&r&&r(a))},onKeyDown:e=>{"Backspace"===e.key&&(e.preventDefault(),l(n.slice(0,-1)))},onPaste:e=>{e.preventDefault();let a=e.clipboardData.getData("text").trim();if(/^\d+$/.test(a)){let e=a.slice(0,t).split(""),i=e.join("");l(i),e.length===t&&r&&r(i)}},autoComplete:"one-time-code",inputMode:"numeric",pattern:"\\d*",className:c().hiddenInput,onFocus:()=>{m(!0),_&&_()},onBlur:()=>{m(!1),u&&u()},maxLength:t,"aria-label":"Code input","aria-invalid":""!==i,"aria-describedby":""!==i?"code-error":void 0,disabled:d,required:!0})]})});d.propTypes={codeLength:n().number,onComplete:n().func.isRequired,errorText:n().string,value:n().string.isRequired,onChange:n().func.isRequired,disabled:n().bool,onFocus:n().func,onBlur:n().func};let _=d},77221:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>eS});var a=r(74848),i=r(96540),n=r(74368),o=r(35296),s=r(86715),l=r.n(s),c=r(41364),d=r(18056),_=r(53823),u=r.n(_),p=r(46942),h=r.n(p),g=r(75756),m=r(51932),v=r(30291),E=r(71662),f=r.n(E),y=r(38949),b=r(97461),S=r(70805),T=r(47819),x=r(27116),R=r(4745),I=r.n(R);let O={PASSWORD:"password",TEXT:"text"},A=e=>{let{className:t,name:r=(0,o.cF)(10),value:n="",type:s=O.TEXT,label:l="",hasError:c=!1,errorText:_="",inputProps:u={},disabled:p=!1,onChange:g=()=>{},onBlur:m=()=>{},onFocus:v=()=>{},placeholder:E="",loginMethod:f}=e,[y,b]=(0,i.useState)(()=>s),[S,T]=(0,i.useState)(!1);return(0,a.jsxs)("div",{className:h()(t,I().field),children:[(0,a.jsxs)("div",{className:h()(I().container,{[I().container__error]:c,[I().container__focused]:S&&!c}),children:[l?(0,a.jsx)("label",{className:h()(I().label,{[I().label__focused]:n||S}),htmlFor:r,children:l}):null,(0,a.jsx)("input",{id:r,type:y,value:n,className:h()(I().input,{[I().input__focused]:n||S}),disabled:p,onChange:e=>{g(e.target.value)},onBlur:()=>{T(!1),m()},onFocus:()=>{T(!0),v()},placeholder:E,...u,...f===d.Rx.phone&&{inputMode:"numeric",pattern:"[0-9]*"}}),s===O.PASSWORD?(0,a.jsx)("div",{className:I().eye,onClick:()=>{b(e=>e===O.PASSWORD?O.TEXT:O.PASSWORD)},children:(0,a.jsx)("img",{className:I().icon,src:"/static/images/registration/eye-".concat(y===O.PASSWORD?"on":"off",".svg"),alt:"show password"})}):null]}),c&&_?(0,a.jsx)("div",{className:I().error,children:_}):null]})};var N=r(28133),C=r.n(N),P=r(36637),j=r.n(P);let w={APPLE_ERROR:"ТеÑ
ниÑеÑÐºÐ°Ñ Ð½ÐµÐ¿Ð¾Ð»Ð°Ð´ÐºÐ°. ÐопÑобÑйÑе еÑе Ñаз â или иÑполÑзÑйÑе поÑÑÑ",USER_ALREADY_LOGGED_IN:"Apple ID иÑполÑзÑеÑÑÑ. ÐÑли ÑÑо вÑ, Ñо вÑйдиÑе и попÑобÑйÑе Ñнова",NOT_REGISTERED:"Apple ID не найден. ÐожалÑйÑÑа, заÑегиÑÑÑиÑÑйÑеÑÑ",SOMETHING_WENT_WRONG:"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак. ÐопÑобÑйÑе позже"};var k=r(84538),L=r.n(k);let D={DEFAULT:"ÐÑибка авÑоÑизаÑии.<br />ÐожалÑйÑÑа, попÑобÑйÑе еÑÑ Ñаз â или иÑполÑзÑйÑе поÑÑÑ",CODE_NOT_FOUND:"ЧÑо-Ñо не ÑÑ
одиÑÑÑ! ÐÑ Ð¾ÑпÑавлÑли дÑÑгой код",PHONE_ALREADY_USED:"ÐÑÐ¾Ñ Ð½Ð¾Ð¼ÐµÑ Ñже заÑегиÑÑÑиÑован",WRONG_USER:"ЧÑо-Ñо не ÑÑ
одиÑÑÑ! ÐÑ Ð¾ÑпÑавлÑли дÑÑгой код",SMS_SEND_DISABLED:"ÐомеÑ
и Ð¾Ñ Ð»ÐµÑÑÑиÑ
мимо комеÑ! РегиÑÑÑиÑÑйÑеÑÑ ÑеÑез поÑÑÑ, Ñак надÑжнее",SMS_SERVER_ERROR:"ÐомеÑ
и Ð¾Ñ Ð»ÐµÑÑÑиÑ
мимо комеÑ! РегиÑÑÑиÑÑйÑеÑÑ ÑеÑез поÑÑÑ, Ñак надÑжнее",SMS_LIMIT_EXCEEDED:"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ÑаÑ. Ð Ð²Ñ Ð·Ð½Ð°Ð»Ð¸, ÑÑо на наÑем YouTube-канале еÑÑÑ Ð±ÐµÑплаÑнÑе ÑÐ¿Ð¸Ð·Ð¾Ð´Ñ Ð½ÐµÐºÐ¾ÑоÑÑÑ
ÑеÑиалов?",CAPTCHA_IS_NEEDED:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",CAPTCHA_IS_WRONG:"ЧÑо-Ñо не ÑÑ
одиÑÑÑ! Ðа каÑÑинке бÑло дÑÑгое ÑиÑло",INVALID_PASSWORD:"ЧÑо-Ñо не ÑÑ
одиÑÑÑ! ÐÑовеÑÑÑе поÑÑÑ Ð¸ паÑолÑ",EMAIL_IS_NEEDED:"ÐÑибка авÑоÑизаÑии.<br />поÑÑа обÑзаÑелÑна, Ñакие пÑавила",SIGN_IN_FAILED:"ÐÑибка авÑоÑизаÑии.<br />ÐожалÑйÑÑа, попÑобÑйÑе еÑÑ Ñаз â или иÑполÑзÑйÑе поÑÑÑ",SIGN_IN_CANCELLED:"ÐÑибка авÑоÑизаÑии.<br />ÐожалÑйÑÑа, попÑобÑйÑе еÑÑ Ñаз â или иÑполÑзÑйÑе поÑÑÑ",SIGN_IN_CURRENTLY_IN_PROGRESS:"ÐÑибка авÑоÑизаÑии.<br />ÐожалÑйÑÑа, попÑобÑйÑе еÑÑ Ñаз â или иÑполÑзÑйÑе поÑÑÑ",AUTH_CODE_IS_EXPIRED:"ÐÑибка авÑоÑизаÑии.<br />ÐожалÑйÑÑа, попÑобÑйÑе еÑÑ Ñаз â или иÑполÑзÑйÑе поÑÑÑ",GOOGLE_ERROR:"ÐÑибка авÑоÑизаÑии.<br />ÐожалÑйÑÑа, попÑобÑйÑе еÑÑ Ñаз â или иÑполÑзÑйÑе поÑÑÑ",FB_ERROR:"ÐÑибка авÑоÑизаÑии.<br />ÐожалÑйÑÑа, попÑобÑйÑе еÑÑ Ñаз â или иÑполÑзÑйÑе поÑÑÑ",ACCOUNT_CONFLICT_G:"ÐÑÐ¾Ñ Google-аккаÑÐ½Ñ Ñже иÑполÑзÑеÑÑÑ.<br />ÐÑли ÑÑо вÑ, пÑоÑÑо вÑйдиÑе и авÑоÑизÑйÑеÑÑ Ñнова â ÑеÑез Google. ",ACCOUNT_CONFLICT_F:"ÐÑÐ¾Ñ Facebook-аккаÑÐ½Ñ Ñже иÑполÑзÑеÑÑÑ.<br />ÐÑли ÑÑо вÑ, пÑоÑÑо вÑйдиÑе и авÑоÑизÑйÑеÑÑ Ñнова â ÑеÑез Facebook",USER_ALREADY_LOGGED_IN_F:"ÐÑÐ¾Ñ Facebook - аккаÑÐ½Ñ Ñже иÑполÑзÑеÑÑÑ. ÐÑли ÑÑо вÑ, пÑоÑÑо вÑйдиÑе и авÑоÑизÑйÑеÑÑ Ñнова â ÑеÑез Facebook",USER_ALREADY_LOGGED_IN_G:"ÐÑÐ¾Ñ Google - аккаÑÐ½Ñ Ñже иÑполÑзÑеÑÑÑ. ÐÑли ÑÑо вÑ, пÑоÑÑо вÑйдиÑе и авÑоÑизÑйÑеÑÑ Ñнова â ÑеÑез Google",NOT_REGISTERED:"ÐккаÑÐ½Ñ Ð½Ðµ найден. ÐаÑегиÑÑÑиÑÑйÑеÑÑ Ð¿Ð¾ ÑÑÑлке Ð²Ð½Ð¸Ð·Ñ Ð¸Ð»Ð¸ войдиÑе ÑеÑез поÑÑÑ","Maximum number of SMS messages was sent in last hour":"ÐÑевÑÑено колиÑеÑÑво запÑоÑов кода","User has already been registered":"ÐÑÐ¾Ñ Ð¿Ð¾ÑÑÑ Ñже заÑегиÑÑÑиÑован","Email has wrong format":"ÐекоÑÑекÑнÑй ÑоÑÐ¼Ð°Ñ Ð¿Ð¾ÑÑÑ"};var M=r(25091),G=r(33256),W=r.n(G);let V={Yandex:e=>{let{setDto:t,changeStep:r}=e,s=c.Ay.useApiUrl(),{clientApiQuery:l}=c.Ay.useApiClientKey(),_=c.Ay.useClickHouseShoot(),u=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),{windowInnerWidth:p}=(0,n.d4)(e=>e.systemInformation),[h,g]=(0,i.useState)(!1),[m,v]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=document.getElementById("ya");if(!e)return;let t=()=>{let t=e.querySelectorAll(".yaPersonalButton");if(!(t.length<=1))for(let e=1;e<t.length;e++)t[e].remove()};t();let r=new MutationObserver(()=>{t()});return r.observe(e,{childList:!0,subtree:!0}),()=>r.disconnect()},[]),(0,i.useEffect)(()=>{(()=>{let e=document.createElement("script");e.src="https://yastatic.net/s3/passport-sdk/autofill/v1/sdk-suggest-latest.js",e.async=!0,e.onload=()=>{E()},e.onerror=()=>{console.error("Failed to load the Yandex OAuth SDK")},document.head.appendChild(e)})()},[]),(0,i.useEffect)(()=>{h&&window.YaAuthSuggest&&window.YaAuthSuggest.init({client_id:"bce2a97f03434310aedfb590781a3ef0",response_type:"token",redirect_uri:"".concat(window.location.origin,"/token/yandex")},"".concat(window.location.origin),{buttonSize:p>1024?"l":"s",customBgColor:"transparent",customBgHoveredColor:"transparent",customBorderColor:"",customBorderWidth:"0",view:"button",parentId:"ya",buttonView:"iconBg",buttonTheme:"light",buttonBorderRadius:"8",buttonIcon:"ya",customBorderHoveredColor:"transparent"}).then(e=>{let{handler:t}=e;return v(!0),t()}).then(e=>{let a="".concat(s).concat(T.PI.yaLogin).concat(l),i={access_token:e.access_token};try{fetch(a,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).then(e=>{e.json().then(a=>{e.status<400?(r(d.RZ.SOCIAL_SUCCESS),t(e=>({...e,authType:d.tG.YANDEX,userProfileData:a})),(0,o.EF)(),_({screen_type:200===e.status?d.sv.LOGIN:d.sv.REGISTRATION,screen_attributes_id:"success",account_id:a._id,profile_id:a.profile_id,account_type:a.type?a.type.toLowerCase():"",screen_attributes_ab_tag:a.tags||"",action_id:200===e.status?d.sv.LOGIN:d.sv.REGISTRATION,action_result:"yandex",virtual_profile_id:null==u?void 0:u._id,event_time:new Date().getTime(),referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})):(r(d.RZ.SOCIAL_ERROR),t(e=>({...e,error:a})))}).catch(e=>{r(d.RZ.SOCIAL_ERROR),t(t=>({...t,error:e}))})})}catch(e){r(d.RZ.SOCIAL_ERROR),t(t=>({...t,error:e}))}}).catch(e=>{console.error("ÐбÑабоÑка оÑибки",e)})},[h]);let E=()=>{g(!0)};return(0,a.jsxs)("div",{className:W().wrapper,onClick:()=>{_({action_id:"click",element_type:"button",element_attributes_id:"auth_yandex_id",screen_type:"login_registration",screen_attributes_id:"login_registration"})},children:[!m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M.A,{className:W().spinner}),(0,a.jsx)("div",{className:W().icon__wrapper})]}),(0,a.jsx)("div",{id:"ya",className:W().button})]})},Google:e=>{let{disabled:t,setDto:r,changeStep:i}=e,s=c.Ay.useApiUrl(),l=c.Ay.useClickHouseShoot(),_=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),u=c.Ay.usePushStack(),{clientApiQuery:p}=c.Ay.useApiClientKey(),h=(0,y.A)(),g=async e=>{let t="".concat(s).concat(T.PI.googleAuth).concat(p),a={auth_code:e.code};try{let e=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),n=await e.json();if(e.ok)l({account_id:n._id,profile_id:n.profile_id,screen_type:"registration",screen_attributes_id:"success",screen_attributes_ab_tag:n.tags||"",action_id:"registration",action_result:"google",virtual_profile_id:null==_?void 0:_._id,event_time:new Date().getTime(),referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),(null==n?void 0:n.need_credentials)&&(null==n?void 0:n.current_country_code)==="RU"&&((null==n?void 0:n.apple_id)||(null==n?void 0:n.google_id))&&!(null==n?void 0:n.phone)?((0,o.TV)("socialReg","true"),i(d.RZ.SOCIAL_COLLECT_CREDS)):(await h(n),u({text:"ÐовÑй аккаÑÐ½Ñ Ð·Ð°ÑегиÑÑÑиÑован ÑеÑез Google",withError:!1}));
1else if("GOOGLE_ERROR"===n.code)switch(r(e=>({...e,authType:d.tG.GOOGLE})),n.message){case d.iE.SOCIAL_AUTH_DISABLED:i(d.RZ.FORCE_LOGIN_WITH_PHONE);break;case d.iE.SOCIAL_SIGNUP_DISABLED:i(d.RZ.SOCIAL_REGISTER_UNAVAILABLE)}else{let e=D[n.code]||"ÐÑибка авÑоÑизаÑии.<br />ÐожалÑйÑÑа, попÑобÑйÑе еÑÑ Ñаз â или иÑполÑзÑйÑе поÑÑÑ";u({text:e,withError:!0})}}catch(e){u({text:D.DEFAULT,withError:!0})}},m=async()=>{l({screen_type:d.sv.LOGIN,screen_attributes_id:"external",action_id:"click",element_type:"button",element_attributes_id:"auth_google"}),window.google.accounts.oauth2.initCodeClient({client_id:"499709915422-29abur395ckft86gjigvu8rlrsk92b5c.apps.googleusercontent.com",callback:e=>g(e),scope:"profile email"}).requestCode()};return(0,a.jsx)("button",{className:L().button,disabled:t,onClick:m,children:(0,a.jsx)("img",{src:"/static/images/registration/social/".concat(t?"go_disabled":"go",".svg"),alt:"go",className:L().icon})})},Apple:e=>{let{disabled:t,setDto:r,changeStep:i}=e,s=c.Ay.useApiUrl(),l=c.Ay.useApiKey(),_=c.Ay.useClickHouseShoot(),u=c.Ay.usePushStack(),p=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),h=(0,y.A)(),g=async()=>{var e;_({screen_type:d.sv.LOGIN,screen_attributes_id:"external",action_id:"click",element_type:"button",element_attributes_id:"auth_apple"}),AppleID.auth.init({clientId:"site.start.ru",scope:"email name",redirectURI:"".concat(window.location.origin,"/signin"),usePopup:!0}),null===(e=AppleID.auth)||void 0===e||e.signIn().then(e=>{var t;let a="".concat(s).concat(T.PI.appleLogin).concat(l,"&auth_token=").concat(e.authorization.id_token),n={advertising_id:"4ba5346e-3107-4f10-a5e6-c6e6809f6553",appsflyer_id:"603d2dd4-7846-4d9b-9423-9a072224dcd7",auth_code:null==e?void 0:null===(t=e.authorization)||void 0===t?void 0:t.code,client_id:"site.start.ru",idfa:"A22EB9C3-B232-4C0B-BA8B-FB6A87565A13",os:"17.1"};try{fetch(a,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(e=>e.ok?e.json().then(e=>{_({account_id:e._id,profile_id:e.profile_id,screen_type:"registration",screen_attributes_id:"success",screen_attributes_ab_tag:e.tags||"",action_id:"registration",action_result:"appleid",virtual_profile_id:null==p?void 0:p._id,event_time:new Date().getTime(),referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),(null==e?void 0:e.need_credentials)&&(null==e?void 0:e.current_country_code)==="RU"&&((null==e?void 0:e.apple_id)||(null==e?void 0:e.google_id))&&!(null==e?void 0:e.phone)?((0,o.TV)("socialReg","true"),i(d.RZ.SOCIAL_COLLECT_CREDS)):(h(e),u({text:"ÐовÑй аккаÑÐ½Ñ Ð·Ð°ÑегиÑÑÑиÑован ÑеÑез Apple",withError:!1}))}):e.json().then(e=>{if((null==e?void 0:e.code)==="APPLE_ERROR")switch(r(e=>({...e,authType:d.tG.APPLE})),e.message){case d.iE.SOCIAL_AUTH_DISABLED:i(d.RZ.FORCE_LOGIN_WITH_PHONE);break;case d.iE.SOCIAL_SIGNUP_DISABLED:i(d.RZ.SOCIAL_REGISTER_UNAVAILABLE)}else{let t=(null==e?void 0:e.code)&&w[null==e?void 0:e.code]?w[null==e?void 0:e.code]:w.SOMETHING_WENT_WRONG;u({text:t,withError:!0})}}))}catch(e){u({text:w.SOMETHING_WENT_WRONG,withError:!0})}}).catch(()=>{u({text:w.SOMETHING_WENT_WRONG,withError:!0})})};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C(),{type:"text/javascript",src:"https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"}),(0,a.jsx)("button",{className:j().button,disabled:t,onClick:g,children:(0,a.jsx)("img",{src:"/static/images/registration/social/".concat(t?"ap_disabled":"ap",".svg"),alt:"ap",className:j().icon})})]})}};var Z=r(3433),H=r.n(Z);let U=e=>{let{activeInput:t=d.Rx.email,onToggle:r}=e,[n,o]=(0,i.useState)(t);(0,i.useEffect)(()=>{o(t)},[t]);let s=e=>{o(e),r(e)};return(0,a.jsxs)("div",{className:H().toggleContainer,children:[(0,a.jsx)("div",{className:"".concat(H().slider," ").concat(n===d.Rx.email?H().sliderEmail:H().sliderPhone)}),(0,a.jsx)("button",{className:"".concat(H().toggleButton," ").concat(n===d.Rx.email?H().activeButton:""),onClick:()=>s(d.Rx.email),children:"ÐоÑÑа"}),(0,a.jsx)("button",{className:"".concat(H().toggleButton," ").concat(n===d.Rx.phone?H().activeButton:""),onClick:()=>s(d.Rx.phone),children:"ТелеÑон"})]})},F={EMPTY:"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ ÑелеÑона или поÑÑÑ",WRONG_EMAIL:"ÐекоÑÑекÑнÑй ÑоÑÐ¼Ð°Ñ Ð¿Ð¾ÑÑÑ",INCORRECT_PHONE:"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +7 900 000 00 00",INCORRECT_TJ:"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +992000000000"};var B=r(10059),K=r(94069),Y=r.n(K),z=r(91106),X=r.n(z),J=r(55700),q=r(78048),$=r(47726),Q=r.n($);let ee=(0,i.forwardRef)((e,t)=>{let{visible:r,children:i,className:n}=e;return(0,a.jsx)("div",{ref:t,className:h()(Q().tooltip,{[Q().tooltipVisible]:r},n),children:i})});var et=r(61938),er=r.n(et);let ea=e=>{let{text:t,onClick:r,icon:i,children:n,className:o,disabled:s=!1,alt:l="icon"}=e;return(0,a.jsxs)("button",{className:h()(er().tooltipButton,o,{[er().disabled]:s}),onClick:s?void 0:r,disabled:s,children:[i&&(0,a.jsx)("img",{src:i,alt:l,className:er().tooltipButtonIcon}),t||n]})};var ei=r(6774),en=r.n(ei);let eo=e=>{let{isOpen:t,onClose:r,children:i,title:n}=e;return(0,a.jsx)("div",{className:h()(en().overlay,{[en().overlay_visible]:t}),onClick:r,children:(0,a.jsxs)("div",{className:h()(en().drawer,{[en().drawer_visible]:t}),onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:en().header,children:[(0,a.jsx)("div",{className:en().headerTitle,children:n}),(0,a.jsx)("img",{src:"/static/images/auth/closeIconWhite.svg",className:en().closeIcon,alt:"Close",onClick:r})]}),i]})})},es=e=>{if(!e||Number.isNaN(Number(e)))return 0;let t=Math.floor(Date.now()/1e3);return e>1e12?Math.max(0,Math.floor(e/1e3-t)):e>1e9?Math.max(0,Math.floor(e-t)):Math.max(0,Math.floor(e))},el={EMPTY:"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ ÑелеÑона",INCORRECT_PHONE:"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +7 900 000 00 00",INCORRECT_TJ:"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +992000000000"},ec={Core:e=>{var t;let{changeStep:r,setDto:s,dto:l}=e,_=(0,n.d4)(e=>{var t;return null===(t=e.registration)||void 0===t?void 0:t.authData}),u=(0,n.d4)(e=>e.systemInformation.outerSource),p=c.Ay.useApiUrl(),g=c.Ay.useApiKey(),E=c.Ay.useClickHouseShoot(),y=c.Ay.useResponsiveButtonSize(),[R,I]=(0,i.useState)(d.Rx.email),[N,C]=(0,S.e)({emailOrPhone:"",hasEmailOrPhoneError:!1,emailOrPhoneErrorText:"",hasCaptcha:!1,captcha:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1,fieldType:"",firstEight:null,firstSeven:null}),P=(0,o.Ri)(d.v8.FROM_PRODUCT_PAGE_WITH_FREE_CONTENT),j=()=>{let e=N.emailOrPhone,{noMaskValue:t}=k(e),r=/\+992\d{0,9}\D{0}/.test(t),a=/\+992\d{9}
1/.test(t)&&13===t.length,i="email"===N.fieldType&&!a,n=i?null:(N.firstEight||N.firstSeven?t[1]:t[0])!=="9",o=N.firstEight||N.firstSeven?"+7"+t.slice(1):"+7"+t,s=!1,l="";return e.length?(r||i||(0,x.OK)(o)&&12===o.length&&!n)&&(/\D/.test(t)||12===o.length)?r&&!a?(s=!0,l=F.INCORRECT_TJ):r||!i||(0,x.xd)(e)||(s=!0,l=F.WRONG_EMAIL):(s=!0,l=F.INCORRECT_PHONE):(s=!0,l=F.EMPTY),s&&(C(e=>{e.hasEmailOrPhoneError=s,e.emailOrPhoneErrorText=l}),E({screen_type:"login_registration",screen_attributes_id:"login_registration",action_id:"error",action_result:l,action_attributes_str:"",action_parameter:"authentication"})),{isFormValid:!s,type:i?d.bh.EMAIL:d.bh.PHONE}},w=e=>{let{noMaskValue:t,skip:r,firstEight:a,firstSeven:i,force:n}=k(e);return((a||i?t.length>11:t.length>10)||/\D/.test(t)||!t.length)&&!n?{maskValue:t,fieldType:r?"phone":"email",firstEight:"boolean"==typeof a?a:N.firstEight,firstSeven:"boolean"==typeof i?i:N.firstSeven}:{maskValue:t.replace(a?"8":i?"7":/\+7/,"").replace(/\D/g,"").replace(/^(\d{0,3})(\d{0,3})(\d{0,2})(\d{0,2})$/,(e,t,r,a,i)=>"+7 (".concat(t).concat(r?") "+r:r).concat(a?" "+a:a).concat(i?" "+i:i)),fieldType:"phone",firstEight:a,firstSeven:i}},k=e=>{let{firstEight:t,firstSeven:r}=N;if(!/\D/.test(e)&&/\d/g.test(e)&&(/[7,8]/.test(e[0])?e.length<12:e.length<11))return{type:"phone",noMaskValue:e,firstEight:"8"===e[0],firstSeven:"7"===e[0]};if(/\+7\s\(\d{1,3}/.test(e)){let a=e.replace("+7","").replace(/\(/,"").replace(/\)/,"").replace(/\s/g,"");return{noMaskValue:t?"8"+a:r?"7"+a:a,type:"phone",firstEight:t,firstSeven:r}}if(/^\+7\s\(\D{1}$/.test(e)){let a=e.replace("+7","").replace(/\(/,"").replace(/\s/g,"");return{noMaskValue:t?"8"+a:r?"7"+a:a,type:"email",firstEight:t,firstSeven:r}}if(/^\+7\s\(\d{0}$/.test(e)&&!t&&!r)return{noMaskValue:"",type:"phone",skip:!0,firstEight:t,firstSeven:r};if(/^\+7\s\({0}$/.test(e))return{noMaskValue:"",type:"phone",skip:!0};if((/8/.test(e)&&!/\D/.test(e)||/^\+7\s{0}$/.test(e))&&e.length<3)return{noMaskValue:e.replace(/\+{0,1}\d/,"+7 ("),type:"phone",firstEight:/8/.test(e),firstSeven:/7/.test(e)};if(/\+\s{0,1}^9/.test(e))return{noMaskValue:e.replace(/\+/,"").replace(/(\d)/,"+7 ($1"),type:"phone",skip:!0};else if(/\+7\s\({0,1}\d{0}/.test(e)&&!t&&!r)return{noMaskValue:"",type:"phone"};else if(/\+7\d{2,10}/.test(e))return{noMaskValue:e.trim(),type:"phone",force:!0,firstSeven:!0,firstEight:!1};else return{noMaskValue:e.trim(),type:"email"}},L=e=>{let t=N.emailOrPhone,a=(0,x.xf)(t)?d.bh.EMAIL:d.bh.PHONE,i=(null==e?void 0:e.provider)==="telegram",n="string"==typeof(null==e?void 0:e.email)?e.email:"",l=a===d.bh.PHONE&&(null==e?void 0:e.provider)==="email"&&n,c=l?d.RZ.EMAIL_OTP_BY_PHONE:i?d.RZ.OTP_TELEGRAM_V2:d.RZ.PHONE_OTP_V2;s(e=>({...e,authMethod:a,...l&&{loginData:{...e.loginData||{},providerEmail:n},emailOtpByPhoneReferer:"by_phone"}}));let _=new Date;_.setTime(_.getTime()+18e4),(0,o.TV)("showSubscribeNotifyPopupDelay","true",{expires:_}),r(a===d.bh.EMAIL?d.RZ.EMAIL_OTP:c)},D=(e,t,a)=>{let i=a&&a.code&&d.pO.includes(a.code);if(a&&a.code&&d.jb.includes(a.code)){s(e=>{var t;return{...e,limitExpiredTime:null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.expired}}),r(d.RZ.LIMIT_ERROR);return}C(t=>{if(i){var n,o;let t=null==a?void 0:null===(n=a.data)||void 0===n?void 0:n.captcha,i=null==a?void 0:null===(o=a.data)||void 0===o?void 0:o.key,l=N.emailOrPhone,c=(0,x.xf)(l)?{email:l}:{phone:l,providers:["telegram","sms","email"]};s(r=>({...r,challenge:{type:"captcha",endpoint:e,payload:{...c},nextStep:(0,x.xf)(l)?d.RZ.EMAIL_OTP:void 0,fromStep:d.RZ.CORE,captcha:{src:t,key:i},referer_screen_type:"",referer_screen_attributes_id:""}})),r(d.RZ.CAPTCHA)}else t.hasEmailOrPhoneError=!0,t.emailOrPhoneErrorText=d.Sr[null==a?void 0:a.code]||d._R[null==a?void 0:a.code]||d._R[null==a?void 0:a.message]||d.Sr[null==a?void 0:a.message]||"ЧÑо-Ñо поÑло не Ñак..."}),E({screen_type:"login_registration",screen_attributes_id:"login_registration",action_id:"error",action_attributes_str:e,action_parameter:"authentication"})},M=async()=>{let{isFormValid:e}=j();if(e&&!N.hasCaptchaError){let e=N.emailOrPhone,t=(0,x.xf)(e)?d.bh.EMAIL:d.bh.PHONE;s(r=>({...r,loginData:{type:t,emailOrPhone:e}}));let r=(0,x.xf)(e)?T.PI.emailAuthOTP:T.PI.phoneAuthOTP;C(e=>{e.isWork=!0});let a="".concat(p).concat(r).concat(g),i=t===d.bh.EMAIL?{email:e}:{phone:e,providers:["telegram","sms","email"]};try{let e=await fetch(a,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),t=await e.json();e.status<400?L(t):D(a,e,t)}catch(e){D(a)}finally{C(e=>{e.isWork=!1})}}E({screen_type:"login_registration",screen_attributes_id:"login_registration",action_id:"click",
1screen_attributes_ab_tag:(null==_?void 0:_.tags)||"",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ"})};return(0,i.useEffect)(()=>{s(e=>({...e,clickHouse:{attributesId:"login_registration"}})),E({screen_type:"login_registration",screen_attributes_id:"login_registration",action_id:"screenview",screen_attributes_ab_tag:(null==_?void 0:_.tags)||""})},[]),(0,i.useEffect)(()=>{var e,t;if(null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.emailOrPhone){let{maskValue:e,fieldType:r,firstEight:a,firstSeven:i}=w(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone);I(r===d.bh.PHONE?d.Rx.phone:d.Rx.email),C(t=>{t.emailOrPhone=e,t.hasEmailOrPhoneError=!1,t.emailOrPhoneErrorText="",t.fieldType=r,t.firstEight=a,t.firstSeven=i})}},[null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од / РегиÑÑÑаÑиÑ",description:"ÐÐ°Ñ Ð¶Ð´ÑÑ 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑÐ¸Ð°Ð»Ñ Ð¸ мÑлÑÑÑилÑмÑ, 200+ Ñелеканалов, безопаÑнÑй деÑÑкий пÑоÑÐ¸Ð»Ñ Ð¸ ÑкÑклÑзивнÑе маÑеÑÐ¸Ð°Ð»Ñ Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,M),children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"ÐойÑи или заÑегиÑÑÑиÑоваÑÑÑÑ"}),P&&(0,a.jsx)("div",{className:h()(f().notice),children:"ÐÐ»Ñ Ð¿ÑоÑмоÑÑа беÑплаÑной ÑеÑии"}),(0,a.jsx)(U,{activeInput:R,onToggle:e=>{I(e),E({screen_type:"login_registration",screen_attributes_id:"login_registration",action_id:"click",element_type:"tab",element_attributes_id:e,element_attributes_text:e===d.Rx.email?"ÐоÑÑа":"ТелеÑон"})}}),(0,a.jsx)(A,{name:"login",type:O.TEXT,value:N.emailOrPhone,disabled:N.isWork,onChange:e=>{let{maskValue:t,fieldType:r,firstEight:a,firstSeven:i}=w(e);C(e=>{e.emailOrPhone=t,e.hasEmailOrPhoneError=!1,e.emailOrPhoneErrorText="",e.fieldType=r,e.firstEight=a,e.firstSeven=i})},onBlur:()=>{E({screen_type:"login_registration",screen_attributes_id:"login_registration",action_id:"text_input",action_parameter:N.emailOrPhone,element_type:"input",element_attributes_id:R===d.Rx.phone?d.Rx.phone:d.Rx.email,element_attributes_text:R===d.Rx.phone?"ÐведиÑе ÑелеÑон":"ÐведиÑе поÑÑÑ"})},onFocus:()=>{E({screen_type:"login_registration",screen_attributes_id:"login_registration",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:R===d.Rx.phone?d.Rx.phone:d.Rx.email,element_attributes_text:R===d.Rx.phone?"ÐведиÑе ÑелеÑон":"ÐведиÑе поÑÑÑ"})},label:R===d.Rx.phone?"ÐведиÑе ÑелеÑон":"ÐведиÑе поÑÑÑ",placeholder:R===d.Rx.phone?"+7 XXX XXX XX XX":"[email protected]",hasError:N.hasEmailOrPhoneError,errorText:N.emailOrPhoneErrorText,loginMethod:R}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:y,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:M,isLoading:N.isWork,isDisabled:N.isWork,className:h()(f().button,f().button_mb12,f().button_mt12)}),"tapp"===u?null:(0,a.jsxs)("div",{className:f().buttons,children:[(0,a.jsx)(V.Yandex,{dto:l,setDto:s,changeStep:r}),(0,a.jsx)("button",{className:f().buttons__showMore,onClick:()=>{r(d.RZ.SHOW_MORE),E({action_id:"click",element_type:"button",element_attributes_id:"auth_external",screen_type:"login_registration",screen_attributes_id:"login_registration"})},children:(0,a.jsx)("img",{className:f().buttons__showMore_icon,src:"/static/images/auth/showMore.svg",alt:"показаÑÑ ÐµÑÑ"})})]})]})]})},SignIn:e=>{var t,r;let{changeStep:s,setDto:_,isBackBtnClick:u,animationComplete:p,dto:g}=e,E=c.Ay.useApiUrl(),y=c.Ay.useClickHouseShoot(),x=c.Ay.useClickHouseUpdate(),{clientApiQuery:R,clientApiKey:I}=c.Ay.useApiClientKey(),O=c.Ay.useResponsiveButtonSize(),A=(0,n.d4)(e=>e.systemInformation.startDeviceId),N=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),C=(0,n.d4)(e=>{var t;return null===(t=e.registration)||void 0===t?void 0:t.authData}),P=(0,n.d4)(e=>e.systemInformation.config||{}),j=(null==P?void 0:null===(t=P.otp)||void 0===t?void 0:t.login_otp)==="on",w="telegram"===(null==P?void 0:null===(r=P.otp)||void 0===r?void 0:r.otp_provider),k=c.Ay.useResponsiveButtonSize({mobile:b.GO.SMALL,desktop:b.GO.MEDIUM}),[L,D]=(0,S.e)({emailOrPhone:"",emailOrPhoneType:void 0,password:"",hasPasswordError:!1,passwordErrorText:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1}),M=L.emailOrPhoneType===d.bh.EMAIL?L.emailOrPhone:(0,o.jW)(L.emailOrPhone),G=(0,i.useRef)(null);(0,i.useEffect)(()=>{p&&G.current&&setTimeout(()=>{G.current.focus()},200)},[p]);let W=()=>{let e=L.password,t=!1,r="";return e.length<d.AG&&(t=!0,r=d.Sr.MIN_PASSWORD_LENGTH),D(e=>{e.hasPasswordError=t,e.passwordErrorText=r}),y({action_id:"error",action_result:r,action_parameter:"login",screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),!t},V=()=>{},Z=async()=>
1{if(y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"button",element_attributes_id:"request_captcha",element_attributes_text:"/static/images/registration/refresh_1.svg",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),!L.hasCaptcha||!L.captchaImg)return;let e=new URL(L.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?D(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await F()},H=async e=>{C.upgrade_options&&C.upgrade_options.length&&(e.upgrade_options=C.upgrade_options),x({exp_ids:e.ab?(0,o.PX)(e,"exp_id"):"",group_ids:e.ab?(0,o.PX)(e,"group_id"):""}),s(d.RZ.SUCCESS),_(t=>({...t,authType:d.tG.LOGIN,loginData:M,userProfileData:e})),y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",account_id:e._id,action_result:L.emailOrPhoneType===d.bh.EMAIL?d.bh.EMAIL:d.bh.PHONE,profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:"login",virtual_profile_id:null==N?void 0:N._id,event_time:new Date().getTime(),referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},U=(e,t)=>{let r=L.emailOrPhone,a=t&&t.code&&d.pO.includes(t.code);D(e=>{let i=e.emailOrPhoneType===d.bh.EMAIL?"ÐевеÑнÑй паÑÐ¾Ð»Ñ Ð¸Ð»Ð¸ поÑÑа":"ÐевеÑнÑй паÑÐ¾Ð»Ñ Ð¸Ð»Ð¸ Ð½Ð¾Ð¼ÐµÑ ÑелеÑона";if(a||(e.hasPasswordError=!0,e.passwordErrorText=r?i:a?d.Sr[null==t?void 0:t.code]||d.Sr[null==t?void 0:t.message]||(null==t?void 0:t.message):i),a){let r=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=r?"".concat(E).concat(r,"&apikey=").concat(I,"&v=").concat(Math.random()):"",e.captchaKey=a,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==t?void 0:t.code]||d.Sr[null==t?void 0:t.message]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло не Ñак..."}}),y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:a?"error_captcha":"error",action_result:d.Sr[null==t?void 0:t.code]||d.Sr[null==t?void 0:t.message]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:e,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},F=async()=>{let e=W()&&!L.hasCaptchaError;if(e&&y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐведиÑе паÑолÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"button",element_attributes_id:"sign_in",element_attributes_text:"ÐойÑи",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),e){let e=L.emailOrPhone,t=L.password,r=L.emailOrPhoneType,a=r===d.bh.EMAIL?T.PI.emailLogin:T.PI.phoneLogin,i="".concat(E).concat(a).concat(R),n={password:window.btoa(unescape(encodeURIComponent(t))),device_id:A,device_type:"web",client_platform:"start",...r===d.bh.EMAIL&&{email:e,is_encoded:!0},...r===d.bh.PHONE&&{phone:e},...L.hasCaptcha&&{key:L.captchaKey,captcha:L.captcha}};D(e=>{e.isWork=!0});try{let e=await fetch(i,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),t=await e.json();if(e.ok){let e=(0,m.Ri)("noPaymentReturn");e?l().push(e):H(t)}else U(i,t)}catch(e){U(i)}finally{D(e=>{e.isWork=!1})}}},K=async()=>{s(d.RZ.REQUEST_OTP_CODE),y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"button",element_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"email_code_for_login":"sms_code_for_login",element_attributes_text:L.emailOrPhoneType===d.bh.EMAIL?"ÐойÑи по кодÑ":"ÐойÑи ÑеÑез СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},z=async()=>{_(e=>({...e,authType:d.tG.LOGIN})),s(d.RZ.REQUEST_TG_OTP_CODE),y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"button",element_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"email_code_for_login":"sms_code_for_login",element_attributes_text:L.emailOrPhoneType===d.bh.EMAIL?"ÐойÑи по кодÑ":"ÐойÑи ÑеÑез СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})};return(0,i.useEffect)(()=>{var e,t;let r=null==g?void 0:null===(e=g.loginData)||void 0===e?void 0:e.emailOrPhone,a=null==g?void 0:null===(t=g.loginData)||void 0===t?void 0:t.type;r&&a&&D(e=>{e.emailOrPhone=r||"",e.emailOrPhoneType=a||void 0;let t=e.emailOrPhoneType;_(e=>({...e,clickHouse:{refererScreenType:"login",refererScreenAttributesId:t===d.bh.EMAIL?"by_email":"by_phone"}})),y({screen_type:"login",screen_attributes_id:e.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START РегиÑÑÑаÑиÑ",description:"ÐолÑÑиÑе 7 дней беÑплаÑно. Ð
1Ð°Ñ Ð¶Ð´ÑÑ 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑÐ¸Ð°Ð»Ñ Ð¸ мÑлÑÑÑилÑмÑ, 200+ Ñелеканалов и ÑкÑклÑзивнÑе маÑеÑÐ¸Ð°Ð»Ñ Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,F),children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐÑ
од в аккаÑÐ½Ñ ÑеÑез ",L.emailOrPhoneType===d.bh.EMAIL?"поÑÑÑ":"ÑелеÑон"]}),(0,a.jsx)("div",{className:f().login,children:(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:M}})}),(0,a.jsx)("div",{className:f().localInput,onBlur:u?()=>{}:()=>{setTimeout(()=>{V()},200)},children:(0,a.jsx)(B.A,{inputRef:G,preventOnBlur:!0,value:L.password,label:"ÐведиÑе паÑолÑ",onChange:e=>{let t=e.target.value;t.length<d.qo&&D(e=>{e.password!==t&&(e.password=t,e.hasPasswordError=!1)})},onFocus:()=>{y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐведиÑе паÑолÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},onValidate:()=>{},id:"password",maxLength:"50",type:"password",error:L.hasPasswordError,errorText:L.passwordErrorText,canHidePassword:!0,darkTheme:!0,alwaysPlaceholder:!0,onClickHouseShoot:y,emailOrPhoneType:L.emailOrPhoneType,screenType:d.sv.LOGIN,placeholder:"ÐаÑÐ¾Ð»Ñ Ð¾Ñ Ð°ÐºÐºÐ°ÑнÑа START",noShoot:!0})}),L.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:L.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:Z})]}),(0,a.jsx)(B.A,{value:L.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;D(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:L.hasCaptchaError,errorText:L.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}):null,(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:O,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:F,isLoading:L.isWork,isDisabled:L.isWork,className:f().button}),j&&((null==g?void 0:g.authMethod)==="email"||!w)&&(0,a.jsx)(b.$n,{"data-testid":"otp_code_signin_button",testid:"signin_button",variant:b.Vt.SECONDARY,size:O,title:L.emailOrPhoneType===d.bh.EMAIL?"ÐойÑи по кодÑ":"ÐойÑи ÑеÑез СÐС",fullWidth:!0,onClick:K,isLoading:L.isWork,isDisabled:L.isWork,className:f().button}),w&&(null==g?void 0:g.authMethod)!=="email"&&(0,a.jsx)(b.$n,{"data-testid":"otp_code_signin_button",testid:"signin_button",variant:b.Vt.SECONDARY,size:O,title:"ÐолÑÑиÑÑ ÐºÐ¾Ð´ Ð´Ð»Ñ Ð²Ñ
ода",fullWidth:!0,onClick:z,isLoading:L.isWork,isDisabled:L.isWork,className:f().button}),(0,a.jsx)(b.$n,{className:h()(f().description),title:"ÐабÑли паÑолÑ?",onClick:()=>{s(d.RZ.PASSWORD_RECOVERY),_(e=>({...e,authType:d.tG.RECOVERY})),y({screen_type:"login",screen_attributes_id:L.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"link",element_attributes_id:"forgot_password",element_attributes_text:"ÐабÑли паÑолÑ?",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},size:k,variant:b.Vt.SECONDARY})]})]})},SignUp:e=>{var t;let{changeStep:r,setDto:s,isBackBtnClick:_,animationComplete:u,dto:p}=e,g=c.Ay.useApiUrl(),{clientApiQuery:E,clientApiKey:y}=c.Ay.useApiClientKey(),x=c.Ay.useClickHouseShoot(),R=c.Ay.useResponsiveButtonSize(),I=(0,n.d4)(e=>e.systemInformation.startDeviceId),[O,A]=(0,i.useState)(null),[N,C]=(0,i.useState)(null),[P,j]=(0,S.e)({emailOrPhone:"",emailOrPhoneType:void 0,password:"",hasPasswordError:!1,passwordErrorText:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",agreement:!1,agreementTextError:"",hasAgreementError:!1,info:!1,isWork:!1}),w=(0,i.useRef)(null),[k,L]=(0,i.useState)(!1),D=(0,n.d4)(e=>e.systemInformation.config||{}),M="telegram"===(null==D?void 0:null===(t=D.otp)||void 0===t?void 0:t.otp_provider);(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=N-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),A("00:00"),L(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");A("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[N]),(0,i.useEffect)(()=>{u&&w.current&&setTimeout(()=>{w.current.focus()},200)},[u]);let G=()=>{let e=P.password,t=!1,r="";return e.length<d.AG&&(t=!0,r=d.Sr.MIN_PASSWORD_LENGTH),j(e=>{e.hasPasswordError=t,e.passwordErrorText=r}),!t},W=()=>{let e=!0;return G()||(e=!1),e},V=()=>{let e=G();x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐÑидÑмайÑе паÑолÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},Z=async()=>
1{if(x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"button",element_attributes_id:"request_captcha",element_attributes_text:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),!P.hasCaptcha||!P.captchaImg)return;let e=new URL(P.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?j(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await $()},H=async()=>{let e=P.emailOrPhone,t=P.password,a="".concat(g).concat(T.PI.emailRegistrationV3).concat(E),i={email:e,password:window.btoa(unescape(encodeURIComponent(t))),device_id:I,device_type:"web",client_platform:"start",is_encoded:!0,...P.hasCaptcha&&{key:P.captchaKey,captcha:P.captcha}};j(e=>{e.isWork=!0});try{let e=await fetch(a,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),n=await e.json();e.status<400?(r(d.RZ.SIGNUP_CONFIRM_EMAIL),(0,o.EF)(),s(e=>({...e,authType:d.tG.REGISTER,loginData:{type:d.bh.EMAIL,emailOrPhone:Q,password:window.btoa(unescape(encodeURIComponent(t)))},userProfileData:n}))):(U(n),x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:n&&d.pO.includes(n.code)?"error_captcha":"error",action_result:d.Sr[n.code]||d.Sr[n.message]||n.message||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:a,...n&&!d.pO.includes(n.code)&&{action_parameter:"registration"},referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}))}catch(e){U(e)}finally{j(e=>{e.isWork=!1})}},U=e=>{let t=e&&e.code&&d.pO.includes(e.code);if(e&&e.code&&d.jb.includes(e.code)){var r;C(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.expired),L(!0);return}j(r=>{if(t){let t=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;r.hasCaptcha=!0,r.captcha="",r.captchaImg=t?"".concat(g).concat(t,"&apikey=").concat(y,"&v=").concat(Math.random()):"",r.captchaKey=a,r.hasCaptchaError=!0,r.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}else r.hasPasswordError=!0,r.passwordErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."})},F=async()=>{let e="".concat(g).concat(T.PI.phoneRegistration).concat(E),t={phone:P.emailOrPhone};j(e=>{e.isWork=!0});try{let a=await fetch(e,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await a.json();a.status<400?(r(d.RZ.PHONE_CODE),s(e=>({...e,authType:d.tG.REGISTER,loginData:{phone:P.emailOrPhone,loginValue:Q,password:window.btoa(unescape(encodeURIComponent(P.password)))},userProfileData:i}))):(x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:i&&d.pO.includes(i.code)?"error_captcha":"error",action_result:d.Sr[i.code]||d.Sr[i.message]||i.message||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:e,...i&&!d.pO.includes(i.code)&&{action_parameter:"registration"},referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),K(i))}catch(e){K()}finally{j(e=>{e.isWork=!1})}},K=e=>{j(t=>{t.hasPasswordError=!0,t.passwordErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."})},z=async()=>{let e="".concat(g).concat(T.PI.phoneRegistrationV2).concat(E),t={phone:P.emailOrPhone,providers:["telegram","sms"],...P.hasCaptcha&&{key:P.captchaKey,captcha:P.captcha}};j(e=>{e.isWork=!0});try{let a=await fetch(e,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),i=await a.json();a.status<400?((null==i?void 0:i.provider)==="telegram"?r(d.RZ.OTP_TELEGRAM_SIGNUP):r(d.RZ.PHONE_CODE),s(e=>({...e,authType:d.tG.REGISTER,loginData:{emailOrPhone:P.emailOrPhone,loginValue:Q,password:window.btoa(unescape(encodeURIComponent(P.password)))},userProfileData:i}))):(x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:i&&d.pO.includes(i.code)?"error_captcha":"error",action_result:d.Sr[i.code]||d.Sr[i.message]||i.message||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак...",action_attributes_str:e,...i&&!d.pO.includes(i.code)&&{action_parameter:"registration"},referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),q(i))}catch(e){q(e)}finally{j(e=>{e.isWork=!1})}},q=e=>{let t=e&&e.code&&d.pO.includes(e.code),a=e&&e.code&&d.jb.includes(e.code),i=M&&((null==e?void 0:e.code)==="TELEGRAM_EXCEPTION"||(null==e?void 0:e.code)==="SERVICE_EXCEPTION");if(a){var n;C(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.expired),L(!0);return}i&&r(d.RZ.OTP_TELEGRAM_ERROR),j(r=>{if(t){let t=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;r.hasCaptcha=!0,r.captcha="",r.captchaImg=t?"".concat(g).concat(t,"&apikey=").concat(y,"&v=").concat(Math.random()):"",r.captchaKey=a,r.hasCaptchaError=!0,r.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}else r.hasPasswordError=!0,r.passwordErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."})},$=async()=>{if(x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"button",element_attributes_id:"register",element_attributes_text:"ÐаÑегиÑÑÑиÑоваÑÑÑÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),W())switch(j(e=>{e.isWork=!0}),P.emailOrPhoneType){case d.bh.EMAIL:await H();break;case d.bh.PHONE:M?await z():await F()}};(0,i.useEffect)(()=>{var e,t;let r=null==p?void 0:null===(e=p.loginData)||void 0===e?void 0:e.emailOrPhone,a=null==p?void 0:null===(t=p.loginData)||void 0===t?void 0:t.type;r&&a?j(e=>{e.emailOrPhone=r||"",e.emailOrPhoneType=a||void 0;let t=e.emailOrPhoneType;s(e=>({...e,clickHouse:{refererScreenType:"registration",refererScreenAttributesId:t===d.bh.EMAIL?"by_email":"by_phone"}})),x({screen_type:"registration",screen_attributes_id:e.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})}):l().push("/auth")},[]);let Q=P.emailOrPhoneType===d.bh.EMAIL?P.emailOrPhone:(0,o.jW)(P.emailOrPhone);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,$),children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["РегиÑÑÑаÑÐ¸Ñ ÑеÑез ",P.emailOrPhoneType===d.bh.EMAIL?"поÑÑÑ":"ÑелеÑон"]}),(0,a.jsx)("div",{className:f().login,children:(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:Q}})}),(0,a.jsx)("div",{className:f().localInputPlain,onBlur:_?()=>{}:()=>{setTimeout(()=>{V()},200)},children:(0,a.jsx)(B.A,{inputRef:w,value:P.password,label:"ÐÑидÑмайÑе паÑолÑ",onChange:e=>{let t=e.target.value;t.length<d.qo&&j(e=>{e.password=t||"",e.hasPasswordError=!1,e.passwordErrorText=""})},preventOnBlur:!0,onFocus:()=>{x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐÑидÑмайÑе паÑолÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},onValidate:()=>{},id:"password",maxLength:"50",type:"password",error:P.hasPasswordError,errorText:P.passwordErrorText,canHidePassword:!0,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ÐинимÑм 6 Ñимволов",onClickHouseShoot:x,emailOrPhoneType:P.emailOrPhoneType,screenType:d.sv.REGISTRATION,noShoot:!0})}),P.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:P.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:Z})]}),(0,a.jsx)(B.A,{value:P.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onCh
1ange:e=>{let t=e.target.value;j(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:P.hasCaptchaError,errorText:P.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}):null,(0,a.jsx)("div",{className:f().field,children:(0,a.jsx)(J.S,{checked:P.info,onChange:()=>{j(e=>{e.info=!e.info}),s(e=>({...e,isWantSpam:!P.info})),x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"checkbox",element_attributes_id:"notifications",element_attributes_text:"Я ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а Ñакже на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
Ð´Ð»Ñ ÐµÑ Ð¾ÑпÑавки",action_result:!P.info,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},name:"notifications",id:"notifications",label:(0,a.jsxs)("span",{children:["Я\xa0ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а\xa0Ñакже\xa0на\xa0",(0,a.jsx)(X(),{className:f().consent_link,prefetch:!1,href:"/legal/consent",target:"_blank",rel:"noopener noreferrer",onClick:e=>{var t;x({screen_type:"registration",screen_attributes_id:P.emailOrPhoneType===d.bh.EMAIL?"by_email":"by_phone",action_id:"click",element_type:"link",element_attributes_id:"personal_data_with_notification",element_attributes_text:null==e?void 0:null===(t=e.currentTarget)||void 0===t?void 0:t.innerText,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},children:"обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
"}),"\xa0длÑ\xa0еÑ\xa0оÑпÑавки"]}),dontShoot:!0})}),(0,a.jsx)(b.$n,{"data-testid":"payment_button_text",variant:b.Vt.PRIMARY,size:R,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:$,isLoading:P.isWork,isDisabled:P.isWork,className:f().button}),(0,a.jsx)("div",{className:h()(f().description_signUp),dangerouslySetInnerHTML:{__html:'<div>\n ÐÑодолжаÑ, Ð²Ñ Ð¿ÑинимаеÑе ÑÑÐ»Ð¾Ð²Ð¸Ñ \n <a href="/legal/privacy_policy" target="_blank">ÐолиÑики конÑиденÑиалÑноÑÑи</a> и\n <a href="/legal/terms_of_use" target="_blank">ÐолÑзоваÑелÑÑкого ÑоглаÑениÑ</a>\n </div>'}}),k&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:O})]})})]})]})},SignUpConfirmEmail:e=>{var t,r;let{changeStep:s,setDto:l,dto:_}=e,[u,p]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:""}),g=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),v=(0,n.d4)(e=>e.systemInformation.startDeviceId),E=c.Ay.useApiUrl(),{clientApiKey:y}=c.Ay.useApiClientKey(),R=c.Ay.useClickHouseShoot(),I=c.Ay.useResponsiveButtonSize(),[O,A]=(0,i.useState)(d.xS),[N,C]=(0,i.useState)(!0),[P,j]=(0,i.useState)(!1),[w,k]=(0,i.useState)(!1),[L,D]=(0,i.useState)(null),[M,G]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=M-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),D("00:00"),k(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");D("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[M]),(0,i.useEffect)(()=>{let e=null;return N&&O>0?e=setInterval(()=>{A(e=>e-1)},1e3):0===O&&(C(!1),j(!0)),()=>clearInterval(e)},[N,O]),(0,i.useEffect)(()=>(C(!0),j(!1),()=>{(0,m.zs)(d.v8.MEGAFON_MLK)}),[]),(0,i.useEffect)(()=>
1{l(e=>({...e,clickHouse:{type:"registration",attributesId:"code_email",refererScreenType:"registration",refererScreenAttributesId:"by_email"}})),R({screen_type:"registration",screen_attributes_id:"code_email",action_id:"screenview",referer_screen_type:"registration",referer_screen_attributes_id:"by_email"})},[]),(0,i.useEffect)(()=>{let e=document.getElementById("pin-0");e&&e.focus()},[]);let W=e=>{let t="",r=!1;if(e.length)e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ");else{var a;r=!0,t=(null==_?void 0:null===(a=_.loginData)||void 0===a?void 0:a.type)===d.bh.EMAIL?"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из пиÑÑма":"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС"}return p(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},V=async e=>{R({screen_type:"registration",screen_attributes_id:"code_email",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"registration",referer_screen_attributes_id:"by_email"});let t=W(e);if(Z(t),t){var r,a,i;p(e=>{e.isWork=!0});let t=null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.emailOrPhone,n="".concat(E).concat(T.PI.emailRegistrationV3Confirm).concat(x.Lq),c={email:t,password:null==_?void 0:null===(a=_.loginData)||void 0===a?void 0:a.password,code:e,...(null==_?void 0:_.isWantSpam)&&{notifications_types:["email"]},device_id:v,device_type:"web",client_platform:"start"},u=await fetch(n,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(u.status<400){let e=await u.json();s(d.RZ.SUCCESS),l(t=>({...t,authType:d.tG.REGISTER,userProfileData:e,clickHouse:{refererScreenType:"registration",refererScreenAttributesId:"code_email"}})),(0,o.EF)(),R({account_id:e._id,profile_id:e.profile_id,screen_type:"registration",screen_attributes_id:"success",screen_attributes_ab_tag:e.tags||"",action_id:"registration",action_result:"email",virtual_profile_id:null==g?void 0:g._id,event_time:new Date().getTime(),referer_screen_type:"registration",referer_screen_attributes_id:"by_email"})}else{let e=await u.json();if(p(e=>{e.isWork=!1}),e&&e.code&&d.jb.includes(e.code)){G(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.expired),k(!0);return}p(t=>{t.isWork=!1,t.hasCodeError=!0,t.codeErrorText=d._R[null==e?void 0:e.code]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}),R({screen_type:"registration",screen_attributes_id:"code_email",action_id:"error",action_result:d._R[null==e?void 0:e.code]||(null==e?void 0:e.code)||(null==e?void 0:e.message),action_attributes_str:n,action_parameter:"registration",referer_screen_type:"registration",referer_screen_attributes_id:"by_email"})}}},Z=e=>{R({screen_type:"registration",screen_attributes_id:"code_email",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из пиÑÑма",referer_screen_type:"registration",referer_screen_attributes_id:"by_email"})},H=async()=>{var e,t,r;j(!1),C(!0),A(d.xS),R({screen_type:"registration",screen_attributes_id:"code_email",action_id:"click",element_type:"button",element_attributes_id:"new_code",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"registration",referer_screen_attributes_id:"by_email"});let a="".concat(E).concat(T.PI.emailRegistrationV3).concat(x.Lq),i={email:null==_?void 0:null===(e=_.loginData)||void 0===e?void 0:e.emailOrPhone,password:null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.password,...u.hasCaptcha&&{key:u.captchaKey,captcha:u.captcha}};try{let e=await fetch(a,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.status>=400){let t=await e.json(),a=t&&t.code&&d.pO.includes(t.code);if(t&&t.code&&d.jb.includes(t.code)){G(null==t?void 0:null===(r=t.data)||void 0===r?void 0:r.expired),k(!0);return}p(e=>{if(a){let r=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=r?"".concat(E).concat(r,"&apikey=").concat(y,"&v=").concat(Math.random()):"",e.captchaKey=a,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==t?void 0:t.code]||d.Sr[null==t?void 0:t.message]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."}else e.hasCodeError=!0,e.codeErrorText=d._R[null==t?void 0:t.code]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло не Ñак..."}),j(!0),C(!1)}}catch(e){console.error("Error requesting new code:",e),j(!0),C(!1),p(e=>{e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}},U=async()=>{if(!u.hasCaptcha||!u.captchaImg)return;let e=new URL(u.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?p(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await V()};return(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&V()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из пиÑÑма,",(0,a.jsx)("br",{}),"оÑпÑавили на поÑÑÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.emailOrPhone}})]}),(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL&&(0,a.jsx)("div",{className:h()(f().description,f().description_otp),children:"ÐÑли пиÑÑма неÑ, пÑовеÑÑÑе Спам"}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{V(e)},errorText:u.hasCodeError?u.codeErrorText:"",value:u.code,onChange:e=>{p(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:u.isWork,onFocus:()=>{R({screen_type:"registration",screen_attributes_id:"code_email",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из пиÑÑма",referer_screen_type:"registration",referer_screen_attributes_id:"by_email"})}})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:I,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>V(u.code),isLoading:u.isWork,isDisabled:u.isWork,className:f().button}),u.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:u.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:U})]}),(0,a.jsx)(B.A,{value:u.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;p(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:u.hasCaptchaError,errorText:u.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"}),(0,a.jsxs)("div",{className:Y().infoMessage,children:[(0,a.jsx)("img",{className:Y().infoMessage_icon,src:"/static/images/auth/info.svg",alt:"info"}),(0,a.jsx)("span",{className:Y().infoMessage_text,children:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð½Ð¾Ð²Ñй код"})]})]}):null,w&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["СлиÑком много попÑÑок ввода.",(0,a.jsx)("br",{}),"ÐопÑобÑйÑе Ñнова ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().countdown_limit),children:L})]})}),!w&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!P&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().small),children:(0,m.fU)(O)})]})]}),onClick:H,size:b.GO.SMALL,variant:b.Vt.SECONDARY,isDisabled:!P})})]})},PhoneCode:e=>{var t,r;let{changeStep:s,setDto:l,dto:_}=e,[u,p]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:""}),g=c.Ay.useApiUrl(),v=c.Ay.useApiKey(),{clientApiKey:E}=c.Ay.useApiClientKey(),y=c.Ay.useClickHouseShoot(),x=c.Ay.useResponsiveButtonSize(),R=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[I,O]=(0,i.useState)(d.xS),[A,N]=(0,i.useState)(!0),[C,P]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),[k,L]=(0,i.useState)(null),[D,M]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=D-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),L("00:00"),w(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");L("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[D]),(0,i.useEffect)(()=>{let e=null;return A&&I>0?e=setInterval(()=>{O(e=>e-1)},1e3):0===I&&(N(!1),P(!0)),()=>clearInterval(e)},[A,I]),(0,i.useEffect)(()=>(N(!0),P(!1),()=>{(0,m.zs)(d.v8.MEGAFON_MLK)}),[]),(0,i.useEffect)(()=>{var e;l(e=>({...e,clickHouse:{refererScreenType:"registration",refererScreenAttributesId:"code_sms"}})),y({screen_type:"registration",screen_attributes_id:"code_sms",action_id:"screenview",referer_screen_type:"registration",referer_screen_attributes_id:_&&(null===(e=_.loginData)||void 0===e?void 0:e.type)})},[]);let G=e=>{let t="",r=!1;return e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС"),p(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},W=async e=>{var t,r,a,i,n,c;y({screen_type:"registration",screen_attributes_id:"code_sms",action_id:"click",element_type:"button",element_attributes_id:"register",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"registration",referer_screen_attributes_id:_&&(null===(t=_.loginData)||void 0===t?void 0:t.type)});let u=G(e);
1if(V(u),u){p(e=>{e.isWork=!0});let t="".concat(g).concat(T.PI.phoneRegistrationConfirm).concat(v),u={phone:(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.phone)||(null==_?void 0:null===(a=_.loginData)||void 0===a?void 0:a.emailOrPhone),code:e,password:null==_?void 0:null===(i=_.loginData)||void 0===i?void 0:i.password,...(null==_?void 0:_.isWantSpam)&&{notifications_types:["sms"]}},h=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)});if(h.status<400){let e=await h.json();s(d.RZ.SUCCESS),l(t=>({...t,authType:d.tG.REGISTER,userProfileData:e})),(0,o.EF)(),y({screen_type:"registration",screen_attributes_id:"success",account_id:e._id,profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:"registration",action_result:"by_phone",virtual_profile_id:null==R?void 0:R._id,event_time:new Date().getTime()})}else{let e=await h.json();if(e&&e.code&&d.jb.includes(e.code)){M(null==e?void 0:null===(c=e.data)||void 0===c?void 0:c.expired),w(!0);return}let r=e&&e.code&&d.pO.includes(e.code);p(t=>{if(t.isWork=!1,r||(t.isWork=!1,t.hasCodeError=!0,t.codeErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."),r){let r=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;t.hasCaptcha=!0,t.captcha="",t.captchaImg=r?"".concat(g).concat(r,"&apikey=").concat(E,"&v=").concat(Math.random()):"",t.captchaKey=a,t.hasCaptchaError=!0,t.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}}),y({screen_type:"registration",screen_attributes_id:"code_sms",action_id:"error",action_result:d._R[null==e?void 0:e.code]||(null==e?void 0:e.code)||(null==e?void 0:e.message),action_attributes_str:t,action_parameter:"registration",referer_screen_type:"registration",referer_screen_attributes_id:_&&(null===(n=_.loginData)||void 0===n?void 0:n.type)})}}},V=e=>{var t;y({screen_type:"registration",screen_attributes_id:"code_sms",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"registration",referer_screen_attributes_id:_&&(null===(t=_.loginData)||void 0===t?void 0:t.type)})},Z=async()=>{var e,t,r,a,i,n;P(!1),N(!0),O(d.xS),y({screen_type:"registration",screen_attributes_id:"code_sms",action_id:"click",element_type:"button",element_attributes_id:"resend_sms",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"registration",referer_screen_attributes_id:_&&(null===(e=_.loginData)||void 0===e?void 0:e.type)});let o="".concat(g).concat(T.PI.phoneRegistration).concat(v),s={phone:(null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.phone)||(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.emailOrPhone),password:null==_?void 0:null===(a=_.loginData)||void 0===a?void 0:a.password,...u.hasCaptcha&&{key:u.captchaKey,captcha:u.captcha}};try{let e=await fetch(o,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(e.status>=400){let t=await e.json();if(t&&t.code&&d.jb.includes(t.code)){M(null==t?void 0:null===(i=t.data)||void 0===i?void 0:i.expired),w(!0);return}p(e=>{e.hasCodeError=!0,e.codeErrorText=d._R[null==t?void 0:t.code]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло не Ñак..."}),P(!0),N(!1)}}catch(t){console.error("Error requesting new code:",t);let e=t&&t.code&&d.pO.includes(t.code);if(t&&t.code&&d.jb.includes(t.code)){M(null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.expired),w(!0);return}P(!0),N(!1),p(r=>{if(e){let e=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;r.hasCaptcha=!0,r.captcha="",r.captchaImg=e?"".concat(g).concat(e,"&apikey=").concat(E,"&v=").concat(Math.random()):"",r.captchaKey=a,r.hasCaptchaError=!0,r.captchaErrorText=d.Sr[null==t?void 0:t.code]||d.Sr[null==t?void 0:t.message]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак...",r.hasCodeError=!0,r.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"}else r.hasPasswordError=!0,r.passwordErrorText=d.Sr[null==t?void 0:t.code]||d.Sr[null==t?void 0:t.message]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло не Ñак...",r.hasCodeError=!0,r.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}},H=async()=>{if(!u.hasCaptcha||!u.captchaImg)return;let e=new URL(u.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?p(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await W()};return(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&W()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из СÐС,",(0,a.jsx)("br",{}),"оÑпÑавили на номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)((null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.phone)||(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.emailOrPhone))}})]}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{W(e)},errorText:u.hasCodeError?u.codeErrorText:"",value:u.code,onChange:e=>{p(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:u.isWork,onFocus:()=>{var e;y({screen_type:"registration",screen_attributes_id:"code_sms",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"registration",referer_screen_attributes_id:_&&(null===(e=_.loginData)||void 0===e?void 0:e.type)})}})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:x,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>W(u.code),isLoading:u.isWork,isDisabled:u.isWork,className:f().button}),u.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:u.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:H})]}),(0,a.jsx)(B.A,{value:u.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;p(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:u.hasCaptchaError,errorText:u.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"}),(0,a.jsxs)("div",{className:Y().infoMessage,children:[(0,a.jsx)("img",{className:Y().infoMessage_icon,src:"/static/images/auth/info.svg",alt:"info"}),(0,a.jsx)("span",{className:Y().infoMessage_text,children:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð½Ð¾Ð²Ñй код"})]})]}):null,j&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["СлиÑком много попÑÑок ввода.",(0,a.jsx)("br",{}),"ÐопÑобÑйÑе Ñнова ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().countdown_limit),children:k})]})}),!j&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!C&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().small),children:(0,m.fU)(I)})]})]}),onClick:Z,size:b.GO.SMALL,variant:b.Vt.SECONDARY,isDisabled:!C})})]})},PhoneOTPV2:e=>{var t,r;let{changeStep:s,setDto:l,dto:_}=e,[u,p]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",info:!1}),g=c.Ay.useApiUrl(),v=c.Ay.useApiKey(),E=c.Ay.useClickHouseShoot(),y=c.Ay.useResponsiveButtonSize(),x=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[R,I]=(0,i.useState)(d.xS),[O,A]=(0,i.useState)(!0),[N,C]=(0,i.useState)(!1),[P,j]=(0,i.useState)(!1),[w,k]=(0,i.useState)(!1),[L,D]=(0,i.useState)(null),[M,G]=(0,i.useState)("00:00"),[W,V]=(0,i.useState)(null),[Z,H]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=W-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),D("00:00"),j(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");D("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[W]),(0,i.useEffect)(()=>
1{if(!w||!Z)return;let e=setInterval(()=>{let t=Z-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),G("00:00"),k(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");G("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[w,Z]),(0,i.useEffect)(()=>{let e=null;return O&&R>0?e=setInterval(()=>{I(e=>e-1)},1e3):0===R&&(A(!1),C(!0)),()=>clearInterval(e)},[O,R]),(0,i.useEffect)(()=>{A(!0),C(!1)},[]),(0,i.useEffect)(()=>{var e;l(e=>({...e,clickHouse:{refererScreenType:"login_registration",refererScreenAttributesId:"code_sms"}})),E({screen_type:"login_registration",screen_attributes_id:"code_sms",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:_&&(null===(e=_.loginData)||void 0===e?void 0:e.type)})},[]);let U=e=>{let t="",r=!1;return(null==e?void 0:e.length)?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС"),p(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},F=async e=>{var t,r,a,i,n,c,u;E({screen_type:"login_registration",screen_attributes_id:"code_sms",action_id:"click",element_type:"button",element_attributes_id:"register",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:_&&(null===(t=_.loginData)||void 0===t?void 0:t.type)});let h=U(e);if(B(h),h){p(e=>{e.isWork=!0});let t="".concat(g).concat(T.PI.phoneAuthOTPConfirm).concat(v),h={phone:(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.phone)||(null==_?void 0:null===(a=_.loginData)||void 0===a?void 0:a.emailOrPhone),code:e,...(null==_?void 0:_.isWantSpam)&&{notifications_types:["sms"]}},m=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(m.status<400){let e=await m.json();s(d.RZ.SUCCESS),l(t=>({...t,authType:200===m.status?d.tG.LOGIN:d.tG.REGISTER,userProfileData:e})),(0,o.EF)(),E({screen_type:200===m.status?d.sv.LOGIN:d.sv.REGISTRATION,screen_attributes_id:"success",account_id:e._id,profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:200===m.status?d.sv.LOGIN:d.sv.REGISTRATION,action_result:"by_phone",virtual_profile_id:null==x?void 0:x._id,event_time:new Date().getTime()})}else{let r=await m.json();if(r&&r.code&&d.jb.includes(r.code)){p(e=>{e.isWork=!1}),V(null==r?void 0:null===(n=r.data)||void 0===n?void 0:n.expired),j(!0);return}let a=r&&r.code&&d.pO.includes(r.code);if(a){let a=null==r?void 0:null===(c=r.data)||void 0===c?void 0:c.captcha,i=null==r?void 0:null===(u=r.data)||void 0===u?void 0:u.key;p(e=>{e.isWork=!1}),l(r=>{var n,o;return{...r,challenge:{type:"captcha",endpoint:t,payload:{phone:(null==_?void 0:null===(n=_.loginData)||void 0===n?void 0:n.phone)||(null==_?void 0:null===(o=_.loginData)||void 0===o?void 0:o.emailOrPhone),code:e,...(null==_?void 0:_.isWantSpam)&&{notifications_types:["sms"]}},nextStep:d.RZ.SUCCESS,fromStep:d.RZ.PHONE_OTP_V2,successAnalytics:{actionResult:"by_phone"},captcha:{src:a,key:i}}}}),s(d.RZ.CAPTCHA)}p(e=>{e.isWork=!1,a||(e.isWork=!1,e.hasCodeError=!0,e.codeErrorText=d.Sr[null==r?void 0:r.code]||d._R[null==r?void 0:r.code]||d._R[null==r?void 0:r.message]||d.Sr[null==r?void 0:r.message]||"ЧÑо-Ñо поÑло не Ñак...")}),E({screen_type:"login_registration",screen_attributes_id:"code_sms",action_id:"error",action_result:d._R[null==r?void 0:r.code]||(null==r?void 0:r.code)||(null==r?void 0:r.message),action_attributes_str:t,action_parameter:"login_registration",referer_screen_type:"login_registration",referer_screen_attributes_id:_&&(null===(i=_.loginData)||void 0===i?void 0:i.type)})}}},B=e=>{var t;E({screen_type:"login_registration",screen_attributes_id:"code_sms",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:_&&(null===(t=_.loginData)||void 0===t?void 0:t.type)})},K=async()=>{var e,t,r,a,i,n,o,c,u,h,m;C(!1),A(!0),I(d.xS),E({screen_type:"login_registration",screen_attributes_id:"code_sms",action_id:"click",element_type:"button",element_attributes_id:"resend_sms",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login_registration",referer_screen_attributes_id:_&&(null===(e=_.loginData)||void 0===e?void 0:e.type)});let f="".concat(g).concat(T.PI.phoneAuthOTP).concat(v),y={phone:(null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.phone)||(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.emailOrPhone),providers:["sms"]};try{let e=await fetch(f,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(y)});if(e.status>=400){let t=await e.json(),r=t&&t.code&&d.jb.includes(t.code),c=t&&t.code&&d.pO.includes(t.code);
1if(r&&(null==t?void 0:t.code)==="SMS_LIMIT_EXCEEDED"){H(null==t?void 0:null===(a=t.data)||void 0===a?void 0:a.expired),k(!0),C(!0),A(!1);return}if(r){V(null==t?void 0:null===(i=t.data)||void 0===i?void 0:i.expired),j(!0);return}if(c){let e=null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.captcha,r=null==t?void 0:null===(o=t.data)||void 0===o?void 0:o.key;l(t=>({...t,challenge:{type:"captcha",endpoint:f,payload:y,nextStep:d.RZ.PHONE_OTP_V2,fromStep:d.RZ.PHONE_OTP_V2,captcha:{src:e,key:r}}})),s(d.RZ.CAPTCHA)}p(e=>{c||(e.hasCodeError=!0,e.codeErrorText=d._R[null==t?void 0:t.code]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло не Ñак...")}),C(!0),A(!1)}}catch(r){console.error("Error requesting new code:",r);let e=r&&r.code&&d.pO.includes(r.code),t=r&&r.code&&d.jb.includes(r.code);if(t&&(null==r?void 0:r.code)==="SMS_LIMIT_EXCEEDED"){H(null==r?void 0:null===(c=r.data)||void 0===c?void 0:c.expired),k(!0),C(!0),A(!1);return}if(t){V(null==r?void 0:null===(u=r.data)||void 0===u?void 0:u.expired),j(!0);return}if(C(!0),A(!1),e){let e=null==r?void 0:null===(h=r.data)||void 0===h?void 0:h.captcha,t=null==r?void 0:null===(m=r.data)||void 0===m?void 0:m.key;l(r=>({...r,challenge:{type:"captcha",endpoint:f,payload:y,nextStep:d.RZ.PHONE_OTP_V2,fromStep:d.RZ.PHONE_OTP_V2,captcha:{src:e,key:t}}})),s(d.RZ.CAPTCHA)}p(t=>{e||(t.hasPasswordError=!0,t.passwordErrorText=d.Sr[null==r?void 0:r.code]||d.Sr[null==r?void 0:r.message]||(null==r?void 0:r.message)||"ЧÑо-Ñо поÑло не Ñак...",t.hasCodeError=!0,t.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода")})}};return(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&F()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из\xa0СÐС,",(0,a.jsx)("br",{}),"оÑпÑавили на\xa0номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)((null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.phone)||(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.emailOrPhone))}})]}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{F(e)},errorText:u.hasCodeError?u.codeErrorText:"",value:u.code,onChange:e=>{p(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:u.isWork,onFocus:()=>{var e;E({screen_type:"login_registration",screen_attributes_id:"code_sms",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:_&&(null===(e=_.loginData)||void 0===e?void 0:e.type)})}})}),(0,a.jsx)("div",{className:h()(f().field,f().field_otpV2),children:(0,a.jsx)(J.S,{checked:u.info,onChange:()=>{p(e=>{e.info=!e.info}),l(e=>({...e,isWantSpam:!u.info})),E({screen_type:"login_registration",screen_attributes_id:"code_sms",action_id:"click",element_type:"checkbox",element_attributes_id:"notifications",element_attributes_text:"Я ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а Ñакже на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
Ð´Ð»Ñ ÐµÑ Ð¾ÑпÑавки",action_result:!u.info,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},name:"notifications",id:"notifications",label:(0,a.jsxs)("span",{children:["Я\xa0ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а\xa0Ñакже\xa0на\xa0",(0,a.jsx)(X(),{className:f().consent_link,prefetch:!1,href:"/legal/consent",target:"_blank",rel:"noopener noreferrer",onClick:e=>{var t;E({screen_type:"login_registration",screen_attributes_id:"code_sms",action_id:"click",element_type:"link",element_attributes_id:"personal_data_with_notification",element_attributes_text:null==e?void 0:null===(t=e.currentTarget)||void 0===t?void 0:t.innerText,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},children:"обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
"}),"\xa0длÑ\xa0еÑ\xa0оÑпÑавки"]}),dontShoot:!0})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:y,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>F(u.code),isLoading:u.isWork,isDisabled:u.isWork,className:f().button}),P&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["СлиÑком много попÑÑок ввода.",(0,a.jsx)("br",{}),"ÐопÑобÑйÑе Ñнова ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().countdown_limit),children:L})]})}),w&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:M})]})}),!P&&!w&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{variant:b.Vt.TERTIARY,className:h()(f().requestAnotherCode),text:(0,a.jsxs)("span",{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!N&&(0,a.jsx)(a.Fragment,{children:" ÑеÑез"})]}),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!N&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown),children:(0,m.fU)(R)})]})]}),onClick:K,size:b.GO.REGULAR,isDisabled:!N,fullWidth:!0})})]})},OTP:e=>{var t,r,s,l,_,u;let{changeStep:p,setDto:g,dto:v}=e,E=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[y,x]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:""}),R=c.Ay.useApiUrl(),I=c.Ay.useApiKey(),{clientApiKey:O}=c.Ay.useApiClientKey(),A=c.Ay.useClickHouseShoot(),N=c.Ay.useResponsiveButtonSize(),[C,P]=(0,i.useState)(d.xS),[j,w]=(0,i.useState)(!0),[k,L]=(0,i.useState)(!1),[D,M]=(0,i.useState)(!1),[G,W]=(0,i.useState)(null),[V,Z]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=V-Math.floor(Date.now()/1e3);if(t<=0)M(!1),clearInterval(e),W("00:00");else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");W("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[V]),(0,i.useEffect)(()=>{let e=null;return j&&C>0?e=setInterval(()=>{P(e=>e-1)},1e3):0===C&&(w(!1),L(!0)),()=>clearInterval(e)},[j,C]),(0,i.useEffect)(()=>(w(!0),L(!1),()=>{(0,m.zs)(d.v8.MEGAFON_MLK)}),[]),(0,i.useEffect)(()=>{var e,t;x(e=>{e.phone=localStorage.getItem(d.CV.PHONE),e.password=localStorage.getItem(d.CV.PASSWORD)}),g(e=>{var t,r;return{...e,clickHouse:{attributesId:(null==v?void 0:null===(t=v.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"code_email":"code_sms",refererScreenType:"login",referer_screen_attributes_id:(null==v?void 0:null===(r=v.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"}}}),A({screen_type:"login",screen_attributes_id:(null==v?void 0:null===(e=v.loginData)||void 0===e?void 0:e.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:(null==v?void 0:null===(t=v.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})},[]),(0,i.useEffect)(()=>{let e=document.getElementById("pin-0");e&&e.focus()},[]);let H=e=>{let t="",r=!1;if(e.length)e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ");else{var a;r=!0,t=(null==v?void 0:null===(a=v.loginData)||void 0===a?void 0:a.type)===d.bh.EMAIL?"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из пиÑÑма":"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС"}return x(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},U=async e=>{var t,r,a,i,n,s,l,c,_;A({screen_type:"login",screen_attributes_id:(null==v?void 0:null===(t=v.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login",referer_screen_attributes_id:(null==v?void 0:null===(r=v.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"});let u=H(e);if(F(u),u){x(e=>{e.isWork=!0});let t=null==v?void 0:null===(a=v.loginData)||void 0===a?void 0:a.emailOrPhone,r=null==v?void 0:null===(i=v.loginData)||void 0===i?void 0:i.type,u=r===d.bh.EMAIL?T.PI.emailLoginV3Confirm:T.PI.phoneLoginV3Confirm,h="".concat(R).concat(u).
1concat(I),f={...r===d.bh.EMAIL&&{email:t,is_encoded:!0},...r===d.bh.PHONE&&{phone:(0,m.n4)(t)},...y.hasCaptcha&&{key:y.captchaKey,captcha:y.captcha},code:e},b=await fetch(h,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)});if(b.status<400){let e=await b.json();p(d.RZ.SUCCESS),g(t=>({...t,authType:d.tG.LOGIN,userProfileData:e})),(0,o.EF)(),A({screen_type:"login",screen_attributes_id:"success",account_id:e._id,action_result:(null==v?void 0:null===(n=v.loginData)||void 0===n?void 0:n.type)===d.bh.EMAIL?"email_otp":"phone_otp",profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:"login",virtual_profile_id:null==E?void 0:E._id,event_time:new Date().getTime(),referer_screen_type:"login",referer_screen_attributes_id:(null==v?void 0:null===(s=v.loginData)||void 0===s?void 0:s.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})}else{let e=await b.json();if(x(e=>{e.isWork=!1}),e&&e.code&&d.jb.includes(e.code)){Z(null==e?void 0:null===(_=e.data)||void 0===_?void 0:_.expired),M(!0);return}let t=e&&e.code&&d.pO.includes(e.code);x(r=>{if(r.isWork=!1,t||(r.isWork=!1,r.hasCodeError=!0,r.codeErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."),t){let t=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;r.hasCaptcha=!0,r.captcha="",r.captchaImg=t?"".concat(R).concat(t,"&apikey=").concat(O,"&v=").concat(Math.random()):"",r.captchaKey=a,r.hasCaptchaError=!0,r.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}}),A({screen_type:"login",screen_attributes_id:(null==v?void 0:null===(l=v.loginData)||void 0===l?void 0:l.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"error",action_result:d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[e.message]||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:h,action_parameter:"login",referer_screen_type:"login",referer_screen_attributes_id:(null==v?void 0:null===(c=v.loginData)||void 0===c?void 0:c.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})}}},F=e=>{var t,r,a;A({screen_type:"login",screen_attributes_id:(null==v?void 0:null===(t=v.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из ".concat((null==v?void 0:null===(r=v.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"пиÑÑма":"СÐС"),referer_screen_type:"login",referer_screen_attributes_id:(null==v?void 0:null===(a=v.loginData)||void 0===a?void 0:a.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})},K=async()=>{var e,t,r,a,i;L(!1),w(!0),P(d.xS),A({screen_type:"login",screen_attributes_id:(null==v?void 0:null===(e=v.loginData)||void 0===e?void 0:e.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"click",element_type:"button",element_attributes_id:"new_code",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login",referer_screen_attributes_id:(null==v?void 0:null===(t=v.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"});let n=null==v?void 0:null===(r=v.loginData)||void 0===r?void 0:r.type,o=n===d.bh.EMAIL?T.PI.emailLoginV3:T.PI.phoneLoginV3,s=null==v?void 0:null===(a=v.loginData)||void 0===a?void 0:a.emailOrPhone,l="".concat(R).concat(o).concat(I
1),c={...n===d.bh.EMAIL&&{email:s,is_encoded:!0},...n===d.bh.PHONE&&{phone:(0,m.n4)(s)},...y.hasCaptcha&&{key:y.captchaKey,captcha:y.captcha}};try{let e=await fetch(l,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(e.status>=400){let t=await e.json(),r=t&&t.code&&d.pO.includes(t.code);if(t&&t.code&&d.jb.includes(t.code)){Z(null==t?void 0:null===(i=t.data)||void 0===i?void 0:i.expired),M(!0);return}x(e=>{if(r){let r=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=r?"".concat(R).concat(r,"&apikey=").concat(O,"&v=").concat(Math.random()):"",e.captchaKey=a,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак..."}else e.hasCodeError=!0,e.codeErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак..."}),L(!0),w(!1)}}catch(e){console.error("Error requesting new code:",e),L(!0),w(!1),x(e=>{e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}},z=async()=>{if(!y.hasCaptcha||!y.captchaImg)return;let e=new URL(y.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?x(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await U()};return(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&U()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из ",(null==v?void 0:null===(t=v.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"пиÑÑма":"СÐС",",",(0,a.jsx)("br",{}),"оÑпÑавили на ",(null==v?void 0:null===(r=v.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"поÑÑÑ":"номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(null==v?void 0:null===(s=v.loginData)||void 0===s?void 0:s.type)===d.bh.EMAIL?null==v?void 0:null===(l=v.loginData)||void 0===l?void 0:l.emailOrPhone:(0,o.jW)(null==v?void 0:null===(_=v.loginData)||void 0===_?void 0:_.emailOrPhone)}})]}),(null==v?void 0:null===(u=v.loginData)||void 0===u?void 0:u.type)===d.bh.EMAIL&&(0,a.jsx)("div",{className:h()(f().description,f().description_otp),children:"ÐÑли пиÑÑма неÑ, пÑовеÑÑÑе Спам"}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{U(e)},errorText:y.hasCodeError?y.codeErrorText:"",value:y.code,onChange:e=>{x(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:y.isWork,onFocus:()=>{var e,t,r;A({screen_type:"login",screen_attributes_id:(null==v?void 0:null===(e=v.loginData)||void 0===e?void 0:e.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из ".concat((null==v?void 0:null===(t=v.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"пиÑÑма":"СÐС"),referer_screen_type:"login",referer_screen_attributes_id:(null==v?void 0:null===(r=v.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})}})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:N,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>U(y.code),isLoading:y.isWork,isDisabled:y.isWork,className:f().button}),y.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:y.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:z})]}),(0,a.jsx)(B.A,{value:y.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onCh
1ange:e=>{let t=e.target.value;x(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:y.hasCaptchaError,errorText:y.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"}),(0,a.jsxs)("div",{className:Y().infoMessage,children:[(0,a.jsx)("img",{className:Y().infoMessage_icon,src:"/static/images/auth/info.svg",alt:"info"}),(0,a.jsx)("span",{className:Y().infoMessage_text,children:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð½Ð¾Ð²Ñй код"})]})]}):null,D&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["СлиÑком много попÑÑок ввода.",(0,a.jsx)("br",{}),"ÐопÑобÑйÑе Ñнова ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().countdown_limit),children:G})]})}),!D&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!k&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().small),children:(0,m.fU)(C)})]})]}),onClick:K,size:b.GO.SMALL,variant:b.Vt.SECONDARY,isDisabled:!k,"data-testid":"otp_get_new_code_button"})})]})},RequestOTPCode:e=>{var t,r,n,o,s;let{changeStep:l,setDto:_,dto:u}=e,{clientApiQuery:p,clientApiKey:g}=c.Ay.useApiClientKey(),E=c.Ay.useClickHouseShoot(),y=c.Ay.useApiUrl(),x=c.Ay.useResponsiveButtonSize(),[R,I]=(0,i.useState)(!1),[O,A]=(0,i.useState)(!1),[N,C]=(0,i.useState)(null),[P,j]=(0,i.useState)(null),[w,k]=(0,S.e)({emailOrPhone:"",emailOrPhoneType:void 0,password:"",hasPasswordError:!1,passwordErrorText:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1}),L=null==u?void 0:null===(t=u.loginData)||void 0===t?void 0:t.emailOrPhone;(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=P-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),C("00:00");else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");C("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[P]),(0,i.useEffect)(()=>{var e,t;_(e=>{var t,r;return{...e,clickHouse:{attributesId:(null==u?void 0:null===(t=u.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"send_code_email":"send_code_sms",refererScreenType:"login",refererScreenAttributesId:(null==u?void 0:null===(r=u.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"by_email":"by_phone"}}}),E({screen_type:"login",screen_attributes_id:(null==u?void 0:null===(e=u.loginData)||void 0===e?void 0:e.type)===d.bh.EMAIL?"send_code_email":"send_code_sms",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:(null==u?void 0:null===(t=u.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"by_email":"by_phone"})},[]);let D=(e,t)=>{var r,a,i;let n="";n=(null==t?void 0:t.error)&&(null==t?void 0:null===(r=t.details)||void 0===r?void 0:r.email)?d.Sr.WRONG_EMAIL:(null==t?void 0:t.error)&&(null==t?void 0:null===(a=t.details)||void 0===a?void 0:a.phone)?d.Sr.INCORRECT_PHONE:(null==t?void 0:t.code)==="REGISTRATION_UNAVAILABLE"?d.Sr.REGISTRATION_UNAVAILABLE:d.Sr.SOMETHING_WENT_WRONG,I(!1);let o=t&&t.code&&d.pO.includes(t.code);if(t&&t.code&&d.jb.includes(t.code)){j(null==t?void 0:null===(i=t.data)||void 0===i?void 0:i.expired),A(!0);return}k(e=>{if(o){let r=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=r?"".concat(y).concat(r,"&apikey=").concat(g,"&v=").concat(Math.random()):"",e.captchaKey=a,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак..."}else e.hasPasswordError=!0,e.passwordErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||n||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."})},M=async()=>{var e,t,r,a,i;E({screen_type:"login",screen_attributes_id:(null==u?void 0:null===(e=u.loginData)||void 0===e?void 0:e.type)===d.bh.EMAIL?"send_code_email":"send_code_sms",action_id:"click",referer_screen_type:"login",referer_screen_attributes_id:(null==u?void 0:null===(t=u.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"by_email":"by_phone",element_type:"button",element_attributes_id:(null==u?void 0:null===(r=u.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"send_email":"send_sms",element_attributes_text:(null==u?void 0:null===(a=u.loginData)||void 0===a?void 0:a.type)===d.bh.EMAIL?"ÐÑпÑавиÑÑ ÐºÐ¾Ð´":"ÐÑпÑавиÑÑ Ð¡ÐС"}),I(!0);let n=null==u?void 0:null===(i=u.loginData)||void 0===i?void 0:i.type,o=n===d.bh.EMAIL?T.PI.emailLoginV3:T.PI.phoneLoginV3,s="".concat(y).concat(o).concat(p),c={...n===d.bh.EMAIL&&{email:L,is_encoded:!0},...n===d.bh.PHONE&&{phone:(0,m.n4)(L)},...w.hasCaptcha&&{key:w.captchaKey,captcha:w.captcha}};try{let e=await fetch(s,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),t=await e.json();e.ok?l(d.RZ.OTP):D(s,t)}catch(e){D(s)}finally{I(!1)}},G=async()=>{if(!w.hasCaptcha||!w.captchaImg)return;let e=new URL(w.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?k(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await M()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"ÐÑ
од по одноÑÐ°Ð·Ð¾Ð²Ð¾Ð¼Ñ Ð¿Ð°ÑолÑ",description:"Ðа данной ÑÑÑаниÑе Ð²Ñ ÑможеÑе запÑоÑиÑÑ Ð¾Ð´Ð½Ð¾ÑазовÑй паÑÐ¾Ð»Ñ Ð¾Ñ Ð°ÐºÐºÐ°ÑнÑа онлайн киноÑеаÑÑа START"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&M()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["Ðод Ð´Ð»Ñ Ð²Ñ
ода оÑпÑавим",(0,a.jsx)("br",{}),(null==u?void 0:null===(r=u.loginData)||void 0===r?void 0:r.type)==="email"?"на поÑÑÑ":"на ÑелеÑон"]}),(0,a.jsx)("div",{className:f().login,children:(null==u?void 0:u.loginData)&&(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:null==u?void 0:null===(n=u.loginData)||void 0===n?void 0:n.emailOrPhone}})}),w.hasCaptcha&&(0,a.jsxs)("div",{className:h()(Y().container,Y().container_requestOTP),children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:w.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:G})]}),(0,a.jsx)(B.A,{value:w.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;k(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:w.hasCaptchaError,errorText:w.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}),(0,a.jsx)(b.$n,{"data-testid":"otp_code_send_button",variant:b.Vt.PRIMARY,size:x,title:(null==u?void 0:null===(o=u.loginData)||void 0===o?void 0:o.type)===d.bh.EMAIL?"ÐÑпÑавиÑÑ ÐºÐ¾Ð´":"ÐÑпÑавиÑÑ Ð¡ÐС",fullWidth:!0,onClick:M,isDisabled:R,isLoading:R,className:h()(f().button,f().button_clear)}),w.passwordErrorText&&(0,a.jsx)("div",{className:h()(f().customError,f().customError_otp),children:w.passwordErrorText}),O&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ ",(null==u?void 0:null===(s=u.loginData)||void 0===s?void 0:s.type)===d.bh.EMAIL?"пиÑем":"запÑоÑов",". ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:N})]})})]})]})},RequestTgOTPCode:e=>{var t,r,s;let{changeStep:l,setDto:_,dto:u}=e,{clientApiQuery:p,clientApiKey:g}=c.Ay.useApiClientKey(),E=c.Ay.useClickHouseShoot(),y=c.Ay.useApiUrl(),x=c.Ay.useResponsiveButtonSize(),[R,I]=(0,i.useState)(!1),[O,A]=(0,i.useState)(!1),[N,C]=(0,i.useState)(!1),[P,j]=(0,i.useState)(null),[w,k]=(0,i.useState)("00:00"),[L,D]=(0,i.useState)(null),[M,G]=(0,i.useState)("00:00"),[W,V]=(0,S.e)({emailOrPhone:"",emailOrPhoneType:void 0,password:"",hasPasswordError:!1,passwordErrorText:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1}),Z=null==u?void 0:null===(t=u.loginData)||void 0===t?void 0:t.emailOrPhone,H=(0,n.d4)(e=>e.systemInformation.config||{}),U=null==H?void 0:null===(r=H.otp)||void 0===r?void 0:r.otp_provider;(0,i.useEffect)(()=>
1{if(O&&P){let e=setInterval(()=>{let t=P-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),k("00:00"),A(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");k("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)}},[O,P]),(0,i.useEffect)(()=>{if(N&&L){let e=setInterval(()=>{let t=L-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),G("00:00"),C(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");G("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)}},[N,L]),(0,i.useEffect)(()=>{_(e=>({...e,clickHouse:{attributesId:"code_by_phone",refererScreenType:"login",refererScreenAttributesId:"by_phone"}})),E({screen_type:"login",screen_attributes_id:"code_by_phone",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:"by_phone"})},[]);let F=(e,t)=>{var r,a,i,n,o,s;let c="";c=(null==t?void 0:t.error)&&(null==t?void 0:null===(r=t.details)||void 0===r?void 0:r.email)?d.Sr.WRONG_EMAIL:(null==t?void 0:t.error)&&(null==t?void 0:null===(a=t.details)||void 0===a?void 0:a.phone)?d.Sr.INCORRECT_PHONE:(null==t?void 0:t.code)==="REGISTRATION_UNAVAILABLE"?d.Sr.REGISTRATION_UNAVAILABLE:d.Sr.SOMETHING_WENT_WRONG,I(!1);let _=t&&t.code&&d.pO.includes(t.code),u=t&&t.code&&d.jb.includes(t.code),p=u&&(null==t?void 0:t.code)==="TELEGRAM_LIMIT_EXCEEDED",h=u&&(null==t?void 0:t.code)==="SMS_LIMIT_EXCEEDED",m=(null==t?void 0:t.code)==="TELEGRAM_EXCEPTION"||(null==t?void 0:t.code)==="SERVICE_EXCEPTION"||(null==t?void 0:null===(i=t.telegram)||void 0===i?void 0:i.code)==="TELEGRAM_EXCEPTION"||(null==t?void 0:null===(n=t.telegram)||void 0===n?void 0:n.code)==="SERVICE_EXCEPTION",v=(null==t?void 0:t.code)==="TELEGRAM_EXCEPTION",E=(null==t?void 0:t.code)==="TELEGRAM_USER_NOT_FOUND",f=v&&(null==t?void 0:t.message)==="BALANCE_NOT_ENOUGH",b=v&&(null==t?void 0:t.message)==="PHONE_NUMBER_INVALID",S=v&&(null==t?void 0:t.message)==="FLOOD_WAIT_3",T=(null==t?void 0:t.code)==="SERVICE_EXCEPTION"&&(null==t?void 0:t.message)==="ExternalServiceError";if(m){l(d.RZ.OTP_TELEGRAM_ERROR);return}if(E){l(d.RZ.OTP_TELEGRAM_NOT_REGISTERED);return}if(h){D(null==t?void 0:null===(o=t.data)||void 0===o?void 0:o.expired),C(!0);return}if(p){j(null==t?void 0:null===(s=t.data)||void 0===s?void 0:s.expired),A(!0);return}if(f){l(d.RZ.OTP_TELEGRAM_ERROR);return}if(b){l(d.RZ.OTP_TELEGRAM_NOT_REGISTERED);return}if(S||T){l(d.RZ.OTP_TELEGRAM_ERROR);return}V(e=>{if(_){let r=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=r?"".concat(y).concat(r,"&apikey=").concat(g,"&v=").concat(Math.random()):"",e.captchaKey=a,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак..."}else e.hasPasswordError=!0,e.passwordErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||c||"ЧÑо-Ñо поÑло не Ñак..."})},K=async()=>{E({screen_type:"login",screen_attributes_id:"code_by_phone",action_id:"click",referer_screen_type:"login",referer_screen_attributes_id:"by_phone",element_type:"button",element_attributes_id:"send_tg_code",element_attributes_text:"ÐÑпÑавиÑÑ Ð² Telegram"}),I(!0);let e="".concat(y).concat(T.PI.phoneLoginV3).concat(p),t={phone:(0,m.n4)(Z),...W.hasCaptcha&&{key:W.captchaKey,captcha:W.captcha},providers:["telegram"]};try{let r=await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await r.json();r.ok?l(d.RZ.OTP_TELEGRAM_SIGNIN):F(e,a)}catch(t){F(e)}finally{I(!1)}},z=async()=>{E({screen_type:"login",screen_attributes_id:"code_by_phone",action_id:"click",referer_screen_type:"login",referer_screen_attributes_id:"by_phone",element_type:"button",element_attributes_id:"send_sms",element_attributes_text:"ÐÑпÑавиÑÑ Ð¡ÐС"}),I(!0);let e="".concat(y).concat(T.PI.phoneLoginV3).concat(p),t={phone:(0,m.n4)(Z),...W.hasCaptcha&&{key:W.captchaKey,captcha:W.captcha},providers:["sms"]};try{let r=await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await r.json();r.ok?l(d.RZ.OTP):F(e,a)}catch(t){F(e)}finally{I(!1)}},X=async()=>
1{if(E({screen_type:"login",screen_attributes_id:"code_by_phone",action_id:"click",element_type:"button",element_attributes_id:"request_captcha",element_attributes_text:"/static/images/registration/refresh_1.svg",referer_screen_type:"login",referer_screen_attributes_id:"by_phone"}),!W.hasCaptcha||!W.captchaImg)return;let e=new URL(W.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?V(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await onSubmit()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"ÐÑ
од по одноÑÐ°Ð·Ð¾Ð²Ð¾Ð¼Ñ Ð¿Ð°ÑолÑ",description:"Ðа данной ÑÑÑаниÑе Ð²Ñ ÑможеÑе запÑоÑиÑÑ Ð¾Ð´Ð½Ð¾ÑазовÑй паÑÐ¾Ð»Ñ Ð¾Ñ Ð°ÐºÐºÐ°ÑнÑа онлайн киноÑеаÑÑа START"}),(0,a.jsxs)("div",{className:f().container,children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"Ðод длÑ\xa0вÑ
ода оÑпÑавим на\xa0номеÑ"}),(0,a.jsx)("div",{className:f().login,children:(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(null==u?void 0:null===(s=u.loginData)||void 0===s?void 0:s.emailOrPhone)||"Ð²Ð°Ñ Ð½Ð¾Ð¼ÐµÑ"}})}),W.hasCaptcha&&(0,a.jsxs)("div",{className:h()(Y().container,Y().container_requestOTP),children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:W.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:X})]}),(0,a.jsx)(B.A,{value:W.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;V(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:W.hasCaptchaError,errorText:W.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}),"telegram"===U&&(O?(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_tgOtpCodeNoMargin),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов Ð´Ð»Ñ Telegram. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:w})]})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(b.$n,{"data-testid":"otp_code_send_button",variant:b.Vt.PRIMARY,size:x,title:"ÐÑпÑавиÑÑ Ð² Telegram",fullWidth:!0,onClick:K,isDisabled:R,isLoading:R,className:h()(f().button,f().button_blue,f().button_clear),iconLeft:(0,a.jsx)("img",{src:"/static/images/auth/telegram_filled.svg",alt:"telegram icon"})})})),N?(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_tgOtpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов Ð´Ð»Ñ Ð¡ÐС. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:M})]})}):(0,a.jsx)(b.$n,{className:h()(f().description),title:"ÐÑпÑавиÑÑ Ð¡ÐС",onClick:z,size:b.GO.SMALL,variant:b.Vt.SECONDARY,"data-testid":"otp_get_new_code_button"}),W.passwordErrorText&&(0,a.jsx)("div",{className:h()(f().customError,f().customError_otp),children:W.passwordErrorText})]})]})},Megafon:e=>{let{changeStep:t,setDto:r,isBackBtnClick:n,animationComplete:s}=e,l=c.Ay.useApiUrl(),_=c.Ay.useApiKey(),{clientApiKey:u}=c.Ay.useApiClientKey(),p=c.Ay.useClickHouseShoot(),g=c.Ay.useResponsiveButtonSize(),[E,y]=(0,S.e)({phone:"",ph
1oneIsEmpty:!1,phoneError:!1,phoneErrorMsg:null,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1}),x=(0,i.useRef)(null);(0,i.useEffect)(()=>{s&&x.current&&setTimeout(()=>{x.current.focus()},200)},[s]);let R=e=>/^\+7 9\d{2} \d{3}-\d{2}-\d{2}$/.test(e),I=async()=>{if(p({screen_type:"login_registration",screen_attributes_id:"megafon_otp",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),!R(E.phone)){y(e=>{e.phoneError=!0,e.phoneErrorMsg="ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +7 900 000 00 00"});return}if(!E.phone){y(e=>{e.phoneError=!0,e.phoneErrorMsg=d.Sr.PHONE_EMPTY});return}if(E.hasCaptcha&&!E.captcha){y(e=>{e.hasCaptchaError=!0,e.captchaErrorText=d.Sr.CAPTCHA_IS_NEEDED});return}let e="".concat(l).concat(T.PI.phoneCheck).concat(_),a="".concat(l).concat(T.PI.megafonCodeV3).concat(_),i={phone:E.phone,from_auth_page:!1,...E.hasCaptcha&&{key:E.captchaKey,captcha:E.captcha}};y(e=>{e.isWork=!0}),fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:E.phone}),credentials:"include"}).then(e=>{e.status<400&&e.json().then(e=>{(null==e?void 0:e.code)==="USER_FOUND"&&(y(e=>{e.isWork=!0}),fetch(a,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).then(e=>e.ok?e.json().then(e=>{t(d.RZ.MEGAFON_SIGNIN_CODE),r(t=>({...t,authType:d.tG.LOGIN,loginData:E.phone,userProfileData:e}))}):e.json().then(e=>O(e))).catch(e=>{O()}).finally(()=>{y(e=>{e.isWork=!1})})),(null==e?void 0:e.code)==="USER_NOT_FOUND"&&(y(e=>{e.isWork=!0}),fetch(a,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}).then(e=>e.ok?e.json().then(e=>{t(d.RZ.MEGAFON_SIGNUP_CODE),r(t=>({...t,authType:d.tG.REGISTER,loginData:E.phone,userProfileData:{phone:e.phone}}))}):e.json().then(e=>O(e))).catch(e=>{O(e,a)}).finally(()=>{y(e=>{e.isWork=!1})}))})})},O=(e,t)=>{p({screen_type:"login_registration",screen_attributes_id:"megafon_otp",action_id:"error",action_result:d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:t,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),y(t=>{if((null==e?void 0:e.code)==="USER_NOT_FOUND");else if(d.pO.includes(null==e?void 0:e.code)){let r=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;t.hasCaptcha=!0,t.captcha="",t.captchaImg=r?"".concat(l).concat(r,"&apikey=").concat(u,"&v=").concat(Math.random()):"",t.captchaKey=a,t.hasCaptchaError=!0,t.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}else t.phoneError=!0,t.phoneErrorMsg=d.Sr[null==e?void 0:e.code]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."})},A=async()=>{if(!E.hasCaptcha||!E.captchaImg)return;let e=new URL(E.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?y(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await I()},N=()=>{p({screen_type:"login_registration",screen_attributes_id:"megafon_otp",action_id:"text_input",action_result:E.phone,element_type:"input",element_attributes_id:"phone",element_attributes_text:"ÐведиÑе ÑелеÑон",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})};return(0,i.useEffect)(()=>{let e=e=>e&&10===e.length?"+7 ".concat(e.slice(0,3)," ").concat(e.slice(3,6),"-").concat(e.slice(6,8),"-").concat(e.slice(8)):"",t=(0,m.Ri)(d.v8.MEGAFON_MLK);return y(r=>{r.phone=t?e(t):""}),p({screen_type:"login_registration",screen_attributes_id:"megafon_otp",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),()=>{(0,o.Yj)(d.v8.MEGAFON_MLK)}},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"ÐÑ
од Ð´Ð»Ñ Ð°Ð±Ð¾Ð½ÐµÐ½Ñов ÐегаФона"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,I),children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð°Ð±Ð¾Ð½ÐµÐ½Ñа ÐегаФона"}),(0,a.jsx)("div",{className:f().megafonField,onBlur:n?()=>{}:()=>{setTimeout(()=>{N()},200)},children:(0,a.jsx)(B.A,{inputRef:x,value:E.phone,label:"ÐведиÑе ÑелеÑон",onChange:e=>{y(t=>{t.phone=e.target.value,t.phoneIsEmpty=!1,t.phoneErrorMsg="",t.phoneError=!1})},onValidate:e=>{y(t=>
1{t.phoneError=!e,t.phoneErrorMsg=!e&&E.phone.length?"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +7 900 000 00 00":"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи Ð½Ð¾Ð¼ÐµÑ ÑелеÑона"}),e||p({screen_type:"login_registration",screen_attributes_id:"megafon_otp",action_id:"error",action_result:!e&&E.phone.length?"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +7 900 000 00 00":"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи Ð½Ð¾Ð¼ÐµÑ ÑелеÑона",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},id:"phone",type:"tel",validationType:"text",error:E.phoneIsEmpty||E.phoneError,errorText:E.phoneErrorMsg,testid:"megafon_signup_phone",autoComplete:"off",blokInfo:{screen_type:"login",screen_attributes_id:"megafon_otp"},darkTheme:!0,placeholder:"+7 ХХХ ХХХ ХХ ХХ",onFocus:()=>{p({screen_type:"login_registration",screen_attributes_id:"megafon_otp",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"phone",element_attributes_text:"ÐведиÑе ÑелеÑон",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},preventOnBlur:!0,noShoot:!0})}),E.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:E.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:A})]}),(0,a.jsx)(B.A,{value:E.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;y(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:E.hasCaptchaError,errorText:E.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}):null,(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:g,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:I,isLoading:E.isWork,isDisabled:E.isWork,className:f().button}),(0,a.jsx)(b.$n,{className:h()(f().description,f().description_megafon),title:"ÐойÑи дÑÑгим ÑпоÑобом",onClick:()=>{p({screen_type:"login_registration",screen_attributes_id:"megafon_otp",action_id:"click",element_type:"link",element_attributes_id:"another_method_login",element_attributes_text:"ÐойÑи дÑÑгим ÑпоÑобом",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),t(d.RZ.CORE)},size:b.GO.SMALL,variant:b.Vt.SECONDARY})]})]})},MegafonSigninCode:e=>{var t;let{dto:r,changeStep:s,setDto:l}=e,_=c.Ay.useApiUrl(),u=c.Ay.useApiKey(),{clientApiKey:p}=c.Ay.useApiClientKey(),g=c.Ay.useClickHouseShoot(),E=c.Ay.useResponsiveButtonSize(),y=(0,n.d4)(e=>e.registration.authData),[x,R]=(0,S.e)({phone:(null==r?void 0:null===(t=r.userProfileData)||void 0===t?void 0:t.phone)||"",phoneIsEmpty:!1,phoneError:!1,phoneErrorMsg:null,code:"",hasCodeError:!1,codeErrorText:"",countdown:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1,info:!1}),[I,O]=(0,i.useState)(!1),[A,N]=(0,i.useState)(!0),[C,P]=(0,i.useState)(d.xS);(0,i.useEffect)(()=>{let e=null;return A&&C>0?e=setInterval(()=>{P(e=>e-1)},1e3):0===C&&(N(!1),O(!0)),()=>clearInterval(e)},[A,C]),(0,i.useEffect)(()=>{N(!0),O(!1)},[]),(0,i.useEffect)(()=>
1{l(e=>({...e,clickHouse:{refererScreenType:"login",refererScreenAttributesId:"megafon_otp"}})),g({screen_type:"login",screen_attributes_id:"megafon_otp",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"})},[]);let j=e=>{let t="",r=!1;return e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС"),R(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},w=()=>{if(!x.hasCaptcha)return!0;let e=x.captcha,t=!1,r="";return e.length||(t=!0,r="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи ÑиÑло"),R(e=>{e.hasCaptchaError=t,e.captchaErrorText=r}),!t},k=async e=>{if(g({action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",screen_type:"login",screen_attributes_id:"megafon_otp",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"}),D(j(e)),j(e)&&w()){let t="".concat(_).concat(T.PI.megafonAuth).concat(u),r={phone:x.phone,code:e,...x.hasCaptcha&&{key:x.captchaKey,captcha:x.captcha}};try{R(e=>{e.isWork=!0});let e=await fetch(t,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),a=await e.json();e.status<400?(g({action_id:"login",action_result:"mf_otp",virtual_profile_id:null==y?void 0:y.profile_id,event_time:new Date().getTime(),referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"}),s(d.RZ.SUCCESS),l(e=>({...e,authType:d.tG.LOGIN,userProfileData:a}))):L(a)}catch(e){L(e)}finally{R(e=>{e.isWork=!1})}}},L=e=>{if((null==e?void 0:e.code)==="USER_NOT_FOUND")s(d.RZ.MEGAFON_SIGNUP_CODE);else if(d.pO.includes(null==e?void 0:e.code)){let t=e&&e.data&&e.data.captcha,r=e&&e.data&&e.data.key;R(a=>{a.hasCaptcha=!0,a.captcha="",a.captchaImg=t?"".concat(_).concat(t,"&apikey=").concat(p,"&v=").concat(Math.random()):"",a.captchaKey=r,a.hasCaptchaError=!0,a.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."})}else R(t=>{t.hasCodeError=!0,t.codeErrorText=d.Sr[null==e?void 0:e.code]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."})},D=e=>{g({screen_type:"login",screen_attributes_id:"megafon_otp",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"})},M=async()=>{O(!1),N(!0),P(d.xS),g({screen_type:"login",screen_attributes_id:"megafon_otp",action_id:"click",element_type:"button",element_attributes_id:"resend_sms",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"});let e="".concat(_).concat(T.PI.megafonCodeV3).concat(u),t={phone:x.phone,from_auth_page:!1,...x.hasCaptcha&&{key:x.captchaKey,captcha:x.captcha}};try{let r=await fetch(e,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(r.status>=400){let e=await r.json(),t=e&&e.code&&d.pO.includes(e.code);R(r=>{if(t){let t=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;r.hasCaptcha=!0,r.captcha="",r.captchaImg=t?"".concat(_).concat(t,"&apikey=").concat(p,"&v=").concat(Math.random()):"",r.captchaKey=a,r.hasCaptchaError=!0,r.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}else r.hasCodeError=!0,r.codeErrorText=d._R[null==e?void 0:e.code]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}),O(!0),N(!1)}}catch(e){console.error("Error requesting new code:",e),O(!0),N(!1),R(e=>{e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}},G=async()=>{if(!x.hasCaptcha||!x.captchaImg)return;let e=new URL(x.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?R(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await k()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"ÐÑ
од Ð´Ð»Ñ Ð°Ð±Ð¾Ð½ÐµÐ½Ñов ÐегаФона"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&k()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из СÐС,",(0,a.jsx)("br",{}),"оÑпÑавили на номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(x.phone)}})]}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{k(e)},errorText:x.hasCodeError?x.codeErrorText:"",value:x.code,onChange:e=>{R(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:x.isWork,onFocus:()=>{g({screen_type:"login",screen_attributes_id:"megafon_otp",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"})}})}),x.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:x.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:G})]}),(0,a.jsx)(B.A,{value:x.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onCh
1ange:e=>{let t=e.target.value;R(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:x.hasCaptchaError,errorText:x.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}):null,(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:E,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>k(x.code),isLoading:x.isWork,isDisabled:x.isWork,className:f().button}),(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!I&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().small),children:(0,m.fU)(C)})]})]}),onClick:M,size:b.GO.SMALL,variant:b.Vt.SECONDARY,isDisabled:!I})})]})]})},MegafonSignupCode:e=>{var t;let{changeStep:r,setDto:s,dto:l}=e,_=c.Ay.useApiUrl(),u=c.Ay.useApiKey(),{clientApiKey:p}=c.Ay.useApiClientKey(),g=c.Ay.useClickHouseShoot(),E=c.Ay.useResponsiveButtonSize(),y=(0,n.d4)(e=>e.registration.authData),[x,R]=(0,S.e)({phone:(null==l?void 0:null===(t=l.userProfileData)||void 0===t?void 0:t.phone)||"",phoneIsEmpty:!1,phoneError:!1,phoneErrorMsg:null,code:"",hasCodeError:!1,codeErrorText:"",countdown:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1,info:!1}),[I,O]=(0,i.useState)(!1),[A,N]=(0,i.useState)(!0),[C,P]=(0,i.useState)(d.xS);(0,i.useEffect)(()=>{let e=null;return A&&C>0?e=setInterval(()=>{P(e=>e-1)},1e3):0===C&&(N(!1),O(!0)),()=>clearInterval(e)},[A,C]),(0,i.useEffect)(()=>{N(!0),O(!1)},[]),(0,i.useEffect)(()=>{s(e=>({...e,clickHouse:{refererScreenType:"registration",refererScreenAttributesId:"megafon_otp"}})),g({screen_type:"registration",screen_attributes_id:"megafon_otp",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"})},[]);let j=e=>{let t="",r=!1;return e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС"),R(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},w=()=>{if(!x.hasCaptcha)return!0;let e=x.captcha,t=!1,r="";return e.length||(t=!0,r="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи ÑиÑло"),R(e=>{e.hasCaptchaError=t,e.captchaErrorText=r}),!t},k=async e=>{if(g({action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",screen_type:"registration",screen_attributes_id:"megafon_otp",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"}),D(j(e)),j(e)&&w()){let t="".concat(_).concat(T.PI.megafonAuth).concat(u),a={phone:x.phone,code:e,...x.hasCaptcha&&{key:x.captchaKey,captcha:x.captcha}};try{R(e=>{e.isWork=!0});let e=await fetch(t,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)}),i=await e.json();e.status<400?(g({action_id:"registration",action_result:"mf_otp",virtual_profile_id:null==y?void 0:y.profile_id,event_time:new Date().getTime(),referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"}),r(d.RZ.SUCCESS),s(e=>({...e,authType:d.tG.REGISTER,userProfileData:i})),(0,o.EF)()):L(i)}catch(e){L()}finally{R(e=>{e.isWork=!1})}}},L=e=>{if((null==e?void 0:e.code)==="USER_NOT_FOUND")r(d.RZ.MEGAFON_SIGNUP_CODE);else if(d.pO.includes(null==e?void 0:e.code)){let t=e&&e.data&&e.data.captcha,r=e&&e.data&&e.data.key;R(a=>{a.hasCaptcha=!0,a.captcha="",a.captchaImg=t?"".concat(_).concat(t,"&apikey=").concat(p,"&v=").concat(Math.random()):"",a.captchaKey=r,a.hasCaptchaError=!0,a.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."})}else R(t=>{t.hasCodeError=!0,t.codeErrorText=d.Sr[null==e?void 0:e.code]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."})},D=e=>{g({screen_type:"registration",screen_attributes_id:"megafon_otp",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"})},M=async()=>{O(!1),N(!0),P(d.xS),g({screen_type:"registration",screen_attributes_id:"megafon_otp",action_id:"click",element_type:"button",element_attributes_id:"resend_sms",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"});let e="".concat(_).concat(T.PI.megafonCodeV3).concat(u),t={phone:x.phone,from_auth_page:!1,...x.hasCaptcha&&{key:x.captchaKey,captcha:x.captcha}};try{let r=await fetch(e,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(r.status>=400){let e=await r.json(),t=e&&e.code&&d.pO.includes(e.code);R(r=>{if(t){let t=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;r.hasCaptcha=!0,r.captcha="",r.captchaImg=t?"".concat(_).concat(t,"&apikey=").concat(p,"&v=").concat(Math.random()):"",r.captchaKey=a,r.hasCaptchaError=!0,r.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."}else r.hasCodeError=!0,r.codeErrorText=d._R[null==e?void 0:e.code]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}),O(!0),N(!1)}}catch(e){console.error("Error requesting new code:",e),O(!0),N(!1),R(e=>{e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}},G=async()=>{if(!x.hasCaptcha||!x.captchaImg)return;let e=new URL(x.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?R(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await k()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"ÐÑ
од Ð´Ð»Ñ Ð°Ð±Ð¾Ð½ÐµÐ½Ñов ÐегаФона"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&k()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код Ð´Ð»Ñ ÑегиÑÑÑаÑии,",(0,a.jsx)("br",{}),"оÑпÑавили СÐС на номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(x.phone)}})]}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{k(e)},errorText:x.hasCodeError?x.codeErrorText:"",value:x.code,onChange:e=>{R(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:x.isWork,onFocus:()=>{g({screen_type:"registration",screen_attributes_id:"megafon_otp",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"})}})}),x.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:x.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:G})]}),(0,a.jsx)(B.A,{value:x.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:onCaptchaChange,onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:x.hasCaptchaError,errorText:x.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}):null,(0,a.jsx)("div",{className:f().field,children:(0,a.jsx)(J.S,{checked:x.info,onChange:()=>{R(e=>{e.info=!e.info}),g({screen_type:"registration",screen_attributes_id:"megafon_otp",action_id:"click",element_type:"checkbox",element_attributes_id:"notifications",element_attributes_text:"Я ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а Ñакже на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
Ð´Ð»Ñ ÐµÑ Ð¾ÑпÑавки",action_result:!x.info,referer_screen_type:"login_registration",referer_screen_attributes_id:"megafon_otp"})},name:"notifications",id:"notifications",label:"Я ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а Ñакже на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
Ð´Ð»Ñ ÐµÑ Ð¾ÑпÑавки",dontShoot:!0})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:E,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>k(x.code),isLoading:x.isWork,isDisabled:x.isWork,className:f().button}),(0,a.jsx)("div",{className:h()(f().description,f().description_signUp,"mb32"),dangerouslySetInnerHTML:{__html:'<div>\n ÐÑодолжаÑ, Ð²Ñ Ð¿ÑинимаеÑе ÑÑловиÑ\n <a href="/legal/privacy_policy" target="_blank">ÐолиÑики конÑиденÑиалÑноÑÑи</a> и\n <a href="/legal/terms_of_use" target="_blank">ÐолÑзоваÑелÑÑкого ÑоглаÑениÑ</a>\n </div>'}}),(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode,"mt0"),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!I&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().small),children:(0,m.fU)(C)})]})]}),onClick:M,size:b.GO.SMALL,variant:b.Vt.SECONDARY,isDisabled:!I})})]})]})},MFPhone:e=>{var t;let{changeStep:r,setDto:s,dto:l}=e,_=(0,n.d4)(e=>{var t;return null===(t=e.registration)||void 0===t?void 0:t.authData}),u=c.Ay.useApiUrl(),p=c.Ay.useApiKey(),g=c.Ay.useClickHouseShoot(),E=c.Ay.useResponsiveButtonSize(),y=d.Rx.phone,[R,I]=(0,S.e)({emailOrPhone:"",hasEmailOrPhoneError:!1,emailOrPhoneErrorText:"",hasCaptcha:!1,captcha:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1,fieldType:"",firstEight:null,firstSeven:null}),N=()=>{let e=R.emailOrPhone,{noMaskValue:t}=P(e),r=/\+992\d{0,9}\D{0}/.test(t),a=/\+992\d{9}
1/.test(t)&&13===t.length,i=(R.firstEight||R.firstSeven?t[1]:t[0])!=="9",n=R.firstEight||R.firstSeven?"+7"+t.slice(1):"+7"+t,o=!1,s="";return e.length?(r||(0,x.OK)(n)&&12===n.length&&!i)&&(/\D/.test(t)||12===n.length)?r&&!a&&(o=!0,s=el.INCORRECT_TJ):(o=!0,s=el.INCORRECT_PHONE):(o=!0,s=el.EMPTY),o&&(I(e=>{e.hasEmailOrPhoneError=o,e.emailOrPhoneErrorText=s}),g({screen_type:"login_registration",screen_attributes_id:"login_registration_mf",action_id:"error",action_result:s,action_attributes_str:"",action_parameter:"authentication"})),{isFormValid:!o}},C=e=>{let{noMaskValue:t,skip:r,firstEight:a,firstSeven:i,force:n}=P(e);return((a||i?t.length>11:t.length>10)||/\D/.test(t)||!t.length)&&!n?{maskValue:t,fieldType:r?"phone":"email",firstEight:"boolean"==typeof a?a:R.firstEight,firstSeven:"boolean"==typeof i?i:R.firstSeven}:{maskValue:t.replace(a?"8":i?"7":/\+7/,"").replace(/\D/g,"").replace(/^(\d{0,3})(\d{0,3})(\d{0,2})(\d{0,2})$/,(e,t,r,a,i)=>"+7 (".concat(t).concat(r?") "+r:r).concat(a?" "+a:a).concat(i?" "+i:i)),fieldType:"phone",firstEight:a,firstSeven:i}},P=e=>{let{firstEight:t,firstSeven:r}=R;if(!/\D/.test(e)&&/\d/g.test(e)&&(/[7,8]/.test(e[0])?e.length<12:e.length<11))return{type:"phone",noMaskValue:e,firstEight:"8"===e[0],firstSeven:"7"===e[0]};if(/\+7\s\(\d{1,3}/.test(e)){let a=e.replace("+7","").replace(/\(/,"").replace(/\)/,"").replace(/\s/g,"");return{noMaskValue:t?"8"+a:r?"7"+a:a,type:"phone",firstEight:t,firstSeven:r}}if(/^\+7\s\(\D{1}$/.test(e)){let a=e.replace("+7","").replace(/\(/,"").replace(/\s/g,"");return{noMaskValue:t?"8"+a:r?"7"+a:a,type:"email",firstEight:t,firstSeven:r}}if(/^\+7\s\(\d{0}$/.test(e)&&!t&&!r)return{noMaskValue:"",type:"phone",skip:!0,firstEight:t,firstSeven:r};if(/^\+7\s\({0}$/.test(e))return{noMaskValue:"",type:"phone",skip:!0};if((/8/.test(e)&&!/\D/.test(e)||/^\+7\s{0}$/.test(e))&&e.length<3)return{noMaskValue:e.replace(/\+{0,1}\d/,"+7 ("),type:"phone",firstEight:/8/.test(e),firstSeven:/7/.test(e)};if(/\+\s{0,1}^9/.test(e))return{noMaskValue:e.replace(/\+/,"").replace(/(\d)/,"+7 ($1"),type:"phone",skip:!0};else if(/\+7\s\({0,1}\d{0}/.test(e)&&!t&&!r)return{noMaskValue:"",type:"phone"};else if(/\+7\d{2,10}/.test(e))return{noMaskValue:e.trim(),type:"phone",force:!0,firstSeven:!0,firstEight:!1};else return{noMaskValue:e.trim(),type:"email"}},j=e=>{R.emailOrPhone;let t=(null==e?void 0:e.provider)==="telegram",a="string"==typeof(null==e?void 0:e.email)?e.email:"",i=(null==e?void 0:e.provider)==="email"&&a,n=i?d.RZ.EMAIL_OTP_BY_PHONE:t?d.RZ.OTP_TELEGRAM_V2:d.RZ.PHONE_OTP_V2;s(e=>({...e,authMethod:d.bh.PHONE,...i&&{loginData:{...e.loginData||{},providerEmail:a},emailOtpByPhoneReferer:"by_phone"}}));let l=new Date;l.setTime(l.getTime()+18e4),(0,o.TV)("showSubscribeNotifyPopupDelay","true",{expires:l}),r(n)},w=(e,t,a)=>{let i=a&&a.code&&d.pO.includes(a.code);if(a&&a.code&&d.jb.includes(a.code)){s(e=>{var t;return{...e,limitExpiredTime:null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.expired}}),r(d.RZ.LIMIT_ERROR);return}I(t=>{if(i){var n,o;let t=null==a?void 0:null===(n=a.data)||void 0===n?void 0:n.captcha,i=null==a?void 0:null===(o=a.data)||void 0===o?void 0:o.key,l={phone:R.emailOrPhone,providers:["telegram","sms","email"]};s(r=>({...r,challenge:{type:"captcha",endpoint:e,payload:{...l},nextStep:d.RZ.PHONE_OTP_V2,fromStep:d.RZ.MFPhone,captcha:{src:t,key:i},referer_screen_type:"",referer_screen_attributes_id:""}})),r(d.RZ.CAPTCHA)}else t.hasEmailOrPhoneError=!0,t.emailOrPhoneErrorText=d.Sr[null==a?void 0:a.code]||d._R[null==a?void 0:a.code]||d._R[null==a?void 0:a.message]||d.Sr[null==a?void 0:a.message]||"ЧÑо-Ñо поÑло не Ñак..."}),g({screen_type:"login_registration",screen_attributes_id:"login_registration_mf",action_id:"error",action_attributes_str:e,action_parameter:"authentication"})},k=async()=>{let{isFormValid:e}=N();if(e&&!R.hasCaptchaError){let e=R.emailOrPhone;s(t=>({...t,loginData:{type:d.bh.PHONE,emailOrPhone:e}})),I(e=>{e.isWork=!0});let t="".concat(u).concat(T.PI.phoneAuthOTP).concat(p);try{let r=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({phone:e,providers:["telegram","sms","email"]})}),a=await r.json();r.status<400?j(a):w(t,r,a)}catch(e){w(t)}finally{I(e=>{e.isWork=!1})}}g({screen_type:"login_registration",screen_attributes_id:"login_registration_mf",action_id:"click",
1screen_attributes_ab_tag:(null==_?void 0:_.tags)||"",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ"})};return(0,i.useEffect)(()=>{s(e=>({...e,authEntryStep:d.RZ.MFPhone,clickHouse:{attributesId:"login_registration_mf"}})),g({screen_type:"login_registration",screen_attributes_id:"login_registration_mf",action_id:"screenview",screen_attributes_ab_tag:(null==_?void 0:_.tags)||""})},[]),(0,i.useEffect)(()=>{var e,t;if(null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.emailOrPhone){let{maskValue:e,fieldType:r,firstEight:a,firstSeven:i}=C(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone);I(t=>{t.emailOrPhone=e,t.hasEmailOrPhoneError=!1,t.emailOrPhoneErrorText="",t.fieldType=r,t.firstEight=a,t.firstSeven=i})}},[null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од / РегиÑÑÑаÑиÑ",description:"ÐÐ°Ñ Ð¶Ð´ÑÑ 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑÐ¸Ð°Ð»Ñ Ð¸ мÑлÑÑÑилÑмÑ, 200+ Ñелеканалов, безопаÑнÑй деÑÑкий пÑоÑÐ¸Ð»Ñ Ð¸ ÑкÑклÑзивнÑе маÑеÑÐ¸Ð°Ð»Ñ Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,k),children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"ÐойÑи или заÑегиÑÑÑиÑоваÑÑÑÑ"}),(0,a.jsx)("div",{className:h()(f().notice,f().notice_mfPhone),children:"Ðо номеÑÑ ÐегаФона"}),(0,a.jsx)(A,{name:"login",type:O.TEXT,value:R.emailOrPhone,disabled:R.isWork,onChange:e=>{let{maskValue:t,fieldType:r,firstEight:a,firstSeven:i}=C(e.replace(/[^\d+()\s]/g,""));I(e=>{e.emailOrPhone=t,e.hasEmailOrPhoneError=!1,e.emailOrPhoneErrorText="",e.fieldType=r,e.firstEight=a,e.firstSeven=i})},onBlur:()=>{g({screen_type:"login_registration",screen_attributes_id:"login_registration_mf",action_id:"text_input",action_parameter:R.emailOrPhone,element_type:"input",element_attributes_id:d.Rx.phone,element_attributes_text:"ÐведиÑе ÑелеÑон"})},onFocus:()=>{g({screen_type:"login_registration",screen_attributes_id:"login_registration_mf",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:d.Rx.phone,element_attributes_text:"ÐведиÑе ÑелеÑон"})},label:"ÐведиÑе ÑелеÑон",placeholder:"+7 XXX XXX XX XX",hasError:R.hasEmailOrPhoneError,errorText:R.emailOrPhoneErrorText,loginMethod:y}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:E,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:k,isLoading:R.isWork,isDisabled:R.isWork,className:h()(f().button,f().button_mb12,f().button_mt12)})]})]})},ShowMore:e=>{let{dto:t,setDto:r,changeStep:n}=e,o=c.Ay.useClickHouseShoot();return(0,i.useEffect)(()=>{r(e=>({...e,clickHouse:{referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"}})),o({screen_type:d.sv.LOGIN,screen_attributes_id:"external",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START РегиÑÑÑаÑиÑ",description:"ÐолÑÑиÑе 7 дней беÑплаÑно. ÐÐ°Ñ Ð¶Ð´ÑÑ 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑÐ¸Ð°Ð»Ñ Ð¸ мÑлÑÑÑилÑмÑ, 200+ Ñелеканалов и ÑкÑклÑзивнÑе маÑеÑÐ¸Ð°Ð»Ñ Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:f().container,children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"ÐойÑи ÑеÑез внеÑние ÑеÑвиÑÑ"}),(0,a.jsx)("div",{className:h()(f().description,f().description_showMore),children:"С\xa01\xa0ÑнваÑÑ 2025\xa0г. вÑ
од ÑеÑез\xa0иноÑÑÑаннÑе ÑеÑвиÑÑ Ð·Ð°Ð¿ÑеÑÑн на\xa0ÑеÑÑиÑоÑии РФ. ÐÑбеÑиÑе дÑÑгой ÑпоÑоб вÑ
ода или\xa0обÑаÑиÑеÑÑ Ð²\xa0поддеÑжкÑ"}),(0,a.jsxs)("div",{className:f().buttons,children:[(0,a.jsx)("div",{children:(0,a.jsx)(V.Apple,{dto:t,setDto:r,changeStep:n,disabled:!0})}),(0,a.jsx)("div",{onClick:()=>o({screen_type:d.sv.LOGIN,screen_attributes_id:"external",action_id:"click",element_type:"button",element_attributes_id:"auth_google",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"}),children:(0,a.jsx)(V.Google,{dto:t,setDto:r,changeStep:n,disabled:!0})})]})]})]})},Success:e=>{var t,r,n,s,l,_;let{dto:u,changeStep:p}=e,g=(0,y.A)({onUpgradeLite:()=>
1p(d.RZ.UPGRADE_LITE)}),E=c.Ay.useClickHouseShoot();(0,i.useEffect)(()=>{(null==u?void 0:u.authMethod)!==d.bh.EMAIL&&sessionStorage.setItem(x.kF,"true");let e=setTimeout(()=>{u&&u.userProfileData&&g(u.userProfileData)},300);return()=>{clearTimeout(e)}},[]),(0,i.useEffect)(()=>{var e,t;(0,o.TV)("fromAuthPage",!0),"landing_PBNasledie"===(0,m.Ri)("utm_source")&&((0,m.zs)("utm_source"),window.location.href="https://belogorye.start.ru/census/"),"kolobcoin"===(0,m.Ri)("utm_source")&&((0,m.zs)("utm_source"),window.location.href="https://kolobcoin.start.ru"),"kiosk"===(0,m.Ri)("utm_source")&&"podpiska"!==(0,m.Ri)("utm_medium")&&((0,m.zs)("utm_source"),window.location.href="https://kiosk.start.ru"),E({screen_type:u.authType&&u.authType===d.tG.REGISTER?d.sv.REGISTRATION:d.sv.LOGIN,screen_attributes_id:u.authType&&u.authType===d.tG.RECOVERY?"recover_password_success":"success",action_id:"screenview",referer_screen_type:null==u?void 0:null===(e=u.clickHouse)||void 0===e?void 0:e.refererScreenType,referer_screen_attributes_id:null==u?void 0:null===(t=u.clickHouse)||void 0===t?void 0:t.refererScreenAttributesId})},[]);let b=(null==u?void 0:u.authMethod)===d.bh.PHONE?(null==u?void 0:null===(t=u.userProfileData)||void 0===t?void 0:t.phone)||(null==u?void 0:null===(r=u.loginData)||void 0===r?void 0:r.phone)||(null==u?void 0:null===(n=u.loginData)||void 0===n?void 0:n.emailOrPhone):(null==u?void 0:null===(s=u.userProfileData)||void 0===s?void 0:s.email)||(null==u?void 0:null===(l=u.loginData)||void 0===l?void 0:l.email)||(null==u?void 0:null===(_=u.loginData)||void 0===_?void 0:_.emailOrPhone);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:h()(f().container,f().container_success),children:[(0,a.jsx)("img",{className:f().successIcon,src:"/static/images/auth/successIcon.svg",alt:"УÑпеÑ
"}),u&&u.authType&&u.authType!==d.tG.RECOVERY?(0,a.jsxs)("div",{className:h()(f().title,f().title_success),children:["ÐÑ ",u&&u.authType&&(e=>{switch(e){case d.tG.REGISTER:return"заÑегиÑÑÑиÑованÑ";case d.tG.LOGIN:default:return"воÑли"}})(u.authType)]}):(0,a.jsx)("div",{className:h()(f().title,f().title_success),children:"ÐаÑÐ¾Ð»Ñ ÑÑпеÑно изменÑн"}),(0,a.jsx)("div",{className:f().login,children:b&&(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:b}})})]})]})},PasswordRecovery:e=>{let{changeStep:t,setDto:r,dto:o}=e,{startDeviceId:s}=(0,n.d4)(e=>e.systemInformation),_=c.Ay.useClickHouseShoot(),u=c.Ay.useApiUrl(),p=c.Ay.useApiKey(),g=c.Ay.useResponsiveButtonSize(),[m,E]=(0,i.useState)(""),[y,S]=(0,i.useState)(!1);(0,i.useEffect)(()=>{var e;_({screen_type:"login",screen_attributes_id:"recover_password",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:o&&(null===(e=o.loginData)||void 0===e?void 0:e.type)})},[]);let x=e=>{S(!1),(null==e?void 0:e.code)==="USER_NOT_FOUND"?(null==e?void 0:e.message)==="User with this phone is not found"?E("ÐÐ¾Ð¼ÐµÑ Ð½Ðµ заÑегиÑÑÑиÑован. ÐведиÑе поÑÑÑ Ð¸Ð»Ð¸ пÑовеÑÑÑе, пÑавилÑно ли введен номеÑ"):l().push("/password/code"):(null==e?void 0:e.message)==="User not found"?E("ÐоÑÑа не заÑегиÑÑÑиÑована. ÐведиÑе Ð½Ð¾Ð¼ÐµÑ ÑелеÑона или пÑовеÑÑÑе, пÑавилÑно ли ввели поÑÑÑ"):E("ЧÑо-Ñо поÑло не Ñак...")},R=async()=>{fetch("".concat(u).concat(T.PI.passwordPhoneReset).concat(p),{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_id:s,device_type:"web",client_platform:"start",phone:o.loginData.emailOrPhone})}).then(e=>{e.status<400?(localStorage.setItem("phone",o.loginData.emailOrPhone),t(d.RZ.PASSWORD_RECOVERY_CODE),r(e=>({...e,authType:(null==o?void 0:o.authType)===d.tG.RECOVERY_FROM_SETTINGS?d.tG.RECOVERY_FROM_SETTINGS:d.tG.RECOVERY}))):e.json().then(x)}).catch(e=>x(e)).finally(()=>S(!1))},I=async()=>
1{fetch("".concat(u).concat(T.PI.passwordReset).concat(p),{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_id:s,device_type:"web",client_platform:"start",email:o.loginData.emailOrPhone})}).then(e=>{e.status<400?(localStorage.setItem("phone",o.loginData.emailOrPhone),t(d.RZ.PASSWORD_RECOVERY_INSTRUCTION_SENT_SCREEN),r(e=>({...e,authType:(null==o?void 0:o.authType)===d.tG.RECOVERY_FROM_SETTINGS?d.tG.RECOVERY_FROM_SETTINGS:d.tG.RECOVERY}))):e.json().then(x)}).catch(e=>x(e)).finally(()=>S(!1))},O=async()=>{var e;switch(S(!0),_({screen_type:"login",screen_attributes_id:"recover_password",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login",referer_screen_attributes_id:o&&(null===(e=o.loginData)||void 0===e?void 0:e.type)}),o&&o.loginData&&o.loginData.type){case d.bh.EMAIL:await I();break;case d.bh.PHONE:await R()}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"СбÑÐ¾Ñ Ð¿Ð°ÑолÑ",description:"Ðа данной ÑÑÑаниÑе Ð²Ñ ÑможеÑе ÑбÑоÑиÑÑ Ð¿Ð°ÑÐ¾Ð»Ñ Ð¾Ñ Ð°ÐºÐºÐ°ÑнÑа онлайн киноÑеаÑÑа START"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&O()},children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"ÐоÑÑÑановление паÑолÑ"}),(0,a.jsx)("div",{className:f().forgotDescription,children:o&&o.loginData&&"email"===o.loginData.type?(0,a.jsxs)(a.Fragment,{children:["ÐÑпÑавим инÑÑÑÑкÑÐ¸Ñ Ð´Ð»Ñ Ð²Ð¾ÑÑÑановлениÑ",(0,a.jsx)("br",{}),"на поÑÑÑ"]}):(0,a.jsxs)(a.Fragment,{children:["ÐÑпÑавим код Ð´Ð»Ñ Ð²Ð¾ÑÑÑановлениÑ",(0,a.jsx)("br",{}),"на ÑелеÑон"]})}),(0,a.jsx)("div",{className:f().login,children:o&&o.loginData&&(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:o.loginData.emailOrPhone}})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",variant:b.Vt.PRIMARY,size:g,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:O,isDisabled:y,isLoading:y,className:h()(f().button,f().button_clear)}),m&&(0,a.jsx)("div",{className:f().customError,children:m}),(null==o?void 0:o.authType)!==d.tG.RECOVERY_FROM_SETTINGS&&(0,a.jsx)(b.$n,{className:h()(f().description),title:"ÐойÑи дÑÑгим ÑпоÑобом",onClick:()=>{var e;_({screen_type:"login",screen_attributes_id:"recover_password",action_id:"click",element_type:"link",element_attributes_id:"another_method_login",element_attributes_text:"ÐойÑи дÑÑгим ÑпоÑобом",referer_screen_type:"login",referer_screen_attributes_id:o&&(null===(e=o.loginData)||void 0===e?void 0:e.type)}),t(d.RZ.CORE)},size:b.GO.SMALL,variant:b.Vt.SECONDARY})]})]})},PasswordRecoveryCode:e=>{var t;let{changeStep:r,setDto:n,dto:s,isBackBtnClick:l}=e,_=c.Ay.useApiUrl(),u=c.Ay.useApiKey(),p=c.Ay.useClickHouseShoot(),g=c.Ay.useResponsiveButtonSize(),[v,E]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1}),[y,x]=(0,i.useState)(""),[R,I]=(0,i.useState)(d.xS),[O,A]=(0,i.useState)(!0),[N,C]=(0,i.useState)(!0),P=()=>{w(),p({screen_type:"login",screen_attributes_id:"recover_password_code",action_id:"text_input",action_parameter:v.hasCodeError?"invalid":"valid",element_type:"input",element_attributes_id:"code",element_attributes_text:"Ðод из СÐС",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"})},j=()=>{let{password:e}=v;E(t=>{t.hasPasswordError=e.length<6,t.passwordErrorText=e.length<6?"ÐинимÑм 6 Ñимволов. Такие пÑавила":""}),p({screen_type:"login",screen_attributes_id:"recover_password_code",action_id:"text_input",action_parameter:v.hasPasswordError?"invalid":"valid",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐведиÑе новÑй паÑолÑ",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"})},w=()=>{let e=v.code,t="",r=!1;return e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ",x("ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ")):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС",x("ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС")),E(e=>{e.hasCodeError=r,e.codeErrorText=t}),!r},k=async()=>{let{code:e,password:t}=v;if(p({screen_type:"login",screen_attributes_id:"recover_password_code",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"}),P(),j(),!e||e.length<6||!t||t.length<6)return;E(e=>{e.isWork=!0});let a="".concat(_).concat(T.PI.phonePasswordConfirm).concat(u),i={phone:localStorage.getItem("phone"),code:e,password:btoa(unescape(encodeURIComponent(t)))};try{let e=await fetch(a,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(e.status<400){let t=await e.json();localStorage.removeItem("phone"),r(d.RZ.SUCCESS),n(e=>({...e,authType:d.tG.RECOVERY,userProfileData:t}))}else{let t=await e.json(),a=t&&t.code&&d.jb.includes(t.code),i=(null==t?void 0:t.code)==="CODE_NOT_FOUND";if(!a&&!i){r(d.RZ.ERROR);return}E(e=>{e.isWork=!1,e.hasCodeError=!0,e.codeErrorText=d._R[null==t?void 0:t.code]||(null==t?void 0:t.message)||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."})}}catch(e){E(e=>{e.isWork=!1,e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи оÑпÑавке запÑоÑа"})}},L=async()=>{C(!1),A(!0),I(d.xS),p({screen_type:"login",screen_attributes_id:"recover_password_code",action_id:"click",element_type:"link",element_attributes_id:"resend_sms",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"});let e="".concat(_).concat(T.PI.passwordPhoneReset).concat(u),t={phone:s&&s.loginData&&s.loginData.emailOrPhone};try{let r=await fetch(e,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(r.status>=400){let e=await r.json();E(t=>{t.hasCodeError=!0,t.codeErrorText=d._R[null==e?void 0:e.code]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."}),x(d._R[null==e?void 0:e.code]||(null==e?void 0:e.message)||"ЧÑо-Ñо поÑло не Ñак..."),C(!0),A(!1)}}catch(e){console.error("Error requesting new code:",e),C(!0),A(!1),E(e=>{e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"}),x("ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода")}};return(0,i.useEffect)(()=>{let e=null;return O&&R>0?e=setInterval(()=>{I(e=>e-1)},1e3):0===R&&(A(!1),C(!0)),()=>clearInterval(e)},[O,R]),(0,i.useEffect)(()=>{A(!0),C(!1),n(e=>({...e,clickHouse:{refererScreenType:"login",refererScreenAttributesId:"recover_password_code"}})),p({screen_type:"login",screen_attributes_id:"recover_password_code",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"})},[]),(0,a.jsxs)("div",{className:f().container,children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из СÐС,",(0,a.jsx)("br",{}),"оÑпÑавили на номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(null==s?void 0:null===(t=s.loginData)||void 0===t?void 0:t.emailOrPhone)}})]}),(0,a.jsx)("div",{className:f().localInputPlain,onBlur:l?()=>{}:()=>{setTimeout(()=>{P()},200)},children:(0,a.jsx)(B.A,{hint:!0,darkTheme:!0,value:v.code,label:"Ðод из СÐС",onChange:e=>{let t=e.target.value;E(e=>{e.code=t,e.hasCodeError=!1,e.codeErrorText=""})},onValidate:()=>{},preventOnBlur:!0,onFocus:()=>{p({screen_type:"login",screen_attributes_id:"recover_password_code",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"Ðод из СÐС",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"})},id:"sms-code",maxLength:"6",type:"text",error:v.hasCodeError,errorText:v.codeErrorText,needActionResult:!0,alwaysPlaceholder:!0,placeholder:"000000",noShoot:!0})}),(0,a.jsx)("div",{className:f().localInputPlain,onBlur:l?()=>{}:()=>{setTimeout(()=>{j()},200)},children:(0,a.jsx)(B.A,{value:v.password,label:"ÐовÑй паÑолÑ",onChange:e=>{let t=e.target.value;t.length<d.qo&&E(e=>{e.password=t||"",e.hasPasswordError=!1,e.passwordErrorText=""})},onValidate:()=>{},preventOnBlur:!0,onFocus:()=>{p({screen_type:"password_recovery",screen_attributes_id:"code_sms",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐведиÑе новÑй паÑолÑ",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"})},id:"password",maxLength:"50",type:"password",error:v.hasPasswordError,errorText:v.passwordErrorText,canHidePassword:!0,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ÐинимÑм 6 Ñимволов",onClickHouseShoot:p,noShoot:!0})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:g,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:k,isLoading:v.isWork,isDisabled:v.isWork,className:f().button}),(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!N&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().small),children:(0,m.fU)(R)})]})]}),onClick:L,size:b.GO.SMALL,variant:b.Vt.SECONDARY,isDisabled:!N})})]})}
1,PasswordRecoveryNewPassword:e=>{let{changeStep:t,setDto:r,dto:o,isBackBtnClick:s}=e,l=c.Ay.useApiUrl(),_=c.Ay.useApiKey(),u=c.Ay.useResponsiveButtonSize(),p=(0,n.d4)(e=>e.systemInformation.clickHouseData),g=c.Ay.useClickHouseShoot(),m=o&&o.token||"",[E,y]=(0,S.e)({emailOrPhone:"",emailOrPhoneType:void 0,password:"",hasPasswordError:!1,passwordErrorText:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",agreement:!1,agreementTextError:"",hasAgreementError:!1,info:!1,isWork:!1});(0,i.useEffect)(()=>{r(e=>({...e,clickHouse:{refererScreenType:d.sv.LOGIN,refererScreenAttributesId:"recover_password_new"}})),g({screen_type:d.sv.LOGIN,screen_attributes_id:"recover_password_new",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:"recover_password_mail"})},[]);let x=()=>{let{password:e}=E;g({...p,action_id:"click",element_type:"button",screen_type:"login",screen_attributes_id:"recover_password_new",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login",referer_screen_attributes_id:"recover_password_mail"}),!E.isWork&&R()&&(y(e=>{e.isWork=!0}),fetch("".concat(l).concat(T.PI.passwordConfirm).concat(_),{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reset_token:m,password:btoa(unescape(encodeURIComponent(e)))})}).then(e=>{e.status<400?e.json().then(e=>{t(d.RZ.SUCCESS),r(t=>({...t,authType:d.tG.RECOVERY,userProfileData:e}))}):(t(d.RZ.ERROR),y(e=>{e.isWork=!1}))}))},R=()=>{let e=E.password,t=!1,r="";return e.length<d.AG&&(t=!0,r=d.Sr.MIN_PASSWORD_LENGTH),y(e=>{e.hasPasswordError=t,e.passwordErrorText=r}),!t},I=()=>{g({screen_type:"login",screen_attributes_id:"recover_password_new",action_id:"text_input",action_parameter:R()?"valid":"invalid",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐведиÑе паÑолÑ",referer_screen_type:"login",referer_screen_attributes_id:"recover_password_mail"})};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"СбÑÐ¾Ñ Ð¿Ð°ÑолÑ",description:"Ðа данной ÑÑÑаниÑе Ð²Ñ ÑможеÑе ÑбÑоÑиÑÑ Ð¿Ð°ÑÐ¾Ð»Ñ Ð¾Ñ Ð°ÐºÐºÐ°ÑнÑа онлайн киноÑеаÑÑа START"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&x()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["СбÑоÑили паÑолÑ. ",(0,a.jsx)("br",{})," ÐÑидÑмайÑе новÑй"]}),(0,a.jsx)("div",{className:f().localInputPlain,onBlur:s?()=>{}:()=>{setTimeout(()=>{I()},200)},children:(0,a.jsx)(B.A,{value:E.password,label:"ÐÑидÑмайÑе паÑолÑ",onChange:e=>{let t=e.target.value;t.length<d.qo&&y(e=>{e.password=t||"",e.hasPasswordError=!1,e.passwordErrorText=""})},preventOnBlur:!0,onFocus:()=>{g({screen_type:"login",screen_attributes_id:"recover_password_new",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐведиÑе паÑолÑ",referer_screen_type:"login",referer_screen_attributes_id:"recover_password_mail"})},onValidate:()=>{},id:"password",maxLength:"50",type:"password",error:E.hasPasswordError,errorText:E.passwordErrorText,onClickHouseShoot:g,canHidePassword:!0,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ÐинимÑм 6 Ñимволов",noShoot:!0})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",variant:b.Vt.PRIMARY,size:u,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:x,isLoading:E.isWork,isDisabled:E.isWork,className:h()(f().button,f().button_clear)})]})]})},PasswordRecoveryInstructionSentScreen:e=>{let{changeStep:t,dto:r}=e,n=c.Ay.useClickHouseShoot(),o=c.Ay.useResponsiveButtonSize();(0,i.useEffect)(()=>{n({screen_type:"login",screen_attributes_id:"recover_password_mail",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"})},[]);let s=()=>{n({screen_type:"login",screen_attributes_id:"recover_password_mail",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login",referer_screen_attributes_id:"recover_password"}),t(d.RZ.CORE)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"СбÑÐ¾Ñ Ð¿Ð°ÑолÑ",description:"Ðа данной ÑÑÑаниÑе Ð²Ñ ÑможеÑе ÑбÑоÑиÑÑ Ð¿Ð°ÑÐ¾Ð»Ñ Ð¾Ñ Ð°ÐºÐºÐ°ÑнÑа онлайн киноÑеаÑÑа START"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&s()},children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"ÐÑпÑавили инÑÑÑÑкÑÐ¸Ñ Ð½Ð° поÑÑÑ"}),(0,a.jsx)("div",{className:f().login,children:r&&r.loginData&&(0,a.jsx)("div",{className:h()(f().loginValue,f().loginValue_instructionSent),dangerouslySetInnerHTML:{__html:r.loginData.emailOrPhone}})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"forgot_next_button",variant:b.Vt.PRIMARY,size:o,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>(null==r?void 0:r.authType)===d.tG.RECOVERY_FROM_SETTINGS?l().push("/account"):s(),className:f().button})]})]})},ForceLoginWithPhone:e=>{let{dto:t,changeStep:r,setDto:n}=e,o=c.Ay.useClickHouseShoot(),s=c.Ay.useResponsiveButtonSize();return(0,i.useEffect)(()=>{n(e=>({...e,clickHouse:{attributesId:(null==t?void 0:t.authType)===d.tG.GOOGLE?"google_id_auth":"apple_id_auth",refererScreenType:d.sv.LOGIN,referer_screen_attributes_id:"external"}})),o({screen_type:"login_registration",screen_attributes_id:(null==t?void 0:t.authType)===d.tG.GOOGLE?"google_id_auth":"apple_id_auth",action_id:"screenview",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START РегиÑÑÑаÑиÑ",description:"ÐолÑÑиÑе 7 дней беÑплаÑно. Ð
1Ð°Ñ Ð¶Ð´ÑÑ 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑÐ¸Ð°Ð»Ñ Ð¸ мÑлÑÑÑилÑмÑ, 200+ Ñелеканалов и ÑкÑклÑзивнÑе маÑеÑÐ¸Ð°Ð»Ñ Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:h()(f().container,f().container_stickToBottom),children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐÐ»Ñ ÑÑого ",(null==t?void 0:t.authType)===d.tG.GOOGLE?"Google аккаÑнÑа":"Apple ID"," иÑполÑзÑйÑе вÑ
од по номеÑÑ ÑелеÑона"]}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:s,title:"ÐойÑи по номеÑÑ",fullWidth:!0,onClick:()=>{o({screen_type:"login_registration",screen_attributes_id:(null==t?void 0:t.authType)===d.tG.GOOGLE?"google_id_auth":"apple_id_auth",action_id:"click",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external",element_type:"button",element_attributes_id:"sign_in",element_attributes_text:"ÐойÑи по номеÑÑ"}),r(d.RZ.CORE)},className:f().button})]})]})},SocialRegisterUnavailable:e=>{let{changeStep:t,dto:r,setDto:n}=e,o=c.Ay.useClickHouseShoot(),s=c.Ay.useResponsiveButtonSize();return(0,i.useEffect)(()=>{n(e=>({...e,clickHouse:{attributesId:(null==r?void 0:r.authType)===d.tG.GOOGLE?"google_id_signup":"apple_id_signup",refererScreenType:d.sv.LOGIN,referer_screen_attributes_id:"external"}})),o({screen_type:"login_registration",screen_attributes_id:(null==r?void 0:r.authType)===d.tG.GOOGLE?"google_id_signup":"apple_id_signup",action_id:"screenview",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START РегиÑÑÑаÑиÑ",description:"ÐолÑÑиÑе 7 дней беÑплаÑно. ÐÐ°Ñ Ð¶Ð´ÑÑ 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑÐ¸Ð°Ð»Ñ Ð¸ мÑлÑÑÑилÑмÑ, 200+ Ñелеканалов и ÑкÑклÑзивнÑе маÑеÑÐ¸Ð°Ð»Ñ Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:f().container,children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["РегиÑÑÑаÑÐ¸Ñ ",(0,a.jsx)("br",{})," ÑеÑез иноÑÑÑаннÑе ÑеÑвиÑÑ Ð±Ð¾Ð»ÑÑе недоÑÑÑпна"]}),(0,a.jsx)("div",{className:h()(f().description,f().description_regUnavailable),children:"ÐаÑегиÑÑÑиÑÑйÑеÑÑ Ð¸Ð»Ð¸ войдиÑе дÑÑгим ÑпоÑобом"}),(0,a.jsx)(b.$n,{variant:b.Vt.SECONDARY,size:s,title:"ÐойÑи дÑÑгим ÑпоÑобом",fullWidth:!0,onClick:()=>{o({screen_type:"login_registration",screen_attributes_id:(null==r?void 0:r.authType)===d.tG.GOOGLE?"google_id_signup":"apple_id_signup",action_id:"click",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external",element_type:"button",element_attributes_id:"auth_another_method",element_attributes_text:"ÐойÑи дÑÑгим ÑпоÑобом"}),t(d.RZ.CORE)},className:f().button})]})]})},SocialCollectCreds:e=>{let{changeStep:t,setDto:r,isBackBtnClick:n,animationComplete:s}=e,_=c.Ay.useApiUrl(),{clientApiQuery:u,clientApiKey:p}=c.Ay.useApiClientKey(),g=c.Ay.useClickHouseShoot(),E=c.Ay.useResponsiveButtonSize(),[y,x]=(0,i.useState)(!1),[R,I]=(0,i.useState)(null),[O,A]=(0,i.useState)(null),[N,C]=(0,S.e)({emailOrPhone:"",emailOrPhoneType:void 0,password:"",hasPasswordError:!1,passwordErrorText:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",agreement:!1,agreementTextError:"",hasAgreementError:!1,info:!1,isWork:!1,phone:"",phoneIsEmpty:!1,phoneError:!1,phoneErrorMsg:null}),P=(0,i.useRef)(null);(0,i.useEffect)(()=>{s&&P.current&&setTimeout(()=>{P.current.focus()},200)},[s]),(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=O-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),I("00:00");else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");I("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[O]);let j=()=>{let e=N.password,t=!1,r="";return e.length<d.AG&&(t=!0,r=d.Sr.MIN_PASSWORD_LENGTH),C(e=>{e.hasPasswordError=t,e.passwordErrorText=r}),!t},w=()=>{let e=!0;return j()||(e=!1),e},k=()=>{g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"text_input",action_parameter:j()?"valid":"invalid",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐÑидÑмайÑе паÑолÑ",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},L=()=>{g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"text_input",action_parameter:N.phone,element_type:"input",element_attributes_id:"phone",element_attributes_text:"ÐведиÑе ÑелеÑон",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},D=async()=>
1{if(g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"click",element_type:"button",element_attributes_id:"request_captcha",element_attributes_text:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"}),!N.hasCaptcha||!N.captchaImg)return;let e=new URL(N.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?C(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await V()},M=async()=>{let e="".concat(_).concat(T.PI.phoneSetV2).concat(u),a=(0,o.jW)(N.phone),i=N.password,n=N.phone,s={phone:n,password:window.btoa(unescape(encodeURIComponent(i))),...N.hasCaptcha&&{key:N.captchaKey,captcha:N.captcha}};C(e=>{e.isWork=!0});try{let o=await fetch(e,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),l=await o.json();o.status<400?(t(d.RZ.CONFIRM_SOCIAL_PHONE_CODE),r(e=>({...e,authType:d.tG.REGISTER,loginData:{phone:n,loginValue:a,password:window.btoa(unescape(encodeURIComponent(i))),type:"social"},userProfileData:l}))):(g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:l&&d.pO.includes(l.code)?"error_captcha":"error",action_result:d.Sr[l.code]||d.Sr[l.message]||l.message||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:e,...l&&!d.pO.includes(l.code)&&{action_parameter:"registration"},referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"}),G(l))}catch(e){G()}finally{C(e=>{e.isWork=!1})}},G=e=>{let t=e&&e.code&&d.pO.includes(e.code);if(e&&e.code&&d.jb.includes(e.code)){var r;A(null==e?void 0:null===(r=e.data)||void 0===r?void 0:r.expired),x(!0);return}C(r=>{if(t){let t=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;r.hasCaptcha=!0,r.captcha="",r.captchaImg=t?"".concat(_).concat(t,"&apikey=").concat(p,"&v=").concat(Math.random()):"",r.captchaKey=a,r.hasCaptchaError=!0,r.captchaErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."}else d.Sr[null==e?void 0:e.code]===d.Sr.PHONE_ALREADY_USED||d.Sr[null==e?void 0:e.code]===d.Sr.USER_PHONE_EXISTS||d.Sr[null==e?void 0:e.code]===d.Sr.INVALID_PHONE?(r.phoneError=!0,r.phoneErrorMsg=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."):(r.hasPasswordError=!0,r.passwordErrorText=d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак...")})},W=e=>/^\+7 9\d{2} \d{3}-\d{2}-\d{2}$/.test(e),V=async()=>{if(g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"}),!W(N.phone)){C(e=>{e.phoneError=!0,e.phoneErrorMsg="ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +7 900 000 00 00"});return}if(!N.phone){C(e=>{e.phoneError=!0,e.phoneErrorMsg=d.Sr.PHONE_EMPTY});return}w()&&(C(e=>{e.isWork=!0}),await M())};return(0,i.useEffect)(()=>{g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"screenview",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,V),children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"ÐобавÑÑе новÑй ÑпоÑоб вÑ
ода"}),(0,a.jsx)("div",{className:h()(f().description,f().description_socialCreds),children:"ÐбÑзаÑелÑное ÑÑловие длÑ\xa0полÑзоваÑелей Apple\xa0ID и\xa0Google на\xa0ÑеÑÑиÑоÑии РФ"}),(0,a.jsx)("div",{className:f().socialCreds,onBlur:n?()=>{}:()=>{setTimeout(()=>{L()},200)},children:(0,a.jsx)(B.A,{inputRef:P,value:N.phone,label:"ÐведиÑе ÑелеÑон",onChange:e=>{C(t=>{t.phone=e.target.value,t.phoneIsEmpty=!1,t.phoneErrorMsg="",t.phoneError=!1})},onValidate:e=>{C(t=>
1{t.phoneError=!e,t.phoneErrorMsg=!e&&N.phone.length?"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +7 900 000 00 00":"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи Ð½Ð¾Ð¼ÐµÑ ÑелеÑона"}),e||g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"error",action_result:!e&&N.phone.length?"ÐведиÑе Ð½Ð¾Ð¼ÐµÑ Ð² ÑоÑмаÑе +7 900 000 00 00":"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи Ð½Ð¾Ð¼ÐµÑ ÑелеÑона",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},id:"phone",type:"tel",validationType:"text",error:N.phoneIsEmpty||N.phoneError,errorText:N.phoneErrorMsg,testid:"megafon_signup_phone",autoComplete:"off",blokInfo:{screen_type:"login",screen_attributes_id:"add_new_login_to_apple_google"},darkTheme:!0,placeholder:"+7 ХХХ ХХХ ХХ ХХ",onFocus:()=>{g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"phone",element_attributes_text:"ÐведиÑе ÑелеÑон",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},preventOnBlur:!0,noShoot:!0})}),(0,a.jsx)("div",{className:f().megafonField,onBlur:n?()=>{}:()=>{setTimeout(()=>{k()},200)},children:(0,a.jsx)(B.A,{inputRef:P,value:N.password,label:"ÐÑидÑмайÑе паÑолÑ",onChange:e=>{let t=e.target.value;t.length<d.qo&&C(e=>{e.password=t||"",e.hasPasswordError=!1,e.passwordErrorText=""})},preventOnBlur:!0,onFocus:()=>{g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"password",element_attributes_text:"ÐÑидÑмайÑе паÑолÑ",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},onValidate:()=>{},id:"password",maxLength:"50",type:"password",error:N.hasPasswordError,errorText:N.passwordErrorText,canHidePassword:!0,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ÐинимÑм 6 Ñимволов",onClickHouseShoot:g,blokInfo:{screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google"},screenType:"login_registration",reserveScreenAttributesId:"add_new_login_to_apple_google",noShoot:!0})}),N.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:N.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:D})]}),(0,a.jsx)(B.A,{value:N.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;C(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onBlur:()=>{g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"text_input",action_parameter:"valid",element_type:"input",element_attributes_id:"captcha",element_attributes_text:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},onFocus:()=>{g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"captcha",element_attributes_text:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:N.hasCaptchaError,errorText:N.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки",noShoot:!0})]}):null,(0,a.jsx)(b.$n,{"data-testid":"payment_button_text",variant:b.Vt.PRIMARY,size:E,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:V,isLoading:N.isWork,isDisabled:N.isWork,className:f().button}),(0,a.jsx)(b.$n,{variant:b.Vt.SECONDARY,size:E,title:"ÐойÑи дÑÑгим ÑпоÑобом",fullWidth:!0,onClick:()=>{(0,o.Yj)("socialReg"),(0,o.TV)("socialRegReturnToAuthPage","true"),l().push("/logout"),g({screen_type:"login_registration",screen_attributes_id:"add_new_login_to_apple_google",element_type:"button",element_attributes_id:"another_method_login",element_attributes_text:"ÐойÑи дÑÑгим ÑпоÑобом",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"external"})},className:h()(f().button,f().button_secondary)}),y&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:R})]})})]})]})},ConfirmSocialPhoneCode:e=>{var t;let{changeStep:r,setDto:s,dto:l}=e,[_,u]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:""}),p=c.Ay.useApiUrl(),g=c.Ay.useApiKey(),v=c.Ay.useResponsiveButtonSize(),{clientApiKey:E}=c.Ay.useApiClientKey(),y=c.Ay.useClickHouseShoot(),x=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[R,I]=(0,i.useState)(d.xS),[O,A]=(0,i.useState)(!0),[N,C]=(0,i.useState)(!1),[P,j]=(0,i.useState)(!1),[w,k]=(0,i.useState)(null),[L,D]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=L-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),k("00:00"),j(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");k("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[L]),(0,i.useEffect)(()=>{let e=null;return O&&R>0?e=setInterval(()=>{I(e=>e-1)},1e3):0===R&&(A(!1),C(!0)),()=>clearInterval(e)},[O,R]),(0,i.useEffect)(()=>(A(!0),C(!1),()=>{(0,m.zs)(d.v8.MEGAFON_MLK)}),[]),(0,i.useEffect)(()=>{s(e=>({...e,clickHouse:{referer_screen_type:"login_registration",referer_screen_attributes_id:"add_new_login_to_apple_google"}})),y({screen_type:"login",screen_attributes_id:"code_sms",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"add_new_login_to_apple_google"})},[]);let M=e=>{let t="",r=!1;return e&&e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС"),u(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},G=async e=>{y({screen_type:"login",screen_attributes_id:"code_sms",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:"add_new_login_to_apple_google"});let t=M(e);if(W(t),t){var a,i,n;u(e=>{e.isWork=!0});let t="".concat(p).concat(T.PI.phoneConfirmV2).concat(g),c={phone:null==l?void 0:null===(a=l.loginData)||void 0===a?void 0:a.phone,code:e,password:null==l?void 0:null===(i=l.loginData)||void 0===i?void 0:i.password},_=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(_.status<400){(0,o.Yj)("socialReg");let e=await _.json();r(d.RZ.SUCCESS),s(t=>({...t,authMethod:d.bh.PHONE,authType:d.tG.LOGIN,userProfileData:e})),(0,o.EF)(),y({screen_type:"login",screen_attributes_id:"success",account_id:e._id,profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:"login",action_result:"phone",virtual_profile_id:null==x?void 0:x._id,event_time:new Date().getTime()})}else{let e=await _.json();if(u(e=>{e.isWork=!1}),e&&(null==e?void 0:e.code)&&d.jb.includes(null==e?void 0:e.code)){D(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.expired),j(!0);return}u(t=>{t.isWork=!1,t.hasCodeError=!0,t.codeErrorText=d._R[null==e?void 0:e.code]||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."}),y({screen_type:"login",screen_attributes_id:"code_sms",action_id:"error",action_result:d._R[null==e?void 0:e.code]||(null==e?void 0:e.code)||e.message,action_attributes_str:t,action_parameter:"login",referer_screen_type:"login_registration",referer_screen_attributes_id:"add_new_login_to_apple_google"})}}},W=e=>{y({screen_type:"login",screen_attributes_id:"code_sms",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:"add_new_login_to_apple_google"})},V=async()=>{var e,t,r,a;C(!1),A(!0),I(d.xS),y({screen_type:"login",screen_attributes_id:"code_sms",action_id:"click",element_type:"button",element_attributes_id:"new_code",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login_registration",referer_screen_attributes_id:"add_new_login_to_apple_google"});let i="".concat(p).concat(T.PI.phoneSetV2).concat(g),n={phone:null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.phone,password:null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.password,..._.hasCaptcha&&{key:_.captchaKey,captcha:_.captcha}};try{let e=await fetch(i,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(e.status>=400){let t=await e.json();if(t&&(null==t?void 0:t.code)&&d.jb.includes(null==t?void 0:t.code)){D(null==t?void 0:null===(r=t.data)||void 0===r?void 0:r.expired),j(!0);return}u(e=>{e.hasCodeError=!0,e.codeErrorText=d._R[null==t?void 0:t.code]||t.message||"ЧÑо-Ñо поÑло не Ñак..."}),C(!0),A(!1)}}catch(t){console.error("Error requesting new code:",t);let e=t&&t.code&&d.pO.includes(t.code);if(t&&t.code&&d.jb.includes(t.code)){D(null==t?void 0:null===(a=t.data)||void 0===a?void 0:a.expired),j(!0);return}C(!0),A(!1),u(r=>{if(e){let e=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;r.hasCaptcha=!0,r.captcha="",r.captchaImg=e?"".concat(p).concat(e,"&apikey=").concat(E,"&v=").concat(Math.random()):"",r.captchaKey=a,r.hasCaptchaError=!0,r.captchaErrorText=d.Sr[null==t?void 0:t.code]||d.Sr[t.message]||"ЧÑо-Ñо поÑло не Ñак..."}else r.hasPasswordError=!0,r.passwordErrorText=d.Sr[null==t?void 0:t.code]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак...",r.hasCodeError=!0,r.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}},Z=async()=>{if(!_.hasCaptcha||!_.captchaImg)return;let e=new URL(_.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?u(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await G()};return(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&G()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из СÐС,",(0,a.jsx)("br",{}),"оÑпÑавили на номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.phone)}})]}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{G(e)},errorText:_.hasCodeError?_.codeErrorText:"",value:_.code,onChange:e=>{u(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:_.isWork,onFocus:()=>{y({screen_type:"login",screen_attributes_id:"code_sms",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:"add_new_login_to_apple_google"})}})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:v,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>G(_.code),isLoading:_.isWork,isDisabled:_.isWork,className:f().button}),_.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:_.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:Z})]}),(0,a.jsx)(B.A,{value:_.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onCh
1ange:e=>{let t=e.target.value;u(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:_.hasCaptchaError,errorText:_.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"}),(0,a.jsxs)("div",{className:Y().infoMessage,children:[(0,a.jsx)("img",{className:Y().infoMessage_icon,src:"/static/images/auth/info.svg",alt:"info"}),(0,a.jsx)("span",{className:Y().infoMessage_text,children:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð½Ð¾Ð²Ñй код"})]})]}):null,P&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["СлиÑком много попÑÑок ввода.",(0,a.jsx)("br",{}),"ÐопÑобÑйÑе Ñнова ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().countdown_limit),children:w})]})}),!P&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{className:h()(f().description),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!N&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().small),children:(0,m.fU)(R)})]})]}),onClick:V,size:b.GO.SMALL,variant:b.Vt.SECONDARY,isDisabled:!N})})]})},OTPTelegramSignup:e=>{var t;let{changeStep:r,setDto:s,dto:l}=e,_=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[u,p]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:""}),g=c.Ay.useApiUrl(),v=c.Ay.useApiKey(),{clientApiQuery:E,clientApiKey:y}=c.Ay.useApiClientKey(),R=c.Ay.useClickHouseShoot(),I=c.Ay.useResponsiveButtonSize(),[O,A]=(0,i.useState)(d.xS),[N,C]=(0,i.useState)(!0),[P,j]=(0,i.useState)(!1),[w,k]=(0,i.useState)(!1),[L,D]=(0,i.useState)(!1),[M,G]=(0,i.useState)(null),[W,V]=(0,i.useState)("00:00"),[Z,H]=(0,i.useState)(null),[U,F]=(0,i.useState)("00:00"),[K,z]=(0,i.useState)(!1),X=(0,i.useRef)(null),J=(0,n.d4)(e=>e.systemInformation.windowInnerWidth)<=x.xW.TABLET_WIDE;(0,i.useEffect)(()=>{let e=e=>{X.current&&!X.current.contains(e.target)&&z(!1)};return K?document.addEventListener("mousedown",e):document.removeEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[K]),(0,i.useEffect)(()=>{if(w&&M){let e=setInterval(()=>{let t=M-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),V("00:00"),k(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");V("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)}},[w,M]),(0,i.useEffect)(()=>{if(L&&Z){let e=setInterval(()=>{let t=Z-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),F("00:00"),D(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");F("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)}},[L,Z]),(0,i.useEffect)(()=>{let e=null;return N&&O>0?e=setInterval(()=>{A(e=>e-1)},1e3):0===O&&(C(!1),j(!0)),()=>clearInterval(e)},[N,O]),(0,i.useEffect)(()=>{C(!0),j(!1)},[]),(0,i.useEffect)(()=>{s(e=>({...e,clickHouse:{attributesId:"code_tg",refererScreenType:"registration",referer_screen_attributes_id:"by_phone"}})),R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:"screenview",referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"})},[]),(0,i.useEffect)(()=>{let e=document.getElementById("pin-0");e&&e.focus()},[]);let $=e=>{let t="",r=!1;return e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из Telegram"),p(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},Q=async e=>{R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"});let t=$(e);
1if(et(t),t){var a,i;p(e=>{e.isWork=!0});let t="".concat(g).concat(T.PI.phoneRegistrationConfirm).concat(v),n={phone:null==l?void 0:null===(a=l.loginData)||void 0===a?void 0:a.emailOrPhone,code:e,password:null==l?void 0:null===(i=l.loginData)||void 0===i?void 0:i.password,...(null==l?void 0:l.isWantSpam)&&{notifications_types:["sms"]}},c=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(c.status<400){let e=await c.json();r(d.RZ.SUCCESS),s(t=>({...t,authType:d.tG.REGISTER,userProfileData:e})),(0,o.EF)(),R({screen_type:"registration",screen_attributes_id:"success",account_id:e._id,profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:"registration",action_result:"tg_otp",virtual_profile_id:null==_?void 0:_._id,event_time:new Date().getTime()})}else{let e=await c.json();p(e=>{e.isWork=!1}),p(t=>{t.isWork=!1,t.hasCodeError=!0,t.codeErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."}),R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:"error",action_result:d._R[null==e?void 0:e.code]||(null==e?void 0:e.code)||(null==e?void 0:e.message),action_attributes_str:t,action_parameter:"registration",referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"})}}},et=e=>{R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из Telegram",referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"})},er=async()=>{var e,t,a,i,n,o;j(!1),C(!0),A(d.xS),R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"new_code",element_attributes_text:"ÐÑпÑавиÑÑ ÐµÑÑ Ñаз",referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"});let s="".concat(g).concat(T.PI.phoneRegistrationV2).concat(v),c={providers:["telegram"],password:null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.password,phone:null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone,...u.hasCaptcha&&{key:u.captchaKey,captcha:u.captcha}};try{let e=await fetch(s,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(e.status>=400){let t=await e.json(),s=t&&t.code&&d.pO.includes(t.code),l=t&&t.code&&d.jb.includes(t.code),c=l&&(null==t?void 0:t.code)==="TELEGRAM_LIMIT_EXCEEDED",_=l&&(null==t?void 0:t.code)==="SMS_LIMIT_EXCEEDED",u=(null==t?void 0:t.code)==="TELEGRAM_EXCEPTION"||(null==t?void 0:t.code)==="SERVICE_EXCEPTION"||(null==t?void 0:null===(a=t.telegram)||void 0===a?void 0:a.code)==="TELEGRAM_EXCEPTION"||(null==t?void 0:null===(i=t.telegram)||void 0===i?void 0:i.code)==="SERVICE_EXCEPTION",h=(null==t?void 0:t.code)==="TELEGRAM_EXCEPTION",m=h&&(null==t?void 0:t.message)==="BALANCE_NOT_ENOUGH",v=h&&(null==t?void 0:t.message)==="PHONE_NUMBER_INVALID",E=h&&(null==t?void 0:t.message)==="FLOOD_WAIT_3",f=(null==t?void 0:t.code)==="SERVICE_EXCEPTION"&&(null==t?void 0:t.message)==="ExternalServiceError";if(u){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(_){H(null==t?void 0:null===(n=t.data)||void 0===n?void 0:n.expired),D(!0);return}if(c){G(null==t?void 0:null===(o=t.data)||void 0===o?void 0:o.expired),k(!0);return}if(m){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(v){r(d.RZ.OTP_TELEGRAM_NOT_REGISTERED);return}if(E||f){r(d.RZ.OTP_TELEGRAM_ERROR);return}p(e=>{if(s){let r=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=r?"".concat(g).concat(r,"&apikey=").concat(y,"&v=").concat(Math.random()):"",e.captchaKey=a,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак..."}else e.hasCodeError=!0,e.codeErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."}),j(!0),C(!1)}}catch(e){console.error("Error requesting new code:",e),j(!0),C(!1),p(e=>{e.hasCodeError=!0,e.codeErrorText="ТеÑ
ниÑеÑÐºÐ°Ñ Ð½ÐµÐ¿Ð¾Ð»Ð°Ð´ÐºÐ°. ÐопÑобÑйÑе позже"})}},ei=async()=>{if(!u.hasCaptcha||!u.captchaImg)return;let e=new URL(u.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?p(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await Q()},en=async()=>{var e,t;R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"send_sms",element_attributes_text:"ÐÑпÑавиÑÑ Ð² СÐС",referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"});let a="".concat(g).concat(T.PI.phoneRegistrationV2).concat(E),i={phone:null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.emailOrPhone,password:null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.password,providers:["sms"],...u.hasCaptcha&&{key:u.captchaKey,captcha:u.captcha}};p(e=>{e.isWork=!0});try{let e=await fetch(a,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),t=await e.json();e.status<400?(r(d.RZ.PHONE_CODE),s(e=>({...e,authType:d.tG.REGISTER,userProfileData:t}))):(R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:t&&d.pO.includes(t.code)?"error_captcha":"error",action_result:d.Sr[t.code]||d.Sr[t.message]||t.message||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:a,...t&&!d.pO.includes(t.code)&&{action_parameter:"registration"},referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"}),es(t))}catch(e){es()}finally{p(e=>{e.isWork=!1})}},es=e=>{var t,a,i,n;let o=e&&e.code&&d.pO.includes(e.code),s=e&&e.code&&d.jb.includes(e.code),l=s&&(null==e?void 0:e.code)==="TELEGRAM_LIMIT_EXCEEDED",c=s&&(null==e?void 0:e.code)==="SMS_LIMIT_EXCEEDED",_=(null==e?void 0:e.code)==="TELEGRAM_EXCEPTION"||(null==e?void 0:e.code)==="SERVICE_EXCEPTION"||(null==e?void 0:null===(t=e.telegram)||void 0===t?void 0:t.code)==="TELEGRAM_EXCEPTION"||(null==e?void 0:null===(a=e.telegram)||void 0===a?void 0:a.code)==="SERVICE_EXCEPTION",u=(null==e?void 0:e.code)==="TELEGRAM_EXCEPTION",h=u&&(null==e?void 0:e.message)==="BALANCE_NOT_ENOUGH",m=u&&(null==e?void 0:e.message)==="PHONE_NUMBER_INVALID",v=u&&(null==e?void 0:e.message)==="FLOOD_WAIT_3",E=(null==e?void 0:e.code)==="SERVICE_EXCEPTION"&&(null==e?void 0:e.message)==="ExternalServiceError";if(_){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(c){H(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.expired),D(!0);return}if(l){G(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.expired),k(!0);return}if(h){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(m){r(d.RZ.OTP_TELEGRAM_NOT_REGISTERED);return}if(v||E){r(d.RZ.OTP_TELEGRAM_ERROR);return}p(t=>{if(o){let r=e&&e.data&&e.data.captcha,a=e&&e.data&&e.data.key;t.hasCaptcha=!0,t.captcha="",t.captchaImg=r?"".concat(g).concat(r,"&apikey=").concat(y,"&v=").concat(Math.random()):"",t.captchaKey=a,t.hasCaptchaError=!0,t.captchaErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."}else t.hasPasswordError=!0,t.passwordErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."})};return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:h()(f().container,{[f().overflowVisible]:K}),onKeyDown:e=>{"Enter"===e.key&&Q()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из\xa0",(0,a.jsx)("img",{className:h()(f().iconCentered,f().tgIcon),src:"/static/images/auth/logo-telegram.svg",alt:"logo telegram"}),"\xa0Telegram,",(0,a.jsx)("br",{}),"оÑпÑавили на\xa0номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone)}})]}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{Q(e)},errorText:u.hasCodeError?u.codeErrorText:"",value:u.code,onChange:e=>{p(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:u.isWork,onFocus:()=>{R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из Telegram",referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"})}})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:I,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>Q(u.code),isLoading:u.isWork,isDisabled:u.isWork,className:f().button}),u.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:u.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:ei})]}),(0,a.jsx)(B.A,{value:u.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onCh
1ange:e=>{let t=e.target.value;p(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:u.hasCaptchaError,errorText:u.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"}),(0,a.jsxs)("div",{className:Y().infoMessage,children:[(0,a.jsx)("img",{className:Y().infoMessage_icon,src:"/static/images/auth/info.svg",alt:"info"}),(0,a.jsx)("span",{className:Y().infoMessage_text,children:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð½Ð¾Ð²Ñй код"})]})]}):null,w&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["СлиÑком много попÑÑок ввода.",(0,a.jsx)("br",{}),"ÐопÑобÑйÑе Ñнова ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().countdown_limit),children:W})]})}),L&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_tgOtpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов Ð´Ð»Ñ Ð¡ÐС. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:U})]})}),(0,a.jsxs)("div",{className:f().descriptionWrapper,children:[(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:"Ðе пÑиÑÑл код в Telegram",onClick:()=>{let e=!K;J&&e&&(0,m.cs)(),z(e=>!e),R({screen_type:"registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"no_tg_code",element_attributes_text:"Ðе пÑиÑÑл код Telegram",referer_screen_type:"registration",referer_screen_attributes_id:"by_phone"})},size:b.GO.SMALL,variant:b.Vt.SECONDARY,"data-testid":"otp_get_new_code_button"}),J?(0,a.jsxs)(eo,{isOpen:K,title:"ÐÑпÑавиÑÑ ÐºÐ¾Ð´ повÑоÑно",onClose:()=>z(!1),children:[(0,a.jsxs)(ea,{disabled:!P||w,icon:"/static/images/auth/telegram_filled.svg",alt:"telegram icon",className:f().tooltipButton,onClick:()=>er(),children:["ÐÑпÑавиÑÑ Ð² Telegram ",!P&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(O)})]}),(0,a.jsx)(ea,{disabled:L,text:"ÐÑпÑавиÑÑ Ð² СÐС",icon:"/static/images/auth/mail_outlined.svg",alt:"mail icon",className:f().tooltipButton,onClick:()=>en()})]}):(0,a.jsxs)(ee,{visible:K,ref:X,children:[(0,a.jsxs)(ea,{disabled:!P||w,icon:"/static/images/auth/telegram_filled.svg",alt:"telegram icon",onClick:()=>er(),children:["ÐÑпÑавиÑÑ ÐµÑÑ Ñаз ",!P&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(O)})]}),(0,a.jsx)(ea,{disabled:L,text:"ÐÑпÑавиÑÑ Ð² СÐС",icon:"/static/images/auth/mail_outlined.svg",alt:"mail icon",onClick:()=>en()})]})]})]})})},OTPTelegramSignin:e=>{var t,r;let{changeStep:s,setDto:l,dto:_}=e,u=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[p,g]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:""}),v=c.Ay.useApiUrl(),E=c.Ay.useApiKey(),{clientApiKey:y}=c.Ay.useApiClientKey(),x=c.Ay.useClickHouseShoot(),R=c.Ay.useResponsiveButtonSize(),[I,O]=(0,i.useState)(d.xS),[A,N]=(0,i.useState)(!0),[C,P]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),[k,L]=(0,i.useState)(null),[D,M]=(0,i.useState)(null);(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=D-Math.floor(Date.now()/1e3);if(t<=0)w(!1),clearInterval(e),L("00:00");else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");L("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[D]),(0,i.useEffect)(()=>{let e=null;return A&&I>0?e=setInterval(()=>{O(e=>e-1)},1e3):0===I&&(N(!1),P(!0)),()=>clearInterval(e)},[A,I]),(0,i.useEffect)(()=>{N(!0),P(!1)},[]),(0,i.useEffect)(()=>
1{l(e=>({...e,clickHouse:{attributesId:"code_tg",refererScreenType:"login",referer_screen_attributes_id:"code_by_phone"}})),x({screen_type:em.LOGIN,screen_attributes_id:"code_tg",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"})},[]);let G=e=>{let t="",r=!1;return e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из Telegram"),g(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},W=async e=>{x({screen_type:em.LOGIN,screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"});let t=G(e);if(V(t),t){var r,a;g(e=>{e.isWork=!0});let t="".concat(v).concat(T.PI.phoneLoginV3Confirm).concat(E),i={phone:null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.emailOrPhone,code:e},n=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(n.status<400){let e=await n.json();s(d.RZ.SUCCESS),l(t=>({...t,userProfileData:e})),(0,o.EF)(),x({screen_type:em.LOGIN,screen_attributes_id:"success",account_id:e._id,profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:"login",action_result:"tg_otp",virtual_profile_id:null==u?void 0:u._id,event_time:new Date().getTime()})}else{let e=await n.json();if(g(e=>{e.isWork=!1}),e&&e.code&&d.jb.includes(e.code)){M(null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.expired),w(!0);return}g(t=>{t.isWork=!1,t.hasCodeError=!0,t.codeErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."}),x({screen_type:em.LOGIN,screen_attributes_id:"code_tg",action_id:"error",action_result:d._R[null==e?void 0:e.code]||(null==e?void 0:e.code)||(null==e?void 0:e.message),action_attributes_str:t,action_parameter:"registration",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"})}}},V=e=>{x({screen_type:em.LOGIN,screen_attributes_id:"code_tg",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из Telegram",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"})},Z=async()=>{var e,t,r,a;P(!1),N(!0),O(d.xS),x({screen_type:em.LOGIN,screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"new_code",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"});let i=null==_?void 0:null===(e=_.loginData)||void 0===e?void 0:e.emailOrPhone,n="".concat(v).concat(T.PI.phoneLoginV3).concat(E),o={phone:(0,m.n4)(i),...p.hasCaptcha&&{key:p.captchaKey,captcha:p.captcha},providers:["telegram"]};try{let e=await fetch(n,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)});if(e.status>=400){let i=await e.json(),n=i&&i.code&&d.pO.includes(i.code),o=i&&i.code&&d.jb.includes(i.code),l=(null==i?void 0:i.code)==="TELEGRAM_EXCEPTION"||(null==i?void 0:i.code)==="SERVICE_EXCEPTION"||(null==i?void 0:null===(t=i.telegram)||void 0===t?void 0:t.code)==="TELEGRAM_EXCEPTION"||(null==i?void 0:null===(r=i.telegram)||void 0===r?void 0:r.code)==="SERVICE_EXCEPTION",c=(null==i?void 0:i.code)==="TELEGRAM_EXCEPTION",_=c&&(null==i?void 0:i.message)==="BALANCE_NOT_ENOUGH",u=c&&(null==i?void 0:i.message)==="PHONE_NUMBER_INVALID",p=c&&(null==i?void 0:i.message)==="FLOOD_WAIT_3",h=(null==i?void 0:i.code)==="SERVICE_EXCEPTION"&&(null==i?void 0:i.message)==="ExternalServiceError";if(o){M(null==i?void 0:null===(a=i.data)||void 0===a?void 0:a.expired),w(!0);return}if(l||_){s(d.RZ.OTP_TELEGRAM_ERROR);return}if(u){s(d.RZ.OTP_TELEGRAM_NOT_REGISTERED);return}if(p||h){s(d.RZ.OTP_TELEGRAM_ERROR);return}g(e=>{if(n){let t=i&&i.data&&i.data.captcha,r=i&&i.data&&i.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=t?"".concat(v).concat(t,"&apikey=").concat(y,"&v=").concat(Math.random()):"",e.captchaKey=r,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==i?void 0:i.code]||d._R[null==i?void 0:i.code]||d._R[null==i?void 0:i.message]||d.Sr[null==i?void 0:i.message]||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."}else e.hasCodeError=!0,e.codeErrorText=d.Sr[null==i?void 0:i.code]||d._R[null==i?void 0:i.code]||d._R[null==i?void 0:i.message]||d.Sr[null==i?void 0:i.message]||"ЧÑо-Ñо поÑло не Ñак..."}),P(!0),N(!1)}}catch(e){console.error("Error requesting new code:",e),P(!0),N(!1),g(e=>{e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}},H=async()=>{if(!p.hasCaptcha||!p.captchaImg)return;let e=new URL(p.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?g(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await W()};return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:h()(f().container),onKeyDown:e=>{"Enter"===e.key&&W()},children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из\xa0",(0,a.jsx)("img",{className:h()(f().iconCentered,f().tgIcon),src:"/static/images/auth/logo-telegram.svg",alt:"logo telegram"}),"\xa0Telegram,",(0,a.jsx)("br",{}),"оÑпÑавили на\xa0номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.emailOrPhone)}})]}),(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL&&(0,a.jsx)("div",{className:h()(f().description,f().description_otp),children:"ÐÑли пиÑÑма неÑ, пÑовеÑÑÑе Спам"}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{W(e)},errorText:p.hasCodeError?p.codeErrorText:"",value:p.code,onChange:e=>{g(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:p.isWork,onFocus:()=>{x({screen_type:em.LOGIN,screen_attributes_id:"code_tg",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из Telegram",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"})}})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:R,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>W(p.code),isLoading:p.isWork,isDisabled:p.isWork,className:f().button}),p.hasCaptcha?(0,a.jsxs)("div",{className:Y().container,children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:p.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:H})]}),(0,a.jsx)(B.A,{value:p.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;g(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:p.hasCaptchaError,errorText:p.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"}),(0,a.jsxs)("div",{className:Y().infoMessage,children:[(0,a.jsx)("img",{className:Y().infoMessage_icon,src:"/static/images/auth/info.svg",alt:"info"}),(0,a.jsx)("span",{className:Y().infoMessage_text,children:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð½Ð¾Ð²Ñй код"})]})]}):null,j&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["СлиÑком много попÑÑок ввода.",(0,a.jsx)("br",{}),"ÐопÑобÑйÑе Ñнова ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().countdown_limit),children:k})]})}),!j&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",!C&&(0,a.jsxs)(a.Fragment,{children:[" ","ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().small),children:(0,m.fU)(I)})]})]}),onClick:Z,size:b.GO.SMALL,isDisabled:!C,"data-testid":"otp_get_new_code_button"})})]})})},OTPTelegramError:e=>{var t,r;let{changeStep:n,setDto:s,dto:l}=e,{clientApiQuery:_,clientApiKey:u}=c.Ay.useApiClientKey(),p=c.Ay.useClickHouseShoot(),g=c.Ay.useApiUrl(),E=c.Ay.useResponsiveButtonSize(),[y,x]=(0,i.useState)(!1),[R,I]=(0,i.useState)(!1),[O,A]=(0,i.useState)(null),[N,C]=(0,i.useState)(null),[P,j]=(0,S.e)({emailOrPhone:"",emailOrPhoneType:void 0,password:"",hasPasswordError:!1,passwordErrorText:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1}),w=null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone;(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=N-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),A("00:00");else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");A("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[N]),(0,i.useEffect)(()=>{s(e=>({...e,clickHouse:{attributesId:"error_code_tg",refererScreenType:"login",refererScreenAttributesId:"code_by_phone"}})),p({screen_type:"registration/login",screen_attributes_id:"error_code_tg",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"})},[]);let k=(e,t)=>{var r,a,i;let n="";n=(null==t?void 0:t.error)&&(null==t?void 0:null===(r=t.details)||void 0===r?void 0:r.email)?d.Sr.WRONG_EMAIL:(null==t?void 0:t.error)&&(null==t?void 0:null===(a=t.details)||void 0===a?void 0:a.phone)?d.Sr.INCORRECT_PHONE:(null==t?void 0:t.code)==="REGISTRATION_UNAVAILABLE"?d.Sr.REGISTRATION_UNAVAILABLE:d.Sr.SOMETHING_WENT_WRONG,x(!1);let o=t&&t.code&&d.pO.includes(t.code);
1if(t&&t.code&&d.jb.includes(t.code)){C(null==t?void 0:null===(i=t.data)||void 0===i?void 0:i.expired),I(!0);return}j(e=>{if(o){let r=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=r?"".concat(g).concat(r,"&apikey=").concat(u,"&v=").concat(Math.random()):"",e.captchaKey=a,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак..."}else e.hasPasswordError=!0,e.passwordErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||n||"ЧÑо-Ñо поÑло не Ñак..."})},L=async()=>{var e;p({screen_type:"registration/login",screen_attributes_id:"error_code_tg",action_id:"click",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone",element_type:"button",element_attributes_id:"send_sms",element_attributes_text:"ÐÑпÑавиÑÑ Ð¡ÐС"}),x(!0);let t=null==l?void 0:l.authType,r=t===d.tG.LOGIN?T.PI.phoneLoginV3:T.PI.phoneRegistrationV2,a="".concat(g).concat(r).concat(_),i={phone:(0,m.n4)(w),...P.hasCaptcha&&{key:P.captchaKey,captcha:P.captcha},password:null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.password,providers:["sms"]};try{let e=await fetch(a,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),r=await e.json();e.ok?t===d.tG.LOGIN?n(d.RZ.OTP):n(d.RZ.PHONE_CODE):k(a,r)}catch(e){k(a)}finally{x(!1)}},D=async()=>{if(p({screen_type:"registration/login",screen_attributes_id:"error_code_tg",action_id:"click",element_type:"button",element_attributes_id:"request_captcha",element_attributes_text:"/static/images/registration/refresh_1.svg",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"}),!P.hasCaptcha||!P.captchaImg)return;let e=new URL(P.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?j(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await L()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"ÐÑ
од по одноÑÐ°Ð·Ð¾Ð²Ð¾Ð¼Ñ Ð¿Ð°ÑолÑ",description:"Ðа данной ÑÑÑаниÑе Ð²Ñ ÑможеÑе запÑоÑиÑÑ Ð¾Ð´Ð½Ð¾ÑазовÑй паÑÐ¾Ð»Ñ Ð¾Ñ Ð°ÐºÐºÐ°ÑнÑа онлайн киноÑеаÑÑа START"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&L()},children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"Ðе\xa0ÑдалоÑÑ Ð¾ÑпÑавиÑÑ ÐºÐ¾Ð´ в\xa0Telegram, оÑпÑавим СÐС на\xa0номеÑ"}),(0,a.jsx)("div",{className:f().login,children:(null==l?void 0:l.loginData)&&(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(null==l?void 0:null===(r=l.loginData)||void 0===r?void 0:r.emailOrPhone)}})}),P.hasCaptcha&&(0,a.jsxs)("div",{className:h()(Y().container,Y().container_requestOTP),children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:P.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:D})]}),(0,a.jsx)(B.A,{value:P.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;j(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:P.hasCaptchaError,errorText:P.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}),(0,a.jsx)(b.$n,{"data-testid":"otp_code_send_button",variant:b.Vt.PRIMARY,size:E,title:"ÐÑпÑавиÑÑ Ð¡ÐС",fullWidth:!0,onClick:L,isDisabled:y,isLoading:y,className:h()(f().button,f().button_clear)}),P.passwordErrorText&&(0,a.jsx)("div",{className:h()(f().customError,f().customError_otp),children:P.passwordErrorText}),R&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:O})]})})]})]})},OTPTelegramNotRegistered:e=>{var t,r;let{changeStep:n,setDto:s,dto:l}=e,{clientApiQuery:_,clientApiKey:u}=c.Ay.useApiClientKey(),p=c.Ay.useClickHouseShoot(),g=c.Ay.useApiUrl(),E=c.Ay.useResponsiveButtonSize(),[y,x]=(0,i.useState)(!1),[R,I]=(0,i.useState)(!1),[O,A]=(0,i.useState)(null),[N,C]=(0,i.useState)(null),[P,j]=(0,S.e)({emailOrPhone:"",emailOrPhoneType:void 0,password:"",hasPasswordError:!1,passwordErrorText:"",hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1}),w=null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone;(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=N-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),A("00:00"),I(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");A("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[N]),(0,i.useEffect)(()=>{s(e=>({...e,clickHouse:{attributesId:"phone_without_tg",refererScreenType:"login",refererScreenAttributesId:"code_by_phone"}})),p({screen_attributes_id:"phone_without_tg",action_id:"screenview",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"})},[]);let k=(e,t)=>{var r,a,i;let n="";n=(null==t?void 0:t.error)&&(null==t?void 0:null===(r=t.details)||void 0===r?void 0:r.email)?d.Sr.WRONG_EMAIL:(null==t?void 0:t.error)&&(null==t?void 0:null===(a=t.details)||void 0===a?void 0:a.phone)?d.Sr.INCORRECT_PHONE:(null==t?void 0:t.code)==="REGISTRATION_UNAVAILABLE"?d.Sr.REGISTRATION_UNAVAILABLE:d.Sr.SOMETHING_WENT_WRONG,x(!1);let o=t&&t.code&&d.pO.includes(t.code);
1if(t&&t.code&&d.jb.includes(t.code)){C(null==t?void 0:null===(i=t.data)||void 0===i?void 0:i.expired),I(!0);return}j(e=>{if(o){let r=t&&t.data&&t.data.captcha,a=t&&t.data&&t.data.key;e.hasCaptcha=!0,e.captcha="",e.captchaImg=r?"".concat(g).concat(r,"&apikey=").concat(u,"&v=").concat(Math.random()):"",e.captchaKey=a,e.hasCaptchaError=!0,e.captchaErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак..."}else e.hasPasswordError=!0,e.passwordErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||n||"ЧÑо-Ñо поÑло не Ñак..."})},L=async()=>{p({screen_attributes_id:"phone_without_tg",action_id:"click",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone",element_type:"button",element_attributes_id:"send_sms",element_attributes_text:"ÐÑпÑавиÑÑ Ð¡ÐС"}),x(!0);let e="".concat(g).concat(T.PI.phoneLoginV3).concat(_),t={phone:(0,m.n4)(w),...P.hasCaptcha&&{key:P.captchaKey,captcha:P.captcha},providers:["sms"]};try{let r=await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await r.json();r.ok?n(d.RZ.OTP):k(e,a)}catch(t){k(e)}finally{x(!1)}},D=async()=>{if(p({screen_attributes_id:"phone_without_tg",action_id:"click",element_type:"button",element_attributes_id:"request_captcha",element_attributes_text:"/static/images/registration/refresh_1.svg",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"}),!P.hasCaptcha||!P.captchaImg)return;let e=new URL(P.captchaImg);e.searchParams.set("renew","true"),e.searchParams.set("v",Date.now().toString()),(await fetch(e.toString(),{credentials:"include"})).ok?j(t=>{t.captchaImg=e.toString(),t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""}):await L()};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"ÐÑ
од по одноÑÐ°Ð·Ð¾Ð²Ð¾Ð¼Ñ Ð¿Ð°ÑолÑ",description:"Ðа данной ÑÑÑаниÑе Ð²Ñ ÑможеÑе запÑоÑиÑÑ Ð¾Ð´Ð½Ð¾ÑазовÑй паÑÐ¾Ð»Ñ Ð¾Ñ Ð°ÐºÐºÐ°ÑнÑа онлайн киноÑеаÑÑа START"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>{"Enter"===e.key&&L()},children:[(0,a.jsx)("div",{className:h()(f().title,f().title_main),children:"ÐÐ¾Ð¼ÐµÑ Ð½Ðµ\xa0заÑегиÑÑÑиÑован в\xa0Telegram"}),(0,a.jsx)("div",{className:f().login,children:(null==l?void 0:l.loginData)&&(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(null==l?void 0:null===(r=l.loginData)||void 0===r?void 0:r.emailOrPhone)}})}),P.hasCaptcha&&(0,a.jsxs)("div",{className:h()(Y().container,Y().container_requestOTP),children:[(0,a.jsxs)("div",{className:Y().section,children:[(0,a.jsx)("img",{className:Y().image,src:P.captchaImg,alt:"captcha"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:D})]}),(0,a.jsx)(B.A,{value:P.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value;j(e=>{e.captcha=t||"",e.hasCaptchaError=!1,e.captchaErrorText=""})},onValidate:()=>{},id:"captcha",type:"text",maxLength:"6",error:P.hasCaptchaError,errorText:P.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки"})]}),(0,a.jsx)(b.$n,{"data-testid":"otp_code_send_button",variant:b.Vt.PRIMARY,size:E,title:"ÐÑпÑавиÑÑ Ð¡ÐС",fullWidth:!0,onClick:L,isDisabled:y,isLoading:y,className:h()(f().button,f().button_clear)}),(0,a.jsx)(b.$n,{testid:"signin_button",variant:b.Vt.SECONDARY,size:E,title:"ÐойÑи дÑÑгим ÑпоÑобом",fullWidth:!0,onClick:()=>{p({screen_attributes_id:"phone_without_tg",action_id:"click",element_type:"button",element_attributes_id:"another_method_login",element_attributes_text:"ÐойÑи дÑÑгим ÑпоÑобом",referer_screen_type:"login",referer_screen_attributes_id:"code_by_phone"}),n(d.RZ.CORE)},isLoading:P.isWork,isDisabled:P.isWork,className:h()(f().button,f().button_mt8)}),P.passwordErrorText&&(0,a.jsx)("div",{className:h()(f().customError,f().customError_otp),children:P.passwordErrorText}),R&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:O})]})})]})]})},OTPTelegramV2:e=>{var t;let{changeStep:r,setDto:s,dto:l,setIsDisclaimerVisible:_}=e,u=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[p,g]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",info:!1}),v=c.Ay.useApiUrl(),E=c.Ay.useApiKey(),{clientApiQuery:y}=c.Ay.useApiClientKey(),R=c.Ay.useClickHouseShoot(),I=c.Ay.useResponsiveButtonSize(),[O,A]=(0,i.useState)(d.xS),[N,C]=(0,i.useState)(!0),[P,j]=(0,i.useState)(!1),[w,k]=(0,i.useState)(!1),[L,D]=(0,i.useState)(!1),[M,G]=(0,i.useState)(null),[W,V]=(0,i.useState)("00:00"),[Z,H]=(0,i.useState)(null),[U,F]=(0,i.useState)("00:00"),[B,K]=(0,i.useState)(!1),Y=(0,i.useRef)(null),z=(0,n.d4)(e=>e.systemInformation.windowInnerWidth)<=x.xW.TABLET_WIDE;(0,i.useEffect)(()=>{_&&_(!(z&&B))},[z,B,_]),(0,i.useEffect)(()=>{let e=e=>{Y.current&&!Y.current.contains(e.target)&&K(!1)};return B?document.addEventListener("mousedown",e):document.removeEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[B]),(0,i.useEffect)(()=>
1{if(w&&M){let e=setInterval(()=>{let t=M-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),V("00:00"),k(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");V("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)}},[w,M]),(0,i.useEffect)(()=>{if(L&&Z){let e=setInterval(()=>{let t=Z-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),F("00:00"),D(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");F("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)}},[L,Z]),(0,i.useEffect)(()=>{let e=null;return N&&O>0?e=setInterval(()=>{A(e=>e-1)},1e3):0===O&&(C(!1),j(!0)),()=>clearInterval(e)},[N,O]),(0,i.useEffect)(()=>{C(!0),j(!1)},[]),(0,i.useEffect)(()=>{s(e=>({...e,clickHouse:{attributesId:"code_tg",refererScreenType:"login_registration",referer_screen_attributes_id:"by_phone"}})),R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"})},[]),(0,i.useEffect)(()=>{let e=document.getElementById("pin-0");e&&e.focus()},[]);let $=e=>{let t="",r=!1;return e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из Telegram"),g(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},Q=async e=>{R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"});let t=$(e);if(et(t),t){var a,i;g(e=>{e.isWork=!0});let t="".concat(v).concat(T.PI.phoneAuthOTPConfirm).concat(E),n={phone:null==l?void 0:null===(a=l.loginData)||void 0===a?void 0:a.emailOrPhone,code:e,...(null==l?void 0:l.isWantSpam)&&{notification_types:["sms"]}},c=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(c.status<400){let e=await c.json();r(d.RZ.SUCCESS),s(t=>({...t,authType:200===c.status?d.tG.LOGIN:d.tG.REGISTER,userProfileData:e})),(0,o.EF)(),R({screen_type:200===c.status?d.sv.LOGIN:d.sv.REGISTRATION,screen_attributes_id:"success",account_id:e._id,profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:200===c.status?d.sv.LOGIN:d.sv.REGISTRATION,action_result:"tg_otp",virtual_profile_id:null==u?void 0:u._id,event_time:new Date().getTime()})}else{let e=await c.json();if(g(e=>{e.isWork=!1}),e&&e.code&&d.jb.includes(e.code)){G(null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.expired),k(!0);return}g(t=>{t.isWork=!1,t.hasCodeError=!0,t.codeErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."}),R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"error",action_result:d._R[null==e?void 0:e.code]||(null==e?void 0:e.code)||(null==e?void 0:e.message),action_attributes_str:t,action_parameter:"login_registration",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"})}}},et=e=>{R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из Telegram",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"})},er=async()=>{var e,t,a,i,n,o,c;j(!1),C(!0),A(d.xS),R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"new_code",element_attributes_text:"ÐÑпÑавиÑÑ ÐµÑÑ Ñаз",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"});let _="".concat(v).concat(T.PI.phoneAuthOTP).concat(E),u={providers:["telegram"],phone:null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.emailOrPhone};try{let e=await fetch(_,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(u)});if(e.status>=400){let u=await e.json(),p=u&&u.code&&d.pO.includes(u.code),h=u&&u.code&&d.jb.includes(u.code),m=h&&(null==u?void 0:u.code)==="TELEGRAM_LIMIT_EXCEEDED",v=h&&(null==u?void 0:u.code)==="SMS_LIMIT_EXCEEDED",E=(null==u?void 0:u.code)==="TELEGRAM_EXCEPTION"||(null==u?void 0:u.code)==="SERVICE_EXCEPTION"||(null==u?void 0:null===(t=u.telegram)||void 0===t?void 0:t.code)==="TELEGRAM_EXCEPTION"||(null==u?void 0:null===(a=u.telegram)||void 0===a?void 0:a.code)==="SERVICE_EXCEPTION",f=(null==u?void 0:u.code)==="TELEGRAM_EXCEPTION",y=f&&(null==u?void 0:u.message)==="BALANCE_NOT_ENOUGH",b=f&&(null==u?void 0:u.message)==="PHONE_NUMBER_INVALID",S=f&&(null==u?void 0:u.message)==="FLOOD_WAIT_3",T=(null==u?void 0:u.code)==="SERVICE_EXCEPTION"&&(null==u?void 0:u.message)==="ExternalServiceError";
1if(E){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(v){H(null==u?void 0:null===(i=u.data)||void 0===i?void 0:i.expired),D(!0);return}if(m){G(null==u?void 0:null===(n=u.data)||void 0===n?void 0:n.expired),k(!0);return}if(y){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(b){r(d.RZ.OTP_TELEGRAM_NOT_REGISTERED);return}if(S||T){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(p){let e=null==u?void 0:null===(o=u.data)||void 0===o?void 0:o.captcha,t=null==u?void 0:null===(c=u.data)||void 0===c?void 0:c.key;s(r=>{var a;return{...r,challenge:{type:"captcha",endpoint:_,payload:{phone:null==l?void 0:null===(a=l.loginData)||void 0===a?void 0:a.emailOrPhone,providers:["telegram"]},nextStep:d.RZ.OTP_TELEGRAM_V2,fromStep:d.RZ.OTP_TELEGRAM_V2,captcha:{src:e,key:t}}}}),r(d.RZ.CAPTCHA)}g(e=>{p||(e.hasCodeError=!0,e.codeErrorText=d.Sr[null==u?void 0:u.code]||d._R[null==u?void 0:u.code]||d._R[null==u?void 0:u.message]||d.Sr[null==u?void 0:u.message]||"ЧÑо-Ñо поÑло не Ñак...")}),j(!0),C(!1)}}catch(e){console.error("Error requesting new code:",e),j(!0),C(!1),g(e=>{e.hasCodeError=!0,e.codeErrorText="ТеÑ
ниÑеÑÐºÐ°Ñ Ð½ÐµÐ¿Ð¾Ð»Ð°Ð´ÐºÐ°. ÐопÑобÑйÑе позже"})}},ei=async()=>{var e,t;R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"send_code_another_method",element_attributes_text:"ÐÑпÑавиÑÑ Ð´ÑÑгим ÑпоÑобом",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"});let a="".concat(v).concat(T.PI.phoneAuthOTP).concat(y),i={phone:null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.emailOrPhone,providers:["sms","email"]};g(e=>{e.isWork=!0});try{let e=await fetch(a,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)}),n=await e.json();if(e.status<400){let e=null!==(t=null==n?void 0:n.provider)&&void 0!==t?t:null==n?void 0:n.providers,a=Array.isArray(e)?e:e?[e]:[],i="string"==typeof(null==n?void 0:n.email)?n.email:"",o=a.includes("email"),l=a.includes("sms"),c=o&&i;s(e=>({...e,authType:d.tG.LOGIN,userProfileData:n,...c&&{loginData:{...e.loginData||{},providerEmail:i},emailOtpByPhoneReferer:"code_tg"}})),c?r(d.RZ.EMAIL_OTP_BY_PHONE):(l||a.length,r(d.RZ.PHONE_OTP_V2))}else R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:n&&d.pO.includes(n.code)?"error_captcha":"error",action_result:d.Sr[n.code]||d.Sr[n.message]||n.message||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:a,...n&&!d.pO.includes(n.code)&&{action_parameter:"login_registration"},referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"}),en(n,a)}catch(e){en()}finally{g(e=>{e.isWork=!1})}},en=(e,t)=>{var a,i,n,o;let c=e&&e.code&&d.pO.includes(e.code),_=e&&e.code&&d.jb.includes(e.code),u=_&&(null==e?void 0:e.code)==="TELEGRAM_LIMIT_EXCEEDED",p=_&&(null==e?void 0:e.code)==="SMS_LIMIT_EXCEEDED",h=(null==e?void 0:e.code)==="TELEGRAM_EXCEPTION"||(null==e?void 0:e.code)==="SERVICE_EXCEPTION"||(null==e?void 0:null===(a=e.telegram)||void 0===a?void 0:a.code)==="TELEGRAM_EXCEPTION"||(null==e?void 0:null===(i=e.telegram)||void 0===i?void 0:i.code)==="SERVICE_EXCEPTION",m=(null==e?void 0:e.code)==="TELEGRAM_EXCEPTION",v=m&&(null==e?void 0:e.message)==="BALANCE_NOT_ENOUGH",E=m&&(null==e?void 0:e.message)==="PHONE_NUMBER_INVALID",f=m&&(null==e?void 0:e.message)==="FLOOD_WAIT_3",y=(null==e?void 0:e.code)==="SERVICE_EXCEPTION"&&(null==e?void 0:e.message)==="ExternalServiceError";if(h){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(p){H(null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.expired),D(!0);return}if(u){G(null==e?void 0:null===(o=e.data)||void 0===o?void 0:o.expired),k(!0);return}if(v){r(d.RZ.OTP_TELEGRAM_ERROR);return}if(E){r(d.RZ.OTP_TELEGRAM_NOT_REGISTERED);return}if(f||y){r(d.RZ.OTP_TELEGRAM_ERROR);return}g(a=>{if(c){var i,n;let a=null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.captcha,o=null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.key;s(e=>{var r;return{...e,challenge:{type:"captcha",endpoint:t,payload:{phone:null==l?void 0:null===(r=l.loginData)||void 0===r?void 0:r.emailOrPhone,providers:["sms","email"]},nextStep:d.RZ.PHONE_OTP_V2,fromStep:d.RZ.OTP_TELEGRAM_V2,captcha:{src:a,key:o}}}}),r(d.RZ.CAPTCHA)}else a.hasCodeError=!0,a.codeErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."})};return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:h()(f().container,{[f().overflowVisible]:B}),onKeyDown:e=>(0,m.jS)(e,Q),children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из\xa0",(0,a.jsx)("img",{className:h()(f().iconCentered,f().tgIcon),src:"/static/images/auth/logo-telegram.svg",alt:"logo telegram"}),"\xa0Telegram,",(0,a.jsx)("br",{}),"оÑпÑавили на\xa0номеÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:(0,o.jW)(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone)}})]}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{Q(e)},errorText:p.hasCodeError?p.codeErrorText:"",value:p.code,onChange:e=>{g(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:p.isWork,onFocus:()=>{R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из Telegram",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"})}})}),(0,a.jsx)("div",{className:h()(f().field,f().field_otpV2),children:(0,a.jsx)(J.S,{checked:p.info,onChange:()=>{g(e=>{e.info=!e.info}),s(e=>({...e,isWantSpam:!p.info})),R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"checkbox",element_attributes_id:"notifications",element_attributes_text:"Я ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а Ñакже на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
Ð´Ð»Ñ ÐµÑ Ð¾ÑпÑавки",action_result:!p.info,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},name:"notifications",id:"notifications",label:(0,a.jsxs)("span",{children:["Я\xa0ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а\xa0Ñакже\xa0на\xa0",(0,a.jsx)(X(),{className:f().consent_link,prefetch:!1,href:"/legal/consent",target:"_blank",rel:"noopener noreferrer",onClick:e=>{var t;R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"link",element_attributes_id:"personal_data_with_notification",element_attributes_text:null==e?void 0:null===(t=e.currentTarget)||void 0===t?void 0:t.innerText,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},children:"обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
"}),"\xa0длÑ\xa0еÑ\xa0оÑпÑавки"]}),dontShoot:!0})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:I,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>Q(p.code),isLoading:p.isWork,isDisabled:p.isWork,className:f().button}),w&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_otpCode),children:["СлиÑком много попÑÑок ввода.",(0,a.jsx)("br",{}),"ÐопÑобÑйÑе Ñнова ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown,f().countdown_limit),children:W})]})}),L&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_tgOtpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов Ð´Ð»Ñ Ð¡ÐС. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:U})]})}),(0,a.jsxs)("div",{className:f().descriptionWrapper,children:[(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:"Ðе пÑиÑÑл код в Telegram",onClick:()=>{let e=!B;z&&e&&(0,m.cs)(),K(e=>!e),R({screen_type:"login_registration",screen_attributes_id:"code_tg",action_id:"click",element_type:"button",element_attributes_id:"no_tg_code",element_attributes_text:"Ðе пÑиÑÑл код Telegram",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_phone"})},size:b.GO.REGULAR,variant:b.Vt.TERTIARY,"data-testid":"otp_get_new_code_button",fullWidth:!0}),z?(0,a.jsxs)(eo,{isOpen:B,title:"ÐÑпÑавиÑÑ ÐºÐ¾Ð´ повÑоÑно",onClose:()=>K(!1),children:[(0,a.jsxs)(ea,{disabled:!P||w,icon:"/static/images/auth/telegram_filled.svg",alt:"telegram icon",className:f().tooltipButton,onClick:()=>er(),children:["ÐÑпÑавиÑÑ Ð² Telegram ",!P&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(O)})]}),(0,a.jsx)(ea,{disabled:L,text:"ÐÑпÑавиÑÑ Ð´ÑÑгим ÑпоÑобом",icon:"/static/images/auth/mail_outlined.svg",alt:"mail icon",className:f().tooltipButton,onClick:()=>ei()})]}):(0,a.jsxs)(ee,{visible:B,ref:Y,children:[(0,a.jsxs)(ea,{disabled:!P||w,icon:"/static/images/auth/telegram_filled.svg",alt:"telegram icon",onClick:()=>er(),children:["ÐÑпÑавиÑÑ ÐµÑÑ Ñаз ",!P&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(O)})]}),(0,a.jsx)(ea,{disabled:L,text:"ÐÑпÑавиÑÑ Ð´ÑÑгим ÑпоÑобом",icon:"/static/images/auth/mail_outlined.svg",alt:"mail icon",onClick:()=>ei()})]})]})]})})},Error:e=>{let{dto:t}=e,r=c.Ay.useClickHouseShoot(),n=c.Ay.useResponsiveButtonSize();return(0,i.useEffect)(()=>{let e=setTimeout(()=>{(null==t?void 0:t.authType)!==d.tG.RECOVERY_FROM_SETTINGS_UNSET&&l().push("/account")},3e3);return()=>{clearTimeout(e)}},[t]),(0,i.useEffect)(()=>{(null==t?void 0:t.authType)===d.tG.RECOVERY_FROM_SETTINGS_UNSET&&r({screen_type:em.LOGIN,screen_attributes_id:"recover_password_by_support",action_id:"screenview",referer_screen_type:"account_edit",referer_screen_attributes_id:"settings"})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START Ð
1Ñ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:h()(f().container,f().container_success),children:[(0,a.jsxs)("div",{className:f().socialError,children:[(0,a.jsx)("img",{className:f().successIcon,src:"/static/images/auth/errorIcon.svg",alt:"ÐÑибка"}),(0,a.jsx)("div",{className:h()(f().title,f().title_success,f().title_error),children:(null==t?void 0:t.authType)===d.tG.RECOVERY_FROM_SETTINGS_UNSET?"ÐÐ»Ñ Ð²Ð¾ÑÑÑÐ°Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¿Ð°ÑÐ¾Ð»Ñ Ð½Ð°Ð¿Ð¸ÑиÑе в поддеÑжкÑ":"ТеÑ
ниÑеÑÐºÐ°Ñ Ð½ÐµÐ¿Ð¾Ð»Ð°Ð´ÐºÐ°. СкоÑо вÑÑ Ð¿Ð¾Ñиним. ÐопÑобÑйÑе позже"}),(null==t?void 0:t.authType)===d.tG.RECOVERY_FROM_SETTINGS_UNSET&&(0,a.jsx)("div",{className:h()(f().description,f().description_recoveryError),children:"У Ð²Ð°Ñ Ð½Ðµ Ð´Ð¾Ð±Ð°Ð²Ð»ÐµÐ½Ñ ÑелеÑон или поÑÑа, ÑÑÐ¾Ð±Ñ ÑделаÑÑ ÑÑо ÑамоÑÑоÑÑелÑно"})]}),(null==t?void 0:t.authType)===d.tG.RECOVERY_FROM_SETTINGS_UNSET&&(0,a.jsx)("div",{className:f().button_socialError,children:(0,a.jsx)(b.$n,{testid:"signin_button",variant:b.Vt.PRIMARY,size:n,title:"ÐонÑÑно",fullWidth:!0,onClick:()=>l().push("/account"),className:h()(f().button)})})]})]})},EmailOTP:e=>{var t;let{changeStep:r,setDto:s,dto:l,setIsDisclaimerVisible:_}=e,u=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[p,g]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",info:!1}),v=c.Ay.useApiUrl(),E=c.Ay.useApiKey(),y=c.Ay.useResponsiveButtonSize(),R=c.Ay.useClickHouseShoot(),[I,O]=(0,i.useState)(d.xS),[A,N]=(0,i.useState)(!0),[C,P]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!1),[k,L]=(0,i.useState)(null),[D,M]=(0,i.useState)(null),[G,W]=(0,i.useState)(!1),V=(0,i.useRef)(null),Z=(0,n.d4)(e=>e.systemInformation.windowInnerWidth)<=x.xW.TABLET_WIDE,H=(0,n.d4)(e=>e.systemInformation.startDeviceId);(0,i.useEffect)(()=>{let e=e=>{V.current&&!V.current.contains(e.target)&&W(!1)};return G?document.addEventListener("mousedown",e):document.removeEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[G]),(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=D-Math.floor(Date.now()/1e3);if(t<=0)w(!1),clearInterval(e),L("00:00");else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");L("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[D]),(0,i.useEffect)(()=>{_&&_(!(Z&&G))},[Z,G,_]),(0,i.useEffect)(()=>{let e=null;return A&&I>0?e=setInterval(()=>{O(e=>e-1)},1e3):0===I&&(N(!1),P(!0)),()=>clearInterval(e)},[A,I]),(0,i.useEffect)(()=>{N(!0),P(!1)},[]),(0,i.useEffect)(()=>{var e,t;s(e=>{var t,r;return{...e,clickHouse:{attributesId:(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"code_email":"code_sms",refererScreenType:"login",referer_screen_attributes_id:(null==l?void 0:null===(r=l.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"}}}),R({screen_type:"login_registration",screen_attributes_id:(null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})},[]),(0,i.useEffect)(()=>{let e=document.getElementById("pin-0");e&&e.focus()},[]);let U=e=>{let t="",r=!1;if(e.length)e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ");else{var a;r=!0,t=(null==l?void 0:null===(a=l.loginData)||void 0===a?void 0:a.type)===d.bh.EMAIL?"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из пиÑÑма":"ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из СÐС"}return g(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},F=async e=>{var t,a,i,n,c,_,p,h;R({screen_type:"login_registration",screen_attributes_id:(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:(null==l?void 0:null===(a=l.loginData)||void 0===a?void 0:a.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"});let m=U(e);if(B(m),m){g(e=>{e.isWork=!0});let t=null==l?void 0:null===(i=l.loginData)||void 0===i?void 0:i.emailOrPhone,a="".concat(v).concat(T.PI.emailAuthOTPConfirm).concat(E),m={email:t,code:e,...(null==l?void 0:l.isWantSpam)&&{notification_types:["email"]}},f=await fetch(a,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(f.status<400){let e=await f.json();r(d.RZ.SUCCESS),s(t=>({...t,authType:200===f.status?d.tG.LOGIN:d.tG.REGISTER,userProfileData:e})),(0,o.EF)(),R({screen_type:200===f.status?d.sv.LOGIN:d.sv.REGISTRATION,screen_attributes_id:"success",account_id:e._id,action_result:"email_otp",profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:200===f.status?d.sv.LOGIN:d.sv.REGISTRATION,virtual_profile_id:null==u?void 0:u._id,event_time:new Date().getTime(),referer_screen_type:"login_registration",referer_screen_attributes_id:"send_code_email"})}else{let t=await f.json();if(g(e=>{e.isWork=!1}),t&&t.code&&d.jb.includes(t.code)){M(null==t?void 0:null===(_=t.data)||void 0===_?void 0:_.expired),w(!0);return}let i=t&&t.code&&d.pO.includes(t.code);
1if(i){let i=null==t?void 0:null===(p=t.data)||void 0===p?void 0:p.captcha,n=null==t?void 0:null===(h=t.data)||void 0===h?void 0:h.key;s(t=>{var r;return{...t,challenge:{type:"captcha",endpoint:a,payload:{device_id:H,device_type:"web",client_platform:"start",email:null==l?void 0:null===(r=l.loginData)||void 0===r?void 0:r.emailOrPhone,code:e},nextStep:d.RZ.SUCCESS,fromStep:d.RZ.EMAIL_OTP,successAnalytics:{actionResult:"email_otp",refererScreenType:"login_registration",refererScreenAttributesId:"send_code_email"},captcha:{src:i,key:n}}}}),r(d.RZ.CAPTCHA)}g(e=>{e.isWork=!1,i||(e.isWork=!1,e.hasCodeError=!0,e.codeErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло не Ñак...")}),R({screen_type:"login_registration",screen_attributes_id:(null==l?void 0:null===(n=l.loginData)||void 0===n?void 0:n.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"error",action_result:d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[t.message]||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:a,action_parameter:"login_registration",referer_screen_type:"login_registration",referer_screen_attributes_id:(null==l?void 0:null===(c=l.loginData)||void 0===c?void 0:c.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})}}},B=e=>{var t,r,a;R({screen_type:"login_registration",screen_attributes_id:(null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из ".concat((null==l?void 0:null===(r=l.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"пиÑÑма":"СÐС"),referer_screen_type:"login_registration",referer_screen_attributes_id:(null==l?void 0:null===(a=l.loginData)||void 0===a?void 0:a.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})},K=async()=>{var e,t;P(!1),N(!0),O(d.xS),R({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"click",element_type:"button",element_attributes_id:"new_code",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login_registration",referer_screen_attributes_id:"send_code_email"});let a=null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.emailOrPhone,i="".concat(v).concat(T.PI.emailAuthOTP).concat(E);try{let e=await fetch(i,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:a})});if(e.status>=400){let a=await e.json(),n=a&&a.code&&d.pO.includes(a.code);if(a&&a.code&&d.jb.includes(a.code)){M(null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.expired),w(!0);return}g(e=>{if(e.isWork=!1,n||(e.isWork=!1,e.hasCodeError=!0,e.codeErrorText=d.Sr[null==a?void 0:a.code]||d._R[null==a?void 0:a.code]||d._R[null==a?void 0:a.message]||d.Sr[null==a?void 0:a.message]||"ЧÑо-Ñо поÑло не Ñак..."),n){var t,o;let e=null==a?void 0:null===(t=a.data)||void 0===t?void 0:t.captcha,n=null==a?void 0:null===(o=a.data)||void 0===o?void 0:o.key;s(t=>{var r;return{...t,challenge:{type:"captcha",endpoint:i,payload:{device_id:H,device_type:"web",client_platform:"start",email:null==l?void 0:null===(r=l.loginData)||void 0===r?void 0:r.emailOrPhone},nextStep:d.RZ.EMAIL_OTP,fromStep:d.RZ.EMAIL_OTP,captcha:{src:e,key:n}}}}),r(d.RZ.CAPTCHA)}}),P(!0),N(!1)}}catch(e){console.error("Error requesting new code:",e),P(!0),N(!1),g(e=>{e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}};return(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,F),children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из пиÑÑма,",(0,a.jsx)("br",{}),"оÑпÑавили на поÑÑÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.emailOrPhone}})]}),(0,a.jsx)("div",{className:h()(f().description,f().description_otp),children:"ÐÑли пиÑÑма неÑ, пÑовеÑÑÑе Спам"}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{F(e)},errorText:p.hasCodeError?p.codeErrorText:"",value:p.code,onChange:e=>{g(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:p.isWork,onFocus:()=>{var e,t,r;R({screen_type:"login_registration",screen_attributes_id:(null==l?void 0:null===(e=l.loginData)||void 0===e?void 0:e.type)===d.bh.EMAIL?"code_email":"code_sms",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из ".concat((null==l?void 0:null===(t=l.loginData)||void 0===t?void 0:t.type)===d.bh.EMAIL?"пиÑÑма":"СÐС"),referer_screen_type:"login_registration",referer_screen_attributes_id:(null==l?void 0:null===(r=l.loginData)||void 0===r?void 0:r.type)===d.bh.EMAIL?"send_code_email":"send_code_sms"})}})}),(0,a.jsx)("div",{className:h()(f().field,f().field_otpV2),children:(0,a.jsx)(J.S,{checked:p.info,onChange:()=>{g(e=>{e.info=!e.info}),s(e=>({...e,isWantSpam:!p.info})),R({screen_type:"login_registration",screen_attributes_id:"by_email",action_id:"click",element_type:"checkbox",element_attributes_id:"notifications",element_attributes_text:"Я ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ Ñекламн
1ÑÑ ÑаÑÑÑлкÑ, а Ñакже на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
Ð´Ð»Ñ ÐµÑ Ð¾ÑпÑавки",action_result:!p.info,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},name:"notifications",id:"notifications",label:(0,a.jsxs)("span",{children:["Я\xa0ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а\xa0Ñакже\xa0на\xa0",(0,a.jsx)(X(),{className:f().consent_link,prefetch:!1,href:"/legal/consent",target:"_blank",rel:"noopener noreferrer",onClick:e=>{var t;R({screen_type:"login_registration",screen_attributes_id:"by_email",action_id:"click",element_type:"link",element_attributes_id:"personal_data_with_notification",element_attributes_text:null==e?void 0:null===(t=e.currentTarget)||void 0===t?void 0:t.innerText,referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},children:"обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
"}),"\xa0длÑ\xa0еÑ\xa0оÑпÑавки"]}),dontShoot:!0})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:y,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>F(p.code),isLoading:p.isWork,isDisabled:p.isWork,className:f().button}),j&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_tgOtpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:k})]})}),(0,a.jsxs)("div",{className:f().descriptionWrapper,children:[(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:"Ðе пÑиÑÑл код",onClick:()=>{let e=!G;Z&&e&&(0,m.cs)(),W(e=>!e),R({screen_type:"login_registration",screen_attributes_id:"by_email",action_id:"click",element_type:"button",element_attributes_id:"no_code",element_attributes_text:"Ðе пÑиÑÑл код",referer_screen_type:"login_registration",referer_screen_attributes_id:"by_email"})},size:b.GO.REGULAR,variant:b.Vt.TERTIARY,"data-testid":"otp_get_new_code_button",fullWidth:!0}),Z?(0,a.jsxs)(eo,{isOpen:G,title:"Ðе пÑиÑÑл код",onClose:()=>W(!1),children:[(0,a.jsxs)(ea,{disabled:!C||j,icon:"/static/images/auth/mail_outlined.svg",alt:"telegram icon",className:f().tooltipButton,onClick:()=>K(),children:["ÐÑпÑавиÑÑ ÐµÑÑ Ñаз ",!C&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(I)})]}),(0,a.jsx)(ea,{text:"ÐÐµÑ Ð´Ð¾ÑÑÑпа к поÑÑе",icon:"/static/images/auth/no_email_icon.svg",alt:"mail icon",className:f().tooltipButton,onClick:()=>r(d.RZ.SUPPORT)})]}):(0,a.jsxs)(ee,{visible:G,ref:V,children:[(0,a.jsxs)(ea,{disabled:!C||j,icon:"/static/images/auth/mail_outlined.svg",alt:"telegram icon",onClick:()=>K(),children:["ÐÑпÑавиÑÑ ÐµÑÑ Ñаз ",!C&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(I)})]}),(0,a.jsx)(ea,{text:"ÐÐµÑ Ð´Ð¾ÑÑÑпа к поÑÑе",icon:"/static/images/auth/no_email_icon.svg",alt:"mail icon",onClick:()=>r(d.RZ.SUPPORT)})]})]})]})},EmailOTPByPhone:e=>{var t,r;let{changeStep:s,setDto:l,dto:_,setIsDisclaimerVisible:u}=e,p=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),[g,v]=(0,S.e)({phone:"",password:"",code:"",hasCodeError:!1,codeErrorText:"",countdown:"",isWork:!1,hasCaptcha:!1,captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",info:!1}),E=c.Ay.useApiUrl(),y=c.Ay.useApiKey(),R=c.Ay.useResponsiveButtonSize(),{clientApiQuery:I}=c.Ay.useApiClientKey(),O=c.Ay.useClickHouseShoot(),[A,N]=(0,i.useState)(d.xS),[C,P]=(0,i.useState)(!0),[j,w]=(0,i.useState)(!1),[k,L]=(0,i.useState)(!1),[D,M]=(0,i.useState)(!1),[G,W]=(0,i.useState)(null),[V,Z]=(0,i.useState)("00:00"),[H,U]=(0,i.useState)(null),[F,B]=(0,i.useState)(null),[K,Y]=(0,i.useState)(!1),z=(0,i.useRef)(null),$=(0,n.d4)(e=>e.systemInformation.windowInnerWidth)<=x.xW.TABLET_WIDE,Q=(null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.providerEmail)||(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.emailOrPhone)||"",et=(null==_?void 0:_.emailOtpByPhoneReferer)||"login_registration";(0,i.useEffect)(()=>{let e=e=>{z.current&&!z.current.contains(e.target)&&Y(!1)};return K?document.addEventListener("mousedown",e):document.removeEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[K]),(0,i.useEffect)(()=>{let e=setInterval(()=>{let t=F-Math.floor(Date.now()/1e3);if(t<=0)L(!1),clearInterval(e),U("00:00");else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");U("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)},[F]),(0,i.useEffect)(()=>
1{if(D&&G){let e=setInterval(()=>{let t=G-Math.floor(Date.now()/1e3);if(t<=0)clearInterval(e),Z("00:00"),M(!1);else{let e=Math.floor(t/60),r=Math.floor(t%60),a=String(e).padStart(2,"0"),i=String(r).padStart(2,"0");Z("".concat(a,":").concat(i))}},1e3);return()=>clearInterval(e)}},[D,G]),(0,i.useEffect)(()=>{u&&u(!($&&K))},[$,K,u]),(0,i.useEffect)(()=>{let e=null;return C&&A>0?e=setInterval(()=>{N(e=>e-1)},1e3):0===A&&(P(!1),w(!0)),()=>clearInterval(e)},[C,A]),(0,i.useEffect)(()=>{P(!0),w(!1)},[]),(0,i.useEffect)(()=>{l(e=>({...e,clickHouse:{attributesId:"code_email",refererScreenType:"login_registration",referer_screen_attributes_id:et}})),O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:et})},[et]),(0,i.useEffect)(()=>{let e=document.getElementById("pin-0");e&&e.focus()},[]);let er=e=>{let t="",r=!1;return e.length?e.length<d.JK&&(r=!0,t="ÐажеÑÑÑ, неÑколÑкиÑ
Ñимволов не Ñ
ваÑаеÑ"):(r=!0,t="ÐÑ Ð·Ð°Ð±Ñли ввеÑÑи код из пиÑÑма"),v(e=>({...e,hasCodeError:r,codeErrorText:t})),!r},ei=async e=>{O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"click",element_type:"button",element_attributes_id:"continue",element_attributes_text:"ÐÑодолжиÑÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:et});let t=er(e);if(en(t),t){var r,a,i,n,c;v(e=>{e.isWork=!0});let t="".concat(E).concat(T.PI.phoneAuthOTPConfirm).concat(y),u=(null==_?void 0:null===(r=_.loginData)||void 0===r?void 0:r.phone)||(null==_?void 0:null===(a=_.loginData)||void 0===a?void 0:a.emailOrPhone),h={phone:u,code:e,...(null==_?void 0:_.isWantSpam)&&{notification_types:["email"]}},g=await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(h)});if(g.status<400){let e=await g.json();s(d.RZ.SUCCESS),l(t=>({...t,authType:200===g.status?d.tG.LOGIN:d.tG.REGISTER,userProfileData:e})),(0,o.EF)(),O({screen_type:200===g.status?d.sv.LOGIN:d.sv.REGISTRATION,screen_attributes_id:"success",account_id:e._id,action_result:"email_otp",profile_id:e.profile_id,account_type:e.type?e.type.toLowerCase():"",screen_attributes_ab_tag:e.tags||"",action_id:200===g.status?d.sv.LOGIN:d.sv.REGISTRATION,virtual_profile_id:null==p?void 0:p._id,event_time:new Date().getTime(),referer_screen_type:"login_registration",referer_screen_attributes_id:"code_email"})}else{let r=await g.json();if(v(e=>{e.isWork=!1}),r&&r.code&&d.jb.includes(r.code)){B(null==r?void 0:null===(i=r.data)||void 0===i?void 0:i.expired),L(!0);return}let a=r&&r.code&&d.pO.includes(r.code);if(a){let a=null==r?void 0:null===(n=r.data)||void 0===n?void 0:n.captcha,i=null==r?void 0:null===(c=r.data)||void 0===c?void 0:c.key;l(r=>({...r,challenge:{type:"captcha",endpoint:t,payload:{phone:u,code:e,...(null==_?void 0:_.isWantSpam)&&{notification_types:["email"]}},nextStep:d.RZ.SUCCESS,fromStep:d.RZ.EMAIL_OTP_BY_PHONE,successAnalytics:{actionResult:"email_otp",refererScreenType:"login_registration",refererScreenAttributesId:"code_email"},captcha:{src:a,key:i}}})),s(d.RZ.CAPTCHA)}v(e=>{e.isWork=!1,a||(e.isWork=!1,e.hasCodeError=!0,e.codeErrorText=d.Sr[null==r?void 0:r.code]||d._R[null==r?void 0:r.code]||d._R[null==r?void 0:r.message]||d.Sr[null==r?void 0:r.message]||"ЧÑо-Ñо поÑло не Ñак...")}),O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"error",action_result:d.Sr[null==r?void 0:r.code]||d._R[null==r?void 0:r.code]||d._R[null==r?void 0:r.message]||d.Sr[r.message]||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:t,action_parameter:"login_registration",referer_screen_type:"login_registration",referer_screen_attributes_id:et})}}},en=e=>{O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"text_input",action_parameter:e?"valid":"invalid",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из пиÑÑма",referer_screen_type:"login_registration",referer_screen_attributes_id:et})},es=async()=>{var e,t,r,a,i;w(!1),P(!0),N(d.xS),O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"click",element_type:"button",element_attributes_id:"new_code",element_attributes_text:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код",referer_screen_type:"login_registration",referer_screen_attributes_id:et});let n="".concat(E).concat(T.PI.phoneAuthOTP).concat(y),o=(null==_?void 0:null===(e=_.loginData)||void 0===e?void 0:e.phone)||(null==_?void 0:null===(t=_.loginData)||void 0===t?void 0:t.emailOrPhone);try{let e=await fetch(n,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providers:["email"],phone:o})});if(e.status>=400){let t=await e.json(),c=t&&t.code&&d.pO.includes(t.code),_=t&&t.code&&d.jb.includes(t.code),u=_&&(null==t?void 0:t.code)==="EMAIL_LIMIT_EXCEEDED",p=_&&(null==t?void 0:t.code)==="SMS_LIMIT_EXCEEDED";if(u){B(null==t?void 0:null===(r=t.data)||void 0===r?void 0:r.expired),L(!0);return}if(p){W(null==t?void 0:null===(a=t.data)||void 0===a?void 0:a.expired),M(!0);return}if(_){B(null==t?void 0:null===(i=t.data)||void 0===i?void 0:i.expired),L(!0);return}v(e=>{if(e.isWork=!1,c||(e.hasCodeError=!0,e.codeErrorText=d.Sr[null==t?void 0:t.code]||d._R[null==t?void 0:t.code]||d._R[null==t?void 0:t.message]||d.Sr[null==t?void 0:t.message]||"ЧÑо-Ñо поÑло Ð
1½Ðµ Ñак..."),c){var r,a;let e=null==t?void 0:null===(r=t.data)||void 0===r?void 0:r.captcha,i=null==t?void 0:null===(a=t.data)||void 0===a?void 0:a.key;l(t=>({...t,challenge:{type:"captcha",endpoint:n,payload:{phone:o,providers:["email"]},nextStep:d.RZ.EMAIL_OTP_BY_PHONE,fromStep:d.RZ.EMAIL_OTP_BY_PHONE,captcha:{src:e,key:i}}})),s(d.RZ.CAPTCHA)}}),w(!0),P(!1)}}catch(e){console.error("Error requesting new code:",e),w(!0),P(!1),v(e=>{e.hasCodeError=!0,e.codeErrorText="ÐÑоизоÑла оÑибка пÑи запÑоÑе нового кода"})}},el=async()=>{var e;O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"click",element_type:"button",element_attributes_id:"send_sms",element_attributes_text:"ÐÑпÑавиÑÑ Ð² СÐС",referer_screen_type:"login_registration",referer_screen_attributes_id:et});let t="".concat(E).concat(T.PI.phoneAuthOTP).concat(I),r={phone:null==_?void 0:null===(e=_.loginData)||void 0===e?void 0:e.emailOrPhone,providers:["sms"]};v(e=>{e.isWork=!0});try{let e=await fetch(t,{credentials:"include",method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),a=await e.json();e.status<400?(s(d.RZ.PHONE_OTP_V2),l(e=>({...e,authType:d.tG.LOGIN,userProfileData:a}))):(O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:a&&d.pO.includes(a.code)?"error_captcha":"error",action_result:d.Sr[a.code]||d.Sr[a.message]||a.message||"ЧÑо-Ñо поÑло не Ñак...",action_attributes_str:t,...a&&!d.pO.includes(a.code)&&{action_parameter:"login_registration"},referer_screen_type:"login_registration",referer_screen_attributes_id:et}),ec(a,t))}catch(e){ec()}finally{v(e=>{e.isWork=!1})}},ec=(e,t)=>{let r=e&&e.code&&d.pO.includes(e.code);if(e&&e.code&&d.jb.includes(e.code)&&(null==e?void 0:e.code)==="SMS_LIMIT_EXCEEDED"){var a;W(null==e?void 0:null===(a=e.data)||void 0===a?void 0:a.expired),M(!0);return}v(a=>{if(r){var i,n;let r=null==e?void 0:null===(i=e.data)||void 0===i?void 0:i.captcha,a=null==e?void 0:null===(n=e.data)||void 0===n?void 0:n.key;l(e=>{var i;return{...e,challenge:{type:"captcha",endpoint:t,payload:{phone:null==_?void 0:null===(i=_.loginData)||void 0===i?void 0:i.emailOrPhone,providers:["sms"]},nextStep:d.RZ.PHONE_OTP_V2,fromStep:d.RZ.EMAIL_OTP_BY_PHONE,captcha:{src:r,key:a}}}}),s(d.RZ.CAPTCHA)}else a.hasCodeError=!0,a.codeErrorText=d.Sr[null==e?void 0:e.code]||d._R[null==e?void 0:e.code]||d._R[null==e?void 0:e.message]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо поÑло не Ñак..."})};return(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,ei),children:[(0,a.jsxs)("div",{className:h()(f().title,f().title_main),children:["ÐведиÑе код из пиÑÑма,",(0,a.jsx)("br",{}),"оÑпÑавили на поÑÑÑ"]}),(0,a.jsxs)("div",{className:f().login,children:[(0,a.jsx)("div",{className:f().loginLabel}),(0,a.jsx)("div",{className:f().loginValue,dangerouslySetInnerHTML:{__html:Q}})]}),(0,a.jsx)("div",{className:h()(f().description,f().description_otp),children:"ÐÑли пиÑÑма неÑ, пÑовеÑÑÑе Спам"}),(0,a.jsx)("div",{className:f().codeField,children:(0,a.jsx)(q.A,{codeLength:d.JK,onComplete:e=>{ei(e)},errorText:g.hasCodeError?g.codeErrorText:"",value:g.code,onChange:e=>{v(t=>({...t,code:e,hasCodeError:!1,codeErrorText:""}))},disabled:g.isWork,onFocus:()=>{O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"code",element_attributes_text:"ÐведиÑе код из пиÑÑма",referer_screen_type:"login_registration",referer_screen_attributes_id:et})}})}),(0,a.jsx)("div",{className:h()(f().field,f().field_otpV2),children:(0,a.jsx)(J.S,{checked:g.info,onChange:()=>{v(e=>{e.info=!e.info}),l(e=>({...e,isWantSpam:!g.info})),O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"click",element_type:"checkbox",element_attributes_id:"notifications",element_attributes_text:"Я ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ ÑекламнÑÑ ÑаÑÑÑлкÑ, а Ñакже на обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
Ð´Ð»Ñ ÐµÑ Ð¾ÑпÑавки",action_result:!g.info,referer_screen_type:"login_registration",referer_screen_attributes_id:et})},name:"notifications",id:"notifications",label:(0,a.jsxs)("span",{children:["Я\xa0ÑоглаÑаÑÑÑ Ð¿Ð¾Ð»ÑÑаÑÑ Ñекламн
1ÑÑ ÑаÑÑÑлкÑ, а\xa0Ñакже\xa0на\xa0",(0,a.jsx)(X(),{className:f().consent_link,prefetch:!1,href:"/legal/consent",target:"_blank",rel:"noopener noreferrer",onClick:e=>{var t;O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"click",element_type:"link",element_attributes_id:"personal_data_with_notification",element_attributes_text:null==e?void 0:null===(t=e.currentTarget)||void 0===t?void 0:t.innerText,referer_screen_type:"login_registration",referer_screen_attributes_id:et})},children:"обÑабоÑÐºÑ Ð¿ÐµÑÑоналÑнÑÑ
даннÑÑ
"}),"\xa0длÑ\xa0еÑ\xa0оÑпÑавки"]}),dontShoot:!0})}),(0,a.jsx)(b.$n,{"data-testid":"signin_button_text",testid:"signin_button",variant:b.Vt.PRIMARY,size:R,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:()=>ei(g.code),isLoading:g.isWork,isDisabled:g.isWork,className:f().button}),k&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_tgOtpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:H})]})}),D&&(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsxs)("div",{className:h()(f().description,f().description_tgOtpCode),children:["ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов Ð´Ð»Ñ Ð¡ÐС. ",(0,a.jsx)("br",{}),"ÐапÑоÑиÑÑ Ð½Ð¾Ð²Ñй код можно ÑеÑез ",(0,a.jsx)("span",{className:f().countdown,children:V})]})}),(0,a.jsxs)("div",{className:f().descriptionWrapper,children:[(0,a.jsx)(b.$n,{className:h()(f().requestAnotherCode),title:"Ðе пÑиÑÑл код на поÑÑÑ",onClick:()=>{let e=!K;$&&e&&(0,m.cs)(),Y(e=>!e),O({screen_type:"login_registration",screen_attributes_id:"code_email",action_id:"click",element_type:"button",element_attributes_id:"no_code",element_attributes_text:"Ðе пÑиÑÑл код на поÑÑÑ",referer_screen_type:"login_registration",referer_screen_attributes_id:et})},size:b.GO.REGULAR,variant:b.Vt.TERTIARY,"data-testid":"otp_get_new_code_button",fullWidth:!0}),$?(0,a.jsxs)(eo,{isOpen:K,title:"Ðе пÑиÑÑл код на поÑÑÑ",onClose:()=>Y(!1),children:[(0,a.jsxs)(ea,{disabled:!j||k,icon:"/static/images/auth/mail_outlined.svg",alt:"telegram icon ",className:f().tooltipButton,onClick:()=>es(),children:["ÐÑпÑавиÑÑ ÐµÑÑ Ñаз ",!j&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(A)})]}),(0,a.jsxs)(ea,{disabled:!j,icon:"/static/images/auth/mail_outlined.svg",alt:"mail icon",className:f().tooltipButton,onClick:el,children:["ÐÑпÑавиÑÑ Ð² СÐС ",!j&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(A)})]})]}):(0,a.jsxs)(ee,{visible:K,ref:z,children:[(0,a.jsxs)(ea,{disabled:!j||k,icon:"/static/images/auth/mail_outlined.svg",alt:"telegram icon",onClick:()=>es(),children:["ÐÑпÑавиÑÑ ÐµÑÑ Ñаз ",!j&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(A)})]}),(0,a.jsxs)(ea,{disabled:!j,icon:"/static/images/auth/mail_outlined.svg",alt:"mail icon",onClick:el,children:["ÐÑпÑавиÑÑ Ð² СÐС ",!j&&(0,a.jsx)("span",{className:f().countdown,children:(0,m.fU)(A)})]})]})]})]})},Captcha:e=>{let{dto:t,setDto:r,changeStep:s}=e,l=(0,n.d4)(e=>{var t;return null===(t=e.profile)||void 0===t?void 0:t.currentProfile}),_=c.Ay.useClickHouseShoot(),u=c.Ay.useApiUrl(),{clientApiKey:p}=c.Ay.useApiClientKey(),g=c.Ay.useResponsiveButtonSize(),[E,y]=(0,S.e)({captcha:"",captchaImg:"",captchaKey:"",hasCaptchaError:!1,captchaErrorText:"",isWork:!1,referer_screen_type:"",referer_screen_attributes_id:""});(0,i.useEffect)(()=>{var e,a,i,n,o,s,l,c;let h=null==t?void 0:null===(a=t.challenge)||void 0===a?void 0:null===(e=a.captcha)||void 0===e?void 0:e.src,g=null==t?void 0:null===(n=t.challenge)||void 0===n?void 0:null===(i=n.captcha)||void 0===i?void 0:i.key,m=null==t?void 0:null===(s=t.challenge)||void 0===s?void 0:null===(o=s.captcha)||void 0===o?void 0:o.referer_screen_type,v=null==t?void 0:null===(c=t.challenge)||void 0===c?void 0:null===(l=c.captcha)||void 0===l?void 0:l.referer_screen_attributes_id;y(e=>
1{e.captchaKey=g||"",e.captchaImg=h?"".concat(u).concat(h,"&apikey=").concat(p,"&v=").concat(Date.now()):"",e.captcha="",e.hasCaptchaError=!1,e.captchaErrorText="",e.referer_screen_type=m,e.referer_screen_attributes_id=v}),r(e=>({...e,clickHouse:{attributesId:"captcha",refererScreenType:m,refererScreenAttributesId:v}})),_({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"captcha",action_id:"screenview",referer_screen_type:m,referer_screen_attributes_id:v})},[]);let T=e=>{let t=new URL(e);return t.searchParams.set("renew","true"),t.searchParams.set("v",Date.now().toString()),t.toString()},x=async()=>{if(_({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"captcha",action_id:"click",element_type:"button",element_attributes_id:"request_captcha",element_attributes_text:"/static/images/registration/refresh_1.svg",referer_screen_type:E.referer_screen_type,referer_screen_attributes_id:E.referer_screen_attributes_id}),!E.captchaImg)return;let e=T(E.captchaImg);y(t=>{t.captchaImg=e,t.captcha="",t.hasCaptchaError=!1,t.captchaErrorText=""})},R=()=>{var e,r,a,i,n;let o=null==t?void 0:null===(e=t.challenge)||void 0===e?void 0:e.successAnalytics;return(null==o?void 0:o.actionResult)?o.actionResult:(null==t?void 0:null===(r=t.challenge)||void 0===r?void 0:r.fromStep)===d.RZ.EMAIL_OTP||(null==t?void 0:null===(a=t.challenge)||void 0===a?void 0:a.fromStep)===d.RZ.EMAIL_OTP_BY_PHONE?"email_otp":(null==t?void 0:null===(i=t.challenge)||void 0===i?void 0:i.fromStep)===d.RZ.OTP_TELEGRAM_V2?"tg_otp":(null==t?void 0:null===(n=t.loginData)||void 0===n?void 0:n.type)===d.bh.EMAIL?"email_otp":"by_phone"},I=(e,r)=>{var a;let i=(null==t?void 0:null===(a=t.challenge)||void 0===a?void 0:a.successAnalytics)||{},n=200===r?d.sv.LOGIN:d.sv.REGISTRATION;(0,o.EF)(),_({screen_type:n,screen_attributes_id:"success",account_id:null==e?void 0:e._id,profile_id:null==e?void 0:e.profile_id,account_type:(null==e?void 0:e.type)?e.type.toLowerCase():"",screen_attributes_ab_tag:(null==e?void 0:e.tags)||"",action_id:n,action_result:R(),virtual_profile_id:null==l?void 0:l._id,event_time:new Date().getTime(),...i.refererScreenType&&{referer_screen_type:i.refererScreenType},...i.refererScreenAttributesId&&{referer_screen_attributes_id:i.refererScreenAttributesId}})},O=async()=>{var e,a,i,n,o,l;if(!E.isWork&&(null==t?void 0:null===(e=t.challenge)||void 0===e?void 0:e.endpoint)){if(!E.captcha||E.captcha.length<1){y(e=>{e.hasCaptchaError=!0,e.captchaErrorText="ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки"});return}A(),_({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"captcha",action_id:"click",element_type:"button",element_attributes_id:"continue",referer_screen_type:E.referer_screen_type,referer_screen_attributes_id:E.referer_screen_attributes_id}),y(e=>{e.isWork=!0});try{let e=t.challenge.endpoint,c=t.challenge.payload||{},h=await fetch(e,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({...c,key:E.captchaKey,captcha:E.captcha})}),g=await h.json().catch(()=>({}));if(h.ok){let e=null==t?void 0:null===(a=t.loginData)||void 0===a?void 0:a.type,n=null!==(i=t.challenge.nextStep)&&void 0!==i?i:d.RZ.CORE,o=n===d.RZ.SUCCESS,l=t.challenge.fromStep===d.RZ.CORE||t.challenge.fromStep===d.RZ.MFPhone,c=t.challenge.fromStep===d.RZ.OTP_TELEGRAM_V2,_="string"==typeof(null==g?void 0:g.email)?g.email:"",u=e===d.bh.PHONE&&(null==g?void 0:g.provider)==="email"&&_,p=l?"login_registration":c?"code_tg":void 0;if(o&&I(g,h.status),r(t=>({...t,challenge:void 0,...o?{authType:200===h.status?d.tG.LOGIN:d.tG.REGISTER,userProfileData:g}:{},...l&&e?{authMethod:e}:{},...u?{loginData:{...t.loginData||{},providerEmail:_},emailOtpByPhoneReferer:p}:{}})),l){if((null==g?void 0:g.provider)==="telegram"){s(d.RZ.OTP_TELEGRAM_V2);return}if((null==g?void 0:g.provider)==="sms"){s(d.RZ.PHONE_OTP_V2);return}}if(u){s(d.RZ.EMAIL_OTP_BY_PHONE);return}s(n)}else if(_({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"captcha",action_attributes_str:e,action_id:"error_captcha",referer_screen_type:E.referer_screen_type,referer_screen_attributes_id:E.referer_screen_attributes_id}),g&&g.code&&d.pO.includes(g.code)){let e=(null==g?void 0:null===(n=g.data)||void 0===n?void 0:n.key)||E.captchaKey,t=null==g?void 0:null===(o=g.data)||void 0===o?void 0:o.captcha,a=t?"".concat(u).
1concat(t,"&apikey=").concat(p,"&v=").concat(Date.now()):E.captchaImg?T(E.captchaImg):"";y(t=>{t.captcha="",t.captchaKey=e,t.captchaImg=a,t.hasCaptchaError=!0,t.captchaErrorText=d.Sr[null==g?void 0:g.code]||d.Sr[null==g?void 0:g.message]||(null==g?void 0:g.message)||"ÐевеÑнÑй код"}),r(r=>{var a,i;return{...r,challenge:{...r.challenge,captcha:{src:t||(null===(i=r.challenge)||void 0===i?void 0:null===(a=i.captcha)||void 0===a?void 0:a.src),key:e}}}})}else{let a=(null==t?void 0:null===(l=t.challenge)||void 0===l?void 0:l.fromStep)||d.RZ.CORE;r(t=>({...t,challenge:void 0,challengeBounce:{endpoint:e,error:g,fromStep:a}})),s(a,!0)}}catch(e){_({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"captcha",action_id:"error_captcha",referer_screen_type:E.referer_screen_type,referer_screen_attributes_id:E.referer_screen_attributes_id}),y(e=>{e.hasCaptchaError=!0,e.captchaErrorText="СеÑÑ Ð½ÐµÐ´Ð¾ÑÑÑпна. ÐопÑобÑйÑе еÑÑ Ñаз."})}finally{y(e=>{e.isWork=!1})}}},A=()=>{_({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"captcha",action_id:"text_input",action_parameter:E.hasCaptchaError?"invalid":"valid",element_type:"input",element_attributes_id:"captcha",element_attributes_text:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",referer_screen_type:E.referer_screen_type,referer_screen_attributes_id:E.referer_screen_attributes_id})};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START РегиÑÑÑаÑиÑ",description:"ÐодÑвеÑдиÑе, ÑÑо Ð²Ñ Ð½Ðµ ÑобоÑ"}),(0,a.jsxs)("div",{className:f().container,onKeyDown:e=>(0,m.jS)(e,O),children:[(0,a.jsx)("div",{className:h()(f().title,f().title_captcha),children:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки"}),(0,a.jsx)("div",{className:h()(f().login),children:"Ðам нÑжно ÑбедиÑÑÑÑ, ÑÑо Ð²Ñ Ð½Ðµ ÑобоÑ"}),(0,a.jsxs)("div",{className:h()(Y().container,Y().container_standAlone),children:[(0,a.jsxs)("div",{className:h()(Y().section,Y().section_standAlone),children:[E.captchaImg.length>0?(0,a.jsx)("img",{className:Y().image,src:E.captchaImg,alt:"captcha"}):(0,a.jsx)("div",{className:Y().imagePlaceholder,children:"ÐагÑÑзка капÑиâ¦"}),(0,a.jsx)("img",{className:Y().refresh,src:"/static/images/registration/refresh_1.svg",alt:"refresh captcha",onClick:x})]}),(0,a.jsx)(B.A,{value:E.captcha,label:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",onChange:e=>{let t=e.target.value.replace(/\D+/g,"").slice(0,6);y(e=>{e.captcha=null!=t?t:"",e.hasCaptchaError=!1,e.captchaErrorText=""})},id:"captcha",type:"text",maxLength:"6",error:E.hasCaptchaError,errorText:E.captchaErrorText,darkTheme:!0,alwaysPlaceholder:!0,placeholder:"ЧиÑло Ñ ÐºÐ°ÑÑинки",onValidate:()=>{},updatedType:"captcha",noShoot:!0,onFocus:()=>{_({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"captcha",action_id:"text_input_start",action_parameter:"manual",element_type:"input",element_attributes_id:"captcha",element_attributes_text:"ÐведиÑе ÑиÑло Ñ ÐºÐ°ÑÑинки",referer_screen_type:E.referer_screen_type,referer_screen_attributes_id:E.referer_screen_attributes_id})}}),(0,a.jsx)(b.$n,{variant:b.Vt.PRIMARY,size:g,title:"ÐÑодолжиÑÑ",fullWidth:!0,onClick:O,isLoading:E.isWork,isDisabled:E.isWork,className:h()(f().button,f().button_clear)})]})]})]})},LimitError:e=>{let{dto:t,changeStep:r}=e,n=c.Ay.useClickHouseShoot(),o=c.Ay.useResponsiveButtonSize(),[s,l]=(0,i.useState)(()=>es(null==t?void 0:t.limitExpiredTime));return(0,i.useEffect)(()=>
1{l(es(null==t?void 0:t.limitExpiredTime))},[null==t?void 0:t.limitExpiredTime]),(0,i.useEffect)(()=>{if(s<=0)return;let e=setInterval(()=>{l(e=>e>0?e-1:0)},1e3);return()=>clearInterval(e)},[s]),(0,i.useEffect)(()=>{n({screen_type:d.sv.REGISTRATION,screen_attributes_id:"error_yandex ",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsx)("div",{className:h()(f().container,f().container_success),children:(0,a.jsxs)("div",{className:h()(f().socialError,f().socialError_limitError),children:[(0,a.jsx)("img",{className:f().successIcon,src:"/static/images/auth/errorIcon.svg",alt:"ÐÑибка"}),(0,a.jsx)("div",{className:h()(f().title,f().title_limitError,f().title_error),children:"ÐÑевÑÑен Ð»Ð¸Ð¼Ð¸Ñ Ð·Ð°Ð¿ÑоÑов"}),(0,a.jsx)("div",{className:f().descriptionWrapper,children:(0,a.jsx)(b.$n,{text:(0,a.jsx)("span",{children:"ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код ÑеÑез"}),title:(0,a.jsxs)(a.Fragment,{children:["ÐолÑÑиÑÑ Ð½Ð¾Ð²Ñй код ÑеÑез ",(0,a.jsx)("span",{className:h()(f().countdown),children:(0,m.fU)(s)})]}),onClick:()=>{},size:b.GO.REGULAR,variant:b.Vt.TERTIARY,"data-testid":"otp_get_new_code_button",fullWidth:!0})}),(0,a.jsx)(b.$n,{className:h()(f().button,f().button_limitError),testid:"signin_button",variant:b.Vt.SECONDARY,size:o,title:"ÐойÑи дÑÑгим ÑпоÑобом",fullWidth:!0,onClick:()=>{r((null==t?void 0:t.authEntryStep)||d.RZ.CORE),n({screen_type:d.sv.REGISTRATION,screen_attributes_id:"error_yandex ",action_id:"click",element_attributes_id:"auth_another_method",element_type:"button",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})}})]})})]})},Support:e=>{let{setDto:t}=e,r=c.Ay.useClickHouseShoot(),n=c.Ay.useResponsiveButtonSize();return(0,i.useEffect)(()=>{t(e=>({...e,clickHouse:{attributesId:"contact_support",refererScreenType:d.sv.LOGIN_REGISTRATION,refererScreenAttributesId:"code_email"}})),r({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"contact_support",action_id:"screenview",referer_screen_type:d.sv.LOGIN_REGISTRATION,referer_screen_attributes_id:"code_email"})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsx)("div",{className:h()(f().container,f().container_success),children:(0,a.jsxs)("div",{className:h()(f().socialError,f().socialError_supporrt),children:[(0,a.jsx)("img",{className:f().successIcon,src:"/static/images/auth/infoCircle_filled.svg",alt:"ÐоддеÑжка"}),(0,a.jsx)("div",{className:h()(f().title,f().title_support,f().title_error),children:"ÐбÑаÑиÑеÑÑ Ð²\xa0поддеÑжкÑ"}),(0,a.jsx)("div",{className:h()(f().codeSubtitle,f().codeSubtitle_support),children:"Ðоможем войÑи в\xa0аккаÑÐ½Ñ START, еÑли\xa0неÑ\xa0доÑÑÑпа к\xa0поÑÑе"}),(0,a.jsx)(b.$n,{className:h()(f().button,f().button_limitError),testid:"signin_button",variant:b.Vt.SECONDARY,size:n,title:"ÐапиÑаÑÑ Ð² поддеÑжкÑ",fullWidth:!0,onClick:()=>{r({screen_type:d.sv.LOGIN_REGISTRATION,screen_attributes_id:"contact_support",referer_screen_type:d.sv.LOGIN_REGISTRATION,referer_screen_attributes_id:"code_email",element_type:"button",element_attributes_id:"contact_support",action_id:"click"}),l().push("/support")}})]})})]})}};var ed=r(29965),e_=r.n(ed),eu=r(83417),ep=r.n(eu);let eh=e=>{if(null==e)return null;let t=Number(e);return Number.isNaN(t)?null:t>=1e3&&t%100==0?t/100:t},eg=e=>null==e?"":"".concat(e," â½"),em={LOGIN_REGISTRATION:"login_registration",LOGIN:"login",REGISTRATION:"registration"},ev={[d.RZ.CORE]:ec.Core,[d.RZ.SIGNIN]:ec.SignIn,[d.RZ.SIGNUP]:ec.SignUp,[d.RZ.SIGNUP_CONFIRM_EMAIL]:ec.SignUpConfirmEmail,[d.RZ.PHONE_CODE]:ec.PhoneCode,[d.RZ.PHONE_OTP_V2]:ec.PhoneOTPV2,[d.RZ.OTP]:ec.OTP,[d.RZ.REQUEST_OTP_CODE]:ec.RequestOTPCode,[d.RZ.REQUEST_TG_OTP_CODE]:ec.RequestTgOTPCode,[d.RZ.OTP_TELEGRAM_SIGNUP]:ec.OTPTelegramSignup,[d.RZ.OTP_TELEGRAM_SIGNIN]:ec.OTPTelegramSignin,[d.RZ.OTP_TELEGRAM_E
1RROR]:ec.OTPTelegramError,[d.RZ.OTP_TELEGRAM_NOT_REGISTERED]:ec.OTPTelegramNotRegistered,[d.RZ.OTP_TELEGRAM_V2]:ec.OTPTelegramV2,[d.RZ.EMAIL_OTP]:ec.EmailOTP,[d.RZ.EMAIL_OTP_BY_PHONE]:ec.EmailOTPByPhone,[d.RZ.MFPhone]:ec.MFPhone,[d.RZ.MEGAFON]:ec.Megafon,[d.RZ.MEGAFON_SIGNIN_CODE]:ec.MegafonSigninCode,[d.RZ.MEGAFON_SIGNUP_CODE]:ec.MegafonSignupCode,[d.RZ.SHOW_MORE]:ec.ShowMore,[d.RZ.SUCCESS]:ec.Success,[d.RZ.ERROR]:ec.Error,[d.RZ.CAPTCHA]:ec.Captcha,[d.RZ.LIMIT_ERROR]:ec.LimitError,[d.RZ.SUPPORT]:ec.Support,[d.RZ.PASSWORD_RECOVERY]:ec.PasswordRecovery,[d.RZ.PASSWORD_RECOVERY_CODE]:ec.PasswordRecoveryCode,[d.RZ.PASSWORD_RECOVERY_NEW_PASSWORD]:ec.PasswordRecoveryNewPassword,[d.RZ.PASSWORD_RECOVERY_INSTRUCTION_SENT_SCREEN]:ec.PasswordRecoveryInstructionSentScreen,[d.RZ.FORCE_LOGIN_WITH_PHONE]:ec.ForceLoginWithPhone,[d.RZ.SOCIAL_REGISTER_UNAVAILABLE]:ec.SocialRegisterUnavailable,[d.RZ.SOCIAL_COLLECT_CREDS]:ec.SocialCollectCreds,[d.RZ.CONFIRM_SOCIAL_PHONE_CODE]:ec.ConfirmSocialPhoneCode,[d.RZ.SOCIAL_SUCCESS]:e=>{let{dto:t}=e,r=(0,y.A)();return(0,i.useEffect)(()=>{let e=setTimeout(async()=>{await r(t.userProfileData)},1500);return()=>{clearTimeout(e)}},[t,r]),(0,i.useEffect)(()=>{"landing_PBNasledie"===(0,m.Ri)("utm_source")&&((0,m.zs)("utm_source"),window.location.href="https://belogorye.start.ru/census/"),"kolobcoin"===(0,m.Ri)("utm_source")&&((0,m.zs)("utm_source"),window.location.href="https://kolobcoin.start.ru"),"kiosk"===(0,m.Ri)("utm_source")&&"podpiska"!==(0,m.Ri)("utm_medium")&&((0,m.zs)("utm_source"),window.location.href="https://kiosk.start.ru");let e=new Date;e.setTime(e.getTime()+18e4),(0,o.TV)("showSubscribeNotifyPopupDelay","true",{expires:e})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:h()(f().container,f().container_success,f().container_success__social),children:[(0,a.jsx)("img",{className:f().successIcon,src:"/static/images/auth/successIcon.svg",alt:"УÑпеÑ
"}),(0,a.jsxs)("div",{className:h()(f().title,f().title_success),children:["ÐÑ Ð²Ð¾Ñли ÑеÑез ",t&&t.authType&&(e=>{switch(e){case d.tG.YANDEX:return"Ð¯Ð½Ð´ÐµÐºÑ ID";case d.tG.GOOGLE:return"Google";case d.tG.APPLE:return"Apple";default:return""}})(t.authType)]})]})]})},[d.RZ.SOCIAL_ERROR]:e=>{let{dto:t,changeStep:r}=e,n=c.Ay.useClickHouseShoot(),o=c.Ay.useResponsiveButtonSize();return(0,i.useEffect)(()=>{n({screen_type:d.sv.REGISTRATION,screen_attributes_id:"error_yandex ",action_id:"screenview",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},[]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsxs)("div",{className:h()(f().container,f().container_success),children:[(0,a.jsxs)("div",{className:f().socialError,children:[(0,a.jsx)("img",{className:f().successIcon,src:"/static/images/auth/errorIcon.svg",alt:"ÐÑибка"}),(0,a.jsx)("div",{className:h()(f().title,f().title_success,f().title_error),children:(e=>{var t;return(null==e?void 0:e.error)&&(null==e?void 0:null===(t=e.details)||void 0===t?void 0:t.access_token)?"ЧÑо-Ñо не Ñак, попÑобÑйÑе еÑÑ\xa0Ñаз":d.Sr[null==e?void 0:e.code]||d.Sr[null==e?void 0:e.message]||"ЧÑо-Ñо не Ñак, попÑобÑйÑе еÑÑ\xa0Ñаз"})(t.error)})]}),(0,a.jsx)("div",{className:f().button_socialError,children:(0,a.jsx)(b.$n,{testid:"signin_button",variant:b.Vt.PRIMARY,size:o,title:"ÐойÑи дÑÑгим ÑпоÑобом",fullWidth:!0,onClick:()=>{r(d.RZ.CORE),n({screen_type:d.sv.REGISTRATION,screen_attributes_id:"error_yandex ",action_id:"click",element_attributes_id:"auth_another_method",element_type:"button",referer_screen_type:"login_registration",referer_screen_attributes_id:"login_registration"})},className:h()(f().button)})})]})]})},[d.RZ.UPGRADE_LITE]:e=>{var t,r,s;let{dto:_}=e,u=c.Ay.useClickHouseShoot(),p=c.Ay.useApiUrl(),g=c.Ay.useApiKey(),{clientApiQuery:v,clientApiKey:E}=c.Ay.useApiClientKey(),f=null==_?void 0:null===(r=_.userProfileData)||void 0===r?void 0:null===(t=r.subscriptions)||void 0===t?void 0:t.find(e=>"lite"===e.acl_type),y=null!==(s=null==f?void 0:f.title)&&void 0!==s?s:"START",[S,R]=(0,i.useState)(null),[I,O]=(0,i.useState)(null),[A,N]=(0,i.useState)(null),[C,P]=(0,i.useState)(!0),j=480>=(0,n.d4)(e=>e.systemInformation.windowInnerWidth),w=(e,t)=>{if(!e){console.error("handleTariffPay >> url must be defined");return}let r=(0,m.Ij)(),a="".concat(p).concat(e).concat(v).concat(r),i=(0,T.fQ)(a),n=(0,m.Ri)("client_key");(0,T.BA)({url:i,clientKey:n||E||null,toPaymentTariffs:!t})},k=async()=>{try{let e="".concat(p).concat(T.PI.getTariffs).concat(g),t=await fetch(e,{credentials:"include",method:"GET"});if(!t.ok)return;let r=await t.json();if(Array.isArray(r)&&r.length>0){let e=r.find(e=>{var t;return null===(t=e.title)||void 0===t?void 0:t.toLowerCase().includes("premium")});e&&(O(eh(e.price)),N(e.url))}}catch(e){console.error("fetchTariffs error:",e)}finally{P(!1)}};return(0,i.useEffect)(()=>{k()},[]),(0,i.useEffect)(()=>{(async()=>{try{let e="".concat(p).concat(T.PI.tariffUpsaleToPremium).concat(g),t=await fetch(e,{credentials:"include",method:"GET"});if(!t.ok)return;let r=await t.json();if(Array.isArray(r)&&r.length>0){let e=r.find(e=>{var t;return null==e?void 0:null===(t=e.tariff_type)||void 0===t?void 0:t.toLowerCase().includes("premium")});e&&R(eh(e.price))}}catch(e){console.error("getBasePrice error:",e)}finally{P(!1)}})()},[]),(0,i.useEffect)(()=>{u({screen_type:"upgrade_sub",screen_attributes_id:"upgrade_sub",action_id:"screenview",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"success"})},[]),(0,a.jsx)("div",{className:ep().page,children:(0,a.jsxs)("div",{className:ep().container,children:[(0,a.jsxs)("h1",{className:ep().title,children:["У\xa0ваÑ\xa0подклÑÑена",(0,a.jsx)("br",{}),"паÑÑнÑÑÑÐºÐ°Ñ Ð¿Ð¾Ð´Ð¿Ð¸Ñка",(0,a.jsx)("br",{}),y]}),(0,a.jsxs)("div",{className:ep().row,children:[(0,a.jsx)("section",{className:h()(ep().col,ep().colLeft),children:(0,a.jsxs)("div",{className:h()(ep().card,ep().cardLite),children:[(0,a.jsxs)("header",{className:ep().cardHeader,children:[(0,a.jsx)(e_(),{className:ep().tierBaseImage,loader:
1o.R2,src:"/static/images/header/logo_white_V2.svg",alt:"start",width:187,height:28}),(0,a.jsx)("span",{className:ep().sub,children:j?"ÐаÑÑнÑÑÑÐºÐ°Ñ Ð¿Ð¾Ð´Ð¿Ð¸Ñка. ÐгÑаниÑеннÑй доÑÑÑп к\xa0каÑалогÑ":"ÐаÑÑнÑÑÑÐºÐ°Ñ Ð¿Ð¾Ð´Ð¿Ð¸Ñка"})]}),j&&(0,a.jsx)("img",{className:ep().separator,src:"/static/images/auth/separator.svg",alt:"СепаÑаÑоÑ"}),(0,a.jsxs)("div",{className:ep().feature,children:[(0,a.jsx)("div",{className:ep().metric,children:"ÐаÑалог"}),(0,a.jsx)("div",{className:ep().caption,children:"ÐгÑаниÑеннÑй доÑÑÑп"})]}),(0,a.jsxs)("div",{className:ep().feature,children:[(0,a.jsx)("div",{className:ep().metric,children:"ТÐ"}),(0,a.jsx)("div",{className:ep().caption,children:"ФедеÑалÑнÑе ÑелеканалÑ"})]}),j&&(0,a.jsx)("img",{className:ep().separator,src:"/static/images/auth/separator.svg",alt:"СепаÑаÑоÑ"}),(0,a.jsx)(b.$n,{className:h()(ep().btn,ep().btnGhost),variant:b.Vt.SECONDARY,size:b.GO.REGULAR,title:"ÐСТÐÐÐТЬ",fullWidth:!0,isDisabled:C,isLoading:C,onClick:()=>{u({screen_type:"upgrade_sub",screen_attributes_id:"upgrade_sub",action_id:"click",element_type:"button",element_attributes_id:"keep_lite_sub",element_attributes_text:"ÐÑÑавиÑÑ LITE",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"success"}),l().push((0,m.Ri)("auth_route")?(0,m.Ri)("auth_route"):"/")},"data-testid":"upgrade-lime-btn"})]})}),(0,a.jsx)("section",{className:h()(ep().col,ep().colRight),children:(0,a.jsx)("div",{className:ep().cardPremiumWrap,children:(0,a.jsxs)("div",{className:h()(ep().card,ep().premiumCard),children:[(0,a.jsxs)("header",{className:ep().cardHeader,children:[(0,a.jsx)("div",{className:ep().tierPremiumWrap,children:(0,a.jsx)("span",{className:ep().tierPremium,children:"PREMIUM"})}),(0,a.jsx)("span",{className:ep().sub,children:"ÐолнÑй доÑÑÑп к каÑалогÑ"})]}),j&&(0,a.jsx)("img",{className:ep().separator,src:"/static/images/auth/separator.svg",alt:"СепаÑаÑоÑ"}),(0,a.jsxs)("ul",{className:ep().features,children:[(0,a.jsxs)("li",{className:ep().feature,children:[(0,a.jsx)("div",{className:ep().metric,children:"150+"}),(0,a.jsx)("div",{className:ep().caption,children:"ХиÑовÑÑ
кино и ÑеÑиалов START"})]}),(0,a.jsxs)("li",{className:ep().feature,children:[(0,a.jsx)("div",{className:ep().metric,children:"1000+"}),(0,a.jsx)("div",{className:ep().caption,children:"ÐапиÑей миÑовÑÑ
Ñ
иÑов из ÑÑиÑа ТÐ"})]}),(0,a.jsxs)("li",{className:ep().feature,children:[(0,a.jsx)("div",{className:ep().metric,children:"120+"}),(0,a.jsx)("div",{className:ep().caption,children:"Телеканалов на лÑбой вкÑÑ"})]}),(0,a.jsxs)("li",{className:ep().feature,children:[(0,a.jsx)("div",{className:ep().metric,children:"ÐÐÐРУÐÐÐ"}),(0,a.jsx)("div",{className:ep().caption,children:j?"ÐлÑ\xa0пÑоÑмоÑÑа в\xa0ÑамолÑÑе, поезде\xa0или\xa0Ñам, где\xa0Ð½ÐµÑ ÑеÑи":"ÐÐ»Ñ Ð¿ÑоÑмоÑÑа без ÑеÑи"})]}),(0,a.jsx)("li",{className:ep().feature,children:(0,a.jsxs)("div",{className:ep().kids,children:["+ START Ð´Ð»Ñ Ð´ÐµÑей ",(0,a.jsx)("img",{src:"/static/images/auth/kid_toggle.svg",alt:"ÐеÑеклÑÑиÑÑ Ð½Ð° деÑÑкий пÑоÑилÑ"})]})})]}),j&&(0,a.jsx)("img",{className:ep().separator,src:"/static/images/auth/separator.svg",alt:"СепаÑаÑоÑ"}),(0,a.jsxs)("div",{className:ep().buttonBlock,children:[(0,a.jsx)(b.$n,{className:ep().btn,variant:b.Vt.PRIMARY,size:b.GO.REGULAR,title:"ÐÐÐÐÐЮЧÐТЬ".concat(j?"":" PREMIUM"),subtitle:"".concat(null!=I?eg(I):"..."," в меÑÑÑ"),fullWidth:!0,isDisabled:C,isLoading:C,onClick:()=>{if(u({screen_type:"upgrade_sub",screen_attributes_id:"upgrade_sub",action_id:"click",element_type:"button",element_attributes_id:"buy_premium",element_attributes_text:"ÐодклÑÑиÑÑ PREMIUM",referer_screen_type:d.sv.LOGIN,referer_screen_attributes_id:"success"}),A){let e=new Date;e.setMinutes(e.getMinutes()+x.nP),(0,m.TV)("fromUpgradeLiteAuthStep",!0,e),w(A)}},"data-testid":"upgrade-premium-btn"}),(0,a.jsxs)("p",{className:ep().notice,children:["ÐпÑÐ¸Ñ Ð´ÐµÐ¹ÑÑвÑÐµÑ Ñ\xa0паÑÑнÑÑÑкой подпиÑкой. Ðез\xa0подпиÑки Ð²Ñ Ð¿ÐµÑейдÑÑе на\xa0START\xa0PREMIUM за\xa0",null!=S?eg(S):"...","\xa0меÑÑÑ, ÑоÑ
Ñанив пÑеимÑÑеÑÑва"]})]})]})})})]})]})})}},eE=e=>{var t,r,a,i,n,o,s,l,c,_,u;let p=null!==(c=null==e?void 0:null===(t=e.clickHouse)||void 0===t?void 0:t.attributesId)&&void 0!==c?c:null==e?void 0:null===(r=e.clickHouse)||void 0===r?void 0:r.attributes_id,h=null!==(_=null==e?void 0:null===(a=e.clickHouse)||void 0===a?void 0:a.refererScreenType)&&void 0!==_?_:null==e?void 0:null===(i=e.clickHouse)||void 0===i?void 0:i.referer_screen_type,g=null!==(u=null==e?void 0:null===(n=e.clickHouse)||void 0===n?void 0:n.refererScreenAttributesId)&&void 0!==u?u:null==e?void 0:null===(o=e.clickHouse)||void 0===o?void 0:o.referer_screen_attributes_id;return{[d.RZ.CORE]:{type:em.LOGIN_REGISTRATION,attributesId:null,refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:em.LOGIN_REGISTRATION},[d.RZ.MFPhone]:{type:em.LOGIN_REGISTRATION,attributesId:"login_registration_mf",refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:em.LOGIN_REGISTRATION},[d.RZ.SIGNIN]:{type:em.LOGIN,attributesId:null,refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:em.LOGIN_REGISTRATION},[d.RZ.SIGNUP]:{type:em.REGISTRATION,attributesId:null,refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:em.LOGIN_REGISTRATION},[d.RZ.PHONE_CODE]:{type:em.REGISTRATION,attributesId:"code_sms",refererScreenType:em.REGISTRATION,refererScreenAttributesId:e&&(null==e?void 0:null===(s=e.loginData)||void 0===s?void 0:s.type)},[d.RZ.PASSWORD_RECOVERY]:{type:em.LOGIN,attributesId:"recover_password",refererScreenType:em.LOGIN,refererScreenAttributesId:e&&(null==e?void 0:null===(l=e.loginData)||void 0===l?void 0:l.type)},[d.RZ.PASSWORD_RECOVERY_INSTRUCTION_SENT_SCREEN]:{type:em.LOGIN,attributesId:"recover_password_mail",refererScreenType:em.LOGIN,refererScreenAttributesId:"recover_password"},[d.RZ.PASSWORD_RECOVERY_CODE]:{type:em.LOGIN,attributesId:"recover_password_code",refererScreenType:em.LOGIN,refererScreenAttributesId:"recover_password"},[d.RZ.MEGAFON]:{type:em.LOGIN_REGISTRATION,attributesId:"megafon_otp",refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:em.LOGIN_REGISTRATION},[d.RZ.SHOW_MORE]:{type:em.LOGIN,attributesId:"external",refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:em.LOGIN_REGISTRATION},[d.RZ.MEGAFON_SIGNUP_CODE]:{type:em.REGISTRATION,attributesId:"megafon_otp",refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:"megafon_otp"},[d.RZ.MEGAFON_SIGNIN_CODE]:{type:em.LOGIN,attributesId:"megafon_otp",refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:"megafon_otp"},[d.RZ.PASSWORD_RECOVERY_NEW_PASSWORD]:{type:em.LOGIN,attributesId:"recover_password_new",refererScreenType:em.LOGIN,refererScreenAttributesId:"recover_password_mail"},[d.RZ.SUCCESS]:{type:e&&e.authType&&e.authType===d.tG.REGISTER?em.REGISTRATION:em.LOGIN,attributesId:e.authType&&e.authType===d.tG.RECOVERY?"recover_password_success":"success",refererScreenType:h,refererScreenAttributesId:g},[d.RZ.SOCIAL_COLLECT_CREDS]:{type:em.LOGIN_REGISTRATION,attributesId:"add_new_login_to_apple_google",refererScreenType:h||"main",refererScreenAttributesId:g||"main"},[d.RZ.CONFIRM_SOCIAL_PHONE_CODE]:{type:em.LOGIN,attributesId:"code_sms",refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:"add_new_login_to_apple_google"},[d.RZ.REQUEST_OTP_CODE]:{type:em.LOGIN,attributesId:p,refererScreenType:em.LOGIN,refererScreenAttributesId:g},[d.RZ.OTP]:{type:em.LOGIN,attributesId:p,refererScreenType:em.LOGIN,refererScreenAttributesId:g},[d.RZ.SIGNUP_CONFIRM_EMAIL]:{type:em.REGISTRATION,attributesId:"code_email",refererScreenType:h,refererScreenAttributesId:g},[d.RZ.FORCE_LOGIN_WITH_PHONE]:{type:em.LOGIN_REGISTRATION,refererScreenType:h,refererScreenAttributesId:g},[d.RZ.SOCIAL_REGISTER_UNAVAILABLE]:{type:em.LOGIN_REGISTRATION,attributesId:p,refererScreenType:h,refererScreenAttributesId:g},[d.RZ.REQUEST_TG_OTP_CODE]:{type:em.LOGIN,attributesId:p,refererScreenType:h,refererScreenAttributesId:g},[d.RZ.OTP_TELEGRAM_SIGNIN]:{type:em.LOGIN,attributesId:"code_tg",refererScreenType:h,refererScreenAttributesId:g},[d.RZ.OTP_TELEGRAM_NOT_REGISTERED]:{type:em.LOGIN,attributesId:"phone_without_tg",refererScreenType:h,refererScreenAttributesId:g}
1,[d.RZ.OTP_TELEGRAM_ERROR]:{type:em.LOGIN,attributesId:"error_code_tg",refererScreenType:h,refererScreenAttributesId:g},[d.RZ.OTP_TELEGRAM_SIGNUP]:{type:em.REGISTRATION,attributesId:p,refererScreenType:h,refererScreenAttributesId:g},[d.RZ.CAPTCHA]:{type:em.LOGIN_REGISTRATION,attributesId:"captcha",refererScreenType:h,refererScreenAttributesId:g},[d.RZ.PHONE_OTP_V2]:{type:em.LOGIN_REGISTRATION,attributesId:"code_sms",refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:em.LOGIN_REGISTRATION},[d.RZ.OTP_TELEGRAM_V2]:{type:em.LOGIN_REGISTRATION,attributesId:"code_tg",refererScreenType:em.LOGIN_REGISTRATION,refererScreenAttributesId:em.LOGIN_REGISTRATION},[d.RZ.SUPPORT]:{type:em.LOGIN_REGISTRATION,attributesId:"contact_support",refererScreenType:h,refererScreenAttributesId:g},[d.RZ.EMAIL_OTP_BY_PHONE]:{type:em.LOGIN_REGISTRATION,attributesId:"code_email",refererScreenType:h,refererScreenAttributesId:g}}};var ef=r(36517);let ey={fetchedPinStatus:g.Do},eb=(0,n.Ng)(e=>({systemInformation:e.systemInformation}),ey)(()=>{var e,t,r,_;let p=c.Ay.useClickHouseShoot(),g=c.Ay.usePushStack(),E=(0,s.useRouter)(),f=(0,n.d4)(e=>e.toggle.checkVPN),[y,b]=(0,i.useState)(()=>{var e;return(null==E?void 0:null===(e=E.query)||void 0===e?void 0:e.mfphone)==="true"?d.RZ.MFPhone:d.RZ.CORE}),[S,T]=(0,i.useState)(d.sv.LOGIN_REGISTRATION),[x,R]=(0,i.useState)(null),[I,O]=(0,i.useState)(null),[A,N]=(0,i.useState)(null),[C,P]=(0,i.useState)(!1),[j,w]=(0,i.useState)(!0),[k,L]=(0,i.useState)({userProfileData:null,loginData:null,token:null,isWantSpam:!1,clickHouse:{attributesId:"",refererScreenType:"",refererScreenAttributesId:""}}),D=(0,i.useRef)(null),M=(0,i.useRef)(null),G=(0,i.useRef)(null),[W,V]=(0,i.useState)(!0),Z=ev[y],H=y===d.RZ.SUCCESS,U=y===d.RZ.SOCIAL_ERROR,F=y===d.RZ.ERROR,B=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=M.current,a=G.current,i=r.offsetHeight,n=t?"right":"left";ef.os.to(a,{xPercent:"right"===n?100:-100,opacity:0,duration:.3,ease:"power2.inOut",onComplete:()=>{b(e),ef.os.fromTo(a,{xPercent:"right"===n?-100:100,opacity:0},{xPercent:0,opacity:1,duration:.3,ease:"power2.inOut",onComplete:()=>V(!0)}),window.innerWidth>1024&&ef.os.fromTo(r,{height:i},{height:"auto",duration:.3,ease:"power2.inOut",onComplete:()=>ef.os.set(r,{height:"auto",clearProps:"height"})})}})},K=[d.RZ.CORE,d.RZ.MFPhone,d.RZ.SUCCESS,d.RZ.SOCIAL_COLLECT_CREDS,d.RZ.FORCE_LOGIN_WITH_PHONE,d.RZ.SOCIAL_REGISTER_UNAVAILABLE,D.current===d.RZ.OTP_TELEGRAM_SIGNUP&&d.RZ.PHONE_CODE,d.RZ.SOCIAL_ERROR,d.RZ.SOCIAL_SUCCESS,d.RZ.ERROR,(null==k?void 0:k.authType)===d.tG.RECOVERY_FROM_SETTINGS&&d.RZ.PASSWORD_RECOVERY,(null==k?void 0:k.authType)===d.tG.RECOVERY_FROM_SETTINGS&&d.RZ.PASSWORD_RECOVERY_CODE,(null==k?void 0:k.authType)===d.tG.RECOVERY_FROM_SETTINGS&&d.RZ.PASSWORD_RECOVERY_INSTRUCTION_SENT_SCREEN,d.RZ.LIMIT_ERROR,D.current===d.RZ.EMAIL_OTP_BY_PHONE&&d.RZ.PHONE_OTP_V2],Y=[d.RZ.SUCCESS,d.RZ.CONFIRM_SOCIAL_PHONE_CODE,d.RZ.SOCIAL_COLLECT_CREDS,d.RZ.SOCIAL_SUCCESS,d.RZ.ERROR],z=[d.RZ.OTP_TELEGRAM_SIGNUP,d.RZ.EMAIL_OTP,d.RZ.EMAIL_OTP_BY_PHONE,d.RZ.OTP_TELEGRAM_V2],X=[d.RZ.UPGRADE_LITE],J=[d.RZ.EMAIL_OTP,d.RZ.EMAIL_OTP_BY_PHONE,d.RZ.OTP_TELEGRAM_V2,d.RZ.PHONE_OTP_V2],q=X.includes(y),$=z.includes(y),Q=J.includes(y),ee=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];D.current=y,B(e,t)};(0,i.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=e.get("utm_source"),r=e.get("channel"),a=e.get("tariff_id"),i=e.get("redirect_url"),n=e.get("promocode");"landing_PBNasledie"===t&&((0,o.TV)(d.v8.BELOGORYE,!0),(0,o.TV)(d.v8.CHANNEL,"pb_special")),n?(localStorage.setItem(d.CV.FROM_CODE,!0),localStorage.setItem(d.CV.PROMOCODE,n)):r&&a&&(localStorage.removeItem(d.CV.FROM_CODE),localStorage.setItem(d.CV.TARIFF_FROM_LANDING,a),localStorage.setItem(d.CV.CHANNEL_FROM_LANDING,r),(0,o.TV)(d.v8.CHANNEL,r),(0,o.TV)(d.v8.TARIFF_ID,a),(0,o.TV)(d.v8.SELECTED_TARIFF,a),i&&(0,o.TV)(d.v8.REDIRECT_URL,i))},[]),(0,i.useLayoutEffect)(()=>{localStorage.removeItem("redirectInProgress")},[]),(0,i.useEffect)(()=>{if(!E.isReady)return;let{recovery_email:e,recovery_phone:t,recovery_unset:r,contact:a,mfphone:i}=E.query;e||t?(b(d.RZ.PASSWORD_RECOVERY),L(r=>({...r,authType:d.tG.RECOVERY_FROM_SETTINGS,loginData:{emailOrPhone:e||(0,m.Wb)(t),type:e?d.bh.EMAIL:d.bh.PHONE}}))):r?(b(d.RZ.ERROR),L(e=>({...e,authType:d.tG.RECOVERY_FROM_SETTINGS_UNSET}))):"true"===i?b(d.RZ.MFPhone):(b(d.RZ.CORE),L(e=>{if(!e.authEntryStep)return e;let{authEntryStep:t,...r}=e;return r}));let n="string"==typeof a?a.trim().replace(/^\+7/,"8"):a;n&&L(e=>({...e,loginData:{...e.loginData||{},emailOrPhone:n}
1}))},[E.isReady,E.query]),(0,i.useEffect)(()=>{"true"===(0,o.Ri)("socialReg")&&b(d.RZ.SOCIAL_COLLECT_CREDS)},[E]),(0,i.useEffect)(()=>{"/account"===(0,o.Ri)("auth_route")&&l().push("/")},[]),(0,i.useEffect)(()=>{P(!1),w(!0)},[y]),(0,i.useEffect)(()=>((0,o.Yj)("viewedMainForNotifyPush"),f&&g({text:"<span>Ðе забÑдÑÑе вÑклÑÑиÑÑ VPN</span> ЧÑÐ¾Ð±Ñ Ð²ÐµÑÑ ÐºÐ¾Ð½ÑÐµÐ½Ñ START ÑÑал доÑÑÑпен",withWarning:!0,withTitle:!0,withoutAutoClosing:!0}),()=>{(0,o.Yj)("refererScreenType")}),[]),(0,i.useEffect)(()=>{let e=document.querySelector(".start-wrapper");if(!e)return;let t=new MutationObserver(t=>{for(let r of t)if("childList"===r.type){let t=e.querySelector("iframe#iframe");t&&t.remove()}});return t.observe(e,{childList:!0,subtree:!0}),()=>t.disconnect()},[]),(0,i.useEffect)(()=>{let e=eE(k)[y]||{type:null,attributesId:null,refererScreenType:null,refererScreenAttributesId:null};T(e.type),R(e.attributesId),O(e.refererScreenType),N(e.refererScreenAttributesId);let t=new Date;t.setTime(t.getTime()+12e4),(0,o.TV)("refererScreenType",e.refererScreenType,{expires:t})},[y,null==k?void 0:null===(e=k.clickHouse)||void 0===e?void 0:e.attributesId,null==k?void 0:null===(t=k.clickHouse)||void 0===t?void 0:t.refererScreenType,null==k?void 0:null===(r=k.clickHouse)||void 0===r?void 0:r.refererScreenAttributesId,null==k?void 0:null===(_=k.clickHouse)||void 0===_?void 0:_.referer_screen_attributes_id]);let et=()=>{var e,t,r;let a=null==k?void 0:null===(e=k.clickHouse)||void 0===e?void 0:e.attributesId,i=null==k?void 0:null===(t=k.loginData)||void 0===t?void 0:t.type;if(!a)switch(i){case d.Rx.email:return"by_email";case d.Rx.phone:return"by_phone"}return x||(null==k?void 0:null===(r=k.clickHouse)||void 0===r?void 0:r.attributesId)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(v.A,{title:"START ÐÑ
од",description:"ÐойдиÑе, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð´Ð¾ÑÑÑп к 100+ оÑигиналÑнÑÑ
пÑоекÑов START, кино, ÑеÑиалам и мÑлÑÑÑилÑмам, 200+ Ñелеканалам и ÑкÑклÑзивнÑм маÑеÑиалам Ñо ÑÑемок."}),(0,a.jsx)("div",{className:u().container,children:(0,a.jsxs)("div",{className:h()(u().wrapper,q&&u().wrapper_fullscreen),children:[q?(0,a.jsx)("div",{className:u().fullscreen,ref:M,children:(0,a.jsx)("div",{className:u().fullscreenInner,ref:G,children:(0,a.jsx)(Z,{changeStep:ee,setDto:L,dto:k,isBackBtnClick:C,animationComplete:W,setIsDisclaimerVisible:w})})}):(0,a.jsxs)("div",{className:h()(u().content,$&&u().content_mb70,$&&u().overflowVisible),ref:M,children:[(0,a.jsxs)("div",{className:u().header,children:[(0,a.jsx)("img",{onClick:()=>{if(p({screen_type:S,screen_attributes_id:et(),action_id:"click",element_type:"button",element_attributes_id:"back",referer_screen_type:I,referer_screen_attributes_id:A}),P(!0),y===d.RZ.CONFIRM_SOCIAL_PHONE_CODE){ee(d.RZ.SOCIAL_COLLECT_CREDS,!0);return}if(y===d.RZ.REQUEST_TG_OTP_CODE){ee(d.RZ.SIGNIN,!0);return}if(y===d.RZ.OTP_TELEGRAM_SIGNIN||y===d.RZ.OTP_TELEGRAM_NOT_REGISTERED){ee(d.RZ.REQUEST_TG_OTP_CODE,!0);return}if(y===d.RZ.OTP_TELEGRAM_ERROR&&(D.current===d.RZ.REQUEST_TG_OTP_CODE||D.current===d.RZ.OTP_TELEGRAM_SIGNIN)||y===d.RZ.OTP_TELEGRAM_SIGNIN){ee(d.RZ.REQUEST_TG_OTP_CODE);return}if(y===d.RZ.CAPTCHA){var e;let t=(null==k?void 0:null===(e=k.challenge)||void 0===e?void 0:e.fromStep)||D.current||(null==k?void 0:k.authEntryStep)||d.RZ.CORE;L(e=>({...e,challenge:void 0})),ee(t,!0);return}ee((null==k?void 0:k.authEntryStep)||d.RZ.CORE,!0)},src:"/static/images/auth/backIcon.svg",alt:"назад",className:h()(u().header__backIcon,!K.includes(y)&&u().header__backIcon_visible)}),(0,a.jsx)("img",{className:h()(u().header__closeIcon,Y.includes(y)&&u().header__closeIcon_invisible),onClick:()=>{if(p({screen_type:S,screen_attributes_id:et(),action_id:"click",element_type:"button",element_attributes_id:"cross",referer_screen_type:I,referer_screen_attributes_id:A}),localStorage.removeItem(d.CV.TARIFF_FROM_LANDING),localStorage.removeItem(d.CV.CHANNEL_FROM_LANDING),localStorage.removeItem("signRoute"),localStorage.removeItem("fromCode"),(0,o.Yj)(d.v8.CHANNEL),(0,o.Yj)(d.v8.TARIFF_ID),(0,o.Yj)(d.v8.SELECTED_TARIFF),(0,o.Yj)(d.v8.AUTH_FROM_PLAYER),document.body.classList.remove("overflow"),(null==k?void 0:k.authType)===d.tG.RECOVERY_FROM_SETTINGS){l().push("/account");return}let e=(0,o.Ri)("auth_route"),t="string"==typeof e&&e.split("?")[0]||"/",r=["/logout","/auth"].includes(E.asPath)||"/auth"===E.pathname,a=window.history.length>1&&r&&"/"===t||!1===t;if(t.startsWith("/favorites")||"/upsale"===t){l().push("/");return}"/channel"===t?l().push("/channels"):a?l().push("/"):["/code","/premium_code","/account","/tv","/purchase"].includes(t)?((0,o.Yj)("auth_route"),l().push("/")):l().push(t).then(()=>(0,o.Yj)(d.v8.FROM_PRODUCT_PAGE_WITH_FREE_CONTENT))},src:"/static/images/auth/closeIcon.svg",alt:"закÑÑÑÑ Ð¾ÐºÐ½Ð¾"})]}),(0,a.jsx)("div",{className:h()(u().stepContainer,H&&u().stepContainer__successStep,(U||F)&&u().stepContainer__socialError,{[u().stepContainer__successStep]:H,[u().overflowVisible]:$,[u().stepContainer__otpTelegram]:$}),ref:G,children:(0,a.jsx)(Z,{changeStep:ee,setDto:L,dto:k,isBackBtnClick:C,animationComplete:W,setIsDisclaimerVisible:w})})]}),Q&&j&&(0,a.jsxs)("div",{className:u().disclaimer,children:["ÐÑодолжаÑ, Ð²Ñ Ð¿ÑинимаеÑе ÑÑловиÑ"," ",(0,a.jsx)("a",{href:"/legal/privacy_policy",target:"_blank",rel:"noopener noreferrer",children:"ÐолиÑики конÑиденÑиалÑноÑÑи"}),"\xa0 и\xa0",(0,a.jsx)("a",{href:"/legal/terms_of_use",target:"_blank",rel:"noopener noreferrer",children:"ÐолÑзоваÑелÑÑкого ÑоглаÑениÑ"})]})]})})]})}),eS=()=>{let e=(0,n.d4)(e=>e.registration.authData),t=(0,s.useRouter)();return(0,i.useEffect)(()=>{let r="true"===(0,o.Ri)("socialReg"),a="true"===localStorage.getItem("redirectInProgress"),{token:i,recovery_email:n,recovery_phone:s,recovery_unset:c}=null==t?void 0:t.query;if((null==e?void 0:e.virtual)===!1&&!a&&!r&&!i&&!n&&!s&&!c){let e=(0,o.uZ)();l().push(e)}},[e]),(0,a.jsx)(eb,{})}},25091:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var a=r(74848),i=r(96540),n=r(41919),o=r.n(n);class s extends i.Component{render(){let{red:e}=this.props;return(0,a.jsxs)("div",{className:o()["spinner-wrapper"],children:[e?(0,a.jsx)("svg",{className:"".concat(o()["spinner-forloading"]," ").concat(o()["spinner-big"]),width:"160",height:"160",viewBox:"0 0 160 160",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M133.332 79.9994C133.332 109.454 109.454 133.332 79.9993 133.332C50.5445 133.332 26.6667 109.454 26.6667 79.9994C26.6667 50.5446 50.5445 26.6667 79.9993 26.6667",stroke:"#FF0019",strokeWidth:"8",strokeLinecap:"round"})}):(0,a.jsx)("svg",{className:o()["spinner-forloading"],xmlns:"http://www.w3.org/2000/svg",width:"26",height:"26",viewBox:"0 0 26 26",children:(0,a.jsx)("path",{fill:"none",fillRule:"evenodd",stroke:"#F2F2F2",strokeLinecap:"round",strokeWidth:"2",d:"M25 13c0-6.627-5.373-12-12-12S1 6.373 1 13",opacity:".4"})}),e?null:(0,a.jsx)("svg",{className:o()["spinner-row"],xmlns:"http://www.w3.org/2000/svg",width:"26",height:"26",viewBox:"0 0 26 26",children:(0,a.jsx)("path",{fill:"none",fillRule:"evenodd",stroke:"#F2F2F2",strokeLinecap:"round",strokeWidth:"2",d:"M25 13c0-6.627-5.373-12-12-12"})})]})}}},53823:e=>{e.exports={"storybook-root":"Auth_storybook-root__dcTpX",container:"Auth_container__31TdS",wrapper:"Auth_wrapper__3SPPh",wrapper_fullscreen:"Auth_
1wrapper_fullscreen__Q9dKm",fullscreen:"Auth_fullscreen__YDMeX",fullscreenInner:"Auth_fullscreenInner__rlwQQ",content:"Auth_content__ZI5JQ",content_mb70:"Auth_content_mb70__KX5aq",stepContainer:"Auth_stepContainer__Fv1XF",stepContainer__successStep:"Auth_stepContainer__successStep__zVzI2",header:"Auth_header__BeN06",header__closeIcon:"Auth_header__closeIcon__3ZO7l",header__closeIcon_invisible:"Auth_header__closeIcon_invisible__c1YPS",header__backIcon:"Auth_header__backIcon__kpha7",header__backIcon_visible:"Auth_header__backIcon_visible__h4XBg",overflowVisible:"Auth_overflowVisible__0zHQH",disclaimer:"Auth_disclaimer__wc5gB",form:"Auth_form___vGax",stepContainer__socialError:"Auth_stepContainer__socialError__dYX9h",stepContainer__otpTelegram:"Auth_stepContainer__otpTelegram__HACi9"}},4745:e=>{e.exports={"storybook-root":"AuthField_storybook-root__nWomw",field:"AuthField_field__qGrQz",container:"AuthField_container__MFY3h",container__error:"AuthField_container__error__tYjva",container__focused:"AuthField_container__focused__4H9sz",label:"AuthField_label__jeOmY",input:"AuthField_input__lS4f_",eye:"AuthField_eye__EH_WV",icon:"AuthField_icon__SbPqa",error:"AuthField_error__FT5m8"}},94069:e=>{e.exports={"storybook-root":"AuthFieldCaptcha_storybook-root__COzxY",container:"AuthFieldCaptcha_container__evO4j",container_requestOTP:"AuthFieldCaptcha_container_requestOTP__Is9Je",container_standAlone:"AuthFieldCaptcha_container_standAlone__Eiutv",section:"AuthFieldCaptcha_section__x_tBy",section_standAlone:"AuthFieldCaptcha_section_standAlone__SuZdV",image:"AuthFieldCaptcha_image__7mCCn",refresh:"AuthFieldCaptcha_refresh__Jswkc",input:"AuthFieldCaptcha_input__gSrKX",infoMessage:"AuthFieldCaptcha_infoMessage__7KwGz",infoMessage_icon:"AuthFieldCaptcha_infoMessage_icon__uN52x",infoMessage_text:"AuthFieldCaptcha_infoMessage_text__WT_a1"}},36637:e=>{e.exports={"storybook-root":"AuthAppleButton_storybook-root__tzamI",button:"AuthAppleButton_button__WlkXI",icon:"AuthAppleButton_icon__asxwG"}},84538:e=>{e.exports={"storybook-root":"AuthGoogleButton_storybook-root__TGQzR",button:"AuthGoogleButton_button__5kb_O",icon:"AuthGoogleButton_icon__rcjg2"}},33256:e=>{e.exports={"storybook-root":"AuthYandexButton_storybook-root__C6EUA",button:"AuthYandexButton_button__u1lNq",icon__wrapper:"AuthYandexButton_icon__wrapper__94LCW",spinner:"AuthYandexButton_spinner__i0xW9",wrapper:"AuthYandexButton_wrapper__s65K_"}},83417:e=>{e.exports={"storybook-root":"AuthStepUpgradeLite_storybook-root__0C_c_",page:"AuthStepUpgradeLite_page__4Yqpl",title:"AuthStepUpgradeLite_title__015OJ",row:"AuthStepUpgradeLite_row__HOWeX",col:"AuthStepUpgradeLite_col__rBqDP",card:"AuthStepUpgradeLite_card__oBxdG",cardLite:"AuthStepUpgradeLite_cardLite__73XkJ",cardPremiumWrap:"AuthStepUpgradeLite_cardPremiumWrap__V8l_3",premiumCard:"AuthStepUpgradeLite_premiumCard__OtOPx",cardHeader:"AuthStepUpgradeLite_cardHeader__WRle7",tierBase:"AuthStepUpgradeLite_tierBase__WLiZA",tierPremiumWrap:"AuthStepUpgradeLite_tierPremiumWrap__9HRQn",tierPremium:"AuthStepUpgradeLite_tierPremium__PuS1Q",sub:"AuthStepUpgradeLite_sub__wMO1a",features:"AuthStepUpgradeLite_features__Vgg7R",feature:"AuthStepUpgradeLite_feature__AZxp4",metric:"AuthStepUpgradeLite_metric__qPKdZ",caption:"AuthStepUpgradeLite_caption__svAx2",kids:"AuthStepUpgradeLite_kids__Ve_gD",buttonBlock:"AuthStepUpgradeLite_buttonBlock__oo48B",btn:"AuthStepUpgradeLite_btn__6h4Uh",btnGhost:"AuthStepUpgradeLite_btnGhost__o6GMV",notice:"AuthStepUpgradeLite_notice__5Rv9k",separator:"AuthStepUpgradeLite_separator__8EGOI",tierBaseImage:"AuthStepUpgradeLite_tierBaseImage__fllf1",price:"AuthStepUpgradeLite_price__HiGXu",colRight:"AuthStepUpgradeLite_colRight__6gYl6"}},71662:e=>{e.exports={"storybook-root":"AuthSteps_storybook-root__WJWoN",centered:"AuthSteps_centered__YkvrH",container:"AuthSteps_container__UAEzf",container_success:"AuthSteps_container_success__Ifzks",container_success__social:"AuthSteps_container_success__social__QWCpj",container_stickToBottom:"AuthSteps_container_stickToBottom__Rm_Ds",socialError:"AuthSteps_socialError__1YG6f",socialError_limitError:"AuthSteps_socialError_limitError__gvTX_",socialError_supporrt:"AuthSteps_socialError_supporrt__ZhzZ7",checkboxLink:"AuthSteps_checkboxLink__KTXaM",back:"AuthSteps_back__8ZFX1",backImg:"AuthSteps_backImg__huYe6",notice:"AuthSteps_notice__bBDNW",notice_mfPhone:"AuthSteps_notice_mfPhone__Myhi1",title:"AuthSteps_title__hEUb1",title_main:"AuthSteps_title_main__NWgqL",title_noPassword:"AuthSteps_title_noPassword__3paUy",title_success:"AuthSteps_title_success__DVyM2",title_limitError:"AuthSteps_title_limitError__5nNiK",title_support:"AuthSteps_title_support__p71s6",title_captcha:"AuthSteps_title_captcha__qWzoX",subtitle:"AuthSteps_subtitle__t6fQ1",margin:"AuthSteps_margin__GOTlS",subtitle_fail:"AuthSteps_subtitle_fail__2Tnk6",title_signup:"AuthSteps_title_signup__b3_W_",descriptionWrapper:"AuthSteps_descriptionWrapper__hIIZ0",requestAnotherCode:"AuthSteps_requestAnotherCode__nnzN_",description:"AuthSteps_description__iIoqH",description_regUnavailable:"AuthSteps_description_regUnavailable__nx38u",description_showMore:"AuthSteps_description_showMore__6VOBP",description_recoveryError:"AuthSteps_description_recoveryError__PStBF",description_otpCode:"AuthSteps_description_otpCode__uEywA",description_tgOtpCode:"AuthSteps_description_tgOtpCode__AW8KP",description_tgOtpCodeNoMargin:"AuthSteps_description_tgOtpCodeNoMargin__c24HV",description_socialCreds:"AuthSteps_description_socialCreds__ZDGwP",description_otp:"AuthSteps_description_otp__UyTW2",description_megafon:"AuthSteps_description_megafon__u2aaG",description_clickable:"AuthSteps_description_clickable__xh_Pg",description_signUp:"AuthSteps_description_signUp__o_fgr",description_limits:"AuthSteps_description_limits__Ds6oF",login:"AuthSteps_login__Ba2PO",login__emailRecovery:"AuthSteps_login__emailRecovery__dlCP9",login_mf:"AuthSteps_login_mf__YQYrS",loginLabel:"AuthSteps_loginLabel__5SuTM",loginValueWrapper:"AuthSteps_loginValueWrapper__iIlAz",loginValue:"AuthSteps_loginValue__NurrS",loginValue_instructionSent:"AuthSteps_loginValue_instructionSent__gpwwB",loginValue_settings:"AuthSteps_loginValue_settings__fJq5C",loader:"AuthSteps_loader__CvLCj",spin:"AuthSteps_spin__Q9a1i",container_loader:"AuthSteps_container_loader__fx5AA",codeSubtitle:"AuthSteps_codeSubtitle__JdCwx",codeSubtitle_support:"AuthSteps_codeSubtitle_support__Dsx0F",forgot:"AuthSteps_forgot__ljMsH",forgotDescription:"AuthSteps_forgotDescription__vRgV4",customError:"AuthSteps_customError__qHwX7",customError_otp:"AuthSteps_customError_otp__bx7xY",field:"AuthSteps_field__lbAuX",field_otpV2:"AuthSteps_field_otpV2__GE5zt",checkbox:"AuthSteps_checkbox__3IQif",consent_link:"AuthSteps_consent_link__PNooH",error:"AuthSteps_error__gaS0n",info:"AuthSteps_info__aZlU1",try:"AuthSteps_try__5UL9W",button:"AuthSteps_button__cKVuS",button_clear:"AuthSteps_button_clear__lYGza",button_secondary:"AuthSteps_button_secondary__IB50_",button_socialError:"AuthSteps_button_socialError__gl2So",button_mt8:"AuthSteps_button_mt8__iUZZL",button_mb12:"AuthSteps_button_mb12__jE_nt",button_mt12:"AuthSteps_button_mt12__6i3Db",button_blue:"AuthSteps_button_blue__Wx90f",button_limitError:"AuthSteps_button_limitError__nBxWT",separator:"AuthSteps_separator__ELk6E",line:"AuthSteps_line__2pGgU",or:"AuthSteps_or__NblR1",megafon:"AuthSteps_megafon__Yre_Z",megafonDisabled:"AuthSteps_megafonDisabled__A5PN3",buttons:"AuthSteps_buttons__YDZIB",buttons__showMore:"AuthSteps_buttons__showMore__XUX3K",buttons__showMore_icon:"AuthSteps_buttons__showMore_icon__wGTMq",social:"AuthSteps_social__x_Ubc",socialDisabled:"AuthSteps_socialDisabled__F5xgq",ya:"AuthSteps_ya__R_JPl",go:"AuthSteps_go__e9IF2",vk:"AuthSteps_vk__VZoRZ",ap:"AuthSteps_ap__0RlfG",mp:"AuthSteps_mp__YlCH_",sms:"AuthSteps_sms__GQwum",resend:"AuthSteps_resend__sol_o",time:"AuthSteps_time__T2MlB",loginError:"AuthSteps_loginError__AYhD7",loginErrorIcon:"AuthSteps_loginErrorIcon__OW_Ee",megafonField:"AuthSteps_megafonField__xa87z",localInput:"AuthSteps_localInput__J_i3B",localInputPlain_noPassword:"AuthSteps_localInputPlain_noPassword__gV6eI",socialCreds:"AuthSteps_socialCreds__Wdks3",socialIcon:"AuthSteps_socialIcon__fAX7_",fld:"AuthSteps_fld__WT2Hu",successIcon:"AuthSteps_successIcon__Z_B_h",countdown:"AuthSteps_countdown__s0nle",countdown_limit:"AuthSteps_countdown_limit__qorsZ",parentalControl__pin:"AuthSteps_parentalControl__pin___qcpU",parentalControl__inputs:"AuthSteps_parentalControl__inputs__LDnuZ",parentalControl__input
1:"AuthSteps_parentalControl__input__nh7jq",parentalControl__errorWrap:"AuthSteps_parentalControl__errorWrap__hHt_I",parentalControl__error:"AuthSteps_parentalControl__error__2DTZQ",parentalControl__forgot:"AuthSteps_parentalControl__forgot__X_cqw",codeField:"AuthSteps_codeField___IS2z",iconCentered:"AuthSteps_iconCentered__pGGF7",overflowVisible:"AuthSteps_overflowVisible__SqsL7",megafon_icon:"AuthSteps_megafon_icon__xfQAP",tgIcon:"AuthSteps_tgIcon__I9TdT",parentalControl__button:"AuthSteps_parentalControl__button___Y9KS",title_error:"AuthSteps_title_error__bVjrL"}},27398:e=>{e.exports={"storybook-root":"CodeField_storybook-root__x5ES4",codeInputWrapper:"CodeField_codeInputWrapper__EugV3",codeAndErrorWrapper:"CodeField_codeAndErrorWrapper__jt7XK",codeCells:"CodeField_codeCells__ZApKn",codeCell:"CodeField_codeCell__9eOre",focused:"CodeField_focused__qtANN",error:"CodeField_error__wGapi",hiddenInput:"CodeField_hiddenInput__9ThTT",cursor:"CodeField_cursor__L5l4w",blink:"CodeField_blink__gugcy",errorCursor:"CodeField_errorCursor__LSQ6e",errorText:"CodeField_errorText__8uJfE"}},6774:e=>{e.exports={"storybook-root":"Drawer_storybook-root__OXiDz",overlay:"Drawer_overlay__1bFPK",overlay_visible:"Drawer_overlay_visible__5cLR5",drawer:"Drawer_drawer__m5Wam",drawer_visible:"Drawer_drawer_visible__W_Q05",header:"Drawer_header__v_Cvn",headerTitle:"Drawer_headerTitle__hNNxk",closeIcon:"Drawer_closeIcon__KH57a"}},3433:e=>{e.exports={"storybook-root":"LoginTypeToggle_storybook-root__i5XbF",toggleContainer:"LoginTypeToggle_toggleContainer__eCQyp",toggleButton:"LoginTypeToggle_toggleButton__CgJBw",activeButton:"LoginTypeToggle_activeButton__GGzvb",slider:"LoginTypeToggle_slider__3KBEz",sliderEmail:"LoginTypeToggle_sliderEmail__Tre61",sliderPhone:"LoginTypeToggle_sliderPhone__UW__R"}},47726:e=>{e.exports={"storybook-root":"Tooltip_storybook-root__jauLR",tooltip:"Tooltip_tooltip__5X2dg",tooltipVisible:"Tooltip_tooltipVisible__hAovK"}},61938:e=>{e.exports={"storybook-root":"TooltipButton_storybook-root__xdXOp",tooltipButton:"TooltipButton_tooltipButton__gsRng",disabled:"TooltipButton_disabled__zCL9w",tooltipButtonIcon:"TooltipButton_tooltipButtonIcon__FxMdi"}},41919:e=>{e.exports={"storybook-root":"Spinner_storybook-root__TZMVJ","spinner-forloading":"Spinner_spinner-forloading__wYOoL","spinner-big":"Spinner_spinner-big__ay9tu","spinner-row":"Spinner_spinner-row__xbdeD","spinner-wrapper":"Spinner_spinner-wrapper__Emkhb"}}},e=>{var t=t=>e(e.s=t);e.O(0,[6834,6517,8949,242,636,6593,8792],()=>t(12327)),_N_E=e.O()}]);
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.