import{L as P,aU as b,r as p,c as h,b2 as x,w as y,bR as Q,h as C,g as j,ar as k}from"./index.03f6cb25.js";import{Q as M}from"./QMenu.ba1252ea.js";var H=P({name:"QPopupProxy",props:{...b,breakpoint:{type:[String,Number],default:450}},emits:["show","hide"],setup(a,{slots:g,emit:c,attrs:v}){const{proxy:r}=j(),{$q:l}=r,n=p(!1),t=p(null),i=h(()=>parseInt(a.breakpoint,10)),{canShow:f}=x({showing:n});function u(){return l.screen.width<i.value||l.screen.height<i.value?"dialog":"menu"}const o=p(u()),m=h(()=>o.value==="menu"?{maxHeight:"99vh"}:{});y(()=>u(),e=>{n.value!==!0&&(o.value=e)});function d(e){n.value=!0,c("show",e)}function w(e){n.value=!1,o.value=u(),c("hide",e)}return Object.assign(r,{show(e){f(e)===!0&&t.value.show(e)},hide(e){t.value.hide(e)},toggle(e){t.value.toggle(e)}}),Q(r,"currentComponent",()=>({type:o.value,ref:t.value})),()=>{const e={ref:t,...m.value,...v,onShow:d,onHide:w};let s;return o.value==="dialog"?s=k:(s=M,Object.assign(e,{target:a.target,contextMenu:a.contextMenu,noParentEvent:!0,separateClosePopup:!0})),C(s,e,g.default)}}});export{H as Q};
