import{c as f,x as s,y as t,L as u,R as k,J as v,u as o,T as g,z as e,C as d,Q as p,ac as y,P as b}from"./vue-vendor-Bsazo-x0.js";import{_ as T,a as w}from"./index-DNRbUlyV.js";const M={class:"theme-toggle-container"},C=["title"],L={key:"sun",class:"fas fa-sun"},x={key:"moon",class:"fas fa-moon"},B={key:"auto",class:"fas fa-circle-half-stroke"},S={key:1,class:"theme-switch-wrapper"},N=["title"],V={class:"switch-handle"},z={class:"handle-icon"},$={key:0,class:"fas fa-sun"},D={key:1,class:"fas fa-moon"},E={key:2,class:"fas fa-circle-half-stroke"},F={key:2,class:"theme-segmented"},I=["title","onClick"],J={key:0,class:"ml-1 hidden sm:inline"},O={__name:"ThemeToggle",props:{mode:{type:String,default:"compact",validator:l=>["compact","dropdown","segmented"].includes(l)},showLabel:{type:Boolean,default:!1}},setup(l){const a=w(),h=[{value:"light",label:"浅色模式",shortLabel:"浅色",icon:"fas fa-sun"},{value:"dark",label:"深色模式",shortLabel:"深色",icon:"fas fa-moon"},{value:"auto",label:"跟随系统",shortLabel:"自动",icon:"fas fa-circle-half-stroke"}],m=f(()=>{const n=h.find(i=>i.value===a.themeMode);return n?`点击切换主题 - ${n.label}`:"切换主题"}),r=()=>{a.cycleThemeMode()},_=n=>{a.setThemeMode(n)};return(n,i)=>(t(),s("div",M,[l.mode==="compact"?(t(),s("button",{key:0,class:"theme-toggle-button",title:m.value,onClick:r},[k(g,{mode:"out-in",name:"fade"},{default:v(()=>[o(a).themeMode==="light"?(t(),s("i",L)):o(a).themeMode==="dark"?(t(),s("i",x)):(t(),s("i",B))]),_:1})],8,C)):l.mode==="dropdown"?(t(),s("div",S,[e("button",{class:d(["theme-switch",{"is-dark":o(a).themeMode==="dark","is-auto":o(a).themeMode==="auto"}]),title:m.value,onClick:r},[i[0]||(i[0]=e("div",{class:"switch-bg"},[e("div",{class:"stars"},[e("span"),e("span"),e("span")]),e("div",{class:"clouds"},[e("span"),e("span")])],-1)),e("div",V,[e("div",z,[o(a).themeMode==="light"?(t(),s("i",$)):o(a).themeMode==="dark"?(t(),s("i",D)):(t(),s("i",E))])])],10,N)])):l.mode==="segmented"?(t(),s("div",F,[(t(),s(p,null,y(h,c=>e("button",{key:c.value,class:d(["theme-segment",{active:o(a).themeMode===c.value}]),title:c.label,onClick:P=>_(c.value)},[e("i",{class:d(c.icon)},null,2),l.showLabel?(t(),s("span",J,b(c.shortLabel),1)):u("",!0)],10,I)),64))])):u("",!0)]))}},j=T(O,[["__scopeId","data-v-78f09a8c"]]);export{j as T};
