@syncfusion/ej2-popups
Version:
A package of Essential JS 2 popup components such as Dialog and Tooltip that is used to display information or messages in separate pop-ups.
10 lines • 114 kB
JavaScript
/*!
* filename: ej2-popups.umd.min.js
* version : 33.1.44
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-buttons")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-buttons"],e):e((t=t||self).ej={},t.ej2Base,t.ej2Buttons)}(this,function(t,L,M){"use strict";var l,r,a,h,m,g,z,I=!1;function D(t,e){var i=!1,o={left:0,top:0},n=t;if(t&&e){for(L.isNullOrUndefined(e.offsetParent)&&"fixed"===e.style.position&&(i=!0);(e.offsetParent||i)&&t&&e.offsetParent!==t;)o.left+=t.offsetLeft,o.top+=t.offsetTop,t=t.offsetParent;for(t=n;(e.offsetParent||i)&&t&&e.offsetParent!==t;)o.left-=t.scrollLeft,o.top-=t.scrollTop,t=t.parentElement}return o}function y(t,e,i,o,n){if(r=void 0,r=n,I=!!o,!t)return{left:0,top:0};i=i||"top",h=t.ownerDocument,a=t;var n=(e=e||"left").toLowerCase(),o=i.toLowerCase(),s={left:0,top:0};switch(l=a.getBoundingClientRect(),o+n){case"topcenter":d(_(),s),p(q(),s);break;case"topright":d(V(),s),p(q(),s);break;case"centercenter":d(_(),s),p(F(),s);break;case"centerright":d(V(),s),p(F(),s);break;case"centerleft":d(W(),s),p(F(),s);break;case"bottomcenter":d(_(),s),p(j(),s);break;case"bottomright":d(V(),s),p(j(),s);break;case"bottomleft":d(W(),s),p(j(),s);break;default:d(W(),s),p(q(),s)}return a=null,s}function d(t,e){e.left=t}function p(t,e){e.top=t}function Y(){return h.documentElement.scrollTop||h.body.scrollTop}function X(){return h.documentElement.scrollLeft||h.body.scrollLeft}function j(){return I?l.bottom:l.bottom+Y()}function F(){return q()+l.height/2}function q(){return I?l.top:l.top+Y()}function W(){return l.left+X()}function V(){var t=a&&((a.classList.contains("e-date-wrapper")||a.classList.contains("e-datetime-wrapper"))&&a.classList.contains("e-rtl")||a.classList.contains("e-ddl")&&a.classList.contains("e-rtl")||a.classList.contains("e-date-range-wrapper")||a.classList.contains("e-filtermenudiv")||a.classList.contains("e-ccdiv"))?r?r.width:0:r&&l.width>=r.width?r.width:0;return a&&a.classList.contains("e-rtl")&&a.classList.contains("e-multiselect")&&(t=r.width),l.right+X()-t}function _(){return W()+l.width/2}function Z(t,e,i,o){var n,s,l,r;return void 0===e&&(e=null),(i=void 0===i?{X:!1,Y:!1}:i).Y||i.X?(n=t.getBoundingClientRect(),g=e,m=t.ownerDocument,o=o||y(t,"left","top"),i.X&&(e=(g?it:pt)(),t=v(),s=rt(),l=t-o.left,r=o.left+n.width-s,n.width>e?o.left=0<l&&r<=0||!(0<r&&l<=0)&&r<l?s-n.width:t:0<l?o.left+=l:0<r&&(o.left-=r)),i.Y&&(e=(g?ot:dt)(),s=lt(),t=at(),l=s-o.top,r=o.top+n.height-t,n.height>e?o.top=0<l&&r<=0||!(0<r&&l<=0)&&r<l?t-n.height:s:0<l?o.top+=l:0<r&&(o.top-=r)),o):{left:0,top:0}}function K(t,e,i,o){void 0===e&&(e=null);var n=y(t,"left","top"),i=(i&&(n.left=i),o&&(n.top=o),[]),o=(g=e,m=t.ownerDocument,t.getBoundingClientRect()),e=n.top,t=n.left,s=n.left+o.width,e=et(e,n.top+o.height),n=tt(t,s);return e.topSide&&i.push("top"),n.rightSide&&i.push("right"),n.leftSide&&i.push("left"),e.bottomSide&&i.push("bottom"),i}function G(t,e,i,o,n,s,l,r,a){var h,d,p,c,u,f;void 0===l&&(l=null),void 0===r&&(r={X:!0,Y:!0}),e&&t&&n&&s&&(r.X||r.Y)&&(h={TL:null,TR:null,BL:null,BR:null},d={TL:null,TR:null,BL:null,BR:null},"none"===window.getComputedStyle(t).display?(c=t.style.visibility,t.style.visibility="hidden",t.style.display="block",p=t.getBoundingClientRect(),t.style.removeProperty("display"),t.style.visibility=c):p=t.getBoundingClientRect(),g=l,m=e.ownerDocument,c=h,l=p,(n={posX:n,posY:s,offsetX:i,offsetY:o,position:{left:0,top:0}}).position=y(s=e,n.posX,n.posY,i=a,l),c.TL=y(s,"left","top",i,l),c.TR=y(s,"right","top",i,l),c.BR=y(s,"left","bottom",i,l),c.BL=y(s,"right","bottom",i,l),$(d,n,p),r.X&&function t(e,i,o,n,s,l){var r=/\b(e-date-wrapper|e-datetime-wrapper)\b/.test(e.className);var a=0;r&&!l&&("leftSide"===z?i.TL.left+=Math.abs(o.TL.left-b()-v()):"rightSide"===z&&(i.TR.left-=o.TR.left-rt()));var h=tt(i.TL.left,i.TR.left);z=h.leftSide?"leftSide":"rightSide";o.TL.left-b()<=v()&&(r?a=o.TL.left-b()-v():h.leftSide=!1);o.TR.left>rt()&&(r?a=o.TR.left-rt():h.rightSide=!1);(h.leftSide&&!h.rightSide||!h.leftSide&&h.rightSide)&&("right"===n.posX?n.posX="left":n.posX="right",r?(n.offsetX+=h.leftSide?Math.abs(a):-1*(s.width+(r?a:0)),"rightSide"===z&&(n.position=y(e,n.posX,n.posY,!1))):(n.offsetX=n.offsetX+s.width,n.offsetX=-1*n.offsetX,n.position=y(e,n.posX,n.posY,!1)),$(i,n,s),l)&&t(e,i,o,n,s,!1)}(e,d,h,n,p,!0),r.Y&&-1<h.TL.top&&function t(e,i,o,n,s,l){var r=et(i.TL.top,i.BL.top);o.TL.top-ht()<=lt()&&(r.topSide=!1);o.BL.top>=at()&&e.getBoundingClientRect().bottom<window.innerHeight&&(r.bottomSide=!1);(r.topSide&&!r.bottomSide||!r.topSide&&r.bottomSide)&&("top"===n.posY?n.posY="bottom":n.posY="top",n.offsetY=n.offsetY+s.height,n.offsetY=-1*n.offsetY,n.position=y(e,n.posX,n.posY,!1,s),$(i,n,s),l)&&t(e,i,o,n,s,!1)}(e,d,h,n,p,!0),o=n,a=p,i=s=0,null==(l=t).offsetParent||"absolute"!==getComputedStyle(l.offsetParent).position&&"relative"!==getComputedStyle(l.offsetParent).position||(a=y(l.offsetParent,"left","top",!1,a),s=a.left,i=a.top),r=a=1,(e=Q(l))&&("none"!==(u=getComputedStyle(e).transform)&&(u=new DOMMatrix(u),a=u.a,r=u.d),"none"!==getComputedStyle(e).zoom)&&(u=J(document.body),a*=u,r*=u),l.style.top=o.position.top/r+o.offsetY-i/r+"px",l.style.left=o.position.left/a+o.offsetX-s/a+"px",e=null,l.classList.contains("e-sticky")&&(l.classList.remove("e-sticky"),e=l.offsetParent&&l.offsetParent.classList.contains("sf-grid")?l.offsetParent:null,l.classList.add("e-sticky")),e&&(l.classList.contains("e-filter-popup")||l.classList.contains("e-ccdlg"))&&(u=D(e,l),f=l.clientWidth,(i=u.left-f+e.clientWidth)<1?i=f+i-16:i-=4,(r=e.offsetWidth)-i<f)&&(o=f-(r-i),l.style.left=i-o+"px"),l.classList.contains("e-filter-popup"))&&l.offsetParent&&(s=parseFloat(l.style.left),a=l.offsetParent.clientWidth,f=l.clientWidth,s<0||a<s+f)&&(l.style.left=Math.max(0,Math.min(s,a-f))+"px")}function J(t){t=getComputedStyle(t).zoom;return parseFloat(t)||1}function Q(t){for(;t;){var e=window.getComputedStyle(t).transform,i=J(document.body);if(e&&"none"!==e||i&&1!==i)return t;if(t===document.body)return null;t=t.offsetParent||t.parentElement}return null}function $(t,e,i){t.TL={top:e.position.top+e.offsetY,left:e.position.left+e.offsetX},t.TR={top:t.TL.top,left:t.TL.left+i.width},t.BL={top:t.TL.top+i.height,left:t.TL.left},t.BR={top:t.TL.top+i.height,left:t.TL.left+i.width}}function tt(t,e){var i=!1,o=!1;return{leftSide:i=t-b()<v()?!0:i,rightSide:o=e>rt()?!0:o}}function et(t,e){var i=!1,o=!1;return{topSide:i=t-ht()<lt()?!0:i,bottomSide:o=e>at()?!0:o}}function it(){return g.getBoundingClientRect().width}function ot(){return g.getBoundingClientRect().height}function nt(){return g.getBoundingClientRect().left}function st(){return g.getBoundingClientRect().top}function lt(){return g?st():0}function v(){return g?nt():0}function rt(){return g?b()+nt()+it():b()+pt()}function at(){return g?ht()+st()+ot():ht()+dt()}function ht(){return m.documentElement.scrollTop||m.body.scrollTop}function b(){return m.documentElement.scrollLeft||m.body.scrollLeft}function dt(){return window.innerHeight}function pt(){var t=window.innerWidth,e=document.documentElement.getBoundingClientRect();return t-(t-(L.isNullOrUndefined(document.documentElement)?0:e.width))}function ct(){m=g=null}ut=function(t,e){return(ut=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var ut,ft,e=function(t,e){function i(){this.constructor=t}ut(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t,e,i,o){var n,s=arguments.length,l=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(s<3?n(l):3<s?n(e,i,l):n(e,i))||l);return 3<s&&l&&Object.defineProperty(e,i,l),l},mt=(ft=L.ChildProperty,e(gt,ft),i([L.Property("left")],gt.prototype,"X",void 0),i([L.Property("top")],gt.prototype,"Y",void 0),gt);function gt(){return null!==ft&&ft.apply(this,arguments)||this}var yt,vt="e-popup",bt="e-rtl",o="e-popup-open",n="e-popup-close",Et=(yt=L.Component,e(s,yt),s.prototype.onPropertyChanged=function(t,e){for(var i=0,o=Object.keys(t);i<o.length;i++)switch(o[i]){case"width":L.setStyleAttribute(this.element,{width:L.formatUnit(t.width)});break;case"height":L.setStyleAttribute(this.element,{height:L.formatUnit(t.height)});break;case"zIndex":L.setStyleAttribute(this.element,{zIndex:t.zIndex});break;case"enableRtl":this.setEnableRtl();break;case"position":case"relateTo":this.refreshPosition();break;case"offsetX":var n=t.offsetX-e.offsetX;this.element.style.left=(parseInt(this.element.style.left,10)+n).toString()+"px";break;case"offsetY":n=t.offsetY-e.offsetY;this.element.style.top=(parseInt(this.element.style.top,10)+n).toString()+"px";break;case"content":this.setContent();break;case"actionOnScroll":"none"!==t.actionOnScroll?this.wireScrollEvents():this.unwireScrollEvents()}},s.prototype.getModuleName=function(){return"popup"},s.prototype.resolveCollision=function(){this.checkCollision()},s.prototype.getPersistData=function(){return this.addOnPersist([])},s.prototype.destroy=function(){this.element.classList.contains("e-popup-open")&&this.unwireEvents(),this.element.classList.remove(vt,bt,o,n),this.content=null,this.relateTo=null,ct(),yt.prototype.destroy.call(this)},s.prototype.render=function(){this.element.classList.add(vt);var t={};1e3!==this.zIndex&&(t.zIndex=this.zIndex),"auto"!==this.width&&(t.width=L.formatUnit(this.width)),"auto"!==this.height&&(t.height=L.formatUnit(this.height)),L.setStyleAttribute(this.element,t),this.fixedParent=!1,this.setEnableRtl(),this.setContent()},s.prototype.wireEvents=function(){L.Browser.isDevice&&L.EventHandler.add(window,"orientationchange",this.orientationOnChange,this),"none"!==this.actionOnScroll&&this.wireScrollEvents()},s.prototype.wireScrollEvents=function(){if(this.getRelateToElement())for(var t=0,e=this.getScrollableParent(this.getRelateToElement());t<e.length;t++){var i=e[t];L.EventHandler.add(i,"scroll",this.scrollRefresh,this)}},s.prototype.unwireEvents=function(){L.Browser.isDevice&&L.EventHandler.remove(window,"orientationchange",this.orientationOnChange),"none"!==this.actionOnScroll&&this.unwireScrollEvents()},s.prototype.unwireScrollEvents=function(){if(this.getRelateToElement())for(var t=0,e=this.getScrollableParent(this.getRelateToElement());t<e.length;t++){var i=e[t];L.EventHandler.remove(i,"scroll",this.scrollRefresh)}},s.prototype.getRelateToElement=function(){var t=""===this.relateTo||L.isNullOrUndefined(this.relateTo)?document.body:this.relateTo;return this.setProperties({relateTo:t},!0),"string"==typeof this.relateTo?document.querySelector(this.relateTo):this.relateTo},s.prototype.scrollRefresh=function(t){"reposition"===this.actionOnScroll?L.isNullOrUndefined(this.element)||this.element.offsetParent===t.target||this.element.offsetParent&&"BODY"===this.element.offsetParent.tagName&&null==t.target.parentElement||this.refreshPosition():"hide"===this.actionOnScroll&&this.hide(),"none"!==this.actionOnScroll&&this.getRelateToElement()&&((t=this.isElementOnViewport(this.getRelateToElement(),t.target))||this.targetInvisibleStatus?t&&(this.targetInvisibleStatus=!1):(this.trigger("targetExitViewport"),this.targetInvisibleStatus=!0))},s.prototype.isElementOnViewport=function(t,e){for(var i=this.getScrollableParent(t),o=0;o<i.length;o++)if(!this.isElementVisible(t,i[o]))return!1;return!0},s.prototype.isElementVisible=function(t,e){var i,o,n,s,l,r,a,h=this.checkGetBoundingClientRect(t);return!(!h.height||!h.width)&&(L.isNullOrUndefined(this.checkGetBoundingClientRect(e))?(i=(a=window).scrollY,o=a.scrollX,n=a.scrollX+a.outerWidth,a=a.scrollY+a.outerHeight,s=(t=y(t)).top,l=t.left,r=t.left+h.width,t=t.top+h.height,0<a-s&&0<n-l&&0<r-o&&0<t-i):(a=e.getBoundingClientRect(),!(h.bottom<a.top||h.bottom>a.bottom||h.right>a.right||h.left<a.left)))},s.prototype.preRender=function(){},s.prototype.setEnableRtl=function(){this.reposition(),this.enableRtl?this.element.classList.add(bt):this.element.classList.remove(bt)},s.prototype.setContent=function(){var t,e;L.isNullOrUndefined(this.content)||(this.element.innerHTML="","string"==typeof this.content?this.element.textContent=this.content:(t=this.getRelateToElement(),e=this.content.props,t.classList.contains("e-dropdown-btn")&&!L.isNullOrUndefined(e)||this.element.appendChild(this.content)))},s.prototype.orientationOnChange=function(){var t=this;setTimeout(function(){t.refreshPosition()},200)},s.prototype.refreshPosition=function(t,e){L.isNullOrUndefined(t)||this.checkFixedParent(t),this.reposition(),e||this.checkCollision()},s.prototype.reposition=function(){var t,e,i,o,n=this.getRelateToElement();"number"==typeof this.position.X&&"number"==typeof this.position.Y?t={left:this.position.X,top:this.position.Y}:"string"==typeof this.position.X&&"number"==typeof this.position.Y||"number"==typeof this.position.X&&"string"==typeof this.position.Y?(e=void 0,o=this.element.style.display,this.element.style.display="block",this.element.classList.contains("e-dlg-modal")&&(e=this.element.parentElement.style.display,this.element.parentElement.style.display="block"),i=this.getAnchorPosition(n,this.element,this.position,this.offsetX,this.offsetY),t="string"==typeof this.position.X?{left:i.left,top:this.position.Y}:{left:this.position.X,top:i.top},this.element.style.display=o,this.element.classList.contains("e-dlg-modal")&&(this.element.parentElement.style.display=e)):n?(i=this.element.clientHeight,o=this.element.style.display,this.element.style.display="block",t=this.getAnchorPosition(n,this.element,this.position,this.offsetX,this.offsetY,i),this.element.style.display=o):t={left:0,top:0},L.isNullOrUndefined(t)||(this.element.style.left=t.left+"px",this.element.style.top=t.top+"px")},s.prototype.checkGetBoundingClientRect=function(t){try{return t.getBoundingClientRect()}catch(t){return null}},s.prototype.getAnchorPosition=function(t,e,i,o,n,s){void 0===s&&(s=0);var l=this.checkGetBoundingClientRect(e),r=this.checkGetBoundingClientRect(t);if(L.isNullOrUndefined(l)||L.isNullOrUndefined(r))return null;var a,h,d,p=t,c={left:0,top:0},c=e.offsetParent&&"BODY"===e.offsetParent.tagName&&"BODY"===t.tagName?y(t):D(p,e=e.classList.contains("e-dlg-modal")&&"BODY"!==p.tagName?e.parentElement:e);switch(i.X){default:case"left":break;case"center":e.classList.contains("e-dlg-modal")&&"BODY"===p.tagName&&"container"===this.targetType?c.left+=window.innerWidth/2-l.width/2:"container"===this.targetType?c.left+=r.width/2-l.width/2:c.left+=r.width/2;break;case"right":e.classList.contains("e-dlg-modal")&&"BODY"===p.tagName&&"container"===this.targetType?c.left+=window.innerWidth-l.width:"container"===this.targetType?(d=1,(a=Q(e))&&("none"!==(h=getComputedStyle(a).transform)&&(d=new DOMMatrix(h).a),"none"!==getComputedStyle(a).zoom)&&(d*=J(document.body)),c.left+=(r.width-l.width)/d):c.left+=r.width}switch(i.Y){default:case"top":break;case"center":e.classList.contains("e-dlg-modal")&&"BODY"===p.tagName&&"container"===this.targetType?c.top+=window.innerHeight/2-l.height/2:"container"===this.targetType?c.top+=r.height/2-l.height/2:c.top+=r.height/2;break;case"bottom":e.classList.contains("e-dlg-modal")&&"BODY"===p.tagName&&"container"===this.targetType?c.top+=window.innerHeight-l.height:"container"!==this.targetType||e.classList.contains("e-dialog")?"container"===this.targetType&&e.classList.contains("e-dialog")?c.top+=r.height-s:c.top+=r.height:c.top+=r.height-l.height}return c.left+=o,c.top+=n,c},s.prototype.callFlip=function(t){var e=this.getRelateToElement();G(this.element,e,this.offsetX,this.offsetY,this.position.X,this.position.Y,this.viewPortElement,t,this.fixedParent)},s.prototype.callFit=function(t){if(0!==K(this.element,this.viewPortElement).length)if(L.isNullOrUndefined(this.viewPortElement)){var e=Z(this.element,this.viewPortElement,t);t.X&&(this.element.style.left=e.left+"px"),t.Y&&(this.element.style.top=e.top+"px")}else{var e=this.checkGetBoundingClientRect(this.element),i=this.checkGetBoundingClientRect(this.viewPortElement);if(L.isNullOrUndefined(e)||L.isNullOrUndefined(i))return null;t&&!0===t.Y&&(i.top>e.top?this.element.style.top="0px":i.bottom<e.bottom&&(this.element.style.top=parseInt(this.element.style.top,10)-(e.bottom-i.bottom)+"px")),t&&!0===t.X&&(i.right<e.right?this.element.style.left=parseInt(this.element.style.left,10)-(e.right-i.right)+"px":i.left>e.left&&(this.element.style.left=parseInt(this.element.style.left,10)+(i.left-e.left)+"px"))}},s.prototype.checkCollision=function(){var t=this.collision.X,e=this.collision.Y;"none"===t&&"none"===e||("flip"===t&&"flip"===e?this.callFlip({X:!0,Y:!0}):"fit"===t&&"fit"===e?this.callFit({X:!0,Y:!0}):("flip"===t?this.callFlip({X:!0,Y:!1}):"flip"===e&&this.callFlip({Y:!0,X:!1}),"fit"===t?this.callFit({X:!0,Y:!1}):"fit"===e&&this.callFit({X:!1,Y:!0})))},s.prototype.show=function(t,e){var i=this;this.wireEvents(),this.getRelateToElement(),1e3!==this.zIndex&&L.isNullOrUndefined(e)||(e=L.isNullOrUndefined(e)?this.element:e,this.zIndex=Ot(e),L.setStyleAttribute(this.element,{zIndex:this.zIndex})),t=L.isNullOrUndefined(t)||"object"!=typeof t?this.showAnimation:t,"none"===this.collision.X&&"none"===this.collision.Y||(L.removeClass([this.element],n),L.addClass([this.element],o),this.element.classList.contains("e-sticky")?(this.element.classList.remove("e-sticky"),this.element.offsetParent&&this.element.offsetParent.classList.contains("sf-grid")&&(this.fixedParent=!0),this.element.classList.add("e-sticky")):this.element.offsetParent&&this.element.offsetParent.classList.contains("sf-grid")&&this.enableRtl&&(this.position.X="left"),this.checkCollision(),L.removeClass([this.element],o),L.addClass([this.element],n)),L.isNullOrUndefined(t)?(L.removeClass([this.element],n),L.addClass([this.element],o),this.trigger("open")):(t.begin=function(){i.isDestroyed||(L.removeClass([i.element],n),L.addClass([i.element],o))},t.end=function(){i.isDestroyed||i.trigger("open")},new L.Animation(t).animate(this.element))},s.prototype.hide=function(t){var e=this;t=L.isNullOrUndefined(t)||"object"!=typeof t?this.hideAnimation:t,L.isNullOrUndefined(t)?(L.removeClass([this.element],o),L.addClass([this.element],n),this.trigger("close")):(t.end=function(){e.isDestroyed||(L.removeClass([e.element],o),L.addClass([e.element],n),e.trigger("close"))},new L.Animation(t).animate(this.element)),this.unwireEvents()},s.prototype.getScrollableParent=function(t){return this.checkFixedParent(t),Ct(t,this.fixedParent)},s.prototype.checkFixedParent=function(t){for(var e=t.parentElement;e&&"HTML"!==e.tagName;){var i=getComputedStyle(e);"fixed"!==i.position&&"sticky"!==i.position||L.isNullOrUndefined(this.element)||!this.element.offsetParent||"BODY"!==this.element.offsetParent.tagName||"hidden"===getComputedStyle(this.element.offsetParent).overflow||(this.element.style.top=window.scrollY>parseInt(this.element.style.top,10)?L.formatUnit(window.scrollY-parseInt(this.element.style.top,10)):L.formatUnit(parseInt(this.element.style.top,10)-window.scrollY),this.element.style.position="fixed",this.fixedParent=!0),e=e.parentElement,!L.isNullOrUndefined(this.element)&&L.isNullOrUndefined(this.element.offsetParent)&&"fixed"===i.position&&"fixed"===this.element.style.position&&(this.fixedParent=!0)}},i([L.Property("auto")],s.prototype,"height",void 0),i([L.Property("auto")],s.prototype,"width",void 0),i([L.Property(null)],s.prototype,"content",void 0),i([L.Property("container")],s.prototype,"targetType",void 0),i([L.Property(null)],s.prototype,"viewPortElement",void 0),i([L.Property({X:"none",Y:"none"})],s.prototype,"collision",void 0),i([L.Property("")],s.prototype,"relateTo",void 0),i([L.Complex({},mt)],s.prototype,"position",void 0),i([L.Property(0)],s.prototype,"offsetX",void 0),i([L.Property(0)],s.prototype,"offsetY",void 0),i([L.Property(1e3)],s.prototype,"zIndex",void 0),i([L.Property(!1)],s.prototype,"enableRtl",void 0),i([L.Property("reposition")],s.prototype,"actionOnScroll",void 0),i([L.Property(null)],s.prototype,"showAnimation",void 0),i([L.Property(null)],s.prototype,"hideAnimation",void 0),i([L.Event()],s.prototype,"open",void 0),i([L.Event()],s.prototype,"close",void 0),i([L.Event()],s.prototype,"targetExitViewport",void 0),i([L.NotifyPropertyChanges],s));function s(t,e){return yt.call(this,e,t)||this}function Ct(t,e){for(var i=getComputedStyle(t),o=[],n=/(auto|scroll)/,s=t.parentElement;s&&"HTML"!==s.tagName;){var l=getComputedStyle(s);"absolute"===i.position&&"static"===l.position||!n.test(l.overflow+l.overflowY+l.overflowX)||o.push(s),s=s.parentElement}return e||o.push(document),o}function Ot(t){for(var e=t.parentElement,i=[];e&&"BODY"!==e.tagName;){var o=document.defaultView.getComputedStyle(e,null).getPropertyValue("z-index"),n=document.defaultView.getComputedStyle(e,null).getPropertyValue("position");"auto"!==o&&"static"!==n&&parseInt(o,10)<2147483647&&i.push(o),e=e.parentElement}for(var s=[],l=0;l<document.body.children.length;l++)t.isEqualNode(document.body.children[l])||(o=document.defaultView.getComputedStyle(document.body.children[l],null).getPropertyValue("z-index"),n=document.defaultView.getComputedStyle(document.body.children[l],null).getPropertyValue("position"),"auto"!==o&&"static"!==n&&parseInt(o,10)<2147483647&&s.push(o));s.push("999");var r=[];if(!L.isNullOrUndefined(t.parentElement)&&"BODY"!==t.parentElement.tagName)for(var a=[].slice.call(t.parentElement.children),l=0;l<a.length;l++)t.isEqualNode(a[l])||(o=document.defaultView.getComputedStyle(a[l],null).getPropertyValue("z-index"),n=document.defaultView.getComputedStyle(a[l],null).getPropertyValue("position"),"auto"!==o&&"static"!==n&&parseInt(o,10)<2147483647&&r.push(o));var h=i.concat(s,r),h=Math.max.apply(Math,h)+1;return 2147483647<h?2147483647:h}wt=function(t,e){return(wt=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}))(t,e)};var wt,Nt,e=function(t,e){function i(){this.constructor=t}wt(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},i=function(t,e,i,o){var n,s=arguments.length,l=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,i,o);else for(var r=t.length-1;0<=r;r--)(n=t[r])&&(l=(s<3?n(l):3<s?n(e,i,l):n(e,i))||l);return 3<s&&l&&Object.defineProperty(e,i,l),l},Tt="e-tooltip",Pt="e-icons",St="e-tooltip-close",xt="e-tooltip-wrap",Ut="e-tip-content",u="e-arrow-tip",Ht="e-arrow-tip-outer",Bt="e-arrow-tip-inner",kt="e-tip-bottom",Mt="e-tip-top",Lt="e-tip-left",Rt="e-tip-right",At="e-popup",zt="e-popup-open",It="e-popup-close",Dt="e-lib",Yt="e-tooltip-popup-container",Xt=(Nt=L.ChildProperty,e(jt,Nt),i([L.Property({effect:"FadeIn",duration:150,delay:0})],jt.prototype,"open",void 0),i([L.Property({effect:"FadeOut",duration:150,delay:0})],jt.prototype,"close",void 0),jt);function jt(){return null!==Nt&&Nt.apply(this,arguments)||this}Ft=L.Component,e(c,Ft),c.prototype.initialize=function(){this.formatPosition(),L.addClass([this.element],Tt)},c.prototype.formatPosition=function(){var t;this.position&&(0===this.position.indexOf("Top")||0===this.position.indexOf("Bottom")?(t=this.position.split(/(?=[A-Z])/),this.tooltipPositionY=t[0],this.tooltipPositionX=t[1]):(t=this.position.split(/(?=[A-Z])/),this.tooltipPositionX=t[0],this.tooltipPositionY=t[1]))},c.prototype.renderArrow=function(){this.setTipClass(this.position);var t=this.createElement("div",{className:u+" "+this.tipClass});t.appendChild(this.createElement("div",{className:Ht+" "+this.tipClass})),t.appendChild(this.createElement("div",{className:Bt+" "+this.tipClass})),this.tooltipEle.appendChild(t)},c.prototype.setTipClass=function(t){0===t.indexOf("Right")?this.tipClass=Lt:0===t.indexOf("Bottom")?this.tipClass=Mt:0===t.indexOf("Left")?this.tipClass=Rt:this.tipClass=kt},c.prototype.renderPopup=function(t){t=this.mouseTrail?{top:0,left:0}:this.getTooltipPosition(t);this.tooltipEle.classList.remove(Dt),this.popupObj=new Et(this.tooltipEle,{height:this.height,width:this.width,position:{X:t.left,Y:t.top},enableRtl:this.enableRtl,open:this.openPopupHandler.bind(this),close:this.closePopupHandler.bind(this)})},c.prototype.getScalingFactor=function(t){var e;return t?(e={x:1,y:1},(t=t.closest('[style*="transform: scale"]'))&&t!==this.tooltipEle&&t.contains(this.tooltipEle)&&(t=window.getComputedStyle(t).getPropertyValue("transform").match(/matrix\(([^)]+)\)/)[1].split(",").map(parseFloat),e.x=t[0],e.y=t[3]),e):{x:1,y:1}},c.prototype.getTooltipPosition=function(t){this.tooltipEle.style.display="block";var e=this.element.closest('[style*="zoom"]'),e=(!e||e.contains(this.tooltipEle)||(this.tooltipEle.style.zoom=getComputedStyle(e).zoom),y(t,this.tooltipPositionX,this.tooltipPositionY,!this.isBodyContainer,this.isBodyContainer?null:this.containerElement.getBoundingClientRect())),i=this.getScalingFactor(t),o=this.calculateTooltipOffset(this.position,i.x,i.y),e=this.calculateElementPosition(e,o),o=e[0],e=e[1],t=this.collisionFlipFit(t,o,e);return t.left=t.left/i.x,t.top=t.top/i.y,this.tooltipEle.style.display="",t},c.prototype.windowResize=function(){this.reposition(this.findTarget())},c.prototype.reposition=function(t){this.popupObj&&t&&(t=this.getTooltipPosition(t),this.popupObj.position={X:t.left,Y:t.top},this.popupObj.dataBind())},c.prototype.openPopupHandler=function(){!this.mouseTrail&&this.needTemplateReposition()&&this.reposition(this.findTarget()),this.trigger("afterOpen",this.tooltipEventArgs),this.tooltipEventArgs=null},c.prototype.closePopupHandler=function(){this.isReact&&"Click"!==this.opensOn&&"function"!=typeof this.content&&this.clearTemplate(["content"]),this.clear();var t={type:this.tooltipEventArgs.event?this.tooltipEventArgs.event.type:null,cancel:!1,target:this.tooltipEventArgs.target,event:this.tooltipEventArgs.event||null,element:this.tooltipEle,isInteracted:!L.isNullOrUndefined(this.tooltipEventArgs.event)};this.trigger("afterClose",t)},c.prototype.calculateTooltipOffset=function(t,e,i){void 0===i&&(i=1);var o,n,s,l,r,a,h,d,p={top:0,left:0},c=1!==(e=void 0===e?1:e)||1!==i?(d=this.tooltipEle.getBoundingClientRect(),r=void 0,a=Math.round(d.width),h=Math.round(d.height),(d=L.select("."+u,this.tooltipEle))&&(r=d.getBoundingClientRect()),o=d?Math.round(r.width):0,n=d?Math.round(r.height):0,s=this.showTipPointer?0:8,l=n/2+2+(h-this.tooltipEle.clientHeight*i),o/2+2+(a-this.tooltipEle.clientWidth*e)):(a=this.tooltipEle.offsetWidth,h=this.tooltipEle.offsetHeight,o=(d=L.select("."+u,this.tooltipEle))?d.offsetWidth:0,n=d?d.offsetHeight:0,s=this.showTipPointer?0:8,l=n/2+2+(this.tooltipEle.offsetHeight-this.tooltipEle.clientHeight),o/2+2+(this.tooltipEle.offsetWidth-this.tooltipEle.clientWidth));switch(this.mouseTrail&&(s+=2),t){case"RightTop":p.left+=o+s,p.top-=h-l;break;case"RightCenter":p.left+=o+s,p.top-=h/2;break;case"RightBottom":p.left+=o+s,p.top-=l;break;case"BottomRight":p.top+=n+s,p.left-=c;break;case"BottomCenter":p.top+=n+s,p.left-=a/2;break;case"BottomLeft":p.top+=n+s,p.left-=a-c;break;case"LeftBottom":p.left-=o+a+s,p.top-=l;break;case"LeftCenter":p.left-=o+a+s,p.top-=h/2;break;case"LeftTop":p.left-=o+a+s,p.top-=h-l;break;case"TopLeft":p.top-=h+n+s,p.left-=a-c;break;case"TopRight":p.top-=h+n+s,p.left-=c;break;default:p.top-=h+n+s,p.left-=a/2}return p.left+=this.offsetX,p.top+=this.offsetY,p},c.prototype.updateTipPosition=function(t){var e=L.selectAll("."+u+",."+Ht+",."+Bt,this.tooltipEle);L.removeClass(e,[kt,Mt,Lt,Rt]),this.setTipClass(t),L.addClass(e,this.tipClass)},c.prototype.adjustArrow=function(t,e,i,o){var n,s,l,r,a,h,d,p=L.select("."+u,this.tooltipEle);!1!==this.showTipPointer&&null!==p&&(this.updateTipPosition(e),this.tooltipEle.style.display="block",e=this.tooltipEle.clientWidth,n=this.tooltipEle.clientHeight,s=L.select("."+Bt,this.tooltipEle),l=p.offsetWidth,r=p.offsetHeight,this.tooltipEle.style.display="",this.tipClass===kt||this.tipClass===Mt?(this.tipClass===kt?(d="99.9%",s.style.top="-"+(r-2)+"px"):(d=-(r-1)+"px",s.style.top="-"+(r-6)+"px"),t&&(a=(h="Center"!==i||e>t.offsetWidth||this.mouseTrail)&&"Left"===i||!h&&"End"===this.tipPointerPosition?e-l-2+"px":h&&"Right"===i||!h&&"Start"===this.tipPointerPosition?"2px":!h||"End"!==this.tipPointerPosition&&"Start"!==this.tipPointerPosition?e/2-l/2+"px":"End"===this.tipPointerPosition?t.offsetWidth+(this.tooltipEle.offsetWidth-t.offsetWidth)/2-l/2-2+"px":(this.tooltipEle.offsetWidth-t.offsetWidth)/2-l/2+2+"px")):(this.tipClass===Rt?(a="99.9%",s.style.left="-"+(l-2)+"px"):(a=-(l-1)+"px",s.style.left=l-2-l+"px"),d=(h="Center"!==o||n>t.offsetHeight||this.mouseTrail)&&"Top"===o||!h&&"End"===this.tipPointerPosition?n-r-2+"px":h&&"Bottom"===o||!h&&"Start"===this.tipPointerPosition?"2px":n/2-r/2+"px"),p.style.top=d,p.style.left=a)},c.prototype.renderContent=function(t){var e,i=this,o=L.select("."+Ut,this.tooltipEle);this.cssClass&&L.addClass([this.tooltipEle],this.cssClass.split(" ")),t&&!L.isNullOrUndefined(t.getAttribute("title"))&&(t.setAttribute("data-content",t.getAttribute("title")),t.removeAttribute("title")),L.isNullOrUndefined(this.content)?t&&!L.isNullOrUndefined(t.getAttribute("data-content"))&&(o.innerHTML=t.getAttribute("data-content")):(o.innerHTML="",this.content instanceof HTMLElement?o.appendChild(this.content):"string"==typeof this.content?(this.isAngular?this.setProperties({content:this.enableHtmlSanitizer?L.SanitizeHtmlHelper.sanitize(this.content):this.content},!0):this.content=this.enableHtmlSanitizer?L.SanitizeHtmlHelper.sanitize(this.content):this.content,this.enableHtmlParse?(e=L.compile(this.content)({},this,"content",this.element.id+"content",void 0,void 0,o,this.root))&&L.append(e,o):o.textContent=this.content):((e=L.compile(this.content)({},this,"content",this.element.id+"content",void 0,void 0,o))&&(this.isAngular&&"ZoomIn"===this.animation.open.effect&&setTimeout(function(){i.reposition(t)},1),L.append(e,o)),this.renderReactTemplates()))},c.prototype.renderCloseIcon=function(){var t;this.isSticky?(t=this.createElement("div",{className:Pt+" "+St,attrs:{role:"button","aria-label":"Press escape to close the Tooltip"}}),this.tooltipEle.appendChild(t),L.EventHandler.add(t,L.Browser.touchStartEvent,this.onStickyClose,this)):(t=this.tooltipEle.querySelector("."+Pt+"."+St))&&L.remove(t)},c.prototype.addDescribedBy=function(t,e){var i=(t.getAttribute("aria-describedby")||"").split(/\s+/);i.indexOf(e)<0&&i.push(e),L.attributes(t,{"aria-describedby":i.join(" ").trim(),"data-tooltip-id":e})},c.prototype.removeDescribedBy=function(t){var e=t.getAttribute("data-tooltip-id"),i=(t.getAttribute("aria-describedby")||"").split(/\s+/),e=i.indexOf(e),e=(-1!==e&&i.splice(e,1),t.removeAttribute("data-tooltip-id"),i.join(" ").trim());e?t.setAttribute("aria-describedby",e):t.removeAttribute("aria-describedby")},c.prototype.tapHoldHandler=function(t){clearTimeout(this.autoCloseTimer),this.targetHover(t.originalEvent)},c.prototype.touchEndHandler=function(){var t=this;this.isSticky||(this.autoCloseTimer=setTimeout(function(){t.close()},1500))},c.prototype.targetClick=function(t){var e,i=this.target?L.closest(t.target,this.target):this.element;L.isNullOrUndefined(i)||(e=t,null===i.getAttribute("data-tooltip-id")?"mousedown"===e.type&&2===e.button||this.targetHover(t):this.isSticky||this.hideTooltip(this.animation.close,t,i))},c.prototype.targetHover=function(t){var e=this.target?L.closest(t.target,this.target):this.element;if(!(L.isNullOrUndefined(e)||null!==e.getAttribute("data-tooltip-id")&&0===this.closeDelay)){!L.isNullOrUndefined(this.tooltipEle)&&this.tooltipEle.getAttribute("e-animation-id")&&(L.Animation.stop(this.tooltipEle),this.clear());for(var i=0,o=[].slice.call(L.selectAll('[data-tooltip-id= "'+this.ctrlId+'_content"]',document));i<o.length;i++){var n=o[i];this.restoreElement(n)}this.showTooltip(e,this.animation.open,t)}},c.prototype.mouseMoveBeforeOpen=function(t){this.mouseMoveEvent=t},c.prototype.mouseMoveBeforeRemove=function(){this.mouseMoveTarget&&L.EventHandler.remove(this.mouseMoveTarget,"mousemove touchstart",this.mouseMoveBeforeOpen)},c.prototype.showTooltip=function(e,i,o){var n=this;clearTimeout(this.showTimer),clearTimeout(this.hideTimer),this.openDelay&&this.mouseTrail&&(this.mouseMoveBeforeRemove(),this.mouseMoveTarget=e,L.EventHandler.add(this.mouseMoveTarget,"mousemove touchstart",this.mouseMoveBeforeOpen,this)),this.tooltipEventArgs={type:o?o.type:null,cancel:!1,target:e,event:o||null,element:this.tooltipEle,isInteracted:!L.isNullOrUndefined(o)};this.trigger("beforeRender",this.tooltipEventArgs,function(t){n.beforeRenderCallback(t,e,o,i)}.bind(this))},c.prototype.beforeRenderCallback=function(t,e,i,o){t.cancel?(this.isHidden=!0,this.clear(),this.mouseMoveBeforeRemove()):(this.isHidden=!1,L.isNullOrUndefined(this.tooltipEle)?(this.ctrlId=this.element.getAttribute("id")?L.getUniqueID(this.element.getAttribute("id")):L.getUniqueID("tooltip"),this.tooltipEle=this.createElement("div",{className:xt+" "+At+" "+Dt,attrs:{role:"tooltip","aria-hidden":"false",id:this.ctrlId+"_content"}}),this.tooltipEle.style.width=L.formatUnit(this.width),this.tooltipEle.style.height=L.formatUnit(this.height),this.tooltipEle.style.position="absolute",this.tooltipBeforeRender(e,this),this.tooltipAfterRender(e,i,o,this)):e&&(this.adjustArrow(e,this.position,this.tooltipPositionX,this.tooltipPositionY),this.addDescribedBy(e,this.ctrlId+"_content"),this.renderContent(e),L.Animation.stop(this.tooltipEle),this.reposition(e),this.tooltipAfterRender(e,i,o,this)))},c.prototype.appendContainer=function(t){var e,i,o;"string"==typeof this.container?"body"===this.container?(e=document.body,this.isAngular&&(i=this.element&&this.element.closest?this.element.closest(".cdk-overlay-pane"):null,o=this.element&&this.element.closest?this.element.closest("[popover]"):null,i)&&o&&(e=i),this.containerElement=e):(this.isBodyContainer=!1,this.containerElement=L.select(this.container,document)):this.container instanceof HTMLElement&&(this.containerElement=this.container,this.isBodyContainer="BODY"===this.containerElement.tagName),this.isBodyContainer||L.addClass([this.containerElement],Yt),this.containerElement.appendChild(t.tooltipEle)},c.prototype.tooltipBeforeRender=function(t,e){t&&(L.Browser.isDevice&&L.addClass([e.tooltipEle],"e-bigger"),"auto"!==e.width&&(e.tooltipEle.style.maxWidth=L.formatUnit(e.width)),e.tooltipEle.appendChild(e.createElement("div",{className:Ut})),this.appendContainer(e),L.removeClass([e.tooltipEle],"e-hidden"),e.addDescribedBy(t,e.ctrlId+"_content"),e.renderContent(t),L.addClass([e.tooltipEle],zt),e.showTipPointer&&e.renderArrow(),e.renderCloseIcon(),e.renderPopup(t),e.adjustArrow(t,e.position,e.tooltipPositionX,e.tooltipPositionY),L.Animation.stop(e.tooltipEle),e.reposition(t))},c.prototype.tooltipAfterRender=function(e,i,o,n){e&&(L.removeClass([n.tooltipEle],zt),L.addClass([n.tooltipEle],It),n.tooltipEventArgs={type:i?i.type:null,cancel:!1,target:e,event:i||null,element:n.tooltipEle,isInteracted:!L.isNullOrUndefined(i)},n.needTemplateReposition()&&!n.mouseTrail&&("None"===o.effect||"FadeIn"===o.effect||this.isReact&&"string"!=typeof n.content)&&(n.tooltipEle.style.display="none"),n.trigger("beforeOpen",n.tooltipEventArgs,function(t){n.beforeOpenCallback(t,e,o,i)}.bind(n)))},c.prototype.beforeOpenCallback=function(t,e,i,o){var n,s=this;t.cancel?(this.isHidden=!0,this.clear(),this.mouseMoveBeforeRemove(),this.restoreElement(e)):(n={name:"None"===i.effect&&"Enable"===L.animationMode?"FadeIn":this.animation.open.effect,duration:i.duration,delay:i.delay,timingFunction:"easeOut"},"None"===i.effect&&(n=void 0),0<this.openDelay?this.showTimer=setTimeout(function(){s.mouseTrail&&L.EventHandler.add(e,"mousemove touchstart mouseenter",s.onMouseMove,s),s.popupObj&&(s.popupObj.show(n,e),s.mouseMoveEvent)&&s.mouseTrail&&s.onMouseMove(s.mouseMoveEvent)},this.openDelay):this.popupObj&&this.popupObj.show(n,e)),o&&this.wireMouseEvents(o,e)},c.prototype.needTemplateReposition=function(){return!L.isNullOrUndefined(this.viewContainerRef)&&"string"!=typeof this.viewContainerRef||this.isReact},c.prototype.checkCollision=function(t,e,i){var o={left:e,top:i,position:this.position,horizontal:this.tooltipPositionX,vertical:this.tooltipPositionY},e=K(this.tooltipEle,this.checkCollideTarget(),e,i);return 0<e.length&&(o.horizontal=0<=e.indexOf("left")?"Right":0<=e.indexOf("right")?"Left":this.tooltipPositionX,o.vertical=0<=e.indexOf("top")?"Bottom":0<=e.indexOf("bottom")?"Top":this.tooltipPositionY),o},c.prototype.calculateElementPosition=function(t,e){return[this.isBodyContainer?t.left+e.left:t.left-this.containerElement.getBoundingClientRect().left+e.left+window.pageXOffset+this.containerElement.scrollLeft,this.isBodyContainer?t.top+e.top:t.top-this.containerElement.getBoundingClientRect().top+e.top+window.pageYOffset+this.containerElement.scrollTop]},c.prototype.collisionFlipFit=function(t,e,i){var o,n,e=this.checkCollision(t,e,i),i=e.position,s=(this.tooltipPositionY!==e.vertical&&(i=0===this.position.indexOf("Bottom")||0===this.position.indexOf("Top")?e.vertical+this.tooltipPositionX:this.tooltipPositionX+e.vertical),this.tooltipPositionX!==e.horizontal&&(0===i.indexOf("Left")&&(e.vertical="LeftTop"===i||"LeftCenter"===i?"Top":"Bottom",i=e.vertical+"Left"),0===i.indexOf("Right")&&(e.vertical="RightTop"===i||"RightCenter"===i?"Top":"Bottom",i=e.vertical+"Right"),e.horizontal=this.tooltipPositionX),this.tooltipEventArgs={type:null,cancel:!1,target:t,event:null,element:this.tooltipEle,collidedPosition:i},this.trigger("beforeCollision",this.tooltipEventArgs),this.tooltipEventArgs.cancel?i=this.position:(o=e.vertical,n=e.horizontal,e.position!==i?(l=y(t,n,o,!this.isBodyContainer,this.isBodyContainer?null:this.containerElement.getBoundingClientRect()),this.adjustArrow(t,i,n,o),s=this.getScalingFactor(t),(s=this.calculateTooltipOffset(i,s.x,s.y)).top-=this.getOffSetPosition("TopBottom",i,this.offsetY),s.left-=this.getOffSetPosition("RightLeft",i,this.offsetX),e.position=i,l=this.calculateElementPosition(l,s),e.left=l[0],e.top=l[1]):this.adjustArrow(t,i,n,o)),{left:e.left,top:e.top}),l=this.isBodyContainer?Z(this.tooltipEle,this.checkCollideTarget(),{X:!0,Y:this.windowCollision},s):s,t=(this.tooltipEle.style.display="block",L.select("."+u,this.tooltipEle));return!this.showTipPointer||null==t||0!==i.indexOf("Bottom")&&0!==i.indexOf("Top")||((n=parseInt(t.style.left,10)-(l.left-e.left))<0?n=0:n+t.offsetWidth>this.tooltipEle.clientWidth&&(n=this.tooltipEle.clientWidth-t.offsetWidth),t.style.left=n.toString()+"px"),this.tooltipEle.style.display="",s.left=l.left,s.top=l.top,s},c.prototype.getOffSetPosition=function(t,e,i){return-1!==t.indexOf(this.position.split(/(?=[A-Z])/)[0])&&-1!==t.indexOf(e.split(/(?=[A-Z])/)[0])?2*i:0},c.prototype.checkCollideTarget=function(){return!this.windowCollision&&this.target?this.element:null},c.prototype.hideTooltip=function(t,e,i){var o=this;0<this.closeDelay?(clearTimeout(this.hideTimer),clearTimeout(this.showTimer),this.hideTimer=setTimeout(function(){o.closeDelay&&o.tooltipEle&&o.isTooltipOpen||o.tooltipHide(t,e,i)},this.closeDelay)):this.tooltipHide(t,e,i)},c.prototype.tooltipHide=function(e,i,t){var o=this,n=i?this.target?t||i.target:this.element:L.select('[data-tooltip-id= "'+this.ctrlId+'_content"]',document);this.tooltipEventArgs={type:i?i.type:null,cancel:!1,target:n,event:i||null,element:this.tooltipEle,isInteracted:!L.isNullOrUndefined(i)},this.trigger("beforeClose",this.tooltipEventArgs,function(t){t.cancel?o.isHidden=!1:(o.mouseMoveBeforeRemove(),o.popupHide(e,n,i))})},c.prototype.popupHide=function(t,e,i){e&&i&&this.restoreElement(e),this.isHidden=!0;i={name:"None"===t.effect&&"Enable"===L.animationMode?"FadeOut":this.animation.close.effect,duration:t.duration,delay:t.delay,timingFunction:"easeIn"};"None"===t.effect&&(i=void 0),this.popupObj&&this.popupObj.hide(i)},c.prototype.restoreElement=function(t){this.unwireMouseEvents(t),L.isNullOrUndefined(t.getAttribute("data-content"))||(t.setAttribute("title",t.getAttribute("data-content")),t.removeAttribute("data-content")),this.removeDescribedBy(t)},c.prototype.clear=function(){var t=this.findTarget();t&&this.restoreElement(t),this.tooltipEle&&(L.removeClass([this.tooltipEle],It),L.addClass([this.tooltipEle],zt)),this.isHidden&&(this.popupObj&&this.popupObj.destroy(),this.tooltipEle&&L.remove(this.tooltipEle),this.tooltipEle=null,this.popupObj=null)},c.prototype.tooltipHover=function(){this.tooltipEle&&(this.isTooltipOpen=!0)},c.prototype.tooltipMouseOut=function(t){this.isTooltipOpen=!1,this.hideTooltip(this.animation.close,t,this.findTarget())},c.prototype.onMouseOut=function(t){var e=t.relatedTarget;e&&!this.mouseTrail?(e=L.closest(e,"."+xt+"."+Dt+"."+At))?L.EventHandler.add(e,"mouseleave",this.tooltipElementMouseOut,this):(this.hideTooltip(this.animation.close,t,this.findTarget()),0===this.closeDelay&&("None"===this.animation.close.effect||this.isReact&&"string"!=typeof this.content)&&this.clear()):(this.hideTooltip(this.animation.close,t,this.findTarget()),this.clear()),this.popupObj&&!this.popupObj.element.classList.contains(zt)&&this.clear()},c.prototype.tooltipElementMouseOut=function(t){this.hideTooltip(this.animation.close,t,this.findTarget()),L.EventHandler.remove(this.element,"mouseleave",this.tooltipElementMouseOut),this.clear()},c.prototype.onStickyClose=function(){this.close()},c.prototype.onMouseMove=function(t){var e,i,o,n=0,s=0,s=(-1<t.type.indexOf("touch")?(t.preventDefault(),n=t.touches[0].pageX,t.touches[0]):(n=t.pageX,t)).pageY;L.isNullOrUndefined(this.tooltipEle)||(L.Animation.stop(this.tooltipEle),L.removeClass([this.tooltipEle],It),L.addClass([this.tooltipEle],zt),this.adjustArrow(t.target,this.position,this.tooltipPositionX,this.tooltipPositionY),e=this.getScalingFactor(t.target),i=n+(o=this.calculateTooltipOffset(this.position,e.x,e.y)).left+this.offsetX,o=s+o.top+this.offsetY,i=this.checkCollision(t.target,i,o),this.tooltipPositionX===i.horizontal&&this.tooltipPositionY===i.vertical||(o=0===this.position.indexOf("Bottom")||0===this.position.indexOf("Top")?i.vertical+i.horizontal:i.horizontal+i.vertical,i.position=o,this.adjustArrow(t.target,i.position,i.horizontal,i.vertical),o=this.calculateTooltipOffset(i.position,e.x,e.y),i.left=n+o.left-this.offsetX,i.top=s+o.top-this.offsetY),this.tooltipEle.style.left=i.left+"px",this.tooltipEle.style.top=i.top+"px")},c.prototype.keyDown=function(t){this.tooltipEle&&27===t.keyCode&&this.close()},c.prototype.touchEnd=function(t){this.tooltipEle&&null===L.closest(t.target,"."+Tt)&&!this.isSticky&&this.close()},c.prototype.scrollHandler=function(t){!this.tooltipEle||this.isSticky||L.closest(t.target,"."+xt+"."+Dt+"."+At)||this.isSticky||this.close()},c.prototype.render=function(){this.initialize(),this.wireEvents(this.opensOn),this.renderComplete()},c.prototype.preRender=function(){this.tipClass=kt,this.tooltipPositionX="Center",this.tooltipPositionY="Top",this.isHidden=!0},c.prototype.wireEvents=function(t){for(var e=0,i=this.getTriggerList(t);e<i.length;e++){var o=i[e];if("Custom"===o)return;"Focus"===o&&this.wireFocusEvents(),"Click"===o&&(L.Browser.isIos7||L.Browser.isIos)&&L.EventHandler.add(this.element,"mousedown",this.targetClick,this),"Click"!==o||L.Browser.isIos7||L.Browser.isIos||L.EventHandler.add(this.element,L.Browser.touchStartEvent,this.targetClick,this),"Hover"===o&&(L.Browser.isDevice?(this.touchModule=new L.Touch(this.element,{tapHoldThreshold:500,tapHold:this.tapHoldHandler.bind(this)}),L.EventHandler.add(this.element,L.Browser.touchEndEvent,this.touchEndHandler,this)):L.EventHandler.add(this.element,"mouseover",this.targetHover,this))}this.windowResizeBound=this.windowResize.bind(this),this.keyDownBound=this.keyDown.bind(this),this.touchEndBound=this.touchEnd.bind(this),this.scrollWheelBound=this.scrollHandler.bind(this),document.addEventListener("wheel",this.scrollWheelBound),document.addEventListener("scroll",this.scrollWheelBound),document.addEventListener("touchend",this.touchEndBound),document.addEventListener("keydown",this.keyDownBound),window.addEventListener("resize",this.windowResizeBound)},c.prototype.getTriggerList=function(t){return t?(t="Auto"===t?L.Browser.isDevice?"Hover":"Hover Focus":t).split(" "):[]},c.prototype.wireFocusEvents=function(){if(L.isNullOrUndefined(this.target))L.EventHandler.add(this.element,"focusin",this.targetHover,this);else{var t=[].slice.call(L.selectAll(this.target,this.element));if(this.targetsList=t,!L.isNullOrUndefined(this.targetsList)&&0<this.targetsList.length)for(var e=0,i=t;e<i.length;e++){var o=i[e];L.EventHandler.add(o,"focus",this.targetHover,this)}else L.EventHandler.add(this.element,"focusin",this.targetHover,this)}},c.prototype.wireMouseEvents=function(t,e){this.tooltipEle&&(this.isSticky||("focus"===t.type&&L.EventHandler.add(e,"blur",this.onMouseOut,this),"focusin"===t.type&&L.EventHandler.add(e,"focusout",this.onMouseOut,this),"mouseover"===t.type&&L.EventHandler.add(e,"mouseleave",this.onMouseOut,this),this.closeDelay&&(L.EventHandler.add(this.tooltipEle,"mouseenter",this.tooltipHover,this),L.EventHandler.add(this.tooltipEle,"mouseleave",this.tooltipMouseOut,this))),this.mouseTrail)&&0===this.openDelay&&L.EventHandler.add(e,"mousemove touchstart mouseenter",this.onMouseMove,this)},c.prototype.unwireEvents=function(t){for(var e=0,i=this.getTriggerList(t);e<i.length;e++){var o=i[e];if("Custom"===o)return;"Focus"===o&&this.unwireFocusEvents(),"Click"===o&&L.EventHandler.remove(this.element,L.Browser.touchStartEvent,this.targetClick),"Hover"===o&&(L.Browser.isDevice?(this.touchModule&&this.touchModule.destroy(),L.EventHandler.remove(this.element,L.Browser.touchEndEvent,this.touchEndHandler)):L.EventHandler.remove(this.element,"mouseover",this.targetHover))}document.removeEventListener("touchend",this.touchEndBound),this.touchEndBound=null,document.removeEventListener("wheel",this.scrollWheelBound),document.removeEventListener("scroll",this.scrollWheelBound),this.scrollWheelBound=null,window.removeEventListener("resize",this.windowResizeBound),this.windowResizeBound=null,document.removeEventListener("keydown",this.keyDownBound),this.keyDownBound=null},c.prototype.unwireFocusEvents=function(){if(L.isNullOrUndefined(this.target))L.EventHandler.remove(this.element,"focusin",this.targetHover);else{var t=[].slice.call(L.selectAll(this.target,this.element));if(!L.isNullOrUndefined(this.targetsList)&&0<this.targetsList.length)for(var e=0,i=t;e<i.length;e++){var o=i[e];L.EventHandler.remove(o,"focus",this.targetHover)}else L.EventHandler.remove(this.element,"focusin",this.targetHover)}},c.prototype.unwireMouseEvents=function(t){if(!this.isSticky){for(var e=0,i=this.getTriggerList(this.opensOn);e<i.length;e++){var o=i[e];"Focus"===o&&(L.EventHandler.remove(t,"blur",this.onMouseOut),L.EventHandler.remove(t,"focusout",this.onMouseOut)),"Hover"!==o||L.Browser.isDevice||L.EventHandler.remove(t,"mouseleave",this.onMouseOut)}this.closeDelay&&(L.EventHandler.remove(t,"mouseenter",this.tooltipHover),L.EventHandler.remove(t,"mouseleave",this.tooltipMouseOut))}this.mouseTrail&&L.EventHandler.remove(t,"mousemove touchstart mouseenter",this.onMouseMove)},c.prototype.findTarget=function(){return L.select('[data-tooltip-id= "'+this.ctrlId+'_content"]',document)},c.prototype.getModuleName=function(){return"tooltip"},c.prototype.getPersistData=function(){return this.addOnPersist([])},c.prototype.onPropertyChanged=function(t,e){for(var i,o,n=this.findTarget(),s=0,l=Object.keys(t);s<l.length;s++)switch(l[s]){case"width":this.tooltipEle&&n&&(this.tooltipEle.style.width=this.tooltipEle.style.maxWidth=L.formatUnit(t.width),this.reposition(n));break;case"height":this.tooltipEle&&n&&(this.tooltipEle.style.height=L.formatUnit(t.height),this.reposition(n));break;case"content":this.tooltipEle&&this.renderContent();break;case"opensOn":this.unwireEvents(e.opensOn),this.wireEvents(t.opensOn);break;case"position":this.formatPosition(),this.tooltipEle&&n&&((i=L.select("."+Bt,this.tooltipEle))&&(i.style.top=i.style.left=null),this.reposition(n));break;case"tipPointerPosition":this.tooltipEle&&n&&this.reposition(n);break;case"offsetX":this.tooltipEle&&(i=t.offsetX-e.offsetX,this.tooltipEle.style.left=(parseInt(this.tooltipEle.style.left,10)+i).toString()+"px");break;case"offsetY":this.tooltipEle&&(o=t.offsetY-e.offsetY,this.tooltipEle.style.top=(parseInt(this.tooltipEle.style.top,10)+o).toString()+"px");break;case"cssClass":this.tooltipEle&&(e.cssClass&&L.removeClass([this.tooltipEle],e.cssClass.split(" ")),t.cssClass)&&L.addClass([this.tooltipEle],t.cssClass.split(" "));break;case"enableRtl":this.tooltipEle&&(this.enableRtl?L.addClass([this.tooltipEle],"e-rtl"):L.removeClass([this.tooltipEle],"e-rtl"));break;case"isSticky":this.tooltipEle&&n&&(this.renderCloseIcon(),this.reposition(n));break;case"container":L.isNullOrUndefined(this.containerElement)||L.removeClass([this.containerElement],Yt),this.container=t.container,this.tooltipEle&&n&&(this.appendContainer(this),this.reposition(n))}},c.prototype.open=function(t,e){L.isNullOrUndefined(e)&&(e=this.animation.open),"none"!==(t=L.isNullOrUndefined(t)?this.element:t).style.display&&this.showTooltip(t,e)},c.prototype.close=function(t){t=t||this.animation.close,this.hideTooltip(t)},c.prototype.refresh=function(t){this.tooltipEle&&this.renderContent(t),this.popupObj&&t&&this.reposition(t),L.isNullOrUndefined(this.targetsList)||L.isNullOrUndefined(this.target)||L.selectAll(this.target,this.element).length!==this.targetsList.length&&(this.unwireEvents(this.opensOn),this.