// Version 1.7.5 float-tooltip - https://github.com/vasturiano/float-tooltip !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).Tooltip=n()}(this,(function(){"use strict";function t(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);e=0&&"xmlns"!==(n=t.slice(0,e))&&(t=t.slice(e+1)),u.hasOwnProperty(n)?{space:u[n],local:t}:t}function c(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===i&&n.documentElement.namespaceURI===i?n.createElement(t):n.createElementNS(e,t)}}function s(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function a(t){var n=l(t);return(n.local?s:c)(n)}function f(){}function _(t){return null==t?f:function(){return this.querySelector(t)}}function p(){return[]}function h(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function d(t){return function(n){return n.matches(t)}}var y=Array.prototype.find;function v(){return this.firstElementChild}var m=Array.prototype.filter;function g(){return Array.from(this.children)}function b(t){return new Array(t.length)}function w(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function x(t,n,e,r,o,i){for(var u,l=0,c=n.length,s=i.length;ln?1:t>=n?0:NaN}function j(t){return function(){this.removeAttribute(t)}}function O(t){return function(){this.removeAttributeNS(t.space,t.local)}}function P(t,n){return function(){this.setAttribute(t,n)}}function C(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function T(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttribute(t):this.setAttribute(t,e)}}function N(t,n){return function(){var e=n.apply(this,arguments);null==e?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function M(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function U(t){return function(){this.style.removeProperty(t)}}function D(t,n,e){return function(){this.style.setProperty(t,n,e)}}function I(t,n,e){return function(){var r=n.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function L(t){return function(){delete this[t]}}function B(t,n){return function(){this[t]=n}}function H(t,n){return function(){var e=n.apply(this,arguments);null==e?delete this[t]:this[t]=e}}function R(t){return t.trim().split(/^|\s+/)}function V(t){return t.classList||new W(t)}function W(t){this._node=t,this._names=R(t.getAttribute("class")||"")}function Y(t,n){for(var e=V(t),r=-1,o=n.length;++r=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var ft=[null];function _t(t,n){this._groups=t,this._parents=n}function pt(t){var n=typeof t;return null!=t&&("object"==n||"function"==n)}_t.prototype={constructor:_t,select:function(t){"function"!=typeof t&&(t=_(t));for(var n=this._groups,e=n.length,r=new Array(e),o=0;o=b&&(b=g+1);!(m=y[b])&&++b=0;)(r=o[i])&&(u&&4^r.compareDocumentPosition(u)&&u.parentNode.insertBefore(r,u),u=r);return this},sort:function(t){function n(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}t||(t=k);for(var e=this._groups,r=e.length,o=new Array(r),i=0;i1?this.each((null==n?U:"function"==typeof n?I:D)(t,n,null==e?"":e)):function(t,n){return t.style.getPropertyValue(n)||M(t).getComputedStyle(t,null).getPropertyValue(n)}(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((null==n?L:"function"==typeof n?H:B)(t,n)):this.node()[t]},classed:function(t,n){var e=R(t+"");if(arguments.length<2){for(var r=V(this.node()),o=-1,i=e.length;++o=0&&(n=t.slice(e+1),t=t.slice(0,e)),{type:t,name:n}}))}(t+""),u=i.length;if(!(arguments.length<2)){for(l=n?lt:ut,r=0;r=n||e<0||f&&t-s>=i}function d(){var t=vt();if(h(t))return y(t);l=setTimeout(d,function(t){var e=n-(t-c);return f?Dt(e,i-(t-s)):e}(t))}function y(t){return l=void 0,_&&r?p(t):(r=o=void 0,u)}function v(){var t=vt(),e=h(t);if(r=arguments,o=this,c=t,e){if(void 0===l)return function(t){return s=t,l=setTimeout(d,n),a?p(t):u}(c);if(f)return clearTimeout(l),l=setTimeout(d,n),p(c)}return void 0===l&&(l=setTimeout(d,n)),u}return n=Mt(n)||0,pt(e)&&(a=!!e.leading,i=(f="maxWait"in e)?Ut(Mt(e.maxWait)||0,n):i,_="trailing"in e?!!e.trailing:_),v.cancel=function(){void 0!==l&&clearTimeout(l),s=0,r=c=o=l=void 0},v.flush=function(){return void 0===l?u:y(vt())},v}function Lt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=Array(n);el&&Xt.sort(Gt),t=Xt.shift(),l=Xt.length,t.__d&&(e=void 0,o=(r=(n=t).__v).__e,i=[],u=[],n.__P&&((e=rn({},r)).__v=r.__v+1,Wt.vnode&&Wt.vnode(e),bn(n.__P,e,r,n.__n,n.__P.namespaceURI,32&r.__u?[o]:null,i,null==o?sn(r):o,!!(32&r.__u),u),e.__v=r.__v,e.__.__k[e.__i]=e,wn(i,e,u),e.__e!=o&&an(e)));_n.__r=0}function pn(t,n,e,r,o,i,u,l,c,s,a){var f,_,p,h,d,y,v=r&&r.__k||tn,m=n.length;for(c=hn(e,n,v,c,m),f=0;f0?un(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):u).__=t,u.__b=t.__b+1,l=null,-1!==(s=u.__i=yn(u,e,c,f))&&(f--,(l=e[s])&&(l.__u|=2)),null==l||null===l.__v?(-1==s&&_--,"function"!=typeof u.type&&(u.__u|=4)):s!=c&&(s==c-1?_--:s==c+1?_++:(s>c?_--:_++,u.__u|=4))):t.__k[i]=null;if(f)for(i=0;i(null==c||2&c.__u?0:1))for(o=e-1,i=e+1;o>=0||i=0){if((c=n[o])&&!(2&c.__u)&&u==c.key&&l===c.type)return o;o--}if(i2&&(u.children=arguments.length>3?Vt.call(arguments,2):e),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===u[i]&&(u[i]=t.defaultProps[i]);return un(t,u,r,o,null)}(ln,null,[t]),r||Zt,Zt,n.namespaceURI,r?null:n.firstChild?Vt.call(n.childNodes):null,o,r?r.__e:n.firstChild,false,i),wn(o,t,i)}function jn(t,n,e){var r,o,i,u,l=rn({},t.props);for(i in t.type&&t.type.defaultProps&&(u=t.type.defaultProps),n)"key"==i?r=n[i]:"ref"==i?o=n[i]:l[i]=void 0===n[i]&&void 0!==u?u[i]:n[i];return arguments.length>2&&(l.children=arguments.length>3?Vt.call(arguments,2):e),un(t.type,l,r||t.key,o||t.ref,null)}Vt=tn.slice,Wt={__e:function(t,n,e,r){for(var o,i,u;n=n.__;)if((o=n.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(t)),u=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(t,r||{}),u=o.__d),u)return o.__E=o}catch(n){t=n}throw t}},Yt=0,Ft=function(t){return null!=t&&null==t.constructor},cn.prototype.setState=function(t,n){var e;e=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=rn({},this.state),"function"==typeof t&&(t=t(rn({},e),this.props)),t&&rn(e,t),null!=t&&this.__v&&(n&&this._sb.push(n),fn(this))},cn.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),fn(this))},cn.prototype.render=ln,Xt=[],qt="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Gt=function(t,n){return t.__v.__b-n.__v.__b},_n.__r=0,zt=/(PointerCapture)$|Capture$/i,Jt=0,Kt=gn(!1),Qt=gn(!0);var On=function(t){if("object"!==o(t))return t;var r,i=jn(t);i.props&&(i.props=function(t){for(var r=1;r2&&void 0!==arguments[2]?arguments[2]:{}).style,i=void 0===e?{}:e,u=function(t){return"string"==typeof t?new _t([[document.querySelector(t)]],[document.documentElement]):new _t([[t]],ft)}(t&&"object"===o(t)&&t.node&&"function"==typeof t.node?t.node():t);"static"===u.style("position")&&u.style("position","relative"),n.tooltipEl=u.append("div").attr("class","float-tooltip-kap"),Object.entries(i).forEach((function(t){var e=r(t,2),o=e[0],i=e[1];return n.tooltipEl.style(o,i)})),n.tooltipEl.style("left","-10000px").style("display","none");var l="tooltip-".concat(Math.round(1e12*Math.random()));n.mouseInside=!1,u.on("mousemove.".concat(l),(function(t){n.mouseInside=!0;var e=function(t,n){if(t=function(t){let n;for(;n=t.sourceEvent;)t=n;return t}(t),void 0===n&&(n=t.currentTarget),n){var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(n.getScreenCTM().inverse())).x,r.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[t.clientX-o.left-n.clientLeft,t.clientY-o.top-n.clientTop]}}return[t.pageX,t.pageY]}(t),r=u.node(),o=r.offsetWidth,i=r.offsetHeight,l=[null===n.offsetX||void 0===n.offsetX?"-".concat(e[0]/o*100,"%"):"number"==typeof n.offsetX?"calc(-50% + ".concat(n.offsetX,"px)"):n.offsetX,null===n.offsetY||void 0===n.offsetY?i>130&&i-e[1]<100?"calc(-100% - 6px)":"21px":"number"==typeof n.offsetY?n.offsetY<0?"calc(-100% - ".concat(Math.abs(n.offsetY),"px)"):"".concat(n.offsetY,"px"):n.offsetY];n.tooltipEl.style("left",e[0]+"px").style("top",e[1]+"px").style("transform","translate(".concat(l.join(","),")")),n.content&&n.tooltipEl.style("display","inline")})),u.on("mouseover.".concat(l),(function(){n.mouseInside=!0,n.content&&n.tooltipEl.style("display","inline")})),u.on("mouseout.".concat(l),(function(){n.mouseInside=!1,n.tooltipEl.style("display","none")}))},update:function(t){var n,e;t.tooltipEl.style("display",t.content&&t.mouseInside?"inline":"none"),t.content?t.content instanceof HTMLElement?(t.tooltipEl.text(""),t.tooltipEl.append((function(){return t.content}))):"string"==typeof t.content?t.tooltipEl.html(t.content):function(t){return Ft(jn(t))}(t.content)?(t.tooltipEl.text(""),n=t.content,delete(e=t.tooltipEl.node()).__k,kn(On(n),e)):(t.tooltipEl.style("display","none"),console.warn("Tooltip content is invalid, skipping.",t.content,t.content.toString())):t.tooltipEl.text("")}},Cn=Pn.stateInit,Tn=void 0===Cn?function(){return{}}:Cn,Nn=Pn.props,Mn=void 0===Nn?{}:Nn,Un=Pn.methods,Dn=void 0===Un?{}:Un,In=Pn.aliases,Ln=void 0===In?{}:In,Bn=Pn.init,Hn=void 0===Bn?function(){}:Bn,Rn=Pn.update,Vn=void 0===Rn?function(){}:Rn,Wn=Object.keys(Mn).map((function(t){return new Rt(t,Mn[t])})),function t(){for(var n=arguments.length,e=new Array(n),r=0;r