import{Transition as e,computed as t,createBlock as n,createCommentVNode as r,createElementBlock as i,createElementVNode as a,normalizeStyle as o,openBlock as s,ref as c,renderSlot as l,unref as u,watch as d,withCtx as f,withModifiers as p}from"/vue.js";var m={class:`nc-drawer-inner`},h=270,g={__name:`nc-drawer`,props:{show:{type:Boolean,default:!1}},emits:[`update:width`],setup(g,{emit:_}){let v=_,y=c(300),b=t(()=>({width:`${y.value}px`}));d(y,()=>{document.body.style.setProperty(`--nc-drawer-width`,`${y.value}px`)},{immediate:!0});function x(e){document.body.style.cursor=`ew-resize`;let t=e.clientX;t>h&&(y.value=t),v(`update:width`,y.value)}function S(){document.addEventListener(`mousemove`,x,!1),document.addEventListener(`mouseup`,C,!1)}function C(){document.body.style.cursor=``,document.removeEventListener(`mousemove`,x,!1),document.removeEventListener(`mouseup`,C,!1)}function w(){document.body.dataset.drawer_appear=!0}function T(){delete document.body.dataset.drawer_appear}function E(){document.body.dataset.drawer_mode=!0}function D(){delete document.body.dataset.drawer_mode}return(t,c)=>(s(),n(e,{name:`expand-nc-drawer`,appear:``,onBeforeEnter:w,onBeforeLeave:w,onEnter:E,onLeave:D,onAfterEnter:T,onAfterLeave:T},{default:f(()=>[g.show?(s(),i(`aside`,{key:0,class:`nc-drawer`,style:o(u(b))},[a(`div`,m,[l(t.$slots,`default`,{width:u(y)})]),a(`div`,{ref:`border`,class:`nc-drawer-border`,onMousedown:p(S,[`prevent`]),onMouseup:p(C,[`prevent`])},null,544)],4)):r(``,!0)]),_:3}))}};export{g as default};