1import{i as $}from"./vendor-2e8812bb.js";import{x as k,m as L,u as c,c as v,d as n,I as u,A as _,r as d,g as y,n as E,b as M}from"./index-06f6d0af.js";import{M as f,C as A}from"./constant-81aa7e34.js";import"./react-f4fa6042.js";import"./utils-790bf987.js";function C(i){return k.post({url:"".concat(f,"/api/refresh"),data:{token:i}})}const s=L(),K=()=>{c(({user:o})=>o.token);const i=c(({user:o})=>o.user),t=c(o=>o.app.game),e=v(),a="".concat(A,"__").concat(t==null?void 0:t.data.proId),p=$(async o=>{if(!i)try{const r=await C(o),l="".concat(f,"/avatar/").concat(r.nick,"-64.jpg");e(n({user:{...r,avatar:l},token:r.token,ready:!0})),s.set(a,o)}catch(r){e(n({token:void 0,ready:!0})),s.remove(a),t!=null&&t.data.force&&u()}});_(async()=>{d("goLogin",(h="sso_login")=>{const m=t==null?void 0:t.data.proId;if(!m)throw new Error("缺å°ç¸å
³MOA项ç®ID, 请èç³»ç¸å
³äººåé
ç½®ï¼");const I=encodeURIComponent(window.location.href);window.location.href="".concat(f,"/").concat(h,"?project=").concat(m,"&redirect=").concat(I)}),d("goLogout",()=>{e(n({token:void 0})),s.remove(a),t!=null&&t.data.force&&u("login")}),d("isCustom",!0);const{token:o,uid:r,name:l,nick:O,...w}=y();if(o){await p(o),E({search:M(w)},{replace:!0});return}const g=s.get(a);if(g){await p(g);return}if(t!=null&&t.data.force){u();return}e(n({ready:!0}))})},P=()=>(K(),null);export{P 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.