@donkit-ai/design-system 1.4.94 → 1.4.96
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/README.md +1 -1
- package/dist/index.cjs.js +4 -4
- package/dist/index.es.js +892 -881
- package/dist/tokens.css +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import X, { useMemo as
|
|
2
|
-
import { Check as Pe, X as
|
|
1
|
+
import X, { useMemo as bt, useContext as le, createContext as De, useState as D, useRef as R, useEffect as P, useLayoutEffect as ct, useId as _t, useCallback as ne, forwardRef as dt } from "react";
|
|
2
|
+
import { Check as Pe, X as te, ChevronDown as ye, Minus as jt, Plus as Nt, XCircle as Me, AlertTriangle as ze, CheckCircle as Fe, Info as We, ChevronUp as wt, ChevronsUpDown as gt, ChevronLeft as yt, ChevronRight as kt, Copy as Et, Brain as Tt, Loader as $t, Paperclip as Ge, Square as Rt, ArrowUp as St, Zap as At, Cpu as Ke, FileText as Bt, ThumbsUp as It, ThumbsDown as Lt } from "lucide-react";
|
|
3
3
|
import re from "react-dom";
|
|
4
4
|
const q = {
|
|
5
5
|
1: 16,
|
|
@@ -19,7 +19,7 @@ var Ie = { exports: {} }, we = {};
|
|
|
19
19
|
* LICENSE file in the root directory of this source tree.
|
|
20
20
|
*/
|
|
21
21
|
var Xe;
|
|
22
|
-
function
|
|
22
|
+
function Dt() {
|
|
23
23
|
if (Xe) return we;
|
|
24
24
|
Xe = 1;
|
|
25
25
|
var t = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
@@ -51,46 +51,46 @@ var ge = {};
|
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
52
|
*/
|
|
53
53
|
var Je;
|
|
54
|
-
function
|
|
54
|
+
function Pt() {
|
|
55
55
|
return Je || (Je = 1, process.env.NODE_ENV !== "production" && function() {
|
|
56
56
|
function t(m) {
|
|
57
57
|
if (m == null) return null;
|
|
58
58
|
if (typeof m == "function")
|
|
59
|
-
return m.$$typeof ===
|
|
59
|
+
return m.$$typeof === g ? null : m.displayName || m.name || null;
|
|
60
60
|
if (typeof m == "string") return m;
|
|
61
61
|
switch (m) {
|
|
62
|
-
case
|
|
62
|
+
case y:
|
|
63
63
|
return "Fragment";
|
|
64
|
-
case
|
|
64
|
+
case T:
|
|
65
65
|
return "Profiler";
|
|
66
|
-
case
|
|
66
|
+
case N:
|
|
67
67
|
return "StrictMode";
|
|
68
|
-
case
|
|
68
|
+
case w:
|
|
69
69
|
return "Suspense";
|
|
70
70
|
case I:
|
|
71
71
|
return "SuspenseList";
|
|
72
|
-
case
|
|
72
|
+
case O:
|
|
73
73
|
return "Activity";
|
|
74
74
|
}
|
|
75
75
|
if (typeof m == "object")
|
|
76
76
|
switch (typeof m.tag == "number" && console.error(
|
|
77
77
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
78
78
|
), m.$$typeof) {
|
|
79
|
-
case
|
|
79
|
+
case j:
|
|
80
80
|
return "Portal";
|
|
81
|
-
case
|
|
81
|
+
case x:
|
|
82
82
|
return m.displayName || "Context";
|
|
83
|
-
case
|
|
83
|
+
case A:
|
|
84
84
|
return (m._context.displayName || "Context") + ".Consumer";
|
|
85
|
-
case
|
|
86
|
-
var
|
|
87
|
-
return m = m.displayName, m || (m =
|
|
85
|
+
case k:
|
|
86
|
+
var b = m.render;
|
|
87
|
+
return m = m.displayName, m || (m = b.displayName || b.name || "", m = m !== "" ? "ForwardRef(" + m + ")" : "ForwardRef"), m;
|
|
88
88
|
case L:
|
|
89
|
-
return
|
|
90
|
-
case
|
|
91
|
-
|
|
89
|
+
return b = m.displayName || null, b !== null ? b : t(m.type) || "Memo";
|
|
90
|
+
case W:
|
|
91
|
+
b = m._payload, m = m._init;
|
|
92
92
|
try {
|
|
93
|
-
return t(m(
|
|
93
|
+
return t(m(b));
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -102,50 +102,50 @@ function Dt() {
|
|
|
102
102
|
function n(m) {
|
|
103
103
|
try {
|
|
104
104
|
s(m);
|
|
105
|
-
var
|
|
105
|
+
var b = !1;
|
|
106
106
|
} catch {
|
|
107
|
-
|
|
107
|
+
b = !0;
|
|
108
108
|
}
|
|
109
|
-
if (
|
|
110
|
-
|
|
111
|
-
var B =
|
|
109
|
+
if (b) {
|
|
110
|
+
b = console;
|
|
111
|
+
var B = b.error, U = typeof Symbol == "function" && Symbol.toStringTag && m[Symbol.toStringTag] || m.constructor.name || "Object";
|
|
112
112
|
return B.call(
|
|
113
|
-
|
|
113
|
+
b,
|
|
114
114
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
115
115
|
U
|
|
116
116
|
), s(m);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
function r(m) {
|
|
120
|
-
if (m ===
|
|
121
|
-
if (typeof m == "object" && m !== null && m.$$typeof ===
|
|
120
|
+
if (m === y) return "<>";
|
|
121
|
+
if (typeof m == "object" && m !== null && m.$$typeof === W)
|
|
122
122
|
return "<...>";
|
|
123
123
|
try {
|
|
124
|
-
var
|
|
125
|
-
return
|
|
124
|
+
var b = t(m);
|
|
125
|
+
return b ? "<" + b + ">" : "<...>";
|
|
126
126
|
} catch {
|
|
127
127
|
return "<...>";
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function a() {
|
|
131
|
-
var m =
|
|
131
|
+
var m = C.A;
|
|
132
132
|
return m === null ? null : m.getOwner();
|
|
133
133
|
}
|
|
134
134
|
function o() {
|
|
135
135
|
return Error("react-stack-top-frame");
|
|
136
136
|
}
|
|
137
137
|
function i(m) {
|
|
138
|
-
if (
|
|
139
|
-
var
|
|
140
|
-
if (
|
|
138
|
+
if (M.call(m, "key")) {
|
|
139
|
+
var b = Object.getOwnPropertyDescriptor(m, "key").get;
|
|
140
|
+
if (b && b.isReactWarning) return !1;
|
|
141
141
|
}
|
|
142
142
|
return m.key !== void 0;
|
|
143
143
|
}
|
|
144
|
-
function l(m,
|
|
144
|
+
function l(m, b) {
|
|
145
145
|
function B() {
|
|
146
146
|
$ || ($ = !0, console.error(
|
|
147
147
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
148
|
-
|
|
148
|
+
b
|
|
149
149
|
));
|
|
150
150
|
}
|
|
151
151
|
B.isReactWarning = !0, Object.defineProperty(m, "key", {
|
|
@@ -155,16 +155,16 @@ function Dt() {
|
|
|
155
155
|
}
|
|
156
156
|
function c() {
|
|
157
157
|
var m = t(this.type);
|
|
158
|
-
return
|
|
158
|
+
return S[m] || (S[m] = !0, console.error(
|
|
159
159
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
160
160
|
)), m = this.props.ref, m !== void 0 ? m : null;
|
|
161
161
|
}
|
|
162
|
-
function u(m,
|
|
162
|
+
function u(m, b, B, U, se, ae) {
|
|
163
163
|
var G = B.ref;
|
|
164
164
|
return m = {
|
|
165
165
|
$$typeof: _,
|
|
166
166
|
type: m,
|
|
167
|
-
key:
|
|
167
|
+
key: b,
|
|
168
168
|
props: B,
|
|
169
169
|
_owner: U
|
|
170
170
|
}, (G !== void 0 ? G : null) !== null ? Object.defineProperty(m, "ref", {
|
|
@@ -184,16 +184,16 @@ function Dt() {
|
|
|
184
184
|
configurable: !1,
|
|
185
185
|
enumerable: !1,
|
|
186
186
|
writable: !0,
|
|
187
|
-
value:
|
|
187
|
+
value: se
|
|
188
188
|
}), Object.defineProperty(m, "_debugTask", {
|
|
189
189
|
configurable: !1,
|
|
190
190
|
enumerable: !1,
|
|
191
191
|
writable: !0,
|
|
192
|
-
value:
|
|
192
|
+
value: ae
|
|
193
193
|
}), Object.freeze && (Object.freeze(m.props), Object.freeze(m)), m;
|
|
194
194
|
}
|
|
195
|
-
function d(m,
|
|
196
|
-
var G =
|
|
195
|
+
function d(m, b, B, U, se, ae) {
|
|
196
|
+
var G = b.children;
|
|
197
197
|
if (G !== void 0)
|
|
198
198
|
if (U)
|
|
199
199
|
if (V(G)) {
|
|
@@ -205,12 +205,12 @@ function Dt() {
|
|
|
205
205
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
206
206
|
);
|
|
207
207
|
else p(G);
|
|
208
|
-
if (
|
|
208
|
+
if (M.call(b, "key")) {
|
|
209
209
|
G = t(m);
|
|
210
|
-
var
|
|
210
|
+
var Q = Object.keys(b).filter(function(je) {
|
|
211
211
|
return je !== "key";
|
|
212
212
|
});
|
|
213
|
-
U = 0 <
|
|
213
|
+
U = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", Y[G + U] || (Q = 0 < Q.length ? "{" + Q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
214
214
|
`A props object containing a "key" prop is being spread into JSX:
|
|
215
215
|
let props = %s;
|
|
216
216
|
<%s {...props} />
|
|
@@ -219,15 +219,15 @@ React keys must be passed directly to JSX without using spread:
|
|
|
219
219
|
<%s key={someKey} {...props} />`,
|
|
220
220
|
U,
|
|
221
221
|
G,
|
|
222
|
-
|
|
222
|
+
Q,
|
|
223
223
|
G
|
|
224
224
|
), Y[G + U] = !0);
|
|
225
225
|
}
|
|
226
|
-
if (G = null, B !== void 0 && (n(B), G = "" + B), i(
|
|
226
|
+
if (G = null, B !== void 0 && (n(B), G = "" + B), i(b) && (n(b.key), G = "" + b.key), "key" in b) {
|
|
227
227
|
B = {};
|
|
228
|
-
for (var fe in
|
|
229
|
-
fe !== "key" && (B[fe] =
|
|
230
|
-
} else B =
|
|
228
|
+
for (var fe in b)
|
|
229
|
+
fe !== "key" && (B[fe] = b[fe]);
|
|
230
|
+
} else B = b;
|
|
231
231
|
return G && l(
|
|
232
232
|
B,
|
|
233
233
|
typeof m == "function" ? m.displayName || m.name || "Unknown" : m
|
|
@@ -236,17 +236,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
236
236
|
G,
|
|
237
237
|
B,
|
|
238
238
|
a(),
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
se,
|
|
240
|
+
ae
|
|
241
241
|
);
|
|
242
242
|
}
|
|
243
243
|
function p(m) {
|
|
244
|
-
h(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof ===
|
|
244
|
+
h(m) ? m._store && (m._store.validated = 1) : typeof m == "object" && m !== null && m.$$typeof === W && (m._payload.status === "fulfilled" ? h(m._payload.value) && m._payload.value._store && (m._payload.value._store.validated = 1) : m._store && (m._store.validated = 1));
|
|
245
245
|
}
|
|
246
246
|
function h(m) {
|
|
247
247
|
return typeof m == "object" && m !== null && m.$$typeof === _;
|
|
248
248
|
}
|
|
249
|
-
var f = X, _ = Symbol.for("react.transitional.element"),
|
|
249
|
+
var f = X, _ = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), N = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), x = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), L = Symbol.for("react.memo"), W = Symbol.for("react.lazy"), O = Symbol.for("react.activity"), g = Symbol.for("react.client.reference"), C = f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, M = Object.prototype.hasOwnProperty, V = Array.isArray, v = console.createTask ? console.createTask : function() {
|
|
250
250
|
return null;
|
|
251
251
|
};
|
|
252
252
|
f = {
|
|
@@ -254,34 +254,34 @@ React keys must be passed directly to JSX without using spread:
|
|
|
254
254
|
return m();
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
var $,
|
|
257
|
+
var $, S = {}, z = f.react_stack_bottom_frame.bind(
|
|
258
258
|
f,
|
|
259
259
|
o
|
|
260
|
-
)(), H =
|
|
261
|
-
ge.Fragment =
|
|
262
|
-
var U = 1e4 >
|
|
260
|
+
)(), H = v(r(o)), Y = {};
|
|
261
|
+
ge.Fragment = y, ge.jsx = function(m, b, B) {
|
|
262
|
+
var U = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
263
263
|
return d(
|
|
264
264
|
m,
|
|
265
|
-
|
|
265
|
+
b,
|
|
266
266
|
B,
|
|
267
267
|
!1,
|
|
268
|
-
U ? Error("react-stack-top-frame") :
|
|
269
|
-
U ?
|
|
268
|
+
U ? Error("react-stack-top-frame") : z,
|
|
269
|
+
U ? v(r(m)) : H
|
|
270
270
|
);
|
|
271
|
-
}, ge.jsxs = function(m,
|
|
272
|
-
var U = 1e4 >
|
|
271
|
+
}, ge.jsxs = function(m, b, B) {
|
|
272
|
+
var U = 1e4 > C.recentlyCreatedOwnerStacks++;
|
|
273
273
|
return d(
|
|
274
274
|
m,
|
|
275
|
-
|
|
275
|
+
b,
|
|
276
276
|
B,
|
|
277
277
|
!0,
|
|
278
|
-
U ? Error("react-stack-top-frame") :
|
|
279
|
-
U ?
|
|
278
|
+
U ? Error("react-stack-top-frame") : z,
|
|
279
|
+
U ? v(r(m)) : H
|
|
280
280
|
);
|
|
281
281
|
};
|
|
282
282
|
}()), ge;
|
|
283
283
|
}
|
|
284
|
-
process.env.NODE_ENV === "production" ? Ie.exports =
|
|
284
|
+
process.env.NODE_ENV === "production" ? Ie.exports = Dt() : Ie.exports = Pt();
|
|
285
285
|
var e = Ie.exports;
|
|
286
286
|
const $e = {
|
|
287
287
|
// Close / dismiss
|
|
@@ -344,8 +344,8 @@ const Oe = De({
|
|
|
344
344
|
strings: $e,
|
|
345
345
|
t: (t, s) => ut($e[t] ?? t, s)
|
|
346
346
|
});
|
|
347
|
-
function
|
|
348
|
-
const n =
|
|
347
|
+
function Ts({ strings: t, children: s }) {
|
|
348
|
+
const n = bt(() => {
|
|
349
349
|
const r = { ...$e, ...t };
|
|
350
350
|
return {
|
|
351
351
|
strings: r,
|
|
@@ -355,12 +355,12 @@ function Es({ strings: t, children: s }) {
|
|
|
355
355
|
return /* @__PURE__ */ e.jsx(Oe.Provider, { value: n, children: s });
|
|
356
356
|
}
|
|
357
357
|
function be() {
|
|
358
|
-
return
|
|
358
|
+
return le(Oe);
|
|
359
359
|
}
|
|
360
360
|
function K() {
|
|
361
|
-
return
|
|
361
|
+
return le(Oe).strings;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function Mt({ size: t = "m", color: s = "default", className: n = "", "aria-label": r, ...a }) {
|
|
364
364
|
const o = K();
|
|
365
365
|
return /* @__PURE__ */ e.jsx(
|
|
366
366
|
"span",
|
|
@@ -372,7 +372,7 @@ function Pt({ size: t = "m", color: s = "default", className: n = "", "aria-labe
|
|
|
372
372
|
}
|
|
373
373
|
);
|
|
374
374
|
}
|
|
375
|
-
const
|
|
375
|
+
const zt = { xs: 12, s: 14, m: 16, l: 20 };
|
|
376
376
|
function de({
|
|
377
377
|
children: t,
|
|
378
378
|
variant: s = "primary",
|
|
@@ -395,41 +395,41 @@ function de({
|
|
|
395
395
|
"aria-label": h,
|
|
396
396
|
"aria-pressed": f,
|
|
397
397
|
className: _ = "",
|
|
398
|
-
...
|
|
398
|
+
...j
|
|
399
399
|
}) {
|
|
400
|
-
const
|
|
400
|
+
const y = a && !t, N = i === "loading", T = i === "success", A = i === "error", x = N || T || A, k = !!(l || c), w = n === "xs" ? "s" : "m", I = s === "danger" ? "on-accent" : "default", L = zt[n] ?? 16, W = N ? /* @__PURE__ */ e.jsx(Mt, { size: w, color: I }) : T ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(Pe, { size: L, strokeWidth: 2.5 }) }) : A ? /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: /* @__PURE__ */ e.jsx(te, { size: L, strokeWidth: 2.5 }) }) : null, O = [
|
|
401
401
|
"ds-button",
|
|
402
402
|
`ds-button--${s}`,
|
|
403
403
|
`ds-button--${n}`,
|
|
404
404
|
r && "ds-button--full",
|
|
405
|
-
|
|
405
|
+
y && "ds-button--icon-only",
|
|
406
406
|
_
|
|
407
|
-
].filter(Boolean).join(" "),
|
|
408
|
-
|
|
407
|
+
].filter(Boolean).join(" "), g = i !== "idle" ? i : void 0, C = f !== void 0 ? f : k ? !0 : void 0, M = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
408
|
+
x ? W : a && /* @__PURE__ */ e.jsx("span", { className: "ds-button__icon", "aria-hidden": "true", children: a }),
|
|
409
409
|
t
|
|
410
410
|
] });
|
|
411
411
|
if (p) {
|
|
412
|
-
const V = (
|
|
413
|
-
if (o ||
|
|
414
|
-
|
|
412
|
+
const V = (v) => {
|
|
413
|
+
if (o || N) {
|
|
414
|
+
v.preventDefault();
|
|
415
415
|
return;
|
|
416
416
|
}
|
|
417
|
-
|
|
417
|
+
v.metaKey || v.ctrlKey || v.button === 1 || (v.preventDefault(), u == null || u(v));
|
|
418
418
|
};
|
|
419
419
|
return /* @__PURE__ */ e.jsx(
|
|
420
420
|
"a",
|
|
421
421
|
{
|
|
422
|
-
className:
|
|
423
|
-
href: o ||
|
|
422
|
+
className: O,
|
|
423
|
+
href: o || N ? void 0 : p,
|
|
424
424
|
onClick: V,
|
|
425
425
|
"aria-label": h,
|
|
426
|
-
"aria-disabled": o ||
|
|
427
|
-
"aria-busy":
|
|
428
|
-
"aria-pressed":
|
|
429
|
-
"data-state":
|
|
430
|
-
"data-active":
|
|
431
|
-
...
|
|
432
|
-
children:
|
|
426
|
+
"aria-disabled": o || N ? "true" : void 0,
|
|
427
|
+
"aria-busy": N ? "true" : void 0,
|
|
428
|
+
"aria-pressed": C,
|
|
429
|
+
"data-state": g,
|
|
430
|
+
"data-active": k ? "true" : void 0,
|
|
431
|
+
...j,
|
|
432
|
+
children: M
|
|
433
433
|
}
|
|
434
434
|
);
|
|
435
435
|
}
|
|
@@ -437,20 +437,20 @@ function de({
|
|
|
437
437
|
"button",
|
|
438
438
|
{
|
|
439
439
|
type: d,
|
|
440
|
-
className:
|
|
440
|
+
className: O,
|
|
441
441
|
disabled: o,
|
|
442
|
-
onClick:
|
|
442
|
+
onClick: N ? void 0 : u,
|
|
443
443
|
"aria-label": h,
|
|
444
|
-
"aria-busy":
|
|
445
|
-
"aria-pressed":
|
|
446
|
-
"data-state":
|
|
447
|
-
"data-active":
|
|
448
|
-
...
|
|
449
|
-
children:
|
|
444
|
+
"aria-busy": N ? "true" : void 0,
|
|
445
|
+
"aria-pressed": C,
|
|
446
|
+
"data-state": g,
|
|
447
|
+
"data-active": k ? "true" : void 0,
|
|
448
|
+
...j,
|
|
449
|
+
children: M
|
|
450
450
|
}
|
|
451
451
|
);
|
|
452
452
|
}
|
|
453
|
-
function
|
|
453
|
+
function $s({
|
|
454
454
|
label: t,
|
|
455
455
|
error: s,
|
|
456
456
|
hint: n,
|
|
@@ -464,7 +464,7 @@ function Ts({
|
|
|
464
464
|
iconRightLabel: d,
|
|
465
465
|
...p
|
|
466
466
|
}) {
|
|
467
|
-
const h = K(), f = u || `input-${X.useId()}`, _ = n ? `${f}-hint` : void 0,
|
|
467
|
+
const h = K(), f = u || `input-${X.useId()}`, _ = n ? `${f}-hint` : void 0, j = s ? `${f}-error` : void 0, y = j || _;
|
|
468
468
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-input-wrapper ${r ? "ds-input-wrapper--full" : ""} ${c ? "ds-input-wrapper--disabled" : ""} ${s ? "ds-input-wrapper--error" : ""}`, children: [
|
|
469
469
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-input-label", htmlFor: f, children: t }),
|
|
470
470
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-input-container", children: [
|
|
@@ -476,7 +476,7 @@ function Ts({
|
|
|
476
476
|
className: `ds-input ds-input--${l} ${a ? "ds-input--with-icon" : ""} ${o ? "ds-input--with-icon-right" : ""} ${s ? "ds-input--error" : ""}`,
|
|
477
477
|
disabled: c,
|
|
478
478
|
"aria-invalid": s ? "true" : "false",
|
|
479
|
-
"aria-describedby":
|
|
479
|
+
"aria-describedby": y,
|
|
480
480
|
...p
|
|
481
481
|
}
|
|
482
482
|
),
|
|
@@ -493,10 +493,10 @@ function Ts({
|
|
|
493
493
|
)
|
|
494
494
|
] }),
|
|
495
495
|
n && !s && /* @__PURE__ */ e.jsx("span", { id: _, className: "ds-input-hint", children: n }),
|
|
496
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: s && /* @__PURE__ */ e.jsx("span", { id:
|
|
496
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-input-error-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "ds-input-error-inner", children: s && /* @__PURE__ */ e.jsx("span", { id: j, className: "ds-input-error", role: "alert", children: s }) }) })
|
|
497
497
|
] });
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Rs({
|
|
500
500
|
label: t,
|
|
501
501
|
error: s,
|
|
502
502
|
hint: n,
|
|
@@ -527,7 +527,7 @@ function $s({
|
|
|
527
527
|
s && /* @__PURE__ */ e.jsx("span", { id: h, className: "ds-textarea-error", role: "alert", children: s })
|
|
528
528
|
] });
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function Ss({
|
|
531
531
|
label: t,
|
|
532
532
|
value: s,
|
|
533
533
|
onChange: n,
|
|
@@ -540,124 +540,124 @@ function Rs({
|
|
|
540
540
|
id: u,
|
|
541
541
|
...d
|
|
542
542
|
}) {
|
|
543
|
-
const p = K(), h = a ?? p.selectOption, [f, _] = D(!1), [
|
|
544
|
-
|
|
543
|
+
const p = K(), h = a ?? p.selectOption, [f, _] = D(!1), [j, y] = D(!1), [N, T] = D({}), [A, x] = D("down"), [k, w] = D(-1), I = R(null), L = R(null), W = R(null), O = R(null), g = u || `select-${X.useId()}`, C = `${g}-label`, M = o ? `${g}-error` : void 0, V = 150, v = (b = !1) => {
|
|
544
|
+
j || (y(!0), w(-1), O.current = setTimeout(() => {
|
|
545
545
|
var B;
|
|
546
|
-
_(!1),
|
|
546
|
+
_(!1), y(!1), b && ((B = W.current) == null || B.focus());
|
|
547
547
|
}, V));
|
|
548
|
-
}, $ = (
|
|
549
|
-
clearTimeout(
|
|
550
|
-
const B =
|
|
551
|
-
|
|
548
|
+
}, $ = (b) => {
|
|
549
|
+
clearTimeout(O.current), y(!1);
|
|
550
|
+
const B = b !== void 0 ? b : Math.max(r.findIndex((U) => U.value === s), 0);
|
|
551
|
+
w(B), _(!0);
|
|
552
552
|
};
|
|
553
|
-
|
|
554
|
-
const
|
|
555
|
-
var
|
|
556
|
-
const
|
|
557
|
-
if (!
|
|
558
|
-
const B = window.innerHeight, U = B -
|
|
559
|
-
|
|
560
|
-
G ? { bottom: B -
|
|
553
|
+
P(() => () => clearTimeout(O.current), []);
|
|
554
|
+
const S = () => {
|
|
555
|
+
var Q;
|
|
556
|
+
const b = (Q = I.current) == null ? void 0 : Q.getBoundingClientRect();
|
|
557
|
+
if (!b) return;
|
|
558
|
+
const B = window.innerHeight, U = B - b.bottom, se = b.top, G = U < 300 && se > U;
|
|
559
|
+
x(G ? "up" : "down"), T(
|
|
560
|
+
G ? { bottom: B - b.top + 4, left: b.left, width: b.width } : { top: b.bottom + 4, left: b.left, width: b.width }
|
|
561
561
|
);
|
|
562
562
|
};
|
|
563
|
-
|
|
563
|
+
P(() => {
|
|
564
564
|
if (f)
|
|
565
|
-
return
|
|
566
|
-
window.removeEventListener("scroll",
|
|
565
|
+
return S(), window.addEventListener("scroll", S, !0), window.addEventListener("resize", S), () => {
|
|
566
|
+
window.removeEventListener("scroll", S, !0), window.removeEventListener("resize", S);
|
|
567
567
|
};
|
|
568
|
-
}, [f]),
|
|
569
|
-
const
|
|
570
|
-
I.current && !I.current.contains(B.target) && L.current && !L.current.contains(B.target) &&
|
|
568
|
+
}, [f]), P(() => {
|
|
569
|
+
const b = (B) => {
|
|
570
|
+
I.current && !I.current.contains(B.target) && L.current && !L.current.contains(B.target) && v();
|
|
571
571
|
};
|
|
572
|
-
return document.addEventListener("mousedown",
|
|
573
|
-
}, [
|
|
572
|
+
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
573
|
+
}, [j]), P(() => {
|
|
574
574
|
var B;
|
|
575
|
-
if (!f ||
|
|
576
|
-
(B = L.current.querySelectorAll(".ds-select-option")[
|
|
577
|
-
}, [
|
|
578
|
-
const
|
|
579
|
-
switch (
|
|
575
|
+
if (!f || k < 0 || !L.current) return;
|
|
576
|
+
(B = L.current.querySelectorAll(".ds-select-option")[k]) == null || B.scrollIntoView({ block: "nearest" });
|
|
577
|
+
}, [k, f]);
|
|
578
|
+
const z = (b) => {
|
|
579
|
+
switch (b.key) {
|
|
580
580
|
case "ArrowDown":
|
|
581
|
-
|
|
581
|
+
b.preventDefault(), f ? w((B) => Math.min(B + 1, r.length - 1)) : $();
|
|
582
582
|
break;
|
|
583
583
|
case "ArrowUp":
|
|
584
|
-
|
|
584
|
+
b.preventDefault(), f ? w((B) => Math.max(B - 1, 0)) : $(r.length - 1);
|
|
585
585
|
break;
|
|
586
586
|
case "Home":
|
|
587
|
-
f && (
|
|
587
|
+
f && (b.preventDefault(), w(0));
|
|
588
588
|
break;
|
|
589
589
|
case "End":
|
|
590
|
-
f && (
|
|
590
|
+
f && (b.preventDefault(), w(r.length - 1));
|
|
591
591
|
break;
|
|
592
592
|
case "Enter":
|
|
593
593
|
case " ":
|
|
594
|
-
|
|
594
|
+
b.preventDefault(), f ? k >= 0 && (n == null || n(r[k].value), v(!0)) : $();
|
|
595
595
|
break;
|
|
596
596
|
case "Escape":
|
|
597
|
-
f && (
|
|
597
|
+
f && (b.preventDefault(), v(!0));
|
|
598
598
|
break;
|
|
599
599
|
case "Tab":
|
|
600
|
-
f &&
|
|
600
|
+
f && v(!1);
|
|
601
601
|
break;
|
|
602
602
|
}
|
|
603
|
-
}, H = r.find((
|
|
603
|
+
}, H = r.find((b) => b.value === s), Y = l === "xs" ? q[1] : l === "small" ? q[2] : q[3], m = f && /* @__PURE__ */ e.jsx(
|
|
604
604
|
"div",
|
|
605
605
|
{
|
|
606
606
|
ref: L,
|
|
607
607
|
"data-ds-portal": "",
|
|
608
608
|
role: "listbox",
|
|
609
|
-
"aria-labelledby": t ?
|
|
609
|
+
"aria-labelledby": t ? C : void 0,
|
|
610
610
|
tabIndex: -1,
|
|
611
611
|
className: [
|
|
612
612
|
"ds-select-dropdown ds-scrollable",
|
|
613
613
|
`ds-select-dropdown--${l}`,
|
|
614
|
-
`ds-select-dropdown--${
|
|
615
|
-
|
|
614
|
+
`ds-select-dropdown--${A}`,
|
|
615
|
+
j && "ds-select-dropdown--closing"
|
|
616
616
|
].filter(Boolean).join(" "),
|
|
617
|
-
style:
|
|
618
|
-
children: r.map((
|
|
617
|
+
style: N,
|
|
618
|
+
children: r.map((b, B) => /* @__PURE__ */ e.jsx(
|
|
619
619
|
"button",
|
|
620
620
|
{
|
|
621
|
-
id: `${
|
|
621
|
+
id: `${g}-opt-${B}`,
|
|
622
622
|
type: "button",
|
|
623
623
|
role: "option",
|
|
624
624
|
tabIndex: -1,
|
|
625
|
-
"aria-selected": s ===
|
|
625
|
+
"aria-selected": s === b.value,
|
|
626
626
|
className: [
|
|
627
627
|
"ds-select-option",
|
|
628
628
|
`ds-select-option--${l}`,
|
|
629
|
-
s ===
|
|
630
|
-
B ===
|
|
629
|
+
s === b.value && "ds-select-option--selected",
|
|
630
|
+
B === k && "ds-select-option--active"
|
|
631
631
|
].filter(Boolean).join(" "),
|
|
632
632
|
onClick: () => {
|
|
633
|
-
n == null || n(
|
|
633
|
+
n == null || n(b.value), v(!0);
|
|
634
634
|
},
|
|
635
|
-
children:
|
|
635
|
+
children: b.label
|
|
636
636
|
},
|
|
637
|
-
|
|
637
|
+
b.value
|
|
638
638
|
))
|
|
639
639
|
}
|
|
640
640
|
);
|
|
641
641
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-select-wrapper ${i ? "ds-select-wrapper--full" : ""} ${c ? "ds-select-wrapper--disabled" : ""}`, children: [
|
|
642
|
-
t && /* @__PURE__ */ e.jsx("label", { id:
|
|
642
|
+
t && /* @__PURE__ */ e.jsx("label", { id: C, className: "ds-select-label", children: t }),
|
|
643
643
|
/* @__PURE__ */ e.jsx("div", { className: "ds-select-container", ref: I, children: /* @__PURE__ */ e.jsxs(
|
|
644
644
|
"button",
|
|
645
645
|
{
|
|
646
|
-
ref:
|
|
646
|
+
ref: W,
|
|
647
647
|
type: "button",
|
|
648
|
-
id:
|
|
648
|
+
id: g,
|
|
649
649
|
role: "combobox",
|
|
650
650
|
"aria-haspopup": "listbox",
|
|
651
651
|
"aria-expanded": f,
|
|
652
|
-
"aria-activedescendant": f &&
|
|
653
|
-
"aria-labelledby": t ?
|
|
652
|
+
"aria-activedescendant": f && k >= 0 ? `${g}-opt-${k}` : void 0,
|
|
653
|
+
"aria-labelledby": t ? C : void 0,
|
|
654
654
|
"aria-invalid": o ? "true" : "false",
|
|
655
|
-
"aria-describedby":
|
|
655
|
+
"aria-describedby": M,
|
|
656
656
|
className: `ds-select-trigger ds-select-trigger--${l} ${o ? "ds-select-trigger--error" : ""}`,
|
|
657
657
|
onClick: () => {
|
|
658
|
-
c || (f ?
|
|
658
|
+
c || (f ? v() : $());
|
|
659
659
|
},
|
|
660
|
-
onKeyDown:
|
|
660
|
+
onKeyDown: z,
|
|
661
661
|
disabled: c,
|
|
662
662
|
...d,
|
|
663
663
|
children: [
|
|
@@ -667,18 +667,18 @@ function Rs({
|
|
|
667
667
|
{
|
|
668
668
|
size: Y,
|
|
669
669
|
strokeWidth: 1.5,
|
|
670
|
-
className: `ds-select-icon ${f &&
|
|
670
|
+
className: `ds-select-icon ${f && A === "down" ? "ds-select-icon--open" : ""} ${f && A === "up" ? "ds-select-icon--up" : ""}`,
|
|
671
671
|
"aria-hidden": "true"
|
|
672
672
|
}
|
|
673
673
|
)
|
|
674
674
|
]
|
|
675
675
|
}
|
|
676
676
|
) }),
|
|
677
|
-
o && /* @__PURE__ */ e.jsx("span", { id:
|
|
677
|
+
o && /* @__PURE__ */ e.jsx("span", { id: M, className: "ds-select-error", role: "alert", children: o }),
|
|
678
678
|
typeof document < "u" && re.createPortal(m, document.body)
|
|
679
679
|
] });
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function As({
|
|
682
682
|
label: t,
|
|
683
683
|
value: s = 0,
|
|
684
684
|
onChange: n,
|
|
@@ -695,45 +695,45 @@ function Ss({
|
|
|
695
695
|
}) {
|
|
696
696
|
const f = K(), _ = () => {
|
|
697
697
|
if (l) return;
|
|
698
|
-
const
|
|
699
|
-
n == null || n(
|
|
700
|
-
},
|
|
698
|
+
const x = Math.min(Number(s) + o, a);
|
|
699
|
+
n == null || n(x);
|
|
700
|
+
}, j = () => {
|
|
701
701
|
if (l) return;
|
|
702
|
-
const
|
|
703
|
-
n == null || n(
|
|
704
|
-
},
|
|
702
|
+
const x = Math.max(Number(s) - o, r);
|
|
703
|
+
n == null || n(x);
|
|
704
|
+
}, y = (x) => {
|
|
705
705
|
if (l) return;
|
|
706
|
-
const
|
|
707
|
-
if (
|
|
706
|
+
const k = x.target.value;
|
|
707
|
+
if (k === "") {
|
|
708
708
|
n == null || n(r);
|
|
709
709
|
return;
|
|
710
710
|
}
|
|
711
|
-
const
|
|
712
|
-
if (!isNaN(
|
|
713
|
-
const I = Math.min(Math.max(
|
|
711
|
+
const w = Number(k);
|
|
712
|
+
if (!isNaN(w)) {
|
|
713
|
+
const I = Math.min(Math.max(w, r), a);
|
|
714
714
|
n == null || n(I);
|
|
715
715
|
}
|
|
716
|
-
},
|
|
716
|
+
}, N = [
|
|
717
717
|
"ds-stepper-wrapper",
|
|
718
718
|
l && "ds-stepper-wrapper--disabled",
|
|
719
719
|
u && "ds-stepper-wrapper--error"
|
|
720
|
-
].filter(Boolean).join(" "),
|
|
720
|
+
].filter(Boolean).join(" "), T = [
|
|
721
721
|
"ds-stepper",
|
|
722
722
|
`ds-stepper--${i}`,
|
|
723
723
|
l && "ds-stepper--disabled"
|
|
724
|
-
].filter(Boolean).join(" "),
|
|
725
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
724
|
+
].filter(Boolean).join(" "), A = i === "xs" ? q[1] : i === "small" ? q[2] : q[3];
|
|
725
|
+
return /* @__PURE__ */ e.jsxs("div", { className: N, children: [
|
|
726
726
|
t && /* @__PURE__ */ e.jsx("label", { className: "ds-stepper-label", children: t }),
|
|
727
|
-
/* @__PURE__ */ e.jsxs("div", { className:
|
|
727
|
+
/* @__PURE__ */ e.jsxs("div", { className: T, children: [
|
|
728
728
|
/* @__PURE__ */ e.jsx(
|
|
729
729
|
"button",
|
|
730
730
|
{
|
|
731
731
|
type: "button",
|
|
732
732
|
className: "ds-stepper-button ds-stepper-button--minus",
|
|
733
|
-
onClick:
|
|
733
|
+
onClick: j,
|
|
734
734
|
disabled: l || s <= r,
|
|
735
735
|
"aria-label": d ?? f.decrease,
|
|
736
|
-
children: /* @__PURE__ */ e.jsx(
|
|
736
|
+
children: /* @__PURE__ */ e.jsx(jt, { size: A, strokeWidth: 1.5 })
|
|
737
737
|
}
|
|
738
738
|
),
|
|
739
739
|
/* @__PURE__ */ e.jsx(
|
|
@@ -742,7 +742,7 @@ function Ss({
|
|
|
742
742
|
type: "number",
|
|
743
743
|
className: "ds-stepper-input",
|
|
744
744
|
value: s,
|
|
745
|
-
onChange:
|
|
745
|
+
onChange: y,
|
|
746
746
|
min: r,
|
|
747
747
|
max: a,
|
|
748
748
|
step: o,
|
|
@@ -758,7 +758,7 @@ function Ss({
|
|
|
758
758
|
onClick: _,
|
|
759
759
|
disabled: l || s >= a,
|
|
760
760
|
"aria-label": p ?? f.increase,
|
|
761
|
-
children: /* @__PURE__ */ e.jsx(
|
|
761
|
+
children: /* @__PURE__ */ e.jsx(Nt, { size: A, strokeWidth: 1.5 })
|
|
762
762
|
}
|
|
763
763
|
)
|
|
764
764
|
] }),
|
|
@@ -766,7 +766,7 @@ function Ss({
|
|
|
766
766
|
u && /* @__PURE__ */ e.jsx("div", { className: "ds-stepper-error", children: u })
|
|
767
767
|
] });
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function Bs({
|
|
770
770
|
children: t,
|
|
771
771
|
padding: s = "m",
|
|
772
772
|
variant: n = "default",
|
|
@@ -785,12 +785,12 @@ function As({
|
|
|
785
785
|
l
|
|
786
786
|
].filter(Boolean).join(" ");
|
|
787
787
|
if (o) {
|
|
788
|
-
const _ = (
|
|
788
|
+
const _ = (j) => {
|
|
789
789
|
if (i) {
|
|
790
|
-
|
|
790
|
+
j.preventDefault();
|
|
791
791
|
return;
|
|
792
792
|
}
|
|
793
|
-
|
|
793
|
+
j.metaKey || j.ctrlKey || j.button === 1 || (j.preventDefault(), a == null || a(j));
|
|
794
794
|
};
|
|
795
795
|
return /* @__PURE__ */ e.jsx(
|
|
796
796
|
"a",
|
|
@@ -820,22 +820,22 @@ function As({
|
|
|
820
820
|
}
|
|
821
821
|
);
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Is({ children: t, ...s }) {
|
|
824
824
|
return /* @__PURE__ */ e.jsx("h1", { className: "ds-h1", ...s, children: t });
|
|
825
825
|
}
|
|
826
|
-
function
|
|
826
|
+
function Ls({ children: t, ...s }) {
|
|
827
827
|
return /* @__PURE__ */ e.jsx("h2", { className: "ds-h2", ...s, children: t });
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function Ds({ children: t, ...s }) {
|
|
830
830
|
return /* @__PURE__ */ e.jsx("h3", { className: "ds-h3", ...s, children: t });
|
|
831
831
|
}
|
|
832
|
-
function
|
|
832
|
+
function Ps({ children: t, ...s }) {
|
|
833
833
|
return /* @__PURE__ */ e.jsx("h4", { className: "ds-h4", ...s, children: t });
|
|
834
834
|
}
|
|
835
|
-
function
|
|
835
|
+
function Ms({ children: t, secondary: s = !1, ...n }) {
|
|
836
836
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p1 ${s ? "ds-p1--secondary" : ""}`, ...n, children: t });
|
|
837
837
|
}
|
|
838
|
-
function
|
|
838
|
+
function Ft({ children: t, secondary: s = !1, ...n }) {
|
|
839
839
|
return /* @__PURE__ */ e.jsx("p", { className: `ds-p2 ${s ? "ds-p2--secondary" : ""}`, ...n, children: t });
|
|
840
840
|
}
|
|
841
841
|
function ft({ children: t, secondary: s = !1, ...n }) {
|
|
@@ -855,12 +855,12 @@ function he({
|
|
|
855
855
|
].filter(Boolean).join(" "), i = r || (["info", "success", "warning", "error"].includes(s) ? "status" : void 0);
|
|
856
856
|
return /* @__PURE__ */ e.jsx("span", { className: o, role: i, ...a, children: t });
|
|
857
857
|
}
|
|
858
|
-
const
|
|
858
|
+
const Wt = {
|
|
859
859
|
info: We,
|
|
860
860
|
success: Fe,
|
|
861
861
|
warning: ze,
|
|
862
862
|
error: Me
|
|
863
|
-
},
|
|
863
|
+
}, zs = X.forwardRef(function({
|
|
864
864
|
children: s,
|
|
865
865
|
variant: n = "info",
|
|
866
866
|
title: r,
|
|
@@ -869,7 +869,7 @@ const Ft = {
|
|
|
869
869
|
closeLabel: i,
|
|
870
870
|
...l
|
|
871
871
|
}, c) {
|
|
872
|
-
const u = K(), d =
|
|
872
|
+
const u = K(), d = Wt[n], p = o || (n === "error" ? "alert" : "status");
|
|
873
873
|
return /* @__PURE__ */ e.jsxs("div", { ref: c, className: `ds-alert ds-alert--${n} ${r ? "" : "ds-alert--no-title"}`, role: p, ...l, children: [
|
|
874
874
|
d && /* @__PURE__ */ e.jsx("div", { className: "ds-alert__icon", children: /* @__PURE__ */ e.jsx(d, { size: q[3], strokeWidth: 1.5 }) }),
|
|
875
875
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-alert__content", children: [
|
|
@@ -883,11 +883,11 @@ const Ft = {
|
|
|
883
883
|
className: "ds-alert__close",
|
|
884
884
|
onClick: a,
|
|
885
885
|
"aria-label": i ?? u.closeAlert,
|
|
886
|
-
children: /* @__PURE__ */ e.jsx(
|
|
886
|
+
children: /* @__PURE__ */ e.jsx(te, { size: q[3], strokeWidth: 1.5 })
|
|
887
887
|
}
|
|
888
888
|
)
|
|
889
889
|
] });
|
|
890
|
-
}),
|
|
890
|
+
}), Ot = "data-ds-portal";
|
|
891
891
|
function Ce(t) {
|
|
892
892
|
var n;
|
|
893
893
|
const s = ((n = t.composedPath) == null ? void 0 : n.call(t)[0]) ?? t.target;
|
|
@@ -895,11 +895,11 @@ function Ce(t) {
|
|
|
895
895
|
}
|
|
896
896
|
function Ue(t, s) {
|
|
897
897
|
var r;
|
|
898
|
-
const n = (r = t == null ? void 0 : t.closest) == null ? void 0 : r.call(t, `[${
|
|
898
|
+
const n = (r = t == null ? void 0 : t.closest) == null ? void 0 : r.call(t, `[${Ot}]`);
|
|
899
899
|
return !!(n && n !== s);
|
|
900
900
|
}
|
|
901
|
-
const
|
|
902
|
-
function
|
|
901
|
+
const Ct = 200;
|
|
902
|
+
function Fs({
|
|
903
903
|
children: t,
|
|
904
904
|
title: s,
|
|
905
905
|
onClose: n,
|
|
@@ -909,24 +909,24 @@ function zs({
|
|
|
909
909
|
closeLabel: i,
|
|
910
910
|
...l
|
|
911
911
|
}) {
|
|
912
|
-
const c = K(), u =
|
|
913
|
-
!n || h || (f(!0), setTimeout(() => {
|
|
912
|
+
const c = K(), u = R(null), d = R(null), p = X.useId(), [h, f] = D(!1), _ = R(null), j = () => {
|
|
913
|
+
!n || h || (f(!0), _.current = setTimeout(() => {
|
|
914
914
|
f(!1), n();
|
|
915
|
-
},
|
|
915
|
+
}, Ct));
|
|
916
916
|
};
|
|
917
|
-
|
|
918
|
-
const
|
|
919
|
-
w.key === "Escape" &&
|
|
920
|
-
},
|
|
921
|
-
var
|
|
922
|
-
const
|
|
923
|
-
|
|
917
|
+
P(() => () => clearTimeout(_.current), []), P(() => {
|
|
918
|
+
const x = (w) => {
|
|
919
|
+
w.key === "Escape" && j();
|
|
920
|
+
}, k = (w) => {
|
|
921
|
+
var L;
|
|
922
|
+
const I = Ce(w);
|
|
923
|
+
I && ((L = d.current) != null && L.contains(I) || Ue(I, u.current) || j());
|
|
924
924
|
};
|
|
925
|
-
return document.addEventListener("keydown",
|
|
926
|
-
document.removeEventListener("keydown",
|
|
925
|
+
return document.addEventListener("keydown", x), document.addEventListener("mousedown", k), () => {
|
|
926
|
+
document.removeEventListener("keydown", x), document.removeEventListener("mousedown", k);
|
|
927
927
|
};
|
|
928
928
|
}, [n, h]);
|
|
929
|
-
const
|
|
929
|
+
const y = X.Children.toArray(t), N = y.find((x) => (x == null ? void 0 : x.type) === xe), T = y.filter((x) => (x == null ? void 0 : x.type) !== xe), A = /* @__PURE__ */ e.jsx(
|
|
930
930
|
"div",
|
|
931
931
|
{
|
|
932
932
|
className: ["ds-modal-overlay", h && "ds-modal-overlay--closing"].filter(Boolean).join(" "),
|
|
@@ -949,8 +949,8 @@ function zs({
|
|
|
949
949
|
className: "ds-modal__close",
|
|
950
950
|
variant: "ghost",
|
|
951
951
|
size: "small",
|
|
952
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
953
|
-
onClick:
|
|
952
|
+
icon: /* @__PURE__ */ e.jsx(te, { size: q[2], strokeWidth: 1.5 }),
|
|
953
|
+
onClick: j,
|
|
954
954
|
"aria-label": i ?? c.closeModal
|
|
955
955
|
}
|
|
956
956
|
),
|
|
@@ -958,20 +958,20 @@ function zs({
|
|
|
958
958
|
s && /* @__PURE__ */ e.jsx("h3", { id: p, className: "ds-modal__title", children: s }),
|
|
959
959
|
o && /* @__PURE__ */ e.jsx("div", { className: "ds-modal__subheader", children: o })
|
|
960
960
|
] }),
|
|
961
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children:
|
|
962
|
-
|
|
961
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-modal__body ds-scrollable", children: T }),
|
|
962
|
+
N
|
|
963
963
|
]
|
|
964
964
|
}
|
|
965
965
|
)
|
|
966
966
|
}
|
|
967
967
|
);
|
|
968
|
-
return typeof document > "u" ?
|
|
968
|
+
return typeof document > "u" ? A : re.createPortal(A, document.body);
|
|
969
969
|
}
|
|
970
970
|
function xe({ children: t }) {
|
|
971
971
|
return !t || X.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-modal__footer", children: t });
|
|
972
972
|
}
|
|
973
|
-
const
|
|
974
|
-
function
|
|
973
|
+
const Ut = 320;
|
|
974
|
+
function Ws({
|
|
975
975
|
children: t,
|
|
976
976
|
title: s,
|
|
977
977
|
onClose: n,
|
|
@@ -979,24 +979,24 @@ function Fs({
|
|
|
979
979
|
closeLabel: a,
|
|
980
980
|
...o
|
|
981
981
|
}) {
|
|
982
|
-
const i = K(), l =
|
|
983
|
-
!n || d || (p(!0), setTimeout(() => {
|
|
982
|
+
const i = K(), l = R(null), c = R(null), u = X.useId(), [d, p] = D(!1), h = R(null), f = () => {
|
|
983
|
+
!n || d || (p(!0), h.current = setTimeout(() => {
|
|
984
984
|
p(!1), n();
|
|
985
|
-
},
|
|
985
|
+
}, Ut));
|
|
986
986
|
};
|
|
987
|
-
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
-
},
|
|
987
|
+
P(() => () => clearTimeout(h.current), []), P(() => {
|
|
988
|
+
const T = (x) => {
|
|
989
|
+
x.key === "Escape" && f();
|
|
990
|
+
}, A = (x) => {
|
|
991
991
|
var w;
|
|
992
|
-
const
|
|
993
|
-
|
|
992
|
+
const k = Ce(x);
|
|
993
|
+
k && ((w = c.current) != null && w.contains(k) || Ue(k, l.current) || f());
|
|
994
994
|
};
|
|
995
|
-
return document.addEventListener("keydown",
|
|
996
|
-
document.removeEventListener("keydown",
|
|
995
|
+
return document.addEventListener("keydown", T), document.addEventListener("mousedown", A), () => {
|
|
996
|
+
document.removeEventListener("keydown", T), document.removeEventListener("mousedown", A);
|
|
997
997
|
};
|
|
998
998
|
}, [n, d]);
|
|
999
|
-
const
|
|
999
|
+
const _ = X.Children.toArray(t), j = _.find((T) => (T == null ? void 0 : T.type) === xe), y = _.filter((T) => (T == null ? void 0 : T.type) !== xe), N = /* @__PURE__ */ e.jsx(
|
|
1000
1000
|
"div",
|
|
1001
1001
|
{
|
|
1002
1002
|
className: ["ds-bottom-sheet-overlay", d && "ds-bottom-sheet-overlay--closing"].filter(Boolean).join(" "),
|
|
@@ -1020,8 +1020,8 @@ function Fs({
|
|
|
1020
1020
|
className: "ds-bottom-sheet__close",
|
|
1021
1021
|
variant: "ghost",
|
|
1022
1022
|
size: "small",
|
|
1023
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
1024
|
-
onClick:
|
|
1023
|
+
icon: /* @__PURE__ */ e.jsx(te, { size: q[2], strokeWidth: 1.5 }),
|
|
1024
|
+
onClick: f,
|
|
1025
1025
|
"aria-label": a ?? i.close
|
|
1026
1026
|
}
|
|
1027
1027
|
),
|
|
@@ -1029,16 +1029,16 @@ function Fs({
|
|
|
1029
1029
|
s && /* @__PURE__ */ e.jsx("h3", { id: u, className: "ds-bottom-sheet__title", children: s }),
|
|
1030
1030
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__subheader", children: r })
|
|
1031
1031
|
] }),
|
|
1032
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children:
|
|
1033
|
-
|
|
1032
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-bottom-sheet__body ds-scrollable", children: y }),
|
|
1033
|
+
j
|
|
1034
1034
|
]
|
|
1035
1035
|
}
|
|
1036
1036
|
)
|
|
1037
1037
|
}
|
|
1038
1038
|
);
|
|
1039
|
-
return typeof document > "u" ?
|
|
1039
|
+
return typeof document > "u" ? N : re.createPortal(N, document.body);
|
|
1040
1040
|
}
|
|
1041
|
-
function
|
|
1041
|
+
function Ht({
|
|
1042
1042
|
children: t,
|
|
1043
1043
|
title: s,
|
|
1044
1044
|
defaultExpanded: n = !1,
|
|
@@ -1049,14 +1049,14 @@ function Ut({
|
|
|
1049
1049
|
...l
|
|
1050
1050
|
}) {
|
|
1051
1051
|
const c = K(), u = s ?? c.code, [d, p] = D(n), h = r !== void 0, f = h ? r : d, _ = () => {
|
|
1052
|
-
h ? a == null || a(!r) : p((
|
|
1053
|
-
},
|
|
1052
|
+
h ? a == null || a(!r) : p((y) => !y);
|
|
1053
|
+
}, j = [
|
|
1054
1054
|
"ds-code-accordion",
|
|
1055
1055
|
`ds-code-accordion--${o}`,
|
|
1056
1056
|
f && "ds-code-accordion--expanded",
|
|
1057
1057
|
i
|
|
1058
1058
|
].filter(Boolean).join(" ");
|
|
1059
|
-
return /* @__PURE__ */ e.jsxs("div", { className:
|
|
1059
|
+
return /* @__PURE__ */ e.jsxs("div", { className: j, ...l, children: [
|
|
1060
1060
|
/* @__PURE__ */ e.jsxs(
|
|
1061
1061
|
"button",
|
|
1062
1062
|
{
|
|
@@ -1080,11 +1080,11 @@ function Ut({
|
|
|
1080
1080
|
/* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__content", children: /* @__PURE__ */ e.jsx("div", { className: "ds-code-accordion__inner", children: /* @__PURE__ */ e.jsx("pre", { className: "ds-code-accordion__pre ds-scrollable", children: /* @__PURE__ */ e.jsx("code", { children: t }) }) }) })
|
|
1081
1081
|
] });
|
|
1082
1082
|
}
|
|
1083
|
-
function
|
|
1083
|
+
function Os({ children: t, block: s = !1, collapsible: n = !1, title: r, defaultExpanded: a = !1, ...o }) {
|
|
1084
1084
|
const i = K(), l = r ?? i.code;
|
|
1085
|
-
return s ? n ? /* @__PURE__ */ e.jsx(
|
|
1085
|
+
return s ? n ? /* @__PURE__ */ e.jsx(Ht, { title: l, defaultExpanded: a, ...o, children: t }) : /* @__PURE__ */ e.jsx("pre", { className: "ds-code-block ds-scrollable", ...o, children: /* @__PURE__ */ e.jsx("code", { children: t }) }) : /* @__PURE__ */ e.jsx("code", { className: "ds-code-inline", ...o, children: t });
|
|
1086
1086
|
}
|
|
1087
|
-
function
|
|
1087
|
+
function Cs({ href: t, children: s, onClick: n, target: r, rel: a, ...o }) {
|
|
1088
1088
|
const l = r === "_blank" ? a ? `${a} noopener noreferrer` : "noopener noreferrer" : a;
|
|
1089
1089
|
return /* @__PURE__ */ e.jsx(
|
|
1090
1090
|
"a",
|
|
@@ -1099,10 +1099,10 @@ function Os({ href: t, children: s, onClick: n, target: r, rel: a, ...o }) {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
);
|
|
1101
1101
|
}
|
|
1102
|
-
function
|
|
1102
|
+
function Us({ children: t, size: s = "m", variant: n = "ghost", ...r }) {
|
|
1103
1103
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-tabs", role: "tablist", ...r, children: X.Children.map(t, (a) => X.isValidElement(a) ? X.cloneElement(a, { size: s, variant: n }) : a) });
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function Hs({ children: t, selected: s = !1, onClick: n, size: r = "m", variant: a = "ghost", disabled: o = !1, icon: i, href: l, ...c }) {
|
|
1106
1106
|
const u = i && !t, d = [
|
|
1107
1107
|
"ds-tab",
|
|
1108
1108
|
`ds-tab--${r}`,
|
|
@@ -1148,10 +1148,10 @@ function Us({ children: t, selected: s = !1, onClick: n, size: r = "m", variant:
|
|
|
1148
1148
|
}
|
|
1149
1149
|
);
|
|
1150
1150
|
}
|
|
1151
|
-
function
|
|
1151
|
+
function Vs({ children: t, className: s = "", ...n }) {
|
|
1152
1152
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-browser-pane", s].filter(Boolean).join(" "), ...n, children: t });
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function Ys({ tabs: t, active: s, onChange: n, onClose: r, className: a = "", ...o }) {
|
|
1155
1155
|
const { t: i } = be();
|
|
1156
1156
|
return /* @__PURE__ */ e.jsx(
|
|
1157
1157
|
"div",
|
|
@@ -1194,7 +1194,7 @@ function Vs({ tabs: t, active: s, onChange: n, onClose: r, className: a = "", ..
|
|
|
1194
1194
|
onClick: (d) => {
|
|
1195
1195
|
d.stopPropagation(), r == null || r(l.id);
|
|
1196
1196
|
},
|
|
1197
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1197
|
+
children: /* @__PURE__ */ e.jsx(te, { size: 12, strokeWidth: 2 })
|
|
1198
1198
|
}
|
|
1199
1199
|
) : null
|
|
1200
1200
|
]
|
|
@@ -1205,10 +1205,10 @@ function Vs({ tabs: t, active: s, onChange: n, onClose: r, className: a = "", ..
|
|
|
1205
1205
|
}
|
|
1206
1206
|
);
|
|
1207
1207
|
}
|
|
1208
|
-
function
|
|
1208
|
+
function qs({ children: t, className: s = "", ...n }) {
|
|
1209
1209
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-list", s].filter(Boolean).join(" "), role: "list", ...n, children: t });
|
|
1210
1210
|
}
|
|
1211
|
-
function
|
|
1211
|
+
function Gs({
|
|
1212
1212
|
icon: t,
|
|
1213
1213
|
title: s,
|
|
1214
1214
|
subtitle: n,
|
|
@@ -1232,24 +1232,24 @@ function qs({
|
|
|
1232
1232
|
] });
|
|
1233
1233
|
return a ? /* @__PURE__ */ e.jsx("button", { type: "button", role: "listitem", className: c, onClick: a, ...i, children: u }) : /* @__PURE__ */ e.jsx("div", { role: "listitem", className: c, ...i, children: u });
|
|
1234
1234
|
}
|
|
1235
|
-
function
|
|
1236
|
-
const o =
|
|
1235
|
+
function Ks({ options: t, value: s, onChange: n, size: r = "m", disabled: a = !1 }) {
|
|
1236
|
+
const o = R(null), i = R(null), [l, c] = D(!1), u = R(!1), d = R(null), p = R(null), h = () => {
|
|
1237
1237
|
if (!o.current) return;
|
|
1238
1238
|
const f = o.current.querySelector(`[data-value="${s}"]`);
|
|
1239
1239
|
if (!f) return;
|
|
1240
|
-
const _ = o.current.getBoundingClientRect(),
|
|
1241
|
-
i.current ? (i.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left =
|
|
1240
|
+
const _ = o.current.getBoundingClientRect(), j = f.getBoundingClientRect(), y = j.left - _.left, N = j.width;
|
|
1241
|
+
i.current ? (i.current.style.transition = u.current ? "left var(--transition-normal), width var(--transition-normal)" : "none", i.current.style.left = y + "px", i.current.style.width = N + "px", u.current = !1) : (c(!0), requestAnimationFrame(() => {
|
|
1242
1242
|
if (!i.current || !o.current) return;
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
1245
|
-
const
|
|
1246
|
-
i.current.style.transition = "none", i.current.style.left =
|
|
1243
|
+
const T = o.current.querySelector(`[data-value="${s}"]`);
|
|
1244
|
+
if (!T) return;
|
|
1245
|
+
const A = o.current.getBoundingClientRect(), x = T.getBoundingClientRect();
|
|
1246
|
+
i.current.style.transition = "none", i.current.style.left = x.left - A.left + "px", i.current.style.width = x.width + "px";
|
|
1247
1247
|
}));
|
|
1248
1248
|
};
|
|
1249
1249
|
return p.current = h, ct(() => {
|
|
1250
1250
|
const f = d.current !== s;
|
|
1251
1251
|
d.current = s, u.current = l && f, h();
|
|
1252
|
-
}),
|
|
1252
|
+
}), P(() => {
|
|
1253
1253
|
if (!o.current) return;
|
|
1254
1254
|
const f = new ResizeObserver(() => {
|
|
1255
1255
|
u.current = !1, p.current();
|
|
@@ -1335,7 +1335,7 @@ function He({
|
|
|
1335
1335
|
] });
|
|
1336
1336
|
}
|
|
1337
1337
|
const ce = 8, pe = 8;
|
|
1338
|
-
function
|
|
1338
|
+
function Vt(t, s, n) {
|
|
1339
1339
|
const r = window.innerWidth;
|
|
1340
1340
|
let a, o;
|
|
1341
1341
|
switch (t) {
|
|
@@ -1357,7 +1357,7 @@ function Ht(t, s, n) {
|
|
|
1357
1357
|
const i = Math.max(pe, Math.min(r - n.width - pe, o)), l = o - i;
|
|
1358
1358
|
return { top: a, left: i, arrowOffset: l };
|
|
1359
1359
|
}
|
|
1360
|
-
function
|
|
1360
|
+
function Yt(t, s, n) {
|
|
1361
1361
|
const r = window.innerWidth, a = window.innerHeight;
|
|
1362
1362
|
if (t.top >= s + ce + pe) return "top";
|
|
1363
1363
|
if (a - t.bottom >= s + ce + pe) return "bottom";
|
|
@@ -1367,30 +1367,30 @@ function Vt(t, s, n) {
|
|
|
1367
1367
|
return o === t.top ? "top" : o === a - t.bottom ? "bottom" : o === r - t.right ? "right" : "left";
|
|
1368
1368
|
}
|
|
1369
1369
|
function Ve({ children: t, content: s, position: n, ...r }) {
|
|
1370
|
-
const [a, o] = D(!1), [i, l] = D({ visibility: "hidden" }), [c, u] = D(n || "top"), d =
|
|
1370
|
+
const [a, o] = D(!1), [i, l] = D({ visibility: "hidden" }), [c, u] = D(n || "top"), d = R(null), p = R(null), h = R(!1), f = () => {
|
|
1371
1371
|
if (!d.current || !p.current) return;
|
|
1372
|
-
const
|
|
1373
|
-
u(
|
|
1372
|
+
const j = d.current.getBoundingClientRect(), y = p.current.getBoundingClientRect(), N = n || Yt(j, y.height, y.width), { top: T, left: A, arrowOffset: x } = Vt(N, j, y);
|
|
1373
|
+
u(N), l({
|
|
1374
1374
|
position: "fixed",
|
|
1375
|
-
top:
|
|
1376
|
-
left:
|
|
1375
|
+
top: T,
|
|
1376
|
+
left: A,
|
|
1377
1377
|
visibility: "visible",
|
|
1378
|
-
"--arrow-offset": `${
|
|
1378
|
+
"--arrow-offset": `${x}px`
|
|
1379
1379
|
});
|
|
1380
1380
|
};
|
|
1381
|
-
if (
|
|
1381
|
+
if (P(() => {
|
|
1382
1382
|
if (!a) return;
|
|
1383
1383
|
l({ position: "fixed", visibility: "hidden" });
|
|
1384
|
-
const
|
|
1384
|
+
const j = requestAnimationFrame(f);
|
|
1385
1385
|
return window.addEventListener("scroll", f, !0), window.addEventListener("resize", f), () => {
|
|
1386
|
-
cancelAnimationFrame(
|
|
1386
|
+
cancelAnimationFrame(j), window.removeEventListener("scroll", f, !0), window.removeEventListener("resize", f);
|
|
1387
1387
|
};
|
|
1388
|
-
}, [a, n]),
|
|
1388
|
+
}, [a, n]), P(() => {
|
|
1389
1389
|
if (!a) return;
|
|
1390
|
-
const
|
|
1391
|
-
d.current && !d.current.contains(
|
|
1390
|
+
const j = (y) => {
|
|
1391
|
+
d.current && !d.current.contains(y.target) && o(!1);
|
|
1392
1392
|
};
|
|
1393
|
-
return document.addEventListener("touchstart",
|
|
1393
|
+
return document.addEventListener("touchstart", j), () => document.removeEventListener("touchstart", j);
|
|
1394
1394
|
}, [a]), !s) return t;
|
|
1395
1395
|
const _ = a && /* @__PURE__ */ e.jsx(
|
|
1396
1396
|
"div",
|
|
@@ -1415,7 +1415,7 @@ function Ve({ children: t, content: s, position: n, ...r }) {
|
|
|
1415
1415
|
h.current || o(!1);
|
|
1416
1416
|
},
|
|
1417
1417
|
onTouchStart: () => {
|
|
1418
|
-
h.current = !0, o((
|
|
1418
|
+
h.current = !0, o((j) => !j);
|
|
1419
1419
|
},
|
|
1420
1420
|
...r,
|
|
1421
1421
|
children: [
|
|
@@ -1425,12 +1425,12 @@ function Ve({ children: t, content: s, position: n, ...r }) {
|
|
|
1425
1425
|
}
|
|
1426
1426
|
);
|
|
1427
1427
|
}
|
|
1428
|
-
const Ze = 8, Ee = 8,
|
|
1428
|
+
const Ze = 8, Ee = 8, qt = 140;
|
|
1429
1429
|
function Qe(t) {
|
|
1430
1430
|
const s = String(t ?? "").replace(/^@/, "").trim();
|
|
1431
1431
|
return s ? `@${s}` : "";
|
|
1432
1432
|
}
|
|
1433
|
-
function
|
|
1433
|
+
function Xs({
|
|
1434
1434
|
label: t,
|
|
1435
1435
|
children: s,
|
|
1436
1436
|
mode: n = "click",
|
|
@@ -1443,59 +1443,59 @@ function Ks({
|
|
|
1443
1443
|
popoverClassName: u = "",
|
|
1444
1444
|
...d
|
|
1445
1445
|
}) {
|
|
1446
|
-
const p =
|
|
1446
|
+
const p = _t(), h = R(null), f = R(null), _ = R(null), [j, y] = D(!1), [N, T] = D(null), A = s != null, x = a || t || "", k = Qe(t || a), w = Qe(o), I = ne(() => {
|
|
1447
1447
|
_.current != null && (window.clearTimeout(_.current), _.current = null);
|
|
1448
|
-
}, []), L =
|
|
1449
|
-
I(),
|
|
1450
|
-
}, [I]),
|
|
1451
|
-
I(), _.current = window.setTimeout(() =>
|
|
1452
|
-
}, [I]),
|
|
1453
|
-
const
|
|
1454
|
-
if (!
|
|
1455
|
-
const
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1458
|
-
const H = Math.max(Ee, Math.min(
|
|
1459
|
-
|
|
1448
|
+
}, []), L = ne(() => {
|
|
1449
|
+
I(), y(!0);
|
|
1450
|
+
}, [I]), W = ne(() => {
|
|
1451
|
+
I(), _.current = window.setTimeout(() => y(!1), qt);
|
|
1452
|
+
}, [I]), O = ne(() => {
|
|
1453
|
+
const M = h.current, V = f.current;
|
|
1454
|
+
if (!M) return;
|
|
1455
|
+
const v = M.getBoundingClientRect(), $ = (V == null ? void 0 : V.offsetHeight) ?? 160, S = (V == null ? void 0 : V.offsetWidth) ?? 260;
|
|
1456
|
+
let z = v.bottom + Ze;
|
|
1457
|
+
z + $ > window.innerHeight - Ee && (z = Math.max(Ee, v.top - $ - Ze));
|
|
1458
|
+
const H = Math.max(Ee, Math.min(v.left, window.innerWidth - S - Ee));
|
|
1459
|
+
T({ top: z, left: H });
|
|
1460
1460
|
}, []);
|
|
1461
1461
|
ct(() => {
|
|
1462
|
-
|
|
1463
|
-
}, [
|
|
1464
|
-
if (!
|
|
1465
|
-
const
|
|
1466
|
-
$.key === "Escape" &&
|
|
1467
|
-
},
|
|
1468
|
-
var
|
|
1462
|
+
j && O();
|
|
1463
|
+
}, [j, O]), P(() => {
|
|
1464
|
+
if (!j) return;
|
|
1465
|
+
const M = () => O(), V = ($) => {
|
|
1466
|
+
$.key === "Escape" && y(!1);
|
|
1467
|
+
}, v = ($) => {
|
|
1468
|
+
var z, H;
|
|
1469
1469
|
if (n === "hover") return;
|
|
1470
|
-
const
|
|
1471
|
-
(
|
|
1470
|
+
const S = $.target;
|
|
1471
|
+
(z = f.current) != null && z.contains(S) || (H = h.current) != null && H.contains(S) || y(!1);
|
|
1472
1472
|
};
|
|
1473
|
-
return window.addEventListener("scroll",
|
|
1474
|
-
window.removeEventListener("scroll",
|
|
1473
|
+
return window.addEventListener("scroll", M, !0), window.addEventListener("resize", M), document.addEventListener("keydown", V), document.addEventListener("mousedown", v), () => {
|
|
1474
|
+
window.removeEventListener("scroll", M, !0), window.removeEventListener("resize", M), document.removeEventListener("keydown", V), document.removeEventListener("mousedown", v);
|
|
1475
1475
|
};
|
|
1476
|
-
}, [
|
|
1477
|
-
const
|
|
1476
|
+
}, [j, O, n]), P(() => () => I(), [I]);
|
|
1477
|
+
const g = n === "hover" ? { onMouseEnter: L, onMouseLeave: W } : {}, C = j ? re.createPortal(
|
|
1478
1478
|
/* @__PURE__ */ e.jsxs(
|
|
1479
1479
|
"div",
|
|
1480
1480
|
{
|
|
1481
1481
|
ref: f,
|
|
1482
1482
|
id: p,
|
|
1483
1483
|
role: "dialog",
|
|
1484
|
-
"aria-label":
|
|
1484
|
+
"aria-label": x || k || "Mention",
|
|
1485
1485
|
"data-ds-portal": "",
|
|
1486
1486
|
className: ["ds-mention__popover", u].filter(Boolean).join(" "),
|
|
1487
|
-
style:
|
|
1488
|
-
...
|
|
1487
|
+
style: N ? { top: N.top, left: N.left } : { top: -9999, left: -9999, visibility: "hidden" },
|
|
1488
|
+
...g,
|
|
1489
1489
|
children: [
|
|
1490
|
-
(r ||
|
|
1490
|
+
(r || x || w) && /* @__PURE__ */ e.jsxs("div", { className: "ds-mention__head", children: [
|
|
1491
1491
|
r,
|
|
1492
|
-
(
|
|
1493
|
-
|
|
1494
|
-
|
|
1492
|
+
(x || w) && /* @__PURE__ */ e.jsxs("div", { className: "ds-mention__meta", children: [
|
|
1493
|
+
x ? /* @__PURE__ */ e.jsx("span", { className: "ds-mention__name", children: x }) : null,
|
|
1494
|
+
w ? /* @__PURE__ */ e.jsx("span", { className: "ds-mention__handle", children: w }) : null
|
|
1495
1495
|
] })
|
|
1496
1496
|
] }),
|
|
1497
1497
|
i ? /* @__PURE__ */ e.jsx("p", { className: "ds-mention__desc", children: i }) : null,
|
|
1498
|
-
l ? /* @__PURE__ */ e.jsx("div", { className: "ds-mention__actions", onClick: () =>
|
|
1498
|
+
l ? /* @__PURE__ */ e.jsx("div", { className: "ds-mention__actions", onClick: () => y(!1), children: l }) : null
|
|
1499
1499
|
]
|
|
1500
1500
|
}
|
|
1501
1501
|
),
|
|
@@ -1510,31 +1510,31 @@ function Ks({
|
|
|
1510
1510
|
type: "button",
|
|
1511
1511
|
className: [
|
|
1512
1512
|
"ds-mention",
|
|
1513
|
-
|
|
1513
|
+
A && "ds-mention--custom",
|
|
1514
1514
|
c
|
|
1515
1515
|
].filter(Boolean).join(" "),
|
|
1516
|
-
"aria-expanded":
|
|
1516
|
+
"aria-expanded": j,
|
|
1517
1517
|
"aria-haspopup": "dialog",
|
|
1518
|
-
"aria-label":
|
|
1519
|
-
"aria-controls":
|
|
1520
|
-
onClick: (
|
|
1518
|
+
"aria-label": A && (k || x) || void 0,
|
|
1519
|
+
"aria-controls": j ? p : void 0,
|
|
1520
|
+
onClick: (M) => {
|
|
1521
1521
|
var V;
|
|
1522
|
-
if ((V = d.onClick) == null || V.call(d,
|
|
1523
|
-
if (
|
|
1522
|
+
if ((V = d.onClick) == null || V.call(d, M), !M.defaultPrevented) {
|
|
1523
|
+
if (M.preventDefault(), M.stopPropagation(), n === "hover") {
|
|
1524
1524
|
L();
|
|
1525
1525
|
return;
|
|
1526
1526
|
}
|
|
1527
|
-
|
|
1527
|
+
y((v) => !v);
|
|
1528
1528
|
}
|
|
1529
1529
|
},
|
|
1530
|
-
...
|
|
1531
|
-
children:
|
|
1530
|
+
...g,
|
|
1531
|
+
children: A ? s : k
|
|
1532
1532
|
}
|
|
1533
1533
|
),
|
|
1534
|
-
typeof document < "u" ?
|
|
1534
|
+
typeof document < "u" ? C : null
|
|
1535
1535
|
] });
|
|
1536
1536
|
}
|
|
1537
|
-
function
|
|
1537
|
+
function Js({
|
|
1538
1538
|
checked: t = !1,
|
|
1539
1539
|
onChange: s,
|
|
1540
1540
|
size: n = "m",
|
|
@@ -1565,7 +1565,7 @@ function Xs({
|
|
|
1565
1565
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-toggle__label", children: a })
|
|
1566
1566
|
] });
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1568
|
+
function Zs({
|
|
1569
1569
|
checked: t = !1,
|
|
1570
1570
|
onChange: s,
|
|
1571
1571
|
size: n = "m",
|
|
@@ -1603,7 +1603,7 @@ function Js({
|
|
|
1603
1603
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-checkbox__label", children: a })
|
|
1604
1604
|
] });
|
|
1605
1605
|
}
|
|
1606
|
-
function
|
|
1606
|
+
function Qs({
|
|
1607
1607
|
checked: t = !1,
|
|
1608
1608
|
onChange: s,
|
|
1609
1609
|
size: n = "m",
|
|
@@ -1638,7 +1638,7 @@ function Zs({
|
|
|
1638
1638
|
a && /* @__PURE__ */ e.jsx("span", { className: "ds-radio__label", children: a })
|
|
1639
1639
|
] });
|
|
1640
1640
|
}
|
|
1641
|
-
function
|
|
1641
|
+
function Gt({ width: t, height: s, shape: n = "rect", aspectRatio: r, className: a = "", style: o = {}, ...i }) {
|
|
1642
1642
|
return /* @__PURE__ */ e.jsx(
|
|
1643
1643
|
"span",
|
|
1644
1644
|
{
|
|
@@ -1649,7 +1649,7 @@ function qt({ width: t, height: s, shape: n = "rect", aspectRatio: r, className:
|
|
|
1649
1649
|
}
|
|
1650
1650
|
);
|
|
1651
1651
|
}
|
|
1652
|
-
function
|
|
1652
|
+
function Kt({ lines: t = 1, lastLineWidth: s = "70%", gap: n, className: r = "", style: a = {}, ...o }) {
|
|
1653
1653
|
return /* @__PURE__ */ e.jsx(
|
|
1654
1654
|
"span",
|
|
1655
1655
|
{
|
|
@@ -1668,20 +1668,20 @@ function Gt({ lines: t = 1, lastLineWidth: s = "70%", gap: n, className: r = "",
|
|
|
1668
1668
|
}
|
|
1669
1669
|
);
|
|
1670
1670
|
}
|
|
1671
|
-
|
|
1672
|
-
function
|
|
1671
|
+
Gt.Text = Kt;
|
|
1672
|
+
function Xt(t) {
|
|
1673
1673
|
let s = 2166136261;
|
|
1674
1674
|
for (let n = 0; n < t.length; n++)
|
|
1675
1675
|
s ^= t.charCodeAt(n), s = Math.imul(s, 16777619) >>> 0;
|
|
1676
1676
|
return s % 360;
|
|
1677
1677
|
}
|
|
1678
|
-
function
|
|
1678
|
+
function Jt(t) {
|
|
1679
1679
|
if (!t) return "";
|
|
1680
1680
|
const s = t.trim().split(/\s+/);
|
|
1681
1681
|
return s.length >= 2 ? (s[0][0] + s[1][0]).toUpperCase() : t[0].toUpperCase();
|
|
1682
1682
|
}
|
|
1683
|
-
function
|
|
1684
|
-
const l =
|
|
1683
|
+
function en({ seed: t, icon: s, src: n, size: r = 32, className: a = "", style: o = {}, ...i }) {
|
|
1684
|
+
const l = Xt(t ?? ""), [c, u] = D(!1), d = s ?? /* @__PURE__ */ e.jsx("span", { className: "ds-avatar__initials", children: Jt(t) });
|
|
1685
1685
|
return /* @__PURE__ */ e.jsx(
|
|
1686
1686
|
"div",
|
|
1687
1687
|
{
|
|
@@ -1693,7 +1693,7 @@ function Qs({ seed: t, icon: s, src: n, size: r = 32, className: a = "", style:
|
|
|
1693
1693
|
}
|
|
1694
1694
|
);
|
|
1695
1695
|
}
|
|
1696
|
-
function
|
|
1696
|
+
function tn({
|
|
1697
1697
|
children: t,
|
|
1698
1698
|
size: s = "compact",
|
|
1699
1699
|
stickyTop: n,
|
|
@@ -1723,13 +1723,13 @@ function en({
|
|
|
1723
1723
|
}
|
|
1724
1724
|
);
|
|
1725
1725
|
}
|
|
1726
|
-
function
|
|
1726
|
+
function sn({ children: t, ...s }) {
|
|
1727
1727
|
return /* @__PURE__ */ e.jsx("thead", { ...s, children: t });
|
|
1728
1728
|
}
|
|
1729
|
-
function
|
|
1729
|
+
function nn({ children: t, ...s }) {
|
|
1730
1730
|
return /* @__PURE__ */ e.jsx("tbody", { ...s, children: t });
|
|
1731
1731
|
}
|
|
1732
|
-
function
|
|
1732
|
+
function rn({ children: t, interactive: s, selected: n, subheader: r, exiting: a, updated: o, className: i = "", onClick: l, ...c }) {
|
|
1733
1733
|
return /* @__PURE__ */ e.jsx(
|
|
1734
1734
|
"tr",
|
|
1735
1735
|
{
|
|
@@ -1748,11 +1748,11 @@ function nn({ children: t, interactive: s, selected: n, subheader: r, exiting: a
|
|
|
1748
1748
|
}
|
|
1749
1749
|
);
|
|
1750
1750
|
}
|
|
1751
|
-
function
|
|
1751
|
+
function an({ children: t, colSpan: s = 999, ...n }) {
|
|
1752
1752
|
return /* @__PURE__ */ e.jsx("tr", { className: "ds-table-row ds-table-row--subheader", ...n, children: /* @__PURE__ */ e.jsx("td", { colSpan: s, children: t }) });
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1755
|
-
const c = !!r || n !== void 0, u = n === "asc" ?
|
|
1754
|
+
function on({ children: t, align: s = "left", sortDir: n, onSort: r, width: a, className: o = "", style: i = {}, ...l }) {
|
|
1755
|
+
const c = !!r || n !== void 0, u = n === "asc" ? wt : n === "desc" ? ye : gt;
|
|
1756
1756
|
return /* @__PURE__ */ e.jsx(
|
|
1757
1757
|
"th",
|
|
1758
1758
|
{
|
|
@@ -1773,7 +1773,7 @@ function an({ children: t, align: s = "left", sortDir: n, onSort: r, width: a, c
|
|
|
1773
1773
|
}
|
|
1774
1774
|
);
|
|
1775
1775
|
}
|
|
1776
|
-
function
|
|
1776
|
+
function ln({ children: t, align: s = "left", secondary: n, muted: r, truncate: a, nowrap: o, className: i = "", ...l }) {
|
|
1777
1777
|
return /* @__PURE__ */ e.jsx(
|
|
1778
1778
|
"td",
|
|
1779
1779
|
{
|
|
@@ -1791,7 +1791,7 @@ function on({ children: t, align: s = "left", secondary: n, muted: r, truncate:
|
|
|
1791
1791
|
}
|
|
1792
1792
|
);
|
|
1793
1793
|
}
|
|
1794
|
-
function
|
|
1794
|
+
function cn({
|
|
1795
1795
|
icon: t,
|
|
1796
1796
|
title: s,
|
|
1797
1797
|
description: n,
|
|
@@ -1814,7 +1814,7 @@ function ln({
|
|
|
1814
1814
|
}
|
|
1815
1815
|
);
|
|
1816
1816
|
}
|
|
1817
|
-
function
|
|
1817
|
+
function dn({
|
|
1818
1818
|
label: t,
|
|
1819
1819
|
hint: s,
|
|
1820
1820
|
error: n,
|
|
@@ -1845,7 +1845,7 @@ function cn({
|
|
|
1845
1845
|
}
|
|
1846
1846
|
);
|
|
1847
1847
|
}
|
|
1848
|
-
function
|
|
1848
|
+
function un({ label: t, value: s, delta: n, size: r = "m", inline: a = !1, className: o = "", style: i, ...l }) {
|
|
1849
1849
|
const c = n != null && n.startsWith("+") ? "up" : n != null && n.startsWith("-") ? "down" : "neutral";
|
|
1850
1850
|
return /* @__PURE__ */ e.jsxs(
|
|
1851
1851
|
"div",
|
|
@@ -1866,7 +1866,7 @@ function dn({ label: t, value: s, delta: n, size: r = "m", inline: a = !1, class
|
|
|
1866
1866
|
}
|
|
1867
1867
|
);
|
|
1868
1868
|
}
|
|
1869
|
-
function
|
|
1869
|
+
function fn({
|
|
1870
1870
|
children: t,
|
|
1871
1871
|
separator: s = "/",
|
|
1872
1872
|
"aria-label": n,
|
|
@@ -1889,7 +1889,7 @@ function un({
|
|
|
1889
1889
|
}
|
|
1890
1890
|
);
|
|
1891
1891
|
}
|
|
1892
|
-
function
|
|
1892
|
+
function mn({
|
|
1893
1893
|
page: t,
|
|
1894
1894
|
total: s,
|
|
1895
1895
|
onChange: n,
|
|
@@ -1901,7 +1901,7 @@ function fn({
|
|
|
1901
1901
|
style: c,
|
|
1902
1902
|
...u
|
|
1903
1903
|
}) {
|
|
1904
|
-
const d = K(), { t: p } = be(), h =
|
|
1904
|
+
const d = K(), { t: p } = be(), h = Zt(t, s, r);
|
|
1905
1905
|
return /* @__PURE__ */ e.jsxs(
|
|
1906
1906
|
"nav",
|
|
1907
1907
|
{
|
|
@@ -1917,7 +1917,7 @@ function fn({
|
|
|
1917
1917
|
onClick: () => n == null ? void 0 : n(t - 1),
|
|
1918
1918
|
disabled: t <= 1,
|
|
1919
1919
|
"aria-label": o ?? d.previousPage,
|
|
1920
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1920
|
+
children: /* @__PURE__ */ e.jsx(yt, { size: 16 })
|
|
1921
1921
|
}
|
|
1922
1922
|
),
|
|
1923
1923
|
h.map(
|
|
@@ -1940,22 +1940,22 @@ function fn({
|
|
|
1940
1940
|
onClick: () => n == null ? void 0 : n(t + 1),
|
|
1941
1941
|
disabled: t >= s,
|
|
1942
1942
|
"aria-label": i ?? d.nextPage,
|
|
1943
|
-
children: /* @__PURE__ */ e.jsx(
|
|
1943
|
+
children: /* @__PURE__ */ e.jsx(kt, { size: 16 })
|
|
1944
1944
|
}
|
|
1945
1945
|
)
|
|
1946
1946
|
]
|
|
1947
1947
|
}
|
|
1948
1948
|
);
|
|
1949
1949
|
}
|
|
1950
|
-
function
|
|
1950
|
+
function Zt(t, s, n) {
|
|
1951
1951
|
if (s <= 7) return Array.from({ length: s }, (i, l) => l + 1);
|
|
1952
1952
|
const r = Math.max(2, t - n), a = Math.min(s - 1, t + n), o = [1];
|
|
1953
1953
|
r > 2 && o.push("…");
|
|
1954
1954
|
for (let i = r; i <= a; i++) o.push(i);
|
|
1955
1955
|
return a < s - 1 && o.push("…"), o.push(s), o;
|
|
1956
1956
|
}
|
|
1957
|
-
const
|
|
1958
|
-
function
|
|
1957
|
+
const Qt = 300;
|
|
1958
|
+
function pn({
|
|
1959
1959
|
children: t,
|
|
1960
1960
|
title: s,
|
|
1961
1961
|
onClose: n,
|
|
@@ -1968,24 +1968,24 @@ function mn({
|
|
|
1968
1968
|
closeLabel: u,
|
|
1969
1969
|
...d
|
|
1970
1970
|
}) {
|
|
1971
|
-
const p = K(), h =
|
|
1972
|
-
!n || _ || (
|
|
1973
|
-
|
|
1974
|
-
},
|
|
1971
|
+
const p = K(), h = R(null), f = X.useId(), [_, j] = D(!1), y = R(null), N = () => {
|
|
1972
|
+
!n || _ || (j(!0), y.current = setTimeout(() => {
|
|
1973
|
+
j(!1), n();
|
|
1974
|
+
}, Qt));
|
|
1975
1975
|
};
|
|
1976
|
-
|
|
1977
|
-
const w = (
|
|
1978
|
-
|
|
1979
|
-
},
|
|
1980
|
-
var
|
|
1981
|
-
const
|
|
1982
|
-
|
|
1976
|
+
P(() => () => clearTimeout(y.current), []), P(() => {
|
|
1977
|
+
const w = (L) => {
|
|
1978
|
+
L.key === "Escape" && N();
|
|
1979
|
+
}, I = (L) => {
|
|
1980
|
+
var O, g;
|
|
1981
|
+
const W = Ce(L);
|
|
1982
|
+
W && ((O = c == null ? void 0 : c.current) != null && O.contains(W) || (g = h.current) != null && g.contains(W) || Ue(W, null) || N());
|
|
1983
1983
|
};
|
|
1984
|
-
return document.addEventListener("keydown", w), document.addEventListener("mousedown",
|
|
1985
|
-
document.removeEventListener("keydown", w), document.removeEventListener("mousedown",
|
|
1984
|
+
return document.addEventListener("keydown", w), document.addEventListener("mousedown", I), () => {
|
|
1985
|
+
document.removeEventListener("keydown", w), document.removeEventListener("mousedown", I);
|
|
1986
1986
|
};
|
|
1987
1987
|
}, [n, _, c]);
|
|
1988
|
-
const
|
|
1988
|
+
const T = X.Children.toArray(t), A = T.find((w) => (w == null ? void 0 : w.type) === et || (w == null ? void 0 : w.type) === xe), x = T.filter((w) => (w == null ? void 0 : w.type) !== et && (w == null ? void 0 : w.type) !== xe), k = /* @__PURE__ */ e.jsx(
|
|
1989
1989
|
"div",
|
|
1990
1990
|
{
|
|
1991
1991
|
className: ["ds-side-page-overlay", _ && "ds-side-page-overlay--closing"].filter(Boolean).join(" "),
|
|
@@ -2010,8 +2010,8 @@ function mn({
|
|
|
2010
2010
|
className: "ds-side-page__close",
|
|
2011
2011
|
variant: "ghost",
|
|
2012
2012
|
size: "small",
|
|
2013
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2014
|
-
onClick:
|
|
2013
|
+
icon: /* @__PURE__ */ e.jsx(te, { size: q[2], strokeWidth: 1.5 }),
|
|
2014
|
+
onClick: N,
|
|
2015
2015
|
"aria-label": u ?? p.close
|
|
2016
2016
|
}
|
|
2017
2017
|
),
|
|
@@ -2019,19 +2019,19 @@ function mn({
|
|
|
2019
2019
|
s && /* @__PURE__ */ e.jsx("h3", { id: f, className: "ds-side-page__title", children: s }),
|
|
2020
2020
|
r && /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__subheader", children: r })
|
|
2021
2021
|
] }),
|
|
2022
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children:
|
|
2023
|
-
|
|
2022
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-side-page__body ds-scrollable", children: x }),
|
|
2023
|
+
A
|
|
2024
2024
|
]
|
|
2025
2025
|
}
|
|
2026
2026
|
)
|
|
2027
2027
|
}
|
|
2028
2028
|
);
|
|
2029
|
-
return typeof document > "u" ?
|
|
2029
|
+
return typeof document > "u" ? k : re.createPortal(k, document.body);
|
|
2030
2030
|
}
|
|
2031
2031
|
function et({ children: t }) {
|
|
2032
2032
|
return !t || X.Children.count(t) === 0 ? null : /* @__PURE__ */ e.jsx("div", { className: "ds-side-page__footer", children: t });
|
|
2033
2033
|
}
|
|
2034
|
-
const _e = De({ collapsed: !1, side: "left" }), Re = De(!1),
|
|
2034
|
+
const _e = De({ collapsed: !1, side: "left" }), Re = De(!1), hn = dt(function({
|
|
2035
2035
|
children: s,
|
|
2036
2036
|
collapsed: n = !1,
|
|
2037
2037
|
side: r = "left",
|
|
@@ -2045,7 +2045,7 @@ const _e = De({ collapsed: !1, side: "left" }), Re = De(!1), pn = dt(function({
|
|
|
2045
2045
|
n && "ds-nav-rail--collapsed",
|
|
2046
2046
|
`ds-nav-rail--${r}`,
|
|
2047
2047
|
i
|
|
2048
|
-
].filter(Boolean).join(" "), d =
|
|
2048
|
+
].filter(Boolean).join(" "), d = ne((p) => {
|
|
2049
2049
|
if (!p.target.closest('button, a, input, select, textarea, [role="button"], [tabindex]')) {
|
|
2050
2050
|
if (n && a) {
|
|
2051
2051
|
a();
|
|
@@ -2067,7 +2067,7 @@ const _e = De({ collapsed: !1, side: "left" }), Re = De(!1), pn = dt(function({
|
|
|
2067
2067
|
}
|
|
2068
2068
|
) });
|
|
2069
2069
|
});
|
|
2070
|
-
function
|
|
2070
|
+
function xn({
|
|
2071
2071
|
icon: t,
|
|
2072
2072
|
label: s,
|
|
2073
2073
|
selected: n = !1,
|
|
@@ -2081,7 +2081,7 @@ function hn({
|
|
|
2081
2081
|
className: d = "",
|
|
2082
2082
|
...p
|
|
2083
2083
|
}) {
|
|
2084
|
-
const { collapsed: h, side: f } =
|
|
2084
|
+
const { collapsed: h, side: f } = le(_e), _ = le(Re), N = {
|
|
2085
2085
|
className: [
|
|
2086
2086
|
"ds-nav-rail__item",
|
|
2087
2087
|
d
|
|
@@ -2098,10 +2098,10 @@ function hn({
|
|
|
2098
2098
|
"data-onboarding": u || void 0
|
|
2099
2099
|
},
|
|
2100
2100
|
...p
|
|
2101
|
-
},
|
|
2101
|
+
}, T = i != null, A = f === "left" ? "right" : "left", x = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2102
2102
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
2103
2103
|
!h && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s }),
|
|
2104
|
-
!h &&
|
|
2104
|
+
!h && T && /* @__PURE__ */ e.jsx(
|
|
2105
2105
|
"span",
|
|
2106
2106
|
{
|
|
2107
2107
|
className: ["ds-nav-rail__count", i === 0 && "ds-nav-rail__count--zero"].filter(Boolean).join(" "),
|
|
@@ -2109,26 +2109,26 @@ function hn({
|
|
|
2109
2109
|
children: i
|
|
2110
2110
|
}
|
|
2111
2111
|
),
|
|
2112
|
-
!h && l && (!
|
|
2113
|
-
h &&
|
|
2114
|
-
h && l && (!
|
|
2115
|
-
] }),
|
|
2116
|
-
return h && !_ ? /* @__PURE__ */ e.jsx(Ve, { content: s, position:
|
|
2112
|
+
!h && l && (!T || i === 0) && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot ds-nav-rail__dot--inline", "aria-hidden": "true" }),
|
|
2113
|
+
h && T && i !== 0 && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__count-collapsed", "data-updated": l || void 0, children: i > 99 ? "99+" : i }),
|
|
2114
|
+
h && l && (!T || i === 0) && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__dot", "aria-hidden": "true" })
|
|
2115
|
+
] }), k = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...N, children: x }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...N, children: x });
|
|
2116
|
+
return h && !_ ? /* @__PURE__ */ e.jsx(Ve, { content: s, position: A, children: k }) : k;
|
|
2117
2117
|
}
|
|
2118
|
-
function
|
|
2118
|
+
function vn({ children: t, className: s = "", ...n }) {
|
|
2119
2119
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__body", "ds-scrollable", s].filter(Boolean).join(" "), ...n, children: t });
|
|
2120
2120
|
}
|
|
2121
|
-
function
|
|
2121
|
+
function bn({ children: t, className: s = "", ...n }) {
|
|
2122
2122
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__header", s].filter(Boolean).join(" "), ...n, children: t });
|
|
2123
2123
|
}
|
|
2124
|
-
function
|
|
2124
|
+
function _n({ children: t, className: s = "", ...n }) {
|
|
2125
2125
|
return /* @__PURE__ */ e.jsx("div", { className: ["ds-nav-rail__footer", s].filter(Boolean).join(" "), ...n, children: t });
|
|
2126
2126
|
}
|
|
2127
|
-
function
|
|
2127
|
+
function jn({ className: t = "", ...s }) {
|
|
2128
2128
|
return /* @__PURE__ */ e.jsx("hr", { className: ["ds-nav-rail__divider", t].filter(Boolean).join(" "), ...s });
|
|
2129
2129
|
}
|
|
2130
|
-
function
|
|
2131
|
-
const { collapsed: o } =
|
|
2130
|
+
function Nn({ children: t, label: s, defaultOpen: n = !0, className: r = "", ...a }) {
|
|
2131
|
+
const { collapsed: o } = le(_e), i = K(), l = s ?? i.recents, [c, u] = D(n);
|
|
2132
2132
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-nav-rail__recents", r].filter(Boolean).join(" "), ...a, children: [
|
|
2133
2133
|
!o && /* @__PURE__ */ e.jsxs(
|
|
2134
2134
|
"button",
|
|
@@ -2146,14 +2146,14 @@ function jn({ children: t, label: s, defaultOpen: n = !0, className: r = "", ...
|
|
|
2146
2146
|
(c || o) && /* @__PURE__ */ e.jsx("div", { className: "ds-nav-rail__recents-body", children: t })
|
|
2147
2147
|
] });
|
|
2148
2148
|
}
|
|
2149
|
-
const
|
|
2149
|
+
const wn = dt(function({
|
|
2150
2150
|
as: s = "button",
|
|
2151
2151
|
avatar: n,
|
|
2152
2152
|
label: r,
|
|
2153
2153
|
className: a = "",
|
|
2154
2154
|
...o
|
|
2155
2155
|
}, i) {
|
|
2156
|
-
const { collapsed: l, side: c } =
|
|
2156
|
+
const { collapsed: l, side: c } = le(_e), u = le(Re), d = c === "left" ? "right" : "left", p = [
|
|
2157
2157
|
"ds-nav-rail__item",
|
|
2158
2158
|
"ds-nav-rail__agent",
|
|
2159
2159
|
a
|
|
@@ -2173,8 +2173,8 @@ const Nn = dt(function({
|
|
|
2173
2173
|
);
|
|
2174
2174
|
return l && !u ? /* @__PURE__ */ e.jsx(Ve, { content: r, position: d, children: f }) : f;
|
|
2175
2175
|
});
|
|
2176
|
-
function
|
|
2177
|
-
const { collapsed: c, side: u } =
|
|
2176
|
+
function gn({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a, onClick: o, className: i = "", ...l }) {
|
|
2177
|
+
const { collapsed: c, side: u } = le(_e), d = le(Re), f = {
|
|
2178
2178
|
className: [
|
|
2179
2179
|
"ds-nav-rail__item",
|
|
2180
2180
|
"ds-nav-rail__agent",
|
|
@@ -2192,11 +2192,11 @@ function wn({ avatar: t, label: s, selected: n = !1, disabled: r = !1, href: a,
|
|
|
2192
2192
|
}, _ = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2193
2193
|
/* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__icon", "aria-hidden": "true", children: t }),
|
|
2194
2194
|
!c && /* @__PURE__ */ e.jsx("span", { className: "ds-nav-rail__label", children: s })
|
|
2195
|
-
] }),
|
|
2196
|
-
return c && !d ? /* @__PURE__ */ e.jsx(Ve, { content: s, position:
|
|
2195
|
+
] }), j = u === "left" ? "right" : "left", y = a ? /* @__PURE__ */ e.jsx("a", { href: r ? void 0 : a, ...f, children: _ }) : /* @__PURE__ */ e.jsx("button", { type: "button", ...f, children: _ });
|
|
2196
|
+
return c && !d ? /* @__PURE__ */ e.jsx(Ve, { content: s, position: j, children: y }) : y;
|
|
2197
2197
|
}
|
|
2198
2198
|
const tt = 240, st = 6, nt = 8;
|
|
2199
|
-
function
|
|
2199
|
+
function yn({
|
|
2200
2200
|
trigger: t,
|
|
2201
2201
|
title: s,
|
|
2202
2202
|
children: n,
|
|
@@ -2205,57 +2205,57 @@ function gn({
|
|
|
2205
2205
|
defaultOpen: o = !1,
|
|
2206
2206
|
closeLabel: i
|
|
2207
2207
|
}) {
|
|
2208
|
-
const l = K(), { side: c } =
|
|
2208
|
+
const l = K(), { side: c } = le(_e), [u, d] = D(o), p = r !== void 0, h = p ? r : u, [f, _] = D(!1), j = R(null), y = R(null), [N, T] = D({}), A = ne(() => {
|
|
2209
2209
|
p ? a == null || a(!0) : d(!0);
|
|
2210
|
-
}, [p, a]),
|
|
2210
|
+
}, [p, a]), x = ne(() => {
|
|
2211
2211
|
p ? a == null || a(!1) : d(!1);
|
|
2212
|
-
}, [p, a]),
|
|
2213
|
-
var
|
|
2214
|
-
const L =
|
|
2212
|
+
}, [p, a]), k = ne(() => h ? x() : A(), [h, A, x]), w = ne(() => {
|
|
2213
|
+
var M;
|
|
2214
|
+
const L = j.current;
|
|
2215
2215
|
if (!L) return;
|
|
2216
|
-
const
|
|
2217
|
-
|
|
2216
|
+
const W = L.getBoundingClientRect(), O = window.innerHeight, g = ((M = y.current) == null ? void 0 : M.offsetHeight) ?? 300, C = Math.max(nt, Math.min(O - g - nt, W.top));
|
|
2217
|
+
T(c === "right" ? {
|
|
2218
2218
|
position: "fixed",
|
|
2219
|
-
top:
|
|
2220
|
-
right: window.innerWidth -
|
|
2219
|
+
top: C,
|
|
2220
|
+
right: window.innerWidth - W.left + st,
|
|
2221
2221
|
width: tt
|
|
2222
2222
|
} : {
|
|
2223
2223
|
position: "fixed",
|
|
2224
|
-
top:
|
|
2225
|
-
left:
|
|
2224
|
+
top: C,
|
|
2225
|
+
left: W.right + st,
|
|
2226
2226
|
width: tt
|
|
2227
2227
|
});
|
|
2228
2228
|
}, [c]);
|
|
2229
|
-
|
|
2229
|
+
P(() => {
|
|
2230
2230
|
if (!h) {
|
|
2231
2231
|
_(!1);
|
|
2232
2232
|
return;
|
|
2233
2233
|
}
|
|
2234
|
-
return
|
|
2235
|
-
window.removeEventListener("scroll",
|
|
2234
|
+
return w(), requestAnimationFrame(() => _(!0)), window.addEventListener("scroll", w, !0), window.addEventListener("resize", w), () => {
|
|
2235
|
+
window.removeEventListener("scroll", w, !0), window.removeEventListener("resize", w);
|
|
2236
2236
|
};
|
|
2237
|
-
}, [h,
|
|
2237
|
+
}, [h, w]), P(() => {
|
|
2238
2238
|
if (!h) return;
|
|
2239
|
-
const L = (
|
|
2240
|
-
var
|
|
2241
|
-
!((
|
|
2242
|
-
},
|
|
2243
|
-
|
|
2239
|
+
const L = (O) => {
|
|
2240
|
+
var g, C;
|
|
2241
|
+
!((g = y.current) != null && g.contains(O.target)) && !((C = j.current) != null && C.contains(O.target)) && x();
|
|
2242
|
+
}, W = (O) => {
|
|
2243
|
+
O.key === "Escape" && x();
|
|
2244
2244
|
};
|
|
2245
|
-
return document.addEventListener("mousedown", L), document.addEventListener("keydown",
|
|
2246
|
-
document.removeEventListener("mousedown", L), document.removeEventListener("keydown",
|
|
2245
|
+
return document.addEventListener("mousedown", L), document.addEventListener("keydown", W), () => {
|
|
2246
|
+
document.removeEventListener("mousedown", L), document.removeEventListener("keydown", W);
|
|
2247
2247
|
};
|
|
2248
|
-
}, [h,
|
|
2248
|
+
}, [h, x]);
|
|
2249
2249
|
const I = h && /* @__PURE__ */ e.jsxs(
|
|
2250
2250
|
"div",
|
|
2251
2251
|
{
|
|
2252
|
-
ref:
|
|
2252
|
+
ref: y,
|
|
2253
2253
|
className: [
|
|
2254
2254
|
"ds-nav-rail-flyout",
|
|
2255
2255
|
`ds-nav-rail-flyout--${c}`,
|
|
2256
2256
|
f && "ds-nav-rail-flyout--visible"
|
|
2257
2257
|
].filter(Boolean).join(" "),
|
|
2258
|
-
style:
|
|
2258
|
+
style: N,
|
|
2259
2259
|
"data-ds-portal": "",
|
|
2260
2260
|
role: "dialog",
|
|
2261
2261
|
"aria-modal": "false",
|
|
@@ -2267,9 +2267,9 @@ function gn({
|
|
|
2267
2267
|
{
|
|
2268
2268
|
type: "button",
|
|
2269
2269
|
className: "ds-nav-rail-flyout__close",
|
|
2270
|
-
onClick:
|
|
2270
|
+
onClick: x,
|
|
2271
2271
|
"aria-label": i ?? l.close,
|
|
2272
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2272
|
+
children: /* @__PURE__ */ e.jsx(te, { size: 16, strokeWidth: 2 })
|
|
2273
2273
|
}
|
|
2274
2274
|
)
|
|
2275
2275
|
] }),
|
|
@@ -2278,17 +2278,17 @@ function gn({
|
|
|
2278
2278
|
}
|
|
2279
2279
|
);
|
|
2280
2280
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2281
|
-
/* @__PURE__ */ e.jsx(Re.Provider, { value: h, children: /* @__PURE__ */ e.jsx("div", { ref:
|
|
2281
|
+
/* @__PURE__ */ e.jsx(Re.Provider, { value: h, children: /* @__PURE__ */ e.jsx("div", { ref: j, onClick: k, style: { display: "flex", flexDirection: "column", width: "100%" }, children: t }) }),
|
|
2282
2282
|
typeof document < "u" && re.createPortal(I, document.body)
|
|
2283
2283
|
] });
|
|
2284
2284
|
}
|
|
2285
|
-
const
|
|
2285
|
+
const es = {
|
|
2286
2286
|
info: We,
|
|
2287
2287
|
success: Fe,
|
|
2288
2288
|
warning: ze,
|
|
2289
2289
|
error: Me
|
|
2290
2290
|
};
|
|
2291
|
-
function
|
|
2291
|
+
function kn({
|
|
2292
2292
|
children: t,
|
|
2293
2293
|
variant: s = "info",
|
|
2294
2294
|
action: n,
|
|
@@ -2298,7 +2298,7 @@ function yn({
|
|
|
2298
2298
|
dismissLabel: i,
|
|
2299
2299
|
...l
|
|
2300
2300
|
}) {
|
|
2301
|
-
const c = K(), u =
|
|
2301
|
+
const c = K(), u = es[s], d = o || (s === "error" ? "alert" : "status");
|
|
2302
2302
|
return /* @__PURE__ */ e.jsxs(
|
|
2303
2303
|
"div",
|
|
2304
2304
|
{
|
|
@@ -2324,14 +2324,14 @@ function yn({
|
|
|
2324
2324
|
className: "ds-banner-dismiss",
|
|
2325
2325
|
onClick: a,
|
|
2326
2326
|
"aria-label": i ?? c.dismiss,
|
|
2327
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2327
|
+
children: /* @__PURE__ */ e.jsx(te, { size: q[2], strokeWidth: 1.5 })
|
|
2328
2328
|
}
|
|
2329
2329
|
)
|
|
2330
2330
|
]
|
|
2331
2331
|
}
|
|
2332
2332
|
);
|
|
2333
2333
|
}
|
|
2334
|
-
function
|
|
2334
|
+
function En({
|
|
2335
2335
|
trigger: t,
|
|
2336
2336
|
items: s = [],
|
|
2337
2337
|
open: n,
|
|
@@ -2342,87 +2342,87 @@ function kn({
|
|
|
2342
2342
|
style: l,
|
|
2343
2343
|
...c
|
|
2344
2344
|
}) {
|
|
2345
|
-
const [u, d] = D(!1), [p, h] = D(!1), f = n !== void 0, _ = f ? n : u,
|
|
2345
|
+
const [u, d] = D(!1), [p, h] = D(!1), f = n !== void 0, _ = f ? n : u, j = R(null), y = R(null), N = R(null), T = R(null), [A, x] = D({}), k = R(null), w = 150, I = () => {
|
|
2346
2346
|
if (f)
|
|
2347
2347
|
r == null || r(!1);
|
|
2348
2348
|
else {
|
|
2349
2349
|
if (p) return;
|
|
2350
|
-
h(!0),
|
|
2350
|
+
h(!0), k.current = setTimeout(() => {
|
|
2351
2351
|
d(!1), h(!1);
|
|
2352
|
-
},
|
|
2352
|
+
}, w);
|
|
2353
2353
|
}
|
|
2354
2354
|
}, L = () => {
|
|
2355
|
-
const
|
|
2356
|
-
f ? r == null || r(
|
|
2357
|
-
},
|
|
2358
|
-
_ || (f ? r == null || r(!0) : (clearTimeout(
|
|
2355
|
+
const v = !_;
|
|
2356
|
+
f ? r == null || r(v) : v ? (clearTimeout(k.current), h(!1), d(!0)) : I();
|
|
2357
|
+
}, W = () => {
|
|
2358
|
+
_ || (f ? r == null || r(!0) : (clearTimeout(k.current), h(!1), d(!0)));
|
|
2359
2359
|
};
|
|
2360
|
-
|
|
2360
|
+
P(() => () => clearTimeout(k.current), []), P(() => {
|
|
2361
2361
|
if (!_) return;
|
|
2362
|
-
const
|
|
2362
|
+
const v = 300, $ = () => {
|
|
2363
2363
|
var Y;
|
|
2364
|
-
const
|
|
2365
|
-
if (!
|
|
2366
|
-
const
|
|
2367
|
-
|
|
2368
|
-
a === "right" ? H ? { bottom: window.innerHeight -
|
|
2364
|
+
const S = (Y = j.current) == null ? void 0 : Y.getBoundingClientRect();
|
|
2365
|
+
if (!S) return;
|
|
2366
|
+
const z = window.innerHeight - S.bottom, H = z < v + 8 && S.top > z;
|
|
2367
|
+
x(
|
|
2368
|
+
a === "right" ? H ? { bottom: window.innerHeight - S.top + 4, top: "auto", right: window.innerWidth - S.right } : { top: S.bottom + 4, bottom: "auto", right: window.innerWidth - S.right } : H ? { bottom: window.innerHeight - S.top + 4, top: "auto", left: S.left } : { top: S.bottom + 4, bottom: "auto", left: S.left }
|
|
2369
2369
|
);
|
|
2370
2370
|
};
|
|
2371
2371
|
return $(), window.addEventListener("scroll", $, !0), window.addEventListener("resize", $), () => {
|
|
2372
2372
|
window.removeEventListener("scroll", $, !0), window.removeEventListener("resize", $);
|
|
2373
2373
|
};
|
|
2374
2374
|
}, [_, a]);
|
|
2375
|
-
const
|
|
2375
|
+
const O = () => {
|
|
2376
2376
|
var $;
|
|
2377
|
-
const
|
|
2377
|
+
const v = ($ = N.current) == null ? void 0 : $.querySelector(
|
|
2378
2378
|
'button:not([disabled]), [href], [tabindex]:not([tabindex="-1"]), input, select, textarea'
|
|
2379
2379
|
);
|
|
2380
|
-
|
|
2380
|
+
v == null || v.focus();
|
|
2381
2381
|
};
|
|
2382
|
-
|
|
2382
|
+
P(() => {
|
|
2383
2383
|
if (!_) return;
|
|
2384
|
-
const
|
|
2385
|
-
var
|
|
2386
|
-
!((
|
|
2387
|
-
}, $ = (
|
|
2388
|
-
|
|
2384
|
+
const v = (S) => {
|
|
2385
|
+
var z, H;
|
|
2386
|
+
!((z = j.current) != null && z.contains(S.target)) && !((H = y.current) != null && H.contains(S.target)) && I();
|
|
2387
|
+
}, $ = (S) => {
|
|
2388
|
+
S.key === "Escape" && (I(), O());
|
|
2389
2389
|
};
|
|
2390
|
-
return document.addEventListener("mousedown",
|
|
2391
|
-
document.removeEventListener("mousedown",
|
|
2390
|
+
return document.addEventListener("mousedown", v), document.addEventListener("keydown", $), () => {
|
|
2391
|
+
document.removeEventListener("mousedown", v), document.removeEventListener("keydown", $);
|
|
2392
2392
|
};
|
|
2393
|
-
}, [_]),
|
|
2394
|
-
if (!_ || !
|
|
2395
|
-
const
|
|
2396
|
-
$ == null || $.focus(),
|
|
2393
|
+
}, [_]), P(() => {
|
|
2394
|
+
if (!_ || !T.current || !y.current) return;
|
|
2395
|
+
const v = g(), $ = T.current === "last" ? v[v.length - 1] : v[0];
|
|
2396
|
+
$ == null || $.focus(), T.current = null;
|
|
2397
2397
|
}, [_]);
|
|
2398
|
-
const
|
|
2398
|
+
const g = () => y.current ? [...y.current.querySelectorAll(
|
|
2399
2399
|
'button:not([disabled]), a[href]:not([aria-disabled="true"]), [tabindex]:not([tabindex="-1"])'
|
|
2400
|
-
)] : [],
|
|
2401
|
-
var $,
|
|
2402
|
-
if (
|
|
2403
|
-
|
|
2404
|
-
else if (
|
|
2405
|
-
if (
|
|
2406
|
-
|
|
2400
|
+
)] : [], C = (v) => {
|
|
2401
|
+
var $, S;
|
|
2402
|
+
if (v.key === "ArrowDown")
|
|
2403
|
+
v.preventDefault(), _ ? ($ = g()[0]) == null || $.focus() : (T.current = "first", W());
|
|
2404
|
+
else if (v.key === "ArrowUp")
|
|
2405
|
+
if (v.preventDefault(), !_)
|
|
2406
|
+
T.current = "last", W();
|
|
2407
2407
|
else {
|
|
2408
|
-
const
|
|
2409
|
-
(
|
|
2408
|
+
const z = g();
|
|
2409
|
+
(S = z[z.length - 1]) == null || S.focus();
|
|
2410
2410
|
}
|
|
2411
|
-
},
|
|
2412
|
-
var
|
|
2413
|
-
const $ =
|
|
2414
|
-
switch (
|
|
2411
|
+
}, M = (v) => {
|
|
2412
|
+
var z, H, Y, m;
|
|
2413
|
+
const $ = g(), S = $.findIndex((b) => b === document.activeElement);
|
|
2414
|
+
switch (v.key) {
|
|
2415
2415
|
case "ArrowDown":
|
|
2416
|
-
|
|
2416
|
+
v.preventDefault(), (z = $[Math.min(S + 1, $.length - 1)]) == null || z.focus();
|
|
2417
2417
|
break;
|
|
2418
2418
|
case "ArrowUp":
|
|
2419
|
-
|
|
2419
|
+
v.preventDefault(), S <= 0 ? O() : (H = $[S - 1]) == null || H.focus();
|
|
2420
2420
|
break;
|
|
2421
2421
|
case "Home":
|
|
2422
|
-
|
|
2422
|
+
v.preventDefault(), (Y = $[0]) == null || Y.focus();
|
|
2423
2423
|
break;
|
|
2424
2424
|
case "End":
|
|
2425
|
-
|
|
2425
|
+
v.preventDefault(), (m = $[$.length - 1]) == null || m.focus();
|
|
2426
2426
|
break;
|
|
2427
2427
|
case "Tab":
|
|
2428
2428
|
I();
|
|
@@ -2431,7 +2431,7 @@ function kn({
|
|
|
2431
2431
|
}, V = _ && /* @__PURE__ */ e.jsx(
|
|
2432
2432
|
"div",
|
|
2433
2433
|
{
|
|
2434
|
-
ref:
|
|
2434
|
+
ref: y,
|
|
2435
2435
|
role: "menu",
|
|
2436
2436
|
"data-ds-portal": "",
|
|
2437
2437
|
className: [
|
|
@@ -2439,34 +2439,34 @@ function kn({
|
|
|
2439
2439
|
`ds-dropdown__menu--${a}`,
|
|
2440
2440
|
p && "ds-dropdown__menu--closing"
|
|
2441
2441
|
].filter(Boolean).join(" "),
|
|
2442
|
-
style:
|
|
2443
|
-
onKeyDown:
|
|
2444
|
-
children: s.map((
|
|
2445
|
-
if (
|
|
2442
|
+
style: A,
|
|
2443
|
+
onKeyDown: M,
|
|
2444
|
+
children: s.map((v, $) => {
|
|
2445
|
+
if (v.separator)
|
|
2446
2446
|
return /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__separator" }, $);
|
|
2447
|
-
if (
|
|
2447
|
+
if (v.type === "section")
|
|
2448
2448
|
return /* @__PURE__ */ e.jsxs("div", { className: "ds-dropdown__section", children: [
|
|
2449
|
-
|
|
2450
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children:
|
|
2449
|
+
v.label && /* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-label", children: v.label }),
|
|
2450
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-dropdown__section-content", children: v.content })
|
|
2451
2451
|
] }, $);
|
|
2452
|
-
const
|
|
2452
|
+
const S = !!v.href, z = S ? "a" : "button", H = S ? { href: v.disabled ? void 0 : v.href, "aria-disabled": v.disabled ? "true" : void 0 } : { type: "button", disabled: v.disabled };
|
|
2453
2453
|
return /* @__PURE__ */ e.jsxs(
|
|
2454
|
-
|
|
2454
|
+
z,
|
|
2455
2455
|
{
|
|
2456
2456
|
role: "menuitem",
|
|
2457
2457
|
className: [
|
|
2458
2458
|
"ds-dropdown__item",
|
|
2459
|
-
|
|
2459
|
+
v.danger && "ds-dropdown__item--danger"
|
|
2460
2460
|
].filter(Boolean).join(" "),
|
|
2461
2461
|
...H,
|
|
2462
2462
|
onClick: () => {
|
|
2463
2463
|
var Y;
|
|
2464
|
-
(Y =
|
|
2464
|
+
(Y = v.onClick) == null || Y.call(v), I();
|
|
2465
2465
|
},
|
|
2466
2466
|
children: [
|
|
2467
|
-
|
|
2468
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children:
|
|
2469
|
-
|
|
2467
|
+
v.icon && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-icon", children: v.icon }),
|
|
2468
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-label", children: v.label }),
|
|
2469
|
+
v.shortcut && /* @__PURE__ */ e.jsx("span", { className: "ds-dropdown__item-shortcut", children: v.shortcut })
|
|
2470
2470
|
]
|
|
2471
2471
|
},
|
|
2472
2472
|
$
|
|
@@ -2477,7 +2477,7 @@ function kn({
|
|
|
2477
2477
|
return /* @__PURE__ */ e.jsxs(
|
|
2478
2478
|
"div",
|
|
2479
2479
|
{
|
|
2480
|
-
ref:
|
|
2480
|
+
ref: j,
|
|
2481
2481
|
className: ["ds-dropdown", o && "ds-dropdown--full-width", i].filter(Boolean).join(" "),
|
|
2482
2482
|
style: l,
|
|
2483
2483
|
...c,
|
|
@@ -2485,10 +2485,10 @@ function kn({
|
|
|
2485
2485
|
/* @__PURE__ */ e.jsx(
|
|
2486
2486
|
"div",
|
|
2487
2487
|
{
|
|
2488
|
-
ref:
|
|
2488
|
+
ref: N,
|
|
2489
2489
|
className: "ds-dropdown__trigger",
|
|
2490
2490
|
onClick: L,
|
|
2491
|
-
onKeyDown:
|
|
2491
|
+
onKeyDown: C,
|
|
2492
2492
|
children: t
|
|
2493
2493
|
}
|
|
2494
2494
|
),
|
|
@@ -2497,7 +2497,7 @@ function kn({
|
|
|
2497
2497
|
}
|
|
2498
2498
|
);
|
|
2499
2499
|
}
|
|
2500
|
-
function
|
|
2500
|
+
function Tn({
|
|
2501
2501
|
value: t = 0,
|
|
2502
2502
|
size: s = "m",
|
|
2503
2503
|
variant: n = "default",
|
|
@@ -2534,11 +2534,11 @@ function En({
|
|
|
2534
2534
|
}
|
|
2535
2535
|
);
|
|
2536
2536
|
}
|
|
2537
|
-
const
|
|
2538
|
-
function
|
|
2539
|
-
const [n, r] = D(t), a =
|
|
2540
|
-
return
|
|
2541
|
-
if (
|
|
2537
|
+
const ts = (t) => 1 - Math.pow(1 - t, 3), ss = () => typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2538
|
+
function ns(t, { duration: s = 600 } = {}) {
|
|
2539
|
+
const [n, r] = D(t), a = R(t), o = R(null);
|
|
2540
|
+
return P(() => {
|
|
2541
|
+
if (ss()) {
|
|
2542
2542
|
r(t), a.current = t;
|
|
2543
2543
|
return;
|
|
2544
2544
|
}
|
|
@@ -2548,24 +2548,24 @@ function ss(t, { duration: s = 600 } = {}) {
|
|
|
2548
2548
|
const u = (d) => {
|
|
2549
2549
|
c || (c = d);
|
|
2550
2550
|
const p = Math.min((d - c) / s, 1);
|
|
2551
|
-
r(i + l *
|
|
2551
|
+
r(i + l * ts(p)), p < 1 ? o.current = requestAnimationFrame(u) : a.current = t;
|
|
2552
2552
|
};
|
|
2553
2553
|
return o.current = requestAnimationFrame(u), () => cancelAnimationFrame(o.current);
|
|
2554
2554
|
}, [t, s]), n;
|
|
2555
2555
|
}
|
|
2556
|
-
function
|
|
2556
|
+
function $n({
|
|
2557
2557
|
value: t,
|
|
2558
2558
|
duration: s = 600,
|
|
2559
2559
|
decimals: n = 0,
|
|
2560
2560
|
prefix: r = "",
|
|
2561
2561
|
suffix: a = ""
|
|
2562
2562
|
}) {
|
|
2563
|
-
const i =
|
|
2563
|
+
const i = ns(t, { duration: s }).toFixed(n);
|
|
2564
2564
|
return `${r}${i}${a}`;
|
|
2565
2565
|
}
|
|
2566
|
-
function
|
|
2567
|
-
const r =
|
|
2568
|
-
return
|
|
2566
|
+
function rs({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
|
|
2567
|
+
const r = R(null), [a, o] = D(!1);
|
|
2568
|
+
return P(() => {
|
|
2569
2569
|
const i = r.current;
|
|
2570
2570
|
if (!i) return;
|
|
2571
2571
|
const l = new IntersectionObserver(
|
|
@@ -2577,7 +2577,7 @@ function ns({ threshold: t = 0.1, rootMargin: s = "0px", once: n = !1 } = {}) {
|
|
|
2577
2577
|
return l.observe(i), () => l.disconnect();
|
|
2578
2578
|
}, [t, s, n]), { ref: r, inView: a };
|
|
2579
2579
|
}
|
|
2580
|
-
function
|
|
2580
|
+
function Rn({
|
|
2581
2581
|
children: t,
|
|
2582
2582
|
as: s = "div",
|
|
2583
2583
|
once: n = !1,
|
|
@@ -2587,8 +2587,8 @@ function $n({
|
|
|
2587
2587
|
onLeave: i,
|
|
2588
2588
|
...l
|
|
2589
2589
|
}) {
|
|
2590
|
-
const { ref: c, inView: u } =
|
|
2591
|
-
return
|
|
2590
|
+
const { ref: c, inView: u } = rs({ threshold: r, rootMargin: a, once: n }), d = R(!1);
|
|
2591
|
+
return P(() => {
|
|
2592
2592
|
u && !d.current && (o == null || o()), !u && d.current && (i == null || i()), d.current = u;
|
|
2593
2593
|
}, [u]), /* @__PURE__ */ e.jsx(s, { ref: c, ...l, children: typeof t == "function" ? t(u) : t });
|
|
2594
2594
|
}
|
|
@@ -2603,15 +2603,15 @@ const Le = /* @__PURE__ */ new Set();
|
|
|
2603
2603
|
function mt() {
|
|
2604
2604
|
Le.forEach((t) => t([...ve]));
|
|
2605
2605
|
}
|
|
2606
|
-
function
|
|
2606
|
+
function as(t) {
|
|
2607
2607
|
ve = [...ve, t], mt();
|
|
2608
2608
|
}
|
|
2609
|
-
function
|
|
2609
|
+
function os(t) {
|
|
2610
2610
|
ve = ve.filter((s) => s.id !== t), mt();
|
|
2611
2611
|
}
|
|
2612
|
-
function
|
|
2612
|
+
function Sn() {
|
|
2613
2613
|
const t = (s, n = {}) => {
|
|
2614
|
-
|
|
2614
|
+
as({
|
|
2615
2615
|
id: `${Date.now()}-${Math.random()}`,
|
|
2616
2616
|
message: s,
|
|
2617
2617
|
type: "default",
|
|
@@ -2621,13 +2621,15 @@ function Rn() {
|
|
|
2621
2621
|
};
|
|
2622
2622
|
return t.success = (s, n) => t(s, { ...n, type: "success" }), t.error = (s, n) => t(s, { ...n, type: "error" }), t.warning = (s, n) => t(s, { ...n, type: "warning" }), { toast: t };
|
|
2623
2623
|
}
|
|
2624
|
-
function
|
|
2625
|
-
const n = K(), [r, a] = D(!1), o =
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2624
|
+
function is({ data: t, onDismiss: s }) {
|
|
2625
|
+
const n = K(), [r, a] = D(!1), o = R(null), i = R(null);
|
|
2626
|
+
P(() => (requestAnimationFrame(() => a(!0)), t.duration > 0 && (o.current = setTimeout(() => l(), t.duration)), () => {
|
|
2627
|
+
clearTimeout(o.current), clearTimeout(i.current);
|
|
2628
|
+
}), []);
|
|
2629
|
+
function l() {
|
|
2630
|
+
a(!1), i.current = setTimeout(() => s(t.id), 250);
|
|
2629
2631
|
}
|
|
2630
|
-
const
|
|
2632
|
+
const c = rt[t.type] ?? rt.default;
|
|
2631
2633
|
return /* @__PURE__ */ e.jsxs(
|
|
2632
2634
|
"div",
|
|
2633
2635
|
{
|
|
@@ -2639,34 +2641,34 @@ function os({ data: t, onDismiss: s }) {
|
|
|
2639
2641
|
role: t.type === "error" ? "alert" : "status",
|
|
2640
2642
|
"aria-live": "polite",
|
|
2641
2643
|
children: [
|
|
2642
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(
|
|
2644
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-toast__icon", children: /* @__PURE__ */ e.jsx(c, { size: q[3], strokeWidth: 1.5 }) }),
|
|
2643
2645
|
/* @__PURE__ */ e.jsx("span", { className: "ds-toast__message", children: t.message }),
|
|
2644
2646
|
/* @__PURE__ */ e.jsx(
|
|
2645
2647
|
"button",
|
|
2646
2648
|
{
|
|
2647
2649
|
className: "ds-toast__close",
|
|
2648
|
-
onClick:
|
|
2650
|
+
onClick: l,
|
|
2649
2651
|
"aria-label": n.close,
|
|
2650
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2652
|
+
children: /* @__PURE__ */ e.jsx(te, { size: q[3], strokeWidth: 1.5 })
|
|
2651
2653
|
}
|
|
2652
2654
|
)
|
|
2653
2655
|
]
|
|
2654
2656
|
}
|
|
2655
2657
|
);
|
|
2656
2658
|
}
|
|
2657
|
-
function
|
|
2659
|
+
function An({ position: t = "bottom-right" }) {
|
|
2658
2660
|
const [s, n] = D(() => [...ve]);
|
|
2659
|
-
return
|
|
2660
|
-
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(
|
|
2661
|
+
return P(() => (Le.add(n), () => Le.delete(n)), []), !s.length || typeof document > "u" ? null : re.createPortal(
|
|
2662
|
+
/* @__PURE__ */ e.jsx("div", { "data-ds-portal": "", className: ["ds-toast-container", `ds-toast-container--${t}`].join(" "), children: s.map((r) => /* @__PURE__ */ e.jsx(is, { data: r, onDismiss: os }, r.id)) }),
|
|
2661
2663
|
document.body
|
|
2662
2664
|
);
|
|
2663
2665
|
}
|
|
2664
|
-
const
|
|
2666
|
+
const ls = {
|
|
2665
2667
|
running: /* @__PURE__ */ e.jsx(he, { size: "xs", variant: "info", children: "Running..." }),
|
|
2666
2668
|
success: /* @__PURE__ */ e.jsx(he, { size: "xs", variant: "success", children: "Done" }),
|
|
2667
2669
|
error: /* @__PURE__ */ e.jsx(he, { size: "xs", variant: "error", children: "Error" })
|
|
2668
2670
|
};
|
|
2669
|
-
function
|
|
2671
|
+
function Bn({
|
|
2670
2672
|
label: t,
|
|
2671
2673
|
status: s = "idle",
|
|
2672
2674
|
icon: n,
|
|
@@ -2681,7 +2683,7 @@ function An({
|
|
|
2681
2683
|
const d = s === "running", p = /* @__PURE__ */ e.jsxs("span", { className: "ds-tool-card__title-row", children: [
|
|
2682
2684
|
n && /* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__icon", children: n }),
|
|
2683
2685
|
/* @__PURE__ */ e.jsx("span", { className: "ds-tool-card__label", children: t }),
|
|
2684
|
-
|
|
2686
|
+
ls[s],
|
|
2685
2687
|
r
|
|
2686
2688
|
] });
|
|
2687
2689
|
return l ? /* @__PURE__ */ e.jsx(
|
|
@@ -2710,34 +2712,34 @@ function An({
|
|
|
2710
2712
|
}
|
|
2711
2713
|
);
|
|
2712
2714
|
}
|
|
2713
|
-
function
|
|
2715
|
+
function cs({
|
|
2714
2716
|
text: t,
|
|
2715
2717
|
size: s = "xs",
|
|
2716
2718
|
timeout: n = 800,
|
|
2717
2719
|
"aria-label": r,
|
|
2718
2720
|
...a
|
|
2719
2721
|
}) {
|
|
2720
|
-
const o = K(), [i, l] = D(!1), c = (u) => {
|
|
2721
|
-
|
|
2722
|
-
l(!0), setTimeout(() => l(!1), n);
|
|
2722
|
+
const o = K(), [i, l] = D(!1), c = R(null), u = (d) => {
|
|
2723
|
+
d.currentTarget.blur(), navigator.clipboard.writeText(t).then(() => {
|
|
2724
|
+
l(!0), clearTimeout(c.current), c.current = setTimeout(() => l(!1), n);
|
|
2723
2725
|
});
|
|
2724
2726
|
};
|
|
2725
|
-
return /* @__PURE__ */ e.jsx(
|
|
2727
|
+
return P(() => () => clearTimeout(c.current), []), /* @__PURE__ */ e.jsx(
|
|
2726
2728
|
de,
|
|
2727
2729
|
{
|
|
2728
2730
|
variant: "ghost",
|
|
2729
2731
|
size: s,
|
|
2730
2732
|
state: i ? "success" : "idle",
|
|
2731
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
2733
|
+
icon: /* @__PURE__ */ e.jsx(Et, { size: q[1], strokeWidth: 1.5 }),
|
|
2732
2734
|
"aria-label": r ?? o.copyToClipboard,
|
|
2733
|
-
onClick:
|
|
2735
|
+
onClick: u,
|
|
2734
2736
|
...a
|
|
2735
2737
|
}
|
|
2736
2738
|
);
|
|
2737
2739
|
}
|
|
2738
|
-
function
|
|
2740
|
+
function In({ content: t, streaming: s = !1, ...n }) {
|
|
2739
2741
|
const [r, a] = D(s);
|
|
2740
|
-
return
|
|
2742
|
+
return P(() => {
|
|
2741
2743
|
a(!!s);
|
|
2742
2744
|
}, [s]), /* @__PURE__ */ e.jsx(
|
|
2743
2745
|
He,
|
|
@@ -2746,8 +2748,8 @@ function Bn({ content: t, streaming: s = !1, ...n }) {
|
|
|
2746
2748
|
onToggle: a,
|
|
2747
2749
|
padding: "s",
|
|
2748
2750
|
title: /* @__PURE__ */ e.jsxs("div", { className: "ds-reasoning__title", children: [
|
|
2749
|
-
/* @__PURE__ */ e.jsx(
|
|
2750
|
-
/* @__PURE__ */ e.jsx(
|
|
2751
|
+
/* @__PURE__ */ e.jsx(Tt, { size: q[1], strokeWidth: 1.5, className: "ds-reasoning__icon" }),
|
|
2752
|
+
/* @__PURE__ */ e.jsx(Ft, { secondary: !0, children: "Thinking" })
|
|
2751
2753
|
] }),
|
|
2752
2754
|
...n,
|
|
2753
2755
|
children: /* @__PURE__ */ e.jsxs(ft, { secondary: !0, style: { whiteSpace: "pre-wrap" }, children: [
|
|
@@ -2757,7 +2759,7 @@ function Bn({ content: t, streaming: s = !1, ...n }) {
|
|
|
2757
2759
|
}
|
|
2758
2760
|
);
|
|
2759
2761
|
}
|
|
2760
|
-
function
|
|
2762
|
+
function Ln({
|
|
2761
2763
|
count: t,
|
|
2762
2764
|
current: s = 0,
|
|
2763
2765
|
done: n = [],
|
|
@@ -2770,7 +2772,7 @@ function In({
|
|
|
2770
2772
|
const c = K(), { t: u } = be();
|
|
2771
2773
|
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-step-indicator", o].filter(Boolean).join(" "), ...l, children: [
|
|
2772
2774
|
/* @__PURE__ */ e.jsx("div", { className: "ds-step-indicator__dots", role: "tablist", "aria-label": i ?? c.steps, children: Array.from({ length: t }, (d, p) => {
|
|
2773
|
-
const h = p === s, f = n.includes(p) && !h, _ = r && (p <= s || n.includes(p)),
|
|
2775
|
+
const h = p === s, f = n.includes(p) && !h, _ = r && (p <= s || n.includes(p)), j = [
|
|
2774
2776
|
"ds-step-indicator__dot",
|
|
2775
2777
|
h && "ds-step-indicator__dot--active",
|
|
2776
2778
|
f && "ds-step-indicator__dot--done"
|
|
@@ -2779,7 +2781,7 @@ function In({
|
|
|
2779
2781
|
"button",
|
|
2780
2782
|
{
|
|
2781
2783
|
type: "button",
|
|
2782
|
-
className:
|
|
2784
|
+
className: j,
|
|
2783
2785
|
role: "tab",
|
|
2784
2786
|
"aria-selected": h,
|
|
2785
2787
|
"aria-label": u("stepN", { n: p + 1 }),
|
|
@@ -2797,7 +2799,7 @@ function In({
|
|
|
2797
2799
|
] })
|
|
2798
2800
|
] });
|
|
2799
2801
|
}
|
|
2800
|
-
function
|
|
2802
|
+
function Dn({
|
|
2801
2803
|
content: t,
|
|
2802
2804
|
isStreaming: s = !1,
|
|
2803
2805
|
cursor: n = "line",
|
|
@@ -2805,15 +2807,15 @@ function Ln({
|
|
|
2805
2807
|
className: a = "",
|
|
2806
2808
|
...o
|
|
2807
2809
|
}) {
|
|
2808
|
-
const i =
|
|
2809
|
-
return
|
|
2810
|
+
const i = R(t);
|
|
2811
|
+
return P(() => {
|
|
2810
2812
|
t !== i.current && (r == null || r(t), i.current = t);
|
|
2811
2813
|
}, [t, r]), /* @__PURE__ */ e.jsxs("span", { className: ["ds-streaming-text", a].filter(Boolean).join(" "), ...o, children: [
|
|
2812
2814
|
t,
|
|
2813
2815
|
s && n !== "none" && /* @__PURE__ */ e.jsx("span", { className: `ds-cursor ds-cursor--${n}`, "aria-hidden": "true" })
|
|
2814
2816
|
] });
|
|
2815
2817
|
}
|
|
2816
|
-
function
|
|
2818
|
+
function Pn({
|
|
2817
2819
|
role: t = "assistant",
|
|
2818
2820
|
header: s,
|
|
2819
2821
|
footer: n,
|
|
@@ -2840,9 +2842,9 @@ function Dn({
|
|
|
2840
2842
|
n && /* @__PURE__ */ e.jsx("div", { className: "ds-chat-message__footer", children: n })
|
|
2841
2843
|
] });
|
|
2842
2844
|
}
|
|
2843
|
-
function
|
|
2844
|
-
const r =
|
|
2845
|
-
|
|
2845
|
+
function Mn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
2846
|
+
const r = R(!1), a = R(0);
|
|
2847
|
+
P(() => {
|
|
2846
2848
|
const o = s == null ? void 0 : s.current;
|
|
2847
2849
|
if (!o) return;
|
|
2848
2850
|
const i = () => {
|
|
@@ -2850,12 +2852,12 @@ function Pn(t, { containerRef: s, smartPause: n = !0 } = {}) {
|
|
|
2850
2852
|
!l && o.scrollTop < a.current && (r.current = !0), l && (r.current = !1), a.current = o.scrollTop;
|
|
2851
2853
|
};
|
|
2852
2854
|
return o.addEventListener("scroll", i, { passive: !0 }), () => o.removeEventListener("scroll", i);
|
|
2853
|
-
}, [s]),
|
|
2855
|
+
}, [s]), P(() => {
|
|
2854
2856
|
const o = s == null ? void 0 : s.current;
|
|
2855
2857
|
o && (n && r.current || (o.scrollTop = o.scrollHeight));
|
|
2856
2858
|
}, t);
|
|
2857
2859
|
}
|
|
2858
|
-
function
|
|
2860
|
+
function ds({
|
|
2859
2861
|
prompts: t,
|
|
2860
2862
|
enabled: s,
|
|
2861
2863
|
typingSpeed: n = 38,
|
|
@@ -2864,36 +2866,36 @@ function cs({
|
|
|
2864
2866
|
betweenTime: o = 380,
|
|
2865
2867
|
manualPauseMs: i = 5e3
|
|
2866
2868
|
}) {
|
|
2867
|
-
const [l, c] = D(0), [u, d] = D(""), p =
|
|
2868
|
-
|
|
2869
|
+
const [l, c] = D(0), [u, d] = D(""), p = R("typing"), h = R(0), f = R(0), _ = R(null), j = R(0);
|
|
2870
|
+
P(() => {
|
|
2869
2871
|
f.current = l;
|
|
2870
|
-
}, [l]),
|
|
2872
|
+
}, [l]), P(() => {
|
|
2871
2873
|
if (_.current && (clearTimeout(_.current), _.current = null), !s || t.length === 0) {
|
|
2872
2874
|
d(""), h.current = 0, p.current = "typing";
|
|
2873
2875
|
return;
|
|
2874
2876
|
}
|
|
2875
|
-
const
|
|
2876
|
-
const
|
|
2877
|
-
if (
|
|
2878
|
-
_.current = setTimeout(
|
|
2877
|
+
const x = () => {
|
|
2878
|
+
const k = Date.now();
|
|
2879
|
+
if (j.current > k) {
|
|
2880
|
+
_.current = setTimeout(x, j.current - k);
|
|
2879
2881
|
return;
|
|
2880
2882
|
}
|
|
2881
|
-
const
|
|
2882
|
-
p.current === "typing" ? (h.current += 1, d(
|
|
2883
|
+
const w = t[f.current % t.length] ?? "";
|
|
2884
|
+
p.current === "typing" ? (h.current += 1, d(w.slice(0, h.current)), h.current >= w.length ? (p.current = "holding", _.current = setTimeout(x, a)) : _.current = setTimeout(x, n + Math.random() * 28)) : p.current === "holding" ? (p.current = "erasing", _.current = setTimeout(x, r)) : (h.current = Math.max(0, h.current - 1), d(w.slice(0, h.current)), h.current <= 0 ? (p.current = "typing", f.current = (f.current + 1) % t.length, c(f.current), _.current = setTimeout(x, o)) : _.current = setTimeout(x, r));
|
|
2883
2885
|
};
|
|
2884
|
-
return _.current = setTimeout(
|
|
2886
|
+
return _.current = setTimeout(x, 260), () => {
|
|
2885
2887
|
_.current && clearTimeout(_.current);
|
|
2886
2888
|
};
|
|
2887
2889
|
}, [s, t, n, r, a, o]);
|
|
2888
|
-
const
|
|
2890
|
+
const y = (x) => {
|
|
2889
2891
|
if (t.length === 0) return;
|
|
2890
|
-
const
|
|
2891
|
-
f.current =
|
|
2892
|
-
},
|
|
2893
|
-
return { displayed: u, currentPrompt:
|
|
2892
|
+
const k = (x % t.length + t.length) % t.length, w = t[k];
|
|
2893
|
+
f.current = k, h.current = w.length, p.current = "holding", j.current = Date.now() + i, c(k), d(w);
|
|
2894
|
+
}, N = () => y(f.current + 1), T = () => y(f.current - 1), A = t[l % t.length] ?? "";
|
|
2895
|
+
return { displayed: u, currentPrompt: A, index: l, next: N, prev: T };
|
|
2894
2896
|
}
|
|
2895
|
-
let
|
|
2896
|
-
function
|
|
2897
|
+
let us = 0;
|
|
2898
|
+
function zn({
|
|
2897
2899
|
value: t = "",
|
|
2898
2900
|
onChange: s,
|
|
2899
2901
|
onSubmit: n,
|
|
@@ -2909,73 +2911,82 @@ function Mn({
|
|
|
2909
2911
|
onAttachImages: h,
|
|
2910
2912
|
onRemoveAttachment: f,
|
|
2911
2913
|
onRemoveImage: _,
|
|
2912
|
-
acceptImage:
|
|
2913
|
-
acceptFile:
|
|
2914
|
-
maxImages:
|
|
2915
|
-
maxImageSize:
|
|
2916
|
-
leftSlot:
|
|
2917
|
-
rightSlot:
|
|
2918
|
-
className:
|
|
2919
|
-
...
|
|
2914
|
+
acceptImage: j,
|
|
2915
|
+
acceptFile: y,
|
|
2916
|
+
maxImages: N,
|
|
2917
|
+
maxImageSize: T,
|
|
2918
|
+
leftSlot: A,
|
|
2919
|
+
rightSlot: x,
|
|
2920
|
+
className: k = "",
|
|
2921
|
+
...w
|
|
2920
2922
|
}) {
|
|
2921
|
-
const I = K(), { t: L } = be(),
|
|
2922
|
-
const
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
const
|
|
2935
|
-
|
|
2936
|
-
|
|
2923
|
+
const I = K(), { t: L } = be(), W = R(null), O = R(null), g = R(0), [C, M] = D(!1), [V, v] = D([]), $ = R(/* @__PURE__ */ new Set()), S = l ?? I.promptPlaceholder, z = (E) => {
|
|
2924
|
+
const F = ++us;
|
|
2925
|
+
v((Z) => [...Z, { id: F, msg: E }]);
|
|
2926
|
+
const J = setTimeout(() => {
|
|
2927
|
+
$.current.delete(J), v((Z) => Z.filter((ee) => ee.id !== F));
|
|
2928
|
+
}, 6e3);
|
|
2929
|
+
$.current.add(J);
|
|
2930
|
+
};
|
|
2931
|
+
P(() => {
|
|
2932
|
+
const E = $.current;
|
|
2933
|
+
return () => E.forEach(clearTimeout);
|
|
2934
|
+
}, []);
|
|
2935
|
+
const H = (E) => v((F) => F.filter((J) => J.id !== E)), Y = (E) => E.type.startsWith("image/"), m = () => !0, b = j ?? Y, B = y ?? m, U = (E) => {
|
|
2936
|
+
const F = [], J = [], Z = [], ee = [];
|
|
2937
|
+
let oe = 0, me = N != null ? N - ((d == null ? void 0 : d.length) ?? 0) : 1 / 0;
|
|
2938
|
+
for (const ie of E)
|
|
2939
|
+
b(ie) ? T && ie.size > T ? Z.push(ie.name) : me > 0 ? (F.push(ie), me--) : oe++ : B(ie) ? J.push(ie) : ee.push(ie.name);
|
|
2940
|
+
return { imageFiles: F, docFiles: J, tooLarge: Z, skipped: ee, limitExceeded: oe };
|
|
2941
|
+
}, se = (E) => {
|
|
2942
|
+
const F = T ? L("fileTooLargeMaxHint", { maxMb: T / 1024 / 1024 }) : "";
|
|
2943
|
+
z(L("fileTooLarge", { maxHint: F, names: E.join(", ") }));
|
|
2944
|
+
}, ae = (E) => {
|
|
2945
|
+
const { imageFiles: F, docFiles: J, tooLarge: Z, skipped: ee, limitExceeded: oe } = U(E);
|
|
2946
|
+
Z.length && se(Z), ee.length && z(L("filesSkipped", { names: ee.join(", ") })), oe && z(L("maxImages", { n: N })), h && F.length && h(F);
|
|
2947
|
+
const me = J.concat(h ? [] : F);
|
|
2937
2948
|
p && me.length && p(me);
|
|
2938
2949
|
};
|
|
2939
|
-
|
|
2940
|
-
const E =
|
|
2950
|
+
P(() => {
|
|
2951
|
+
const E = O.current;
|
|
2941
2952
|
E && (E.style.height = "auto", E.style.height = `${Math.min(E.scrollHeight, 200)}px`);
|
|
2942
|
-
}, [t]),
|
|
2943
|
-
const E = (
|
|
2944
|
-
var
|
|
2953
|
+
}, [t]), P(() => {
|
|
2954
|
+
const E = (F) => {
|
|
2955
|
+
var Z, ee, oe;
|
|
2945
2956
|
if (o || i) return;
|
|
2946
|
-
const J = (
|
|
2947
|
-
J === "INPUT" || J === "TEXTAREA" || J === "SELECT" || (
|
|
2957
|
+
const J = (Z = F.target) == null ? void 0 : Z.tagName;
|
|
2958
|
+
J === "INPUT" || J === "TEXTAREA" || J === "SELECT" || (ee = F.target) != null && ee.isContentEditable || F.ctrlKey || F.metaKey || F.altKey || F.key.length !== 1 && F.key !== "Backspace" && F.key !== "Delete" || (oe = O.current) == null || oe.focus();
|
|
2948
2959
|
};
|
|
2949
2960
|
return document.addEventListener("keydown", E), () => document.removeEventListener("keydown", E);
|
|
2950
2961
|
}, [o, i]);
|
|
2951
|
-
const
|
|
2952
|
-
E.preventDefault(),
|
|
2953
|
-
},
|
|
2954
|
-
E.preventDefault(),
|
|
2955
|
-
},
|
|
2956
|
-
E.preventDefault(),
|
|
2957
|
-
const
|
|
2958
|
-
|
|
2959
|
-
}, je = (E) => {
|
|
2960
|
-
const M = Array.from(E.target.files || []);
|
|
2961
|
-
F.current && (F.current.value = ""), M.length && te(M);
|
|
2962
|
+
const G = (E) => {
|
|
2963
|
+
E.preventDefault(), g.current++, E.dataTransfer.types.includes("Files") && M(!0);
|
|
2964
|
+
}, Q = (E) => {
|
|
2965
|
+
E.preventDefault(), g.current--, g.current === 0 && M(!1);
|
|
2966
|
+
}, fe = (E) => E.preventDefault(), je = (E) => {
|
|
2967
|
+
E.preventDefault(), g.current = 0, M(!1);
|
|
2968
|
+
const F = Array.from(E.dataTransfer.files);
|
|
2969
|
+
F.length && ae(F);
|
|
2962
2970
|
}, Se = (E) => {
|
|
2963
|
-
|
|
2971
|
+
const F = Array.from(E.target.files || []);
|
|
2972
|
+
W.current && (W.current.value = ""), F.length && ae(F);
|
|
2973
|
+
}, pt = (E) => {
|
|
2974
|
+
var ie;
|
|
2964
2975
|
if (!h) return;
|
|
2965
|
-
const
|
|
2966
|
-
if (!
|
|
2976
|
+
const F = (ie = E.clipboardData) == null ? void 0 : ie.items;
|
|
2977
|
+
if (!F) return;
|
|
2967
2978
|
const J = [];
|
|
2968
|
-
for (const
|
|
2969
|
-
const qe =
|
|
2979
|
+
for (const vt of F) {
|
|
2980
|
+
const qe = vt.getAsFile();
|
|
2970
2981
|
qe && J.push(qe);
|
|
2971
2982
|
}
|
|
2972
2983
|
if (J.length === 0) return;
|
|
2973
|
-
const { imageFiles:
|
|
2974
|
-
|
|
2975
|
-
}, Ne = !o && !i && !!(c != null && c.length) && t.length === 0, ke =
|
|
2984
|
+
const { imageFiles: Z, tooLarge: ee, skipped: oe, limitExceeded: me } = U(J);
|
|
2985
|
+
ee.length && se(ee), oe.length && z(L("filesSkipped", { names: oe.join(", ") })), me && z(L("maxImages", { n: N })), Z.length && (E.preventDefault(), h(Z));
|
|
2986
|
+
}, Ne = !o && !i && !!(c != null && c.length) && t.length === 0, ke = ds({
|
|
2976
2987
|
prompts: c ?? [],
|
|
2977
2988
|
enabled: Ne
|
|
2978
|
-
}),
|
|
2989
|
+
}), ht = (E) => {
|
|
2979
2990
|
if (Ne) {
|
|
2980
2991
|
if (E.key === "ArrowDown" || E.key === "ArrowRight") {
|
|
2981
2992
|
E.preventDefault(), ke.next();
|
|
@@ -2991,38 +3002,38 @@ function Mn({
|
|
|
2991
3002
|
}
|
|
2992
3003
|
}
|
|
2993
3004
|
a == null || a(E);
|
|
2994
|
-
},
|
|
2995
|
-
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input",
|
|
3005
|
+
}, xt = (t.trim() || (d == null ? void 0 : d.length) > 0 || (u == null ? void 0 : u.length) > 0) && !i, Ye = p || h;
|
|
3006
|
+
return /* @__PURE__ */ e.jsxs("div", { className: ["ds-prompt-input", k].filter(Boolean).join(" "), ...w, children: [
|
|
2996
3007
|
Ye && /* @__PURE__ */ e.jsx(
|
|
2997
3008
|
"input",
|
|
2998
3009
|
{
|
|
2999
|
-
ref:
|
|
3010
|
+
ref: W,
|
|
3000
3011
|
type: "file",
|
|
3001
3012
|
multiple: !0,
|
|
3002
3013
|
accept: "*/*",
|
|
3003
3014
|
className: "ds-prompt-input__file-input",
|
|
3004
|
-
onChange:
|
|
3015
|
+
onChange: Se
|
|
3005
3016
|
}
|
|
3006
3017
|
),
|
|
3007
3018
|
/* @__PURE__ */ e.jsxs(
|
|
3008
3019
|
"div",
|
|
3009
3020
|
{
|
|
3010
|
-
className: ["ds-prompt-input__box",
|
|
3011
|
-
onDragEnter:
|
|
3012
|
-
onDragLeave:
|
|
3013
|
-
onDragOver:
|
|
3014
|
-
onDrop:
|
|
3021
|
+
className: ["ds-prompt-input__box", C && "ds-prompt-input__box--dragging"].filter(Boolean).join(" "),
|
|
3022
|
+
onDragEnter: G,
|
|
3023
|
+
onDragLeave: Q,
|
|
3024
|
+
onDragOver: fe,
|
|
3025
|
+
onDrop: je,
|
|
3015
3026
|
children: [
|
|
3016
|
-
|
|
3027
|
+
C && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__drag-overlay", children: I.dropFilesHere }),
|
|
3017
3028
|
/* @__PURE__ */ e.jsx(
|
|
3018
3029
|
"textarea",
|
|
3019
3030
|
{
|
|
3020
|
-
ref:
|
|
3031
|
+
ref: O,
|
|
3021
3032
|
value: t,
|
|
3022
3033
|
onChange: (E) => s == null ? void 0 : s(E.target.value),
|
|
3023
|
-
onKeyDown:
|
|
3024
|
-
onPaste:
|
|
3025
|
-
placeholder: Ne ? "" :
|
|
3034
|
+
onKeyDown: ht,
|
|
3035
|
+
onPaste: pt,
|
|
3036
|
+
placeholder: Ne ? "" : S,
|
|
3026
3037
|
disabled: o || i,
|
|
3027
3038
|
rows: 1,
|
|
3028
3039
|
className: ["ds-prompt-input__textarea", Ne && "ds-prompt-input__textarea--anim"].filter(Boolean).join(" ")
|
|
@@ -3032,19 +3043,19 @@ function Mn({
|
|
|
3032
3043
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-text", children: ke.displayed }),
|
|
3033
3044
|
/* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__anim-cursor" })
|
|
3034
3045
|
] }),
|
|
3035
|
-
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: d.map((E,
|
|
3046
|
+
d && d.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__images", children: d.map((E, F) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__image-thumb", children: [
|
|
3036
3047
|
/* @__PURE__ */ e.jsx("img", { src: E.preview, alt: "" }),
|
|
3037
3048
|
/* @__PURE__ */ e.jsx(
|
|
3038
3049
|
"button",
|
|
3039
3050
|
{
|
|
3040
3051
|
className: "ds-prompt-input__image-remove",
|
|
3041
|
-
onClick: () => _ == null ? void 0 : _(
|
|
3052
|
+
onClick: () => _ == null ? void 0 : _(F),
|
|
3042
3053
|
"aria-label": I.removeImage,
|
|
3043
3054
|
type: "button",
|
|
3044
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3055
|
+
children: /* @__PURE__ */ e.jsx(te, { size: 12, strokeWidth: 2 })
|
|
3045
3056
|
}
|
|
3046
3057
|
)
|
|
3047
|
-
] },
|
|
3058
|
+
] }, F)) }),
|
|
3048
3059
|
V.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__warnings", children: V.map((E) => /* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__warning", role: "alert", children: [
|
|
3049
3060
|
/* @__PURE__ */ e.jsx("span", { children: E.msg }),
|
|
3050
3061
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3052,26 +3063,26 @@ function Mn({
|
|
|
3052
3063
|
{
|
|
3053
3064
|
type: "button",
|
|
3054
3065
|
className: "ds-prompt-input__warning-close",
|
|
3055
|
-
onClick: () =>
|
|
3066
|
+
onClick: () => H(E.id),
|
|
3056
3067
|
"aria-label": I.dismiss,
|
|
3057
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3068
|
+
children: /* @__PURE__ */ e.jsx(te, { size: q[1], strokeWidth: 1.5 })
|
|
3058
3069
|
}
|
|
3059
3070
|
)
|
|
3060
3071
|
] }, E.id)) }),
|
|
3061
|
-
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: u.map((E,
|
|
3062
|
-
E.uploading ? /* @__PURE__ */ e.jsx(
|
|
3072
|
+
u && u.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__attachments", children: u.map((E, F) => /* @__PURE__ */ e.jsx(he, { size: "xs", children: /* @__PURE__ */ e.jsxs("span", { className: "ds-prompt-input__badge-content", children: [
|
|
3073
|
+
E.uploading ? /* @__PURE__ */ e.jsx($t, { size: q[1], strokeWidth: 1.5, className: "spin" }) : /* @__PURE__ */ e.jsx(Ge, { size: q[1], strokeWidth: 1.5 }),
|
|
3063
3074
|
E.filename,
|
|
3064
3075
|
E.uploading ? /* @__PURE__ */ e.jsx("span", { className: "ds-prompt-input__uploading", children: I.uploading }) : /* @__PURE__ */ e.jsx(
|
|
3065
3076
|
"button",
|
|
3066
3077
|
{
|
|
3067
3078
|
type: "button",
|
|
3068
3079
|
className: "ds-prompt-input__remove-btn",
|
|
3069
|
-
onClick: () => f == null ? void 0 : f(
|
|
3080
|
+
onClick: () => f == null ? void 0 : f(F),
|
|
3070
3081
|
"aria-label": I.removeAttachment,
|
|
3071
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3082
|
+
children: /* @__PURE__ */ e.jsx(te, { size: q[1], strokeWidth: 1.5 })
|
|
3072
3083
|
}
|
|
3073
3084
|
)
|
|
3074
|
-
] }) },
|
|
3085
|
+
] }) }, F)) }),
|
|
3075
3086
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-prompt-input__toolbar", children: [
|
|
3076
3087
|
Ye && /* @__PURE__ */ e.jsx(
|
|
3077
3088
|
de,
|
|
@@ -3082,19 +3093,19 @@ function Mn({
|
|
|
3082
3093
|
"aria-label": I.attachFiles,
|
|
3083
3094
|
onClick: () => {
|
|
3084
3095
|
var E;
|
|
3085
|
-
return (E =
|
|
3096
|
+
return (E = W.current) == null ? void 0 : E.click();
|
|
3086
3097
|
}
|
|
3087
3098
|
}
|
|
3088
3099
|
),
|
|
3089
|
-
|
|
3090
|
-
|
|
3100
|
+
A,
|
|
3101
|
+
x,
|
|
3091
3102
|
/* @__PURE__ */ e.jsx("div", { className: "ds-prompt-input__spacer" }),
|
|
3092
3103
|
o ? /* @__PURE__ */ e.jsx(
|
|
3093
3104
|
de,
|
|
3094
3105
|
{
|
|
3095
3106
|
variant: "primary",
|
|
3096
3107
|
size: "xs",
|
|
3097
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
3108
|
+
icon: /* @__PURE__ */ e.jsx(Rt, { size: q[2], strokeWidth: 1.5 }),
|
|
3098
3109
|
onClick: r,
|
|
3099
3110
|
"aria-label": I.stop
|
|
3100
3111
|
}
|
|
@@ -3103,9 +3114,9 @@ function Mn({
|
|
|
3103
3114
|
{
|
|
3104
3115
|
variant: "primary",
|
|
3105
3116
|
size: "xs",
|
|
3106
|
-
icon: /* @__PURE__ */ e.jsx(
|
|
3117
|
+
icon: /* @__PURE__ */ e.jsx(St, { size: q[2], strokeWidth: 1.5 }),
|
|
3107
3118
|
onClick: n,
|
|
3108
|
-
disabled: !
|
|
3119
|
+
disabled: !xt,
|
|
3109
3120
|
"aria-label": I.send
|
|
3110
3121
|
}
|
|
3111
3122
|
)
|
|
@@ -3116,7 +3127,7 @@ function Mn({
|
|
|
3116
3127
|
] });
|
|
3117
3128
|
}
|
|
3118
3129
|
const at = { fast: 0, standard: 1, premium: 2 }, ot = { fast: "data-5", standard: "data-3", premium: "data-6" };
|
|
3119
|
-
function
|
|
3130
|
+
function Fn({
|
|
3120
3131
|
models: t = [],
|
|
3121
3132
|
value: s,
|
|
3122
3133
|
onChange: n,
|
|
@@ -3127,58 +3138,58 @@ function zn({
|
|
|
3127
3138
|
className: l = "",
|
|
3128
3139
|
...c
|
|
3129
3140
|
}) {
|
|
3130
|
-
const [u, d] = D(!1), p =
|
|
3131
|
-
|
|
3141
|
+
const [u, d] = D(!1), p = R(null), h = R(null), f = R(null), [_, j] = D({}), y = r === "s" ? "s" : "xs", N = t.filter((g) => !a || g.name === "auto" ? !0 : (at[g.tier] ?? 1) >= (at[a] ?? 1)), T = N.find((g) => g.name === "auto"), A = N.filter((g) => g.name !== "auto"), x = t.find((g) => g.name === s), w = new Set(A.map((g) => g.tier).filter(Boolean)).size > 1;
|
|
3142
|
+
P(() => {
|
|
3132
3143
|
if (!u) return;
|
|
3133
|
-
const
|
|
3134
|
-
var
|
|
3135
|
-
const
|
|
3136
|
-
if (!
|
|
3137
|
-
const $ = window.innerHeight -
|
|
3138
|
-
|
|
3144
|
+
const g = 320, C = () => {
|
|
3145
|
+
var z;
|
|
3146
|
+
const v = (z = h.current) == null ? void 0 : z.getBoundingClientRect();
|
|
3147
|
+
if (!v) return;
|
|
3148
|
+
const $ = window.innerHeight - v.bottom, S = $ < g + 8 && v.top > $;
|
|
3149
|
+
j({
|
|
3139
3150
|
position: "fixed",
|
|
3140
3151
|
zIndex: "var(--z-dropdown, 500)",
|
|
3141
|
-
left:
|
|
3142
|
-
...
|
|
3152
|
+
left: v.left,
|
|
3153
|
+
...S ? { bottom: window.innerHeight - v.top + 4, top: "auto" } : { top: v.bottom + 4, bottom: "auto" }
|
|
3143
3154
|
});
|
|
3144
3155
|
};
|
|
3145
|
-
|
|
3146
|
-
const
|
|
3147
|
-
var $,
|
|
3148
|
-
!(($ = p.current) != null && $.contains(
|
|
3149
|
-
}, V = (
|
|
3150
|
-
|
|
3156
|
+
C(), window.addEventListener("scroll", C, !0), window.addEventListener("resize", C);
|
|
3157
|
+
const M = (v) => {
|
|
3158
|
+
var $, S;
|
|
3159
|
+
!(($ = p.current) != null && $.contains(v.target)) && !((S = f.current) != null && S.contains(v.target)) && d(!1);
|
|
3160
|
+
}, V = (v) => {
|
|
3161
|
+
v.key === "Escape" && d(!1);
|
|
3151
3162
|
};
|
|
3152
|
-
return document.addEventListener("mousedown",
|
|
3153
|
-
window.removeEventListener("scroll",
|
|
3163
|
+
return document.addEventListener("mousedown", M), document.addEventListener("keydown", V), () => {
|
|
3164
|
+
window.removeEventListener("scroll", C, !0), window.removeEventListener("resize", C), document.removeEventListener("mousedown", M), document.removeEventListener("keydown", V);
|
|
3154
3165
|
};
|
|
3155
3166
|
}, [u]);
|
|
3156
|
-
const I = (
|
|
3157
|
-
n == null || n(
|
|
3158
|
-
}, L = (
|
|
3167
|
+
const I = (g) => {
|
|
3168
|
+
n == null || n(g), d(!1);
|
|
3169
|
+
}, L = (g) => /* @__PURE__ */ e.jsxs(
|
|
3159
3170
|
"button",
|
|
3160
3171
|
{
|
|
3161
3172
|
type: "button",
|
|
3162
3173
|
className: [
|
|
3163
3174
|
"ds-model-picker__item",
|
|
3164
|
-
|
|
3175
|
+
g.name === s && "ds-model-picker__item--active"
|
|
3165
3176
|
].filter(Boolean).join(" "),
|
|
3166
|
-
onClick: () => I(
|
|
3177
|
+
onClick: () => I(g.name),
|
|
3167
3178
|
children: [
|
|
3168
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children:
|
|
3169
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children:
|
|
3170
|
-
|
|
3179
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: g.icon || /* @__PURE__ */ e.jsx(Ke, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3180
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: g.displayName || g.name }),
|
|
3181
|
+
w && g.tier && /* @__PURE__ */ e.jsx(he, { size: "xs", variant: ot[g.tier] || "default", children: g.tier })
|
|
3171
3182
|
]
|
|
3172
3183
|
},
|
|
3173
|
-
|
|
3174
|
-
),
|
|
3175
|
-
const
|
|
3176
|
-
return
|
|
3177
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier":
|
|
3178
|
-
...
|
|
3184
|
+
g.name
|
|
3185
|
+
), W = () => !i || !w ? A.map(L) : ["fast", "standard", "premium"].flatMap((g) => {
|
|
3186
|
+
const C = A.filter((M) => M.tier === g);
|
|
3187
|
+
return C.length ? [
|
|
3188
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__group-label", "data-tier": g, children: g.charAt(0).toUpperCase() + g.slice(1) }, `lbl-${g}`),
|
|
3189
|
+
...C.map(L)
|
|
3179
3190
|
] : [];
|
|
3180
|
-
}),
|
|
3181
|
-
o &&
|
|
3191
|
+
}), O = u && /* @__PURE__ */ e.jsxs("div", { ref: f, className: `ds-model-picker__menu ds-model-picker__menu--${y} ds-scrollable`, "data-ds-portal": "", style: _, children: [
|
|
3192
|
+
o && T && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3182
3193
|
/* @__PURE__ */ e.jsxs(
|
|
3183
3194
|
"button",
|
|
3184
3195
|
{
|
|
@@ -3190,14 +3201,14 @@ function zn({
|
|
|
3190
3201
|
].filter(Boolean).join(" "),
|
|
3191
3202
|
onClick: () => I("auto"),
|
|
3192
3203
|
children: [
|
|
3193
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: /* @__PURE__ */ e.jsx(
|
|
3204
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-icon", children: /* @__PURE__ */ e.jsx(At, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3194
3205
|
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__item-name", children: "Auto (smart routing)" })
|
|
3195
3206
|
]
|
|
3196
3207
|
}
|
|
3197
3208
|
),
|
|
3198
|
-
|
|
3209
|
+
A.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "ds-model-picker__separator" })
|
|
3199
3210
|
] }),
|
|
3200
|
-
|
|
3211
|
+
W()
|
|
3201
3212
|
] });
|
|
3202
3213
|
return /* @__PURE__ */ e.jsxs(
|
|
3203
3214
|
"div",
|
|
@@ -3211,98 +3222,98 @@ function zn({
|
|
|
3211
3222
|
{
|
|
3212
3223
|
ref: h,
|
|
3213
3224
|
type: "button",
|
|
3214
|
-
className: `ds-model-picker__trigger ds-model-picker__trigger--${
|
|
3215
|
-
onClick: () => d((
|
|
3225
|
+
className: `ds-model-picker__trigger ds-model-picker__trigger--${y}`,
|
|
3226
|
+
onClick: () => d((g) => !g),
|
|
3216
3227
|
"aria-haspopup": "listbox",
|
|
3217
3228
|
"aria-expanded": u,
|
|
3218
3229
|
children: [
|
|
3219
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__icon", children: (
|
|
3220
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (
|
|
3221
|
-
|
|
3230
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__icon", children: (x == null ? void 0 : x.icon) || /* @__PURE__ */ e.jsx(Ke, { strokeWidth: 1.5, "aria-hidden": "true" }) }),
|
|
3231
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-model-picker__trigger-name", children: (x == null ? void 0 : x.displayName) || (x == null ? void 0 : x.name) || s }),
|
|
3232
|
+
w && (x == null ? void 0 : x.tier) && /* @__PURE__ */ e.jsx(he, { size: "xs", variant: ot[x.tier] || "default", children: x.tier })
|
|
3222
3233
|
]
|
|
3223
3234
|
}
|
|
3224
3235
|
),
|
|
3225
|
-
typeof document < "u" && re.createPortal(
|
|
3236
|
+
typeof document < "u" && re.createPortal(O, document.body)
|
|
3226
3237
|
]
|
|
3227
3238
|
}
|
|
3228
3239
|
);
|
|
3229
3240
|
}
|
|
3230
|
-
const
|
|
3241
|
+
const fs = ({ filename: t, pagesLabel: s }) => /* @__PURE__ */ e.jsxs("span", { style: { display: "flex", alignItems: "center", gap: "var(--space-2)", minWidth: 0 }, children: [
|
|
3231
3242
|
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: t }),
|
|
3232
3243
|
s && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: s })
|
|
3233
3244
|
] });
|
|
3234
|
-
function
|
|
3245
|
+
function ms(t) {
|
|
3235
3246
|
const s = /* @__PURE__ */ new Map();
|
|
3236
3247
|
for (const n of t)
|
|
3237
3248
|
s.has(n.filename) || s.set(n.filename, { filename: n.filename, url: n.url, items: [] }), s.get(n.filename).items.push(n);
|
|
3238
3249
|
return [...s.values()];
|
|
3239
3250
|
}
|
|
3240
|
-
function
|
|
3251
|
+
function Wn({
|
|
3241
3252
|
sources: t = [],
|
|
3242
3253
|
layout: s = "list",
|
|
3243
3254
|
title: n,
|
|
3244
3255
|
maxVisible: r = 5,
|
|
3245
3256
|
onSourceClick: a
|
|
3246
3257
|
}) {
|
|
3247
|
-
const o = K(), { t: i } = be(), l = n ?? o.sources, [c, u] = D(!1), d =
|
|
3248
|
-
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className:
|
|
3249
|
-
h.map((
|
|
3250
|
-
const
|
|
3258
|
+
const o = K(), { t: i } = be(), l = n ?? o.sources, [c, u] = D(!1), d = ms(t), p = d.length > r, h = c ? d : d.slice(0, r), f = t.some((N) => N.snippet), _ = (N) => N != null && N.length ? i("pageAbbrev", { pages: N.join(", ") }) : null, j = i("moreSources", { n: d.length - r }), y = ["ds-sources-panel", s === "compact" && "ds-sources-panel--compact"].filter(Boolean).join(" ");
|
|
3259
|
+
return s === "compact" ? /* @__PURE__ */ e.jsxs("div", { className: y, children: [
|
|
3260
|
+
h.map((N) => {
|
|
3261
|
+
const T = N.items.map((k) => k.page).filter(Boolean), A = _(T), x = !!a;
|
|
3251
3262
|
return /* @__PURE__ */ e.jsxs(
|
|
3252
3263
|
"div",
|
|
3253
3264
|
{
|
|
3254
|
-
className: `ds-sources-panel__compact-row${
|
|
3255
|
-
onClick:
|
|
3265
|
+
className: `ds-sources-panel__compact-row${x ? " ds-sources-panel__compact-row--clickable" : ""}`,
|
|
3266
|
+
onClick: x ? () => a(N.items[0]) : void 0,
|
|
3256
3267
|
children: [
|
|
3257
|
-
/* @__PURE__ */ e.jsx(
|
|
3258
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children:
|
|
3259
|
-
|
|
3268
|
+
/* @__PURE__ */ e.jsx(Bt, { size: q[1], strokeWidth: 1.5, className: "ds-sources-panel__compact-icon" }),
|
|
3269
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: N.filename }),
|
|
3270
|
+
A && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: A })
|
|
3260
3271
|
]
|
|
3261
3272
|
},
|
|
3262
|
-
|
|
3273
|
+
N.filename
|
|
3263
3274
|
);
|
|
3264
3275
|
}),
|
|
3265
|
-
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children:
|
|
3266
|
-
] }) : /* @__PURE__ */ e.jsxs("div", { className:
|
|
3276
|
+
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children: j })
|
|
3277
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: y, children: [
|
|
3267
3278
|
l && /* @__PURE__ */ e.jsx("div", { className: "ds-sources-panel__title", children: l }),
|
|
3268
|
-
h.map((
|
|
3269
|
-
const
|
|
3279
|
+
h.map((N) => {
|
|
3280
|
+
const T = N.items.map((k) => k.page).filter(Boolean), A = _(T), x = !!a;
|
|
3270
3281
|
return f ? /* @__PURE__ */ e.jsx(
|
|
3271
3282
|
He,
|
|
3272
3283
|
{
|
|
3273
|
-
title: /* @__PURE__ */ e.jsx(
|
|
3284
|
+
title: /* @__PURE__ */ e.jsx(fs, { filename: N.filename, pagesLabel: A }),
|
|
3274
3285
|
padding: "s",
|
|
3275
|
-
children:
|
|
3286
|
+
children: N.items.map((k, w) => /* @__PURE__ */ e.jsx(
|
|
3276
3287
|
"div",
|
|
3277
3288
|
{
|
|
3278
|
-
className: `ds-sources-panel__snippet${
|
|
3279
|
-
onClick:
|
|
3280
|
-
children:
|
|
3289
|
+
className: `ds-sources-panel__snippet${x ? " ds-sources-panel__snippet--clickable" : ""}`,
|
|
3290
|
+
onClick: x ? () => a(k) : void 0,
|
|
3291
|
+
children: k.snippet ?? i("pageAbbrev", { pages: k.page })
|
|
3281
3292
|
},
|
|
3282
|
-
|
|
3293
|
+
w
|
|
3283
3294
|
))
|
|
3284
3295
|
},
|
|
3285
|
-
|
|
3296
|
+
N.filename
|
|
3286
3297
|
) : /* @__PURE__ */ e.jsxs(
|
|
3287
3298
|
"div",
|
|
3288
3299
|
{
|
|
3289
|
-
className: `ds-sources-panel__row${
|
|
3290
|
-
onClick:
|
|
3300
|
+
className: `ds-sources-panel__row${x ? " ds-sources-panel__row--clickable" : ""}`,
|
|
3301
|
+
onClick: x ? () => a(N.items[0]) : void 0,
|
|
3291
3302
|
children: [
|
|
3292
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children:
|
|
3293
|
-
|
|
3303
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__filename", children: N.filename }),
|
|
3304
|
+
A && /* @__PURE__ */ e.jsx("span", { className: "ds-sources-panel__pages", children: A })
|
|
3294
3305
|
]
|
|
3295
3306
|
},
|
|
3296
|
-
|
|
3307
|
+
N.filename
|
|
3297
3308
|
);
|
|
3298
3309
|
}),
|
|
3299
|
-
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children:
|
|
3310
|
+
p && !c && /* @__PURE__ */ e.jsx("button", { className: "ds-sources-panel__more", onClick: () => u(!0), children: j })
|
|
3300
3311
|
] });
|
|
3301
3312
|
}
|
|
3302
3313
|
function it(t) {
|
|
3303
3314
|
return t >= 1e6 ? (t / 1e6).toFixed(1).replace(/\.0$/, "") + "M" : t >= 1e3 ? (t / 1e3).toFixed(1).replace(/\.0$/, "") + "K" : String(t);
|
|
3304
3315
|
}
|
|
3305
|
-
function
|
|
3316
|
+
function On({
|
|
3306
3317
|
used: t,
|
|
3307
3318
|
limit: s,
|
|
3308
3319
|
size: n = "s",
|
|
@@ -3343,16 +3354,16 @@ function Wn({
|
|
|
3343
3354
|
);
|
|
3344
3355
|
}
|
|
3345
3356
|
const lt = 5;
|
|
3346
|
-
function
|
|
3357
|
+
function ps(t) {
|
|
3347
3358
|
return t < 0.34 ? "low" : t < 0.67 ? "medium" : "high";
|
|
3348
3359
|
}
|
|
3349
|
-
function
|
|
3360
|
+
function Cn({
|
|
3350
3361
|
value: t = 0,
|
|
3351
3362
|
size: s = "xs",
|
|
3352
3363
|
showLabel: n = "none",
|
|
3353
3364
|
layout: r = "inline"
|
|
3354
3365
|
}) {
|
|
3355
|
-
const a = Math.max(0, Math.min(1, t)), o = Math.round(a * lt), i =
|
|
3366
|
+
const a = Math.max(0, Math.min(1, t)), o = Math.round(a * lt), i = ps(a);
|
|
3356
3367
|
return /* @__PURE__ */ e.jsxs("div", { className: [
|
|
3357
3368
|
"ds-confidence-bar",
|
|
3358
3369
|
`ds-confidence-bar--${s}`,
|
|
@@ -3369,15 +3380,15 @@ function On({
|
|
|
3369
3380
|
n === "text" && /* @__PURE__ */ e.jsx("span", { className: "ds-confidence-bar__label", children: i })
|
|
3370
3381
|
] });
|
|
3371
3382
|
}
|
|
3372
|
-
const
|
|
3383
|
+
const hs = { add: "+", remove: "-", context: " " };
|
|
3373
3384
|
function Ae({ line: t, lineNumbers: s }) {
|
|
3374
3385
|
return /* @__PURE__ */ e.jsxs("div", { className: `ds-diff-view__line ds-diff-view__line--${t.type}`, children: [
|
|
3375
3386
|
s && t.lineNo != null && /* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__lineno", children: t.lineNo }),
|
|
3376
|
-
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children:
|
|
3387
|
+
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__prefix", children: hs[t.type] }),
|
|
3377
3388
|
/* @__PURE__ */ e.jsx("span", { className: "ds-diff-view__text", children: t.text })
|
|
3378
3389
|
] });
|
|
3379
3390
|
}
|
|
3380
|
-
function
|
|
3391
|
+
function Un({
|
|
3381
3392
|
lines: t = [],
|
|
3382
3393
|
layout: s = "inline",
|
|
3383
3394
|
wordWrap: n = !1,
|
|
@@ -3405,7 +3416,7 @@ function Cn({
|
|
|
3405
3416
|
/* @__PURE__ */ e.jsx("div", { className: "ds-diff-view__body ds-scrollable", style: l, children: t.map((c, u) => /* @__PURE__ */ e.jsx(Ae, { line: c, lineNumbers: r }, u)) })
|
|
3406
3417
|
] });
|
|
3407
3418
|
}
|
|
3408
|
-
function
|
|
3419
|
+
function xs({
|
|
3409
3420
|
value: t = "idle",
|
|
3410
3421
|
onLike: s,
|
|
3411
3422
|
onDislike: n,
|
|
@@ -3437,7 +3448,7 @@ function hs({
|
|
|
3437
3448
|
"aria-label": a ?? l.like,
|
|
3438
3449
|
"aria-pressed": t === "liked",
|
|
3439
3450
|
children: /* @__PURE__ */ e.jsx(
|
|
3440
|
-
|
|
3451
|
+
It,
|
|
3441
3452
|
{
|
|
3442
3453
|
size: q[1],
|
|
3443
3454
|
strokeWidth: 1.5,
|
|
@@ -3458,7 +3469,7 @@ function hs({
|
|
|
3458
3469
|
"aria-label": o ?? l.dislike,
|
|
3459
3470
|
"aria-pressed": t === "disliked",
|
|
3460
3471
|
children: /* @__PURE__ */ e.jsx(
|
|
3461
|
-
|
|
3472
|
+
Lt,
|
|
3462
3473
|
{
|
|
3463
3474
|
size: q[1],
|
|
3464
3475
|
strokeWidth: 1.5,
|
|
@@ -3471,7 +3482,7 @@ function hs({
|
|
|
3471
3482
|
}
|
|
3472
3483
|
);
|
|
3473
3484
|
}
|
|
3474
|
-
function
|
|
3485
|
+
function vs(t) {
|
|
3475
3486
|
const s = t instanceof Date ? t : new Date(t);
|
|
3476
3487
|
if (isNaN(s)) return null;
|
|
3477
3488
|
const n = /* @__PURE__ */ new Date(), r = s.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", hour12: !1 }), a = new Date(n.getFullYear(), n.getMonth(), n.getDate()), o = new Date(a - 864e5);
|
|
@@ -3480,7 +3491,7 @@ function xs(t) {
|
|
|
3480
3491
|
const i = s.getDate(), l = s.toLocaleString([], { month: "short" });
|
|
3481
3492
|
return `${i} ${l} ${r}`;
|
|
3482
3493
|
}
|
|
3483
|
-
function
|
|
3494
|
+
function Hn({
|
|
3484
3495
|
role: t = "assistant",
|
|
3485
3496
|
text: s,
|
|
3486
3497
|
timestamp: n,
|
|
@@ -3490,7 +3501,7 @@ function Un({
|
|
|
3490
3501
|
className: i = "",
|
|
3491
3502
|
...l
|
|
3492
3503
|
}) {
|
|
3493
|
-
const c = t === "assistant" && (a || o), u = !!s, d = n ?
|
|
3504
|
+
const c = t === "assistant" && (a || o), u = !!s, d = n ? vs(n) : null;
|
|
3494
3505
|
return !c && !u && !d ? null : /* @__PURE__ */ e.jsxs(
|
|
3495
3506
|
"div",
|
|
3496
3507
|
{
|
|
@@ -3498,20 +3509,20 @@ function Un({
|
|
|
3498
3509
|
...l,
|
|
3499
3510
|
children: [
|
|
3500
3511
|
t === "user" && d && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: d }),
|
|
3501
|
-
c && /* @__PURE__ */ e.jsx(
|
|
3502
|
-
u && /* @__PURE__ */ e.jsx(
|
|
3512
|
+
c && /* @__PURE__ */ e.jsx(xs, { className: "ds-message-action", value: r, onLike: a, onDislike: o }),
|
|
3513
|
+
u && /* @__PURE__ */ e.jsx(cs, { className: "ds-message-action", text: s }),
|
|
3503
3514
|
t === "assistant" && d && /* @__PURE__ */ e.jsx("span", { className: "ds-message-footer__timestamp ds-message-action", children: d })
|
|
3504
3515
|
]
|
|
3505
3516
|
}
|
|
3506
3517
|
);
|
|
3507
3518
|
}
|
|
3508
|
-
function
|
|
3519
|
+
function Vn({ label: t, className: s = "", ...n }) {
|
|
3509
3520
|
return /* @__PURE__ */ e.jsxs("span", { className: ["ds-thinking-dot", s].filter(Boolean).join(" "), ...n, children: [
|
|
3510
3521
|
/* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__pulse" }),
|
|
3511
3522
|
t && /* @__PURE__ */ e.jsx("span", { className: "ds-thinking-dot__label", children: t })
|
|
3512
3523
|
] });
|
|
3513
3524
|
}
|
|
3514
|
-
function
|
|
3525
|
+
function Yn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...a }) {
|
|
3515
3526
|
const o = t === "dark", i = s ?? o, l = o ? "rgba(255,250,250,0.05)" : "var(--color-border-light)", c = o ? "rgba(255,250,250,0.025)" : "color-mix(in srgb, var(--color-border-light) 50%, transparent)";
|
|
3516
3527
|
return /* @__PURE__ */ e.jsx(
|
|
3517
3528
|
"div",
|
|
@@ -3552,7 +3563,7 @@ function Vn({ variant: t = "light", glow: s, mask: n = !0, style: r, ...a }) {
|
|
|
3552
3563
|
}
|
|
3553
3564
|
);
|
|
3554
3565
|
}
|
|
3555
|
-
function
|
|
3566
|
+
function qn({ children: t, axis: s = "y", style: n, className: r = "", ...a }) {
|
|
3556
3567
|
const o = s === "x" ? { overflowX: "auto", overflowY: "hidden" } : s === "both" ? { overflow: "auto" } : { overflowY: "auto", overflowX: "hidden" };
|
|
3557
3568
|
return /* @__PURE__ */ e.jsx(
|
|
3558
3569
|
"div",
|
|
@@ -3564,11 +3575,11 @@ function Yn({ children: t, axis: s = "y", style: n, className: r = "", ...a }) {
|
|
|
3564
3575
|
}
|
|
3565
3576
|
);
|
|
3566
3577
|
}
|
|
3567
|
-
const Be = 280,
|
|
3568
|
-
function
|
|
3578
|
+
const Be = 280, bs = 22, _s = 14, ue = 8, Te = 6, js = 200;
|
|
3579
|
+
function Ns(t) {
|
|
3569
3580
|
return t ? typeof t == "function" ? t() : typeof t == "string" ? document.querySelector(t) : null : null;
|
|
3570
3581
|
}
|
|
3571
|
-
function
|
|
3582
|
+
function ws(t, s, n, r) {
|
|
3572
3583
|
const a = window.innerWidth, o = window.innerHeight;
|
|
3573
3584
|
if (o - t.bottom >= s + r + ue) return "bottom";
|
|
3574
3585
|
if (t.top >= s + r + ue) return "top";
|
|
@@ -3577,7 +3588,7 @@ function Ns(t, s, n, r) {
|
|
|
3577
3588
|
const i = Math.max(t.top, o - t.bottom, a - t.right, t.left);
|
|
3578
3589
|
return i === o - t.bottom ? "bottom" : i === t.top ? "top" : i === a - t.right ? "right" : "left";
|
|
3579
3590
|
}
|
|
3580
|
-
function
|
|
3591
|
+
function gs(t, s, n, r, a) {
|
|
3581
3592
|
const o = window.innerWidth, i = window.innerHeight;
|
|
3582
3593
|
let l, c;
|
|
3583
3594
|
switch (t) {
|
|
@@ -3596,7 +3607,7 @@ function ws(t, s, n, r, a) {
|
|
|
3596
3607
|
const u = Math.max(ue, Math.min(o - r - ue, c)), d = Math.max(ue, Math.min(i - n - ue, l));
|
|
3597
3608
|
return { top: d, left: u, arrowOffset: c - u, arrowOffsetY: l - d };
|
|
3598
3609
|
}
|
|
3599
|
-
function
|
|
3610
|
+
function Gn({
|
|
3600
3611
|
steps: t,
|
|
3601
3612
|
currentStep: s,
|
|
3602
3613
|
onNext: n,
|
|
@@ -3612,66 +3623,66 @@ function qn({
|
|
|
3612
3623
|
statePrimary: h = "idle",
|
|
3613
3624
|
stateBack: f = "idle"
|
|
3614
3625
|
}) {
|
|
3615
|
-
const _ = K(), { t:
|
|
3616
|
-
|
|
3617
|
-
const [L,
|
|
3618
|
-
const Y =
|
|
3619
|
-
if (!Y || !
|
|
3620
|
-
const m =
|
|
3626
|
+
const _ = K(), { t: j } = be(), y = c ?? _.next, N = u ?? _.back, T = d ?? _.skipTour, A = p ?? _.done, x = R(null), k = R(t), w = R(s), I = R(l);
|
|
3627
|
+
k.current = t, w.current = s, I.current = l;
|
|
3628
|
+
const [L, W] = D(!1), [O, g] = D({ position: "fixed", visibility: "hidden", width: Be }), [C, M] = D("bottom"), [V, v] = D(null), $ = R(!1), S = t[s], z = s === t.length - 1, H = ne(() => {
|
|
3629
|
+
const Y = k.current[w.current];
|
|
3630
|
+
if (!Y || !x.current) return;
|
|
3631
|
+
const m = Ns(Y.target);
|
|
3621
3632
|
if (!m) return;
|
|
3622
|
-
const
|
|
3623
|
-
|
|
3633
|
+
const b = m.getBoundingClientRect(), U = x.current.getBoundingClientRect().height || 160, se = Be, ae = I.current ? bs : _s, G = Y.position || ws(b, U, se, ae), { top: Q, left: fe, arrowOffset: je, arrowOffsetY: Se } = gs(G, b, U, se, ae);
|
|
3634
|
+
M(G), g({
|
|
3624
3635
|
position: "fixed",
|
|
3625
|
-
top:
|
|
3636
|
+
top: Q,
|
|
3626
3637
|
left: fe,
|
|
3627
3638
|
width: Be,
|
|
3628
3639
|
visibility: "visible",
|
|
3629
3640
|
"--arrow-offset": `${je}px`,
|
|
3630
3641
|
"--arrow-offset-y": `${Se}px`
|
|
3631
|
-
}),
|
|
3632
|
-
top:
|
|
3633
|
-
left:
|
|
3634
|
-
width:
|
|
3635
|
-
height:
|
|
3642
|
+
}), v({
|
|
3643
|
+
top: b.top - Te,
|
|
3644
|
+
left: b.left - Te,
|
|
3645
|
+
width: b.width + Te * 2,
|
|
3646
|
+
height: b.height + Te * 2
|
|
3636
3647
|
});
|
|
3637
3648
|
}, []);
|
|
3638
|
-
return
|
|
3649
|
+
return P(() => {
|
|
3639
3650
|
window.addEventListener("scroll", H, !0), window.addEventListener("resize", H);
|
|
3640
3651
|
const Y = requestAnimationFrame(() => {
|
|
3641
|
-
H(),
|
|
3652
|
+
H(), W(!0), $.current = !0;
|
|
3642
3653
|
});
|
|
3643
3654
|
return () => {
|
|
3644
3655
|
cancelAnimationFrame(Y), window.removeEventListener("scroll", H, !0), window.removeEventListener("resize", H);
|
|
3645
3656
|
};
|
|
3646
|
-
}, []),
|
|
3657
|
+
}, []), P(() => {
|
|
3647
3658
|
if (!$.current) return;
|
|
3648
|
-
|
|
3659
|
+
W(!1);
|
|
3649
3660
|
const Y = setTimeout(() => {
|
|
3650
|
-
|
|
3651
|
-
H(),
|
|
3661
|
+
g((m) => ({ ...m, visibility: "hidden" })), requestAnimationFrame(() => {
|
|
3662
|
+
H(), W(!0);
|
|
3652
3663
|
});
|
|
3653
|
-
},
|
|
3664
|
+
}, js + 20);
|
|
3654
3665
|
return () => clearTimeout(Y);
|
|
3655
|
-
}, [s]),
|
|
3656
|
-
L &&
|
|
3657
|
-
}, [L]),
|
|
3666
|
+
}, [s]), P(() => {
|
|
3667
|
+
L && x.current && x.current.focus({ preventScroll: !0 });
|
|
3668
|
+
}, [L]), P(() => {
|
|
3658
3669
|
const Y = (m) => {
|
|
3659
3670
|
m.key === "Escape" && a();
|
|
3660
3671
|
};
|
|
3661
3672
|
return document.addEventListener("keydown", Y), () => document.removeEventListener("keydown", Y);
|
|
3662
|
-
}, [a]),
|
|
3673
|
+
}, [a]), P(() => {
|
|
3663
3674
|
if (!L) return;
|
|
3664
3675
|
const Y = (m) => {
|
|
3665
|
-
if (m.key !== "Tab" || !
|
|
3666
|
-
const
|
|
3667
|
-
|
|
3676
|
+
if (m.key !== "Tab" || !x.current) return;
|
|
3677
|
+
const b = Array.from(
|
|
3678
|
+
x.current.querySelectorAll('button:not([disabled]), [href], [tabindex]:not([tabindex="-1"])')
|
|
3668
3679
|
);
|
|
3669
|
-
if (!
|
|
3670
|
-
const B =
|
|
3680
|
+
if (!b.length) return;
|
|
3681
|
+
const B = b[0], U = b[b.length - 1];
|
|
3671
3682
|
m.shiftKey && document.activeElement === B ? (m.preventDefault(), U.focus()) : !m.shiftKey && document.activeElement === U && (m.preventDefault(), B.focus());
|
|
3672
3683
|
};
|
|
3673
3684
|
return document.addEventListener("keydown", Y), () => document.removeEventListener("keydown", Y);
|
|
3674
|
-
}, [L]), !
|
|
3685
|
+
}, [L]), !S || typeof document > "u" ? null : re.createPortal(
|
|
3675
3686
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
3676
3687
|
V && /* @__PURE__ */ e.jsx(
|
|
3677
3688
|
"div",
|
|
@@ -3689,18 +3700,18 @@ function qn({
|
|
|
3689
3700
|
/* @__PURE__ */ e.jsxs(
|
|
3690
3701
|
"div",
|
|
3691
3702
|
{
|
|
3692
|
-
ref:
|
|
3703
|
+
ref: x,
|
|
3693
3704
|
"data-ds-portal": "",
|
|
3694
3705
|
role: "dialog",
|
|
3695
3706
|
"aria-modal": "false",
|
|
3696
3707
|
"aria-live": "polite",
|
|
3697
|
-
"aria-label":
|
|
3708
|
+
"aria-label": S.title ?? j("stepOf", { current: s + 1, total: t.length }),
|
|
3698
3709
|
className: [
|
|
3699
3710
|
"ds-coachmark__bubble",
|
|
3700
|
-
`ds-coachmark__bubble--${
|
|
3711
|
+
`ds-coachmark__bubble--${C}`,
|
|
3701
3712
|
L && "ds-coachmark__bubble--visible"
|
|
3702
3713
|
].filter(Boolean).join(" "),
|
|
3703
|
-
style:
|
|
3714
|
+
style: O,
|
|
3704
3715
|
tabIndex: -1,
|
|
3705
3716
|
children: [
|
|
3706
3717
|
/* @__PURE__ */ e.jsx(
|
|
@@ -3709,12 +3720,12 @@ function qn({
|
|
|
3709
3720
|
type: "button",
|
|
3710
3721
|
className: "ds-coachmark__close",
|
|
3711
3722
|
onClick: a,
|
|
3712
|
-
"aria-label":
|
|
3713
|
-
children: /* @__PURE__ */ e.jsx(
|
|
3723
|
+
"aria-label": T,
|
|
3724
|
+
children: /* @__PURE__ */ e.jsx(te, { size: 16, strokeWidth: 2 })
|
|
3714
3725
|
}
|
|
3715
3726
|
),
|
|
3716
|
-
|
|
3717
|
-
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children:
|
|
3727
|
+
S.title && /* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__title", children: S.title }),
|
|
3728
|
+
/* @__PURE__ */ e.jsx("div", { className: "ds-coachmark__body", children: S.content }),
|
|
3718
3729
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer", children: [
|
|
3719
3730
|
t.length > 1 && /* @__PURE__ */ e.jsxs("span", { className: "ds-coachmark__counter", children: [
|
|
3720
3731
|
s + 1,
|
|
@@ -3722,8 +3733,8 @@ function qn({
|
|
|
3722
3733
|
t.length
|
|
3723
3734
|
] }),
|
|
3724
3735
|
/* @__PURE__ */ e.jsxs("div", { className: "ds-coachmark__footer-nav", children: [
|
|
3725
|
-
s > 0 && /* @__PURE__ */ e.jsx(de, { variant: "secondary", size: "s", state: f, onClick: r, children:
|
|
3726
|
-
/* @__PURE__ */ e.jsx(de, { variant: "primary", size: "s", state: h, onClick:
|
|
3736
|
+
s > 0 && /* @__PURE__ */ e.jsx(de, { variant: "secondary", size: "s", state: f, onClick: r, children: N }),
|
|
3737
|
+
/* @__PURE__ */ e.jsx(de, { variant: "primary", size: "s", state: h, onClick: z ? o : n, children: z ? A : y })
|
|
3727
3738
|
] })
|
|
3728
3739
|
] })
|
|
3729
3740
|
]
|
|
@@ -3733,8 +3744,8 @@ function qn({
|
|
|
3733
3744
|
document.body
|
|
3734
3745
|
);
|
|
3735
3746
|
}
|
|
3736
|
-
function
|
|
3737
|
-
const { storageKey: n } = s, [r, a] = D(0), [o, i] = D(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", c =
|
|
3747
|
+
function Kn(t, s = {}) {
|
|
3748
|
+
const { storageKey: n } = s, [r, a] = D(0), [o, i] = D(!1), l = () => n && typeof localStorage < "u" && localStorage.getItem(n) === "done", c = ne(() => {
|
|
3738
3749
|
i(!1), n && typeof localStorage < "u" && localStorage.setItem(n, "done");
|
|
3739
3750
|
}, [n]);
|
|
3740
3751
|
return {
|
|
@@ -3749,8 +3760,8 @@ function Gn(t, s = {}) {
|
|
|
3749
3760
|
finish: c
|
|
3750
3761
|
};
|
|
3751
3762
|
}
|
|
3752
|
-
function
|
|
3753
|
-
const t =
|
|
3763
|
+
function Xn() {
|
|
3764
|
+
const t = R(null), s = ne(() => {
|
|
3754
3765
|
const n = t.current;
|
|
3755
3766
|
if (!n) return;
|
|
3756
3767
|
n.classList.remove("ds-shake"), n.offsetWidth, n.classList.add("ds-shake");
|
|
@@ -3763,102 +3774,102 @@ function Kn() {
|
|
|
3763
3774
|
}
|
|
3764
3775
|
export {
|
|
3765
3776
|
He as Accordion,
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3777
|
+
zs as Alert,
|
|
3778
|
+
$n as AnimatedNumber,
|
|
3779
|
+
en as Avatar,
|
|
3769
3780
|
he as Badge,
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3781
|
+
kn as Banner,
|
|
3782
|
+
Ws as BottomSheet,
|
|
3783
|
+
fn as Breadcrumb,
|
|
3784
|
+
Vs as BrowserPane,
|
|
3785
|
+
Ys as BrowserTabs,
|
|
3775
3786
|
de as Button,
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3787
|
+
Bs as Card,
|
|
3788
|
+
Pn as ChatMessage,
|
|
3789
|
+
Zs as Checkbox,
|
|
3790
|
+
Gn as Coachmark,
|
|
3791
|
+
Os as Code,
|
|
3792
|
+
Ht as CodeAccordion,
|
|
3793
|
+
Cn as ConfidenceBar,
|
|
3794
|
+
cs as CopyButton,
|
|
3795
|
+
Un as DiffView,
|
|
3796
|
+
En as Dropdown,
|
|
3797
|
+
cn as EmptyState,
|
|
3798
|
+
Yn as EngineerGrid,
|
|
3799
|
+
dn as FormField,
|
|
3800
|
+
Is as H1,
|
|
3801
|
+
Ls as H2,
|
|
3802
|
+
Ds as H3,
|
|
3803
|
+
Ps as H4,
|
|
3804
|
+
Rn as InView,
|
|
3805
|
+
$s as Input,
|
|
3806
|
+
Cs as Link,
|
|
3807
|
+
qs as List,
|
|
3808
|
+
Gs as ListRow,
|
|
3809
|
+
Ts as LocaleProvider,
|
|
3810
|
+
Xs as Mention,
|
|
3811
|
+
xs as MessageFeedback,
|
|
3812
|
+
Hn as MessageFooter,
|
|
3813
|
+
Fs as Modal,
|
|
3803
3814
|
xe as ModalFooter,
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3815
|
+
Fn as ModelPicker,
|
|
3816
|
+
hn as NavRail,
|
|
3817
|
+
gn as NavRailAgent,
|
|
3818
|
+
vn as NavRailBody,
|
|
3819
|
+
wn as NavRailCustomItem,
|
|
3820
|
+
jn as NavRailDivider,
|
|
3821
|
+
yn as NavRailFlyout,
|
|
3822
|
+
_n as NavRailFooter,
|
|
3823
|
+
bn as NavRailHeader,
|
|
3824
|
+
xn as NavRailItem,
|
|
3825
|
+
Nn as NavRailRecents,
|
|
3826
|
+
Ms as P1,
|
|
3827
|
+
Ft as P2,
|
|
3817
3828
|
ft as P3,
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3829
|
+
mn as Pagination,
|
|
3830
|
+
Tn as ProgressBar,
|
|
3831
|
+
zn as PromptInput,
|
|
3832
|
+
Qs as Radio,
|
|
3833
|
+
In as ReasoningBlock,
|
|
3834
|
+
qn as Scrollable,
|
|
3835
|
+
Ks as SegmentedControl,
|
|
3836
|
+
Ss as Select,
|
|
3837
|
+
pn as SidePage,
|
|
3827
3838
|
et as SidePageFooter,
|
|
3828
|
-
|
|
3829
|
-
|
|
3830
|
-
|
|
3831
|
-
|
|
3832
|
-
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3839
|
+
Gt as Skeleton,
|
|
3840
|
+
Wn as SourcesPanel,
|
|
3841
|
+
Mt as Spinner,
|
|
3842
|
+
un as Stat,
|
|
3843
|
+
Ln as StepIndicator,
|
|
3844
|
+
As as Stepper,
|
|
3845
|
+
Dn as StreamingText,
|
|
3846
|
+
Hs as Tab,
|
|
3847
|
+
tn as Table,
|
|
3848
|
+
nn as TableBody,
|
|
3849
|
+
sn as TableHead,
|
|
3850
|
+
rn as TableRow,
|
|
3851
|
+
an as TableSubheaderRow,
|
|
3852
|
+
Us as Tabs,
|
|
3853
|
+
ln as Td,
|
|
3854
|
+
Rs as Textarea,
|
|
3855
|
+
on as Th,
|
|
3856
|
+
Vn as ThinkingDot,
|
|
3857
|
+
An as ToastContainer,
|
|
3858
|
+
Js as Toggle,
|
|
3859
|
+
On as TokenCounter,
|
|
3860
|
+
Bn as ToolCallBubble,
|
|
3861
|
+
Bn as ToolCallCard,
|
|
3851
3862
|
Ve as Tooltip,
|
|
3852
3863
|
$e as defaultStrings,
|
|
3853
3864
|
ut as formatString,
|
|
3854
3865
|
q as iconSizes,
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3866
|
+
ns as useAnimatedNumber,
|
|
3867
|
+
ds as useAnimatedPlaceholder,
|
|
3868
|
+
Kn as useCoachmark,
|
|
3869
|
+
rs as useInView,
|
|
3859
3870
|
be as useLocale,
|
|
3860
|
-
|
|
3861
|
-
|
|
3871
|
+
Xn as useShake,
|
|
3872
|
+
Mn as useStreamScroll,
|
|
3862
3873
|
K as useStrings,
|
|
3863
|
-
|
|
3874
|
+
Sn as useToast
|
|
3864
3875
|
};
|