import{j as o}from"./jsx-runtime.D_zvdyIk.js";import{c as j,b as w}from"./site-config.CgQ_bxrG.js";import{u as T}from"./useIsMounted.BP-0-XYC.js";import{u as y}from"./useTranslation.Dg7DwAC5.js";import{I as i}from"./iconify.pctX9hd_.js";import{c as C}from"./utils.BZbvJs_N.js";import{u as g}from"./index.RTTH55m1.js";import{$ as k,t as E}from"./bgm.BGD4n5gC.js";import{c as p,i as v,d as N,e as B}from"./christmas.D6_UQK5_.js";import{d as I}from"./modal.CmyA2O2l.js";import{r as d}from"./index.BIRwh3HZ.js";import{m as f}from"./proxy.D9st1TsE.js";import{A as O}from"./index.BbbUxuaI.js";import"./site.Deo0TYgJ.js";import"./utils.D6Ui05B2.js";import"./index.3whys8t3.js";import"./index.BHh4vvK5.js";import"./_commonjsHelpers.CqkleIqs.js";function a({onClick:t,ariaLabel:s,title:e,children:r,className:l,dataBgmToggle:n}){const c=T();return o.jsx("button",{type:"button",onClick:t,className:C("rounded-full bg-background/80 p-2 opacity-80 shadow-lg backdrop-blur-sm transition-all duration-200 hover:bg-background hover:opacity-100",l),"aria-label":s,title:c?e:void 0,"data-bgm-toggle":n||void 0,children:r})}function W(){const{t}=y(),[s,e]=d.useState(!0),r=g(I),l=g(p),n=g(k);d.useEffect(()=>{v()},[]);const c=()=>window.scrollTo({top:0,behavior:"smooth"}),u=()=>window.scrollTo({top:document.documentElement.scrollHeight,behavior:"smooth"}),b=()=>{p.get()?N():B()},h=()=>e(x=>!x),m=r;return o.jsxs(f.div,{className:"fixed right-4 bottom-4 z-50 flex flex-col gap-2 text-primary",animate:{x:m?200:0,opacity:m?0:1,pointerEvents:m?"none":"auto"},transition:{duration:.3,ease:"easeInOut"},children:[o.jsx(O,{children:s&&o.jsxs(f.div,{className:"flex flex-col gap-2",initial:{y:50,opacity:0},animate:{y:0,opacity:1},exit:{y:50,opacity:0},transition:{duration:.15,ease:"easeInOut"},children:[j.enabled&&o.jsx(a,{onClick:b,ariaLabel:t("floating.christmas"),title:t("floating.christmas"),children:o.jsx(i,{icon:l?"ri:snowy-fill":"ri:snowy-line",className:"h-5 w-5"})}),w.audio.length>0&&o.jsx(a,{onClick:E,ariaLabel:t("floating.bgm"),title:t("floating.bgm"),dataBgmToggle:!0,children:o.jsx(i,{icon:n?"ri:music-2-fill":"ri:music-2-line",className:"h-5 w-5"})}),o.jsx(a,{onClick:c,ariaLabel:t("floating.backToTop"),title:t("floating.backToTop"),children:o.jsx(i,{icon:"ri:arrow-up-s-line",className:"h-5 w-5"})}),o.jsx(a,{onClick:u,ariaLabel:t("floating.scrollToBottom"),title:t("floating.scrollToBottom"),children:o.jsx(i,{icon:"ri:arrow-down-s-line",className:"h-5 w-5"})})]})}),o.jsx(a,{onClick:h,ariaLabel:t("floating.toggleToolbar"),title:t("floating.toggleToolbar"),className:"size-9 flex-center",children:o.jsx(i,{icon:s?"ri:close-large-fill":"ri:magic-fill",className:"size-4"})})]})}export{W as default};
