react-tooltip 5.8.2-beta.2 → 5.8.2-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- import require$$0, { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect, useLayoutEffect } from 'react';
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { createContext, useState, useCallback, useMemo, useContext, useRef, useEffect, useLayoutEffect } from 'react';
2
3
 
3
4
  function getAlignment(placement) {
4
5
  return placement.split('-')[1];
@@ -1509,926 +1510,6 @@ const computePosition = (reference, floating, options) => {
1509
1510
  });
1510
1511
  };
1511
1512
 
1512
- var jsxRuntime = {exports: {}};
1513
-
1514
- var reactJsxRuntime_development = {};
1515
-
1516
- /** @license React v16.14.0
1517
- * react-jsx-runtime.development.js
1518
- *
1519
- * Copyright (c) Facebook, Inc. and its affiliates.
1520
- *
1521
- * This source code is licensed under the MIT license found in the
1522
- * LICENSE file in the root directory of this source tree.
1523
- */
1524
-
1525
- (function (exports) {
1526
-
1527
- {
1528
- (function() {
1529
-
1530
- var React = require$$0;
1531
-
1532
- // ATTENTION
1533
- // When adding new symbols to this file,
1534
- // Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
1535
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
1536
- // nor polyfill, then a plain number is used for performance.
1537
- var REACT_ELEMENT_TYPE = 0xeac7;
1538
- var REACT_PORTAL_TYPE = 0xeaca;
1539
- exports.Fragment = 0xeacb;
1540
- var REACT_STRICT_MODE_TYPE = 0xeacc;
1541
- var REACT_PROFILER_TYPE = 0xead2;
1542
- var REACT_PROVIDER_TYPE = 0xeacd;
1543
- var REACT_CONTEXT_TYPE = 0xeace;
1544
- var REACT_FORWARD_REF_TYPE = 0xead0;
1545
- var REACT_SUSPENSE_TYPE = 0xead1;
1546
- var REACT_SUSPENSE_LIST_TYPE = 0xead8;
1547
- var REACT_MEMO_TYPE = 0xead3;
1548
- var REACT_LAZY_TYPE = 0xead4;
1549
- var REACT_BLOCK_TYPE = 0xead9;
1550
- var REACT_SERVER_BLOCK_TYPE = 0xeada;
1551
- var REACT_FUNDAMENTAL_TYPE = 0xead5;
1552
- var REACT_DEBUG_TRACING_MODE_TYPE = 0xeae1;
1553
- var REACT_LEGACY_HIDDEN_TYPE = 0xeae3;
1554
-
1555
- if (typeof Symbol === 'function' && Symbol.for) {
1556
- var symbolFor = Symbol.for;
1557
- REACT_ELEMENT_TYPE = symbolFor('react.element');
1558
- REACT_PORTAL_TYPE = symbolFor('react.portal');
1559
- exports.Fragment = symbolFor('react.fragment');
1560
- REACT_STRICT_MODE_TYPE = symbolFor('react.strict_mode');
1561
- REACT_PROFILER_TYPE = symbolFor('react.profiler');
1562
- REACT_PROVIDER_TYPE = symbolFor('react.provider');
1563
- REACT_CONTEXT_TYPE = symbolFor('react.context');
1564
- REACT_FORWARD_REF_TYPE = symbolFor('react.forward_ref');
1565
- REACT_SUSPENSE_TYPE = symbolFor('react.suspense');
1566
- REACT_SUSPENSE_LIST_TYPE = symbolFor('react.suspense_list');
1567
- REACT_MEMO_TYPE = symbolFor('react.memo');
1568
- REACT_LAZY_TYPE = symbolFor('react.lazy');
1569
- REACT_BLOCK_TYPE = symbolFor('react.block');
1570
- REACT_SERVER_BLOCK_TYPE = symbolFor('react.server.block');
1571
- REACT_FUNDAMENTAL_TYPE = symbolFor('react.fundamental');
1572
- symbolFor('react.scope');
1573
- symbolFor('react.opaque.id');
1574
- REACT_DEBUG_TRACING_MODE_TYPE = symbolFor('react.debug_trace_mode');
1575
- symbolFor('react.offscreen');
1576
- REACT_LEGACY_HIDDEN_TYPE = symbolFor('react.legacy_hidden');
1577
- }
1578
-
1579
- var MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1580
- var FAUX_ITERATOR_SYMBOL = '@@iterator';
1581
- function getIteratorFn(maybeIterable) {
1582
- if (maybeIterable === null || typeof maybeIterable !== 'object') {
1583
- return null;
1584
- }
1585
-
1586
- var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
1587
-
1588
- if (typeof maybeIterator === 'function') {
1589
- return maybeIterator;
1590
- }
1591
-
1592
- return null;
1593
- }
1594
-
1595
- var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1596
-
1597
- function error(format) {
1598
- {
1599
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1600
- args[_key2 - 1] = arguments[_key2];
1601
- }
1602
-
1603
- printWarning('error', format, args);
1604
- }
1605
- }
1606
-
1607
- function printWarning(level, format, args) {
1608
- // When changing this logic, you might want to also
1609
- // update consoleWithStackDev.www.js as well.
1610
- {
1611
- var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
1612
- var stack = '';
1613
-
1614
- if (currentlyValidatingElement) {
1615
- var name = getComponentName(currentlyValidatingElement.type);
1616
- var owner = currentlyValidatingElement._owner;
1617
- stack += describeComponentFrame(name, currentlyValidatingElement._source, owner && getComponentName(owner.type));
1618
- }
1619
-
1620
- stack += ReactDebugCurrentFrame.getStackAddendum();
1621
-
1622
- if (stack !== '') {
1623
- format += '%s';
1624
- args = args.concat([stack]);
1625
- }
1626
-
1627
- var argsWithFormat = args.map(function (item) {
1628
- return '' + item;
1629
- }); // Careful: RN currently depends on this prefix
1630
-
1631
- argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
1632
- // breaks IE9: https://github.com/facebook/react/issues/13610
1633
- // eslint-disable-next-line react-internal/no-production-logging
1634
-
1635
- Function.prototype.apply.call(console[level], console, argsWithFormat);
1636
- }
1637
- }
1638
-
1639
- // Filter certain DOM attributes (e.g. src, href) if their values are empty strings.
1640
-
1641
- var enableScopeAPI = false; // Experimental Create Event Handle API.
1642
-
1643
- function isValidElementType(type) {
1644
- if (typeof type === 'string' || typeof type === 'function') {
1645
- return true;
1646
- } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
1647
-
1648
-
1649
- if (type === exports.Fragment || type === REACT_PROFILER_TYPE || type === REACT_DEBUG_TRACING_MODE_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_LEGACY_HIDDEN_TYPE || enableScopeAPI ) {
1650
- return true;
1651
- }
1652
-
1653
- if (typeof type === 'object' && type !== null) {
1654
- if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_BLOCK_TYPE || type[0] === REACT_SERVER_BLOCK_TYPE) {
1655
- return true;
1656
- }
1657
- }
1658
-
1659
- return false;
1660
- }
1661
-
1662
-
1663
- var BEFORE_SLASH_RE = /^(.*)[\\\/]/;
1664
- function describeComponentFrame (name, source, ownerName) {
1665
- var sourceInfo = '';
1666
-
1667
- if (source) {
1668
- var path = source.fileName;
1669
- var fileName = path.replace(BEFORE_SLASH_RE, '');
1670
-
1671
- {
1672
- // In DEV, include code for a common special case:
1673
- // prefer "folder/index.js" instead of just "index.js".
1674
- if (/^index\./.test(fileName)) {
1675
- var match = path.match(BEFORE_SLASH_RE);
1676
-
1677
- if (match) {
1678
- var pathBeforeSlash = match[1];
1679
-
1680
- if (pathBeforeSlash) {
1681
- var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');
1682
- fileName = folderName + '/' + fileName;
1683
- }
1684
- }
1685
- }
1686
- }
1687
-
1688
- sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';
1689
- } else if (ownerName) {
1690
- sourceInfo = ' (created by ' + ownerName + ')';
1691
- }
1692
-
1693
- return '\n in ' + (name || 'Unknown') + sourceInfo;
1694
- }
1695
-
1696
- var Resolved = 1;
1697
- function refineResolvedLazyComponent(lazyComponent) {
1698
- return lazyComponent._status === Resolved ? lazyComponent._result : null;
1699
- }
1700
-
1701
- function getWrappedName(outerType, innerType, wrapperName) {
1702
- var functionName = innerType.displayName || innerType.name || '';
1703
- return outerType.displayName || (functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName);
1704
- }
1705
-
1706
- function getComponentName(type) {
1707
- if (type == null) {
1708
- // Host root, text node or just invalid type.
1709
- return null;
1710
- }
1711
-
1712
- {
1713
- if (typeof type.tag === 'number') {
1714
- error('Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');
1715
- }
1716
- }
1717
-
1718
- if (typeof type === 'function') {
1719
- return type.displayName || type.name || null;
1720
- }
1721
-
1722
- if (typeof type === 'string') {
1723
- return type;
1724
- }
1725
-
1726
- switch (type) {
1727
- case exports.Fragment:
1728
- return 'Fragment';
1729
-
1730
- case REACT_PORTAL_TYPE:
1731
- return 'Portal';
1732
-
1733
- case REACT_PROFILER_TYPE:
1734
- return "Profiler";
1735
-
1736
- case REACT_STRICT_MODE_TYPE:
1737
- return 'StrictMode';
1738
-
1739
- case REACT_SUSPENSE_TYPE:
1740
- return 'Suspense';
1741
-
1742
- case REACT_SUSPENSE_LIST_TYPE:
1743
- return 'SuspenseList';
1744
- }
1745
-
1746
- if (typeof type === 'object') {
1747
- switch (type.$$typeof) {
1748
- case REACT_CONTEXT_TYPE:
1749
- return 'Context.Consumer';
1750
-
1751
- case REACT_PROVIDER_TYPE:
1752
- return 'Context.Provider';
1753
-
1754
- case REACT_FORWARD_REF_TYPE:
1755
- return getWrappedName(type, type.render, 'ForwardRef');
1756
-
1757
- case REACT_MEMO_TYPE:
1758
- return getComponentName(type.type);
1759
-
1760
- case REACT_BLOCK_TYPE:
1761
- return getComponentName(type.render);
1762
-
1763
- case REACT_LAZY_TYPE:
1764
- {
1765
- var thenable = type;
1766
- var resolvedThenable = refineResolvedLazyComponent(thenable);
1767
-
1768
- if (resolvedThenable) {
1769
- return getComponentName(resolvedThenable);
1770
- }
1771
-
1772
- break;
1773
- }
1774
- }
1775
- }
1776
-
1777
- return null;
1778
- }
1779
-
1780
- var loggedTypeFailures = {};
1781
- ReactSharedInternals.ReactDebugCurrentFrame;
1782
- var currentlyValidatingElement = null;
1783
-
1784
- function setCurrentlyValidatingElement(element) {
1785
- {
1786
- currentlyValidatingElement = element;
1787
- }
1788
- }
1789
-
1790
- function checkPropTypes(typeSpecs, values, location, componentName, element) {
1791
- {
1792
- // $FlowFixMe This is okay but Flow doesn't know it.
1793
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
1794
-
1795
- for (var typeSpecName in typeSpecs) {
1796
- if (has(typeSpecs, typeSpecName)) {
1797
- var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to
1798
- // fail the render phase where it didn't fail before. So we log it.
1799
- // After these have been cleaned up, we'll let them throw.
1800
-
1801
- try {
1802
- // This is intentionally an invariant that gets caught. It's the same
1803
- // behavior as without this statement except with a better message.
1804
- if (typeof typeSpecs[typeSpecName] !== 'function') {
1805
- var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
1806
- err.name = 'Invariant Violation';
1807
- throw err;
1808
- }
1809
-
1810
- error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
1811
- } catch (ex) {
1812
- error$1 = ex;
1813
- }
1814
-
1815
- if (error$1 && !(error$1 instanceof Error)) {
1816
- setCurrentlyValidatingElement(element);
1817
-
1818
- error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
1819
-
1820
- setCurrentlyValidatingElement(null);
1821
- }
1822
-
1823
- if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
1824
- // Only monitor this failure once because there tends to be a lot of the
1825
- // same error.
1826
- loggedTypeFailures[error$1.message] = true;
1827
- setCurrentlyValidatingElement(element);
1828
-
1829
- error('Failed %s type: %s', location, error$1.message);
1830
-
1831
- setCurrentlyValidatingElement(null);
1832
- }
1833
- }
1834
- }
1835
- }
1836
- }
1837
-
1838
- var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
1839
- var hasOwnProperty = Object.prototype.hasOwnProperty;
1840
- var RESERVED_PROPS = {
1841
- key: true,
1842
- ref: true,
1843
- __self: true,
1844
- __source: true
1845
- };
1846
- var specialPropKeyWarningShown;
1847
- var specialPropRefWarningShown;
1848
- var didWarnAboutStringRefs;
1849
-
1850
- {
1851
- didWarnAboutStringRefs = {};
1852
- }
1853
-
1854
- function hasValidRef(config) {
1855
- {
1856
- if (hasOwnProperty.call(config, 'ref')) {
1857
- var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
1858
-
1859
- if (getter && getter.isReactWarning) {
1860
- return false;
1861
- }
1862
- }
1863
- }
1864
-
1865
- return config.ref !== undefined;
1866
- }
1867
-
1868
- function hasValidKey(config) {
1869
- {
1870
- if (hasOwnProperty.call(config, 'key')) {
1871
- var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
1872
-
1873
- if (getter && getter.isReactWarning) {
1874
- return false;
1875
- }
1876
- }
1877
- }
1878
-
1879
- return config.key !== undefined;
1880
- }
1881
-
1882
- function warnIfStringRefCannotBeAutoConverted(config, self) {
1883
- {
1884
- if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
1885
- var componentName = getComponentName(ReactCurrentOwner.current.type);
1886
-
1887
- if (!didWarnAboutStringRefs[componentName]) {
1888
- error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentName(ReactCurrentOwner.current.type), config.ref);
1889
-
1890
- didWarnAboutStringRefs[componentName] = true;
1891
- }
1892
- }
1893
- }
1894
- }
1895
-
1896
- function defineKeyPropWarningGetter(props, displayName) {
1897
- {
1898
- var warnAboutAccessingKey = function () {
1899
- if (!specialPropKeyWarningShown) {
1900
- specialPropKeyWarningShown = true;
1901
-
1902
- error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
1903
- }
1904
- };
1905
-
1906
- warnAboutAccessingKey.isReactWarning = true;
1907
- Object.defineProperty(props, 'key', {
1908
- get: warnAboutAccessingKey,
1909
- configurable: true
1910
- });
1911
- }
1912
- }
1913
-
1914
- function defineRefPropWarningGetter(props, displayName) {
1915
- {
1916
- var warnAboutAccessingRef = function () {
1917
- if (!specialPropRefWarningShown) {
1918
- specialPropRefWarningShown = true;
1919
-
1920
- error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
1921
- }
1922
- };
1923
-
1924
- warnAboutAccessingRef.isReactWarning = true;
1925
- Object.defineProperty(props, 'ref', {
1926
- get: warnAboutAccessingRef,
1927
- configurable: true
1928
- });
1929
- }
1930
- }
1931
- /**
1932
- * Factory method to create a new React element. This no longer adheres to
1933
- * the class pattern, so do not use new to call it. Also, instanceof check
1934
- * will not work. Instead test $$typeof field against Symbol.for('react.element') to check
1935
- * if something is a React Element.
1936
- *
1937
- * @param {*} type
1938
- * @param {*} props
1939
- * @param {*} key
1940
- * @param {string|object} ref
1941
- * @param {*} owner
1942
- * @param {*} self A *temporary* helper to detect places where `this` is
1943
- * different from the `owner` when React.createElement is called, so that we
1944
- * can warn. We want to get rid of owner and replace string `ref`s with arrow
1945
- * functions, and as long as `this` and owner are the same, there will be no
1946
- * change in behavior.
1947
- * @param {*} source An annotation object (added by a transpiler or otherwise)
1948
- * indicating filename, line number, and/or other information.
1949
- * @internal
1950
- */
1951
-
1952
-
1953
- var ReactElement = function (type, key, ref, self, source, owner, props) {
1954
- var element = {
1955
- // This tag allows us to uniquely identify this as a React Element
1956
- $$typeof: REACT_ELEMENT_TYPE,
1957
- // Built-in properties that belong on the element
1958
- type: type,
1959
- key: key,
1960
- ref: ref,
1961
- props: props,
1962
- // Record the component responsible for creating this element.
1963
- _owner: owner
1964
- };
1965
-
1966
- {
1967
- // The validation flag is currently mutative. We put it on
1968
- // an external backing store so that we can freeze the whole object.
1969
- // This can be replaced with a WeakMap once they are implemented in
1970
- // commonly used development environments.
1971
- element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
1972
- // the validation flag non-enumerable (where possible, which should
1973
- // include every environment we run tests in), so the test framework
1974
- // ignores it.
1975
-
1976
- Object.defineProperty(element._store, 'validated', {
1977
- configurable: false,
1978
- enumerable: false,
1979
- writable: true,
1980
- value: false
1981
- }); // self and source are DEV only properties.
1982
-
1983
- Object.defineProperty(element, '_self', {
1984
- configurable: false,
1985
- enumerable: false,
1986
- writable: false,
1987
- value: self
1988
- }); // Two elements created in two different places should be considered
1989
- // equal for testing purposes and therefore we hide it from enumeration.
1990
-
1991
- Object.defineProperty(element, '_source', {
1992
- configurable: false,
1993
- enumerable: false,
1994
- writable: false,
1995
- value: source
1996
- });
1997
-
1998
- if (Object.freeze) {
1999
- Object.freeze(element.props);
2000
- Object.freeze(element);
2001
- }
2002
- }
2003
-
2004
- return element;
2005
- };
2006
- /**
2007
- * https://github.com/reactjs/rfcs/pull/107
2008
- * @param {*} type
2009
- * @param {object} props
2010
- * @param {string} key
2011
- */
2012
-
2013
- function jsxDEV(type, config, maybeKey, source, self) {
2014
- {
2015
- var propName; // Reserved names are extracted
2016
-
2017
- var props = {};
2018
- var key = null;
2019
- var ref = null; // Currently, key can be spread in as a prop. This causes a potential
2020
- // issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
2021
- // or <div key="Hi" {...props} /> ). We want to deprecate key spread,
2022
- // but as an intermediary step, we will use jsxDEV for everything except
2023
- // <div {...props} key="Hi" />, because we aren't currently able to tell if
2024
- // key is explicitly declared to be undefined or not.
2025
-
2026
- if (maybeKey !== undefined) {
2027
- key = '' + maybeKey;
2028
- }
2029
-
2030
- if (hasValidKey(config)) {
2031
- key = '' + config.key;
2032
- }
2033
-
2034
- if (hasValidRef(config)) {
2035
- ref = config.ref;
2036
- warnIfStringRefCannotBeAutoConverted(config, self);
2037
- } // Remaining properties are added to a new props object
2038
-
2039
-
2040
- for (propName in config) {
2041
- if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
2042
- props[propName] = config[propName];
2043
- }
2044
- } // Resolve default props
2045
-
2046
-
2047
- if (type && type.defaultProps) {
2048
- var defaultProps = type.defaultProps;
2049
-
2050
- for (propName in defaultProps) {
2051
- if (props[propName] === undefined) {
2052
- props[propName] = defaultProps[propName];
2053
- }
2054
- }
2055
- }
2056
-
2057
- if (key || ref) {
2058
- var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
2059
-
2060
- if (key) {
2061
- defineKeyPropWarningGetter(props, displayName);
2062
- }
2063
-
2064
- if (ref) {
2065
- defineRefPropWarningGetter(props, displayName);
2066
- }
2067
- }
2068
-
2069
- return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
2070
- }
2071
- }
2072
-
2073
- var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
2074
- ReactSharedInternals.ReactDebugCurrentFrame;
2075
-
2076
- function setCurrentlyValidatingElement$1(element) {
2077
- currentlyValidatingElement = element;
2078
- }
2079
-
2080
- var propTypesMisspellWarningShown;
2081
-
2082
- {
2083
- propTypesMisspellWarningShown = false;
2084
- }
2085
- /**
2086
- * Verifies the object is a ReactElement.
2087
- * See https://reactjs.org/docs/react-api.html#isvalidelement
2088
- * @param {?object} object
2089
- * @return {boolean} True if `object` is a ReactElement.
2090
- * @final
2091
- */
2092
-
2093
- function isValidElement(object) {
2094
- {
2095
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
2096
- }
2097
- }
2098
-
2099
- function getDeclarationErrorAddendum() {
2100
- {
2101
- if (ReactCurrentOwner$1.current) {
2102
- var name = getComponentName(ReactCurrentOwner$1.current.type);
2103
-
2104
- if (name) {
2105
- return '\n\nCheck the render method of `' + name + '`.';
2106
- }
2107
- }
2108
-
2109
- return '';
2110
- }
2111
- }
2112
-
2113
- function getSourceInfoErrorAddendum(source) {
2114
- {
2115
- if (source !== undefined) {
2116
- var fileName = source.fileName.replace(/^.*[\\\/]/, '');
2117
- var lineNumber = source.lineNumber;
2118
- return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
2119
- }
2120
-
2121
- return '';
2122
- }
2123
- }
2124
- /**
2125
- * Warn if there's no key explicitly set on dynamic arrays of children or
2126
- * object keys are not valid. This allows us to keep track of children between
2127
- * updates.
2128
- */
2129
-
2130
-
2131
- var ownerHasKeyUseWarning = {};
2132
-
2133
- function getCurrentComponentErrorInfo(parentType) {
2134
- {
2135
- var info = getDeclarationErrorAddendum();
2136
-
2137
- if (!info) {
2138
- var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
2139
-
2140
- if (parentName) {
2141
- info = "\n\nCheck the top-level render call using <" + parentName + ">.";
2142
- }
2143
- }
2144
-
2145
- return info;
2146
- }
2147
- }
2148
- /**
2149
- * Warn if the element doesn't have an explicit key assigned to it.
2150
- * This element is in an array. The array could grow and shrink or be
2151
- * reordered. All children that haven't already been validated are required to
2152
- * have a "key" property assigned to it. Error statuses are cached so a warning
2153
- * will only be shown once.
2154
- *
2155
- * @internal
2156
- * @param {ReactElement} element Element that requires a key.
2157
- * @param {*} parentType element's parent's type.
2158
- */
2159
-
2160
-
2161
- function validateExplicitKey(element, parentType) {
2162
- {
2163
- if (!element._store || element._store.validated || element.key != null) {
2164
- return;
2165
- }
2166
-
2167
- element._store.validated = true;
2168
- var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
2169
-
2170
- if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
2171
- return;
2172
- }
2173
-
2174
- ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
2175
- // property, it may be the creator of the child that's responsible for
2176
- // assigning it a key.
2177
-
2178
- var childOwner = '';
2179
-
2180
- if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
2181
- // Give the component that originally created this child.
2182
- childOwner = " It was passed a child from " + getComponentName(element._owner.type) + ".";
2183
- }
2184
-
2185
- setCurrentlyValidatingElement$1(element);
2186
-
2187
- error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
2188
-
2189
- setCurrentlyValidatingElement$1(null);
2190
- }
2191
- }
2192
- /**
2193
- * Ensure that every element either is passed in a static location, in an
2194
- * array with an explicit keys property defined, or in an object literal
2195
- * with valid key property.
2196
- *
2197
- * @internal
2198
- * @param {ReactNode} node Statically passed child of any type.
2199
- * @param {*} parentType node's parent's type.
2200
- */
2201
-
2202
-
2203
- function validateChildKeys(node, parentType) {
2204
- {
2205
- if (typeof node !== 'object') {
2206
- return;
2207
- }
2208
-
2209
- if (Array.isArray(node)) {
2210
- for (var i = 0; i < node.length; i++) {
2211
- var child = node[i];
2212
-
2213
- if (isValidElement(child)) {
2214
- validateExplicitKey(child, parentType);
2215
- }
2216
- }
2217
- } else if (isValidElement(node)) {
2218
- // This element was passed in a valid location.
2219
- if (node._store) {
2220
- node._store.validated = true;
2221
- }
2222
- } else if (node) {
2223
- var iteratorFn = getIteratorFn(node);
2224
-
2225
- if (typeof iteratorFn === 'function') {
2226
- // Entry iterators used to provide implicit keys,
2227
- // but now we print a separate warning for them later.
2228
- if (iteratorFn !== node.entries) {
2229
- var iterator = iteratorFn.call(node);
2230
- var step;
2231
-
2232
- while (!(step = iterator.next()).done) {
2233
- if (isValidElement(step.value)) {
2234
- validateExplicitKey(step.value, parentType);
2235
- }
2236
- }
2237
- }
2238
- }
2239
- }
2240
- }
2241
- }
2242
- /**
2243
- * Given an element, validate that its props follow the propTypes definition,
2244
- * provided by the type.
2245
- *
2246
- * @param {ReactElement} element
2247
- */
2248
-
2249
-
2250
- function validatePropTypes(element) {
2251
- {
2252
- var type = element.type;
2253
-
2254
- if (type === null || type === undefined || typeof type === 'string') {
2255
- return;
2256
- }
2257
-
2258
- var propTypes;
2259
-
2260
- if (typeof type === 'function') {
2261
- propTypes = type.propTypes;
2262
- } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
2263
- // Inner props are checked in the reconciler.
2264
- type.$$typeof === REACT_MEMO_TYPE)) {
2265
- propTypes = type.propTypes;
2266
- } else {
2267
- return;
2268
- }
2269
-
2270
- if (propTypes) {
2271
- // Intentionally inside to avoid triggering lazy initializers:
2272
- var name = getComponentName(type);
2273
- checkPropTypes(propTypes, element.props, 'prop', name, element);
2274
- } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
2275
- propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
2276
-
2277
- var _name = getComponentName(type);
2278
-
2279
- error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
2280
- }
2281
-
2282
- if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
2283
- error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
2284
- }
2285
- }
2286
- }
2287
- /**
2288
- * Given a fragment, validate that it can only be provided with fragment props
2289
- * @param {ReactElement} fragment
2290
- */
2291
-
2292
-
2293
- function validateFragmentProps(fragment) {
2294
- {
2295
- var keys = Object.keys(fragment.props);
2296
-
2297
- for (var i = 0; i < keys.length; i++) {
2298
- var key = keys[i];
2299
-
2300
- if (key !== 'children' && key !== 'key') {
2301
- setCurrentlyValidatingElement$1(fragment);
2302
-
2303
- error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
2304
-
2305
- setCurrentlyValidatingElement$1(null);
2306
- break;
2307
- }
2308
- }
2309
-
2310
- if (fragment.ref !== null) {
2311
- setCurrentlyValidatingElement$1(fragment);
2312
-
2313
- error('Invalid attribute `ref` supplied to `React.Fragment`.');
2314
-
2315
- setCurrentlyValidatingElement$1(null);
2316
- }
2317
- }
2318
- }
2319
-
2320
- function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
2321
- {
2322
- var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
2323
- // succeed and there will likely be errors in render.
2324
-
2325
- if (!validType) {
2326
- var info = '';
2327
-
2328
- if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
2329
- info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
2330
- }
2331
-
2332
- var sourceInfo = getSourceInfoErrorAddendum(source);
2333
-
2334
- if (sourceInfo) {
2335
- info += sourceInfo;
2336
- } else {
2337
- info += getDeclarationErrorAddendum();
2338
- }
2339
-
2340
- var typeString;
2341
-
2342
- if (type === null) {
2343
- typeString = 'null';
2344
- } else if (Array.isArray(type)) {
2345
- typeString = 'array';
2346
- } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
2347
- typeString = "<" + (getComponentName(type.type) || 'Unknown') + " />";
2348
- info = ' Did you accidentally export a JSX literal instead of a component?';
2349
- } else {
2350
- typeString = typeof type;
2351
- }
2352
-
2353
- error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
2354
- }
2355
-
2356
- var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
2357
- // TODO: Drop this when these are no longer allowed as the type argument.
2358
-
2359
- if (element == null) {
2360
- return element;
2361
- } // Skip key warning if the type isn't valid since our key validation logic
2362
- // doesn't expect a non-string/function type and can throw confusing errors.
2363
- // We don't want exception behavior to differ between dev and prod.
2364
- // (Rendering will throw with a helpful message and as soon as the type is
2365
- // fixed, the key warnings will appear.)
2366
-
2367
-
2368
- if (validType) {
2369
- var children = props.children;
2370
-
2371
- if (children !== undefined) {
2372
- if (isStaticChildren) {
2373
- if (Array.isArray(children)) {
2374
- for (var i = 0; i < children.length; i++) {
2375
- validateChildKeys(children[i], type);
2376
- }
2377
-
2378
- if (Object.freeze) {
2379
- Object.freeze(children);
2380
- }
2381
- } else {
2382
- error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
2383
- }
2384
- } else {
2385
- validateChildKeys(children, type);
2386
- }
2387
- }
2388
- }
2389
-
2390
- if (type === exports.Fragment) {
2391
- validateFragmentProps(element);
2392
- } else {
2393
- validatePropTypes(element);
2394
- }
2395
-
2396
- return element;
2397
- }
2398
- } // These two functions exist to still get child warnings in dev
2399
- // even with the prod transform. This means that jsxDEV is purely
2400
- // opt-in behavior for better messages but that we won't stop
2401
- // giving you warnings if you use production apis.
2402
-
2403
- function jsxWithValidationStatic(type, props, key) {
2404
- {
2405
- return jsxWithValidation(type, props, key, true);
2406
- }
2407
- }
2408
- function jsxWithValidationDynamic(type, props, key) {
2409
- {
2410
- return jsxWithValidation(type, props, key, false);
2411
- }
2412
- }
2413
-
2414
- var jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.
2415
- // for now we can ship identical prod functions
2416
-
2417
- var jsxs = jsxWithValidationStatic ;
2418
-
2419
- exports.jsx = jsx;
2420
- exports.jsxs = jsxs;
2421
- })();
2422
- }
2423
- } (reactJsxRuntime_development));
2424
-
2425
- (function (module) {
2426
-
2427
- {
2428
- module.exports = reactJsxRuntime_development;
2429
- }
2430
- } (jsxRuntime));
2431
-
2432
1513
  var classnames = {exports: {}};
2433
1514
 
2434
1515
  /*!
@@ -2514,7 +1595,7 @@ const debounce = (func, wait, immediate) => {
2514
1595
  };
2515
1596
 
2516
1597
  const TooltipContent = ({ content }) => {
2517
- return jsxRuntime.exports.jsx("span", { dangerouslySetInnerHTML: { __html: content } });
1598
+ return jsx("span", { dangerouslySetInnerHTML: { __html: content } });
2518
1599
  };
2519
1600
 
2520
1601
  const DEFAULT_TOOLTIP_ID = 'DEFAULT_TOOLTIP_ID';
@@ -2593,7 +1674,7 @@ const TooltipProvider = ({ children }) => {
2593
1674
  getTooltipData,
2594
1675
  };
2595
1676
  }, [getTooltipData]);
2596
- return jsxRuntime.exports.jsx(TooltipContext.Provider, { value: context, children: children });
1677
+ return jsx(TooltipContext.Provider, { value: context, children: children });
2597
1678
  };
2598
1679
  function useTooltip(tooltipId = DEFAULT_TOOLTIP_ID) {
2599
1680
  return useContext(TooltipContext).getTooltipData(tooltipId);
@@ -2612,7 +1693,7 @@ const TooltipWrapper = ({ tooltipId, children, className, place, content, html,
2612
1693
  detach(anchorRef);
2613
1694
  };
2614
1695
  }, []);
2615
- return (jsxRuntime.exports.jsx("span", { ref: anchorRef, className: classNames('react-tooltip-wrapper', className), "data-tooltip-place": place, "data-tooltip-content": content, "data-tooltip-html": html, "data-tooltip-variant": variant, "data-tooltip-offset": offset, "data-tooltip-wrapper": wrapper, "data-tooltip-events": events, "data-tooltip-position-strategy": positionStrategy, "data-tooltip-delay-show": delayShow, "data-tooltip-delay-hide": delayHide, children: children }));
1696
+ return (jsx("span", { ref: anchorRef, className: classNames('react-tooltip-wrapper', className), "data-tooltip-place": place, "data-tooltip-content": content, "data-tooltip-html": html, "data-tooltip-variant": variant, "data-tooltip-offset": offset, "data-tooltip-wrapper": wrapper, "data-tooltip-events": events, "data-tooltip-position-strategy": positionStrategy, "data-tooltip-delay-show": delayShow, "data-tooltip-delay-hide": delayHide, children: children }));
2616
1697
  };
2617
1698
 
2618
1699
  const computeTooltipPosition = async ({ elementReference = null, tooltipReference = null, tooltipArrowReference = null, place = 'top', offset: offsetValue = 10, strategy = 'absolute', middlewares = [offset(Number(offsetValue)), flip(), shift({ padding: 5 })], }) => {
@@ -2961,7 +2042,14 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
2961
2042
  selector = `[data-tooltip-id='${id}']`;
2962
2043
  }
2963
2044
  const documentObserverCallback = (mutationList) => {
2045
+ const newAnchors = [];
2964
2046
  mutationList.forEach((mutation) => {
2047
+ if (mutation.type === 'attributes' && mutation.attributeName === 'data-tooltip-id') {
2048
+ const newId = mutation.target.getAttribute('data-tooltip-id');
2049
+ if (newId === id) {
2050
+ newAnchors.push(mutation.target);
2051
+ }
2052
+ }
2965
2053
  if (mutation.type !== 'childList') {
2966
2054
  return;
2967
2055
  }
@@ -2981,15 +2069,12 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
2981
2069
  }
2982
2070
  try {
2983
2071
  const elements = [...mutation.addedNodes].filter((node) => node.nodeType === 1);
2984
- const newAnchors = [
2985
- ...elements.filter((element) => element.matches(selector)),
2986
- ...elements.flatMap((element) => [
2987
- ...element.querySelectorAll(selector),
2988
- ]),
2989
- ];
2990
- if (newAnchors.length) {
2991
- setAnchorsBySelect((anchors) => [...anchors, ...newAnchors]);
2992
- }
2072
+ newAnchors.push(
2073
+ // the element itself is an anchor
2074
+ ...elements.filter((element) => element.matches(selector)));
2075
+ newAnchors.push(
2076
+ // the element has children which are anchors
2077
+ ...elements.flatMap((element) => [...element.querySelectorAll(selector)]));
2993
2078
  }
2994
2079
  catch (_a) {
2995
2080
  /**
@@ -2998,10 +2083,18 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
2998
2083
  */
2999
2084
  }
3000
2085
  });
2086
+ if (newAnchors.length) {
2087
+ setAnchorsBySelect((anchors) => [...anchors, ...newAnchors]);
2088
+ }
3001
2089
  };
3002
2090
  const documentObserver = new MutationObserver(documentObserverCallback);
3003
2091
  // watch for anchor being removed from the DOM
3004
- documentObserver.observe(document.body, { attributes: false, childList: true, subtree: true });
2092
+ documentObserver.observe(document.body, {
2093
+ childList: true,
2094
+ subtree: true,
2095
+ attributes: true,
2096
+ attributeFilter: ['data-tooltip-id'],
2097
+ });
3005
2098
  return () => {
3006
2099
  documentObserver.disconnect();
3007
2100
  };
@@ -3089,11 +2182,11 @@ content, html, isOpen, setIsOpen, activeAnchor, setActiveAnchor, }) => {
3089
2182
  }, [id, anchorSelect]);
3090
2183
  const hasContentOrChildren = Boolean(html || content || children);
3091
2184
  const canShow = hasContentOrChildren && show && Object.keys(inlineStyles).length > 0;
3092
- return rendered ? (jsxRuntime.exports.jsxs(WrapperElement, { id: id, role: "tooltip", className: classNames('react-tooltip', styles['tooltip'], styles[variant], className, {
2185
+ return rendered ? (jsxs(WrapperElement, { id: id, role: "tooltip", className: classNames('react-tooltip', styles['tooltip'], styles[variant], className, {
3093
2186
  [styles['show']]: canShow,
3094
2187
  [styles['fixed']]: positionStrategy === 'fixed',
3095
2188
  [styles['clickable']]: clickable,
3096
- }), style: { ...externalStyles, ...inlineStyles }, ref: tooltipRef, children: [(html && jsxRuntime.exports.jsx(TooltipContent, { content: html })) || content || children, jsxRuntime.exports.jsx(WrapperElement, { className: classNames('react-tooltip-arrow', styles['arrow'], classNameArrow, {
2189
+ }), style: { ...externalStyles, ...inlineStyles }, ref: tooltipRef, children: [(html && jsx(TooltipContent, { content: html })) || content || children, jsx(WrapperElement, { className: classNames('react-tooltip-arrow', styles['arrow'], classNameArrow, {
3097
2190
  [styles['no-arrow']]: noArrow,
3098
2191
  }), style: inlineArrowStyles, ref: tooltipArrowRef })] })) : null;
3099
2192
  };
@@ -3272,7 +2365,7 @@ const TooltipController = ({ id, anchorId, anchorSelect, content, html, classNam
3272
2365
  activeAnchor,
3273
2366
  setActiveAnchor: (anchor) => setActiveAnchor(anchor),
3274
2367
  };
3275
- return children ? jsxRuntime.exports.jsx(Tooltip, { ...props, children: children }) : jsxRuntime.exports.jsx(Tooltip, { ...props });
2368
+ return children ? jsx(Tooltip, { ...props, children: children }) : jsx(Tooltip, { ...props });
3276
2369
  };
3277
2370
 
3278
2371
  export { TooltipController as Tooltip, TooltipProvider, TooltipWrapper, autoPlacement, flip, inline, offset, shift, size };