var z=(F,R,s)=>new Promise((P,g)=>{var M=r=>{try{u(s.next(r))}catch(h){g(h)}},E=r=>{try{u(s.throw(r))}catch(h){g(h)}},u=r=>r.done?P(r.value):Promise.resolve(r.value).then(M,E);u((s=s.apply(F,R)).next())});import{f as A,n as N,u as f,H as I,w as V}from"./vue-vendor-CxLCUzY4.js";import{T as W,Y as X,P as Y,L as Z}from"./index-B_2CoVdl.js";import{useWindowSizeFn as _}from"./useWindowSizeFn-C3WExEpc.js";import{u as $}from"./useContentViewHeight-DlpfApuB.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./usePageContext-HMYqek-Q.js";function U(F,R,s,P,g=0,M=A(0)){const E=A(null),{footerHeightRef:u}=$();let r={useLayoutFooter:!0};const h=e=>{r=e};function D(){N(()=>{B()})}function p(e,x="all"){var m,H,l,b;function c(t){return Number(t.replace(/[^\d]/g,""))}let i=0;const a="0px";if(e){const t=getComputedStyle(e),n=c((m=t==null?void 0:t.marginTop)!=null?m:a),o=c((H=t==null?void 0:t.marginBottom)!=null?H:a),d=c((l=t==null?void 0:t.paddingTop)!=null?l:a),k=c((b=t==null?void 0:t.paddingBottom)!=null?b:a);x==="all"?(i+=n,i+=o,i+=d,i+=k):x==="top"?(i+=n,i+=d):(i+=o,i+=k)}return i}function T(e){return e==null?null:e instanceof HTMLDivElement?e:e.$el}function B(){return z(this,null,function*(){var b;if(!F.value)return;yield N();const e=T(f(R));if(!e)return;const{bottomIncludeBody:x}=X(e);let c=0;s.forEach(t=>{var n,o;c+=(o=(n=T(f(t)))==null?void 0:n.offsetHeight)!=null?o:0});let i=(b=p(e))!=null?b:0;P.forEach(t=>{i+=p(T(f(t)))});let a=0;function m(t,n){if(t&&n){const o=t.parentElement;o&&(Y(n)?o.classList.contains(n)?a+=p(o,"bottom"):(a+=p(o,"bottom"),m(o,n)):Z(n)&&n>0&&(a+=p(o,"bottom"),m(o,--n)))}}I(g)?m(e,f(g)):m(e,g);let H=x-f(u)-f(M)-c-i-a;const l=()=>{var t;(t=r.elements)==null||t.forEach(n=>{var o,d;H+=(d=(o=T(f(n)))==null?void 0:o.offsetHeight)!=null?d:0})};r.useLayoutFooter&&f(u)>0,l(),E.value=H})}return W(()=>{N(()=>{B()})}),_(()=>{B()},50,{immediate:!0}),V(()=>[u.value],()=>{B()},{flush:"post",immediate:!0}),{redoHeight:D,setCompensation:h,contentHeight:E}}export{U as useContentHeight};
