diff --git a/.editorconfig b/.editorconfig
deleted file mode 100644
index 9d08a1a..0000000
--- a/.editorconfig
+++ /dev/null
@@ -1,9 +0,0 @@
-root = true
-
-[*]
-charset = utf-8
-indent_style = space
-indent_size = 2
-end_of_line = lf
-insert_final_newline = true
-trim_trailing_whitespace = true
diff --git a/.eslintignore b/.eslintignore
deleted file mode 100644
index a804767..0000000
--- a/.eslintignore
+++ /dev/null
@@ -1,5 +0,0 @@
-build/
-dist/
-node_modules/
-.snapshots/
-*.min.js
\ No newline at end of file
diff --git a/.eslintrc b/.eslintrc
deleted file mode 100644
index 5b87c77..0000000
--- a/.eslintrc
+++ /dev/null
@@ -1,31 +0,0 @@
-{
- "parser": "babel-eslint",
- "extends": [
- "standard",
- "standard-react",
- "plugin:prettier/recommended",
- "prettier/standard",
- "prettier/react"
- ],
- "env": {
- "node": true
- },
- "parserOptions": {
- "ecmaVersion": 2020,
- "ecmaFeatures": { "jsx": true }
- },
- "settings": {
- "react": {
- "version": "16"
- }
- },
- "rules": {
- "no-console": 1,
- "space-before-function-paren": 0,
- "react/prop-types": 0,
- "react/jsx-handler-names": 0,
- "react/jsx-fragments": 0,
- "react/no-unused-prop-types": 2,
- "import/export": 0
- }
-}
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 7005be7..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# See https://help.github.com/ignore-files/ for more about ignoring files.
-
-# dependencies
-node_modules
-
-# builds
-build
-dist
-.rpt2_cache
-
-# misc
-.DS_Store
-.env
-.env.local
-.env.development.local
-.env.test.local
-.env.production.local
-
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
diff --git a/.npmignore b/.npmignore
deleted file mode 100644
index e056642..0000000
--- a/.npmignore
+++ /dev/null
@@ -1,4 +0,0 @@
-example
-
-# media files with copyrighted material
-*.png
\ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index c66a67b..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: node_js
-node_js:
- - 12
- - 10
diff --git a/README.md b/README.md
deleted file mode 100644
index c5a0fb9..0000000
--- a/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# react-tech-tree
-
-> React tech tree component
-
-[](https://www.npmjs.com/package/react-tech-tree) [](https://standardjs.com)
-
-## Install
-
-```bash
-npm install --save react-tech-tree
-```
-
-## Usage
-
-```jsx
-import React, { Component } from 'react'
-
-import MyComponent from 'react-tech-tree'
-import 'react-tech-tree/dist/index.css'
-
-class Example extends Component {
- render() {
- return
=0;n--){for(var u=t.words[n],c=f-1;c>=0;c--){var l=u>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}f=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},a.mont=function(e){return new M(e)},i(M,S),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(137)(e))},function(e,t,r){"use strict";(function(e){var n=r(101),i=r(102),a=r(51);function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o() P(o,r))void 0!==f&&0>P(f,o)?(e[n]=f,e[s]=r,n=s):(e[n]=o,e[a]=r,n=a);else{if(!(void 0!==f&&0>P(f,r)))break e;e[n]=f,e[s]=r,n=s}}}return t}return null}function P(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}var A=[],C=[],N=1,O=null,I=3,R=!1,B=!1,j=!1;function L(e){for(var t=x(C);null!==t;){if(null===t.callback)T(C);else{if(!(t.startTime<=e))break;T(C),t.sortIndex=t.expirationTime,k(A,t)}t=x(C)}}function z(e){if(j=!1,L(e),!B)if(null!==x(A))B=!0,n(D);else{var t=x(C);null!==t&&i(z,t.startTime-e)}}function D(e,r){B=!1,j&&(j=!1,a()),R=!0;var n=I;try{for(L(r),O=x(A);null!==O&&(!(O.expirationTime>r)||e&&!o());){var s=O.callback;if(null!==s){O.callback=null,I=O.priorityLevel;var f=s(O.expirationTime<=r);r=t.unstable_now(),"function"===typeof f?O.callback=f:O===x(A)&&T(A),L(r)}else T(A);O=x(A)}if(null!==O)var u=!0;else{var c=x(C);null!==c&&i(z,c.startTime-r),u=!1}return u}finally{O=null,I=n,R=!1}}function H(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var U=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){B||R||(B=!0,n(D))},t.unstable_getCurrentPriorityLevel=function(){return I},t.unstable_getFirstCallbackNode=function(){return x(A)},t.unstable_next=function(e){switch(I){case 1:case 2:case 3:var t=3;break;default:t=I}var r=I;I=t;try{return e()}finally{I=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=U,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=I;I=e;try{return t()}finally{I=r}},t.unstable_scheduleCallback=function(e,r,o){var s=t.unstable_now();if("object"===typeof o&&null!==o){var f=o.delay;f="number"===typeof f&&0s&&(r=s-f),a=r;a>=0;a--){for(var l=!0,d=0;di)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return M(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i>>0},t.sum64_4_lo=function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,a,o,s,f,u){var c=0,l=t;return c+=(l=l+n>>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,a,o,s,f,u){return t+n+a+s+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(n){"object"===typeof window&&(r=window)}e.exports=r},function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"===typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var f,u=[],c=!1,l=-1;function d(){c&&f&&(c=!1,f.length?u=f.concat(u):l=-1,u.length&&h())}function h(){if(!c){var e=s(d);c=!0;for(var t=u.length;t;){for(f=u,u=[];++l>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,a=0,o=6;o>=0;o-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+o&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+o&1}for(o=6;o>=0;o-=2){for(s=1;s<=25;s+=8)a<<=1,a|=t>>>s+o&1;for(s=1;s<=25;s+=8)a<<=1,a|=e>>>s+o&1}r[n+0]=i>>>0,r[n+1]=a>>>0},t.rip=function(e,t,r,n){for(var i=0,a=0,o=0;o<4;o++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+o&1,i<<=1,i|=e>>>s+o&1;for(o=4;o<8;o++)for(s=24;s>=0;s-=8)a<<=1,a|=t>>>s+o&1,a<<=1,a|=e>>>s+o&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.pc1=function(e,t,r,n){for(var i=0,a=0,o=7;o>=5;o--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+o&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+o&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+o&1;for(o=1;o<=3;o++){for(s=0;s<=24;s+=8)a<<=1,a|=t>>s+o&1;for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1}for(s=0;s<=24;s+=8)a<<=1,a|=e>>s+o&1;r[n+0]=i>>>0,r[n+1]=a>>>0},t.r28shl=function(e,t){return e<>>n[f]&1;for(f=s;f>8,o=255&i;a?r.push(a,o):r.push(o)}return r},n.zero2=i,n.toHex=a,n.encode=function(e,t){return"hex"===t?a(e):e}},function(e,t,r){"use strict";var n=t;n.base=r(26),n.short=r(145),n.mont=r(146),n.edwards=r(147)},function(e,t,r){"use strict";var n=r(8).rotr32;function i(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?o(t,r,n):2===e?a(t,r,n):void 0},t.ch32=i,t.maj32=a,t.p32=o,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(8),i=r(20),a=r(77),o=r(6),s=n.sum32,f=n.sum32_4,u=n.sum32_5,c=a.ch32,l=a.maj32,d=a.s0_256,h=a.s1_256,p=a.g0_256,b=a.g1_256,v=i.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(g,v),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n
/;return n&&"false"!==n&&a.test(e)?e.split(a).map((function(e,t){return i.a.createElement("span",{key:t,className:"multi-line"},e)})):e}function W(e){var t={};return Object.keys(e).filter((function(e){return/(^aria-\w+$|^role$)/.test(e)})).forEach((function(r){t[r]=e[r]})),t}function K(e){var t=e.length;return e.hasOwnProperty?Array.prototype.slice.call(e):new Array(t).fill().map((function(t){return e[t]}))}function V(){return o.a.randomBytes(16)}for(var Y=[],$=0;$<256;++$)Y[$]=($+256).toString(16).substr(1);function X(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||V)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var a=0;a<16;++a)t[n+a]=i[a];return t||function(e,t){var r=t||0,n=Y;return[n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]]].join("")}(i)}!function(e){if(e&&"undefined"!==typeof window){var t=document.createElement("style");t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t)}}('.__react_component_tooltip {\n border-radius: 3px;\n display: inline-block;\n font-size: 13px;\n left: -999em;\n opacity: 0;\n padding: 8px 21px;\n position: fixed;\n pointer-events: none;\n transition: opacity 0.3s ease-out;\n top: -999em;\n visibility: hidden;\n z-index: 999;\n}\n.__react_component_tooltip.allow_hover, .__react_component_tooltip.allow_click {\n pointer-events: auto;\n}\n.__react_component_tooltip::before, .__react_component_tooltip::after {\n content: "";\n width: 0;\n height: 0;\n position: absolute;\n}\n.__react_component_tooltip.show {\n opacity: 0.9;\n margin-top: 0;\n margin-left: 0;\n visibility: visible;\n}\n.__react_component_tooltip.place-top::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n bottom: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-bottom::before {\n border-left: 10px solid transparent;\n border-right: 10px solid transparent;\n top: -8px;\n left: 50%;\n margin-left: -10px;\n}\n.__react_component_tooltip.place-left::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n right: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip.place-right::before {\n border-top: 6px solid transparent;\n border-bottom: 6px solid transparent;\n left: -8px;\n top: 50%;\n margin-top: -5px;\n}\n.__react_component_tooltip .multi-line {\n display: block;\n padding: 2px 0;\n text-align: center;\n}');var Q,G,J,Z={dark:{text:"#fff",background:"#222",border:"transparent",arrow:"#222"},success:{text:"#fff",background:"#8DC572",border:"transparent",arrow:"#8DC572"},warning:{text:"#fff",background:"#F0AD4E",border:"transparent",arrow:"#F0AD4E"},error:{text:"#fff",background:"#BE6464",border:"transparent",arrow:"#BE6464"},info:{text:"#fff",background:"#337AB7",border:"transparent",arrow:"#337AB7"},light:{text:"#222",background:"#fff",border:"transparent",arrow:"#fff"}};function ee(e,t,r,n){return function(e,t){var r=t.text,n=t.background,i=t.border,a=t.arrow;return"\n \t.".concat(e," {\n\t color: ").concat(r,";\n\t background: ").concat(n,";\n\t border: 1px solid ").concat(i,";\n \t}\n\n \t.").concat(e,".place-top {\n margin-top: -10px;\n }\n .").concat(e,".place-top::before {\n border-top: 8px solid ").concat(i,";\n }\n .").concat(e,".place-top::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n border-top-color: ").concat(a,";\n border-top-style: solid;\n border-top-width: 6px;\n }\n\n .").concat(e,".place-bottom {\n margin-top: 10px;\n }\n .").concat(e,".place-bottom::before {\n border-bottom: 8px solid ").concat(i,";\n }\n .").concat(e,".place-bottom::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n border-bottom-color: ").concat(a,";\n border-bottom-style: solid;\n border-bottom-width: 6px;\n }\n\n .").concat(e,".place-left {\n margin-left: -10px;\n }\n .").concat(e,".place-left::before {\n border-left: 8px solid ").concat(i,";\n }\n .").concat(e,".place-left::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n border-left-color: ").concat(a,";\n border-left-style: solid;\n border-left-width: 6px;\n }\n\n .").concat(e,".place-right {\n margin-left: 10px;\n }\n .").concat(e,".place-right::before {\n border-right: 8px solid ").concat(i,";\n }\n .").concat(e,".place-right::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n border-right-color: ").concat(a,";\n border-right-style: solid;\n border-right-width: 6px;\n }\n ")}(e,function(e,t,r){var n=e.text,i=e.background,a=e.border,o=e.arrow?e.arrow:e.background,s=function(e){return Z[e]?d({},Z[e]):void 0}(t);n&&(s.text=n);i&&(s.background=i);r&&(s.border=a||("light"===t?"black":"white"));o&&(s.arrow=o);return s}(t,r,n))}var te,re=function(e){e.hide=function(e){C(A.HIDE,{target:e})},e.rebuild=function(){C(A.REBUILD)},e.show=function(e){C(A.SHOW,{target:e})},e.prototype.globalRebuild=function(){this.mount&&(this.unbindListener(),this.bindListener())},e.prototype.globalShow=function(e){if(this.mount){var t=!!(e&&e.detail&&e.detail.target);this.showTooltip({currentTarget:t&&e.detail.target},!0)}},e.prototype.globalHide=function(e){if(this.mount){var t=!!(e&&e.detail&&e.detail.target);this.hideTooltip({currentTarget:t&&e.detail.target},t)}}}(Q=function(e){e.prototype.bindWindowEvents=function(e){window.removeEventListener(A.HIDE,this.globalHide),window.addEventListener(A.HIDE,this.globalHide,!1),window.removeEventListener(A.REBUILD,this.globalRebuild),window.addEventListener(A.REBUILD,this.globalRebuild,!1),window.removeEventListener(A.SHOW,this.globalShow),window.addEventListener(A.SHOW,this.globalShow,!1),e&&(window.removeEventListener("resize",this.onWindowResize),window.addEventListener("resize",this.onWindowResize,!1))},e.prototype.unbindWindowEvents=function(){window.removeEventListener(A.HIDE,this.globalHide),window.removeEventListener(A.REBUILD,this.globalRebuild),window.removeEventListener(A.SHOW,this.globalShow),window.removeEventListener("resize",this.onWindowResize)},e.prototype.onWindowResize=function(){this.mount&&this.hideTooltip()}}(Q=function(e){e.prototype.isCustomEvent=function(e){return this.state.event||!!e.getAttribute("data-event")},e.prototype.customBindListener=function(e){var t=this,r=this.state,n=r.event,i=r.eventOff,a=e.getAttribute("data-event")||n,o=e.getAttribute("data-event-off")||i;a.split(" ").forEach((function(r){e.removeEventListener(r,I.get(e,r));var n=N.bind(t,o);I.set(e,r,n),e.addEventListener(r,n,!1)})),o&&o.split(" ").forEach((function(r){e.removeEventListener(r,t.hideTooltip),e.addEventListener(r,t.hideTooltip,!1)}))},e.prototype.customUnbindListener=function(e){var t=this.state,r=t.event,n=t.eventOff,i=r||e.getAttribute("data-event"),a=n||e.getAttribute("data-event-off");e.removeEventListener(i,I.get(e,r)),a&&e.removeEventListener(a,this.hideTooltip)}}(Q=function(e){e.prototype.isCapture=function(e){return e&&"true"===e.getAttribute("data-iscapture")||this.props.isCapture||!1}}(Q=function(e){e.prototype.getEffect=function(e){return e.getAttribute("data-effect")||this.props.effect||"float"}}(Q=function(e){e.prototype.isBodyMode=function(){return!!this.props.bodyMode},e.prototype.bindBodyListener=function(e){var t=this,r=this.state,n=r.event,i=r.eventOff,a=r.possibleCustomEvents,o=r.possibleCustomEventsOff,s=j(),f=B(e,"data-event"),u=B(e,"data-event-off");null!=n&&(f[n]=!0),null!=i&&(u[i]=!0),a.split(" ").forEach((function(e){return f[e]=!0})),o.split(" ").forEach((function(e){return u[e]=!0})),this.unbindBodyListener(s);var c=this.bodyModeListeners={};for(var l in null==n&&(c.mouseover=R.bind(this,this.showTooltip,{}),c.mousemove=R.bind(this,this.updateTooltip,{respectEffect:!0}),c.mouseout=R.bind(this,this.hideTooltip,{})),f)c[l]=R.bind(this,(function(e){var r=e.currentTarget.getAttribute("data-event-off")||i;N.call(t,r,e)}),{customEvent:!0});for(var d in u)c[d]=R.bind(this,this.hideTooltip,{customEvent:!0});for(var h in c)s.addEventListener(h,c[h])},e.prototype.unbindBodyListener=function(e){e=e||j();var t=this.bodyModeListeners;for(var r in t)e.removeEventListener(r,t[r])}}((J=G=function(e){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(r=b(this,h(t).call(this,e))).state={uuid:"t"+X(),place:e.place||"top",desiredPlace:e.place||"top",type:"dark",effect:"float",show:!1,border:!1,customColors:{},offset:{},extraClass:"",html:!1,delayHide:0,delayShow:0,event:e.event||null,eventOff:e.eventOff||null,currentEvent:null,currentTarget:null,ariaProps:W(e),isEmptyTip:!1,disable:!1,possibleCustomEvents:e.possibleCustomEvents||"",possibleCustomEventsOff:e.possibleCustomEventsOff||"",originTooltip:null,isMultiline:!1},r.bind(["showTooltip","updateTooltip","hideTooltip","hideTooltipOnScroll","getTooltipContent","globalRebuild","globalShow","globalHide","onWindowResize","mouseOnToolTip"]),r.mount=!0,r.delayShowLoop=null,r.delayHideLoop=null,r.delayReshow=null,r.intervalUpdateContent=null,r}return function(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&p(e,t)}(t,e),f(t,null,[{key:"propTypes",get:function(){return{uuid:P.string,children:P.any,place:P.string,type:P.string,effect:P.string,offset:P.object,multiline:P.bool,border:P.bool,textColor:P.string,backgroundColor:P.string,borderColor:P.string,arrowColor:P.string,insecure:P.bool,class:P.string,className:P.string,id:P.string,html:P.bool,delayHide:P.number,delayUpdate:P.number,delayShow:P.number,event:P.string,eventOff:P.string,watchWindow:P.bool,isCapture:P.bool,globalEventOff:P.string,getContent:P.any,afterShow:P.func,afterHide:P.func,overridePosition:P.func,disable:P.bool,scrollHide:P.bool,resizeHide:P.bool,wrapper:P.string,bodyMode:P.bool,possibleCustomEvents:P.string,possibleCustomEventsOff:P.string,clickable:P.bool}}}]),f(t,[{key:"bind",value:function(e){var t=this;e.forEach((function(e){t[e]=t[e].bind(t)}))}},{key:"componentDidMount",value:function(){var e=this.props,t=(e.insecure,e.resizeHide);this.bindListener(),this.bindWindowEvents(t)}},{key:"componentWillUnmount",value:function(){this.mount=!1,this.clearTimer(),this.unbindListener(),this.removeScrollListener(),this.unbindWindowEvents()}},{key:"mouseOnToolTip",value:function(){return!(!this.state.show||!this.tooltipRef)&&(this.tooltipRef.matches||(this.tooltipRef.msMatchesSelector?this.tooltipRef.matches=this.tooltipRef.msMatchesSelector:this.tooltipRef.matches=this.tooltipRef.mozMatchesSelector),this.tooltipRef.matches(":hover"))}},{key:"getTargetArray",value:function(e){var t,r=[];if(e){var n=e.replace(/\\/g,"\\\\").replace(/"/g,'\\"');t='[data-tip][data-for="'.concat(n,'"]')}else t="[data-tip]:not([data-for])";return K(document.getElementsByTagName("*")).filter((function(e){return e.shadowRoot})).forEach((function(e){r=r.concat(K(e.shadowRoot.querySelectorAll(t)))})),r.concat(K(document.querySelectorAll(t)))}},{key:"bindListener",value:function(){var e=this,t=this.props,r=t.id,n=t.globalEventOff,i=t.isCapture,a=this.getTargetArray(r);a.forEach((function(t){null===t.getAttribute("currentItem")&&t.setAttribute("currentItem","false"),e.unbindBasicListener(t),e.isCustomEvent(t)&&e.customUnbindListener(t)})),this.isBodyMode()?this.bindBodyListener(a):a.forEach((function(t){var r=e.isCapture(t),n=e.getEffect(t);e.isCustomEvent(t)?e.customBindListener(t):(t.addEventListener("mouseenter",e.showTooltip,r),"float"===n&&t.addEventListener("mousemove",e.updateTooltip,r),t.addEventListener("mouseleave",e.hideTooltip,r))})),n&&(window.removeEventListener(n,this.hideTooltip),window.addEventListener(n,this.hideTooltip,i)),this.bindRemovalTracker()}},{key:"unbindListener",value:function(){var e=this,t=this.props,r=t.id,n=t.globalEventOff;this.isBodyMode()?this.unbindBodyListener():this.getTargetArray(r).forEach((function(t){e.unbindBasicListener(t),e.isCustomEvent(t)&&e.customUnbindListener(t)})),n&&window.removeEventListener(n,this.hideTooltip),this.unbindRemovalTracker()}},{key:"unbindBasicListener",value:function(e){var t=this.isCapture(e);e.removeEventListener("mouseenter",this.showTooltip,t),e.removeEventListener("mousemove",this.updateTooltip,t),e.removeEventListener("mouseleave",this.hideTooltip,t)}},{key:"getTooltipContent",value:function(){var e,t=this.props,r=t.getContent,n=t.children;return r&&(e=Array.isArray(r)?r[0]&&r[0](this.state.originTooltip):r(this.state.originTooltip)),q(this.state.originTooltip,n,e,this.state.isMultiline)}},{key:"isEmptyTip",value:function(e){return"string"===typeof e&&""===e||null===e}},{key:"showTooltip",value:function(e,t){if(!t||this.getTargetArray(this.props.id).some((function(t){return t===e.currentTarget}))){var r=this.props,n=r.multiline,i=r.getContent,a=e.currentTarget.getAttribute("data-tip"),o=e.currentTarget.getAttribute("data-multiline")||n||!1,s=e instanceof window.FocusEvent||t,f=!0;e.currentTarget.getAttribute("data-scroll-hide")?f="true"===e.currentTarget.getAttribute("data-scroll-hide"):null!=this.props.scrollHide&&(f=this.props.scrollHide);var u=e.currentTarget.getAttribute("data-place")||this.props.place||"top",c=s?"solid":this.getEffect(e.currentTarget),l=e.currentTarget.getAttribute("data-offset")||this.props.offset||{},d=L(e,e.currentTarget,this.tooltipRef,u,u,c,l);d.position&&this.props.overridePosition&&(d.position=this.props.overridePosition(d.position,e,e.currentTarget,this.tooltipRef,u,u,c,l));var h=d.isNewState?d.newState.place:u;this.clearTimer();var p=e.currentTarget,b=this.state.show?p.getAttribute("data-delay-update")||this.props.delayUpdate:0,v=this,m=function(){v.setState({originTooltip:a,isMultiline:o,desiredPlace:u,place:h,type:p.getAttribute("data-type")||v.props.type||"dark",customColors:{text:p.getAttribute("data-text-color")||v.props.textColor||null,background:p.getAttribute("data-background-color")||v.props.backgroundColor||null,border:p.getAttribute("data-border-color")||v.props.borderColor||null,arrow:p.getAttribute("data-arrow-color")||v.props.arrowColor||null},effect:c,offset:l,html:(p.getAttribute("data-html")?"true"===p.getAttribute("data-html"):v.props.html)||!1,delayShow:p.getAttribute("data-delay-show")||v.props.delayShow||0,delayHide:p.getAttribute("data-delay-hide")||v.props.delayHide||0,delayUpdate:p.getAttribute("data-delay-update")||v.props.delayUpdate||0,border:(p.getAttribute("data-border")?"true"===p.getAttribute("data-border"):v.props.border)||!1,extraClass:p.getAttribute("data-class")||v.props.class||v.props.className||"",disable:(p.getAttribute("data-tip-disable")?"true"===p.getAttribute("data-tip-disable"):v.props.disable)||!1,currentTarget:p},(function(){f&&v.addScrollListener(v.state.currentTarget),v.updateTooltip(e),i&&Array.isArray(i)&&(v.intervalUpdateContent=setInterval((function(){if(v.mount){var e=v.props.getContent,t=q(a,"",e[0](),o),r=v.isEmptyTip(t);v.setState({isEmptyTip:r}),v.updatePosition()}}),i[1]))}))};b?this.delayReshow=setTimeout(m,b):m()}}},{key:"updateTooltip",value:function(e){var t=this,r=this.state,n=r.delayShow,i=r.disable,a=this.props.afterShow,o=this.getTooltipContent(),s=parseInt(n,10),f=e.currentTarget||e.target;if(!this.mouseOnToolTip()&&!this.isEmptyTip(o)&&!i){var u=function(){if(Array.isArray(o)&&o.length>0||o){var r=!t.state.show;t.setState({currentEvent:e,currentTarget:f,show:!0},(function(){t.updatePosition(),r&&a&&a(e)}))}};clearTimeout(this.delayShowLoop),n?this.delayShowLoop=setTimeout(u,s):u()}}},{key:"listenForTooltipExit",value:function(){this.state.show&&this.tooltipRef&&this.tooltipRef.addEventListener("mouseleave",this.hideTooltip)}},{key:"removeListenerForTooltipExit",value:function(){this.state.show&&this.tooltipRef&&this.tooltipRef.removeEventListener("mouseleave",this.hideTooltip)}},{key:"hideTooltip",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{isScroll:!1},i=this.state.disable,a=n.isScroll,o=a?0:this.state.delayHide,s=this.props.afterHide,f=this.getTooltipContent();if(this.mount&&!this.isEmptyTip(f)&&!i){if(t){var u=this.getTargetArray(this.props.id),c=u.some((function(t){return t===e.currentTarget}));if(!c||!this.state.show)return}var l=function(){var t=r.state.show;r.mouseOnToolTip()?r.listenForTooltipExit():(r.removeListenerForTooltipExit(),r.setState({show:!1},(function(){r.removeScrollListener(),t&&s&&s(e)})))};this.clearTimer(),o?this.delayHideLoop=setTimeout(l,parseInt(o,10)):l()}}},{key:"hideTooltipOnScroll",value:function(e,t){this.hideTooltip(e,t,{isScroll:!0})}},{key:"addScrollListener",value:function(e){var t=this.isCapture(e);window.addEventListener("scroll",this.hideTooltipOnScroll,t)}},{key:"removeScrollListener",value:function(){window.removeEventListener("scroll",this.hideTooltipOnScroll)}},{key:"updatePosition",value:function(){var e=this,t=this.state,r=t.currentEvent,n=t.currentTarget,i=t.place,a=t.desiredPlace,o=t.effect,s=t.offset,f=this.tooltipRef,u=L(r,n,f,i,a,o,s);if(u.position&&this.props.overridePosition&&(u.position=this.props.overridePosition(u.position,r,n,f,i,a,o,s)),u.isNewState)return this.setState(u.newState,(function(){e.updatePosition()}));f.style.left=u.position.left+"px",f.style.top=u.position.top+"px"}},{key:"clearTimer",value:function(){clearTimeout(this.delayShowLoop),clearTimeout(this.delayHideLoop),clearTimeout(this.delayReshow),clearInterval(this.intervalUpdateContent)}},{key:"hasCustomColors",value:function(){var e=this;return Boolean(Object.keys(this.state.customColors).find((function(t){return"border"!==t&&e.state.customColors[t]}))||this.state.border&&this.state.customColors.border)}},{key:"render",value:function(){var e=this,r=this.state,n=r.extraClass,a=r.html,o=r.ariaProps,s=r.disable,f=this.getTooltipContent(),u=this.isEmptyTip(f),l=ee(this.state.uuid,this.state.customColors,this.state.type,this.state.border),d="__react_component_tooltip"+" ".concat(this.state.uuid)+(!this.state.show||s||u?"":" show")+(this.state.border?" border":"")+" place-".concat(this.state.place)+" type-".concat(this.hasCustomColors()?"custom":this.state.type)+(this.props.delayUpdate?" allow_hover":"")+(this.props.clickable?" allow_click":""),h=this.props.wrapper;t.supportedWrappers.indexOf(h)<0&&(h=t.defaultProps.wrapper);var p=[d,n].filter(Boolean).join(" ");if(a){var b="".concat(f,"\n");return i.a.createElement(h,c({className:"".concat(p),id:this.props.id,ref:function(t){return e.tooltipRef=t}},o,{"data-id":"tooltip",dangerouslySetInnerHTML:{__html:b}}))}return i.a.createElement(h,c({className:"".concat(p),id:this.props.id},o,{ref:function(t){return e.tooltipRef=t},"data-id":"tooltip"}),i.a.createElement("style",{dangerouslySetInnerHTML:{__html:l}}),f)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=t.ariaProps,n=W(e);return Object.keys(n).some((function(e){return n[e]!==r[e]}))?d({},t,{ariaProps:n}):null}}]),t}(i.a.Component),u(G,"defaultProps",{insecure:!0,resizeHide:!0,wrapper:"div",clickable:!1}),u(G,"supportedWrappers",["div","span"]),u(G,"displayName","ReactTooltip"),(te=Q=J).prototype.bindRemovalTracker=function(){var e=this,t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;if(null!=t){var r=new t((function(t){for(var r=0;rs?s:o+16383));1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!==typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,f=o.length;s>1,c=-7,l=r?i-1:0,d=r?-1:1,h=e[t+l];for(l+=d,a=h&(1<<-c)-1,h>>=-c,c+=s;c>0;a=256*a+e[t+l],l+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+l],l+=d,c-=8);if(0===a)a=1-u;else{if(a===f)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),a-=u}return(h?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,f,u=8*a-i-1,c=(1<>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:a-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-o))<1&&(o--,f*=2),(t+=o+l>=1?d/f:d*Math.pow(2,1-l))*f>=2&&(o++,f/=2),o+l>=c?(s=0,o=c):o+l>=1?(s=(t*f-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(o=o<0;e[r+h]=255&o,h+=p,o/=256,u-=8);e[r+h-p]|=128*b}},,function(e,t,r){"use strict";var n=r(32).Buffer,i=r(105);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,a=n.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=a,i=s,t.copy(r,i),s+=o.data.length,o=o.next;return a},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},,function(e,t,r){(function(e){var n="undefined"!==typeof e&&e||"undefined"!==typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(107),t.setImmediate="undefined"!==typeof self&&self.setImmediate||"undefined"!==typeof e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!==typeof self&&self.clearImmediate||"undefined"!==typeof e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(9))},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i=1,a={},o=!1,s=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){c(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?function(){var t="setImmediate$"+Math.random()+"$",r=function(r){r.source===e&&"string"===typeof r.data&&0===r.data.indexOf(t)&&c(+r.data.slice(t.length))};e.addEventListener?e.addEventListener("message",r,!1):e.attachEvent("onmessage",r),n=function(r){e.postMessage(t+r,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){c(e.data)},n=function(t){e.port2.postMessage(t)}}():s&&"onreadystatechange"in s.createElement("script")?function(){var e=s.documentElement;n=function(t){var r=s.createElement("script");r.onreadystatechange=function(){c(t),r.onreadystatechange=null,e.removeChild(r),r=null},e.appendChild(r)}}():n=function(e){setTimeout(c,0,e)},f.setImmediate=function(e){"function"!==typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r
/;\n if (!multiline || multiline === \"false\" || !regexp.test(tip)) {\n // No trim(), so that user can keep their input\n return tip;\n }\n\n // Multiline tooltip content\n return tip.split(regexp).map((d, i) => {\n return (\n \n {d}\n \n );\n });\n}\n","/**\n * Support aria- and role in ReactTooltip\n *\n * @params props {Object}\n * @return {Object}\n */\nexport function parseAria(props) {\n const ariaObj = {};\n Object.keys(props)\n .filter(prop => {\n // aria-xxx and role is acceptable\n return /(^aria-\\w+$|^role$)/.test(prop);\n })\n .forEach(prop => {\n ariaObj[prop] = props[prop];\n });\n\n return ariaObj;\n}\n","/**\n * Convert nodelist to array\n * @see https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/core/createArrayFromMixed.js#L24\n * NodeLists are functions in Safari\n */\n\nexport default function(nodeList) {\n const length = nodeList.length;\n if (nodeList.hasOwnProperty) {\n return Array.prototype.slice.call(nodeList);\n }\n return new Array(length).fill().map(index => nodeList[index]);\n}\n","import crypto from 'crypto';\nexport default function rng() {\n return crypto.randomBytes(16);\n}","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n\n return [bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], '-', bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]], bth[buf[i++]]].join('');\n}\n\nexport default bytesToUuid;","import rng from './rng.js';\nimport bytesToUuid from './bytesToUuid.js';\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof options == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n\n options = options || {};\n var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nexport default v4;","/**\n * Default pop-up style values (text color, background color).\n */\nconst defaultColors = {\n \"dark\": { \"text\": \"#fff\", \"background\": \"#222\", \"border\": \"transparent\", \"arrow\": \"#222\" },\n \"success\": { \"text\": \"#fff\", \"background\": \"#8DC572\", \"border\": \"transparent\", \"arrow\": \"#8DC572\" },\n \"warning\": { \"text\": \"#fff\", \"background\": \"#F0AD4E\", \"border\": \"transparent\", \"arrow\": \"#F0AD4E\" },\n \"error\": { \"text\": \"#fff\", \"background\": \"#BE6464\", \"border\": \"transparent\", \"arrow\": \"#BE6464\" },\n \"info\": { \"text\": \"#fff\", \"background\": \"#337AB7\", \"border\": \"transparent\", \"arrow\": \"#337AB7\" },\n \"light\": { \"text\": \"#222\", \"background\": \"#fff\", \"border\": \"transparent\", \"arrow\": \"#fff\" }\n};\n\nexport function getDefaultPopupColors (type) {\n\treturn defaultColors[type] ? { ...defaultColors[type] } : undefined;\n}\n","import { getDefaultPopupColors } from \"./defaultStyles\";\n\n/**\n* Generates the specific tooltip style for use on render.\n*/\nexport function generateTooltipStyle(uuid, customColors, type, hasBorder) {\n\treturn generateStyle(uuid, getPopupColors(customColors, type, hasBorder));\n}\n\n/**\n * Generates the tooltip style rules based on the element-specified \"data-type\" property.\n */\nfunction generateStyle(uuid, colors) {\n const textColor = colors.text;\n const backgroundColor = colors.background;\n const borderColor = colors.border;\n const arrowColor = colors.arrow;\n\n return `\n \t.${uuid} {\n\t color: ${textColor};\n\t background: ${backgroundColor};\n\t border: 1px solid ${borderColor};\n \t}\n\n \t.${uuid}.place-top {\n margin-top: -10px;\n }\n .${uuid}.place-top::before {\n border-top: 8px solid ${borderColor};\n }\n .${uuid}.place-top::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n bottom: -6px;\n left: 50%;\n margin-left: -8px;\n border-top-color: ${arrowColor};\n border-top-style: solid;\n border-top-width: 6px;\n }\n\n .${uuid}.place-bottom {\n margin-top: 10px;\n }\n .${uuid}.place-bottom::before {\n border-bottom: 8px solid ${borderColor};\n }\n .${uuid}.place-bottom::after {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n top: -6px;\n left: 50%;\n margin-left: -8px;\n border-bottom-color: ${arrowColor};\n border-bottom-style: solid;\n border-bottom-width: 6px;\n }\n\n .${uuid}.place-left {\n margin-left: -10px;\n }\n .${uuid}.place-left::before {\n border-left: 8px solid ${borderColor};\n }\n .${uuid}.place-left::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n right: -6px;\n top: 50%;\n margin-top: -4px;\n border-left-color: ${arrowColor};\n border-left-style: solid;\n border-left-width: 6px;\n }\n\n .${uuid}.place-right {\n margin-left: 10px;\n }\n .${uuid}.place-right::before {\n border-right: 8px solid ${borderColor};\n }\n .${uuid}.place-right::after {\n border-top: 5px solid transparent;\n border-bottom: 5px solid transparent;\n left: -6px;\n top: 50%;\n margin-top: -4px;\n border-right-color: ${arrowColor};\n border-right-style: solid;\n border-right-width: 6px;\n }\n `;\n}\n\nfunction getPopupColors(customColors, type, hasBorder) {\n const textColor = customColors.text;\n const backgroundColor = customColors.background;\n const borderColor = customColors.border;\n const arrowColor = customColors.arrow ? customColors.arrow : customColors.background;\n\n const colors = getDefaultPopupColors(type);\n\n if (textColor) {\n colors.text = textColor;\n }\n\n if (backgroundColor) {\n colors.background = backgroundColor;\n }\n\n if (hasBorder) {\n if (borderColor) {\n colors.border = borderColor;\n } else {\n colors.border = (type === \"light\" ? \"black\" : \"white\");\n }\n }\n\n if (arrowColor) {\n colors.arrow = arrowColor;\n }\n\n return colors;\n}\n","/**\n * Tracking target removing from DOM.\n * It's necessary to hide tooltip when it's target disappears.\n * Otherwise, the tooltip would be shown forever until another target\n * is triggered.\n *\n * If MutationObserver is not available, this feature just doesn't work.\n */\n\n// https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/\nconst getMutationObserverClass = () => {\n return (\n window.MutationObserver ||\n window.WebKitMutationObserver ||\n window.MozMutationObserver\n );\n};\n\nexport default function(target) {\n target.prototype.bindRemovalTracker = function() {\n const MutationObserver = getMutationObserverClass();\n if (MutationObserver == null) return;\n\n const observer = new MutationObserver(mutations => {\n for (let m1 = 0; m1 < mutations.length; m1++) {\n const mutation = mutations[m1];\n for (let m2 = 0; m2 < mutation.removedNodes.length; m2++) {\n const element = mutation.removedNodes[m2];\n if (element === this.state.currentTarget) {\n this.hideTooltip();\n return;\n }\n }\n }\n });\n\n observer.observe(window.document, { childList: true, subtree: true });\n\n this.removalTracker = observer;\n };\n\n target.prototype.unbindRemovalTracker = function() {\n if (this.removalTracker) {\n this.removalTracker.disconnect();\n this.removalTracker = null;\n }\n };\n}\n","/* eslint-disable no-unused-vars, dot-notation */\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\n\n/* Decorators */\nimport staticMethods from \"./decorators/staticMethods\";\nimport windowListener from \"./decorators/windowListener\";\nimport customEvent from \"./decorators/customEvent\";\nimport isCapture from \"./decorators/isCapture\";\nimport getEffect from \"./decorators/getEffect\";\nimport bodyMode from \"./decorators/bodyMode\";\nimport trackRemoval from \"./decorators/trackRemoval\";\n\n/* Utils */\nimport getPosition from \"./utils/getPosition\";\nimport getTipContent from \"./utils/getTipContent\";\nimport { parseAria } from \"./utils/aria\";\nimport nodeListToArray from \"./utils/nodeListToArray\";\nimport { generateUUID } from \"./utils/uuid\";\n\n/* CSS */\nimport \"./index.scss\";\nimport { generateTooltipStyle } from \"./decorators/styler\";\n\n@staticMethods\n@windowListener\n@customEvent\n@isCapture\n@getEffect\n@bodyMode\n@trackRemoval\nclass ReactTooltip extends React.Component {\n static get propTypes() {\n return {\n uuid: PropTypes.string,\n children: PropTypes.any,\n place: PropTypes.string,\n type: PropTypes.string,\n effect: PropTypes.string,\n offset: PropTypes.object,\n multiline: PropTypes.bool,\n border: PropTypes.bool,\n textColor: PropTypes.string,\n backgroundColor: PropTypes.string,\n borderColor: PropTypes.string,\n arrowColor: PropTypes.string,\n insecure: PropTypes.bool,\n class: PropTypes.string,\n className: PropTypes.string,\n id: PropTypes.string,\n html: PropTypes.bool,\n delayHide: PropTypes.number,\n delayUpdate: PropTypes.number,\n delayShow: PropTypes.number,\n event: PropTypes.string,\n eventOff: PropTypes.string,\n watchWindow: PropTypes.bool,\n isCapture: PropTypes.bool,\n globalEventOff: PropTypes.string,\n getContent: PropTypes.any,\n afterShow: PropTypes.func,\n afterHide: PropTypes.func,\n overridePosition: PropTypes.func,\n disable: PropTypes.bool,\n scrollHide: PropTypes.bool,\n resizeHide: PropTypes.bool,\n wrapper: PropTypes.string,\n bodyMode: PropTypes.bool,\n possibleCustomEvents: PropTypes.string,\n possibleCustomEventsOff: PropTypes.string,\n clickable: PropTypes.bool\n };\n }\n\n static defaultProps = {\n insecure: true,\n resizeHide: true,\n wrapper: \"div\",\n clickable: false\n };\n\n static supportedWrappers = [\"div\", \"span\"];\n\n static displayName = \"ReactTooltip\";\n\n constructor(props) {\n super(props);\n\n this.state = {\n uuid: generateUUID(),\n place: props.place || \"top\", // Direction of tooltip\n desiredPlace: props.place || \"top\",\n type: \"dark\", // Color theme of tooltip\n effect: \"float\", // float or fixed\n show: false,\n border: false,\n customColors: {},\n offset: {},\n extraClass: \"\",\n html: false,\n delayHide: 0,\n delayShow: 0,\n event: props.event || null,\n eventOff: props.eventOff || null,\n currentEvent: null, // Current mouse event\n currentTarget: null, // Current target of mouse event\n ariaProps: parseAria(props), // aria- and role attributes\n isEmptyTip: false,\n disable: false,\n possibleCustomEvents: props.possibleCustomEvents || \"\",\n possibleCustomEventsOff: props.possibleCustomEventsOff || \"\",\n originTooltip: null,\n isMultiline: false\n };\n\n this.bind([\n \"showTooltip\",\n \"updateTooltip\",\n \"hideTooltip\",\n \"hideTooltipOnScroll\",\n \"getTooltipContent\",\n \"globalRebuild\",\n \"globalShow\",\n \"globalHide\",\n \"onWindowResize\",\n \"mouseOnToolTip\"\n ]);\n\n this.mount = true;\n this.delayShowLoop = null;\n this.delayHideLoop = null;\n this.delayReshow = null;\n this.intervalUpdateContent = null;\n }\n\n /**\n * For unify the bind and unbind listener\n */\n bind(methodArray) {\n methodArray.forEach(method => {\n this[method] = this[method].bind(this);\n });\n }\n\n componentDidMount() {\n const { insecure, resizeHide } = this.props;\n\n this.bindListener(); // Bind listener for tooltip\n this.bindWindowEvents(resizeHide); // Bind global event for static method\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n const { ariaProps } = prevState;\n const newAriaProps = parseAria(nextProps);\n const isChanged = Object.keys(newAriaProps).some(props => {\n return newAriaProps[props] !== ariaProps[props];\n });\n if (!isChanged) {\n return null;\n }\n return {\n ...prevState,\n ariaProps: newAriaProps\n };\n }\n\n componentWillUnmount() {\n this.mount = false;\n\n this.clearTimer();\n\n this.unbindListener();\n this.removeScrollListener();\n this.unbindWindowEvents();\n }\n\n /**\n * Return if the mouse is on the tooltip.\n * @returns {boolean} true - mouse is on the tooltip\n */\n mouseOnToolTip() {\n const { show } = this.state;\n\n if (show && this.tooltipRef) {\n /* old IE or Firefox work around */\n if (!this.tooltipRef.matches) {\n /* old IE work around */\n if (this.tooltipRef.msMatchesSelector) {\n this.tooltipRef.matches = this.tooltipRef.msMatchesSelector;\n } else {\n /* old Firefox work around */\n this.tooltipRef.matches = this.tooltipRef.mozMatchesSelector;\n }\n }\n return this.tooltipRef.matches(\":hover\");\n }\n return false;\n }\n\n /**\n * Pick out corresponded target elements\n */\n getTargetArray(id) {\n let targetArray = [];\n let selector;\n if (!id) {\n selector = \"[data-tip]:not([data-for])\";\n } else {\n const escaped = id.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, '\\\\\"');\n selector = `[data-tip][data-for=\"${escaped}\"]`;\n }\n\n // Scan document for shadow DOM elements\n nodeListToArray(document.getElementsByTagName(\"*\"))\n .filter(element => element.shadowRoot)\n .forEach(element => {\n targetArray = targetArray.concat(\n nodeListToArray(element.shadowRoot.querySelectorAll(selector))\n );\n });\n return targetArray.concat(\n nodeListToArray(document.querySelectorAll(selector))\n );\n }\n\n /**\n * Bind listener to the target elements\n * These listeners used to trigger showing or hiding the tooltip\n */\n bindListener() {\n const { id, globalEventOff, isCapture } = this.props;\n const targetArray = this.getTargetArray(id);\n\n targetArray.forEach(target => {\n if (target.getAttribute(\"currentItem\") === null) {\n target.setAttribute(\"currentItem\", \"false\");\n }\n this.unbindBasicListener(target);\n if (this.isCustomEvent(target)) {\n this.customUnbindListener(target);\n }\n });\n\n if (this.isBodyMode()) {\n this.bindBodyListener(targetArray);\n } else {\n targetArray.forEach(target => {\n const isCaptureMode = this.isCapture(target);\n const effect = this.getEffect(target);\n if (this.isCustomEvent(target)) {\n this.customBindListener(target);\n return;\n }\n\n target.addEventListener(\"mouseenter\", this.showTooltip, isCaptureMode);\n if (effect === \"float\") {\n target.addEventListener(\n \"mousemove\",\n this.updateTooltip,\n isCaptureMode\n );\n }\n target.addEventListener(\"mouseleave\", this.hideTooltip, isCaptureMode);\n });\n }\n\n // Global event to hide tooltip\n if (globalEventOff) {\n window.removeEventListener(globalEventOff, this.hideTooltip);\n window.addEventListener(globalEventOff, this.hideTooltip, isCapture);\n }\n\n // Track removal of targetArray elements from DOM\n this.bindRemovalTracker();\n }\n\n /**\n * Unbind listeners on target elements\n */\n unbindListener() {\n const { id, globalEventOff } = this.props;\n if (this.isBodyMode()) {\n this.unbindBodyListener();\n } else {\n const targetArray = this.getTargetArray(id);\n targetArray.forEach(target => {\n this.unbindBasicListener(target);\n if (this.isCustomEvent(target)) this.customUnbindListener(target);\n });\n }\n\n if (globalEventOff)\n window.removeEventListener(globalEventOff, this.hideTooltip);\n this.unbindRemovalTracker();\n }\n\n /**\n * Invoke this before bind listener and unmount the component\n * it is necessary to invoke this even when binding custom event\n * so that the tooltip can switch between custom and default listener\n */\n unbindBasicListener(target) {\n const isCaptureMode = this.isCapture(target);\n target.removeEventListener(\"mouseenter\", this.showTooltip, isCaptureMode);\n target.removeEventListener(\"mousemove\", this.updateTooltip, isCaptureMode);\n target.removeEventListener(\"mouseleave\", this.hideTooltip, isCaptureMode);\n }\n\n getTooltipContent() {\n const { getContent, children } = this.props;\n\n // Generate tooltip content\n let content;\n if (getContent) {\n if (Array.isArray(getContent)) {\n content = getContent[0] && getContent[0](this.state.originTooltip);\n } else {\n content = getContent(this.state.originTooltip);\n }\n }\n\n return getTipContent(\n this.state.originTooltip,\n children,\n content,\n this.state.isMultiline\n );\n }\n\n isEmptyTip(placeholder) {\n return (\n (typeof placeholder === \"string\" && placeholder === \"\") ||\n placeholder === null\n );\n }\n\n /**\n * When mouse enter, show the tooltip\n */\n showTooltip(e, isGlobalCall) {\n if (isGlobalCall) {\n // Don't trigger other elements belongs to other ReactTooltip\n const targetArray = this.getTargetArray(this.props.id);\n const isMyElement = targetArray.some(ele => ele === e.currentTarget);\n if (!isMyElement) return;\n }\n // Get the tooltip content\n // calculate in this phrase so that tip width height can be detected\n const { multiline, getContent } = this.props;\n const originTooltip = e.currentTarget.getAttribute(\"data-tip\");\n const isMultiline =\n e.currentTarget.getAttribute(\"data-multiline\") || multiline || false;\n\n // If it is focus event or called by ReactTooltip.show, switch to `solid` effect\n const switchToSolid = e instanceof window.FocusEvent || isGlobalCall;\n\n // if it needs to skip adding hide listener to scroll\n let scrollHide = true;\n if (e.currentTarget.getAttribute(\"data-scroll-hide\")) {\n scrollHide = e.currentTarget.getAttribute(\"data-scroll-hide\") === \"true\";\n } else if (this.props.scrollHide != null) {\n scrollHide = this.props.scrollHide;\n }\n\n // Make sure the correct place is set\n const desiredPlace =\n e.currentTarget.getAttribute(\"data-place\") || this.props.place || \"top\";\n const effect =\n (switchToSolid && \"solid\") || this.getEffect(e.currentTarget);\n const offset =\n e.currentTarget.getAttribute(\"data-offset\") || this.props.offset || {};\n const result = getPosition(\n e,\n e.currentTarget,\n this.tooltipRef,\n desiredPlace,\n desiredPlace,\n effect,\n offset\n );\n if (result.position && this.props.overridePosition) {\n result.position = this.props.overridePosition(\n result.position,\n e,\n e.currentTarget,\n this.tooltipRef,\n desiredPlace,\n desiredPlace,\n effect,\n offset\n );\n }\n\n const place = result.isNewState ? result.newState.place : desiredPlace;\n\n // To prevent previously created timers from triggering\n this.clearTimer();\n\n const target = e.currentTarget;\n\n const reshowDelay = this.state.show ? (target.getAttribute(\"data-delay-update\") || this.props.delayUpdate) : 0;\n\n const self = this;\n\n const updateState = function updateState() {\n self.setState({\n originTooltip: originTooltip,\n isMultiline: isMultiline,\n desiredPlace: desiredPlace,\n place: place,\n type: target.getAttribute(\"data-type\") ||\n self.props.type ||\n \"dark\",\n customColors: {\n text: target.getAttribute(\"data-text-color\") ||\n self.props.textColor ||\n null,\n background: target.getAttribute(\"data-background-color\") ||\n self.props.backgroundColor ||\n null,\n border: target.getAttribute(\"data-border-color\") ||\n self.props.borderColor ||\n null,\n arrow: target.getAttribute(\"data-arrow-color\") ||\n self.props.arrowColor ||\n null\n },\n effect: effect,\n offset: offset,\n html: (target.getAttribute(\"data-html\") ? target.getAttribute(\"data-html\") === \"true\" : self.props.html) ||\n false,\n delayShow: target.getAttribute(\"data-delay-show\") ||\n self.props.delayShow ||\n 0,\n delayHide: target.getAttribute(\"data-delay-hide\") ||\n self.props.delayHide ||\n 0,\n delayUpdate: target.getAttribute(\"data-delay-update\") ||\n self.props.delayUpdate ||\n 0,\n border: (target.getAttribute(\"data-border\") ?\n target.getAttribute(\"data-border\") === \"true\" :\n self.props.border) ||\n false,\n extraClass: target.getAttribute(\"data-class\") ||\n self.props.class ||\n self.props.className ||\n \"\",\n disable: (target.getAttribute(\"data-tip-disable\") ?\n target.getAttribute(\"data-tip-disable\") === \"true\" :\n self.props.disable) ||\n false,\n currentTarget: target\n }, () => {\n if (scrollHide) {\n self.addScrollListener(self.state.currentTarget);\n }\n\n self.updateTooltip(e);\n\n if (getContent && Array.isArray(getContent)) {\n self.intervalUpdateContent = setInterval(() => {\n if (self.mount) {\n const { getContent } = self.props;\n const placeholder = getTipContent(originTooltip, \"\", getContent[0](), isMultiline);\n const isEmptyTip = self.isEmptyTip(placeholder);\n self.setState({ isEmptyTip });\n self.updatePosition();\n }\n }, getContent[1]);\n }\n }\n );\n };\n\n // If there is no delay call immediately, don't allow events to get in first.\n if (reshowDelay) {\n this.delayReshow = setTimeout(updateState, reshowDelay);\n } else {\n updateState();\n }\n }\n\n /**\n * When mouse hover, update tool tip\n */\n updateTooltip(e) {\n const { delayShow, disable } = this.state;\n const { afterShow } = this.props;\n const placeholder = this.getTooltipContent();\n const delayTime = parseInt(delayShow, 10);\n const eventTarget = e.currentTarget || e.target;\n\n // Check if the mouse is actually over the tooltip, if so don't hide the tooltip\n if (this.mouseOnToolTip()) {\n return;\n }\n\n // if the tooltip is empty, disable the tooltip\n if (this.isEmptyTip(placeholder) || disable) {\n return;\n }\n\n const updateState = () => {\n if ((Array.isArray(placeholder) && placeholder.length > 0) || placeholder) {\n const isInvisible = !this.state.show;\n this.setState({\n currentEvent: e,\n currentTarget: eventTarget,\n show: true\n }, () => {\n this.updatePosition();\n if (isInvisible && afterShow) {\n afterShow(e);\n }\n }\n );\n }\n };\n\n clearTimeout(this.delayShowLoop);\n if (delayShow) {\n this.delayShowLoop = setTimeout(updateState, delayTime);\n } else {\n updateState();\n }\n }\n\n /*\n * If we're mousing over the tooltip remove it when we leave.\n */\n listenForTooltipExit() {\n const { show } = this.state;\n\n if (show && this.tooltipRef) {\n this.tooltipRef.addEventListener(\"mouseleave\", this.hideTooltip);\n }\n }\n\n removeListenerForTooltipExit() {\n const { show } = this.state;\n\n if (show && this.tooltipRef) {\n this.tooltipRef.removeEventListener(\"mouseleave\", this.hideTooltip);\n }\n }\n\n /**\n * When mouse leave, hide tooltip\n */\n hideTooltip(e, hasTarget, options = { isScroll: false }) {\n const { disable } = this.state;\n const { isScroll } = options;\n const delayHide = isScroll ? 0 : this.state.delayHide;\n const { afterHide } = this.props;\n const placeholder = this.getTooltipContent();\n if (!this.mount) return;\n if (this.isEmptyTip(placeholder) || disable) return; // if the tooltip is empty, disable the tooltip\n if (hasTarget) {\n // Don't trigger other elements belongs to other ReactTooltip\n const targetArray = this.getTargetArray(this.props.id);\n const isMyElement = targetArray.some(ele => ele === e.currentTarget);\n if (!isMyElement || !this.state.show) return;\n }\n\n const resetState = () => {\n const isVisible = this.state.show;\n // Check if the mouse is actually over the tooltip, if so don't hide the tooltip\n if (this.mouseOnToolTip()) {\n this.listenForTooltipExit();\n return;\n }\n\n this.removeListenerForTooltipExit();\n\n this.setState({ show: false }, () => {\n this.removeScrollListener();\n if (isVisible && afterHide) {\n afterHide(e);\n }\n });\n };\n\n this.clearTimer();\n if (delayHide) {\n this.delayHideLoop = setTimeout(resetState, parseInt(delayHide, 10));\n } else {\n resetState();\n }\n }\n\n /**\n * When scroll, hide tooltip\n */\n hideTooltipOnScroll(event, hasTarget) {\n this.hideTooltip(event, hasTarget, { isScroll: true });\n }\n\n /**\n * Add scroll event listener when tooltip show\n * automatically hide the tooltip when scrolling\n */\n addScrollListener(currentTarget) {\n const isCaptureMode = this.isCapture(currentTarget);\n window.addEventListener(\"scroll\", this.hideTooltipOnScroll, isCaptureMode);\n }\n\n removeScrollListener() {\n window.removeEventListener(\"scroll\", this.hideTooltipOnScroll);\n }\n\n // Calculation the position\n updatePosition() {\n const {\n currentEvent,\n currentTarget,\n place,\n desiredPlace,\n effect,\n offset\n } = this.state;\n const node = this.tooltipRef;\n const result = getPosition(\n currentEvent,\n currentTarget,\n node,\n place,\n desiredPlace,\n effect,\n offset\n );\n if (result.position && this.props.overridePosition) {\n result.position = this.props.overridePosition(\n result.position,\n currentEvent,\n currentTarget,\n node,\n place,\n desiredPlace,\n effect,\n offset\n );\n }\n\n if (result.isNewState) {\n // Switch to reverse placement\n return this.setState(result.newState, () => {\n this.updatePosition();\n });\n }\n\n // Set tooltip position\n node.style.left = result.position.left + \"px\";\n node.style.top = result.position.top + \"px\";\n }\n\n /**\n * CLear all kinds of timeout of interval\n */\n clearTimer() {\n clearTimeout(this.delayShowLoop);\n clearTimeout(this.delayHideLoop);\n clearTimeout(this.delayReshow);\n clearInterval(this.intervalUpdateContent);\n }\n\n hasCustomColors() {\n return Boolean(\n Object.keys(this.state.customColors).find(color => color !== \"border\" && this.state.customColors[color]) ||\n (this.state.border && this.state.customColors[\"border\"])\n );\n }\n\n render() {\n const { extraClass, html, ariaProps, disable } = this.state;\n const content = this.getTooltipContent();\n const isEmptyTip = this.isEmptyTip(content);\n const style = generateTooltipStyle(this.state.uuid, this.state.customColors, this.state.type, this.state.border);\n\n const tooltipClass =\n \"__react_component_tooltip\" +\n ` ${this.state.uuid}` +\n (this.state.show && !disable && !isEmptyTip ? \" show\" : \"\") +\n (this.state.border ? \" border\" : \"\") +\n ` place-${this.state.place}` + // top, bottom, left, right\n ` type-${(this.hasCustomColors() ? \"custom\" : this.state.type)}` + // dark, success, warning, error, info, light, custom\n (this.props.delayUpdate ? \" allow_hover\" : \"\") +\n (this.props.clickable ? \" allow_click\" : \"\");\n\n let Wrapper = this.props.wrapper;\n\n if (ReactTooltip.supportedWrappers.indexOf(Wrapper) < 0) {\n Wrapper = ReactTooltip.defaultProps.wrapper;\n }\n\n const wrapperClassName = [tooltipClass, extraClass].filter(Boolean).join(\" \");\n\n if (html) {\n const htmlContent = `${content}\\n`;\n\n return (\n