var _e=Object.defineProperty,Ce=Object.defineProperties;var He=Object.getOwnPropertyDescriptors;var ne=Object.getOwnPropertySymbols;var ke=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var ae=(e,t,a)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,D=(e,t)=>{for(var a in t||(t={}))ke.call(t,a)&&ae(e,a,t[a]);if(ne)for(var a of ne(t))Pe.call(t,a)&&ae(e,a,t[a]);return e},re=(e,t)=>Ce(e,He(t));var oe=(e,t,a)=>new Promise((l,n)=>{var y=h=>{try{u(a.next(h))}catch(C){n(C)}},v=h=>{try{u(a.throw(h))}catch(C){n(C)}},u=h=>h.done?l(h.value):Promise.resolve(h.value).then(y,v);u((a=a.apply(e,t)).next())});import{i as b,bk as $e,a as L,r as T,p as we,_ as X,a6 as Z,b9 as ie,b2 as Fe,$ as Se,eq as Be,c as S,a3 as Re,a4 as Oe,a5 as q,eo as Te,Y as R,aZ as xe,er as Ee,es as je,j as fe,b as ge,ds as Ae,o as N,e as Y,f as G,U as O,n as z,ag as ve,aa as he,ae as Q,h as B,et as Ie,eu as Ne,bL as ze,ac as De,bK as $,aL as We,ax as le,O as se,Q as ce,S as Le,T as Ke,x as W,V as Ve,W as Me,au as Ue,y as Xe,z as Ze,R as qe,af as ue,X as pe}from"./index.ae52ebae.js";import{B as Qe}from"./index.c4be8493.js";import{A as Ye}from"./index.ddcc0e35.js";import{o as Ge}from"./onMountedOrActivated.c176aad3.js";import{u as Je}from"./useWindowSizeFn.d176b3a5.js";import{a as et}from"./useContentViewHeight.2a59a8a3.js";import{A as tt}from"./ArrowLeftOutlined.0f7d1b9e.js";var nt={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M869 487.8L491.2 159.9c-2.9-2.5-6.6-3.9-10.5-3.9h-88.5c-7.4 0-10.8 9.2-5.2 14l350.2 304H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h585.1L386.9 854c-5.6 4.9-2.2 14 5.2 14h91.5c1.9 0 3.8-.7 5.2-2L869 536.2a32.07 32.07 0 000-48.4z"}}]},name:"arrow-right",theme:"outlined"},at=nt;function de(e){for(var t=1;t{h=c};function x(){Q(()=>{m()})}function P(c,_="all"){var i,r,s,g;function H(o){return Number(o.replace(/[^\d]/g,""))}let p=0;const k="0px";if(c){const o=getComputedStyle(c),d=H((i=o==null?void 0:o.marginTop)!=null?i:k),f=H((r=o==null?void 0:o.marginBottom)!=null?r:k),F=H((s=o==null?void 0:o.paddingTop)!=null?s:k),E=H((g=o==null?void 0:o.paddingBottom)!=null?g:k);_==="all"?(p+=d,p+=f,p+=F,p+=E):_==="top"?(p+=d,p+=F):(p+=f,p+=E)}return p}function w(c){return c==null?null:c instanceof HTMLDivElement?c:c.$el}function m(){return oe(this,null,function*(){var g;if(!e.value)return;yield Q();const c=w(B(t));if(!c)return;const{bottomIncludeBody:_}=Ie(c);let H=0;a.forEach(o=>{var d,f;H+=(f=(d=w(B(o)))==null?void 0:d.offsetHeight)!=null?f:0});let p=(g=P(c))!=null?g:0;l.forEach(o=>{p+=P(w(B(o)))});let k=0;function i(o,d){if(o&&d){const f=o.parentElement;f&&(ze(d)?f.classList.contains(d)?k+=P(f,"bottom"):(k+=P(f,"bottom"),i(f,d)):De(d)&&d>0&&(k+=P(f,"bottom"),i(f,--d)))}}Ne(n)?i(c,B(n)):i(c,n);let r=_-B(u)-B(y)-H-p-k;const s=()=>{var o;(o=h.elements)==null||o.forEach(d=>{var f,F;r+=(F=(f=w(B(d)))==null?void 0:f.offsetHeight)!=null?F:0})};h.useLayoutFooter&&B(u)>0,s(),v.value=r})}return Ge(()=>{Q(()=>{m()})}),Je(()=>{m()},50,{immediate:!0}),he(()=>[u.value],()=>{m()},{flush:"post",immediate:!0}),{redoHeight:x,setCompensation:C,contentHeight:v}}const pt=L({name:"PageWrapper",components:{PageFooter:be,PageHeader:ft},inheritAttrs:!1,props:{title:$.string,dense:$.bool,ghost:$.bool,content:$.string,contentStyle:{type:Object},contentBackground:$.bool,contentFullHeight:$.bool,contentClass:$.string,fixedHeight:$.bool,upwardSpace:$.oneOfType([$.number,$.string]).def(0)},setup(e,{slots:t,attrs:a}){const l=T(null),n=T(null),y=T(null),v=T(null),{prefixCls:u}=ge("page-wrapper");We(yt,S(()=>e.fixedHeight));const h=S(()=>e.contentFullHeight),C=S(()=>e.upwardSpace),{redoHeight:x,setCompensation:P,contentHeight:w}=ht(h,l,[n,v],[y],C);P({useLayoutFooter:!0,elements:[v]});const m=S(()=>{var i;return[u,{[`${u}--dense`]:e.dense},(i=a.class)!=null?i:{}]}),c=S(()=>e.content||(t==null?void 0:t.headerContent)||e.title||H.value.length),_=S(()=>(t==null?void 0:t.leftFooter)||(t==null?void 0:t.rightFooter)),H=S(()=>Object.keys(le(t,"default","leftFooter","rightFooter","headerContent"))),p=S(()=>{const{contentFullHeight:i,contentStyle:r,fixedHeight:s}=e;if(!i)return D({},r);const g=`${B(w)}px`;return D(re(D({},r),{minHeight:g}),s?{height:g}:{})}),k=S(()=>{const{contentBackground:i,contentClass:r}=e;return[`${u}-content`,r,{[`${u}-content-bg`]:i}]});return he(()=>[_.value],()=>{x()},{flush:"post",immediate:!0}),{getContentStyle:p,wrapperRef:l,headerRef:n,contentRef:y,footerRef:v,getClass:m,getHeaderSlots:H,prefixCls:u,getShowHeader:c,getShowFooter:_,omit:le,getContentClass:k}}});function bt(e,t,a,l,n,y){const v=se("PageHeader"),u=se("PageFooter");return N(),Y("div",{class:z(e.getClass),ref:"wrapperRef"},[e.getShowHeader?(N(),ce(v,qe({key:0,ghost:e.ghost,title:e.title},e.omit(e.$attrs,"class"),{ref:"headerRef"}),Le({default:W(()=>[e.content?(N(),Y(Ue,{key:0},[Xe(Ze(e.content),1)],64)):O(e.$slots,"headerContent",{key:1})]),_:2},[Ke(e.getHeaderSlots,h=>({name:h,fn:W(C=>[O(e.$slots,h,Ve(Me(C||{})))])}))]),1040,["ghost","title"])):ue("",!0),G("div",{class:z(["overflow-hidden",e.getContentClass]),style:ve(e.getContentStyle),ref:"contentRef"},[O(e.$slots,"default")],6),e.getShowFooter?(N(),ce(u,{key:1,ref:"footerRef"},{left:W(()=>[O(e.$slots,"leftFooter")]),right:W(()=>[O(e.$slots,"rightFooter")]),_:3},512)):ue("",!0)],2)}var mt=fe(pt,[["render",bt]]);pe(be);const St=pe(mt),yt="PageWrapperFixedHeight";export{St as P,ct as T,yt as a};