import{t as b,a as f}from"./Dv2BvCMR.js";import{s as w,f as N,w as x,R as g,aM as k,aK as B,S as T,T as V,U as d,c as v,Z as p,V as C,Y as S,a4 as y}from"./C0u2Lk3h.js";import{V as R}from"./BMKr9CCw.js";function L(u,t){const o=w(h()),c=b(u),n=N({get(){var e;const a=c.value;let s=t!=null&&t.getIndexOf?t.getIndexOf(o.value,a):a.indexOf(o.value);return s<0&&(s=(e=t==null?void 0:t.fallbackIndex)!=null?e:0),s},set(e){l(e)}});function l(e){const a=c.value,s=a.length,I=(e%s+s)%s,_=a[I];return o.value=_,_}function i(e=1){return l(n.value+e)}function m(e=1){return i(e)}function r(e=1){return i(-e)}function h(){var e,a;return(a=f((e=t==null?void 0:t.initialValue)!=null?e:f(u)[0]))!=null?a:void 0}return x(c,()=>l(n.value)),{state:o,index:n,next:m,prev:r,go:l}}const O={class:"text-capitalize"},z=g({__name:"ThemeSwitcher",props:{themes:{}},setup(u){const t=u,{name:o,global:c}=k(),{state:n,next:l,index:i}=L(t.themes.map(r=>r.name),{initialValue:o}),m=()=>{c.name.value=l()};return x(()=>c.name.value,r=>{n.value=r}),(r,h)=>{const e=B("IconBtn");return V(),T(e,{onClick:m},{default:d(()=>[v(C,{icon:t.themes[p(i)].icon},null,8,["icon"]),v(R,{activator:"parent","open-delay":"1000","scroll-strategy":"close"},{default:d(()=>[S("span",O,y(p(n)),1)]),_:1})]),_:1})}}}),U=g({__name:"NavbarThemeSwitcher",setup(u){const t=[{name:"light",icon:"bx-sun"},{name:"dark",icon:"bx-moon"}];return(o,c)=>{const n=z;return V(),T(n,{themes:t})}}});export{U as _};
