import{_ as $,u as B,a as m,v as V,b2 as E,c as j,d as e,W as z,b3 as A,aw as G,ax as f,t as D,F as J,au as K,at as M,aC as r,aA as F,f as L,p as N,i as O,Q as T,aD as X,__tla as Y}from"./index.3b792103.js";import{_ as Z}from"./line.d26ca51b.js";import{s as ee,l as ae,__tla as se}from"./auth.7c6ff6ae.js";let Q,le=Promise.all([(()=>{try{return Y}catch{}})(),(()=>{try{return se}catch{}})()]).then(async()=>{let i,_,h,g,w,y,b,x,k,q,I,C,H,P;i=d=>(N("data-v-65563063"),d=d(),O(),d),_={class:"main-wrap login-page mb-xxl"},h={class:"login-section p-0"},g={class:"custom-form"},w=i(()=>e("h1",{class:"font-md title-color fw-600"},"\u6703\u54E1\u767B\u5165",-1)),y={class:"input-box"},b={class:"input-box"},x=i(()=>e("i",{class:"iconly-Hide icli showHidePassword"},null,-1)),k={class:"socila-section"},q=i(()=>e("span",null,[e("span",{class:"font-sm fw-600 font-theme"}," \u5176\u4ED6\u767B\u5165\u65B9\u5F0F ")],-1)),I={class:"social-wrap"},C=["onClick"],H=i(()=>e("img",{src:Z,alt:"line login"},null,-1)),P={__name:"Index",setup(d){const p=T(),v=X(),u=B(),s=m({username:"",password:""}),U=m("\u7372\u53D6\u9A57\u8B49\u78BC"),o=m(!1),t=m(0),R=async()=>{if(!o.value)return;if(!s.value.username)return r({message:"\u8ACB\u8F38\u5165\u624B\u6A5F\u865F",duration:1e3});let a=await ee(s.value.username);a.code===200?(U.value="\u91CD\u65B0\u767C\u9001",t.value=60,r({message:"\u9A57\u8B49\u78BC\u5DF2\u767C\u9001",duration:1e3})):(t.value=a.data.countdown,r({message:a.message,duration:1e3}))};V(()=>s.value.username,a=>/^09[0-9]{8}$/.test(a)&&t.value===0?o.value=!0:o.value=!1);let c=null;V(()=>t.value,a=>{a>0?(o.value=!1,c||(c=setInterval(()=>{t.value>0&&t.value--},1e3))):(clearInterval(c),c=null,o.value=!0)});const S=async()=>{if(!s.value.username)return r({message:"\u8ACB\u8F38\u5165\u624B\u6A5F\u865F",duration:1e3});if(!s.value.username||!s.value.password)return r({message:"\u8ACB\u8F38\u5165\u5E33\u865F\u53CA\u9A57\u8B49\u78BC",duration:1e3});let a=await ae(s.value);if(a.code===200){if(F.set("token",a.data.token,{expires:365,domain:u.sso_domain}),F.set("uid",a.data.uid,{expires:365,domain:u.sso_domain}),p.query.redirect){v.push(p.query.redirect);return}return v.push("/user")}else a.code===201?(sessionStorage.setItem("reg",s.value.username),v.push({name:"Register",query:{type:"mobile"}})):r({message:"\u767B\u5165\u5931\u6557",duration:1e3})},W=async()=>{const a="1661025693";let n="";u.domain.includes("localhost")?n="http://"+u.domain+":5173/m/linelogin":n="https://"+u.domain+"/m/linelogin";let l="https://access.line.me/oauth2/v2.1/authorize?";l=l+"response_type=code",l+="&client_id="+a,l+="&redirect_uri="+n,l+="&state="+(p.query.redirect||"login"),l+="&scope=openid%20profile",window.location.href=l};return E(()=>{clearInterval(c)}),(a,n)=>(L(),j("main",_,[e("section",h,[e("form",g,[w,e("div",y,[z(e("input",{type:"tel",placeholder:"\u624B\u6A5F\u865F\u78BC",required:"",class:"form-control","onUpdate:modelValue":n[0]||(n[0]=l=>s.value.username=l)},null,512),[[A,s.value.username]]),e("i",{class:G(["verify",{disable:!o.value}]),onClick:R},[f(D(U.value)+" ",1),t.value>0?(L(),j(J,{key:0},[f("("+D(t.value)+")",1)],64)):K("",!0)],2)]),e("div",b,[z(e("input",{type:"password",placeholder:"\u9A57\u8B49\u78BC",required:"",class:"form-control","onUpdate:modelValue":n[1]||(n[1]=l=>s.value.password=l)},null,512),[[A,s.value.password]]),x]),e("button",{type:"button",class:"btn-solid",onClick:S},"\u767B\u5165")]),e("div",k,[q,e("div",I,[e("a",{href:"javascript:void(0)",class:"font-md title-color fw-600",onClick:M(W,["prevent"])},[H,f(" Line \u767B\u5165 ")],8,C)])])])]))}},Q=$(P,[["__scopeId","data-v-65563063"]])});export{le as __tla,Q as default};