1import{am as pe,S as se,a6 as U,an as G,n as Ee,a7 as we,w as k,o as Te,e as j,r as q,ao as Ce,ah as K,ap as Se,P as He,aq as ke,h as J,T as Me,Y as Pe,D as H,ar as We,X as qe}from"./index-CcrG2OFL.js";import{u as Be,a as Ae,b as Le}from"./use-model-toggle-fst9xBe7.js";import{u as Re,a as Fe}from"./QCard-DEo5Ubei.js";import{p as $,c as ze,s as $e,u as De,d as Ke,e as Oe,f as je,h as Qe,r as Z,i as Ve,j as Xe,g as Ye,k as Ne,l as _e}from"./QDialog-BIim0x7W.js";import{a as ee}from"./focus-manager-CVuBXJZ4.js";function Ie(){if(window.getSelection!==void 0){const e=window.getSelection();e.empty!==void 0?e.empty():e.removeAllRanges!==void 0&&(e.removeAllRanges(),pe.is.mobile||e.addRange(document.createRange()))}else document.selection!==void 0&&document.selection.empty()}const Ue={target:{type:[Boolean,String,Element],default:!0},noParentEvent:Boolean},Ge={...Ue,contextMenu:Boolean};function Je({showing:e,avoidEmit:t,configureAnchorEl:o}){const{props:n,proxy:l,emit:s}=se(),i=q(null);let c=null;function h(a){return i.value===null?!1:a===void 0||a.touches===void 0||a.touches.length<=1}const r={};o===void 0&&(Object.assign(r,{hide(a){l.hide(a)},toggle(a){l.toggle(a),a.qAnchorHandled=!0},toggleKey(a){we(a,13)&&r.toggle(a)},contextClick(a){l.hide(a),U(a),Ee(()=>{l.show(a),a.qAnchorHandled=!0})},prevent:U,mobileTouch(a){if(r.mobileCleanup(a),!h(a))return;l.hide(a),i.value.classList.add("non-selectable");const d=a.target;G(r,"anchor",[[d,"touchmove","mobileCleanup","passive"],[d,"touchend","mobileCleanup","passive"],[d,"touchcancel","mobileCleanup","passive"],[i.value,"contextmenu","prevent","notPassive"]]),c=setTimeout(()=>{c=null,l.show(a),a.qAnchorHandled=!0},300)},mobileCleanup(a){i.value.classList.remove("non-selectable"),c!==null&&(clearTimeout(c),c=null),e.value&&a!==void 0&&Ie()}}),o=function(d=n.contextMenu){if(n.noParentEvent||i.value===null)return;const T=d?l.$q.platform.is.mobile?[[i.value,"touchstart","mobileTouch","passive"]]:[[i.value,"mousedown","hide","passive"],[i.value,"contextmenu","contextClick","notPassive"]]:[[i.value,"click","toggle","passive"],[i.value,"keyup","toggleKey","passive"]];G(r,"anchor",T)});function f(){Ce(r,"anchor")}function g(a){for(i.value=a;i.value.classList.contains("q-anchor--skip");)i.value=i.value.parentNode;o()}function x(){if(n.target===!1||n.target===""||l.$el.parentNode===null)i.value=null;else if(n.target===!0)g(l.$el.parentNode);else{let a=n.target;if(typeof n.target=="string")try{a=document.querySelector(n.target)}catch{a=void 0}a!=null?(i.value=a.$el||a,o()):(i.value=null,console.error(`Anchor: target "${n.target}" not found`))}}return k(()=>n.contextMenu,a=>{i.value!==null&&(f(),o(a))}),k(()=>n.target,()=>{i.value!==null&&f(),x()}),k(()=>n.noParentEvent,a=>{i.value!==null&&(a?f():o())}),Te(()=>{x(),!t&&n.modelValue&&i.value===null&&s("update:modelValue",!1)}),j(()=>{c!==null&&clearTimeout(c),f()}),{anchorEl:i,canShow:h,anchorEvents:r}}function Ze(e,t){const o=q(null);let n;function l(c,h){const r=`${h!==void 0?"add":"remove"}EventListener`,f=h!==void 0?h:n;c!==window&&c[r]("scroll",f,K.passive),window[r]("scroll",f,K.passive),n=h}function s(){o.value!==null&&(l(o.value),o.value=null)}const i=k(()=>e.noParentEvent,()=>{o.value!==null&&(s(),t())});return j(i),{localScrollTarget:o,unconfigureScrollTarget:s,changeScrollEvent:l}}const{notPassiveCapture:B}=K,w=[];function A(e){const t=e.target;if(t===void 0||t.nodeType===8||t.classList.contains("no-pointer-events"))return;let o=null,n=!1;for(let l=$.length-1;l>=0;l--){const s=$[l].$,i=s.type.name;if(i!=="QTooltip"){if(i==="QDialog"){if(s.props.seamless!==!0){if(n===!1)return;o=new Set($.slice(l+1).map(c=>c.contentEl));break}continue}n=!0}}for(let l=w.length-1;l>=0;l--){const s=w[l];if(o!==null&&!o.has(s.innerRef.value))return;if((s.anchorEl.value===null||!s.anchorEl.value.contains(t))&&(t===document.body||s.innerRef.value!==null&&!s.innerRef.value.contains(t)))e.qClickOutside=!0,s.onClickOutside(e);else return}}function et(e){w.push(e),w.length===1&&(document.addEventListener("mousedown",A,B),document.addEventListener("touchstart",A,B))}function te(e){const t=w.indexOf(e);
1t!==-1&&(w.splice(t,1),w.length===0&&(document.removeEventListener("mousedown",A,B),document.removeEventListener("touchstart",A,B)))}let ne,oe;const tt=["top","center","bottom"],nt=["left","middle","right","start","end"];function le(e){const t=e.split(" ");return t.length!==2?!1:tt.includes(t[0])?nt.includes(t[1])?!0:(console.error("Anchor/Self position must end with one of left/middle/right/start/end"),!1):(console.error("Anchor/Self position must start with one of top/center/bottom"),!1)}function ot(e){return e?!(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number"):!0}const O={"start#ltr":"left","start#rtl":"right","end#ltr":"right","end#rtl":"left"};["left","middle","right"].forEach(e=>{O[`${e}#ltr`]=e,O[`${e}#rtl`]=e});function ie(e,t){const o=e.split(" ");return{vertical:o[0],horizontal:O[`${o[1]}#${t?"rtl":"ltr"}`]}}function lt(e,t){let{top:o,left:n,right:l,bottom:s,width:i,height:c}=e.getBoundingClientRect();return t!==void 0&&(o-=t[1],n-=t[0],s+=t[1],l+=t[0],i+=t[0],c+=t[1]),{top:o,bottom:s,height:c,left:n,right:l,width:i,middle:n+(l-n)/2,center:o+(s-o)/2}}function it(e,t,o){let{top:n,left:l}=e.getBoundingClientRect();return n+=t.top,l+=t.left,o!==void 0&&(n+=o[1],l+=o[0]),{top:n,bottom:n+1,height:1,left:l,right:l+1,width:1,middle:l,center:n}}function at(e,t){return{top:0,center:t/2,bottom:t,left:0,middle:e/2,right:e}}function ae(e,t,o,n){return{top:e[o.vertical]-t[n.vertical],left:e[o.horizontal]-t[n.horizontal]}}function ue(e,t=0){if(e.targetEl===null||e.anchorEl===null||t>5)return;if(e.targetEl.offsetHeight===0||e.targetEl.offsetWidth===0){setTimeout(()=>{ue(e,t+1)},10);return}const{targetEl:o,offset:n,anchorEl:l,anchorOrigin:s,selfOrigin:i,absoluteOffset:c,fit:h,cover:r,maxHeight:f,maxWidth:g}=e;if(Se.is.ios&&window.visualViewport!==void 0){const C=document.body.style,{offsetLeft:y,offsetTop:b}=window.visualViewport;y!==ne&&(C.setProperty("--q-pe-left",y+"px"),ne=y),b!==oe&&(C.setProperty("--q-pe-top",b+"px"),oe=b)}const{scrollLeft:x,scrollTop:a}=o,d=c===void 0?lt(l,r?[0,0]:n):it(l,c,n);Object.assign(o.style,{top:0,left:0,minWidth:null,minHeight:null,maxWidth:g,maxHeight:f,visibility:"visible"});const{offsetWidth:T,offsetHeight:M}=o,{elWidth:W,elHeight:L}=h||r?{elWidth:Math.max(d.width,T),elHeight:r?Math.max(d.height,M):M}:{elWidth:T,elHeight:M};let v={maxWidth:g,maxHeight:f};(h||r)&&(v.minWidth=d.width+"px",r&&(v.minHeight=d.height+"px")),Object.assign(o.style,v);const p=at(W,L);let m=ae(d,p,s,i);if(c===void 0||n===void 0)D(m,d,p,s,i);else{const{top:C,left:y}=m;D(m,d,p,s,i);let b=!1;if(m.top!==C){b=!0;const E=2*n[1];d.center=d.top-=E,d.bottom-=E+2}if(m.left!==y){b=!0;const E=2*n[0];d.middle=d.left-=E,d.right-=E+2}b&&(m=ae(d,p,s,i),D(m,d,p,s,i))}v={top:m.top+"px",left:m.left+"px"},m.maxHeight!==void 0&&(v.maxHeight=m.maxHeight+"px",d.height>m.maxHeight&&(v.minHeight=v.maxHeight)),m.maxWidth!==void 0&&(v.maxWidth=m.maxWidth+"px",d.width>m.maxWidth&&(v.minWidth=v.maxWidth)),Object.assign(o.style,v),o.scrollTop!==a&&(o.scrollTop=a),o.scrollLeft!==x&&(o.scrollLeft=x)}function D(e,t,o,n,l){const s=o.bottom,i=o.right,c=ze(),h=window.innerHeight-c,r=document.body.clientWidth;if(e.top<0||e.top+s>h)if(l.vertical==="center")e.top=t[n.vertical]>h/2?Math.max(0,h-s):0,e.maxHeight=Math.min(s,h);else if(t[n.vertical]>h/2){const f=Math.min(h,n.vertical==="center"?t.center:n.vertical===l.vertical?t.bottom:t.top);e.maxHeight=Math.min(s,f),e.top=Math.max(0,f-s)}else e.top=Math.max(0,n.vertical==="center"?t.center:n.vertical===l.vertical?t.top:t.bottom),e.maxHeight=Math.min(s,h-e.top);if(e.left<0||e.left+i>r)if(e.maxWidth=Math.min(i,r),l.horizontal==="middle")e.left=t[n.horizontal]>r/2?Math.max(0,r-i):0;else if(t[n.horizontal]>r/2){const f=Math.min(r,n.horizontal==="middle"?t.middle:n.horizontal===l.horizontal?t.right:t.left);e.maxWidth=Math.min(i,f),e.left=Math.max(0,f-e.maxWidth)}else e.left=Math.max(0,n.horizontal==="middle"?t.middle:n.horizontal===l.horizontal?t.left:t.right),e.maxWidth=Math.min(i,r-e.left)}const ft=He({name:"QMenu",inheritAttrs:!1,props:{...Ge,...Ae,...Re,...De,persistent:Boolean,autoClose:Boolean,separateClosePopup:Boolean,noEscDismiss:Boolean,noRouteDism
1iss:Boolean,noRefocus:Boolean,noFocus:Boolean,fit:Boolean,cover:Boolean,square:Boolean,anchor:{type:String,validator:le},self:{type:String,validator:le},offset:{type:Array,validator:ot},scrollTarget:$e,touchPosition:Boolean,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null}},emits:[...Be,"click","escapeKey"],setup(e,{slots:t,emit:o,attrs:n}){let l=null,s,i,c;const h=se(),{proxy:r}=h,{$q:f}=r,g=q(null),x=q(!1),a=H(()=>!e.persistent&&!e.noRouteDismiss),d=Fe(e,f),{registerTick:T,removeTick:M}=Ke(),{registerTimeout:W}=Oe(),{transitionProps:L,transitionStyle:v}=Ne(e),{localScrollTarget:p,changeScrollEvent:m,unconfigureScrollTarget:C}=Ze(e,_),{anchorEl:y,canShow:b}=Je({showing:x}),{hide:E}=Le({showing:x,canShow:b,handleShow:he,handleHide:me,handleRouteChange:ve,hideOnRouteChange:a,processOnMount:!0}),{showPortal:Q,hidePortal:V,renderPortal:re}=je(h,g,xe,"menu"),R={anchorEl:y,innerRef:g,onClickOutside(u){if(!e.persistent&&x.value)return E(u),(u.type==="touchstart"||u.target.classList.contains("q-dialog__backdrop"))&&qe(u),!0}},X=H(()=>ie(e.anchor||(e.cover?"center middle":"bottom start"),f.lang.rtl)),ce=H(()=>e.cover?X.value:ie(e.self||"top start",f.lang.rtl)),de=H(()=>(e.square?" q-menu--square":"")+(d.value?" q-menu--dark q-dark":"")),fe=H(()=>e.autoClose?{onClick:ge}:{}),Y=H(()=>x.value&&!e.persistent);k(Y,u=>{u?(Qe(z),et(R)):(Z(z),te(R))});function F(){ee(()=>{let u=g.value;u&&!u.contains(document.activeElement)&&(u=u.querySelector("[autofocus][tabindex], [data-autofocus][tabindex]")||u.querySelector("[autofocus] [tabindex], [data-autofocus] [tabindex]")||u.querySelector("[autofocus], [data-autofocus]")||u,u.focus({preventScroll:!0}))})}function he(u){if(l=e.noRefocus?null:document.activeElement,Ve(I),Q(),_(),s=void 0,u!==void 0&&(e.touchPosition||e.contextMenu)){const S=ke(u);if(S.left!==void 0){const{top:ye,left:be}=y.value.getBoundingClientRect();s={left:S.left-be,top:S.top-ye}}}i===void 0&&(i=k(()=>f.screen.width+"|"+f.screen.height+"|"+e.self+"|"+e.anchor+"|"+f.lang.rtl,P)),e.noFocus||document.activeElement.blur(),T(()=>{P(),e.noFocus||F()}),W(()=>{f.platform.is.ios&&(c=e.autoClose,g.value.click()),P(),Q(!0),o("show",u)},e.transitionDuration)}function me(u){if(M(),V(),N(!0),l!==null&&(u===void 0||!u.qClickOutside)){const S=(u?.type.indexOf("key")===0?l.closest('[tabindex]:not([tabindex^="-"])'):void 0)||l;l=null,ee(()=>{S.isConnected&&S.focus()})}W(()=>{V(!0),o("hide",u)},e.transitionDuration)}function ve(){l=null}function N(u){s=void 0,i!==void 0&&(i(),i=void 0),(u||x.value)&&(Xe(I),C(),te(R),Z(z)),u||(l=null)}function _(){(y.value!==null||e.scrollTarget!==void 0)&&(p.value=Ye(y.value,e.scrollTarget),m(p.value,P))}function ge(u){c?c=!1:(_e(r,u),o("click",u))}function I(u){Y.value&&!e.noFocus&&!We(g.value,u.target)&&F()}function z(u){e.noEscDismiss||(o("escapeKey"),E(u))}function P(){ue({targetEl:g.value,offset:e.offset,anchorEl:y.value,anchorOrigin:X.value,selfOrigin:ce.value,absoluteOffset:s,fit:e.fit,cover:e.cover,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function xe(){return J(Me,L.value,()=>x.value?J("div",{role:"menu",...n,ref:g,tabindex:-1,class:["q-menu q-position-engine scroll"+de.value,n.class],style:[n.style,v.value],...fe.value},Pe(t.default)):null)}return j(()=>{N()}),Object.assign(r,{focus:F,updatePosition:P}),re}});export{ft as Q};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.