react-tooltip 5.0.0-beta.1 → 5.0.0

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.
Files changed (97) hide show
  1. package/.eslintrc.json +2 -1
  2. package/CODE_OF_CONDUCT.md +53 -0
  3. package/LICENSE +1 -2
  4. package/README.md +30 -152
  5. package/dist/react-tooltip.cjs.js +3 -6
  6. package/dist/react-tooltip.cjs.min.js +1 -1
  7. package/dist/react-tooltip.esm.js +3 -6
  8. package/dist/react-tooltip.esm.min.js +1 -1
  9. package/dist/react-tooltip.umd.js +3 -6
  10. package/dist/react-tooltip.umd.min.js +1 -1
  11. package/jest.config.ts +214 -0
  12. package/package.json +12 -6
  13. package/tsconfig.json +2 -2
  14. package/.editorconfig +0 -25
  15. package/.github/FUNDING.yml +0 -13
  16. package/.github/workflows/lint.yaml +0 -35
  17. package/.github/workflows/pull-request.yaml +0 -11
  18. package/.github/workflows/release.yaml +0 -30
  19. package/.husky/pre-commit +0 -6
  20. package/.vscode/settings.json +0 -27
  21. package/build/dist/react-tooltip.cjs.js +0 -2909
  22. package/build/dist/react-tooltip.cjs.min.js +0 -6
  23. package/build/dist/react-tooltip.css +0 -73
  24. package/build/dist/react-tooltip.esm.js +0 -2901
  25. package/build/dist/react-tooltip.esm.min.js +0 -6
  26. package/build/dist/react-tooltip.min.css +0 -1
  27. package/build/dist/react-tooltip.umd.js +0 -2913
  28. package/build/dist/react-tooltip.umd.min.js +0 -6
  29. package/build/index.css +0 -79
  30. package/build/index.html +0 -19
  31. package/build/index.js +0 -36190
  32. package/docs/README.md +0 -50
  33. package/docs/babel.config.js +0 -3
  34. package/docs/docs/examples/_category_.json +0 -7
  35. package/docs/docs/examples/basic-examples.mdx +0 -68
  36. package/docs/docs/examples/children.mdx +0 -67
  37. package/docs/docs/examples/content.mdx +0 -80
  38. package/docs/docs/examples/delay.mdx +0 -84
  39. package/docs/docs/examples/events.mdx +0 -85
  40. package/docs/docs/examples/get-content.mdx +0 -58
  41. package/docs/docs/examples/html.mdx +0 -75
  42. package/docs/docs/examples/multiline.mdx +0 -91
  43. package/docs/docs/examples/offset.mdx +0 -69
  44. package/docs/docs/examples/place.mdx +0 -55
  45. package/docs/docs/examples/state.mdx +0 -331
  46. package/docs/docs/examples/styling.mdx +0 -388
  47. package/docs/docs/examples/variant.mdx +0 -100
  48. package/docs/docs/getting-started.mdx +0 -100
  49. package/docs/docs/options.mdx +0 -105
  50. package/docs/docs/upgrade-guide/_category_.json +0 -7
  51. package/docs/docs/upgrade-guide/basic-examples-v4-v5.mdx +0 -119
  52. package/docs/docs/upgrade-guide/changelog-v4-v5.md +0 -86
  53. package/docs/docusaurus.config.js +0 -135
  54. package/docs/package.json +0 -47
  55. package/docs/sidebars.js +0 -33
  56. package/docs/src/components/HomepageFeatures/index.tsx +0 -71
  57. package/docs/src/components/HomepageFeatures/styles.module.css +0 -11
  58. package/docs/src/css/custom.css +0 -74
  59. package/docs/src/pages/index.module.css +0 -35
  60. package/docs/src/pages/index.tsx +0 -45
  61. package/docs/src/pages/markdown-page.md +0 -7
  62. package/docs/static/.nojekyll +0 -0
  63. package/docs/static/img/Octocat.jpg +0 -0
  64. package/docs/static/img/Octocat.png +0 -0
  65. package/docs/static/img/Octocat.svg +0 -9
  66. package/docs/static/img/android-chrome-192x192.png +0 -0
  67. package/docs/static/img/android-chrome-512x512.png +0 -0
  68. package/docs/static/img/apple-touch-icon.png +0 -0
  69. package/docs/static/img/docusaurus.png +0 -0
  70. package/docs/static/img/favicon-16x16.png +0 -0
  71. package/docs/static/img/favicon-32x32.png +0 -0
  72. package/docs/static/img/favicon-old.ico +0 -0
  73. package/docs/static/img/favicon.ico +0 -0
  74. package/docs/static/img/github.svg +0 -1
  75. package/docs/static/img/happy-face-tooltip.png +0 -0
  76. package/docs/static/img/happy-face-tooltip.svg +0 -21
  77. package/docs/static/img/logo-dinossaur.svg +0 -1
  78. package/docs/static/img/logo.png +0 -0
  79. package/docs/static/img/logo.svg +0 -21
  80. package/docs/static/img/only-tooltip-top.png +0 -0
  81. package/docs/static/img/only-tooltip-top.svg +0 -4
  82. package/docs/static/img/only-tooltip.png +0 -0
  83. package/docs/static/img/only-tooltip.svg +0 -4
  84. package/docs/static/img/site.webmanifest +0 -1
  85. package/docs/static/img/undraw_docusaurus_mountain.svg +0 -171
  86. package/docs/static/img/undraw_docusaurus_react.svg +0 -170
  87. package/docs/static/img/undraw_docusaurus_tree.svg +0 -40
  88. package/docs/tsconfig.json +0 -7
  89. package/docs/yarn.lock +0 -7599
  90. package/example-v5/package.json +0 -21
  91. package/example-v5/public/index.html +0 -20
  92. package/example-v5/public/manifest.json +0 -8
  93. package/example-v5/src/App.jsx +0 -908
  94. package/example-v5/src/index.css +0 -238
  95. package/example-v5/src/index.js +0 -15
  96. package/example-v5/src/index.scss +0 -251
  97. package/public/index.html +0 -19
package/.eslintrc.json CHANGED
@@ -7,7 +7,8 @@
7
7
  "plugin:prettier/recommended"
8
8
  ],
9
9
  "env": {
10
- "browser": true
10
+ "browser": true,
11
+ "jest": true
11
12
  },
12
13
  "parser": "@typescript-eslint/parser",
13
14
  "plugins": ["react", "react-hooks", "prettier", "@typescript-eslint"],
@@ -0,0 +1,53 @@
1
+ ## Code of Conduct
2
+
3
+ ### Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ### Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ - Demonstrating empathy and kindness toward other people
14
+ - Being respectful of differing opinions, viewpoints, and experiences
15
+ - Giving and gracefully accepting constructive feedback
16
+ - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ - Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ - The use of sexualized language or imagery, and sexual attention or advances of any kind
22
+ - Trolling, insulting or derogatory comments, and personal or political attacks
23
+ - Public or private harassment
24
+ - Publishing others’ private information, such as a physical or email address, without their explicit permission
25
+ - Other conduct which could reasonably be considered inappropriate in a professional setting
26
+
27
+ ### Enforcement Responsibilities
28
+
29
+ Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32
+
33
+ ### Scope
34
+
35
+ This Code of Conduct applies within all community spaces and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36
+
37
+ ### Enforcement
38
+
39
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team responsible for enforcement. All complaints will be reviewed and investigated promptly and fairly.
40
+
41
+ All project maintainers are obligated to respect the privacy and security of the reporter of any incident.
42
+
43
+ Project maintainers who do not follow or enforce the Code of Conduct in good
44
+ faith may face temporary or permanent repercussions as determined by other
45
+ members of the project's leadership.
46
+
47
+ ### Attribution
48
+
49
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1,
50
+ available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct/][version]
51
+
52
+ [homepage]: http://contributor-covenant.org
53
+ [version]: https://www.contributor-covenant.org/version/2/1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015 Wang Zixiao
3
+ Copyright (c) 2022 ReactTooltip Team Github
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
-
package/README.md CHANGED
@@ -11,9 +11,11 @@
11
11
 
12
12
  ## Demo
13
13
 
14
- [![Edit ReactTooltip](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/heuristic-curran-bddeu?fontsize=14&hidenavigation=1&theme=dark)
14
+ [![Edit ReactTooltip](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/still-monad-yfi4fn?fontsize=14&hidenavigation=1&theme=dark)
15
15
 
16
- Or see it on [Github Page](https://reacttooltip.github.io/react-tooltip/).
16
+ Documentation for V4 - [Github Page](https://reacttooltip.github.io/react-tooltip/).
17
+
18
+ Documentation for V5 - [ReactTooltip](https://react-tooltip.com/docs/getting-started).
17
19
 
18
20
  ## Installation
19
21
 
@@ -34,67 +36,44 @@ yarn add react-tooltip
34
36
  1 . Require react-tooltip after installation
35
37
 
36
38
  ```js
37
- import ReactTooltip from 'react-tooltip';
39
+ import { Tooltip } from 'react-tooltip'
38
40
  ```
39
41
 
40
- 2 . Add data-tip = "your placeholder" to your element
42
+ or if you want to still use the name ReactTooltip as V4:
43
+
44
+ ```js
45
+ import { Tooltip as ReactTooltip } from 'react-tooltip'
46
+ ```
47
+
48
+ 2 . Add data-tooltip-content = "your placeholder" to your element
41
49
 
42
50
  ```jsx
43
- <p data-tip="hello world">Tooltip</p>
51
+ <p id="my-element" data-tooltip-content="hello world">
52
+ Tooltip
53
+ </p>
44
54
  ```
45
55
 
46
56
  3 . Include react-tooltip component
47
57
 
48
58
  ```jsx
49
- <ReactTooltip />
59
+ <ReactTooltip anchorId="my-element" />
50
60
  ```
51
61
 
52
62
  ### Standalone
53
63
 
54
- You can import `node_modules/react-tooltip/dist/index.js` into your page. Please make sure that you have already imported `react` and `react-dom` into your page.
64
+ You can import `node_modules/react-tooltip/dist/react-tooltip.[mode].js` into your page. Please make sure that you have already imported `react` and `react-dom` into your page.
65
+
66
+ mode: `esm` `cjs` `umd`
67
+
68
+ If you want to use default ReactTooltip styles, don't forget to import the styles: `node_modules/react-tooltip/dist/react-tooltip.css`
69
+
70
+ PS: all the files has a minified version and a not minified version.
71
+
72
+ ![image](https://user-images.githubusercontent.com/9615850/205637814-c0ef01ae-bd77-4e7f-b4bf-df502c71e5c3.png)
55
73
 
56
74
  ## Options
57
75
 
58
- Notes:
59
-
60
- - The tooltip sets `type: dark` `place: top` `effect: float` as **default** attributes. You don't have to add these options if you don't want to change the defaults
61
- - The option you set on `<ReactTooltip />` component will be implemented on every tooltip in a same page: `<ReactTooltip effect="solid" />`
62
- - The option you set on a specific element, for example: `<a data-type="warning"></a>` will only affect this specific tooltip
63
-
64
- | Global | Specific | Type | Values | Description |
65
- | :------------------- | :-------------------- | :------------ | :------------------------------------------------------------------------------------------------------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
66
- | place | data-place | String | "top", "right", "bottom", "left", or comma-separated e.g. "left,right" | placement - can specify a comma-separated list of preferences that will be attempted in order |
67
- | type | data-type | String | dark, success, warning, error, info, light | theme |
68
- | effect | data-effect | String | float, solid | behaviour of tooltip |
69
- | event | data-event | String | e.g. click | custom event to trigger tooltip |
70
- | eventOff | data-event-off | String | e.g. click | custom event to hide tooltip (only makes effect after setting event attribute) |
71
- | globalEventOff | | String | e.g. click | global event to hide tooltip (global only) |
72
- | isCapture | data-iscapture | Bool | true, false | when set to true, custom event's propagation mode will be capture |
73
- | offset | data-offset | Object | { top?: number, right?: number, bottom?: number, left?: number } | `data-offset="{'top': 10, 'left': 10}"` for specific and `offset={{top: 10, left: 10}}` for global |
74
- | padding | data-padding | String | e.g. `8px 21px` | Popup padding style |
75
- | multiline | data-multiline | Bool | true, false | support `<br>`, `<br />` to make multiline |
76
- | className | data-class | String | | extra custom class, can use !important to overwrite react-tooltip's default class |
77
- | html | data-html | Bool | true, false | `<p data-tip="<p>HTML tooltip</p>" data-html={true}></p>` or `<ReactTooltip html={true} />`, but see [Security Note](#security-note) below.<br/>When using JSX, see [this note](#jsx-note) below. |
78
- | delayHide | data-delay-hide | Number | | `<p data-tip="tooltip" data-delay-hide='1000'></p>` or `<ReactTooltip delayHide={1000} />` |
79
- | delayShow | data-delay-show | Number | | `<p data-tip="tooltip" data-delay-show='1000'></p>` or `<ReactTooltip delayShow={1000} />` |
80
- | delayUpdate | data-delay-update | Number | | `<p data-tip="tooltip" data-delay-update='1000'></p>` or `<ReactTooltip delayUpdate={1000} />` Sets a delay in calling getContent if the tooltip is already shown and you mouse over another target |
81
- | insecure | null | Bool | true, false | Whether to inject the style header into the page dynamically (violates CSP style-src but is a convenient default) |
82
- | border | data-border | Bool | true, false | Add one pixel white border |
83
- | borderClass | data-border-class | String | e.g. custom-border-class | A custom class name to use for the border - enabled by the `border` prop |
84
- | textColor | data-text-color | String | e.g. red | Popup text color |
85
- | backgroundColor | data-background-color | String | e.g. yellow | Popup background color |
86
- | borderColor | data-border-color | String | e.g. green | Popup border color - enabled by the `border` value |
87
- | arrowColor | data-arrow-color | String | e.g. #fff | Popup arrow color - if not specified, will use the `backgroundColor` value |
88
- | getContent | null | Func or Array | (dataTip) => {}, [(dataTip) => {}, Interval] | Generate the tip content dynamically |
89
- | afterShow | null | Func | (evt) => {} | Function that will be called after tooltip show, with event that triggered show |
90
- | afterHide | null | Func | (evt) => {} | Function that will be called after tooltip hide, with event that triggered hide |
91
- | overridePosition | null | Func | ({left:number, top: number}, currentEvent, currentTarget, node, place, desiredPlace, effect, offset) => ({left: number, top: number}) | Function that will replace tooltip position with custom one |
92
- | disable | data-tip-disable | Bool | true, false | Disable the tooltip behaviour, default is false |
93
- | scrollHide | data-scroll-hide | Bool | true, false | Hide the tooltip when scrolling, default is true |
94
- | resizeHide | null | Bool | true, false | Hide the tooltip when resizing the window, default is true |
95
- | wrapper | null | String | div, span | Selecting the wrapper element of the react tooltip, default is div |
96
- | clickable | null | Bool | true, false | Enables tooltip to respond to mouse (or touch) events, default is false |
97
- | disableInternalStyle | null | Bool | true, false | Disable internal styles to let custom styling of the tooltip being added |
76
+ For all available options, please check [React Tooltip Options](https://react-tooltip.com/docs/options)
98
77
 
99
78
  ### Security Note
100
79
 
@@ -102,121 +81,20 @@ The `html` option allows a tooltip to directly display raw HTML. This is a secur
102
81
 
103
82
  #### JSX Note
104
83
 
105
- You can use React's [`renderToStaticMarkup`-function](https://reactjs.org/docs/react-dom-server.html#rendertostaticmarkup) to use JSX instead of HTML. You still need to set `data-html={true}`.
84
+ You can use React's [`renderToStaticMarkup`-function](https://reactjs.org/docs/react-dom-server.html#rendertostaticmarkup) to use JSX instead of HTML.
106
85
  **Example:**
107
86
 
108
87
  ```jsx
109
88
  import ReactDOMServer from 'react-dom/server';
110
89
  [...]
111
- <p data-html={true} data-tip={ReactDOMServer.renderToString(<div>I am <b>JSX</b> content</div>)}>
90
+ <p id="my-element" data-tooltip-html={ReactDOMServer.renderToString(<div>I am <b>JSX</b> content</div>)}>
112
91
  Hover me
113
92
  </p>
114
93
  ```
115
94
 
116
95
  #### Note
117
96
 
118
- 1. **data-tip** is necessary, because `<ReactTooltip />` finds the tooltip via this attribute
119
- 2. **data-for** corresponds to the **id** of `<ReactTooltip />`
120
- 3. When using react component as tooltip, you can have many `<ReactTooltip />` in a page but they should have different **id**s
121
-
122
- ## Static Methods
123
-
124
- ### ReactTooltip.hide(target)
125
-
126
- > Hide the tooltip manually, the target is optional, if no target passed in, all existing tooltips will be hidden
127
-
128
- ```jsx
129
- import ReactTooltip from 'react-tooltip'
130
-
131
- <p ref={ref => this.fooRef = ref} data-tip='tooltip'></p>
132
- <button onClick={() => { ReactTooltip.hide(this.fooRef) }}></button>
133
- <ReactTooltip />
134
- ```
135
-
136
- ### ReactTooltip.rebuild()
137
-
138
- > Rebinding all tooltips
139
-
140
- ### ReactTooltip.show(target)
141
-
142
- > Show specific tooltip manually, for example:
143
-
144
- ```jsx
145
- import ReactTooltip from 'react-tooltip'
146
-
147
- <p ref={ref => this.fooRef = ref} data-tip='tooltip'></p>
148
- <button onClick={() => { ReactTooltip.show(this.fooRef) }}></button>
149
- <ReactTooltip />
150
- ```
151
-
152
- ## Troubleshooting
153
-
154
- ### 1. Using tooltip within the modal (e.g. [react-modal](https://github.com/reactjs/react-modal))
155
-
156
- The component was designed to set `<ReactTooltip />` once and then use tooltip everywhere, but a lot of people get stuck when using this component in a modal. You can read the discussion [here](https://github.com/wwayne/react-tooltip/issues/130). To solve this problem:
157
-
158
- 1. Place `<ReactTooltip />` outside of the `<Modal>`
159
- 2. Use `ReactTooltip.rebuild()` when opening the modal
160
- 3. If your modal's z-index happens to be higher than the tooltip's, use the attribute `className` to custom your tooltip's z-index
161
-
162
- > I suggest always putting `<ReactTooltip />` in the Highest level or smart component of Redux, so you might need these static
163
- > method to control tooltip's behaviour in some situations
164
-
165
- ### 2. Hide tooltip when getContent returns undefined
166
-
167
- When you set `getContent={() => { return }}` you will find the tooltip will display `true`. That's because React will set the value of data-\* to be 'true' automatically if there is no value to be set. So you have to set `data-tip=''` in this situation.
168
-
169
- ```jsx
170
- <p data-tip='' data-for='test'></p>
171
- <ReactTooltip id='test' getContent={() => { return null }}/>
172
- ```
173
-
174
- Same for empty children, if you don't want show the tooltip when the children is empty
175
-
176
- ```jsx
177
- <p data-tip='' data-for='test'></p>
178
- <ReactTooltip id='test'>{}</ReactTooltip>
179
- ```
180
-
181
- ### 3. Tooltip not binding to dynamic content
182
-
183
- When you render `<ReactTooltip>` ahead of dynamic content, and are using `data-for={id}` attributes
184
- on new dynamic content, the tooltip will not register its event listener.
185
-
186
- For example, you render a generic tooltip in the root of your app, then load a list of content async.
187
- Elements in the list use the `data-for={id}` attribute to bind the tooltip on hover.
188
- Since the tooltip has already scanned for data-tip these new elements will not trigger.
189
-
190
- One workaround for this is to trigger `ReactTooltip.rebuild()` after the data load to scan for the attribute again,
191
- to allow event wireup.
192
-
193
- #### Example
194
-
195
- ```jsx
196
- <app>
197
- <ReactTooltip id="foo" />
198
- <list />
199
- </app>
200
- ```
201
-
202
- ```jsx
203
-
204
- const dynamicList = (props) => {
205
-
206
- useEffect(() => {
207
- ReactTooltip.rebuild();
208
- });
209
-
210
- return(
211
- <list>
212
- {data.map((item)=> {
213
- <span data-for="foo">My late bound tooltip triggered data</span>
214
- });}
215
- </list>
216
- );
217
- };
218
-
219
- ```
97
+ - **id** is necessary, because `<ReactTooltip anchorId="my-element" />` finds the tooltip via this attribute
220
98
 
221
99
  ## Article
222
100
 
@@ -224,7 +102,7 @@ return(
224
102
 
225
103
  ## Maintainers
226
104
 
227
- [danielbarion](https://github.com/danielbarion) Casual maintainer - accepting PRs and doing minor testing/development.
105
+ [danielbarion](https://github.com/danielbarion) maintainer - accepting PRs and doing minor testing/development.
228
106
 
229
107
  [alexgurr](https://github.com/alexgurr) Casual maintainer - accepting PRs and doing minor testing/development.
230
108
 
@@ -1413,13 +1413,9 @@ const debounce = (func, wait, immediate) => {
1413
1413
  func.apply(context, args);
1414
1414
  }
1415
1415
  };
1416
- const callNow = immediate && !timeout;
1417
1416
  // @ts-ignore
1418
1417
  clearTimeout(timeout);
1419
1418
  timeout = setTimeout(later, wait);
1420
- if (callNow) {
1421
- func.apply(context, args);
1422
- }
1423
1419
  };
1424
1420
  };
1425
1421
 
@@ -2613,9 +2609,10 @@ const computePosition = (reference, floating, options) => computePosition$1(refe
2613
2609
  });
2614
2610
 
2615
2611
  const computeToolTipPosition = async ({ elementReference = null, tooltipReference = null, tooltipArrowReference = null, place = 'top', offset: offsetValue = 10, }) => {
2616
- if (elementReference === null) {
2612
+ if (!elementReference) {
2613
+ // elementReference can be null or undefined and we will not compute the position
2617
2614
  // eslint-disable-next-line no-console
2618
- console.error('The reference element for tooltip was not defined: ', elementReference);
2615
+ // console.error('The reference element for tooltip was not defined: ', elementReference)
2619
2616
  return { tooltipStyles: {}, tooltipArrowStyles: {} };
2620
2617
  }
2621
2618
  if (tooltipReference === null) {
@@ -3,4 +3,4 @@
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */i=a,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}return n.join(" ")}i.exports?(t.default=t,i.exports=t):window.classNames=t}();var l=a.exports;const s=(e,t,n)=>{let r;return function(){const o=this,i=arguments,a=()=>{r=null,n||e.apply(o,i)},l=n&&!r;clearTimeout(r),r=setTimeout(a,t),l&&e.apply(o,i)}},c=({content:e})=>r.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}});function u(e){return e.split("-")[0]}function f(e){return e.split("-")[1]}function p(e){return["top","bottom"].includes(u(e))?"x":"y"}function d(e){return"y"===e?"height":"width"}function y(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=p(t),s=d(l),c=r[s]/2-o[s]/2,y="x"===l;let m;switch(u(t)){case"top":m={x:i,y:r.y-o.height};break;case"bottom":m={x:i,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:a};break;case"left":m={x:r.x-o.width,y:a};break;default:m={x:r.x,y:r.y}}switch(f(t)){case"start":m[l]-=c*(n&&y?-1:1);break;case"end":m[l]+=c*(n&&y?-1:1)}return m}function m(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function h(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function g(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=m(d),g=l[p?"floating"===f?"reference":"floating":f],v=h(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),b=h(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:v.top-b.top+y.top,bottom:b.bottom-v.bottom+y.bottom,left:v.left-b.left+y.left,right:b.right-v.right+y.right}}const v=Math.min,b=Math.max;function w(e,t,n){return b(e,v(t,n))}const x={left:"right",right:"left",bottom:"top",top:"bottom"};function S(e){return e.replace(/left|right|bottom|top/g,(e=>x[e]))}const _={start:"end",end:"start"};function R(e){return e.replace(/start|end/g,(e=>_[e]))}const k=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:y=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",flipAlignment:v=!0,...b}=e,w=u(r),x=m||(w===a||!v?[S(a)]:function(e){const t=S(e);return[R(e),t,R(t)]}(a)),_=[a,...x],k=await g(t,b),T=[];let O=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&T.push(k[w]),y){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=f(e),o=p(e),i=d(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=S(a)),{main:a,cross:S(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));T.push(k[e],k[t])}if(O=[...O,{placement:r,overflows:T}],!T.every((e=>e<=0))){var j,E;const e=(null!=(j=null==(E=o.flip)?void 0:E.index)?j:0)+1,t=_[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var P;const e=null==(P=O.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const T=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=u(n),l=f(n),s="x"===p(n),c=["left","top"].includes(a)?-1:1,d=i&&s?-1:1,y="function"==typeof t?t(e):t;let{mainAxis:m,crossAxis:h,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return l&&"number"==typeof g&&(h="end"===l?-1*g:g),s?{x:h*d,y:m*c}:{x:m*c,y:h*d}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function O(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function j(e){if(null==e)return window;if(!O(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function E(e){return j(e).getComputedStyle(e)}function P(e){return O(e)?"":e?(e.nodeName||"").toLowerCase():""}function A(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function N(e){return e instanceof j(e).HTMLElement}function L(e){return e instanceof j(e).Element}function C(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof j(e).ShadowRoot||e instanceof ShadowRoot}function $(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=E(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function D(e){return["table","td","th"].includes(P(e))}function F(e){const t=/firefox/i.test(A()),n=E(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function I(){return!/^((?!chrome|android).)*safari/i.test(A())}function W(e){return["html","body","#document"].includes(P(e))}const H=Math.min,M=Math.max,U=Math.round;function B(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&N(e)&&(s=e.offsetWidth>0&&U(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&U(l.height)/e.offsetHeight||1);const u=L(e)?j(e):window,f=!I()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function V(e){return(t=e,(t instanceof j(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function q(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function z(e){return B(V(e)).left+q(e).scrollLeft}function Y(e,t,n){const r=N(t),o=V(t),i=B(e,r&&function(e){const t=B(e);return U(t.width)!==e.offsetWidth||U(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==P(t)||$(o))&&(a=q(t)),N(t)){const e=B(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=z(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function X(e){if("html"===P(e))return e;const t=e.assignedSlot||e.parentNode||(C(e)?e.host:null)||V(e);return C(t)?t.host:t}function J(e){return N(e)&&"fixed"!==E(e).position?e.offsetParent:null}function K(e){const t=j(e);let n=J(e);for(;n&&D(n)&&"static"===E(n).position;)n=J(n);return n&&("html"===P(n)||"body"===P(n)&&"static"===E(n).position&&!F(n))?t:n||function(e){let t=X(e);for(;N(t)&&!W(t);){if(F(t))return t;t=X(t)}return null}(e)||t}function Z(e){if(N(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=B(e);return{width:t.width,height:t.height}}function G(e){const t=X(e);return W(t)?e.ownerDocument.body:N(t)&&$(t)?t:G(t)}function Q(e,t){var n;void 0===t&&(t=[]);const r=G(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=j(r),a=o?[i].concat(i.visualViewport||[],$(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(Q(a))}function ee(e,t,n){return"viewport"===t?h(function(e,t){const n=j(e),r=V(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=I();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):L(t)?function(e,t){const n=B(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):h(function(e){var t;const n=V(e),r=q(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=M(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=M(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+z(e);const s=-r.scrollTop;return"rtl"===E(o||n).direction&&(l+=M(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(V(e)))}const te={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=Q(e).filter((e=>L(e)&&"body"!==P(e))),n=e,r=null;for(;L(n)&&!W(n);){const e=E(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!F(n)?t=t.filter((e=>e!==n)):r=e,n=X(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=ee(t,n,o);return e.top=M(r.top,e.top),e.right=H(r.right,e.right),e.bottom=H(r.bottom,e.bottom),e.left=M(r.left,e.left),e}),ee(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=N(n),i=V(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==P(n)||$(i))&&(a=q(n)),N(n))){const e=B(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:L,getDimensions:Z,getOffsetParent:K,getDocumentElement:V,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Y(t,K(n),r),floating:{...Z(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===E(e).direction},ne=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=y(c,r,s),p=r,d={},m=0;for(let n=0;n<l.length;n++){const{name:i,fn:h}=l[n],{x:g,y:v,data:b,reset:w}=await h({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,f=null!=v?v:f,d={...d,[i]:{...d[i],...b}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=y(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:te,...n}),re=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10})=>{if(null===e)return console.error("The reference element for tooltip was not defined: ",e),{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const i=[T(Number(o)),k(),(a={padding:5},void 0===a&&(a={}),{name:"shift",options:a,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=a,c={x:t,y:n},f=await g(e,s),d=p(u(r)),y="x"===d?"y":"x";let m=c[d],h=c[y];if(o){const e="y"===d?"bottom":"right";m=w(m+f["y"===d?"top":"left"],m,m-f[e])}if(i){const e="y"===y?"bottom":"right";h=w(h+f["y"===y?"top":"left"],h,h-f[e])}const v=l.fn({...e,[d]:m,[y]:h});return{...v,data:{x:v.x-t,y:v.y-n}}}})];var a;return n?(i.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=m(r),u={x:o,y:i},y=p(a),h=f(a),g=d(y),v=await s.getDimensions(n),b="y"===y?"top":"left",x="y"===y?"bottom":"right",S=l.reference[g]+l.reference[y]-u[y]-l.floating[g],_=u[y]-l.reference[y],R=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let k=R?"y"===y?R.clientHeight||0:R.clientWidth||0:0;0===k&&(k=l.floating[g]);const T=S/2-_/2,O=c[b],j=k-v[g]-c[x],E=k/2-v[g]/2+T,P=w(O,E,j),A=("start"===h?c[b]:c[x])>0&&E!==P&&l.reference[g]<=l.floating[g];return{[y]:u[y]-(A?E<O?O-E:j-E:0),data:{[y]:P,centerOffset:E-P}}}}))({element:n})),ne(e,t,{placement:r,middleware:i}).then((({x:e,y:t,placement:n,middlewareData:r})=>{const o={left:`${e}px`,top:`${t}px`},{x:i,y:a}=r.arrow;return{tooltipStyles:o,tooltipArrowStyles:{left:null!=i?`${i}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[{top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]]]:"-4px"}}}))):ne(e,t,{placement:"bottom",middleware:i}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var oe={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ie=({id:t=e.useId(),className:n,classNameArrow:o,variant:i="dark",anchorId:a,place:u="top",offset:f=10,events:p=["hover"],wrapper:d="div",children:y=null,delayShow:m=0,delayHide:h=0,isHtmlContent:g=!1,content:v,isOpen:b,setIsOpen:w})=>{const x=e.createRef(),S=e.createRef(),_=e.useRef(),R=e.useRef(),[k,T]=e.useState({}),[O,j]=e.useState({}),[E,P]=e.useState(!1),A=e=>{w?w(e):void 0===b&&P(e)},N=()=>{w?w(!b):void 0===b&&P((e=>!e))},L=s((()=>{m?(_.current&&clearTimeout(_.current),_.current=setTimeout((()=>{A(!0)}),m)):A(!0),R.current&&clearTimeout(R.current)}),50),C=s((()=>{h?(R.current&&clearTimeout(R.current),R.current=setTimeout((()=>{A(!1)}),h)):A(!1),E&&_.current?clearTimeout(_.current):!E&&_.current&&(R.current=setTimeout((()=>{A(!1)}),2*m))}),50);return e.useEffect((()=>{const e=document.querySelector(`#${a}`);if(!e)return()=>{};const t=[];return p.find((e=>"click"===e))&&t.push({event:"click",listener:N}),p.find((e=>"hover"===e))&&t.push({event:"mouseenter",listener:L},{event:"mouseleave",listener:C},{event:"focus",listener:L},{event:"blur",listener:C}),t.forEach((({event:t,listener:n})=>{null==e||e.addEventListener(t,n)})),()=>{t.forEach((({event:t,listener:n})=>{null==e||e.removeEventListener(t,n)}))}}),[a,p,h,m]),e.useEffect((()=>{const e=document.querySelector(`#${a}`);return re({place:u,offset:f,elementReference:e,tooltipReference:x.current,tooltipArrowReference:S.current}).then((e=>{Object.keys(e.tooltipStyles).length&&T(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&j(e.tooltipArrowStyles)})),()=>{_.current=void 0,R.current=void 0}}),[E,b,a]),r.exports.jsxs(d,{id:t,role:"tooltip",className:l(oe.tooltip,oe[i],n,{[oe.show]:b||E}),style:k,ref:x,children:[y||(g?r.exports.jsx(c,{content:v}):v),r.exports.jsx("div",{className:l(oe.arrow,o),style:O,ref:S})]})},ae=["place","content","html","variant","offset","wrapper","events","delay-show","delay-hide"];exports.Tooltip=({id:t,anchorId:n,content:o,html:i,className:a,classNameArrow:l,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:d=["hover"],delayShow:y=0,delayHide:m=0,getContent:h,isOpen:g,setIsOpen:v})=>{const[b,w]=e.useState(o||i),[x,S]=e.useState(c),[_,R]=e.useState(s),[k,T]=e.useState(u),[O,j]=e.useState(y),[E,P]=e.useState(m),[A,N]=e.useState(f),[L,C]=e.useState(d),[$,D]=e.useState(Boolean(i)),F=e=>{const t=Object.keys(e);let n=null;const r={place:e=>{S(e)},content:e=>{D(!0),w(h?h(e):e)},html:e=>{D(!0),w(h?h(e):e)},variant:e=>{R(e)},offset:e=>{T(e)},wrapper:e=>{N(e)},events:e=>{const t=e.split(" ");C(t)},"delay-show":e=>{j(Number(e))},"delay-hide":e=>{P(Number(e))}};t.forEach((t=>{n=t.replace("data-tooltip-",""),ae.includes(n)&&r[n](e[t])}))};e.useEffect((()=>{if(!n)return()=>{};const e=document.querySelector(`#${n}`);if(!e)return()=>{};o&&h&&w(h(o));const t=new MutationObserver((t=>{t.forEach((t=>{if("attributes"===t.type){const n=(({element:e,attributeName:t})=>({[t]:e.getAttribute(t)}))({element:e,attributeName:t.attributeName});F(n)}}))}));t.observe(e,{attributes:!0,childList:!1,subtree:!1});const r=(e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>(n.includes("data-tooltip-")&&(t[n]=null==e?void 0:e.getAttribute(n)),t)),{}))(e);return F(r),()=>{t.disconnect()}}),[n]);const I={id:t,anchorId:n,className:a,classNameArrow:l,content:b,isHtmlContent:$,place:x,variant:_,offset:k,wrapper:A,events:L,delayShow:O,delayHide:E,isOpen:g,setIsOpen:v};return p?r.exports.jsx(ie,{...I,children:p}):r.exports.jsx(ie,{...I})};
6
+ */i=a,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}return n.join(" ")}i.exports?(t.default=t,i.exports=t):window.classNames=t}();var l=a.exports;const s=(e,t,n)=>{let r;return function(){const o=this,i=arguments,a=()=>{r=null,n||e.apply(o,i)};clearTimeout(r),r=setTimeout(a,t)}},c=({content:e})=>r.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}});function u(e){return e.split("-")[0]}function f(e){return e.split("-")[1]}function p(e){return["top","bottom"].includes(u(e))?"x":"y"}function d(e){return"y"===e?"height":"width"}function y(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=p(t),s=d(l),c=r[s]/2-o[s]/2,y="x"===l;let m;switch(u(t)){case"top":m={x:i,y:r.y-o.height};break;case"bottom":m={x:i,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:a};break;case"left":m={x:r.x-o.width,y:a};break;default:m={x:r.x,y:r.y}}switch(f(t)){case"start":m[l]-=c*(n&&y?-1:1);break;case"end":m[l]+=c*(n&&y?-1:1)}return m}function m(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function h(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function g(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=m(d),g=l[p?"floating"===f?"reference":"floating":f],v=h(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),b=h(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:v.top-b.top+y.top,bottom:b.bottom-v.bottom+y.bottom,left:v.left-b.left+y.left,right:b.right-v.right+y.right}}const v=Math.min,b=Math.max;function w(e,t,n){return b(e,v(t,n))}const x={left:"right",right:"left",bottom:"top",top:"bottom"};function S(e){return e.replace(/left|right|bottom|top/g,(e=>x[e]))}const _={start:"end",end:"start"};function R(e){return e.replace(/start|end/g,(e=>_[e]))}const k=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:y=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",flipAlignment:v=!0,...b}=e,w=u(r),x=m||(w===a||!v?[S(a)]:function(e){const t=S(e);return[R(e),t,R(t)]}(a)),_=[a,...x],k=await g(t,b),T=[];let O=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&T.push(k[w]),y){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=f(e),o=p(e),i=d(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=S(a)),{main:a,cross:S(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));T.push(k[e],k[t])}if(O=[...O,{placement:r,overflows:T}],!T.every((e=>e<=0))){var j,E;const e=(null!=(j=null==(E=o.flip)?void 0:E.index)?j:0)+1,t=_[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n="bottom";switch(h){case"bestFit":{var P;const e=null==(P=O.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const T=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=u(n),l=f(n),s="x"===p(n),c=["left","top"].includes(a)?-1:1,d=i&&s?-1:1,y="function"==typeof t?t(e):t;let{mainAxis:m,crossAxis:h,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return l&&"number"==typeof g&&(h="end"===l?-1*g:g),s?{x:h*d,y:m*c}:{x:m*c,y:h*d}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function O(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function j(e){if(null==e)return window;if(!O(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function E(e){return j(e).getComputedStyle(e)}function P(e){return O(e)?"":e?(e.nodeName||"").toLowerCase():""}function A(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function N(e){return e instanceof j(e).HTMLElement}function L(e){return e instanceof j(e).Element}function C(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof j(e).ShadowRoot||e instanceof ShadowRoot}function $(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=E(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function D(e){return["table","td","th"].includes(P(e))}function F(e){const t=/firefox/i.test(A()),n=E(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function I(){return!/^((?!chrome|android).)*safari/i.test(A())}function W(e){return["html","body","#document"].includes(P(e))}const H=Math.min,M=Math.max,U=Math.round;function B(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&N(e)&&(s=e.offsetWidth>0&&U(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&U(l.height)/e.offsetHeight||1);const u=L(e)?j(e):window,f=!I()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function V(e){return(t=e,(t instanceof j(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function q(e){return L(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function z(e){return B(V(e)).left+q(e).scrollLeft}function Y(e,t,n){const r=N(t),o=V(t),i=B(e,r&&function(e){const t=B(e);return U(t.width)!==e.offsetWidth||U(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==P(t)||$(o))&&(a=q(t)),N(t)){const e=B(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=z(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function X(e){if("html"===P(e))return e;const t=e.assignedSlot||e.parentNode||(C(e)?e.host:null)||V(e);return C(t)?t.host:t}function J(e){return N(e)&&"fixed"!==E(e).position?e.offsetParent:null}function K(e){const t=j(e);let n=J(e);for(;n&&D(n)&&"static"===E(n).position;)n=J(n);return n&&("html"===P(n)||"body"===P(n)&&"static"===E(n).position&&!F(n))?t:n||function(e){let t=X(e);for(;N(t)&&!W(t);){if(F(t))return t;t=X(t)}return null}(e)||t}function Z(e){if(N(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=B(e);return{width:t.width,height:t.height}}function G(e){const t=X(e);return W(t)?e.ownerDocument.body:N(t)&&$(t)?t:G(t)}function Q(e,t){var n;void 0===t&&(t=[]);const r=G(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=j(r),a=o?[i].concat(i.visualViewport||[],$(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(Q(a))}function ee(e,t,n){return"viewport"===t?h(function(e,t){const n=j(e),r=V(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=I();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):L(t)?function(e,t){const n=B(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):h(function(e){var t;const n=V(e),r=q(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=M(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=M(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+z(e);const s=-r.scrollTop;return"rtl"===E(o||n).direction&&(l+=M(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(V(e)))}const te={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=Q(e).filter((e=>L(e)&&"body"!==P(e))),n=e,r=null;for(;L(n)&&!W(n);){const e=E(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!F(n)?t=t.filter((e=>e!==n)):r=e,n=X(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=ee(t,n,o);return e.top=M(r.top,e.top),e.right=H(r.right,e.right),e.bottom=H(r.bottom,e.bottom),e.left=M(r.left,e.left),e}),ee(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=N(n),i=V(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==P(n)||$(i))&&(a=q(n)),N(n))){const e=B(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:L,getDimensions:Z,getOffsetParent:K,getDocumentElement:V,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:Y(t,K(n),r),floating:{...Z(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===E(e).direction},ne=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=y(c,r,s),p=r,d={},m=0;for(let n=0;n<l.length;n++){const{name:i,fn:h}=l[n],{x:g,y:v,data:b,reset:w}=await h({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,f=null!=v?v:f,d={...d,[i]:{...d[i],...b}},m>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=y(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:te,...n}),re=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const i=[T(Number(o)),k(),(a={padding:5},void 0===a&&(a={}),{name:"shift",options:a,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=a,c={x:t,y:n},f=await g(e,s),d=p(u(r)),y="x"===d?"y":"x";let m=c[d],h=c[y];if(o){const e="y"===d?"bottom":"right";m=w(m+f["y"===d?"top":"left"],m,m-f[e])}if(i){const e="y"===y?"bottom":"right";h=w(h+f["y"===y?"top":"left"],h,h-f[e])}const v=l.fn({...e,[d]:m,[y]:h});return{...v,data:{x:v.x-t,y:v.y-n}}}})];var a;return n?(i.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=m(r),u={x:o,y:i},y=p(a),h=f(a),g=d(y),v=await s.getDimensions(n),b="y"===y?"top":"left",x="y"===y?"bottom":"right",S=l.reference[g]+l.reference[y]-u[y]-l.floating[g],_=u[y]-l.reference[y],R=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let k=R?"y"===y?R.clientHeight||0:R.clientWidth||0:0;0===k&&(k=l.floating[g]);const T=S/2-_/2,O=c[b],j=k-v[g]-c[x],E=k/2-v[g]/2+T,P=w(O,E,j),A=("start"===h?c[b]:c[x])>0&&E!==P&&l.reference[g]<=l.floating[g];return{[y]:u[y]-(A?E<O?O-E:j-E:0),data:{[y]:P,centerOffset:E-P}}}}))({element:n})),ne(e,t,{placement:r,middleware:i}).then((({x:e,y:t,placement:n,middlewareData:r})=>{const o={left:`${e}px`,top:`${t}px`},{x:i,y:a}=r.arrow;return{tooltipStyles:o,tooltipArrowStyles:{left:null!=i?`${i}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[{top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]]]:"-4px"}}}))):ne(e,t,{placement:"bottom",middleware:i}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var oe={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const ie=({id:t=e.useId(),className:n,classNameArrow:o,variant:i="dark",anchorId:a,place:u="top",offset:f=10,events:p=["hover"],wrapper:d="div",children:y=null,delayShow:m=0,delayHide:h=0,isHtmlContent:g=!1,content:v,isOpen:b,setIsOpen:w})=>{const x=e.createRef(),S=e.createRef(),_=e.useRef(),R=e.useRef(),[k,T]=e.useState({}),[O,j]=e.useState({}),[E,P]=e.useState(!1),A=e=>{w?w(e):void 0===b&&P(e)},N=()=>{w?w(!b):void 0===b&&P((e=>!e))},L=s((()=>{m?(_.current&&clearTimeout(_.current),_.current=setTimeout((()=>{A(!0)}),m)):A(!0),R.current&&clearTimeout(R.current)}),50),C=s((()=>{h?(R.current&&clearTimeout(R.current),R.current=setTimeout((()=>{A(!1)}),h)):A(!1),E&&_.current?clearTimeout(_.current):!E&&_.current&&(R.current=setTimeout((()=>{A(!1)}),2*m))}),50);return e.useEffect((()=>{const e=document.querySelector(`#${a}`);if(!e)return()=>{};const t=[];return p.find((e=>"click"===e))&&t.push({event:"click",listener:N}),p.find((e=>"hover"===e))&&t.push({event:"mouseenter",listener:L},{event:"mouseleave",listener:C},{event:"focus",listener:L},{event:"blur",listener:C}),t.forEach((({event:t,listener:n})=>{null==e||e.addEventListener(t,n)})),()=>{t.forEach((({event:t,listener:n})=>{null==e||e.removeEventListener(t,n)}))}}),[a,p,h,m]),e.useEffect((()=>{const e=document.querySelector(`#${a}`);return re({place:u,offset:f,elementReference:e,tooltipReference:x.current,tooltipArrowReference:S.current}).then((e=>{Object.keys(e.tooltipStyles).length&&T(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&j(e.tooltipArrowStyles)})),()=>{_.current=void 0,R.current=void 0}}),[E,b,a]),r.exports.jsxs(d,{id:t,role:"tooltip",className:l(oe.tooltip,oe[i],n,{[oe.show]:b||E}),style:k,ref:x,children:[y||(g?r.exports.jsx(c,{content:v}):v),r.exports.jsx("div",{className:l(oe.arrow,o),style:O,ref:S})]})},ae=["place","content","html","variant","offset","wrapper","events","delay-show","delay-hide"];exports.Tooltip=({id:t,anchorId:n,content:o,html:i,className:a,classNameArrow:l,variant:s="dark",place:c="top",offset:u=10,wrapper:f="div",children:p=null,events:d=["hover"],delayShow:y=0,delayHide:m=0,getContent:h,isOpen:g,setIsOpen:v})=>{const[b,w]=e.useState(o||i),[x,S]=e.useState(c),[_,R]=e.useState(s),[k,T]=e.useState(u),[O,j]=e.useState(y),[E,P]=e.useState(m),[A,N]=e.useState(f),[L,C]=e.useState(d),[$,D]=e.useState(Boolean(i)),F=e=>{const t=Object.keys(e);let n=null;const r={place:e=>{S(e)},content:e=>{D(!0),w(h?h(e):e)},html:e=>{D(!0),w(h?h(e):e)},variant:e=>{R(e)},offset:e=>{T(e)},wrapper:e=>{N(e)},events:e=>{const t=e.split(" ");C(t)},"delay-show":e=>{j(Number(e))},"delay-hide":e=>{P(Number(e))}};t.forEach((t=>{n=t.replace("data-tooltip-",""),ae.includes(n)&&r[n](e[t])}))};e.useEffect((()=>{if(!n)return()=>{};const e=document.querySelector(`#${n}`);if(!e)return()=>{};o&&h&&w(h(o));const t=new MutationObserver((t=>{t.forEach((t=>{if("attributes"===t.type){const n=(({element:e,attributeName:t})=>({[t]:e.getAttribute(t)}))({element:e,attributeName:t.attributeName});F(n)}}))}));t.observe(e,{attributes:!0,childList:!1,subtree:!1});const r=(e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>(n.includes("data-tooltip-")&&(t[n]=null==e?void 0:e.getAttribute(n)),t)),{}))(e);return F(r),()=>{t.disconnect()}}),[n]);const I={id:t,anchorId:n,className:a,classNameArrow:l,content:b,isHtmlContent:$,place:x,variant:_,offset:k,wrapper:A,events:L,delayShow:O,delayHide:E,isOpen:g,setIsOpen:v};return p?r.exports.jsx(ie,{...I,children:p}):r.exports.jsx(ie,{...I})};
@@ -1405,13 +1405,9 @@ const debounce = (func, wait, immediate) => {
1405
1405
  func.apply(context, args);
1406
1406
  }
1407
1407
  };
1408
- const callNow = immediate && !timeout;
1409
1408
  // @ts-ignore
1410
1409
  clearTimeout(timeout);
1411
1410
  timeout = setTimeout(later, wait);
1412
- if (callNow) {
1413
- func.apply(context, args);
1414
- }
1415
1411
  };
1416
1412
  };
1417
1413
 
@@ -2605,9 +2601,10 @@ const computePosition = (reference, floating, options) => computePosition$1(refe
2605
2601
  });
2606
2602
 
2607
2603
  const computeToolTipPosition = async ({ elementReference = null, tooltipReference = null, tooltipArrowReference = null, place = 'top', offset: offsetValue = 10, }) => {
2608
- if (elementReference === null) {
2604
+ if (!elementReference) {
2605
+ // elementReference can be null or undefined and we will not compute the position
2609
2606
  // eslint-disable-next-line no-console
2610
- console.error('The reference element for tooltip was not defined: ', elementReference);
2607
+ // console.error('The reference element for tooltip was not defined: ', elementReference)
2611
2608
  return { tooltipStyles: {}, tooltipArrowStyles: {} };
2612
2609
  }
2613
2610
  if (tooltipReference === null) {
@@ -3,4 +3,4 @@ import e,{createRef as t,useRef as n,useState as r,useEffect as o,useId as i}fro
3
3
  Copyright (c) 2018 Jed Watson.
4
4
  Licensed under the MIT License (MIT), see
5
5
  http://jedwatson.github.io/classnames
6
- */s=c,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}return n.join(" ")}s.exports?(t.default=t,s.exports=t):window.classNames=t}();var u=c.exports;const f=(e,t,n)=>{let r;return function(){const o=this,i=arguments,a=()=>{r=null,n||e.apply(o,i)},l=n&&!r;clearTimeout(r),r=setTimeout(a,t),l&&e.apply(o,i)}},p=({content:e})=>a.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}});function d(e){return e.split("-")[0]}function y(e){return e.split("-")[1]}function m(e){return["top","bottom"].includes(d(e))?"x":"y"}function h(e){return"y"===e?"height":"width"}function g(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=m(t),s=h(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(d(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(y(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function v(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function b(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function w(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=v(d),m=l[p?"floating"===f?"reference":"floating":f],h=b(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=b(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const x=Math.min,_=Math.max;function S(e,t,n){return _(e,x(t,n))}const R={left:"right",right:"left",bottom:"top",top:"bottom"};function k(e){return e.replace(/left|right|bottom|top/g,(e=>R[e]))}const T={start:"end",end:"start"};function O(e){return e.replace(/start|end/g,(e=>T[e]))}const j=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:g=!0,...v}=e,b=d(r),x=f||(b===a||!g?[k(a)]:function(e){const t=k(e);return[O(e),t,O(t)]}(a)),_=[a,...x],S=await w(t,v),R=[];let T=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&R.push(S[b]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=y(e),o=m(e),i=h(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=k(a)),{main:a,cross:k(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));R.push(S[e],S[t])}if(T=[...T,{placement:r,overflows:R}],!R.every((e=>e<=0))){var j,E;const e=(null!=(j=null==(E=o.flip)?void 0:E.index)?j:0)+1,t=_[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var P;const e=null==(P=T.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const E=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=d(n),l=y(n),s="x"===m(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:h,alignmentAxis:g}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof g&&(h="end"===l?-1*g:g),s?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function P(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function A(e){if(null==e)return window;if(!P(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function N(e){return A(e).getComputedStyle(e)}function L(e){return P(e)?"":e?(e.nodeName||"").toLowerCase():""}function C(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function $(e){return e instanceof A(e).HTMLElement}function D(e){return e instanceof A(e).Element}function F(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof A(e).ShadowRoot||e instanceof ShadowRoot}function I(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=N(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function W(e){return["table","td","th"].includes(L(e))}function H(e){const t=/firefox/i.test(C()),n=N(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function M(){return!/^((?!chrome|android).)*safari/i.test(C())}function U(e){return["html","body","#document"].includes(L(e))}const B=Math.min,V=Math.max,z=Math.round;function Y(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&$(e)&&(s=e.offsetWidth>0&&z(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&z(l.height)/e.offsetHeight||1);const u=D(e)?A(e):window,f=!M()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function q(e){return(t=e,(t instanceof A(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function X(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function J(e){return Y(q(e)).left+X(e).scrollLeft}function K(e,t,n){const r=$(t),o=q(t),i=Y(e,r&&function(e){const t=Y(e);return z(t.width)!==e.offsetWidth||z(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==L(t)||I(o))&&(a=X(t)),$(t)){const e=Y(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=J(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function Z(e){if("html"===L(e))return e;const t=e.assignedSlot||e.parentNode||(F(e)?e.host:null)||q(e);return F(t)?t.host:t}function G(e){return $(e)&&"fixed"!==N(e).position?e.offsetParent:null}function Q(e){const t=A(e);let n=G(e);for(;n&&W(n)&&"static"===N(n).position;)n=G(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===N(n).position&&!H(n))?t:n||function(e){let t=Z(e);for(;$(t)&&!U(t);){if(H(t))return t;t=Z(t)}return null}(e)||t}function ee(e){if($(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Y(e);return{width:t.width,height:t.height}}function te(e){const t=Z(e);return U(t)?e.ownerDocument.body:$(t)&&I(t)?t:te(t)}function ne(e,t){var n;void 0===t&&(t=[]);const r=te(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=A(r),a=o?[i].concat(i.visualViewport||[],I(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(ne(a))}function re(e,t,n){return"viewport"===t?b(function(e,t){const n=A(e),r=q(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=M();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):D(t)?function(e,t){const n=Y(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):b(function(e){var t;const n=q(e),r=X(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=V(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=V(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+J(e);const s=-r.scrollTop;return"rtl"===N(o||n).direction&&(l+=V(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(q(e)))}const oe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=ne(e).filter((e=>D(e)&&"body"!==L(e))),n=e,r=null;for(;D(n)&&!U(n);){const e=N(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!H(n)?t=t.filter((e=>e!==n)):r=e,n=Z(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=re(t,n,o);return e.top=V(r.top,e.top),e.right=B(r.right,e.right),e.bottom=B(r.bottom,e.bottom),e.left=V(r.left,e.left),e}),re(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=$(n),i=q(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==L(n)||I(i))&&(a=X(n)),$(n))){const e=Y(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:D,getDimensions:ee,getOffsetParent:Q,getDocumentElement:q,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:K(t,Q(n),r),floating:{...ee(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===N(e).direction},ie=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=g(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:v,data:b,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=v?v:f,d={...d,[i]:{...d[i],...b}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&y<=50&&(y++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=g(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:oe,...n}),ae=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10})=>{if(null===e)return console.error("The reference element for tooltip was not defined: ",e),{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const i=[E(Number(o)),j(),(a={padding:5},void 0===a&&(a={}),{name:"shift",options:a,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=a,c={x:t,y:n},u=await w(e,s),f=m(d(r)),p="x"===f?"y":"x";let y=c[f],h=c[p];if(o){const e="y"===f?"bottom":"right";y=S(y+u["y"===f?"top":"left"],y,y-u[e])}if(i){const e="y"===p?"bottom":"right";h=S(h+u["y"===p?"top":"left"],h,h-u[e])}const g=l.fn({...e,[f]:y,[p]:h});return{...g,data:{x:g.x-t,y:g.y-n}}}})];var a;return n?(i.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=v(r),u={x:o,y:i},f=m(a),p=y(a),d=h(f),g=await s.getDimensions(n),b="y"===f?"top":"left",w="y"===f?"bottom":"right",x=l.reference[d]+l.reference[f]-u[f]-l.floating[d],_=u[f]-l.reference[f],R=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let k=R?"y"===f?R.clientHeight||0:R.clientWidth||0:0;0===k&&(k=l.floating[d]);const T=x/2-_/2,O=c[b],j=k-g[d]-c[w],E=k/2-g[d]/2+T,P=S(O,E,j),A=("start"===p?c[b]:c[w])>0&&E!==P&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(A?E<O?O-E:j-E:0),data:{[f]:P,centerOffset:E-P}}}}))({element:n})),ie(e,t,{placement:r,middleware:i}).then((({x:e,y:t,placement:n,middlewareData:r})=>{const o={left:`${e}px`,top:`${t}px`},{x:i,y:a}=r.arrow;return{tooltipStyles:o,tooltipArrowStyles:{left:null!=i?`${i}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[{top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]]]:"-4px"}}}))):ie(e,t,{placement:"bottom",middleware:i}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var le={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const se=({id:e=i(),className:l,classNameArrow:s,variant:c="dark",anchorId:d,place:y="top",offset:m=10,events:h=["hover"],wrapper:g="div",children:v=null,delayShow:b=0,delayHide:w=0,isHtmlContent:x=!1,content:_,isOpen:S,setIsOpen:R})=>{const k=t(),T=t(),O=n(),j=n(),[E,P]=r({}),[A,N]=r({}),[L,C]=r(!1),$=e=>{R?R(e):void 0===S&&C(e)},D=()=>{R?R(!S):void 0===S&&C((e=>!e))},F=f((()=>{b?(O.current&&clearTimeout(O.current),O.current=setTimeout((()=>{$(!0)}),b)):$(!0),j.current&&clearTimeout(j.current)}),50),I=f((()=>{w?(j.current&&clearTimeout(j.current),j.current=setTimeout((()=>{$(!1)}),w)):$(!1),L&&O.current?clearTimeout(O.current):!L&&O.current&&(j.current=setTimeout((()=>{$(!1)}),2*b))}),50);return o((()=>{const e=document.querySelector(`#${d}`);if(!e)return()=>{};const t=[];return h.find((e=>"click"===e))&&t.push({event:"click",listener:D}),h.find((e=>"hover"===e))&&t.push({event:"mouseenter",listener:F},{event:"mouseleave",listener:I},{event:"focus",listener:F},{event:"blur",listener:I}),t.forEach((({event:t,listener:n})=>{null==e||e.addEventListener(t,n)})),()=>{t.forEach((({event:t,listener:n})=>{null==e||e.removeEventListener(t,n)}))}}),[d,h,w,b]),o((()=>{const e=document.querySelector(`#${d}`);return ae({place:y,offset:m,elementReference:e,tooltipReference:k.current,tooltipArrowReference:T.current}).then((e=>{Object.keys(e.tooltipStyles).length&&P(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&N(e.tooltipArrowStyles)})),()=>{O.current=void 0,j.current=void 0}}),[L,S,d]),a.exports.jsxs(g,{id:e,role:"tooltip",className:u(le.tooltip,le[c],l,{[le.show]:S||L}),style:E,ref:k,children:[v||(x?a.exports.jsx(p,{content:_}):_),a.exports.jsx("div",{className:u(le.arrow,s),style:A,ref:T})]})},ce=["place","content","html","variant","offset","wrapper","events","delay-show","delay-hide"],ue=({id:e,anchorId:t,content:n,html:i,className:l,classNameArrow:s,variant:c="dark",place:u="top",offset:f=10,wrapper:p="div",children:d=null,events:y=["hover"],delayShow:m=0,delayHide:h=0,getContent:g,isOpen:v,setIsOpen:b})=>{const[w,x]=r(n||i),[_,S]=r(u),[R,k]=r(c),[T,O]=r(f),[j,E]=r(m),[P,A]=r(h),[N,L]=r(p),[C,$]=r(y),[D,F]=r(Boolean(i)),I=e=>{const t=Object.keys(e);let n=null;const r={place:e=>{S(e)},content:e=>{F(!0),x(g?g(e):e)},html:e=>{F(!0),x(g?g(e):e)},variant:e=>{k(e)},offset:e=>{O(e)},wrapper:e=>{L(e)},events:e=>{const t=e.split(" ");$(t)},"delay-show":e=>{E(Number(e))},"delay-hide":e=>{A(Number(e))}};t.forEach((t=>{n=t.replace("data-tooltip-",""),ce.includes(n)&&r[n](e[t])}))};o((()=>{if(!t)return()=>{};const e=document.querySelector(`#${t}`);if(!e)return()=>{};n&&g&&x(g(n));const r=new MutationObserver((t=>{t.forEach((t=>{if("attributes"===t.type){const n=(({element:e,attributeName:t})=>({[t]:e.getAttribute(t)}))({element:e,attributeName:t.attributeName});I(n)}}))}));r.observe(e,{attributes:!0,childList:!1,subtree:!1});const o=(e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>(n.includes("data-tooltip-")&&(t[n]=null==e?void 0:e.getAttribute(n)),t)),{}))(e);return I(o),()=>{r.disconnect()}}),[t]);const W={id:e,anchorId:t,className:l,classNameArrow:s,content:w,isHtmlContent:D,place:_,variant:R,offset:T,wrapper:N,events:C,delayShow:j,delayHide:P,isOpen:v,setIsOpen:b};return d?a.exports.jsx(se,{...W,children:d}):a.exports.jsx(se,{...W})};export{ue as Tooltip};
6
+ */s=c,function(){var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)){if(o.length){var a=t.apply(null,o);a&&n.push(a)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){n.push(o.toString());continue}for(var l in o)e.call(o,l)&&o[l]&&n.push(l)}}}return n.join(" ")}s.exports?(t.default=t,s.exports=t):window.classNames=t}();var u=c.exports;const f=(e,t,n)=>{let r;return function(){const o=this,i=arguments,a=()=>{r=null,n||e.apply(o,i)};clearTimeout(r),r=setTimeout(a,t)}},p=({content:e})=>a.exports.jsx("span",{dangerouslySetInnerHTML:{__html:e}});function d(e){return e.split("-")[0]}function y(e){return e.split("-")[1]}function m(e){return["top","bottom"].includes(d(e))?"x":"y"}function h(e){return"y"===e?"height":"width"}function g(e,t,n){let{reference:r,floating:o}=e;const i=r.x+r.width/2-o.width/2,a=r.y+r.height/2-o.height/2,l=m(t),s=h(l),c=r[s]/2-o[s]/2,u="x"===l;let f;switch(d(t)){case"top":f={x:i,y:r.y-o.height};break;case"bottom":f={x:i,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:a};break;case"left":f={x:r.x-o.width,y:a};break;default:f={x:r.x,y:r.y}}switch(y(t)){case"start":f[l]-=c*(n&&u?-1:1);break;case"end":f[l]+=c*(n&&u?-1:1)}return f}function v(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function b(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function w(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=t,y=v(d),m=l[p?"floating"===f?"reference":"floating":f],h=b(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:c,rootBoundary:u,strategy:s})),g=b(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:"floating"===f?{...a.floating,x:r,y:o}:a.reference,offsetParent:await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),strategy:s}):a[f]);return{top:h.top-g.top+y.top,bottom:g.bottom-h.bottom+y.bottom,left:h.left-g.left+y.left,right:g.right-h.right+y.right}}const x=Math.min,_=Math.max;function S(e,t,n){return _(e,x(t,n))}const R={left:"right",right:"left",bottom:"top",top:"bottom"};function k(e){return e.replace(/left|right|bottom|top/g,(e=>R[e]))}const T={start:"end",end:"start"};function O(e){return e.replace(/start|end/g,(e=>T[e]))}const j=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:l,elements:s}=t,{mainAxis:c=!0,crossAxis:u=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",flipAlignment:g=!0,...v}=e,b=d(r),x=f||(b===a||!g?[k(a)]:function(e){const t=k(e);return[O(e),t,O(t)]}(a)),_=[a,...x],S=await w(t,v),R=[];let T=(null==(n=o.flip)?void 0:n.overflows)||[];if(c&&R.push(S[b]),u){const{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);const r=y(e),o=m(e),i=h(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=k(a)),{main:a,cross:k(a)}}(r,i,await(null==l.isRTL?void 0:l.isRTL(s.floating)));R.push(S[e],S[t])}if(T=[...T,{placement:r,overflows:R}],!R.every((e=>e<=0))){var j,E;const e=(null!=(j=null==(E=o.flip)?void 0:E.index)?j:0)+1,t=_[e];if(t)return{data:{index:e,overflows:T},reset:{placement:t}};let n="bottom";switch(p){case"bestFit":{var P;const e=null==(P=T.map((e=>[e,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:P[0].placement;e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}};const E=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,o=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=d(n),l=y(n),s="x"===m(n),c=["left","top"].includes(a)?-1:1,u=i&&s?-1:1,f="function"==typeof t?t(e):t;let{mainAxis:p,crossAxis:h,alignmentAxis:g}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&"number"==typeof g&&(h="end"===l?-1*g:g),s?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return{x:n+o.x,y:r+o.y,data:o}}}};function P(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function A(e){if(null==e)return window;if(!P(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function N(e){return A(e).getComputedStyle(e)}function L(e){return P(e)?"":e?(e.nodeName||"").toLowerCase():""}function C(){const e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map((e=>e.brand+"/"+e.version)).join(" "):navigator.userAgent}function $(e){return e instanceof A(e).HTMLElement}function D(e){return e instanceof A(e).Element}function F(e){if("undefined"==typeof ShadowRoot)return!1;return e instanceof A(e).ShadowRoot||e instanceof ShadowRoot}function I(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=N(e);return/auto|scroll|overlay|hidden/.test(t+r+n)&&!["inline","contents"].includes(o)}function W(e){return["table","td","th"].includes(L(e))}function H(e){const t=/firefox/i.test(C()),n=N(e),r=n.backdropFilter||n.WebkitBackdropFilter;return"none"!==n.transform||"none"!==n.perspective||!!r&&"none"!==r||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter||["transform","perspective"].some((e=>n.willChange.includes(e)))||["paint","layout","strict","content"].some((e=>{const t=n.contain;return null!=t&&t.includes(e)}))}function M(){return!/^((?!chrome|android).)*safari/i.test(C())}function U(e){return["html","body","#document"].includes(L(e))}const B=Math.min,V=Math.max,z=Math.round;function Y(e,t,n){var r,o,i,a;void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect();let s=1,c=1;t&&$(e)&&(s=e.offsetWidth>0&&z(l.width)/e.offsetWidth||1,c=e.offsetHeight>0&&z(l.height)/e.offsetHeight||1);const u=D(e)?A(e):window,f=!M()&&n,p=(l.left+(f&&null!=(r=null==(o=u.visualViewport)?void 0:o.offsetLeft)?r:0))/s,d=(l.top+(f&&null!=(i=null==(a=u.visualViewport)?void 0:a.offsetTop)?i:0))/c,y=l.width/s,m=l.height/c;return{width:y,height:m,top:d,right:p+y,bottom:d+m,left:p,x:p,y:d}}function q(e){return(t=e,(t instanceof A(t).Node?e.ownerDocument:e.document)||window.document).documentElement;var t}function X(e){return D(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function J(e){return Y(q(e)).left+X(e).scrollLeft}function K(e,t,n){const r=$(t),o=q(t),i=Y(e,r&&function(e){const t=Y(e);return z(t.width)!==e.offsetWidth||z(t.height)!==e.offsetHeight}(t),"fixed"===n);let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if(r||!r&&"fixed"!==n)if(("body"!==L(t)||I(o))&&(a=X(t)),$(t)){const e=Y(t,!0);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=J(o));return{x:i.left+a.scrollLeft-l.x,y:i.top+a.scrollTop-l.y,width:i.width,height:i.height}}function Z(e){if("html"===L(e))return e;const t=e.assignedSlot||e.parentNode||(F(e)?e.host:null)||q(e);return F(t)?t.host:t}function G(e){return $(e)&&"fixed"!==N(e).position?e.offsetParent:null}function Q(e){const t=A(e);let n=G(e);for(;n&&W(n)&&"static"===N(n).position;)n=G(n);return n&&("html"===L(n)||"body"===L(n)&&"static"===N(n).position&&!H(n))?t:n||function(e){let t=Z(e);for(;$(t)&&!U(t);){if(H(t))return t;t=Z(t)}return null}(e)||t}function ee(e){if($(e))return{width:e.offsetWidth,height:e.offsetHeight};const t=Y(e);return{width:t.width,height:t.height}}function te(e){const t=Z(e);return U(t)?e.ownerDocument.body:$(t)&&I(t)?t:te(t)}function ne(e,t){var n;void 0===t&&(t=[]);const r=te(e),o=r===(null==(n=e.ownerDocument)?void 0:n.body),i=A(r),a=o?[i].concat(i.visualViewport||[],I(r)?r:[]):r,l=t.concat(a);return o?l:l.concat(ne(a))}function re(e,t,n){return"viewport"===t?b(function(e,t){const n=A(e),r=q(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,s=0;if(o){i=o.width,a=o.height;const e=M();(e||!e&&"fixed"===t)&&(l=o.offsetLeft,s=o.offsetTop)}return{width:i,height:a,x:l,y:s}}(e,n)):D(t)?function(e,t){const n=Y(e,!1,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft;return{top:r,left:o,x:o,y:r,right:o+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):b(function(e){var t;const n=q(e),r=X(e),o=null==(t=e.ownerDocument)?void 0:t.body,i=V(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=V(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let l=-r.scrollLeft+J(e);const s=-r.scrollTop;return"rtl"===N(o||n).direction&&(l+=V(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:l,y:s}}(q(e)))}const oe={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?function(e){let t=ne(e).filter((e=>D(e)&&"body"!==L(e))),n=e,r=null;for(;D(n)&&!U(n);){const e=N(n);"static"===e.position&&r&&["absolute","fixed"].includes(r.position)&&!H(n)?t=t.filter((e=>e!==n)):r=e,n=Z(n)}return t}(t):[].concat(n),a=[...i,r],l=a[0],s=a.reduce(((e,n)=>{const r=re(t,n,o);return e.top=V(r.top,e.top),e.right=B(r.right,e.right),e.bottom=B(r.bottom,e.bottom),e.left=V(r.left,e.left),e}),re(t,l,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=$(n),i=q(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0};const l={x:0,y:0};if((o||!o&&"fixed"!==r)&&(("body"!==L(n)||I(i))&&(a=X(n)),$(n))){const e=Y(n,!0);l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+l.x,y:t.y-a.scrollTop+l.y}},isElement:D,getDimensions:ee,getOffsetParent:Q,getDocumentElement:q,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:K(t,Q(n),r),floating:{...ee(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===N(e).direction},ie=(e,t,n)=>(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),s=await(null==a.isRTL?void 0:a.isRTL(t));if(null==a&&console.error(["Floating UI: `platform` property was not passed to config. If you","want to use Floating UI on the web, install @floating-ui/dom","instead of the /core package. Otherwise, you can create your own","`platform`: https://floating-ui.com/docs/platform"].join(" ")),l.filter((e=>{let{name:t}=e;return"autoPlacement"===t||"flip"===t})).length>1)throw new Error(["Floating UI: duplicate `flip` and/or `autoPlacement` middleware","detected. This will lead to an infinite loop. Ensure only one of","either has been passed to the `middleware` array."].join(" "));e&&t||console.error(["Floating UI: The reference and/or floating element was not defined","when `computePosition()` was called. Ensure that both elements have","been created and can be measured."].join(" "));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=g(c,r,s),p=r,d={},y=0;for(let n=0;n<l.length;n++){const{name:i,fn:m}=l[n],{x:h,y:v,data:b,reset:w}=await m({x:u,y:f,initialPlacement:r,placement:p,strategy:o,middlewareData:d,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=h?h:u,f=null!=v?v:f,d={...d,[i]:{...d[i],...b}},y>50&&console.warn(["Floating UI: The middleware lifecycle appears to be running in an","infinite loop. This is usually caused by a `reset` continually","being returned without a break condition."].join(" ")),w&&y<=50&&(y++,"object"==typeof w&&(w.placement&&(p=w.placement),w.rects&&(c=!0===w.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:u,y:f}=g(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:o,middlewareData:d}})(e,t,{platform:oe,...n}),ae=async({elementReference:e=null,tooltipReference:t=null,tooltipArrowReference:n=null,place:r="top",offset:o=10})=>{if(!e)return{tooltipStyles:{},tooltipArrowStyles:{}};if(null===t)return{tooltipStyles:{},tooltipArrowStyles:{}};const i=[E(Number(o)),j(),(a={padding:5},void 0===a&&(a={}),{name:"shift",options:a,async fn(e){const{x:t,y:n,placement:r}=e,{mainAxis:o=!0,crossAxis:i=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...s}=a,c={x:t,y:n},u=await w(e,s),f=m(d(r)),p="x"===f?"y":"x";let y=c[f],h=c[p];if(o){const e="y"===f?"bottom":"right";y=S(y+u["y"===f?"top":"left"],y,y-u[e])}if(i){const e="y"===p?"bottom":"right";h=S(h+u["y"===p?"top":"left"],h,h-u[e])}const g=l.fn({...e,[f]:y,[p]:h});return{...g,data:{x:g.x-t,y:g.y-n}}}})];var a;return n?(i.push((e=>({name:"arrow",options:e,async fn(t){const{element:n,padding:r=0}=null!=e?e:{},{x:o,y:i,placement:a,rects:l,platform:s}=t;if(null==n)return console.warn("Floating UI: No `element` was passed to the `arrow` middleware."),{};const c=v(r),u={x:o,y:i},f=m(a),p=y(a),d=h(f),g=await s.getDimensions(n),b="y"===f?"top":"left",w="y"===f?"bottom":"right",x=l.reference[d]+l.reference[f]-u[f]-l.floating[d],_=u[f]-l.reference[f],R=await(null==s.getOffsetParent?void 0:s.getOffsetParent(n));let k=R?"y"===f?R.clientHeight||0:R.clientWidth||0:0;0===k&&(k=l.floating[d]);const T=x/2-_/2,O=c[b],j=k-g[d]-c[w],E=k/2-g[d]/2+T,P=S(O,E,j),A=("start"===p?c[b]:c[w])>0&&E!==P&&l.reference[d]<=l.floating[d];return{[f]:u[f]-(A?E<O?O-E:j-E:0),data:{[f]:P,centerOffset:E-P}}}}))({element:n})),ie(e,t,{placement:r,middleware:i}).then((({x:e,y:t,placement:n,middlewareData:r})=>{const o={left:`${e}px`,top:`${t}px`},{x:i,y:a}=r.arrow;return{tooltipStyles:o,tooltipArrowStyles:{left:null!=i?`${i}px`:"",top:null!=a?`${a}px`:"",right:"",bottom:"",[{top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]]]:"-4px"}}}))):ie(e,t,{placement:"bottom",middleware:i}).then((({x:e,y:t})=>({tooltipStyles:{left:`${e}px`,top:`${t}px`},tooltipArrowStyles:{}})))};var le={tooltip:"styles-module_tooltip__mnnfp",arrow:"styles-module_arrow__K0L3T",show:"styles-module_show__2NboJ",dark:"styles-module_dark__xNqje",light:"styles-module_light__Z6W-X",success:"styles-module_success__A2AKt",warning:"styles-module_warning__SCK0X",error:"styles-module_error__JvumD",info:"styles-module_info__BWdHW"};const se=({id:e=i(),className:l,classNameArrow:s,variant:c="dark",anchorId:d,place:y="top",offset:m=10,events:h=["hover"],wrapper:g="div",children:v=null,delayShow:b=0,delayHide:w=0,isHtmlContent:x=!1,content:_,isOpen:S,setIsOpen:R})=>{const k=t(),T=t(),O=n(),j=n(),[E,P]=r({}),[A,N]=r({}),[L,C]=r(!1),$=e=>{R?R(e):void 0===S&&C(e)},D=()=>{R?R(!S):void 0===S&&C((e=>!e))},F=f((()=>{b?(O.current&&clearTimeout(O.current),O.current=setTimeout((()=>{$(!0)}),b)):$(!0),j.current&&clearTimeout(j.current)}),50),I=f((()=>{w?(j.current&&clearTimeout(j.current),j.current=setTimeout((()=>{$(!1)}),w)):$(!1),L&&O.current?clearTimeout(O.current):!L&&O.current&&(j.current=setTimeout((()=>{$(!1)}),2*b))}),50);return o((()=>{const e=document.querySelector(`#${d}`);if(!e)return()=>{};const t=[];return h.find((e=>"click"===e))&&t.push({event:"click",listener:D}),h.find((e=>"hover"===e))&&t.push({event:"mouseenter",listener:F},{event:"mouseleave",listener:I},{event:"focus",listener:F},{event:"blur",listener:I}),t.forEach((({event:t,listener:n})=>{null==e||e.addEventListener(t,n)})),()=>{t.forEach((({event:t,listener:n})=>{null==e||e.removeEventListener(t,n)}))}}),[d,h,w,b]),o((()=>{const e=document.querySelector(`#${d}`);return ae({place:y,offset:m,elementReference:e,tooltipReference:k.current,tooltipArrowReference:T.current}).then((e=>{Object.keys(e.tooltipStyles).length&&P(e.tooltipStyles),Object.keys(e.tooltipArrowStyles).length&&N(e.tooltipArrowStyles)})),()=>{O.current=void 0,j.current=void 0}}),[L,S,d]),a.exports.jsxs(g,{id:e,role:"tooltip",className:u(le.tooltip,le[c],l,{[le.show]:S||L}),style:E,ref:k,children:[v||(x?a.exports.jsx(p,{content:_}):_),a.exports.jsx("div",{className:u(le.arrow,s),style:A,ref:T})]})},ce=["place","content","html","variant","offset","wrapper","events","delay-show","delay-hide"],ue=({id:e,anchorId:t,content:n,html:i,className:l,classNameArrow:s,variant:c="dark",place:u="top",offset:f=10,wrapper:p="div",children:d=null,events:y=["hover"],delayShow:m=0,delayHide:h=0,getContent:g,isOpen:v,setIsOpen:b})=>{const[w,x]=r(n||i),[_,S]=r(u),[R,k]=r(c),[T,O]=r(f),[j,E]=r(m),[P,A]=r(h),[N,L]=r(p),[C,$]=r(y),[D,F]=r(Boolean(i)),I=e=>{const t=Object.keys(e);let n=null;const r={place:e=>{S(e)},content:e=>{F(!0),x(g?g(e):e)},html:e=>{F(!0),x(g?g(e):e)},variant:e=>{k(e)},offset:e=>{O(e)},wrapper:e=>{L(e)},events:e=>{const t=e.split(" ");$(t)},"delay-show":e=>{E(Number(e))},"delay-hide":e=>{A(Number(e))}};t.forEach((t=>{n=t.replace("data-tooltip-",""),ce.includes(n)&&r[n](e[t])}))};o((()=>{if(!t)return()=>{};const e=document.querySelector(`#${t}`);if(!e)return()=>{};n&&g&&x(g(n));const r=new MutationObserver((t=>{t.forEach((t=>{if("attributes"===t.type){const n=(({element:e,attributeName:t})=>({[t]:e.getAttribute(t)}))({element:e,attributeName:t.attributeName});I(n)}}))}));r.observe(e,{attributes:!0,childList:!1,subtree:!1});const o=(e=>null==e?void 0:e.getAttributeNames().reduce(((t,n)=>(n.includes("data-tooltip-")&&(t[n]=null==e?void 0:e.getAttribute(n)),t)),{}))(e);return I(o),()=>{r.disconnect()}}),[t]);const W={id:e,anchorId:t,className:l,classNameArrow:s,content:w,isHtmlContent:D,place:_,variant:R,offset:T,wrapper:N,events:C,delayShow:j,delayHide:P,isOpen:v,setIsOpen:b};return d?a.exports.jsx(se,{...W,children:d}):a.exports.jsx(se,{...W})};export{ue as Tooltip};
@@ -1413,13 +1413,9 @@
1413
1413
  func.apply(context, args);
1414
1414
  }
1415
1415
  };
1416
- const callNow = immediate && !timeout;
1417
1416
  // @ts-ignore
1418
1417
  clearTimeout(timeout);
1419
1418
  timeout = setTimeout(later, wait);
1420
- if (callNow) {
1421
- func.apply(context, args);
1422
- }
1423
1419
  };
1424
1420
  };
1425
1421
 
@@ -2613,9 +2609,10 @@
2613
2609
  });
2614
2610
 
2615
2611
  const computeToolTipPosition = async ({ elementReference = null, tooltipReference = null, tooltipArrowReference = null, place = 'top', offset: offsetValue = 10, }) => {
2616
- if (elementReference === null) {
2612
+ if (!elementReference) {
2613
+ // elementReference can be null or undefined and we will not compute the position
2617
2614
  // eslint-disable-next-line no-console
2618
- console.error('The reference element for tooltip was not defined: ', elementReference);
2615
+ // console.error('The reference element for tooltip was not defined: ', elementReference)
2619
2616
  return { tooltipStyles: {}, tooltipArrowStyles: {} };
2620
2617
  }
2621
2618
  if (tooltipReference === null) {