@gobolt/genesis 0.0.7

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 (142) hide show
  1. package/README.md +86 -0
  2. package/dist/AntdIcon-Bsnbyy6g.js +200 -0
  3. package/dist/CheckOutlined-DAynWe12.js +527 -0
  4. package/dist/CloseCircleFilled-ZIY-u-27.js +13 -0
  5. package/dist/Compact-CJBo3f0u.js +185 -0
  6. package/dist/ContextIsolator-CGkdKtc3.js +20 -0
  7. package/dist/ExclamationCircleFilled-BICVVQIg.js +21 -0
  8. package/dist/Form-Cylpi4M4.js +1815 -0
  9. package/dist/Overflow-CP1M4Z0s.js +369 -0
  10. package/dist/SearchOutlined-DuzJkIiQ.js +52 -0
  11. package/dist/TextArea-3MOYYuAQ.js +1680 -0
  12. package/dist/bundle.css +1 -0
  13. package/dist/button-BNV2qdrP.js +1392 -0
  14. package/dist/compact-item-DH13cl8A.js +61 -0
  15. package/dist/components/atoms/button/Button.d.ts +12 -0
  16. package/dist/components/atoms/button/Button.js +27 -0
  17. package/dist/components/atoms/button/__stories__/Button.stories.d.ts +13 -0
  18. package/dist/components/atoms/button/index.d.ts +2 -0
  19. package/dist/components/atoms/button/index.js +4 -0
  20. package/dist/components/atoms/button/styles.d.ts +12 -0
  21. package/dist/components/atoms/button/styles.js +71 -0
  22. package/dist/components/atoms/checkbox/Checkbox.d.ts +10 -0
  23. package/dist/components/atoms/checkbox/Checkbox.js +13 -0
  24. package/dist/components/atoms/checkbox/__stories__/Checkbox.stories.d.ts +8 -0
  25. package/dist/components/atoms/checkbox/__tests__/Checkbox.test.d.ts +1 -0
  26. package/dist/components/atoms/checkbox/__tests__/Checkbox.test.js +18 -0
  27. package/dist/components/atoms/checkbox/index.d.ts +2 -0
  28. package/dist/components/atoms/checkbox/index.js +4 -0
  29. package/dist/components/atoms/checkbox/styles.d.ts +11 -0
  30. package/dist/components/atoms/checkbox/styles.js +582 -0
  31. package/dist/components/atoms/index.d.ts +1 -0
  32. package/dist/components/atoms/index.js +3 -0
  33. package/dist/components/atoms/input/Input.d.ts +11 -0
  34. package/dist/components/atoms/input/Input.js +12 -0
  35. package/dist/components/atoms/input/__stories__/Input.stories.d.ts +10 -0
  36. package/dist/components/atoms/input/__tests__/Input.test.d.ts +1 -0
  37. package/dist/components/atoms/input/__tests__/Input.test.js +28 -0
  38. package/dist/components/atoms/input/index.d.ts +2 -0
  39. package/dist/components/atoms/input/index.js +4 -0
  40. package/dist/components/atoms/input/styles.d.ts +14 -0
  41. package/dist/components/atoms/input/styles.js +415 -0
  42. package/dist/components/atoms/select/Select.d.ts +11 -0
  43. package/dist/components/atoms/select/Select.js +24 -0
  44. package/dist/components/atoms/select/__stories__/Select.stories.d.ts +8 -0
  45. package/dist/components/atoms/select/__tests__/Select.test.d.ts +1 -0
  46. package/dist/components/atoms/select/__tests__/Select.test.js +10735 -0
  47. package/dist/components/atoms/select/index.d.ts +2 -0
  48. package/dist/components/atoms/select/index.js +4 -0
  49. package/dist/components/atoms/select/styles.d.ts +15 -0
  50. package/dist/components/atoms/select/styles.js +3868 -0
  51. package/dist/components/atoms/typography/Typography.d.ts +11 -0
  52. package/dist/components/atoms/typography/Typography.js +44 -0
  53. package/dist/components/atoms/typography/__stories__/Typography.stories.d.ts +12 -0
  54. package/dist/components/atoms/typography/__tests__/Typography.test.d.ts +1 -0
  55. package/dist/components/atoms/typography/__tests__/Typography.test.js +16 -0
  56. package/dist/components/atoms/typography/index.d.ts +2 -0
  57. package/dist/components/atoms/typography/index.js +4 -0
  58. package/dist/components/atoms/typography/styles.d.ts +11 -0
  59. package/dist/components/atoms/typography/styles.js +28 -0
  60. package/dist/components/index.d.js +1 -0
  61. package/dist/components/index.d.ts +14 -0
  62. package/dist/components/index.js +16 -0
  63. package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.d.ts +10 -0
  64. package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.js +35 -0
  65. package/dist/components/molecules/error-boundary-fallback/__stories__/ErrorBoundaryFallback.stories.d.ts +8 -0
  66. package/dist/components/molecules/error-boundary-fallback/index.d.ts +1 -0
  67. package/dist/components/molecules/error-boundary-fallback/index.js +4 -0
  68. package/dist/components/molecules/error-boundary-fallback/styles.d.ts +1 -0
  69. package/dist/components/molecules/error-boundary-fallback/styles.js +930 -0
  70. package/dist/components/molecules/form/Form.d.ts +15 -0
  71. package/dist/components/molecules/form/Form.js +7 -0
  72. package/dist/components/molecules/form/__stories__/Form.stories.d.ts +7 -0
  73. package/dist/components/molecules/form/__stories__/FormStory.d.ts +1 -0
  74. package/dist/components/molecules/form/__stories__/FormStory.js +90 -0
  75. package/dist/components/molecules/form/index.d.ts +2 -0
  76. package/dist/components/molecules/form/index.js +4 -0
  77. package/dist/constants/index.d.ts +51 -0
  78. package/dist/constants/index.js +54 -0
  79. package/dist/context-CZsFJmh6.js +2093 -0
  80. package/dist/declaration.d.js +1 -0
  81. package/dist/genesis/GenesisThemeBreakdown.d.ts +4 -0
  82. package/dist/genesis/GenesisThemeBreakdown.js +56 -0
  83. package/dist/genesis/GenesisThemeDemo.d.ts +8 -0
  84. package/dist/genesis/GenesisThemeDemo.js +8 -0
  85. package/dist/genesis/GenesisThemeDemo.stories.d.ts +7 -0
  86. package/dist/genesis/styles.d.ts +12 -0
  87. package/dist/genesis/styles.js +4038 -0
  88. package/dist/index-3MWkSVA1.js +96 -0
  89. package/dist/index-BPtFqhcp.js +19110 -0
  90. package/dist/index-BQO27mgE.js +402 -0
  91. package/dist/index-BWys7dkb.js +4462 -0
  92. package/dist/index-C7kFNqp2.js +276 -0
  93. package/dist/index-D1v_7IIx.js +1057 -0
  94. package/dist/index-SAAXFt-P.js +946 -0
  95. package/dist/index-VDH3iLaC.js +884 -0
  96. package/dist/index.d.ts +2 -0
  97. package/dist/index.js +20 -0
  98. package/dist/isVisible-CNQjrJPN.js +366 -0
  99. package/dist/magic-string.es-BkUFmFT4.js +858 -0
  100. package/dist/presetColors-Cl8UP3Nw.js +4 -0
  101. package/dist/providers/GenesisProvider.d.ts +8 -0
  102. package/dist/providers/GenesisProvider.js +7 -0
  103. package/dist/providers/ThemeProvider.d.ts +9 -0
  104. package/dist/providers/ThemeProvider.js +18 -0
  105. package/dist/providers/index.d.ts +2 -0
  106. package/dist/providers/index.js +6 -0
  107. package/dist/reactNode-sKPeiqPL.js +12 -0
  108. package/dist/setup-CMYVZCPF.js +33883 -0
  109. package/dist/styled-components.browser.esm-CZ1XM4o4.js +1144 -0
  110. package/dist/styles/design-tokens/border-tokens/BorderTokenList.d.ts +1 -0
  111. package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +37 -0
  112. package/dist/styles/design-tokens/border-tokens/BorderTokens.stories.d.ts +6 -0
  113. package/dist/styles/design-tokens/color-tokens/ColorTokens.stories.d.ts +7 -0
  114. package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.d.ts +3 -0
  115. package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +36 -0
  116. package/dist/styles/design-tokens/sizing-tokens/index.stories.d.ts +7 -0
  117. package/dist/styles/design-tokens/typography/TypographyTokens.stories.d.ts +7 -0
  118. package/dist/styles/design-tokens/variables.d.ts +704 -0
  119. package/dist/styles/design-tokens/variables.js +697 -0
  120. package/dist/styles/global-styles.d.ts +1 -0
  121. package/dist/styles/global-styles.js +35 -0
  122. package/dist/styles/theme/genesis-theme.d.ts +75 -0
  123. package/dist/styles/theme/genesis-theme.js +896 -0
  124. package/dist/styles/theme/genesis-theme.types.d.ts +162 -0
  125. package/dist/styles/theme/genesis-theme.types.js +4 -0
  126. package/dist/styles/theme/global-styles.d.ts +1 -0
  127. package/dist/styles/theme/global-styles.js +35 -0
  128. package/dist/styles/theme/index.d.ts +1 -0
  129. package/dist/styles/theme/index.js +9 -0
  130. package/dist/test/setup.d.ts +5 -0
  131. package/dist/test/setup.js +7 -0
  132. package/dist/useVariants-CEpw6Ww6.js +29 -0
  133. package/dist/utils/getAppointmentColor.d.ts +4 -0
  134. package/dist/utils/getAppointmentColor.js +91 -0
  135. package/dist/utils/isAllEnglishString.d.ts +1 -0
  136. package/dist/utils/isAllEnglishString.js +8 -0
  137. package/dist/utils/isAllEnglishString.test.d.ts +1 -0
  138. package/dist/utils/isAllEnglishString.test.js +8 -0
  139. package/dist/utils/parseAddress.d.ts +3 -0
  140. package/dist/utils/parseAddress.js +19 -0
  141. package/dist/vite-env.d.js +1 -0
  142. package/package.json +115 -0
@@ -0,0 +1,3868 @@
1
+ import { d as rt } from "../../../styled-components.browser.esm-CZ1XM4o4.js";
2
+ import * as o from "react";
3
+ import Dn, { useState as Tn, useRef as fe, useEffect as Qn, useMemo as pr, useContext as hr } from "react";
4
+ import { ag as br, C as jn, c as Le, b as pn, e as re, y as Sr, a as ee, G as wr, h as ae, _ as Ze, d as In, w as Ue, ah as yr, H as Ye, v as Cr, O as Nn, B as on, r as Er, q as Ir, x as xr, k as St, ai as Or, Z as Rr, aj as wt, N as ot, Q as Vn, m as Bt, n as Pn, A as at, D as it, ak as Zn, z as _e, T as Ft, F as $r } from "../../../index-BWys7dkb.js";
5
+ import { u as Bn, o as At, t as Jn } from "../../../isVisible-CNQjrJPN.js";
6
+ import { K as hn, i as Mr, T as Dr, c as Nr, a as lt, u as Pr, g as _r } from "../../../index-VDH3iLaC.js";
7
+ import { K as X, R as Tr } from "../../../CheckOutlined-DAynWe12.js";
8
+ import { p as Fn, R as zr } from "../../../SearchOutlined-DuzJkIiQ.js";
9
+ import { F as Lr, s as Hr, a as Vr, b as Br, c as Fr, i as yt, R as Ar } from "../../../Overflow-CP1M4Z0s.js";
10
+ import { R as jt } from "../../../index-BQO27mgE.js";
11
+ import { r as Ct } from "../../../index-BPtFqhcp.js";
12
+ import { u as jr, a as Wr, g as Kr } from "../../../useVariants-CEpw6Ww6.js";
13
+ import { u as Xr, F as Ur } from "../../../context-CZsFJmh6.js";
14
+ import { R as Gr, b as Yr, a as qr } from "../../../Compact-CJBo3f0u.js";
15
+ import { g as Qr } from "../../../compact-item-DH13cl8A.js";
16
+ import { R as Zr } from "../../../CloseCircleFilled-ZIY-u-27.js";
17
+ import { I as Jr } from "../../../AntdIcon-Bsnbyy6g.js";
18
+ const kr = new hn("antMoveDownIn", {
19
+ "0%": {
20
+ transform: "translate3d(0, 100%, 0)",
21
+ transformOrigin: "0 0",
22
+ opacity: 0
23
+ },
24
+ "100%": {
25
+ transform: "translate3d(0, 0, 0)",
26
+ transformOrigin: "0 0",
27
+ opacity: 1
28
+ }
29
+ }), eo = new hn("antMoveDownOut", {
30
+ "0%": {
31
+ transform: "translate3d(0, 0, 0)",
32
+ transformOrigin: "0 0",
33
+ opacity: 1
34
+ },
35
+ "100%": {
36
+ transform: "translate3d(0, 100%, 0)",
37
+ transformOrigin: "0 0",
38
+ opacity: 0
39
+ }
40
+ }), no = new hn("antMoveLeftIn", {
41
+ "0%": {
42
+ transform: "translate3d(-100%, 0, 0)",
43
+ transformOrigin: "0 0",
44
+ opacity: 0
45
+ },
46
+ "100%": {
47
+ transform: "translate3d(0, 0, 0)",
48
+ transformOrigin: "0 0",
49
+ opacity: 1
50
+ }
51
+ }), to = new hn("antMoveLeftOut", {
52
+ "0%": {
53
+ transform: "translate3d(0, 0, 0)",
54
+ transformOrigin: "0 0",
55
+ opacity: 1
56
+ },
57
+ "100%": {
58
+ transform: "translate3d(-100%, 0, 0)",
59
+ transformOrigin: "0 0",
60
+ opacity: 0
61
+ }
62
+ }), ro = new hn("antMoveRightIn", {
63
+ "0%": {
64
+ transform: "translate3d(100%, 0, 0)",
65
+ transformOrigin: "0 0",
66
+ opacity: 0
67
+ },
68
+ "100%": {
69
+ transform: "translate3d(0, 0, 0)",
70
+ transformOrigin: "0 0",
71
+ opacity: 1
72
+ }
73
+ }), oo = new hn("antMoveRightOut", {
74
+ "0%": {
75
+ transform: "translate3d(0, 0, 0)",
76
+ transformOrigin: "0 0",
77
+ opacity: 1
78
+ },
79
+ "100%": {
80
+ transform: "translate3d(100%, 0, 0)",
81
+ transformOrigin: "0 0",
82
+ opacity: 0
83
+ }
84
+ }), ao = new hn("antMoveUpIn", {
85
+ "0%": {
86
+ transform: "translate3d(0, -100%, 0)",
87
+ transformOrigin: "0 0",
88
+ opacity: 0
89
+ },
90
+ "100%": {
91
+ transform: "translate3d(0, 0, 0)",
92
+ transformOrigin: "0 0",
93
+ opacity: 1
94
+ }
95
+ }), io = new hn("antMoveUpOut", {
96
+ "0%": {
97
+ transform: "translate3d(0, 0, 0)",
98
+ transformOrigin: "0 0",
99
+ opacity: 1
100
+ },
101
+ "100%": {
102
+ transform: "translate3d(0, -100%, 0)",
103
+ transformOrigin: "0 0",
104
+ opacity: 0
105
+ }
106
+ }), lo = {
107
+ "move-up": {
108
+ inKeyframes: ao,
109
+ outKeyframes: io
110
+ },
111
+ "move-down": {
112
+ inKeyframes: kr,
113
+ outKeyframes: eo
114
+ },
115
+ "move-left": {
116
+ inKeyframes: no,
117
+ outKeyframes: to
118
+ },
119
+ "move-right": {
120
+ inKeyframes: ro,
121
+ outKeyframes: oo
122
+ }
123
+ }, Et = (e, n) => {
124
+ const {
125
+ antCls: t
126
+ } = e, r = `${t}-${n}`, {
127
+ inKeyframes: a,
128
+ outKeyframes: i
129
+ } = lo[n];
130
+ return [Mr(r, a, i, e.motionDurationMid), {
131
+ [`
132
+ ${r}-enter,
133
+ ${r}-appear
134
+ `]: {
135
+ opacity: 0,
136
+ animationTimingFunction: e.motionEaseOutCirc
137
+ },
138
+ [`${r}-leave`]: {
139
+ animationTimingFunction: e.motionEaseInOutCirc
140
+ }
141
+ }];
142
+ };
143
+ function uo(e) {
144
+ return (n) => /* @__PURE__ */ o.createElement(br, {
145
+ theme: {
146
+ token: {
147
+ motion: !1,
148
+ zIndexPopupBase: 0
149
+ }
150
+ }
151
+ }, /* @__PURE__ */ o.createElement(e, Object.assign({}, n)));
152
+ }
153
+ const co = (e, n, t, r, a) => uo((l) => {
154
+ const {
155
+ prefixCls: u,
156
+ style: d
157
+ } = l, f = o.useRef(null), [v, s] = o.useState(0), [h, c] = o.useState(0), [g, m] = Bn(!1, {
158
+ value: l.open
159
+ }), {
160
+ getPrefixCls: S
161
+ } = o.useContext(jn), w = S("select", u);
162
+ o.useEffect(() => {
163
+ if (m(!0), typeof ResizeObserver < "u") {
164
+ const y = new ResizeObserver((p) => {
165
+ const C = p[0].target;
166
+ s(C.offsetHeight + 8), c(C.offsetWidth);
167
+ }), N = setInterval(() => {
168
+ var p;
169
+ const C = `.${w}-dropdown`, _ = (p = f.current) === null || p === void 0 ? void 0 : p.querySelector(C);
170
+ _ && (clearInterval(N), y.observe(_));
171
+ }, 10);
172
+ return () => {
173
+ clearInterval(N), y.disconnect();
174
+ };
175
+ }
176
+ }, []);
177
+ let b = Object.assign(Object.assign({}, l), {
178
+ style: Object.assign(Object.assign({}, d), {
179
+ margin: 0
180
+ }),
181
+ open: g,
182
+ visible: g,
183
+ getPopupContainer: () => f.current
184
+ });
185
+ Object.assign(b, {
186
+ [n]: {
187
+ overflow: {
188
+ adjustX: !1,
189
+ adjustY: !1
190
+ }
191
+ }
192
+ });
193
+ const x = {
194
+ paddingBottom: v,
195
+ position: "relative",
196
+ minWidth: h
197
+ };
198
+ return /* @__PURE__ */ o.createElement("div", {
199
+ ref: f,
200
+ style: x
201
+ }, /* @__PURE__ */ o.createElement(e, Object.assign({}, b)));
202
+ });
203
+ var Wn = function(n) {
204
+ var t = n.className, r = n.customizeIcon, a = n.customizeIconProps, i = n.children, l = n.onMouseDown, u = n.onClick, d = typeof r == "function" ? r(a) : r;
205
+ return /* @__PURE__ */ o.createElement("span", {
206
+ className: t,
207
+ onMouseDown: function(v) {
208
+ v.preventDefault(), l == null || l(v);
209
+ },
210
+ style: {
211
+ userSelect: "none",
212
+ WebkitUserSelect: "none"
213
+ },
214
+ unselectable: "on",
215
+ onClick: u,
216
+ "aria-hidden": !0
217
+ }, d !== void 0 ? d : /* @__PURE__ */ o.createElement("span", {
218
+ className: Le(t.split(/\s+/).map(function(f) {
219
+ return "".concat(f, "-icon");
220
+ }))
221
+ }, i));
222
+ }, so = function(n, t, r, a, i) {
223
+ var l = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1, u = arguments.length > 6 ? arguments[6] : void 0, d = arguments.length > 7 ? arguments[7] : void 0, f = Dn.useMemo(function() {
224
+ if (pn(a) === "object")
225
+ return a.clearIcon;
226
+ if (i)
227
+ return i;
228
+ }, [a, i]), v = Dn.useMemo(function() {
229
+ return !!(!l && a && (r.length || u) && !(d === "combobox" && u === ""));
230
+ }, [a, l, r.length, u, d]);
231
+ return {
232
+ allowClear: v,
233
+ clearIcon: /* @__PURE__ */ Dn.createElement(Wn, {
234
+ className: "".concat(n, "-clear"),
235
+ onMouseDown: t,
236
+ customizeIcon: f
237
+ }, "×")
238
+ };
239
+ }, Wt = /* @__PURE__ */ o.createContext(null);
240
+ function fo() {
241
+ return o.useContext(Wt);
242
+ }
243
+ function mo() {
244
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10, n = o.useState(!1), t = re(n, 2), r = t[0], a = t[1], i = o.useRef(null), l = function() {
245
+ window.clearTimeout(i.current);
246
+ };
247
+ o.useEffect(function() {
248
+ return l;
249
+ }, []);
250
+ var u = function(f, v) {
251
+ l(), i.current = window.setTimeout(function() {
252
+ a(f), v && v();
253
+ }, e);
254
+ };
255
+ return [r, u, l];
256
+ }
257
+ function Kt() {
258
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 250, n = o.useRef(null), t = o.useRef(null);
259
+ o.useEffect(function() {
260
+ return function() {
261
+ window.clearTimeout(t.current);
262
+ };
263
+ }, []);
264
+ function r(a) {
265
+ (a || n.current === null) && (n.current = a), window.clearTimeout(t.current), t.current = window.setTimeout(function() {
266
+ n.current = null;
267
+ }, e);
268
+ }
269
+ return [function() {
270
+ return n.current;
271
+ }, r];
272
+ }
273
+ function vo(e, n, t, r) {
274
+ var a = o.useRef(null);
275
+ a.current = {
276
+ open: n,
277
+ triggerOpen: t,
278
+ customizedTrigger: r
279
+ }, o.useEffect(function() {
280
+ function i(l) {
281
+ var u;
282
+ if (!((u = a.current) !== null && u !== void 0 && u.customizedTrigger)) {
283
+ var d = l.target;
284
+ d.shadowRoot && l.composed && (d = l.composedPath()[0] || d), a.current.open && e().filter(function(f) {
285
+ return f;
286
+ }).every(function(f) {
287
+ return !f.contains(d) && f !== d;
288
+ }) && a.current.triggerOpen(!1);
289
+ }
290
+ }
291
+ return window.addEventListener("mousedown", i), function() {
292
+ return window.removeEventListener("mousedown", i);
293
+ };
294
+ }, []);
295
+ }
296
+ function go(e) {
297
+ return (
298
+ // Undefined for Edge bug:
299
+ // https://github.com/ant-design/ant-design/issues/51292
300
+ e && // Other keys
301
+ ![
302
+ // System function button
303
+ X.ESC,
304
+ X.SHIFT,
305
+ X.BACKSPACE,
306
+ X.TAB,
307
+ X.WIN_KEY,
308
+ X.ALT,
309
+ X.META,
310
+ X.WIN_KEY_RIGHT,
311
+ X.CTRL,
312
+ X.SEMICOLON,
313
+ X.EQUALS,
314
+ X.CAPS_LOCK,
315
+ X.CONTEXT_MENU,
316
+ // F1-F12
317
+ X.F1,
318
+ X.F2,
319
+ X.F3,
320
+ X.F4,
321
+ X.F5,
322
+ X.F6,
323
+ X.F7,
324
+ X.F8,
325
+ X.F9,
326
+ X.F10,
327
+ X.F11,
328
+ X.F12
329
+ ].includes(e)
330
+ );
331
+ }
332
+ var po = function(n, t) {
333
+ var r, a = n.prefixCls, i = n.id, l = n.inputElement, u = n.disabled, d = n.tabIndex, f = n.autoFocus, v = n.autoComplete, s = n.editable, h = n.activeDescendantId, c = n.value, g = n.maxLength, m = n.onKeyDown, S = n.onMouseDown, w = n.onChange, b = n.onPaste, x = n.onCompositionStart, y = n.onCompositionEnd, N = n.open, p = n.attrs, C = l || /* @__PURE__ */ o.createElement("input", null), _ = C, F = _.ref, A = _.props, K = A.onKeyDown, U = A.onChange, ne = A.onMouseDown, z = A.onCompositionStart, ie = A.onCompositionEnd, j = A.style;
334
+ return Sr(!("maxLength" in C.props), "Passing 'maxLength' to input element directly may not work because input in BaseSelect is controlled."), C = /* @__PURE__ */ o.cloneElement(C, ee(ee(ee({
335
+ type: "search"
336
+ }, A), {}, {
337
+ // Override over origin props
338
+ id: i,
339
+ ref: wr(t, F),
340
+ disabled: u,
341
+ tabIndex: d,
342
+ autoComplete: v || "off",
343
+ autoFocus: f,
344
+ className: Le("".concat(a, "-selection-search-input"), (r = C) === null || r === void 0 || (r = r.props) === null || r === void 0 ? void 0 : r.className),
345
+ role: "combobox",
346
+ "aria-expanded": N || !1,
347
+ "aria-haspopup": "listbox",
348
+ "aria-owns": "".concat(i, "_list"),
349
+ "aria-autocomplete": "list",
350
+ "aria-controls": "".concat(i, "_list"),
351
+ "aria-activedescendant": N ? h : void 0
352
+ }, p), {}, {
353
+ value: s ? c : "",
354
+ maxLength: g,
355
+ readOnly: !s,
356
+ unselectable: s ? null : "on",
357
+ style: ee(ee({}, j), {}, {
358
+ opacity: s ? null : 0
359
+ }),
360
+ onKeyDown: function(M) {
361
+ m(M), K && K(M);
362
+ },
363
+ onMouseDown: function(M) {
364
+ S(M), ne && ne(M);
365
+ },
366
+ onChange: function(M) {
367
+ w(M), U && U(M);
368
+ },
369
+ onCompositionStart: function(M) {
370
+ x(M), z && z(M);
371
+ },
372
+ onCompositionEnd: function(M) {
373
+ y(M), ie && ie(M);
374
+ },
375
+ onPaste: b
376
+ })), C;
377
+ }, ut = /* @__PURE__ */ o.forwardRef(po);
378
+ process.env.NODE_ENV !== "production" && (ut.displayName = "Input");
379
+ function ct(e) {
380
+ return Array.isArray(e) ? e : e !== void 0 ? [e] : [];
381
+ }
382
+ var ho = typeof window < "u" && window.document && window.document.documentElement, bo = process.env.NODE_ENV !== "test" && ho;
383
+ function So(e) {
384
+ return e != null;
385
+ }
386
+ function wo(e) {
387
+ return !e && e !== 0;
388
+ }
389
+ function It(e) {
390
+ return ["string", "number"].includes(pn(e));
391
+ }
392
+ function Xt(e) {
393
+ var n = void 0;
394
+ return e && (It(e.title) ? n = e.title.toString() : It(e.label) && (n = e.label.toString())), n;
395
+ }
396
+ function yo(e, n) {
397
+ bo ? o.useLayoutEffect(e, n) : o.useEffect(e, n);
398
+ }
399
+ function Co(e) {
400
+ var n;
401
+ return (n = e.key) !== null && n !== void 0 ? n : e.value;
402
+ }
403
+ var xt = function(n) {
404
+ n.preventDefault(), n.stopPropagation();
405
+ }, Eo = function(n) {
406
+ var t = n.id, r = n.prefixCls, a = n.values, i = n.open, l = n.searchValue, u = n.autoClearSearchValue, d = n.inputRef, f = n.placeholder, v = n.disabled, s = n.mode, h = n.showSearch, c = n.autoFocus, g = n.autoComplete, m = n.activeDescendantId, S = n.tabIndex, w = n.removeIcon, b = n.maxTagCount, x = n.maxTagTextLength, y = n.maxTagPlaceholder, N = y === void 0 ? function(L) {
407
+ return "+ ".concat(L.length, " ...");
408
+ } : y, p = n.tagRender, C = n.onToggleOpen, _ = n.onRemove, F = n.onInputChange, A = n.onInputPaste, K = n.onInputKeyDown, U = n.onInputMouseDown, ne = n.onInputCompositionStart, z = n.onInputCompositionEnd, ie = o.useRef(null), j = Tn(0), Z = re(j, 2), M = Z[0], V = Z[1], J = Tn(!1), $ = re(J, 2), Ee = $[0], Re = $[1], G = "".concat(r, "-selection"), he = i || s === "multiple" && u === !1 || s === "tags" ? l : "", $e = s === "tags" || s === "multiple" && u === !1 || h && (i || Ee);
409
+ yo(function() {
410
+ V(ie.current.scrollWidth);
411
+ }, [he]);
412
+ var Y = function(W, R, Q, ue, se) {
413
+ return /* @__PURE__ */ o.createElement("span", {
414
+ title: Xt(W),
415
+ className: Le("".concat(G, "-item"), ae({}, "".concat(G, "-item-disabled"), Q))
416
+ }, /* @__PURE__ */ o.createElement("span", {
417
+ className: "".concat(G, "-item-content")
418
+ }, R), ue && /* @__PURE__ */ o.createElement(Wn, {
419
+ className: "".concat(G, "-item-remove"),
420
+ onMouseDown: xt,
421
+ onClick: se,
422
+ customizeIcon: w
423
+ }, "×"));
424
+ }, be = function(W, R, Q, ue, se, oe) {
425
+ var ve = function(He) {
426
+ xt(He), C(!i);
427
+ };
428
+ return /* @__PURE__ */ o.createElement("span", {
429
+ onMouseDown: ve
430
+ }, p({
431
+ label: R,
432
+ value: W,
433
+ disabled: Q,
434
+ closable: ue,
435
+ onClose: se,
436
+ isMaxTag: !!oe
437
+ }));
438
+ }, we = function(W) {
439
+ var R = W.disabled, Q = W.label, ue = W.value, se = !v && !R, oe = Q;
440
+ if (typeof x == "number" && (typeof Q == "string" || typeof Q == "number")) {
441
+ var ve = String(oe);
442
+ ve.length > x && (oe = "".concat(ve.slice(0, x), "..."));
443
+ }
444
+ var De = function(Ve) {
445
+ Ve && Ve.stopPropagation(), _(W);
446
+ };
447
+ return typeof p == "function" ? be(ue, oe, R, se, De) : Y(W, oe, R, se, De);
448
+ }, le = function(W) {
449
+ if (!a.length)
450
+ return null;
451
+ var R = typeof N == "function" ? N(W) : N;
452
+ return typeof p == "function" ? be(void 0, R, !1, !1, void 0, !0) : Y({
453
+ title: R
454
+ }, R, !1);
455
+ }, E = /* @__PURE__ */ o.createElement("div", {
456
+ className: "".concat(G, "-search"),
457
+ style: {
458
+ width: M
459
+ },
460
+ onFocus: function() {
461
+ Re(!0);
462
+ },
463
+ onBlur: function() {
464
+ Re(!1);
465
+ }
466
+ }, /* @__PURE__ */ o.createElement(ut, {
467
+ ref: d,
468
+ open: i,
469
+ prefixCls: r,
470
+ id: t,
471
+ inputElement: null,
472
+ disabled: v,
473
+ autoFocus: c,
474
+ autoComplete: g,
475
+ editable: $e,
476
+ activeDescendantId: m,
477
+ value: he,
478
+ onKeyDown: K,
479
+ onMouseDown: U,
480
+ onChange: F,
481
+ onPaste: A,
482
+ onCompositionStart: ne,
483
+ onCompositionEnd: z,
484
+ tabIndex: S,
485
+ attrs: Fn(n, !0)
486
+ }), /* @__PURE__ */ o.createElement("span", {
487
+ ref: ie,
488
+ className: "".concat(G, "-search-mirror"),
489
+ "aria-hidden": !0
490
+ }, he, " ")), O = /* @__PURE__ */ o.createElement(Lr, {
491
+ prefixCls: "".concat(G, "-overflow"),
492
+ data: a,
493
+ renderItem: we,
494
+ renderRest: le,
495
+ suffix: E,
496
+ itemKey: Co,
497
+ maxCount: b
498
+ });
499
+ return /* @__PURE__ */ o.createElement("span", {
500
+ className: "".concat(G, "-wrap")
501
+ }, O, !a.length && !he && /* @__PURE__ */ o.createElement("span", {
502
+ className: "".concat(G, "-placeholder")
503
+ }, f));
504
+ }, Io = function(n) {
505
+ var t = n.inputElement, r = n.prefixCls, a = n.id, i = n.inputRef, l = n.disabled, u = n.autoFocus, d = n.autoComplete, f = n.activeDescendantId, v = n.mode, s = n.open, h = n.values, c = n.placeholder, g = n.tabIndex, m = n.showSearch, S = n.searchValue, w = n.activeValue, b = n.maxLength, x = n.onInputKeyDown, y = n.onInputMouseDown, N = n.onInputChange, p = n.onInputPaste, C = n.onInputCompositionStart, _ = n.onInputCompositionEnd, F = n.title, A = o.useState(!1), K = re(A, 2), U = K[0], ne = K[1], z = v === "combobox", ie = z || m, j = h[0], Z = S || "";
506
+ z && w && !U && (Z = w), o.useEffect(function() {
507
+ z && ne(!1);
508
+ }, [z, w]);
509
+ var M = v !== "combobox" && !s && !m ? !1 : !!Z, V = F === void 0 ? Xt(j) : F, J = o.useMemo(function() {
510
+ return j ? null : /* @__PURE__ */ o.createElement("span", {
511
+ className: "".concat(r, "-selection-placeholder"),
512
+ style: M ? {
513
+ visibility: "hidden"
514
+ } : void 0
515
+ }, c);
516
+ }, [j, M, c, r]);
517
+ return /* @__PURE__ */ o.createElement("span", {
518
+ className: "".concat(r, "-selection-wrap")
519
+ }, /* @__PURE__ */ o.createElement("span", {
520
+ className: "".concat(r, "-selection-search")
521
+ }, /* @__PURE__ */ o.createElement(ut, {
522
+ ref: i,
523
+ prefixCls: r,
524
+ id: a,
525
+ open: s,
526
+ inputElement: t,
527
+ disabled: l,
528
+ autoFocus: u,
529
+ autoComplete: d,
530
+ editable: ie,
531
+ activeDescendantId: f,
532
+ value: Z,
533
+ onKeyDown: x,
534
+ onMouseDown: y,
535
+ onChange: function(Ee) {
536
+ ne(!0), N(Ee);
537
+ },
538
+ onPaste: p,
539
+ onCompositionStart: C,
540
+ onCompositionEnd: _,
541
+ tabIndex: g,
542
+ attrs: Fn(n, !0),
543
+ maxLength: z ? b : void 0
544
+ })), !z && j ? /* @__PURE__ */ o.createElement("span", {
545
+ className: "".concat(r, "-selection-item"),
546
+ title: V,
547
+ style: M ? {
548
+ visibility: "hidden"
549
+ } : void 0
550
+ }, j.label) : null, J);
551
+ }, xo = function(n, t) {
552
+ var r = fe(null), a = fe(!1), i = n.prefixCls, l = n.open, u = n.mode, d = n.showSearch, f = n.tokenWithEnter, v = n.disabled, s = n.prefix, h = n.autoClearSearchValue, c = n.onSearch, g = n.onSearchSubmit, m = n.onToggleOpen, S = n.onInputKeyDown, w = n.domRef;
553
+ o.useImperativeHandle(t, function() {
554
+ return {
555
+ focus: function(V) {
556
+ r.current.focus(V);
557
+ },
558
+ blur: function() {
559
+ r.current.blur();
560
+ }
561
+ };
562
+ });
563
+ var b = Kt(0), x = re(b, 2), y = x[0], N = x[1], p = function(V) {
564
+ var J = V.which, $ = r.current instanceof HTMLTextAreaElement;
565
+ !$ && l && (J === X.UP || J === X.DOWN) && V.preventDefault(), S && S(V), J === X.ENTER && u === "tags" && !a.current && !l && (g == null || g(V.target.value)), !($ && !l && ~[X.UP, X.DOWN, X.LEFT, X.RIGHT].indexOf(J)) && go(J) && m(!0);
566
+ }, C = function() {
567
+ N(!0);
568
+ }, _ = fe(null), F = function(V) {
569
+ c(V, !0, a.current) !== !1 && m(!0);
570
+ }, A = function() {
571
+ a.current = !0;
572
+ }, K = function(V) {
573
+ a.current = !1, u !== "combobox" && F(V.target.value);
574
+ }, U = function(V) {
575
+ var J = V.target.value;
576
+ if (f && _.current && /[\r\n]/.test(_.current)) {
577
+ var $ = _.current.replace(/[\r\n]+$/, "").replace(/\r\n/g, " ").replace(/[\r\n]/g, " ");
578
+ J = J.replace($, _.current);
579
+ }
580
+ _.current = null, F(J);
581
+ }, ne = function(V) {
582
+ var J = V.clipboardData, $ = J == null ? void 0 : J.getData("text");
583
+ _.current = $ || "";
584
+ }, z = function(V) {
585
+ var J = V.target;
586
+ if (J !== r.current) {
587
+ var $ = document.body.style.msTouchAction !== void 0;
588
+ $ ? setTimeout(function() {
589
+ r.current.focus();
590
+ }) : r.current.focus();
591
+ }
592
+ }, ie = function(V) {
593
+ var J = y();
594
+ V.target !== r.current && !J && !(u === "combobox" && v) && V.preventDefault(), (u !== "combobox" && (!d || !J) || !l) && (l && h !== !1 && c("", !0, !1), m());
595
+ }, j = {
596
+ inputRef: r,
597
+ onInputKeyDown: p,
598
+ onInputMouseDown: C,
599
+ onInputChange: U,
600
+ onInputPaste: ne,
601
+ onInputCompositionStart: A,
602
+ onInputCompositionEnd: K
603
+ }, Z = u === "multiple" || u === "tags" ? /* @__PURE__ */ o.createElement(Eo, Ze({}, n, j)) : /* @__PURE__ */ o.createElement(Io, Ze({}, n, j));
604
+ return /* @__PURE__ */ o.createElement("div", {
605
+ ref: w,
606
+ className: "".concat(i, "-selector"),
607
+ onClick: z,
608
+ onMouseDown: ie
609
+ }, s && /* @__PURE__ */ o.createElement("div", {
610
+ className: "".concat(i, "-prefix")
611
+ }, s), Z);
612
+ }, Ut = /* @__PURE__ */ o.forwardRef(xo);
613
+ process.env.NODE_ENV !== "production" && (Ut.displayName = "Selector");
614
+ var Oo = ["prefixCls", "disabled", "visible", "children", "popupElement", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "direction", "placement", "builtinPlacements", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "getPopupContainer", "empty", "getTriggerDOMNode", "onPopupVisibleChange", "onPopupMouseEnter"], Ro = function(n) {
615
+ var t = n === !0 ? 0 : 1;
616
+ return {
617
+ bottomLeft: {
618
+ points: ["tl", "bl"],
619
+ offset: [0, 4],
620
+ overflow: {
621
+ adjustX: t,
622
+ adjustY: 1
623
+ },
624
+ htmlRegion: "scroll"
625
+ },
626
+ bottomRight: {
627
+ points: ["tr", "br"],
628
+ offset: [0, 4],
629
+ overflow: {
630
+ adjustX: t,
631
+ adjustY: 1
632
+ },
633
+ htmlRegion: "scroll"
634
+ },
635
+ topLeft: {
636
+ points: ["bl", "tl"],
637
+ offset: [0, -4],
638
+ overflow: {
639
+ adjustX: t,
640
+ adjustY: 1
641
+ },
642
+ htmlRegion: "scroll"
643
+ },
644
+ topRight: {
645
+ points: ["br", "tr"],
646
+ offset: [0, -4],
647
+ overflow: {
648
+ adjustX: t,
649
+ adjustY: 1
650
+ },
651
+ htmlRegion: "scroll"
652
+ }
653
+ };
654
+ }, $o = function(n, t) {
655
+ var r = n.prefixCls;
656
+ n.disabled;
657
+ var a = n.visible, i = n.children, l = n.popupElement, u = n.animation, d = n.transitionName, f = n.dropdownStyle, v = n.dropdownClassName, s = n.direction, h = s === void 0 ? "ltr" : s, c = n.placement, g = n.builtinPlacements, m = n.dropdownMatchSelectWidth, S = n.dropdownRender, w = n.dropdownAlign, b = n.getPopupContainer, x = n.empty, y = n.getTriggerDOMNode, N = n.onPopupVisibleChange, p = n.onPopupMouseEnter, C = In(n, Oo), _ = "".concat(r, "-dropdown"), F = l;
658
+ S && (F = S(l));
659
+ var A = o.useMemo(function() {
660
+ return g || Ro(m);
661
+ }, [g, m]), K = u ? "".concat(_, "-").concat(u) : d, U = typeof m == "number", ne = o.useMemo(function() {
662
+ return U ? null : m === !1 ? "minWidth" : "width";
663
+ }, [m, U]), z = f;
664
+ U && (z = ee(ee({}, z), {}, {
665
+ width: m
666
+ }));
667
+ var ie = o.useRef(null);
668
+ return o.useImperativeHandle(t, function() {
669
+ return {
670
+ getPopupElement: function() {
671
+ var Z;
672
+ return (Z = ie.current) === null || Z === void 0 ? void 0 : Z.popupElement;
673
+ }
674
+ };
675
+ }), /* @__PURE__ */ o.createElement(Dr, Ze({}, C, {
676
+ showAction: N ? ["click"] : [],
677
+ hideAction: N ? ["click"] : [],
678
+ popupPlacement: c || (h === "rtl" ? "bottomRight" : "bottomLeft"),
679
+ builtinPlacements: A,
680
+ prefixCls: _,
681
+ popupTransitionName: K,
682
+ popup: /* @__PURE__ */ o.createElement("div", {
683
+ onMouseEnter: p
684
+ }, F),
685
+ ref: ie,
686
+ stretch: ne,
687
+ popupAlign: w,
688
+ popupVisible: a,
689
+ getPopupContainer: b,
690
+ popupClassName: Le(v, ae({}, "".concat(_, "-empty"), x)),
691
+ popupStyle: z,
692
+ getTriggerDOMNode: y,
693
+ onPopupVisibleChange: N
694
+ }), i);
695
+ }, Gt = /* @__PURE__ */ o.forwardRef($o);
696
+ process.env.NODE_ENV !== "production" && (Gt.displayName = "SelectTrigger");
697
+ function Ot(e, n) {
698
+ var t = e.key, r;
699
+ return "value" in e && (r = e.value), t ?? (r !== void 0 ? r : "rc-index-key-".concat(n));
700
+ }
701
+ function kn(e) {
702
+ return typeof e < "u" && !Number.isNaN(e);
703
+ }
704
+ function Yt(e, n) {
705
+ var t = e || {}, r = t.label, a = t.value, i = t.options, l = t.groupLabel, u = r || (n ? "children" : "label");
706
+ return {
707
+ label: u,
708
+ value: a || "value",
709
+ options: i || "options",
710
+ groupLabel: l || u
711
+ };
712
+ }
713
+ function Mo(e) {
714
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = n.fieldNames, r = n.childrenAsData, a = [], i = Yt(t, !1), l = i.label, u = i.value, d = i.options, f = i.groupLabel;
715
+ function v(s, h) {
716
+ Array.isArray(s) && s.forEach(function(c) {
717
+ if (h || !(d in c)) {
718
+ var g = c[u];
719
+ a.push({
720
+ key: Ot(c, a.length),
721
+ groupOption: h,
722
+ data: c,
723
+ label: c[l],
724
+ value: g
725
+ });
726
+ } else {
727
+ var m = c[f];
728
+ m === void 0 && r && (m = c.label), a.push({
729
+ key: Ot(c, a.length),
730
+ group: !0,
731
+ data: c,
732
+ label: m
733
+ }), v(c[d], !0);
734
+ }
735
+ });
736
+ }
737
+ return v(e, !1), a;
738
+ }
739
+ function et(e) {
740
+ var n = ee({}, e);
741
+ return "props" in n || Object.defineProperty(n, "props", {
742
+ get: function() {
743
+ return Ue(!1, "Return type is option instead of Option instance. Please read value directly instead of reading from `props`."), n;
744
+ }
745
+ }), n;
746
+ }
747
+ var Do = function(n, t, r) {
748
+ if (!t || !t.length)
749
+ return null;
750
+ var a = !1, i = function u(d, f) {
751
+ var v = yr(f), s = v[0], h = v.slice(1);
752
+ if (!s)
753
+ return [d];
754
+ var c = d.split(s);
755
+ return a = a || c.length > 1, c.reduce(function(g, m) {
756
+ return [].concat(Ye(g), Ye(u(m, h)));
757
+ }, []).filter(Boolean);
758
+ }, l = i(n, t);
759
+ return a ? typeof r < "u" ? l.slice(0, r) : l : null;
760
+ }, st = /* @__PURE__ */ o.createContext(null);
761
+ function No(e) {
762
+ var n = e.visible, t = e.values;
763
+ if (!n)
764
+ return null;
765
+ var r = 50;
766
+ return /* @__PURE__ */ o.createElement("span", {
767
+ "aria-live": "polite",
768
+ style: {
769
+ width: 0,
770
+ height: 0,
771
+ position: "absolute",
772
+ overflow: "hidden",
773
+ opacity: 0
774
+ }
775
+ }, "".concat(t.slice(0, r).map(function(a) {
776
+ var i = a.label, l = a.value;
777
+ return ["number", "string"].includes(pn(i)) ? i : l;
778
+ }).join(", ")), t.length > r ? ", ..." : null);
779
+ }
780
+ var Po = ["id", "prefixCls", "className", "showSearch", "tagRender", "direction", "omitDomProps", "displayValues", "onDisplayValuesChange", "emptyOptions", "notFoundContent", "onClear", "mode", "disabled", "loading", "getInputElement", "getRawInputElement", "open", "defaultOpen", "onDropdownVisibleChange", "activeValue", "onActiveValueChange", "activeDescendantId", "searchValue", "autoClearSearchValue", "onSearch", "onSearchSplit", "tokenSeparators", "allowClear", "prefix", "suffixIcon", "clearIcon", "OptionList", "animation", "transitionName", "dropdownStyle", "dropdownClassName", "dropdownMatchSelectWidth", "dropdownRender", "dropdownAlign", "placement", "builtinPlacements", "getPopupContainer", "showAction", "onFocus", "onBlur", "onKeyUp", "onKeyDown", "onMouseDown"], _o = ["value", "onChange", "removeIcon", "placeholder", "autoFocus", "maxTagCount", "maxTagTextLength", "maxTagPlaceholder", "choiceTransitionName", "onInputKeyDown", "onPopupScroll", "tabIndex"], An = function(n) {
781
+ return n === "tags" || n === "multiple";
782
+ }, qt = /* @__PURE__ */ o.forwardRef(function(e, n) {
783
+ var t, r = e.id, a = e.prefixCls, i = e.className, l = e.showSearch, u = e.tagRender, d = e.direction, f = e.omitDomProps, v = e.displayValues, s = e.onDisplayValuesChange, h = e.emptyOptions, c = e.notFoundContent, g = c === void 0 ? "Not Found" : c, m = e.onClear, S = e.mode, w = e.disabled, b = e.loading, x = e.getInputElement, y = e.getRawInputElement, N = e.open, p = e.defaultOpen, C = e.onDropdownVisibleChange, _ = e.activeValue, F = e.onActiveValueChange, A = e.activeDescendantId, K = e.searchValue, U = e.autoClearSearchValue, ne = e.onSearch, z = e.onSearchSplit, ie = e.tokenSeparators, j = e.allowClear, Z = e.prefix, M = e.suffixIcon, V = e.clearIcon, J = e.OptionList, $ = e.animation, Ee = e.transitionName, Re = e.dropdownStyle, G = e.dropdownClassName, he = e.dropdownMatchSelectWidth, $e = e.dropdownRender, Y = e.dropdownAlign, be = e.placement, we = e.builtinPlacements, le = e.getPopupContainer, E = e.showAction, O = E === void 0 ? [] : E, L = e.onFocus, W = e.onBlur, R = e.onKeyUp, Q = e.onKeyDown, ue = e.onMouseDown, se = In(e, Po), oe = An(S), ve = (l !== void 0 ? l : oe) || S === "combobox", De = ee({}, se);
784
+ _o.forEach(function(ce) {
785
+ delete De[ce];
786
+ }), f == null || f.forEach(function(ce) {
787
+ delete De[ce];
788
+ });
789
+ var He = o.useState(!1), Ve = re(He, 2), me = Ve[0], qe = Ve[1];
790
+ o.useEffect(function() {
791
+ qe(Nr());
792
+ }, []);
793
+ var Me = o.useRef(null), ge = o.useRef(null), ye = o.useRef(null), Ie = o.useRef(null), Te = o.useRef(null), Ae = o.useRef(!1), Je = mo(), xe = re(Je, 3), We = xe[0], je = xe[1], fn = xe[2];
794
+ o.useImperativeHandle(n, function() {
795
+ var ce, q;
796
+ return {
797
+ focus: (ce = Ie.current) === null || ce === void 0 ? void 0 : ce.focus,
798
+ blur: (q = Ie.current) === null || q === void 0 ? void 0 : q.blur,
799
+ scrollTo: function(Xe) {
800
+ var Pe;
801
+ return (Pe = Te.current) === null || Pe === void 0 ? void 0 : Pe.scrollTo(Xe);
802
+ },
803
+ nativeElement: Me.current || ge.current
804
+ };
805
+ });
806
+ var Be = o.useMemo(function() {
807
+ var ce;
808
+ if (S !== "combobox")
809
+ return K;
810
+ var q = (ce = v[0]) === null || ce === void 0 ? void 0 : ce.value;
811
+ return typeof q == "string" || typeof q == "number" ? String(q) : "";
812
+ }, [K, S, v]), ze = S === "combobox" && typeof x == "function" && x() || null, Ne = typeof y == "function" && y(), bn = Cr(ge, Ne == null || (t = Ne.props) === null || t === void 0 ? void 0 : t.ref), mn = o.useState(!1), On = re(mn, 2), vn = On[0], an = On[1];
813
+ Nn(function() {
814
+ an(!0);
815
+ }, []);
816
+ var Sn = Bn(!1, {
817
+ defaultValue: p,
818
+ value: N
819
+ }), nn = re(Sn, 2), wn = nn[0], ln = nn[1], Ce = vn ? wn : !1, un = !g && h;
820
+ (w || un && Ce && S === "combobox") && (Ce = !1);
821
+ var cn = un ? !1 : Ce, P = o.useCallback(function(ce) {
822
+ var q = ce !== void 0 ? ce : !Ce;
823
+ w || (ln(q), Ce !== q && (C == null || C(q)));
824
+ }, [w, Ce, ln, C]), B = o.useMemo(function() {
825
+ return (ie || []).some(function(ce) {
826
+ return [`
827
+ `, `\r
828
+ `].includes(ce);
829
+ });
830
+ }, [ie]), T = o.useContext(st) || {}, H = T.maxCount, te = T.rawValues, de = function(q, Ke, Xe) {
831
+ if (!(oe && kn(H) && (te == null ? void 0 : te.size) >= H)) {
832
+ var Pe = !0, Fe = q;
833
+ F == null || F(null);
834
+ var dn = Do(q, ie, kn(H) ? H - te.size : void 0), rn = Xe ? null : dn;
835
+ return S !== "combobox" && rn && (Fe = "", z == null || z(rn), P(!1), Pe = !1), ne && Be !== Fe && ne(Fe, {
836
+ source: Ke ? "typing" : "effect"
837
+ }), Pe;
838
+ }
839
+ }, Qe = function(q) {
840
+ !q || !q.trim() || ne(q, {
841
+ source: "submit"
842
+ });
843
+ };
844
+ o.useEffect(function() {
845
+ !Ce && !oe && S !== "combobox" && de("", !1, !1);
846
+ }, [Ce]), o.useEffect(function() {
847
+ wn && w && ln(!1), w && !Ae.current && je(!1);
848
+ }, [w]);
849
+ var Ge = Kt(), ke = re(Ge, 2), Oe = ke[0], tn = ke[1], en = o.useRef(!1), sn = function(q) {
850
+ var Ke = Oe(), Xe = q.key, Pe = Xe === "Enter";
851
+ if (Pe && (S !== "combobox" && q.preventDefault(), Ce || P(!0)), tn(!!Be), Xe === "Backspace" && !Ke && oe && !Be && v.length) {
852
+ for (var Fe = Ye(v), dn = null, rn = Fe.length - 1; rn >= 0; rn -= 1) {
853
+ var Cn = Fe[rn];
854
+ if (!Cn.disabled) {
855
+ Fe.splice(rn, 1), dn = Cn;
856
+ break;
857
+ }
858
+ }
859
+ dn && s(Fe, {
860
+ type: "remove",
861
+ values: [dn]
862
+ });
863
+ }
864
+ for (var Mn = arguments.length, En = new Array(Mn > 1 ? Mn - 1 : 0), Ln = 1; Ln < Mn; Ln++)
865
+ En[Ln - 1] = arguments[Ln];
866
+ if (Ce && (!Pe || !en.current)) {
867
+ var Hn;
868
+ (Hn = Te.current) === null || Hn === void 0 || Hn.onKeyDown.apply(Hn, [q].concat(En));
869
+ }
870
+ Pe && (en.current = !0), Q == null || Q.apply(void 0, [q].concat(En));
871
+ }, _n = function(q) {
872
+ for (var Ke = arguments.length, Xe = new Array(Ke > 1 ? Ke - 1 : 0), Pe = 1; Pe < Ke; Pe++)
873
+ Xe[Pe - 1] = arguments[Pe];
874
+ if (Ce) {
875
+ var Fe;
876
+ (Fe = Te.current) === null || Fe === void 0 || Fe.onKeyUp.apply(Fe, [q].concat(Xe));
877
+ }
878
+ q.key === "Enter" && (en.current = !1), R == null || R.apply(void 0, [q].concat(Xe));
879
+ }, D = function(q) {
880
+ var Ke = v.filter(function(Xe) {
881
+ return Xe !== q;
882
+ });
883
+ s(Ke, {
884
+ type: "remove",
885
+ values: [q]
886
+ });
887
+ }, I = o.useRef(!1), k = function() {
888
+ je(!0), w || (L && !I.current && L.apply(void 0, arguments), O.includes("focus") && P(!0)), I.current = !0;
889
+ }, pe = function() {
890
+ Ae.current = !0, je(!1, function() {
891
+ I.current = !1, Ae.current = !1, P(!1);
892
+ }), !w && (Be && (S === "tags" ? ne(Be, {
893
+ source: "submit"
894
+ }) : S === "multiple" && ne("", {
895
+ source: "blur"
896
+ })), W && W.apply(void 0, arguments));
897
+ }, Se = [];
898
+ o.useEffect(function() {
899
+ return function() {
900
+ Se.forEach(function(ce) {
901
+ return clearTimeout(ce);
902
+ }), Se.splice(0, Se.length);
903
+ };
904
+ }, []);
905
+ var Rn = function(q) {
906
+ var Ke, Xe = q.target, Pe = (Ke = ye.current) === null || Ke === void 0 ? void 0 : Ke.getPopupElement();
907
+ if (Pe && Pe.contains(Xe)) {
908
+ var Fe = setTimeout(function() {
909
+ var Mn = Se.indexOf(Fe);
910
+ if (Mn !== -1 && Se.splice(Mn, 1), fn(), !me && !Pe.contains(document.activeElement)) {
911
+ var En;
912
+ (En = Ie.current) === null || En === void 0 || En.focus();
913
+ }
914
+ });
915
+ Se.push(Fe);
916
+ }
917
+ for (var dn = arguments.length, rn = new Array(dn > 1 ? dn - 1 : 0), Cn = 1; Cn < dn; Cn++)
918
+ rn[Cn - 1] = arguments[Cn];
919
+ ue == null || ue.apply(void 0, [q].concat(rn));
920
+ }, yn = o.useState({}), Kn = re(yn, 2), Xn = Kn[1];
921
+ function zn() {
922
+ Xn({});
923
+ }
924
+ var $n;
925
+ Ne && ($n = function(q) {
926
+ P(q);
927
+ }), vo(function() {
928
+ var ce;
929
+ return [Me.current, (ce = ye.current) === null || ce === void 0 ? void 0 : ce.getPopupElement()];
930
+ }, cn, P, !!Ne);
931
+ var sr = o.useMemo(function() {
932
+ return ee(ee({}, e), {}, {
933
+ notFoundContent: g,
934
+ open: Ce,
935
+ triggerOpen: cn,
936
+ id: r,
937
+ showSearch: ve,
938
+ multiple: oe,
939
+ toggleOpen: P
940
+ });
941
+ }, [e, g, cn, Ce, r, ve, oe, P]), gt = !!M || b, pt;
942
+ gt && (pt = /* @__PURE__ */ o.createElement(Wn, {
943
+ className: Le("".concat(a, "-arrow"), ae({}, "".concat(a, "-arrow-loading"), b)),
944
+ customizeIcon: M,
945
+ customizeIconProps: {
946
+ loading: b,
947
+ searchValue: Be,
948
+ open: Ce,
949
+ focused: We,
950
+ showSearch: ve
951
+ }
952
+ }));
953
+ var dr = function() {
954
+ var q;
955
+ m == null || m(), (q = Ie.current) === null || q === void 0 || q.focus(), s([], {
956
+ type: "clear",
957
+ values: v
958
+ }), de("", !1, !1);
959
+ }, ht = so(a, dr, v, j, V, w, Be, S), fr = ht.allowClear, mr = ht.clearIcon, vr = /* @__PURE__ */ o.createElement(J, {
960
+ ref: Te
961
+ }), gr = Le(a, i, ae(ae(ae(ae(ae(ae(ae(ae(ae(ae({}, "".concat(a, "-focused"), We), "".concat(a, "-multiple"), oe), "".concat(a, "-single"), !oe), "".concat(a, "-allow-clear"), j), "".concat(a, "-show-arrow"), gt), "".concat(a, "-disabled"), w), "".concat(a, "-loading"), b), "".concat(a, "-open"), Ce), "".concat(a, "-customize-input"), ze), "".concat(a, "-show-search"), ve)), bt = /* @__PURE__ */ o.createElement(Gt, {
962
+ ref: ye,
963
+ disabled: w,
964
+ prefixCls: a,
965
+ visible: cn,
966
+ popupElement: vr,
967
+ animation: $,
968
+ transitionName: Ee,
969
+ dropdownStyle: Re,
970
+ dropdownClassName: G,
971
+ direction: d,
972
+ dropdownMatchSelectWidth: he,
973
+ dropdownRender: $e,
974
+ dropdownAlign: Y,
975
+ placement: be,
976
+ builtinPlacements: we,
977
+ getPopupContainer: le,
978
+ empty: h,
979
+ getTriggerDOMNode: function(q) {
980
+ return (
981
+ // TODO: This is workaround and should be removed in `rc-select`
982
+ // And use new standard `nativeElement` for ref.
983
+ // But we should update `rc-resize-observer` first.
984
+ ge.current || q
985
+ );
986
+ },
987
+ onPopupVisibleChange: $n,
988
+ onPopupMouseEnter: zn
989
+ }, Ne ? /* @__PURE__ */ o.cloneElement(Ne, {
990
+ ref: bn
991
+ }) : /* @__PURE__ */ o.createElement(Ut, Ze({}, e, {
992
+ domRef: ge,
993
+ prefixCls: a,
994
+ inputElement: ze,
995
+ ref: Ie,
996
+ id: r,
997
+ prefix: Z,
998
+ showSearch: ve,
999
+ autoClearSearchValue: U,
1000
+ mode: S,
1001
+ activeDescendantId: A,
1002
+ tagRender: u,
1003
+ values: v,
1004
+ open: Ce,
1005
+ onToggleOpen: P,
1006
+ activeValue: _,
1007
+ searchValue: Be,
1008
+ onSearch: de,
1009
+ onSearchSubmit: Qe,
1010
+ onRemove: D,
1011
+ tokenWithEnter: B
1012
+ }))), Un;
1013
+ return Ne ? Un = bt : Un = /* @__PURE__ */ o.createElement("div", Ze({
1014
+ className: gr
1015
+ }, De, {
1016
+ ref: Me,
1017
+ onMouseDown: Rn,
1018
+ onKeyDown: sn,
1019
+ onKeyUp: _n,
1020
+ onFocus: k,
1021
+ onBlur: pe
1022
+ }), /* @__PURE__ */ o.createElement(No, {
1023
+ visible: We && !Ce,
1024
+ values: v
1025
+ }), bt, pt, fr && mr), /* @__PURE__ */ o.createElement(Wt.Provider, {
1026
+ value: sr
1027
+ }, Un);
1028
+ });
1029
+ process.env.NODE_ENV !== "production" && (qt.displayName = "BaseSelect");
1030
+ var dt = function() {
1031
+ return null;
1032
+ };
1033
+ dt.isSelectOptGroup = !0;
1034
+ var ft = function() {
1035
+ return null;
1036
+ };
1037
+ ft.isSelectOption = !0;
1038
+ var Qt = /* @__PURE__ */ o.forwardRef(function(e, n) {
1039
+ var t = e.height, r = e.offsetY, a = e.offsetX, i = e.children, l = e.prefixCls, u = e.onInnerResize, d = e.innerProps, f = e.rtl, v = e.extra, s = {}, h = {
1040
+ display: "flex",
1041
+ flexDirection: "column"
1042
+ };
1043
+ return r !== void 0 && (s = {
1044
+ height: t,
1045
+ position: "relative",
1046
+ overflow: "hidden"
1047
+ }, h = ee(ee({}, h), {}, ae(ae(ae(ae(ae({
1048
+ transform: "translateY(".concat(r, "px)")
1049
+ }, f ? "marginRight" : "marginLeft", -a), "position", "absolute"), "left", 0), "right", 0), "top", 0))), /* @__PURE__ */ o.createElement("div", {
1050
+ style: s
1051
+ }, /* @__PURE__ */ o.createElement(jt, {
1052
+ onResize: function(g) {
1053
+ var m = g.offsetHeight;
1054
+ m && u && u();
1055
+ }
1056
+ }, /* @__PURE__ */ o.createElement("div", Ze({
1057
+ style: h,
1058
+ className: Le(ae({}, "".concat(l, "-holder-inner"), l)),
1059
+ ref: n
1060
+ }, d), i, v)));
1061
+ });
1062
+ Qt.displayName = "Filler";
1063
+ function To(e) {
1064
+ var n = e.children, t = e.setRef, r = o.useCallback(function(a) {
1065
+ t(a);
1066
+ }, []);
1067
+ return /* @__PURE__ */ o.cloneElement(n, {
1068
+ ref: r
1069
+ });
1070
+ }
1071
+ function zo(e, n, t, r, a, i, l, u) {
1072
+ var d = u.getKey;
1073
+ return e.slice(n, t + 1).map(function(f, v) {
1074
+ var s = n + v, h = l(f, s, {
1075
+ style: {
1076
+ width: r
1077
+ },
1078
+ offsetX: a
1079
+ }), c = d(f);
1080
+ return /* @__PURE__ */ o.createElement(To, {
1081
+ key: c,
1082
+ setRef: function(m) {
1083
+ return i(f, m);
1084
+ }
1085
+ }, h);
1086
+ });
1087
+ }
1088
+ function Lo(e, n, t) {
1089
+ var r = e.length, a = n.length, i, l;
1090
+ if (r === 0 && a === 0)
1091
+ return null;
1092
+ r < a ? (i = e, l = n) : (i = n, l = e);
1093
+ var u = {
1094
+ __EMPTY_ITEM__: !0
1095
+ };
1096
+ function d(g) {
1097
+ return g !== void 0 ? t(g) : u;
1098
+ }
1099
+ for (var f = null, v = Math.abs(r - a) !== 1, s = 0; s < l.length; s += 1) {
1100
+ var h = d(i[s]), c = d(l[s]);
1101
+ if (h !== c) {
1102
+ f = s, v = v || h !== d(l[s + 1]);
1103
+ break;
1104
+ }
1105
+ }
1106
+ return f === null ? null : {
1107
+ index: f,
1108
+ multiple: v
1109
+ };
1110
+ }
1111
+ function Ho(e, n, t) {
1112
+ var r = o.useState(e), a = re(r, 2), i = a[0], l = a[1], u = o.useState(null), d = re(u, 2), f = d[0], v = d[1];
1113
+ return o.useEffect(function() {
1114
+ var s = Lo(i || [], e, n);
1115
+ (s == null ? void 0 : s.index) !== void 0 && v(e[s.index]), l(e);
1116
+ }, [e]), [f];
1117
+ }
1118
+ var Rt = (typeof navigator > "u" ? "undefined" : pn(navigator)) === "object" && /Firefox/i.test(navigator.userAgent);
1119
+ const Zt = function(e, n, t, r) {
1120
+ var a = fe(!1), i = fe(null);
1121
+ function l() {
1122
+ clearTimeout(i.current), a.current = !0, i.current = setTimeout(function() {
1123
+ a.current = !1;
1124
+ }, 50);
1125
+ }
1126
+ var u = fe({
1127
+ top: e,
1128
+ bottom: n,
1129
+ left: t,
1130
+ right: r
1131
+ });
1132
+ return u.current.top = e, u.current.bottom = n, u.current.left = t, u.current.right = r, function(d, f) {
1133
+ var v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1, s = d ? (
1134
+ // Pass origin wheel when on the left
1135
+ f < 0 && u.current.left || // Pass origin wheel when on the right
1136
+ f > 0 && u.current.right
1137
+ ) : f < 0 && u.current.top || // Pass origin wheel when on the bottom
1138
+ f > 0 && u.current.bottom;
1139
+ return v && s ? (clearTimeout(i.current), a.current = !1) : (!s || a.current) && l(), !a.current && s;
1140
+ };
1141
+ };
1142
+ function Vo(e, n, t, r, a, i, l) {
1143
+ var u = fe(0), d = fe(null), f = fe(null), v = fe(!1), s = Zt(n, t, r, a);
1144
+ function h(b, x) {
1145
+ if (on.cancel(d.current), !s(!1, x)) {
1146
+ var y = b;
1147
+ if (!y._virtualHandled)
1148
+ y._virtualHandled = !0;
1149
+ else
1150
+ return;
1151
+ u.current += x, f.current = x, Rt || y.preventDefault(), d.current = on(function() {
1152
+ var N = v.current ? 10 : 1;
1153
+ l(u.current * N, !1), u.current = 0;
1154
+ });
1155
+ }
1156
+ }
1157
+ function c(b, x) {
1158
+ l(x, !0), Rt || b.preventDefault();
1159
+ }
1160
+ var g = fe(null), m = fe(null);
1161
+ function S(b) {
1162
+ if (e) {
1163
+ on.cancel(m.current), m.current = on(function() {
1164
+ g.current = null;
1165
+ }, 2);
1166
+ var x = b.deltaX, y = b.deltaY, N = b.shiftKey, p = x, C = y;
1167
+ (g.current === "sx" || !g.current && N && y && !x) && (p = y, C = 0, g.current = "sx");
1168
+ var _ = Math.abs(p), F = Math.abs(C);
1169
+ g.current === null && (g.current = i && _ > F ? "x" : "y"), g.current === "y" ? h(b, C) : c(b, p);
1170
+ }
1171
+ }
1172
+ function w(b) {
1173
+ e && (v.current = b.detail === f.current);
1174
+ }
1175
+ return [S, w];
1176
+ }
1177
+ function Bo(e, n, t, r) {
1178
+ var a = o.useMemo(function() {
1179
+ return [/* @__PURE__ */ new Map(), []];
1180
+ }, [e, t.id, r]), i = re(a, 2), l = i[0], u = i[1], d = function(v) {
1181
+ var s = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : v, h = l.get(v), c = l.get(s);
1182
+ if (h === void 0 || c === void 0)
1183
+ for (var g = e.length, m = u.length; m < g; m += 1) {
1184
+ var S, w = e[m], b = n(w);
1185
+ l.set(b, m);
1186
+ var x = (S = t.get(b)) !== null && S !== void 0 ? S : r;
1187
+ if (u[m] = (u[m - 1] || 0) + x, b === v && (h = m), b === s && (c = m), h !== void 0 && c !== void 0)
1188
+ break;
1189
+ }
1190
+ return {
1191
+ top: u[h - 1] || 0,
1192
+ bottom: u[c]
1193
+ };
1194
+ };
1195
+ return d;
1196
+ }
1197
+ var Fo = /* @__PURE__ */ function() {
1198
+ function e() {
1199
+ Ir(this, e), ae(this, "maps", void 0), ae(this, "id", 0), ae(this, "diffKeys", /* @__PURE__ */ new Set()), this.maps = /* @__PURE__ */ Object.create(null);
1200
+ }
1201
+ return Er(e, [{
1202
+ key: "set",
1203
+ value: function(t, r) {
1204
+ this.maps[t] = r, this.id += 1, this.diffKeys.add(t);
1205
+ }
1206
+ }, {
1207
+ key: "get",
1208
+ value: function(t) {
1209
+ return this.maps[t];
1210
+ }
1211
+ /**
1212
+ * CacheMap will record the key changed.
1213
+ * To help to know what's update in the next render.
1214
+ */
1215
+ }, {
1216
+ key: "resetRecord",
1217
+ value: function() {
1218
+ this.diffKeys.clear();
1219
+ }
1220
+ }, {
1221
+ key: "getRecord",
1222
+ value: function() {
1223
+ return this.diffKeys;
1224
+ }
1225
+ }]), e;
1226
+ }();
1227
+ function $t(e) {
1228
+ var n = parseFloat(e);
1229
+ return isNaN(n) ? 0 : n;
1230
+ }
1231
+ function Ao(e, n, t) {
1232
+ var r = o.useState(0), a = re(r, 2), i = a[0], l = a[1], u = fe(/* @__PURE__ */ new Map()), d = fe(new Fo()), f = fe(0);
1233
+ function v() {
1234
+ f.current += 1;
1235
+ }
1236
+ function s() {
1237
+ var c = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1238
+ v();
1239
+ var g = function() {
1240
+ u.current.forEach(function(w, b) {
1241
+ if (w && w.offsetParent) {
1242
+ var x = xr(w), y = x.offsetHeight, N = getComputedStyle(x), p = N.marginTop, C = N.marginBottom, _ = $t(p), F = $t(C), A = y + _ + F;
1243
+ d.current.get(b) !== A && d.current.set(b, A);
1244
+ }
1245
+ }), l(function(w) {
1246
+ return w + 1;
1247
+ });
1248
+ };
1249
+ if (c)
1250
+ g();
1251
+ else {
1252
+ f.current += 1;
1253
+ var m = f.current;
1254
+ Promise.resolve().then(function() {
1255
+ m === f.current && g();
1256
+ });
1257
+ }
1258
+ }
1259
+ function h(c, g) {
1260
+ var m = e(c);
1261
+ u.current.get(m), g ? (u.current.set(m, g), s()) : u.current.delete(m);
1262
+ }
1263
+ return Qn(function() {
1264
+ return v;
1265
+ }, []), [h, s, d.current, i];
1266
+ }
1267
+ var Mt = 14 / 15;
1268
+ function jo(e, n, t) {
1269
+ var r = fe(!1), a = fe(0), i = fe(0), l = fe(null), u = fe(null), d, f = function(c) {
1270
+ if (r.current) {
1271
+ var g = Math.ceil(c.touches[0].pageX), m = Math.ceil(c.touches[0].pageY), S = a.current - g, w = i.current - m, b = Math.abs(S) > Math.abs(w);
1272
+ b ? a.current = g : i.current = m;
1273
+ var x = t(b, b ? S : w, !1, c);
1274
+ x && c.preventDefault(), clearInterval(u.current), x && (u.current = setInterval(function() {
1275
+ b ? S *= Mt : w *= Mt;
1276
+ var y = Math.floor(b ? S : w);
1277
+ (!t(b, y, !0) || Math.abs(y) <= 0.1) && clearInterval(u.current);
1278
+ }, 16));
1279
+ }
1280
+ }, v = function() {
1281
+ r.current = !1, d();
1282
+ }, s = function(c) {
1283
+ d(), c.touches.length === 1 && !r.current && (r.current = !0, a.current = Math.ceil(c.touches[0].pageX), i.current = Math.ceil(c.touches[0].pageY), l.current = c.target, l.current.addEventListener("touchmove", f, {
1284
+ passive: !1
1285
+ }), l.current.addEventListener("touchend", v, {
1286
+ passive: !0
1287
+ }));
1288
+ };
1289
+ d = function() {
1290
+ l.current && (l.current.removeEventListener("touchmove", f), l.current.removeEventListener("touchend", v));
1291
+ }, Nn(function() {
1292
+ return e && n.current.addEventListener("touchstart", s, {
1293
+ passive: !0
1294
+ }), function() {
1295
+ var h;
1296
+ (h = n.current) === null || h === void 0 || h.removeEventListener("touchstart", s), d(), clearInterval(u.current);
1297
+ };
1298
+ }, [e]);
1299
+ }
1300
+ function Dt(e) {
1301
+ return Math.floor(Math.pow(e, 0.5));
1302
+ }
1303
+ function nt(e, n) {
1304
+ var t = "touches" in e ? e.touches[0] : e;
1305
+ return t[n ? "pageX" : "pageY"] - window[n ? "scrollX" : "scrollY"];
1306
+ }
1307
+ function Wo(e, n, t) {
1308
+ o.useEffect(function() {
1309
+ var r = n.current;
1310
+ if (e && r) {
1311
+ var a = !1, i, l, u = function() {
1312
+ on.cancel(i);
1313
+ }, d = function h() {
1314
+ u(), i = on(function() {
1315
+ t(l), h();
1316
+ });
1317
+ }, f = function(c) {
1318
+ var g = c;
1319
+ g._virtualHandled || (g._virtualHandled = !0, a = !0);
1320
+ }, v = function() {
1321
+ a = !1, u();
1322
+ }, s = function(c) {
1323
+ if (a) {
1324
+ var g = nt(c, !1), m = r.getBoundingClientRect(), S = m.top, w = m.bottom;
1325
+ if (g <= S) {
1326
+ var b = S - g;
1327
+ l = -Dt(b), d();
1328
+ } else if (g >= w) {
1329
+ var x = g - w;
1330
+ l = Dt(x), d();
1331
+ } else
1332
+ u();
1333
+ }
1334
+ };
1335
+ return r.addEventListener("mousedown", f), r.ownerDocument.addEventListener("mouseup", v), r.ownerDocument.addEventListener("mousemove", s), function() {
1336
+ r.removeEventListener("mousedown", f), r.ownerDocument.removeEventListener("mouseup", v), r.ownerDocument.removeEventListener("mousemove", s), u();
1337
+ };
1338
+ }
1339
+ }, [e]);
1340
+ }
1341
+ var Nt = 10;
1342
+ function Ko(e, n, t, r, a, i, l, u) {
1343
+ var d = o.useRef(), f = o.useState(null), v = re(f, 2), s = v[0], h = v[1];
1344
+ return Nn(function() {
1345
+ if (s && s.times < Nt) {
1346
+ if (!e.current) {
1347
+ h(function(V) {
1348
+ return ee({}, V);
1349
+ });
1350
+ return;
1351
+ }
1352
+ i();
1353
+ var c = s.targetAlign, g = s.originAlign, m = s.index, S = s.offset, w = e.current.clientHeight, b = !1, x = c, y = null;
1354
+ if (w) {
1355
+ for (var N = c || g, p = 0, C = 0, _ = 0, F = Math.min(n.length - 1, m), A = 0; A <= F; A += 1) {
1356
+ var K = a(n[A]);
1357
+ C = p;
1358
+ var U = t.get(K);
1359
+ _ = C + (U === void 0 ? r : U), p = _;
1360
+ }
1361
+ for (var ne = N === "top" ? S : w - S, z = F; z >= 0; z -= 1) {
1362
+ var ie = a(n[z]), j = t.get(ie);
1363
+ if (j === void 0) {
1364
+ b = !0;
1365
+ break;
1366
+ }
1367
+ if (ne -= j, ne <= 0)
1368
+ break;
1369
+ }
1370
+ switch (N) {
1371
+ case "top":
1372
+ y = C - S;
1373
+ break;
1374
+ case "bottom":
1375
+ y = _ - w + S;
1376
+ break;
1377
+ default: {
1378
+ var Z = e.current.scrollTop, M = Z + w;
1379
+ C < Z ? x = "top" : _ > M && (x = "bottom");
1380
+ }
1381
+ }
1382
+ y !== null && l(y), y !== s.lastTop && (b = !0);
1383
+ }
1384
+ b && h(ee(ee({}, s), {}, {
1385
+ times: s.times + 1,
1386
+ targetAlign: x,
1387
+ lastTop: y
1388
+ }));
1389
+ } else process.env.NODE_ENV !== "production" && (s == null ? void 0 : s.times) === Nt && Ue(!1, "Seems `scrollTo` with `rc-virtual-list` reach the max limitation. Please fire issue for us. Thanks.");
1390
+ }, [s, e.current]), function(c) {
1391
+ if (c == null) {
1392
+ u();
1393
+ return;
1394
+ }
1395
+ if (on.cancel(d.current), typeof c == "number")
1396
+ l(c);
1397
+ else if (c && pn(c) === "object") {
1398
+ var g, m = c.align;
1399
+ "index" in c ? g = c.index : g = n.findIndex(function(b) {
1400
+ return a(b) === c.key;
1401
+ });
1402
+ var S = c.offset, w = S === void 0 ? 0 : S;
1403
+ h({
1404
+ times: 0,
1405
+ index: g,
1406
+ offset: w,
1407
+ originAlign: m
1408
+ });
1409
+ }
1410
+ };
1411
+ }
1412
+ var tt = /* @__PURE__ */ o.forwardRef(function(e, n) {
1413
+ var t = e.prefixCls, r = e.rtl, a = e.scrollOffset, i = e.scrollRange, l = e.onStartMove, u = e.onStopMove, d = e.onScroll, f = e.horizontal, v = e.spinSize, s = e.containerSize, h = e.style, c = e.thumbStyle, g = o.useState(!1), m = re(g, 2), S = m[0], w = m[1], b = o.useState(null), x = re(b, 2), y = x[0], N = x[1], p = o.useState(null), C = re(p, 2), _ = C[0], F = C[1], A = !r, K = o.useRef(), U = o.useRef(), ne = o.useState(!1), z = re(ne, 2), ie = z[0], j = z[1], Z = o.useRef(), M = function() {
1414
+ clearTimeout(Z.current), j(!0), Z.current = setTimeout(function() {
1415
+ j(!1);
1416
+ }, 3e3);
1417
+ }, V = i - s || 0, J = s - v || 0, $ = o.useMemo(function() {
1418
+ if (a === 0 || V === 0)
1419
+ return 0;
1420
+ var le = a / V;
1421
+ return le * J;
1422
+ }, [a, V, J]), Ee = function(E) {
1423
+ E.stopPropagation(), E.preventDefault();
1424
+ }, Re = o.useRef({
1425
+ top: $,
1426
+ dragging: S,
1427
+ pageY: y,
1428
+ startTop: _
1429
+ });
1430
+ Re.current = {
1431
+ top: $,
1432
+ dragging: S,
1433
+ pageY: y,
1434
+ startTop: _
1435
+ };
1436
+ var G = function(E) {
1437
+ w(!0), N(nt(E, f)), F(Re.current.top), l(), E.stopPropagation(), E.preventDefault();
1438
+ };
1439
+ o.useEffect(function() {
1440
+ var le = function(W) {
1441
+ W.preventDefault();
1442
+ }, E = K.current, O = U.current;
1443
+ return E.addEventListener("touchstart", le, {
1444
+ passive: !1
1445
+ }), O.addEventListener("touchstart", G, {
1446
+ passive: !1
1447
+ }), function() {
1448
+ E.removeEventListener("touchstart", le), O.removeEventListener("touchstart", G);
1449
+ };
1450
+ }, []);
1451
+ var he = o.useRef();
1452
+ he.current = V;
1453
+ var $e = o.useRef();
1454
+ $e.current = J, o.useEffect(function() {
1455
+ if (S) {
1456
+ var le, E = function(W) {
1457
+ var R = Re.current, Q = R.dragging, ue = R.pageY, se = R.startTop;
1458
+ on.cancel(le);
1459
+ var oe = K.current.getBoundingClientRect(), ve = s / (f ? oe.width : oe.height);
1460
+ if (Q) {
1461
+ var De = (nt(W, f) - ue) * ve, He = se;
1462
+ !A && f ? He -= De : He += De;
1463
+ var Ve = he.current, me = $e.current, qe = me ? He / me : 0, Me = Math.ceil(qe * Ve);
1464
+ Me = Math.max(Me, 0), Me = Math.min(Me, Ve), le = on(function() {
1465
+ d(Me, f);
1466
+ });
1467
+ }
1468
+ }, O = function() {
1469
+ w(!1), u();
1470
+ };
1471
+ return window.addEventListener("mousemove", E, {
1472
+ passive: !0
1473
+ }), window.addEventListener("touchmove", E, {
1474
+ passive: !0
1475
+ }), window.addEventListener("mouseup", O, {
1476
+ passive: !0
1477
+ }), window.addEventListener("touchend", O, {
1478
+ passive: !0
1479
+ }), function() {
1480
+ window.removeEventListener("mousemove", E), window.removeEventListener("touchmove", E), window.removeEventListener("mouseup", O), window.removeEventListener("touchend", O), on.cancel(le);
1481
+ };
1482
+ }
1483
+ }, [S]), o.useEffect(function() {
1484
+ return M(), function() {
1485
+ clearTimeout(Z.current);
1486
+ };
1487
+ }, [a]), o.useImperativeHandle(n, function() {
1488
+ return {
1489
+ delayHidden: M
1490
+ };
1491
+ });
1492
+ var Y = "".concat(t, "-scrollbar"), be = {
1493
+ position: "absolute",
1494
+ visibility: ie ? null : "hidden"
1495
+ }, we = {
1496
+ position: "absolute",
1497
+ background: "rgba(0, 0, 0, 0.5)",
1498
+ borderRadius: 99,
1499
+ cursor: "pointer",
1500
+ userSelect: "none"
1501
+ };
1502
+ return f ? (be.height = 8, be.left = 0, be.right = 0, be.bottom = 0, we.height = "100%", we.width = v, A ? we.left = $ : we.right = $) : (be.width = 8, be.top = 0, be.bottom = 0, A ? be.right = 0 : be.left = 0, we.width = "100%", we.height = v, we.top = $), /* @__PURE__ */ o.createElement("div", {
1503
+ ref: K,
1504
+ className: Le(Y, ae(ae(ae({}, "".concat(Y, "-horizontal"), f), "".concat(Y, "-vertical"), !f), "".concat(Y, "-visible"), ie)),
1505
+ style: ee(ee({}, be), h),
1506
+ onMouseDown: Ee,
1507
+ onMouseMove: M
1508
+ }, /* @__PURE__ */ o.createElement("div", {
1509
+ ref: U,
1510
+ className: Le("".concat(Y, "-thumb"), ae({}, "".concat(Y, "-thumb-moving"), S)),
1511
+ style: ee(ee({}, we), c),
1512
+ onMouseDown: G
1513
+ }));
1514
+ });
1515
+ process.env.NODE_ENV !== "production" && (tt.displayName = "ScrollBar");
1516
+ var Xo = 20;
1517
+ function Pt() {
1518
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0, n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, t = e / n * e;
1519
+ return isNaN(t) && (t = 0), t = Math.max(t, Xo), Math.floor(t);
1520
+ }
1521
+ var Uo = ["prefixCls", "className", "height", "itemHeight", "fullHeight", "style", "data", "children", "itemKey", "virtual", "direction", "scrollWidth", "component", "onScroll", "onVirtualScroll", "onVisibleChange", "innerProps", "extraRender", "styles"], Go = [], Yo = {
1522
+ overflowY: "auto",
1523
+ overflowAnchor: "none"
1524
+ };
1525
+ function qo(e, n) {
1526
+ var t = e.prefixCls, r = t === void 0 ? "rc-virtual-list" : t, a = e.className, i = e.height, l = e.itemHeight, u = e.fullHeight, d = u === void 0 ? !0 : u, f = e.style, v = e.data, s = e.children, h = e.itemKey, c = e.virtual, g = e.direction, m = e.scrollWidth, S = e.component, w = S === void 0 ? "div" : S, b = e.onScroll, x = e.onVirtualScroll, y = e.onVisibleChange, N = e.innerProps, p = e.extraRender, C = e.styles, _ = In(e, Uo), F = o.useCallback(function(D) {
1527
+ return typeof h == "function" ? h(D) : D == null ? void 0 : D[h];
1528
+ }, [h]), A = Ao(F), K = re(A, 4), U = K[0], ne = K[1], z = K[2], ie = K[3], j = !!(c !== !1 && i && l), Z = o.useMemo(function() {
1529
+ return Object.values(z.maps).reduce(function(D, I) {
1530
+ return D + I;
1531
+ }, 0);
1532
+ }, [z.id, z.maps]), M = j && v && (Math.max(l * v.length, Z) > i || !!m), V = g === "rtl", J = Le(r, ae({}, "".concat(r, "-rtl"), V), a), $ = v || Go, Ee = fe(), Re = fe(), G = fe(), he = Tn(0), $e = re(he, 2), Y = $e[0], be = $e[1], we = Tn(0), le = re(we, 2), E = le[0], O = le[1], L = Tn(!1), W = re(L, 2), R = W[0], Q = W[1], ue = function() {
1533
+ Q(!0);
1534
+ }, se = function() {
1535
+ Q(!1);
1536
+ }, oe = {
1537
+ getKey: F
1538
+ };
1539
+ function ve(D) {
1540
+ be(function(I) {
1541
+ var k;
1542
+ typeof D == "function" ? k = D(I) : k = D;
1543
+ var pe = On(k);
1544
+ return Ee.current.scrollTop = pe, pe;
1545
+ });
1546
+ }
1547
+ var De = fe({
1548
+ start: 0,
1549
+ end: $.length
1550
+ }), He = fe(), Ve = Ho($, F), me = re(Ve, 1), qe = me[0];
1551
+ He.current = qe;
1552
+ var Me = o.useMemo(function() {
1553
+ if (!j)
1554
+ return {
1555
+ scrollHeight: void 0,
1556
+ start: 0,
1557
+ end: $.length - 1,
1558
+ offset: void 0
1559
+ };
1560
+ if (!M) {
1561
+ var D;
1562
+ return {
1563
+ scrollHeight: ((D = Re.current) === null || D === void 0 ? void 0 : D.offsetHeight) || 0,
1564
+ start: 0,
1565
+ end: $.length - 1,
1566
+ offset: void 0
1567
+ };
1568
+ }
1569
+ for (var I = 0, k, pe, Se, Rn = $.length, yn = 0; yn < Rn; yn += 1) {
1570
+ var Kn = $[yn], Xn = F(Kn), zn = z.get(Xn), $n = I + (zn === void 0 ? l : zn);
1571
+ $n >= Y && k === void 0 && (k = yn, pe = I), $n > Y + i && Se === void 0 && (Se = yn), I = $n;
1572
+ }
1573
+ return k === void 0 && (k = 0, pe = 0, Se = Math.ceil(i / l)), Se === void 0 && (Se = $.length - 1), Se = Math.min(Se + 1, $.length - 1), {
1574
+ scrollHeight: I,
1575
+ start: k,
1576
+ end: Se,
1577
+ offset: pe
1578
+ };
1579
+ }, [M, j, Y, $, ie, i]), ge = Me.scrollHeight, ye = Me.start, Ie = Me.end, Te = Me.offset;
1580
+ De.current.start = ye, De.current.end = Ie, o.useLayoutEffect(function() {
1581
+ var D = z.getRecord();
1582
+ if (D.size === 1) {
1583
+ var I = Array.from(D)[0], k = F($[ye]);
1584
+ if (k === I) {
1585
+ var pe = z.get(I), Se = pe - l;
1586
+ ve(function(Rn) {
1587
+ return Rn + Se;
1588
+ });
1589
+ }
1590
+ }
1591
+ z.resetRecord();
1592
+ }, [ge]);
1593
+ var Ae = o.useState({
1594
+ width: 0,
1595
+ height: i
1596
+ }), Je = re(Ae, 2), xe = Je[0], We = Je[1], je = function(I) {
1597
+ We({
1598
+ width: I.offsetWidth,
1599
+ height: I.offsetHeight
1600
+ });
1601
+ }, fn = fe(), Be = fe(), ze = o.useMemo(function() {
1602
+ return Pt(xe.width, m);
1603
+ }, [xe.width, m]), Ne = o.useMemo(function() {
1604
+ return Pt(xe.height, ge);
1605
+ }, [xe.height, ge]), bn = ge - i, mn = fe(bn);
1606
+ mn.current = bn;
1607
+ function On(D) {
1608
+ var I = D;
1609
+ return Number.isNaN(mn.current) || (I = Math.min(I, mn.current)), I = Math.max(I, 0), I;
1610
+ }
1611
+ var vn = Y <= 0, an = Y >= bn, Sn = E <= 0, nn = E >= m, wn = Zt(vn, an, Sn, nn), ln = function() {
1612
+ return {
1613
+ x: V ? -E : E,
1614
+ y: Y
1615
+ };
1616
+ }, Ce = fe(ln()), un = St(function(D) {
1617
+ if (x) {
1618
+ var I = ee(ee({}, ln()), D);
1619
+ (Ce.current.x !== I.x || Ce.current.y !== I.y) && (x(I), Ce.current = I);
1620
+ }
1621
+ });
1622
+ function cn(D, I) {
1623
+ var k = D;
1624
+ I ? (Ct.flushSync(function() {
1625
+ O(k);
1626
+ }), un()) : ve(k);
1627
+ }
1628
+ function P(D) {
1629
+ var I = D.currentTarget.scrollTop;
1630
+ I !== Y && ve(I), b == null || b(D), un();
1631
+ }
1632
+ var B = function(I) {
1633
+ var k = I, pe = m ? m - xe.width : 0;
1634
+ return k = Math.max(k, 0), k = Math.min(k, pe), k;
1635
+ }, T = St(function(D, I) {
1636
+ I ? (Ct.flushSync(function() {
1637
+ O(function(k) {
1638
+ var pe = k + (V ? -D : D);
1639
+ return B(pe);
1640
+ });
1641
+ }), un()) : ve(function(k) {
1642
+ var pe = k + D;
1643
+ return pe;
1644
+ });
1645
+ }), H = Vo(j, vn, an, Sn, nn, !!m, T), te = re(H, 2), de = te[0], Qe = te[1];
1646
+ jo(j, Ee, function(D, I, k, pe) {
1647
+ var Se = pe;
1648
+ return wn(D, I, k) ? !1 : !Se || !Se._virtualHandled ? (Se && (Se._virtualHandled = !0), de({
1649
+ preventDefault: function() {
1650
+ },
1651
+ deltaX: D ? I : 0,
1652
+ deltaY: D ? 0 : I
1653
+ }), !0) : !1;
1654
+ }), Wo(M, Ee, function(D) {
1655
+ ve(function(I) {
1656
+ return I + D;
1657
+ });
1658
+ }), Nn(function() {
1659
+ function D(k) {
1660
+ var pe = vn && k.detail < 0, Se = an && k.detail > 0;
1661
+ j && !pe && !Se && k.preventDefault();
1662
+ }
1663
+ var I = Ee.current;
1664
+ return I.addEventListener("wheel", de, {
1665
+ passive: !1
1666
+ }), I.addEventListener("DOMMouseScroll", Qe, {
1667
+ passive: !0
1668
+ }), I.addEventListener("MozMousePixelScroll", D, {
1669
+ passive: !1
1670
+ }), function() {
1671
+ I.removeEventListener("wheel", de), I.removeEventListener("DOMMouseScroll", Qe), I.removeEventListener("MozMousePixelScroll", D);
1672
+ };
1673
+ }, [j, vn, an]), Nn(function() {
1674
+ if (m) {
1675
+ var D = B(E);
1676
+ O(D), un({
1677
+ x: D
1678
+ });
1679
+ }
1680
+ }, [xe.width, m]);
1681
+ var Ge = function() {
1682
+ var I, k;
1683
+ (I = fn.current) === null || I === void 0 || I.delayHidden(), (k = Be.current) === null || k === void 0 || k.delayHidden();
1684
+ }, ke = Ko(Ee, $, z, l, F, function() {
1685
+ return ne(!0);
1686
+ }, ve, Ge);
1687
+ o.useImperativeHandle(n, function() {
1688
+ return {
1689
+ nativeElement: G.current,
1690
+ getScrollInfo: ln,
1691
+ scrollTo: function(I) {
1692
+ function k(pe) {
1693
+ return pe && pn(pe) === "object" && ("left" in pe || "top" in pe);
1694
+ }
1695
+ k(I) ? (I.left !== void 0 && O(B(I.left)), ke(I.top)) : ke(I);
1696
+ }
1697
+ };
1698
+ }), Nn(function() {
1699
+ if (y) {
1700
+ var D = $.slice(ye, Ie + 1);
1701
+ y(D, $);
1702
+ }
1703
+ }, [ye, Ie, $]);
1704
+ var Oe = Bo($, F, z, l), tn = p == null ? void 0 : p({
1705
+ start: ye,
1706
+ end: Ie,
1707
+ virtual: M,
1708
+ offsetX: E,
1709
+ offsetY: Te,
1710
+ rtl: V,
1711
+ getSize: Oe
1712
+ }), en = zo($, ye, Ie, m, E, U, s, oe), sn = null;
1713
+ i && (sn = ee(ae({}, d ? "height" : "maxHeight", i), Yo), j && (sn.overflowY = "hidden", m && (sn.overflowX = "hidden"), R && (sn.pointerEvents = "none")));
1714
+ var _n = {};
1715
+ return V && (_n.dir = "rtl"), /* @__PURE__ */ o.createElement("div", Ze({
1716
+ ref: G,
1717
+ style: ee(ee({}, f), {}, {
1718
+ position: "relative"
1719
+ }),
1720
+ className: J
1721
+ }, _n, _), /* @__PURE__ */ o.createElement(jt, {
1722
+ onResize: je
1723
+ }, /* @__PURE__ */ o.createElement(w, {
1724
+ className: "".concat(r, "-holder"),
1725
+ style: sn,
1726
+ ref: Ee,
1727
+ onScroll: P,
1728
+ onMouseEnter: Ge
1729
+ }, /* @__PURE__ */ o.createElement(Qt, {
1730
+ prefixCls: r,
1731
+ height: ge,
1732
+ offsetX: E,
1733
+ offsetY: Te,
1734
+ scrollWidth: m,
1735
+ onInnerResize: ne,
1736
+ ref: Re,
1737
+ innerProps: N,
1738
+ rtl: V,
1739
+ extra: tn
1740
+ }, en))), M && ge > i && /* @__PURE__ */ o.createElement(tt, {
1741
+ ref: fn,
1742
+ prefixCls: r,
1743
+ scrollOffset: Y,
1744
+ scrollRange: ge,
1745
+ rtl: V,
1746
+ onScroll: cn,
1747
+ onStartMove: ue,
1748
+ onStopMove: se,
1749
+ spinSize: Ne,
1750
+ containerSize: xe.height,
1751
+ style: C == null ? void 0 : C.verticalScrollBar,
1752
+ thumbStyle: C == null ? void 0 : C.verticalScrollBarThumb
1753
+ }), M && m > xe.width && /* @__PURE__ */ o.createElement(tt, {
1754
+ ref: Be,
1755
+ prefixCls: r,
1756
+ scrollOffset: E,
1757
+ scrollRange: m,
1758
+ rtl: V,
1759
+ onScroll: cn,
1760
+ onStartMove: ue,
1761
+ onStopMove: se,
1762
+ spinSize: ze,
1763
+ containerSize: xe.width,
1764
+ horizontal: !0,
1765
+ style: C == null ? void 0 : C.horizontalScrollBar,
1766
+ thumbStyle: C == null ? void 0 : C.horizontalScrollBarThumb
1767
+ }));
1768
+ }
1769
+ var Jt = /* @__PURE__ */ o.forwardRef(qo);
1770
+ Jt.displayName = "List";
1771
+ function Qo() {
1772
+ return /(mac\sos|macintosh)/i.test(navigator.appVersion);
1773
+ }
1774
+ var Zo = ["disabled", "title", "children", "style", "className"];
1775
+ function _t(e) {
1776
+ return typeof e == "string" || typeof e == "number";
1777
+ }
1778
+ var Jo = function(n, t) {
1779
+ var r = fo(), a = r.prefixCls, i = r.id, l = r.open, u = r.multiple, d = r.mode, f = r.searchValue, v = r.toggleOpen, s = r.notFoundContent, h = r.onPopupScroll, c = o.useContext(st), g = c.maxCount, m = c.flattenOptions, S = c.onActiveValue, w = c.defaultActiveFirstOption, b = c.onSelect, x = c.menuItemSelectedIcon, y = c.rawValues, N = c.fieldNames, p = c.virtual, C = c.direction, _ = c.listHeight, F = c.listItemHeight, A = c.optionRender, K = "".concat(a, "-item"), U = Or(function() {
1780
+ return m;
1781
+ }, [l, m], function(E, O) {
1782
+ return O[0] && E[1] !== O[1];
1783
+ }), ne = o.useRef(null), z = o.useMemo(function() {
1784
+ return u && kn(g) && (y == null ? void 0 : y.size) >= g;
1785
+ }, [u, g, y == null ? void 0 : y.size]), ie = function(O) {
1786
+ O.preventDefault();
1787
+ }, j = function(O) {
1788
+ var L;
1789
+ (L = ne.current) === null || L === void 0 || L.scrollTo(typeof O == "number" ? {
1790
+ index: O
1791
+ } : O);
1792
+ }, Z = o.useCallback(function(E) {
1793
+ return d === "combobox" ? !1 : y.has(E);
1794
+ }, [d, Ye(y).toString(), y.size]), M = function(O) {
1795
+ for (var L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1, W = U.length, R = 0; R < W; R += 1) {
1796
+ var Q = (O + R * L + W) % W, ue = U[Q] || {}, se = ue.group, oe = ue.data;
1797
+ if (!se && !(oe != null && oe.disabled) && (Z(oe.value) || !z))
1798
+ return Q;
1799
+ }
1800
+ return -1;
1801
+ }, V = o.useState(function() {
1802
+ return M(0);
1803
+ }), J = re(V, 2), $ = J[0], Ee = J[1], Re = function(O) {
1804
+ var L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
1805
+ Ee(O);
1806
+ var W = {
1807
+ source: L ? "keyboard" : "mouse"
1808
+ }, R = U[O];
1809
+ if (!R) {
1810
+ S(null, -1, W);
1811
+ return;
1812
+ }
1813
+ S(R.value, O, W);
1814
+ };
1815
+ Qn(function() {
1816
+ Re(w !== !1 ? M(0) : -1);
1817
+ }, [U.length, f]);
1818
+ var G = o.useCallback(function(E) {
1819
+ return d === "combobox" ? String(E).toLowerCase() === f.toLowerCase() : y.has(E);
1820
+ }, [d, f, Ye(y).toString(), y.size]);
1821
+ Qn(function() {
1822
+ var E = setTimeout(function() {
1823
+ if (!u && l && y.size === 1) {
1824
+ var L = Array.from(y)[0], W = U.findIndex(function(R) {
1825
+ var Q = R.data;
1826
+ return Q.value === L;
1827
+ });
1828
+ W !== -1 && (Re(W), j(W));
1829
+ }
1830
+ });
1831
+ if (l) {
1832
+ var O;
1833
+ (O = ne.current) === null || O === void 0 || O.scrollTo(void 0);
1834
+ }
1835
+ return function() {
1836
+ return clearTimeout(E);
1837
+ };
1838
+ }, [l, f]);
1839
+ var he = function(O) {
1840
+ O !== void 0 && b(O, {
1841
+ selected: !y.has(O)
1842
+ }), u || v(!1);
1843
+ };
1844
+ if (o.useImperativeHandle(t, function() {
1845
+ return {
1846
+ onKeyDown: function(O) {
1847
+ var L = O.which, W = O.ctrlKey;
1848
+ switch (L) {
1849
+ case X.N:
1850
+ case X.P:
1851
+ case X.UP:
1852
+ case X.DOWN: {
1853
+ var R = 0;
1854
+ if (L === X.UP ? R = -1 : L === X.DOWN ? R = 1 : Qo() && W && (L === X.N ? R = 1 : L === X.P && (R = -1)), R !== 0) {
1855
+ var Q = M($ + R, R);
1856
+ j(Q), Re(Q, !0);
1857
+ }
1858
+ break;
1859
+ }
1860
+ case X.TAB:
1861
+ case X.ENTER: {
1862
+ var ue, se = U[$];
1863
+ se && !(se != null && (ue = se.data) !== null && ue !== void 0 && ue.disabled) && !z ? he(se.value) : he(void 0), l && O.preventDefault();
1864
+ break;
1865
+ }
1866
+ case X.ESC:
1867
+ v(!1), l && O.stopPropagation();
1868
+ }
1869
+ },
1870
+ onKeyUp: function() {
1871
+ },
1872
+ scrollTo: function(O) {
1873
+ j(O);
1874
+ }
1875
+ };
1876
+ }), U.length === 0)
1877
+ return /* @__PURE__ */ o.createElement("div", {
1878
+ role: "listbox",
1879
+ id: "".concat(i, "_list"),
1880
+ className: "".concat(K, "-empty"),
1881
+ onMouseDown: ie
1882
+ }, s);
1883
+ var $e = Object.keys(N).map(function(E) {
1884
+ return N[E];
1885
+ }), Y = function(O) {
1886
+ return O.label;
1887
+ };
1888
+ function be(E, O) {
1889
+ var L = E.group;
1890
+ return {
1891
+ role: L ? "presentation" : "option",
1892
+ id: "".concat(i, "_list_").concat(O)
1893
+ };
1894
+ }
1895
+ var we = function(O) {
1896
+ var L = U[O];
1897
+ if (!L)
1898
+ return null;
1899
+ var W = L.data || {}, R = W.value, Q = L.group, ue = Fn(W, !0), se = Y(L);
1900
+ return L ? /* @__PURE__ */ o.createElement("div", Ze({
1901
+ "aria-label": typeof se == "string" && !Q ? se : null
1902
+ }, ue, {
1903
+ key: O
1904
+ }, be(L, O), {
1905
+ "aria-selected": G(R)
1906
+ }), R) : null;
1907
+ }, le = {
1908
+ role: "listbox",
1909
+ id: "".concat(i, "_list")
1910
+ };
1911
+ return /* @__PURE__ */ o.createElement(o.Fragment, null, p && /* @__PURE__ */ o.createElement("div", Ze({}, le, {
1912
+ style: {
1913
+ height: 0,
1914
+ width: 0,
1915
+ overflow: "hidden"
1916
+ }
1917
+ }), we($ - 1), we($), we($ + 1)), /* @__PURE__ */ o.createElement(Jt, {
1918
+ itemKey: "key",
1919
+ ref: ne,
1920
+ data: U,
1921
+ height: _,
1922
+ itemHeight: F,
1923
+ fullHeight: !1,
1924
+ onMouseDown: ie,
1925
+ onScroll: h,
1926
+ virtual: p,
1927
+ direction: C,
1928
+ innerProps: p ? null : le
1929
+ }, function(E, O) {
1930
+ var L = E.group, W = E.groupOption, R = E.data, Q = E.label, ue = E.value, se = R.key;
1931
+ if (L) {
1932
+ var oe, ve = (oe = R.title) !== null && oe !== void 0 ? oe : _t(Q) ? Q.toString() : void 0;
1933
+ return /* @__PURE__ */ o.createElement("div", {
1934
+ className: Le(K, "".concat(K, "-group"), R.className),
1935
+ title: ve
1936
+ }, Q !== void 0 ? Q : se);
1937
+ }
1938
+ var De = R.disabled, He = R.title;
1939
+ R.children;
1940
+ var Ve = R.style, me = R.className, qe = In(R, Zo), Me = At(qe, $e), ge = Z(ue), ye = De || !ge && z, Ie = "".concat(K, "-option"), Te = Le(K, Ie, me, ae(ae(ae(ae({}, "".concat(Ie, "-grouped"), W), "".concat(Ie, "-active"), $ === O && !ye), "".concat(Ie, "-disabled"), ye), "".concat(Ie, "-selected"), ge)), Ae = Y(E), Je = !x || typeof x == "function" || ge, xe = typeof Ae == "number" ? Ae : Ae || ue, We = _t(xe) ? xe.toString() : void 0;
1941
+ return He !== void 0 && (We = He), /* @__PURE__ */ o.createElement("div", Ze({}, Fn(Me), p ? {} : be(E, O), {
1942
+ "aria-selected": G(ue),
1943
+ className: Te,
1944
+ title: We,
1945
+ onMouseMove: function() {
1946
+ $ === O || ye || Re(O);
1947
+ },
1948
+ onClick: function() {
1949
+ ye || he(ue);
1950
+ },
1951
+ style: Ve
1952
+ }), /* @__PURE__ */ o.createElement("div", {
1953
+ className: "".concat(Ie, "-content")
1954
+ }, typeof A == "function" ? A(E, {
1955
+ index: O
1956
+ }) : xe), /* @__PURE__ */ o.isValidElement(x) || ge, Je && /* @__PURE__ */ o.createElement(Wn, {
1957
+ className: "".concat(K, "-option-state"),
1958
+ customizeIcon: x,
1959
+ customizeIconProps: {
1960
+ value: ue,
1961
+ disabled: ye,
1962
+ isSelected: ge
1963
+ }
1964
+ }, ge ? "✓" : null));
1965
+ }));
1966
+ }, kt = /* @__PURE__ */ o.forwardRef(Jo);
1967
+ process.env.NODE_ENV !== "production" && (kt.displayName = "OptionList");
1968
+ const ko = function(e, n) {
1969
+ var t = o.useRef({
1970
+ values: /* @__PURE__ */ new Map(),
1971
+ options: /* @__PURE__ */ new Map()
1972
+ }), r = o.useMemo(function() {
1973
+ var i = t.current, l = i.values, u = i.options, d = e.map(function(s) {
1974
+ if (s.label === void 0) {
1975
+ var h;
1976
+ return ee(ee({}, s), {}, {
1977
+ label: (h = l.get(s.value)) === null || h === void 0 ? void 0 : h.label
1978
+ });
1979
+ }
1980
+ return s;
1981
+ }), f = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
1982
+ return d.forEach(function(s) {
1983
+ f.set(s.value, s), v.set(s.value, n.get(s.value) || u.get(s.value));
1984
+ }), t.current.values = f, t.current.options = v, d;
1985
+ }, [e, n]), a = o.useCallback(function(i) {
1986
+ return n.get(i) || t.current.options.get(i);
1987
+ }, [n]);
1988
+ return [r, a];
1989
+ };
1990
+ function Gn(e, n) {
1991
+ return ct(e).join("").toUpperCase().includes(n);
1992
+ }
1993
+ const ea = function(e, n, t, r, a) {
1994
+ return o.useMemo(function() {
1995
+ if (!t || r === !1)
1996
+ return e;
1997
+ var i = n.options, l = n.label, u = n.value, d = [], f = typeof r == "function", v = t.toUpperCase(), s = f ? r : function(c, g) {
1998
+ return a ? Gn(g[a], v) : g[i] ? Gn(g[l !== "children" ? l : "label"], v) : Gn(g[u], v);
1999
+ }, h = f ? function(c) {
2000
+ return et(c);
2001
+ } : function(c) {
2002
+ return c;
2003
+ };
2004
+ return e.forEach(function(c) {
2005
+ if (c[i]) {
2006
+ var g = s(t, h(c));
2007
+ if (g)
2008
+ d.push(c);
2009
+ else {
2010
+ var m = c[i].filter(function(S) {
2011
+ return s(t, h(S));
2012
+ });
2013
+ m.length && d.push(ee(ee({}, c), {}, ae({}, i, m)));
2014
+ }
2015
+ return;
2016
+ }
2017
+ s(t, h(c)) && d.push(c);
2018
+ }), d;
2019
+ }, [e, r, a, t, n]);
2020
+ };
2021
+ var Tt = 0, na = process.env.NODE_ENV !== "test" && Rr();
2022
+ function ta() {
2023
+ var e;
2024
+ return na ? (e = Tt, Tt += 1) : e = "TEST_OR_SSR", e;
2025
+ }
2026
+ function ra(e) {
2027
+ var n = o.useState(), t = re(n, 2), r = t[0], a = t[1];
2028
+ return o.useEffect(function() {
2029
+ a("rc_select_".concat(ta()));
2030
+ }, []), e || r;
2031
+ }
2032
+ var oa = ["children", "value"], aa = ["children"];
2033
+ function ia(e) {
2034
+ var n = e, t = n.key, r = n.props, a = r.children, i = r.value, l = In(r, oa);
2035
+ return ee({
2036
+ key: t,
2037
+ value: i !== void 0 ? i : t,
2038
+ children: a
2039
+ }, l);
2040
+ }
2041
+ function mt(e) {
2042
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
2043
+ return Jn(e).map(function(t, r) {
2044
+ if (!/* @__PURE__ */ o.isValidElement(t) || !t.type)
2045
+ return null;
2046
+ var a = t, i = a.type.isSelectOptGroup, l = a.key, u = a.props, d = u.children, f = In(u, aa);
2047
+ return n || !i ? ia(t) : ee(ee({
2048
+ key: "__RC_SELECT_GRP__".concat(l === null ? r : l, "__"),
2049
+ label: l
2050
+ }, f), {}, {
2051
+ options: mt(d)
2052
+ });
2053
+ }).filter(function(t) {
2054
+ return t;
2055
+ });
2056
+ }
2057
+ var la = function(n, t, r, a, i) {
2058
+ return o.useMemo(function() {
2059
+ var l = n, u = !n;
2060
+ u && (l = mt(t));
2061
+ var d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), v = function(c, g, m) {
2062
+ m && typeof m == "string" && c.set(g[m], g);
2063
+ }, s = function h(c) {
2064
+ for (var g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, m = 0; m < c.length; m += 1) {
2065
+ var S = c[m];
2066
+ !S[r.options] || g ? (d.set(S[r.value], S), v(f, S, r.label), v(f, S, a), v(f, S, i)) : h(S[r.options], !0);
2067
+ }
2068
+ };
2069
+ return s(l), {
2070
+ options: l,
2071
+ valueOptions: d,
2072
+ labelOptions: f
2073
+ };
2074
+ }, [n, t, r, a, i]);
2075
+ };
2076
+ function zt(e) {
2077
+ var n = o.useRef();
2078
+ n.current = e;
2079
+ var t = o.useCallback(function() {
2080
+ return n.current.apply(n, arguments);
2081
+ }, []);
2082
+ return t;
2083
+ }
2084
+ function ua(e) {
2085
+ var n = e.mode, t = e.options, r = e.children, a = e.backfill, i = e.allowClear, l = e.placeholder, u = e.getInputElement, d = e.showSearch, f = e.onSearch, v = e.defaultOpen, s = e.autoFocus, h = e.labelInValue, c = e.value, g = e.inputValue, m = e.optionLabelProp, S = An(n), w = d !== void 0 ? d : S || n === "combobox", b = t || mt(r);
2086
+ if (Ue(n !== "tags" || b.every(function(p) {
2087
+ return !p.disabled;
2088
+ }), "Please avoid setting option to disabled in tags mode since user can always type text as tag."), n === "tags" || n === "combobox") {
2089
+ var x = b.some(function(p) {
2090
+ return p.options ? p.options.some(function(C) {
2091
+ return typeof ("value" in C ? C.value : C.key) == "number";
2092
+ }) : typeof ("value" in p ? p.value : p.key) == "number";
2093
+ });
2094
+ Ue(!x, "`value` of Option should not use number type when `mode` is `tags` or `combobox`.");
2095
+ }
2096
+ if (Ue(n !== "combobox" || !m, "`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."), Ue(n === "combobox" || !a, "`backfill` only works with `combobox` mode."), Ue(n === "combobox" || !u, "`getInputElement` only work with `combobox` mode."), wt(n !== "combobox" || !u || !i || !l, "Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."), f && !w && n !== "combobox" && n !== "tags" && Ue(!1, "`onSearch` should work with `showSearch` instead of use alone."), wt(!v || s, "`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."), c != null) {
2097
+ var y = ct(c);
2098
+ Ue(!h || y.every(function(p) {
2099
+ return pn(p) === "object" && ("key" in p || "value" in p);
2100
+ }), "`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"), Ue(!S || Array.isArray(c), "`value` should be array when `mode` is `multiple` or `tags`");
2101
+ }
2102
+ if (r) {
2103
+ var N = null;
2104
+ Jn(r).some(function(p) {
2105
+ if (!/* @__PURE__ */ o.isValidElement(p) || !p.type)
2106
+ return !1;
2107
+ var C = p, _ = C.type;
2108
+ if (_.isSelectOption)
2109
+ return !1;
2110
+ if (_.isSelectOptGroup) {
2111
+ var F = Jn(p.props.children).every(function(A) {
2112
+ return !/* @__PURE__ */ o.isValidElement(A) || !p.type || A.type.isSelectOption ? !0 : (N = A.type, !1);
2113
+ });
2114
+ return !F;
2115
+ }
2116
+ return N = _, !0;
2117
+ }), N && Ue(!1, "`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(N.displayName || N.name || N, "`.")), Ue(g === void 0, "`inputValue` is deprecated, please use `searchValue` instead.");
2118
+ }
2119
+ }
2120
+ function ca(e, n) {
2121
+ if (e) {
2122
+ var t = function r(a) {
2123
+ for (var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1, l = 0; l < a.length; l++) {
2124
+ var u = a[l];
2125
+ if (u[n == null ? void 0 : n.value] === null)
2126
+ return Ue(!1, "`value` in Select options should not be `null`."), !0;
2127
+ if (!i && Array.isArray(u[n == null ? void 0 : n.options]) && r(u[n == null ? void 0 : n.options], !0))
2128
+ break;
2129
+ }
2130
+ };
2131
+ t(e);
2132
+ }
2133
+ }
2134
+ var sa = ["id", "mode", "prefixCls", "backfill", "fieldNames", "inputValue", "searchValue", "onSearch", "autoClearSearchValue", "onSelect", "onDeselect", "dropdownMatchSelectWidth", "filterOption", "filterSort", "optionFilterProp", "optionLabelProp", "options", "optionRender", "children", "defaultActiveFirstOption", "menuItemSelectedIcon", "virtual", "direction", "listHeight", "listItemHeight", "labelRender", "value", "defaultValue", "labelInValue", "onChange", "maxCount"], da = ["inputValue"];
2135
+ function fa(e) {
2136
+ return !e || pn(e) !== "object";
2137
+ }
2138
+ var er = /* @__PURE__ */ o.forwardRef(function(e, n) {
2139
+ var t = e.id, r = e.mode, a = e.prefixCls, i = a === void 0 ? "rc-select" : a, l = e.backfill, u = e.fieldNames, d = e.inputValue, f = e.searchValue, v = e.onSearch, s = e.autoClearSearchValue, h = s === void 0 ? !0 : s, c = e.onSelect, g = e.onDeselect, m = e.dropdownMatchSelectWidth, S = m === void 0 ? !0 : m, w = e.filterOption, b = e.filterSort, x = e.optionFilterProp, y = e.optionLabelProp, N = e.options, p = e.optionRender, C = e.children, _ = e.defaultActiveFirstOption, F = e.menuItemSelectedIcon, A = e.virtual, K = e.direction, U = e.listHeight, ne = U === void 0 ? 200 : U, z = e.listItemHeight, ie = z === void 0 ? 20 : z, j = e.labelRender, Z = e.value, M = e.defaultValue, V = e.labelInValue, J = e.onChange, $ = e.maxCount, Ee = In(e, sa), Re = ra(t), G = An(r), he = !!(!N && C), $e = o.useMemo(function() {
2140
+ return w === void 0 && r === "combobox" ? !1 : w;
2141
+ }, [w, r]), Y = o.useMemo(
2142
+ function() {
2143
+ return Yt(u, he);
2144
+ },
2145
+ /* eslint-disable react-hooks/exhaustive-deps */
2146
+ [
2147
+ // We stringify fieldNames to avoid unnecessary re-renders.
2148
+ JSON.stringify(u),
2149
+ he
2150
+ ]
2151
+ /* eslint-enable react-hooks/exhaustive-deps */
2152
+ ), be = Bn("", {
2153
+ value: f !== void 0 ? f : d,
2154
+ postState: function(B) {
2155
+ return B || "";
2156
+ }
2157
+ }), we = re(be, 2), le = we[0], E = we[1], O = la(N, C, Y, x, y), L = O.valueOptions, W = O.labelOptions, R = O.options, Q = o.useCallback(function(P) {
2158
+ var B = ct(P);
2159
+ return B.map(function(T) {
2160
+ var H, te, de, Qe, Ge;
2161
+ if (fa(T))
2162
+ H = T;
2163
+ else {
2164
+ var ke;
2165
+ de = T.key, te = T.label, H = (ke = T.value) !== null && ke !== void 0 ? ke : de;
2166
+ }
2167
+ var Oe = L.get(H);
2168
+ if (Oe) {
2169
+ var tn;
2170
+ if (te === void 0 && (te = Oe == null ? void 0 : Oe[y || Y.label]), de === void 0 && (de = (tn = Oe == null ? void 0 : Oe.key) !== null && tn !== void 0 ? tn : H), Qe = Oe == null ? void 0 : Oe.disabled, Ge = Oe == null ? void 0 : Oe.title, process.env.NODE_ENV !== "production" && !y) {
2171
+ var en = Oe == null ? void 0 : Oe[Y.label];
2172
+ en !== void 0 && !/* @__PURE__ */ o.isValidElement(en) && !/* @__PURE__ */ o.isValidElement(te) && en !== te && Ue(!1, "`label` of `value` is not same as `label` in Select options.");
2173
+ }
2174
+ }
2175
+ return {
2176
+ label: te,
2177
+ value: H,
2178
+ key: de,
2179
+ disabled: Qe,
2180
+ title: Ge
2181
+ };
2182
+ });
2183
+ }, [Y, y, L]), ue = Bn(M, {
2184
+ value: Z
2185
+ }), se = re(ue, 2), oe = se[0], ve = se[1], De = o.useMemo(function() {
2186
+ var P, B = G && oe === null ? [] : oe, T = Q(B);
2187
+ return r === "combobox" && wo((P = T[0]) === null || P === void 0 ? void 0 : P.value) ? [] : T;
2188
+ }, [oe, Q, r, G]), He = ko(De, L), Ve = re(He, 2), me = Ve[0], qe = Ve[1], Me = o.useMemo(function() {
2189
+ if (!r && me.length === 1) {
2190
+ var P = me[0];
2191
+ if (P.value === null && (P.label === null || P.label === void 0))
2192
+ return [];
2193
+ }
2194
+ return me.map(function(B) {
2195
+ var T;
2196
+ return ee(ee({}, B), {}, {
2197
+ label: (T = typeof j == "function" ? j(B) : B.label) !== null && T !== void 0 ? T : B.value
2198
+ });
2199
+ });
2200
+ }, [r, me, j]), ge = o.useMemo(function() {
2201
+ return new Set(me.map(function(P) {
2202
+ return P.value;
2203
+ }));
2204
+ }, [me]);
2205
+ o.useEffect(function() {
2206
+ if (r === "combobox") {
2207
+ var P, B = (P = me[0]) === null || P === void 0 ? void 0 : P.value;
2208
+ E(So(B) ? String(B) : "");
2209
+ }
2210
+ }, [me]);
2211
+ var ye = zt(function(P, B) {
2212
+ var T = B ?? P;
2213
+ return ae(ae({}, Y.value, P), Y.label, T);
2214
+ }), Ie = o.useMemo(function() {
2215
+ if (r !== "tags")
2216
+ return R;
2217
+ var P = Ye(R), B = function(H) {
2218
+ return L.has(H);
2219
+ };
2220
+ return Ye(me).sort(function(T, H) {
2221
+ return T.value < H.value ? -1 : 1;
2222
+ }).forEach(function(T) {
2223
+ var H = T.value;
2224
+ B(H) || P.push(ye(H, T.label));
2225
+ }), P;
2226
+ }, [ye, R, L, me, r]), Te = ea(Ie, Y, le, $e, x), Ae = o.useMemo(function() {
2227
+ return r !== "tags" || !le || Te.some(function(P) {
2228
+ return P[x || "value"] === le;
2229
+ }) || Te.some(function(P) {
2230
+ return P[Y.value] === le;
2231
+ }) ? Te : [ye(le)].concat(Ye(Te));
2232
+ }, [ye, x, r, Te, le, Y]), Je = function P(B) {
2233
+ var T = Ye(B).sort(function(H, te) {
2234
+ return b(H, te, {
2235
+ searchValue: le
2236
+ });
2237
+ });
2238
+ return T.map(function(H) {
2239
+ return Array.isArray(H.options) ? ee(ee({}, H), {}, {
2240
+ options: H.options.length > 0 ? P(H.options) : H.options
2241
+ }) : H;
2242
+ });
2243
+ }, xe = o.useMemo(function() {
2244
+ return b ? Je(Ae) : Ae;
2245
+ }, [Ae, b, le]), We = o.useMemo(function() {
2246
+ return Mo(xe, {
2247
+ fieldNames: Y,
2248
+ childrenAsData: he
2249
+ });
2250
+ }, [xe, Y, he]), je = function(B) {
2251
+ var T = Q(B);
2252
+ if (ve(T), J && // Trigger event only when value changed
2253
+ (T.length !== me.length || T.some(function(de, Qe) {
2254
+ var Ge;
2255
+ return ((Ge = me[Qe]) === null || Ge === void 0 ? void 0 : Ge.value) !== (de == null ? void 0 : de.value);
2256
+ }))) {
2257
+ var H = V ? T : T.map(function(de) {
2258
+ return de.value;
2259
+ }), te = T.map(function(de) {
2260
+ return et(qe(de.value));
2261
+ });
2262
+ J(
2263
+ // Value
2264
+ G ? H : H[0],
2265
+ // Option
2266
+ G ? te : te[0]
2267
+ );
2268
+ }
2269
+ }, fn = o.useState(null), Be = re(fn, 2), ze = Be[0], Ne = Be[1], bn = o.useState(0), mn = re(bn, 2), On = mn[0], vn = mn[1], an = _ !== void 0 ? _ : r !== "combobox", Sn = o.useCallback(function(P, B) {
2270
+ var T = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, H = T.source, te = H === void 0 ? "keyboard" : H;
2271
+ vn(B), l && r === "combobox" && P !== null && te === "keyboard" && Ne(String(P));
2272
+ }, [l, r]), nn = function(B, T, H) {
2273
+ var te = function() {
2274
+ var D, I = qe(B);
2275
+ return [V ? {
2276
+ label: I == null ? void 0 : I[Y.label],
2277
+ value: B,
2278
+ key: (D = I == null ? void 0 : I.key) !== null && D !== void 0 ? D : B
2279
+ } : B, et(I)];
2280
+ };
2281
+ if (T && c) {
2282
+ var de = te(), Qe = re(de, 2), Ge = Qe[0], ke = Qe[1];
2283
+ c(Ge, ke);
2284
+ } else if (!T && g && H !== "clear") {
2285
+ var Oe = te(), tn = re(Oe, 2), en = tn[0], sn = tn[1];
2286
+ g(en, sn);
2287
+ }
2288
+ }, wn = zt(function(P, B) {
2289
+ var T, H = G ? B.selected : !0;
2290
+ H ? T = G ? [].concat(Ye(me), [P]) : [P] : T = me.filter(function(te) {
2291
+ return te.value !== P;
2292
+ }), je(T), nn(P, H), r === "combobox" ? Ne("") : (!An || h) && (E(""), Ne(""));
2293
+ }), ln = function(B, T) {
2294
+ je(B);
2295
+ var H = T.type, te = T.values;
2296
+ (H === "remove" || H === "clear") && te.forEach(function(de) {
2297
+ nn(de.value, !1, H);
2298
+ });
2299
+ }, Ce = function(B, T) {
2300
+ if (E(B), Ne(null), T.source === "submit") {
2301
+ var H = (B || "").trim();
2302
+ if (H) {
2303
+ var te = Array.from(new Set([].concat(Ye(ge), [H])));
2304
+ je(te), nn(H, !0), E("");
2305
+ }
2306
+ return;
2307
+ }
2308
+ T.source !== "blur" && (r === "combobox" && je(B), v == null || v(B));
2309
+ }, un = function(B) {
2310
+ var T = B;
2311
+ r !== "tags" && (T = B.map(function(te) {
2312
+ var de = W.get(te);
2313
+ return de == null ? void 0 : de.value;
2314
+ }).filter(function(te) {
2315
+ return te !== void 0;
2316
+ }));
2317
+ var H = Array.from(new Set([].concat(Ye(ge), Ye(T))));
2318
+ je(H), H.forEach(function(te) {
2319
+ nn(te, !0);
2320
+ });
2321
+ }, cn = o.useMemo(function() {
2322
+ var P = A !== !1 && S !== !1;
2323
+ return ee(ee({}, O), {}, {
2324
+ flattenOptions: We,
2325
+ onActiveValue: Sn,
2326
+ defaultActiveFirstOption: an,
2327
+ onSelect: wn,
2328
+ menuItemSelectedIcon: F,
2329
+ rawValues: ge,
2330
+ fieldNames: Y,
2331
+ virtual: P,
2332
+ direction: K,
2333
+ listHeight: ne,
2334
+ listItemHeight: ie,
2335
+ childrenAsData: he,
2336
+ maxCount: $,
2337
+ optionRender: p
2338
+ });
2339
+ }, [$, O, We, Sn, an, wn, F, ge, Y, A, S, K, ne, ie, he, p]);
2340
+ return process.env.NODE_ENV !== "production" && (ua(e), ca(R, Y)), /* @__PURE__ */ o.createElement(st.Provider, {
2341
+ value: cn
2342
+ }, /* @__PURE__ */ o.createElement(qt, Ze({}, Ee, {
2343
+ // >>> MISC
2344
+ id: Re,
2345
+ prefixCls: i,
2346
+ ref: n,
2347
+ omitDomProps: da,
2348
+ mode: r,
2349
+ displayValues: Me,
2350
+ onDisplayValuesChange: ln,
2351
+ direction: K,
2352
+ searchValue: le,
2353
+ onSearch: Ce,
2354
+ autoClearSearchValue: h,
2355
+ onSearchSplit: un,
2356
+ dropdownMatchSelectWidth: S,
2357
+ OptionList: kt,
2358
+ emptyOptions: !We.length,
2359
+ activeValue: ze,
2360
+ activeDescendantId: "".concat(Re, "_list_").concat(On)
2361
+ })));
2362
+ });
2363
+ process.env.NODE_ENV !== "production" && (er.displayName = "Select");
2364
+ var vt = er;
2365
+ vt.Option = ft;
2366
+ vt.OptGroup = dt;
2367
+ const nr = () => {
2368
+ const [, e] = ot(), [n] = lt("Empty"), r = new Vn(e.colorBgBase).toHsl().l < 0.5 ? {
2369
+ opacity: 0.65
2370
+ } : {};
2371
+ return /* @__PURE__ */ o.createElement("svg", {
2372
+ style: r,
2373
+ width: "184",
2374
+ height: "152",
2375
+ viewBox: "0 0 184 152",
2376
+ xmlns: "http://www.w3.org/2000/svg"
2377
+ }, /* @__PURE__ */ o.createElement("title", null, (n == null ? void 0 : n.description) || "Empty"), /* @__PURE__ */ o.createElement("g", {
2378
+ fill: "none",
2379
+ fillRule: "evenodd"
2380
+ }, /* @__PURE__ */ o.createElement("g", {
2381
+ transform: "translate(24 31.67)"
2382
+ }, /* @__PURE__ */ o.createElement("ellipse", {
2383
+ fillOpacity: ".8",
2384
+ fill: "#F5F5F7",
2385
+ cx: "67.797",
2386
+ cy: "106.89",
2387
+ rx: "67.797",
2388
+ ry: "12.668"
2389
+ }), /* @__PURE__ */ o.createElement("path", {
2390
+ d: "M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z",
2391
+ fill: "#AEB8C2"
2392
+ }), /* @__PURE__ */ o.createElement("path", {
2393
+ d: "M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",
2394
+ fill: "url(#linearGradient-1)",
2395
+ transform: "translate(13.56)"
2396
+ }), /* @__PURE__ */ o.createElement("path", {
2397
+ d: "M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z",
2398
+ fill: "#F5F5F7"
2399
+ }), /* @__PURE__ */ o.createElement("path", {
2400
+ d: "M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z",
2401
+ fill: "#DCE0E6"
2402
+ })), /* @__PURE__ */ o.createElement("path", {
2403
+ d: "M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z",
2404
+ fill: "#DCE0E6"
2405
+ }), /* @__PURE__ */ o.createElement("g", {
2406
+ transform: "translate(149.65 15.383)",
2407
+ fill: "#FFF"
2408
+ }, /* @__PURE__ */ o.createElement("ellipse", {
2409
+ cx: "20.654",
2410
+ cy: "3.167",
2411
+ rx: "2.849",
2412
+ ry: "2.815"
2413
+ }), /* @__PURE__ */ o.createElement("path", {
2414
+ d: "M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"
2415
+ }))));
2416
+ };
2417
+ process.env.NODE_ENV !== "production" && (nr.displayName = "EmptyImage");
2418
+ const tr = () => {
2419
+ const [, e] = ot(), [n] = lt("Empty"), {
2420
+ colorFill: t,
2421
+ colorFillTertiary: r,
2422
+ colorFillQuaternary: a,
2423
+ colorBgContainer: i
2424
+ } = e, {
2425
+ borderColor: l,
2426
+ shadowColor: u,
2427
+ contentColor: d
2428
+ } = pr(() => ({
2429
+ borderColor: new Vn(t).onBackground(i).toHexString(),
2430
+ shadowColor: new Vn(r).onBackground(i).toHexString(),
2431
+ contentColor: new Vn(a).onBackground(i).toHexString()
2432
+ }), [t, r, a, i]);
2433
+ return /* @__PURE__ */ o.createElement("svg", {
2434
+ width: "64",
2435
+ height: "41",
2436
+ viewBox: "0 0 64 41",
2437
+ xmlns: "http://www.w3.org/2000/svg"
2438
+ }, /* @__PURE__ */ o.createElement("title", null, (n == null ? void 0 : n.description) || "Empty"), /* @__PURE__ */ o.createElement("g", {
2439
+ transform: "translate(0 1)",
2440
+ fill: "none",
2441
+ fillRule: "evenodd"
2442
+ }, /* @__PURE__ */ o.createElement("ellipse", {
2443
+ fill: u,
2444
+ cx: "32",
2445
+ cy: "33",
2446
+ rx: "32",
2447
+ ry: "7"
2448
+ }), /* @__PURE__ */ o.createElement("g", {
2449
+ fillRule: "nonzero",
2450
+ stroke: l
2451
+ }, /* @__PURE__ */ o.createElement("path", {
2452
+ d: "M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"
2453
+ }), /* @__PURE__ */ o.createElement("path", {
2454
+ d: "M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",
2455
+ fill: d
2456
+ }))));
2457
+ };
2458
+ process.env.NODE_ENV !== "production" && (tr.displayName = "SimpleImage");
2459
+ const ma = (e) => {
2460
+ const {
2461
+ componentCls: n,
2462
+ margin: t,
2463
+ marginXS: r,
2464
+ marginXL: a,
2465
+ fontSize: i,
2466
+ lineHeight: l
2467
+ } = e;
2468
+ return {
2469
+ [n]: {
2470
+ marginInline: r,
2471
+ fontSize: i,
2472
+ lineHeight: l,
2473
+ textAlign: "center",
2474
+ // 原来 &-image 没有父子结构,现在为了外层承担我们的 hashId,改成父子结构
2475
+ [`${n}-image`]: {
2476
+ height: e.emptyImgHeight,
2477
+ marginBottom: r,
2478
+ opacity: e.opacityImage,
2479
+ img: {
2480
+ height: "100%"
2481
+ },
2482
+ svg: {
2483
+ maxWidth: "100%",
2484
+ height: "100%",
2485
+ margin: "auto"
2486
+ }
2487
+ },
2488
+ [`${n}-description`]: {
2489
+ color: e.colorTextDescription
2490
+ },
2491
+ // 原来 &-footer 没有父子结构,现在为了外层承担我们的 hashId,改成父子结构
2492
+ [`${n}-footer`]: {
2493
+ marginTop: t
2494
+ },
2495
+ "&-normal": {
2496
+ marginBlock: a,
2497
+ color: e.colorTextDescription,
2498
+ [`${n}-description`]: {
2499
+ color: e.colorTextDescription
2500
+ },
2501
+ [`${n}-image`]: {
2502
+ height: e.emptyImgHeightMD
2503
+ }
2504
+ },
2505
+ "&-small": {
2506
+ marginBlock: r,
2507
+ color: e.colorTextDescription,
2508
+ [`${n}-image`]: {
2509
+ height: e.emptyImgHeightSM
2510
+ }
2511
+ }
2512
+ }
2513
+ };
2514
+ }, va = Bt("Empty", (e) => {
2515
+ const {
2516
+ componentCls: n,
2517
+ controlHeightLG: t,
2518
+ calc: r
2519
+ } = e, a = Pn(e, {
2520
+ emptyImgCls: `${n}-img`,
2521
+ emptyImgHeight: r(t).mul(2.5).equal(),
2522
+ emptyImgHeightMD: t,
2523
+ emptyImgHeightSM: r(t).mul(0.875).equal()
2524
+ });
2525
+ return [ma(a)];
2526
+ });
2527
+ var ga = function(e, n) {
2528
+ var t = {};
2529
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
2530
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
2531
+ n.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (t[r[a]] = e[r[a]]);
2532
+ return t;
2533
+ };
2534
+ const rr = /* @__PURE__ */ o.createElement(nr, null), or = /* @__PURE__ */ o.createElement(tr, null), gn = (e) => {
2535
+ var n, t, r, a, i, l, u, d;
2536
+ const {
2537
+ className: f,
2538
+ rootClassName: v,
2539
+ prefixCls: s,
2540
+ image: h = rr,
2541
+ description: c,
2542
+ children: g,
2543
+ imageStyle: m,
2544
+ style: S,
2545
+ classNames: w,
2546
+ styles: b
2547
+ } = e, x = ga(e, ["className", "rootClassName", "prefixCls", "image", "description", "children", "imageStyle", "style", "classNames", "styles"]), {
2548
+ getPrefixCls: y,
2549
+ direction: N,
2550
+ empty: p
2551
+ } = o.useContext(jn), C = y("empty", s), [_, F, A] = va(C), [K] = lt("Empty"), U = typeof c < "u" ? c : K == null ? void 0 : K.description, ne = typeof U == "string" ? U : "empty";
2552
+ let z = null;
2553
+ if (typeof h == "string" ? z = /* @__PURE__ */ o.createElement("img", {
2554
+ alt: ne,
2555
+ src: h
2556
+ }) : z = h, process.env.NODE_ENV !== "production") {
2557
+ const ie = at("Empty");
2558
+ [["imageStyle", "styles: { image: {} }"]].forEach((j) => {
2559
+ let [Z, M] = j;
2560
+ ie.deprecated(!(Z in e), Z, M);
2561
+ });
2562
+ }
2563
+ return _(/* @__PURE__ */ o.createElement("div", Object.assign({
2564
+ className: Le(F, A, C, p == null ? void 0 : p.className, {
2565
+ [`${C}-normal`]: h === or,
2566
+ [`${C}-rtl`]: N === "rtl"
2567
+ }, f, v, (n = p == null ? void 0 : p.classNames) === null || n === void 0 ? void 0 : n.root, w == null ? void 0 : w.root),
2568
+ style: Object.assign(Object.assign(Object.assign(Object.assign({}, (t = p == null ? void 0 : p.styles) === null || t === void 0 ? void 0 : t.root), p == null ? void 0 : p.style), b == null ? void 0 : b.root), S)
2569
+ }, x), /* @__PURE__ */ o.createElement("div", {
2570
+ className: Le(`${C}-image`, (r = p == null ? void 0 : p.classNames) === null || r === void 0 ? void 0 : r.image, w == null ? void 0 : w.image),
2571
+ style: Object.assign(Object.assign(Object.assign({}, m), (a = p == null ? void 0 : p.styles) === null || a === void 0 ? void 0 : a.image), b == null ? void 0 : b.image)
2572
+ }, z), U && /* @__PURE__ */ o.createElement("div", {
2573
+ className: Le(`${C}-description`, (i = p == null ? void 0 : p.classNames) === null || i === void 0 ? void 0 : i.description, w == null ? void 0 : w.description),
2574
+ style: Object.assign(Object.assign({}, (l = p == null ? void 0 : p.styles) === null || l === void 0 ? void 0 : l.description), b == null ? void 0 : b.description)
2575
+ }, U), g && /* @__PURE__ */ o.createElement("div", {
2576
+ className: Le(`${C}-footer`, (u = p == null ? void 0 : p.classNames) === null || u === void 0 ? void 0 : u.footer, w == null ? void 0 : w.footer),
2577
+ style: Object.assign(Object.assign({}, (d = p == null ? void 0 : p.styles) === null || d === void 0 ? void 0 : d.footer), b == null ? void 0 : b.footer)
2578
+ }, g)));
2579
+ };
2580
+ gn.PRESENTED_IMAGE_DEFAULT = rr;
2581
+ gn.PRESENTED_IMAGE_SIMPLE = or;
2582
+ process.env.NODE_ENV !== "production" && (gn.displayName = "Empty");
2583
+ const pa = (e) => {
2584
+ const {
2585
+ componentName: n
2586
+ } = e, {
2587
+ getPrefixCls: t
2588
+ } = hr(jn), r = t("empty");
2589
+ switch (n) {
2590
+ case "Table":
2591
+ case "List":
2592
+ return /* @__PURE__ */ Dn.createElement(gn, {
2593
+ image: gn.PRESENTED_IMAGE_SIMPLE
2594
+ });
2595
+ case "Select":
2596
+ case "TreeSelect":
2597
+ case "Cascader":
2598
+ case "Transfer":
2599
+ case "Mentions":
2600
+ return /* @__PURE__ */ Dn.createElement(gn, {
2601
+ image: gn.PRESENTED_IMAGE_SIMPLE,
2602
+ className: `${r}-small`
2603
+ });
2604
+ case "Table.filter":
2605
+ return null;
2606
+ default:
2607
+ return /* @__PURE__ */ Dn.createElement(gn, null);
2608
+ }
2609
+ }, ha = (e) => {
2610
+ const t = {
2611
+ overflow: {
2612
+ adjustX: !0,
2613
+ adjustY: !0,
2614
+ shiftY: !0
2615
+ },
2616
+ htmlRegion: e === "scroll" ? "scroll" : "visible",
2617
+ dynamicInset: !0
2618
+ };
2619
+ return {
2620
+ bottomLeft: Object.assign(Object.assign({}, t), {
2621
+ points: ["tl", "bl"],
2622
+ offset: [0, 4]
2623
+ }),
2624
+ bottomRight: Object.assign(Object.assign({}, t), {
2625
+ points: ["tr", "br"],
2626
+ offset: [0, 4]
2627
+ }),
2628
+ topLeft: Object.assign(Object.assign({}, t), {
2629
+ points: ["bl", "tl"],
2630
+ offset: [0, -4]
2631
+ }),
2632
+ topRight: Object.assign(Object.assign({}, t), {
2633
+ points: ["br", "tr"],
2634
+ offset: [0, -4]
2635
+ })
2636
+ };
2637
+ };
2638
+ function ba(e, n) {
2639
+ return e || ha(n);
2640
+ }
2641
+ const Lt = (e) => {
2642
+ const {
2643
+ optionHeight: n,
2644
+ optionFontSize: t,
2645
+ optionLineHeight: r,
2646
+ optionPadding: a
2647
+ } = e;
2648
+ return {
2649
+ position: "relative",
2650
+ display: "block",
2651
+ minHeight: n,
2652
+ padding: a,
2653
+ color: e.colorText,
2654
+ fontWeight: "normal",
2655
+ fontSize: t,
2656
+ lineHeight: r,
2657
+ boxSizing: "border-box"
2658
+ };
2659
+ }, Sa = (e) => {
2660
+ const {
2661
+ antCls: n,
2662
+ componentCls: t
2663
+ } = e, r = `${t}-item`, a = `&${n}-slide-up-enter${n}-slide-up-enter-active`, i = `&${n}-slide-up-appear${n}-slide-up-appear-active`, l = `&${n}-slide-up-leave${n}-slide-up-leave-active`, u = `${t}-dropdown-placement-`, d = `${r}-option-selected`;
2664
+ return [
2665
+ {
2666
+ [`${t}-dropdown`]: Object.assign(Object.assign({}, it(e)), {
2667
+ position: "absolute",
2668
+ top: -9999,
2669
+ zIndex: e.zIndexPopup,
2670
+ boxSizing: "border-box",
2671
+ padding: e.paddingXXS,
2672
+ overflow: "hidden",
2673
+ fontSize: e.fontSize,
2674
+ // Fix select render lag of long text in chrome
2675
+ // https://github.com/ant-design/ant-design/issues/11456
2676
+ // https://github.com/ant-design/ant-design/issues/11843
2677
+ fontVariant: "initial",
2678
+ backgroundColor: e.colorBgElevated,
2679
+ borderRadius: e.borderRadiusLG,
2680
+ outline: "none",
2681
+ boxShadow: e.boxShadowSecondary,
2682
+ [`
2683
+ ${a}${u}bottomLeft,
2684
+ ${i}${u}bottomLeft
2685
+ `]: {
2686
+ animationName: Hr
2687
+ },
2688
+ [`
2689
+ ${a}${u}topLeft,
2690
+ ${i}${u}topLeft,
2691
+ ${a}${u}topRight,
2692
+ ${i}${u}topRight
2693
+ `]: {
2694
+ animationName: Vr
2695
+ },
2696
+ [`${l}${u}bottomLeft`]: {
2697
+ animationName: Br
2698
+ },
2699
+ [`
2700
+ ${l}${u}topLeft,
2701
+ ${l}${u}topRight
2702
+ `]: {
2703
+ animationName: Fr
2704
+ },
2705
+ "&-hidden": {
2706
+ display: "none"
2707
+ },
2708
+ [r]: Object.assign(Object.assign({}, Lt(e)), {
2709
+ cursor: "pointer",
2710
+ transition: `background ${e.motionDurationSlow} ease`,
2711
+ borderRadius: e.borderRadiusSM,
2712
+ // =========== Group ============
2713
+ "&-group": {
2714
+ color: e.colorTextDescription,
2715
+ fontSize: e.fontSizeSM,
2716
+ cursor: "default"
2717
+ },
2718
+ // =========== Option ===========
2719
+ "&-option": {
2720
+ display: "flex",
2721
+ "&-content": Object.assign({
2722
+ flex: "auto"
2723
+ }, Zn),
2724
+ "&-state": {
2725
+ flex: "none",
2726
+ display: "flex",
2727
+ alignItems: "center"
2728
+ },
2729
+ [`&-active:not(${r}-option-disabled)`]: {
2730
+ backgroundColor: e.optionActiveBg
2731
+ },
2732
+ [`&-selected:not(${r}-option-disabled)`]: {
2733
+ color: e.optionSelectedColor,
2734
+ fontWeight: e.optionSelectedFontWeight,
2735
+ backgroundColor: e.optionSelectedBg,
2736
+ [`${r}-option-state`]: {
2737
+ color: e.colorPrimary
2738
+ }
2739
+ },
2740
+ "&-disabled": {
2741
+ [`&${r}-option-selected`]: {
2742
+ backgroundColor: e.colorBgContainerDisabled
2743
+ },
2744
+ color: e.colorTextDisabled,
2745
+ cursor: "not-allowed"
2746
+ },
2747
+ "&-grouped": {
2748
+ paddingInlineStart: e.calc(e.controlPaddingHorizontal).mul(2).equal()
2749
+ }
2750
+ },
2751
+ "&-empty": Object.assign(Object.assign({}, Lt(e)), {
2752
+ color: e.colorTextDisabled
2753
+ })
2754
+ }),
2755
+ // https://github.com/ant-design/ant-design/pull/46646
2756
+ [`${d}:has(+ ${d})`]: {
2757
+ borderEndStartRadius: 0,
2758
+ borderEndEndRadius: 0,
2759
+ [`& + ${d}`]: {
2760
+ borderStartStartRadius: 0,
2761
+ borderStartEndRadius: 0
2762
+ }
2763
+ },
2764
+ // =========================== RTL ===========================
2765
+ "&-rtl": {
2766
+ direction: "rtl"
2767
+ }
2768
+ })
2769
+ },
2770
+ // Follow code may reuse in other components
2771
+ yt(e, "slide-up"),
2772
+ yt(e, "slide-down"),
2773
+ Et(e, "move-up"),
2774
+ Et(e, "move-down")
2775
+ ];
2776
+ }, wa = (e) => {
2777
+ const {
2778
+ multipleSelectItemHeight: n,
2779
+ paddingXXS: t,
2780
+ lineWidth: r,
2781
+ INTERNAL_FIXED_ITEM_MARGIN: a
2782
+ } = e, i = e.max(e.calc(t).sub(r).equal(), 0), l = e.max(e.calc(i).sub(a).equal(), 0);
2783
+ return {
2784
+ basePadding: i,
2785
+ containerPadding: l,
2786
+ itemHeight: _e(n),
2787
+ itemLineHeight: _e(e.calc(n).sub(e.calc(e.lineWidth).mul(2)).equal())
2788
+ };
2789
+ }, ya = (e) => {
2790
+ const {
2791
+ multipleSelectItemHeight: n,
2792
+ selectHeight: t,
2793
+ lineWidth: r
2794
+ } = e;
2795
+ return e.calc(t).sub(n).div(2).sub(r).equal();
2796
+ }, Ca = (e) => {
2797
+ const {
2798
+ componentCls: n,
2799
+ iconCls: t,
2800
+ borderRadiusSM: r,
2801
+ motionDurationSlow: a,
2802
+ paddingXS: i,
2803
+ multipleItemColorDisabled: l,
2804
+ multipleItemBorderColorDisabled: u,
2805
+ colorIcon: d,
2806
+ colorIconHover: f,
2807
+ INTERNAL_FIXED_ITEM_MARGIN: v
2808
+ } = e;
2809
+ return {
2810
+ /**
2811
+ * Do not merge `height` & `line-height` under style with `selection` & `search`, since chrome
2812
+ * may update to redesign with its align logic.
2813
+ */
2814
+ // =========================== Overflow ===========================
2815
+ [`${n}-selection-overflow`]: {
2816
+ position: "relative",
2817
+ display: "flex",
2818
+ flex: "auto",
2819
+ flexWrap: "wrap",
2820
+ maxWidth: "100%",
2821
+ "&-item": {
2822
+ flex: "none",
2823
+ alignSelf: "center",
2824
+ maxWidth: "100%",
2825
+ display: "inline-flex"
2826
+ },
2827
+ // ======================== Selections ==========================
2828
+ [`${n}-selection-item`]: {
2829
+ display: "flex",
2830
+ alignSelf: "center",
2831
+ flex: "none",
2832
+ boxSizing: "border-box",
2833
+ maxWidth: "100%",
2834
+ marginBlock: v,
2835
+ borderRadius: r,
2836
+ cursor: "default",
2837
+ transition: `font-size ${a}, line-height ${a}, height ${a}`,
2838
+ marginInlineEnd: e.calc(v).mul(2).equal(),
2839
+ paddingInlineStart: i,
2840
+ paddingInlineEnd: e.calc(i).div(2).equal(),
2841
+ [`${n}-disabled&`]: {
2842
+ color: l,
2843
+ borderColor: u,
2844
+ cursor: "not-allowed"
2845
+ },
2846
+ // It's ok not to do this, but 24px makes bottom narrow in view should adjust
2847
+ "&-content": {
2848
+ display: "inline-block",
2849
+ marginInlineEnd: e.calc(i).div(2).equal(),
2850
+ overflow: "hidden",
2851
+ whiteSpace: "pre",
2852
+ // fix whitespace wrapping. custom tags display all whitespace within.
2853
+ textOverflow: "ellipsis"
2854
+ },
2855
+ "&-remove": Object.assign(Object.assign({}, Ft()), {
2856
+ display: "inline-flex",
2857
+ alignItems: "center",
2858
+ color: d,
2859
+ fontWeight: "bold",
2860
+ fontSize: 10,
2861
+ lineHeight: "inherit",
2862
+ cursor: "pointer",
2863
+ [`> ${t}`]: {
2864
+ verticalAlign: "-0.2em"
2865
+ },
2866
+ "&:hover": {
2867
+ color: f
2868
+ }
2869
+ })
2870
+ }
2871
+ }
2872
+ };
2873
+ }, Ea = (e, n) => {
2874
+ const {
2875
+ componentCls: t,
2876
+ INTERNAL_FIXED_ITEM_MARGIN: r
2877
+ } = e, a = `${t}-selection-overflow`, i = e.multipleSelectItemHeight, l = ya(e), u = n ? `${t}-${n}` : "", d = wa(e);
2878
+ return {
2879
+ [`${t}-multiple${u}`]: Object.assign(Object.assign({}, Ca(e)), {
2880
+ // ========================= Selector =========================
2881
+ [`${t}-selector`]: {
2882
+ display: "flex",
2883
+ alignItems: "center",
2884
+ width: "100%",
2885
+ height: "100%",
2886
+ // Multiple is little different that horizontal is follow the vertical
2887
+ paddingInline: d.basePadding,
2888
+ paddingBlock: d.containerPadding,
2889
+ borderRadius: e.borderRadius,
2890
+ [`${t}-disabled&`]: {
2891
+ background: e.multipleSelectorBgDisabled,
2892
+ cursor: "not-allowed"
2893
+ },
2894
+ "&:after": {
2895
+ display: "inline-block",
2896
+ width: 0,
2897
+ margin: `${_e(r)} 0`,
2898
+ lineHeight: _e(i),
2899
+ visibility: "hidden",
2900
+ content: '"\\a0"'
2901
+ }
2902
+ },
2903
+ // ======================== Selections ========================
2904
+ [`${t}-selection-item`]: {
2905
+ height: d.itemHeight,
2906
+ lineHeight: _e(d.itemLineHeight)
2907
+ },
2908
+ // ========================== Wrap ===========================
2909
+ [`${t}-selection-wrap`]: {
2910
+ alignSelf: "flex-start",
2911
+ "&:after": {
2912
+ lineHeight: _e(i),
2913
+ marginBlock: r
2914
+ }
2915
+ },
2916
+ // ========================== Input ==========================
2917
+ [`${t}-prefix`]: {
2918
+ marginInlineStart: e.calc(e.inputPaddingHorizontalBase).sub(d.basePadding).equal()
2919
+ },
2920
+ [`${a}-item + ${a}-item,
2921
+ ${t}-prefix + ${t}-selection-wrap
2922
+ `]: {
2923
+ [`${t}-selection-search`]: {
2924
+ marginInlineStart: 0
2925
+ },
2926
+ [`${t}-selection-placeholder`]: {
2927
+ insetInlineStart: 0
2928
+ }
2929
+ },
2930
+ // https://github.com/ant-design/ant-design/issues/44754
2931
+ // Same as `wrap:after`
2932
+ [`${a}-item-suffix`]: {
2933
+ minHeight: d.itemHeight,
2934
+ marginBlock: r
2935
+ },
2936
+ [`${t}-selection-search`]: {
2937
+ display: "inline-flex",
2938
+ position: "relative",
2939
+ maxWidth: "100%",
2940
+ marginInlineStart: e.calc(e.inputPaddingHorizontalBase).sub(l).equal(),
2941
+ "\n &-input,\n &-mirror\n ": {
2942
+ height: i,
2943
+ fontFamily: e.fontFamily,
2944
+ lineHeight: _e(i),
2945
+ transition: `all ${e.motionDurationSlow}`
2946
+ },
2947
+ "&-input": {
2948
+ width: "100%",
2949
+ minWidth: 4.1
2950
+ // fix search cursor missing
2951
+ },
2952
+ "&-mirror": {
2953
+ position: "absolute",
2954
+ top: 0,
2955
+ insetInlineStart: 0,
2956
+ insetInlineEnd: "auto",
2957
+ zIndex: 999,
2958
+ whiteSpace: "pre",
2959
+ // fix whitespace wrapping caused width calculation bug
2960
+ visibility: "hidden"
2961
+ }
2962
+ },
2963
+ // ======================= Placeholder =======================
2964
+ [`${t}-selection-placeholder`]: {
2965
+ position: "absolute",
2966
+ top: "50%",
2967
+ insetInlineStart: e.calc(e.inputPaddingHorizontalBase).sub(d.basePadding).equal(),
2968
+ insetInlineEnd: e.inputPaddingHorizontalBase,
2969
+ transform: "translateY(-50%)",
2970
+ transition: `all ${e.motionDurationSlow}`
2971
+ }
2972
+ })
2973
+ };
2974
+ };
2975
+ function Yn(e, n) {
2976
+ const {
2977
+ componentCls: t
2978
+ } = e, r = n ? `${t}-${n}` : "", a = {
2979
+ [`${t}-multiple${r}`]: {
2980
+ fontSize: e.fontSize,
2981
+ // ========================= Selector =========================
2982
+ [`${t}-selector`]: {
2983
+ [`${t}-show-search&`]: {
2984
+ cursor: "text"
2985
+ }
2986
+ },
2987
+ [`
2988
+ &${t}-show-arrow ${t}-selector,
2989
+ &${t}-allow-clear ${t}-selector
2990
+ `]: {
2991
+ paddingInlineEnd: e.calc(e.fontSizeIcon).add(e.controlPaddingHorizontal).equal()
2992
+ }
2993
+ }
2994
+ };
2995
+ return [Ea(e, n), a];
2996
+ }
2997
+ const Ia = (e) => {
2998
+ const {
2999
+ componentCls: n
3000
+ } = e, t = Pn(e, {
3001
+ selectHeight: e.controlHeightSM,
3002
+ multipleSelectItemHeight: e.multipleItemHeightSM,
3003
+ borderRadius: e.borderRadiusSM,
3004
+ borderRadiusSM: e.borderRadiusXS
3005
+ }), r = Pn(e, {
3006
+ fontSize: e.fontSizeLG,
3007
+ selectHeight: e.controlHeightLG,
3008
+ multipleSelectItemHeight: e.multipleItemHeightLG,
3009
+ borderRadius: e.borderRadiusLG,
3010
+ borderRadiusSM: e.borderRadius
3011
+ });
3012
+ return [
3013
+ Yn(e),
3014
+ // ======================== Small ========================
3015
+ Yn(t, "sm"),
3016
+ // Padding
3017
+ {
3018
+ [`${n}-multiple${n}-sm`]: {
3019
+ [`${n}-selection-placeholder`]: {
3020
+ insetInline: e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal()
3021
+ },
3022
+ // https://github.com/ant-design/ant-design/issues/29559
3023
+ [`${n}-selection-search`]: {
3024
+ marginInlineStart: 2
3025
+ // Magic Number
3026
+ }
3027
+ }
3028
+ },
3029
+ // ======================== Large ========================
3030
+ Yn(r, "lg")
3031
+ ];
3032
+ };
3033
+ function qn(e, n) {
3034
+ const {
3035
+ componentCls: t,
3036
+ inputPaddingHorizontalBase: r,
3037
+ borderRadius: a
3038
+ } = e, i = e.calc(e.controlHeight).sub(e.calc(e.lineWidth).mul(2)).equal(), l = n ? `${t}-${n}` : "";
3039
+ return {
3040
+ [`${t}-single${l}`]: {
3041
+ fontSize: e.fontSize,
3042
+ height: e.controlHeight,
3043
+ // ========================= Selector =========================
3044
+ [`${t}-selector`]: Object.assign(Object.assign({}, it(e, !0)), {
3045
+ display: "flex",
3046
+ borderRadius: a,
3047
+ flex: "1 1 auto",
3048
+ [`${t}-selection-search`]: {
3049
+ position: "absolute",
3050
+ inset: 0,
3051
+ width: "100%",
3052
+ "&-input": {
3053
+ width: "100%",
3054
+ WebkitAppearance: "textfield"
3055
+ }
3056
+ },
3057
+ [`
3058
+ ${t}-selection-item,
3059
+ ${t}-selection-placeholder
3060
+ `]: {
3061
+ display: "block",
3062
+ padding: 0,
3063
+ lineHeight: _e(i),
3064
+ transition: `all ${e.motionDurationSlow}, visibility 0s`,
3065
+ alignSelf: "center"
3066
+ },
3067
+ [`${t}-selection-placeholder`]: {
3068
+ transition: "none",
3069
+ pointerEvents: "none"
3070
+ },
3071
+ // For common baseline align
3072
+ [[
3073
+ "&:after",
3074
+ /* For '' value baseline align */
3075
+ `${t}-selection-item:empty:after`,
3076
+ /* For undefined value baseline align */
3077
+ `${t}-selection-placeholder:empty:after`
3078
+ ].join(",")]: {
3079
+ display: "inline-block",
3080
+ width: 0,
3081
+ visibility: "hidden",
3082
+ content: '"\\a0"'
3083
+ }
3084
+ }),
3085
+ [`
3086
+ &${t}-show-arrow ${t}-selection-item,
3087
+ &${t}-show-arrow ${t}-selection-search,
3088
+ &${t}-show-arrow ${t}-selection-placeholder
3089
+ `]: {
3090
+ paddingInlineEnd: e.showArrowPaddingInlineEnd
3091
+ },
3092
+ // Opacity selection if open
3093
+ [`&${t}-open ${t}-selection-item`]: {
3094
+ color: e.colorTextPlaceholder
3095
+ },
3096
+ // ========================== Input ==========================
3097
+ // We only change the style of non-customize input which is only support by `combobox` mode.
3098
+ // Not customize
3099
+ [`&:not(${t}-customize-input)`]: {
3100
+ [`${t}-selector`]: {
3101
+ width: "100%",
3102
+ height: "100%",
3103
+ alignItems: "center",
3104
+ padding: `0 ${_e(r)}`,
3105
+ [`${t}-selection-search-input`]: {
3106
+ height: i
3107
+ },
3108
+ "&:after": {
3109
+ lineHeight: _e(i)
3110
+ }
3111
+ }
3112
+ },
3113
+ [`&${t}-customize-input`]: {
3114
+ [`${t}-selector`]: {
3115
+ "&:after": {
3116
+ display: "none"
3117
+ },
3118
+ [`${t}-selection-search`]: {
3119
+ position: "static",
3120
+ width: "100%"
3121
+ },
3122
+ [`${t}-selection-placeholder`]: {
3123
+ position: "absolute",
3124
+ insetInlineStart: 0,
3125
+ insetInlineEnd: 0,
3126
+ padding: `0 ${_e(r)}`,
3127
+ "&:after": {
3128
+ display: "none"
3129
+ }
3130
+ }
3131
+ }
3132
+ }
3133
+ }
3134
+ };
3135
+ }
3136
+ function xa(e) {
3137
+ const {
3138
+ componentCls: n
3139
+ } = e, t = e.calc(e.controlPaddingHorizontalSM).sub(e.lineWidth).equal();
3140
+ return [
3141
+ qn(e),
3142
+ // ======================== Small ========================
3143
+ // Shared
3144
+ qn(Pn(e, {
3145
+ controlHeight: e.controlHeightSM,
3146
+ borderRadius: e.borderRadiusSM
3147
+ }), "sm"),
3148
+ // padding
3149
+ {
3150
+ [`${n}-single${n}-sm`]: {
3151
+ [`&:not(${n}-customize-input)`]: {
3152
+ [`${n}-selector`]: {
3153
+ padding: `0 ${_e(t)}`
3154
+ },
3155
+ // With arrow should provides `padding-right` to show the arrow
3156
+ [`&${n}-show-arrow ${n}-selection-search`]: {
3157
+ insetInlineEnd: e.calc(t).add(e.calc(e.fontSize).mul(1.5)).equal()
3158
+ },
3159
+ [`
3160
+ &${n}-show-arrow ${n}-selection-item,
3161
+ &${n}-show-arrow ${n}-selection-placeholder
3162
+ `]: {
3163
+ paddingInlineEnd: e.calc(e.fontSize).mul(1.5).equal()
3164
+ }
3165
+ }
3166
+ }
3167
+ },
3168
+ // ======================== Large ========================
3169
+ // Shared
3170
+ qn(Pn(e, {
3171
+ controlHeight: e.singleItemHeightLG,
3172
+ fontSize: e.fontSizeLG,
3173
+ borderRadius: e.borderRadiusLG
3174
+ }), "lg")
3175
+ ];
3176
+ }
3177
+ const Oa = (e) => {
3178
+ const {
3179
+ fontSize: n,
3180
+ lineHeight: t,
3181
+ lineWidth: r,
3182
+ controlHeight: a,
3183
+ controlHeightSM: i,
3184
+ controlHeightLG: l,
3185
+ paddingXXS: u,
3186
+ controlPaddingHorizontal: d,
3187
+ zIndexPopupBase: f,
3188
+ colorText: v,
3189
+ fontWeightStrong: s,
3190
+ controlItemBgActive: h,
3191
+ controlItemBgHover: c,
3192
+ colorBgContainer: g,
3193
+ colorFillSecondary: m,
3194
+ colorBgContainerDisabled: S,
3195
+ colorTextDisabled: w,
3196
+ colorPrimaryHover: b,
3197
+ colorPrimary: x,
3198
+ controlOutline: y
3199
+ } = e, N = u * 2, p = r * 2, C = Math.min(a - N, a - p), _ = Math.min(i - N, i - p), F = Math.min(l - N, l - p);
3200
+ return {
3201
+ INTERNAL_FIXED_ITEM_MARGIN: Math.floor(u / 2),
3202
+ zIndexPopup: f + 50,
3203
+ optionSelectedColor: v,
3204
+ optionSelectedFontWeight: s,
3205
+ optionSelectedBg: h,
3206
+ optionActiveBg: c,
3207
+ optionPadding: `${(a - n * t) / 2}px ${d}px`,
3208
+ optionFontSize: n,
3209
+ optionLineHeight: t,
3210
+ optionHeight: a,
3211
+ selectorBg: g,
3212
+ clearBg: g,
3213
+ singleItemHeightLG: l,
3214
+ multipleItemBg: m,
3215
+ multipleItemBorderColor: "transparent",
3216
+ multipleItemHeight: C,
3217
+ multipleItemHeightSM: _,
3218
+ multipleItemHeightLG: F,
3219
+ multipleSelectorBgDisabled: S,
3220
+ multipleItemColorDisabled: w,
3221
+ multipleItemBorderColorDisabled: "transparent",
3222
+ showArrowPaddingInlineEnd: Math.ceil(e.fontSize * 1.25),
3223
+ hoverBorderColor: b,
3224
+ activeBorderColor: x,
3225
+ activeOutlineColor: y,
3226
+ selectAffixPadding: u
3227
+ };
3228
+ }, ar = (e, n) => {
3229
+ const {
3230
+ componentCls: t,
3231
+ antCls: r,
3232
+ controlOutlineWidth: a
3233
+ } = e;
3234
+ return {
3235
+ [`&:not(${t}-customize-input) ${t}-selector`]: {
3236
+ border: `${_e(e.lineWidth)} ${e.lineType} ${n.borderColor}`,
3237
+ background: e.selectorBg
3238
+ },
3239
+ [`&:not(${t}-disabled):not(${t}-customize-input):not(${r}-pagination-size-changer)`]: {
3240
+ [`&:hover ${t}-selector`]: {
3241
+ borderColor: n.hoverBorderHover
3242
+ },
3243
+ [`${t}-focused& ${t}-selector`]: {
3244
+ borderColor: n.activeBorderColor,
3245
+ boxShadow: `0 0 0 ${_e(a)} ${n.activeOutlineColor}`,
3246
+ outline: 0
3247
+ },
3248
+ [`${t}-prefix`]: {
3249
+ color: n.color
3250
+ }
3251
+ }
3252
+ };
3253
+ }, Ht = (e, n) => ({
3254
+ [`&${e.componentCls}-status-${n.status}`]: Object.assign({}, ar(e, n))
3255
+ }), Ra = (e) => ({
3256
+ "&-outlined": Object.assign(Object.assign(Object.assign(Object.assign({}, ar(e, {
3257
+ borderColor: e.colorBorder,
3258
+ hoverBorderHover: e.hoverBorderColor,
3259
+ activeBorderColor: e.activeBorderColor,
3260
+ activeOutlineColor: e.activeOutlineColor,
3261
+ color: e.colorText
3262
+ })), Ht(e, {
3263
+ status: "error",
3264
+ borderColor: e.colorError,
3265
+ hoverBorderHover: e.colorErrorHover,
3266
+ activeBorderColor: e.colorError,
3267
+ activeOutlineColor: e.colorErrorOutline,
3268
+ color: e.colorError
3269
+ })), Ht(e, {
3270
+ status: "warning",
3271
+ borderColor: e.colorWarning,
3272
+ hoverBorderHover: e.colorWarningHover,
3273
+ activeBorderColor: e.colorWarning,
3274
+ activeOutlineColor: e.colorWarningOutline,
3275
+ color: e.colorWarning
3276
+ })), {
3277
+ [`&${e.componentCls}-disabled`]: {
3278
+ [`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
3279
+ background: e.colorBgContainerDisabled,
3280
+ color: e.colorTextDisabled
3281
+ }
3282
+ },
3283
+ [`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
3284
+ background: e.multipleItemBg,
3285
+ border: `${_e(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`
3286
+ }
3287
+ })
3288
+ }), ir = (e, n) => {
3289
+ const {
3290
+ componentCls: t,
3291
+ antCls: r
3292
+ } = e;
3293
+ return {
3294
+ [`&:not(${t}-customize-input) ${t}-selector`]: {
3295
+ background: n.bg,
3296
+ border: `${_e(e.lineWidth)} ${e.lineType} transparent`,
3297
+ color: n.color
3298
+ },
3299
+ [`&:not(${t}-disabled):not(${t}-customize-input):not(${r}-pagination-size-changer)`]: {
3300
+ [`&:hover ${t}-selector`]: {
3301
+ background: n.hoverBg
3302
+ },
3303
+ [`${t}-focused& ${t}-selector`]: {
3304
+ background: e.selectorBg,
3305
+ borderColor: n.activeBorderColor,
3306
+ outline: 0
3307
+ }
3308
+ }
3309
+ };
3310
+ }, Vt = (e, n) => ({
3311
+ [`&${e.componentCls}-status-${n.status}`]: Object.assign({}, ir(e, n))
3312
+ }), $a = (e) => ({
3313
+ "&-filled": Object.assign(Object.assign(Object.assign(Object.assign({}, ir(e, {
3314
+ bg: e.colorFillTertiary,
3315
+ hoverBg: e.colorFillSecondary,
3316
+ activeBorderColor: e.activeBorderColor,
3317
+ color: e.colorText
3318
+ })), Vt(e, {
3319
+ status: "error",
3320
+ bg: e.colorErrorBg,
3321
+ hoverBg: e.colorErrorBgHover,
3322
+ activeBorderColor: e.colorError,
3323
+ color: e.colorError
3324
+ })), Vt(e, {
3325
+ status: "warning",
3326
+ bg: e.colorWarningBg,
3327
+ hoverBg: e.colorWarningBgHover,
3328
+ activeBorderColor: e.colorWarning,
3329
+ color: e.colorWarning
3330
+ })), {
3331
+ [`&${e.componentCls}-disabled`]: {
3332
+ [`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
3333
+ borderColor: e.colorBorder,
3334
+ background: e.colorBgContainerDisabled,
3335
+ color: e.colorTextDisabled
3336
+ }
3337
+ },
3338
+ [`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
3339
+ background: e.colorBgContainer,
3340
+ border: `${_e(e.lineWidth)} ${e.lineType} ${e.colorSplit}`
3341
+ }
3342
+ })
3343
+ }), Ma = (e) => ({
3344
+ "&-borderless": {
3345
+ [`${e.componentCls}-selector`]: {
3346
+ background: "transparent",
3347
+ border: `${_e(e.lineWidth)} ${e.lineType} transparent`
3348
+ },
3349
+ [`&${e.componentCls}-disabled`]: {
3350
+ [`&:not(${e.componentCls}-customize-input) ${e.componentCls}-selector`]: {
3351
+ color: e.colorTextDisabled
3352
+ }
3353
+ },
3354
+ [`&${e.componentCls}-multiple ${e.componentCls}-selection-item`]: {
3355
+ background: e.multipleItemBg,
3356
+ border: `${_e(e.lineWidth)} ${e.lineType} ${e.multipleItemBorderColor}`
3357
+ },
3358
+ // Status
3359
+ [`&${e.componentCls}-status-error`]: {
3360
+ [`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]: {
3361
+ color: e.colorError
3362
+ }
3363
+ },
3364
+ [`&${e.componentCls}-status-warning`]: {
3365
+ [`${e.componentCls}-prefix, ${e.componentCls}-selection-item`]: {
3366
+ color: e.colorWarning
3367
+ }
3368
+ }
3369
+ }
3370
+ }), Da = (e) => ({
3371
+ [e.componentCls]: Object.assign(Object.assign(Object.assign({}, Ra(e)), $a(e)), Ma(e))
3372
+ }), Na = (e) => {
3373
+ const {
3374
+ componentCls: n
3375
+ } = e;
3376
+ return {
3377
+ position: "relative",
3378
+ transition: `all ${e.motionDurationMid} ${e.motionEaseInOut}`,
3379
+ input: {
3380
+ cursor: "pointer"
3381
+ },
3382
+ [`${n}-show-search&`]: {
3383
+ cursor: "text",
3384
+ input: {
3385
+ cursor: "auto",
3386
+ color: "inherit",
3387
+ height: "100%"
3388
+ }
3389
+ },
3390
+ [`${n}-disabled&`]: {
3391
+ cursor: "not-allowed",
3392
+ input: {
3393
+ cursor: "not-allowed"
3394
+ }
3395
+ }
3396
+ };
3397
+ }, Pa = (e) => {
3398
+ const {
3399
+ componentCls: n
3400
+ } = e;
3401
+ return {
3402
+ [`${n}-selection-search-input`]: {
3403
+ margin: 0,
3404
+ padding: 0,
3405
+ background: "transparent",
3406
+ border: "none",
3407
+ outline: "none",
3408
+ appearance: "none",
3409
+ fontFamily: "inherit",
3410
+ "&::-webkit-search-cancel-button": {
3411
+ display: "none",
3412
+ "-webkit-appearance": "none"
3413
+ }
3414
+ }
3415
+ };
3416
+ }, _a = (e) => {
3417
+ const {
3418
+ antCls: n,
3419
+ componentCls: t,
3420
+ inputPaddingHorizontalBase: r,
3421
+ iconCls: a
3422
+ } = e;
3423
+ return {
3424
+ [t]: Object.assign(Object.assign({}, it(e)), {
3425
+ position: "relative",
3426
+ display: "inline-flex",
3427
+ cursor: "pointer",
3428
+ [`&:not(${t}-customize-input) ${t}-selector`]: Object.assign(Object.assign({}, Na(e)), Pa(e)),
3429
+ // ======================== Selection ========================
3430
+ [`${t}-selection-item`]: Object.assign(Object.assign({
3431
+ flex: 1,
3432
+ fontWeight: "normal",
3433
+ position: "relative",
3434
+ userSelect: "none"
3435
+ }, Zn), {
3436
+ // https://github.com/ant-design/ant-design/issues/40421
3437
+ [`> ${n}-typography`]: {
3438
+ display: "inline"
3439
+ }
3440
+ }),
3441
+ // ======================= Placeholder =======================
3442
+ [`${t}-selection-placeholder`]: Object.assign(Object.assign({}, Zn), {
3443
+ flex: 1,
3444
+ color: e.colorTextPlaceholder,
3445
+ pointerEvents: "none"
3446
+ }),
3447
+ // ========================== Arrow ==========================
3448
+ [`${t}-arrow`]: Object.assign(Object.assign({}, Ft()), {
3449
+ position: "absolute",
3450
+ top: "50%",
3451
+ insetInlineStart: "auto",
3452
+ insetInlineEnd: r,
3453
+ height: e.fontSizeIcon,
3454
+ marginTop: e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),
3455
+ color: e.colorTextQuaternary,
3456
+ fontSize: e.fontSizeIcon,
3457
+ lineHeight: 1,
3458
+ textAlign: "center",
3459
+ pointerEvents: "none",
3460
+ display: "flex",
3461
+ alignItems: "center",
3462
+ transition: `opacity ${e.motionDurationSlow} ease`,
3463
+ [a]: {
3464
+ verticalAlign: "top",
3465
+ transition: `transform ${e.motionDurationSlow}`,
3466
+ "> svg": {
3467
+ verticalAlign: "top"
3468
+ },
3469
+ [`&:not(${t}-suffix)`]: {
3470
+ pointerEvents: "auto"
3471
+ }
3472
+ },
3473
+ [`${t}-disabled &`]: {
3474
+ cursor: "not-allowed"
3475
+ },
3476
+ "> *:not(:last-child)": {
3477
+ marginInlineEnd: 8
3478
+ // FIXME: magic
3479
+ }
3480
+ }),
3481
+ // ========================== Wrap ===========================
3482
+ [`${t}-selection-wrap`]: {
3483
+ display: "flex",
3484
+ width: "100%",
3485
+ position: "relative",
3486
+ minWidth: 0,
3487
+ // https://github.com/ant-design/ant-design/issues/51669
3488
+ "&:after": {
3489
+ content: '"\\a0"',
3490
+ width: 0,
3491
+ overflow: "hidden"
3492
+ }
3493
+ },
3494
+ // ========================= Prefix ==========================
3495
+ [`${t}-prefix`]: {
3496
+ flex: "none",
3497
+ marginInlineEnd: e.selectAffixPadding
3498
+ },
3499
+ // ========================== Clear ==========================
3500
+ [`${t}-clear`]: {
3501
+ position: "absolute",
3502
+ top: "50%",
3503
+ insetInlineStart: "auto",
3504
+ insetInlineEnd: r,
3505
+ zIndex: 1,
3506
+ display: "inline-block",
3507
+ width: e.fontSizeIcon,
3508
+ height: e.fontSizeIcon,
3509
+ marginTop: e.calc(e.fontSizeIcon).mul(-1).div(2).equal(),
3510
+ color: e.colorTextQuaternary,
3511
+ fontSize: e.fontSizeIcon,
3512
+ fontStyle: "normal",
3513
+ lineHeight: 1,
3514
+ textAlign: "center",
3515
+ textTransform: "none",
3516
+ cursor: "pointer",
3517
+ opacity: 0,
3518
+ transition: `color ${e.motionDurationMid} ease, opacity ${e.motionDurationSlow} ease`,
3519
+ textRendering: "auto",
3520
+ "&:before": {
3521
+ display: "block"
3522
+ },
3523
+ "&:hover": {
3524
+ color: e.colorTextTertiary
3525
+ }
3526
+ },
3527
+ [`&:hover ${t}-clear`]: {
3528
+ opacity: 1,
3529
+ background: e.colorBgBase,
3530
+ borderRadius: "50%"
3531
+ }
3532
+ }),
3533
+ // ========================= Feedback ==========================
3534
+ [`${t}-status`]: {
3535
+ "&-error, &-warning, &-success, &-validating": {
3536
+ [`&${t}-has-feedback`]: {
3537
+ [`${t}-clear`]: {
3538
+ insetInlineEnd: e.calc(r).add(e.fontSize).add(e.paddingXS).equal()
3539
+ }
3540
+ }
3541
+ }
3542
+ }
3543
+ };
3544
+ }, Ta = (e) => {
3545
+ const {
3546
+ componentCls: n
3547
+ } = e;
3548
+ return [
3549
+ {
3550
+ [n]: {
3551
+ // ==================== In Form ====================
3552
+ [`&${n}-in-form-item`]: {
3553
+ width: "100%"
3554
+ }
3555
+ }
3556
+ },
3557
+ // =====================================================
3558
+ // == LTR ==
3559
+ // =====================================================
3560
+ // Base
3561
+ _a(e),
3562
+ // Single
3563
+ xa(e),
3564
+ // Multiple
3565
+ Ia(e),
3566
+ // Dropdown
3567
+ Sa(e),
3568
+ // =====================================================
3569
+ // == RTL ==
3570
+ // =====================================================
3571
+ {
3572
+ [`${n}-rtl`]: {
3573
+ direction: "rtl"
3574
+ }
3575
+ },
3576
+ // =====================================================
3577
+ // == Space Compact ==
3578
+ // =====================================================
3579
+ Qr(e, {
3580
+ borderElCls: `${n}-selector`,
3581
+ focusElCls: `${n}-focused`
3582
+ })
3583
+ ];
3584
+ }, za = Bt("Select", (e, n) => {
3585
+ let {
3586
+ rootPrefixCls: t
3587
+ } = n;
3588
+ const r = Pn(e, {
3589
+ rootPrefixCls: t,
3590
+ inputPaddingHorizontalBase: e.calc(e.paddingSM).sub(1).equal(),
3591
+ multipleSelectItemHeight: e.multipleItemHeight,
3592
+ selectHeight: e.controlHeight
3593
+ });
3594
+ return [Ta(r), Da(r)];
3595
+ }, Oa, {
3596
+ unitless: {
3597
+ optionLineHeight: !0,
3598
+ optionSelectedFontWeight: !0
3599
+ }
3600
+ });
3601
+ var La = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z" } }] }, name: "down", theme: "outlined" }, Ha = function(n, t) {
3602
+ return /* @__PURE__ */ o.createElement(Jr, Ze({}, n, {
3603
+ ref: t,
3604
+ icon: La
3605
+ }));
3606
+ }, lr = /* @__PURE__ */ o.forwardRef(Ha);
3607
+ process.env.NODE_ENV !== "production" && (lr.displayName = "DownOutlined");
3608
+ function Va(e) {
3609
+ let {
3610
+ suffixIcon: n,
3611
+ clearIcon: t,
3612
+ menuItemSelectedIcon: r,
3613
+ removeIcon: a,
3614
+ loading: i,
3615
+ multiple: l,
3616
+ hasFeedback: u,
3617
+ prefixCls: d,
3618
+ showSuffixIcon: f,
3619
+ feedbackIcon: v,
3620
+ showArrow: s,
3621
+ componentName: h
3622
+ } = e;
3623
+ process.env.NODE_ENV !== "production" && at(h).deprecated(!t, "clearIcon", "allowClear={{ clearIcon: React.ReactNode }}");
3624
+ const c = t ?? /* @__PURE__ */ o.createElement(Zr, null), g = (b) => n === null && !u && !s ? null : /* @__PURE__ */ o.createElement(o.Fragment, null, f !== !1 && b, u && v);
3625
+ let m = null;
3626
+ if (n !== void 0)
3627
+ m = g(n);
3628
+ else if (i)
3629
+ m = g(/* @__PURE__ */ o.createElement(Gr, {
3630
+ spin: !0
3631
+ }));
3632
+ else {
3633
+ const b = `${d}-suffix`;
3634
+ m = (x) => {
3635
+ let {
3636
+ open: y,
3637
+ showSearch: N
3638
+ } = x;
3639
+ return g(y && N ? /* @__PURE__ */ o.createElement(zr, {
3640
+ className: b
3641
+ }) : /* @__PURE__ */ o.createElement(lr, {
3642
+ className: b
3643
+ }));
3644
+ };
3645
+ }
3646
+ let S = null;
3647
+ r !== void 0 ? S = r : l ? S = /* @__PURE__ */ o.createElement(Tr, null) : S = null;
3648
+ let w = null;
3649
+ return a !== void 0 ? w = a : w = /* @__PURE__ */ o.createElement(Ar, null), {
3650
+ clearIcon: c,
3651
+ suffixIcon: m,
3652
+ itemIcon: S,
3653
+ removeIcon: w
3654
+ };
3655
+ }
3656
+ function Ba(e, n) {
3657
+ return n !== void 0 ? n : e !== null;
3658
+ }
3659
+ var Fa = function(e, n) {
3660
+ var t = {};
3661
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && n.indexOf(r) < 0 && (t[r] = e[r]);
3662
+ if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
3663
+ n.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (t[r[a]] = e[r[a]]);
3664
+ return t;
3665
+ };
3666
+ const ur = "SECRET_COMBOBOX_MODE_DO_NOT_USE", cr = (e, n) => {
3667
+ var t;
3668
+ const {
3669
+ prefixCls: r,
3670
+ bordered: a,
3671
+ className: i,
3672
+ rootClassName: l,
3673
+ getPopupContainer: u,
3674
+ popupClassName: d,
3675
+ dropdownClassName: f,
3676
+ listHeight: v = 256,
3677
+ placement: s,
3678
+ listItemHeight: h,
3679
+ size: c,
3680
+ disabled: g,
3681
+ notFoundContent: m,
3682
+ status: S,
3683
+ builtinPlacements: w,
3684
+ dropdownMatchSelectWidth: b,
3685
+ popupMatchSelectWidth: x,
3686
+ direction: y,
3687
+ style: N,
3688
+ allowClear: p,
3689
+ variant: C,
3690
+ dropdownStyle: _,
3691
+ transitionName: F,
3692
+ tagRender: A,
3693
+ maxCount: K,
3694
+ prefix: U
3695
+ } = e, ne = Fa(e, ["prefixCls", "bordered", "className", "rootClassName", "getPopupContainer", "popupClassName", "dropdownClassName", "listHeight", "placement", "listItemHeight", "size", "disabled", "notFoundContent", "status", "builtinPlacements", "dropdownMatchSelectWidth", "popupMatchSelectWidth", "direction", "style", "allowClear", "variant", "dropdownStyle", "transitionName", "tagRender", "maxCount", "prefix"]), {
3696
+ getPopupContainer: z,
3697
+ getPrefixCls: ie,
3698
+ renderEmpty: j,
3699
+ direction: Z,
3700
+ virtual: M,
3701
+ popupMatchSelectWidth: V,
3702
+ popupOverflow: J,
3703
+ select: $
3704
+ } = o.useContext(jn), [, Ee] = ot(), Re = h ?? (Ee == null ? void 0 : Ee.controlHeight), G = ie("select", r), he = ie(), $e = y ?? Z, {
3705
+ compactSize: Y,
3706
+ compactItemClassnames: be
3707
+ } = Yr(G, $e), [we, le] = jr("select", C, a), E = Xr(G), [O, L, W] = za(G, E), R = o.useMemo(() => {
3708
+ const {
3709
+ mode: ze
3710
+ } = e;
3711
+ if (ze !== "combobox")
3712
+ return ze === ur ? "combobox" : ze;
3713
+ }, [e.mode]), Q = R === "multiple" || R === "tags", ue = Ba(e.suffixIcon, e.showArrow), se = (t = x ?? b) !== null && t !== void 0 ? t : V, {
3714
+ status: oe,
3715
+ hasFeedback: ve,
3716
+ isFormItemInput: De,
3717
+ feedbackIcon: He
3718
+ } = o.useContext(Ur), Ve = Kr(oe, S);
3719
+ let me;
3720
+ m !== void 0 ? me = m : R === "combobox" ? me = null : me = (j == null ? void 0 : j("Select")) || /* @__PURE__ */ o.createElement(pa, {
3721
+ componentName: "Select"
3722
+ });
3723
+ const {
3724
+ suffixIcon: qe,
3725
+ itemIcon: Me,
3726
+ removeIcon: ge,
3727
+ clearIcon: ye
3728
+ } = Va(Object.assign(Object.assign({}, ne), {
3729
+ multiple: Q,
3730
+ hasFeedback: ve,
3731
+ feedbackIcon: He,
3732
+ showSuffixIcon: ue,
3733
+ prefixCls: G,
3734
+ componentName: "Select"
3735
+ })), Ie = p === !0 ? {
3736
+ clearIcon: ye
3737
+ } : p, Te = At(ne, ["suffixIcon", "itemIcon"]), Ae = Le(d || f, {
3738
+ [`${G}-dropdown-${$e}`]: $e === "rtl"
3739
+ }, l, W, E, L), Je = qr((ze) => {
3740
+ var Ne;
3741
+ return (Ne = c ?? Y) !== null && Ne !== void 0 ? Ne : ze;
3742
+ }), xe = o.useContext($r), We = g ?? xe, je = Le({
3743
+ [`${G}-lg`]: Je === "large",
3744
+ [`${G}-sm`]: Je === "small",
3745
+ [`${G}-rtl`]: $e === "rtl",
3746
+ [`${G}-${we}`]: le,
3747
+ [`${G}-in-form-item`]: De
3748
+ }, Wr(G, Ve, ve), be, $ == null ? void 0 : $.className, i, l, W, E, L), fn = o.useMemo(() => s !== void 0 ? s : $e === "rtl" ? "bottomRight" : "bottomLeft", [s, $e]);
3749
+ if (process.env.NODE_ENV !== "production") {
3750
+ const ze = at("Select");
3751
+ ze.deprecated(!f, "dropdownClassName", "popupClassName"), ze.deprecated(b === void 0, "dropdownMatchSelectWidth", "popupMatchSelectWidth"), process.env.NODE_ENV !== "production" && ze(!("showArrow" in e), "deprecated", "`showArrow` is deprecated which will be removed in next major version. It will be a default behavior, you can hide it by setting `suffixIcon` to null."), ze.deprecated(!("bordered" in e), "bordered", "variant"), process.env.NODE_ENV !== "production" && ze(!(typeof K < "u" && !Q), "usage", "`maxCount` only works with mode `multiple` or `tags`");
3752
+ }
3753
+ const [Be] = Pr("SelectLike", _ == null ? void 0 : _.zIndex);
3754
+ return O(/* @__PURE__ */ o.createElement(vt, Object.assign({
3755
+ ref: n,
3756
+ virtual: M,
3757
+ showSearch: $ == null ? void 0 : $.showSearch
3758
+ }, Te, {
3759
+ style: Object.assign(Object.assign({}, $ == null ? void 0 : $.style), N),
3760
+ dropdownMatchSelectWidth: se,
3761
+ transitionName: _r(he, "slide-up", F),
3762
+ builtinPlacements: ba(w, J),
3763
+ listHeight: v,
3764
+ listItemHeight: Re,
3765
+ mode: R,
3766
+ prefixCls: G,
3767
+ placement: fn,
3768
+ direction: $e,
3769
+ prefix: U,
3770
+ suffixIcon: qe,
3771
+ menuItemSelectedIcon: Me,
3772
+ removeIcon: ge,
3773
+ allowClear: Ie,
3774
+ notFoundContent: me,
3775
+ className: je,
3776
+ getPopupContainer: u || z,
3777
+ dropdownClassName: Ae,
3778
+ disabled: We,
3779
+ dropdownStyle: Object.assign(Object.assign({}, _), {
3780
+ zIndex: Be
3781
+ }),
3782
+ maxCount: Q ? K : void 0,
3783
+ tagRender: Q ? A : void 0
3784
+ })));
3785
+ };
3786
+ process.env.NODE_ENV !== "production" && (cr.displayName = "Select");
3787
+ const xn = /* @__PURE__ */ o.forwardRef(cr), Aa = co(xn, "dropdownAlign");
3788
+ xn.SECRET_COMBOBOX_MODE_DO_NOT_USE = ur;
3789
+ xn.Option = ft;
3790
+ xn.OptGroup = dt;
3791
+ xn._InternalPanelDoNotUseOrYouWillBeFired = Aa;
3792
+ process.env.NODE_ENV !== "production" && (xn.displayName = "Select");
3793
+ const ja = ({ colors: e, sizing: n, typography: t, borderRadius: r }, a, i) => `
3794
+ &.ant-select {
3795
+ color: ${e[a][i].color};
3796
+ font-size: ${n.Size4}px;
3797
+ line-height: ${n.Size6}px;
3798
+ letter-spacing: 0;
3799
+ font-weight: 400;
3800
+ border-width: 1px;
3801
+
3802
+ width: 330px;
3803
+ height: 32px;
3804
+
3805
+ background-color: ${e[a][i].backgroundColor};
3806
+
3807
+
3808
+ border-radius: ${r.BorderRadiusMd}px;
3809
+ gap: ${n.Size2}px;
3810
+
3811
+
3812
+ &:hover {
3813
+ background-color: ${e[a].hover.backgroundColor};
3814
+ border-color: ${e[a].hover.borderColor};
3815
+ }
3816
+
3817
+ &:active {
3818
+ background-color: ${e[a].pressed.backgroundColor};
3819
+ border-color: ${e[a].pressed.borderColor};
3820
+ }
3821
+
3822
+ &:focus {
3823
+ background-color: ${e[a].focussed.backgroundColor};
3824
+ border-color: ${e[a].focussed.borderColor};
3825
+ }
3826
+
3827
+ &:disabled {
3828
+ background-color: ${e[a].disabled.backgroundColor};
3829
+ border-color: ${e[a].disabled.borderColor};
3830
+ }
3831
+ }
3832
+ `, Wa = rt.div`
3833
+ .ant-select-item-option {
3834
+ transition: all 0.2s ease-in-out;
3835
+
3836
+ &:hover {
3837
+ background-color: ${({ theme: e, type: n }) => e.colors[n].hover.backgroundColor};
3838
+ color: ${({ theme: e, type: n }) => e.colors[n].hover.color};
3839
+ }
3840
+
3841
+ &.ant-select-item-option-selected {
3842
+ background-color: ${({ theme: e, type: n }) => e.colors[n].hover.backgroundColor};
3843
+ color: ${({ theme: e, type: n }) => e.colors[n].active.color};
3844
+
3845
+ &:hover {
3846
+ background-color: ${({ theme: e, type: n }) => e.colors[n].hover.backgroundColor};
3847
+ color: ${({ theme: e, type: n }) => e.colors[n].hover.color};
3848
+ }
3849
+ }
3850
+ }
3851
+ `, ii = rt.div`
3852
+ .ant-select-dropdown {
3853
+ border-radius: ${({ theme: e }) => e.borderRadius.BorderRadiusMd}px;
3854
+ box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
3855
+
3856
+ ${Wa} {
3857
+ padding: ${({ theme: e }) => e.sizing.Size2}px
3858
+ ${({ theme: e }) => e.sizing.Size3}px;
3859
+ }
3860
+ }
3861
+ `, li = rt(xn)`
3862
+ ${({ theme: e, type: n = "primary", state: t = "active" }) => ja(e, n, t)}
3863
+ `;
3864
+ export {
3865
+ li as Select,
3866
+ ii as SelectDropdown,
3867
+ Wa as StyledMenuItem
3868
+ };