import{ak as T,bc as O,bd as L,au as b,aC as s,be as f,bf as m,bg as A,bh as H,bi as S,bj as x,aE as y,bk as $,bl as C,bm as B,aA as M,bn as v,bo as h,aP as _}from"./JQJBiNWj.js";import{C as D}from"./DqVYbxj5.js";var k=({dt:i})=>`
.p-tooltip {
    position: absolute;
    display: none;
    max-width: ${i("tooltip.max.width")};
}

.p-tooltip-right,
.p-tooltip-left {
    padding: 0 ${i("tooltip.gutter")};
}

.p-tooltip-top,
.p-tooltip-bottom {
    padding: ${i("tooltip.gutter")} 0;
}

.p-tooltip-text {
    white-space: pre-line;
    word-break: break-word;
    background: ${i("tooltip.background")};
    color: ${i("tooltip.color")};
    padding: ${i("tooltip.padding")};
    box-shadow: ${i("tooltip.shadow")};
    border-radius: ${i("tooltip.border.radius")};
}

.p-tooltip-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border-color: transparent;
    border-style: solid;
}

.p-tooltip-right .p-tooltip-arrow {
    margin-top: calc(-1 * ${i("tooltip.gutter")});
    border-width: ${i("tooltip.gutter")} ${i("tooltip.gutter")} ${i("tooltip.gutter")} 0;
    border-right-color: ${i("tooltip.background")};
}

.p-tooltip-left .p-tooltip-arrow {
    margin-top: calc(-1 * ${i("tooltip.gutter")});
    border-width: ${i("tooltip.gutter")} 0 ${i("tooltip.gutter")} ${i("tooltip.gutter")};
    border-left-color: ${i("tooltip.background")};
}

.p-tooltip-top .p-tooltip-arrow {
    margin-left: calc(-1 * ${i("tooltip.gutter")});
    border-width: ${i("tooltip.gutter")} ${i("tooltip.gutter")} 0 ${i("tooltip.gutter")};
    border-top-color: ${i("tooltip.background")};
    border-bottom-color: ${i("tooltip.background")};
}

.p-tooltip-bottom .p-tooltip-arrow {
    margin-left: calc(-1 * ${i("tooltip.gutter")});
    border-width: 0 ${i("tooltip.gutter")} ${i("tooltip.gutter")} ${i("tooltip.gutter")};
    border-top-color: ${i("tooltip.background")};
    border-bottom-color: ${i("tooltip.background")};
}
`,I={root:"p-tooltip p-component",arrow:"p-tooltip-arrow",text:"p-tooltip-text"},R=T.extend({name:"tooltip-directive",style:k,classes:I}),j=O.extend({style:R});function F(i,t){return U(i)||V(i,t)||P(i,t)||W()}function W(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P(i,t){if(i){if(typeof i=="string")return E(i,t);var e={}.toString.call(i).slice(8,-1);return e==="Object"&&i.constructor&&(e=i.constructor.name),e==="Map"||e==="Set"?Array.from(i):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?E(i,t):void 0}}function E(i,t){(t==null||t>i.length)&&(t=i.length);for(var e=0,o=Array(t);e<t;e++)o[e]=i[e];return o}function V(i,t){var e=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(e!=null){var o,r,n,a,p=[],l=!0,u=!1;try{if(n=(e=e.call(i)).next,t!==0)for(;!(l=(o=n.call(e)).done)&&(p.push(o.value),p.length!==t);l=!0);}catch(c){u=!0,r=c}finally{try{if(!l&&e.return!=null&&(a=e.return(),Object(a)!==a))return}finally{if(u)throw r}}return p}}function U(i){if(Array.isArray(i))return i}function w(i,t,e){return(t=K(t))in i?Object.defineProperty(i,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):i[t]=e,i}function K(i){var t=z(i,"string");return d(t)=="symbol"?t:t+""}function z(i,t){if(d(i)!="object"||!i)return i;var e=i[Symbol.toPrimitive];if(e!==void 0){var o=e.call(i,t);if(d(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(i)}function d(i){"@babel/helpers - typeof";return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(i)}var q=j.extend("tooltip",{beforeMount:function(t,e){var o,r=this.getTarget(t);if(r.$_ptooltipModifiers=this.getModifiers(e),e.value){if(typeof e.value=="string")r.$_ptooltipValue=e.value,r.$_ptooltipDisabled=!1,r.$_ptooltipEscape=!0,r.$_ptooltipClass=null,r.$_ptooltipFitContent=!0,r.$_ptooltipIdAttr=h("pv_id")+"_tooltip",r.$_ptooltipShowDelay=0,r.$_ptooltipHideDelay=0,r.$_ptooltipAutoHide=!0;else if(d(e.value)==="object"&&e.value){if(_(e.value.value)||e.value.value.trim()==="")return;r.$_ptooltipValue=e.value.value,r.$_ptooltipDisabled=!!e.value.disabled===e.value.disabled?e.value.disabled:!1,r.$_ptooltipEscape=!!e.value.escape===e.value.escape?e.value.escape:!0,r.$_ptooltipClass=e.value.class||"",r.$_ptooltipFitContent=!!e.value.fitContent===e.value.fitContent?e.value.fitContent:!0,r.$_ptooltipIdAttr=e.value.id||h("pv_id")+"_tooltip",r.$_ptooltipShowDelay=e.value.showDelay||0,r.$_ptooltipHideDelay=e.value.hideDelay||0,r.$_ptooltipAutoHide=!!e.value.autoHide===e.value.autoHide?e.value.autoHide:!0}}else return;r.$_ptooltipZIndex=(o=e.instance.$primevue)===null||o===void 0||(o=o.config)===null||o===void 0||(o=o.zIndex)===null||o===void 0?void 0:o.tooltip,this.bindEvents(r,e),t.setAttribute("data-pd-tooltip",!0)},updated:function(t,e){var o=this.getTarget(t);if(o.$_ptooltipModifiers=this.getModifiers(e),this.unbindEvents(o),!!e.value){if(typeof e.value=="string")o.$_ptooltipValue=e.value,o.$_ptooltipDisabled=!1,o.$_ptooltipEscape=!0,o.$_ptooltipClass=null,o.$_ptooltipIdAttr=o.$_ptooltipIdAttr||h("pv_id")+"_tooltip",o.$_ptooltipShowDelay=0,o.$_ptooltipHideDelay=0,o.$_ptooltipAutoHide=!0,this.bindEvents(o,e);else if(d(e.value)==="object"&&e.value)if(_(e.value.value)||e.value.value.trim()===""){this.unbindEvents(o,e);return}else o.$_ptooltipValue=e.value.value,o.$_ptooltipDisabled=!!e.value.disabled===e.value.disabled?e.value.disabled:!1,o.$_ptooltipEscape=!!e.value.escape===e.value.escape?e.value.escape:!0,o.$_ptooltipClass=e.value.class||"",o.$_ptooltipFitContent=!!e.value.fitContent===e.value.fitContent?e.value.fitContent:!0,o.$_ptooltipIdAttr=e.value.id||o.$_ptooltipIdAttr||h("pv_id")+"_tooltip",o.$_ptooltipShowDelay=e.value.showDelay||0,o.$_ptooltipHideDelay=e.value.hideDelay||0,o.$_ptooltipAutoHide=!!e.value.autoHide===e.value.autoHide?e.value.autoHide:!0,this.bindEvents(o,e)}},unmounted:function(t,e){var o=this.getTarget(t);this.remove(o),this.unbindEvents(o,e),o.$_ptooltipScrollHandler&&(o.$_ptooltipScrollHandler.destroy(),o.$_ptooltipScrollHandler=null)},timer:void 0,methods:{bindEvents:function(t,e){var o=this,r=t.$_ptooltipModifiers;r.focus?(t.$_ptooltipFocusEvent=function(n){return o.onFocus(n,e)},t.$_ptooltipBlurEvent=this.onBlur.bind(this),t.addEventListener("focus",t.$_ptooltipFocusEvent),t.addEventListener("blur",t.$_ptooltipBlurEvent)):(t.$_ptooltipMouseEnterEvent=function(n){return o.onMouseEnter(n,e)},t.$_ptooltipMouseLeaveEvent=this.onMouseLeave.bind(this),t.$_ptooltipClickEvent=this.onClick.bind(this),t.addEventListener("mouseenter",t.$_ptooltipMouseEnterEvent),t.addEventListener("mouseleave",t.$_ptooltipMouseLeaveEvent),t.addEventListener("click",t.$_ptooltipClickEvent)),t.addEventListener("keydown",this.onKeydown.bind(this))},unbindEvents:function(t){var e=t.$_ptooltipModifiers;e.focus?(t.removeEventListener("focus",t.$_ptooltipFocusEvent),t.$_ptooltipFocusEvent=null,t.removeEventListener("blur",t.$_ptooltipBlurEvent),t.$_ptooltipBlurEvent=null):(t.removeEventListener("mouseenter",t.$_ptooltipMouseEnterEvent),t.$_ptooltipMouseEnterEvent=null,t.removeEventListener("mouseleave",t.$_ptooltipMouseLeaveEvent),t.$_ptooltipMouseLeaveEvent=null,t.removeEventListener("click",t.$_ptooltipClickEvent),t.$_ptooltipClickEvent=null),t.removeEventListener("keydown",this.onKeydown.bind(this))},bindScrollListener:function(t){var e=this;t.$_ptooltipScrollHandler||(t.$_ptooltipScrollHandler=new D(t,function(){e.hide(t)})),t.$_ptooltipScrollHandler.bindScrollListener()},unbindScrollListener:function(t){t.$_ptooltipScrollHandler&&t.$_ptooltipScrollHandler.unbindScrollListener()},onMouseEnter:function(t,e){var o=t.currentTarget,r=o.$_ptooltipShowDelay;this.show(o,e,r)},onMouseLeave:function(t){var e=t.currentTarget,o=e.$_ptooltipHideDelay,r=e.$_ptooltipAutoHide;if(r)this.hide(e,o);else{var n=v(t.target,"data-pc-name")==="tooltip"||v(t.target,"data-pc-section")==="arrow"||v(t.target,"data-pc-section")==="text"||v(t.relatedTarget,"data-pc-name")==="tooltip"||v(t.relatedTarget,"data-pc-section")==="arrow"||v(t.relatedTarget,"data-pc-section")==="text";!n&&this.hide(e,o)}},onFocus:function(t,e){var o=t.currentTarget,r=o.$_ptooltipShowDelay;this.show(o,e,r)},onBlur:function(t){var e=t.currentTarget,o=e.$_ptooltipHideDelay;this.hide(e,o)},onClick:function(t){var e=t.currentTarget,o=e.$_ptooltipHideDelay;this.hide(e,o)},onKeydown:function(t){var e=t.currentTarget,o=e.$_ptooltipHideDelay;t.code==="Escape"&&this.hide(t.currentTarget,o)},tooltipActions:function(t,e){if(!(t.$_ptooltipDisabled||!C(t))){var o=this.create(t,e);this.align(t),!this.isUnstyled()&&B(o,250);var r=this;window.addEventListener("resize",function n(){M()||r.hide(t),window.removeEventListener("resize",n)}),o.addEventListener("mouseleave",function n(){r.hide(t),o.removeEventListener("mouseleave",n),t.removeEventListener("mouseenter",t.$_ptooltipMouseEnterEvent),setTimeout(function(){return t.addEventListener("mouseenter",t.$_ptooltipMouseEnterEvent)},50)}),this.bindScrollListener(t),y.set("tooltip",o,t.$_ptooltipZIndex)}},show:function(t,e,o){var r=this;o!==void 0?this.timer=setTimeout(function(){return r.tooltipActions(t,e)},o):this.tooltipActions(t,e)},tooltipRemoval:function(t){this.remove(t),this.unbindScrollListener(t)},hide:function(t,e){var o=this;clearTimeout(this.timer),e!==void 0?setTimeout(function(){return o.tooltipRemoval(t)},e):this.tooltipRemoval(t)},getTooltipElement:function(t){return document.getElementById(t.$_ptooltipId)},getArrowElement:function(t){var e=this.getTooltipElement(t);return b(e,'[data-pc-section="arrow"]')},create:function(t){var e=t.$_ptooltipModifiers,o=$("div",{class:!this.isUnstyled()&&this.cx("arrow"),"p-bind":this.ptm("arrow",{context:e})}),r=$("div",{class:!this.isUnstyled()&&this.cx("text"),"p-bind":this.ptm("text",{context:e})});t.$_ptooltipEscape?(r.innerHTML="",r.appendChild(document.createTextNode(t.$_ptooltipValue))):r.innerHTML=t.$_ptooltipValue;var n=$("div",w(w({id:t.$_ptooltipIdAttr,role:"tooltip",style:{display:"inline-block",width:t.$_ptooltipFitContent?"fit-content":void 0,pointerEvents:!this.isUnstyled()&&t.$_ptooltipAutoHide&&"none"},class:[!this.isUnstyled()&&this.cx("root"),t.$_ptooltipClass]},this.$attrSelector,""),"p-bind",this.ptm("root",{context:e})),o,r);return document.body.appendChild(n),t.$_ptooltipId=n.id,this.$el=n,n},remove:function(t){if(t){var e=this.getTooltipElement(t);e&&e.parentElement&&(y.clear(e),document.body.removeChild(e)),t.$_ptooltipId=null}},align:function(t){var e=t.$_ptooltipModifiers;e.top?(this.alignTop(t),this.isOutOfBounds(t)&&(this.alignBottom(t),this.isOutOfBounds(t)&&this.alignTop(t))):e.left?(this.alignLeft(t),this.isOutOfBounds(t)&&(this.alignRight(t),this.isOutOfBounds(t)&&(this.alignTop(t),this.isOutOfBounds(t)&&(this.alignBottom(t),this.isOutOfBounds(t)&&this.alignLeft(t))))):e.bottom?(this.alignBottom(t),this.isOutOfBounds(t)&&(this.alignTop(t),this.isOutOfBounds(t)&&this.alignBottom(t))):(this.alignRight(t),this.isOutOfBounds(t)&&(this.alignLeft(t),this.isOutOfBounds(t)&&(this.alignTop(t),this.isOutOfBounds(t)&&(this.alignBottom(t),this.isOutOfBounds(t)&&this.alignRight(t)))))},getHostOffset:function(t){var e=t.getBoundingClientRect(),o=e.left+S(),r=e.top+x();return{left:o,top:r}},alignRight:function(t){this.preAlign(t,"right");var e=this.getTooltipElement(t),o=this.getArrowElement(t),r=this.getHostOffset(t),n=r.left+s(t),a=r.top+(f(t)-f(e))/2;e.style.left=n+"px",e.style.top=a+"px",o.style.top="50%",o.style.right=null,o.style.bottom=null,o.style.left="0"},alignLeft:function(t){this.preAlign(t,"left");var e=this.getTooltipElement(t),o=this.getArrowElement(t),r=this.getHostOffset(t),n=r.left-s(e),a=r.top+(f(t)-f(e))/2;e.style.left=n+"px",e.style.top=a+"px",o.style.top="50%",o.style.right="0",o.style.bottom=null,o.style.left=null},alignTop:function(t){this.preAlign(t,"top");var e=this.getTooltipElement(t),o=this.getArrowElement(t),r=s(e),n=s(t),a=m(),p=a.width,l=this.getHostOffset(t),u=l.left+(s(t)-s(e))/2,c=l.top-f(e);l.left+r>p&&(u=Math.floor(l.left+n-r)),e.style.left=u+"px",e.style.top=c+"px";var g=l.left-this.getHostOffset(e).left+n/2;o.style.top=null,o.style.right=null,o.style.bottom="0",o.style.left=g+"px"},alignBottom:function(t){this.preAlign(t,"bottom");var e=this.getTooltipElement(t),o=this.getArrowElement(t),r=s(e),n=s(t),a=m(),p=a.width,l=this.getHostOffset(t),u=l.left+(s(t)-s(e))/2,c=l.top+f(t);l.left+r>p&&(u=Math.floor(l.left+n-r)),e.style.left=u+"px",e.style.top=c+"px";var g=l.left-this.getHostOffset(e).left+n/2;o.style.top="0",o.style.right=null,o.style.bottom=null,o.style.left=g+"px"},preAlign:function(t,e){var o=this.getTooltipElement(t);o.style.left="-999px",o.style.top="-999px",A(o,"p-tooltip-".concat(o.$_ptooltipPosition)),!this.isUnstyled()&&H(o,"p-tooltip-".concat(e)),o.$_ptooltipPosition=e,o.setAttribute("data-p-position",e)},isOutOfBounds:function(t){var e=this.getTooltipElement(t),o=e.getBoundingClientRect(),r=o.top,n=o.left,a=s(e),p=f(e),l=m();return n+a>l.width||n<0||r<0||r+p>l.height},getTarget:function(t){var e;return L(t,"p-inputwrapper")&&(e=b(t,"input"))!==null&&e!==void 0?e:t},getModifiers:function(t){return t.modifiers&&Object.keys(t.modifiers).length?t.modifiers:t.arg&&d(t.arg)==="object"?Object.entries(t.arg).reduce(function(e,o){var r=F(o,2),n=r[0],a=r[1];return(n==="event"||n==="position")&&(e[a]=!0),e},{}):{}}}});export{q as T};
