1import{g as ee,n as L,a as te,b as ne,r as ae,v as oe,_ as ie,c as se}from"./kosRCU1r.js";import{K as le,x as ue,M as re,r as o,c as m,m as ce,v as de,a as pe,o as r,b as c,e as n,E as ve,h as x,g as _e,T as fe,R as U,V as S,t as d,C as T,n as me,i as ye,L as he,z as ge,D as be,_ as ke}from"./BafG0enI.js";import{g as we}from"./Dv4m7iBK.js";import{u as Ce}from"./BbwJrXS9.js";import{t as xe}from"./b7c24pf3.js";import{s as Se}from"./DhHT-QsW.js";import"./BporYn2C.js";const Te={class:"social-continuation",dir:"rtl"},Me={key:"loading",class:"social-continuation__state","aria-live":"polite"},Ae={key:"phone"},Ie={"aria-hidden":"true"},qe={class:"social-continuation__description"},Ve={key:0,class:"social-continuation__email",dir:"ltr"},Ee={key:"otp"},De=["disabled"],Ne={class:"social-continuation__description"},$e={dir:"ltr"},Pe={class:"social-continuation__resend"},Re={key:0,class:"social-continuation__checking"},Fe={key:2},Oe={key:"error",class:"social-continuation__state social-continuation__state--error"},ze={class:"social-continuation__error-icon","aria-hidden":"true"},Be=le({__name:"auth-social-continue",setup(Ke){ue({title:"تکÙ
ÛÙ ÙØ±Ùد",meta:[{name:"robots",content:"noindex, nofollow"}]});const M=re(),N=Ce(),u=o("loading"),y=o("google"),A=o(null),$=o(null),I=o(""),l=o(!1),p=o(0),b=o(0),P=o("ÙØ±Ùد تکÙ
ÛÙ ÙØ´Ø¯"),R=o("در Ø§ÙØ¬Ø§Ù
ÙØ±Ùد Ù
Ø´Ú©ÙÛ Ù¾ÛØ´ Ø¢Ù
د. ÙØ·ÙØ§Ù Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯."),v=o(null),q=o(null);let k=null;const F=m({get:()=>I.value,set:e=>{I.value=L(e)}}),w=m(()=>L(I.value)),O=m(()=>/^09\d{9}$/.test(w.value)),h=m(()=>te(y.value)),W=m(()=>({google:"G",twitch:"T",kick:"K"})[y.value]),V=m(()=>ne($.value||E(M.query.return_to)));function E(e){return Array.isArray(e)?e[0]:e}function z(e){const t=E(e);return t==="twitch"||t==="kick"?t:"google"}function G(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`}function H(e){be().$toast.error((e==null?void 0:e.message)||"در Ø§ÙØ¬Ø§Ù
Ø¯Ø±Ø®ÙØ§Ø³Øª Ù
Ø´Ú©ÙÛ Ù¾ÛØ´ Ø¢Ù
د. Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯.",{theme:"colored",type:"error"})}function i(e,t){g(),P.value=e,R.value=t,u.value="error"}function D(e){const t=String((e==null?void 0:e.readable_code)||"");return(e==null?void 0:e.status)===410||t==="social_auth_flow_expired"?(i("زÙ
Ø§Ù ÙØ±Ùد Ø¨Ù Ù¾Ø§ÛØ§Ù Ø±Ø³ÛØ¯","Ø¨Ø±Ø§Û ØÙظ اÙ
ÙÛØªØ اÛÙ ÙØ±Ø§ÛÙØ¯ Ù
ÙÙØ¶Û شد٠است. ÙØ±Ùد را Ø¯ÙØ¨Ø§Ø±Ù آغاز Ú©ÙÛØ¯."),!0):t==="account_link_conflict"||t==="social_identity_conflict"||t==="ambiguous_cellphone"?(i("Ø§ØªØµØ§Ù ØØ³Ø§Ø¨ ÙÛØ§Ø² Ø¨Ù Ø¨Ø±Ø±Ø³Û Ø¯Ø§Ø±Ø¯","اÛÙ Ø§Ø·ÙØ§Ø¹Ø§Øª Ø¨Ù Ø¨ÛØ´ از ÛÚ© ØØ³Ø§Ø¨ Ù
رتبط است. Ø¨Ø±Ø§Û Ø¬ÙÙÚ¯ÛØ±Û از Ø§ØªØµØ§Ù Ø§Ø´ØªØ¨Ø§ÙØ با Ù¾Ø´ØªÛØ¨Ø§ÙÛ Ø¯ÙÙÛØªÙ در تÙ
اس Ø¨Ø§Ø´ÛØ¯."),!0):(e==null?void 0:e.status)===403||t==="user_is_not_active"?(i("ØØ³Ø§Ø¨ در دسترس ÙÛØ³Øª","اÛÙ ØØ³Ø§Ø¨ در ØØ§Ù ØØ§Ø¶Ø± اÙ
Ú©Ø§Ù ÙØ±Ùد ÙØ¯Ø§Ø±Ø¯. Ø¨Ø±Ø§Û Ø¨Ø±Ø±Ø³Û Ø¨ÛØ´ØªØ± با Ù¾Ø´ØªÛØ¨Ø§ÙÛ ØªÙ
اس Ø¨Ú¯ÛØ±Ûد."),!0):(H(e),!1)}async function j(e=null){try{const t=await we();return t.data&&N.addME(t.data),t.data||e}catch{return e&&N.addME(e),e}}async function B(e=null){const t=await j(e);if(!t){i("ÙØ´Ø³Øª ÙØ±Ùد Ø³Ø§Ø®ØªÙ ÙØ´Ø¯","ÙØ±Ùد تاÛÛØ¯ شد اÙ
ا Ø¯Ø±ÛØ§Ùت Ø§Ø·ÙØ§Ø¹Ø§Øª ØØ³Ø§Ø¨ Ù
Ù
Ú©Ù ÙØ¨Ùد. ÙØ·ÙØ§Ù Ø¯ÙØ¨Ø§Ø±Ù ÙØ§Ø±Ø¯ Ø´ÙÛØ¯.");return}const a=t.is_kyc_complete?V.value||"/panel/dashboard":"/panel/kyc";await U(a)}async function J(){var e;try{const a=(await ee()).data||{};if(a.status!=="phone_required"){i("ÙØ¶Ø¹Ûت ÙØ±Ùد Ù
عتبر ÙÛØ³Øª","اÛÙ ÙØ±Ø§ÛÙØ¯ ÙØ§Ø¨Ù اداÙ
Ù ÙÛØ³Øª. ÙØ±Ùد را Ø¯ÙØ¨Ø§Ø±Ù آغاز Ú©ÙÛØ¯.");return}y.value=z(a.provider),A.value=typeof a.masked_email=="string"?a.masked_email:null,$.value=typeof a.return_to=="string"?a.return_to:null,u.value="phone",await S(),(e=q.value)==null||e.focus()}catch(t){D(t)||i("ارتباط Ø¨Ø±ÙØ±Ø§Ø± ÙØ´Ø¯","Ø¯Ø±ÛØ§Ùت ÙØ¶Ø¹Ûت ÙØ±Ùد Ù
Ù
Ú©Ù ÙØ¨Ùد. ÙØ·ÙØ§Ù ÙØ±Ùد را Ø¯ÙØ¨Ø§Ø±Ù آغاز Ú©ÙÛØ¯.")}}async function K(){var t,a,_,f,s;if(!O.value||l.value)return;l.value=!0,b.value++,u.value==="otp"&&((t=v.value)==null||t.listenForWebOtp());let e=!1;try{const C=await ae(w.value,G());e=!0,u.value="otp",Y(Number(((a=C.data)==null?void 0:a.retry_after)||120))}catch(C){(_=v.value)==null||_.reset(),D(C)}finally{l.value=!1}e&&(await S(),await((f=v.value)==null?void 0:f.focus(0)),(s=v.value)==null||s.listenForWebOtp())}async function Q(e){var a,_,f;if(e.length!==6||l.value)return;l.value=!0;let t=!1;try{const s=await oe(w.value,e);await B(((a=s.data)==null?void 0:a.user)||null)}catch(s){b.value++,(_=v.value)==null||_.reset(),String((s==null?void 0:s.readable_code)||"")==="otp_expired"&&(p.value=0),D(s),t=u.value==="otp"}finally{l.value=!1}t&&(await S(),await((f=v.value)==null?void 0:f.focus(0)))}async function X(){var e;b.value++,g(),u.value="phone",await S(),(e=q.value)==null||e.focus()}function Y(e){g(),p.value=Math.max(0,e),k=Se(()=>{p.value=Math.max(0,p.value-1),p.value===0&&g()},1e3)}function g(){k&&clearInterval(k),k=null}async function Z(){const e=V.value?{redirect:V.value}:void 0;await U({path:"/auth",query:e})}return ce(async()=>{y.value=z(M.query.provider);const e=E(M.query.result);if(e==="authenticated"){await B();return}if(e==="cancelled"){i("ÙØ±Ùد ÙØºÙ شد",`ÙØ±Ùد با ${h.value} ØªÙØ³Ø· Ø´Ù
ا ÙØºÙ شد.`);return}if(e==="expired"){i("زÙ
Ø§Ù ÙØ±Ùد Ø¨Ù Ù¾Ø§ÛØ§Ù Ø±Ø³ÛØ¯","Ø¨Ø±Ø§Û ØÙظ اÙ
ÙÛØªØ اÛÙ ÙØ±Ø§ÛÙØ¯ Ù
ÙÙØ¶Û شد٠است. ÙØ±Ùد را Ø¯ÙØ¨Ø§Ø±Ù آغاز Ú©ÙÛØ¯.");return}if(e==="provider_error"){i("ارتباط Ø¨Ø±ÙØ±Ø§Ø± ÙØ´Ø¯",`Ø¯Ø±ÛØ§Ùت Ø§Ø·ÙØ§Ø¹Ø§Øª از ${h.value} Ù
Ù
Ú©Ù ÙØ¨Ùد. ÚÙØ¯ ÙØØ¸Ù Ø¯Ûگر Ø¯ÙØ¨Ø§Ø±Ù ØªÙØ§Ø´ Ú©ÙÛØ¯.`);return}if(e==="account_unavailable"){i("ØØ³Ø§Ø¨ در دسترس ÙÛØ³Øª","اÛÙ ØØ³Ø§Ø¨ در ØØ§Ù ØØ§Ø¶Ø± اÙ
Ú©Ø§Ù ÙØ±Ùد ÙØ¯Ø§Ø±Ø¯. Ø¨Ø±Ø§Û Ø¨Ø±Ø±Ø³Û Ø¨ÛØ´ØªØ± با Ù¾Ø´ØªÛØ¨Ø§ÙÛ Ø¯ÙÙÛØªÙ در تÙ
اس Ø¨Ø§Ø´ÛØ¯.");return}if(e==="conflict"){i("Ø§ØªØµØ§Ù ØØ³Ø§Ø¨ ÙÛØ§Ø² Ø¨Ù Ø¨Ø±Ø±Ø³Û Ø¯Ø§Ø±Ø¯","اÛÙ ØØ³Ø§Ø¨ اجتÙ
Ø§Ø¹Û ÙØ¨ÙØ§Ù Ø¨Ù ØØ³Ø§Ø¨ دÛÚ¯Ø±Û Ù
تص٠شد٠است. Ø¨Ø±Ø§Û Ø¬ÙÙÚ¯ÛØ±Û از Ø§ØªØµØ§Ù Ø§Ø´ØªØ¨Ø§ÙØ با Ù¾Ø´ØªÛØ¨Ø§ÙÛ Ø¯ÙÙÛØªÙ در تÙ
اس Ø¨Ø§Ø´ÛØ¯.");return}await J()}),de(()=>g()),(e,t)=>{const a=ie,_=se,f=pe("font-awesome-icon");return r(),c("section",Te,[t[11]||(t[11]=n("div",{class:"social-continuation__mark"},[n("img",{src:ve,alt:"دÙÙÛØªÙ"})],-1)),x(fe,{name:"social-step",mode:"out-in"},{default:_e(()=>[u.value==="loading"?(r(),c("div",Me,[t[2]||(t[2]=n("span",{class:"social-continuation__loader","aria-hidden":"true"},null,-1)),t[3]||(t[3]=n("h1",null,"در ØØ§Ù تکÙ
ÛÙ ÙØ±Ùد",-1)),n("p",null,"ارتباط اÙ
٠با "+d(h.value)+" در ØØ§Ù Ø¨Ø±Ø±Ø³Û Ø§Ø³Øª.",1)])):u.value==="phone"?(r(
1),c("div",Ae,[n("span",{class:me(["social-continuation__provider",`is-${y.value}`])},[n("b",Ie,d(W.value),1),T(" "+d(h.value)+" Ù
تص٠شد ",1)],2),t[4]||(t[4]=n("h1",null,"Ø´Ù
ار٠Ù
ÙØ¨Ø§Û٠را تاÛÛØ¯ Ú©ÙÛØ¯",-1)),n("p",qe," Ø¨Ø±Ø§Û Ø§ØªØµØ§Ù Ø§Ù
Ù "+d(h.value)+" Ø¨Ù ØØ³Ø§Ø¨ دÙÙÛØªÙØ Ø´Ù
ار٠Ù
ÙØ¨Ø§ÛÙ Ø®ÙØ¯ را ÙØ§Ø±Ø¯ Ú©ÙÛØ¯. ",1),A.value?(r(),c("p",Ve,d(A.value),1)):ye("",!0),x(a,{ref_key:"mobileInput",ref:q,modelValue:F.value,"onUpdate:modelValue":t[0]||(t[0]=s=>F.value=s),"input-id":"social-auth-cellphone",valid:O.value,loading:l.value,autofocus:"",onSubmit:K},null,8,["modelValue","valid","loading"]),t[5]||(t[5]=n("p",{class:"social-continuation__hint"}," اگر اÛÙ Ø´Ù
Ø§Ø±Ù ÙØ¨Ùا٠در دÙÙÛØªÙ ثبت Ø´Ø¯Ù Ø¨Ø§Ø´Ø¯Ø Ø§ØªØµØ§Ù Ø¨Ù ÙÙ
Ø§Ù ØØ³Ø§Ø¨ Ø§ÙØ¬Ø§Ù
Ù
ÛâØ´ÙØ¯. ",-1))])):u.value==="otp"?(r(),c("div",Ee,[n("button",{type:"button",class:"social-continuation__back",disabled:l.value,onClick:X},t[6]||(t[6]=[n("span",{"aria-hidden":"true"},"â",-1),n("span",null,"تغÛÛØ± Ø´Ù
ارÙ",-1)]),8,De),t[10]||(t[10]=n("h1",null,"کد تاÛÛØ¯ را ÙØ§Ø±Ø¯ Ú©ÙÛØ¯",-1)),n("p",Ne,[t[7]||(t[7]=T(" کد Ø´Ø´âØ±ÙÙ
Û Ø§Ø±Ø³Ø§ÙâØ´Ø¯Ù Ø¨Ù ")),n("b",$e,d(w.value),1),t[8]||(t[8]=T(" را ÙØ§Ø±Ø¯ Ú©ÙÛØ¯. "))]),n("form",{class:"social-continuation__otp",onSubmit:t[1]||(t[1]=he(()=>{},["prevent"]))},[x(_,{ref_key:"otpInput",ref:v,"id-prefix":"social-auth-code",disabled:l.value,"reset-key":b.value,onComplete:Q},null,8,["disabled","reset-key"])],32),n("div",Pe,[l.value?(r(),c("span",Re,t[9]||(t[9]=[n("span",{class:"social-continuation__spinner"},null,-1),T(" در ØØ§Ù Ø¨Ø±Ø±Ø³Û Ú©Ø¯ ")]))):p.value===0?(r(),c("button",{key:1,type:"button",onClick:K}," ارسا٠Ù
جدد کد ")):(r(),c("span",Fe,"ارسا٠Ù
جدد تا "+d(ge(xe)(p.value))+" ثاÙÛÙ",1))])])):(r(),c("div",Oe,[n("span",ze,[x(f,{icon:"exclamation-triangle"})]),n("h1",null,d(P.value),1),n("p",null,d(R.value),1),n("button",{type:"button",class:"social-continuation__retry",onClick:Z}," بازگشت Ø¨Ù ØµÙØÙ ÙØ±Ùد ")]))]),_:1})])}}}),Qe=ke(Be,[["__scopeId","data-v-c52f00d0"]]);export{Qe 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.