import"./modulepreload-polyfill-B5Qt9EMX.js";import{d as N,u as C,r,g as j,o as M,c as o,a as l,x as _,e as s,q as L,F as T,j as B,t as u,f as g,b as x,n as F,z as I,G as p,K as D,Y as V}from"./vendor-nt8ldNfT.js";import{N as $,F as S}from"./FooterBar-J0dB23BZ.js";import{_ as H}from"./ThemeSwitcher.vue_vue_type_script_setup_true_lang-hbZuyjE_.js";import{_ as P}from"./tailwind-Bkcu6GYy.js";const q={class:"flex flex-col min-h-screen bg-base-200 relative"},A={class:"flex flex-1 relative"},E={class:"z-20 w-48 md:w-56 xl:w-64 bg-base-100 border-r border-base-300 overflow-y-auto p-4 space-y-3"},G=["onClick"],K={class:"block text-sm md:text-base xl:text-lg font-medium text-base-content"},U={class:"z-20 flex-1 p-6 overflow-y-auto"},Y={key:0,class:"text-center text-gray-400"},J={key:1,class:"max-w-3xl mx-auto bg-base-100 p-6 rounded shadow space-y-4"},O={class:"text-2xl font-bold"},Q=["src"],R={class:"text-sm text-gray-500"},W={class:"font-semibold text-base-content"},X=["innerHTML"],Z={class:"mt-4"},ee=["disabled"],ae={key:0,class:"loading loading-spinner mr-2"},se=N({__name:"Tiaozhan",setup(oe){const i=C(),d=r(!0),b=r(!1),v=r(!1),m=r([]),a=r(null),f=r(""),y=j(()=>f.value?{backgroundImage:`url(${f.value})`}:{}),z=async()=>{try{const e=await(await fetch("/tiaozhanmoshi.html?ChallengeMode=Menu")).json();e.status===200&&(m.value=e.data,e.data.length&&await h(e.data[0]))}catch{i.error("副本菜单加载失败")}},h=async n=>{d.value=!0;try{const t=await(await fetch(n.tiaozhanurl)).json();t.status===200&&(a.value=t.data,f.value=t.data.tzpng||"")}catch{i.error("副本详情加载失败")}finally{d.value=!1}},w=async()=>{var n;if((n=a.value)!=null&&n.fuben_id){b.value=!0,v.value=!0;try{const e=`/tiaozhanmoshi.html?kaishi=yes&fuben=${a.value.fuben_id}`,c=await(await fetch(e)).json();c.status===200?i.success(c.msg||"挑战发起成功"):i.warning(c.msg||"挑战失败"),await h(m.value.find(k=>k.tiaozhanurl.includes(a.value.fuben_id)))}catch{i.error("请求失败，请稍后重试")}finally{b.value=!1,v.value=!1}}};return M(async()=>{await z()}),(n,e)=>(l(),o("div",q,[_($),_(H),s("div",A,[s("div",{class:"absolute inset-0 bg-cover bg-center z-0 transition-all",style:L(y.value)},null,4),e[2]||(e[2]=s("div",{class:"absolute inset-0 bg-base-200 bg-opacity-80 backdrop-blur z-10"},null,-1)),s("aside",E,[e[0]||(e[0]=s("h2",{class:"text-lg font-semibold mb-4"},"副本列表",-1)),(l(!0),o(T,null,B(m.value,t=>(l(),o("div",{key:t.tiaozhanurl,class:"cursor-pointer bg-base-200 hover:bg-base-300 p-3 rounded transition",onClick:c=>h(t)},[s("span",K,u(t.tiaozhanname),1)],8,G))),128))]),s("main",U,[d.value?(l(),o("div",Y,"正在加载副本详情...")):a.value?(l(),o("div",J,[s("h1",O,u(a.value.tiname),1),a.value.tzpng?(l(),o("img",{key:0,src:a.value.tzpng,alt:"副本图",class:"w-full rounded max-h-64 object-cover"},null,8,Q)):g("",!0),s("div",R,[e[1]||(e[1]=x(" 发起玩家： ")),s("span",W,u(a.value.Initiateplayer),1)]),s("div",{class:"text-base-content leading-relaxed",innerHTML:a.value.jieshao},null,8,X),s("div",Z,[s("button",{class:F(["btn",{"btn-accent":Number(a.value.Challengestatuscode)<=1,"btn-disabled btn-ghost":Number(a.value.Challengestatuscode)>1}]),disabled:v.value||Number(a.value.Challengestatuscode)>1,onClick:w},[b.value?(l(),o("span",ae)):g("",!0),x(" "+u(a.value.kaishitiaozhan||"操作"),1)],10,ee)])])):g("",!0)])]),_(S)]))}}),te=P(se,[["__scopeId","data-v-95c4955f"]]),ne=I({render:()=>p(D,null,{default:()=>p(V,null,{default:()=>p(te)})})});ne.mount("#app");
