var C=(t,d,a)=>new Promise((u,n)=>{var c=e=>{try{i(a.next(e))}catch(s){n(s)}},h=e=>{try{i(a.throw(e))}catch(s){n(s)}},i=e=>e.done?u(e.value):Promise.resolve(e.value).then(c,h);i((a=a.apply(t,d)).next())});import{bd as H}from"./bootstrap-Bqxdt4iG.js";import{a1 as x,L as m,bk as $,E as R,aa as S,ap as o,aj as l,an as r,az as b,aR as g,a9 as v,aS as y,al as f,ay as k,am as T,V as O}from"../jse/index-index-BUJ_4tQs.js";const B={class:"relative flex min-h-full flex-col"},E={class:"flex-auto"},p={key:0,class:"mb-2 flex text-lg font-semibold"},A={key:0,class:"text-muted-foreground"},N={key:0},w=x({name:"Page",__name:"page",props:{title:{},description:{},contentClass:{},autoContentHeight:{type:Boolean,default:!1},headerClass:{},footerClass:{},heightOffset:{default:0}},setup(t){const d=m(0),a=m(0),u=m(!1),n=$("headerRef"),c=$("footerRef"),h=R(()=>t.autoContentHeight?{height:`calc(var(${H}) - ${d.value}px - ${a.value}px - ${typeof t.heightOffset=="number"?`${t.heightOffset}px`:t.heightOffset})`,overflowY:u.value?"auto":"unset"}:{});function i(){return C(this,null,function*(){var e,s;t.autoContentHeight&&(yield O(),d.value=((e=n.value)==null?void 0:e.offsetHeight)||0,a.value=((s=c.value)==null?void 0:s.offsetHeight)||0,setTimeout(()=>{u.value=!0},30))})}return S(()=>{i()}),(e,s)=>(l(),o("div",B,[t.description||e.$slots.description||t.title||e.$slots.title||e.$slots.extra?(l(),o("div",{key:0,ref_key:"headerRef",ref:n,class:g(v(y)("bg-card border-border relative flex items-end border-b px-6 py-4",t.headerClass))},[b("div",E,[f(e.$slots,"title",{},()=>[t.title?(l(),o("div",p,k(t.title),1)):r("",!0)]),f(e.$slots,"description",{},()=>[t.description?(l(),o("p",A,k(t.description),1)):r("",!0)])]),e.$slots.extra?(l(),o("div",N,[f(e.$slots,"extra")])):r("",!0)],2)):r("",!0),b("div",{class:g(v(y)("h-full p-4",t.contentClass)),style:T(h.value)},[f(e.$slots,"default")],6),e.$slots.footer?(l(),o("div",{key:1,ref_key:"footerRef",ref:c,class:g(v(y)("bg-card align-center flex px-6 py-4",t.footerClass))},[f(e.$slots,"footer")],2)):r("",!0)]))}});export{w as _};
