import{c as h,q as u,t as o,a as c,h as g,d as f,v,I as y,i as C,w as m,aR as i,ae as Q,ad as x,O as $,aS as r}from"./index-BdTXri3T.js";const q=h({name:"QPage",props:{padding:Boolean,styleFn:Function},setup(a,{slots:t}){const{proxy:{$q:n}}=C(),e=u(v,o);if(e===o)return console.error("QPage needs to be a deep child of QLayout"),o;if(u(y,o)===o)return console.error("QPage needs to be child of QPageContainer"),o;const l=c(()=>{const s=(e.header.space===!0?e.header.size:0)+(e.footer.space===!0?e.footer.size:0);if(typeof a.styleFn=="function"){const p=e.isContainer.value===!0?e.containerHeight.value:n.screen.height;return a.styleFn(s,p)}return{minHeight:e.isContainer.value===!0?e.containerHeight.value-s+"px":n.screen.height===0?s!==0?`calc(100vh - ${s}px)`:"100vh":n.screen.height-s+"px"}}),d=c(()=>`q-page${a.padding===!0?" q-layout-padding":""}`);return()=>g("main",{class:d.value,style:l.value},f(t.default))}});function H(a){{const t={active:!0};if(typeof a=="function"){const n=c(a);t.val=n.value,m(n,e=>{t.val=e,t.active===!0&&i()})}else t.val=a;r.push(t),i(),Q(()=>{t.active=!0,i()}),x(()=>{t.active=!1,i()}),$(()=>{r.splice(r.indexOf(t),1),i()})}}export{q as Q,H as u};
