var x=Object.defineProperty;var f=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var h=(o,t,e)=>t in o?x(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e,u=(o,t)=>{for(var e in t||(t={}))A.call(t,e)&&h(o,e,t[e]);if(f)for(var e of f(t))v.call(t,e)&&h(o,e,t[e]);return o};var p=(o,t,e)=>new Promise((c,s)=>{var n=r=>{try{i(e.next(r))}catch(a){s(a)}},m=r=>{try{i(e.throw(r))}catch(a){s(a)}},i=r=>r.done?c(r.value):Promise.resolve(r.value).then(n,m);i((e=e.apply(o,t)).next())});import"./element-plus-DzGjmbPT.js";import"./vxe-B6nyV_6w.js";import{R as B,aA as R,a6 as y,aB as b,aC as E,O as I}from"./Editor-BMuQppe5-CHXZ3yZL.js";import{useRoute as O}from"./vue-router-DhSsrCnR.js";import{d as C,az as k,c as U,o as w,J as $,O as g,u as _}from"./vue-BCeUdUZW.js";import{_ as q}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./@vueuse--GEK18_Y.js";import"./dayjs-C1e0w4cr.js";import"./@element-plus-icons-vue-Wht5hDuw.js";import"./lodash-es-BOeLjWVX.js";import"./shared-CcA2kMdO.js";import"./monaco-editor-xcHgnT1C.js";import"./html2canvas-DNSjNh3_.js";import"./mockjs-DKzs-0ke.js";import"./marked-BQZxLJfc.js";const S={class:"loading"},j=C({__name:"Auth",props:{remote:{},access:{},baseUrl:{default:"/"}},setup(o){return p(this,null,function*(){let t,e;const c=o,s=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{s.login(r);const a=n.query.redirect;location.href=decodeURIComponent(a||c.baseUrl)}catch(a){location.reload()}return(a,d)=>(w(),U("div",S,"正在登录中..."))})}}),z=q(j,[["__scopeId","data-v-2674e98b"]]),Z=C({__name:"auth",setup(o){return p(this,null,function*(){let t,e;const c=new I,s=([t,e]=k(()=>c.getExtension().catch(()=>null)),t=yield t,e(),t),n=s==null?void 0:s.remote,m=s==null?void 0:s.__ACCESS__;return(i,r)=>_(n)?(w(),$(_(z),{key:0,remote:_(n),access:_(m)},null,8,["remote","access"])):g("",!0)})}});export{Z as default};
