import{d as w,r as g,z as B,A as C,l as t,i as p,o as i,j as l,k as m,h as d,t as L,y as k,F as z,s as I,b as x,g as N}from"./index-DPl1iiyq.js";import{m as j,j as D,s as E,av as F,v as X}from"./ReferenceContentLoader-Z8YmHBVJ.js";import{bl as A}from"./navigation-BzNQiq4W.js";import{A as R}from"./ScalarHotkey.vue-CqP2dfhk.js";const V={key:0,class:"xl:min-h-header flex min-h-12 items-center justify-between px-3 py-1.5 text-sm md:px-[18px] md:py-2.5"},W={class:"m-0 text-sm font-medium whitespace-nowrap"},q={class:"bg-b-1 relative sticky bottom-0 z-10 w-[inherit] pt-0 has-[.empty-sidebar-item]:border-t md:px-2.5 md:pb-2.5"},M=w({__name:"Sidebar",props:{title:{}},setup(b){const{isSidebarOpen:u}=j(),{sidebarWidth:s,setSidebarWidth:r}=D(),{layout:o}=E(),n=g(!1),v=g(null),{breakpoints:c}=F(),S=e=>{e.preventDefault();const f=e.clientX,$=Number.parseInt(getComputedStyle(v.value).width||s.value,10),h=_=>{n.value=!0,document.body.classList.add("dragging");let a=$+_.clientX-f;a>420&&(a=420+(a-420)*.2),a<240&&(a=240),r(`${a}px`)},y=()=>{n.value=!1,document.body.classList.remove("dragging"),document.documentElement.removeEventListener("mousemove",h,!1),document.documentElement.removeEventListener("mouseup",y,!1),Number.parseInt(s.value,10)>420?r("360px"):Number.parseInt(s.value,10)<240&&r("240px")};document.documentElement.addEventListener("mousemove",h,!1),document.documentElement.addEventListener("mouseup",y,!1)};return(e,f)=>B((i(),p("aside",{ref_key:"sidebarRef",ref:v,class:k(["sidebar bg-b-1 relative flex min-w-full flex-1 flex-col overflow-hidden leading-3 md:min-w-fit md:flex-none md:border-r md:border-b-0",{dragging:n.value}]),style:I({width:t(c).lg?t(s):"100%"})},[l(e.$slots,"header",{},void 0,!0),t(o)!=="modal"&&e.title?(i(),p("div",V,[d("h2",W,L(e.title),1),t(c).lg?m("",!0):l(e.$slots,"button",{key:0},void 0,!0)])):m("",!0),d("div",{class:k(["custom-scroll sidebar-height w-[inherit] pb-0 md:pb-[37px]",{"sidebar-mask":t(o)!=="modal"}])},[l(e.$slots,"content",{},void 0,!0)],2),t(c).lg?(i(),p(z,{key:1},[d("div",q,[l(e.$slots,"button",{},void 0,!0)]),d("div",{class:"resizer",onMousedown:S},null,32)],64)):m("",!0)],6)),[[C,t(u)]])}}),J=X(M,[["__scopeId","data-v-72824faa"]]),K=w({__name:"SidebarButton",props:{click:{type:Function},hotkey:{}},setup(b){const u=b,{layout:s}=E(),r=()=>{u.click()};return(o,n)=>(i(),x(t(A),{class:"bg-b-1 text-c-1 hover:bg-b-2 group relative h-auto w-auto border px-2 py-1 md:w-full md:p-1.5",icon:"Plus",variant:"outlined",onClick:r},{default:N(()=>[l(o.$slots,"title"),o.hotkey&&t(s)==="desktop"?(i(),x(R,{key:0,class:"text-c-2 add-item-hotkey absolute right-2 hidden group-hover:opacity-80 md:block",hotkey:o.hotkey},null,8,["hotkey"])):m("",!0)]),_:3}))}});export{K as g,J as m};
