import{c as W,a as N,l as X}from"../chunks/cL9VaPgy.js";import{t as B,J as U,K as V,a5 as ee,as as ae,Z,an as te,at as re,au as ne,av as se,aw as z,P as oe,ax as ie,ay as x,az as le,aA as L,F as y,aB as fe,aC as ce,i as ue,p as de,j,k as _e,D as G,af as ve,m as v,aD as he,f as me,d as u,s as M,l as O,a as F,b as ge,c as $,E as k,n as T,aE as pe,g as d,h as be,aF as ye,y as we,z as Se,o as Te}from"../chunks/C75YQU_W.js";import{i as ke}from"../chunks/B4FYT0oR.js";import{e as Ee,i as xe,s as I}from"../chunks/D-5ps19L.js";import{B as Me,a as Oe,e as Fe}from"../chunks/Wy6oXzdU.js";import{b as A}from"../chunks/DzSV4D8H.js";import{g as H}from"../chunks/BpVw-oe-.js";import{g as He}from"../chunks/Cz-4yBSw.js";function je(i,a,h){if(!a||a===le(String(h??"")))return;let l;const f=i.__svelte_meta?.loc;f?l=`near ${f.file}:${f.line}:${f.column}`:L?.[y]&&(l=`in ${L[y]}`),fe(ce(l))}function Ae(i,a,h=!1,l=!1,f=!1){var g=i,n="";B(()=>{var c=ee;if(n===(n=a()??"")){U&&V();return}if(c.nodes_start!==null&&(ae(c.nodes_start,c.nodes_end),c.nodes_start=c.nodes_end=null),n!==""){if(U){for(var _=Z.data,t=V(),p=t;t!==null&&(t.nodeType!==te||t.data!=="");)p=t,t=re(t);if(t===null)throw ne(),se;f||je(t.parentNode,_,n),z(Z,p),g=oe(t);return}var s=n+"";h?s=`<svg>${s}</svg>`:l&&(s=`<math>${s}</math>`);var r=ie(s);if((h||l)&&(r=x(r)),z(x(r),r.lastChild),h||l)for(;x(r);)g.before(x(r));else g.before(r)}})}const Be='<symbol viewBox="0 0 24 24" id="iconSpinner"><path fill="currentColor" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"></path><circle cx="12" cy="2.5" r="1.5" fill="currentColor"><animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"></animateTransform></circle></symbol>',Ne=Object.freeze(Object.defineProperty({__proto__:null,iconSpinner:Be},Symbol.toStringTag,{value:"Module"}));o[y]="src/routes/+layout.svelte";var $e=(i,a)=>{k(a,!v(a))},Ce=(i,a)=>{T(i.target,i.currentTarget)&&k(a,!1)},De=N($('<li><a class="d.iblock p.2"> </a></li>'),o[y],[[120,3,[[121,4]]]]),Pe=N($('<li><form action="/?/signout" method="POST"><!></form></li>'),o[y],[[126,3,[[127,4]]]]),Re=N($('<nav class="flex flex.end p.2"><button type="button" class="main-nav__toggle btn savnac h5 svelte-1lj5aue"><svg class="icon" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 6.5H19V8H5V6.5Z"></path><path d="M5 16.5H19V18H5V16.5Z"></path><path d="M5 11.5H19V13H5V11.5Z"></path></svg> <span class="visually-hidden">Toggle Menu</span></button> <ul class="main-nav flex gap.4 flex.center svelte-1lj5aue"><!> <!></ul></nav> <main class="p.4"><!></main> <svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden" version="1.1" xmlns="http://www.w3.org/2000/svg"><defs><!></defs></svg>',1),o[y],[[87,0,[[88,1,[[97,2,[[103,3],[104,3],[105,3]]],[107,2]]],[110,1]]],[146,0],[150,0,[[156,1]]]]);function o(i,a){W(new.target),de(a,!0,o),H.user=a.data.user;const h=[{label:"Home",href:"/"},{label:"Sign In",href:"/sign-in",onlyShowFor:"GUEST"},{label:"Sign Up",href:"/sign-up",onlyShowFor:"GUEST"},{label:"Dashboard",href:"/dashboard",onlyShowFor:"USER"}];let l=j(_e(()=>h.filter(e=>T(e.onlyShowFor,void 0)?!0:H.user?T(e.onlyShowFor,"USER"):T(e.onlyShowFor,"GUEST"))),"navLinks"),f,g,n,c=j(G(!1),"signoutPending"),_=j(G(!1),"isMenuOpen");ve(()=>{v(_)?n.setAttribute("inert","true"):n.removeAttribute("inert")});var t=Re();he("keydown",pe,e=>{if(v(_)&&T(e.key,"Escape")){k(_,!1);return}});var p=me(t),s=u(p);s.__click=[$e,_],A(s,e=>f=e,()=>f);var r=M(s,2);r.__click=[Ce,_];var C=u(r);O(()=>Ee(C,17,()=>v(l),xe,(e,b)=>{var m=De(),w=u(m),S=u(w,!0);d(w),d(m),B(()=>{I(w,"href",v(b).href),be(S,v(b).label)}),F(e,m)}),"each",o,119,2);var q=M(C,2);{var J=e=>{var b=Pe(),m=u(b),w=u(m);O(()=>Me(w,{type:"submit",get loading(){return v(c)},children:we(o,(S,R)=>{Se();var Q=Te("Sign Out");F(S,Q)}),$$slots:{default:!0}}),"component",o,139,5,{componentTag:"Button"}),d(m),Oe(m,(S,R)=>Fe?.(S,R),()=>()=>(k(c,!0),()=>{H.user=null,k(c,!1),He("/")})),d(b),F(e,b)};O(()=>ke(q,e=>{H.user&&e(J)}),"if",o,125,2)}d(r),A(r,e=>g=e,()=>g),d(p);var E=M(p,2),K=u(E);O(()=>ye(K,()=>a.children),"render",o,147,1),d(E),A(E,e=>n=e,()=>n);var D=M(E,2),P=u(D),Y=u(P);return Ae(Y,()=>Object.values(Ne).join(""),!0),d(P),d(D),B(()=>I(s,"aria-expanded",v(_))),F(i,t),ge({...X()})}ue(["click"]);export{o as component};
