import{n as R}from"./index-009d300e.js";const w="horizontal",r="vertical",M={name:"multipane",props:{layout:{type:String,default:r}},data(){return{isResizing:!1}},computed:{classnames(){return["multipane","layout-"+this.layout.slice(0,1),this.isResizing?"is-resizing":""]},cursor(){return this.isResizing?this.layout==r?"col-resize":"row-resize":""},userSelect(){return this.isResizing?"none":""}},methods:{getPageXY(s){var e;return((e=s.touches)==null?void 0:e[0])||s},onMouseDown(s){const e=s.target;if(e.className&&e.className.match("multipane-resizer")){let{$el:l,layout:u}=this;const{pageX:v,pageY:f}=this.getPageXY(s);let t=e.previousElementSibling,{offsetWidth:z,offsetHeight:y}=t,_=!!(t.style.width+"").match("%");const{addEventListener:c,removeEventListener:h}=window,i=(g,d=0)=>{if(u==r){let o=l.clientWidth,a=g+d;return t.style.width=_?a/o*100+"%":a+"px"}if(u==w){let o=l.clientHeight,a=g+d;return t.style.height=_?a/o*100+"%":a+"px"}};this.isResizing=!0;let n=i();this.$emit("paneResizeStart",t,e,n);const m=g=>{const{pageX:d,pageY:o}=this.getPageXY(g);n=u==r?i(z,d-v):i(y,o-f),this.$emit("paneResize",t,e,n)},p=()=>{n=u==r?i(t.clientWidth):i(t.clientHeight),this.isResizing=!1,h("mousemove",m),h("mouseup",p),h("touchmove",m),h("touchend",p),this.$emit("paneResizeStop",t,e,n)};c("mousemove",m),c("mouseup",p),c("touchmove",m),c("touchend",p)}}}};var P=function(){var e=this,l=e._self._c;return l("div",{class:e.classnames,style:{cursor:e.cursor,userSelect:e.userSelect},on:{mousedown:e.onMouseDown,touchstart:e.onMouseDown}},[e._t("default")],2)},Y=[],H=R(M,P,Y,!1,null,null,null,null);const S=H.exports;export{S as default};
