const e=require("../_util/type.js"),t=require("../_util/classNames.js"),n=require("../_util/props-util/initDefaultProps.js"),r=require("../config-provider/hooks/useConfigInject.js"),i=require("../_util/vue-types/index.js"),a=require("../_util/isNumeric.js"),o=require("./injectionKey.js");let s=require("vue"),c=require("@antsoo-lib/icons");var l={xs:`479.98px`,sm:`575.98px`,md:`767.98px`,lg:`991.98px`,xl:`1199.98px`,xxl:`1599.98px`,xxxl:`1999.98px`},u=()=>({prefixCls:String,collapsible:{type:Boolean,default:void 0},collapsed:{type:Boolean,default:void 0},defaultCollapsed:{type:Boolean,default:void 0},reverseArrow:{type:Boolean,default:void 0},zeroWidthTriggerStyle:{type:Object,default:void 0},trigger:i.default.any,width:i.default.oneOfType([i.default.number,i.default.string]),collapsedWidth:i.default.oneOfType([i.default.number,i.default.string]),breakpoint:i.default.oneOf(e.tuple(`xs`,`sm`,`md`,`lg`,`xl`,`xxl`,`xxxl`)),theme:i.default.oneOf(e.tuple(`light`,`dark`)).def(`dark`),onBreakpoint:Function,onCollapse:Function}),d=(()=>{let e=0;return(t=``)=>(e+=1,`${t}${e}`)})(),f=(0,s.defineComponent)({compatConfig:{MODE:3},name:`ALayoutSider`,inheritAttrs:!1,props:n.default(u(),{collapsible:!1,defaultCollapsed:!1,reverseArrow:!1,width:200,collapsedWidth:80}),emits:[`breakpoint`,`update:collapsed`,`collapse`],setup(e,{emit:n,attrs:i,slots:u}){let{prefixCls:f}=r.default(`layout-sider`,e),p=(0,s.inject)(o.SiderHookProviderKey,void 0),m=(0,s.shallowRef)(!!(e.collapsed===void 0?e.defaultCollapsed:e.collapsed)),h=(0,s.shallowRef)(!1);(0,s.watch)(()=>e.collapsed,()=>{m.value=!!e.collapsed}),(0,s.provide)(o.SiderCollapsedKey,m);let g=(t,r)=>{e.collapsed===void 0&&(m.value=t),n(`update:collapsed`,t),n(`collapse`,t,r)},_=(0,s.shallowRef)(e=>{h.value=e.matches,n(`breakpoint`,e.matches),m.value!==e.matches&&g(e.matches,`responsive`)}),v;function y(e){return _.value(e)}let b=d(`ant-sider-`);p&&p.addSider(b),(0,s.onMounted)(()=>{(0,s.watch)(()=>e.breakpoint,()=>{try{v?.removeEventListener(`change`,y)}catch{v?.removeListener(y)}if(typeof window<`u`){let{matchMedia:t}=window;if(t&&e.breakpoint&&e.breakpoint in l){v=t(`(max-width: ${l[e.breakpoint]})`);try{v.addEventListener(`change`,y)}catch{v.addListener(y)}y(v)}}},{immediate:!0})}),(0,s.onBeforeUnmount)(()=>{try{v?.removeEventListener(`change`,y)}catch{v?.removeListener(y)}p&&p.removeSider(b)});let x=()=>{g(!m.value,`clickTrigger`)};return()=>{let n=f.value,{collapsedWidth:r,width:o,reverseArrow:l,zeroWidthTriggerStyle:d,trigger:p=u.trigger?.(),collapsible:g,theme:_}=e,v=m.value?r:o,y=a.default(v)?`${v}px`:String(v),b=Number.parseFloat(String(r||0))===0?(0,s.createVNode)(`span`,{onClick:x,class:t.default(`${n}-zero-width-trigger`,`${n}-zero-width-trigger-${l?`right`:`left`}`),style:d},[p||(0,s.createVNode)(c.BarsOutlined,null,null)]):null,S={expanded:l?(0,s.createVNode)(c.RightOutlined,null,null):(0,s.createVNode)(c.LeftOutlined,null,null),collapsed:l?(0,s.createVNode)(c.LeftOutlined,null,null):(0,s.createVNode)(c.RightOutlined,null,null)}[m.value?`collapsed`:`expanded`],C=p===null?null:b||(0,s.createVNode)(`div`,{class:`${n}-trigger`,onClick:x,style:{width:y}},[p||S]),w=[i.style,{flex:`0 0 ${y}`,maxWidth:y,minWidth:y,width:y}],T=t.default(n,`${n}-${_}`,{[`${n}-collapsed`]:!!m.value,[`${n}-has-trigger`]:g&&p!==null&&!b,[`${n}-below`]:!!h.value,[`${n}-zero-width`]:Number.parseFloat(y)===0},i.class);return(0,s.createVNode)(`aside`,{...i,class:T,style:w},[(0,s.createVNode)(`div`,{class:`${n}-children`},[u.default?.()]),g||h.value&&b?C:null])}}});exports.default=f,exports.siderProps=u;