import{a6 as e,a7 as t,a as o,Q as a,a8 as i,i as n,a9 as l,p as s,g as r,aa as c,h as u,ab as d,ac as f,r as v,w as p,e as h,ad as g}from"./index.9313841a.js";import{Q as m}from"./QScrollObserver.6e57b6d0.js";import{Q as y}from"./QResizeObserver.55ad86ae.js";var z=e({name:"QPageContainer",setup(e,{slots:u}){const{proxy:{$q:d}}=r(),f=n(l,t);if(f===t)return t;s(c,!0);const v=o((()=>{const e={};return!0===f.header.space&&(e.paddingTop=`${f.header.size}px`),!0===f.right.space&&(e["padding"+(!0===d.lang.rtl?"Left":"Right")]=`${f.right.size}px`),!0===f.footer.space&&(e.paddingBottom=`${f.footer.size}px`),!0===f.left.space&&(e["padding"+(!0===d.lang.rtl?"Right":"Left")]=`${f.left.size}px`),e}));return()=>a("div",{class:"q-page-container",style:v.value},i(u.default))}}),b=e({name:"QLayout",props:{container:Boolean,view:{type:String,default:"hhh lpr fff",validator:e=>/^(h|l)h(h|r) lpr (f|l)f(f|r)$/.test(e.toLowerCase())},onScroll:Function,onScrollHeight:Function,onResize:Function},setup(e,{slots:t,emit:i}){const{proxy:{$q:n}}=r(),c=u(null),z=u(n.screen.height),b=u(!0===e.container?0:n.screen.width),w=u({position:0,direction:"down",inflectionPoint:0}),x=u(0),$=u(!0===d.value?0:f()),L=o((()=>"q-layout q-layout--"+(!0===e.container?"containerized":"standard"))),q=o((()=>!1===e.container?{minHeight:n.screen.height+"px"}:null)),Q=o((()=>0!==$.value?{[!0===n.lang.rtl?"left":"right"]:`${$.value}px`}:null)),R=o((()=>0!==$.value?{[!0===n.lang.rtl?"right":"left"]:0,[!0===n.lang.rtl?"left":"right"]:`-${$.value}px`,width:`calc(100% + ${$.value}px)`}:null));function S(t){if(!0===e.container||!0!==document.qScrollPrevented){const o={position:t.position.top,direction:t.direction,directionChanged:t.directionChanged,inflectionPoint:t.inflectionPoint.top,delta:t.delta.top};w.value=o,void 0!==e.onScroll&&i("scroll",o)}}function C(t){const{height:o,width:a}=t;let n=!1;z.value!==o&&(n=!0,z.value=o,void 0!==e.onScrollHeight&&i("scrollHeight",o),T()),b.value!==a&&(n=!0,b.value=a),!0===n&&void 0!==e.onResize&&i("resize",t)}function H({height:e}){x.value!==e&&(x.value=e,T())}function T(){if(!0===e.container){const e=z.value>x.value?f():0;$.value!==e&&($.value=e)}}let P=null;const j={instances:{},view:o((()=>e.view)),isContainer:o((()=>e.container)),rootRef:c,height:z,containerHeight:x,scrollbarWidth:$,totalWidth:o((()=>b.value+$.value)),rows:o((()=>{const t=e.view.toLowerCase().split(" ");return{top:t[0].split(""),middle:t[1].split(""),bottom:t[2].split("")}})),header:v({size:0,offset:0,space:!1}),right:v({size:300,offset:0,space:!1}),footer:v({size:0,offset:0,space:!1}),left:v({size:300,offset:0,space:!1}),scroll:w,animate(){null!==P?clearTimeout(P):document.body.classList.add("q-body--layout-animate"),P=setTimeout((()=>{P=null,document.body.classList.remove("q-body--layout-animate")}),155)},update(e,t,o){j[e][t]=o}};if(s(l,j),f()>0){let t=function(){i=null,l.classList.remove("hide-scrollbar")},o=function(){if(null===i){if(l.scrollHeight>n.screen.height)return;l.classList.add("hide-scrollbar")}else clearTimeout(i);i=setTimeout(t,300)},a=function(e){null!==i&&"remove"===e&&(clearTimeout(i),t()),window[`${e}EventListener`]("resize",o)},i=null;const l=document.body;p((()=>!0!==e.container?"add":"remove"),a),!0!==e.container&&a("add"),h((()=>{a("remove")}))}return()=>{const o=g(t.default,[a(m,{onScroll:S}),a(y,{onResize:C})]),i=a("div",{class:L.value,style:q.value,ref:!0===e.container?void 0:c,tabindex:-1},o);return!0===e.container?a("div",{class:"q-layout-container overflow-hidden",ref:c},[a(y,{onResize:H}),a("div",{class:"absolute-full",style:Q.value},[a("div",{class:"scroll",style:R.value},[i])])]):i}}});export{z as Q,b as a};
