var x=Object.defineProperty;var f=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var h=(s,t,e)=>t in s?x(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,u=(s,t)=>{for(var e in t||(t={}))A.call(t,e)&&h(s,e,t[e]);if(f)for(var e of f(t))v.call(t,e)&&h(s,e,t[e]);return s};var p=(s,t,e)=>new Promise((c,o)=>{var n=r=>{try{i(e.next(r))}catch(a){o(a)}},m=r=>{try{i(e.throw(r))}catch(a){o(a)}},i=r=>r.done?c(r.value):Promise.resolve(r.value).then(n,m);i((e=e.apply(s,t)).next())});import"./element-plus-BCa6Zci8.js";import"./vxe-CiIRgvGK.js";import{R as B,aA as R,a6 as y,aB as b,aC as E,O as I}from"./Editor-CrAfk7jY-Cd4xhKAl.js";import{useRoute as O}from"./vue-router-CwSAuTE4.js";import{d as C,az as k,c as U,o as w,J as $,O as g,u as _}from"./vue-CAMRmZ-8.js";import{_ as q}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./dayjs-BGdj-UA2.js";import"./@vueuse-CFu7Lllw.js";import"./@element-plus-icons-vue-BKci8WR4.js";import"./lodash-es-DyZ5XK_i.js";import"./shared-CcA2kMdO.js";import"./monaco-editor-BnTtZo-x.js";import"./html2canvas-DNSjNh3_.js";import"./mockjs-D1skojwT.js";import"./marked-BQZxLJfc.js";const J={class:"loading"},S=C({__name:"Auth",props:{remote:{},access:{},baseUrl:{default:"/"}},setup(s){return p(this,null,function*(){let t,e;const c=s,o=B(u(u({alert:y},R),c.access)),n=O(),m=a=>p(null,null,function*(){const d=`${c.remote||b}/api/open/user/${a}`,l=yield E(d).catch(()=>null);return!l||!l.success?(yield y("登录失败"),null):l.data}),i=n.query.token,r=i?([t,e]=k(()=>m(i)),t=yield t,e(),t):null;if(r)try{o.login(r);const a=n.query.redirect;location.href=decodeURIComponent(a||c.baseUrl)}catch(a){location.reload()}return(a,d)=>(w(),U("div",J,"正在登录中..."))})}}),z=q(S,[["__scopeId","data-v-2674e98b"]]),Z=C({__name:"auth",setup(s){return p(this,null,function*(){let t,e;const c=new I,o=([t,e]=k(()=>c.getExtension().catch(()=>null)),t=yield t,e(),t),n=o==null?void 0:o.remote,m=o==null?void 0:o.__ACCESS__;return(i,r)=>_(n)?(w(),$(_(z),{key:0,remote:_(n),access:_(m)},null,8,["remote","access"])):g("",!0)})}});export{Z as default};
