@cfxjs/sirius-next-common 0.1.38 → 0.1.39
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.
- package/dist/chunk-3RVRAMNW.js +69 -0
- package/dist/chunk-3RVRAMNW.js.map +1 -0
- package/dist/chunk-4HTI24KG.js +3629 -0
- package/dist/chunk-4HTI24KG.js.map +1 -0
- package/dist/chunk-6AGMKWAW.js +286 -0
- package/dist/chunk-6AGMKWAW.js.map +1 -0
- package/dist/chunk-6GBDCZIP.js +414 -0
- package/dist/chunk-6GBDCZIP.js.map +1 -0
- package/dist/chunk-73IFRWHE.js +130 -0
- package/dist/chunk-73IFRWHE.js.map +1 -0
- package/dist/chunk-AAQD5VX5.js +212 -0
- package/dist/chunk-AAQD5VX5.js.map +1 -0
- package/dist/chunk-AD46ITJC.js +416 -0
- package/dist/chunk-AD46ITJC.js.map +1 -0
- package/dist/chunk-AV2OU3PU.js +108 -0
- package/dist/chunk-AV2OU3PU.js.map +1 -0
- package/dist/chunk-B5XWZ3ZE.js +150 -0
- package/dist/chunk-B5XWZ3ZE.js.map +1 -0
- package/dist/chunk-CDYRVFSO.js +150 -0
- package/dist/chunk-CDYRVFSO.js.map +1 -0
- package/dist/chunk-EP4RVV4C.js +3629 -0
- package/dist/chunk-EP4RVV4C.js.map +1 -0
- package/dist/chunk-EVMUOMAM.js +412 -0
- package/dist/chunk-EVMUOMAM.js.map +1 -0
- package/dist/chunk-EYT54RGS.js +63 -0
- package/dist/chunk-EYT54RGS.js.map +1 -0
- package/dist/chunk-FMHO65DC.js +105 -0
- package/dist/chunk-FMHO65DC.js.map +1 -0
- package/dist/chunk-H6W3LPDS.js +2324 -0
- package/dist/chunk-H6W3LPDS.js.map +1 -0
- package/dist/chunk-HC2D4STF.js +69 -0
- package/dist/chunk-HC2D4STF.js.map +1 -0
- package/dist/chunk-IV4QQOMI.js +416 -0
- package/dist/chunk-IV4QQOMI.js.map +1 -0
- package/dist/chunk-IWECTQOD.js +212 -0
- package/dist/chunk-IWECTQOD.js.map +1 -0
- package/dist/chunk-JQUV4NMR.js +416 -0
- package/dist/chunk-JQUV4NMR.js.map +1 -0
- package/dist/chunk-KAGEJPGK.js +416 -0
- package/dist/chunk-KAGEJPGK.js.map +1 -0
- package/dist/chunk-KCPSCEXG.js +69 -0
- package/dist/chunk-KCPSCEXG.js.map +1 -0
- package/dist/chunk-KKR2JERD.js +284 -0
- package/dist/chunk-KKR2JERD.js.map +1 -0
- package/dist/chunk-LQXAMTBE.js +69 -0
- package/dist/chunk-LQXAMTBE.js.map +1 -0
- package/dist/chunk-M43SICPO.js +63 -0
- package/dist/chunk-M43SICPO.js.map +1 -0
- package/dist/chunk-M6MXSMYM.js +284 -0
- package/dist/chunk-M6MXSMYM.js.map +1 -0
- package/dist/chunk-MIAX5LP5.js +141 -0
- package/dist/chunk-MIAX5LP5.js.map +1 -0
- package/dist/chunk-N5TMLKGL.js +141 -0
- package/dist/chunk-N5TMLKGL.js.map +1 -0
- package/dist/chunk-NIYCXPXR.js +108 -0
- package/dist/chunk-NIYCXPXR.js.map +1 -0
- package/dist/chunk-O474QMUU.js +105 -0
- package/dist/chunk-O474QMUU.js.map +1 -0
- package/dist/chunk-OF33MONA.js +69 -0
- package/dist/chunk-OF33MONA.js.map +1 -0
- package/dist/chunk-PLU4IMEZ.js +130 -0
- package/dist/chunk-PLU4IMEZ.js.map +1 -0
- package/dist/chunk-RB2U3Y7F.js +49 -0
- package/dist/chunk-RB2U3Y7F.js.map +1 -0
- package/dist/chunk-RVVVAX7C.js +796 -0
- package/dist/chunk-RVVVAX7C.js.map +1 -0
- package/dist/chunk-TAJNIINB.js +69 -0
- package/dist/chunk-TAJNIINB.js.map +1 -0
- package/dist/chunk-VLDX5EPR.js +69 -0
- package/dist/chunk-VLDX5EPR.js.map +1 -0
- package/dist/chunk-VUULJBTQ.js +796 -0
- package/dist/chunk-VUULJBTQ.js.map +1 -0
- package/dist/chunk-VY6BUAPS.js +49 -0
- package/dist/chunk-VY6BUAPS.js.map +1 -0
- package/dist/chunk-XGOIDR7R.js +416 -0
- package/dist/chunk-XGOIDR7R.js.map +1 -0
- package/dist/chunk-XMBEB34D.js +69 -0
- package/dist/chunk-XMBEB34D.js.map +1 -0
- package/dist/chunk-XMWQQ4A6.js +414 -0
- package/dist/chunk-XMWQQ4A6.js.map +1 -0
- package/dist/chunk-Z6EYKGBH.js +286 -0
- package/dist/chunk-Z6EYKGBH.js.map +1 -0
- package/dist/chunk-ZKNMJZ5R.js +2324 -0
- package/dist/chunk-ZKNMJZ5R.js.map +1 -0
- package/dist/components/AddressContainer/CoreAddressContainer.js +10 -10
- package/dist/components/AddressContainer/EVMAddressContainer.js +9 -9
- package/dist/components/AddressContainer/addressSwitcher.js +7 -7
- package/dist/components/AddressContainer/addressView.js +6 -6
- package/dist/components/AddressContainer/label.js +4 -4
- package/dist/components/Age/index.js +4 -4
- package/dist/components/Charts/ChartOptions.js +2 -2
- package/dist/components/Charts/PreviewChartTemplate.js +6 -4
- package/dist/components/Charts/PreviewChartTemplate.js.map +1 -1
- package/dist/components/Charts/StockChartTemplate.js +7 -5
- package/dist/components/Charts/StockChartTemplate.js.map +1 -1
- package/dist/components/Charts/config.d.ts +5 -4
- package/dist/components/Charts/config.js +3 -1
- package/dist/components/CopyButton/index.js +3 -3
- package/dist/components/DownloadCSV/index.js +4 -4
- package/dist/components/GasPriceDropdown/index.js +2 -2
- package/dist/components/IncreasePercent/index.js +2 -2
- package/dist/components/InfoIconWithTooltip/index.js +3 -3
- package/dist/components/Modal/index.js +3 -3
- package/dist/components/NetworkIcon/index.js +2 -2
- package/dist/components/PhishingAddressContainer/index.js +4 -4
- package/dist/components/Price/index.js +3 -3
- package/dist/components/Radio/index.js +2 -2
- package/dist/components/Select/index.js +3 -3
- package/dist/components/Select/select.js +3 -3
- package/dist/components/Text/index.js +4 -4
- package/dist/components/Tooltip/index.js +3 -3
- package/dist/components/TransactionAction/coreTransactionAction.js +10 -10
- package/dist/components/TransactionAction/evmTransactionAction.js +9 -9
- package/dist/utils/address.d.ts +1 -1
- package/dist/utils/address.js +2 -2
- package/dist/utils/contractManagerTool.js +2 -2
- package/dist/utils/hooks/useChartQueryParams.d.ts +18 -0
- package/dist/utils/hooks/useChartQueryParams.js +31 -0
- package/dist/utils/hooks/useChartQueryParams.js.map +1 -0
- package/dist/utils/hooks/useENS.js +3 -3
- package/dist/utils/index.js +2 -2
- package/dist/utils/request.d.ts +1 -1
- package/dist/utils/request.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,3629 @@
|
|
|
1
|
+
import {
|
|
2
|
+
arrow,
|
|
3
|
+
autoUpdate,
|
|
4
|
+
computePosition,
|
|
5
|
+
flip,
|
|
6
|
+
hide,
|
|
7
|
+
limitShift,
|
|
8
|
+
offset,
|
|
9
|
+
shift,
|
|
10
|
+
size
|
|
11
|
+
} from "./chunk-LRCAKRPK.js";
|
|
12
|
+
import {
|
|
13
|
+
cn
|
|
14
|
+
} from "./chunk-VUULJBTQ.js";
|
|
15
|
+
|
|
16
|
+
// src/components/Select/select.tsx
|
|
17
|
+
import * as React9 from "react";
|
|
18
|
+
|
|
19
|
+
// ../../node_modules/.pnpm/@babel+runtime@7.24.1/node_modules/@babel/runtime/helpers/esm/extends.js
|
|
20
|
+
function _extends() {
|
|
21
|
+
_extends = Object.assign ? Object.assign.bind() : function(target) {
|
|
22
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
23
|
+
var source = arguments[i];
|
|
24
|
+
for (var key in source) {
|
|
25
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
26
|
+
target[key] = source[key];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
return _extends.apply(this, arguments);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// ../../node_modules/.pnpm/@radix-ui+react-select@2.0.0_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
36
|
+
import { useState as $01b9c$useState, useRef as $01b9c$useRef, createElement as $01b9c$createElement, useCallback as $01b9c$useCallback, forwardRef as $01b9c$forwardRef, Fragment as $01b9c$Fragment, useEffect as $01b9c$useEffect, useMemo as $01b9c$useMemo } from "react";
|
|
37
|
+
import { createPortal as $01b9c$createPortal } from "react-dom";
|
|
38
|
+
|
|
39
|
+
// ../../node_modules/.pnpm/@radix-ui+number@1.0.1/node_modules/@radix-ui/number/dist/index.mjs
|
|
40
|
+
function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {
|
|
41
|
+
return Math.min(max, Math.max(min, value));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ../../node_modules/.pnpm/@radix-ui+primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs
|
|
45
|
+
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
46
|
+
return function handleEvent(event) {
|
|
47
|
+
originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
|
|
48
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented)
|
|
49
|
+
return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ../../node_modules/.pnpm/@radix-ui+react-collection@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18.2_j7spzduairohywsflm43c32xhi/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
54
|
+
import $6vYhU$react from "react";
|
|
55
|
+
|
|
56
|
+
// ../../node_modules/.pnpm/@radix-ui+react-context@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-context/dist/index.mjs
|
|
57
|
+
import { createContext as $3bkAK$createContext, useMemo as $3bkAK$useMemo, createElement as $3bkAK$createElement, useContext as $3bkAK$useContext } from "react";
|
|
58
|
+
function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {
|
|
59
|
+
let defaultContexts = [];
|
|
60
|
+
function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
61
|
+
const BaseContext = /* @__PURE__ */ $3bkAK$createContext(defaultContext);
|
|
62
|
+
const index2 = defaultContexts.length;
|
|
63
|
+
defaultContexts = [
|
|
64
|
+
...defaultContexts,
|
|
65
|
+
defaultContext
|
|
66
|
+
];
|
|
67
|
+
function Provider(props) {
|
|
68
|
+
const { scope, children, ...context } = props;
|
|
69
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index2]) || BaseContext;
|
|
70
|
+
const value = $3bkAK$useMemo(
|
|
71
|
+
() => context,
|
|
72
|
+
Object.values(context)
|
|
73
|
+
);
|
|
74
|
+
return /* @__PURE__ */ $3bkAK$createElement(Context.Provider, {
|
|
75
|
+
value
|
|
76
|
+
}, children);
|
|
77
|
+
}
|
|
78
|
+
function useContext(consumerName, scope) {
|
|
79
|
+
const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index2]) || BaseContext;
|
|
80
|
+
const context = $3bkAK$useContext(Context);
|
|
81
|
+
if (context)
|
|
82
|
+
return context;
|
|
83
|
+
if (defaultContext !== void 0)
|
|
84
|
+
return defaultContext;
|
|
85
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
86
|
+
}
|
|
87
|
+
Provider.displayName = rootComponentName + "Provider";
|
|
88
|
+
return [
|
|
89
|
+
Provider,
|
|
90
|
+
useContext
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
const createScope = () => {
|
|
94
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
95
|
+
return /* @__PURE__ */ $3bkAK$createContext(defaultContext);
|
|
96
|
+
});
|
|
97
|
+
return function useScope(scope) {
|
|
98
|
+
const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
|
|
99
|
+
return $3bkAK$useMemo(
|
|
100
|
+
() => ({
|
|
101
|
+
[`__scope${scopeName}`]: {
|
|
102
|
+
...scope,
|
|
103
|
+
[scopeName]: contexts
|
|
104
|
+
}
|
|
105
|
+
}),
|
|
106
|
+
[
|
|
107
|
+
scope,
|
|
108
|
+
contexts
|
|
109
|
+
]
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
createScope.scopeName = scopeName;
|
|
114
|
+
return [
|
|
115
|
+
$c512c27ab02ef895$export$fd42f52fd3ae1109,
|
|
116
|
+
$c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
function $c512c27ab02ef895$var$composeContextScopes(...scopes) {
|
|
120
|
+
const baseScope = scopes[0];
|
|
121
|
+
if (scopes.length === 1)
|
|
122
|
+
return baseScope;
|
|
123
|
+
const createScope1 = () => {
|
|
124
|
+
const scopeHooks = scopes.map(
|
|
125
|
+
(createScope) => ({
|
|
126
|
+
useScope: createScope(),
|
|
127
|
+
scopeName: createScope.scopeName
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
return function useComposedScopes(overrideScopes) {
|
|
131
|
+
const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope, scopeName }) => {
|
|
132
|
+
const scopeProps = useScope(overrideScopes);
|
|
133
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
134
|
+
return {
|
|
135
|
+
...nextScopes,
|
|
136
|
+
...currentScope
|
|
137
|
+
};
|
|
138
|
+
}, {});
|
|
139
|
+
return $3bkAK$useMemo(
|
|
140
|
+
() => ({
|
|
141
|
+
[`__scope${baseScope.scopeName}`]: nextScopes1
|
|
142
|
+
}),
|
|
143
|
+
[
|
|
144
|
+
nextScopes1
|
|
145
|
+
]
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
createScope1.scopeName = baseScope.scopeName;
|
|
150
|
+
return createScope1;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
|
|
154
|
+
import { useCallback as $3vqmr$useCallback } from "react";
|
|
155
|
+
function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
156
|
+
if (typeof ref === "function")
|
|
157
|
+
ref(value);
|
|
158
|
+
else if (ref !== null && ref !== void 0)
|
|
159
|
+
ref.current = value;
|
|
160
|
+
}
|
|
161
|
+
function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
162
|
+
return (node) => refs.forEach(
|
|
163
|
+
(ref) => $6ed0406888f73fc4$var$setRef(ref, node)
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
167
|
+
return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs
|
|
171
|
+
import { forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment } from "react";
|
|
172
|
+
var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ $9IrjX$forwardRef((props, forwardedRef) => {
|
|
173
|
+
const { children, ...slotProps } = props;
|
|
174
|
+
const childrenArray = $9IrjX$Children.toArray(children);
|
|
175
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
176
|
+
if (slottable) {
|
|
177
|
+
const newElement = slottable.props.children;
|
|
178
|
+
const newChildren = childrenArray.map((child) => {
|
|
179
|
+
if (child === slottable) {
|
|
180
|
+
if ($9IrjX$Children.count(newElement) > 1)
|
|
181
|
+
return $9IrjX$Children.only(null);
|
|
182
|
+
return /* @__PURE__ */ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;
|
|
183
|
+
} else
|
|
184
|
+
return child;
|
|
185
|
+
});
|
|
186
|
+
return /* @__PURE__ */ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
187
|
+
ref: forwardedRef
|
|
188
|
+
}), /* @__PURE__ */ $9IrjX$isValidElement(newElement) ? /* @__PURE__ */ $9IrjX$cloneElement(newElement, void 0, newChildren) : null);
|
|
189
|
+
}
|
|
190
|
+
return /* @__PURE__ */ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
191
|
+
ref: forwardedRef
|
|
192
|
+
}), children);
|
|
193
|
+
});
|
|
194
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
|
|
195
|
+
var $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ $9IrjX$forwardRef((props, forwardedRef) => {
|
|
196
|
+
const { children, ...slotProps } = props;
|
|
197
|
+
if (/* @__PURE__ */ $9IrjX$isValidElement(children))
|
|
198
|
+
return /* @__PURE__ */ $9IrjX$cloneElement(children, {
|
|
199
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
200
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
201
|
+
});
|
|
202
|
+
return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;
|
|
203
|
+
});
|
|
204
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
|
|
205
|
+
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children }) => {
|
|
206
|
+
return /* @__PURE__ */ $9IrjX$createElement($9IrjX$Fragment, null, children);
|
|
207
|
+
};
|
|
208
|
+
function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
209
|
+
return /* @__PURE__ */ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
210
|
+
}
|
|
211
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
212
|
+
const overrideProps = {
|
|
213
|
+
...childProps
|
|
214
|
+
};
|
|
215
|
+
for (const propName in childProps) {
|
|
216
|
+
const slotPropValue = slotProps[propName];
|
|
217
|
+
const childPropValue = childProps[propName];
|
|
218
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
219
|
+
if (isHandler) {
|
|
220
|
+
if (slotPropValue && childPropValue)
|
|
221
|
+
overrideProps[propName] = (...args) => {
|
|
222
|
+
childPropValue(...args);
|
|
223
|
+
slotPropValue(...args);
|
|
224
|
+
};
|
|
225
|
+
else if (slotPropValue)
|
|
226
|
+
overrideProps[propName] = slotPropValue;
|
|
227
|
+
} else if (propName === "style")
|
|
228
|
+
overrideProps[propName] = {
|
|
229
|
+
...slotPropValue,
|
|
230
|
+
...childPropValue
|
|
231
|
+
};
|
|
232
|
+
else if (propName === "className")
|
|
233
|
+
overrideProps[propName] = [
|
|
234
|
+
slotPropValue,
|
|
235
|
+
childPropValue
|
|
236
|
+
].filter(Boolean).join(" ");
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
...slotProps,
|
|
240
|
+
...overrideProps
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// ../../node_modules/.pnpm/@radix-ui+react-collection@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18.2_j7spzduairohywsflm43c32xhi/node_modules/@radix-ui/react-collection/dist/index.mjs
|
|
245
|
+
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
246
|
+
const PROVIDER_NAME = name + "CollectionProvider";
|
|
247
|
+
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
248
|
+
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
249
|
+
collectionRef: {
|
|
250
|
+
current: null
|
|
251
|
+
},
|
|
252
|
+
itemMap: /* @__PURE__ */ new Map()
|
|
253
|
+
});
|
|
254
|
+
const CollectionProvider = (props) => {
|
|
255
|
+
const { scope, children } = props;
|
|
256
|
+
const ref = $6vYhU$react.useRef(null);
|
|
257
|
+
const itemMap = $6vYhU$react.useRef(/* @__PURE__ */ new Map()).current;
|
|
258
|
+
return /* @__PURE__ */ $6vYhU$react.createElement(CollectionProviderImpl, {
|
|
259
|
+
scope,
|
|
260
|
+
itemMap,
|
|
261
|
+
collectionRef: ref
|
|
262
|
+
}, children);
|
|
263
|
+
};
|
|
264
|
+
/* @__PURE__ */ Object.assign(CollectionProvider, {
|
|
265
|
+
displayName: PROVIDER_NAME
|
|
266
|
+
});
|
|
267
|
+
const COLLECTION_SLOT_NAME = name + "CollectionSlot";
|
|
268
|
+
const CollectionSlot = /* @__PURE__ */ $6vYhU$react.forwardRef((props, forwardedRef) => {
|
|
269
|
+
const { scope, children } = props;
|
|
270
|
+
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
271
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
272
|
+
return /* @__PURE__ */ $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
273
|
+
ref: composedRefs
|
|
274
|
+
}, children);
|
|
275
|
+
});
|
|
276
|
+
/* @__PURE__ */ Object.assign(CollectionSlot, {
|
|
277
|
+
displayName: COLLECTION_SLOT_NAME
|
|
278
|
+
});
|
|
279
|
+
const ITEM_SLOT_NAME = name + "CollectionItemSlot";
|
|
280
|
+
const ITEM_DATA_ATTR = "data-radix-collection-item";
|
|
281
|
+
const CollectionItemSlot = /* @__PURE__ */ $6vYhU$react.forwardRef((props, forwardedRef) => {
|
|
282
|
+
const { scope, children, ...itemData } = props;
|
|
283
|
+
const ref = $6vYhU$react.useRef(null);
|
|
284
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
285
|
+
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
286
|
+
$6vYhU$react.useEffect(() => {
|
|
287
|
+
context.itemMap.set(ref, {
|
|
288
|
+
ref,
|
|
289
|
+
...itemData
|
|
290
|
+
});
|
|
291
|
+
return () => void context.itemMap.delete(ref);
|
|
292
|
+
});
|
|
293
|
+
return /* @__PURE__ */ $6vYhU$react.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
294
|
+
[ITEM_DATA_ATTR]: "",
|
|
295
|
+
ref: composedRefs
|
|
296
|
+
}, children);
|
|
297
|
+
});
|
|
298
|
+
/* @__PURE__ */ Object.assign(CollectionItemSlot, {
|
|
299
|
+
displayName: ITEM_SLOT_NAME
|
|
300
|
+
});
|
|
301
|
+
function useCollection(scope) {
|
|
302
|
+
const context = useCollectionContext(name + "CollectionConsumer", scope);
|
|
303
|
+
const getItems = $6vYhU$react.useCallback(() => {
|
|
304
|
+
const collectionNode = context.collectionRef.current;
|
|
305
|
+
if (!collectionNode)
|
|
306
|
+
return [];
|
|
307
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
308
|
+
const items = Array.from(context.itemMap.values());
|
|
309
|
+
const orderedItems = items.sort(
|
|
310
|
+
(a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
311
|
+
);
|
|
312
|
+
return orderedItems;
|
|
313
|
+
}, [
|
|
314
|
+
context.collectionRef,
|
|
315
|
+
context.itemMap
|
|
316
|
+
]);
|
|
317
|
+
return getItems;
|
|
318
|
+
}
|
|
319
|
+
return [
|
|
320
|
+
{
|
|
321
|
+
Provider: CollectionProvider,
|
|
322
|
+
Slot: CollectionSlot,
|
|
323
|
+
ItemSlot: CollectionItemSlot
|
|
324
|
+
},
|
|
325
|
+
useCollection,
|
|
326
|
+
createCollectionScope
|
|
327
|
+
];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// ../../node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs
|
|
331
|
+
import { createContext as $7Gjcd$createContext, createElement as $7Gjcd$createElement, useContext as $7Gjcd$useContext } from "react";
|
|
332
|
+
var $f631663db3294ace$var$DirectionContext = /* @__PURE__ */ $7Gjcd$createContext(void 0);
|
|
333
|
+
function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
334
|
+
const globalDir = $7Gjcd$useContext($f631663db3294ace$var$DirectionContext);
|
|
335
|
+
return localDir || globalDir || "ltr";
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.0.5_@types+react-dom@18.2.22_@types+react@18.2.67_react-d_eutoambuxax2hyuqgqqitkytki/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
339
|
+
import { createContext as $kqwpH$createContext, forwardRef as $kqwpH$forwardRef, useContext as $kqwpH$useContext, useState as $kqwpH$useState, useEffect as $kqwpH$useEffect, createElement as $kqwpH$createElement, useRef as $kqwpH$useRef } from "react";
|
|
340
|
+
|
|
341
|
+
// ../../node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18.2._pcssahmctkg3uinjzyzzxugzuq/node_modules/@radix-ui/react-primitive/dist/index.mjs
|
|
342
|
+
import { forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement } from "react";
|
|
343
|
+
import { flushSync as $4q5Fq$flushSync } from "react-dom";
|
|
344
|
+
var $8927f6f2acc4f386$var$NODES = [
|
|
345
|
+
"a",
|
|
346
|
+
"button",
|
|
347
|
+
"div",
|
|
348
|
+
"form",
|
|
349
|
+
"h2",
|
|
350
|
+
"h3",
|
|
351
|
+
"img",
|
|
352
|
+
"input",
|
|
353
|
+
"label",
|
|
354
|
+
"li",
|
|
355
|
+
"nav",
|
|
356
|
+
"ol",
|
|
357
|
+
"p",
|
|
358
|
+
"span",
|
|
359
|
+
"svg",
|
|
360
|
+
"ul"
|
|
361
|
+
];
|
|
362
|
+
var $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node) => {
|
|
363
|
+
const Node = /* @__PURE__ */ $4q5Fq$forwardRef((props, forwardedRef) => {
|
|
364
|
+
const { asChild, ...primitiveProps } = props;
|
|
365
|
+
const Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
|
|
366
|
+
$4q5Fq$useEffect(() => {
|
|
367
|
+
window[Symbol.for("radix-ui")] = true;
|
|
368
|
+
}, []);
|
|
369
|
+
return /* @__PURE__ */ $4q5Fq$createElement(Comp, _extends({}, primitiveProps, {
|
|
370
|
+
ref: forwardedRef
|
|
371
|
+
}));
|
|
372
|
+
});
|
|
373
|
+
Node.displayName = `Primitive.${node}`;
|
|
374
|
+
return {
|
|
375
|
+
...primitive,
|
|
376
|
+
[node]: Node
|
|
377
|
+
};
|
|
378
|
+
}, {});
|
|
379
|
+
function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {
|
|
380
|
+
if (target)
|
|
381
|
+
$4q5Fq$flushSync(
|
|
382
|
+
() => target.dispatchEvent(event)
|
|
383
|
+
);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
|
|
387
|
+
import { useRef as $lwiWj$useRef, useEffect as $lwiWj$useEffect, useMemo as $lwiWj$useMemo } from "react";
|
|
388
|
+
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
|
|
389
|
+
const callbackRef = $lwiWj$useRef(callback);
|
|
390
|
+
$lwiWj$useEffect(() => {
|
|
391
|
+
callbackRef.current = callback;
|
|
392
|
+
});
|
|
393
|
+
return $lwiWj$useMemo(
|
|
394
|
+
() => (...args) => {
|
|
395
|
+
var _callbackRef$current;
|
|
396
|
+
return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);
|
|
397
|
+
},
|
|
398
|
+
[]
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-escape-keydown@1.0.3_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs
|
|
403
|
+
import { useEffect as $hPSQ5$useEffect } from "react";
|
|
404
|
+
function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
405
|
+
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
406
|
+
$hPSQ5$useEffect(() => {
|
|
407
|
+
const handleKeyDown = (event) => {
|
|
408
|
+
if (event.key === "Escape")
|
|
409
|
+
onEscapeKeyDown(event);
|
|
410
|
+
};
|
|
411
|
+
ownerDocument.addEventListener("keydown", handleKeyDown);
|
|
412
|
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown);
|
|
413
|
+
}, [
|
|
414
|
+
onEscapeKeyDown,
|
|
415
|
+
ownerDocument
|
|
416
|
+
]);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// ../../node_modules/.pnpm/@radix-ui+react-dismissable-layer@1.0.5_@types+react-dom@18.2.22_@types+react@18.2.67_react-d_eutoambuxax2hyuqgqqitkytki/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs
|
|
420
|
+
var $5cb92bef7577960e$var$CONTEXT_UPDATE = "dismissableLayer.update";
|
|
421
|
+
var $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = "dismissableLayer.pointerDownOutside";
|
|
422
|
+
var $5cb92bef7577960e$var$FOCUS_OUTSIDE = "dismissableLayer.focusOutside";
|
|
423
|
+
var $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
424
|
+
var $5cb92bef7577960e$var$DismissableLayerContext = /* @__PURE__ */ $kqwpH$createContext({
|
|
425
|
+
layers: /* @__PURE__ */ new Set(),
|
|
426
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
427
|
+
branches: /* @__PURE__ */ new Set()
|
|
428
|
+
});
|
|
429
|
+
var $5cb92bef7577960e$export$177fb62ff3ec1f22 = /* @__PURE__ */ $kqwpH$forwardRef((props, forwardedRef) => {
|
|
430
|
+
var _node$ownerDocument;
|
|
431
|
+
const { disableOutsidePointerEvents = false, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, onDismiss, ...layerProps } = props;
|
|
432
|
+
const context = $kqwpH$useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
433
|
+
const [node1, setNode] = $kqwpH$useState(null);
|
|
434
|
+
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
435
|
+
const [, force] = $kqwpH$useState({});
|
|
436
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
437
|
+
forwardedRef,
|
|
438
|
+
(node) => setNode(node)
|
|
439
|
+
);
|
|
440
|
+
const layers = Array.from(context.layers);
|
|
441
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
442
|
+
...context.layersWithOutsidePointerEventsDisabled
|
|
443
|
+
].slice(-1);
|
|
444
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled);
|
|
445
|
+
const index2 = node1 ? layers.indexOf(node1) : -1;
|
|
446
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
447
|
+
const isPointerEventsEnabled = index2 >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
448
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event) => {
|
|
449
|
+
const target = event.target;
|
|
450
|
+
const isPointerDownOnBranch = [
|
|
451
|
+
...context.branches
|
|
452
|
+
].some(
|
|
453
|
+
(branch) => branch.contains(target)
|
|
454
|
+
);
|
|
455
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch)
|
|
456
|
+
return;
|
|
457
|
+
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
458
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
459
|
+
if (!event.defaultPrevented)
|
|
460
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
461
|
+
}, ownerDocument);
|
|
462
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event) => {
|
|
463
|
+
const target = event.target;
|
|
464
|
+
const isFocusInBranch = [
|
|
465
|
+
...context.branches
|
|
466
|
+
].some(
|
|
467
|
+
(branch) => branch.contains(target)
|
|
468
|
+
);
|
|
469
|
+
if (isFocusInBranch)
|
|
470
|
+
return;
|
|
471
|
+
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
472
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
473
|
+
if (!event.defaultPrevented)
|
|
474
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
475
|
+
}, ownerDocument);
|
|
476
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765((event) => {
|
|
477
|
+
const isHighestLayer = index2 === context.layers.size - 1;
|
|
478
|
+
if (!isHighestLayer)
|
|
479
|
+
return;
|
|
480
|
+
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
481
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
482
|
+
event.preventDefault();
|
|
483
|
+
onDismiss();
|
|
484
|
+
}
|
|
485
|
+
}, ownerDocument);
|
|
486
|
+
$kqwpH$useEffect(() => {
|
|
487
|
+
if (!node1)
|
|
488
|
+
return;
|
|
489
|
+
if (disableOutsidePointerEvents) {
|
|
490
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
491
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
492
|
+
ownerDocument.body.style.pointerEvents = "none";
|
|
493
|
+
}
|
|
494
|
+
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
495
|
+
}
|
|
496
|
+
context.layers.add(node1);
|
|
497
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
498
|
+
return () => {
|
|
499
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1)
|
|
500
|
+
ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
501
|
+
};
|
|
502
|
+
}, [
|
|
503
|
+
node1,
|
|
504
|
+
ownerDocument,
|
|
505
|
+
disableOutsidePointerEvents,
|
|
506
|
+
context
|
|
507
|
+
]);
|
|
508
|
+
$kqwpH$useEffect(() => {
|
|
509
|
+
return () => {
|
|
510
|
+
if (!node1)
|
|
511
|
+
return;
|
|
512
|
+
context.layers.delete(node1);
|
|
513
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
514
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
515
|
+
};
|
|
516
|
+
}, [
|
|
517
|
+
node1,
|
|
518
|
+
context
|
|
519
|
+
]);
|
|
520
|
+
$kqwpH$useEffect(() => {
|
|
521
|
+
const handleUpdate = () => force({});
|
|
522
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
523
|
+
return () => document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
524
|
+
}, []);
|
|
525
|
+
return /* @__PURE__ */ $kqwpH$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
526
|
+
ref: composedRefs,
|
|
527
|
+
style: {
|
|
528
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? "auto" : "none" : void 0,
|
|
529
|
+
...props.style
|
|
530
|
+
},
|
|
531
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
532
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
533
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
534
|
+
}));
|
|
535
|
+
});
|
|
536
|
+
function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
537
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
538
|
+
const isPointerInsideReactTreeRef = $kqwpH$useRef(false);
|
|
539
|
+
const handleClickRef = $kqwpH$useRef(() => {
|
|
540
|
+
});
|
|
541
|
+
$kqwpH$useEffect(() => {
|
|
542
|
+
const handlePointerDown = (event) => {
|
|
543
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
544
|
+
let handleAndDispatchPointerDownOutsideEvent = function() {
|
|
545
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
546
|
+
discrete: true
|
|
547
|
+
});
|
|
548
|
+
};
|
|
549
|
+
const eventDetail = {
|
|
550
|
+
originalEvent: event
|
|
551
|
+
};
|
|
552
|
+
if (event.pointerType === "touch") {
|
|
553
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
554
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
555
|
+
ownerDocument.addEventListener("click", handleClickRef.current, {
|
|
556
|
+
once: true
|
|
557
|
+
});
|
|
558
|
+
} else
|
|
559
|
+
handleAndDispatchPointerDownOutsideEvent();
|
|
560
|
+
} else
|
|
561
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
562
|
+
isPointerInsideReactTreeRef.current = false;
|
|
563
|
+
};
|
|
564
|
+
const timerId = window.setTimeout(() => {
|
|
565
|
+
ownerDocument.addEventListener("pointerdown", handlePointerDown);
|
|
566
|
+
}, 0);
|
|
567
|
+
return () => {
|
|
568
|
+
window.clearTimeout(timerId);
|
|
569
|
+
ownerDocument.removeEventListener("pointerdown", handlePointerDown);
|
|
570
|
+
ownerDocument.removeEventListener("click", handleClickRef.current);
|
|
571
|
+
};
|
|
572
|
+
}, [
|
|
573
|
+
ownerDocument,
|
|
574
|
+
handlePointerDownOutside
|
|
575
|
+
]);
|
|
576
|
+
return {
|
|
577
|
+
// ensures we check React component tree (not just DOM tree)
|
|
578
|
+
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
579
|
+
};
|
|
580
|
+
}
|
|
581
|
+
function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
582
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
583
|
+
const isFocusInsideReactTreeRef = $kqwpH$useRef(false);
|
|
584
|
+
$kqwpH$useEffect(() => {
|
|
585
|
+
const handleFocus = (event) => {
|
|
586
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
587
|
+
const eventDetail = {
|
|
588
|
+
originalEvent: event
|
|
589
|
+
};
|
|
590
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
591
|
+
discrete: false
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
};
|
|
595
|
+
ownerDocument.addEventListener("focusin", handleFocus);
|
|
596
|
+
return () => ownerDocument.removeEventListener("focusin", handleFocus);
|
|
597
|
+
}, [
|
|
598
|
+
ownerDocument,
|
|
599
|
+
handleFocusOutside
|
|
600
|
+
]);
|
|
601
|
+
return {
|
|
602
|
+
onFocusCapture: () => isFocusInsideReactTreeRef.current = true,
|
|
603
|
+
onBlurCapture: () => isFocusInsideReactTreeRef.current = false
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
607
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
608
|
+
document.dispatchEvent(event);
|
|
609
|
+
}
|
|
610
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
611
|
+
const target = detail.originalEvent.target;
|
|
612
|
+
const event = new CustomEvent(name, {
|
|
613
|
+
bubbles: false,
|
|
614
|
+
cancelable: true,
|
|
615
|
+
detail
|
|
616
|
+
});
|
|
617
|
+
if (handler)
|
|
618
|
+
target.addEventListener(name, handler, {
|
|
619
|
+
once: true
|
|
620
|
+
});
|
|
621
|
+
if (discrete)
|
|
622
|
+
$8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
623
|
+
else
|
|
624
|
+
target.dispatchEvent(event);
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
// ../../node_modules/.pnpm/@radix-ui+react-focus-guards@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.mjs
|
|
628
|
+
import { useEffect as $1wErz$useEffect } from "react";
|
|
629
|
+
var $3db38b7d1fb3fe6a$var$count = 0;
|
|
630
|
+
function $3db38b7d1fb3fe6a$export$b7ece24a22aeda8c() {
|
|
631
|
+
$1wErz$useEffect(() => {
|
|
632
|
+
var _edgeGuards$, _edgeGuards$2;
|
|
633
|
+
const edgeGuards = document.querySelectorAll("[data-radix-focus-guard]");
|
|
634
|
+
document.body.insertAdjacentElement("afterbegin", (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
635
|
+
document.body.insertAdjacentElement("beforeend", (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $3db38b7d1fb3fe6a$var$createFocusGuard());
|
|
636
|
+
$3db38b7d1fb3fe6a$var$count++;
|
|
637
|
+
return () => {
|
|
638
|
+
if ($3db38b7d1fb3fe6a$var$count === 1)
|
|
639
|
+
document.querySelectorAll("[data-radix-focus-guard]").forEach(
|
|
640
|
+
(node) => node.remove()
|
|
641
|
+
);
|
|
642
|
+
$3db38b7d1fb3fe6a$var$count--;
|
|
643
|
+
};
|
|
644
|
+
}, []);
|
|
645
|
+
}
|
|
646
|
+
function $3db38b7d1fb3fe6a$var$createFocusGuard() {
|
|
647
|
+
const element = document.createElement("span");
|
|
648
|
+
element.setAttribute("data-radix-focus-guard", "");
|
|
649
|
+
element.tabIndex = 0;
|
|
650
|
+
element.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none";
|
|
651
|
+
return element;
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// ../../node_modules/.pnpm/@radix-ui+react-focus-scope@1.0.4_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18._w4zudsi4g6vfciwftrylaqpdnm/node_modules/@radix-ui/react-focus-scope/dist/index.mjs
|
|
655
|
+
import { forwardRef as $45QHv$forwardRef, useState as $45QHv$useState, useRef as $45QHv$useRef, useEffect as $45QHv$useEffect, useCallback as $45QHv$useCallback, createElement as $45QHv$createElement } from "react";
|
|
656
|
+
var $d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
|
|
657
|
+
var $d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
|
|
658
|
+
var $d3863c46a17e8a28$var$EVENT_OPTIONS = {
|
|
659
|
+
bubbles: false,
|
|
660
|
+
cancelable: true
|
|
661
|
+
};
|
|
662
|
+
var $d3863c46a17e8a28$export$20e40289641fbbb6 = /* @__PURE__ */ $45QHv$forwardRef((props, forwardedRef) => {
|
|
663
|
+
const { loop = false, trapped = false, onMountAutoFocus: onMountAutoFocusProp, onUnmountAutoFocus: onUnmountAutoFocusProp, ...scopeProps } = props;
|
|
664
|
+
const [container1, setContainer] = $45QHv$useState(null);
|
|
665
|
+
const onMountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onMountAutoFocusProp);
|
|
666
|
+
const onUnmountAutoFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onUnmountAutoFocusProp);
|
|
667
|
+
const lastFocusedElementRef = $45QHv$useRef(null);
|
|
668
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
669
|
+
forwardedRef,
|
|
670
|
+
(node) => setContainer(node)
|
|
671
|
+
);
|
|
672
|
+
const focusScope = $45QHv$useRef({
|
|
673
|
+
paused: false,
|
|
674
|
+
pause() {
|
|
675
|
+
this.paused = true;
|
|
676
|
+
},
|
|
677
|
+
resume() {
|
|
678
|
+
this.paused = false;
|
|
679
|
+
}
|
|
680
|
+
}).current;
|
|
681
|
+
$45QHv$useEffect(() => {
|
|
682
|
+
if (trapped) {
|
|
683
|
+
let handleFocusIn = function(event) {
|
|
684
|
+
if (focusScope.paused || !container1)
|
|
685
|
+
return;
|
|
686
|
+
const target = event.target;
|
|
687
|
+
if (container1.contains(target))
|
|
688
|
+
lastFocusedElementRef.current = target;
|
|
689
|
+
else
|
|
690
|
+
$d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
691
|
+
select: true
|
|
692
|
+
});
|
|
693
|
+
}, handleFocusOut = function(event) {
|
|
694
|
+
if (focusScope.paused || !container1)
|
|
695
|
+
return;
|
|
696
|
+
const relatedTarget = event.relatedTarget;
|
|
697
|
+
if (relatedTarget === null)
|
|
698
|
+
return;
|
|
699
|
+
if (!container1.contains(relatedTarget))
|
|
700
|
+
$d3863c46a17e8a28$var$focus(lastFocusedElementRef.current, {
|
|
701
|
+
select: true
|
|
702
|
+
});
|
|
703
|
+
}, handleMutations = function(mutations) {
|
|
704
|
+
const focusedElement = document.activeElement;
|
|
705
|
+
if (focusedElement !== document.body)
|
|
706
|
+
return;
|
|
707
|
+
for (const mutation of mutations)
|
|
708
|
+
if (mutation.removedNodes.length > 0)
|
|
709
|
+
$d3863c46a17e8a28$var$focus(container1);
|
|
710
|
+
};
|
|
711
|
+
document.addEventListener("focusin", handleFocusIn);
|
|
712
|
+
document.addEventListener("focusout", handleFocusOut);
|
|
713
|
+
const mutationObserver = new MutationObserver(handleMutations);
|
|
714
|
+
if (container1)
|
|
715
|
+
mutationObserver.observe(container1, {
|
|
716
|
+
childList: true,
|
|
717
|
+
subtree: true
|
|
718
|
+
});
|
|
719
|
+
return () => {
|
|
720
|
+
document.removeEventListener("focusin", handleFocusIn);
|
|
721
|
+
document.removeEventListener("focusout", handleFocusOut);
|
|
722
|
+
mutationObserver.disconnect();
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
}, [
|
|
726
|
+
trapped,
|
|
727
|
+
container1,
|
|
728
|
+
focusScope.paused
|
|
729
|
+
]);
|
|
730
|
+
$45QHv$useEffect(() => {
|
|
731
|
+
if (container1) {
|
|
732
|
+
$d3863c46a17e8a28$var$focusScopesStack.add(focusScope);
|
|
733
|
+
const previouslyFocusedElement = document.activeElement;
|
|
734
|
+
const hasFocusedCandidate = container1.contains(previouslyFocusedElement);
|
|
735
|
+
if (!hasFocusedCandidate) {
|
|
736
|
+
const mountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
737
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
738
|
+
container1.dispatchEvent(mountEvent);
|
|
739
|
+
if (!mountEvent.defaultPrevented) {
|
|
740
|
+
$d3863c46a17e8a28$var$focusFirst($d3863c46a17e8a28$var$removeLinks($d3863c46a17e8a28$var$getTabbableCandidates(container1)), {
|
|
741
|
+
select: true
|
|
742
|
+
});
|
|
743
|
+
if (document.activeElement === previouslyFocusedElement)
|
|
744
|
+
$d3863c46a17e8a28$var$focus(container1);
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
return () => {
|
|
748
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
|
|
749
|
+
setTimeout(() => {
|
|
750
|
+
const unmountEvent = new CustomEvent($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, $d3863c46a17e8a28$var$EVENT_OPTIONS);
|
|
751
|
+
container1.addEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
752
|
+
container1.dispatchEvent(unmountEvent);
|
|
753
|
+
if (!unmountEvent.defaultPrevented)
|
|
754
|
+
$d3863c46a17e8a28$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, {
|
|
755
|
+
select: true
|
|
756
|
+
});
|
|
757
|
+
container1.removeEventListener($d3863c46a17e8a28$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
|
|
758
|
+
$d3863c46a17e8a28$var$focusScopesStack.remove(focusScope);
|
|
759
|
+
}, 0);
|
|
760
|
+
};
|
|
761
|
+
}
|
|
762
|
+
}, [
|
|
763
|
+
container1,
|
|
764
|
+
onMountAutoFocus,
|
|
765
|
+
onUnmountAutoFocus,
|
|
766
|
+
focusScope
|
|
767
|
+
]);
|
|
768
|
+
const handleKeyDown = $45QHv$useCallback((event) => {
|
|
769
|
+
if (!loop && !trapped)
|
|
770
|
+
return;
|
|
771
|
+
if (focusScope.paused)
|
|
772
|
+
return;
|
|
773
|
+
const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
|
|
774
|
+
const focusedElement = document.activeElement;
|
|
775
|
+
if (isTabKey && focusedElement) {
|
|
776
|
+
const container = event.currentTarget;
|
|
777
|
+
const [first, last] = $d3863c46a17e8a28$var$getTabbableEdges(container);
|
|
778
|
+
const hasTabbableElementsInside = first && last;
|
|
779
|
+
if (!hasTabbableElementsInside) {
|
|
780
|
+
if (focusedElement === container)
|
|
781
|
+
event.preventDefault();
|
|
782
|
+
} else {
|
|
783
|
+
if (!event.shiftKey && focusedElement === last) {
|
|
784
|
+
event.preventDefault();
|
|
785
|
+
if (loop)
|
|
786
|
+
$d3863c46a17e8a28$var$focus(first, {
|
|
787
|
+
select: true
|
|
788
|
+
});
|
|
789
|
+
} else if (event.shiftKey && focusedElement === first) {
|
|
790
|
+
event.preventDefault();
|
|
791
|
+
if (loop)
|
|
792
|
+
$d3863c46a17e8a28$var$focus(last, {
|
|
793
|
+
select: true
|
|
794
|
+
});
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
}, [
|
|
799
|
+
loop,
|
|
800
|
+
trapped,
|
|
801
|
+
focusScope.paused
|
|
802
|
+
]);
|
|
803
|
+
return /* @__PURE__ */ $45QHv$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
804
|
+
tabIndex: -1
|
|
805
|
+
}, scopeProps, {
|
|
806
|
+
ref: composedRefs,
|
|
807
|
+
onKeyDown: handleKeyDown
|
|
808
|
+
}));
|
|
809
|
+
});
|
|
810
|
+
function $d3863c46a17e8a28$var$focusFirst(candidates, { select = false } = {}) {
|
|
811
|
+
const previouslyFocusedElement = document.activeElement;
|
|
812
|
+
for (const candidate of candidates) {
|
|
813
|
+
$d3863c46a17e8a28$var$focus(candidate, {
|
|
814
|
+
select
|
|
815
|
+
});
|
|
816
|
+
if (document.activeElement !== previouslyFocusedElement)
|
|
817
|
+
return;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
function $d3863c46a17e8a28$var$getTabbableEdges(container) {
|
|
821
|
+
const candidates = $d3863c46a17e8a28$var$getTabbableCandidates(container);
|
|
822
|
+
const first = $d3863c46a17e8a28$var$findVisible(candidates, container);
|
|
823
|
+
const last = $d3863c46a17e8a28$var$findVisible(candidates.reverse(), container);
|
|
824
|
+
return [
|
|
825
|
+
first,
|
|
826
|
+
last
|
|
827
|
+
];
|
|
828
|
+
}
|
|
829
|
+
function $d3863c46a17e8a28$var$getTabbableCandidates(container) {
|
|
830
|
+
const nodes = [];
|
|
831
|
+
const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
|
|
832
|
+
acceptNode: (node) => {
|
|
833
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
834
|
+
if (node.disabled || node.hidden || isHiddenInput)
|
|
835
|
+
return NodeFilter.FILTER_SKIP;
|
|
836
|
+
return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
while (walker.nextNode())
|
|
840
|
+
nodes.push(walker.currentNode);
|
|
841
|
+
return nodes;
|
|
842
|
+
}
|
|
843
|
+
function $d3863c46a17e8a28$var$findVisible(elements, container) {
|
|
844
|
+
for (const element of elements) {
|
|
845
|
+
if (!$d3863c46a17e8a28$var$isHidden(element, {
|
|
846
|
+
upTo: container
|
|
847
|
+
}))
|
|
848
|
+
return element;
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
function $d3863c46a17e8a28$var$isHidden(node, { upTo }) {
|
|
852
|
+
if (getComputedStyle(node).visibility === "hidden")
|
|
853
|
+
return true;
|
|
854
|
+
while (node) {
|
|
855
|
+
if (upTo !== void 0 && node === upTo)
|
|
856
|
+
return false;
|
|
857
|
+
if (getComputedStyle(node).display === "none")
|
|
858
|
+
return true;
|
|
859
|
+
node = node.parentElement;
|
|
860
|
+
}
|
|
861
|
+
return false;
|
|
862
|
+
}
|
|
863
|
+
function $d3863c46a17e8a28$var$isSelectableInput(element) {
|
|
864
|
+
return element instanceof HTMLInputElement && "select" in element;
|
|
865
|
+
}
|
|
866
|
+
function $d3863c46a17e8a28$var$focus(element, { select = false } = {}) {
|
|
867
|
+
if (element && element.focus) {
|
|
868
|
+
const previouslyFocusedElement = document.activeElement;
|
|
869
|
+
element.focus({
|
|
870
|
+
preventScroll: true
|
|
871
|
+
});
|
|
872
|
+
if (element !== previouslyFocusedElement && $d3863c46a17e8a28$var$isSelectableInput(element) && select)
|
|
873
|
+
element.select();
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
var $d3863c46a17e8a28$var$focusScopesStack = $d3863c46a17e8a28$var$createFocusScopesStack();
|
|
877
|
+
function $d3863c46a17e8a28$var$createFocusScopesStack() {
|
|
878
|
+
let stack = [];
|
|
879
|
+
return {
|
|
880
|
+
add(focusScope) {
|
|
881
|
+
const activeFocusScope = stack[0];
|
|
882
|
+
if (focusScope !== activeFocusScope)
|
|
883
|
+
activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause();
|
|
884
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
885
|
+
stack.unshift(focusScope);
|
|
886
|
+
},
|
|
887
|
+
remove(focusScope) {
|
|
888
|
+
var _stack$;
|
|
889
|
+
stack = $d3863c46a17e8a28$var$arrayRemove(stack, focusScope);
|
|
890
|
+
(_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume();
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
}
|
|
894
|
+
function $d3863c46a17e8a28$var$arrayRemove(array, item) {
|
|
895
|
+
const updatedArray = [
|
|
896
|
+
...array
|
|
897
|
+
];
|
|
898
|
+
const index2 = updatedArray.indexOf(item);
|
|
899
|
+
if (index2 !== -1)
|
|
900
|
+
updatedArray.splice(index2, 1);
|
|
901
|
+
return updatedArray;
|
|
902
|
+
}
|
|
903
|
+
function $d3863c46a17e8a28$var$removeLinks(items) {
|
|
904
|
+
return items.filter(
|
|
905
|
+
(item) => item.tagName !== "A"
|
|
906
|
+
);
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
910
|
+
import * as $2AODx$react from "react";
|
|
911
|
+
|
|
912
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
|
|
913
|
+
import { useLayoutEffect as $dxlwH$useLayoutEffect } from "react";
|
|
914
|
+
var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect : () => {
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.mjs
|
|
918
|
+
var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || (() => void 0);
|
|
919
|
+
var $1746a345f3d73bb7$var$count = 0;
|
|
920
|
+
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
921
|
+
const [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId());
|
|
922
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
923
|
+
if (!deterministicId)
|
|
924
|
+
setId(
|
|
925
|
+
(reactId) => reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
926
|
+
);
|
|
927
|
+
}, [
|
|
928
|
+
deterministicId
|
|
929
|
+
]);
|
|
930
|
+
return deterministicId || (id ? `radix-${id}` : "");
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
// ../../node_modules/.pnpm/@radix-ui+react-popper@1.1.3_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
934
|
+
import { useState as $kY93V$useState, createElement as $kY93V$createElement, forwardRef as $kY93V$forwardRef, useRef as $kY93V$useRef, useEffect as $kY93V$useEffect } from "react";
|
|
935
|
+
|
|
936
|
+
// ../../node_modules/.pnpm/@floating-ui+react-dom@2.1.0_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
937
|
+
import * as React from "react";
|
|
938
|
+
import { useLayoutEffect, useEffect } from "react";
|
|
939
|
+
import * as ReactDOM from "react-dom";
|
|
940
|
+
var index = typeof document !== "undefined" ? useLayoutEffect : useEffect;
|
|
941
|
+
function deepEqual(a, b) {
|
|
942
|
+
if (a === b) {
|
|
943
|
+
return true;
|
|
944
|
+
}
|
|
945
|
+
if (typeof a !== typeof b) {
|
|
946
|
+
return false;
|
|
947
|
+
}
|
|
948
|
+
if (typeof a === "function" && a.toString() === b.toString()) {
|
|
949
|
+
return true;
|
|
950
|
+
}
|
|
951
|
+
let length;
|
|
952
|
+
let i;
|
|
953
|
+
let keys;
|
|
954
|
+
if (a && b && typeof a === "object") {
|
|
955
|
+
if (Array.isArray(a)) {
|
|
956
|
+
length = a.length;
|
|
957
|
+
if (length !== b.length)
|
|
958
|
+
return false;
|
|
959
|
+
for (i = length; i-- !== 0; ) {
|
|
960
|
+
if (!deepEqual(a[i], b[i])) {
|
|
961
|
+
return false;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
return true;
|
|
965
|
+
}
|
|
966
|
+
keys = Object.keys(a);
|
|
967
|
+
length = keys.length;
|
|
968
|
+
if (length !== Object.keys(b).length) {
|
|
969
|
+
return false;
|
|
970
|
+
}
|
|
971
|
+
for (i = length; i-- !== 0; ) {
|
|
972
|
+
if (!{}.hasOwnProperty.call(b, keys[i])) {
|
|
973
|
+
return false;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
for (i = length; i-- !== 0; ) {
|
|
977
|
+
const key = keys[i];
|
|
978
|
+
if (key === "_owner" && a.$$typeof) {
|
|
979
|
+
continue;
|
|
980
|
+
}
|
|
981
|
+
if (!deepEqual(a[key], b[key])) {
|
|
982
|
+
return false;
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
return true;
|
|
986
|
+
}
|
|
987
|
+
return a !== a && b !== b;
|
|
988
|
+
}
|
|
989
|
+
function getDPR(element) {
|
|
990
|
+
if (typeof window === "undefined") {
|
|
991
|
+
return 1;
|
|
992
|
+
}
|
|
993
|
+
const win = element.ownerDocument.defaultView || window;
|
|
994
|
+
return win.devicePixelRatio || 1;
|
|
995
|
+
}
|
|
996
|
+
function roundByDPR(element, value) {
|
|
997
|
+
const dpr = getDPR(element);
|
|
998
|
+
return Math.round(value * dpr) / dpr;
|
|
999
|
+
}
|
|
1000
|
+
function useLatestRef(value) {
|
|
1001
|
+
const ref = React.useRef(value);
|
|
1002
|
+
index(() => {
|
|
1003
|
+
ref.current = value;
|
|
1004
|
+
});
|
|
1005
|
+
return ref;
|
|
1006
|
+
}
|
|
1007
|
+
function useFloating(options) {
|
|
1008
|
+
if (options === void 0) {
|
|
1009
|
+
options = {};
|
|
1010
|
+
}
|
|
1011
|
+
const {
|
|
1012
|
+
placement = "bottom",
|
|
1013
|
+
strategy = "absolute",
|
|
1014
|
+
middleware = [],
|
|
1015
|
+
platform: platform2,
|
|
1016
|
+
elements: {
|
|
1017
|
+
reference: externalReference,
|
|
1018
|
+
floating: externalFloating
|
|
1019
|
+
} = {},
|
|
1020
|
+
transform = true,
|
|
1021
|
+
whileElementsMounted,
|
|
1022
|
+
open
|
|
1023
|
+
} = options;
|
|
1024
|
+
const [data, setData] = React.useState({
|
|
1025
|
+
x: 0,
|
|
1026
|
+
y: 0,
|
|
1027
|
+
strategy,
|
|
1028
|
+
placement,
|
|
1029
|
+
middlewareData: {},
|
|
1030
|
+
isPositioned: false
|
|
1031
|
+
});
|
|
1032
|
+
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
|
|
1033
|
+
if (!deepEqual(latestMiddleware, middleware)) {
|
|
1034
|
+
setLatestMiddleware(middleware);
|
|
1035
|
+
}
|
|
1036
|
+
const [_reference, _setReference] = React.useState(null);
|
|
1037
|
+
const [_floating, _setFloating] = React.useState(null);
|
|
1038
|
+
const setReference = React.useCallback((node) => {
|
|
1039
|
+
if (node !== referenceRef.current) {
|
|
1040
|
+
referenceRef.current = node;
|
|
1041
|
+
_setReference(node);
|
|
1042
|
+
}
|
|
1043
|
+
}, []);
|
|
1044
|
+
const setFloating = React.useCallback((node) => {
|
|
1045
|
+
if (node !== floatingRef.current) {
|
|
1046
|
+
floatingRef.current = node;
|
|
1047
|
+
_setFloating(node);
|
|
1048
|
+
}
|
|
1049
|
+
}, []);
|
|
1050
|
+
const referenceEl = externalReference || _reference;
|
|
1051
|
+
const floatingEl = externalFloating || _floating;
|
|
1052
|
+
const referenceRef = React.useRef(null);
|
|
1053
|
+
const floatingRef = React.useRef(null);
|
|
1054
|
+
const dataRef = React.useRef(data);
|
|
1055
|
+
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
1056
|
+
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
1057
|
+
const platformRef = useLatestRef(platform2);
|
|
1058
|
+
const update = React.useCallback(() => {
|
|
1059
|
+
if (!referenceRef.current || !floatingRef.current) {
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
const config = {
|
|
1063
|
+
placement,
|
|
1064
|
+
strategy,
|
|
1065
|
+
middleware: latestMiddleware
|
|
1066
|
+
};
|
|
1067
|
+
if (platformRef.current) {
|
|
1068
|
+
config.platform = platformRef.current;
|
|
1069
|
+
}
|
|
1070
|
+
computePosition(referenceRef.current, floatingRef.current, config).then((data2) => {
|
|
1071
|
+
const fullData = {
|
|
1072
|
+
...data2,
|
|
1073
|
+
isPositioned: true
|
|
1074
|
+
};
|
|
1075
|
+
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
1076
|
+
dataRef.current = fullData;
|
|
1077
|
+
ReactDOM.flushSync(() => {
|
|
1078
|
+
setData(fullData);
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
}, [latestMiddleware, placement, strategy, platformRef]);
|
|
1083
|
+
index(() => {
|
|
1084
|
+
if (open === false && dataRef.current.isPositioned) {
|
|
1085
|
+
dataRef.current.isPositioned = false;
|
|
1086
|
+
setData((data2) => ({
|
|
1087
|
+
...data2,
|
|
1088
|
+
isPositioned: false
|
|
1089
|
+
}));
|
|
1090
|
+
}
|
|
1091
|
+
}, [open]);
|
|
1092
|
+
const isMountedRef = React.useRef(false);
|
|
1093
|
+
index(() => {
|
|
1094
|
+
isMountedRef.current = true;
|
|
1095
|
+
return () => {
|
|
1096
|
+
isMountedRef.current = false;
|
|
1097
|
+
};
|
|
1098
|
+
}, []);
|
|
1099
|
+
index(() => {
|
|
1100
|
+
if (referenceEl)
|
|
1101
|
+
referenceRef.current = referenceEl;
|
|
1102
|
+
if (floatingEl)
|
|
1103
|
+
floatingRef.current = floatingEl;
|
|
1104
|
+
if (referenceEl && floatingEl) {
|
|
1105
|
+
if (whileElementsMountedRef.current) {
|
|
1106
|
+
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
1107
|
+
}
|
|
1108
|
+
update();
|
|
1109
|
+
}
|
|
1110
|
+
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
1111
|
+
const refs = React.useMemo(() => ({
|
|
1112
|
+
reference: referenceRef,
|
|
1113
|
+
floating: floatingRef,
|
|
1114
|
+
setReference,
|
|
1115
|
+
setFloating
|
|
1116
|
+
}), [setReference, setFloating]);
|
|
1117
|
+
const elements = React.useMemo(() => ({
|
|
1118
|
+
reference: referenceEl,
|
|
1119
|
+
floating: floatingEl
|
|
1120
|
+
}), [referenceEl, floatingEl]);
|
|
1121
|
+
const floatingStyles = React.useMemo(() => {
|
|
1122
|
+
const initialStyles = {
|
|
1123
|
+
position: strategy,
|
|
1124
|
+
left: 0,
|
|
1125
|
+
top: 0
|
|
1126
|
+
};
|
|
1127
|
+
if (!elements.floating) {
|
|
1128
|
+
return initialStyles;
|
|
1129
|
+
}
|
|
1130
|
+
const x = roundByDPR(elements.floating, data.x);
|
|
1131
|
+
const y = roundByDPR(elements.floating, data.y);
|
|
1132
|
+
if (transform) {
|
|
1133
|
+
return {
|
|
1134
|
+
...initialStyles,
|
|
1135
|
+
transform: "translate(" + x + "px, " + y + "px)",
|
|
1136
|
+
...getDPR(elements.floating) >= 1.5 && {
|
|
1137
|
+
willChange: "transform"
|
|
1138
|
+
}
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
return {
|
|
1142
|
+
position: strategy,
|
|
1143
|
+
left: x,
|
|
1144
|
+
top: y
|
|
1145
|
+
};
|
|
1146
|
+
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
1147
|
+
return React.useMemo(() => ({
|
|
1148
|
+
...data,
|
|
1149
|
+
update,
|
|
1150
|
+
refs,
|
|
1151
|
+
elements,
|
|
1152
|
+
floatingStyles
|
|
1153
|
+
}), [data, update, refs, elements, floatingStyles]);
|
|
1154
|
+
}
|
|
1155
|
+
var arrow$1 = (options) => {
|
|
1156
|
+
function isRef(value) {
|
|
1157
|
+
return {}.hasOwnProperty.call(value, "current");
|
|
1158
|
+
}
|
|
1159
|
+
return {
|
|
1160
|
+
name: "arrow",
|
|
1161
|
+
options,
|
|
1162
|
+
fn(state) {
|
|
1163
|
+
const {
|
|
1164
|
+
element,
|
|
1165
|
+
padding
|
|
1166
|
+
} = typeof options === "function" ? options(state) : options;
|
|
1167
|
+
if (element && isRef(element)) {
|
|
1168
|
+
if (element.current != null) {
|
|
1169
|
+
return arrow({
|
|
1170
|
+
element: element.current,
|
|
1171
|
+
padding
|
|
1172
|
+
}).fn(state);
|
|
1173
|
+
}
|
|
1174
|
+
return {};
|
|
1175
|
+
}
|
|
1176
|
+
if (element) {
|
|
1177
|
+
return arrow({
|
|
1178
|
+
element,
|
|
1179
|
+
padding
|
|
1180
|
+
}).fn(state);
|
|
1181
|
+
}
|
|
1182
|
+
return {};
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
};
|
|
1186
|
+
var offset2 = (options, deps) => ({
|
|
1187
|
+
...offset(options),
|
|
1188
|
+
options: [options, deps]
|
|
1189
|
+
});
|
|
1190
|
+
var shift2 = (options, deps) => ({
|
|
1191
|
+
...shift(options),
|
|
1192
|
+
options: [options, deps]
|
|
1193
|
+
});
|
|
1194
|
+
var limitShift2 = (options, deps) => ({
|
|
1195
|
+
...limitShift(options),
|
|
1196
|
+
options: [options, deps]
|
|
1197
|
+
});
|
|
1198
|
+
var flip2 = (options, deps) => ({
|
|
1199
|
+
...flip(options),
|
|
1200
|
+
options: [options, deps]
|
|
1201
|
+
});
|
|
1202
|
+
var size2 = (options, deps) => ({
|
|
1203
|
+
...size(options),
|
|
1204
|
+
options: [options, deps]
|
|
1205
|
+
});
|
|
1206
|
+
var hide2 = (options, deps) => ({
|
|
1207
|
+
...hide(options),
|
|
1208
|
+
options: [options, deps]
|
|
1209
|
+
});
|
|
1210
|
+
var arrow2 = (options, deps) => ({
|
|
1211
|
+
...arrow$1(options),
|
|
1212
|
+
options: [options, deps]
|
|
1213
|
+
});
|
|
1214
|
+
|
|
1215
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-size@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-use-size/dist/index.mjs
|
|
1216
|
+
import { useState as $9gyGR$useState } from "react";
|
|
1217
|
+
function $db6c3485150b8e66$export$1ab7ae714698c4b8(element) {
|
|
1218
|
+
const [size3, setSize] = $9gyGR$useState(void 0);
|
|
1219
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
1220
|
+
if (element) {
|
|
1221
|
+
setSize({
|
|
1222
|
+
width: element.offsetWidth,
|
|
1223
|
+
height: element.offsetHeight
|
|
1224
|
+
});
|
|
1225
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
1226
|
+
if (!Array.isArray(entries))
|
|
1227
|
+
return;
|
|
1228
|
+
if (!entries.length)
|
|
1229
|
+
return;
|
|
1230
|
+
const entry = entries[0];
|
|
1231
|
+
let width;
|
|
1232
|
+
let height;
|
|
1233
|
+
if ("borderBoxSize" in entry) {
|
|
1234
|
+
const borderSizeEntry = entry["borderBoxSize"];
|
|
1235
|
+
const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;
|
|
1236
|
+
width = borderSize["inlineSize"];
|
|
1237
|
+
height = borderSize["blockSize"];
|
|
1238
|
+
} else {
|
|
1239
|
+
width = element.offsetWidth;
|
|
1240
|
+
height = element.offsetHeight;
|
|
1241
|
+
}
|
|
1242
|
+
setSize({
|
|
1243
|
+
width,
|
|
1244
|
+
height
|
|
1245
|
+
});
|
|
1246
|
+
});
|
|
1247
|
+
resizeObserver.observe(element, {
|
|
1248
|
+
box: "border-box"
|
|
1249
|
+
});
|
|
1250
|
+
return () => resizeObserver.unobserve(element);
|
|
1251
|
+
} else
|
|
1252
|
+
setSize(void 0);
|
|
1253
|
+
}, [
|
|
1254
|
+
element
|
|
1255
|
+
]);
|
|
1256
|
+
return size3;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
// ../../node_modules/.pnpm/@radix-ui+react-popper@1.1.3_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-popper/dist/index.mjs
|
|
1260
|
+
var $cf1ac5d9fe0e8206$var$POPPER_NAME = "Popper";
|
|
1261
|
+
var [$cf1ac5d9fe0e8206$var$createPopperContext, $cf1ac5d9fe0e8206$export$722aac194ae923] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
1262
|
+
var [$cf1ac5d9fe0e8206$var$PopperProvider, $cf1ac5d9fe0e8206$var$usePopperContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$POPPER_NAME);
|
|
1263
|
+
var $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9 = (props) => {
|
|
1264
|
+
const { __scopePopper, children } = props;
|
|
1265
|
+
const [anchor, setAnchor] = $kY93V$useState(null);
|
|
1266
|
+
return /* @__PURE__ */ $kY93V$createElement($cf1ac5d9fe0e8206$var$PopperProvider, {
|
|
1267
|
+
scope: __scopePopper,
|
|
1268
|
+
anchor,
|
|
1269
|
+
onAnchorChange: setAnchor
|
|
1270
|
+
}, children);
|
|
1271
|
+
};
|
|
1272
|
+
var $cf1ac5d9fe0e8206$var$ANCHOR_NAME = "PopperAnchor";
|
|
1273
|
+
var $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d = /* @__PURE__ */ $kY93V$forwardRef((props, forwardedRef) => {
|
|
1274
|
+
const { __scopePopper, virtualRef, ...anchorProps } = props;
|
|
1275
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$ANCHOR_NAME, __scopePopper);
|
|
1276
|
+
const ref = $kY93V$useRef(null);
|
|
1277
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
1278
|
+
$kY93V$useEffect(() => {
|
|
1279
|
+
context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current);
|
|
1280
|
+
});
|
|
1281
|
+
return virtualRef ? null : /* @__PURE__ */ $kY93V$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, anchorProps, {
|
|
1282
|
+
ref: composedRefs
|
|
1283
|
+
}));
|
|
1284
|
+
});
|
|
1285
|
+
var $cf1ac5d9fe0e8206$var$CONTENT_NAME = "PopperContent";
|
|
1286
|
+
var [$cf1ac5d9fe0e8206$var$PopperContentProvider, $cf1ac5d9fe0e8206$var$useContentContext] = $cf1ac5d9fe0e8206$var$createPopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME);
|
|
1287
|
+
var $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc = /* @__PURE__ */ $kY93V$forwardRef((props, forwardedRef) => {
|
|
1288
|
+
var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide;
|
|
1289
|
+
const { __scopePopper, side = "bottom", sideOffset = 0, align = "center", alignOffset = 0, arrowPadding = 0, avoidCollisions = true, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = "partial", hideWhenDetached = false, updatePositionStrategy = "optimized", onPlaced, ...contentProps } = props;
|
|
1290
|
+
const context = $cf1ac5d9fe0e8206$var$usePopperContext($cf1ac5d9fe0e8206$var$CONTENT_NAME, __scopePopper);
|
|
1291
|
+
const [content, setContent] = $kY93V$useState(null);
|
|
1292
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
1293
|
+
forwardedRef,
|
|
1294
|
+
(node) => setContent(node)
|
|
1295
|
+
);
|
|
1296
|
+
const [arrow3, setArrow] = $kY93V$useState(null);
|
|
1297
|
+
const arrowSize = $db6c3485150b8e66$export$1ab7ae714698c4b8(arrow3);
|
|
1298
|
+
const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0;
|
|
1299
|
+
const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0;
|
|
1300
|
+
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
|
|
1301
|
+
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : {
|
|
1302
|
+
top: 0,
|
|
1303
|
+
right: 0,
|
|
1304
|
+
bottom: 0,
|
|
1305
|
+
left: 0,
|
|
1306
|
+
...collisionPaddingProp
|
|
1307
|
+
};
|
|
1308
|
+
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [
|
|
1309
|
+
collisionBoundary
|
|
1310
|
+
];
|
|
1311
|
+
const hasExplicitBoundaries = boundary.length > 0;
|
|
1312
|
+
const detectOverflowOptions = {
|
|
1313
|
+
padding: collisionPadding,
|
|
1314
|
+
boundary: boundary.filter($cf1ac5d9fe0e8206$var$isNotNull),
|
|
1315
|
+
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
1316
|
+
altBoundary: hasExplicitBoundaries
|
|
1317
|
+
};
|
|
1318
|
+
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
|
|
1319
|
+
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
1320
|
+
strategy: "fixed",
|
|
1321
|
+
placement: desiredPlacement,
|
|
1322
|
+
whileElementsMounted: (...args) => {
|
|
1323
|
+
const cleanup = autoUpdate(...args, {
|
|
1324
|
+
animationFrame: updatePositionStrategy === "always"
|
|
1325
|
+
});
|
|
1326
|
+
return cleanup;
|
|
1327
|
+
},
|
|
1328
|
+
elements: {
|
|
1329
|
+
reference: context.anchor
|
|
1330
|
+
},
|
|
1331
|
+
middleware: [
|
|
1332
|
+
offset2({
|
|
1333
|
+
mainAxis: sideOffset + arrowHeight,
|
|
1334
|
+
alignmentAxis: alignOffset
|
|
1335
|
+
}),
|
|
1336
|
+
avoidCollisions && shift2({
|
|
1337
|
+
mainAxis: true,
|
|
1338
|
+
crossAxis: false,
|
|
1339
|
+
limiter: sticky === "partial" ? limitShift2() : void 0,
|
|
1340
|
+
...detectOverflowOptions
|
|
1341
|
+
}),
|
|
1342
|
+
avoidCollisions && flip2({
|
|
1343
|
+
...detectOverflowOptions
|
|
1344
|
+
}),
|
|
1345
|
+
size2({
|
|
1346
|
+
...detectOverflowOptions,
|
|
1347
|
+
apply: ({ elements, rects, availableWidth, availableHeight }) => {
|
|
1348
|
+
const { width: anchorWidth, height: anchorHeight } = rects.reference;
|
|
1349
|
+
const contentStyle = elements.floating.style;
|
|
1350
|
+
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
|
|
1351
|
+
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
|
|
1352
|
+
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
|
|
1353
|
+
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
|
|
1354
|
+
}
|
|
1355
|
+
}),
|
|
1356
|
+
arrow3 && arrow2({
|
|
1357
|
+
element: arrow3,
|
|
1358
|
+
padding: arrowPadding
|
|
1359
|
+
}),
|
|
1360
|
+
$cf1ac5d9fe0e8206$var$transformOrigin({
|
|
1361
|
+
arrowWidth,
|
|
1362
|
+
arrowHeight
|
|
1363
|
+
}),
|
|
1364
|
+
hideWhenDetached && hide2({
|
|
1365
|
+
strategy: "referenceHidden",
|
|
1366
|
+
...detectOverflowOptions
|
|
1367
|
+
})
|
|
1368
|
+
]
|
|
1369
|
+
});
|
|
1370
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
1371
|
+
const handlePlaced = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPlaced);
|
|
1372
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
1373
|
+
if (isPositioned)
|
|
1374
|
+
handlePlaced === null || handlePlaced === void 0 || handlePlaced();
|
|
1375
|
+
}, [
|
|
1376
|
+
isPositioned,
|
|
1377
|
+
handlePlaced
|
|
1378
|
+
]);
|
|
1379
|
+
const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x;
|
|
1380
|
+
const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y;
|
|
1381
|
+
const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0;
|
|
1382
|
+
const [contentZIndex, setContentZIndex] = $kY93V$useState();
|
|
1383
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
1384
|
+
if (content)
|
|
1385
|
+
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
1386
|
+
}, [
|
|
1387
|
+
content
|
|
1388
|
+
]);
|
|
1389
|
+
return /* @__PURE__ */ $kY93V$createElement("div", {
|
|
1390
|
+
ref: refs.setFloating,
|
|
1391
|
+
"data-radix-popper-content-wrapper": "",
|
|
1392
|
+
style: {
|
|
1393
|
+
...floatingStyles,
|
|
1394
|
+
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
|
|
1395
|
+
// keep off the page when measuring
|
|
1396
|
+
minWidth: "max-content",
|
|
1397
|
+
zIndex: contentZIndex,
|
|
1398
|
+
["--radix-popper-transform-origin"]: [
|
|
1399
|
+
(_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x,
|
|
1400
|
+
(_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y
|
|
1401
|
+
].join(" ")
|
|
1402
|
+
},
|
|
1403
|
+
dir: props.dir
|
|
1404
|
+
}, /* @__PURE__ */ $kY93V$createElement($cf1ac5d9fe0e8206$var$PopperContentProvider, {
|
|
1405
|
+
scope: __scopePopper,
|
|
1406
|
+
placedSide,
|
|
1407
|
+
onArrowChange: setArrow,
|
|
1408
|
+
arrowX,
|
|
1409
|
+
arrowY,
|
|
1410
|
+
shouldHideArrow: cannotCenterArrow
|
|
1411
|
+
}, /* @__PURE__ */ $kY93V$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
1412
|
+
"data-side": placedSide,
|
|
1413
|
+
"data-align": placedAlign
|
|
1414
|
+
}, contentProps, {
|
|
1415
|
+
ref: composedRefs,
|
|
1416
|
+
style: {
|
|
1417
|
+
...contentProps.style,
|
|
1418
|
+
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
1419
|
+
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
1420
|
+
animation: !isPositioned ? "none" : void 0,
|
|
1421
|
+
// hide the content if using the hide middleware and should be hidden
|
|
1422
|
+
opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : void 0
|
|
1423
|
+
}
|
|
1424
|
+
}))));
|
|
1425
|
+
});
|
|
1426
|
+
function $cf1ac5d9fe0e8206$var$isNotNull(value) {
|
|
1427
|
+
return value !== null;
|
|
1428
|
+
}
|
|
1429
|
+
var $cf1ac5d9fe0e8206$var$transformOrigin = (options) => ({
|
|
1430
|
+
name: "transformOrigin",
|
|
1431
|
+
options,
|
|
1432
|
+
fn(data) {
|
|
1433
|
+
var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8;
|
|
1434
|
+
const { placement, rects, middlewareData } = data;
|
|
1435
|
+
const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0;
|
|
1436
|
+
const isArrowHidden = cannotCenterArrow;
|
|
1437
|
+
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
|
|
1438
|
+
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
|
|
1439
|
+
const [placedSide, placedAlign] = $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement);
|
|
1440
|
+
const noArrowAlign = {
|
|
1441
|
+
start: "0%",
|
|
1442
|
+
center: "50%",
|
|
1443
|
+
end: "100%"
|
|
1444
|
+
}[placedAlign];
|
|
1445
|
+
const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2;
|
|
1446
|
+
const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2;
|
|
1447
|
+
let x = "";
|
|
1448
|
+
let y = "";
|
|
1449
|
+
if (placedSide === "bottom") {
|
|
1450
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
1451
|
+
y = `${-arrowHeight}px`;
|
|
1452
|
+
} else if (placedSide === "top") {
|
|
1453
|
+
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
|
|
1454
|
+
y = `${rects.floating.height + arrowHeight}px`;
|
|
1455
|
+
} else if (placedSide === "right") {
|
|
1456
|
+
x = `${-arrowHeight}px`;
|
|
1457
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
1458
|
+
} else if (placedSide === "left") {
|
|
1459
|
+
x = `${rects.floating.width + arrowHeight}px`;
|
|
1460
|
+
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
|
|
1461
|
+
}
|
|
1462
|
+
return {
|
|
1463
|
+
data: {
|
|
1464
|
+
x,
|
|
1465
|
+
y
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
function $cf1ac5d9fe0e8206$var$getSideAndAlignFromPlacement(placement) {
|
|
1471
|
+
const [side, align = "center"] = placement.split("-");
|
|
1472
|
+
return [
|
|
1473
|
+
side,
|
|
1474
|
+
align
|
|
1475
|
+
];
|
|
1476
|
+
}
|
|
1477
|
+
var $cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9 = $cf1ac5d9fe0e8206$export$badac9ada3a0bdf9;
|
|
1478
|
+
var $cf1ac5d9fe0e8206$export$b688253958b8dfe7 = $cf1ac5d9fe0e8206$export$ecd4e1ccab6ed6d;
|
|
1479
|
+
var $cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2 = $cf1ac5d9fe0e8206$export$bc4ae5855d3c4fc;
|
|
1480
|
+
|
|
1481
|
+
// ../../node_modules/.pnpm/@radix-ui+react-portal@1.0.4_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-portal/dist/index.mjs
|
|
1482
|
+
import { forwardRef as $7SXl2$forwardRef, createElement as $7SXl2$createElement } from "react";
|
|
1483
|
+
import $7SXl2$reactdom from "react-dom";
|
|
1484
|
+
var $f1701beae083dbae$export$602eac185826482c = /* @__PURE__ */ $7SXl2$forwardRef((props, forwardedRef) => {
|
|
1485
|
+
var _globalThis$document;
|
|
1486
|
+
const { container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body, ...portalProps } = props;
|
|
1487
|
+
return container ? /* @__PURE__ */ $7SXl2$reactdom.createPortal(/* @__PURE__ */ $7SXl2$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
1488
|
+
ref: forwardedRef
|
|
1489
|
+
})), container) : null;
|
|
1490
|
+
});
|
|
1491
|
+
|
|
1492
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
|
|
1493
|
+
import { useCallback as $bnPw9$useCallback, useState as $bnPw9$useState, useRef as $bnPw9$useRef, useEffect as $bnPw9$useEffect } from "react";
|
|
1494
|
+
function $71cd76cc60e0454e$export$6f32135080cb4c3({ prop, defaultProp, onChange = () => {
|
|
1495
|
+
} }) {
|
|
1496
|
+
const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({
|
|
1497
|
+
defaultProp,
|
|
1498
|
+
onChange
|
|
1499
|
+
});
|
|
1500
|
+
const isControlled = prop !== void 0;
|
|
1501
|
+
const value1 = isControlled ? prop : uncontrolledProp;
|
|
1502
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
1503
|
+
const setValue = $bnPw9$useCallback((nextValue) => {
|
|
1504
|
+
if (isControlled) {
|
|
1505
|
+
const setter = nextValue;
|
|
1506
|
+
const value = typeof nextValue === "function" ? setter(prop) : nextValue;
|
|
1507
|
+
if (value !== prop)
|
|
1508
|
+
handleChange(value);
|
|
1509
|
+
} else
|
|
1510
|
+
setUncontrolledProp(nextValue);
|
|
1511
|
+
}, [
|
|
1512
|
+
isControlled,
|
|
1513
|
+
prop,
|
|
1514
|
+
setUncontrolledProp,
|
|
1515
|
+
handleChange
|
|
1516
|
+
]);
|
|
1517
|
+
return [
|
|
1518
|
+
value1,
|
|
1519
|
+
setValue
|
|
1520
|
+
];
|
|
1521
|
+
}
|
|
1522
|
+
function $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp, onChange }) {
|
|
1523
|
+
const uncontrolledState = $bnPw9$useState(defaultProp);
|
|
1524
|
+
const [value] = uncontrolledState;
|
|
1525
|
+
const prevValueRef = $bnPw9$useRef(value);
|
|
1526
|
+
const handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
|
|
1527
|
+
$bnPw9$useEffect(() => {
|
|
1528
|
+
if (prevValueRef.current !== value) {
|
|
1529
|
+
handleChange(value);
|
|
1530
|
+
prevValueRef.current = value;
|
|
1531
|
+
}
|
|
1532
|
+
}, [
|
|
1533
|
+
value,
|
|
1534
|
+
prevValueRef,
|
|
1535
|
+
handleChange
|
|
1536
|
+
]);
|
|
1537
|
+
return uncontrolledState;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
// ../../node_modules/.pnpm/@radix-ui+react-use-previous@1.0.1_@types+react@18.2.67_react@18.2.0/node_modules/@radix-ui/react-use-previous/dist/index.mjs
|
|
1541
|
+
import { useRef as $8LvvK$useRef, useMemo as $8LvvK$useMemo } from "react";
|
|
1542
|
+
function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
|
1543
|
+
const ref = $8LvvK$useRef({
|
|
1544
|
+
value,
|
|
1545
|
+
previous: value
|
|
1546
|
+
});
|
|
1547
|
+
return $8LvvK$useMemo(() => {
|
|
1548
|
+
if (ref.current.value !== value) {
|
|
1549
|
+
ref.current.previous = ref.current.value;
|
|
1550
|
+
ref.current.value = value;
|
|
1551
|
+
}
|
|
1552
|
+
return ref.current.previous;
|
|
1553
|
+
}, [
|
|
1554
|
+
value
|
|
1555
|
+
]);
|
|
1556
|
+
}
|
|
1557
|
+
|
|
1558
|
+
// ../../node_modules/.pnpm/@radix-ui+react-visually-hidden@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom_4x3fnmulqnvu7mroxgohhoaryu/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs
|
|
1559
|
+
import { forwardRef as $kVwnw$forwardRef, createElement as $kVwnw$createElement } from "react";
|
|
1560
|
+
var $ea1ef594cf570d83$export$439d29a4e110a164 = /* @__PURE__ */ $kVwnw$forwardRef((props, forwardedRef) => {
|
|
1561
|
+
return /* @__PURE__ */ $kVwnw$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, props, {
|
|
1562
|
+
ref: forwardedRef,
|
|
1563
|
+
style: {
|
|
1564
|
+
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
1565
|
+
position: "absolute",
|
|
1566
|
+
border: 0,
|
|
1567
|
+
width: 1,
|
|
1568
|
+
height: 1,
|
|
1569
|
+
padding: 0,
|
|
1570
|
+
margin: -1,
|
|
1571
|
+
overflow: "hidden",
|
|
1572
|
+
clip: "rect(0, 0, 0, 0)",
|
|
1573
|
+
whiteSpace: "nowrap",
|
|
1574
|
+
wordWrap: "normal",
|
|
1575
|
+
...props.style
|
|
1576
|
+
}
|
|
1577
|
+
}));
|
|
1578
|
+
});
|
|
1579
|
+
|
|
1580
|
+
// ../../node_modules/.pnpm/aria-hidden@1.2.4/node_modules/aria-hidden/dist/es2015/index.js
|
|
1581
|
+
var getDefaultParent = function(originalTarget) {
|
|
1582
|
+
if (typeof document === "undefined") {
|
|
1583
|
+
return null;
|
|
1584
|
+
}
|
|
1585
|
+
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
1586
|
+
return sampleTarget.ownerDocument.body;
|
|
1587
|
+
};
|
|
1588
|
+
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
1589
|
+
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
1590
|
+
var markerMap = {};
|
|
1591
|
+
var lockCount = 0;
|
|
1592
|
+
var unwrapHost = function(node) {
|
|
1593
|
+
return node && (node.host || unwrapHost(node.parentNode));
|
|
1594
|
+
};
|
|
1595
|
+
var correctTargets = function(parent, targets) {
|
|
1596
|
+
return targets.map(function(target) {
|
|
1597
|
+
if (parent.contains(target)) {
|
|
1598
|
+
return target;
|
|
1599
|
+
}
|
|
1600
|
+
var correctedTarget = unwrapHost(target);
|
|
1601
|
+
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
1602
|
+
return correctedTarget;
|
|
1603
|
+
}
|
|
1604
|
+
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
1605
|
+
return null;
|
|
1606
|
+
}).filter(function(x) {
|
|
1607
|
+
return Boolean(x);
|
|
1608
|
+
});
|
|
1609
|
+
};
|
|
1610
|
+
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
1611
|
+
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
1612
|
+
if (!markerMap[markerName]) {
|
|
1613
|
+
markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
1614
|
+
}
|
|
1615
|
+
var markerCounter = markerMap[markerName];
|
|
1616
|
+
var hiddenNodes = [];
|
|
1617
|
+
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
1618
|
+
var elementsToStop = new Set(targets);
|
|
1619
|
+
var keep = function(el) {
|
|
1620
|
+
if (!el || elementsToKeep.has(el)) {
|
|
1621
|
+
return;
|
|
1622
|
+
}
|
|
1623
|
+
elementsToKeep.add(el);
|
|
1624
|
+
keep(el.parentNode);
|
|
1625
|
+
};
|
|
1626
|
+
targets.forEach(keep);
|
|
1627
|
+
var deep = function(parent) {
|
|
1628
|
+
if (!parent || elementsToStop.has(parent)) {
|
|
1629
|
+
return;
|
|
1630
|
+
}
|
|
1631
|
+
Array.prototype.forEach.call(parent.children, function(node) {
|
|
1632
|
+
if (elementsToKeep.has(node)) {
|
|
1633
|
+
deep(node);
|
|
1634
|
+
} else {
|
|
1635
|
+
try {
|
|
1636
|
+
var attr = node.getAttribute(controlAttribute);
|
|
1637
|
+
var alreadyHidden = attr !== null && attr !== "false";
|
|
1638
|
+
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
1639
|
+
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
1640
|
+
counterMap.set(node, counterValue);
|
|
1641
|
+
markerCounter.set(node, markerValue);
|
|
1642
|
+
hiddenNodes.push(node);
|
|
1643
|
+
if (counterValue === 1 && alreadyHidden) {
|
|
1644
|
+
uncontrolledNodes.set(node, true);
|
|
1645
|
+
}
|
|
1646
|
+
if (markerValue === 1) {
|
|
1647
|
+
node.setAttribute(markerName, "true");
|
|
1648
|
+
}
|
|
1649
|
+
if (!alreadyHidden) {
|
|
1650
|
+
node.setAttribute(controlAttribute, "true");
|
|
1651
|
+
}
|
|
1652
|
+
} catch (e) {
|
|
1653
|
+
console.error("aria-hidden: cannot operate on ", node, e);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
});
|
|
1657
|
+
};
|
|
1658
|
+
deep(parentNode);
|
|
1659
|
+
elementsToKeep.clear();
|
|
1660
|
+
lockCount++;
|
|
1661
|
+
return function() {
|
|
1662
|
+
hiddenNodes.forEach(function(node) {
|
|
1663
|
+
var counterValue = counterMap.get(node) - 1;
|
|
1664
|
+
var markerValue = markerCounter.get(node) - 1;
|
|
1665
|
+
counterMap.set(node, counterValue);
|
|
1666
|
+
markerCounter.set(node, markerValue);
|
|
1667
|
+
if (!counterValue) {
|
|
1668
|
+
if (!uncontrolledNodes.has(node)) {
|
|
1669
|
+
node.removeAttribute(controlAttribute);
|
|
1670
|
+
}
|
|
1671
|
+
uncontrolledNodes.delete(node);
|
|
1672
|
+
}
|
|
1673
|
+
if (!markerValue) {
|
|
1674
|
+
node.removeAttribute(markerName);
|
|
1675
|
+
}
|
|
1676
|
+
});
|
|
1677
|
+
lockCount--;
|
|
1678
|
+
if (!lockCount) {
|
|
1679
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
1680
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
1681
|
+
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
1682
|
+
markerMap = {};
|
|
1683
|
+
}
|
|
1684
|
+
};
|
|
1685
|
+
};
|
|
1686
|
+
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
1687
|
+
if (markerName === void 0) {
|
|
1688
|
+
markerName = "data-aria-hidden";
|
|
1689
|
+
}
|
|
1690
|
+
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
1691
|
+
var activeParentNode = parentNode || getDefaultParent(originalTarget);
|
|
1692
|
+
if (!activeParentNode) {
|
|
1693
|
+
return function() {
|
|
1694
|
+
return null;
|
|
1695
|
+
};
|
|
1696
|
+
}
|
|
1697
|
+
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live]")));
|
|
1698
|
+
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
1699
|
+
};
|
|
1700
|
+
|
|
1701
|
+
// ../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs
|
|
1702
|
+
var __assign = function() {
|
|
1703
|
+
__assign = Object.assign || function __assign2(t) {
|
|
1704
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1705
|
+
s = arguments[i];
|
|
1706
|
+
for (var p in s)
|
|
1707
|
+
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1708
|
+
t[p] = s[p];
|
|
1709
|
+
}
|
|
1710
|
+
return t;
|
|
1711
|
+
};
|
|
1712
|
+
return __assign.apply(this, arguments);
|
|
1713
|
+
};
|
|
1714
|
+
function __rest(s, e) {
|
|
1715
|
+
var t = {};
|
|
1716
|
+
for (var p in s)
|
|
1717
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1718
|
+
t[p] = s[p];
|
|
1719
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1720
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1721
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1722
|
+
t[p[i]] = s[p[i]];
|
|
1723
|
+
}
|
|
1724
|
+
return t;
|
|
1725
|
+
}
|
|
1726
|
+
function __spreadArray(to, from, pack) {
|
|
1727
|
+
if (pack || arguments.length === 2)
|
|
1728
|
+
for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
1729
|
+
if (ar || !(i in from)) {
|
|
1730
|
+
if (!ar)
|
|
1731
|
+
ar = Array.prototype.slice.call(from, 0, i);
|
|
1732
|
+
ar[i] = from[i];
|
|
1733
|
+
}
|
|
1734
|
+
}
|
|
1735
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1738
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
1739
|
+
import * as React8 from "react";
|
|
1740
|
+
|
|
1741
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
1742
|
+
import * as React4 from "react";
|
|
1743
|
+
|
|
1744
|
+
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.6_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/constants.js
|
|
1745
|
+
var zeroRightClassName = "right-scroll-bar-position";
|
|
1746
|
+
var fullWidthClassName = "width-before-scroll-bar";
|
|
1747
|
+
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
1748
|
+
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
1749
|
+
|
|
1750
|
+
// ../../node_modules/.pnpm/use-callback-ref@1.3.2_@types+react@18.2.67_react@18.2.0/node_modules/use-callback-ref/dist/es2015/assignRef.js
|
|
1751
|
+
function assignRef(ref, value) {
|
|
1752
|
+
if (typeof ref === "function") {
|
|
1753
|
+
ref(value);
|
|
1754
|
+
} else if (ref) {
|
|
1755
|
+
ref.current = value;
|
|
1756
|
+
}
|
|
1757
|
+
return ref;
|
|
1758
|
+
}
|
|
1759
|
+
|
|
1760
|
+
// ../../node_modules/.pnpm/use-callback-ref@1.3.2_@types+react@18.2.67_react@18.2.0/node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
1761
|
+
import { useState as useState3 } from "react";
|
|
1762
|
+
function useCallbackRef(initialValue, callback) {
|
|
1763
|
+
var ref = useState3(function() {
|
|
1764
|
+
return {
|
|
1765
|
+
// value
|
|
1766
|
+
value: initialValue,
|
|
1767
|
+
// last callback
|
|
1768
|
+
callback,
|
|
1769
|
+
// "memoized" public interface
|
|
1770
|
+
facade: {
|
|
1771
|
+
get current() {
|
|
1772
|
+
return ref.value;
|
|
1773
|
+
},
|
|
1774
|
+
set current(value) {
|
|
1775
|
+
var last = ref.value;
|
|
1776
|
+
if (last !== value) {
|
|
1777
|
+
ref.value = value;
|
|
1778
|
+
ref.callback(value, last);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
};
|
|
1783
|
+
})[0];
|
|
1784
|
+
ref.callback = callback;
|
|
1785
|
+
return ref.facade;
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
// ../../node_modules/.pnpm/use-callback-ref@1.3.2_@types+react@18.2.67_react@18.2.0/node_modules/use-callback-ref/dist/es2015/useMergeRef.js
|
|
1789
|
+
import * as React2 from "react";
|
|
1790
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React2.useLayoutEffect : React2.useEffect;
|
|
1791
|
+
var currentValues = /* @__PURE__ */ new WeakMap();
|
|
1792
|
+
function useMergeRefs(refs, defaultValue) {
|
|
1793
|
+
var callbackRef = useCallbackRef(defaultValue || null, function(newValue) {
|
|
1794
|
+
return refs.forEach(function(ref) {
|
|
1795
|
+
return assignRef(ref, newValue);
|
|
1796
|
+
});
|
|
1797
|
+
});
|
|
1798
|
+
useIsomorphicLayoutEffect(function() {
|
|
1799
|
+
var oldValue = currentValues.get(callbackRef);
|
|
1800
|
+
if (oldValue) {
|
|
1801
|
+
var prevRefs_1 = new Set(oldValue);
|
|
1802
|
+
var nextRefs_1 = new Set(refs);
|
|
1803
|
+
var current_1 = callbackRef.current;
|
|
1804
|
+
prevRefs_1.forEach(function(ref) {
|
|
1805
|
+
if (!nextRefs_1.has(ref)) {
|
|
1806
|
+
assignRef(ref, null);
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
nextRefs_1.forEach(function(ref) {
|
|
1810
|
+
if (!prevRefs_1.has(ref)) {
|
|
1811
|
+
assignRef(ref, current_1);
|
|
1812
|
+
}
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
currentValues.set(callbackRef, refs);
|
|
1816
|
+
}, [refs]);
|
|
1817
|
+
return callbackRef;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
// ../../node_modules/.pnpm/use-sidecar@1.1.2_@types+react@18.2.67_react@18.2.0/node_modules/use-sidecar/dist/es2015/medium.js
|
|
1821
|
+
function ItoI(a) {
|
|
1822
|
+
return a;
|
|
1823
|
+
}
|
|
1824
|
+
function innerCreateMedium(defaults, middleware) {
|
|
1825
|
+
if (middleware === void 0) {
|
|
1826
|
+
middleware = ItoI;
|
|
1827
|
+
}
|
|
1828
|
+
var buffer = [];
|
|
1829
|
+
var assigned = false;
|
|
1830
|
+
var medium = {
|
|
1831
|
+
read: function() {
|
|
1832
|
+
if (assigned) {
|
|
1833
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
1834
|
+
}
|
|
1835
|
+
if (buffer.length) {
|
|
1836
|
+
return buffer[buffer.length - 1];
|
|
1837
|
+
}
|
|
1838
|
+
return defaults;
|
|
1839
|
+
},
|
|
1840
|
+
useMedium: function(data) {
|
|
1841
|
+
var item = middleware(data, assigned);
|
|
1842
|
+
buffer.push(item);
|
|
1843
|
+
return function() {
|
|
1844
|
+
buffer = buffer.filter(function(x) {
|
|
1845
|
+
return x !== item;
|
|
1846
|
+
});
|
|
1847
|
+
};
|
|
1848
|
+
},
|
|
1849
|
+
assignSyncMedium: function(cb) {
|
|
1850
|
+
assigned = true;
|
|
1851
|
+
while (buffer.length) {
|
|
1852
|
+
var cbs = buffer;
|
|
1853
|
+
buffer = [];
|
|
1854
|
+
cbs.forEach(cb);
|
|
1855
|
+
}
|
|
1856
|
+
buffer = {
|
|
1857
|
+
push: function(x) {
|
|
1858
|
+
return cb(x);
|
|
1859
|
+
},
|
|
1860
|
+
filter: function() {
|
|
1861
|
+
return buffer;
|
|
1862
|
+
}
|
|
1863
|
+
};
|
|
1864
|
+
},
|
|
1865
|
+
assignMedium: function(cb) {
|
|
1866
|
+
assigned = true;
|
|
1867
|
+
var pendingQueue = [];
|
|
1868
|
+
if (buffer.length) {
|
|
1869
|
+
var cbs = buffer;
|
|
1870
|
+
buffer = [];
|
|
1871
|
+
cbs.forEach(cb);
|
|
1872
|
+
pendingQueue = buffer;
|
|
1873
|
+
}
|
|
1874
|
+
var executeQueue = function() {
|
|
1875
|
+
var cbs2 = pendingQueue;
|
|
1876
|
+
pendingQueue = [];
|
|
1877
|
+
cbs2.forEach(cb);
|
|
1878
|
+
};
|
|
1879
|
+
var cycle = function() {
|
|
1880
|
+
return Promise.resolve().then(executeQueue);
|
|
1881
|
+
};
|
|
1882
|
+
cycle();
|
|
1883
|
+
buffer = {
|
|
1884
|
+
push: function(x) {
|
|
1885
|
+
pendingQueue.push(x);
|
|
1886
|
+
cycle();
|
|
1887
|
+
},
|
|
1888
|
+
filter: function(filter) {
|
|
1889
|
+
pendingQueue = pendingQueue.filter(filter);
|
|
1890
|
+
return buffer;
|
|
1891
|
+
}
|
|
1892
|
+
};
|
|
1893
|
+
}
|
|
1894
|
+
};
|
|
1895
|
+
return medium;
|
|
1896
|
+
}
|
|
1897
|
+
function createSidecarMedium(options) {
|
|
1898
|
+
if (options === void 0) {
|
|
1899
|
+
options = {};
|
|
1900
|
+
}
|
|
1901
|
+
var medium = innerCreateMedium(null);
|
|
1902
|
+
medium.options = __assign({ async: true, ssr: false }, options);
|
|
1903
|
+
return medium;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
// ../../node_modules/.pnpm/use-sidecar@1.1.2_@types+react@18.2.67_react@18.2.0/node_modules/use-sidecar/dist/es2015/exports.js
|
|
1907
|
+
import * as React3 from "react";
|
|
1908
|
+
var SideCar = function(_a) {
|
|
1909
|
+
var sideCar = _a.sideCar, rest = __rest(_a, ["sideCar"]);
|
|
1910
|
+
if (!sideCar) {
|
|
1911
|
+
throw new Error("Sidecar: please provide `sideCar` property to import the right car");
|
|
1912
|
+
}
|
|
1913
|
+
var Target = sideCar.read();
|
|
1914
|
+
if (!Target) {
|
|
1915
|
+
throw new Error("Sidecar medium not found");
|
|
1916
|
+
}
|
|
1917
|
+
return React3.createElement(Target, __assign({}, rest));
|
|
1918
|
+
};
|
|
1919
|
+
SideCar.isSideCarExport = true;
|
|
1920
|
+
function exportSidecar(medium, exported) {
|
|
1921
|
+
medium.useMedium(exported);
|
|
1922
|
+
return SideCar;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/medium.js
|
|
1926
|
+
var effectCar = createSidecarMedium();
|
|
1927
|
+
|
|
1928
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/UI.js
|
|
1929
|
+
var nothing = function() {
|
|
1930
|
+
return;
|
|
1931
|
+
};
|
|
1932
|
+
var RemoveScroll = React4.forwardRef(function(props, parentRef) {
|
|
1933
|
+
var ref = React4.useRef(null);
|
|
1934
|
+
var _a = React4.useState({
|
|
1935
|
+
onScrollCapture: nothing,
|
|
1936
|
+
onWheelCapture: nothing,
|
|
1937
|
+
onTouchMoveCapture: nothing
|
|
1938
|
+
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
1939
|
+
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as"]);
|
|
1940
|
+
var SideCar2 = sideCar;
|
|
1941
|
+
var containerRef = useMergeRefs([ref, parentRef]);
|
|
1942
|
+
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
1943
|
+
return React4.createElement(
|
|
1944
|
+
React4.Fragment,
|
|
1945
|
+
null,
|
|
1946
|
+
enabled && React4.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref }),
|
|
1947
|
+
forwardProps ? React4.cloneElement(React4.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : React4.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
1948
|
+
);
|
|
1949
|
+
});
|
|
1950
|
+
RemoveScroll.defaultProps = {
|
|
1951
|
+
enabled: true,
|
|
1952
|
+
removeScrollBar: true,
|
|
1953
|
+
inert: false
|
|
1954
|
+
};
|
|
1955
|
+
RemoveScroll.classNames = {
|
|
1956
|
+
fullWidth: fullWidthClassName,
|
|
1957
|
+
zeroRight: zeroRightClassName
|
|
1958
|
+
};
|
|
1959
|
+
|
|
1960
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
1961
|
+
import * as React7 from "react";
|
|
1962
|
+
|
|
1963
|
+
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.6_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
1964
|
+
import * as React6 from "react";
|
|
1965
|
+
|
|
1966
|
+
// ../../node_modules/.pnpm/react-style-singleton@2.2.1_@types+react@18.2.67_react@18.2.0/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
1967
|
+
import * as React5 from "react";
|
|
1968
|
+
|
|
1969
|
+
// ../../node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js
|
|
1970
|
+
var currentNonce;
|
|
1971
|
+
var getNonce = function() {
|
|
1972
|
+
if (currentNonce) {
|
|
1973
|
+
return currentNonce;
|
|
1974
|
+
}
|
|
1975
|
+
if (typeof __webpack_nonce__ !== "undefined") {
|
|
1976
|
+
return __webpack_nonce__;
|
|
1977
|
+
}
|
|
1978
|
+
return void 0;
|
|
1979
|
+
};
|
|
1980
|
+
|
|
1981
|
+
// ../../node_modules/.pnpm/react-style-singleton@2.2.1_@types+react@18.2.67_react@18.2.0/node_modules/react-style-singleton/dist/es2015/singleton.js
|
|
1982
|
+
function makeStyleTag() {
|
|
1983
|
+
if (!document)
|
|
1984
|
+
return null;
|
|
1985
|
+
var tag = document.createElement("style");
|
|
1986
|
+
tag.type = "text/css";
|
|
1987
|
+
var nonce = getNonce();
|
|
1988
|
+
if (nonce) {
|
|
1989
|
+
tag.setAttribute("nonce", nonce);
|
|
1990
|
+
}
|
|
1991
|
+
return tag;
|
|
1992
|
+
}
|
|
1993
|
+
function injectStyles(tag, css) {
|
|
1994
|
+
if (tag.styleSheet) {
|
|
1995
|
+
tag.styleSheet.cssText = css;
|
|
1996
|
+
} else {
|
|
1997
|
+
tag.appendChild(document.createTextNode(css));
|
|
1998
|
+
}
|
|
1999
|
+
}
|
|
2000
|
+
function insertStyleTag(tag) {
|
|
2001
|
+
var head = document.head || document.getElementsByTagName("head")[0];
|
|
2002
|
+
head.appendChild(tag);
|
|
2003
|
+
}
|
|
2004
|
+
var stylesheetSingleton = function() {
|
|
2005
|
+
var counter = 0;
|
|
2006
|
+
var stylesheet = null;
|
|
2007
|
+
return {
|
|
2008
|
+
add: function(style) {
|
|
2009
|
+
if (counter == 0) {
|
|
2010
|
+
if (stylesheet = makeStyleTag()) {
|
|
2011
|
+
injectStyles(stylesheet, style);
|
|
2012
|
+
insertStyleTag(stylesheet);
|
|
2013
|
+
}
|
|
2014
|
+
}
|
|
2015
|
+
counter++;
|
|
2016
|
+
},
|
|
2017
|
+
remove: function() {
|
|
2018
|
+
counter--;
|
|
2019
|
+
if (!counter && stylesheet) {
|
|
2020
|
+
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
2021
|
+
stylesheet = null;
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
};
|
|
2025
|
+
};
|
|
2026
|
+
|
|
2027
|
+
// ../../node_modules/.pnpm/react-style-singleton@2.2.1_@types+react@18.2.67_react@18.2.0/node_modules/react-style-singleton/dist/es2015/hook.js
|
|
2028
|
+
var styleHookSingleton = function() {
|
|
2029
|
+
var sheet = stylesheetSingleton();
|
|
2030
|
+
return function(styles, isDynamic) {
|
|
2031
|
+
React5.useEffect(function() {
|
|
2032
|
+
sheet.add(styles);
|
|
2033
|
+
return function() {
|
|
2034
|
+
sheet.remove();
|
|
2035
|
+
};
|
|
2036
|
+
}, [styles && isDynamic]);
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
|
|
2040
|
+
// ../../node_modules/.pnpm/react-style-singleton@2.2.1_@types+react@18.2.67_react@18.2.0/node_modules/react-style-singleton/dist/es2015/component.js
|
|
2041
|
+
var styleSingleton = function() {
|
|
2042
|
+
var useStyle = styleHookSingleton();
|
|
2043
|
+
var Sheet = function(_a) {
|
|
2044
|
+
var styles = _a.styles, dynamic = _a.dynamic;
|
|
2045
|
+
useStyle(styles, dynamic);
|
|
2046
|
+
return null;
|
|
2047
|
+
};
|
|
2048
|
+
return Sheet;
|
|
2049
|
+
};
|
|
2050
|
+
|
|
2051
|
+
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.6_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/utils.js
|
|
2052
|
+
var zeroGap = {
|
|
2053
|
+
left: 0,
|
|
2054
|
+
top: 0,
|
|
2055
|
+
right: 0,
|
|
2056
|
+
gap: 0
|
|
2057
|
+
};
|
|
2058
|
+
var parse = function(x) {
|
|
2059
|
+
return parseInt(x || "", 10) || 0;
|
|
2060
|
+
};
|
|
2061
|
+
var getOffset = function(gapMode) {
|
|
2062
|
+
var cs = window.getComputedStyle(document.body);
|
|
2063
|
+
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
2064
|
+
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
2065
|
+
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
2066
|
+
return [parse(left), parse(top), parse(right)];
|
|
2067
|
+
};
|
|
2068
|
+
var getGapWidth = function(gapMode) {
|
|
2069
|
+
if (gapMode === void 0) {
|
|
2070
|
+
gapMode = "margin";
|
|
2071
|
+
}
|
|
2072
|
+
if (typeof window === "undefined") {
|
|
2073
|
+
return zeroGap;
|
|
2074
|
+
}
|
|
2075
|
+
var offsets = getOffset(gapMode);
|
|
2076
|
+
var documentWidth = document.documentElement.clientWidth;
|
|
2077
|
+
var windowWidth = window.innerWidth;
|
|
2078
|
+
return {
|
|
2079
|
+
left: offsets[0],
|
|
2080
|
+
top: offsets[1],
|
|
2081
|
+
right: offsets[2],
|
|
2082
|
+
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
2083
|
+
};
|
|
2084
|
+
};
|
|
2085
|
+
|
|
2086
|
+
// ../../node_modules/.pnpm/react-remove-scroll-bar@2.3.6_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll-bar/dist/es2015/component.js
|
|
2087
|
+
var Style = styleSingleton();
|
|
2088
|
+
var lockAttribute = "data-scroll-locked";
|
|
2089
|
+
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
2090
|
+
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
2091
|
+
if (gapMode === void 0) {
|
|
2092
|
+
gapMode = "margin";
|
|
2093
|
+
}
|
|
2094
|
+
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
2095
|
+
allowRelative && "position: relative ".concat(important, ";"),
|
|
2096
|
+
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
2097
|
+
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
2098
|
+
].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
2099
|
+
};
|
|
2100
|
+
var getCurrentUseCounter = function() {
|
|
2101
|
+
var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
|
|
2102
|
+
return isFinite(counter) ? counter : 0;
|
|
2103
|
+
};
|
|
2104
|
+
var useLockAttribute = function() {
|
|
2105
|
+
React6.useEffect(function() {
|
|
2106
|
+
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
2107
|
+
return function() {
|
|
2108
|
+
var newCounter = getCurrentUseCounter() - 1;
|
|
2109
|
+
if (newCounter <= 0) {
|
|
2110
|
+
document.body.removeAttribute(lockAttribute);
|
|
2111
|
+
} else {
|
|
2112
|
+
document.body.setAttribute(lockAttribute, newCounter.toString());
|
|
2113
|
+
}
|
|
2114
|
+
};
|
|
2115
|
+
}, []);
|
|
2116
|
+
};
|
|
2117
|
+
var RemoveScrollBar = function(_a) {
|
|
2118
|
+
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
2119
|
+
useLockAttribute();
|
|
2120
|
+
var gap = React6.useMemo(function() {
|
|
2121
|
+
return getGapWidth(gapMode);
|
|
2122
|
+
}, [gapMode]);
|
|
2123
|
+
return React6.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
2124
|
+
};
|
|
2125
|
+
|
|
2126
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js
|
|
2127
|
+
var passiveSupported = false;
|
|
2128
|
+
if (typeof window !== "undefined") {
|
|
2129
|
+
try {
|
|
2130
|
+
options = Object.defineProperty({}, "passive", {
|
|
2131
|
+
get: function() {
|
|
2132
|
+
passiveSupported = true;
|
|
2133
|
+
return true;
|
|
2134
|
+
}
|
|
2135
|
+
});
|
|
2136
|
+
window.addEventListener("test", options, options);
|
|
2137
|
+
window.removeEventListener("test", options, options);
|
|
2138
|
+
} catch (err) {
|
|
2139
|
+
passiveSupported = false;
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
var options;
|
|
2143
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
2144
|
+
|
|
2145
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/handleScroll.js
|
|
2146
|
+
var alwaysContainsScroll = function(node) {
|
|
2147
|
+
return node.tagName === "TEXTAREA";
|
|
2148
|
+
};
|
|
2149
|
+
var elementCanBeScrolled = function(node, overflow) {
|
|
2150
|
+
var styles = window.getComputedStyle(node);
|
|
2151
|
+
return (
|
|
2152
|
+
// not-not-scrollable
|
|
2153
|
+
styles[overflow] !== "hidden" && // contains scroll inside self
|
|
2154
|
+
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
|
|
2155
|
+
);
|
|
2156
|
+
};
|
|
2157
|
+
var elementCouldBeVScrolled = function(node) {
|
|
2158
|
+
return elementCanBeScrolled(node, "overflowY");
|
|
2159
|
+
};
|
|
2160
|
+
var elementCouldBeHScrolled = function(node) {
|
|
2161
|
+
return elementCanBeScrolled(node, "overflowX");
|
|
2162
|
+
};
|
|
2163
|
+
var locationCouldBeScrolled = function(axis, node) {
|
|
2164
|
+
var current = node;
|
|
2165
|
+
do {
|
|
2166
|
+
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
|
|
2167
|
+
current = current.host;
|
|
2168
|
+
}
|
|
2169
|
+
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
2170
|
+
if (isScrollable) {
|
|
2171
|
+
var _a = getScrollVariables(axis, current), s = _a[1], d = _a[2];
|
|
2172
|
+
if (s > d) {
|
|
2173
|
+
return true;
|
|
2174
|
+
}
|
|
2175
|
+
}
|
|
2176
|
+
current = current.parentNode;
|
|
2177
|
+
} while (current && current !== document.body);
|
|
2178
|
+
return false;
|
|
2179
|
+
};
|
|
2180
|
+
var getVScrollVariables = function(_a) {
|
|
2181
|
+
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
2182
|
+
return [
|
|
2183
|
+
scrollTop,
|
|
2184
|
+
scrollHeight,
|
|
2185
|
+
clientHeight
|
|
2186
|
+
];
|
|
2187
|
+
};
|
|
2188
|
+
var getHScrollVariables = function(_a) {
|
|
2189
|
+
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
2190
|
+
return [
|
|
2191
|
+
scrollLeft,
|
|
2192
|
+
scrollWidth,
|
|
2193
|
+
clientWidth
|
|
2194
|
+
];
|
|
2195
|
+
};
|
|
2196
|
+
var elementCouldBeScrolled = function(axis, node) {
|
|
2197
|
+
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
2198
|
+
};
|
|
2199
|
+
var getScrollVariables = function(axis, node) {
|
|
2200
|
+
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
2201
|
+
};
|
|
2202
|
+
var getDirectionFactor = function(axis, direction) {
|
|
2203
|
+
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
2204
|
+
};
|
|
2205
|
+
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
2206
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
2207
|
+
var delta = directionFactor * sourceDelta;
|
|
2208
|
+
var target = event.target;
|
|
2209
|
+
var targetInLock = endTarget.contains(target);
|
|
2210
|
+
var shouldCancelScroll = false;
|
|
2211
|
+
var isDeltaPositive = delta > 0;
|
|
2212
|
+
var availableScroll = 0;
|
|
2213
|
+
var availableScrollTop = 0;
|
|
2214
|
+
do {
|
|
2215
|
+
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
2216
|
+
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
2217
|
+
if (position || elementScroll) {
|
|
2218
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
2219
|
+
availableScroll += elementScroll;
|
|
2220
|
+
availableScrollTop += position;
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
target = target.parentNode;
|
|
2224
|
+
} while (
|
|
2225
|
+
// portaled content
|
|
2226
|
+
!targetInLock && target !== document.body || // self content
|
|
2227
|
+
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
2228
|
+
);
|
|
2229
|
+
if (isDeltaPositive && (noOverscroll && availableScroll === 0 || !noOverscroll && delta > availableScroll)) {
|
|
2230
|
+
shouldCancelScroll = true;
|
|
2231
|
+
} else if (!isDeltaPositive && (noOverscroll && availableScrollTop === 0 || !noOverscroll && -delta > availableScrollTop)) {
|
|
2232
|
+
shouldCancelScroll = true;
|
|
2233
|
+
}
|
|
2234
|
+
return shouldCancelScroll;
|
|
2235
|
+
};
|
|
2236
|
+
|
|
2237
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/SideEffect.js
|
|
2238
|
+
var getTouchXY = function(event) {
|
|
2239
|
+
return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
2240
|
+
};
|
|
2241
|
+
var getDeltaXY = function(event) {
|
|
2242
|
+
return [event.deltaX, event.deltaY];
|
|
2243
|
+
};
|
|
2244
|
+
var extractRef = function(ref) {
|
|
2245
|
+
return ref && "current" in ref ? ref.current : ref;
|
|
2246
|
+
};
|
|
2247
|
+
var deltaCompare = function(x, y) {
|
|
2248
|
+
return x[0] === y[0] && x[1] === y[1];
|
|
2249
|
+
};
|
|
2250
|
+
var generateStyle = function(id) {
|
|
2251
|
+
return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
|
|
2252
|
+
};
|
|
2253
|
+
var idCounter = 0;
|
|
2254
|
+
var lockStack = [];
|
|
2255
|
+
function RemoveScrollSideCar(props) {
|
|
2256
|
+
var shouldPreventQueue = React7.useRef([]);
|
|
2257
|
+
var touchStartRef = React7.useRef([0, 0]);
|
|
2258
|
+
var activeAxis = React7.useRef();
|
|
2259
|
+
var id = React7.useState(idCounter++)[0];
|
|
2260
|
+
var Style2 = React7.useState(function() {
|
|
2261
|
+
return styleSingleton();
|
|
2262
|
+
})[0];
|
|
2263
|
+
var lastProps = React7.useRef(props);
|
|
2264
|
+
React7.useEffect(function() {
|
|
2265
|
+
lastProps.current = props;
|
|
2266
|
+
}, [props]);
|
|
2267
|
+
React7.useEffect(function() {
|
|
2268
|
+
if (props.inert) {
|
|
2269
|
+
document.body.classList.add("block-interactivity-".concat(id));
|
|
2270
|
+
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
2271
|
+
allow_1.forEach(function(el) {
|
|
2272
|
+
return el.classList.add("allow-interactivity-".concat(id));
|
|
2273
|
+
});
|
|
2274
|
+
return function() {
|
|
2275
|
+
document.body.classList.remove("block-interactivity-".concat(id));
|
|
2276
|
+
allow_1.forEach(function(el) {
|
|
2277
|
+
return el.classList.remove("allow-interactivity-".concat(id));
|
|
2278
|
+
});
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
return;
|
|
2282
|
+
}, [props.inert, props.lockRef.current, props.shards]);
|
|
2283
|
+
var shouldCancelEvent = React7.useCallback(function(event, parent) {
|
|
2284
|
+
if ("touches" in event && event.touches.length === 2) {
|
|
2285
|
+
return !lastProps.current.allowPinchZoom;
|
|
2286
|
+
}
|
|
2287
|
+
var touch = getTouchXY(event);
|
|
2288
|
+
var touchStart = touchStartRef.current;
|
|
2289
|
+
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
2290
|
+
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
2291
|
+
var currentAxis;
|
|
2292
|
+
var target = event.target;
|
|
2293
|
+
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
2294
|
+
if ("touches" in event && moveDirection === "h" && target.type === "range") {
|
|
2295
|
+
return false;
|
|
2296
|
+
}
|
|
2297
|
+
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
2298
|
+
if (!canBeScrolledInMainDirection) {
|
|
2299
|
+
return true;
|
|
2300
|
+
}
|
|
2301
|
+
if (canBeScrolledInMainDirection) {
|
|
2302
|
+
currentAxis = moveDirection;
|
|
2303
|
+
} else {
|
|
2304
|
+
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
2305
|
+
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
2306
|
+
}
|
|
2307
|
+
if (!canBeScrolledInMainDirection) {
|
|
2308
|
+
return false;
|
|
2309
|
+
}
|
|
2310
|
+
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
|
|
2311
|
+
activeAxis.current = currentAxis;
|
|
2312
|
+
}
|
|
2313
|
+
if (!currentAxis) {
|
|
2314
|
+
return true;
|
|
2315
|
+
}
|
|
2316
|
+
var cancelingAxis = activeAxis.current || currentAxis;
|
|
2317
|
+
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY, true);
|
|
2318
|
+
}, []);
|
|
2319
|
+
var shouldPrevent = React7.useCallback(function(_event) {
|
|
2320
|
+
var event = _event;
|
|
2321
|
+
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style2) {
|
|
2322
|
+
return;
|
|
2323
|
+
}
|
|
2324
|
+
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
2325
|
+
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
2326
|
+
return e.name === event.type && e.target === event.target && deltaCompare(e.delta, delta);
|
|
2327
|
+
})[0];
|
|
2328
|
+
if (sourceEvent && sourceEvent.should) {
|
|
2329
|
+
if (event.cancelable) {
|
|
2330
|
+
event.preventDefault();
|
|
2331
|
+
}
|
|
2332
|
+
return;
|
|
2333
|
+
}
|
|
2334
|
+
if (!sourceEvent) {
|
|
2335
|
+
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
2336
|
+
return node.contains(event.target);
|
|
2337
|
+
});
|
|
2338
|
+
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
2339
|
+
if (shouldStop) {
|
|
2340
|
+
if (event.cancelable) {
|
|
2341
|
+
event.preventDefault();
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
}, []);
|
|
2346
|
+
var shouldCancel = React7.useCallback(function(name, delta, target, should) {
|
|
2347
|
+
var event = { name, delta, target, should };
|
|
2348
|
+
shouldPreventQueue.current.push(event);
|
|
2349
|
+
setTimeout(function() {
|
|
2350
|
+
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
2351
|
+
return e !== event;
|
|
2352
|
+
});
|
|
2353
|
+
}, 1);
|
|
2354
|
+
}, []);
|
|
2355
|
+
var scrollTouchStart = React7.useCallback(function(event) {
|
|
2356
|
+
touchStartRef.current = getTouchXY(event);
|
|
2357
|
+
activeAxis.current = void 0;
|
|
2358
|
+
}, []);
|
|
2359
|
+
var scrollWheel = React7.useCallback(function(event) {
|
|
2360
|
+
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
2361
|
+
}, []);
|
|
2362
|
+
var scrollTouchMove = React7.useCallback(function(event) {
|
|
2363
|
+
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
2364
|
+
}, []);
|
|
2365
|
+
React7.useEffect(function() {
|
|
2366
|
+
lockStack.push(Style2);
|
|
2367
|
+
props.setCallbacks({
|
|
2368
|
+
onScrollCapture: scrollWheel,
|
|
2369
|
+
onWheelCapture: scrollWheel,
|
|
2370
|
+
onTouchMoveCapture: scrollTouchMove
|
|
2371
|
+
});
|
|
2372
|
+
document.addEventListener("wheel", shouldPrevent, nonPassive);
|
|
2373
|
+
document.addEventListener("touchmove", shouldPrevent, nonPassive);
|
|
2374
|
+
document.addEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
2375
|
+
return function() {
|
|
2376
|
+
lockStack = lockStack.filter(function(inst) {
|
|
2377
|
+
return inst !== Style2;
|
|
2378
|
+
});
|
|
2379
|
+
document.removeEventListener("wheel", shouldPrevent, nonPassive);
|
|
2380
|
+
document.removeEventListener("touchmove", shouldPrevent, nonPassive);
|
|
2381
|
+
document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
2382
|
+
};
|
|
2383
|
+
}, []);
|
|
2384
|
+
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
2385
|
+
return React7.createElement(
|
|
2386
|
+
React7.Fragment,
|
|
2387
|
+
null,
|
|
2388
|
+
inert ? React7.createElement(Style2, { styles: generateStyle(id) }) : null,
|
|
2389
|
+
removeScrollBar ? React7.createElement(RemoveScrollBar, { gapMode: "margin" }) : null
|
|
2390
|
+
);
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.js
|
|
2394
|
+
var sidecar_default = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
2395
|
+
|
|
2396
|
+
// ../../node_modules/.pnpm/react-remove-scroll@2.5.5_@types+react@18.2.67_react@18.2.0/node_modules/react-remove-scroll/dist/es2015/Combination.js
|
|
2397
|
+
var ReactRemoveScroll = React8.forwardRef(function(props, ref) {
|
|
2398
|
+
return React8.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: sidecar_default }));
|
|
2399
|
+
});
|
|
2400
|
+
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
2401
|
+
var Combination_default = ReactRemoveScroll;
|
|
2402
|
+
|
|
2403
|
+
// ../../node_modules/.pnpm/@radix-ui+react-select@2.0.0_@types+react-dom@18.2.22_@types+react@18.2.67_react-dom@18.2.0_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.mjs
|
|
2404
|
+
var $cc7e05a45900e73f$var$OPEN_KEYS = [
|
|
2405
|
+
" ",
|
|
2406
|
+
"Enter",
|
|
2407
|
+
"ArrowUp",
|
|
2408
|
+
"ArrowDown"
|
|
2409
|
+
];
|
|
2410
|
+
var $cc7e05a45900e73f$var$SELECTION_KEYS = [
|
|
2411
|
+
" ",
|
|
2412
|
+
"Enter"
|
|
2413
|
+
];
|
|
2414
|
+
var $cc7e05a45900e73f$var$SELECT_NAME = "Select";
|
|
2415
|
+
var [$cc7e05a45900e73f$var$Collection, $cc7e05a45900e73f$var$useCollection, $cc7e05a45900e73f$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($cc7e05a45900e73f$var$SELECT_NAME);
|
|
2416
|
+
var [$cc7e05a45900e73f$var$createSelectContext, $cc7e05a45900e73f$export$286727a75dc039bd] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($cc7e05a45900e73f$var$SELECT_NAME, [
|
|
2417
|
+
$cc7e05a45900e73f$var$createCollectionScope,
|
|
2418
|
+
$cf1ac5d9fe0e8206$export$722aac194ae923
|
|
2419
|
+
]);
|
|
2420
|
+
var $cc7e05a45900e73f$var$usePopperScope = $cf1ac5d9fe0e8206$export$722aac194ae923();
|
|
2421
|
+
var [$cc7e05a45900e73f$var$SelectProvider, $cc7e05a45900e73f$var$useSelectContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
2422
|
+
var [$cc7e05a45900e73f$var$SelectNativeOptionsProvider, $cc7e05a45900e73f$var$useSelectNativeOptionsContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$SELECT_NAME);
|
|
2423
|
+
var $cc7e05a45900e73f$export$ef9b1a59e592288f = (props) => {
|
|
2424
|
+
const { __scopeSelect, children, open: openProp, defaultOpen, onOpenChange, value: valueProp, defaultValue, onValueChange, dir, name, autoComplete, disabled, required } = props;
|
|
2425
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
2426
|
+
const [trigger, setTrigger] = $01b9c$useState(null);
|
|
2427
|
+
const [valueNode, setValueNode] = $01b9c$useState(null);
|
|
2428
|
+
const [valueNodeHasChildren, setValueNodeHasChildren] = $01b9c$useState(false);
|
|
2429
|
+
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
2430
|
+
const [open = false, setOpen] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
2431
|
+
prop: openProp,
|
|
2432
|
+
defaultProp: defaultOpen,
|
|
2433
|
+
onChange: onOpenChange
|
|
2434
|
+
});
|
|
2435
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
2436
|
+
prop: valueProp,
|
|
2437
|
+
defaultProp: defaultValue,
|
|
2438
|
+
onChange: onValueChange
|
|
2439
|
+
});
|
|
2440
|
+
const triggerPointerDownPosRef = $01b9c$useRef(null);
|
|
2441
|
+
const isFormControl = trigger ? Boolean(trigger.closest("form")) : true;
|
|
2442
|
+
const [nativeOptionsSet, setNativeOptionsSet] = $01b9c$useState(/* @__PURE__ */ new Set());
|
|
2443
|
+
const nativeSelectKey = Array.from(nativeOptionsSet).map(
|
|
2444
|
+
(option) => option.props.value
|
|
2445
|
+
).join(";");
|
|
2446
|
+
return /* @__PURE__ */ $01b9c$createElement($cf1ac5d9fe0e8206$export$be92b6f5f03c0fe9, popperScope, /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectProvider, {
|
|
2447
|
+
required,
|
|
2448
|
+
scope: __scopeSelect,
|
|
2449
|
+
trigger,
|
|
2450
|
+
onTriggerChange: setTrigger,
|
|
2451
|
+
valueNode,
|
|
2452
|
+
onValueNodeChange: setValueNode,
|
|
2453
|
+
valueNodeHasChildren,
|
|
2454
|
+
onValueNodeHasChildrenChange: setValueNodeHasChildren,
|
|
2455
|
+
contentId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
2456
|
+
value,
|
|
2457
|
+
onValueChange: setValue,
|
|
2458
|
+
open,
|
|
2459
|
+
onOpenChange: setOpen,
|
|
2460
|
+
dir: direction,
|
|
2461
|
+
triggerPointerDownPosRef,
|
|
2462
|
+
disabled
|
|
2463
|
+
}, /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$Collection.Provider, {
|
|
2464
|
+
scope: __scopeSelect
|
|
2465
|
+
}, /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectNativeOptionsProvider, {
|
|
2466
|
+
scope: props.__scopeSelect,
|
|
2467
|
+
onNativeOptionAdd: $01b9c$useCallback((option) => {
|
|
2468
|
+
setNativeOptionsSet(
|
|
2469
|
+
(prev) => new Set(prev).add(option)
|
|
2470
|
+
);
|
|
2471
|
+
}, []),
|
|
2472
|
+
onNativeOptionRemove: $01b9c$useCallback((option) => {
|
|
2473
|
+
setNativeOptionsSet((prev) => {
|
|
2474
|
+
const optionsSet = new Set(prev);
|
|
2475
|
+
optionsSet.delete(option);
|
|
2476
|
+
return optionsSet;
|
|
2477
|
+
});
|
|
2478
|
+
}, [])
|
|
2479
|
+
}, children)), isFormControl ? /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$BubbleSelect, {
|
|
2480
|
+
key: nativeSelectKey,
|
|
2481
|
+
"aria-hidden": true,
|
|
2482
|
+
required,
|
|
2483
|
+
tabIndex: -1,
|
|
2484
|
+
name,
|
|
2485
|
+
autoComplete,
|
|
2486
|
+
value,
|
|
2487
|
+
onChange: (event) => setValue(event.target.value),
|
|
2488
|
+
disabled
|
|
2489
|
+
}, value === void 0 ? /* @__PURE__ */ $01b9c$createElement("option", {
|
|
2490
|
+
value: ""
|
|
2491
|
+
}) : null, Array.from(nativeOptionsSet)) : null));
|
|
2492
|
+
};
|
|
2493
|
+
var $cc7e05a45900e73f$var$TRIGGER_NAME = "SelectTrigger";
|
|
2494
|
+
var $cc7e05a45900e73f$export$3ac1e88a1c0b9f1 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
2495
|
+
const { __scopeSelect, disabled = false, ...triggerProps } = props;
|
|
2496
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
2497
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$TRIGGER_NAME, __scopeSelect);
|
|
2498
|
+
const isDisabled = context.disabled || disabled;
|
|
2499
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onTriggerChange);
|
|
2500
|
+
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
2501
|
+
const [searchRef, handleTypeaheadSearch, resetTypeahead] = $cc7e05a45900e73f$var$useTypeaheadSearch((search) => {
|
|
2502
|
+
const enabledItems = getItems().filter(
|
|
2503
|
+
(item) => !item.disabled
|
|
2504
|
+
);
|
|
2505
|
+
const currentItem = enabledItems.find(
|
|
2506
|
+
(item) => item.value === context.value
|
|
2507
|
+
);
|
|
2508
|
+
const nextItem = $cc7e05a45900e73f$var$findNextItem(enabledItems, search, currentItem);
|
|
2509
|
+
if (nextItem !== void 0)
|
|
2510
|
+
context.onValueChange(nextItem.value);
|
|
2511
|
+
});
|
|
2512
|
+
const handleOpen = () => {
|
|
2513
|
+
if (!isDisabled) {
|
|
2514
|
+
context.onOpenChange(true);
|
|
2515
|
+
resetTypeahead();
|
|
2516
|
+
}
|
|
2517
|
+
};
|
|
2518
|
+
return /* @__PURE__ */ $01b9c$createElement($cf1ac5d9fe0e8206$export$b688253958b8dfe7, _extends({
|
|
2519
|
+
asChild: true
|
|
2520
|
+
}, popperScope), /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
2521
|
+
type: "button",
|
|
2522
|
+
role: "combobox",
|
|
2523
|
+
"aria-controls": context.contentId,
|
|
2524
|
+
"aria-expanded": context.open,
|
|
2525
|
+
"aria-required": context.required,
|
|
2526
|
+
"aria-autocomplete": "none",
|
|
2527
|
+
dir: context.dir,
|
|
2528
|
+
"data-state": context.open ? "open" : "closed",
|
|
2529
|
+
disabled: isDisabled,
|
|
2530
|
+
"data-disabled": isDisabled ? "" : void 0,
|
|
2531
|
+
"data-placeholder": $cc7e05a45900e73f$var$shouldShowPlaceholder(context.value) ? "" : void 0
|
|
2532
|
+
}, triggerProps, {
|
|
2533
|
+
ref: composedRefs,
|
|
2534
|
+
onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onClick, (event) => {
|
|
2535
|
+
event.currentTarget.focus();
|
|
2536
|
+
}),
|
|
2537
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onPointerDown, (event) => {
|
|
2538
|
+
const target = event.target;
|
|
2539
|
+
if (target.hasPointerCapture(event.pointerId))
|
|
2540
|
+
target.releasePointerCapture(event.pointerId);
|
|
2541
|
+
if (event.button === 0 && event.ctrlKey === false) {
|
|
2542
|
+
handleOpen();
|
|
2543
|
+
context.triggerPointerDownPosRef.current = {
|
|
2544
|
+
x: Math.round(event.pageX),
|
|
2545
|
+
y: Math.round(event.pageY)
|
|
2546
|
+
};
|
|
2547
|
+
event.preventDefault();
|
|
2548
|
+
}
|
|
2549
|
+
}),
|
|
2550
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(triggerProps.onKeyDown, (event) => {
|
|
2551
|
+
const isTypingAhead = searchRef.current !== "";
|
|
2552
|
+
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
2553
|
+
if (!isModifierKey && event.key.length === 1)
|
|
2554
|
+
handleTypeaheadSearch(event.key);
|
|
2555
|
+
if (isTypingAhead && event.key === " ")
|
|
2556
|
+
return;
|
|
2557
|
+
if ($cc7e05a45900e73f$var$OPEN_KEYS.includes(event.key)) {
|
|
2558
|
+
handleOpen();
|
|
2559
|
+
event.preventDefault();
|
|
2560
|
+
}
|
|
2561
|
+
})
|
|
2562
|
+
})));
|
|
2563
|
+
});
|
|
2564
|
+
var $cc7e05a45900e73f$var$VALUE_NAME = "SelectValue";
|
|
2565
|
+
var $cc7e05a45900e73f$export$e288731fd71264f0 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
2566
|
+
const { __scopeSelect, className, style, children, placeholder = "", ...valueProps } = props;
|
|
2567
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$VALUE_NAME, __scopeSelect);
|
|
2568
|
+
const { onValueNodeHasChildrenChange } = context;
|
|
2569
|
+
const hasChildren = children !== void 0;
|
|
2570
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.onValueNodeChange);
|
|
2571
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
2572
|
+
onValueNodeHasChildrenChange(hasChildren);
|
|
2573
|
+
}, [
|
|
2574
|
+
onValueNodeHasChildrenChange,
|
|
2575
|
+
hasChildren
|
|
2576
|
+
]);
|
|
2577
|
+
return /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({}, valueProps, {
|
|
2578
|
+
ref: composedRefs,
|
|
2579
|
+
style: {
|
|
2580
|
+
pointerEvents: "none"
|
|
2581
|
+
}
|
|
2582
|
+
}), $cc7e05a45900e73f$var$shouldShowPlaceholder(context.value) ? /* @__PURE__ */ $01b9c$createElement($01b9c$Fragment, null, placeholder) : children);
|
|
2583
|
+
});
|
|
2584
|
+
var $cc7e05a45900e73f$export$99b400cabb58c515 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
2585
|
+
const { __scopeSelect, children, ...iconProps } = props;
|
|
2586
|
+
return /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
2587
|
+
"aria-hidden": true
|
|
2588
|
+
}, iconProps, {
|
|
2589
|
+
ref: forwardedRef
|
|
2590
|
+
}), children || "\u25BC");
|
|
2591
|
+
});
|
|
2592
|
+
var $cc7e05a45900e73f$export$b2af6c9944296213 = (props) => {
|
|
2593
|
+
return /* @__PURE__ */ $01b9c$createElement($f1701beae083dbae$export$602eac185826482c, _extends({
|
|
2594
|
+
asChild: true
|
|
2595
|
+
}, props));
|
|
2596
|
+
};
|
|
2597
|
+
var $cc7e05a45900e73f$var$CONTENT_NAME = "SelectContent";
|
|
2598
|
+
var $cc7e05a45900e73f$export$c973a4b3cb86a03d = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
2599
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, props.__scopeSelect);
|
|
2600
|
+
const [fragment, setFragment] = $01b9c$useState();
|
|
2601
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
2602
|
+
setFragment(new DocumentFragment());
|
|
2603
|
+
}, []);
|
|
2604
|
+
if (!context.open) {
|
|
2605
|
+
const frag = fragment;
|
|
2606
|
+
return frag ? /* @__PURE__ */ $01b9c$createPortal(/* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
2607
|
+
scope: props.__scopeSelect
|
|
2608
|
+
}, /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
2609
|
+
scope: props.__scopeSelect
|
|
2610
|
+
}, /* @__PURE__ */ $01b9c$createElement("div", null, props.children))), frag) : null;
|
|
2611
|
+
}
|
|
2612
|
+
return /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectContentImpl, _extends({}, props, {
|
|
2613
|
+
ref: forwardedRef
|
|
2614
|
+
}));
|
|
2615
|
+
});
|
|
2616
|
+
var $cc7e05a45900e73f$var$CONTENT_MARGIN = 10;
|
|
2617
|
+
var [$cc7e05a45900e73f$var$SelectContentProvider, $cc7e05a45900e73f$var$useSelectContentContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME);
|
|
2618
|
+
var $cc7e05a45900e73f$var$SelectContentImpl = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
2619
|
+
const {
|
|
2620
|
+
__scopeSelect,
|
|
2621
|
+
position = "item-aligned",
|
|
2622
|
+
onCloseAutoFocus,
|
|
2623
|
+
onEscapeKeyDown,
|
|
2624
|
+
onPointerDownOutside,
|
|
2625
|
+
side,
|
|
2626
|
+
sideOffset,
|
|
2627
|
+
align,
|
|
2628
|
+
alignOffset,
|
|
2629
|
+
arrowPadding,
|
|
2630
|
+
collisionBoundary,
|
|
2631
|
+
collisionPadding,
|
|
2632
|
+
sticky,
|
|
2633
|
+
hideWhenDetached,
|
|
2634
|
+
avoidCollisions,
|
|
2635
|
+
//
|
|
2636
|
+
...contentProps
|
|
2637
|
+
} = props;
|
|
2638
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
2639
|
+
const [content, setContent] = $01b9c$useState(null);
|
|
2640
|
+
const [viewport, setViewport] = $01b9c$useState(null);
|
|
2641
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
2642
|
+
forwardedRef,
|
|
2643
|
+
(node) => setContent(node)
|
|
2644
|
+
);
|
|
2645
|
+
const [selectedItem, setSelectedItem] = $01b9c$useState(null);
|
|
2646
|
+
const [selectedItemText, setSelectedItemText] = $01b9c$useState(null);
|
|
2647
|
+
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
2648
|
+
const [isPositioned, setIsPositioned] = $01b9c$useState(false);
|
|
2649
|
+
const firstValidItemFoundRef = $01b9c$useRef(false);
|
|
2650
|
+
$01b9c$useEffect(() => {
|
|
2651
|
+
if (content)
|
|
2652
|
+
return hideOthers(content);
|
|
2653
|
+
}, [
|
|
2654
|
+
content
|
|
2655
|
+
]);
|
|
2656
|
+
$3db38b7d1fb3fe6a$export$b7ece24a22aeda8c();
|
|
2657
|
+
const focusFirst = $01b9c$useCallback((candidates) => {
|
|
2658
|
+
const [firstItem, ...restItems] = getItems().map(
|
|
2659
|
+
(item) => item.ref.current
|
|
2660
|
+
);
|
|
2661
|
+
const [lastItem] = restItems.slice(-1);
|
|
2662
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
2663
|
+
for (const candidate of candidates) {
|
|
2664
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT)
|
|
2665
|
+
return;
|
|
2666
|
+
candidate === null || candidate === void 0 || candidate.scrollIntoView({
|
|
2667
|
+
block: "nearest"
|
|
2668
|
+
});
|
|
2669
|
+
if (candidate === firstItem && viewport)
|
|
2670
|
+
viewport.scrollTop = 0;
|
|
2671
|
+
if (candidate === lastItem && viewport)
|
|
2672
|
+
viewport.scrollTop = viewport.scrollHeight;
|
|
2673
|
+
candidate === null || candidate === void 0 || candidate.focus();
|
|
2674
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT)
|
|
2675
|
+
return;
|
|
2676
|
+
}
|
|
2677
|
+
}, [
|
|
2678
|
+
getItems,
|
|
2679
|
+
viewport
|
|
2680
|
+
]);
|
|
2681
|
+
const focusSelectedItem = $01b9c$useCallback(
|
|
2682
|
+
() => focusFirst([
|
|
2683
|
+
selectedItem,
|
|
2684
|
+
content
|
|
2685
|
+
]),
|
|
2686
|
+
[
|
|
2687
|
+
focusFirst,
|
|
2688
|
+
selectedItem,
|
|
2689
|
+
content
|
|
2690
|
+
]
|
|
2691
|
+
);
|
|
2692
|
+
$01b9c$useEffect(() => {
|
|
2693
|
+
if (isPositioned)
|
|
2694
|
+
focusSelectedItem();
|
|
2695
|
+
}, [
|
|
2696
|
+
isPositioned,
|
|
2697
|
+
focusSelectedItem
|
|
2698
|
+
]);
|
|
2699
|
+
const { onOpenChange, triggerPointerDownPosRef } = context;
|
|
2700
|
+
$01b9c$useEffect(() => {
|
|
2701
|
+
if (content) {
|
|
2702
|
+
let pointerMoveDelta = {
|
|
2703
|
+
x: 0,
|
|
2704
|
+
y: 0
|
|
2705
|
+
};
|
|
2706
|
+
const handlePointerMove = (event) => {
|
|
2707
|
+
var _triggerPointerDownPo, _triggerPointerDownPo2, _triggerPointerDownPo3, _triggerPointerDownPo4;
|
|
2708
|
+
pointerMoveDelta = {
|
|
2709
|
+
x: Math.abs(Math.round(event.pageX) - ((_triggerPointerDownPo = (_triggerPointerDownPo2 = triggerPointerDownPosRef.current) === null || _triggerPointerDownPo2 === void 0 ? void 0 : _triggerPointerDownPo2.x) !== null && _triggerPointerDownPo !== void 0 ? _triggerPointerDownPo : 0)),
|
|
2710
|
+
y: Math.abs(Math.round(event.pageY) - ((_triggerPointerDownPo3 = (_triggerPointerDownPo4 = triggerPointerDownPosRef.current) === null || _triggerPointerDownPo4 === void 0 ? void 0 : _triggerPointerDownPo4.y) !== null && _triggerPointerDownPo3 !== void 0 ? _triggerPointerDownPo3 : 0))
|
|
2711
|
+
};
|
|
2712
|
+
};
|
|
2713
|
+
const handlePointerUp = (event) => {
|
|
2714
|
+
if (pointerMoveDelta.x <= 10 && pointerMoveDelta.y <= 10)
|
|
2715
|
+
event.preventDefault();
|
|
2716
|
+
else if (!content.contains(event.target))
|
|
2717
|
+
onOpenChange(false);
|
|
2718
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
2719
|
+
triggerPointerDownPosRef.current = null;
|
|
2720
|
+
};
|
|
2721
|
+
if (triggerPointerDownPosRef.current !== null) {
|
|
2722
|
+
document.addEventListener("pointermove", handlePointerMove);
|
|
2723
|
+
document.addEventListener("pointerup", handlePointerUp, {
|
|
2724
|
+
capture: true,
|
|
2725
|
+
once: true
|
|
2726
|
+
});
|
|
2727
|
+
}
|
|
2728
|
+
return () => {
|
|
2729
|
+
document.removeEventListener("pointermove", handlePointerMove);
|
|
2730
|
+
document.removeEventListener("pointerup", handlePointerUp, {
|
|
2731
|
+
capture: true
|
|
2732
|
+
});
|
|
2733
|
+
};
|
|
2734
|
+
}
|
|
2735
|
+
}, [
|
|
2736
|
+
content,
|
|
2737
|
+
onOpenChange,
|
|
2738
|
+
triggerPointerDownPosRef
|
|
2739
|
+
]);
|
|
2740
|
+
$01b9c$useEffect(() => {
|
|
2741
|
+
const close = () => onOpenChange(false);
|
|
2742
|
+
window.addEventListener("blur", close);
|
|
2743
|
+
window.addEventListener("resize", close);
|
|
2744
|
+
return () => {
|
|
2745
|
+
window.removeEventListener("blur", close);
|
|
2746
|
+
window.removeEventListener("resize", close);
|
|
2747
|
+
};
|
|
2748
|
+
}, [
|
|
2749
|
+
onOpenChange
|
|
2750
|
+
]);
|
|
2751
|
+
const [searchRef, handleTypeaheadSearch] = $cc7e05a45900e73f$var$useTypeaheadSearch((search) => {
|
|
2752
|
+
const enabledItems = getItems().filter(
|
|
2753
|
+
(item) => !item.disabled
|
|
2754
|
+
);
|
|
2755
|
+
const currentItem = enabledItems.find(
|
|
2756
|
+
(item) => item.ref.current === document.activeElement
|
|
2757
|
+
);
|
|
2758
|
+
const nextItem = $cc7e05a45900e73f$var$findNextItem(enabledItems, search, currentItem);
|
|
2759
|
+
if (nextItem)
|
|
2760
|
+
setTimeout(
|
|
2761
|
+
() => nextItem.ref.current.focus()
|
|
2762
|
+
);
|
|
2763
|
+
});
|
|
2764
|
+
const itemRefCallback = $01b9c$useCallback((node, value, disabled) => {
|
|
2765
|
+
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
2766
|
+
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
2767
|
+
if (isSelectedItem || isFirstValidItem) {
|
|
2768
|
+
setSelectedItem(node);
|
|
2769
|
+
if (isFirstValidItem)
|
|
2770
|
+
firstValidItemFoundRef.current = true;
|
|
2771
|
+
}
|
|
2772
|
+
}, [
|
|
2773
|
+
context.value
|
|
2774
|
+
]);
|
|
2775
|
+
const handleItemLeave = $01b9c$useCallback(
|
|
2776
|
+
() => content === null || content === void 0 ? void 0 : content.focus(),
|
|
2777
|
+
[
|
|
2778
|
+
content
|
|
2779
|
+
]
|
|
2780
|
+
);
|
|
2781
|
+
const itemTextRefCallback = $01b9c$useCallback((node, value, disabled) => {
|
|
2782
|
+
const isFirstValidItem = !firstValidItemFoundRef.current && !disabled;
|
|
2783
|
+
const isSelectedItem = context.value !== void 0 && context.value === value;
|
|
2784
|
+
if (isSelectedItem || isFirstValidItem)
|
|
2785
|
+
setSelectedItemText(node);
|
|
2786
|
+
}, [
|
|
2787
|
+
context.value
|
|
2788
|
+
]);
|
|
2789
|
+
const SelectPosition = position === "popper" ? $cc7e05a45900e73f$var$SelectPopperPosition : $cc7e05a45900e73f$var$SelectItemAlignedPosition;
|
|
2790
|
+
const popperContentProps = SelectPosition === $cc7e05a45900e73f$var$SelectPopperPosition ? {
|
|
2791
|
+
side,
|
|
2792
|
+
sideOffset,
|
|
2793
|
+
align,
|
|
2794
|
+
alignOffset,
|
|
2795
|
+
arrowPadding,
|
|
2796
|
+
collisionBoundary,
|
|
2797
|
+
collisionPadding,
|
|
2798
|
+
sticky,
|
|
2799
|
+
hideWhenDetached,
|
|
2800
|
+
avoidCollisions
|
|
2801
|
+
} : {};
|
|
2802
|
+
return /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectContentProvider, {
|
|
2803
|
+
scope: __scopeSelect,
|
|
2804
|
+
content,
|
|
2805
|
+
viewport,
|
|
2806
|
+
onViewportChange: setViewport,
|
|
2807
|
+
itemRefCallback,
|
|
2808
|
+
selectedItem,
|
|
2809
|
+
onItemLeave: handleItemLeave,
|
|
2810
|
+
itemTextRefCallback,
|
|
2811
|
+
focusSelectedItem,
|
|
2812
|
+
selectedItemText,
|
|
2813
|
+
position,
|
|
2814
|
+
isPositioned,
|
|
2815
|
+
searchRef
|
|
2816
|
+
}, /* @__PURE__ */ $01b9c$createElement(Combination_default, {
|
|
2817
|
+
as: $5e63c961fc1ce211$export$8c6ed5c666ac1360,
|
|
2818
|
+
allowPinchZoom: true
|
|
2819
|
+
}, /* @__PURE__ */ $01b9c$createElement($d3863c46a17e8a28$export$20e40289641fbbb6, {
|
|
2820
|
+
asChild: true,
|
|
2821
|
+
trapped: context.open,
|
|
2822
|
+
onMountAutoFocus: (event) => {
|
|
2823
|
+
event.preventDefault();
|
|
2824
|
+
},
|
|
2825
|
+
onUnmountAutoFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(onCloseAutoFocus, (event) => {
|
|
2826
|
+
var _context$trigger;
|
|
2827
|
+
(_context$trigger = context.trigger) === null || _context$trigger === void 0 || _context$trigger.focus({
|
|
2828
|
+
preventScroll: true
|
|
2829
|
+
});
|
|
2830
|
+
event.preventDefault();
|
|
2831
|
+
})
|
|
2832
|
+
}, /* @__PURE__ */ $01b9c$createElement($5cb92bef7577960e$export$177fb62ff3ec1f22, {
|
|
2833
|
+
asChild: true,
|
|
2834
|
+
disableOutsidePointerEvents: true,
|
|
2835
|
+
onEscapeKeyDown,
|
|
2836
|
+
onPointerDownOutside,
|
|
2837
|
+
onFocusOutside: (event) => event.preventDefault(),
|
|
2838
|
+
onDismiss: () => context.onOpenChange(false)
|
|
2839
|
+
}, /* @__PURE__ */ $01b9c$createElement(SelectPosition, _extends({
|
|
2840
|
+
role: "listbox",
|
|
2841
|
+
id: context.contentId,
|
|
2842
|
+
"data-state": context.open ? "open" : "closed",
|
|
2843
|
+
dir: context.dir,
|
|
2844
|
+
onContextMenu: (event) => event.preventDefault()
|
|
2845
|
+
}, contentProps, popperContentProps, {
|
|
2846
|
+
onPlaced: () => setIsPositioned(true),
|
|
2847
|
+
ref: composedRefs,
|
|
2848
|
+
style: {
|
|
2849
|
+
// flex layout so we can place the scroll buttons properly
|
|
2850
|
+
display: "flex",
|
|
2851
|
+
flexDirection: "column",
|
|
2852
|
+
// reset the outline by default as the content MAY get focused
|
|
2853
|
+
outline: "none",
|
|
2854
|
+
...contentProps.style
|
|
2855
|
+
},
|
|
2856
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(contentProps.onKeyDown, (event) => {
|
|
2857
|
+
const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;
|
|
2858
|
+
if (event.key === "Tab")
|
|
2859
|
+
event.preventDefault();
|
|
2860
|
+
if (!isModifierKey && event.key.length === 1)
|
|
2861
|
+
handleTypeaheadSearch(event.key);
|
|
2862
|
+
if ([
|
|
2863
|
+
"ArrowUp",
|
|
2864
|
+
"ArrowDown",
|
|
2865
|
+
"Home",
|
|
2866
|
+
"End"
|
|
2867
|
+
].includes(event.key)) {
|
|
2868
|
+
const items = getItems().filter(
|
|
2869
|
+
(item) => !item.disabled
|
|
2870
|
+
);
|
|
2871
|
+
let candidateNodes = items.map(
|
|
2872
|
+
(item) => item.ref.current
|
|
2873
|
+
);
|
|
2874
|
+
if ([
|
|
2875
|
+
"ArrowUp",
|
|
2876
|
+
"End"
|
|
2877
|
+
].includes(event.key))
|
|
2878
|
+
candidateNodes = candidateNodes.slice().reverse();
|
|
2879
|
+
if ([
|
|
2880
|
+
"ArrowUp",
|
|
2881
|
+
"ArrowDown"
|
|
2882
|
+
].includes(event.key)) {
|
|
2883
|
+
const currentElement = event.target;
|
|
2884
|
+
const currentIndex = candidateNodes.indexOf(currentElement);
|
|
2885
|
+
candidateNodes = candidateNodes.slice(currentIndex + 1);
|
|
2886
|
+
}
|
|
2887
|
+
setTimeout(
|
|
2888
|
+
() => focusFirst(candidateNodes)
|
|
2889
|
+
);
|
|
2890
|
+
event.preventDefault();
|
|
2891
|
+
}
|
|
2892
|
+
})
|
|
2893
|
+
}))))));
|
|
2894
|
+
});
|
|
2895
|
+
var $cc7e05a45900e73f$var$SelectItemAlignedPosition = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
2896
|
+
const { __scopeSelect, onPlaced, ...popperProps } = props;
|
|
2897
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
2898
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$CONTENT_NAME, __scopeSelect);
|
|
2899
|
+
const [contentWrapper, setContentWrapper] = $01b9c$useState(null);
|
|
2900
|
+
const [content, setContent] = $01b9c$useState(null);
|
|
2901
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
2902
|
+
forwardedRef,
|
|
2903
|
+
(node) => setContent(node)
|
|
2904
|
+
);
|
|
2905
|
+
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
2906
|
+
const shouldExpandOnScrollRef = $01b9c$useRef(false);
|
|
2907
|
+
const shouldRepositionRef = $01b9c$useRef(true);
|
|
2908
|
+
const { viewport, selectedItem, selectedItemText, focusSelectedItem } = contentContext;
|
|
2909
|
+
const position = $01b9c$useCallback(() => {
|
|
2910
|
+
if (context.trigger && context.valueNode && contentWrapper && content && viewport && selectedItem && selectedItemText) {
|
|
2911
|
+
const triggerRect = context.trigger.getBoundingClientRect();
|
|
2912
|
+
const contentRect = content.getBoundingClientRect();
|
|
2913
|
+
const valueNodeRect = context.valueNode.getBoundingClientRect();
|
|
2914
|
+
const itemTextRect = selectedItemText.getBoundingClientRect();
|
|
2915
|
+
if (context.dir !== "rtl") {
|
|
2916
|
+
const itemTextOffset = itemTextRect.left - contentRect.left;
|
|
2917
|
+
const left = valueNodeRect.left - itemTextOffset;
|
|
2918
|
+
const leftDelta = triggerRect.left - left;
|
|
2919
|
+
const minContentWidth = triggerRect.width + leftDelta;
|
|
2920
|
+
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
2921
|
+
const rightEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
2922
|
+
const clampedLeft = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(left, [
|
|
2923
|
+
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
2924
|
+
rightEdge - contentWidth
|
|
2925
|
+
]);
|
|
2926
|
+
contentWrapper.style.minWidth = minContentWidth + "px";
|
|
2927
|
+
contentWrapper.style.left = clampedLeft + "px";
|
|
2928
|
+
} else {
|
|
2929
|
+
const itemTextOffset = contentRect.right - itemTextRect.right;
|
|
2930
|
+
const right = window.innerWidth - valueNodeRect.right - itemTextOffset;
|
|
2931
|
+
const rightDelta = window.innerWidth - triggerRect.right - right;
|
|
2932
|
+
const minContentWidth = triggerRect.width + rightDelta;
|
|
2933
|
+
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
2934
|
+
const leftEdge = window.innerWidth - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
2935
|
+
const clampedRight = $ae6933e535247d3d$export$7d15b64cf5a3a4c4(right, [
|
|
2936
|
+
$cc7e05a45900e73f$var$CONTENT_MARGIN,
|
|
2937
|
+
leftEdge - contentWidth
|
|
2938
|
+
]);
|
|
2939
|
+
contentWrapper.style.minWidth = minContentWidth + "px";
|
|
2940
|
+
contentWrapper.style.right = clampedRight + "px";
|
|
2941
|
+
}
|
|
2942
|
+
const items = getItems();
|
|
2943
|
+
const availableHeight = window.innerHeight - $cc7e05a45900e73f$var$CONTENT_MARGIN * 2;
|
|
2944
|
+
const itemsHeight = viewport.scrollHeight;
|
|
2945
|
+
const contentStyles = window.getComputedStyle(content);
|
|
2946
|
+
const contentBorderTopWidth = parseInt(contentStyles.borderTopWidth, 10);
|
|
2947
|
+
const contentPaddingTop = parseInt(contentStyles.paddingTop, 10);
|
|
2948
|
+
const contentBorderBottomWidth = parseInt(contentStyles.borderBottomWidth, 10);
|
|
2949
|
+
const contentPaddingBottom = parseInt(contentStyles.paddingBottom, 10);
|
|
2950
|
+
const fullContentHeight = contentBorderTopWidth + contentPaddingTop + itemsHeight + contentPaddingBottom + contentBorderBottomWidth;
|
|
2951
|
+
const minContentHeight = Math.min(selectedItem.offsetHeight * 5, fullContentHeight);
|
|
2952
|
+
const viewportStyles = window.getComputedStyle(viewport);
|
|
2953
|
+
const viewportPaddingTop = parseInt(viewportStyles.paddingTop, 10);
|
|
2954
|
+
const viewportPaddingBottom = parseInt(viewportStyles.paddingBottom, 10);
|
|
2955
|
+
const topEdgeToTriggerMiddle = triggerRect.top + triggerRect.height / 2 - $cc7e05a45900e73f$var$CONTENT_MARGIN;
|
|
2956
|
+
const triggerMiddleToBottomEdge = availableHeight - topEdgeToTriggerMiddle;
|
|
2957
|
+
const selectedItemHalfHeight = selectedItem.offsetHeight / 2;
|
|
2958
|
+
const itemOffsetMiddle = selectedItem.offsetTop + selectedItemHalfHeight;
|
|
2959
|
+
const contentTopToItemMiddle = contentBorderTopWidth + contentPaddingTop + itemOffsetMiddle;
|
|
2960
|
+
const itemMiddleToContentBottom = fullContentHeight - contentTopToItemMiddle;
|
|
2961
|
+
const willAlignWithoutTopOverflow = contentTopToItemMiddle <= topEdgeToTriggerMiddle;
|
|
2962
|
+
if (willAlignWithoutTopOverflow) {
|
|
2963
|
+
const isLastItem = selectedItem === items[items.length - 1].ref.current;
|
|
2964
|
+
contentWrapper.style.bottom = "0px";
|
|
2965
|
+
const viewportOffsetBottom = content.clientHeight - viewport.offsetTop - viewport.offsetHeight;
|
|
2966
|
+
const clampedTriggerMiddleToBottomEdge = Math.max(triggerMiddleToBottomEdge, selectedItemHalfHeight + (isLastItem ? viewportPaddingBottom : 0) + viewportOffsetBottom + contentBorderBottomWidth);
|
|
2967
|
+
const height = contentTopToItemMiddle + clampedTriggerMiddleToBottomEdge;
|
|
2968
|
+
contentWrapper.style.height = height + "px";
|
|
2969
|
+
} else {
|
|
2970
|
+
const isFirstItem = selectedItem === items[0].ref.current;
|
|
2971
|
+
contentWrapper.style.top = "0px";
|
|
2972
|
+
const clampedTopEdgeToTriggerMiddle = Math.max(topEdgeToTriggerMiddle, contentBorderTopWidth + viewport.offsetTop + (isFirstItem ? viewportPaddingTop : 0) + selectedItemHalfHeight);
|
|
2973
|
+
const height = clampedTopEdgeToTriggerMiddle + itemMiddleToContentBottom;
|
|
2974
|
+
contentWrapper.style.height = height + "px";
|
|
2975
|
+
viewport.scrollTop = contentTopToItemMiddle - topEdgeToTriggerMiddle + viewport.offsetTop;
|
|
2976
|
+
}
|
|
2977
|
+
contentWrapper.style.margin = `${$cc7e05a45900e73f$var$CONTENT_MARGIN}px 0`;
|
|
2978
|
+
contentWrapper.style.minHeight = minContentHeight + "px";
|
|
2979
|
+
contentWrapper.style.maxHeight = availableHeight + "px";
|
|
2980
|
+
onPlaced === null || onPlaced === void 0 || onPlaced();
|
|
2981
|
+
requestAnimationFrame(
|
|
2982
|
+
() => shouldExpandOnScrollRef.current = true
|
|
2983
|
+
);
|
|
2984
|
+
}
|
|
2985
|
+
}, [
|
|
2986
|
+
getItems,
|
|
2987
|
+
context.trigger,
|
|
2988
|
+
context.valueNode,
|
|
2989
|
+
contentWrapper,
|
|
2990
|
+
content,
|
|
2991
|
+
viewport,
|
|
2992
|
+
selectedItem,
|
|
2993
|
+
selectedItemText,
|
|
2994
|
+
context.dir,
|
|
2995
|
+
onPlaced
|
|
2996
|
+
]);
|
|
2997
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(
|
|
2998
|
+
() => position(),
|
|
2999
|
+
[
|
|
3000
|
+
position
|
|
3001
|
+
]
|
|
3002
|
+
);
|
|
3003
|
+
const [contentZIndex, setContentZIndex] = $01b9c$useState();
|
|
3004
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
3005
|
+
if (content)
|
|
3006
|
+
setContentZIndex(window.getComputedStyle(content).zIndex);
|
|
3007
|
+
}, [
|
|
3008
|
+
content
|
|
3009
|
+
]);
|
|
3010
|
+
const handleScrollButtonChange = $01b9c$useCallback((node) => {
|
|
3011
|
+
if (node && shouldRepositionRef.current === true) {
|
|
3012
|
+
position();
|
|
3013
|
+
focusSelectedItem === null || focusSelectedItem === void 0 || focusSelectedItem();
|
|
3014
|
+
shouldRepositionRef.current = false;
|
|
3015
|
+
}
|
|
3016
|
+
}, [
|
|
3017
|
+
position,
|
|
3018
|
+
focusSelectedItem
|
|
3019
|
+
]);
|
|
3020
|
+
return /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectViewportProvider, {
|
|
3021
|
+
scope: __scopeSelect,
|
|
3022
|
+
contentWrapper,
|
|
3023
|
+
shouldExpandOnScrollRef,
|
|
3024
|
+
onScrollButtonChange: handleScrollButtonChange
|
|
3025
|
+
}, /* @__PURE__ */ $01b9c$createElement("div", {
|
|
3026
|
+
ref: setContentWrapper,
|
|
3027
|
+
style: {
|
|
3028
|
+
display: "flex",
|
|
3029
|
+
flexDirection: "column",
|
|
3030
|
+
position: "fixed",
|
|
3031
|
+
zIndex: contentZIndex
|
|
3032
|
+
}
|
|
3033
|
+
}, /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, popperProps, {
|
|
3034
|
+
ref: composedRefs,
|
|
3035
|
+
style: {
|
|
3036
|
+
// When we get the height of the content, it includes borders. If we were to set
|
|
3037
|
+
// the height without having `boxSizing: 'border-box'` it would be too big.
|
|
3038
|
+
boxSizing: "border-box",
|
|
3039
|
+
// We need to ensure the content doesn't get taller than the wrapper
|
|
3040
|
+
maxHeight: "100%",
|
|
3041
|
+
...popperProps.style
|
|
3042
|
+
}
|
|
3043
|
+
}))));
|
|
3044
|
+
});
|
|
3045
|
+
var $cc7e05a45900e73f$var$SelectPopperPosition = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3046
|
+
const { __scopeSelect, align = "start", collisionPadding = $cc7e05a45900e73f$var$CONTENT_MARGIN, ...popperProps } = props;
|
|
3047
|
+
const popperScope = $cc7e05a45900e73f$var$usePopperScope(__scopeSelect);
|
|
3048
|
+
return /* @__PURE__ */ $01b9c$createElement($cf1ac5d9fe0e8206$export$7c6e2c02157bb7d2, _extends({}, popperScope, popperProps, {
|
|
3049
|
+
ref: forwardedRef,
|
|
3050
|
+
align,
|
|
3051
|
+
collisionPadding,
|
|
3052
|
+
style: {
|
|
3053
|
+
// Ensure border-box for floating-ui calculations
|
|
3054
|
+
boxSizing: "border-box",
|
|
3055
|
+
...popperProps.style,
|
|
3056
|
+
"--radix-select-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
3057
|
+
"--radix-select-content-available-width": "var(--radix-popper-available-width)",
|
|
3058
|
+
"--radix-select-content-available-height": "var(--radix-popper-available-height)",
|
|
3059
|
+
"--radix-select-trigger-width": "var(--radix-popper-anchor-width)",
|
|
3060
|
+
"--radix-select-trigger-height": "var(--radix-popper-anchor-height)"
|
|
3061
|
+
}
|
|
3062
|
+
}));
|
|
3063
|
+
});
|
|
3064
|
+
var [$cc7e05a45900e73f$var$SelectViewportProvider, $cc7e05a45900e73f$var$useSelectViewportContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$CONTENT_NAME, {});
|
|
3065
|
+
var $cc7e05a45900e73f$var$VIEWPORT_NAME = "SelectViewport";
|
|
3066
|
+
var $cc7e05a45900e73f$export$9ed6e7b40248d36d = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3067
|
+
const { __scopeSelect, ...viewportProps } = props;
|
|
3068
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
3069
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$VIEWPORT_NAME, __scopeSelect);
|
|
3070
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, contentContext.onViewportChange);
|
|
3071
|
+
const prevScrollTopRef = $01b9c$useRef(0);
|
|
3072
|
+
return /* @__PURE__ */ $01b9c$createElement($01b9c$Fragment, null, /* @__PURE__ */ $01b9c$createElement("style", {
|
|
3073
|
+
dangerouslySetInnerHTML: {
|
|
3074
|
+
__html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`
|
|
3075
|
+
}
|
|
3076
|
+
}), /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$Collection.Slot, {
|
|
3077
|
+
scope: __scopeSelect
|
|
3078
|
+
}, /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3079
|
+
"data-radix-select-viewport": "",
|
|
3080
|
+
role: "presentation"
|
|
3081
|
+
}, viewportProps, {
|
|
3082
|
+
ref: composedRefs,
|
|
3083
|
+
style: {
|
|
3084
|
+
// we use position: 'relative' here on the `viewport` so that when we call
|
|
3085
|
+
// `selectedItem.offsetTop` in calculations, the offset is relative to the viewport
|
|
3086
|
+
// (independent of the scrollUpButton).
|
|
3087
|
+
position: "relative",
|
|
3088
|
+
flex: 1,
|
|
3089
|
+
overflow: "auto",
|
|
3090
|
+
...viewportProps.style
|
|
3091
|
+
},
|
|
3092
|
+
onScroll: $e42e1063c40fb3ef$export$b9ecd428b558ff10(viewportProps.onScroll, (event) => {
|
|
3093
|
+
const viewport = event.currentTarget;
|
|
3094
|
+
const { contentWrapper, shouldExpandOnScrollRef } = viewportContext;
|
|
3095
|
+
if (shouldExpandOnScrollRef !== null && shouldExpandOnScrollRef !== void 0 && shouldExpandOnScrollRef.current && contentWrapper) {
|
|
3096
|
+
const scrolledBy = Math.abs(prevScrollTopRef.current - viewport.scrollTop);
|
|
3097
|
+
if (scrolledBy > 0) {
|
|
3098
|
+
const availableHeight = window.innerHeight - $cc7e05a45900e73f$var$CONTENT_MARGIN * 2;
|
|
3099
|
+
const cssMinHeight = parseFloat(contentWrapper.style.minHeight);
|
|
3100
|
+
const cssHeight = parseFloat(contentWrapper.style.height);
|
|
3101
|
+
const prevHeight = Math.max(cssMinHeight, cssHeight);
|
|
3102
|
+
if (prevHeight < availableHeight) {
|
|
3103
|
+
const nextHeight = prevHeight + scrolledBy;
|
|
3104
|
+
const clampedNextHeight = Math.min(availableHeight, nextHeight);
|
|
3105
|
+
const heightDiff = nextHeight - clampedNextHeight;
|
|
3106
|
+
contentWrapper.style.height = clampedNextHeight + "px";
|
|
3107
|
+
if (contentWrapper.style.bottom === "0px") {
|
|
3108
|
+
viewport.scrollTop = heightDiff > 0 ? heightDiff : 0;
|
|
3109
|
+
contentWrapper.style.justifyContent = "flex-end";
|
|
3110
|
+
}
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
prevScrollTopRef.current = viewport.scrollTop;
|
|
3115
|
+
})
|
|
3116
|
+
}))));
|
|
3117
|
+
});
|
|
3118
|
+
var $cc7e05a45900e73f$var$GROUP_NAME = "SelectGroup";
|
|
3119
|
+
var [$cc7e05a45900e73f$var$SelectGroupContextProvider, $cc7e05a45900e73f$var$useSelectGroupContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$GROUP_NAME);
|
|
3120
|
+
var $cc7e05a45900e73f$export$ee25a334c55de1f4 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3121
|
+
const { __scopeSelect, ...groupProps } = props;
|
|
3122
|
+
const groupId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
3123
|
+
return /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectGroupContextProvider, {
|
|
3124
|
+
scope: __scopeSelect,
|
|
3125
|
+
id: groupId
|
|
3126
|
+
}, /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3127
|
+
role: "group",
|
|
3128
|
+
"aria-labelledby": groupId
|
|
3129
|
+
}, groupProps, {
|
|
3130
|
+
ref: forwardedRef
|
|
3131
|
+
})));
|
|
3132
|
+
});
|
|
3133
|
+
var $cc7e05a45900e73f$var$LABEL_NAME = "SelectLabel";
|
|
3134
|
+
var $cc7e05a45900e73f$export$f67338d29bd972f8 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3135
|
+
const { __scopeSelect, ...labelProps } = props;
|
|
3136
|
+
const groupContext = $cc7e05a45900e73f$var$useSelectGroupContext($cc7e05a45900e73f$var$LABEL_NAME, __scopeSelect);
|
|
3137
|
+
return /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3138
|
+
id: groupContext.id
|
|
3139
|
+
}, labelProps, {
|
|
3140
|
+
ref: forwardedRef
|
|
3141
|
+
}));
|
|
3142
|
+
});
|
|
3143
|
+
var $cc7e05a45900e73f$var$ITEM_NAME = "SelectItem";
|
|
3144
|
+
var [$cc7e05a45900e73f$var$SelectItemContextProvider, $cc7e05a45900e73f$var$useSelectItemContext] = $cc7e05a45900e73f$var$createSelectContext($cc7e05a45900e73f$var$ITEM_NAME);
|
|
3145
|
+
var $cc7e05a45900e73f$export$13ef48a934230896 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3146
|
+
const { __scopeSelect, value, disabled = false, textValue: textValueProp, ...itemProps } = props;
|
|
3147
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$ITEM_NAME, __scopeSelect);
|
|
3148
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$ITEM_NAME, __scopeSelect);
|
|
3149
|
+
const isSelected = context.value === value;
|
|
3150
|
+
const [textValue, setTextValue] = $01b9c$useState(textValueProp !== null && textValueProp !== void 0 ? textValueProp : "");
|
|
3151
|
+
const [isFocused, setIsFocused] = $01b9c$useState(false);
|
|
3152
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node) => {
|
|
3153
|
+
var _contentContext$itemR;
|
|
3154
|
+
return (_contentContext$itemR = contentContext.itemRefCallback) === null || _contentContext$itemR === void 0 ? void 0 : _contentContext$itemR.call(contentContext, node, value, disabled);
|
|
3155
|
+
});
|
|
3156
|
+
const textId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
3157
|
+
const handleSelect = () => {
|
|
3158
|
+
if (!disabled) {
|
|
3159
|
+
context.onValueChange(value);
|
|
3160
|
+
context.onOpenChange(false);
|
|
3161
|
+
}
|
|
3162
|
+
};
|
|
3163
|
+
if (value === "")
|
|
3164
|
+
throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");
|
|
3165
|
+
return /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectItemContextProvider, {
|
|
3166
|
+
scope: __scopeSelect,
|
|
3167
|
+
value,
|
|
3168
|
+
disabled,
|
|
3169
|
+
textId,
|
|
3170
|
+
isSelected,
|
|
3171
|
+
onItemTextChange: $01b9c$useCallback((node) => {
|
|
3172
|
+
setTextValue((prevTextValue) => {
|
|
3173
|
+
var _node$textContent;
|
|
3174
|
+
return prevTextValue || ((_node$textContent = node === null || node === void 0 ? void 0 : node.textContent) !== null && _node$textContent !== void 0 ? _node$textContent : "").trim();
|
|
3175
|
+
});
|
|
3176
|
+
}, [])
|
|
3177
|
+
}, /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$Collection.ItemSlot, {
|
|
3178
|
+
scope: __scopeSelect,
|
|
3179
|
+
value,
|
|
3180
|
+
disabled,
|
|
3181
|
+
textValue
|
|
3182
|
+
}, /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3183
|
+
role: "option",
|
|
3184
|
+
"aria-labelledby": textId,
|
|
3185
|
+
"data-highlighted": isFocused ? "" : void 0,
|
|
3186
|
+
"aria-selected": isSelected && isFocused,
|
|
3187
|
+
"data-state": isSelected ? "checked" : "unchecked",
|
|
3188
|
+
"aria-disabled": disabled || void 0,
|
|
3189
|
+
"data-disabled": disabled ? "" : void 0,
|
|
3190
|
+
tabIndex: disabled ? void 0 : -1
|
|
3191
|
+
}, itemProps, {
|
|
3192
|
+
ref: composedRefs,
|
|
3193
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(
|
|
3194
|
+
itemProps.onFocus,
|
|
3195
|
+
() => setIsFocused(true)
|
|
3196
|
+
),
|
|
3197
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(
|
|
3198
|
+
itemProps.onBlur,
|
|
3199
|
+
() => setIsFocused(false)
|
|
3200
|
+
),
|
|
3201
|
+
onPointerUp: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerUp, handleSelect),
|
|
3202
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerMove, (event) => {
|
|
3203
|
+
if (disabled) {
|
|
3204
|
+
var _contentContext$onIte;
|
|
3205
|
+
(_contentContext$onIte = contentContext.onItemLeave) === null || _contentContext$onIte === void 0 || _contentContext$onIte.call(contentContext);
|
|
3206
|
+
} else
|
|
3207
|
+
event.currentTarget.focus({
|
|
3208
|
+
preventScroll: true
|
|
3209
|
+
});
|
|
3210
|
+
}),
|
|
3211
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onPointerLeave, (event) => {
|
|
3212
|
+
if (event.currentTarget === document.activeElement) {
|
|
3213
|
+
var _contentContext$onIte2;
|
|
3214
|
+
(_contentContext$onIte2 = contentContext.onItemLeave) === null || _contentContext$onIte2 === void 0 || _contentContext$onIte2.call(contentContext);
|
|
3215
|
+
}
|
|
3216
|
+
}),
|
|
3217
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(itemProps.onKeyDown, (event) => {
|
|
3218
|
+
var _contentContext$searc;
|
|
3219
|
+
const isTypingAhead = ((_contentContext$searc = contentContext.searchRef) === null || _contentContext$searc === void 0 ? void 0 : _contentContext$searc.current) !== "";
|
|
3220
|
+
if (isTypingAhead && event.key === " ")
|
|
3221
|
+
return;
|
|
3222
|
+
if ($cc7e05a45900e73f$var$SELECTION_KEYS.includes(event.key))
|
|
3223
|
+
handleSelect();
|
|
3224
|
+
if (event.key === " ")
|
|
3225
|
+
event.preventDefault();
|
|
3226
|
+
})
|
|
3227
|
+
}))));
|
|
3228
|
+
});
|
|
3229
|
+
var $cc7e05a45900e73f$var$ITEM_TEXT_NAME = "SelectItemText";
|
|
3230
|
+
var $cc7e05a45900e73f$export$3572fb0fb821ff49 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3231
|
+
const { __scopeSelect, className, style, ...itemTextProps } = props;
|
|
3232
|
+
const context = $cc7e05a45900e73f$var$useSelectContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
3233
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
3234
|
+
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
3235
|
+
const nativeOptionsContext = $cc7e05a45900e73f$var$useSelectNativeOptionsContext($cc7e05a45900e73f$var$ITEM_TEXT_NAME, __scopeSelect);
|
|
3236
|
+
const [itemTextNode, setItemTextNode] = $01b9c$useState(null);
|
|
3237
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(
|
|
3238
|
+
forwardedRef,
|
|
3239
|
+
(node) => setItemTextNode(node),
|
|
3240
|
+
itemContext.onItemTextChange,
|
|
3241
|
+
(node) => {
|
|
3242
|
+
var _contentContext$itemT;
|
|
3243
|
+
return (_contentContext$itemT = contentContext.itemTextRefCallback) === null || _contentContext$itemT === void 0 ? void 0 : _contentContext$itemT.call(contentContext, node, itemContext.value, itemContext.disabled);
|
|
3244
|
+
}
|
|
3245
|
+
);
|
|
3246
|
+
const textContent = itemTextNode === null || itemTextNode === void 0 ? void 0 : itemTextNode.textContent;
|
|
3247
|
+
const nativeOption = $01b9c$useMemo(
|
|
3248
|
+
() => /* @__PURE__ */ $01b9c$createElement("option", {
|
|
3249
|
+
key: itemContext.value,
|
|
3250
|
+
value: itemContext.value,
|
|
3251
|
+
disabled: itemContext.disabled
|
|
3252
|
+
}, textContent),
|
|
3253
|
+
[
|
|
3254
|
+
itemContext.disabled,
|
|
3255
|
+
itemContext.value,
|
|
3256
|
+
textContent
|
|
3257
|
+
]
|
|
3258
|
+
);
|
|
3259
|
+
const { onNativeOptionAdd, onNativeOptionRemove } = nativeOptionsContext;
|
|
3260
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
3261
|
+
onNativeOptionAdd(nativeOption);
|
|
3262
|
+
return () => onNativeOptionRemove(nativeOption);
|
|
3263
|
+
}, [
|
|
3264
|
+
onNativeOptionAdd,
|
|
3265
|
+
onNativeOptionRemove,
|
|
3266
|
+
nativeOption
|
|
3267
|
+
]);
|
|
3268
|
+
return /* @__PURE__ */ $01b9c$createElement($01b9c$Fragment, null, /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
3269
|
+
id: itemContext.textId
|
|
3270
|
+
}, itemTextProps, {
|
|
3271
|
+
ref: composedRefs
|
|
3272
|
+
})), itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? /* @__PURE__ */ $01b9c$createPortal(itemTextProps.children, context.valueNode) : null);
|
|
3273
|
+
});
|
|
3274
|
+
var $cc7e05a45900e73f$var$ITEM_INDICATOR_NAME = "SelectItemIndicator";
|
|
3275
|
+
var $cc7e05a45900e73f$export$6b9198de19accfe6 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3276
|
+
const { __scopeSelect, ...itemIndicatorProps } = props;
|
|
3277
|
+
const itemContext = $cc7e05a45900e73f$var$useSelectItemContext($cc7e05a45900e73f$var$ITEM_INDICATOR_NAME, __scopeSelect);
|
|
3278
|
+
return itemContext.isSelected ? /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
3279
|
+
"aria-hidden": true
|
|
3280
|
+
}, itemIndicatorProps, {
|
|
3281
|
+
ref: forwardedRef
|
|
3282
|
+
})) : null;
|
|
3283
|
+
});
|
|
3284
|
+
var $cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME = "SelectScrollUpButton";
|
|
3285
|
+
var $cc7e05a45900e73f$export$d8117927658af6d7 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3286
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
3287
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_UP_BUTTON_NAME, props.__scopeSelect);
|
|
3288
|
+
const [canScrollUp1, setCanScrollUp] = $01b9c$useState(false);
|
|
3289
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, viewportContext.onScrollButtonChange);
|
|
3290
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
3291
|
+
if (contentContext.viewport && contentContext.isPositioned) {
|
|
3292
|
+
let handleScroll2 = function() {
|
|
3293
|
+
const canScrollUp = viewport.scrollTop > 0;
|
|
3294
|
+
setCanScrollUp(canScrollUp);
|
|
3295
|
+
};
|
|
3296
|
+
const viewport = contentContext.viewport;
|
|
3297
|
+
handleScroll2();
|
|
3298
|
+
viewport.addEventListener("scroll", handleScroll2);
|
|
3299
|
+
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
3300
|
+
}
|
|
3301
|
+
}, [
|
|
3302
|
+
contentContext.viewport,
|
|
3303
|
+
contentContext.isPositioned
|
|
3304
|
+
]);
|
|
3305
|
+
return canScrollUp1 ? /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, _extends({}, props, {
|
|
3306
|
+
ref: composedRefs,
|
|
3307
|
+
onAutoScroll: () => {
|
|
3308
|
+
const { viewport, selectedItem } = contentContext;
|
|
3309
|
+
if (viewport && selectedItem)
|
|
3310
|
+
viewport.scrollTop = viewport.scrollTop - selectedItem.offsetHeight;
|
|
3311
|
+
}
|
|
3312
|
+
})) : null;
|
|
3313
|
+
});
|
|
3314
|
+
var $cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME = "SelectScrollDownButton";
|
|
3315
|
+
var $cc7e05a45900e73f$export$ff951e476c12189 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3316
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
3317
|
+
const viewportContext = $cc7e05a45900e73f$var$useSelectViewportContext($cc7e05a45900e73f$var$SCROLL_DOWN_BUTTON_NAME, props.__scopeSelect);
|
|
3318
|
+
const [canScrollDown1, setCanScrollDown] = $01b9c$useState(false);
|
|
3319
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, viewportContext.onScrollButtonChange);
|
|
3320
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
3321
|
+
if (contentContext.viewport && contentContext.isPositioned) {
|
|
3322
|
+
let handleScroll2 = function() {
|
|
3323
|
+
const maxScroll = viewport.scrollHeight - viewport.clientHeight;
|
|
3324
|
+
const canScrollDown = Math.ceil(viewport.scrollTop) < maxScroll;
|
|
3325
|
+
setCanScrollDown(canScrollDown);
|
|
3326
|
+
};
|
|
3327
|
+
const viewport = contentContext.viewport;
|
|
3328
|
+
handleScroll2();
|
|
3329
|
+
viewport.addEventListener("scroll", handleScroll2);
|
|
3330
|
+
return () => viewport.removeEventListener("scroll", handleScroll2);
|
|
3331
|
+
}
|
|
3332
|
+
}, [
|
|
3333
|
+
contentContext.viewport,
|
|
3334
|
+
contentContext.isPositioned
|
|
3335
|
+
]);
|
|
3336
|
+
return canScrollDown1 ? /* @__PURE__ */ $01b9c$createElement($cc7e05a45900e73f$var$SelectScrollButtonImpl, _extends({}, props, {
|
|
3337
|
+
ref: composedRefs,
|
|
3338
|
+
onAutoScroll: () => {
|
|
3339
|
+
const { viewport, selectedItem } = contentContext;
|
|
3340
|
+
if (viewport && selectedItem)
|
|
3341
|
+
viewport.scrollTop = viewport.scrollTop + selectedItem.offsetHeight;
|
|
3342
|
+
}
|
|
3343
|
+
})) : null;
|
|
3344
|
+
});
|
|
3345
|
+
var $cc7e05a45900e73f$var$SelectScrollButtonImpl = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3346
|
+
const { __scopeSelect, onAutoScroll, ...scrollIndicatorProps } = props;
|
|
3347
|
+
const contentContext = $cc7e05a45900e73f$var$useSelectContentContext("SelectScrollButton", __scopeSelect);
|
|
3348
|
+
const autoScrollTimerRef = $01b9c$useRef(null);
|
|
3349
|
+
const getItems = $cc7e05a45900e73f$var$useCollection(__scopeSelect);
|
|
3350
|
+
const clearAutoScrollTimer = $01b9c$useCallback(() => {
|
|
3351
|
+
if (autoScrollTimerRef.current !== null) {
|
|
3352
|
+
window.clearInterval(autoScrollTimerRef.current);
|
|
3353
|
+
autoScrollTimerRef.current = null;
|
|
3354
|
+
}
|
|
3355
|
+
}, []);
|
|
3356
|
+
$01b9c$useEffect(() => {
|
|
3357
|
+
return () => clearAutoScrollTimer();
|
|
3358
|
+
}, [
|
|
3359
|
+
clearAutoScrollTimer
|
|
3360
|
+
]);
|
|
3361
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(() => {
|
|
3362
|
+
var _activeItem$ref$curre;
|
|
3363
|
+
const activeItem = getItems().find(
|
|
3364
|
+
(item) => item.ref.current === document.activeElement
|
|
3365
|
+
);
|
|
3366
|
+
activeItem === null || activeItem === void 0 || (_activeItem$ref$curre = activeItem.ref.current) === null || _activeItem$ref$curre === void 0 || _activeItem$ref$curre.scrollIntoView({
|
|
3367
|
+
block: "nearest"
|
|
3368
|
+
});
|
|
3369
|
+
}, [
|
|
3370
|
+
getItems
|
|
3371
|
+
]);
|
|
3372
|
+
return /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3373
|
+
"aria-hidden": true
|
|
3374
|
+
}, scrollIndicatorProps, {
|
|
3375
|
+
ref: forwardedRef,
|
|
3376
|
+
style: {
|
|
3377
|
+
flexShrink: 0,
|
|
3378
|
+
...scrollIndicatorProps.style
|
|
3379
|
+
},
|
|
3380
|
+
onPointerDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerDown, () => {
|
|
3381
|
+
if (autoScrollTimerRef.current === null)
|
|
3382
|
+
autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
3383
|
+
}),
|
|
3384
|
+
onPointerMove: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerMove, () => {
|
|
3385
|
+
var _contentContext$onIte3;
|
|
3386
|
+
(_contentContext$onIte3 = contentContext.onItemLeave) === null || _contentContext$onIte3 === void 0 || _contentContext$onIte3.call(contentContext);
|
|
3387
|
+
if (autoScrollTimerRef.current === null)
|
|
3388
|
+
autoScrollTimerRef.current = window.setInterval(onAutoScroll, 50);
|
|
3389
|
+
}),
|
|
3390
|
+
onPointerLeave: $e42e1063c40fb3ef$export$b9ecd428b558ff10(scrollIndicatorProps.onPointerLeave, () => {
|
|
3391
|
+
clearAutoScrollTimer();
|
|
3392
|
+
})
|
|
3393
|
+
}));
|
|
3394
|
+
});
|
|
3395
|
+
var $cc7e05a45900e73f$export$eba4b1df07cb1d3 = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3396
|
+
const { __scopeSelect, ...separatorProps } = props;
|
|
3397
|
+
return /* @__PURE__ */ $01b9c$createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
3398
|
+
"aria-hidden": true
|
|
3399
|
+
}, separatorProps, {
|
|
3400
|
+
ref: forwardedRef
|
|
3401
|
+
}));
|
|
3402
|
+
});
|
|
3403
|
+
function $cc7e05a45900e73f$var$shouldShowPlaceholder(value) {
|
|
3404
|
+
return value === "" || value === void 0;
|
|
3405
|
+
}
|
|
3406
|
+
var $cc7e05a45900e73f$var$BubbleSelect = /* @__PURE__ */ $01b9c$forwardRef((props, forwardedRef) => {
|
|
3407
|
+
const { value, ...selectProps } = props;
|
|
3408
|
+
const ref = $01b9c$useRef(null);
|
|
3409
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
3410
|
+
const prevValue = $010c2913dbd2fe3d$export$5cae361ad82dce8b(value);
|
|
3411
|
+
$01b9c$useEffect(() => {
|
|
3412
|
+
const select = ref.current;
|
|
3413
|
+
const selectProto = window.HTMLSelectElement.prototype;
|
|
3414
|
+
const descriptor = Object.getOwnPropertyDescriptor(selectProto, "value");
|
|
3415
|
+
const setValue = descriptor.set;
|
|
3416
|
+
if (prevValue !== value && setValue) {
|
|
3417
|
+
const event = new Event("change", {
|
|
3418
|
+
bubbles: true
|
|
3419
|
+
});
|
|
3420
|
+
setValue.call(select, value);
|
|
3421
|
+
select.dispatchEvent(event);
|
|
3422
|
+
}
|
|
3423
|
+
}, [
|
|
3424
|
+
prevValue,
|
|
3425
|
+
value
|
|
3426
|
+
]);
|
|
3427
|
+
return /* @__PURE__ */ $01b9c$createElement($ea1ef594cf570d83$export$439d29a4e110a164, {
|
|
3428
|
+
asChild: true
|
|
3429
|
+
}, /* @__PURE__ */ $01b9c$createElement("select", _extends({}, selectProps, {
|
|
3430
|
+
ref: composedRefs,
|
|
3431
|
+
defaultValue: value
|
|
3432
|
+
})));
|
|
3433
|
+
});
|
|
3434
|
+
$cc7e05a45900e73f$var$BubbleSelect.displayName = "BubbleSelect";
|
|
3435
|
+
function $cc7e05a45900e73f$var$useTypeaheadSearch(onSearchChange) {
|
|
3436
|
+
const handleSearchChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onSearchChange);
|
|
3437
|
+
const searchRef = $01b9c$useRef("");
|
|
3438
|
+
const timerRef = $01b9c$useRef(0);
|
|
3439
|
+
const handleTypeaheadSearch = $01b9c$useCallback((key) => {
|
|
3440
|
+
const search = searchRef.current + key;
|
|
3441
|
+
handleSearchChange(search);
|
|
3442
|
+
(function updateSearch(value) {
|
|
3443
|
+
searchRef.current = value;
|
|
3444
|
+
window.clearTimeout(timerRef.current);
|
|
3445
|
+
if (value !== "")
|
|
3446
|
+
timerRef.current = window.setTimeout(
|
|
3447
|
+
() => updateSearch(""),
|
|
3448
|
+
1e3
|
|
3449
|
+
);
|
|
3450
|
+
})(search);
|
|
3451
|
+
}, [
|
|
3452
|
+
handleSearchChange
|
|
3453
|
+
]);
|
|
3454
|
+
const resetTypeahead = $01b9c$useCallback(() => {
|
|
3455
|
+
searchRef.current = "";
|
|
3456
|
+
window.clearTimeout(timerRef.current);
|
|
3457
|
+
}, []);
|
|
3458
|
+
$01b9c$useEffect(() => {
|
|
3459
|
+
return () => window.clearTimeout(timerRef.current);
|
|
3460
|
+
}, []);
|
|
3461
|
+
return [
|
|
3462
|
+
searchRef,
|
|
3463
|
+
handleTypeaheadSearch,
|
|
3464
|
+
resetTypeahead
|
|
3465
|
+
];
|
|
3466
|
+
}
|
|
3467
|
+
function $cc7e05a45900e73f$var$findNextItem(items, search, currentItem) {
|
|
3468
|
+
const isRepeated = search.length > 1 && Array.from(search).every(
|
|
3469
|
+
(char) => char === search[0]
|
|
3470
|
+
);
|
|
3471
|
+
const normalizedSearch = isRepeated ? search[0] : search;
|
|
3472
|
+
const currentItemIndex = currentItem ? items.indexOf(currentItem) : -1;
|
|
3473
|
+
let wrappedItems = $cc7e05a45900e73f$var$wrapArray(items, Math.max(currentItemIndex, 0));
|
|
3474
|
+
const excludeCurrentItem = normalizedSearch.length === 1;
|
|
3475
|
+
if (excludeCurrentItem)
|
|
3476
|
+
wrappedItems = wrappedItems.filter(
|
|
3477
|
+
(v) => v !== currentItem
|
|
3478
|
+
);
|
|
3479
|
+
const nextItem = wrappedItems.find(
|
|
3480
|
+
(item) => item.textValue.toLowerCase().startsWith(normalizedSearch.toLowerCase())
|
|
3481
|
+
);
|
|
3482
|
+
return nextItem !== currentItem ? nextItem : void 0;
|
|
3483
|
+
}
|
|
3484
|
+
function $cc7e05a45900e73f$var$wrapArray(array, startIndex) {
|
|
3485
|
+
return array.map(
|
|
3486
|
+
(_, index2) => array[(startIndex + index2) % array.length]
|
|
3487
|
+
);
|
|
3488
|
+
}
|
|
3489
|
+
var $cc7e05a45900e73f$export$be92b6f5f03c0fe9 = $cc7e05a45900e73f$export$ef9b1a59e592288f;
|
|
3490
|
+
var $cc7e05a45900e73f$export$41fb9f06171c75f4 = $cc7e05a45900e73f$export$3ac1e88a1c0b9f1;
|
|
3491
|
+
var $cc7e05a45900e73f$export$4c8d1a57a761ef94 = $cc7e05a45900e73f$export$e288731fd71264f0;
|
|
3492
|
+
var $cc7e05a45900e73f$export$f04a61298a47a40f = $cc7e05a45900e73f$export$99b400cabb58c515;
|
|
3493
|
+
var $cc7e05a45900e73f$export$602eac185826482c = $cc7e05a45900e73f$export$b2af6c9944296213;
|
|
3494
|
+
var $cc7e05a45900e73f$export$7c6e2c02157bb7d2 = $cc7e05a45900e73f$export$c973a4b3cb86a03d;
|
|
3495
|
+
var $cc7e05a45900e73f$export$d5c6c08dc2d3ca7 = $cc7e05a45900e73f$export$9ed6e7b40248d36d;
|
|
3496
|
+
var $cc7e05a45900e73f$export$eb2fcfdbd7ba97d4 = $cc7e05a45900e73f$export$ee25a334c55de1f4;
|
|
3497
|
+
var $cc7e05a45900e73f$export$b04be29aa201d4f5 = $cc7e05a45900e73f$export$f67338d29bd972f8;
|
|
3498
|
+
var $cc7e05a45900e73f$export$6d08773d2e66f8f2 = $cc7e05a45900e73f$export$13ef48a934230896;
|
|
3499
|
+
var $cc7e05a45900e73f$export$d6e5bf9c43ea9319 = $cc7e05a45900e73f$export$3572fb0fb821ff49;
|
|
3500
|
+
var $cc7e05a45900e73f$export$c3468e2714d175fa = $cc7e05a45900e73f$export$6b9198de19accfe6;
|
|
3501
|
+
var $cc7e05a45900e73f$export$2f60d3ec9ad468f2 = $cc7e05a45900e73f$export$d8117927658af6d7;
|
|
3502
|
+
var $cc7e05a45900e73f$export$bf1aedc3039c8d63 = $cc7e05a45900e73f$export$ff951e476c12189;
|
|
3503
|
+
var $cc7e05a45900e73f$export$1ff3c3f08ae963c0 = $cc7e05a45900e73f$export$eba4b1df07cb1d3;
|
|
3504
|
+
|
|
3505
|
+
// src/components/Select/select.tsx
|
|
3506
|
+
import { Check, ChevronDown, ChevronUp } from "lucide-react";
|
|
3507
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3508
|
+
var Select = $cc7e05a45900e73f$export$be92b6f5f03c0fe9;
|
|
3509
|
+
var SelectGroup = $cc7e05a45900e73f$export$eb2fcfdbd7ba97d4;
|
|
3510
|
+
var SelectValue = $cc7e05a45900e73f$export$4c8d1a57a761ef94;
|
|
3511
|
+
var SelectTrigger = React9.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(
|
|
3512
|
+
$cc7e05a45900e73f$export$41fb9f06171c75f4,
|
|
3513
|
+
{
|
|
3514
|
+
ref,
|
|
3515
|
+
className: cn(
|
|
3516
|
+
"flex h-9 w-full items-center justify-between rounded-md border-0 px-4 py-2 text-base placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
3517
|
+
className
|
|
3518
|
+
),
|
|
3519
|
+
...props,
|
|
3520
|
+
children: [
|
|
3521
|
+
children,
|
|
3522
|
+
/* @__PURE__ */ jsx($cc7e05a45900e73f$export$f04a61298a47a40f, { asChild: true, children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4 opacity-50 ml-2" }) })
|
|
3523
|
+
]
|
|
3524
|
+
}
|
|
3525
|
+
));
|
|
3526
|
+
SelectTrigger.displayName = $cc7e05a45900e73f$export$41fb9f06171c75f4.displayName;
|
|
3527
|
+
var SelectScrollUpButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3528
|
+
$cc7e05a45900e73f$export$2f60d3ec9ad468f2,
|
|
3529
|
+
{
|
|
3530
|
+
ref,
|
|
3531
|
+
className: cn(
|
|
3532
|
+
"flex cursor-default items-center justify-center py-1",
|
|
3533
|
+
className
|
|
3534
|
+
),
|
|
3535
|
+
...props,
|
|
3536
|
+
children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
|
|
3537
|
+
}
|
|
3538
|
+
));
|
|
3539
|
+
SelectScrollUpButton.displayName = $cc7e05a45900e73f$export$2f60d3ec9ad468f2.displayName;
|
|
3540
|
+
var SelectScrollDownButton = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3541
|
+
$cc7e05a45900e73f$export$bf1aedc3039c8d63,
|
|
3542
|
+
{
|
|
3543
|
+
ref,
|
|
3544
|
+
className: cn(
|
|
3545
|
+
"flex cursor-default items-center justify-center py-1 data-[highlighted]:bg-[#f1f3f5] data-[highlighted]:text-[#AFE9D2]",
|
|
3546
|
+
className
|
|
3547
|
+
),
|
|
3548
|
+
...props,
|
|
3549
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
|
|
3550
|
+
}
|
|
3551
|
+
));
|
|
3552
|
+
SelectScrollDownButton.displayName = $cc7e05a45900e73f$export$bf1aedc3039c8d63.displayName;
|
|
3553
|
+
var SelectContent = React9.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx($cc7e05a45900e73f$export$602eac185826482c, { children: /* @__PURE__ */ jsxs(
|
|
3554
|
+
$cc7e05a45900e73f$export$7c6e2c02157bb7d2,
|
|
3555
|
+
{
|
|
3556
|
+
ref,
|
|
3557
|
+
className: cn(
|
|
3558
|
+
"relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
3559
|
+
position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
3560
|
+
className
|
|
3561
|
+
),
|
|
3562
|
+
position,
|
|
3563
|
+
...props,
|
|
3564
|
+
children: [
|
|
3565
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
3566
|
+
/* @__PURE__ */ jsx(
|
|
3567
|
+
$cc7e05a45900e73f$export$d5c6c08dc2d3ca7,
|
|
3568
|
+
{
|
|
3569
|
+
className: cn(
|
|
3570
|
+
"p-1",
|
|
3571
|
+
position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
|
|
3572
|
+
),
|
|
3573
|
+
children
|
|
3574
|
+
}
|
|
3575
|
+
),
|
|
3576
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
3577
|
+
]
|
|
3578
|
+
}
|
|
3579
|
+
) }));
|
|
3580
|
+
SelectContent.displayName = $cc7e05a45900e73f$export$7c6e2c02157bb7d2.displayName;
|
|
3581
|
+
var SelectLabel = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3582
|
+
$cc7e05a45900e73f$export$b04be29aa201d4f5,
|
|
3583
|
+
{
|
|
3584
|
+
ref,
|
|
3585
|
+
className: cn("text-sm font-semibold", className),
|
|
3586
|
+
...props
|
|
3587
|
+
}
|
|
3588
|
+
));
|
|
3589
|
+
SelectLabel.displayName = $cc7e05a45900e73f$export$b04be29aa201d4f5.displayName;
|
|
3590
|
+
var SelectItem = React9.forwardRef(({ className, children, ...props }, ref) => {
|
|
3591
|
+
return /* @__PURE__ */ jsxs(
|
|
3592
|
+
$cc7e05a45900e73f$export$6d08773d2e66f8f2,
|
|
3593
|
+
{
|
|
3594
|
+
ref,
|
|
3595
|
+
className: cn(
|
|
3596
|
+
"h-[2.14rem] p-[1.14rem] relative flex items-center bg-[#FFF] text-[#444] text-[12px] data-[highlighted]:bg-[#f1f3f5] data-[highlighted]:bg-[#7789D3] data-[highlighted]:text-[#fff]",
|
|
3597
|
+
className
|
|
3598
|
+
),
|
|
3599
|
+
...props,
|
|
3600
|
+
children: [
|
|
3601
|
+
/* @__PURE__ */ jsx($cc7e05a45900e73f$export$d6e5bf9c43ea9319, { children }),
|
|
3602
|
+
/* @__PURE__ */ jsx("span", { className: "absolute top-1/2 right-3 transform -translate-y-1/2 flex items-center justify-center", children: /* @__PURE__ */ jsx($cc7e05a45900e73f$export$c3468e2714d175fa, { children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }) })
|
|
3603
|
+
]
|
|
3604
|
+
}
|
|
3605
|
+
);
|
|
3606
|
+
});
|
|
3607
|
+
SelectItem.displayName = $cc7e05a45900e73f$export$6d08773d2e66f8f2.displayName;
|
|
3608
|
+
var SelectSeparator = React9.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
3609
|
+
$cc7e05a45900e73f$export$1ff3c3f08ae963c0,
|
|
3610
|
+
{
|
|
3611
|
+
ref,
|
|
3612
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
3613
|
+
...props
|
|
3614
|
+
}
|
|
3615
|
+
));
|
|
3616
|
+
SelectSeparator.displayName = $cc7e05a45900e73f$export$1ff3c3f08ae963c0.displayName;
|
|
3617
|
+
|
|
3618
|
+
export {
|
|
3619
|
+
Select,
|
|
3620
|
+
SelectGroup,
|
|
3621
|
+
SelectValue,
|
|
3622
|
+
SelectTrigger,
|
|
3623
|
+
SelectScrollDownButton,
|
|
3624
|
+
SelectContent,
|
|
3625
|
+
SelectLabel,
|
|
3626
|
+
SelectItem,
|
|
3627
|
+
SelectSeparator
|
|
3628
|
+
};
|
|
3629
|
+
//# sourceMappingURL=chunk-4HTI24KG.js.map
|