import"./vue-C2cMydZB.js";import{k as D,c as I,u as j,q as V}from"./primevue-D560Sdto.js";import{D as L}from"./diagnostics-service-4wNjnnV6.js";import{a5 as b,r as _,I as v,K as g,d as t,j as c,J as x,e as h,c as i,D as y,P as $,Q as k,E as u,L as q,i as z,N as C,H as A,G as F}from"./@vue-Bf7e1FJA.js";import{o as G,O as H}from"./app-BEmliBhW.js";import{s as J}from"./pinia-BVayYkVO.js";import{t as B}from"./laravel-vue-i18n-DoYn1SwG.js";import"./@primevue-DPkGvRPC.js";import"./@primeuix-C4hPHhAU.js";import"./axios-NIGUFBhG.js";import"./vue-router-CKUI0Twr.js";import"./@vueuse-Ca5vHdxT.js";import"./sprintf-js-D7DtBTRn.js";import"./justified-layout-1UKsdMGj.js";import"./@sidsbrmnn-DQhBXYP8.js";import"./qrcode-B3tOMrWf.js";import"./dijkstrajs-C00ieaqj.js";import"./vue-collapsed-BjXSUHBS.js";import"./leaflet-B16DWo85.js";import"./leaflet-rotatedmarker-roe_HPmI.js";import"./leaflet.markercluster-CQ4sI09g.js";import"./@lychee-org-CcYfPfz8.js";import"./axios-cache-interceptor-hz9-Z59L.js";import"./cache-parser-DXYp_BCq.js";import"./fast-defer-9MI9za_P.js";import"./object-code-SBtdq8jY.js";import"./pinia-plugin-persistedstate-B8MS7Mes.js";import"./destr-BPvN1X9m.js";import"./deep-pick-omit-CegYQlcN.js";/* empty css            */const K={class:"text-muted-color font-mono text-sm"},O=b({__name:"ConfigurationsDiagnostics",emits:["loaded"],setup(w,{emit:r}){const e=_(void 0),m=r;function a(){L.config().then(o=>{e.value=o.data,m("loaded",o.data)})}return a(),(o,n)=>e.value?(t(),v(c(D),{key:0,header:o.$t("diagnostics.configuration"),class:"border-none max-w-7xl mx-auto",dir:"ltr"},{default:x(()=>[h("pre",null,[(t(!0),i($,null,k(e.value,s=>(t(),i("div",K,u(s),1))),256)),n[0]||(n[0]=y(`
		`))])]),_:1},8,["header"])):g("",!0)}}),P={class:"text-muted-color font-mono text-sm"},Q=b({__name:"InfoDiagnostics",emits:["loaded"],setup(w,{emit:r}){const e=_(void 0),m=r;function a(){L.info().then(o=>{e.value=o.data,m("loaded",o.data)})}return a(),(o,n)=>e.value?(t(),v(c(D),{key:0,header:o.$t("diagnostics.info"),class:"border-none max-w-7xl mx-auto",dir:"ltr"},{default:x(()=>[h("pre",null,[(t(!0),i($,null,k(e.value,s=>(t(),i("div",P,u(s),1))),256)),n[0]||(n[0]=y(`
		`))])]),_:1},8,["header"])):g("",!0)}}),R={key:0,class:"text-sky-400 font-bold"},U={class:"flex flex-col"},W={class:"w-full flex"},M={class:"text-muted-color"},X={class:"flex"},Y={class:"text-muted-color italic text-xs"},Z=b({__name:"ErrorsDiagnostics",emits:["loaded"],setup(w,{emit:r}){const e=_(void 0),m=r;function a(){L.errors().then(s=>{e.value=s.data,m("loaded",n(s.data))})}function o(s){return s==="error"?"text-danger-700 font-bold":s==="warning"?"text-orange-500":s==="info"?"text-primary-400":""}function n(s){const p=[];return s.forEach(d=>{let f="";d.type==="error"?f="Error:   ":d.type==="warning"?f="Warning: ":d.type==="info"&&(f="Info:    "),p.push(f+d.message),d.details.forEach(E=>{p.push("         "+E)})}),p}return a(),(s,p)=>(t(),v(c(D),{header:s.$t("diagnostics.self-diagnosis"),class:"border-none max-w-7xl mx-auto",dir:"ltr"},{default:x(()=>[e.value?(t(!0),i($,{key:1},k(e.value,d=>(t(),i("div",U,[h("div",W,[h("div",{class:q(["w-24 flex-none capitalize",o(d.type)])},u(d.type),3),h("div",M,u(d.message),1)]),(t(!0),i($,null,k(d.details,f=>(t(),i("div",X,[p[0]||(p[0]=h("div",{class:"w-24 flex-none"},null,-1)),h("div",Y,u(f),1)]))),256))]))),256)):(t(),i("div",R,u(s.$t("diagnostics.loading")),1))]),_:1},8,["header"]))}}),tt={key:1,class:"text-sky-400 font-bold"},et={key:2},ot={class:"text-muted-color font-mono"},st=b({__name:"SpaceDiagnostics",setup(w){const r=_(!1),e=_(void 0);function m(){r.value=!0,L.space().then(a=>{e.value=a.data})}return(a,o)=>(t(),v(c(D),{header:a.$t("diagnostics.space"),class:"border-none max-w-7xl mx-auto",dir:"ltr"},{default:x(()=>[r.value?g("",!0):(t(),v(c(I),{key:0,icon:"pi pi-refresh",class:"w-48 border-none font-bold",onClick:m},{default:x(()=>[y(u(a.$t("diagnostics.load_space")),1)]),_:1})),r.value&&!e.value?(t(),i("div",tt,u(a.$t("diagnostics.loading")),1)):g("",!0),e.value?(t(),i("pre",et,[(t(!0),i($,null,k(e.value,n=>(t(),i("div",ot,u(n),1))),256)),o[0]||(o[0]=y(`
		`))])):g("",!0)]),_:1},8,["header"]))}}),jt=b({__name:"Diagnostics",setup(w){const r=G(),{user:e}=J(r);r.getUser();const m=j(),a=_(void 0),o=_(void 0),n=_(void 0),s=z(()=>a.value!==void 0&&o.value!==void 0&&n.value!==void 0);function p(l){a.value=l}function d(l){o.value=l}function f(l){n.value=l}function E(){if(!s.value)return;const l=a.value?.join(`
`)??"",S=o.value?.join(`
`)??"",T=n.value?.join(`
`)??"",N=`Self-diagnosis:
${"-".repeat(20)}
${l}


Info:
${"-".repeat(20)}
${S}


Config:
${"-".repeat(20)}
${T}`;navigator.clipboard.writeText(N).then(()=>m.add({severity:"info",summary:B("diagnostics.toast.info"),detail:B("diagnostics.toast.copy"),life:3e3}))}return(l,S)=>{const T=F("tooltip");return t(),i($,null,[C(c(V),{class:"w-full border-0 h-14"},{start:x(()=>[C(H)]),center:x(()=>[y(u(l.$t("diagnostics.title")),1)]),end:x(()=>[A(C(c(I),{disabled:!s.value,text:"","aria-label":"Copy",icon:"pi pi-copy",onClick:E},null,8,["disabled"]),[[T,l.$t("diagnostics.copy_to_clipboard")]])]),_:1}),C(Z,{onLoaded:p}),c(e)?.id?(t(),v(Q,{key:0,onLoaded:d})):g("",!0),c(e)?.id?(t(),v(st,{key:1})):g("",!0),c(e)?.id?(t(),v(O,{key:2,onLoaded:f})):g("",!0)],64)}}});export{jt as default};
