import{i as e,n as a,O as t}from"./vendor-element-C6VO9u7w.js";import{q as s,r,R as l,bi as n,t as o,A as u,D as c,H as i,E as v,M as d,K as m,u as x,v as f}from"./vendor-core-Nc7YMZCV.js";import{r as y}from"./index-WIJVsNja.js";const p={class:"flex items-center justify-center min-h-screen bg-gray-50"},g={class:"text-center"},h={key:1,class:"text-gray-600"},b={class:"text-lg"},j=s({__name:"index",setup(s){const j=n(),w=r(!0),_=r("");return l(()=>{return e=null,a=null,t=function*(){var e;const a=j.query.code;if(!a)return _.value="无效的链接代码",void(w.value=!1);try{const t=yield y(a);200===t.code&&(null==(e=t.data)?void 0:e.url)?window.location.href=t.data.url:_.value=t.msg||"链接解析失败"}catch(t){_.value=t.message||"链接解析失败"}finally{w.value=!1}},new Promise((s,r)=>{var l=e=>{try{o(t.next(e))}catch(a){r(a)}},n=e=>{try{o(t.throw(e))}catch(a){r(a)}},o=e=>e.done?s(e.value):Promise.resolve(e.value).then(l,n);o((t=t.apply(e,a)).next())});var e,a,t}),(s,r)=>{const l=e;return f(),o("div",p,[u("div",g,[w.value?(f(),c(l,{key:0,class:"is-loading text-4xl text-blue-500 mb-4"},{default:v(()=>[d(x(a))]),_:1})):_.value?(f(),o("div",h,[d(l,{class:"text-4xl text-red-500 mb-2"},{default:v(()=>[d(x(t))]),_:1}),u("p",b,m(_.value),1)])):i("",!0)])])}}});export{j as default};
