Files
claude-relay-service/web/admin-spa/dist/assets/index-BAse2XU9.js
2025-12-26 06:36:34 +00:00

24 lines
21 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LoginView-C_fN82yI.js","assets/vue-vendor-BVUySZOn.js","assets/chart-ChB167Jv.js","assets/vendor-Dr8jvgFu.js","assets/ThemeToggle-Btdau4yo.js","assets/ThemeToggle-BLLHl9nT.css","assets/element-plus-CKhypU-Q.js","assets/element-plus-BWHEPMNp.css","assets/LoginView-tn0RQdqM.css","assets/UserLoginView-COfwLqzh.js","assets/UserDashboardView-DyavPA36.js","assets/ConfirmModal-BGRLg47v.js","assets/ConfirmModal-BvCtxUSJ.css","assets/TutorialView-C0wjIk1C.js","assets/TutorialView-BjIHOtH3.css","assets/UserManagementView-CFT_Esng.js","assets/MainLayout-Bd5PtuA8.js","assets/LogoTitle-BKx-1OIz.js","assets/LogoTitle-DXipqypn.css","assets/MainLayout-CCQ2LruH.css","assets/DashboardView-L6RVGrpZ.js","assets/DashboardView-CJCkJ1Cw.css","assets/ApiKeysView-P3GV4oxx.js","assets/WindowCountdown-Cb_iHkvc.js","assets/ActionDropdown-XGihbnCH.js","assets/ActionDropdown-BAe-X9zd.css","assets/ApiKeysView-sn4JYbr5.css","assets/ApiKeyUsageRecordsView-2qB4i7ZK.js","assets/RecordDetailModal-CVWv3dXE.js","assets/RecordDetailModal-BqG3nD3p.css","assets/AccountsView-DXROeeN3.js","assets/AccountsView-ChRk8WT-.css","assets/AccountUsageRecordsView-CUkKidfm.js","assets/SettingsView-BuM-cxrS.js","assets/SettingsView-BrlNWmbu.css","assets/ApiStatsView-C428m7c6.js","assets/ApiStatsView-D5HJh2jj.css"])))=>i.map(i=>d[i]);
import{aP as M,aQ as Z,aR as ee,r as p,c as L,o as z,q as K,V as B,I as F,z as g,x as E,ac as te,Q as se,a5 as G,y as T,C as q,L as U,P,Y as W,B as oe,R as C,J as ae,T as re,O as ne,av as ie,aM as ce,aS as le}from"./vue-vendor-BVUySZOn.js";import{i as ue,z as de}from"./element-plus-CKhypU-Q.js";import{P as w}from"./vendor-Dr8jvgFu.js";import"./chart-ChB167Jv.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const r of i.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&a(r)}).observe(document,{childList:!0,subtree:!0});function s(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(o){if(o.ep)return;o.ep=!0;const i=s(o);fetch(o.href,i)}})();const he="modulepreload",me=function(t){return"/admin-next/"+t},J={},y=function(e,s,a){let o=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),c=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));o=Promise.allSettled(s.map(l=>{if(l=me(l),l in J)return;J[l]=!0;const m=l.endsWith(".css"),f=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const n=document.createElement("link");if(n.rel=m?"stylesheet":he,m||(n.as="script"),n.crossOrigin="",n.href=l,c&&n.setAttribute("nonce",c),document.head.appendChild(n),m)return new Promise((d,h)=>{n.addEventListener("load",d),n.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(r){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=r,window.dispatchEvent(c),!c.defaultPrevented)throw r}return o.then(r=>{for(const c of r||[])c.status==="rejected"&&i(c.reason);return e().catch(i)})};let I=null,fe=0;function Q(t,e="info",s="",a=3e3){I||(I=document.createElement("div"),I.id="toast-container",I.style.cssText="position: fixed; top: 20px; right: 20px; z-index: 10000;",document.body.appendChild(I));const o=++fe,i=document.createElement("div");i.className=`toast rounded-2xl p-4 shadow-2xl backdrop-blur-sm toast-${e}`,i.style.cssText=`
position: relative;
min-width: 320px;
max-width: 500px;
margin-bottom: 16px;
transform: translateX(100%);
transition: transform 0.3s ease-in-out;
`;const r={success:"fas fa-check-circle",error:"fas fa-times-circle",warning:"fas fa-exclamation-triangle",info:"fas fa-info-circle"},c=t.replace(/\n/g,"<br>");return i.innerHTML=`
<div class="flex items-start gap-3">
<div class="flex-shrink-0 mt-0.5">
<i class="${r[e]} text-lg"></i>
</div>
<div class="flex-1 min-w-0">
${s?`<h4 class="font-semibold text-sm mb-1">${s}</h4>`:""}
<p class="text-sm opacity-90 leading-relaxed">${c}</p>
</div>
<button onclick="this.parentElement.parentElement.remove()"
class="flex-shrink-0 text-white/70 hover:text-white transition-colors ml-2">
<i class="fas fa-times"></i>
</button>
</div>
`,I.appendChild(i),setTimeout(()=>{i.style.transform="translateX(0)"},10),a>0&&setTimeout(()=>{i.style.transform="translateX(100%)",setTimeout(()=>{i.remove()},300)},a),o}const pe=Object.freeze(Object.defineProperty({__proto__:null,showToast:Q},Symbol.toStringTag,{value:"Module"})),D={basePath:"/admin-next/",apiPrefix:""};function ge(t=""){return t&&!t.startsWith("/")&&(t="/"+t),D.basePath+(t.startsWith("#")?t:"#"+t)}function ve(){return ge("/login")}const H=D.apiPrefix;function x(t){return t.startsWith("/")||(t="/"+t),H+t}class ye{constructor(){this.baseURL=H}getAuthToken(){return localStorage.getItem("authToken")||null}buildConfig(e={}){const s={headers:{"Content-Type":"application/json",...e.headers},...e},a=this.getAuthToken();return a&&(s.headers.Authorization=`Bearer ${a}`),s}async handleResponse(e){if(e.status===401){const a=window.location.pathname+window.location.hash;throw a.includes("/login")||a.endsWith("/")||(localStorage.removeItem("authToken"),window.location.href=ve()),new Error("Unauthorized")}const s=e.headers.get("content-type");if(s&&s.includes("application/json")){const a=await e.json();if(!e.ok){const o=new Error(a.message||`HTTP ${e.status}`);throw o.response={status:e.status,data:a},o.message=a.message||o.message,o}return a}if(!e.ok)throw new Error(`HTTP ${e.status}: ${e.statusText}`);return e}async get(e,s={}){let a=x(e);if(s.params){const c=new URLSearchParams(s.params);a+="?"+c.toString()}const{params:o,...i}=s,r=this.buildConfig({...i,method:"GET"});try{const c=await fetch(a,r);return await this.handleResponse(c)}catch(c){throw console.error("API GET Error:",c),c}}async post(e,s=null,a={}){const o=x(e),i=this.buildConfig({...a,method:"POST",body:s?JSON.stringify(s):void 0});try{const r=await fetch(o,i);return await this.handleResponse(r)}catch(r){throw console.error("API POST Error:",r),r}}async put(e,s=null,a={}){const o=x(e),i=this.buildConfig({...a,method:"PUT",body:s?JSON.stringify(s):void 0});try{const r=await fetch(o,i);return await this.handleResponse(r)}catch(r){throw console.error("API PUT Error:",r),r}}async patch(e,s=null,a={}){const o=x(e),i=this.buildConfig({...a,method:"PATCH",body:s?JSON.stringify(s):void 0});try{const r=await fetch(o,i);return await this.handleResponse(r)}catch(r){throw console.error("API PATCH Error:",r),r}}async delete(e,s={}){const a=x(e),{data:o,...i}=s,r=this.buildConfig({...i,method:"DELETE",body:o?JSON.stringify(o):void 0});try{const c=await fetch(a,r);return await this.handleResponse(c)}catch(c){throw console.error("API DELETE Error:",c),c}}}const S=new ye,k=`${H}/users`,X=M("user",{state:()=>({user:null,isAuthenticated:!1,sessionToken:null,loading:!1,config:null}),getters:{isLoggedIn:t=>t.isAuthenticated&&t.user,userName:t=>{var e,s;return((e=t.user)==null?void 0:e.displayName)||((s=t.user)==null?void 0:s.username)},userRole:t=>{var e;return(e=t.user)==null?void 0:e.role}},actions:{async login(t){this.loading=!0;try{const e=await w.post(`${k}/login`,t);if(e.data.success)return this.user=e.data.user,this.sessionToken=e.data.sessionToken,this.isAuthenticated=!0,localStorage.setItem("userToken",this.sessionToken),localStorage.setItem("userData",JSON.stringify(this.user)),this.setAuthHeader(),e.data;throw new Error(e.data.message||"Login failed")}catch(e){throw this.clearAuth(),e}finally{this.loading=!1}},async logout(){try{this.sessionToken&&await w.post(`${k}/logout`,{},{headers:{"x-user-token":this.sessionToken}})}catch(t){console.error("Logout request failed:",t)}finally{this.clearAuth()}},async checkAuth(){const t=localStorage.getItem("userToken"),e=localStorage.getItem("userData"),s=localStorage.getItem("userConfig");if(!t||!e)return this.clearAuth(),!1;try{return this.sessionToken=t,this.user=JSON.parse(e),this.config=s?JSON.parse(s):null,this.isAuthenticated=!0,this.setAuthHeader(),await this.getUserProfile(),!0}catch(a){return console.error("Auth check failed:",a),this.clearAuth(),!1}},async getUserProfile(){var t,e,s,a;try{const o=await w.get(`${k}/profile`);if(o.data.success)return this.user=o.data.user,this.config=o.data.config,localStorage.setItem("userData",JSON.stringify(this.user)),localStorage.setItem("userConfig",JSON.stringify(this.config)),o.data.user}catch(o){throw(((t=o.response)==null?void 0:t.status)===401||((e=o.response)==null?void 0:e.status)===403)&&(this.clearAuth(),((s=o.response)==null?void 0:s.status)===403)?new Error(((a=o.response.data)==null?void 0:a.message)||"Your account has been disabled"):o}},async getUserApiKeys(t=!1){try{const e={};t&&(e.includeDeleted="true");const s=await w.get(`${k}/api-keys`,{params:e});return s.data.success?s.data.apiKeys:[]}catch(e){throw console.error("Failed to fetch API keys:",e),e}},async createApiKey(t){try{return(await w.post(`${k}/api-keys`,t)).data}catch(e){throw console.error("Failed to create API key:",e),e}},async deleteApiKey(t){try{return(await w.delete(`${k}/api-keys/${t}`)).data}catch(e){throw console.error("Failed to delete API key:",e),e}},async getUserUsageStats(t={}){try{const e=await w.get(`${k}/usage-stats`,{params:t});return e.data.success?e.data.stats:null}catch(e){throw console.error("Failed to fetch usage stats:",e),e}},clearAuth(){this.user=null,this.sessionToken=null,this.isAuthenticated=!1,this.config=null,localStorage.removeItem("userToken"),localStorage.removeItem("userData"),localStorage.removeItem("userConfig"),delete w.defaults.headers.common["x-user-token"]},setAuthHeader(){this.sessionToken&&(w.defaults.headers.common["x-user-token"]=this.sessionToken)},setupAxiosInterceptors(){w.interceptors.response.use(t=>t,t=>{var e,s;if(((e=t.response)==null?void 0:e.status)===403){const a=(s=t.response.data)==null?void 0:s.message;a&&(a.includes("disabled")||a.includes("Account disabled"))&&(this.clearAuth(),Q(a,"error"),window.location.pathname!=="/user-login"&&(window.location.href="/user-login"))}return Promise.reject(t)})}}}),_e=()=>y(()=>import("./LoginView-C_fN82yI.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])),we=()=>y(()=>import("./UserLoginView-COfwLqzh.js"),__vite__mapDeps([9,1,2,3,4,5,6,7,8])),Ae=()=>y(()=>import("./UserDashboardView-DyavPA36.js"),__vite__mapDeps([10,1,2,3,4,5,11,12,13,6,7,14,8])),Te=()=>y(()=>import("./UserManagementView-CFT_Esng.js"),__vite__mapDeps([15,1,2,3,11,12,6,7,8])),b=()=>y(()=>import("./MainLayout-Bd5PtuA8.js"),__vite__mapDeps([16,1,2,3,17,18,4,5,6,7,19])),be=()=>y(()=>import("./DashboardView-L6RVGrpZ.js"),__vite__mapDeps([20,6,1,2,3,7,21])),ke=()=>y(()=>import("./ApiKeysView-P3GV4oxx.js"),__vite__mapDeps([22,6,1,2,3,7,23,24,25,26])),Ee=()=>y(()=>import("./ApiKeyUsageRecordsView-2qB4i7ZK.js"),__vite__mapDeps([27,6,1,2,3,7,28,29])),Ie=()=>y(()=>import("./AccountsView-DXROeeN3.js"),__vite__mapDeps([30,6,1,2,3,7,11,12,24,25,31])),Pe=()=>y(()=>import("./AccountUsageRecordsView-CUkKidfm.js"),__vite__mapDeps([32,6,1,2,3,7,28,29])),xe=()=>y(()=>import("./TutorialView-C0wjIk1C.js"),__vite__mapDeps([13,1,2,3,6,7,14])),Se=()=>y(()=>import("./SettingsView-BuM-cxrS.js"),__vite__mapDeps([33,1,2,3,6,7,34])),Le=()=>y(()=>import("./ApiStatsView-C428m7c6.js"),__vite__mapDeps([35,1,2,3,17,18,4,5,23,13,6,7,14,36])),Oe=[{path:"/",redirect:()=>{const t=window.location.pathname,e=D.basePath.replace(/\/$/,"");return t===e||t===e+"/","/api-stats"}},{path:"/login",name:"Login",component:_e,meta:{requiresAuth:!1}},{path:"/admin-login",redirect:"/login"},{path:"/user-login",name:"UserLogin",component:we,meta:{requiresAuth:!1,userAuth:!0}},{path:"/user-dashboard",name:"UserDashboard",component:Ae,meta:{requiresUserAuth:!0}},{path:"/api-stats",name:"ApiStats",component:Le,meta:{requiresAuth:!1}},{path:"/dashboard",component:b,meta:{requiresAuth:!0},children:[{path:"",name:"Dashboard",component:be}]},{path:"/api-keys",component:b,meta:{requiresAuth:!0},children:[{path:"",name:"ApiKeys",component:ke}]},{path:"/api-keys/:keyId/usage-records",component:b,meta:{requiresAuth:!0},children:[{path:"",name:"ApiKeyUsageRecords",component:Ee}]},{path:"/accounts",component:b,meta:{requiresAuth:!0},children:[{path:"",name:"Accounts",component:Ie}]},{path:"/accounts/:accountId/usage-records",component:b,meta:{requiresAuth:!0},children:[{path:"",name:"AccountUsageRecords",component:Pe}]},{path:"/tutorial",component:b,meta:{requiresAuth:!0},children:[{path:"",name:"Tutorial",component:xe}]},{path:"/settings",component:b,meta:{requiresAuth:!0},children:[{path:"",name:"Settings",component:Se}]},{path:"/user-management",component:b,meta:{requiresAuth:!0},children:[{path:"",name:"UserManagement",component:Te}]},{path:"/:pathMatch(.*)*",redirect:"/api-stats"}],R=Z({history:ee(D.basePath),routes:Oe});R.beforeEach(async(t,e,s)=>{const a=Y(),o=X();if(console.log("路由导航:",{to:t.path,from:e.path,fullPath:t.fullPath,requiresAuth:t.meta.requiresAuth,requiresUserAuth:t.meta.requiresUserAuth,isAuthenticated:a.isAuthenticated,isUserAuthenticated:o.isAuthenticated}),t.path===e.path&&t.fullPath===e.fullPath)return s();if(t.meta.requiresUserAuth){if(!o.isAuthenticated)try{if(!await o.checkAuth())return s("/user-login")}catch(i){if(i.message&&i.message.includes("disabled")){const{showToast:r}=await y(async()=>{const{showToast:c}=await Promise.resolve().then(()=>pe);return{showToast:c}},void 0);r(i.message,"error")}return s("/user-login")}return s()}t.path==="/api-stats"||t.path.startsWith("/api-stats")?s():t.path==="/user-login"?o.isAuthenticated?s("/user-dashboard"):s():t.meta.requiresAuth&&!a.isAuthenticated?s("/login"):t.path==="/login"&&a.isAuthenticated?s("/dashboard"):s()});const Y=M("auth",()=>{const t=p(!1),e=p(localStorage.getItem("authToken")||""),s=p(""),a=p(""),o=p(!1),i=p({siteName:"Claude Relay Service",siteIcon:"",siteIconData:"",faviconData:"",publicStatsEnabled:!1}),r=p(!0),c=p(null),l=p(!1),m=L(()=>!!e.value&&t.value),f=L(()=>e.value),n=L(()=>({username:s.value}));async function d(u){o.value=!0,a.value="";try{const _=await S.post("/web/auth/login",u);_.success?(e.value=_.token,s.value=_.username||u.username,t.value=!0,localStorage.setItem("authToken",_.token),await R.push("/dashboard")):a.value=_.message||"登录失败"}catch(_){a.value=_.message||"登录失败,请检查用户名和密码"}finally{o.value=!1}}function h(){t.value=!1,e.value="",s.value="",localStorage.removeItem("authToken"),R.push("/login")}function A(){e.value&&(t.value=!0,V())}async function V(){try{const u=await S.get("/web/auth/user");u.success&&u.user&&(s.value=u.user.username),(await S.get("/admin/dashboard")).success||h()}catch{h()}}async function N(){r.value=!0;try{const u=await S.get("/admin/oem-settings");if(u.success&&u.data){if(i.value={...i.value,...u.data},u.data.siteIconData||u.data.siteIcon){const _=document.querySelector("link[rel*='icon']")||document.createElement("link");_.type="image/x-icon",_.rel="shortcut icon",_.href=u.data.siteIconData||u.data.siteIcon,document.getElementsByTagName("head")[0].appendChild(_)}u.data.siteName&&(document.title=`${u.data.siteName} - 管理后台`),u.data.publicStatsEnabled&&O()}}catch(u){console.error("加载OEM设置失败:",u)}finally{r.value=!1}}async function O(){l.value=!0;try{const u=await S.get("/admin/public-stats");u.success&&u.enabled&&u.data?c.value=u.data:c.value=null}catch(u){console.error("加载公开统计失败:",u),c.value=null}finally{l.value=!1}}return{isLoggedIn:t,authToken:e,username:s,loginError:a,loginLoading:o,oemSettings:i,oemLoading:r,publicStats:c,publicStatsLoading:l,isAuthenticated:m,token:f,user:n,login:d,logout:h,checkAuth:A,loadOemSettings:N,loadPublicStats:O}}),v={LIGHT:"light",DARK:"dark",AUTO:"auto"},Ce=M("theme",()=>{const t=p(v.AUTO),e=p(!1),s=L(()=>t.value===v.DARK?!0:t.value===v.LIGHT?!1:e.value),a=L(()=>s.value?v.DARK:v.LIGHT),o=()=>{const n=window.matchMedia("(prefers-color-scheme: dark)");e.value=n.matches;const d=localStorage.getItem("themeMode");d&&Object.values(v).includes(d)?t.value=d:t.value=v.AUTO,i(),l()},i=()=>{const n=document.documentElement;s.value?n.classList.add("dark"):n.classList.remove("dark")},r=n=>{Object.values(v).includes(n)&&(t.value=n)},c=()=>{const n=[v.LIGHT,v.DARK,v.AUTO],h=(n.indexOf(t.value)+1)%n.length;t.value=n[h]};z(t,n=>{localStorage.setItem("themeMode",n),i()}),z(e,()=>{t.value===v.AUTO&&i()});const l=()=>{const n=window.matchMedia("(prefers-color-scheme: dark)"),d=h=>{e.value=h.matches};return e.value=n.matches,n.addEventListener("change",d),()=>{n.removeEventListener("change",d)}};return{themeMode:t,isDarkMode:s,currentTheme:a,systemPrefersDark:e,ThemeMode:v,initTheme:o,setThemeMode:r,cycleThemeMode:c,watchSystemTheme:l,toggleTheme:()=>{c()},setTheme:n=>{n==="dark"?r(v.DARK):n==="light"&&r(v.LIGHT)}}}),j=(t,e)=>{const s=t.__vccOpts||t;for(const[a,o]of e)s[a]=o;return s},Ue={class:"toast-container"},Re=["onClick"],De={class:"toast-content"},$e={class:"toast-icon"},Ve={class:"toast-body"},Ne={key:0,class:"toast-title"},qe={class:"toast-message"},Me=["onClick"],Ke={__name:"ToastNotification",setup(t,{expose:e}){const s=p([]);let a=0;const o=m=>{const f={success:"fas fa-check-circle",error:"fas fa-exclamation-circle",warning:"fas fa-exclamation-triangle",info:"fas fa-info-circle"};return f[m]||f.info},i=(m,f="info",n=null,d=5e3)=>{const h=++a,A={id:h,message:m,type:f,title:n,duration:d,isVisible:!1};return s.value.push(A),setTimeout(()=>{A.isVisible=!0},10),d>0&&setTimeout(()=>{r(h)},d),h},r=m=>{const f=s.value.findIndex(n=>n.id===m);if(f>-1){const n=s.value[f];n.isVisible=!1,setTimeout(()=>{const d=s.value.findIndex(h=>h.id===m);d>-1&&s.value.splice(d,1)},300)}},c=()=>{s.value.forEach(m=>{m.isVisible=!1}),setTimeout(()=>{s.value.length=0},300)},l=(m,f="info",n=null,d=5e3)=>i(m,f,n,d);return K(()=>{window.showToast=l}),B(()=>{window.showToast===l&&delete window.showToast}),e({showToast:l,removeToast:r,clearAllToasts:c}),(m,f)=>(T(),F(G,{to:"body"},[g("div",Ue,[(T(!0),E(se,null,te(s.value,n=>(T(),E("div",{key:n.id,class:q(["toast",`toast-${n.type}`,n.isVisible?"toast-show":"toast-hide"]),onClick:d=>r(n.id)},[g("div",De,[g("div",$e,[g("i",{class:q(o(n.type))},null,2)]),g("div",Ve,[n.title?(T(),E("div",Ne,P(n.title),1)):U("",!0),g("div",qe,P(n.message),1)]),g("button",{class:"toast-close",onClick:W(d=>r(n.id),["stop"])},f[0]||(f[0]=[g("i",{class:"fas fa-times"},null,-1)]),8,Me)]),n.duration>0?(T(),E("div",{key:0,class:"toast-progress",style:oe({animationDuration:`${n.duration}ms`})},null,4)):U("",!0)],10,Re))),128))])]))}},He=j(Ke,[["__scopeId","data-v-c8b24ff5"]]),je={class:"modal-content mx-auto w-full max-w-md p-6"},ze={class:"mb-6 flex items-start gap-4"},Je={class:"flex-1"},Be={class:"mb-2 text-lg font-semibold text-gray-900 dark:text-white"},Fe={class:"whitespace-pre-line leading-relaxed text-gray-700 dark:text-gray-400"},Ge={class:"flex items-center justify-end gap-3"},We=["disabled"],Qe=["disabled"],Xe={key:0,class:"loading-spinner mr-2"},Ye={__name:"ConfirmDialog",setup(t,{expose:e}){const s=p(!1),a=p(!1),o=p(""),i=p(""),r=p("确认"),c=p("取消");let l=null;const m=(h,A,V="确认",N="取消")=>new Promise(O=>{o.value=h,i.value=A,r.value=V,c.value=N,s.value=!0,a.value=!1,l=O}),f=()=>{a.value||(a.value=!0,setTimeout(()=>{s.value=!1,a.value=!1,l&&(l(!0),l=null)},200))},n=()=>{a.value||(s.value=!1,l&&(l(!1),l=null))},d=h=>{s.value&&(h.key==="Escape"?n():h.key==="Enter"&&!h.shiftKey&&!h.ctrlKey&&!h.altKey&&f())};return K(()=>{window.showConfirm=m,document.addEventListener("keydown",d)}),B(()=>{window.showConfirm===m&&delete window.showConfirm,document.removeEventListener("keydown",d)}),e({showConfirm:m}),(h,A)=>(T(),F(G,{to:"body"},[C(re,{appear:"",name:"modal"},{default:ae(()=>[s.value?(T(),E("div",{key:0,class:"modal fixed inset-0 z-[100] flex items-center justify-center p-4",onClick:W(n,["self"])},[g("div",je,[g("div",ze,[A[0]||(A[0]=g("div",{class:"flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-xl bg-gradient-to-br from-amber-500 to-amber-600"},[g("i",{class:"fas fa-exclamation-triangle text-lg text-white"})],-1)),g("div",Je,[g("h3",Be,P(o.value),1),g("div",Fe,P(i.value),1)])]),g("div",Ge,[g("button",{class:"btn bg-gray-100 px-6 py-3 text-gray-700 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-300 dark:hover:bg-gray-600",disabled:a.value,onClick:n},P(c.value),9,We),g("button",{class:q(["btn btn-warning px-6 py-3",{"cursor-not-allowed opacity-50":a.value}]),disabled:a.value,onClick:f},[a.value?(T(),E("div",Xe)):U("",!0),ne(" "+P(r.value),1)],10,Qe)])])])):U("",!0)]),_:1})]))}},Ze=j(Ye,[["__scopeId","data-v-6b3390a6"]]),et={id:"app"},tt={__name:"App",setup(t){const e=Y(),s=Ce(),a=p(),o=p();return K(()=>{s.initTheme(),s.watchSystemTheme(),e.checkAuth(),e.loadOemSettings()}),(i,r)=>{const c=ie("router-view");return T(),E("div",et,[C(c),C(He,{ref_key:"toastRef",ref:a},null,512),C(Ze,{ref_key:"confirmRef",ref:o},null,512)])}}},st=j(tt,[["__scopeId","data-v-dab04b7e"]]),$=ce(st),ot=le();$.use(ot);$.use(R);$.use(ue,{locale:de});const at=X();at.setupAxiosInterceptors();$.mount("#app");export{H as A,j as _,Ce as a,X as b,S as c,Q as s,Y as u};