import{L as te,N as oe,O as ae,P as T,R as ne,S as ie,T as se,U as le,V as re,w as E,W as C,X as k,Y as x,Z as ue,M as H,_ as ce,$ as de,D as A,E as f,a0 as fe,a1 as he,a2 as ve}from"./index-DAvBaevK.js";import{v as ge,a as D,u as me,b as Te,c as pe,d as ye,r as L,s as Se,p as M}from"./position-engine-BHgB6lrx.js";import{c as q}from"./selection-DrSF90ET.js";const Oe=te({name:"QTooltip",inheritAttrs:!1,props:{...me,...ne,...T,maxHeight:{type:String,default:null},maxWidth:{type:String,default:null},transitionShow:{...T.transitionShow,default:"jump-down"},transitionHide:{...T.transitionHide,default:"jump-up"},anchor:{type:String,default:"bottom middle",validator:D},self:{type:String,default:"top middle",validator:D},offset:{type:Array,default:()=>[14,14],validator:ge},scrollTarget:ae,delay:{type:Number,default:0},hideDelay:{type:Number,default:0},persistent:Boolean},emits:[...oe],setup(e,{slots:W,emit:p,attrs:h}){let i,s;const v=de(),{proxy:{$q:o}}=v,l=A(null),c=A(!1),j=f(()=>M(e.anchor,o.lang.rtl)),N=f(()=>M(e.self,o.lang.rtl)),Q=f(()=>e.persistent!==!0),{registerTick:R,removeTick:U}=ie(),{registerTimeout:d}=se(),{transitionProps:_,transitionStyle:B}=fe(e),{localScrollTarget:y,changeScrollEvent:V,unconfigureScrollTarget:$}=Te(e,w),{anchorEl:a,canShow:I,anchorEvents:r}=pe({showing:c,configureAnchorEl:J}),{show:X,hide:g}=le({showing:c,canShow:I,handleShow:Z,handleHide:z,hideOnRouteChange:Q,processOnMount:!0});Object.assign(r,{delayShow:F,delayHide:G});const{showPortal:S,hidePortal:b,renderPortal:Y}=re(v,l,ee,"tooltip");if(o.platform.is.mobile===!0){const t={anchorEl:a,innerRef:l,onClickOutside(n){return g(n),n.target.classList.contains("q-dialog__backdrop")&&ve(n),!0}},m=f(()=>e.modelValue===null&&e.persistent!==!0&&c.value===!0);E(m,n=>{(n===!0?ye:L)(t)}),C(()=>{L(t)})}function Z(t){S(),R(()=>{s=new MutationObserver(()=>u()),s.observe(l.value,{attributes:!1,childList:!0,characterData:!0,subtree:!0}),u(),w()}),i===void 0&&(i=E(()=>o.screen.width+"|"+o.screen.height+"|"+e.self+"|"+e.anchor+"|"+o.lang.rtl,u)),d(()=>{S(!0),p("show",t)},e.transitionDuration)}function z(t){U(),b(),P(),d(()=>{b(!0),p("hide",t)},e.transitionDuration)}function P(){s!==void 0&&(s.disconnect(),s=void 0),i!==void 0&&(i(),i=void 0),$(),k(r,"tooltipTemp")}function u(){Se({targetEl:l.value,offset:e.offset,anchorEl:a.value,anchorOrigin:j.value,selfOrigin:N.value,maxHeight:e.maxHeight,maxWidth:e.maxWidth})}function F(t){if(o.platform.is.mobile===!0){q(),document.body.classList.add("non-selectable");const m=a.value,n=["touchmove","touchcancel","touchend","click"].map(O=>[m,O,"delayHide","passiveCapture"]);x(r,"tooltipTemp",n)}d(()=>{X(t)},e.delay)}function G(t){o.platform.is.mobile===!0&&(k(r,"tooltipTemp"),q(),setTimeout(()=>{document.body.classList.remove("non-selectable")},10)),d(()=>{g(t)},e.hideDelay)}function J(){if(e.noParentEvent===!0||a.value===null)return;const t=o.platform.is.mobile===!0?[[a.value,"touchstart","delayShow","passive"]]:[[a.value,"mouseenter","delayShow","passive"],[a.value,"mouseleave","delayHide","passive"]];x(r,"anchor",t)}function w(){if(a.value!==null||e.scrollTarget!==void 0){y.value=ue(a.value,e.scrollTarget);const t=e.noParentEvent===!0?u:g;V(y.value,t)}}function K(){return c.value===!0?H("div",{...h,ref:l,class:["q-tooltip q-tooltip--style q-position-engine no-pointer-events",h.class],style:[h.style,B.value],role:"tooltip"},he(W.default)):null}function ee(){return H(ce,_.value,K)}return C(P),Object.assign(v.proxy,{updatePosition:u}),Y}}),Ee="/assets/logo-7g001S5W.png";export{Oe as Q,Ee as f};
