"use client"
import{c as p}from"./chunk-CTSTG4GK.mjs";import{a as f}from"./chunk-AK3VTPOG.mjs";import{d as n,g as m,i as l}from"./chunk-JP57AFGB.mjs";import{ChevronDown as b,Menu as N,X as g}from"lucide-react";import o from"next/link";import{useParams as y}from"next/navigation";import{useEffect as k,useState as w}from"react";import x from"swr";import{Fragment as v,jsx as e,jsxs as t}from"react/jsx-runtime";function M({theme:u="light"}){let{domain:r="dub.co"}=y(),[a,c]=w(!1);k(()=>{a?document.body.style.overflow="hidden":document.body.style.overflow="auto"},[a]);let{data:d}=x(r==="dub.co"&&"/api/auth/session",m,{dedupingInterval:6e4});return t("div",{className:l(u==="dark"&&"dark"),children:[e("button",{onClick:()=>c(!a),className:l("fixed right-3 top-3 z-40 rounded-full p-2 transition-colors duration-200 hover:bg-gray-200 focus:outline-none active:bg-gray-300 lg:hidden dark:hover:bg-white/20 dark:active:bg-white/30",a&&"hover:bg-gray-100 active:bg-gray-200"),children:a?e(g,{className:"h-5 w-5 text-gray-600 dark:text-white/70"}):e(N,{className:"h-5 w-5 text-gray-600 dark:text-white/70"})}),e("nav",{className:l("fixed inset-0 z-20 hidden w-full bg-white px-5 py-16 lg:hidden dark:bg-black dark:text-white/70",a&&"block"),children:t("ul",{className:"grid divide-y divide-gray-200 dark:divide-white/[0.15]",children:[t("li",{className:"py-3",children:[t("button",{className:"flex w-full justify-between",onClick:()=>setOpenFeatures(!openFeatures),children:[e("p",{className:"font-semibold",children:"Features"}),e(b,{className:l("h-5 w-5 text-gray-500 transition-all dark:text-white/50",openFeatures&&"rotate-180")})]}),openFeatures&&e("div",{className:"grid gap-4 overflow-hidden py-4",children:f.map(({slug:s,icon:i,shortTitle:h})=>t(o,{href:r==="dub.co"?`/${s}`:`https://dub.co/${s}`,onClick:()=>c(!1),className:"flex w-full space-x-2",children:[e(i,{className:"h-5 w-5 text-gray-500 dark:text-white/80"}),e("span",{className:"text-sm",children:h})]},s))})]}),p.map(({name:s,slug:i})=>e("li",{className:"py-3",children:e(o,{href:r==="dub.co"?`/${i}`:`https://dub.co/${i}`,onClick:()=>c(!1),className:"flex w-full font-semibold capitalize",children:s})},i)),d&&Object.keys(d).length>0?e("li",{className:"py-3",children:e(o,{href:n,className:"flex w-full font-semibold capitalize",children:"Dashboard"})}):t(v,{children:[e("li",{className:"py-3",children:e(o,{href:`${n}/login`,className:"flex w-full font-semibold capitalize",children:"Log in"})}),e("li",{className:"py-3",children:e(o,{href:`${n}/register`,className:"flex w-full font-semibold capitalize",children:"Sign Up"})})]})]})})]})}export{M as a};
