1import{aY as z,bU as G,c9 as X,bF as C,aL as l,bu as A,b1 as k,b2 as m,bz as v,ca as w,bQ as ee,b9 as L,d$ as h,aK as y,aM as u,be as N,bf as U,bd as K,e0 as te,cl as E,bc as x,b3 as p,bh as b,aZ as W,a$ as g,bp as F,b0 as re,b4 as Y,b5 as Z,aO as T,bW as Q,bN as R,aT as ne,b6 as j,b7 as H,bl as S,e1 as I,cR as se,e2 as oe,aP as ie,e3 as M,aV as ae,aW as le,bH as ce,bV as ue,co as O,bC as D,bD as B}from"./BLbFcDY4.js";import{G as he}from"./CvKwkNo4.js";import{t as de}from"./FRy1XGnn.js";import{k as me}from"./DoQ0_s42.js";import{M as pe}from"./DmCUTRre.js";import{$}from"./C--1hzmd.js";import{z as fe}from"./DtJuT8Au.js";import{Q as ge}from"./Biz0AsKd.js";import{u as V,m as _e,n as Ce}from"./MbkrmIu1.js";import{h as be,b as ve}from"./DUlgF_G5.js";import{v as Te,x as Se,b as ke}from"./BxDcJxim.js";import{u as we}from"./B7uMGFeA.js";import{T as Ae}from"./C8NiijRa.js";import{e as P}from"./B6Nt7-ep.js";import"./I-GFd47M.js";import"./RGsWmKZP.js";import"./D_VHTKc3.js";import"./UMhdEuiP.js";import"./-JFlTWVS.js";import"./CJNQ9peY.js";import"./BIJepdv6.js";import"./BXH5SNOI.js";import"./DQd_gWW7.js";import"./Bd07KBfU.js";import"./DZfqgOou.js";import"./Ngw-a2eK.js";import"./CFiAvM6-.js";import"./DVRaenKL.js";import"./Dy2rWYss.js";import"./DZwQQtCS.js";import"./CjECELIu.js";import"./DWoecRsz.js";import"./ICV3vbNf.js";import"./DkX2EVOz.js";import"./D6QL_5nn.js";import"./Cow5z95P.js";import"./Cnvzea_l.js";import"./YRVtcWuo.js";import"./BXsRn6bU.js";import"./CidJZ2xt.js";import"./DRQ9f4fj.js";import"./CrPB3dmw.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ec4de397-73a1-449a-8d20-7b6b56c8d977",e._sentryDebugIdIdentifier="sentry-dbid-ec4de397-73a1-449a-8d20-7b6b56c8d977")}catch{}})();const ye=z({name:"SmsIcon",components:{IconWrapper:we},props:{size:{type:String,default:G.L},fill:{type:String,default:"var(--mono-900)"}}}),Me=["fill"];function Ie(e,t,r,s,o,n){const d=C("IconWrapper");return l(),A(d,{size:e.size},{default:k(()=>[m("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M1.33301 5.66667C1.33301 4.28596 2.4523 3.16667 3.83301 3.16667H12.1663C13.5471 3.16667 14.6663 4.28596 14.6663 5.66667V10.3333C14.6663 11.714 13.5471 12.8333 12.1663 12.8333H7.01152L4.93035 14.9145C4.27938 15.5655 3.16634 15.1044 3.16634 14.1838V12.7435C2.10928 12.4517 1.33301 11.4832 1.33301 10.3333V5.66667ZM5.66634 8C5.66634 8.55229 5.21863 9 4.66634 9C4.11406 9 3.66634 8.55229 3.66634 8C3.66634 7.44772 4.11406 7 4.66634 7C5.21863 7 5.66634 7.44772 5.66634 8ZM7.99967 9C8.55196 9 8.99967 8.55229 8.99967 8C8.99967 7.44772 8.55196 7 7.99967 7C7.44739 7 6.99967 7.44772 6.99967 8C6.99967 8.55229 7.44739 9 7.99967 9ZM11.333 9C11.8853 9 12.333 8.55229 12.333 8C12.333 7.44772 11.8853 7 11.333 7C10.7807 7 10.333 7.44772 10.333 8C10.333 8.55229 10.7807 9 11.333 9Z",fill:e.fill},null,8,Me)]),_:1},8,["size"])}const Pe=X(ye,[["render",Ie]]);function xe(e){if(e.step===void 0)return null;const t=e.step;if(e.result==="success")return{[t]:{success:{}}};if(e.result==="error"){const{$i18n:r}=v();return{[t]:{error:e.errorMessage??r.t("unknownError")}}}return{[t]:{}}}const _=e=>{let t;try{t=v().$sendYandexMetrika}catch{return}if(!t)return;if(!e){t(w.AUTH);return}const r=xe(e);r!==null&&t(w.AUTH,r)},Re=()=>{const e=L(null),t=L(!1),r=()=>{const n=e.value;if(n){n.onclose=null,n.onerror=null,n.onmessage=null;try{n.close()}catch(d){console.error("ÐÑибка пÑи закÑÑÑии WebSocket:",d)}}e.value=null,t.value=!1},s=n=>{if(e.value&&t.value)try{e.value.send(JSON.stringify(n))}catch(d){console.error("ÐÑибка оÑпÑавки ÑообÑÐµÐ½Ð¸Ñ ÑеÑез WebSocket:",d)}else console.warn("WebSocket не подклÑÑен. СообÑение не оÑпÑавлено.")},o=(n,d)=>{e.value&&r();const a=n.wsUrl;if(!n.phone||!n.transport||!a){console.warn("ÐÑÑÑÑÑÑвÑÑÑ Ð¾Ð±ÑзаÑелÑнÑе даннÑе Ð´Ð»Ñ Ð¿Ð¾Ð´ÐºÐ»ÑÑÐµÐ½Ð¸Ñ WebSocket.");return}try{e.value=new WebSocket(a)}catch(i){console.error("ÐÑибка ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ WebSocket:",i);return}e.value.onopen=()=>{t.value=!0,s({action:"start",body:{phone:n.phone,transport:n.transport,confirmMessage:n?.confirmMessage||null,ignoreConfirmationMessage:n.ignoreConfirmationMessage||null,isMobile:n.isMobileBrowser}})},e.value.onclose=()=>{r()},e.value.onerror=i=>{console.error("ÐÑибка WebSocket:",i),_({step:n.transport,result:"error",errorMessage:"ÐÑибка WebSocket"}),r()},e.value.onmessage=i=>{let f;try{f=JSON.parse(i.data)}catch(c){console.error("ÐÑибка обÑабоÑки ÑообÑÐµÐ½Ð¸Ñ WebSocket:",c);return}f?.action==="confirm"&&(d(f.body),r())}};return ee(()=>{r()}),{startConnection:o,closeConnection:r,isConnected:t}},q=(e,t)=>
1{const{$sendYandexMetrika:r,$sendTagManagerMetric:s}=v();switch(e){case h.SMS:r(`sms-${t}`),s(`sms-${t}`);break;case h.WHATSAPP:r(`whatsapp-${t}`),s(`whatsapp-${t}`);break;case h.WHATSAPP_SMS:r(`whatsapp-revvy-${t}`),s(`whatsapp-revvy-${t}`);break;case h.TELEGRAM:r(`telegram-${t}`),s(`telegram-${t}`);break;case h.CALL:r(`unibell-${t}`),s(`unibell-${t}`)}},J={data(){return{lastClickTime:null,timerInterval:null,timerRemaining:null,featureTime:null}},methods:{startTimer(e){const t=e||30;!this.lastClickTime&&!this.featureTime&&(this.lastClickTime=new Date().getTime(),this.featureTime=new Date().getTime()+t*1e3,localStorage.setItem("lastClickTime",this.lastClickTime),localStorage.setItem("featureTime",this.featureTime)),this.timerInterval=setInterval(()=>{const r=new Date().getTime(),s=this.featureTime-r,o=Math.round(s/1e3);o<1?this.clearTimer():this.timerRemaining=o},1e3)},clearTimer(){clearInterval(this.timerInterval),this.lastClickTime=null,this.featureTime=null,localStorage.removeItem("lastClickTime"),localStorage.removeItem("featureTime"),this.timerRemaining=0}},mounted(){const e=localStorage.getItem("lastClickTime"),t=localStorage.getItem("featureTime");if(e&&t){this.lastClickTime=e,this.featureTime=t;const r=new Date().getTime();this.featureTime-r<1&&this.clearTimer()}}},Ve={name:"AuthorizationCode",emits:["input","change"],props:{digitCount:{type:Number,default:4},value:{type:String},error:{type:String},type:{type:String,default:"number"},isDisabled:{type:Boolean,default:!1}},data(){return{code:Array(this.digitCount),dataFromPaste:[],keysAllowed:["0","1","2","3","4","5","6","7","8","9"]}},computed:{isNumber(){return this.type==="number"}},methods:{handleInput(e){const t=e.target;if(!this.keysAllowed.includes(t.value)&&this.isNumber){t.value="";return}this.handleNext(t),this.$emit("input",this.code.join(""))},handleDelete(e,t){const r=e.currentTarget;r.value="",this.code[t]=null,e.preventDefault(),e.target.previousElementSibling?.focus(),this.$emit("input",this.code.join(""))},handleArrowLeft(e){const t=e.target.previousElementSibling;t&&t.focus()},handleArrowRight(e){const t=e.target.nextElementSibling;t&&t.focus()},onPaste(e){let t=e.target;const r=e.clipboardData?.getData("text").trim().split("");r&&r.length<=this.digitCount&&r.forEach(s=>{const o=parseInt(t.id.split("_")[1]);t.value=s,this.code[o]=s,t=t.nextElementSibling,this.handleNext(t)})},handleNext(e){e?.nextElementSibling?e.nextElementSibling?.focus():this.$emit("change",this.code.join(""))},clearInput(){this.code=Array(this.digitCount)}}},Ee={class:"verification-code"},De={class:"verification-code-wrapper"},Le=["id","onUpdate:modelValue","type","data-testid","disabled","onKeydown"],$e={key:0,class:"verification-code-error"};function ze(e,t,r,s,o,n){return l(),u("div",Ee,[m("div",De,[(l(!0),u(N,null,U(o.code,(d,a)=>K((l(),u("input",{id:"input_"+a,ref_for:!0,ref:"input_"+a,key:a,"onUpdate:modelValue":i=>o.code[a]=i,class:x(["verification-code-input",{"verification-code-input__error":r.error}]),type:r.type,maxlength:"1","data-testid":`registerCode-${a}`,disabled:r.isDisabled,onInput:t[0]||(t[0]=(...i)=>n.handleInput&&n.handleInput(...i)),onPaste:t[1]||(t[1]=(...i)=>n.onPaste&&n.onPaste(...i)),onKeydown:[E(i=>n.handleDelete(i,a),["delete"]),t[2]||(t[2]=E((...i)=>n.handleArrowLeft&&n.handleArrowLeft(...i),["left"])),t[3]||(t[3]=E((...i)=>n.handleArrowRight&&n.handleArrowRight(...i),["right"]))]},null,42,Le)),[[te,o.code[a]]])),128))]),r.error?(l(),u("span",$e,p(r.error),1)):b("",!0)])}const Ne=y(Ve,[["render",ze],["__scopeId","data-v-a08cafa6"]]),He={class:"phone"},Oe={class:"phone__status"},Be={class:"phone__content content"},Ge={key:0,class:"content__call"},Ue=z({__name:"PhoneMockup",props:{isCall:{type:Boolean,default:!1}},setup(e){const{t}=W();return(r,s)=>{const o=F;return l(),u("div",He,[m("div",Oe,[g(o,{class:"phone__status-img",src:"/img/phone-status-bar.webp",alt:"",loading:"lazy"})]),m("div",Be,[e.isCall?(l(),u("p",Ge,p(`${re(t)("outgoingCall")}...`),1)):b("",!0),Y(r.$slots,"default",{},void 0,!0)])])}}}),Ke=y(Ue,[["__scopeId","data-v-5ba7f750"]]),We={name:"AuthorizationConfirm",mixins:[J],components:{PhoneMockup:Ke,QrcodeVue:ge,GButton:Z,AuthorizationCode:Ne},emits:["changePhone","closeHandler"],props:{transport:{type:String},phone:{type:String},isConfirm:{type:Boolean}},data(){return{isDisabledCodeInput:!1,verificationError:null,Sizes:H,ButtonView:j,VerifyType:h}},computed:{CallIcon(){return $},RepeatIcon(){return fe},isSms(){return this.transport===h.SMS},isOutgoingCall(){return this.transport===h.OUTGOING_CALL},isMobile(){const{$screen:e}=v();return e.width<640},outgoingCallPhone(){const{getAvailableRegisterTypes:e}=T();return Ce(e.unibel_number)},maskedOutgoingCallPhone(){return _e(this.outgoingCallPhone)},confirmContent(){switch(this.transport){case h.CALL:return{title:this.$t("callConfirmationTitle",{phone:this.phone}),isShowCode:!0,imageUrl:"/img/phone.webp",repeatText:this.repeatMessage(!1),goBackText:this.$t("changePhoneNumber")};case h.WHATSAPP_SMS:return{title:this.$t("whatsappConfirmationTitle",{phone:this.phone}),isShowCode:!0,imageUrl:"img/whatsappConfirm.webp",repeatText:this.repeatMessage(!0),goBackText:this.$t("changePhoneNumber")};case h.SMS:return{title:this.$t("smsConfirmationTitle",{phone:this.phone}),isShowCode:!0,imageUrl:"/img/smsConfirm.webp",repeatText:this.repeatMessage(!0),goBackText:this.$t("changePhoneNumber")};case h.OUTGOING_CALL:return{title:this.$t("outgoingCallConfirmationTitle",{phone:this.maskedOutgoingCallPhone}),isShowCode:!1,goBackText:this.$t("changeAuthType")};default:return{}}}},methods:{repeatMessage(e){const t=e?this.$t("message"):this.$t("calling"),r=this.timerRemaining||"";return r?this.$t("repeatSmtsAfterTime",{type:t.toLowerCase(),time:r}):this.$t("repeatSmth",{type:t.toLowerCase()})},changeHandler(e){const{$sendYandexMetrika:t,$sendTagManagerMetric:r}=v(),{registerConfirm:s}=T();this.isDisabledCodeInput=!0,s({phone:V(this.phone),code:e,isSms:this.isSms}).then(async()=>{q(this.transport,"end"),_({step:this.transport,result:"success"}),this.$emit("closeHandler"),(this._.provides[Q]||this.$route).path.includes(R.ORDER+R.PRODUCTS)&&(t(w.LOGGED_IN_CART),r(w.LOGGED_IN_CART)),await ne(),location.reload()}).catch(o=>{this.verificationError=o.error_message,this.isDisabledCodeInput=!1,_({step:this.transport,result:"error",errorMessage:o?.error_message})})},repeatCall(){const{register:e}=T();if(!this.timerRemaining){this.$refs.verificationCodeInput.clearInput(),this.verificationError=null;const t={phone:V(this.phone),verify_type:this.transport};e(t).then(r=>{this.startTimer(r.retry_seconds)}).catch(r=>{this.verificationError=r.error_message,this.startTimer(r.retry_seconds),_({step:this.transport,result:"error",errorMessage:r?.error_message})})}},changePhoneHandler(){this.$emit("changePhone"),this.clearTimer()}},mounted(){this.$refs.verificationCodeInput&&this.$refs.verificationCodeInput.$refs.input_0[0].focus(),this.startTimer()}},Fe=["innerHTML"],Ye={key:1,class:"verification__code-input"},Ze={key:2,class:"verification__confirm-img"},Qe={key:3,class:"verification__phone-info phone-info"},je={class:"phone-info__qr-wrapper"},qe={class:"phone-info__qr-text"},Je={key:1,class:"phone-info__phonenumber"},Xe={class:"verification__confirm-buttons"},et=["href"];function tt(e,t,r,s,o,n){const d=C("AuthorizationCode"),a=F,i=C("QrcodeVue"),f=C("PhoneMockup"),c=C("GButton");return l(),u("div",{class:x(["verification",`verification_${r.transport}`])},[n.confirmContent.title?(l(),u("p",{key:0,class:"verification__title",innerHTML:n.confirmContent.title},null,8,Fe)):b("",!0),n.confirmContent.isShowCode?(l(),u("div",Ye,[g(d,{ref:"verificationCodeInput",error:o.verificationError,"is-disabled":o.isDisabledCodeInput,type:"text",onCh
1ange:n.changeHandler},null,8,["error","is-disabled","onChange"])])):b("",!0),n.confirmContent.imageUrl?(l(),u("div",Ze,[g(a,{width:"214",height:"133",src:n.confirmContent.imageUrl,alt:""},null,8,["src"])])):b("",!0),n.isOutgoingCall?(l(),u("div",Qe,[g(f,{class:"phone-info__phone","is-call":n.isMobile},{default:k(()=>[n.isMobile?(l(),u("p",Je,p(n.maskedOutgoingCallPhone),1)):(l(),u(N,{key:0},[m("div",je,[n.isOutgoingCall?(l(),A(i,{key:0,background:"transparent",foreground:"var(--exeption-900)","render-as":"svg",size:116,value:`tel:${n.outgoingCallPhone}`},null,8,["value"])):b("",!0)]),m("div",qe,p(e.$t("pointYourPhoneCameraToMakeACall")),1)],64))]),_:1},8,["is-call"])])):b("",!0),m("div",Xe,[n.confirmContent.repeatText?(l(),A(c,{key:0,view:o.ButtonView.CLEAR,size:o.Sizes.L,disabled:!!e.timerRemaining,"icon-left":n.RepeatIcon,class:"verification__confirm-repeat-call","icon-fill":"var(--exeption-600)","data-testid":"resendingCode",onClick:n.repeatCall},{default:k(()=>[m("span",{class:x({"verification__confirm-repeat-text":!!e.timerRemaining})},p(n.confirmContent.repeatText),3)]),_:1},8,["view","size","disabled","icon-left","onClick"])):b("",!0),n.isOutgoingCall&&n.isMobile?(l(),u("a",{key:1,href:`tel:${n.outgoingCallPhone}`,class:"verification__outgoing-call-link"},[g(c,{view:o.ButtonView.PRIMARY,"data-testid":"outgoingCall","icon-left":n.CallIcon,"icon-fill":"var(--exeption-100)",size:o.Sizes.L,type:"submit"},{default:k(()=>[S(p(e.$t("callFree")),1)]),_:1},8,["view","icon-left","size"])],8,et)):b("",!0),g(c,{view:o.ButtonView.GHOST,"data-testid":"registerGoBack",size:o.Sizes.L,onClick:n.changePhoneHandler},{default:k(()=>[S(p(n.confirmContent.goBackText),1)]),_:1},8,["view","size","onClick"])])],2)}const rt=y(We,[["render",tt],["__scopeId","data-v-06a1e56e"]]),nt={},st={width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function ot(e,t){return l(),u("svg",st,[...t[0]||(t[0]=[m("path",{d:"M3 13.56C3 8.58197 3 6.09295 4.54648 4.54648C6.09295 3 8.58197 3 13.56 3H14.44C19.418 3 21.907 3 23.4535 4.54648C25 6.09295 25 8.58197 25 13.56V14.44C25 19.418 25 21.907 23.4535 23.4535C21.907 25 19.418 25 14.44 25H13.56C8.58197 25 6.09295 25 4.54648 23.4535C3 21.907 3 19.418 3 14.44V13.56Z",fill:"#0077FF"},null,-1),m("path",{d:"M14.7065 18.9C9.68405 18.9 6.81937 15.4465 6.70001 9.69995H9.2158C9.29844 13.9178 11.1531 15.7043 12.6222 16.0727V9.69995H14.9912V13.3376C16.4419 13.181 17.9659 11.5234 18.4801 9.69995H20.849C20.4542 11.947 18.8015 13.6046 17.6262 14.2861C18.8015 14.8387 20.6838 16.2845 21.4 18.9H18.7923C18.2322 17.1502 16.8367 15.7964 14.9912 15.6123V18.9H14.7065Z",fill:"white"},null,-1)])])}const it=y(nt,[["render",ot]]),at={class:"vk-auth-button"},lt={key:0,class:"vk-auth-button__error"},ct=z({__name:"VKAuthButton",setup(e){const{loginViaVK:t}=T(),{t:r}=W(),s=L(null),o={[I.NewTabHasBeenClosed]:r("errorVkClose"),[I.CannotCreateNewTab]:r("errorVkCannotCreateNewTab"),[I.AuthorizationFailed]:r("errorVkAuthorizationFailed"),[I.StateMismatch]:r("errorVkStateMismatch"),[I.EventNotSupported]:r("errorVkEventNotSupported")};function n(a){return typeof a?.code=="number"?o[a.code]??r("errorVkSDK",{code:a.code}):a?.error_description??a?.error_message}const d=async()=>{_({step:h.VK_ID});try{await t(),_({step:h.VK_ID,result:"success"})}catch(a){_({step:h.VK_ID,result:"error",errorMessage:n(a)}),s.value=a.error_code===se.PHONE_NOT_FOUND?a?.error_message:"Ðе ÑдалоÑÑ Ð²Ð¾Ð¹Ñи ÑеÑез VK. ÐопÑобÑйÑе позже или войдиÑе по номеÑÑ ÑелеÑона"}};return(a,i)=>(l(),u("div",at,[i[1]||(i[1]=m("span",{class:"vk-auth-button__additional-text"},"или",-1)),m("button",{class:"vk-auth-button-btn",onClick:d},[g(it,{class:"vk-auth-button-icon"}),i[0]||(i[0]=S(" ÐойÑи Ñ VK ID ",-1))]),s.value?(l(),u("div",lt,p(s.value),1)):b("",!0)]))}}),ut=y(ct,[["__scopeId","data-v-d2c3cd83"]]),ht={name:"AuthorizationMethods",components:{VKAuthButton:ut,GShimmer:ve,GButton:Z,GShimmerProvider:be},props:{isError:{type:Boolean}},data(){return{IconSizes:G,smsEnabled:!0,transport:null,url:null,smsBlock:!1,availableRegisterTypes:[]}},computed:{...ce(T,["isVKAuthAvailable","getVKAuthSettings"]),Sizes(){return H},ButtonView(){return j},isMobile(){const{$screen:e}=v();return e.width<640},isLoading(){const{isLoading:e}=ae();
1return e(le.AVAILABLE_REGISTER_TYPES)},isVKButtonShown(){return this.isVKAuthAvailable&&!this.isLoading}},methods:{changeHandler(e){this.$emit("choose",e)},async getAvailableRegisterTypes(){try{const{encodedIP:r}=await oe("/app-api/client-ip");if(r){const{$api:s}=v();s.recreateRequests(r)}}catch(r){console.error("[ip] failed to refresh encodedIP",r)}const{fetchAvailableRegisterTypes:e}=T();await e();const{getAvailableRegisterTypes:t}=ie(T());this.availableRegisterTypes=t.value.types?.reduce((r,s)=>{switch(s){case h.TELEGRAM:r.push({id:"registerTelegram",icon:M(ke),text:"Telegram",value:s});break;case h.MAX:r.push({id:"registerMax",icon:M(Se),text:"ÐÐÐС",value:s});break;case h.CALL:r.push({id:"registerCall",icon:M($),text:this.$t("call"),value:s});break;case h.WHATSAPP:case h.WHATSAPP_SMS:r.push({id:"registerWhatsapp",icon:M(Te),text:"Whatsapp",value:s});break;case h.SMS:this.smsEnabled&&r.push({id:"registerSms",icon:M(Pe),text:this.$t("sms").toUpperCase(),value:s});break;case h.OUTGOING_CALL:r.push({id:"registerOutgoingCall",icon:M($),text:this.$t("outgoingCall"),value:s});break}return r},[])}},beforeMount(){this.getAvailableRegisterTypes()}},dt={class:"external-confirm"};function mt(e,t,r,s,o,n){const d=C("GButton"),a=C("GShimmer"),i=C("VKAuthButton"),f=C("GShimmerProvider");return l(),u("div",dt,[m("div",{class:x(["external-confirm__title",{"external-confirm__title_error":r.isError}])},[Y(e.$slots,"default",{},()=>[S(p(e.$t("selectConfirmationMethod")),1)],!0)],2),g(f,{loading:n.isLoading,class:"confirm-body"},{default:k(()=>[g(a,{class:"confirm-block"},{default:k(()=>[(l(!0),u(N,null,U(o.availableRegisterTypes,c=>(l(),u("div",{key:c.id,class:"confirm-button"},[g(d,{size:n.isMobile?n.Sizes.M:n.Sizes.L,view:n.ButtonView.SECONDARY,"data-testid":c.id,"icon-left":c.icon,"icon-fill":"var(--color-primary)",onClick:St=>n.changeHandler(c.value)},{default:k(()=>[S(p(c.text),1)]),_:2},1032,["size","view","data-testid","icon-left","onClick"])]))),128))]),_:1}),n.isVKButtonShown?(l(),A(i,{key:0})):b("",!0)]),_:1},8,["loading"])])}const pt=y(ht,[["render",mt],["__scopeId","data-v-50097212"]]),ft={name:"LoginFormModal",setup(){const{startConnection:e}=Re();return{startConnection:e}},mixins:[J,pe],components:{AuthorizationConfirm:rt,GInput:he,AuthorizationMethods:pt},directives:{maska:me},props:{modalName:{type:String},modalData:{type:Object}},data(){return{Sizes:H,Side:de,phone:"",isConfirm:!1,confirmPhoneMethodsError:!1,externalConfirmInfo:null,transport:null,error:null,socket:null,authMetricSent:!1}},computed:{TEST_IDS(){return Ae},isMobile(){const{$screen:e}=v();return e.width<640},unmaskedPhone(){return V(this.phone)},isCartRoute(){return(this._.provides[Q]||this.$route).path.includes(R.ORDER+R.PRODUCTS)}},methods:{submitHandler(e){const{$sendYandexMetrika:t,$sendTagManagerMetric:r}=v(),s=T();if(!this.phone){this.error=this.$t("phoneNumberIsRequired");return}e&&(this.transport=e,q(e,"start"),_({step:e}),P.isExternal(e)?(this.externalAuthorization(e),P.hasSecondScreen(e)&&(this.isConfirm=!0)):s.register({phone:this.unmaskedPhone,verify_type:e}).then(o=>{this.startTimer(o.retry_seconds),this.isConfirm=!0}).catch(o=>{this.error=o.error_message,_({step:e,result:"error",errorMessage:o?.error_message})}),this.isCartRoute&&(t(w.LOGGED_IN_CART),r(w.LOGGED_IN_CART)))},inputHandler(){this.error=null},async handleSuccess(e){const{registerConfirm:t,onAfterLogin:r}=T();t({phone:this.unmaskedPhone,verify_type:e?.transport,ext:e}).then(()=>{_({step:e.transport,result:"success"}),this.closeModal(),r()}).catch(s=>{_({step:e.transport,result:"error",errorMessage:s?.error_message}),this.error=s?.error_message})},async externalAuthorization(e){const t=D(),r=T(),s=this.unmaskedPhone,o=i=>{this.startConnection({phone:s,transport:e,confirmMessage:"tpl:register_success",isMobileBrowser:t.isMobileBrowser,wsUrl:i},this.handleSuccess)},n=(i,f)=>{i?window.open(i,"_blank"):f&&console.error(`Ðе полÑÑен URL Ð´Ð»Ñ ÑедиÑекÑа (transport: ${e})`)},d=r.getExternalAuthData,a=i=>{const{url:f,expected:c}=d?P.buildRedirectUrl(e,i,s):P.getRedirectUrl(e,i);n(f,c),o(i.ws)};if(d){a(d);return}console.warn("externalAuthorization: пÑедзагÑÑженнÑе даннÑе оÑÑÑÑÑÑвÑÑÑ, иÑполÑзÑеÑÑÑ fallback");try{const i=await r.fetchAuthExternalData(s);a(i)}catch(i){console.error(i)}},showPersonalDataProcessingAgreement(){const{showUserAgreement:e}=D();e(B.privatePolice)},showPersonalDataTerms(){const{showUserAgreement:e}=D();e(B.personalDataTerms)}},watch:{phone(e){!this.authMetricSent&&V(e).length===10&&(this.authMetricSent=!0,_())}},mounted(){const{$sendYandexMetrika:e,$sendTagManagerMetric:t}=v();this.$refs.phoneInput.$refs.inputField.focus(),this.isCartRoute&&(e(w.SHOW_AUTHORIZATION_MODAL_IN_CART),t(w.SHOW_AUTHORIZATION_MODAL_IN_CART))}},gt={ref:"loginForm",class:"header-login-form"},_t={class:"login__form-content"},Ct={class:"login__confirm-methods"},bt={class:"login__text-agreements"},vt=["data-testid"];function Tt(e,t,r,s,o,n){const d=C("GInput"),a=C("AuthorizationMethods"),i=C("AuthorizationConfirm"),f=ue("maska");return l(),u("div",gt,[(l(),A(O,{defer:"",to:e.teleportToTitle},[S(p(e.$t("enter")),1)],8,["to"])),(l(),A(O,{defer:"",to:e.teleportToFooter},[o.isConfirm?(l(),A(i,{key:1,phone:o.phone,transport:o.transport,onChangePhone:t[4]||(t[4]=c=>o.isConfirm=!1),onCloseHandler:t[5]||(t[5]=c=>e.closeModal())},null,8,["phone","transport"])):(l(),u("div",{key:0,class:"login__form",onSubmit:t[3]||(t[3]=(...c)=>n.submitHandler&&n.submitHandler(...c))},[m("div",_t,[K(g(d,{ref:"phoneInput",modelValue:o.phone,"onUpdate:modelValue":t[0]||(t[0]=c=>
1o.phone=c),autocomplete:"on",class:"login__phone-input",name:"phone",placeholder:"+7 (___) ___-__-__","allow-clear":!1,"without-star":"","custom-error":o.error,type:"phone","data-testid":"registerPhone","error-test-id":n.TEST_IDS.AUTH.INPUT_ERROR,onInput:n.inputHandler},null,8,["modelValue","custom-error","error-test-id","onInput"]),[[f,"+7 (###) ###-##-##"]]),m("div",Ct,[g(a,{"is-error":o.confirmPhoneMethodsError,onChoose:n.submitHandler},null,8,["is-error","onChoose"])]),m("div",bt,[S(p(e.$t("ÐÑбиÑÐ°Ñ ÑпоÑоб авÑоÑизаÑии, Ð²Ñ Ð´Ð°ÑÑе"))+" ",1),m("a",{class:"login__text-agreements-link",onClick:t[1]||(t[1]=(...c)=>n.showPersonalDataTerms&&n.showPersonalDataTerms(...c))},p(e.$t("ÑоглаÑие")),1),S(" "+p(e.$t("на обÑабоÑÐºÑ ÑвоиÑ
даннÑÑ
. ÐодÑобнее об обÑабоÑке даннÑÑ
в"))+" ",1),m("a",{class:"login__text-agreements-link","data-testid":n.TEST_IDS.AUTH.LINK_PRIVACY_POLICY,onClick:t[2]||(t[2]=(...c)=>n.showPersonalDataProcessingAgreement&&n.showPersonalDataProcessingAgreement(...c))},p(e.$t("ÐолиÑике")),9,vt),t[6]||(t[6]=S(". ",-1))])])],32))],8,["to"]))],512)}const hr=y(ft,[["render",Tt],["__scopeId","data-v-910bad19"]]);export{hr as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.