@openviking/react 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/LICENSE.arco-design +21 -0
  2. package/README.md +25 -15
  3. package/dist/0~0.js +19 -0
  4. package/dist/2~0.js +2360 -0
  5. package/dist/2~0.js.LICENSE.txt +23 -0
  6. package/dist/3c~0.js +2206 -0
  7. package/dist/3~0.js +1205 -1982
  8. package/dist/4~0.js +18 -0
  9. package/dist/9~0.js +43 -0
  10. package/dist/ae~0.js +487 -0
  11. package/dist/ark-message-list-view~0.js +530 -119
  12. package/dist/a~0.js +1289 -10
  13. package/dist/c7~0.js +38 -2
  14. package/dist/ck~0.js +23 -0
  15. package/dist/client/index.d.ts +2 -1
  16. package/dist/client/paths.d.ts +64 -0
  17. package/dist/client/provider.d.ts +5 -3
  18. package/dist/client/response.d.ts +31 -0
  19. package/dist/client/sse.d.ts +39 -0
  20. package/dist/client/stream.d.ts +26 -0
  21. package/dist/client/types.d.ts +109 -5
  22. package/dist/client.js +2 -239
  23. package/dist/components/agent-connect/agent-connect-copy.d.ts +19 -33
  24. package/dist/components/agent-connect/agent-connect-design.d.ts +1935 -167
  25. package/dist/components/agent-connect/agent-connect-instructions.d.ts +135 -0
  26. package/dist/components/agent-connect/locales/en-US.d.ts +20 -0
  27. package/dist/components/agent-connect/locales/zh-CN.d.ts +3 -0
  28. package/dist/components/agent-connect/style.css +14 -2
  29. package/dist/components/agent-connect/types.d.ts +2 -1
  30. package/dist/components/directory-tour/directory-tour.d.ts +3 -0
  31. package/dist/components/directory-tour/index.d.ts +3 -0
  32. package/dist/components/directory-tour/locales/en-US.d.ts +3 -0
  33. package/dist/components/directory-tour/locales/zh-CN.d.ts +3 -0
  34. package/dist/components/directory-tour/steps.d.ts +5 -0
  35. package/dist/components/directory-tour/style.css +237 -0
  36. package/dist/components/directory-tour/style.js +0 -0
  37. package/dist/components/directory-tour/types.d.ts +42 -0
  38. package/dist/components/directory-tour/use-tour-anchor.d.ts +5 -0
  39. package/dist/components/directory-tour/use-tour-position.d.ts +12 -0
  40. package/dist/components/directory-tour.js +40 -0
  41. package/dist/components/file-browser-entries/file-browser-entries-icons.d.ts +18 -0
  42. package/dist/components/file-browser-entries/file-browser-entries.d.ts +14 -0
  43. package/dist/components/file-browser-entries/index.d.ts +1 -0
  44. package/dist/components/file-browser-entries/labels.d.ts +3 -0
  45. package/dist/components/file-browser-entries/locales/en-US.d.ts +6 -0
  46. package/dist/components/file-browser-entries/locales/zh-CN.d.ts +6 -0
  47. package/dist/components/file-browser-entries/style.css +905 -0
  48. package/dist/components/file-browser-entries/style.js +0 -0
  49. package/dist/components/file-browser-entries/types.d.ts +63 -0
  50. package/dist/components/file-browser-entries.js +1 -0
  51. package/dist/components/file-preview/file-preview-adapters.d.ts +2 -1
  52. package/dist/components/file-preview/file-preview-body.d.ts +2 -1
  53. package/dist/components/file-preview/file-preview-breadcrumb-menu.d.ts +2 -1
  54. package/dist/components/file-preview/file-preview-breadcrumb.d.ts +2 -1
  55. package/dist/components/file-preview/file-preview-directory.d.ts +33 -0
  56. package/dist/components/file-preview/file-preview-handle-adapters.d.ts +2 -1
  57. package/dist/components/file-preview/file-preview-header.d.ts +25 -3
  58. package/dist/components/file-preview/file-preview-image-frame.d.ts +5 -0
  59. package/dist/components/file-preview/file-preview-labels.d.ts +2 -14
  60. package/dist/components/file-preview/file-preview-level-tabs.d.ts +7 -0
  61. package/dist/components/file-preview/file-preview-markdown-images.d.ts +13 -0
  62. package/dist/components/file-preview/file-preview-panels.d.ts +44 -0
  63. package/dist/components/file-preview/file-preview-state.d.ts +10 -3
  64. package/dist/components/file-preview/file-preview-viewer.d.ts +2 -1
  65. package/dist/components/file-preview/file-preview.d.ts +1 -1
  66. package/dist/components/file-preview/index.d.ts +2 -1
  67. package/dist/components/file-preview/level-selection.d.ts +25 -0
  68. package/dist/components/file-preview/locales/en-US.d.ts +16 -0
  69. package/dist/components/file-preview/locales/zh-CN.d.ts +16 -0
  70. package/dist/components/file-preview/style.css +234 -3
  71. package/dist/components/file-preview/types.d.ts +134 -11
  72. package/dist/components/file-preview/use-directory-level.d.ts +30 -0
  73. package/dist/components/file-preview/use-file-preview-actions-context.d.ts +6 -2
  74. package/dist/components/file-preview/use-file-preview-actions.d.ts +1 -1
  75. package/dist/components/file-preview/use-file-preview-levels.d.ts +7 -0
  76. package/dist/components/file-preview/use-file-preview-view-state.d.ts +15 -0
  77. package/dist/components/file-preview.js +1 -1
  78. package/dist/components/file-tree/file-tree-info-labels.d.ts +0 -15
  79. package/dist/components/file-tree/file-tree-info-tooltip.d.ts +7 -7
  80. package/dist/components/file-tree/file-tree-labels.d.ts +4 -0
  81. package/dist/components/file-tree/file-tree-row-context.d.ts +0 -5
  82. package/dist/components/file-tree/file-tree-row-shared.d.ts +1 -4
  83. package/dist/components/file-tree/file-tree-toolbar.d.ts +11 -0
  84. package/dist/components/file-tree/file-tree-tooltip-surface.d.ts +8 -8
  85. package/dist/components/file-tree/locales/en-US.d.ts +69 -0
  86. package/dist/components/file-tree/locales/zh-CN.d.ts +69 -0
  87. package/dist/components/file-tree/style.css +207 -42
  88. package/dist/components/file-tree/types.d.ts +58 -10
  89. package/dist/components/file-tree/use-file-tree-actions.d.ts +4 -1
  90. package/dist/components/scope-switcher/labels.d.ts +3 -0
  91. package/dist/components/scope-switcher/locales/en-US.d.ts +8 -0
  92. package/dist/components/scope-switcher/locales/zh-CN.d.ts +8 -0
  93. package/dist/components/scope-switcher/scope-panel.d.ts +1 -1
  94. package/dist/components/scope-switcher/scope-switcher.d.ts +1 -1
  95. package/dist/components/scope-switcher/style.css +14 -2
  96. package/dist/components/scope-switcher/types.d.ts +11 -5
  97. package/dist/components/style.css +10144 -6840
  98. package/dist/components/tui/locales/en-US.d.ts +35 -0
  99. package/dist/components/tui/locales/zh-CN.d.ts +35 -0
  100. package/dist/components/tui/style.css +310 -18
  101. package/dist/components/tui/tui-copy-button.d.ts +1 -1
  102. package/dist/components/tui/tui-empty.d.ts +25 -0
  103. package/dist/components/tui/tui-labels.d.ts +2 -2
  104. package/dist/components/tui/tui.d.ts +1 -1
  105. package/dist/components/tui/types.d.ts +35 -12
  106. package/dist/components/tui.js +1 -1
  107. package/dist/components/viking-bot/ark-adapter.d.ts +2 -0
  108. package/dist/components/viking-bot/ark-message-body.d.ts +1 -7
  109. package/dist/components/viking-bot/ark-message-list-view.d.ts +1 -1
  110. package/dist/components/viking-bot/ark-message-row.d.ts +3 -1
  111. package/dist/components/viking-bot/bot-popover.d.ts +9 -0
  112. package/dist/components/viking-bot/capabilities.d.ts +49 -0
  113. package/dist/components/viking-bot/composer-attachments.d.ts +13 -0
  114. package/dist/components/viking-bot/composer-controls.d.ts +10 -0
  115. package/dist/components/viking-bot/composer-footer.d.ts +17 -0
  116. package/dist/components/viking-bot/composer-references.d.ts +20 -0
  117. package/dist/components/viking-bot/composer-text.d.ts +10 -0
  118. package/dist/components/viking-bot/index.d.ts +3 -1
  119. package/dist/components/viking-bot/interaction/ask-human-fields.d.ts +1 -1
  120. package/dist/components/viking-bot/interaction/labels.d.ts +2 -1
  121. package/dist/components/viking-bot/interaction/locales/en-US.d.ts +17 -0
  122. package/dist/components/viking-bot/interaction/locales/zh-CN.d.ts +17 -0
  123. package/dist/components/viking-bot/interaction/types.d.ts +8 -3
  124. package/dist/components/viking-bot/interaction/viking-bot-interaction.d.ts +1 -1
  125. package/dist/components/viking-bot/labels.d.ts +2 -0
  126. package/dist/components/viking-bot/locales/en-US.d.ts +40 -0
  127. package/dist/components/viking-bot/locales/zh-CN.d.ts +40 -0
  128. package/dist/components/viking-bot/markdown-links.d.ts +27 -0
  129. package/dist/components/viking-bot/message-activity.d.ts +7 -0
  130. package/dist/components/viking-bot/message-code-block.d.ts +8 -0
  131. package/dist/components/viking-bot/message-footer.d.ts +8 -0
  132. package/dist/components/viking-bot/message-markdown.d.ts +9 -0
  133. package/dist/components/viking-bot/model.d.ts +37 -3
  134. package/dist/components/viking-bot/quick-input-tracker.d.ts +16 -0
  135. package/dist/components/viking-bot/quick-inputs.d.ts +6 -0
  136. package/dist/components/viking-bot/reference-picker.d.ts +16 -0
  137. package/dist/components/viking-bot/session-actions.d.ts +11 -0
  138. package/dist/components/viking-bot/style.css +1486 -48
  139. package/dist/components/viking-bot/tool-activity.d.ts +9 -0
  140. package/dist/components/viking-bot/tool-result-links.d.ts +6 -0
  141. package/dist/components/viking-bot/types.d.ts +21 -9
  142. package/dist/components/viking-bot/use-quick-input.d.ts +17 -0
  143. package/dist/components/viking-bot/viking-bot.d.ts +1 -6
  144. package/dist/components/viking-bot/welcome.d.ts +8 -0
  145. package/dist/components/viking-bot.js +1 -1
  146. package/dist/c~0.js +533 -66
  147. package/dist/e~0.js +333 -0
  148. package/dist/file-preview-viewer~0.js +90 -8
  149. package/dist/f~0.js +39 -47
  150. package/dist/h~0.js +5 -1
  151. package/dist/icons/console-icons.d.ts +12 -0
  152. package/dist/icons/index.d.ts +2 -0
  153. package/dist/icons/viking-bot-icons.d.ts +6 -0
  154. package/dist/icons.js +1 -0
  155. package/dist/index.d.ts +4 -0
  156. package/dist/index.js +3 -1
  157. package/dist/k~0.js +1 -0
  158. package/dist/lg~0.js +155 -0
  159. package/dist/lk~0.js +37 -8
  160. package/dist/l~0.js +1447 -25
  161. package/dist/modules/console/command-messages.d.ts +19 -0
  162. package/dist/modules/console/command-parser.d.ts +15 -0
  163. package/dist/modules/console/command-specs.d.ts +15 -0
  164. package/dist/modules/console/commands.d.ts +6 -0
  165. package/dist/modules/console/console-history.d.ts +10 -0
  166. package/dist/modules/console/console-toolbar.d.ts +18 -0
  167. package/dist/modules/console/console.d.ts +1 -3
  168. package/dist/modules/console/controller.d.ts +17 -0
  169. package/dist/modules/console/index.d.ts +2 -0
  170. package/dist/modules/console/labels.d.ts +61 -0
  171. package/dist/modules/console/locales/en-US.d.ts +49 -0
  172. package/dist/modules/console/locales/zh-CN.d.ts +3 -0
  173. package/dist/modules/console/localize-records.d.ts +11 -0
  174. package/dist/modules/console/results.d.ts +2 -0
  175. package/dist/modules/console/style.css +10905 -15
  176. package/dist/modules/console/types.d.ts +59 -80
  177. package/dist/modules/console/use-console.d.ts +3 -0
  178. package/dist/modules/console.js +1 -1
  179. package/dist/modules/file-browser/file-browser-detail-icons.d.ts +10 -0
  180. package/dist/modules/file-browser/file-browser-detail.d.ts +34 -0
  181. package/dist/modules/file-browser/file-browser-empty.d.ts +3 -0
  182. package/dist/modules/file-browser/file-browser-failure.d.ts +22 -0
  183. package/dist/modules/file-browser/file-browser-icons.d.ts +18 -0
  184. package/dist/modules/file-browser/file-browser-labels.d.ts +27 -0
  185. package/dist/modules/file-browser/file-browser-layout.d.ts +27 -0
  186. package/dist/modules/file-browser/file-browser-toolbar.d.ts +17 -0
  187. package/dist/modules/file-browser/file-browser-tree-pane.d.ts +32 -0
  188. package/dist/modules/file-browser/file-browser.d.ts +14 -5
  189. package/dist/modules/file-browser/find-result.d.ts +24 -0
  190. package/dist/modules/file-browser/fs-directories.d.ts +33 -0
  191. package/dist/modules/file-browser/fs-file-kind.d.ts +19 -0
  192. package/dist/modules/file-browser/fs-icon.d.ts +17 -0
  193. package/dist/modules/file-browser/fs-model.d.ts +106 -0
  194. package/dist/modules/file-browser/fs-page.d.ts +16 -0
  195. package/dist/modules/file-browser/fs-path.d.ts +16 -0
  196. package/dist/modules/file-browser/fs-read-directory.d.ts +16 -0
  197. package/dist/modules/file-browser/fs-scope.d.ts +22 -0
  198. package/dist/modules/file-browser/fs-stat.d.ts +25 -0
  199. package/dist/modules/file-browser/index.d.ts +3 -1
  200. package/dist/modules/file-browser/locales/en-US.d.ts +25 -0
  201. package/dist/modules/file-browser/locales/zh-CN.d.ts +25 -0
  202. package/dist/modules/file-browser/style.css +6388 -41
  203. package/dist/modules/file-browser/types.d.ts +206 -52
  204. package/dist/modules/file-browser/use-container-width.d.ts +17 -0
  205. package/dist/modules/file-browser/use-file-browser.d.ts +54 -0
  206. package/dist/modules/file-browser/use-fs-preview.d.ts +65 -0
  207. package/dist/modules/file-browser/use-fs-search.d.ts +35 -0
  208. package/dist/modules/file-browser/use-fs-tree.d.ts +43 -0
  209. package/dist/modules/file-browser/use-request-scope.d.ts +39 -0
  210. package/dist/modules/file-browser.js +1 -1
  211. package/dist/modules/scope-cascade/labels.d.ts +6 -0
  212. package/dist/modules/scope-cascade/locales/en-US.d.ts +6 -0
  213. package/dist/modules/scope-cascade/locales/zh-CN.d.ts +3 -0
  214. package/dist/modules/scope-cascade/scope-cascade.d.ts +1 -1
  215. package/dist/modules/scope-cascade/style.css +14 -2
  216. package/dist/modules/scope-cascade/types.d.ts +3 -0
  217. package/dist/modules/style.css +17338 -77
  218. package/dist/nx~0.js +15 -0
  219. package/dist/n~0.js +403 -144
  220. package/dist/o~0.js +106 -0
  221. package/dist/p~0.js +27 -0
  222. package/dist/rslib-runtime~0.js +42 -0
  223. package/dist/r~0.js +152 -0
  224. package/dist/shared/components/divider/divider.d.ts +18 -0
  225. package/dist/shared/components/divider/index.d.ts +1 -0
  226. package/dist/shared/components/divider/types.d.ts +35 -0
  227. package/dist/shared/components/drawer/drawer.d.ts +13 -0
  228. package/dist/shared/components/drawer/index.d.ts +1 -0
  229. package/dist/shared/components/overlay/types.d.ts +7 -0
  230. package/dist/shared/components/{tooltip/use-tooltip-position.d.ts → overlay/use-overlay-position.d.ts} +6 -6
  231. package/dist/shared/components/popover/index.d.ts +1 -0
  232. package/dist/shared/components/popover/popover.d.ts +23 -0
  233. package/dist/shared/components/popover/types.d.ts +50 -0
  234. package/dist/shared/components/resizable/clamp.d.ts +13 -0
  235. package/dist/shared/components/resizable/index.d.ts +2 -0
  236. package/dist/shared/components/resizable/resizable-handle.d.ts +25 -0
  237. package/dist/shared/components/resizable/types.d.ts +48 -0
  238. package/dist/shared/components/tooltip/types.d.ts +5 -5
  239. package/dist/shared/components/tooltip/use-portal-theme.d.ts +3 -0
  240. package/dist/shared/locale.d.ts +6 -0
  241. package/dist/style.css +27753 -7176
  242. package/dist/u~0.js +75 -58
  243. package/dist/viking-bot-composer~0.js +434 -77
  244. package/dist/viking-bot-interaction~0.js +11 -11
  245. package/package.json +18 -4
  246. package/dist/components/file-tree/file-tree-tooltip.d.ts +0 -17
  247. package/dist/components/tui/tui-labels-zh.d.ts +0 -2
  248. package/dist/g~0.js +0 -1207
  249. package/dist/modules/file-browser/file-browser-toolbar-button.d.ts +0 -10
package/dist/2~0.js ADDED
@@ -0,0 +1,2360 @@
1
+ /*! LICENSE: 2~0.js.LICENSE.txt */
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import react, { Fragment, PureComponent, createContext, forwardRef, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
4
+ import { createPortal } from "react-dom";
5
+ import { CSSTransition } from "react-transition-group";
6
+ import { __webpack_require__ } from "./rslib-runtime~0.js";
7
+ import { resolveLocale } from "./nx~0.js";
8
+ import { removereact } from "./4~0.js";
9
+ import { usePortalTheme } from "./9~0.js";
10
+ import { AgentConnect } from "./u~0.js";
11
+ import * as __rspack_external_react from "react";
12
+ __webpack_require__.add({
13
+ N (module) {
14
+ /*
15
+ object-assign
16
+ (c) Sindre Sorhus
17
+ @license MIT
18
+ */ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
19
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
20
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
21
+ function toObject(val) {
22
+ if (null == val) throw new TypeError('Object.assign cannot be called with null or undefined');
23
+ return Object(val);
24
+ }
25
+ function shouldUseNative() {
26
+ try {
27
+ if (!Object.assign) return false;
28
+ var test1 = new String('abc');
29
+ test1[5] = 'de';
30
+ if ('5' === Object.getOwnPropertyNames(test1)[0]) return false;
31
+ var test2 = {};
32
+ for(var i = 0; i < 10; i++)test2['_' + String.fromCharCode(i)] = i;
33
+ var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
34
+ return test2[n];
35
+ });
36
+ if ('0123456789' !== order2.join('')) return false;
37
+ var test3 = {};
38
+ 'abcdefghijklmnopqrst'.split('').forEach(function(letter) {
39
+ test3[letter] = letter;
40
+ });
41
+ if ('abcdefghijklmnopqrst' !== Object.keys(Object.assign({}, test3)).join('')) return false;
42
+ return true;
43
+ } catch (err) {
44
+ return false;
45
+ }
46
+ }
47
+ module.exports = shouldUseNative() ? Object.assign : function(target, source) {
48
+ var from;
49
+ var to = toObject(target);
50
+ var symbols;
51
+ for(var s = 1; s < arguments.length; s++){
52
+ from = Object(arguments[s]);
53
+ for(var key in from)if (hasOwnProperty.call(from, key)) to[key] = from[key];
54
+ if (getOwnPropertySymbols) {
55
+ symbols = getOwnPropertySymbols(from);
56
+ for(var i = 0; i < symbols.length; i++)if (propIsEnumerable.call(from, symbols[i])) to[symbols[i]] = from[symbols[i]];
57
+ }
58
+ }
59
+ return to;
60
+ };
61
+ },
62
+ G (module, __unused_rspack_exports, __webpack_require__) {
63
+ var printWarning = function() {};
64
+ if ('production' !== process.env.NODE_ENV) {
65
+ var ReactPropTypesSecret = __webpack_require__("y");
66
+ var loggedTypeFailures = {};
67
+ var has = __webpack_require__("x");
68
+ printWarning = function(text) {
69
+ var message = 'Warning: ' + text;
70
+ if ("u" > typeof console) console.error(message);
71
+ try {
72
+ throw new Error(message);
73
+ } catch (x) {}
74
+ };
75
+ }
76
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
77
+ if ('production' !== process.env.NODE_ENV) {
78
+ for(var typeSpecName in typeSpecs)if (has(typeSpecs, typeSpecName)) {
79
+ var error;
80
+ try {
81
+ if ('function' != typeof typeSpecs[typeSpecName]) {
82
+ var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
83
+ err.name = 'Invariant Violation';
84
+ throw err;
85
+ }
86
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
87
+ } catch (ex) {
88
+ error = ex;
89
+ }
90
+ if (error && !(error instanceof Error)) printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).");
91
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
92
+ loggedTypeFailures[error.message] = true;
93
+ var stack = getStack ? getStack() : '';
94
+ printWarning('Failed ' + location + ' type: ' + error.message + (null != stack ? stack : ''));
95
+ }
96
+ }
97
+ }
98
+ }
99
+ checkPropTypes.resetWarningCache = function() {
100
+ if ('production' !== process.env.NODE_ENV) loggedTypeFailures = {};
101
+ };
102
+ module.exports = checkPropTypes;
103
+ },
104
+ S (module, __unused_rspack_exports, __webpack_require__) {
105
+ var ReactPropTypesSecret = __webpack_require__("y");
106
+ function emptyFunction() {}
107
+ function emptyFunctionWithReset() {}
108
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
109
+ module.exports = function() {
110
+ function shim(props, propName, componentName, location, propFullName, secret) {
111
+ if (secret === ReactPropTypesSecret) return;
112
+ var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");
113
+ err.name = 'Invariant Violation';
114
+ throw err;
115
+ }
116
+ shim.isRequired = shim;
117
+ function getShim() {
118
+ return shim;
119
+ }
120
+ var ReactPropTypes = {
121
+ array: shim,
122
+ bigint: shim,
123
+ bool: shim,
124
+ func: shim,
125
+ number: shim,
126
+ object: shim,
127
+ string: shim,
128
+ symbol: shim,
129
+ any: shim,
130
+ arrayOf: getShim,
131
+ element: shim,
132
+ elementType: shim,
133
+ instanceOf: getShim,
134
+ node: shim,
135
+ objectOf: getShim,
136
+ oneOf: getShim,
137
+ oneOfType: getShim,
138
+ shape: getShim,
139
+ exact: getShim,
140
+ checkPropTypes: emptyFunctionWithReset,
141
+ resetWarningCache: emptyFunction
142
+ };
143
+ ReactPropTypes.PropTypes = ReactPropTypes;
144
+ return ReactPropTypes;
145
+ };
146
+ },
147
+ IH (module, __unused_rspack_exports, __webpack_require__) {
148
+ var ReactIs = __webpack_require__("vJ");
149
+ var assign = __webpack_require__("N");
150
+ var ReactPropTypesSecret = __webpack_require__("y");
151
+ var has = __webpack_require__("x");
152
+ var checkPropTypes = __webpack_require__("G");
153
+ var printWarning = function() {};
154
+ if ('production' !== process.env.NODE_ENV) printWarning = function(text) {
155
+ var message = 'Warning: ' + text;
156
+ if ("u" > typeof console) console.error(message);
157
+ try {
158
+ throw new Error(message);
159
+ } catch (x) {}
160
+ };
161
+ function emptyFunctionThatReturnsNull() {
162
+ return null;
163
+ }
164
+ module.exports = function(isValidElement, throwOnDirectAccess) {
165
+ var ITERATOR_SYMBOL = 'function' == typeof Symbol && Symbol.iterator;
166
+ var FAUX_ITERATOR_SYMBOL = '@@iterator';
167
+ function getIteratorFn(maybeIterable) {
168
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
169
+ if ('function' == typeof iteratorFn) return iteratorFn;
170
+ }
171
+ var ANONYMOUS = '<<anonymous>>';
172
+ var ReactPropTypes = {
173
+ array: createPrimitiveTypeChecker('array'),
174
+ bigint: createPrimitiveTypeChecker('bigint'),
175
+ bool: createPrimitiveTypeChecker('boolean'),
176
+ func: createPrimitiveTypeChecker('function'),
177
+ number: createPrimitiveTypeChecker('number'),
178
+ object: createPrimitiveTypeChecker('object'),
179
+ string: createPrimitiveTypeChecker('string'),
180
+ symbol: createPrimitiveTypeChecker('symbol'),
181
+ any: createAnyTypeChecker(),
182
+ arrayOf: createArrayOfTypeChecker,
183
+ element: createElementTypeChecker(),
184
+ elementType: createElementTypeTypeChecker(),
185
+ instanceOf: createInstanceTypeChecker,
186
+ node: createNodeChecker(),
187
+ objectOf: createObjectOfTypeChecker,
188
+ oneOf: createEnumTypeChecker,
189
+ oneOfType: createUnionTypeChecker,
190
+ shape: createShapeTypeChecker,
191
+ exact: createStrictShapeTypeChecker
192
+ };
193
+ function is(x, y) {
194
+ if (x === y) return 0 !== x || 1 / x === 1 / y;
195
+ else return x !== x && y !== y;
196
+ }
197
+ function PropTypeError(message, data) {
198
+ this.message = message;
199
+ this.data = data && 'object' == typeof data ? data : {};
200
+ this.stack = '';
201
+ }
202
+ PropTypeError.prototype = Error.prototype;
203
+ function createChainableTypeChecker(validate) {
204
+ if ('production' !== process.env.NODE_ENV) {
205
+ var manualPropTypeCallCache = {};
206
+ var manualPropTypeWarningCount = 0;
207
+ }
208
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
209
+ componentName = componentName || ANONYMOUS;
210
+ propFullName = propFullName || propName;
211
+ if (secret !== ReactPropTypesSecret) {
212
+ if (throwOnDirectAccess) {
213
+ var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");
214
+ err.name = 'Invariant Violation';
215
+ throw err;
216
+ } else if ('production' !== process.env.NODE_ENV && "u" > typeof console) {
217
+ var cacheKey = componentName + ':' + propName;
218
+ if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) {
219
+ printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + '` prop on `' + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details.");
220
+ manualPropTypeCallCache[cacheKey] = true;
221
+ manualPropTypeWarningCount++;
222
+ }
223
+ }
224
+ }
225
+ if (null != props[propName]) return validate(props, propName, componentName, location, propFullName);
226
+ else {
227
+ if (isRequired) {
228
+ if (null === props[propName]) return new PropTypeError('The ' + location + ' `' + propFullName + "` is marked as required in `" + componentName + '`, but its value is `null`.');
229
+ return new PropTypeError('The ' + location + ' `' + propFullName + "` is marked as required in `" + componentName + '`, but its value is `undefined`.');
230
+ }
231
+ return null;
232
+ }
233
+ }
234
+ var chainedCheckType = checkType.bind(null, false);
235
+ chainedCheckType.isRequired = checkType.bind(null, true);
236
+ return chainedCheckType;
237
+ }
238
+ function createPrimitiveTypeChecker(expectedType) {
239
+ function validate(props, propName, componentName, location, propFullName, secret) {
240
+ var propValue = props[propName];
241
+ var propType = getPropType(propValue);
242
+ if (propType !== expectedType) {
243
+ var preciseType = getPreciseType(propValue);
244
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `') + componentName + "`, expected `" + expectedType + '`.', {
245
+ expectedType: expectedType
246
+ });
247
+ }
248
+ return null;
249
+ }
250
+ return createChainableTypeChecker(validate);
251
+ }
252
+ function createAnyTypeChecker() {
253
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
254
+ }
255
+ function createArrayOfTypeChecker(typeChecker) {
256
+ function validate(props, propName, componentName, location, propFullName) {
257
+ if ('function' != typeof typeChecker) return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
258
+ var propValue = props[propName];
259
+ if (!Array.isArray(propValue)) {
260
+ var propType = getPropType(propValue);
261
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `') + componentName + '`, expected an array.');
262
+ }
263
+ for(var i = 0; i < propValue.length; i++){
264
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
265
+ if (error instanceof Error) return error;
266
+ }
267
+ return null;
268
+ }
269
+ return createChainableTypeChecker(validate);
270
+ }
271
+ function createElementTypeChecker() {
272
+ function validate(props, propName, componentName, location, propFullName) {
273
+ var propValue = props[propName];
274
+ if (!isValidElement(propValue)) {
275
+ var propType = getPropType(propValue);
276
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `') + componentName + '`, expected a single ReactElement.');
277
+ }
278
+ return null;
279
+ }
280
+ return createChainableTypeChecker(validate);
281
+ }
282
+ function createElementTypeTypeChecker() {
283
+ function validate(props, propName, componentName, location, propFullName) {
284
+ var propValue = props[propName];
285
+ if (!ReactIs.isValidElementType(propValue)) {
286
+ var propType = getPropType(propValue);
287
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `') + componentName + '`, expected a single ReactElement type.');
288
+ }
289
+ return null;
290
+ }
291
+ return createChainableTypeChecker(validate);
292
+ }
293
+ function createInstanceTypeChecker(expectedClass) {
294
+ function validate(props, propName, componentName, location, propFullName) {
295
+ if (!(props[propName] instanceof expectedClass)) {
296
+ var expectedClassName = expectedClass.name || ANONYMOUS;
297
+ var actualClassName = getClassName(props[propName]);
298
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `') + componentName + "`, expected instance of `" + expectedClassName + '`.');
299
+ }
300
+ return null;
301
+ }
302
+ return createChainableTypeChecker(validate);
303
+ }
304
+ function createEnumTypeChecker(expectedValues) {
305
+ if (!Array.isArray(expectedValues)) {
306
+ if ('production' !== process.env.NODE_ENV) arguments.length > 1 ? printWarning('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).") : printWarning('Invalid argument supplied to oneOf, expected an array.');
307
+ return emptyFunctionThatReturnsNull;
308
+ }
309
+ function validate(props, propName, componentName, location, propFullName) {
310
+ var propValue = props[propName];
311
+ for(var i = 0; i < expectedValues.length; i++)if (is(propValue, expectedValues[i])) return null;
312
+ var valuesString = JSON.stringify(expectedValues, function(key, value) {
313
+ var type = getPreciseType(value);
314
+ if ('symbol' === type) return String(value);
315
+ return value;
316
+ });
317
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ') + valuesString + '.');
318
+ }
319
+ return createChainableTypeChecker(validate);
320
+ }
321
+ function createObjectOfTypeChecker(typeChecker) {
322
+ function validate(props, propName, componentName, location, propFullName) {
323
+ if ('function' != typeof typeChecker) return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
324
+ var propValue = props[propName];
325
+ var propType = getPropType(propValue);
326
+ if ('object' !== propType) return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `') + componentName + '`, expected an object.');
327
+ for(var key in propValue)if (has(propValue, key)) {
328
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
329
+ if (error instanceof Error) return error;
330
+ }
331
+ return null;
332
+ }
333
+ return createChainableTypeChecker(validate);
334
+ }
335
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
336
+ if (!Array.isArray(arrayOfTypeCheckers)) {
337
+ 'production' !== process.env.NODE_ENV && printWarning('Invalid argument supplied to oneOfType, expected an instance of array.');
338
+ return emptyFunctionThatReturnsNull;
339
+ }
340
+ for(var i = 0; i < arrayOfTypeCheckers.length; i++){
341
+ var checker = arrayOfTypeCheckers[i];
342
+ if ('function' != typeof checker) {
343
+ printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
344
+ return emptyFunctionThatReturnsNull;
345
+ }
346
+ }
347
+ function validate(props, propName, componentName, location, propFullName) {
348
+ var expectedTypes = [];
349
+ for(var i = 0; i < arrayOfTypeCheckers.length; i++){
350
+ var checker = arrayOfTypeCheckers[i];
351
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
352
+ if (null == checkerResult) return null;
353
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) expectedTypes.push(checkerResult.data.expectedType);
354
+ }
355
+ var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
356
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`') + expectedTypesMessage + '.');
357
+ }
358
+ return createChainableTypeChecker(validate);
359
+ }
360
+ function createNodeChecker() {
361
+ function validate(props, propName, componentName, location, propFullName) {
362
+ if (!isNode(props[propName])) return new PropTypeError('Invalid ' + location + ' `' + propFullName + "` supplied to `" + componentName + '`, expected a ReactNode.');
363
+ return null;
364
+ }
365
+ return createChainableTypeChecker(validate);
366
+ }
367
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
368
+ return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + '`.');
369
+ }
370
+ function createShapeTypeChecker(shapeTypes) {
371
+ function validate(props, propName, componentName, location, propFullName) {
372
+ var propValue = props[propName];
373
+ var propType = getPropType(propValue);
374
+ if ('object' !== propType) return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + "` supplied to `" + componentName + '`, expected `object`.');
375
+ for(var key in shapeTypes){
376
+ var checker = shapeTypes[key];
377
+ if ('function' != typeof checker) return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
378
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
379
+ if (error) return error;
380
+ }
381
+ return null;
382
+ }
383
+ return createChainableTypeChecker(validate);
384
+ }
385
+ function createStrictShapeTypeChecker(shapeTypes) {
386
+ function validate(props, propName, componentName, location, propFullName) {
387
+ var propValue = props[propName];
388
+ var propType = getPropType(propValue);
389
+ if ('object' !== propType) return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + "` supplied to `" + componentName + '`, expected `object`.');
390
+ var allKeys = assign({}, props[propName], shapeTypes);
391
+ for(var key in allKeys){
392
+ var checker = shapeTypes[key];
393
+ if (has(shapeTypes, key) && 'function' != typeof checker) return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
394
+ if (!checker) return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
395
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
396
+ if (error) return error;
397
+ }
398
+ return null;
399
+ }
400
+ return createChainableTypeChecker(validate);
401
+ }
402
+ function isNode(propValue) {
403
+ switch(typeof propValue){
404
+ case 'number':
405
+ case 'string':
406
+ case 'undefined':
407
+ return true;
408
+ case 'boolean':
409
+ return !propValue;
410
+ case 'object':
411
+ if (Array.isArray(propValue)) return propValue.every(isNode);
412
+ if (null === propValue || isValidElement(propValue)) return true;
413
+ var iteratorFn = getIteratorFn(propValue);
414
+ if (!iteratorFn) return false;
415
+ else {
416
+ var iterator = iteratorFn.call(propValue);
417
+ var step;
418
+ if (iteratorFn !== propValue.entries) {
419
+ while(!(step = iterator.next()).done)if (!isNode(step.value)) return false;
420
+ } else while(!(step = iterator.next()).done){
421
+ var entry = step.value;
422
+ if (entry) {
423
+ if (!isNode(entry[1])) return false;
424
+ }
425
+ }
426
+ }
427
+ return true;
428
+ default:
429
+ return false;
430
+ }
431
+ }
432
+ function isSymbol(propType, propValue) {
433
+ if ('symbol' === propType) return true;
434
+ if (!propValue) return false;
435
+ if ('Symbol' === propValue['@@toStringTag']) return true;
436
+ if ('function' == typeof Symbol && propValue instanceof Symbol) return true;
437
+ return false;
438
+ }
439
+ function getPropType(propValue) {
440
+ var propType = typeof propValue;
441
+ if (Array.isArray(propValue)) return 'array';
442
+ if (propValue instanceof RegExp) return 'object';
443
+ if (isSymbol(propType, propValue)) return 'symbol';
444
+ return propType;
445
+ }
446
+ function getPreciseType(propValue) {
447
+ if (null == propValue) return '' + propValue;
448
+ var propType = getPropType(propValue);
449
+ if ('object' === propType) {
450
+ if (propValue instanceof Date) return 'date';
451
+ else if (propValue instanceof RegExp) return 'regexp';
452
+ }
453
+ return propType;
454
+ }
455
+ function getPostfixForTypeWarning(value) {
456
+ var type = getPreciseType(value);
457
+ switch(type){
458
+ case 'array':
459
+ case 'object':
460
+ return 'an ' + type;
461
+ case 'boolean':
462
+ case 'date':
463
+ case 'regexp':
464
+ return 'a ' + type;
465
+ default:
466
+ return type;
467
+ }
468
+ }
469
+ function getClassName(propValue) {
470
+ if (!propValue.constructor || !propValue.constructor.name) return ANONYMOUS;
471
+ return propValue.constructor.name;
472
+ }
473
+ ReactPropTypes.checkPropTypes = checkPropTypes;
474
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
475
+ ReactPropTypes.PropTypes = ReactPropTypes;
476
+ return ReactPropTypes;
477
+ };
478
+ },
479
+ i (module, __unused_rspack_exports, __webpack_require__) {
480
+ if ('production' !== process.env.NODE_ENV) {
481
+ var ReactIs = __webpack_require__("vJ");
482
+ var throwOnDirectAccess = true;
483
+ module.exports = __webpack_require__("IH")(ReactIs.isElement, throwOnDirectAccess);
484
+ } else module.exports = __webpack_require__("S")();
485
+ },
486
+ y (module) {
487
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
488
+ module.exports = ReactPropTypesSecret;
489
+ },
490
+ x (module) {
491
+ module.exports = Function.call.bind(Object.prototype.hasOwnProperty);
492
+ },
493
+ V (__unused_rspack_module, exports) {
494
+ /** @license React v16.13.1
495
+ * react-is.development.js
496
+ *
497
+ * Copyright (c) Facebook, Inc. and its affiliates.
498
+ *
499
+ * This source code is licensed under the MIT license found in the
500
+ * LICENSE file in the root directory of this source tree.
501
+ */ if ("production" !== process.env.NODE_ENV) (function() {
502
+ 'use strict';
503
+ var hasSymbol = 'function' == typeof Symbol && Symbol.for;
504
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
505
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
506
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
507
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
508
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
509
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
510
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
511
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
512
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
513
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
514
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
515
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
516
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
517
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
518
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
519
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
520
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
521
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
522
+ function isValidElementType(type) {
523
+ return 'string' == typeof type || 'function' == typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || 'object' == typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
524
+ }
525
+ function typeOf(object) {
526
+ if ('object' == typeof object && null !== object) {
527
+ var $$typeof = object.$$typeof;
528
+ switch($$typeof){
529
+ case REACT_ELEMENT_TYPE:
530
+ var type = object.type;
531
+ switch(type){
532
+ case REACT_ASYNC_MODE_TYPE:
533
+ case REACT_CONCURRENT_MODE_TYPE:
534
+ case REACT_FRAGMENT_TYPE:
535
+ case REACT_PROFILER_TYPE:
536
+ case REACT_STRICT_MODE_TYPE:
537
+ case REACT_SUSPENSE_TYPE:
538
+ return type;
539
+ default:
540
+ var $$typeofType = type && type.$$typeof;
541
+ switch($$typeofType){
542
+ case REACT_CONTEXT_TYPE:
543
+ case REACT_FORWARD_REF_TYPE:
544
+ case REACT_LAZY_TYPE:
545
+ case REACT_MEMO_TYPE:
546
+ case REACT_PROVIDER_TYPE:
547
+ return $$typeofType;
548
+ default:
549
+ return $$typeof;
550
+ }
551
+ }
552
+ case REACT_PORTAL_TYPE:
553
+ return $$typeof;
554
+ }
555
+ }
556
+ }
557
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
558
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
559
+ var ContextConsumer = REACT_CONTEXT_TYPE;
560
+ var ContextProvider = REACT_PROVIDER_TYPE;
561
+ var Element = REACT_ELEMENT_TYPE;
562
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
563
+ var Fragment = REACT_FRAGMENT_TYPE;
564
+ var Lazy = REACT_LAZY_TYPE;
565
+ var Memo = REACT_MEMO_TYPE;
566
+ var Portal = REACT_PORTAL_TYPE;
567
+ var Profiler = REACT_PROFILER_TYPE;
568
+ var StrictMode = REACT_STRICT_MODE_TYPE;
569
+ var Suspense = REACT_SUSPENSE_TYPE;
570
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
571
+ function isAsyncMode(object) {
572
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
573
+ hasWarnedAboutDeprecatedIsAsyncMode = true;
574
+ console['warn']("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.");
575
+ }
576
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
577
+ }
578
+ function isConcurrentMode(object) {
579
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
580
+ }
581
+ function isContextConsumer(object) {
582
+ return typeOf(object) === REACT_CONTEXT_TYPE;
583
+ }
584
+ function isContextProvider(object) {
585
+ return typeOf(object) === REACT_PROVIDER_TYPE;
586
+ }
587
+ function isElement(object) {
588
+ return 'object' == typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
589
+ }
590
+ function isForwardRef(object) {
591
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
592
+ }
593
+ function isFragment(object) {
594
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
595
+ }
596
+ function isLazy(object) {
597
+ return typeOf(object) === REACT_LAZY_TYPE;
598
+ }
599
+ function isMemo(object) {
600
+ return typeOf(object) === REACT_MEMO_TYPE;
601
+ }
602
+ function isPortal(object) {
603
+ return typeOf(object) === REACT_PORTAL_TYPE;
604
+ }
605
+ function isProfiler(object) {
606
+ return typeOf(object) === REACT_PROFILER_TYPE;
607
+ }
608
+ function isStrictMode(object) {
609
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
610
+ }
611
+ function isSuspense(object) {
612
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
613
+ }
614
+ exports.AsyncMode = AsyncMode;
615
+ exports.ConcurrentMode = ConcurrentMode;
616
+ exports.ContextConsumer = ContextConsumer;
617
+ exports.ContextProvider = ContextProvider;
618
+ exports.Element = Element;
619
+ exports.ForwardRef = ForwardRef;
620
+ exports.Fragment = Fragment;
621
+ exports.Lazy = Lazy;
622
+ exports.Memo = Memo;
623
+ exports.Portal = Portal;
624
+ exports.Profiler = Profiler;
625
+ exports.StrictMode = StrictMode;
626
+ exports.Suspense = Suspense;
627
+ exports.isAsyncMode = isAsyncMode;
628
+ exports.isConcurrentMode = isConcurrentMode;
629
+ exports.isContextConsumer = isContextConsumer;
630
+ exports.isContextProvider = isContextProvider;
631
+ exports.isElement = isElement;
632
+ exports.isForwardRef = isForwardRef;
633
+ exports.isFragment = isFragment;
634
+ exports.isLazy = isLazy;
635
+ exports.isMemo = isMemo;
636
+ exports.isPortal = isPortal;
637
+ exports.isProfiler = isProfiler;
638
+ exports.isStrictMode = isStrictMode;
639
+ exports.isSuspense = isSuspense;
640
+ exports.isValidElementType = isValidElementType;
641
+ exports.typeOf = typeOf;
642
+ })();
643
+ },
644
+ l (__unused_rspack_module, exports) {
645
+ /** @license React v16.13.1
646
+ * react-is.production.min.js
647
+ *
648
+ * Copyright (c) Facebook, Inc. and its affiliates.
649
+ *
650
+ * This source code is licensed under the MIT license found in the
651
+ * LICENSE file in the root directory of this source tree.
652
+ */ var b = "function" == typeof Symbol && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
653
+ function z(a) {
654
+ if ("object" == typeof a && null !== a) {
655
+ var u = a.$$typeof;
656
+ switch(u){
657
+ case c:
658
+ switch(a = a.type){
659
+ case l:
660
+ case m:
661
+ case e:
662
+ case g:
663
+ case f:
664
+ case p:
665
+ return a;
666
+ default:
667
+ switch(a = a && a.$$typeof){
668
+ case k:
669
+ case n:
670
+ case t:
671
+ case r:
672
+ case h:
673
+ return a;
674
+ default:
675
+ return u;
676
+ }
677
+ }
678
+ case d:
679
+ return u;
680
+ }
681
+ }
682
+ }
683
+ function A(a) {
684
+ return z(a) === m;
685
+ }
686
+ exports.AsyncMode = l;
687
+ exports.ConcurrentMode = m;
688
+ exports.ContextConsumer = k;
689
+ exports.ContextProvider = h;
690
+ exports.Element = c;
691
+ exports.ForwardRef = n;
692
+ exports.Fragment = e;
693
+ exports.Lazy = t;
694
+ exports.Memo = r;
695
+ exports.Portal = d;
696
+ exports.Profiler = g;
697
+ exports.StrictMode = f;
698
+ exports.Suspense = p;
699
+ exports.isAsyncMode = function(a) {
700
+ return A(a) || z(a) === l;
701
+ };
702
+ exports.isConcurrentMode = A;
703
+ exports.isContextConsumer = function(a) {
704
+ return z(a) === k;
705
+ };
706
+ exports.isContextProvider = function(a) {
707
+ return z(a) === h;
708
+ };
709
+ exports.isElement = function(a) {
710
+ return "object" == typeof a && null !== a && a.$$typeof === c;
711
+ };
712
+ exports.isForwardRef = function(a) {
713
+ return z(a) === n;
714
+ };
715
+ exports.isFragment = function(a) {
716
+ return z(a) === e;
717
+ };
718
+ exports.isLazy = function(a) {
719
+ return z(a) === t;
720
+ };
721
+ exports.isMemo = function(a) {
722
+ return z(a) === r;
723
+ };
724
+ exports.isPortal = function(a) {
725
+ return z(a) === d;
726
+ };
727
+ exports.isProfiler = function(a) {
728
+ return z(a) === g;
729
+ };
730
+ exports.isStrictMode = function(a) {
731
+ return z(a) === f;
732
+ };
733
+ exports.isSuspense = function(a) {
734
+ return z(a) === p;
735
+ };
736
+ exports.isValidElementType = function(a) {
737
+ return "string" == typeof a || "function" == typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" == typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
738
+ };
739
+ exports.typeOf = z;
740
+ },
741
+ vJ (module, __unused_rspack_exports, __webpack_require__) {
742
+ if ('production' === process.env.NODE_ENV) module.exports = __webpack_require__("l");
743
+ else module.exports = __webpack_require__("V");
744
+ }
745
+ });
746
+ const messages = {
747
+ close: 'Close',
748
+ connectAgent: 'Connect agent',
749
+ importResources: 'Import resources'
750
+ };
751
+ const en_US = messages;
752
+ const zh_CN_messages = {
753
+ close: '关闭',
754
+ connectAgent: '连接 Agent',
755
+ importResources: '导入资源'
756
+ };
757
+ const zh_CN = zh_CN_messages;
758
+ const LOCALES = {
759
+ 'en-US': en_US,
760
+ 'zh-CN': zh_CN
761
+ };
762
+ function resolveFileBrowserEntriesLabels(locale, labels) {
763
+ return resolveLocale(LOCALES, locale, labels);
764
+ }
765
+ function Divider({ orientation = 'vertical', length, thickness = 1, color, className, style, ...rest }) {
766
+ const vertical = 'vertical' === orientation;
767
+ const size = vertical ? {
768
+ flex: 'none',
769
+ width: thickness,
770
+ height: length
771
+ } : {
772
+ flex: 'none',
773
+ width: length ?? '100%',
774
+ height: thickness
775
+ };
776
+ return /*#__PURE__*/ jsx("div", {
777
+ ...rest,
778
+ role: "separator",
779
+ "aria-orientation": orientation,
780
+ className: [
781
+ 'ov-divider',
782
+ className
783
+ ].filter(Boolean).join(' '),
784
+ style: {
785
+ background: color ?? 'var(--ov-ui-color-border-2, var(--ov-ui-border-2-default, #e1e4f2))',
786
+ ...size,
787
+ ...style
788
+ }
789
+ });
790
+ }
791
+ function _objectWithoutPropertiesLoose(r, e) {
792
+ if (null == r) return {};
793
+ var t = {};
794
+ for(var n in r)if (({}).hasOwnProperty.call(r, n)) {
795
+ if (-1 !== e.indexOf(n)) continue;
796
+ t[n] = r[n];
797
+ }
798
+ return t;
799
+ }
800
+ function _extends() {
801
+ return _extends = Object.assign ? Object.assign.bind() : function(n) {
802
+ for(var e = 1; e < arguments.length; e++){
803
+ var t = arguments[e];
804
+ for(var r in t)({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
805
+ }
806
+ return n;
807
+ }, _extends.apply(null, arguments);
808
+ }
809
+ var FOCUS_GROUP = 'data-focus-lock';
810
+ var FOCUS_DISABLED = 'data-focus-lock-disabled';
811
+ var FOCUS_ALLOW = 'data-no-focus-lock';
812
+ var FOCUS_AUTO = 'data-autofocus-inside';
813
+ var FOCUS_NO_AUTOFOCUS = 'data-no-autofocus';
814
+ function assignRef(ref, value) {
815
+ if ('function' == typeof ref) ref(value);
816
+ else if (ref) ref.current = value;
817
+ return ref;
818
+ }
819
+ function useCallbackRef(initialValue, callback) {
820
+ var ref = useState(function() {
821
+ return {
822
+ value: initialValue,
823
+ callback: callback,
824
+ facade: {
825
+ get current () {
826
+ return ref.value;
827
+ },
828
+ set current (value){
829
+ var last = ref.value;
830
+ if (last !== value) {
831
+ ref.value = value;
832
+ ref.callback(value, last);
833
+ }
834
+ }
835
+ }
836
+ };
837
+ })[0];
838
+ ref.callback = callback;
839
+ return ref.facade;
840
+ }
841
+ var useIsomorphicLayoutEffect = "u" > typeof window ? __rspack_external_react.useLayoutEffect : __rspack_external_react.useEffect;
842
+ var currentValues = new WeakMap();
843
+ function useMergeRefs(refs, defaultValue) {
844
+ var callbackRef = useCallbackRef(defaultValue || null, function(newValue) {
845
+ return refs.forEach(function(ref) {
846
+ return assignRef(ref, newValue);
847
+ });
848
+ });
849
+ useIsomorphicLayoutEffect(function() {
850
+ var oldValue = currentValues.get(callbackRef);
851
+ if (oldValue) {
852
+ var prevRefs_1 = new Set(oldValue);
853
+ var nextRefs_1 = new Set(refs);
854
+ var current_1 = callbackRef.current;
855
+ prevRefs_1.forEach(function(ref) {
856
+ if (!nextRefs_1.has(ref)) assignRef(ref, null);
857
+ });
858
+ nextRefs_1.forEach(function(ref) {
859
+ if (!prevRefs_1.has(ref)) assignRef(ref, current_1);
860
+ });
861
+ }
862
+ currentValues.set(callbackRef, refs);
863
+ }, [
864
+ refs
865
+ ]);
866
+ return callbackRef;
867
+ }
868
+ const prop_types = __webpack_require__("i");
869
+ var prop_types_default = /*#__PURE__*/ __webpack_require__.n(prop_types);
870
+ var hiddenGuard = {
871
+ width: '1px',
872
+ height: '0px',
873
+ padding: 0,
874
+ overflow: 'hidden',
875
+ position: 'fixed',
876
+ top: '1px',
877
+ left: '1px'
878
+ };
879
+ var FocusGuard_InFocusGuard = function(_ref) {
880
+ var _ref$children = _ref.children, children = void 0 === _ref$children ? null : _ref$children;
881
+ return /*#__PURE__*/ react.createElement(Fragment, null, /*#__PURE__*/ react.createElement("div", {
882
+ key: "guard-first",
883
+ "data-focus-guard": true,
884
+ "data-focus-auto-guard": true,
885
+ style: hiddenGuard
886
+ }), children, children && /*#__PURE__*/ react.createElement("div", {
887
+ key: "guard-last",
888
+ "data-focus-guard": true,
889
+ "data-focus-auto-guard": true,
890
+ style: hiddenGuard
891
+ }));
892
+ };
893
+ FocusGuard_InFocusGuard.propTypes = "production" !== process.env.NODE_ENV ? {
894
+ children: prop_types_default().node
895
+ } : {};
896
+ var tslib_es6_assign = function() {
897
+ tslib_es6_assign = Object.assign || function(t) {
898
+ for(var s, i = 1, n = arguments.length; i < n; i++){
899
+ s = arguments[i];
900
+ for(var p in s)if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
901
+ }
902
+ return t;
903
+ };
904
+ return tslib_es6_assign.apply(this, arguments);
905
+ };
906
+ function ItoI(a) {
907
+ return a;
908
+ }
909
+ function innerCreateMedium(defaults, middleware) {
910
+ if (void 0 === middleware) middleware = ItoI;
911
+ var buffer = [];
912
+ var assigned = false;
913
+ var medium = {
914
+ read: function() {
915
+ if (assigned) throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');
916
+ if (buffer.length) return buffer[buffer.length - 1];
917
+ return defaults;
918
+ },
919
+ useMedium: function(data) {
920
+ var item = middleware(data, assigned);
921
+ buffer.push(item);
922
+ return function() {
923
+ buffer = buffer.filter(function(x) {
924
+ return x !== item;
925
+ });
926
+ };
927
+ },
928
+ assignSyncMedium: function(cb) {
929
+ assigned = true;
930
+ while(buffer.length){
931
+ var cbs = buffer;
932
+ buffer = [];
933
+ cbs.forEach(cb);
934
+ }
935
+ buffer = {
936
+ push: function(x) {
937
+ return cb(x);
938
+ },
939
+ filter: function() {
940
+ return buffer;
941
+ }
942
+ };
943
+ },
944
+ assignMedium: function(cb) {
945
+ assigned = true;
946
+ var pendingQueue = [];
947
+ if (buffer.length) {
948
+ var cbs = buffer;
949
+ buffer = [];
950
+ cbs.forEach(cb);
951
+ pendingQueue = buffer;
952
+ }
953
+ var executeQueue = function() {
954
+ var cbs = pendingQueue;
955
+ pendingQueue = [];
956
+ cbs.forEach(cb);
957
+ };
958
+ var cycle = function() {
959
+ return Promise.resolve().then(executeQueue);
960
+ };
961
+ cycle();
962
+ buffer = {
963
+ push: function(x) {
964
+ pendingQueue.push(x);
965
+ cycle();
966
+ },
967
+ filter: function(filter) {
968
+ pendingQueue = pendingQueue.filter(filter);
969
+ return buffer;
970
+ }
971
+ };
972
+ }
973
+ };
974
+ return medium;
975
+ }
976
+ function createMedium(defaults, middleware) {
977
+ if (void 0 === middleware) middleware = ItoI;
978
+ return innerCreateMedium(defaults, middleware);
979
+ }
980
+ function createSidecarMedium(options) {
981
+ if (void 0 === options) options = {};
982
+ var medium = innerCreateMedium(null);
983
+ medium.options = tslib_es6_assign({
984
+ async: true,
985
+ ssr: false
986
+ }, options);
987
+ return medium;
988
+ }
989
+ var mediumFocus = createMedium({}, function(_ref) {
990
+ var target = _ref.target, currentTarget = _ref.currentTarget;
991
+ return {
992
+ target: target,
993
+ currentTarget: currentTarget
994
+ };
995
+ });
996
+ var mediumBlur = createMedium();
997
+ var mediumEffect = createMedium();
998
+ var mediumSidecar = createSidecarMedium({
999
+ async: true,
1000
+ ssr: "u" > typeof document
1001
+ });
1002
+ var focusScope = /*#__PURE__*/ createContext(void 0);
1003
+ var emptyArray = [];
1004
+ var FocusLock = /*#__PURE__*/ forwardRef(function(props, parentRef) {
1005
+ var _extends2;
1006
+ var _useState = useState(), realObserved = _useState[0], setObserved = _useState[1];
1007
+ var observed = useRef();
1008
+ var isActive = useRef(false);
1009
+ var originalFocusedElement = useRef(null);
1010
+ var _useState2 = useState({}), update = _useState2[1];
1011
+ var children = props.children, _props$disabled = props.disabled, disabled = void 0 === _props$disabled ? false : _props$disabled, _props$noFocusGuards = props.noFocusGuards, noFocusGuards = void 0 === _props$noFocusGuards ? false : _props$noFocusGuards, _props$persistentFocu = props.persistentFocus, persistentFocus = void 0 === _props$persistentFocu ? false : _props$persistentFocu, _props$crossFrame = props.crossFrame, crossFrame = void 0 === _props$crossFrame ? true : _props$crossFrame, _props$autoFocus = props.autoFocus, autoFocus = void 0 === _props$autoFocus ? true : _props$autoFocus, allowTextSelection = props.allowTextSelection, group = props.group, className = props.className, whiteList = props.whiteList, hasPositiveIndices = props.hasPositiveIndices, _props$shards = props.shards, shards = void 0 === _props$shards ? emptyArray : _props$shards, _props$as = props.as, Container = void 0 === _props$as ? 'div' : _props$as, _props$lockProps = props.lockProps, containerProps = void 0 === _props$lockProps ? {} : _props$lockProps, SideCar = props.sideCar, _props$returnFocus = props.returnFocus, shouldReturnFocus = void 0 === _props$returnFocus ? false : _props$returnFocus, focusOptions = props.focusOptions, onActivationCallback = props.onActivation, onDeactivationCallback = props.onDeactivation;
1012
+ var _useState3 = useState({}), id = _useState3[0];
1013
+ var onActivation = useCallback(function(_ref) {
1014
+ var captureFocusRestore = _ref.captureFocusRestore;
1015
+ if (!originalFocusedElement.current) {
1016
+ var _document;
1017
+ var activeElement = null == (_document = document) ? void 0 : _document.activeElement;
1018
+ originalFocusedElement.current = activeElement;
1019
+ if (activeElement !== document.body) originalFocusedElement.current = captureFocusRestore(activeElement);
1020
+ }
1021
+ if (observed.current && onActivationCallback) onActivationCallback(observed.current);
1022
+ isActive.current = true;
1023
+ update();
1024
+ }, [
1025
+ onActivationCallback
1026
+ ]);
1027
+ var onDeactivation = useCallback(function() {
1028
+ isActive.current = false;
1029
+ if (onDeactivationCallback) onDeactivationCallback(observed.current);
1030
+ update();
1031
+ }, [
1032
+ onDeactivationCallback
1033
+ ]);
1034
+ var returnFocus = useCallback(function(allowDefer) {
1035
+ var focusRestore = originalFocusedElement.current;
1036
+ if (focusRestore) {
1037
+ var returnFocusTo = ('function' == typeof focusRestore ? focusRestore() : focusRestore) || document.body;
1038
+ var howToReturnFocus = 'function' == typeof shouldReturnFocus ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;
1039
+ if (howToReturnFocus) {
1040
+ var returnFocusOptions = 'object' == typeof howToReturnFocus ? howToReturnFocus : void 0;
1041
+ originalFocusedElement.current = null;
1042
+ if (allowDefer) Promise.resolve().then(function() {
1043
+ return returnFocusTo.focus(returnFocusOptions);
1044
+ });
1045
+ else returnFocusTo.focus(returnFocusOptions);
1046
+ }
1047
+ }
1048
+ }, [
1049
+ shouldReturnFocus
1050
+ ]);
1051
+ var onFocus = useCallback(function(event) {
1052
+ if (isActive.current) mediumFocus.useMedium(event);
1053
+ }, []);
1054
+ var onBlur = mediumBlur.useMedium;
1055
+ var setObserveNode = useCallback(function(newObserved) {
1056
+ if (observed.current !== newObserved) {
1057
+ observed.current = newObserved;
1058
+ setObserved(newObserved);
1059
+ }
1060
+ }, []);
1061
+ if ('production' !== process.env.NODE_ENV) {
1062
+ if (void 0 !== allowTextSelection) console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');
1063
+ useEffect(function() {
1064
+ if (!observed.current && 'string' != typeof Container) console.error('FocusLock: could not obtain ref to internal node');
1065
+ }, []);
1066
+ }
1067
+ var lockProps = _extends((_extends2 = {}, _extends2[FOCUS_DISABLED] = disabled && 'disabled', _extends2[FOCUS_GROUP] = group, _extends2), containerProps);
1068
+ var hasLeadingGuards = true !== noFocusGuards;
1069
+ var hasTailingGuards = hasLeadingGuards && 'tail' !== noFocusGuards;
1070
+ var mergedRef = useMergeRefs([
1071
+ parentRef,
1072
+ setObserveNode
1073
+ ]);
1074
+ var focusScopeValue = useMemo(function() {
1075
+ return {
1076
+ observed: observed,
1077
+ shards: shards,
1078
+ enabled: !disabled,
1079
+ get active () {
1080
+ return isActive.current;
1081
+ }
1082
+ };
1083
+ }, [
1084
+ disabled,
1085
+ isActive,
1086
+ shards,
1087
+ observed
1088
+ ]);
1089
+ return /*#__PURE__*/ react.createElement(Fragment, null, hasLeadingGuards && [
1090
+ /*#__PURE__*/ react.createElement("div", {
1091
+ key: "guard-first",
1092
+ "data-focus-guard": true,
1093
+ tabIndex: disabled ? -1 : 0,
1094
+ style: hiddenGuard
1095
+ }),
1096
+ hasPositiveIndices ? /*#__PURE__*/ react.createElement("div", {
1097
+ key: "guard-nearest",
1098
+ "data-focus-guard": true,
1099
+ tabIndex: disabled ? -1 : 1,
1100
+ style: hiddenGuard
1101
+ }) : null
1102
+ ], !disabled && /*#__PURE__*/ react.createElement(SideCar, {
1103
+ id: id,
1104
+ sideCar: mediumSidecar,
1105
+ observed: realObserved,
1106
+ disabled: disabled,
1107
+ persistentFocus: persistentFocus,
1108
+ crossFrame: crossFrame,
1109
+ autoFocus: autoFocus,
1110
+ whiteList: whiteList,
1111
+ shards: shards,
1112
+ onActivation: onActivation,
1113
+ onDeactivation: onDeactivation,
1114
+ returnFocus: returnFocus,
1115
+ focusOptions: focusOptions,
1116
+ noFocusGuards: noFocusGuards
1117
+ }), /*#__PURE__*/ react.createElement(Container, _extends({
1118
+ ref: mergedRef
1119
+ }, lockProps, {
1120
+ className: className,
1121
+ onBlur: onBlur,
1122
+ onFocus: onFocus
1123
+ }), /*#__PURE__*/ react.createElement(focusScope.Provider, {
1124
+ value: focusScopeValue
1125
+ }, children)), hasTailingGuards && /*#__PURE__*/ react.createElement("div", {
1126
+ "data-focus-guard": true,
1127
+ tabIndex: disabled ? -1 : 0,
1128
+ style: hiddenGuard
1129
+ }));
1130
+ });
1131
+ FocusLock.propTypes = "production" !== process.env.NODE_ENV ? {
1132
+ children: prop_types.node,
1133
+ disabled: prop_types.bool,
1134
+ returnFocus: (0, prop_types.oneOfType)([
1135
+ prop_types.bool,
1136
+ prop_types.object,
1137
+ prop_types.func
1138
+ ]),
1139
+ focusOptions: prop_types.object,
1140
+ noFocusGuards: prop_types.bool,
1141
+ hasPositiveIndices: prop_types.bool,
1142
+ allowTextSelection: prop_types.bool,
1143
+ autoFocus: prop_types.bool,
1144
+ persistentFocus: prop_types.bool,
1145
+ crossFrame: prop_types.bool,
1146
+ group: prop_types.string,
1147
+ className: prop_types.string,
1148
+ whiteList: prop_types.func,
1149
+ shards: (0, prop_types.arrayOf)(prop_types.any),
1150
+ as: (0, prop_types.oneOfType)([
1151
+ prop_types.string,
1152
+ prop_types.func,
1153
+ prop_types.object
1154
+ ]),
1155
+ lockProps: prop_types.object,
1156
+ onActivation: prop_types.func,
1157
+ onDeactivation: prop_types.func,
1158
+ sideCar: prop_types.any.isRequired
1159
+ } : {};
1160
+ const Lock = FocusLock;
1161
+ function _setPrototypeOf(t, e) {
1162
+ return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
1163
+ return t.__proto__ = e, t;
1164
+ }, _setPrototypeOf(t, e);
1165
+ }
1166
+ function _inheritsLoose(t, o) {
1167
+ t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
1168
+ }
1169
+ function _typeof(o) {
1170
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
1171
+ return typeof o;
1172
+ } : function(o) {
1173
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
1174
+ }, _typeof(o);
1175
+ }
1176
+ function toPrimitive(t, e) {
1177
+ if ("object" != _typeof(t) || !t) return t;
1178
+ var r;
1179
+ if ("u" > typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) {
1180
+ var i = r.call(t, e || "default");
1181
+ if ("object" != _typeof(i)) return i;
1182
+ throw new TypeError("@@toPrimitive must return a primitive value.");
1183
+ }
1184
+ return ("string" === e ? String : Number)(t);
1185
+ }
1186
+ function toPropertyKey(t) {
1187
+ var i = toPrimitive(t, "string");
1188
+ return "symbol" == _typeof(i) ? i : i + "";
1189
+ }
1190
+ function _defineProperty(e, r, t) {
1191
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
1192
+ value: t,
1193
+ enumerable: !0,
1194
+ configurable: !0,
1195
+ writable: !0
1196
+ }) : e[r] = t, e;
1197
+ }
1198
+ function withSideEffect(reducePropsToState, handleStateChangeOnClient) {
1199
+ if ("production" !== process.env.NODE_ENV) {
1200
+ if ('function' != typeof reducePropsToState) throw new Error('Expected reducePropsToState to be a function.');
1201
+ if ('function' != typeof handleStateChangeOnClient) throw new Error('Expected handleStateChangeOnClient to be a function.');
1202
+ }
1203
+ function getDisplayName(WrappedComponent) {
1204
+ return WrappedComponent.displayName || WrappedComponent.name || 'Component';
1205
+ }
1206
+ return function(WrappedComponent) {
1207
+ if ("production" !== process.env.NODE_ENV) {
1208
+ if ('function' != typeof WrappedComponent) throw new Error('Expected WrappedComponent to be a React component.');
1209
+ }
1210
+ var mountedInstances = [];
1211
+ var state;
1212
+ function emitChange() {
1213
+ state = reducePropsToState(mountedInstances.map(function(instance) {
1214
+ return instance.props;
1215
+ }));
1216
+ handleStateChangeOnClient(state);
1217
+ }
1218
+ var SideEffect = /*#__PURE__*/ function(_PureComponent) {
1219
+ _inheritsLoose(SideEffect, _PureComponent);
1220
+ function SideEffect() {
1221
+ return _PureComponent.apply(this, arguments) || this;
1222
+ }
1223
+ SideEffect.peek = function() {
1224
+ return state;
1225
+ };
1226
+ var _proto = SideEffect.prototype;
1227
+ _proto.componentDidMount = function() {
1228
+ mountedInstances.push(this);
1229
+ emitChange();
1230
+ };
1231
+ _proto.componentDidUpdate = function() {
1232
+ emitChange();
1233
+ };
1234
+ _proto.componentWillUnmount = function() {
1235
+ var index = mountedInstances.indexOf(this);
1236
+ mountedInstances.splice(index, 1);
1237
+ emitChange();
1238
+ };
1239
+ _proto.render = function() {
1240
+ return /*#__PURE__*/ react.createElement(WrappedComponent, this.props);
1241
+ };
1242
+ return SideEffect;
1243
+ }(PureComponent);
1244
+ _defineProperty(SideEffect, "displayName", "SideEffect(" + getDisplayName(WrappedComponent) + ")");
1245
+ return SideEffect;
1246
+ };
1247
+ }
1248
+ const index_es = withSideEffect;
1249
+ var toArray = function(a) {
1250
+ var ret = Array(a.length);
1251
+ for(var i = 0; i < a.length; ++i)ret[i] = a[i];
1252
+ return ret;
1253
+ };
1254
+ var asArray = function(a) {
1255
+ return Array.isArray(a) ? a : [
1256
+ a
1257
+ ];
1258
+ };
1259
+ var getFirst = function(a) {
1260
+ return Array.isArray(a) ? a[0] : a;
1261
+ };
1262
+ var isElementHidden = function(node) {
1263
+ if (node.nodeType !== Node.ELEMENT_NODE) return false;
1264
+ var computedStyle = window.getComputedStyle(node, null);
1265
+ if (!computedStyle || !computedStyle.getPropertyValue) return false;
1266
+ return 'none' === computedStyle.getPropertyValue('display') || 'hidden' === computedStyle.getPropertyValue('visibility');
1267
+ };
1268
+ var getParentNode = function(node) {
1269
+ return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? node.parentNode.host : node.parentNode;
1270
+ };
1271
+ var isTopNode = function(node) {
1272
+ return node === document || node && node.nodeType === Node.DOCUMENT_NODE;
1273
+ };
1274
+ var isInert = function(node) {
1275
+ return node.hasAttribute('inert');
1276
+ };
1277
+ var isVisibleUncached = function(node, checkParent) {
1278
+ return !node || isTopNode(node) || !isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node));
1279
+ };
1280
+ var isVisibleCached = function(visibilityCache, node) {
1281
+ var cached = visibilityCache.get(node);
1282
+ if (void 0 !== cached) return cached;
1283
+ var result = isVisibleUncached(node, isVisibleCached.bind(void 0, visibilityCache));
1284
+ visibilityCache.set(node, result);
1285
+ return result;
1286
+ };
1287
+ var isAutoFocusAllowedUncached = function(node, checkParent) {
1288
+ return node && !isTopNode(node) ? isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false : true;
1289
+ };
1290
+ var isAutoFocusAllowedCached = function(cache, node) {
1291
+ var cached = cache.get(node);
1292
+ if (void 0 !== cached) return cached;
1293
+ var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(void 0, cache));
1294
+ cache.set(node, result);
1295
+ return result;
1296
+ };
1297
+ var getDataset = function(node) {
1298
+ return node.dataset;
1299
+ };
1300
+ var isHTMLButtonElement = function(node) {
1301
+ return 'BUTTON' === node.tagName;
1302
+ };
1303
+ var isHTMLInputElement = function(node) {
1304
+ return 'INPUT' === node.tagName;
1305
+ };
1306
+ var isRadioElement = function(node) {
1307
+ return isHTMLInputElement(node) && 'radio' === node.type;
1308
+ };
1309
+ var notHiddenInput = function(node) {
1310
+ return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && ('hidden' === node.type || node.disabled));
1311
+ };
1312
+ var isAutoFocusAllowed = function(node) {
1313
+ var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS);
1314
+ return ![
1315
+ true,
1316
+ 'true',
1317
+ ''
1318
+ ].includes(attribute);
1319
+ };
1320
+ var isGuard = function(node) {
1321
+ var _a;
1322
+ return Boolean(node && (null == (_a = getDataset(node)) ? void 0 : _a.focusGuard));
1323
+ };
1324
+ var isNotAGuard = function(node) {
1325
+ return !isGuard(node);
1326
+ };
1327
+ var isDefined = function(x) {
1328
+ return Boolean(x);
1329
+ };
1330
+ var tabSort = function(a, b) {
1331
+ var aTab = Math.max(0, a.tabIndex);
1332
+ var bTab = Math.max(0, b.tabIndex);
1333
+ var tabDiff = aTab - bTab;
1334
+ var indexDiff = a.index - b.index;
1335
+ if (tabDiff) {
1336
+ if (!aTab) return 1;
1337
+ if (!bTab) return -1;
1338
+ }
1339
+ return tabDiff || indexDiff;
1340
+ };
1341
+ var getTabIndex = function(node) {
1342
+ if (node.tabIndex < 0) {
1343
+ if (!node.hasAttribute('tabindex')) return 0;
1344
+ }
1345
+ return node.tabIndex;
1346
+ };
1347
+ var orderByTabIndex = function(nodes, filterNegative, keepGuards) {
1348
+ return toArray(nodes).map(function(node, index) {
1349
+ var tabIndex = getTabIndex(node);
1350
+ return {
1351
+ node: node,
1352
+ index: index,
1353
+ tabIndex: keepGuards && -1 === tabIndex ? (node.dataset || {}).focusGuard ? 0 : -1 : tabIndex
1354
+ };
1355
+ }).filter(function(data) {
1356
+ return !filterNegative || data.tabIndex >= 0;
1357
+ }).sort(tabSort);
1358
+ };
1359
+ var tabbables = [
1360
+ 'button:enabled',
1361
+ 'select:enabled',
1362
+ 'textarea:enabled',
1363
+ 'input:enabled',
1364
+ 'a[href]',
1365
+ 'area[href]',
1366
+ 'summary',
1367
+ 'iframe',
1368
+ 'object',
1369
+ 'embed',
1370
+ 'audio[controls]',
1371
+ 'video[controls]',
1372
+ '[tabindex]',
1373
+ '[contenteditable]',
1374
+ '[autofocus]'
1375
+ ];
1376
+ var queryTabbables = tabbables.join(',');
1377
+ var queryGuardTabbables = "".concat(queryTabbables, ", [data-focus-guard]");
1378
+ var getFocusablesWithShadowDom = function(parent, withGuards) {
1379
+ return toArray((parent.shadowRoot || parent).children).reduce(function(acc, child) {
1380
+ return acc.concat(child.matches(withGuards ? queryGuardTabbables : queryTabbables) ? [
1381
+ child
1382
+ ] : [], getFocusablesWithShadowDom(child));
1383
+ }, []);
1384
+ };
1385
+ var getFocusablesWithIFrame = function(parent, withGuards) {
1386
+ var _a;
1387
+ if (parent instanceof HTMLIFrameElement && (null == (_a = parent.contentDocument) ? void 0 : _a.body)) return getFocusables([
1388
+ parent.contentDocument.body
1389
+ ], withGuards);
1390
+ return [
1391
+ parent
1392
+ ];
1393
+ };
1394
+ var getFocusables = function(parents, withGuards) {
1395
+ return parents.reduce(function(acc, parent) {
1396
+ var _a;
1397
+ var focusableWithShadowDom = getFocusablesWithShadowDom(parent, withGuards);
1398
+ var focusableWithIframes = (_a = []).concat.apply(_a, focusableWithShadowDom.map(function(node) {
1399
+ return getFocusablesWithIFrame(node, withGuards);
1400
+ }));
1401
+ return acc.concat(focusableWithIframes, parent.parentNode ? toArray(parent.parentNode.querySelectorAll(queryTabbables)).filter(function(node) {
1402
+ return node === parent;
1403
+ }) : []);
1404
+ }, []);
1405
+ };
1406
+ var getParentAutofocusables = function(parent) {
1407
+ var parentFocus = parent.querySelectorAll("[".concat(FOCUS_AUTO, "]"));
1408
+ return toArray(parentFocus).map(function(node) {
1409
+ return getFocusables([
1410
+ node
1411
+ ]);
1412
+ }).reduce(function(acc, nodes) {
1413
+ return acc.concat(nodes);
1414
+ }, []);
1415
+ };
1416
+ var filterFocusable = function(nodes, visibilityCache) {
1417
+ return toArray(nodes).filter(function(node) {
1418
+ return isVisibleCached(visibilityCache, node);
1419
+ }).filter(function(node) {
1420
+ return notHiddenInput(node);
1421
+ });
1422
+ };
1423
+ var filterAutoFocusable = function(nodes, cache) {
1424
+ if (void 0 === cache) cache = new Map();
1425
+ return toArray(nodes).filter(function(node) {
1426
+ return isAutoFocusAllowedCached(cache, node);
1427
+ });
1428
+ };
1429
+ var getTabbableNodes = function(topNodes, visibilityCache, withGuards) {
1430
+ return orderByTabIndex(filterFocusable(getFocusables(topNodes, withGuards), visibilityCache), true, withGuards);
1431
+ };
1432
+ var getFocusableNodes = function(topNodes, visibilityCache) {
1433
+ return orderByTabIndex(filterFocusable(getFocusables(topNodes), visibilityCache), false);
1434
+ };
1435
+ var parentAutofocusables = function(topNode, visibilityCache) {
1436
+ return filterFocusable(getParentAutofocusables(topNode), visibilityCache);
1437
+ };
1438
+ var contains = function(scope, element) {
1439
+ if (scope.shadowRoot) return contains(scope.shadowRoot, element);
1440
+ else {
1441
+ if (void 0 !== Object.getPrototypeOf(scope).contains && Object.getPrototypeOf(scope).contains.call(scope, element)) return true;
1442
+ return toArray(scope.children).some(function(child) {
1443
+ var _a;
1444
+ if (child instanceof HTMLIFrameElement) {
1445
+ var iframeBody = null == (_a = child.contentDocument) ? void 0 : _a.body;
1446
+ if (iframeBody) return contains(iframeBody, element);
1447
+ return false;
1448
+ }
1449
+ return contains(child, element);
1450
+ });
1451
+ }
1452
+ };
1453
+ var safeProbe = function(cb) {
1454
+ try {
1455
+ return cb();
1456
+ } catch (e) {
1457
+ return;
1458
+ }
1459
+ };
1460
+ var getActiveElement = function(inDocument) {
1461
+ if (void 0 === inDocument) inDocument = document;
1462
+ if (!inDocument || !inDocument.activeElement) return;
1463
+ var activeElement = inDocument.activeElement;
1464
+ return activeElement.shadowRoot ? getActiveElement(activeElement.shadowRoot) : activeElement instanceof HTMLIFrameElement && safeProbe(function() {
1465
+ return activeElement.contentWindow.document;
1466
+ }) ? getActiveElement(activeElement.contentWindow.document) : activeElement;
1467
+ };
1468
+ var focusIsHidden = function(inDocument) {
1469
+ if (void 0 === inDocument) inDocument = document;
1470
+ var activeElement = getActiveElement(inDocument);
1471
+ if (!activeElement) return false;
1472
+ return toArray(inDocument.querySelectorAll("[".concat(FOCUS_ALLOW, "]"))).some(function(node) {
1473
+ return contains(node, activeElement);
1474
+ });
1475
+ };
1476
+ var filterNested = function(nodes) {
1477
+ var contained = new Set();
1478
+ var l = nodes.length;
1479
+ for(var i = 0; i < l; i += 1)for(var j = i + 1; j < l; j += 1){
1480
+ var position = nodes[i].compareDocumentPosition(nodes[j]);
1481
+ if ((position & Node.DOCUMENT_POSITION_CONTAINED_BY) > 0) contained.add(j);
1482
+ if ((position & Node.DOCUMENT_POSITION_CONTAINS) > 0) contained.add(i);
1483
+ }
1484
+ return nodes.filter(function(_, index) {
1485
+ return !contained.has(index);
1486
+ });
1487
+ };
1488
+ var getTopParent = function(node) {
1489
+ return node.parentNode ? getTopParent(node.parentNode) : node;
1490
+ };
1491
+ var getAllAffectedNodes = function(node) {
1492
+ var nodes = asArray(node);
1493
+ return nodes.filter(Boolean).reduce(function(acc, currentNode) {
1494
+ var group = currentNode.getAttribute(FOCUS_GROUP);
1495
+ acc.push.apply(acc, group ? filterNested(toArray(getTopParent(currentNode).querySelectorAll("[".concat(FOCUS_GROUP, "=\"").concat(group, "\"]:not([").concat(FOCUS_DISABLED, "=\"disabled\"])")))) : [
1496
+ currentNode
1497
+ ]);
1498
+ return acc;
1499
+ }, []);
1500
+ };
1501
+ var focusInFrame = function(frame, activeElement) {
1502
+ return frame === activeElement;
1503
+ };
1504
+ var focusInsideIframe = function(topNode, activeElement) {
1505
+ return Boolean(toArray(topNode.querySelectorAll('iframe')).some(function(node) {
1506
+ return focusInFrame(node, activeElement);
1507
+ }));
1508
+ };
1509
+ var focusInside = function(topNode, activeElement) {
1510
+ if (void 0 === activeElement) activeElement = getActiveElement(getFirst(topNode).ownerDocument);
1511
+ if (!activeElement || activeElement.dataset && activeElement.dataset.focusGuard) return false;
1512
+ return getAllAffectedNodes(topNode).some(function(node) {
1513
+ return contains(node, activeElement) || focusInsideIframe(node, activeElement);
1514
+ });
1515
+ };
1516
+ var focusOn = function(target, focusOptions) {
1517
+ if (!target) return;
1518
+ if ('focus' in target) target.focus(focusOptions);
1519
+ if ('contentWindow' in target && target.contentWindow) target.contentWindow.focus();
1520
+ };
1521
+ var findSelectedRadio = function(node, nodes) {
1522
+ return nodes.filter(isRadioElement).filter(function(el) {
1523
+ return el.name === node.name;
1524
+ }).filter(function(el) {
1525
+ return el.checked;
1526
+ })[0] || node;
1527
+ };
1528
+ var correctNode = function(node, nodes) {
1529
+ if (isRadioElement(node) && node.name) return findSelectedRadio(node, nodes);
1530
+ return node;
1531
+ };
1532
+ var correctNodes = function(nodes) {
1533
+ var resultSet = new Set();
1534
+ nodes.forEach(function(node) {
1535
+ return resultSet.add(correctNode(node, nodes));
1536
+ });
1537
+ return nodes.filter(function(node) {
1538
+ return resultSet.has(node);
1539
+ });
1540
+ };
1541
+ var pickFirstFocus = function(nodes) {
1542
+ if (nodes[0] && nodes.length > 1) return correctNode(nodes[0], nodes);
1543
+ return nodes[0];
1544
+ };
1545
+ var pickFocusable = function(nodes, node) {
1546
+ return nodes.indexOf(correctNode(node, nodes));
1547
+ };
1548
+ var NEW_FOCUS = 'NEW_FOCUS';
1549
+ var newFocus = function(innerNodes, innerTabbables, outerNodes, activeElement, lastNode) {
1550
+ var cnt = innerNodes.length;
1551
+ var firstFocus = innerNodes[0];
1552
+ var lastFocus = innerNodes[cnt - 1];
1553
+ var isOnGuard = isGuard(activeElement);
1554
+ if (activeElement && innerNodes.indexOf(activeElement) >= 0) return;
1555
+ var activeIndex = void 0 !== activeElement ? outerNodes.indexOf(activeElement) : -1;
1556
+ var lastIndex = lastNode ? outerNodes.indexOf(lastNode) : activeIndex;
1557
+ var lastNodeInside = lastNode ? innerNodes.indexOf(lastNode) : -1;
1558
+ if (-1 === activeIndex) {
1559
+ if (-1 !== lastNodeInside) return lastNodeInside;
1560
+ return NEW_FOCUS;
1561
+ }
1562
+ if (-1 === lastNodeInside) return NEW_FOCUS;
1563
+ var indexDiff = activeIndex - lastIndex;
1564
+ var firstNodeIndex = outerNodes.indexOf(firstFocus);
1565
+ var lastNodeIndex = outerNodes.indexOf(lastFocus);
1566
+ var correctedNodes = correctNodes(outerNodes);
1567
+ var currentFocusableIndex = void 0 !== activeElement ? correctedNodes.indexOf(activeElement) : -1;
1568
+ var previousFocusableIndex = lastNode ? correctedNodes.indexOf(lastNode) : currentFocusableIndex;
1569
+ var tabbableNodes = correctedNodes.filter(function(node) {
1570
+ return node.tabIndex >= 0;
1571
+ });
1572
+ var currentTabbableIndex = void 0 !== activeElement ? tabbableNodes.indexOf(activeElement) : -1;
1573
+ var previousTabbableIndex = lastNode ? tabbableNodes.indexOf(lastNode) : currentTabbableIndex;
1574
+ var focusIndexDiff = currentTabbableIndex >= 0 && previousTabbableIndex >= 0 ? previousTabbableIndex - currentTabbableIndex : previousFocusableIndex - currentFocusableIndex;
1575
+ if (!indexDiff && lastNodeInside >= 0) return lastNodeInside;
1576
+ if (0 === innerTabbables.length) return lastNodeInside;
1577
+ var returnFirstNode = pickFocusable(innerNodes, innerTabbables[0]);
1578
+ var returnLastNode = pickFocusable(innerNodes, innerTabbables[innerTabbables.length - 1]);
1579
+ if (activeIndex <= firstNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) return returnLastNode;
1580
+ if (activeIndex >= lastNodeIndex && isOnGuard && Math.abs(indexDiff) > 1) return returnFirstNode;
1581
+ if (indexDiff && Math.abs(focusIndexDiff) > 1) return lastNodeInside;
1582
+ if (activeIndex <= firstNodeIndex) return returnLastNode;
1583
+ if (activeIndex > lastNodeIndex) return returnFirstNode;
1584
+ if (indexDiff) {
1585
+ if (Math.abs(indexDiff) > 1) return lastNodeInside;
1586
+ return (cnt + lastNodeInside + indexDiff) % cnt;
1587
+ }
1588
+ };
1589
+ var findAutoFocused = function(autoFocusables) {
1590
+ return function(node) {
1591
+ var _a;
1592
+ var autofocus = null == (_a = getDataset(node)) ? void 0 : _a.autofocus;
1593
+ return node.autofocus || void 0 !== autofocus && 'false' !== autofocus || autoFocusables.indexOf(node) >= 0;
1594
+ };
1595
+ };
1596
+ var pickAutofocus = function(nodesIndexes, orderedNodes, groups) {
1597
+ var nodes = nodesIndexes.map(function(_a) {
1598
+ var node = _a.node;
1599
+ return node;
1600
+ });
1601
+ var autoFocusable = filterAutoFocusable(nodes.filter(findAutoFocused(groups)));
1602
+ if (autoFocusable && autoFocusable.length) return pickFirstFocus(autoFocusable);
1603
+ return pickFirstFocus(filterAutoFocusable(orderedNodes));
1604
+ };
1605
+ var getParents = function(node, parents) {
1606
+ if (void 0 === parents) parents = [];
1607
+ parents.push(node);
1608
+ if (node.parentNode) getParents(node.parentNode.host || node.parentNode, parents);
1609
+ return parents;
1610
+ };
1611
+ var getCommonParent = function(nodeA, nodeB) {
1612
+ var parentsA = getParents(nodeA);
1613
+ var parentsB = getParents(nodeB);
1614
+ for(var i = 0; i < parentsA.length; i += 1){
1615
+ var currentParent = parentsA[i];
1616
+ if (parentsB.indexOf(currentParent) >= 0) return currentParent;
1617
+ }
1618
+ return false;
1619
+ };
1620
+ var getTopCommonParent = function(baseActiveElement, leftEntry, rightEntries) {
1621
+ var activeElements = asArray(baseActiveElement);
1622
+ var leftEntries = asArray(leftEntry);
1623
+ var activeElement = activeElements[0];
1624
+ var topCommon = false;
1625
+ leftEntries.filter(Boolean).forEach(function(entry) {
1626
+ topCommon = getCommonParent(topCommon || entry, entry) || topCommon;
1627
+ rightEntries.filter(Boolean).forEach(function(subEntry) {
1628
+ var common = getCommonParent(activeElement, subEntry);
1629
+ if (common) topCommon = !topCommon || contains(common, topCommon) ? common : getCommonParent(common, topCommon);
1630
+ });
1631
+ });
1632
+ return topCommon;
1633
+ };
1634
+ var allParentAutofocusables = function(entries, visibilityCache) {
1635
+ return entries.reduce(function(acc, node) {
1636
+ return acc.concat(parentAutofocusables(node, visibilityCache));
1637
+ }, []);
1638
+ };
1639
+ var reorderNodes = function(srcNodes, dstNodes) {
1640
+ var remap = new Map();
1641
+ dstNodes.forEach(function(entity) {
1642
+ return remap.set(entity.node, entity);
1643
+ });
1644
+ return srcNodes.map(function(node) {
1645
+ return remap.get(node);
1646
+ }).filter(isDefined);
1647
+ };
1648
+ var focusSolver = function(topNode, lastNode) {
1649
+ var activeElement = getActiveElement(asArray(topNode).length > 0 ? document : getFirst(topNode).ownerDocument);
1650
+ var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
1651
+ var commonParent = getTopCommonParent(activeElement || topNode, topNode, entries);
1652
+ var visibilityCache = new Map();
1653
+ var anyFocusable = getFocusableNodes(entries, visibilityCache);
1654
+ var innerElements = anyFocusable.filter(function(_a) {
1655
+ var node = _a.node;
1656
+ return isNotAGuard(node);
1657
+ });
1658
+ if (!innerElements[0]) return;
1659
+ var outerNodes = getFocusableNodes([
1660
+ commonParent
1661
+ ], visibilityCache).map(function(_a) {
1662
+ var node = _a.node;
1663
+ return node;
1664
+ });
1665
+ var orderedInnerElements = reorderNodes(outerNodes, innerElements);
1666
+ var innerFocusables = orderedInnerElements.map(function(_a) {
1667
+ var node = _a.node;
1668
+ return node;
1669
+ });
1670
+ var innerTabbable = orderedInnerElements.filter(function(_a) {
1671
+ var tabIndex = _a.tabIndex;
1672
+ return tabIndex >= 0;
1673
+ }).map(function(_a) {
1674
+ var node = _a.node;
1675
+ return node;
1676
+ });
1677
+ var newId = newFocus(innerFocusables, innerTabbable, outerNodes, activeElement, lastNode);
1678
+ if (newId === NEW_FOCUS) {
1679
+ var focusNode = pickAutofocus(anyFocusable, innerTabbable, allParentAutofocusables(entries, visibilityCache)) || pickAutofocus(anyFocusable, innerFocusables, allParentAutofocusables(entries, visibilityCache));
1680
+ if (focusNode) return {
1681
+ node: focusNode
1682
+ };
1683
+ else return void console.warn('focus-lock: cannot find any node to move focus into');
1684
+ }
1685
+ if (void 0 === newId) return newId;
1686
+ return orderedInnerElements[newId];
1687
+ };
1688
+ var guardCount = 0;
1689
+ var lockDisabled = false;
1690
+ var moveFocusInside = function(topNode, lastNode, options) {
1691
+ if (void 0 === options) options = {};
1692
+ var focusable = focusSolver(topNode, lastNode);
1693
+ if (lockDisabled) return;
1694
+ if (focusable) {
1695
+ if (guardCount > 2) {
1696
+ console.error("FocusLock: focus-fighting detected. Only one focus management system could be active. See https://github.com/theKashey/focus-lock/#focus-fighting");
1697
+ lockDisabled = true;
1698
+ setTimeout(function() {
1699
+ lockDisabled = false;
1700
+ }, 1);
1701
+ return;
1702
+ }
1703
+ guardCount++;
1704
+ focusOn(focusable.node, options.focusOptions);
1705
+ guardCount--;
1706
+ }
1707
+ };
1708
+ function weakRef(value) {
1709
+ if (!value) return null;
1710
+ if ("u" < typeof WeakRef) return function() {
1711
+ return value || null;
1712
+ };
1713
+ var w = value ? new WeakRef(value) : null;
1714
+ return function() {
1715
+ return (null == w ? void 0 : w.deref()) || null;
1716
+ };
1717
+ }
1718
+ var recordElementLocation = function(element) {
1719
+ if (!element) return null;
1720
+ var stack = [];
1721
+ var currentElement = element;
1722
+ while(currentElement && currentElement !== document.body){
1723
+ stack.push({
1724
+ current: weakRef(currentElement),
1725
+ parent: weakRef(currentElement.parentElement),
1726
+ left: weakRef(currentElement.previousElementSibling),
1727
+ right: weakRef(currentElement.nextElementSibling)
1728
+ });
1729
+ currentElement = currentElement.parentElement;
1730
+ }
1731
+ return {
1732
+ element: weakRef(element),
1733
+ stack: stack,
1734
+ ownerDocument: element.ownerDocument
1735
+ };
1736
+ };
1737
+ var restoreFocusTo = function(location) {
1738
+ var _a, _b, _c, _d, _e;
1739
+ if (!location) return;
1740
+ var stack = location.stack, ownerDocument = location.ownerDocument;
1741
+ var visibilityCache = new Map();
1742
+ for(var _i = 0, stack_1 = stack; _i < stack_1.length; _i++){
1743
+ var line = stack_1[_i];
1744
+ var parent_1 = null == (_a = line.parent) ? void 0 : _a.call(line);
1745
+ if (parent_1 && ownerDocument.contains(parent_1)) {
1746
+ var left = null == (_b = line.left) ? void 0 : _b.call(line);
1747
+ var savedCurrent = line.current();
1748
+ var current = parent_1.contains(savedCurrent) ? savedCurrent : void 0;
1749
+ var right = null == (_c = line.right) ? void 0 : _c.call(line);
1750
+ var focusables = getTabbableNodes([
1751
+ parent_1
1752
+ ], visibilityCache);
1753
+ var aim = null != (_e = null != (_d = null != current ? current : null == left ? void 0 : left.nextElementSibling) ? _d : right) ? _e : left;
1754
+ while(aim){
1755
+ for(var _f = 0, focusables_1 = focusables; _f < focusables_1.length; _f++){
1756
+ var focusable = focusables_1[_f];
1757
+ if (null == aim ? void 0 : aim.contains(focusable.node)) return focusable.node;
1758
+ }
1759
+ aim = aim.nextElementSibling;
1760
+ }
1761
+ if (focusables.length) return focusables[0].node;
1762
+ }
1763
+ }
1764
+ };
1765
+ var return_focus_captureFocusRestore = function(targetElement) {
1766
+ var location = recordElementLocation(targetElement);
1767
+ return function() {
1768
+ return restoreFocusTo(location);
1769
+ };
1770
+ };
1771
+ var expandFocusableNodes = function(topNode) {
1772
+ var entries = getAllAffectedNodes(topNode).filter(isNotAGuard);
1773
+ var commonParent = getTopCommonParent(topNode, topNode, entries);
1774
+ var outerNodes = orderByTabIndex(getFocusables([
1775
+ commonParent
1776
+ ], true), true, true);
1777
+ var innerElements = getFocusables(entries, false);
1778
+ return outerNodes.map(function(_a) {
1779
+ var node = _a.node, index = _a.index;
1780
+ return {
1781
+ node: node,
1782
+ index: index,
1783
+ lockItem: innerElements.indexOf(node) >= 0,
1784
+ guard: isGuard(node)
1785
+ };
1786
+ });
1787
+ };
1788
+ var getRelativeFocusable = function(element, scope, useTabbables) {
1789
+ if (!element || !scope) {
1790
+ console.error('no element or scope given');
1791
+ return {};
1792
+ }
1793
+ var shards = asArray(scope);
1794
+ if (shards.every(function(shard) {
1795
+ return !contains(shard, element);
1796
+ })) {
1797
+ console.error('Active element is not contained in the scope');
1798
+ return {};
1799
+ }
1800
+ var focusables = useTabbables ? getTabbableNodes(shards, new Map()) : getFocusableNodes(shards, new Map());
1801
+ var current = focusables.findIndex(function(_a) {
1802
+ var node = _a.node;
1803
+ return node === element;
1804
+ });
1805
+ if (-1 === current) return;
1806
+ return {
1807
+ prev: focusables[current - 1],
1808
+ next: focusables[current + 1],
1809
+ first: focusables[0],
1810
+ last: focusables[focusables.length - 1]
1811
+ };
1812
+ };
1813
+ var getBoundary = function(shards, useTabbables) {
1814
+ var set = useTabbables ? getTabbableNodes(asArray(shards), new Map()) : getFocusableNodes(asArray(shards), new Map());
1815
+ return {
1816
+ first: set[0],
1817
+ last: set[set.length - 1]
1818
+ };
1819
+ };
1820
+ var defaultOptions = function(options) {
1821
+ return Object.assign({
1822
+ scope: document.body,
1823
+ cycle: true,
1824
+ onlyTabbable: true
1825
+ }, options);
1826
+ };
1827
+ var moveFocus = function(fromElement, options, cb) {
1828
+ if (void 0 === options) options = {};
1829
+ var newOptions = defaultOptions(options);
1830
+ var solution = getRelativeFocusable(fromElement, newOptions.scope, newOptions.onlyTabbable);
1831
+ if (!solution) return;
1832
+ var target = cb(solution, newOptions.cycle);
1833
+ if (target) focusOn(target.node, newOptions.focusOptions);
1834
+ };
1835
+ var focusNextElement = function(fromElement, options) {
1836
+ if (void 0 === options) options = {};
1837
+ moveFocus(fromElement, options, function(_a, cycle) {
1838
+ var next = _a.next, first = _a.first;
1839
+ return next || cycle && first;
1840
+ });
1841
+ };
1842
+ var focusPrevElement = function(fromElement, options) {
1843
+ if (void 0 === options) options = {};
1844
+ moveFocus(fromElement, options, function(_a, cycle) {
1845
+ var prev = _a.prev, last = _a.last;
1846
+ return prev || cycle && last;
1847
+ });
1848
+ };
1849
+ var pickBoundary = function(scope, options, what) {
1850
+ var _a;
1851
+ var boundary = getBoundary(scope, null != (_a = options.onlyTabbable) ? _a : true);
1852
+ var node = boundary[what];
1853
+ if (node) focusOn(node.node, options.focusOptions);
1854
+ };
1855
+ var focusFirstElement = function(scope, options) {
1856
+ if (void 0 === options) options = {};
1857
+ pickBoundary(scope, options, 'first');
1858
+ };
1859
+ var focusLastElement = function(scope, options) {
1860
+ if (void 0 === options) options = {};
1861
+ pickBoundary(scope, options, 'last');
1862
+ };
1863
+ function deferAction(action) {
1864
+ setTimeout(action, 1);
1865
+ }
1866
+ var util_extractRef = function(ref) {
1867
+ return ref && 'current' in ref ? ref.current : ref;
1868
+ };
1869
+ var Trap_focusOnBody = function() {
1870
+ return document && document.activeElement === document.body;
1871
+ };
1872
+ var Trap_isFreeFocus = function() {
1873
+ return Trap_focusOnBody() || focusIsHidden();
1874
+ };
1875
+ var lastActiveTrap = null;
1876
+ var lastActiveFocus = null;
1877
+ var Trap_tryRestoreFocus = function() {
1878
+ return null;
1879
+ };
1880
+ var lastPortaledElement = null;
1881
+ var focusWasOutsideWindow = false;
1882
+ var windowFocused = false;
1883
+ var Trap_defaultWhitelist = function() {
1884
+ return true;
1885
+ };
1886
+ var Trap_focusWhitelisted = function(activeElement) {
1887
+ return (lastActiveTrap.whiteList || Trap_defaultWhitelist)(activeElement);
1888
+ };
1889
+ var Trap_recordPortal = function(observerNode, portaledElement) {
1890
+ lastPortaledElement = {
1891
+ observerNode: observerNode,
1892
+ portaledElement: portaledElement
1893
+ };
1894
+ };
1895
+ var Trap_focusIsPortaledPair = function(element) {
1896
+ return lastPortaledElement && lastPortaledElement.portaledElement === element;
1897
+ };
1898
+ function autoGuard(startIndex, end, step, allNodes) {
1899
+ var lastGuard = null;
1900
+ var i = startIndex;
1901
+ do {
1902
+ var item = allNodes[i];
1903
+ if (item.guard) {
1904
+ if (item.node.dataset.focusAutoGuard) lastGuard = item;
1905
+ } else if (item.lockItem) {
1906
+ if (i !== startIndex) return;
1907
+ lastGuard = null;
1908
+ } else break;
1909
+ }while ((i += step) !== end)
1910
+ if (lastGuard) lastGuard.node.tabIndex = 0;
1911
+ }
1912
+ var Trap_focusWasOutside = function(crossFrameOption) {
1913
+ if (crossFrameOption) return Boolean(focusWasOutsideWindow);
1914
+ return 'meanwhile' === focusWasOutsideWindow;
1915
+ };
1916
+ var Trap_checkInHost = function checkInHost(check, el, boundary) {
1917
+ return el && (el.host === check && (!el.activeElement || boundary.contains(el.activeElement)) || el.parentNode && checkInHost(check, el.parentNode, boundary));
1918
+ };
1919
+ var Trap_withinHost = function(activeElement, workingArea) {
1920
+ return workingArea.some(function(area) {
1921
+ return Trap_checkInHost(activeElement, area, area);
1922
+ });
1923
+ };
1924
+ var Trap_getNodeFocusables = function(nodes) {
1925
+ return getFocusableNodes(nodes, new Map());
1926
+ };
1927
+ var Trap_isNotFocusable = function(node) {
1928
+ return !Trap_getNodeFocusables([
1929
+ node.parentNode
1930
+ ]).some(function(el) {
1931
+ return el.node === node;
1932
+ });
1933
+ };
1934
+ var Trap_activateTrap = function() {
1935
+ var result = false;
1936
+ if (lastActiveTrap) {
1937
+ var _lastActiveTrap = lastActiveTrap, observed = _lastActiveTrap.observed, persistentFocus = _lastActiveTrap.persistentFocus, autoFocus = _lastActiveTrap.autoFocus, shards = _lastActiveTrap.shards, crossFrame = _lastActiveTrap.crossFrame, focusOptions = _lastActiveTrap.focusOptions, noFocusGuards = _lastActiveTrap.noFocusGuards;
1938
+ var workingNode = observed || lastPortaledElement && lastPortaledElement.portaledElement;
1939
+ if (Trap_focusOnBody() && lastActiveFocus && lastActiveFocus !== document.body) {
1940
+ if (!document.body.contains(lastActiveFocus) || Trap_isNotFocusable(lastActiveFocus)) {
1941
+ var newTarget = Trap_tryRestoreFocus();
1942
+ if (newTarget) newTarget.focus();
1943
+ }
1944
+ }
1945
+ var activeElement = document && document.activeElement;
1946
+ if (workingNode) {
1947
+ var workingArea = [
1948
+ workingNode
1949
+ ].concat(shards.map(util_extractRef).filter(Boolean));
1950
+ var shouldForceRestoreFocus = function() {
1951
+ if (!Trap_focusWasOutside(crossFrame) || !noFocusGuards || !lastActiveFocus || windowFocused) return false;
1952
+ var nodes = Trap_getNodeFocusables(workingArea);
1953
+ var lastIndex = nodes.findIndex(function(_ref) {
1954
+ var node = _ref.node;
1955
+ return node === lastActiveFocus;
1956
+ });
1957
+ return 0 === lastIndex || lastIndex === nodes.length - 1;
1958
+ };
1959
+ if (!activeElement || Trap_focusWhitelisted(activeElement)) {
1960
+ if (persistentFocus || shouldForceRestoreFocus() || !Trap_isFreeFocus() || !lastActiveFocus && autoFocus) {
1961
+ if (workingNode && !(focusInside(workingArea) || activeElement && Trap_withinHost(activeElement, workingArea) || Trap_focusIsPortaledPair(activeElement))) if (document && !lastActiveFocus && activeElement && !autoFocus) {
1962
+ if (activeElement.blur) activeElement.blur();
1963
+ document.body.focus();
1964
+ } else {
1965
+ result = moveFocusInside(workingArea, lastActiveFocus, {
1966
+ focusOptions: focusOptions
1967
+ });
1968
+ lastPortaledElement = {};
1969
+ }
1970
+ lastActiveFocus = document && document.activeElement;
1971
+ if (lastActiveFocus !== document.body) Trap_tryRestoreFocus = return_focus_captureFocusRestore(lastActiveFocus);
1972
+ focusWasOutsideWindow = false;
1973
+ }
1974
+ }
1975
+ if (document && activeElement !== document.activeElement && document.querySelector('[data-focus-auto-guard]')) {
1976
+ var newActiveElement = document && document.activeElement;
1977
+ var allNodes = expandFocusableNodes(workingArea);
1978
+ var focusedIndex = allNodes.map(function(_ref2) {
1979
+ var node = _ref2.node;
1980
+ return node;
1981
+ }).indexOf(newActiveElement);
1982
+ if (focusedIndex > -1) {
1983
+ allNodes.filter(function(_ref3) {
1984
+ var guard = _ref3.guard, node = _ref3.node;
1985
+ return guard && node.dataset.focusAutoGuard;
1986
+ }).forEach(function(_ref4) {
1987
+ var node = _ref4.node;
1988
+ return node.removeAttribute('tabIndex');
1989
+ });
1990
+ autoGuard(focusedIndex, allNodes.length, 1, allNodes);
1991
+ autoGuard(focusedIndex, -1, -1, allNodes);
1992
+ }
1993
+ }
1994
+ }
1995
+ }
1996
+ return result;
1997
+ };
1998
+ var Trap_onTrap = function(event) {
1999
+ if (Trap_activateTrap() && event) {
2000
+ event.stopPropagation();
2001
+ event.preventDefault();
2002
+ }
2003
+ };
2004
+ var Trap_onBlur = function() {
2005
+ return deferAction(Trap_activateTrap);
2006
+ };
2007
+ var Trap_onFocus = function(event) {
2008
+ var source = event.target;
2009
+ var currentNode = event.currentTarget;
2010
+ if (!currentNode.contains(source)) Trap_recordPortal(currentNode, source);
2011
+ };
2012
+ var Trap_FocusWatcher = function() {
2013
+ return null;
2014
+ };
2015
+ var Trap_FocusTrap = function(_ref5) {
2016
+ var children = _ref5.children;
2017
+ return /*#__PURE__*/ react.createElement("div", {
2018
+ onBlur: Trap_onBlur,
2019
+ onFocus: Trap_onFocus
2020
+ }, children);
2021
+ };
2022
+ Trap_FocusTrap.propTypes = "production" !== process.env.NODE_ENV ? {
2023
+ children: prop_types_default().node.isRequired
2024
+ } : {};
2025
+ var Trap_onWindowFocus = function() {
2026
+ windowFocused = true;
2027
+ };
2028
+ var Trap_onWindowBlur = function() {
2029
+ windowFocused = false;
2030
+ focusWasOutsideWindow = 'just';
2031
+ deferAction(function() {
2032
+ focusWasOutsideWindow = 'meanwhile';
2033
+ });
2034
+ };
2035
+ var Trap_attachHandler = function() {
2036
+ document.addEventListener('focusin', Trap_onTrap);
2037
+ document.addEventListener('focusout', Trap_onBlur);
2038
+ window.addEventListener('focus', Trap_onWindowFocus);
2039
+ window.addEventListener('blur', Trap_onWindowBlur);
2040
+ };
2041
+ var Trap_detachHandler = function() {
2042
+ document.removeEventListener('focusin', Trap_onTrap);
2043
+ document.removeEventListener('focusout', Trap_onBlur);
2044
+ window.removeEventListener('focus', Trap_onWindowFocus);
2045
+ window.removeEventListener('blur', Trap_onWindowBlur);
2046
+ };
2047
+ function Trap_reducePropsToState(propsList) {
2048
+ return propsList.filter(function(_ref6) {
2049
+ var disabled = _ref6.disabled;
2050
+ return !disabled;
2051
+ });
2052
+ }
2053
+ var focusLockAPI = {
2054
+ moveFocusInside: moveFocusInside,
2055
+ focusInside: focusInside,
2056
+ focusNextElement: focusNextElement,
2057
+ focusPrevElement: focusPrevElement,
2058
+ focusFirstElement: focusFirstElement,
2059
+ focusLastElement: focusLastElement,
2060
+ captureFocusRestore: return_focus_captureFocusRestore
2061
+ };
2062
+ function Trap_handleStateChangeOnClient(traps) {
2063
+ var trap = traps.slice(-1)[0];
2064
+ if (trap && !lastActiveTrap) Trap_attachHandler();
2065
+ var lastTrap = lastActiveTrap;
2066
+ var sameTrap = lastTrap && trap && trap.id === lastTrap.id;
2067
+ lastActiveTrap = trap;
2068
+ if (lastTrap && !sameTrap) {
2069
+ lastTrap.onDeactivation();
2070
+ if (!traps.filter(function(_ref7) {
2071
+ var id = _ref7.id;
2072
+ return id === lastTrap.id;
2073
+ }).length) lastTrap.returnFocus(!trap);
2074
+ }
2075
+ if (trap) {
2076
+ lastActiveFocus = null;
2077
+ if (!sameTrap || lastTrap.observed !== trap.observed) trap.onActivation(focusLockAPI);
2078
+ Trap_activateTrap();
2079
+ deferAction(Trap_activateTrap);
2080
+ } else {
2081
+ Trap_detachHandler();
2082
+ lastActiveFocus = null;
2083
+ }
2084
+ }
2085
+ mediumFocus.assignSyncMedium(Trap_onFocus);
2086
+ mediumBlur.assignMedium(Trap_onBlur);
2087
+ mediumEffect.assignMedium(function(cb) {
2088
+ return cb(focusLockAPI);
2089
+ });
2090
+ const Trap = index_es(Trap_reducePropsToState, Trap_handleStateChangeOnClient)(Trap_FocusWatcher);
2091
+ var FocusLockCombination = /*#__PURE__*/ forwardRef(function(props, ref) {
2092
+ return /*#__PURE__*/ react.createElement(Lock, _extends({
2093
+ sideCar: Trap,
2094
+ ref: ref
2095
+ }, props));
2096
+ });
2097
+ var Combination_ref = Lock.propTypes || {}, propTypes = (Combination_ref.sideCar, _objectWithoutPropertiesLoose(Combination_ref, [
2098
+ "sideCar"
2099
+ ]));
2100
+ FocusLockCombination.propTypes = "production" !== process.env.NODE_ENV ? propTypes : {};
2101
+ const Combination = FocusLockCombination;
2102
+ const es2015 = Combination;
2103
+ const scrollLocks = new WeakMap();
2104
+ function lockBodyScroll(body) {
2105
+ const existing = scrollLocks.get(body);
2106
+ const lock = existing ?? {
2107
+ owners: new Set(),
2108
+ styles: [
2109
+ 'overflow-x',
2110
+ 'overflow-y',
2111
+ 'padding-right'
2112
+ ].map((property)=>({
2113
+ property,
2114
+ value: body.style.getPropertyValue(property),
2115
+ priority: body.style.getPropertyPriority(property)
2116
+ }))
2117
+ };
2118
+ if (!existing) {
2119
+ scrollLocks.set(body, lock);
2120
+ if ('hidden' !== body.style.overflowY && 'hidden' !== body.style.overflow) {
2121
+ const doc = body.ownerDocument;
2122
+ const view = doc.defaultView;
2123
+ const scrollbar = (view?.innerWidth ?? 0) - doc.documentElement.clientWidth;
2124
+ if (view && scrollbar > 0) {
2125
+ const padding = Number.parseFloat(view.getComputedStyle(body).paddingRight) || 0;
2126
+ body.style.setProperty('padding-right', `${padding + scrollbar}px`, body.style.getPropertyPriority('padding-right'));
2127
+ }
2128
+ }
2129
+ for (const property of [
2130
+ 'overflow-x',
2131
+ 'overflow-y'
2132
+ ])body.style.setProperty(property, 'hidden', body.style.getPropertyPriority(property));
2133
+ }
2134
+ const owner = Symbol();
2135
+ lock.owners.add(owner);
2136
+ return ()=>{
2137
+ if (!lock.owners.delete(owner) || lock.owners.size > 0) return;
2138
+ scrollLocks.delete(body);
2139
+ for (const { property, value, priority } of lock.styles)body.style.setProperty(property, value, priority);
2140
+ };
2141
+ }
2142
+ const ENTER = 'ov-drawer--enter';
2143
+ const ENTER_ACTIVE = 'ov-drawer--enter-active';
2144
+ const MOTION = {
2145
+ appear: ENTER,
2146
+ appearActive: ENTER_ACTIVE,
2147
+ enter: ENTER,
2148
+ enterActive: ENTER_ACTIVE,
2149
+ exitActive: 'ov-drawer--exit'
2150
+ };
2151
+ function Drawer({ id, open, title, closeLabel, triggerRef, children, className, lang, onClose }) {
2152
+ const panelRef = useRef(null);
2153
+ const maskRef = useRef(null);
2154
+ const [present, setPresent] = useState(open);
2155
+ const [layer, setLayer] = useState(null);
2156
+ usePortalTheme(Boolean(layer), triggerRef, layer);
2157
+ useEffect(()=>{
2158
+ if (layer) return lockBodyScroll(layer.ownerDocument.body);
2159
+ }, [
2160
+ layer
2161
+ ]);
2162
+ if ("u" < typeof document || !open && !present) return null;
2163
+ return /*#__PURE__*/ createPortal(/*#__PURE__*/ jsxs("div", {
2164
+ ref: setLayer,
2165
+ role: "presentation",
2166
+ className: [
2167
+ 'ov-drawer',
2168
+ className
2169
+ ].filter(Boolean).join(' '),
2170
+ lang: lang,
2171
+ onKeyDown: (event)=>{
2172
+ if ('Escape' !== event.key || event.defaultPrevented) return;
2173
+ if (!(event.target instanceof Node) || !event.currentTarget.contains(event.target)) return;
2174
+ event.preventDefault();
2175
+ event.stopPropagation();
2176
+ onClose();
2177
+ },
2178
+ children: [
2179
+ /*#__PURE__*/ jsx(CSSTransition, {
2180
+ nodeRef: maskRef,
2181
+ in: open,
2182
+ timeout: 300,
2183
+ classNames: MOTION,
2184
+ appear: true,
2185
+ mountOnEnter: true,
2186
+ unmountOnExit: true,
2187
+ children: /*#__PURE__*/ jsx("button", {
2188
+ ref: maskRef,
2189
+ type: "button",
2190
+ className: "ov-drawer__mask",
2191
+ "aria-label": closeLabel,
2192
+ "aria-hidden": "true",
2193
+ tabIndex: -1,
2194
+ onClick: onClose
2195
+ })
2196
+ }),
2197
+ /*#__PURE__*/ jsx(CSSTransition, {
2198
+ nodeRef: panelRef,
2199
+ in: open,
2200
+ timeout: 300,
2201
+ classNames: MOTION,
2202
+ appear: true,
2203
+ mountOnEnter: true,
2204
+ unmountOnExit: true,
2205
+ onEnter: ()=>setPresent(true),
2206
+ onExited: ()=>setPresent(false),
2207
+ children: /*#__PURE__*/ jsx("div", {
2208
+ ref: panelRef,
2209
+ id: id,
2210
+ role: "dialog",
2211
+ "aria-modal": "true",
2212
+ "aria-label": title,
2213
+ className: "ov-drawer__panel",
2214
+ children: /*#__PURE__*/ jsxs(es2015, {
2215
+ className: "ov-drawer__focus-lock",
2216
+ returnFocus: {
2217
+ preventScroll: true
2218
+ },
2219
+ crossFrame: false,
2220
+ children: [
2221
+ /*#__PURE__*/ jsx("button", {
2222
+ type: "button",
2223
+ className: "ov-drawer__close",
2224
+ "aria-label": closeLabel,
2225
+ onClick: onClose,
2226
+ children: /*#__PURE__*/ jsx(removereact, {
2227
+ width: 16,
2228
+ height: 16,
2229
+ "aria-hidden": "true"
2230
+ })
2231
+ }),
2232
+ /*#__PURE__*/ jsx("div", {
2233
+ className: "ov-drawer__body",
2234
+ children: children
2235
+ })
2236
+ ]
2237
+ })
2238
+ })
2239
+ })
2240
+ ]
2241
+ }), document.body);
2242
+ }
2243
+ function ConnectAgentIcon() {
2244
+ return /*#__PURE__*/ jsx("svg", {
2245
+ width: "14",
2246
+ height: "14",
2247
+ viewBox: "0 0 14 14",
2248
+ fill: "none",
2249
+ stroke: "currentColor",
2250
+ strokeWidth: "1.4",
2251
+ strokeLinecap: "round",
2252
+ strokeLinejoin: "round",
2253
+ "aria-hidden": "true",
2254
+ focusable: "false",
2255
+ children: /*#__PURE__*/ jsx("path", {
2256
+ d: "M5.187 1.75V3.736M8.876 1.75V3.736M7.031 10.547V12.25M4.052 3.736H10.011A1.135 1.135 0 0 1 11.147 4.872V8.277A2.27 2.27 0 0 1 8.876 10.547H5.187A2.27 2.27 0 0 1 2.917 8.277V4.872A1.135 1.135 0 0 1 4.052 3.736Z"
2257
+ })
2258
+ });
2259
+ }
2260
+ function ImportResourcesIcon() {
2261
+ return /*#__PURE__*/ jsx("svg", {
2262
+ width: "12",
2263
+ height: "12",
2264
+ viewBox: "0 0 12 12",
2265
+ fill: "none",
2266
+ stroke: "currentColor",
2267
+ strokeWidth: "1.4",
2268
+ strokeLinecap: "round",
2269
+ strokeLinejoin: "round",
2270
+ "aria-hidden": "true",
2271
+ focusable: "false",
2272
+ children: /*#__PURE__*/ jsx("path", {
2273
+ d: "M10.5 7.5V8.1C10.5 8.94008 10.5 9.36012 10.3365 9.68099C10.1927 9.96323 9.96323 10.1927 9.68099 10.3365C9.36012 10.5 8.94008 10.5 8.1 10.5H3.9C3.05992 10.5 2.63988 10.5 2.31901 10.3365C2.03677 10.1927 1.8073 9.96323 1.66349 9.68099C1.5 9.36012 1.5 8.94008 1.5 8.1V7.5M3.5 4L6 1.5L8.5 4M6 1.5V7.5"
2274
+ })
2275
+ });
2276
+ }
2277
+ function FileBrowserEntries({ locale = 'en-US', agentConnect, onConnectAgent, onImportResources, renderImportResources, labels, className, ...rest }) {
2278
+ const triggerRef = useRef(null);
2279
+ const drawerId = useId();
2280
+ const [drawerOpen, setDrawerOpen] = useState(false);
2281
+ const text = resolveFileBrowserEntriesLabels(locale, labels);
2282
+ const showConnect = Boolean(agentConnect || onConnectAgent);
2283
+ const importButton = /*#__PURE__*/ jsxs("button", {
2284
+ type: "button",
2285
+ className: "ov-file-browser-entries__entry",
2286
+ onClick: onImportResources,
2287
+ children: [
2288
+ /*#__PURE__*/ jsx("span", {
2289
+ className: "ov-file-browser-entries__icon",
2290
+ "aria-hidden": "true",
2291
+ children: /*#__PURE__*/ jsx(ImportResourcesIcon, {})
2292
+ }),
2293
+ /*#__PURE__*/ jsx("span", {
2294
+ className: "ov-file-browser-entries__label",
2295
+ children: text.importResources
2296
+ })
2297
+ ]
2298
+ });
2299
+ const importEntry = renderImportResources ? renderImportResources(importButton) : onImportResources ? importButton : null;
2300
+ const showImport = null != importEntry && 'boolean' != typeof importEntry;
2301
+ if (!showConnect && !showImport) return null;
2302
+ return /*#__PURE__*/ jsxs("div", {
2303
+ ...rest,
2304
+ className: [
2305
+ 'ov-file-browser-entries',
2306
+ className
2307
+ ].filter(Boolean).join(' '),
2308
+ children: [
2309
+ showConnect ? /*#__PURE__*/ jsxs("button", {
2310
+ ref: triggerRef,
2311
+ type: "button",
2312
+ className: "ov-file-browser-entries__entry",
2313
+ "aria-haspopup": agentConnect ? 'dialog' : void 0,
2314
+ "aria-controls": agentConnect ? drawerId : void 0,
2315
+ "aria-expanded": agentConnect ? drawerOpen : void 0,
2316
+ onClick: ()=>{
2317
+ if (agentConnect) setDrawerOpen(true);
2318
+ onConnectAgent?.();
2319
+ },
2320
+ children: [
2321
+ /*#__PURE__*/ jsx("span", {
2322
+ className: "ov-file-browser-entries__icon",
2323
+ "aria-hidden": "true",
2324
+ children: /*#__PURE__*/ jsx(ConnectAgentIcon, {})
2325
+ }),
2326
+ /*#__PURE__*/ jsx("span", {
2327
+ className: "ov-file-browser-entries__label",
2328
+ children: text.connectAgent
2329
+ })
2330
+ ]
2331
+ }) : null,
2332
+ showConnect && showImport ? /*#__PURE__*/ jsx(Divider, {
2333
+ className: "ov-file-browser-entries__divider",
2334
+ length: 12,
2335
+ color: "var(--ov-ui-color-primary, var(--ov-ui-primary-default))",
2336
+ style: {
2337
+ opacity: 0.5
2338
+ }
2339
+ }) : null,
2340
+ agentConnect ? /*#__PURE__*/ jsx(Drawer, {
2341
+ id: drawerId,
2342
+ open: drawerOpen,
2343
+ title: text.connectAgent,
2344
+ closeLabel: text.close,
2345
+ triggerRef: triggerRef,
2346
+ className: "ov-file-browser-entries__drawer",
2347
+ lang: agentConnect.locale,
2348
+ onClose: ()=>setDrawerOpen(false),
2349
+ children: /*#__PURE__*/ jsx(AgentConnect, {
2350
+ ...agentConnect
2351
+ })
2352
+ }) : null,
2353
+ showImport ? /*#__PURE__*/ jsx("span", {
2354
+ className: "ov-file-browser-entries__import-slot",
2355
+ children: importEntry
2356
+ }) : null
2357
+ ]
2358
+ });
2359
+ }
2360
+ export { FileBrowserEntries };