import{r as P}from"../chunks/CNfxrBwf.js";import{t as g,a as d,d as W}from"../chunks/CUaqldoV.js";import{c as v,r as e,t as y,p as z,K as D,L as H,M as q,f as k,a as B,s as f,g as o,n as C}from"../chunks/BSRAYoh9.js";import{s as w}from"../chunks/oozxAL8j.js";import{i as F}from"../chunks/Db5XNeQO.js";import{e as j,i as E}from"../chunks/DRkj5cSX.js";import{s as T}from"../chunks/BBHC2RMp.js";import{a as G,s as S}from"../chunks/DFaclXwQ.js";import{d as I}from"../chunks/Dvr0EhCJ.js";/* empty css                */import{p as J}from"../chunks/Cy8E2L9C.js";import{t as N}from"../chunks/BYuKR2PY.js";const Q=async({data:r,url:a})=>{if(!r.user&&!a.pathname.startsWith("/mgr/login"))throw P(302,"/mgr/login");return{...r}},da=Object.freeze(Object.defineProperty({__proto__:null,load:Q},Symbol.toStringTag,{value:"Module"}));var R=g("<aside><!></aside>");function U(r,a){var s=R();let i;var u=v(s);T(u,()=>a.children),e(s),y(n=>i=G(s,1,"toast svelte-1o3394e",null,i,n),[()=>({"toast--success":a.type==="success","toast--danger":a.type==="danger"})]),d(r,s)}async function V(){await fetch("/mgr/login",{method:"DELETE"}),window.location.reload()}var X=g('<a class="nav-item svelte-st4f7u"> </a>'),Y=g('<nav class="nav svelte-st4f7u"></nav> <div><button class="btn btn--light">Wyloguj</button></div>',1),Z=g('<header class="header container svelte-st4f7u"><div>Admin</div> <!></header> <main class="container"><!></main> <div class="toast-list svelte-st4f7u"></div>',1);function va(r,a){z(a,!0);let s=[{path:"/mgr/home",name:"Home"},{path:"/mgr/aktualnosci",name:"Aktualności"},{path:"/mgr/kadra",name:"Kadra"}],i=D(H([]));N.subscribe(t=>{q(i,t,!0)});var u=Z(),n=k(u),A=f(v(n),2);{var K=t=>{var l=Y(),m=k(l);j(m,21,()=>s,E,(M,b)=>{var c=X(),O=v(c,!0);e(c),y(()=>{S(c,"href",o(b).path),S(c,"aria-current",J.url.pathname===o(b).path?"page":void 0),w(O,o(b).name)}),d(M,c)}),e(m);var _=f(m,2),p=v(_);p.__click=[V],e(_),d(t,l)};F(A,t=>{a.data.user&&t(K)})}e(n);var h=f(n,2),L=v(h);T(L,()=>a.children),e(h);var x=f(h,2);j(x,21,()=>o(i),E,(t,l)=>{U(t,{get type(){return o(l).type},children:(m,_)=>{C();var p=W();y(()=>w(p,o(l).message)),d(m,p)}})}),e(x),d(r,u),B()}I(["click"]);export{va as component,da as universal};
