PageSourceSearch

https://ibasa.ir/_nuxt/D8KShJXf.js

js ibasa.ir collected 2026-10-02 23:29:08 UTC 3,003 bytes, 1 lines download raw bytes

1import{_ as S}from"./BaUBNTtz.js";import{_ as q}from"./C3Jyrd7Q.js";import{_ as B}from"./Co8E1a2A.js";import{f as I,G as L,E as j,H as A,R as E,r as f,D as F,I as D,s as G,o as g,c as P,a as w,t as i,b as s,w as r,L as t,T as H,A as O,C as W,d as y,S as z,V as b,W as x,N as $,O as d,j as J}from"./CtMHwfXV.js";import{_ as K}from"./C1Pj0ji8.js";import{f as c}from"./B7QSrAfv.js";import"./BfLrq-jg.js";import"./xMlNgL3B.js";const M=/^09(0[1-5]|[1 3]\d|2[0-2]|9[0-9])\d{7}$/,Q={class:"mb-5 text-center text-lg font-extrabold text-secondary-900 dark:text-secondary-200"},re=I({__name:"login",setup(X){const l=L(),v=j(),V=A(),n=E("config:LoginType","otp"),T=f(),m=F();f(!1);const o=D({phone:T.value,password:"",grantType:n.value,subjects:l.defaultSubjects}),k=G(()=>z({password:n.value==="password"?b().min(8,"حداقل باید ۸ کاراکتر باشد").required("پسورد الزامی است"):void 0,phone:b().matches(M,"شماره را به درستی وارد کنید")})),N=()=>{o.phone&&(n.value==="otp"?l.login(new x({...o,grantType:"otp",phone:c(o.phone)})).then(async()=>{$({name:"auth-confirm",query:{status:"login"}})}).catch(e=>{e.code==d.ResourceExhausted&&m.add({title:"فراخوانی بیش از حد",description:"لطفا چند لحظه دیگر تلاش کنید",color:"danger"})}):l.login(new x({...o,grantType:"password",username:c(o.phone),phone:c(o.phone)})).catch(e=>{[d.Unauthenticated,d.NotFound].includes(e.code)&&m.add({title:v.t("auth.wrong_password"),color:"danger"})}).finally(()=>{var p;let e="/";const a=V.query;a.redirect&&(e=(p=a.redirect)==null?void 0:p.toString()),$({path:e},{replace:!0})}))};function U(){n.value=n.value==="otp"?"password":"otp"}return(e,a)=>{const p=S,h=q,C=B,_=J,R=K;return g(),P("div",null,[w("div",Q,i(e.$t("auth.sign_in_now")),1),s(R,{state:t(o),schema:t(k),class:"mb-5 flex flex-auto flex-col space-y-4 px-4 lg:px-10",onSubmit:N},{default:r(()=>[s(h,{label:e.$t("user.phone_number"),name:"phone"},{default:r(()=>[s(p,{modelValue:t(o).phone,"onUpdate:modelValue":a[0]||(a[0]=u=>t(o).phone=u),type:"text",placeholder:e.$t("user.phone_number")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),s(H,{name:"fade"},{default:r(()=>[t(n)==="password"?(g(),O(h,{key:0,label:e.$t("auth.password"),name:"password"},{default:r(()=>[s(C,{modelValue:t(o).password,"onUpdate:modelValue":a[1]||(a[1]=u=>t(o).password=u),type:"password","show-password-on":"click",placeholder:e.$t("auth.password")},null,8,["modelValue","placeholder"])]),_:1},8,["label"])):W("",!0)]),_:1}),s(_,{type:"submit",color:"primary",block:"",loading:t(l).loading.login||t(l).loading.confirm},{default:r(()=>[y(i(t(n)==="otp"?e.$t("auth.login_register"):e.$t("auth.login")),1)]),_:1},8,["loading"]),a[2]||(a[2]=w("hr",{class:"my-3 lg:mx-5"},null,-1)),s(_,{type:"info",variant:"ghost",block:"",onClick:U},{default:r(()=>[y(i(t(n)==="otp"?e.$t("auth.login_with_password"):e.$t("auth.login_with_sms")),1)]),_:1})]),_:1},8,["state","schema"])])}}});export{re 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.