@aiquants/directory-tree 5.0.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,193 +1,193 @@
1
- import * as ue from "react";
2
- import fr, { useRef as G, useEffect as Ae, useCallback as _, memo as Dt, useState as de, useMemo as z, useLayoutEffect as En, useImperativeHandle as hr, useTransition as mr } from "react";
3
- import { VIRTUAL_SCROLL_LABEL_KEYS as ht, VIRTUAL_SCROLL_LABEL_CATALOGS as Rn, resolveVirtualScrollLocale as $n, resolveVirtualScrollLabels as pr, VirtualScroll as yr, ScrollBar as gr } from "@aiquants/virtualscroll";
4
- import { twMerge as L } from "tailwind-merge";
5
- import { FileIcon as br, FileText as vr, FileCode as Sr, FileZip as wr, FileVideo as xr, FileAudio as Er, FileImage as Rr, FilePpt as Ir, FileDoc as Nr, FileCsv as Tr, FileXls as kr, FilePdf as Pr, FileMd as _r } from "@phosphor-icons/react";
6
- var ft = { exports: {} }, Je = {};
7
- var In;
8
- function Cr() {
9
- if (In) return Je;
10
- In = 1;
1
+ import * as he from "react";
2
+ import pr, { useRef as Y, useEffect as De, useCallback as _, memo as Ft, useState as fe, useMemo as z, useLayoutEffect as In, useImperativeHandle as yr, useTransition as gr } from "react";
3
+ import { VIRTUAL_SCROLL_LABEL_KEYS as pt, VIRTUAL_SCROLL_LABEL_CATALOGS as Tn, resolveVirtualScrollLocale as Mn, resolveVirtualScrollLabels as br, VirtualScroll as vr, ScrollBar as Sr } from "@aiquants/virtualscroll";
4
+ import { twMerge as U } from "tailwind-merge";
5
+ import { FileIcon as wr, FileText as Er, FileCode as xr, FileZip as Rr, FileVideo as Ir, FileAudio as Tr, FileImage as Nr, FilePpt as kr, FileDoc as Pr, FileCsv as _r, FileXls as Cr, FilePdf as Or, FileMd as jr } from "@phosphor-icons/react";
6
+ var mt = { exports: {} }, qe = {};
7
+ var Nn;
8
+ function Ar() {
9
+ if (Nn) return qe;
10
+ Nn = 1;
11
11
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
12
- function n(r, o, i) {
12
+ function n(r, a, i) {
13
13
  var l = null;
14
- if (i !== void 0 && (l = "" + i), o.key !== void 0 && (l = "" + o.key), "key" in o) {
14
+ if (i !== void 0 && (l = "" + i), a.key !== void 0 && (l = "" + a.key), "key" in a) {
15
15
  i = {};
16
- for (var d in o)
17
- d !== "key" && (i[d] = o[d]);
18
- } else i = o;
19
- return o = i.ref, {
16
+ for (var d in a)
17
+ d !== "key" && (i[d] = a[d]);
18
+ } else i = a;
19
+ return a = i.ref, {
20
20
  $$typeof: e,
21
21
  type: r,
22
22
  key: l,
23
- ref: o !== void 0 ? o : null,
23
+ ref: a !== void 0 ? a : null,
24
24
  props: i
25
25
  };
26
26
  }
27
- return Je.Fragment = t, Je.jsx = n, Je.jsxs = n, Je;
27
+ return qe.Fragment = t, qe.jsx = n, qe.jsxs = n, qe;
28
28
  }
29
- var Ze = {};
30
- var Nn;
31
- function Or() {
32
- return Nn || (Nn = 1, process.env.NODE_ENV !== "production" && (function() {
33
- function e(s) {
34
- if (s == null) return null;
35
- if (typeof s == "function")
36
- return s.$$typeof === W ? null : s.displayName || s.name || null;
37
- if (typeof s == "string") return s;
38
- switch (s) {
39
- case p:
29
+ var Qe = {};
30
+ var kn;
31
+ function Lr() {
32
+ return kn || (kn = 1, process.env.NODE_ENV !== "production" && (function() {
33
+ function e(o) {
34
+ if (o == null) return null;
35
+ if (typeof o == "function")
36
+ return o.$$typeof === M ? null : o.displayName || o.name || null;
37
+ if (typeof o == "string") return o;
38
+ switch (o) {
39
+ case w:
40
40
  return "Fragment";
41
- case M:
41
+ case F:
42
42
  return "Profiler";
43
43
  case v:
44
44
  return "StrictMode";
45
- case F:
45
+ case D:
46
46
  return "Suspense";
47
47
  case $:
48
48
  return "SuspenseList";
49
49
  case J:
50
50
  return "Activity";
51
51
  }
52
- if (typeof s == "object")
53
- switch (typeof s.tag == "number" && console.error(
52
+ if (typeof o == "object")
53
+ switch (typeof o.tag == "number" && console.error(
54
54
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
55
- ), s.$$typeof) {
56
- case m:
55
+ ), o.$$typeof) {
56
+ case p:
57
57
  return "Portal";
58
58
  case C:
59
- return s.displayName || "Context";
59
+ return o.displayName || "Context";
60
60
  case P:
61
- return (s._context.displayName || "Context") + ".Consumer";
62
- case y:
63
- var u = s.render;
64
- return s = s.displayName, s || (s = u.displayName || u.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
61
+ return (o._context.displayName || "Context") + ".Consumer";
62
+ case g:
63
+ var u = o.render;
64
+ return o = o.displayName, o || (o = u.displayName || u.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
65
65
  case O:
66
- return u = s.displayName || null, u !== null ? u : e(s.type) || "Memo";
66
+ return u = o.displayName || null, u !== null ? u : e(o.type) || "Memo";
67
67
  case Q:
68
- u = s._payload, s = s._init;
68
+ u = o._payload, o = o._init;
69
69
  try {
70
- return e(s(u));
70
+ return e(o(u));
71
71
  } catch {
72
72
  }
73
73
  }
74
74
  return null;
75
75
  }
76
- function t(s) {
77
- return "" + s;
76
+ function t(o) {
77
+ return "" + o;
78
78
  }
79
- function n(s) {
79
+ function n(o) {
80
80
  try {
81
- t(s);
81
+ t(o);
82
82
  var u = !1;
83
83
  } catch {
84
84
  u = !0;
85
85
  }
86
86
  if (u) {
87
87
  u = console;
88
- var N = u.error, E = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
89
- return N.call(
88
+ var I = u.error, E = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
89
+ return I.call(
90
90
  u,
91
91
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
92
  E
93
- ), t(s);
93
+ ), t(o);
94
94
  }
95
95
  }
96
- function r(s) {
97
- if (s === p) return "<>";
98
- if (typeof s == "object" && s !== null && s.$$typeof === Q)
96
+ function r(o) {
97
+ if (o === w) return "<>";
98
+ if (typeof o == "object" && o !== null && o.$$typeof === Q)
99
99
  return "<...>";
100
100
  try {
101
- var u = e(s);
101
+ var u = e(o);
102
102
  return u ? "<" + u + ">" : "<...>";
103
103
  } catch {
104
104
  return "<...>";
105
105
  }
106
106
  }
107
- function o() {
108
- var s = Y.A;
109
- return s === null ? null : s.getOwner();
107
+ function a() {
108
+ var o = B.A;
109
+ return o === null ? null : o.getOwner();
110
110
  }
111
111
  function i() {
112
112
  return Error("react-stack-top-frame");
113
113
  }
114
- function l(s) {
115
- if (fe.call(s, "key")) {
116
- var u = Object.getOwnPropertyDescriptor(s, "key").get;
114
+ function l(o) {
115
+ if (me.call(o, "key")) {
116
+ var u = Object.getOwnPropertyDescriptor(o, "key").get;
117
117
  if (u && u.isReactWarning) return !1;
118
118
  }
119
- return s.key !== void 0;
119
+ return o.key !== void 0;
120
120
  }
121
- function d(s, u) {
122
- function N() {
123
- he || (he = !0, console.error(
121
+ function d(o, u) {
122
+ function I() {
123
+ pe || (pe = !0, console.error(
124
124
  "%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)",
125
125
  u
126
126
  ));
127
127
  }
128
- N.isReactWarning = !0, Object.defineProperty(s, "key", {
129
- get: N,
128
+ I.isReactWarning = !0, Object.defineProperty(o, "key", {
129
+ get: I,
130
130
  configurable: !0
131
131
  });
132
132
  }
133
- function b() {
134
- var s = e(this.type);
135
- return V[s] || (V[s] = !0, console.error(
133
+ function h() {
134
+ var o = e(this.type);
135
+ return V[o] || (V[o] = !0, console.error(
136
136
  "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."
137
- )), s = this.props.ref, s !== void 0 ? s : null;
137
+ )), o = this.props.ref, o !== void 0 ? o : null;
138
138
  }
139
- function S(s, u, N, E, ge, T) {
140
- var j = N.ref;
141
- return s = {
142
- $$typeof: g,
143
- type: s,
139
+ function b(o, u, I, E, ve, T) {
140
+ var j = I.ref;
141
+ return o = {
142
+ $$typeof: y,
143
+ type: o,
144
144
  key: u,
145
- props: N,
145
+ props: I,
146
146
  _owner: E
147
- }, (j !== void 0 ? j : null) !== null ? Object.defineProperty(s, "ref", {
147
+ }, (j !== void 0 ? j : null) !== null ? Object.defineProperty(o, "ref", {
148
148
  enumerable: !1,
149
- get: b
150
- }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
149
+ get: h
150
+ }) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
151
151
  configurable: !1,
152
152
  enumerable: !1,
153
153
  writable: !0,
154
154
  value: 0
155
- }), Object.defineProperty(s, "_debugInfo", {
155
+ }), Object.defineProperty(o, "_debugInfo", {
156
156
  configurable: !1,
157
157
  enumerable: !1,
158
158
  writable: !0,
159
159
  value: null
160
- }), Object.defineProperty(s, "_debugStack", {
160
+ }), Object.defineProperty(o, "_debugStack", {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
- value: ge
165
- }), Object.defineProperty(s, "_debugTask", {
164
+ value: ve
165
+ }), Object.defineProperty(o, "_debugTask", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
169
  value: T
170
- }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
170
+ }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
171
171
  }
172
- function w(s, u, N, E, ge, T) {
172
+ function N(o, u, I, E, ve, T) {
173
173
  var j = u.children;
174
174
  if (j !== void 0)
175
175
  if (E)
176
- if (B(j)) {
176
+ if (W(j)) {
177
177
  for (E = 0; E < j.length; E++)
178
- R(j[E]);
178
+ x(j[E]);
179
179
  Object.freeze && Object.freeze(j);
180
180
  } else
181
181
  console.error(
182
182
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
183
183
  );
184
- else R(j);
185
- if (fe.call(u, "key")) {
186
- j = e(s);
187
- var ee = Object.keys(u).filter(function(Ie) {
188
- return Ie !== "key";
184
+ else x(j);
185
+ if (me.call(u, "key")) {
186
+ j = e(o);
187
+ var ee = Object.keys(u).filter(function(Ne) {
188
+ return Ne !== "key";
189
189
  });
190
- E = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", ye[j + E] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
190
+ E = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", be[j + E] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
191
191
  `A props object containing a "key" prop is being spread into JSX:
192
192
  let props = %s;
193
193
  <%s {...props} />
@@ -198,77 +198,77 @@ React keys must be passed directly to JSX without using spread:
198
198
  j,
199
199
  ee,
200
200
  j
201
- ), ye[j + E] = !0);
201
+ ), be[j + E] = !0);
202
202
  }
203
- if (j = null, N !== void 0 && (n(N), j = "" + N), l(u) && (n(u.key), j = "" + u.key), "key" in u) {
204
- N = {};
205
- for (var me in u)
206
- me !== "key" && (N[me] = u[me]);
207
- } else N = u;
203
+ if (j = null, I !== void 0 && (n(I), j = "" + I), l(u) && (n(u.key), j = "" + u.key), "key" in u) {
204
+ I = {};
205
+ for (var ye in u)
206
+ ye !== "key" && (I[ye] = u[ye]);
207
+ } else I = u;
208
208
  return j && d(
209
- N,
210
- typeof s == "function" ? s.displayName || s.name || "Unknown" : s
211
- ), S(
212
- s,
209
+ I,
210
+ typeof o == "function" ? o.displayName || o.name || "Unknown" : o
211
+ ), b(
212
+ o,
213
213
  j,
214
- N,
215
- o(),
216
- ge,
214
+ I,
215
+ a(),
216
+ ve,
217
217
  T
218
218
  );
219
219
  }
220
- function R(s) {
221
- k(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === Q && (s._payload.status === "fulfilled" ? k(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
220
+ function x(o) {
221
+ k(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === Q && (o._payload.status === "fulfilled" ? k(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
222
222
  }
223
- function k(s) {
224
- return typeof s == "object" && s !== null && s.$$typeof === g;
223
+ function k(o) {
224
+ return typeof o == "object" && o !== null && o.$$typeof === y;
225
225
  }
226
- var h = fr, g = /* @__PURE__ */ Symbol.for("react.transitional.element"), m = /* @__PURE__ */ Symbol.for("react.portal"), p = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), M = /* @__PURE__ */ Symbol.for("react.profiler"), P = /* @__PURE__ */ Symbol.for("react.consumer"), C = /* @__PURE__ */ Symbol.for("react.context"), y = /* @__PURE__ */ Symbol.for("react.forward_ref"), F = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), Q = /* @__PURE__ */ Symbol.for("react.lazy"), J = /* @__PURE__ */ Symbol.for("react.activity"), W = /* @__PURE__ */ Symbol.for("react.client.reference"), Y = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, fe = Object.prototype.hasOwnProperty, B = Array.isArray, oe = console.createTask ? console.createTask : function() {
226
+ var m = pr, y = /* @__PURE__ */ Symbol.for("react.transitional.element"), p = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), F = /* @__PURE__ */ Symbol.for("react.profiler"), P = /* @__PURE__ */ Symbol.for("react.consumer"), C = /* @__PURE__ */ Symbol.for("react.context"), g = /* @__PURE__ */ Symbol.for("react.forward_ref"), D = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), Q = /* @__PURE__ */ Symbol.for("react.lazy"), J = /* @__PURE__ */ Symbol.for("react.activity"), M = /* @__PURE__ */ Symbol.for("react.client.reference"), B = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, me = Object.prototype.hasOwnProperty, W = Array.isArray, oe = console.createTask ? console.createTask : function() {
227
227
  return null;
228
228
  };
229
- h = {
230
- react_stack_bottom_frame: function(s) {
231
- return s();
229
+ m = {
230
+ react_stack_bottom_frame: function(o) {
231
+ return o();
232
232
  }
233
233
  };
234
- var he, V = {}, K = h.react_stack_bottom_frame.bind(
235
- h,
234
+ var pe, V = {}, X = m.react_stack_bottom_frame.bind(
235
+ m,
236
236
  i
237
- )(), we = oe(r(i)), ye = {};
238
- Ze.Fragment = p, Ze.jsx = function(s, u, N) {
239
- var E = 1e4 > Y.recentlyCreatedOwnerStacks++;
240
- return w(
241
- s,
237
+ )(), xe = oe(r(i)), be = {};
238
+ Qe.Fragment = w, Qe.jsx = function(o, u, I) {
239
+ var E = 1e4 > B.recentlyCreatedOwnerStacks++;
240
+ return N(
241
+ o,
242
242
  u,
243
- N,
243
+ I,
244
244
  !1,
245
- E ? Error("react-stack-top-frame") : K,
246
- E ? oe(r(s)) : we
245
+ E ? Error("react-stack-top-frame") : X,
246
+ E ? oe(r(o)) : xe
247
247
  );
248
- }, Ze.jsxs = function(s, u, N) {
249
- var E = 1e4 > Y.recentlyCreatedOwnerStacks++;
250
- return w(
251
- s,
248
+ }, Qe.jsxs = function(o, u, I) {
249
+ var E = 1e4 > B.recentlyCreatedOwnerStacks++;
250
+ return N(
251
+ o,
252
252
  u,
253
- N,
253
+ I,
254
254
  !0,
255
- E ? Error("react-stack-top-frame") : K,
256
- E ? oe(r(s)) : we
255
+ E ? Error("react-stack-top-frame") : X,
256
+ E ? oe(r(o)) : xe
257
257
  );
258
258
  };
259
- })()), Ze;
259
+ })()), Qe;
260
260
  }
261
- var Tn;
262
- function jr() {
263
- return Tn || (Tn = 1, process.env.NODE_ENV === "production" ? ft.exports = Cr() : ft.exports = Or()), ft.exports;
261
+ var Pn;
262
+ function Dr() {
263
+ return Pn || (Pn = 1, process.env.NODE_ENV === "production" ? mt.exports = Ar() : mt.exports = Lr()), mt.exports;
264
264
  }
265
- var f = jr();
266
- function Ar({
265
+ var f = Dr();
266
+ function $r({
267
267
  title: e,
268
268
  titleId: t,
269
269
  ...n
270
270
  }, r) {
271
- return /* @__PURE__ */ ue.createElement("svg", Object.assign({
271
+ return /* @__PURE__ */ he.createElement("svg", Object.assign({
272
272
  xmlns: "http://www.w3.org/2000/svg",
273
273
  viewBox: "0 0 24 24",
274
274
  fill: "currentColor",
@@ -276,21 +276,21 @@ function Ar({
276
276
  "data-slot": "icon",
277
277
  ref: r,
278
278
  "aria-labelledby": t
279
- }, n), e ? /* @__PURE__ */ ue.createElement("title", {
279
+ }, n), e ? /* @__PURE__ */ he.createElement("title", {
280
280
  id: t
281
- }, e) : null, /* @__PURE__ */ ue.createElement("path", {
281
+ }, e) : null, /* @__PURE__ */ he.createElement("path", {
282
282
  fillRule: "evenodd",
283
283
  d: "M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z",
284
284
  clipRule: "evenodd"
285
285
  }));
286
286
  }
287
- const Lr = /* @__PURE__ */ ue.forwardRef(Ar);
288
- function Dr({
287
+ const Fr = /* @__PURE__ */ he.forwardRef($r);
288
+ function zr({
289
289
  title: e,
290
290
  titleId: t,
291
291
  ...n
292
292
  }, r) {
293
- return /* @__PURE__ */ ue.createElement("svg", Object.assign({
293
+ return /* @__PURE__ */ he.createElement("svg", Object.assign({
294
294
  xmlns: "http://www.w3.org/2000/svg",
295
295
  viewBox: "0 0 24 24",
296
296
  fill: "currentColor",
@@ -298,21 +298,21 @@ function Dr({
298
298
  "data-slot": "icon",
299
299
  ref: r,
300
300
  "aria-labelledby": t
301
- }, n), e ? /* @__PURE__ */ ue.createElement("title", {
301
+ }, n), e ? /* @__PURE__ */ he.createElement("title", {
302
302
  id: t
303
- }, e) : null, /* @__PURE__ */ ue.createElement("path", {
303
+ }, e) : null, /* @__PURE__ */ he.createElement("path", {
304
304
  fillRule: "evenodd",
305
305
  d: "M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",
306
306
  clipRule: "evenodd"
307
307
  }));
308
308
  }
309
- const Fr = /* @__PURE__ */ ue.forwardRef(Dr);
310
- function $r({
309
+ const Mr = /* @__PURE__ */ he.forwardRef(zr);
310
+ function Hr({
311
311
  title: e,
312
312
  titleId: t,
313
313
  ...n
314
314
  }, r) {
315
- return /* @__PURE__ */ ue.createElement("svg", Object.assign({
315
+ return /* @__PURE__ */ he.createElement("svg", Object.assign({
316
316
  xmlns: "http://www.w3.org/2000/svg",
317
317
  viewBox: "0 0 24 24",
318
318
  fill: "currentColor",
@@ -320,41 +320,62 @@ function $r({
320
320
  "data-slot": "icon",
321
321
  ref: r,
322
322
  "aria-labelledby": t
323
- }, n), e ? /* @__PURE__ */ ue.createElement("title", {
323
+ }, n), e ? /* @__PURE__ */ he.createElement("title", {
324
324
  id: t
325
- }, e) : null, /* @__PURE__ */ ue.createElement("path", {
325
+ }, e) : null, /* @__PURE__ */ he.createElement("path", {
326
326
  d: "M19.5 21a3 3 0 0 0 3-3v-4.5a3 3 0 0 0-3-3h-15a3 3 0 0 0-3 3V18a3 3 0 0 0 3 3h15ZM1.5 10.146V6a3 3 0 0 1 3-3h5.379a2.25 2.25 0 0 1 1.59.659l2.122 2.121c.14.141.331.22.53.22H19.5a3 3 0 0 1 3 3v1.146A4.483 4.483 0 0 0 19.5 9h-15a4.483 4.483 0 0 0-3 1.146Z"
327
327
  }));
328
328
  }
329
- const Mr = /* @__PURE__ */ ue.forwardRef($r), Mn = "text-[length:var(--dt-font-size-body,0.8125rem)]", zr = `${Mn} leading-[max(var(--dt-line-height-body,1.25rem),1.5em)]`, _t = 44, Wr = 12, Hr = 8, ce = 14, Br = 14, zn = (e) => e === void 0 ? void 0 : { fontSize: typeof e == "number" ? `${e}px` : e }, ae = (e) => ({ width: e, height: e }), D = {
330
- container: "directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",
331
- containerPending: "opacity-70",
329
+ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Hn = "#71829b", ce = {
330
+ rowHover: "hover:bg-[color:light-dark(#f3f4f6,#1e2939)]",
331
+ rowSelected: "bg-[color:light-dark(#eff6ff,#162456)]",
332
+ checkedRing: "inset-ring-1 inset-ring-[color:light-dark(#155dfc,#51a2ff)]",
333
+ name: "text-[color:light-dark(#364153,#e5e7eb)]",
334
+ nameSelected: "text-[color:light-dark(#193cb8,#bedbff)]",
335
+ gridEdge: "text-[color:light-dark(#4a5565,#d1d5dc)]",
336
+ icon: "text-[color:light-dark(#6a7282,#99a1af)]",
337
+ iconSelected: "text-[color:light-dark(#1447e6,#51a2ff)]"
338
+ }, ue = {
339
+ markdown: "text-[color:light-dark(#0084d1,#00bcff)]",
340
+ pdf: "text-[color:light-dark(#e7000b,#ff6467)]",
341
+ spreadsheet: "text-[color:light-dark(#009966,#00d492)]",
342
+ csv: "text-[color:light-dark(#009966,#00d492)]",
343
+ document: "text-[color:light-dark(#155dfc,#51a2ff)]",
344
+ presentation: "text-[color:light-dark(#f54900,#ff8904)]",
345
+ image: "text-[color:light-dark(#009689,#00d5be)]",
346
+ audio: "text-[color:light-dark(#e60076,#fb64b6)]",
347
+ video: "text-[color:light-dark(#7f22fe,#a684ff)]",
348
+ archive: "text-[color:light-dark(#bb4d00,#ffb900)]",
349
+ code: "text-[color:light-dark(#9810fa,#c27aff)]",
350
+ text: "text-[color:light-dark(#6a7282,#99a1af)]"
351
+ }, Wn = "text-[length:var(--dt-font-size-body,0.8125rem)]", Br = `${Wn} leading-[max(var(--dt-line-height-body,1.25rem),1.5em)]`, Ot = 44, Yr = 12, Gr = 8, de = 14, Vr = 14, Bn = (e) => e === void 0 ? void 0 : { fontSize: typeof e == "number" ? `${e}px` : e }, ae = (e) => ({ width: e, height: e }), L = {
352
+ container: "directory-tree-container relative h-full overflow-y-hidden pb-[3px] pr-[2px]",
353
+ // 保留中も薄めない。薄めた文字と印は地と混ざり、配色表の組の対比 (文字 7:1・印 3:1) を割る
354
+ containerPending: "cursor-progress",
332
355
  // 行は itemHeight の固定の箱で中身を縦の中央に置くため、上下の詰め物は行の高さを中身から奪うだけになる
333
356
  // (行の中に置いたホストのボタンが行の高さいっぱいの的にならない)
334
- entry: `directory-tree-entry flex items-center cursor-pointer relative select-none ${zr}`,
335
- // ホバー時のスタイル(ライト/ダークモード対応)
336
- entryHover: L("directory-tree-entry--hover hover:bg-gray-400/15", "dark:hover:bg-gray-200/10"),
337
- // 選択時のスタイル(ライト/ダークモード対応)
338
- entrySelected: L("directory-tree-entry--selected bg-blue-400/10", "dark:bg-blue-400/15"),
339
- // アイテム選択時のスタイル(ライト/ダークモード対応)
340
- entryItemSelected: L("directory-tree-entry--item-selected bg-blue-400/20 shadow-[0_0_0_1px_rgba(59,130,246,0.3)]", "dark:bg-blue-400/25 dark:shadow-[0_0_0_1px_rgba(96,165,250,0.4)]"),
357
+ entry: `directory-tree-entry flex items-center cursor-pointer relative select-none ${Br}`,
358
+ entryHover: `directory-tree-entry--hover ${ce.rowHover}`,
359
+ entrySelected: `directory-tree-entry--selected ${ce.rowSelected}`,
360
+ // 輪は行の内側に描く。外側の輪は、後に描く隣の行の不透明な地 (ホバーや選択) に覆われる
361
+ entryItemSelected: `directory-tree-entry--item-selected ${ce.rowSelected} ${ce.checkedRing}`,
341
362
  // 箱の大きさはクラスでなく EXPAND_BOX_SIZE から行が付ける (ツリーラインのジオメトリが印を置く箱と同じ値を読むため)
342
- expandIcon: L("directory-tree-expand-icon flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
343
- expandIconSelected: L("directory-tree-expand-icon--selected text-blue-700", "dark:text-blue-400"),
363
+ expandIcon: `directory-tree-expand-icon flex-shrink-0 flex items-center justify-center ${ce.icon}`,
364
+ expandIconSelected: `directory-tree-expand-icon--selected ${ce.iconSelected}`,
344
365
  // 箱の大きさはクラスでなく visual.typeIconSize から行が付ける (ツリーラインのジオメトリと同じ値を読むため)
345
- typeIcon: L("directory-tree-type-icon flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
346
- typeIconSelected: L("directory-tree-type-icon--selected text-blue-700", "dark:text-blue-400"),
366
+ typeIcon: `directory-tree-type-icon flex-shrink-0 flex items-center justify-center ${ce.icon}`,
367
+ typeIconSelected: `directory-tree-type-icon--selected ${ce.iconSelected}`,
347
368
  // 文字の行の高さ (line-height) は行 (entry) の body の行を受け継ぐため、名前には文字の大きさだけを付ける
348
- name: L(`directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 ${Mn} font-normal`, "text-gray-700", "dark:text-gray-200"),
369
+ name: `directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 ${Wn} font-normal ${ce.name}`,
349
370
  nameDirectory: "directory-tree-name--directory font-medium",
350
- nameSelected: L("directory-tree-name--selected text-blue-800 font-semibold", "dark:text-blue-300")
351
- }, Ft = (e) => {
371
+ nameSelected: `directory-tree-name--selected font-semibold ${ce.nameSelected}`
372
+ }, zt = (e) => {
352
373
  const t = e.slice(e.lastIndexOf("/") + 1), n = t.lastIndexOf(".");
353
374
  return n <= 0 ? "" : t.slice(n + 1).toLowerCase();
354
- }, Yr = /^[a-z][a-z\d+.-]*:\/\//i, kn = (e) => Ft(Yr.test(e) ? e.split(/[?#]/, 1)[0] : e), Wn = (e) => Ft(e.name) || kn(e.relativePath) || kn(e.absolutePath), Hn = ({ isDirectory: e, isExpanded: t, showExpandIcons: n, useCanvasExpandIcons: r, expandIconSize: o }) => {
355
- const i = o ? { width: o, height: o } : void 0, l = o ? "" : "h-4 w-4";
356
- return !(n && e) || r ? /* @__PURE__ */ f.jsx("span", { className: l, style: i, "aria-hidden": "true" }) : t ? /* @__PURE__ */ f.jsx(Lr, { className: l, style: i }) : /* @__PURE__ */ f.jsx(Fr, { className: l, style: i });
357
- }, Ot = (e, t) => {
375
+ }, Xr = /^[a-z][a-z\d+.-]*:\/\//i, _n = (e) => zt(Xr.test(e) ? e.split(/[?#]/, 1)[0] : e), Yn = (e) => zt(e.name) || _n(e.relativePath) || _n(e.absolutePath), Gn = ({ isDirectory: e, isExpanded: t, showExpandIcons: n, useCanvasExpandIcons: r, expandIconSize: a }) => {
376
+ const i = a ? { width: a, height: a } : void 0, l = a ? "" : "h-4 w-4";
377
+ return !(n && e) || r ? /* @__PURE__ */ f.jsx("span", { className: l, style: i, "aria-hidden": "true" }) : t ? /* @__PURE__ */ f.jsx(Fr, { className: l, style: i }) : /* @__PURE__ */ f.jsx(Mr, { className: l, style: i });
378
+ }, At = (e, t) => {
358
379
  if (e == null || typeof e == "boolean") return null;
359
380
  if (typeof e == "function")
360
381
  return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`), null;
@@ -362,7 +383,7 @@ const Mr = /* @__PURE__ */ ue.forwardRef($r), Mn = "text-[length:var(--dt-font-s
362
383
  if ("then" in e)
363
384
  return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`), null;
364
385
  if (Array.isArray(e)) {
365
- const r = e.map((o) => Ot(o, t)).filter(Boolean);
386
+ const r = e.map((a) => At(a, t)).filter(Boolean);
366
387
  return r.length ? r : null;
367
388
  }
368
389
  const n = e.type;
@@ -370,20 +391,20 @@ const Mr = /* @__PURE__ */ ue.forwardRef($r), Mn = "text-[length:var(--dt-font-s
370
391
  return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`), null;
371
392
  }
372
393
  return e;
373
- }, Gr = {
374
- markdown: (e) => /* @__PURE__ */ f.jsx(_r, { className: "text-sky-500 dark:text-sky-400", style: ae(e) }),
375
- pdf: (e) => /* @__PURE__ */ f.jsx(Pr, { className: "text-red-500 dark:text-red-400", style: ae(e) }),
376
- spreadsheet: (e) => /* @__PURE__ */ f.jsx(kr, { className: "text-emerald-600 dark:text-emerald-400", style: ae(e) }),
377
- csv: (e) => /* @__PURE__ */ f.jsx(Tr, { className: "text-emerald-600 dark:text-emerald-400", style: ae(e) }),
378
- document: (e) => /* @__PURE__ */ f.jsx(Nr, { className: "text-blue-600 dark:text-blue-400", style: ae(e) }),
379
- presentation: (e) => /* @__PURE__ */ f.jsx(Ir, { className: "text-orange-500 dark:text-orange-400", style: ae(e) }),
380
- image: (e) => /* @__PURE__ */ f.jsx(Rr, { className: "text-teal-500 dark:text-teal-400", style: ae(e) }),
381
- audio: (e) => /* @__PURE__ */ f.jsx(Er, { className: "text-pink-500 dark:text-pink-400", style: ae(e) }),
382
- video: (e) => /* @__PURE__ */ f.jsx(xr, { className: "text-violet-500 dark:text-violet-400", style: ae(e) }),
383
- archive: (e) => /* @__PURE__ */ f.jsx(wr, { className: "text-amber-500 dark:text-amber-400", style: ae(e) }),
384
- code: (e) => /* @__PURE__ */ f.jsx(Sr, { className: "text-purple-500 dark:text-purple-400", style: ae(e) }),
385
- text: (e) => /* @__PURE__ */ f.jsx(vr, { className: "text-gray-500 dark:text-gray-400", style: ae(e) })
386
- }, Xr = {
394
+ }, Kr = {
395
+ markdown: (e) => /* @__PURE__ */ f.jsx(jr, { className: ue.markdown, style: ae(e) }),
396
+ pdf: (e) => /* @__PURE__ */ f.jsx(Or, { className: ue.pdf, style: ae(e) }),
397
+ spreadsheet: (e) => /* @__PURE__ */ f.jsx(Cr, { className: ue.spreadsheet, style: ae(e) }),
398
+ csv: (e) => /* @__PURE__ */ f.jsx(_r, { className: ue.csv, style: ae(e) }),
399
+ document: (e) => /* @__PURE__ */ f.jsx(Pr, { className: ue.document, style: ae(e) }),
400
+ presentation: (e) => /* @__PURE__ */ f.jsx(kr, { className: ue.presentation, style: ae(e) }),
401
+ image: (e) => /* @__PURE__ */ f.jsx(Nr, { className: ue.image, style: ae(e) }),
402
+ audio: (e) => /* @__PURE__ */ f.jsx(Tr, { className: ue.audio, style: ae(e) }),
403
+ video: (e) => /* @__PURE__ */ f.jsx(Ir, { className: ue.video, style: ae(e) }),
404
+ archive: (e) => /* @__PURE__ */ f.jsx(Rr, { className: ue.archive, style: ae(e) }),
405
+ code: (e) => /* @__PURE__ */ f.jsx(xr, { className: ue.code, style: ae(e) }),
406
+ text: (e) => /* @__PURE__ */ f.jsx(Er, { className: ue.text, style: ae(e) })
407
+ }, Ur = {
387
408
  markdown: ["md", "markdown", "mdx"],
388
409
  pdf: ["pdf"],
389
410
  spreadsheet: ["xls", "xlsx", "xlsm", "xlsb", "ods"],
@@ -396,7 +417,7 @@ const Mr = /* @__PURE__ */ ue.forwardRef($r), Mn = "text-[length:var(--dt-font-s
396
417
  archive: ["zip", "tar", "gz", "7z", "rar", "tgz", "bz2"],
397
418
  code: ["js", "mjs", "cjs", "ts", "tsx", "jsx", "json", "html", "htm", "css", "scss", "py", "go", "rs", "c", "cpp", "h", "hpp", "sh", "bash", "yaml", "yml", "sql", "xml", "toml"],
398
419
  text: ["txt", "log"]
399
- }, Vr = new Map(Object.entries(Xr).flatMap(([e, t]) => t.map((n) => [n, e]))), Kr = /* @__PURE__ */ new Set(["", "application/octet-stream", "binary/octet-stream", "text/plain", "application/x-empty"]), Ur = (e) => (e ?? "").split(";", 1)[0].trim().toLowerCase(), Jr = (e) => {
420
+ }, Jr = new Map(Object.entries(Ur).flatMap(([e, t]) => t.map((n) => [n, e]))), Zr = /* @__PURE__ */ new Set(["", "application/octet-stream", "binary/octet-stream", "text/plain", "application/x-empty"]), qr = (e) => (e ?? "").split(";", 1)[0].trim().toLowerCase(), Qr = (e) => {
400
421
  if (e === "text/markdown" || e === "text/x-markdown") return "markdown";
401
422
  if (e === "application/pdf") return "pdf";
402
423
  if (e.includes("excel") || e.includes("spreadsheet")) return "spreadsheet";
@@ -410,21 +431,21 @@ const Mr = /* @__PURE__ */ ue.forwardRef($r), Mn = "text-[length:var(--dt-font-s
410
431
  if (e === "application/json" || e.includes("javascript") || e.includes("typescript") || e.includes("xml") || e.startsWith("text/html") || e.startsWith("text/css") || e.includes("x-python") || e.includes("x-sh") || e.includes("x-go") || e.includes("x-rust"))
411
432
  return "code";
412
433
  if (e.startsWith("text/")) return "text";
413
- }, Zr = (e, t, n, r) => {
414
- const o = Ur(e), i = Jr(o), l = Vr.get((t || (n ? Ft(n) : "")).toLowerCase()), b = (Kr.has(o) ? [l, i] : [i, l]).find((S) => S !== void 0);
415
- return b === void 0 ? /* @__PURE__ */ f.jsx(br, { className: "text-gray-400 dark:text-gray-400", style: ae(r) }) : Gr[b](r);
416
- }, Bn = (e, t, n) => {
417
- const { entry: r, isDirectory: o, isExpanded: i, extension: l, mimeType: d } = e;
418
- let b;
419
- const S = d || r.mimeType;
420
- return r.icon !== void 0 ? b = r.icon : o ? b = i && t?.directoryExpanded || t?.directory || /* @__PURE__ */ f.jsx(Mr, { style: ae(n) }) : l && t?.fileByExtension?.[l] ? b = t.fileByExtension[l] : b = t?.file || Zr(S, l, r.name, n), Ot(typeof b == "function" ? b(e) : b, r.absolutePath);
421
- }, qr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Yn = (e) => {
434
+ }, eo = (e, t, n, r) => {
435
+ const a = qr(e), i = Qr(a), l = Jr.get((t || (n ? zt(n) : "")).toLowerCase()), h = (Zr.has(a) ? [l, i] : [i, l]).find((b) => b !== void 0);
436
+ return h === void 0 ? /* @__PURE__ */ f.jsx(wr, { className: ce.icon, style: ae(r) }) : Kr[h](r);
437
+ }, Vn = (e, t, n) => {
438
+ const { entry: r, isDirectory: a, isExpanded: i, extension: l, mimeType: d } = e;
439
+ let h;
440
+ const b = d || r.mimeType;
441
+ return r.icon !== void 0 ? h = r.icon : a ? h = i && t?.directoryExpanded || t?.directory || /* @__PURE__ */ f.jsx(Wr, { style: ae(n) }) : l && t?.fileByExtension?.[l] ? h = t.fileByExtension[l] : h = t?.file || eo(b, l, r.name, n), At(typeof h == "function" ? h(e) : h, r.absolutePath);
442
+ }, to = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Xn = (e) => {
422
443
  if (!e)
423
444
  return;
424
445
  const t = Object.entries(e).filter(([, n]) => n != null);
425
446
  if (t.length !== 0)
426
- return Object.fromEntries(t.map(([n, r]) => [`data-${qr(n)}`, String(r)]));
427
- }, Qr = [
447
+ return Object.fromEntries(t.map(([n, r]) => [`data-${to(n)}`, String(r)]));
448
+ }, no = [
428
449
  // 塗り: 箱の大きさと位置を変えずに行の面・縁・指す形だけを描く (アウトラインと影は箱の外に描かれ、場所を取らない)
429
450
  "color",
430
451
  "background",
@@ -471,160 +492,160 @@ const Mr = /* @__PURE__ */ ue.forwardRef($r), Mn = "text-[length:var(--dt-font-s
471
492
  "textDecorationThickness",
472
493
  "textUnderlineOffset",
473
494
  "textTransform"
474
- ], eo = ["color", "opacity"], to = "the row's box belongs to the tree (height: visual.itemHeight, indent: visual.indentSize, icons: visual.typeIconSize, text size: visual.fontSize)", no = new Set(Qr), ro = new Set(eo), Pn = (e, t) => {
495
+ ], ro = ["color", "opacity"], oo = "the row's box belongs to the tree (height: visual.itemHeight, indent: visual.indentSize, icons: visual.typeIconSize, text size: visual.fontSize)", so = new Set(no), ao = new Set(ro), Cn = (e, t) => {
475
496
  const n = t === void 0 ? e.option : `${e.option}.${t}`;
476
497
  return e.absolutePath === void 0 ? n : `${n} of "${e.absolutePath}"`;
477
- }, Gn = (e, t, n, r) => {
498
+ }, Kn = (e, t, n, r) => {
478
499
  if (e !== void 0) {
479
500
  if (typeof e != "object" || e === null)
480
- throw new RangeError(`${Pn(n, void 0)} must be an object of CSS properties or undefined, got ${e === null ? "null" : typeof e}.`);
481
- for (const [o, i] of Object.entries(e))
482
- if (i !== void 0 && !t.has(o))
483
- throw new RangeError(`${Pn(n, o)} cannot be set: ${to}, so ${r}.`);
501
+ throw new RangeError(`${Cn(n, void 0)} must be an object of CSS properties or undefined, got ${e === null ? "null" : typeof e}.`);
502
+ for (const [a, i] of Object.entries(e))
503
+ if (i !== void 0 && !t.has(a))
504
+ throw new RangeError(`${Cn(n, a)} cannot be set: ${oo}, so ${r}.`);
484
505
  }
485
- }, Be = (e, t) => Gn(e, no, t, "a row style accepts only paint and text properties (ROW_STYLE_PROPERTIES)"), oo = (e, t) => Gn(e, ro, t, "the expand icon style accepts only the glyph's colour and opacity (EXPAND_ICON_STYLE_PROPERTIES), and the 14 px expand box is the tree's"), so = 500, Xn = ({ entry: e, isDirectory: t, isExpanded: n, isItemSelected: r, selectionMode: o, onSelectionChange: i, onEntryClick: l, toggleDirectory: d, onToggleDirectoryRecursive: b }) => {
486
- const S = G(null);
487
- return Ae(
506
+ }, Ge = (e, t) => Kn(e, so, t, "a row style accepts only paint and text properties (ROW_STYLE_PROPERTIES)"), io = (e, t) => Kn(e, ao, t, "the expand icon style accepts only the glyph's colour and opacity (EXPAND_ICON_STYLE_PROPERTIES), and the 14 px expand box is the tree's"), lo = 500, Un = ({ entry: e, isDirectory: t, isExpanded: n, isItemSelected: r, selectionMode: a, onSelectionChange: i, onEntryClick: l, toggleDirectory: d, onToggleDirectoryRecursive: h }) => {
507
+ const b = Y(null);
508
+ return De(
488
509
  () => () => {
489
- S.current && window.clearTimeout(S.current);
510
+ b.current && window.clearTimeout(b.current);
490
511
  },
491
512
  []
492
513
  ), _(
493
- (w) => {
494
- w.stopPropagation(), o !== "none" && !t && i && i(e, !r);
495
- let R = !1;
514
+ (N) => {
515
+ N.stopPropagation(), a !== "none" && !t && i && i(e, !r);
516
+ let x = !1;
496
517
  l({
497
518
  entry: e,
498
519
  isDirectory: t,
499
520
  isExpanded: n,
500
521
  preventDefault: () => {
501
- R = !0;
522
+ x = !0;
502
523
  }
503
- }), !(!t || R) && (S.current ? (window.clearTimeout(S.current), S.current = null, b(e)) : S.current = window.setTimeout(() => {
504
- d(e.absolutePath), S.current = null;
505
- }, so));
524
+ }), !(!t || x) && (b.current ? (window.clearTimeout(b.current), b.current = null, h(e)) : b.current = window.setTimeout(() => {
525
+ d(e.absolutePath), b.current = null;
526
+ }, lo));
506
527
  },
507
- [t, e, n, b, d, l, o, i, r]
528
+ [t, e, n, h, d, l, a, i, r]
508
529
  );
509
- }, Vn = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", _n = (e, t) => e.children !== void 0 && t(e.absolutePath), Kn = (e, t) => ({
530
+ }, Jn = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", On = (e, t) => e.children !== void 0 && t(e.absolutePath), Zn = (e, t) => ({
510
531
  width: e,
511
532
  gridTemplateColumns: t
512
- }), Un = Dt(
533
+ }), qn = Ft(
513
534
  ({
514
535
  entry: e,
515
536
  indentLevel: t,
516
537
  positionInSet: n,
517
538
  setSize: r,
518
- rowIndex: o,
539
+ rowIndex: a,
519
540
  flatIndex: i,
520
541
  onRowFocus: l,
521
542
  onRowBlur: d,
522
- isSelectedForAria: b,
523
- rowHeight: S,
524
- isDirOpen: w,
525
- columns: R,
543
+ isSelectedForAria: h,
544
+ rowHeight: b,
545
+ isDirOpen: N,
546
+ columns: x,
526
547
  numericTemplate: k,
527
- numericTotal: h,
528
- nameWidth: g,
529
- rowClassName: m,
530
- selection: { onEntryClick: p, selectedPath: v, currentPath: M, mode: P = "none", selectedItems: C, onSelectionChange: y },
531
- expansion: { toggleDirectory: F, onToggleDirectoryRecursive: $ },
532
- visual: { iconOverrides: O, showExpandIcons: Q = !0, showDirectoryIcons: J = !0, showFileIcons: W = !0, useCanvasExpandIcons: Y = !1, expandIconSize: fe, typeIconSize: B, fontSize: oe, indentSize: he, highlightStyles: V, expandIconClassName: K, expandIconStyle: we }
548
+ numericTotal: m,
549
+ nameWidth: y,
550
+ rowClassName: p,
551
+ selection: { onEntryClick: w, selectedPath: v, currentPath: F, mode: P = "none", selectedItems: C, onSelectionChange: g },
552
+ expansion: { toggleDirectory: D, onToggleDirectoryRecursive: $ },
553
+ visual: { iconOverrides: O, showExpandIcons: Q = !0, showDirectoryIcons: J = !0, showFileIcons: M = !0, useCanvasExpandIcons: B = !1, expandIconSize: me, typeIconSize: W, fontSize: oe, indentSize: pe, highlightStyles: V, expandIconClassName: X, expandIconStyle: xe }
533
554
  }) => {
534
- Be(e.style, { option: "entry.style", absolutePath: e.absolutePath });
535
- const [ye, s] = de(!1), u = e.children !== void 0, N = u && w(e.absolutePath), E = e.absolutePath === v, ge = e.absolutePath === M, T = !u && !!C?.has(e.absolutePath), j = u ? void 0 : Wn(e), ee = Xn({ entry: e, isDirectory: u, isExpanded: N, isItemSelected: T, selectionMode: P, onSelectionChange: y, onEntryClick: p, toggleDirectory: F, onToggleDirectoryRecursive: $ }), me = ye ? V?.hoverClassName !== void 0 ? V.hoverClassName : D.entryHover : "", Ie = (() => {
555
+ Ge(e.style, { option: "entry.style", absolutePath: e.absolutePath });
556
+ const [be, o] = fe(!1), u = e.children !== void 0, I = u && N(e.absolutePath), E = e.absolutePath === v, ve = e.absolutePath === F, T = !u && !!C?.has(e.absolutePath), j = u ? void 0 : Yn(e), ee = Un({ entry: e, isDirectory: u, isExpanded: I, isItemSelected: T, selectionMode: P, onSelectionChange: g, onEntryClick: w, toggleDirectory: D, onToggleDirectoryRecursive: $ }), ye = be ? V?.hoverClassName !== void 0 ? V.hoverClassName : L.entryHover : "", Ne = (() => {
536
557
  if (u) {
537
- if (E) return V?.directorySelectedClassName !== void 0 ? V.directorySelectedClassName : D.entrySelected;
558
+ if (E) return V?.directorySelectedClassName !== void 0 ? V.directorySelectedClassName : L.entrySelected;
538
559
  } else if (E || T)
539
- return V?.itemSelectedClassName !== void 0 ? V.itemSelectedClassName : L(E && D.entrySelected, T && D.entryItemSelected);
560
+ return V?.itemSelectedClassName !== void 0 ? V.itemSelectedClassName : U(E && L.entrySelected, T && L.entryItemSelected);
540
561
  return "";
541
- })(), A = typeof m == "function" ? m(e) : m, be = L("dt-grid-row cursor-pointer select-none", me, Ie, A, e.className), Z = L(D.expandIcon, K, (E || T) && D.expandIconSelected), Le = L(D.typeIcon, (E || T) && D.typeIconSelected), se = L("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", u && D.nameDirectory, (E || T) && D.nameSelected), te = Hn({ isDirectory: u, isExpanded: N, showExpandIcons: Q, useCanvasExpandIcons: Y, expandIconSize: fe }), le = (u ? J : W) ? Bn({ entry: e, isDirectory: u, isExpanded: N, isSelected: E, isItemSelected: T, extension: j, mimeType: e.mimeType }, O, B) : null, Ne = { indentLevel: t, isDirectory: u, isExpanded: N }, [_e, ...Te] = R, De = _e?.render ? _e.render(e, Ne) : e.label ?? e.name, xe = {
542
- ...ye ? V?.hoverStyle : {},
562
+ })(), A = typeof p == "function" ? p(e) : p, Se = U("dt-grid-row cursor-pointer select-none", ye, Ne, A, e.className), Z = U(L.expandIcon, X, (E || T) && L.expandIconSelected), $e = U(L.typeIcon, (E || T) && L.typeIconSelected), se = U("dt-grid-name-label ml-1", ce.name, u && L.nameDirectory, (E || T) && L.nameSelected), te = Gn({ isDirectory: u, isExpanded: I, showExpandIcons: Q, useCanvasExpandIcons: B, expandIconSize: me }), ie = (u ? J : M) ? Vn({ entry: e, isDirectory: u, isExpanded: I, isSelected: E, isItemSelected: T, extension: j, mimeType: e.mimeType }, O, W) : null, ke = { indentLevel: t, isDirectory: u, isExpanded: I }, [Oe, ...Pe] = x, Fe = Oe?.render ? Oe.render(e, ke) : e.label ?? e.name, Re = {
563
+ ...be ? V?.hoverStyle : {},
543
564
  ...u && E ? V?.directorySelectedStyle : {},
544
565
  ...!u && (E || T) ? V?.itemSelectedStyle : {}
545
566
  };
546
567
  return /* @__PURE__ */ f.jsxs(
547
568
  "div",
548
569
  {
549
- className: be,
550
- style: { ...xe, ...e.style, height: S },
570
+ className: Se,
571
+ style: { ...Re, ...e.style, height: b },
551
572
  role: "row",
552
- "aria-expanded": u ? N : void 0,
573
+ "aria-expanded": u ? I : void 0,
553
574
  "aria-level": t + 1,
554
575
  "aria-posinset": n,
555
576
  "aria-setsize": r,
556
- "aria-rowindex": o,
557
- "aria-selected": P === "none" ? void 0 : b,
558
- "aria-current": ge ? "page" : void 0,
559
- ...Yn(e.data),
577
+ "aria-rowindex": a,
578
+ "aria-selected": P === "none" ? void 0 : h,
579
+ "aria-current": ve ? "page" : void 0,
580
+ ...Xn(e.data),
560
581
  "data-entry-type": u ? "directory" : "file",
561
- "data-entry-expanded": u ? String(N) : void 0,
582
+ "data-entry-expanded": u ? String(I) : void 0,
562
583
  "data-entry-selected": E ? "true" : void 0,
563
584
  "data-entry-item-selected": T ? "true" : void 0,
564
585
  onClick: ee,
565
- onMouseEnter: () => s(!0),
566
- onMouseLeave: () => s(!1),
567
- onFocus: (X) => l(i, e.absolutePath, X.currentTarget),
568
- onBlur: (X) => d(e.absolutePath, X.currentTarget),
569
- onKeyDown: (X) => {
570
- if (X.key === "Enter") {
571
- if (X.repeat) {
572
- X.preventDefault();
586
+ onMouseEnter: () => o(!0),
587
+ onMouseLeave: () => o(!1),
588
+ onFocus: (G) => l(i, e.absolutePath, G.currentTarget),
589
+ onBlur: (G) => d(e.absolutePath, G.currentTarget),
590
+ onKeyDown: (G) => {
591
+ if (G.key === "Enter") {
592
+ if (G.repeat) {
593
+ G.preventDefault();
573
594
  return;
574
595
  }
575
- ee(X);
596
+ ee(G);
576
597
  }
577
598
  },
578
599
  tabIndex: 0,
579
600
  children: [
580
- /* @__PURE__ */ f.jsxs("div", { className: L("dt-grid-name-cell", _e?.className), role: "gridcell", style: { width: g, paddingLeft: Math.max(0, t * he) }, children: [
581
- (Q || Y) && /* @__PURE__ */ f.jsx("span", { className: Z, style: { ...we, width: ce, height: ce }, children: te }),
582
- (u ? J : W) && /* @__PURE__ */ f.jsx("span", { className: Le, style: { width: B, height: B }, children: le }),
583
- /* @__PURE__ */ f.jsx("span", { className: se, style: zn(oe), children: De })
601
+ /* @__PURE__ */ f.jsxs("div", { className: U("dt-grid-name-cell", Oe?.className), role: "gridcell", style: { width: y, paddingLeft: Math.max(0, t * pe) }, children: [
602
+ (Q || B) && /* @__PURE__ */ f.jsx("span", { className: Z, style: { ...xe, width: de, height: de }, children: te }),
603
+ (u ? J : M) && /* @__PURE__ */ f.jsx("span", { className: $e, style: { width: W, height: W }, children: ie }),
604
+ /* @__PURE__ */ f.jsx("span", { className: se, style: Bn(oe), children: Fe })
584
605
  ] }),
585
- Te.length > 0 && /* @__PURE__ */ f.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ f.jsx("div", { className: "dt-grid-numeric-track", style: Kn(h, k), children: Te.map((X) => /* @__PURE__ */ f.jsx("div", { className: L("dt-grid-cell", Vn(X.align), X.className), role: "gridcell", children: X.render ? X.render(e, Ne) : null }, X.key)) }) })
606
+ Pe.length > 0 && /* @__PURE__ */ f.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ f.jsx("div", { className: "dt-grid-numeric-track", style: Zn(m, k), children: Pe.map((G) => /* @__PURE__ */ f.jsx("div", { className: U("dt-grid-cell", Jn(G.align), G.className), role: "gridcell", children: G.render ? G.render(e, ke) : null }, G.key)) }) })
586
607
  ]
587
608
  }
588
609
  );
589
610
  },
590
611
  (e, t) => {
591
612
  if (e.entry !== t.entry) return !1;
592
- const n = _n(e.entry, e.isDirOpen), r = _n(t.entry, t.isDirOpen);
613
+ const n = On(e.entry, e.isDirOpen), r = On(t.entry, t.isDirOpen);
593
614
  return e.indentLevel === t.indentLevel && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowIndex === t.rowIndex && // 焦点の通知は行番号で行うため、番号が変われば描き直してハンドラへ新しい番号を渡す
594
615
  e.flatIndex === t.flatIndex && e.isSelectedForAria === t.isSelectedForAria && e.rowHeight === t.rowHeight && n === r && e.columns === t.columns && e.numericTemplate === t.numericTemplate && e.numericTotal === t.numericTotal && e.nameWidth === t.nameWidth && e.rowClassName === t.rowClassName && e.selection.selectedPath === t.selection.selectedPath && e.selection.currentPath === t.selection.currentPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
595
616
  }
596
617
  );
597
- Un.displayName = "DirectoryTreeGridRow";
598
- const Jn = ({
618
+ qn.displayName = "DirectoryTreeGridRow";
619
+ const Qn = ({
599
620
  kind: e,
600
621
  columns: t,
601
622
  numericTemplate: n,
602
623
  numericTotal: r,
603
- nameWidth: o,
624
+ nameWidth: a,
604
625
  scrollBarWidth: i,
605
626
  className: l,
606
627
  nameContent: d,
607
- renderCell: b
628
+ renderCell: h
608
629
  }) => {
609
- const [, ...S] = t, w = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", R = e === "header" ? "dt-grid-header" : "dt-grid-footer", k = e === "header" ? "columnheader" : "gridcell";
610
- return /* @__PURE__ */ f.jsxs("div", { className: L(R, "text-gray-600 dark:text-gray-300", l), role: "row", children: [
611
- /* @__PURE__ */ f.jsx("div", { className: L(w, "px-1", t[0]?.className), role: k, style: { width: o }, children: d }),
612
- S.length > 0 && /* @__PURE__ */ f.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ f.jsx("div", { className: "dt-grid-numeric-track", style: Kn(r, n), children: S.map((h) => /* @__PURE__ */ f.jsx("div", { className: L("dt-grid-cell", Vn(h.align), h.className), role: k, children: b(h) }, h.key)) }) }),
630
+ const [, ...b] = t, N = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", x = e === "header" ? "dt-grid-header" : "dt-grid-footer", k = e === "header" ? "columnheader" : "gridcell";
631
+ return /* @__PURE__ */ f.jsxs("div", { className: U(x, ce.gridEdge, l), role: "row", children: [
632
+ /* @__PURE__ */ f.jsx("div", { className: U(N, "px-1", t[0]?.className), role: k, style: { width: a }, children: d }),
633
+ b.length > 0 && /* @__PURE__ */ f.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ f.jsx("div", { className: "dt-grid-numeric-track", style: Zn(r, n), children: b.map((m) => /* @__PURE__ */ f.jsx("div", { className: U("dt-grid-cell", Jn(m.align), m.className), role: k, children: h(m) }, m.key)) }) }),
613
634
  /* @__PURE__ */ f.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: i }, "aria-hidden": "true" })
614
635
  ] });
615
- }, ao = ({ columns: e, className: t, ...n }) => /* @__PURE__ */ f.jsx(Jn, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (r) => r.header ?? null, ...n }), Cn = (e, t) => typeof e == "function" ? e(t) : e ?? null, lo = ({ columns: e, allEntries: t, className: n, ...r }) => /* @__PURE__ */ f.jsx(Jn, { kind: "footer", columns: e, className: n, nameContent: Cn(e[0]?.footer, t), renderCell: (o) => Cn(o.footer, t), ...r }), io = 240, Zn = 96, qn = 12, jt = (e, t) => {
636
+ }, co = ({ columns: e, className: t, ...n }) => /* @__PURE__ */ f.jsx(Qn, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (r) => r.header ?? null, ...n }), jn = (e, t) => typeof e == "function" ? e(t) : e ?? null, uo = ({ columns: e, allEntries: t, className: n, ...r }) => /* @__PURE__ */ f.jsx(Qn, { kind: "footer", columns: e, className: n, nameContent: jn(e[0]?.footer, t), renderCell: (a) => jn(a.footer, t), ...r }), fo = 240, er = 96, tr = 12, Lt = (e, t) => {
616
637
  const n = e?.width;
617
638
  return typeof n == "number" && Number.isFinite(n) && n > 0 ? n : t;
618
- }, co = (e) => e.slice(1).map((t) => `${jt(t, Zn)}px`).join(" "), uo = ({ measuredWidth: e, columns: t, scrollBarWidth: n = qn }) => {
619
- const r = jt(t[0], io), o = t.slice(1).reduce((b, S) => b + jt(S, Zn), 0), i = Number.isFinite(e) && e > 0 ? e : 0, l = Math.max(0, i - r - Math.max(0, n)), d = Math.max(0, o - l);
620
- return { nameWidth: r, numericTotal: o, numericVisible: l, maxHScroll: d };
621
- }, Ct = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, fo = (e) => {
639
+ }, ho = (e) => e.slice(1).map((t) => `${Lt(t, er)}px`).join(" "), mo = ({ measuredWidth: e, columns: t, scrollBarWidth: n = tr }) => {
640
+ const r = Lt(t[0], fo), a = t.slice(1).reduce((h, b) => h + Lt(b, er), 0), i = Number.isFinite(e) && e > 0 ? e : 0, l = Math.max(0, i - r - Math.max(0, n)), d = Math.max(0, a - l);
641
+ return { nameWidth: r, numericTotal: a, numericVisible: l, maxHScroll: d };
642
+ }, jt = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, po = (e) => {
622
643
  const t = [], n = (r) => {
623
- for (const o of r)
624
- t.push(o), o.children && o.children.length > 0 && n(o.children);
644
+ for (const a of r)
645
+ t.push(a), a.children && a.children.length > 0 && n(a.children);
625
646
  };
626
647
  return n(e), t;
627
- }, Qn = ["entryKindDirectory", "entryKindFile"], On = [...ht, ...Qn], At = Object.freeze({
648
+ }, nr = ["entryKindDirectory", "entryKindFile"], An = [...pt, ...nr], Dt = Object.freeze({
628
649
  en: Object.freeze({
629
650
  entryKindDirectory: "directory",
630
651
  entryKindFile: "file"
@@ -633,45 +654,45 @@ const Jn = ({
633
654
  entryKindDirectory: "ディレクトリ",
634
655
  entryKindFile: "ファイル"
635
656
  })
636
- }), ho = Object.freeze({
637
- en: Object.freeze({ ...Rn.en, ...At.en }),
638
- ja: Object.freeze({ ...Rn.ja, ...At.ja })
639
- }), jn = (e) => typeof e == "string" ? JSON.stringify(e) : e === null ? "null" : typeof e, mo = (e) => {
657
+ }), yo = Object.freeze({
658
+ en: Object.freeze({ ...Tn.en, ...Dt.en }),
659
+ ja: Object.freeze({ ...Tn.ja, ...Dt.ja })
660
+ }), Ln = (e) => typeof e == "string" ? JSON.stringify(e) : e === null ? "null" : typeof e, go = (e) => {
640
661
  const t = {};
641
662
  let n = !1;
642
- for (const r of ht) {
643
- const o = Object.hasOwn(e, r) ? e[r] : void 0;
644
- o !== void 0 && (t[r] = o, n = !0);
663
+ for (const r of pt) {
664
+ const a = Object.hasOwn(e, r) ? e[r] : void 0;
665
+ a !== void 0 && (t[r] = a, n = !0);
645
666
  }
646
667
  return n ? t : void 0;
647
- }, po = (e, t) => {
648
- const n = $n(e);
668
+ }, bo = (e, t) => {
669
+ const n = Mn(e);
649
670
  if (t === void 0)
650
- return ho[n];
671
+ return yo[n];
651
672
  if (t === null || typeof t != "object")
652
- throw new RangeError(`[directory-tree] labels must be an object; got ${jn(t)}`);
673
+ throw new RangeError(`[directory-tree] labels must be an object; got ${Ln(t)}`);
653
674
  const r = Object.getPrototypeOf(t);
654
675
  if (r !== Object.prototype && r !== null)
655
676
  throw new RangeError(`[directory-tree] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(t) ? "an array" : "an object with a non-plain prototype"}`);
656
677
  for (const l of Object.keys(t))
657
- if (!On.includes(l))
658
- throw new RangeError(`[directory-tree] labels.${l} is not a known label key; expected one of ${On.join(", ")}`);
659
- const i = { ...pr(n, mo(t)), ...At[n] };
660
- for (const l of Qn) {
678
+ if (!An.includes(l))
679
+ throw new RangeError(`[directory-tree] labels.${l} is not a known label key; expected one of ${An.join(", ")}`);
680
+ const i = { ...br(n, go(t)), ...Dt[n] };
681
+ for (const l of nr) {
661
682
  const d = Object.hasOwn(t, l) ? t[l] : void 0;
662
683
  if (d !== void 0) {
663
684
  if (typeof d != "string" || d.trim() === "")
664
- throw new RangeError(`[directory-tree] labels.${l} must be a non-blank string; got ${jn(d)}`);
685
+ throw new RangeError(`[directory-tree] labels.${l} must be a non-blank string; got ${Ln(d)}`);
665
686
  i[l] = d;
666
687
  }
667
688
  }
668
689
  return Object.freeze(i);
669
- }, yo = (e) => {
690
+ }, vo = (e) => {
670
691
  const t = {};
671
- for (const n of ht)
692
+ for (const n of pt)
672
693
  t[n] = e[n];
673
694
  return Object.freeze(t);
674
- }, go = () => {
695
+ }, So = () => {
675
696
  let e = null;
676
697
  return {
677
698
  mark: (t) => {
@@ -682,212 +703,204 @@ const Jn = ({
682
703
  },
683
704
  landedOn: (t) => e?.includes(t) === !0
684
705
  };
685
- }, qe = (e) => typeof e == "string" ? JSON.stringify(e) : String(e), Lt = (e, t) => {
706
+ }, et = (e) => typeof e == "string" ? JSON.stringify(e) : String(e), $t = (e, t) => {
686
707
  if (typeof t != "number" || !Number.isFinite(t) || t <= 0)
687
- throw new RangeError(`[directory-tree] visual.${e} must be a finite number greater than 0 (px); got ${qe(t)}.`);
708
+ throw new RangeError(`[directory-tree] visual.${e} must be a finite number greater than 0 (px); got ${et(t)}.`);
688
709
  return t;
689
- }, bo = (e) => {
710
+ }, wo = (e) => {
690
711
  if (typeof e == "string" && e.trim() !== "" || typeof e == "number" && Number.isFinite(e) && e > 0)
691
712
  return e;
692
- throw new RangeError(`[directory-tree] visual.fontSize must be a finite number greater than 0 (px) or a CSS font size that is not blank; got ${qe(e)}.`);
693
- }, vo = ({ indentSize: e, typeIconSize: t, fontSize: n }) => ({
694
- indentSize: e === void 0 ? Wr : Lt("indentSize", e),
695
- typeIconSize: t === void 0 ? Br : Lt("typeIconSize", t),
696
- fontSize: n === void 0 ? void 0 : bo(n)
697
- }), So = ({ indentSize: e, removeRootIndent: t, hasExpandBox: n }) => t ? Math.max(0, e - (n ? ce : 0)) : 0, wo = (e, t, n) => {
713
+ throw new RangeError(`[directory-tree] visual.fontSize must be a finite number greater than 0 (px) or a CSS font size that is not blank; got ${et(e)}.`);
714
+ }, Eo = ({ indentSize: e, typeIconSize: t, fontSize: n }) => ({
715
+ indentSize: e === void 0 ? Yr : $t("indentSize", e),
716
+ typeIconSize: t === void 0 ? Vr : $t("typeIconSize", t),
717
+ fontSize: n === void 0 ? void 0 : wo(n)
718
+ }), xo = ({ indentSize: e, removeRootIndent: t, hasExpandBox: n }) => t ? Math.max(0, e - (n ? de : 0)) : 0, Ro = (e, t, n) => {
698
719
  if (typeof e != "function")
699
- return Lt("itemHeight", e);
720
+ return $t("itemHeight", e);
700
721
  const r = e(t, n);
701
722
  if (typeof r != "number" || !Number.isFinite(r) || r <= 0)
702
- throw new RangeError(`[directory-tree] visual.itemHeight returned ${qe(r)} for ${JSON.stringify(t.absolutePath)} (row ${n}); it must return a finite number greater than 0 (px).`);
723
+ throw new RangeError(`[directory-tree] visual.itemHeight returned ${et(r)} for ${JSON.stringify(t.absolutePath)} (row ${n}); it must return a finite number greater than 0 (px).`);
703
724
  return r;
704
- }, xo = (e, t, n) => {
705
- const r = t === void 0 ? Hr : t;
706
- if (typeof r != "number" || !Number.isFinite(r) || r <= 0 || r > ce)
707
- throw new RangeError(`[directory-tree] visual.expandIconSize must be a finite number greater than 0 and at most ${ce} (the expand box, px) while tree lines are drawn; got ${qe(r)}.`);
708
- const { indentSize: o, typeIconSize: i } = e, l = r / 2, d = ce + i - r / 2;
709
- if (o < l || o > d)
725
+ }, Io = (e, t, n) => {
726
+ const r = t === void 0 ? Gr : t;
727
+ if (typeof r != "number" || !Number.isFinite(r) || r <= 0 || r > de)
728
+ throw new RangeError(`[directory-tree] visual.expandIconSize must be a finite number greater than 0 and at most ${de} (the expand box, px) while tree lines are drawn; got ${et(r)}.`);
729
+ const { indentSize: a, typeIconSize: i } = e, l = r / 2, d = de + i - r / 2;
730
+ if (a < l || a > d)
710
731
  throw new RangeError(
711
- `[directory-tree] visual.indentSize ${qe(o)} does not fit the tree lines: with typeIconSize ${i} and an expand glyph of ${r} px it must be from ${l} (half the glyph) to ${d} (the ${ce} px expand box + typeIconSize − half the glyph).`
732
+ `[directory-tree] visual.indentSize ${et(a)} does not fit the tree lines: with typeIconSize ${i} and an expand glyph of ${r} px it must be from ${l} (half the glyph) to ${d} (the ${de} px expand box + typeIconSize − half the glyph).`
712
733
  );
713
- return { indentSize: o, typeIconSize: i, glyphSize: r, originX: n };
714
- }, Eo = ({ indentSize: e, typeIconSize: t, glyphSize: n }) => Math.min(Math.max(ce + t / 2 - e, n / 2), ce - n / 2), Ro = (e, t) => {
734
+ return { indentSize: a, typeIconSize: i, glyphSize: r, originX: n };
735
+ }, To = ({ indentSize: e, typeIconSize: t, glyphSize: n }) => Math.min(Math.max(de + t / 2 - e, n / 2), de - n / 2), No = (e, t) => {
715
736
  const n = e.length - 1;
716
737
  if (n <= 0) return 0;
717
- let r = 0, o = n - 1, i = 0;
718
- for (; r <= o; ) {
719
- const l = r + o >>> 1;
720
- e[l] <= t ? (i = l, r = l + 1) : o = l - 1;
738
+ let r = 0, a = n - 1, i = 0;
739
+ for (; r <= a; ) {
740
+ const l = r + a >>> 1;
741
+ e[l] <= t ? (i = l, r = l + 1) : a = l - 1;
721
742
  }
722
743
  return i;
723
- }, Io = (e, t, n) => {
744
+ }, ko = (e, t, n) => {
724
745
  if (n <= 0 || e.length === 0 || t.length !== e.length + 1)
725
746
  return null;
726
- const r = Ro(t, n), o = e[r];
727
- return o ? {
728
- path: o.entry.absolutePath,
747
+ const r = No(t, n), a = e[r];
748
+ return a ? {
749
+ path: a.entry.absolutePath,
729
750
  offsetInViewport: n - t[r]
730
751
  } : null;
731
- }, No = (e, t, n) => {
752
+ }, Po = (e, t, n) => {
732
753
  if (t.length === 0 || n.length !== t.length + 1)
733
754
  return null;
734
755
  for (let r = 0; r < t.length; r++)
735
756
  if (t[r].entry.absolutePath === e.path)
736
757
  return Math.max(0, n[r] + e.offsetInViewport);
737
758
  return null;
738
- }, To = (e, t, n) => {
759
+ }, _o = (e, t, n) => {
739
760
  const r = [];
740
- for (let o = t; o < n; o++) {
741
- const i = e[o];
761
+ for (let a = t; a < n; a++) {
762
+ const i = e[a];
742
763
  if (!(!i || i.length === 0))
743
764
  for (const l of i)
744
765
  r.push(l);
745
766
  }
746
767
  return r;
747
- }, ko = (e, t, n) => {
768
+ }, Co = (e, t, n) => {
748
769
  const r = [];
749
- for (let o = t; o < n; o++) {
750
- const i = e[o];
770
+ for (let a = t; a < n; a++) {
771
+ const i = e[a];
751
772
  if (!(!i || i.length === 0))
752
773
  for (const l of i)
753
774
  r.push(l);
754
775
  }
755
776
  return r;
756
- }, Po = (e, t, n, r) => {
757
- const o = Math.max(1, Math.floor(t * r)), i = Math.max(1, Math.floor(n * r));
758
- (e.width !== o || e.height !== i) && (e.width = o, e.height = i);
777
+ }, Oo = (e, t, n, r) => {
778
+ const a = Math.max(1, Math.floor(t * r)), i = Math.max(1, Math.floor(n * r));
779
+ (e.width !== a || e.height !== i) && (e.width = a, e.height = i);
759
780
  const l = e.style;
760
781
  l.width !== `${t}px` && (l.width = `${t}px`), l.height !== `${n}px` && (l.height = `${n}px`);
761
- }, _o = (e, t, n) => {
782
+ }, jo = (e, t, n) => {
762
783
  e.lineWidth = n, e.beginPath();
763
784
  for (const r of t)
764
785
  e.moveTo(r.x1, r.y1), e.lineTo(r.x2, r.y2);
765
786
  e.stroke();
766
- }, Co = (e, t) => {
767
- const n = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
768
- if (!n)
769
- return null;
770
- let r = n[1];
771
- r.length === 3 && (r = r.split("").map((d) => d + d).join(""));
772
- const o = Number.parseInt(r.slice(0, 2), 16), i = Number.parseInt(r.slice(2, 4), 16), l = Number.parseInt(r.slice(4, 6), 16);
773
- return `rgba(${o}, ${i}, ${l}, ${t})`;
774
- }, Oo = (e, t, n, r) => {
787
+ }, Ao = (e, t, n, r) => {
775
788
  if (t.length === 0)
776
789
  return;
777
- const o = Co(n, 0.14), i = e.strokeStyle, l = e.fillStyle, d = e.lineWidth, b = e.lineCap, S = e.lineJoin;
790
+ const a = e.strokeStyle, i = e.lineWidth, l = e.lineCap, d = e.lineJoin;
778
791
  e.strokeStyle = n, e.lineCap = "round", e.lineJoin = "round";
779
- for (const w of t) {
780
- const R = r ?? w.size, k = Math.max(0, R / 2), h = Math.max(1, Math.round(R * 0.08)), g = Math.max(1, Math.round(R * 0.14)), m = Math.max(0, k - h * 0.8), p = Math.max(0, m * 0.55);
781
- o && (e.fillStyle = o, e.beginPath(), e.arc(w.centerX, w.centerY, m, 0, Math.PI * 2), e.fill()), e.lineWidth = h, e.beginPath(), e.arc(w.centerX, w.centerY, Math.max(0, k - h * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = g, e.beginPath(), e.moveTo(w.centerX - p, w.centerY), e.lineTo(w.centerX + p, w.centerY), e.stroke(), w.isExpanded || (e.beginPath(), e.moveTo(w.centerX, w.centerY - p), e.lineTo(w.centerX, w.centerY + p), e.stroke());
792
+ for (const h of t) {
793
+ const b = r ?? h.size, N = Math.max(0, b / 2), x = Math.max(1, Math.round(b * 0.08)), k = Math.max(1, Math.round(b * 0.14)), m = Math.max(0, N - x * 0.8), y = Math.max(0, m * 0.55);
794
+ e.lineWidth = x, e.beginPath(), e.arc(h.centerX, h.centerY, Math.max(0, N - x * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = k, e.beginPath(), e.moveTo(h.centerX - y, h.centerY), e.lineTo(h.centerX + y, h.centerY), e.stroke(), h.isExpanded || (e.beginPath(), e.moveTo(h.centerX, h.centerY - y), e.lineTo(h.centerX, h.centerY + y), e.stroke());
782
795
  }
783
- e.strokeStyle = i, e.fillStyle = l, e.lineWidth = d, e.lineCap = b, e.lineJoin = S;
784
- }, er = Dt(({ segmentsByItem: e, glyphsByItem: t, itemHeight: n, width: r, viewportHeight: o, scrollPosition: i, color: l = "#a0aec0", strokeWidth: d = 1, renderStartIndex: b, renderEndIndex: S, lookaheadEndIndex: w, devicePixelRatio: R, expandGlyphColor: k, expandGlyphSize: h }) => {
785
- const g = G(null), m = G(null), p = G({
796
+ e.strokeStyle = a, e.lineWidth = i, e.lineCap = l, e.lineJoin = d;
797
+ }, rr = Ft(({ segmentsByItem: e, glyphsByItem: t, itemHeight: n, width: r, viewportHeight: a, scrollPosition: i, color: l = Hn, strokeWidth: d = 1, renderStartIndex: h, renderEndIndex: b, lookaheadEndIndex: N, devicePixelRatio: x, expandGlyphColor: k, expandGlyphSize: m }) => {
798
+ const y = Y(null), p = Y(null), w = Y({
786
799
  segmentsByItem: e,
787
800
  glyphsByItem: t,
788
801
  itemHeight: n,
789
802
  width: r,
790
- viewportHeight: o,
803
+ viewportHeight: a,
791
804
  scrollPosition: i,
792
805
  color: l,
793
806
  strokeWidth: d,
794
- renderStartIndex: b,
795
- renderEndIndex: S,
796
- lookaheadEndIndex: w,
797
- devicePixelRatio: R,
807
+ renderStartIndex: h,
808
+ renderEndIndex: b,
809
+ lookaheadEndIndex: N,
810
+ devicePixelRatio: x,
798
811
  expandGlyphColor: k,
799
- expandGlyphSize: h
812
+ expandGlyphSize: m
800
813
  }), v = _(() => {
801
- m.current = null;
802
- const P = g.current;
814
+ p.current = null;
815
+ const P = y.current;
803
816
  if (!P)
804
817
  return;
805
818
  const C = P.getContext("2d");
806
819
  if (!C)
807
820
  return;
808
- const y = p.current;
809
- if (y.width <= 0 || y.viewportHeight <= 0) {
821
+ const g = w.current;
822
+ if (g.width <= 0 || g.viewportHeight <= 0) {
810
823
  C.clearRect(0, 0, P.width, P.height);
811
824
  return;
812
825
  }
813
- const F = Number.isFinite(y.devicePixelRatio ?? NaN) ? y.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
814
- Po(P, y.width, y.viewportHeight, F);
815
- const $ = y.segmentsByItem.length, O = typeof y.renderStartIndex == "number" && Number.isFinite(y.renderStartIndex) ? Math.max(0, Math.floor(y.renderStartIndex)) : Math.max(0, Math.floor(y.scrollPosition / y.itemHeight)), Q = Math.min($, Math.ceil((y.scrollPosition + y.viewportHeight) / y.itemHeight)), J = (() => {
816
- if (typeof y.renderEndIndex == "number" && Number.isFinite(y.renderEndIndex)) {
817
- const B = Math.floor(y.renderEndIndex);
818
- return Math.max(Math.min($, B + 1), O);
826
+ const D = Number.isFinite(g.devicePixelRatio ?? NaN) ? g.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
827
+ Oo(P, g.width, g.viewportHeight, D);
828
+ const $ = g.segmentsByItem.length, O = typeof g.renderStartIndex == "number" && Number.isFinite(g.renderStartIndex) ? Math.max(0, Math.floor(g.renderStartIndex)) : Math.max(0, Math.floor(g.scrollPosition / g.itemHeight)), Q = Math.min($, Math.ceil((g.scrollPosition + g.viewportHeight) / g.itemHeight)), J = (() => {
829
+ if (typeof g.renderEndIndex == "number" && Number.isFinite(g.renderEndIndex)) {
830
+ const W = Math.floor(g.renderEndIndex);
831
+ return Math.max(Math.min($, W + 1), O);
819
832
  }
820
833
  return Math.max(Q, O);
821
- })(), W = (() => {
822
- if (typeof y.lookaheadEndIndex == "number" && Number.isFinite(y.lookaheadEndIndex)) {
823
- const B = Math.floor(y.lookaheadEndIndex), oe = Math.min($, B + 1);
834
+ })(), M = (() => {
835
+ if (typeof g.lookaheadEndIndex == "number" && Number.isFinite(g.lookaheadEndIndex)) {
836
+ const W = Math.floor(g.lookaheadEndIndex), oe = Math.min($, W + 1);
824
837
  return Math.max(oe, J);
825
838
  }
826
839
  return Math.max(Q, J);
827
- })(), Y = To(y.segmentsByItem, O, W), fe = ko(y.glyphsByItem, O, W);
828
- C.save(), C.scale(F, F), C.clearRect(0, 0, y.width, y.viewportHeight), C.translate(0, -y.scrollPosition), C.strokeStyle = y.color, _o(C, Y, y.strokeWidth), Oo(C, fe, y.expandGlyphColor ?? y.color, y.expandGlyphSize), C.restore();
829
- }, []), M = _(() => {
830
- m.current === null && (m.current = window.requestAnimationFrame(v));
840
+ })(), B = _o(g.segmentsByItem, O, M), me = Co(g.glyphsByItem, O, M);
841
+ C.save(), C.scale(D, D), C.clearRect(0, 0, g.width, g.viewportHeight), C.translate(0, -g.scrollPosition), C.strokeStyle = g.color, jo(C, B, g.strokeWidth), Ao(C, me, g.expandGlyphColor ?? g.color, g.expandGlyphSize), C.restore();
842
+ }, []), F = _(() => {
843
+ p.current === null && (p.current = window.requestAnimationFrame(v));
831
844
  }, [v]);
832
- return Ae(() => {
833
- p.current = {
845
+ return De(() => {
846
+ w.current = {
834
847
  segmentsByItem: e,
835
848
  glyphsByItem: t,
836
849
  itemHeight: n,
837
850
  width: r,
838
- viewportHeight: o,
851
+ viewportHeight: a,
839
852
  scrollPosition: i,
840
853
  color: l,
841
854
  strokeWidth: d,
842
- renderStartIndex: b,
843
- renderEndIndex: S,
844
- lookaheadEndIndex: w,
845
- devicePixelRatio: R,
855
+ renderStartIndex: h,
856
+ renderEndIndex: b,
857
+ lookaheadEndIndex: N,
858
+ devicePixelRatio: x,
846
859
  expandGlyphColor: k,
847
- expandGlyphSize: h
848
- }, M();
849
- }, [e, t, n, r, o, i, l, d, b, S, w, R, k, h, M]), Ae(() => () => {
850
- m.current !== null && (window.cancelAnimationFrame(m.current), m.current = null);
851
- }, []), /* @__PURE__ */ f.jsx("canvas", { ref: g, className: "pointer-events-none absolute top-0 left-0 z-0" });
860
+ expandGlyphSize: m
861
+ }, F();
862
+ }, [e, t, n, r, a, i, l, d, h, b, N, x, k, m, F]), De(() => () => {
863
+ p.current !== null && (window.cancelAnimationFrame(p.current), p.current = null);
864
+ }, []), /* @__PURE__ */ f.jsx("canvas", { ref: y, className: "pointer-events-none absolute top-0 left-0 z-0" });
852
865
  });
853
- er.displayName = "TreeLineCanvas";
854
- const jo = (e) => {
866
+ rr.displayName = "TreeLineCanvas";
867
+ const Lo = (e) => {
855
868
  const t = /* @__PURE__ */ new Map();
856
869
  for (let n = 0; n < e.length; n++) {
857
870
  const r = e[n].entry.absolutePath;
858
871
  t.has(r) || t.set(r, n);
859
872
  }
860
873
  return t;
861
- }, An = (e, t) => e.selectedPath === t ? e : { selectedPath: t, selectionGeneration: e.selectionGeneration + 1, anchor: e.anchor }, Ao = (e, t) => ({ ...e, anchor: { path: t, selectionGeneration: e.selectionGeneration, focused: !0 } }), Lo = (e, t) => {
862
- const { anchor: n, selectionGeneration: r, selectedPath: o } = t;
874
+ }, Dn = (e, t) => e.selectedPath === t ? e : { selectedPath: t, selectionGeneration: e.selectionGeneration + 1, anchor: e.anchor }, Do = (e, t) => ({ ...e, anchor: { path: t, selectionGeneration: e.selectionGeneration, focused: !0 } }), $o = (e, t) => {
875
+ const { anchor: n, selectionGeneration: r, selectedPath: a } = t;
863
876
  if (n !== null && (n.focused || n.selectionGeneration === r)) {
864
877
  const i = e.get(n.path);
865
878
  if (i !== void 0)
866
879
  return i;
867
880
  }
868
- if (o !== null) {
869
- const i = e.get(o);
881
+ if (a !== null) {
882
+ const i = e.get(a);
870
883
  if (i !== void 0)
871
884
  return i;
872
885
  }
873
886
  return 0;
874
- }, Do = {
887
+ }, Fo = {
875
888
  msOverflowStyle: "none",
876
889
  scrollbarWidth: "none"
877
- }, Fo = () => {
890
+ }, zo = () => {
878
891
  let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
879
892
  e || (e = document.createElement("style"), e.id = "directory-tree-webkit-scrollbar-hide", e.textContent = ".directory-tree-container::-webkit-scrollbar { display: none; }", document.head.appendChild(e));
880
- }, $o = (e) => {
881
- const t = G(null), n = t.current;
882
- return n !== null && ht.every((r) => n[r] === e[r]) ? n : (t.current = e, e);
883
- }, Ln = /* @__PURE__ */ new Set(["top", "bottom", "center", "nearest"]), Dn = (e) => {
893
+ }, Mo = (e) => {
894
+ const t = Y(null), n = t.current;
895
+ return n !== null && pt.every((r) => n[r] === e[r]) ? n : (t.current = e, e);
896
+ }, $n = /* @__PURE__ */ new Set(["top", "bottom", "center", "nearest"]), Fn = (e) => {
884
897
  const t = e?.align;
885
898
  if (t === void 0)
886
899
  return "top";
887
- if (!Ln.has(t))
888
- throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...Ln].join(", ")}.`);
900
+ if (!$n.has(t))
901
+ throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...$n].join(", ")}.`);
889
902
  return t;
890
- }, Mo = {
903
+ }, Ho = {
891
904
  position: "absolute",
892
905
  width: 1,
893
906
  height: 1,
@@ -897,226 +910,226 @@ const jo = (e) => {
897
910
  overflow: "hidden",
898
911
  clipPath: "inset(50%)",
899
912
  whiteSpace: "nowrap"
900
- }, zo = (e, t, n, r, o) => {
913
+ }, Wo = (e, t, n, r, a) => {
901
914
  const i = [], l = [];
902
915
  let d = 0;
903
- const b = (S, w, R) => {
904
- const k = o ? [...S].sort(o) : S;
905
- for (let h = 0; h < k.length; h++) {
906
- const g = k[h], m = h === k.length - 1, p = [...R, m], v = g.children !== void 0, M = v && t(g.absolutePath, g.relativePath);
907
- let P = w, C = R;
908
- r && (P = w - 1, C = R.slice(1)), i.push({ entry: g, indentLevel: P, depth: w, positionInSet: h + 1, setSize: k.length }), n && (P > d && (d = P), l.push({
909
- id: g.absolutePath,
910
- name: g.name,
911
- absolutePath: g.absolutePath,
916
+ const h = (b, N, x) => {
917
+ const k = a ? [...b].sort(a) : b;
918
+ for (let m = 0; m < k.length; m++) {
919
+ const y = k[m], p = m === k.length - 1, w = [...x, p], v = y.children !== void 0, F = v && t(y.absolutePath, y.relativePath);
920
+ let P = N, C = x;
921
+ r && (P = N - 1, C = x.slice(1)), i.push({ entry: y, indentLevel: P, depth: N, positionInSet: m + 1, setSize: k.length }), n && (P > d && (d = P), l.push({
922
+ id: y.absolutePath,
923
+ name: y.name,
924
+ absolutePath: y.absolutePath,
912
925
  indentLevel: P,
913
- isLastChild: m,
926
+ isLastChild: p,
914
927
  isDirectory: v,
915
- isExpanded: M,
928
+ isExpanded: F,
916
929
  ancestorIsLast: [...C],
917
- hideLines: r && w === 0
918
- })), v && M && g.children && b(g.children, w + 1, p);
930
+ hideLines: r && N === 0
931
+ })), v && F && y.children && h(y.children, N + 1, w);
919
932
  }
920
933
  };
921
- return b(e, 0, []), { flatItems: i, lineItems: l, maxIndent: d };
922
- }, Fn = (e, t) => {
934
+ return h(e, 0, []), { flatItems: i, lineItems: l, maxIndent: d };
935
+ }, zn = (e, t) => {
923
936
  const n = e.length - 1;
924
937
  if (n <= 0) return 0;
925
- let r = 0, o = n - 1, i = 0;
926
- for (; r <= o; ) {
927
- const l = r + o >>> 1;
928
- e[l] <= t ? (i = l, r = l + 1) : o = l - 1;
938
+ let r = 0, a = n - 1, i = 0;
939
+ for (; r <= a; ) {
940
+ const l = r + a >>> 1;
941
+ e[l] <= t ? (i = l, r = l + 1) : a = l - 1;
929
942
  }
930
943
  return i;
931
- }, Wo = (e, t, n, r, o, i) => {
932
- const l = r?.renderStart ?? Math.max(0, Fn(i, o)), d = t > 0 ? Fn(i, o + t) + n : l + n, b = e > 0 ? Math.min(e - 1, Math.max(l, d)) : l, S = r?.renderEnd ?? b, w = e > 0 ? Math.min(e - 1, S + n) : S;
933
- return { renderStart: l, renderEnd: S, lookaheadEnd: w };
934
- }, Ho = (e, t, n, r) => {
944
+ }, Bo = (e, t, n, r, a, i) => {
945
+ const l = r?.renderStart ?? Math.max(0, zn(i, a)), d = t > 0 ? zn(i, a + t) + n : l + n, h = e > 0 ? Math.min(e - 1, Math.max(l, d)) : l, b = r?.renderEnd ?? h, N = e > 0 ? Math.min(e - 1, b + n) : b;
946
+ return { renderStart: l, renderEnd: b, lookaheadEnd: N };
947
+ }, Yo = (e, t, n, r) => {
935
948
  if (e.length === 0)
936
949
  return { segmentsByItem: [], glyphsByItem: [] };
937
- const { indentSize: o, typeIconSize: i, glyphSize: l, originX: d } = r, b = Array.from({ length: e.length }, () => []), S = Array.from({ length: e.length }, () => []), w = d + Eo(r), R = (h) => h * o + w, k = l / 2 + 2;
938
- for (let h = 0; h < e.length; h++) {
939
- const g = e[h], m = t[h] ?? 0, p = n[h] ?? 0, v = p + m / 2, M = e[h + 1], P = v + i / 2, C = p + m, y = M !== void 0 && M.indentLevel === g.indentLevel + 1 && P < C ? { key: `${g.id}-connector-children`, x1: R(M.indentLevel), y1: P, x2: R(M.indentLevel), y2: C, itemIndex: h } : null;
940
- if (g.hideLines) {
941
- y !== null && (b[h] = [y]);
950
+ const { indentSize: a, typeIconSize: i, glyphSize: l, originX: d } = r, h = Array.from({ length: e.length }, () => []), b = Array.from({ length: e.length }, () => []), N = d + To(r), x = (m) => m * a + N, k = l / 2 + 2;
951
+ for (let m = 0; m < e.length; m++) {
952
+ const y = e[m], p = t[m] ?? 0, w = n[m] ?? 0, v = w + p / 2, F = e[m + 1], P = v + i / 2, C = w + p, g = F !== void 0 && F.indentLevel === y.indentLevel + 1 && P < C ? { key: `${y.id}-connector-children`, x1: x(F.indentLevel), y1: P, x2: x(F.indentLevel), y2: C, itemIndex: m } : null;
953
+ if (y.hideLines) {
954
+ g !== null && (h[m] = [g]);
942
955
  continue;
943
956
  }
944
- const F = [];
945
- for (let O = 0; O < g.indentLevel; O++) {
946
- if (g.ancestorIsLast[O] ?? !1)
957
+ const D = [];
958
+ for (let O = 0; O < y.indentLevel; O++) {
959
+ if (y.ancestorIsLast[O] ?? !1)
947
960
  continue;
948
961
  let J = !1;
949
- for (let W = h; W < e.length; W++) {
950
- const Y = e[W];
951
- if (Y.indentLevel > O && Y.ancestorIsLast.length > O && !Y.ancestorIsLast[O]) {
962
+ for (let M = m; M < e.length; M++) {
963
+ const B = e[M];
964
+ if (B.indentLevel > O && B.ancestorIsLast.length > O && !B.ancestorIsLast[O]) {
952
965
  J = !0;
953
966
  break;
954
967
  }
955
- if (W > h && Y.indentLevel === O)
968
+ if (M > m && B.indentLevel === O)
956
969
  break;
957
970
  }
958
971
  if (J) {
959
- const W = R(O);
960
- F.push({
961
- key: `${g.id}-ancestor-${O}`,
962
- x1: W,
963
- y1: p,
964
- x2: W,
965
- y2: p + m,
966
- itemIndex: h
972
+ const M = x(O);
973
+ D.push({
974
+ key: `${y.id}-ancestor-${O}`,
975
+ x1: M,
976
+ y1: w,
977
+ x2: M,
978
+ y2: w + p,
979
+ itemIndex: m
967
980
  });
968
981
  }
969
982
  }
970
- const $ = R(g.indentLevel);
971
- h > 0 && F.push({
972
- key: `${g.id}-connector-top`,
983
+ const $ = x(y.indentLevel);
984
+ m > 0 && D.push({
985
+ key: `${y.id}-connector-top`,
973
986
  x1: $,
974
- y1: p,
987
+ y1: w,
975
988
  x2: $,
976
- y2: g.isDirectory ? v - k : v,
977
- itemIndex: h
978
- }), !g.isDirectory && g.isLastChild && F.push({
979
- key: `${g.id}-connector-horizontal`,
989
+ y2: y.isDirectory ? v - k : v,
990
+ itemIndex: m
991
+ }), !y.isDirectory && y.isLastChild && D.push({
992
+ key: `${y.id}-connector-horizontal`,
980
993
  x1: $,
981
994
  y1: v,
982
- x2: d + g.indentLevel * o + ce,
995
+ x2: d + y.indentLevel * a + de,
983
996
  y2: v,
984
- itemIndex: h
985
- }), g.isLastChild || (g.isDirectory ? F.push({
986
- key: `${g.id}-connector-bottom`,
997
+ itemIndex: m
998
+ }), y.isLastChild || (y.isDirectory ? D.push({
999
+ key: `${y.id}-connector-bottom`,
987
1000
  x1: $,
988
1001
  y1: v + k,
989
1002
  x2: $,
990
- y2: p + m,
991
- itemIndex: h
992
- }) : F.push({
993
- key: `${g.id}-connector-bottom`,
1003
+ y2: w + p,
1004
+ itemIndex: m
1005
+ }) : D.push({
1006
+ key: `${y.id}-connector-bottom`,
994
1007
  x1: $,
995
1008
  y1: v,
996
1009
  x2: $,
997
- y2: p + m,
998
- itemIndex: h
999
- })), y !== null && F.push(y), b[h] = F, g.isDirectory && (S[h] = [
1010
+ y2: w + p,
1011
+ itemIndex: m
1012
+ })), g !== null && D.push(g), h[m] = D, y.isDirectory && (b[m] = [
1000
1013
  {
1001
- key: `${g.id}-glyph`,
1002
- itemIndex: h,
1014
+ key: `${y.id}-glyph`,
1015
+ itemIndex: m,
1003
1016
  centerX: $,
1004
1017
  centerY: v,
1005
1018
  size: l,
1006
- isExpanded: g.isExpanded
1019
+ isExpanded: y.isExpanded
1007
1020
  }
1008
1021
  ]);
1009
1022
  }
1010
- return { segmentsByItem: b, glyphsByItem: S };
1011
- }, tr = Dt(
1023
+ return { segmentsByItem: h, glyphsByItem: b };
1024
+ }, or = Ft(
1012
1025
  ({
1013
1026
  entry: e,
1014
1027
  indentLevel: t,
1015
1028
  originX: n,
1016
1029
  depth: r,
1017
- positionInSet: o,
1030
+ positionInSet: a,
1018
1031
  setSize: i,
1019
1032
  isSelectedForAria: l,
1020
1033
  flatIndex: d,
1021
- isActive: b,
1022
- registerRowRef: S,
1023
- onNavigationKeyDown: w,
1024
- onRowFocus: R,
1034
+ isActive: h,
1035
+ registerRowRef: b,
1036
+ onNavigationKeyDown: N,
1037
+ onRowFocus: x,
1025
1038
  onRowBlur: k,
1026
- rowHeight: h,
1027
- entryKindDirectory: g,
1028
- entryKindFile: m,
1029
- isDirOpen: p,
1030
- expansion: { toggleDirectory: v, onToggleDirectoryRecursive: M },
1031
- selection: { onEntryClick: P, selectedPath: C, currentPath: y, mode: F = "none", selectedItems: $, onSelectionChange: O },
1039
+ rowHeight: m,
1040
+ entryKindDirectory: y,
1041
+ entryKindFile: p,
1042
+ isDirOpen: w,
1043
+ expansion: { toggleDirectory: v, onToggleDirectoryRecursive: F },
1044
+ selection: { onEntryClick: P, selectedPath: C, currentPath: g, mode: D = "none", selectedItems: $, onSelectionChange: O },
1032
1045
  visual: {
1033
1046
  iconOverrides: Q,
1034
1047
  showExpandIcons: J = !0,
1035
- showDirectoryIcons: W = !0,
1036
- showFileIcons: Y = !0,
1037
- useCanvasExpandIcons: fe = !1,
1038
- expandIconSize: B,
1048
+ showDirectoryIcons: M = !0,
1049
+ showFileIcons: B = !0,
1050
+ useCanvasExpandIcons: me = !1,
1051
+ expandIconSize: W,
1039
1052
  typeIconSize: oe,
1040
- fontSize: he,
1053
+ fontSize: pe,
1041
1054
  indentSize: V,
1042
- highlightStyles: K,
1043
- entryClassName: we,
1044
- entryStyle: ye,
1045
- nameClassName: s,
1055
+ highlightStyles: X,
1056
+ entryClassName: xe,
1057
+ entryStyle: be,
1058
+ nameClassName: o,
1046
1059
  nameStyle: u,
1047
- directoryNameClassName: N,
1060
+ directoryNameClassName: I,
1048
1061
  directoryNameStyle: E,
1049
- fileNameClassName: ge,
1062
+ fileNameClassName: ve,
1050
1063
  fileNameStyle: T,
1051
1064
  expandIconClassName: j,
1052
1065
  expandIconStyle: ee
1053
1066
  }
1054
1067
  }) => {
1055
- Be(e.style, { option: "entry.style", absolutePath: e.absolutePath });
1056
- const [me, Ie] = de(!1), A = e.children !== void 0, be = A && p(e.absolutePath), Z = e.absolutePath === C, Le = e.absolutePath === y, se = !A && $?.has(e.absolutePath), te = _((ne) => S(d, ne), [S, d]), le = A ? void 0 : Wn(e), Ne = Xn({ entry: e, isDirectory: A, isExpanded: be, isItemSelected: !!se, selectionMode: F, onSelectionChange: O, onEntryClick: P, toggleDirectory: v, onToggleDirectoryRecursive: M }), _e = me ? K?.hoverClassName !== void 0 ? K.hoverClassName : D.entryHover : "", Te = (() => {
1068
+ Ge(e.style, { option: "entry.style", absolutePath: e.absolutePath });
1069
+ const [ye, Ne] = fe(!1), A = e.children !== void 0, Se = A && w(e.absolutePath), Z = e.absolutePath === C, $e = e.absolutePath === g, se = !A && $?.has(e.absolutePath), te = _((ne) => b(d, ne), [b, d]), ie = A ? void 0 : Yn(e), ke = Un({ entry: e, isDirectory: A, isExpanded: Se, isItemSelected: !!se, selectionMode: D, onSelectionChange: O, onEntryClick: P, toggleDirectory: v, onToggleDirectoryRecursive: F }), Oe = ye ? X?.hoverClassName !== void 0 ? X.hoverClassName : L.entryHover : "", Pe = (() => {
1057
1070
  if (A) {
1058
1071
  if (Z)
1059
- return K?.directorySelectedClassName !== void 0 ? K.directorySelectedClassName : D.entrySelected;
1072
+ return X?.directorySelectedClassName !== void 0 ? X.directorySelectedClassName : L.entrySelected;
1060
1073
  } else if (Z || se)
1061
- return K?.itemSelectedClassName !== void 0 ? K.itemSelectedClassName : L(Z && D.entrySelected, se && D.entryItemSelected);
1074
+ return X?.itemSelectedClassName !== void 0 ? X.itemSelectedClassName : U(Z && L.entrySelected, se && L.entryItemSelected);
1062
1075
  return "";
1063
- })(), De = L(D.entry, _e, Te, we, e.className), xe = L(D.expandIcon, j, (Z || se) && D.expandIconSelected), X = L(D.typeIcon, (Z || se) && D.typeIconSelected), Ye = L(D.name, s, A && D.nameDirectory, A && N, !A && ge, (Z || se) && D.nameSelected), Qe = Hn({ isDirectory: A, isExpanded: be, showExpandIcons: J && t >= 0, useCanvasExpandIcons: fe, expandIconSize: B }), mt = (A ? W : Y) ? Bn({ entry: e, isDirectory: A, isExpanded: be, isSelected: Z, isItemSelected: !!se, extension: le, mimeType: e.mimeType }, Q, oe) : null, Ge = {
1064
- ...me ? K?.hoverStyle : {},
1065
- ...A && Z ? K?.directorySelectedStyle : {},
1066
- ...!A && (Z || se) ? K?.itemSelectedStyle : {}
1067
- }, Xe = Yn(e.data), et = { width: oe, height: oe }, tt = zn(he), ve = n + t * V;
1076
+ })(), Fe = U(L.entry, Oe, Pe, xe, e.className), Re = U(L.expandIcon, j, (Z || se) && L.expandIconSelected), G = U(L.typeIcon, (Z || se) && L.typeIconSelected), Ve = U(L.name, o, A && L.nameDirectory, A && I, !A && ve, (Z || se) && L.nameSelected), tt = Gn({ isDirectory: A, isExpanded: Se, showExpandIcons: J && t >= 0, useCanvasExpandIcons: me, expandIconSize: W }), yt = (A ? M : B) ? Vn({ entry: e, isDirectory: A, isExpanded: Se, isSelected: Z, isItemSelected: !!se, extension: ie, mimeType: e.mimeType }, Q, oe) : null, Xe = {
1077
+ ...ye ? X?.hoverStyle : {},
1078
+ ...A && Z ? X?.directorySelectedStyle : {},
1079
+ ...!A && (Z || se) ? X?.itemSelectedStyle : {}
1080
+ }, Ke = Xn(e.data), nt = { width: oe, height: oe }, rt = Bn(pe), we = n + t * V;
1068
1081
  return /* @__PURE__ */ f.jsxs(
1069
1082
  "div",
1070
1083
  {
1071
- className: De,
1084
+ className: Fe,
1072
1085
  style: {
1073
- ...tt,
1074
- ...Ge,
1075
- ...ye,
1086
+ ...rt,
1087
+ ...Xe,
1088
+ ...be,
1076
1089
  ...e.style,
1077
1090
  // 箱の性質はホストのスタイルの後に書く。スプレッドは値が undefined のキーも写し、React はそれを空にするため、
1078
1091
  // 前に書くと検査が通す { height: undefined } が行の高さを消す
1079
- paddingLeft: `${Math.max(0, ve)}px`,
1080
- transform: ve < 0 ? `translateX(${ve}px)` : void 0,
1081
- width: ve < 0 ? `calc(100% + ${-ve}px)` : void 0,
1082
- height: `${h}px`
1092
+ paddingLeft: `${Math.max(0, we)}px`,
1093
+ transform: we < 0 ? `translateX(${we}px)` : void 0,
1094
+ width: we < 0 ? `calc(100% + ${-we}px)` : void 0,
1095
+ height: `${m}px`
1083
1096
  },
1084
- ...Xe,
1097
+ ...Ke,
1085
1098
  "data-entry-type": A ? "directory" : "file",
1086
- "data-entry-expanded": A ? String(be) : void 0,
1099
+ "data-entry-expanded": A ? String(Se) : void 0,
1087
1100
  "data-entry-selected": Z ? "true" : void 0,
1088
1101
  "data-entry-item-selected": se ? "true" : void 0,
1089
- onClick: Ne,
1090
- onMouseEnter: () => Ie(!0),
1091
- onMouseLeave: () => Ie(!1),
1092
- onFocus: (ne) => R(d, e.absolutePath, ne.currentTarget),
1102
+ onClick: ke,
1103
+ onMouseEnter: () => Ne(!0),
1104
+ onMouseLeave: () => Ne(!1),
1105
+ onFocus: (ne) => x(d, e.absolutePath, ne.currentTarget),
1093
1106
  onBlur: (ne) => k(e.absolutePath, ne.currentTarget),
1094
1107
  ref: te,
1095
1108
  onKeyDown: (ne) => {
1096
1109
  if (ne.key === "Enter" || ne.key === " ") {
1097
- ne.preventDefault(), ne.repeat || Ne(ne);
1110
+ ne.preventDefault(), ne.repeat || ke(ne);
1098
1111
  return;
1099
1112
  }
1100
- w(ne, d);
1113
+ N(ne, d);
1101
1114
  },
1102
- tabIndex: b ? 0 : -1,
1115
+ tabIndex: h ? 0 : -1,
1103
1116
  role: "treeitem",
1104
- "aria-expanded": A ? be : void 0,
1117
+ "aria-expanded": A ? Se : void 0,
1105
1118
  "aria-level": r + 1,
1106
- "aria-posinset": o,
1119
+ "aria-posinset": a,
1107
1120
  "aria-setsize": i,
1108
- "aria-selected": F === "none" ? void 0 : l,
1109
- "aria-current": Le ? "page" : void 0,
1110
- "aria-label": `${e.name} (${A ? g : m})`,
1121
+ "aria-selected": D === "none" ? void 0 : l,
1122
+ "aria-current": $e ? "page" : void 0,
1123
+ "aria-label": `${e.name} (${A ? y : p})`,
1111
1124
  children: [
1112
- (J || fe) && /* @__PURE__ */ f.jsx("span", { className: xe, style: { ...ee, width: ce, height: ce }, children: Qe }),
1113
- (A ? W : Y) && /* @__PURE__ */ f.jsx("span", { className: X, style: et, children: mt }),
1125
+ (J || me) && /* @__PURE__ */ f.jsx("span", { className: Re, style: { ...ee, width: de, height: de }, children: tt }),
1126
+ (A ? M : B) && /* @__PURE__ */ f.jsx("span", { className: G, style: nt, children: yt }),
1114
1127
  /* @__PURE__ */ f.jsx(
1115
1128
  "span",
1116
1129
  {
1117
- className: Ye,
1130
+ className: Ve,
1118
1131
  style: {
1119
- ...tt,
1132
+ ...rt,
1120
1133
  ...u,
1121
1134
  ...A ? E : T
1122
1135
  },
@@ -1131,634 +1144,642 @@ const jo = (e) => {
1131
1144
  },
1132
1145
  (e, t) => {
1133
1146
  if (e.entry !== t.entry) return !1;
1134
- const n = e.entry.children !== void 0, r = t.entry.children !== void 0, o = n && e.isDirOpen(e.entry.absolutePath), i = r && t.isDirOpen(t.entry.absolutePath);
1147
+ const n = e.entry.children !== void 0, r = t.entry.children !== void 0, a = n && e.isDirOpen(e.entry.absolutePath), i = r && t.isDirOpen(t.entry.absolutePath);
1135
1148
  return e.indentLevel === t.indentLevel && e.originX === t.originX && // 位置情報は aria として描画されるため、変化したら再描画が必要
1136
1149
  e.depth === t.depth && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.isSelectedForAria === t.isSelectedForAria && e.flatIndex === t.flatIndex && e.isActive === t.isActive && e.rowHeight === t.rowHeight && // 種別語はアクセシブルネームとして描画されるため、ロケール / 上書きの変更で再描画が必要
1137
- e.entryKindDirectory === t.entryKindDirectory && e.entryKindFile === t.entryKindFile && o === i && e.selection.selectedPath === t.selection.selectedPath && e.selection.currentPath === t.selection.currentPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual.iconOverrides === t.visual.iconOverrides && e.visual.showExpandIcons === t.visual.showExpandIcons && e.visual.showDirectoryIcons === t.visual.showDirectoryIcons && e.visual.showFileIcons === t.visual.showFileIcons && e.visual.useCanvasExpandIcons === t.visual.useCanvasExpandIcons && e.visual.expandIconSize === t.visual.expandIconSize && e.visual.typeIconSize === t.visual.typeIconSize && e.visual.fontSize === t.visual.fontSize && e.visual.indentSize === t.visual.indentSize && e.visual.highlightStyles === t.visual.highlightStyles && e.visual.entryClassName === t.visual.entryClassName && e.visual.entryStyle === t.visual.entryStyle && e.visual.nameClassName === t.visual.nameClassName && e.visual.nameStyle === t.visual.nameStyle && e.visual.directoryNameClassName === t.visual.directoryNameClassName && e.visual.directoryNameStyle === t.visual.directoryNameStyle && e.visual.fileNameClassName === t.visual.fileNameClassName && e.visual.fileNameStyle === t.visual.fileNameStyle && e.visual.expandIconClassName === t.visual.expandIconClassName && e.visual.expandIconStyle === t.visual.expandIconStyle;
1150
+ e.entryKindDirectory === t.entryKindDirectory && e.entryKindFile === t.entryKindFile && a === i && e.selection.selectedPath === t.selection.selectedPath && e.selection.currentPath === t.selection.currentPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual.iconOverrides === t.visual.iconOverrides && e.visual.showExpandIcons === t.visual.showExpandIcons && e.visual.showDirectoryIcons === t.visual.showDirectoryIcons && e.visual.showFileIcons === t.visual.showFileIcons && e.visual.useCanvasExpandIcons === t.visual.useCanvasExpandIcons && e.visual.expandIconSize === t.visual.expandIconSize && e.visual.typeIconSize === t.visual.typeIconSize && e.visual.fontSize === t.visual.fontSize && e.visual.indentSize === t.visual.indentSize && e.visual.highlightStyles === t.visual.highlightStyles && e.visual.entryClassName === t.visual.entryClassName && e.visual.entryStyle === t.visual.entryStyle && e.visual.nameClassName === t.visual.nameClassName && e.visual.nameStyle === t.visual.nameStyle && e.visual.directoryNameClassName === t.visual.directoryNameClassName && e.visual.directoryNameStyle === t.visual.directoryNameStyle && e.visual.fileNameClassName === t.visual.fileNameClassName && e.visual.fileNameStyle === t.visual.fileNameStyle && e.visual.expandIconClassName === t.visual.expandIconClassName && e.visual.expandIconStyle === t.visual.expandIconStyle;
1138
1151
  }
1139
1152
  );
1140
- tr.displayName = "DirectoryEntryItem";
1141
- const nr = (e) => {
1153
+ or.displayName = "DirectoryEntryItem";
1154
+ const sr = (e) => {
1142
1155
  const t = [];
1143
1156
  if (e.children)
1144
1157
  for (const n of e.children)
1145
- n.type === "directory" && (t.push(n.absolutePath), t.push(...nr(n)));
1158
+ n.type === "directory" && (t.push(n.absolutePath), t.push(...sr(n)));
1146
1159
  return t;
1147
- }, Vo = ({
1160
+ }, Uo = ({
1148
1161
  entries: e,
1149
- expansion: { toggle: t, isExpanded: n, expandMultiple: r, collapseMultiple: o, isPending: i, alwaysExpanded: l = !1, doubleClickAction: d = "recursive" },
1150
- selection: { onEntryClick: b, selectedPath: S, currentPath: w, mode: R = "none", selectedItems: k, onSelectionChange: h },
1162
+ expansion: { toggle: t, isExpanded: n, expandMultiple: r, collapseMultiple: a, isPending: i, alwaysExpanded: l = !1, doubleClickAction: d = "recursive" },
1163
+ selection: { onEntryClick: h, selectedPath: b, currentPath: N, mode: x = "none", selectedItems: k, onSelectionChange: m },
1151
1164
  visual: {
1152
- className: g,
1153
- style: m,
1154
- ariaLabel: p,
1165
+ className: y,
1166
+ style: p,
1167
+ ariaLabel: w,
1155
1168
  ariaLabelledBy: v,
1156
- lineColor: M = "#A0AEC0",
1169
+ lineColor: F = Hn,
1157
1170
  showTreeLines: P = !0,
1158
1171
  showExpandIcons: C = !0,
1159
- showDirectoryIcons: y = !0,
1160
- showFileIcons: F = !0,
1172
+ showDirectoryIcons: g = !0,
1173
+ showFileIcons: D = !0,
1161
1174
  iconOverrides: $,
1162
1175
  expandIconSize: O,
1163
1176
  typeIconSize: Q,
1164
1177
  fontSize: J,
1165
- indentSize: W,
1166
- itemHeight: Y = _t,
1167
- removeRootIndent: fe = !1,
1168
- highlightStyles: B,
1178
+ indentSize: M,
1179
+ itemHeight: B = Ot,
1180
+ removeRootIndent: me = !1,
1181
+ highlightStyles: W,
1169
1182
  entryClassName: oe,
1170
- entryStyle: he,
1183
+ entryStyle: pe,
1171
1184
  nameClassName: V,
1172
- nameStyle: K,
1173
- directoryNameClassName: we,
1174
- directoryNameStyle: ye,
1175
- fileNameClassName: s,
1185
+ nameStyle: X,
1186
+ directoryNameClassName: xe,
1187
+ directoryNameStyle: be,
1188
+ fileNameClassName: o,
1176
1189
  fileNameStyle: u,
1177
- expandIconClassName: N,
1190
+ expandIconClassName: I,
1178
1191
  expandIconStyle: E
1179
1192
  } = {},
1180
- virtualScroll: ge,
1193
+ virtualScroll: ve,
1181
1194
  grid: T,
1182
1195
  sort: j,
1183
1196
  locale: ee,
1184
- labels: me,
1185
- ref: Ie
1197
+ labels: ye,
1198
+ ref: Ne
1186
1199
  }) => {
1187
- const A = $n(ee), be = z(() => po(ee, me), [ee, me]), Z = $o(yo(be)), { entryKindDirectory: Le, entryKindFile: se } = be, te = z(() => vo({ indentSize: W, typeIconSize: Q, fontSize: J }), [W, Q, J]);
1200
+ const A = Mn(ee), Se = z(() => bo(ee, ye), [ee, ye]), Z = Mo(vo(Se)), { entryKindDirectory: $e, entryKindFile: se } = Se, te = z(() => Eo({ indentSize: M, typeIconSize: Q, fontSize: J }), [M, Q, J]);
1188
1201
  z(() => {
1189
- Be(he, { option: "visual.entryStyle" }), Be(B?.hoverStyle, { option: "visual.highlightStyles.hoverStyle" }), Be(B?.directorySelectedStyle, { option: "visual.highlightStyles.directorySelectedStyle" }), Be(B?.itemSelectedStyle, { option: "visual.highlightStyles.itemSelectedStyle" }), oo(E, { option: "visual.expandIconStyle" });
1190
- }, [he, B, E]);
1191
- const le = T !== void 0, [Ne, _e] = de(!1), Te = G(null), De = G(null), xe = G(null), [X, Ye] = de(0), [Qe, mt] = de(0), [Ge, Xe] = de(0), [et, tt] = de(null), {
1192
- overscanCount: ve = 15,
1202
+ Ge(pe, { option: "visual.entryStyle" }), Ge(W?.hoverStyle, { option: "visual.highlightStyles.hoverStyle" }), Ge(W?.directorySelectedStyle, { option: "visual.highlightStyles.directorySelectedStyle" }), Ge(W?.itemSelectedStyle, { option: "visual.highlightStyles.itemSelectedStyle" }), io(E, { option: "visual.expandIconStyle" });
1203
+ }, [pe, W, E]);
1204
+ const ie = T !== void 0, [ke, Oe] = fe(!1), Pe = Y(null), Fe = Y(null), Re = Y(null), [G, Ve] = fe(0), [tt, yt] = fe(0), [Xe, Ke] = fe(0), [nt, rt] = fe(null), {
1205
+ overscanCount: we = 15,
1193
1206
  className: ne,
1194
- background: $t,
1195
- onScroll: Mt,
1196
- onRangeChange: zt,
1197
- onScrollAdjust: Wt,
1198
- liveRegion: Ht,
1199
- initialScrollIndex: Bt,
1200
- initialScrollOffset: Fe,
1201
- initialScrollAnchor: Yt,
1202
- callbackThrottleMs: Gt = 5,
1203
- contentInsets: Xt,
1204
- onItemFocus: Vt,
1205
- viewportHeightOverride: ie,
1206
- scrollBarOptions: pt,
1207
- behaviorOptions: Kt,
1208
- preserveScrollAnchor: Ut = !1,
1209
- getItemKey: rr,
1207
+ background: Mt,
1208
+ onScroll: Ht,
1209
+ onRangeChange: Wt,
1210
+ onScrollAdjust: Bt,
1211
+ liveRegion: Yt,
1212
+ initialScrollIndex: Gt,
1213
+ initialScrollOffset: ze,
1214
+ initialScrollAnchor: Vt,
1215
+ callbackThrottleMs: Xt = 5,
1216
+ contentInsets: Kt,
1217
+ onItemFocus: Ut,
1218
+ viewportHeightOverride: le,
1219
+ scrollBarOptions: gt,
1220
+ behaviorOptions: Jt,
1221
+ preserveScrollAnchor: Zt = !1,
1222
+ getItemKey: ar,
1210
1223
  // 素通しの pass-through。型で受け付けているものは実際に転送する
1211
- testId: Jt,
1212
- contentProps: yt
1213
- } = ge ?? {}, Zt = z(
1214
- () => le ? { ...yt, role: "rowgroup" } : { ...yt, role: "tree", "aria-label": v ? void 0 : p, "aria-labelledby": v, "aria-multiselectable": R === "multiple" ? !0 : void 0 },
1215
- [le, yt, p, v, R]
1216
- ), qt = z(() => ({ ...Kt, enableKeyboardNavigation: !1 }), [Kt]), [nt, Qt] = de(typeof Fe == "number" ? Fe : 0), gt = G(typeof Fe == "number" ? Fe : 0), en = _(
1217
- (a, c) => {
1218
- gt.current = a, Qt(a), Mt?.(a, c);
1224
+ testId: qt,
1225
+ contentProps: bt
1226
+ } = ve ?? {}, Qt = z(
1227
+ () => ie ? { ...bt, role: "rowgroup" } : {
1228
+ ...bt,
1229
+ role: "tree",
1230
+ "aria-label": v ? void 0 : w,
1231
+ "aria-labelledby": v,
1232
+ "aria-multiselectable": x === "multiple" ? !0 : void 0,
1233
+ "aria-busy": i ? !0 : void 0
1234
+ },
1235
+ [ie, bt, w, v, x, i]
1236
+ ), en = z(() => ({ ...Jt, enableKeyboardNavigation: !1 }), [Jt]), [ot, tn] = fe(typeof ze == "number" ? ze : 0), vt = Y(typeof ze == "number" ? ze : 0), nn = _(
1237
+ (s, c) => {
1238
+ vt.current = s, tn(s), Ht?.(s, c);
1219
1239
  },
1220
- [Mt]
1221
- ), tn = _(
1222
- (a) => {
1223
- const { renderingStartIndex: c, renderingEndIndex: x } = a;
1224
- tt((I) => I && I.renderStart === c && I.renderEnd === x ? I : { renderStart: c, renderEnd: x }), zt?.(a);
1240
+ [Ht]
1241
+ ), rn = _(
1242
+ (s) => {
1243
+ const { renderingStartIndex: c, renderingEndIndex: S } = s;
1244
+ rt((R) => R && R.renderStart === c && R.renderEnd === S ? R : { renderStart: c, renderEnd: S }), Wt?.(s);
1225
1245
  },
1226
- [zt]
1246
+ [Wt]
1227
1247
  );
1228
- Ae(() => {
1229
- _e(!0), Fo();
1230
- }, []), Ae(() => {
1231
- const a = Te.current, c = le ? De.current : a, x = () => {
1232
- if (a) {
1233
- const H = a.clientWidth;
1234
- mt((q) => Math.abs(q - H) > 1 ? H : q);
1248
+ De(() => {
1249
+ Oe(!0), zo();
1250
+ }, []), De(() => {
1251
+ const s = Pe.current, c = ie ? Fe.current : s, S = () => {
1252
+ if (s) {
1253
+ const H = s.clientWidth;
1254
+ yt((q) => Math.abs(q - H) > 1 ? H : q);
1235
1255
  }
1236
- if (typeof ie == "number")
1237
- Ye((H) => Math.abs(H - ie) > 1 ? ie : H);
1256
+ if (typeof le == "number")
1257
+ Ve((H) => Math.abs(H - le) > 1 ? le : H);
1238
1258
  else if (c) {
1239
1259
  const H = c.clientHeight;
1240
- Ye((q) => Math.abs(q - H) > 1 ? H : q);
1260
+ Ve((q) => Math.abs(q - H) > 1 ? H : q);
1241
1261
  }
1242
1262
  };
1243
- if (!(a || c)) return Ye(0);
1244
- x();
1245
- const I = new ResizeObserver(x);
1246
- return a && I.observe(a), c && c !== a && I.observe(c), () => I.disconnect();
1247
- }, [ie, le]);
1248
- const $e = typeof ie == "number" ? ie : X, Se = _((a) => l || (Ne ? n(a) : !1), [Ne, n, l]), nn = L(D.container, i && D.containerPending, g), rn = z(
1263
+ if (!(s || c)) return Ve(0);
1264
+ S();
1265
+ const R = new ResizeObserver(S);
1266
+ return s && R.observe(s), c && c !== s && R.observe(c), () => R.disconnect();
1267
+ }, [le, ie]);
1268
+ const Me = typeof le == "number" ? le : G, Ee = _((s) => l || (ke ? n(s) : !1), [ke, n, l]), on = U(L.container, i && L.containerPending, y), sn = z(
1249
1269
  () => ({
1250
- ...Do,
1251
- ...m ?? {},
1252
- ...typeof ie == "number" ? { height: ie, minHeight: ie } : {}
1270
+ ...Fo,
1271
+ ...p ?? {},
1272
+ ...typeof le == "number" ? { height: le, minHeight: le } : {}
1253
1273
  }),
1254
- [m, ie]
1255
- ), bt = _(
1256
- (a, c) => {
1257
- const x = [a.absolutePath, ...nr(a)], I = c || d;
1258
- if (x.every((Re) => Se(Re))) return o(x);
1259
- if (x.every((Re) => !Se(Re)) || I === "recursive") return r(x);
1260
- if (I === "toggle") return o(x);
1261
- console.warn(`[DirectoryTree] Unknown double click action: ${I}. No action taken.`);
1274
+ [p, le]
1275
+ ), St = _(
1276
+ (s, c) => {
1277
+ const S = [s.absolutePath, ...sr(s)], R = c || d;
1278
+ if (S.every((Te) => Ee(Te))) return a(S);
1279
+ if (S.every((Te) => !Ee(Te)) || R === "recursive") return r(S);
1280
+ if (R === "toggle") return a(S);
1281
+ console.warn(`[DirectoryTree] Unknown double click action: ${R}. No action taken.`);
1262
1282
  },
1263
- [Se, r, o, d]
1264
- ), vt = le ? !1 : fe, { flatItems: Ce, lineItems: St, maxIndent: on } = z(() => zo(e, Se, P, vt, j), [e, Se, P, vt, j]), rt = So({ indentSize: te.indentSize, removeRootIndent: vt, hasExpandBox: C || P }), pe = z(() => P ? xo(te, O, rt) : null, [P, te, O, rt]), U = z(() => Ce.map((a, c) => ({ ...a, rowHeight: wo(Y, a.entry, c) })), [Ce, Y]), ke = z(() => U.map((a) => a.rowHeight), [U]), Oe = z(() => {
1265
- const a = new Array(ke.length + 1);
1266
- a[0] = 0;
1267
- for (let c = 0; c < ke.length; c++)
1268
- a[c + 1] = a[c] + ke[c];
1269
- return a;
1270
- }, [ke]), sn = _((a) => U[a]?.rowHeight ?? _t, [U]), or = _((a) => U[a]?.entry.absolutePath ?? a, [U]), an = rr ?? or, Me = S ?? null, wt = w ?? null, [ln, Ve] = de(() => ({ selectedPath: Me, selectionGeneration: 0, anchor: null })), xt = An(ln, Me);
1271
- xt !== ln && Ve((a) => An(a, Me));
1272
- const ot = z(() => jo(Ce), [Ce]), ze = z(() => Lo(ot, xt), [ot, xt]), Ke = G(/* @__PURE__ */ new Map()), st = G(null), [at] = de(go), Ue = G(null), [sr, cn] = de(!0), Et = G(Ce);
1273
- Et.current = Ce;
1274
- const dn = G(Se);
1275
- dn.current = Se;
1276
- const Rt = G(t);
1277
- Rt.current = t;
1278
- const un = G(ot);
1279
- un.current = ot;
1280
- const It = G(ze);
1281
- It.current = ze;
1282
- const fn = G(Vt);
1283
- fn.current = Vt;
1284
- const je = _((a) => {
1285
- const c = xe.current;
1286
- return !c || c.getViewportSize() <= 0 ? !1 : (c.scrollToIndex(a, { align: "nearest" }), !0);
1287
- }, []), Ee = _(
1288
- (a) => {
1289
- const c = Ke.current.get(a);
1283
+ [Ee, r, a, d]
1284
+ ), wt = ie ? !1 : me, { flatItems: je, lineItems: Et, maxIndent: an } = z(() => Wo(e, Ee, P, wt, j), [e, Ee, P, wt, j]), st = xo({ indentSize: te.indentSize, removeRootIndent: wt, hasExpandBox: C || P }), ge = z(() => P ? Io(te, O, st) : null, [P, te, O, st]), K = z(() => je.map((s, c) => ({ ...s, rowHeight: Ro(B, s.entry, c) })), [je, B]), _e = z(() => K.map((s) => s.rowHeight), [K]), Ae = z(() => {
1285
+ const s = new Array(_e.length + 1);
1286
+ s[0] = 0;
1287
+ for (let c = 0; c < _e.length; c++)
1288
+ s[c + 1] = s[c] + _e[c];
1289
+ return s;
1290
+ }, [_e]), ln = _((s) => K[s]?.rowHeight ?? Ot, [K]), ir = _((s) => K[s]?.entry.absolutePath ?? s, [K]), cn = ar ?? ir, He = b ?? null, xt = N ?? null, [dn, Ue] = fe(() => ({ selectedPath: He, selectionGeneration: 0, anchor: null })), Rt = Dn(dn, He);
1291
+ Rt !== dn && Ue((s) => Dn(s, He));
1292
+ const at = z(() => Lo(je), [je]), We = z(() => $o(at, Rt), [at, Rt]), Je = Y(/* @__PURE__ */ new Map()), it = Y(null), [lt] = fe(So), Ze = Y(null), [lr, un] = fe(!0), It = Y(je);
1293
+ It.current = je;
1294
+ const fn = Y(Ee);
1295
+ fn.current = Ee;
1296
+ const Tt = Y(t);
1297
+ Tt.current = t;
1298
+ const hn = Y(at);
1299
+ hn.current = at;
1300
+ const Nt = Y(We);
1301
+ Nt.current = We;
1302
+ const mn = Y(Ut);
1303
+ mn.current = Ut;
1304
+ const Le = _((s) => {
1305
+ const c = Re.current;
1306
+ return !c || c.getViewportSize() <= 0 ? !1 : (c.scrollToIndex(s, { align: "nearest" }), !0);
1307
+ }, []), Ie = _(
1308
+ (s) => {
1309
+ const c = Je.current.get(s);
1290
1310
  if (c === void 0) {
1291
- Ue.current = a, je(a) || (Ue.current = null);
1311
+ Ze.current = s, Le(s) || (Ze.current = null);
1292
1312
  return;
1293
1313
  }
1294
- Ue.current = null, je(a), c.focus({ preventScroll: !0 });
1314
+ Ze.current = null, Le(s), c.focus({ preventScroll: !0 });
1295
1315
  },
1296
- [je]
1297
- ), hn = _((a, c) => {
1316
+ [Le]
1317
+ ), pn = _((s, c) => {
1298
1318
  if (c)
1299
- Ke.current.set(a, c), Ue.current === a ? (Ue.current = null, c.focus({ preventScroll: !0 })) : c.contains(c.ownerDocument.activeElement) && Ve((x) => x.anchor === null ? x : { ...x, anchor: { ...x.anchor, focused: !0 } });
1319
+ Je.current.set(s, c), Ze.current === s ? (Ze.current = null, c.focus({ preventScroll: !0 })) : c.contains(c.ownerDocument.activeElement) && Ue((S) => S.anchor === null ? S : { ...S, anchor: { ...S.anchor, focused: !0 } });
1300
1320
  else {
1301
- const x = Ke.current.get(a);
1302
- Ke.current.delete(a), x?.contains(x.ownerDocument.activeElement) && Ve((I) => I.anchor === null ? I : { ...I, anchor: { ...I.anchor, focused: !1 } });
1321
+ const S = Je.current.get(s);
1322
+ Je.current.delete(s), S?.contains(S.ownerDocument.activeElement) && Ue((R) => R.anchor === null ? R : { ...R, anchor: { ...R.anchor, focused: !1 } });
1303
1323
  }
1304
- a === It.current && cn(c !== null);
1324
+ s === Nt.current && un(c !== null);
1305
1325
  }, []);
1306
- En(() => {
1307
- cn(Ke.current.has(ze));
1308
- }, [ze]);
1309
- const Nt = _(
1310
- (a, c, x) => {
1311
- const I = st.current === x;
1312
- st.current = null, I || (Ve((H) => Ao(H, c)), at.landedOn(x) || je(a)), fn.current?.(a);
1326
+ In(() => {
1327
+ un(Je.current.has(We));
1328
+ }, [We]);
1329
+ const kt = _(
1330
+ (s, c, S) => {
1331
+ const R = it.current === S;
1332
+ it.current = null, R || (Ue((H) => Do(H, c)), lt.landedOn(S) || Le(s)), mn.current?.(s);
1313
1333
  },
1314
- [je, at]
1315
- ), lt = _((a) => at.mark(a.nativeEvent), [at]), Tt = _((a, c) => {
1316
- const { ownerDocument: x } = c;
1317
- if (!x.hasFocus() && c.contains(x.activeElement)) {
1318
- st.current = c;
1334
+ [Le, lt]
1335
+ ), ct = _((s) => lt.mark(s.nativeEvent), [lt]), Pt = _((s, c) => {
1336
+ const { ownerDocument: S } = c;
1337
+ if (!S.hasFocus() && c.contains(S.activeElement)) {
1338
+ it.current = c;
1319
1339
  return;
1320
1340
  }
1321
- st.current = null, Ve((I) => I.anchor !== null && I.anchor.path === a ? { ...I, anchor: { ...I.anchor, focused: !1 } } : I);
1322
- }, []), ar = _(() => Ee(It.current), [Ee]), kt = _(
1323
- (a, c) => {
1324
- const x = Dn(c), I = Et.current.length;
1325
- if (!Number.isInteger(a) || a < 0 || a >= I)
1326
- throw new RangeError(`[directory-tree] scrollToIndex: ${String(a)} is not a row index (${I === 0 ? "the tree has no rows" : `expected an integer in 0..${String(I - 1)}`}).`);
1327
- if (x === "nearest") {
1328
- je(a);
1341
+ it.current = null, Ue((R) => R.anchor !== null && R.anchor.path === s ? { ...R, anchor: { ...R.anchor, focused: !1 } } : R);
1342
+ }, []), cr = _(() => Ie(Nt.current), [Ie]), _t = _(
1343
+ (s, c) => {
1344
+ const S = Fn(c), R = It.current.length;
1345
+ if (!Number.isInteger(s) || s < 0 || s >= R)
1346
+ throw new RangeError(`[directory-tree] scrollToIndex: ${String(s)} is not a row index (${R === 0 ? "the tree has no rows" : `expected an integer in 0..${String(R - 1)}`}).`);
1347
+ if (S === "nearest") {
1348
+ Le(s);
1329
1349
  return;
1330
1350
  }
1331
- xe.current?.scrollToIndex(a, { align: x });
1351
+ Re.current?.scrollToIndex(s, { align: S });
1332
1352
  },
1333
- [je]
1353
+ [Le]
1334
1354
  );
1335
- hr(
1336
- Ie,
1355
+ yr(
1356
+ Ne,
1337
1357
  () => ({
1338
- scrollToIndex: kt,
1339
- scrollToPath: (a, c) => {
1340
- Dn(c);
1341
- const x = un.current.get(a);
1342
- return x === void 0 ? !1 : (kt(x, c), !0);
1358
+ scrollToIndex: _t,
1359
+ scrollToPath: (s, c) => {
1360
+ Fn(c);
1361
+ const S = hn.current.get(s);
1362
+ return S === void 0 ? !1 : (_t(S, c), !0);
1343
1363
  },
1344
- getScrollAnchor: () => xe.current?.getScrollAnchor() ?? null
1364
+ getScrollAnchor: () => Re.current?.getScrollAnchor() ?? null
1345
1365
  }),
1346
- [kt]
1366
+ [_t]
1347
1367
  );
1348
- const mn = _(
1349
- (a, c) => {
1350
- if (a.altKey || a.ctrlKey || a.metaKey)
1368
+ const yn = _(
1369
+ (s, c) => {
1370
+ if (s.altKey || s.ctrlKey || s.metaKey)
1351
1371
  return;
1352
- const x = Et.current, I = x.length - 1;
1353
- if (I < 0) return;
1354
- const H = x[c], q = H?.entry.children !== void 0, Re = q && dn.current(H.entry.absolutePath);
1355
- switch (a.key) {
1372
+ const S = It.current, R = S.length - 1;
1373
+ if (R < 0) return;
1374
+ const H = S[c], q = H?.entry.children !== void 0, Te = q && fn.current(H.entry.absolutePath);
1375
+ switch (s.key) {
1356
1376
  case "ArrowDown":
1357
- a.preventDefault(), Ee(Math.min(c + 1, I));
1377
+ s.preventDefault(), Ie(Math.min(c + 1, R));
1358
1378
  break;
1359
1379
  case "ArrowUp":
1360
- a.preventDefault(), Ee(Math.max(c - 1, 0));
1380
+ s.preventDefault(), Ie(Math.max(c - 1, 0));
1361
1381
  break;
1362
1382
  case "Home":
1363
- a.preventDefault(), Ee(0);
1383
+ s.preventDefault(), Ie(0);
1364
1384
  break;
1365
1385
  case "End":
1366
- a.preventDefault(), Ee(I);
1386
+ s.preventDefault(), Ie(R);
1367
1387
  break;
1368
1388
  case "ArrowRight":
1369
- a.preventDefault(), q && !Re ? Rt.current(H.entry.absolutePath) : q && c < I && x[c + 1].depth > H.depth && Ee(c + 1);
1389
+ s.preventDefault(), q && !Te ? Tt.current(H.entry.absolutePath) : q && c < R && S[c + 1].depth > H.depth && Ie(c + 1);
1370
1390
  break;
1371
1391
  case "ArrowLeft": {
1372
- if (a.preventDefault(), q && Re) {
1373
- Rt.current(H.entry.absolutePath);
1392
+ if (s.preventDefault(), q && Te) {
1393
+ Tt.current(H.entry.absolutePath);
1374
1394
  break;
1375
1395
  }
1376
- const ur = H?.depth ?? 0;
1377
- for (let ut = c - 1; ut >= 0; ut--)
1378
- if (x[ut].depth < ur) {
1379
- Ee(ut);
1396
+ const mr = H?.depth ?? 0;
1397
+ for (let ht = c - 1; ht >= 0; ht--)
1398
+ if (S[ht].depth < mr) {
1399
+ Ie(ht);
1380
1400
  break;
1381
1401
  }
1382
1402
  break;
1383
1403
  }
1384
1404
  }
1385
1405
  },
1386
- [Ee]
1387
- ), it = z(() => pe === null || St.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : Ho(St, ke, Oe, pe), [St, ke, Oe, pe]), ct = z(() => pe === null || e.length === 0 ? 0 : pe.originX + on * pe.indentSize + ce + pe.typeIconSize, [e.length, on, pe]), { renderStart: pn, renderEnd: yn, lookaheadEnd: gn } = z(
1388
- () => Wo(U.length, $e, ve, et, nt, Oe),
1389
- [U.length, $e, ve, et, nt, Oe]
1390
- ), Pt = z(() => pe === null || ct <= 0 || $e <= 0 || it.segmentsByItem.length === 0 ? null : /* @__PURE__ */ f.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ f.jsx("div", { className: "absolute top-0 left-0", style: { width: ct, height: $e }, children: /* @__PURE__ */ f.jsx(
1391
- er,
1406
+ [Ie]
1407
+ ), dt = z(() => ge === null || Et.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : Yo(Et, _e, Ae, ge), [Et, _e, Ae, ge]), ut = z(() => ge === null || e.length === 0 ? 0 : ge.originX + an * ge.indentSize + de + ge.typeIconSize, [e.length, an, ge]), { renderStart: gn, renderEnd: bn, lookaheadEnd: vn } = z(
1408
+ () => Bo(K.length, Me, we, nt, ot, Ae),
1409
+ [K.length, Me, we, nt, ot, Ae]
1410
+ ), Ct = z(() => ge === null || ut <= 0 || Me <= 0 || dt.segmentsByItem.length === 0 ? null : /* @__PURE__ */ f.jsx("div", { className: "pointer-events-none absolute inset-0 z-1", "aria-hidden": "true", children: /* @__PURE__ */ f.jsx("div", { className: "absolute top-0 left-0", style: { width: ut, height: Me }, children: /* @__PURE__ */ f.jsx(
1411
+ rr,
1392
1412
  {
1393
- segmentsByItem: it.segmentsByItem,
1394
- glyphsByItem: it.glyphsByItem,
1395
- itemHeight: ke[0] ?? _t,
1396
- width: ct,
1397
- viewportHeight: $e,
1398
- scrollPosition: nt,
1399
- color: M,
1400
- expandGlyphColor: M,
1401
- expandGlyphSize: pe.glyphSize,
1402
- renderStartIndex: pn,
1403
- renderEndIndex: yn,
1404
- lookaheadEndIndex: gn
1413
+ segmentsByItem: dt.segmentsByItem,
1414
+ glyphsByItem: dt.glyphsByItem,
1415
+ itemHeight: _e[0] ?? Ot,
1416
+ width: ut,
1417
+ viewportHeight: Me,
1418
+ scrollPosition: ot,
1419
+ color: F,
1420
+ expandGlyphColor: F,
1421
+ expandGlyphSize: ge.glyphSize,
1422
+ renderStartIndex: gn,
1423
+ renderEndIndex: bn,
1424
+ lookaheadEndIndex: vn
1405
1425
  }
1406
- ) }) }), [ct, $e, pn, yn, gn, nt, it, M, pe, ke]), bn = _((a) => U[a], [U]), vn = G(null);
1407
- En(() => {
1408
- const a = vn.current;
1409
- if (vn.current = { items: U, offsets: Oe }, !Ut || !a || a.items === U)
1426
+ ) }) }), [ut, Me, gn, bn, vn, ot, dt, F, ge, _e]), Sn = _((s) => K[s], [K]), wn = Y(null);
1427
+ In(() => {
1428
+ const s = wn.current;
1429
+ if (wn.current = { items: K, offsets: Ae }, !Zt || !s || s.items === K)
1410
1430
  return;
1411
- const c = xe.current, x = c?.getScrollPosition(), I = typeof x == "number" && x >= 0 ? x : gt.current, H = Io(a.items, a.offsets, I);
1431
+ const c = Re.current, S = c?.getScrollPosition(), R = typeof S == "number" && S >= 0 ? S : vt.current, H = ko(s.items, s.offsets, R);
1412
1432
  if (!H)
1413
1433
  return;
1414
- const q = No(H, U, Oe);
1415
- if (q === null || Math.abs(q - I) < 1)
1434
+ const q = Po(H, K, Ae);
1435
+ if (q === null || Math.abs(q - R) < 1)
1416
1436
  return;
1417
- const Re = c ? c.scrollTo(q) : q;
1418
- gt.current = Re, Qt(Re);
1419
- }, [U, Oe, Ut]);
1420
- const Pe = T?.columns, We = T?.scrollBarWidth ?? pt?.width ?? qn, re = z(() => Pe ? uo({ measuredWidth: Qe, columns: Pe, scrollBarWidth: We }) : null, [Pe, Qe, We]), dt = z(() => Pe ? co(Pe) : "", [Pe]), lr = z(() => T?.showFooter && Pe ? fo(e) : [], [T?.showFooter, Pe, e]), He = re?.maxHScroll ?? 0;
1421
- Ae(() => {
1422
- Xe((a) => Ct(a, He));
1423
- }, [He]);
1424
- const Sn = _((a) => Xe((c) => Ct(c + a, He)), [He]), wn = z(
1437
+ const Te = c ? c.scrollTo(q) : q;
1438
+ vt.current = Te, tn(Te);
1439
+ }, [K, Ae, Zt]);
1440
+ const Ce = T?.columns, Be = T?.scrollBarWidth ?? gt?.width ?? tr, re = z(() => Ce ? mo({ measuredWidth: tt, columns: Ce, scrollBarWidth: Be }) : null, [Ce, tt, Be]), ft = z(() => Ce ? ho(Ce) : "", [Ce]), dr = z(() => T?.showFooter && Ce ? po(e) : [], [T?.showFooter, Ce, e]), Ye = re?.maxHScroll ?? 0;
1441
+ De(() => {
1442
+ Ke((s) => jt(s, Ye));
1443
+ }, [Ye]);
1444
+ const En = _((s) => Ke((c) => jt(c + s, Ye)), [Ye]), xn = z(
1425
1445
  () => ({
1426
1446
  iconOverrides: $,
1427
1447
  showExpandIcons: C,
1428
- showDirectoryIcons: y,
1429
- showFileIcons: F,
1448
+ showDirectoryIcons: g,
1449
+ showFileIcons: D,
1430
1450
  useCanvasExpandIcons: P,
1431
1451
  expandIconSize: O,
1432
1452
  typeIconSize: te.typeIconSize,
1433
1453
  fontSize: te.fontSize,
1434
1454
  indentSize: te.indentSize,
1435
- highlightStyles: B,
1436
- expandIconClassName: N,
1455
+ highlightStyles: W,
1456
+ expandIconClassName: I,
1437
1457
  expandIconStyle: E
1438
1458
  }),
1439
- [$, C, y, F, P, O, te, B, N, E]
1440
- ), xn = z(
1459
+ [$, C, g, D, P, O, te, W, I, E]
1460
+ ), Rn = z(
1441
1461
  () => /* @__PURE__ */ f.jsx(
1442
- yr,
1462
+ vr,
1443
1463
  {
1444
- ref: xe,
1445
- itemCount: U.length,
1446
- getItem: bn,
1447
- getItemHeight: sn,
1448
- getItemKey: an,
1449
- testId: Jt,
1450
- contentProps: Zt,
1464
+ ref: Re,
1465
+ itemCount: K.length,
1466
+ getItem: Sn,
1467
+ getItemHeight: ln,
1468
+ getItemKey: cn,
1469
+ testId: qt,
1470
+ contentProps: Qt,
1451
1471
  locale: A,
1452
1472
  labels: Z,
1453
- viewportSize: typeof ie == "number" ? ie : void 0,
1454
- overscanCount: ve,
1455
- onScroll: en,
1456
- onRangeChange: tn,
1457
- onScrollAdjust: Wt,
1458
- liveRegion: Ht,
1473
+ viewportSize: typeof le == "number" ? le : void 0,
1474
+ overscanCount: we,
1475
+ onScroll: nn,
1476
+ onRangeChange: rn,
1477
+ onScrollAdjust: Bt,
1478
+ liveRegion: Yt,
1459
1479
  className: ne,
1460
- onWheelHorizontal: le ? Sn : void 0,
1480
+ onWheelHorizontal: ie ? En : void 0,
1461
1481
  background: /* @__PURE__ */ f.jsxs(f.Fragment, { children: [
1462
- le && re ? (
1482
+ ie && re ? (
1463
1483
  // Clip the connector-line canvas to the frozen name column so deep trees never bleed into the numeric region.
1464
- /* @__PURE__ */ f.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width: re.nameWidth }, "aria-hidden": "true", children: Pt })
1465
- ) : Pt,
1466
- $t
1484
+ /* @__PURE__ */ f.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-1 h-full overflow-hidden", style: { width: re.nameWidth }, "aria-hidden": "true", children: Ct })
1485
+ ) : Ct,
1486
+ Mt
1467
1487
  ] }),
1468
- initialScrollIndex: Bt,
1469
- initialScrollOffset: Fe,
1470
- initialScrollAnchor: Yt,
1471
- callbackThrottleMs: Gt,
1472
- contentInsets: Xt,
1473
- scrollBarOptions: pt,
1474
- behaviorOptions: qt,
1475
- children: (a, c) => a ? le && T && re ? /* @__PURE__ */ f.jsx(
1476
- Un,
1488
+ initialScrollIndex: Gt,
1489
+ initialScrollOffset: ze,
1490
+ initialScrollAnchor: Vt,
1491
+ callbackThrottleMs: Xt,
1492
+ contentInsets: Kt,
1493
+ scrollBarOptions: gt,
1494
+ behaviorOptions: en,
1495
+ children: (s, c) => s ? ie && T && re ? /* @__PURE__ */ f.jsx(
1496
+ qn,
1477
1497
  {
1478
- entry: a.entry,
1479
- indentLevel: a.indentLevel,
1480
- positionInSet: a.positionInSet,
1481
- setSize: a.setSize,
1498
+ entry: s.entry,
1499
+ indentLevel: s.indentLevel,
1500
+ positionInSet: s.positionInSet,
1501
+ setSize: s.setSize,
1482
1502
  rowIndex: c + (T.showHeader ?? !0 ? 2 : 1),
1483
1503
  flatIndex: c,
1484
- onRowFocus: Nt,
1485
- onRowBlur: Tt,
1486
- isSelectedForAria: !!k?.has(a.entry.absolutePath),
1487
- rowHeight: a.rowHeight,
1488
- isDirOpen: Se,
1504
+ onRowFocus: kt,
1505
+ onRowBlur: Pt,
1506
+ isSelectedForAria: !!k?.has(s.entry.absolutePath),
1507
+ rowHeight: s.rowHeight,
1508
+ isDirOpen: Ee,
1489
1509
  columns: T.columns,
1490
- numericTemplate: dt,
1510
+ numericTemplate: ft,
1491
1511
  numericTotal: re.numericTotal,
1492
1512
  nameWidth: re.nameWidth,
1493
1513
  rowClassName: T.rowClassName,
1494
- selection: { onEntryClick: b, selectedPath: Me, currentPath: wt, mode: R, selectedItems: k, onSelectionChange: h },
1495
- expansion: { toggleDirectory: t, onToggleDirectoryRecursive: bt },
1496
- visual: wn
1514
+ selection: { onEntryClick: h, selectedPath: He, currentPath: xt, mode: x, selectedItems: k, onSelectionChange: m },
1515
+ expansion: { toggleDirectory: t, onToggleDirectoryRecursive: St },
1516
+ visual: xn
1497
1517
  },
1498
- a.entry.absolutePath
1518
+ s.entry.absolutePath
1499
1519
  ) : /* @__PURE__ */ f.jsx(
1500
- tr,
1520
+ or,
1501
1521
  {
1502
- entry: a.entry,
1503
- indentLevel: a.indentLevel,
1504
- originX: rt,
1505
- depth: a.depth,
1506
- positionInSet: a.positionInSet,
1507
- setSize: a.setSize,
1508
- isSelectedForAria: !!k?.has(a.entry.absolutePath),
1522
+ entry: s.entry,
1523
+ indentLevel: s.indentLevel,
1524
+ originX: st,
1525
+ depth: s.depth,
1526
+ positionInSet: s.positionInSet,
1527
+ setSize: s.setSize,
1528
+ isSelectedForAria: !!k?.has(s.entry.absolutePath),
1509
1529
  flatIndex: c,
1510
- isActive: c === ze,
1511
- registerRowRef: hn,
1512
- onNavigationKeyDown: mn,
1513
- onRowFocus: Nt,
1514
- onRowBlur: Tt,
1515
- rowHeight: a.rowHeight,
1516
- entryKindDirectory: Le,
1530
+ isActive: c === We,
1531
+ registerRowRef: pn,
1532
+ onNavigationKeyDown: yn,
1533
+ onRowFocus: kt,
1534
+ onRowBlur: Pt,
1535
+ rowHeight: s.rowHeight,
1536
+ entryKindDirectory: $e,
1517
1537
  entryKindFile: se,
1518
- isDirOpen: Se,
1519
- expansion: { toggleDirectory: t, onToggleDirectoryRecursive: bt },
1520
- selection: { onEntryClick: b, selectedPath: Me, currentPath: wt, mode: R, selectedItems: k, onSelectionChange: h },
1538
+ isDirOpen: Ee,
1539
+ expansion: { toggleDirectory: t, onToggleDirectoryRecursive: St },
1540
+ selection: { onEntryClick: h, selectedPath: He, currentPath: xt, mode: x, selectedItems: k, onSelectionChange: m },
1521
1541
  visual: {
1522
1542
  iconOverrides: $,
1523
1543
  showExpandIcons: C,
1524
- showDirectoryIcons: y,
1525
- showFileIcons: F,
1544
+ showDirectoryIcons: g,
1545
+ showFileIcons: D,
1526
1546
  useCanvasExpandIcons: P,
1527
1547
  expandIconSize: O,
1528
1548
  typeIconSize: te.typeIconSize,
1529
1549
  fontSize: te.fontSize,
1530
1550
  indentSize: te.indentSize,
1531
- highlightStyles: B,
1551
+ highlightStyles: W,
1532
1552
  entryClassName: oe,
1533
- entryStyle: he,
1553
+ entryStyle: pe,
1534
1554
  nameClassName: V,
1535
- nameStyle: K,
1536
- directoryNameClassName: we,
1537
- directoryNameStyle: ye,
1538
- fileNameClassName: s,
1555
+ nameStyle: X,
1556
+ directoryNameClassName: xe,
1557
+ directoryNameStyle: be,
1558
+ fileNameClassName: o,
1539
1559
  fileNameStyle: u,
1540
- expandIconClassName: N,
1560
+ expandIconClassName: I,
1541
1561
  expandIconStyle: E
1542
1562
  }
1543
1563
  },
1544
- a.entry.absolutePath
1564
+ s.entry.absolutePath
1545
1565
  ) : null
1546
1566
  }
1547
1567
  ),
1548
1568
  [
1549
- U.length,
1550
- bn,
1551
- sn,
1552
- an,
1553
- Jt,
1554
- Zt,
1569
+ K.length,
1570
+ Sn,
1571
+ ln,
1572
+ cn,
1573
+ qt,
1574
+ Qt,
1555
1575
  A,
1556
1576
  Z,
1557
- Le,
1577
+ $e,
1558
1578
  se,
1559
- ze,
1560
- hn,
1561
- mn,
1562
- Nt,
1563
- Tt,
1564
- ie,
1565
- ve,
1566
- en,
1567
- tn,
1568
- Wt,
1569
- Ht,
1570
- ne,
1571
- le,
1572
- Sn,
1573
- re,
1579
+ We,
1580
+ pn,
1581
+ yn,
1582
+ kt,
1574
1583
  Pt,
1575
- $t,
1584
+ le,
1585
+ we,
1586
+ nn,
1587
+ rn,
1576
1588
  Bt,
1577
- Fe,
1578
1589
  Yt,
1590
+ ne,
1591
+ ie,
1592
+ En,
1593
+ re,
1594
+ Ct,
1595
+ Mt,
1579
1596
  Gt,
1597
+ ze,
1598
+ Vt,
1580
1599
  Xt,
1581
- pt,
1582
- qt,
1600
+ Kt,
1601
+ gt,
1602
+ en,
1583
1603
  T,
1584
- dt,
1585
- Se,
1586
- b,
1587
- Me,
1588
- wt,
1589
- R,
1590
- k,
1604
+ ft,
1605
+ Ee,
1591
1606
  h,
1607
+ He,
1608
+ xt,
1609
+ x,
1610
+ k,
1611
+ m,
1592
1612
  t,
1593
- bt,
1594
- wn,
1613
+ St,
1614
+ xn,
1595
1615
  $,
1596
1616
  C,
1597
- y,
1598
- F,
1617
+ g,
1618
+ D,
1599
1619
  P,
1600
1620
  O,
1601
1621
  te,
1602
- rt,
1603
- B,
1622
+ st,
1623
+ W,
1604
1624
  oe,
1605
- he,
1625
+ pe,
1606
1626
  V,
1607
- K,
1608
- we,
1609
- ye,
1610
- s,
1627
+ X,
1628
+ xe,
1629
+ be,
1630
+ o,
1611
1631
  u,
1612
- N,
1632
+ I,
1613
1633
  E
1614
1634
  ]
1615
1635
  );
1616
1636
  if (!(T && re))
1617
- return /* @__PURE__ */ f.jsxs("div", { ref: Te, className: nn, style: rn, onPointerDownCapture: lt, onMouseDownCapture: lt, children: [
1618
- Ce.length > 0 && !sr && // biome-ignore lint/a11y/noNoninteractiveTabindex: 停止点の行が描画窓の外で DOM に無い間だけ Tab を受け、受けた瞬間にその行へ焦点を渡す。これが無いとツリーに Tab で入れない
1637
+ return /* @__PURE__ */ f.jsxs("div", { ref: Pe, className: on, style: sn, onPointerDownCapture: ct, onMouseDownCapture: ct, children: [
1638
+ je.length > 0 && !lr && // biome-ignore lint/a11y/noNoninteractiveTabindex: 停止点の行が描画窓の外で DOM に無い間だけ Tab を受け、受けた瞬間にその行へ焦点を渡す。これが無いとツリーに Tab で入れない
1619
1639
  // biome-ignore lint/a11y/noStaticElementInteractions: 同上 (焦点の受け渡しだけを担い、要素自身は操作の対象ではない)
1620
- /* @__PURE__ */ f.jsx("span", { tabIndex: 0, "data-directory-tree-tab-stop": "", style: Mo, onFocus: ar }),
1621
- xn
1640
+ /* @__PURE__ */ f.jsx("span", { tabIndex: 0, "data-directory-tree-tab-stop": "", style: Ho, onFocus: cr }),
1641
+ Rn
1622
1642
  ] });
1623
- const ir = T.showHeader ?? !0, cr = T.showFooter ?? !1, dr = { ...rn, "--dt-hscroll": `${Ge}px` };
1643
+ const ur = T.showHeader ?? !0, fr = T.showFooter ?? !1, hr = { ...sn, "--dt-hscroll": `${Xe}px` };
1624
1644
  return /* @__PURE__ */ f.jsxs(
1625
1645
  "div",
1626
1646
  {
1627
- ref: Te,
1628
- className: L(nn, "dt-grid"),
1629
- style: dr,
1647
+ ref: Pe,
1648
+ className: U(on, "dt-grid"),
1649
+ style: hr,
1630
1650
  role: "treegrid",
1631
- "aria-label": v ? void 0 : p,
1651
+ "aria-label": v ? void 0 : w,
1632
1652
  "aria-labelledby": v,
1633
- "aria-multiselectable": R === "multiple" ? !0 : void 0,
1634
- "aria-rowcount": U.length + (T.showHeader ?? !0 ? 1 : 0),
1635
- onPointerDownCapture: lt,
1636
- onMouseDownCapture: lt,
1653
+ "aria-multiselectable": x === "multiple" ? !0 : void 0,
1654
+ "aria-busy": i ? !0 : void 0,
1655
+ "aria-rowcount": K.length + (T.showHeader ?? !0 ? 1 : 0),
1656
+ onPointerDownCapture: ct,
1657
+ onMouseDownCapture: ct,
1637
1658
  children: [
1638
- ir && // biome-ignore lint/a11y/useSemanticElements: 仮想スクロールの treegrid は絶対配置行を使うため native table 要素にできない。ARIA ロールで意味を提供する
1639
- /* @__PURE__ */ f.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ f.jsx(ao, { columns: T.columns, numericTemplate: dt, numericTotal: re.numericTotal, nameWidth: re.nameWidth, scrollBarWidth: We, className: T.headerClassName }) }),
1640
- /* @__PURE__ */ f.jsx("div", { ref: De, className: "dt-grid-body", children: xn }),
1641
- He > 0 && /* @__PURE__ */ f.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
1659
+ ur && // biome-ignore lint/a11y/useSemanticElements: 仮想スクロールの treegrid は絶対配置行を使うため native table 要素にできない。ARIA ロールで意味を提供する
1660
+ /* @__PURE__ */ f.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ f.jsx(co, { columns: T.columns, numericTemplate: ft, numericTotal: re.numericTotal, nameWidth: re.nameWidth, scrollBarWidth: Be, className: T.headerClassName }) }),
1661
+ /* @__PURE__ */ f.jsx("div", { ref: Fe, className: "dt-grid-body", children: Rn }),
1662
+ Ye > 0 && /* @__PURE__ */ f.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
1642
1663
  /* @__PURE__ */ f.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: re.nameWidth }, "aria-hidden": "true" }),
1643
1664
  /* @__PURE__ */ f.jsx(
1644
- gr,
1665
+ Sr,
1645
1666
  {
1646
1667
  horizontal: !0,
1647
1668
  contentSize: re.numericTotal,
1648
1669
  viewportSize: re.numericVisible,
1649
- scrollPosition: Ge,
1650
- scrollBarWidth: We,
1670
+ scrollPosition: Xe,
1671
+ scrollBarWidth: Be,
1651
1672
  locale: A,
1652
1673
  labels: Z,
1653
- onScroll: (a) => {
1654
- const c = typeof a == "function" ? a(Ge) : a, x = Ct(c, He);
1655
- return Xe(x), x;
1674
+ onScroll: (s) => {
1675
+ const c = typeof s == "function" ? s(Xe) : s, S = jt(c, Ye);
1676
+ return Ke(S), S;
1656
1677
  }
1657
1678
  }
1658
1679
  ),
1659
- /* @__PURE__ */ f.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: We }, "aria-hidden": "true" })
1680
+ /* @__PURE__ */ f.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: Be }, "aria-hidden": "true" })
1660
1681
  ] }),
1661
- cr && // biome-ignore lint/a11y/useSemanticElements: 同上 (フッタ行も絶対配置レイアウトの一部)
1662
- /* @__PURE__ */ f.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ f.jsx(lo, { columns: T.columns, numericTemplate: dt, numericTotal: re.numericTotal, nameWidth: re.nameWidth, scrollBarWidth: We, allEntries: lr, className: T.footerClassName }) })
1682
+ fr && // biome-ignore lint/a11y/useSemanticElements: 同上 (フッタ行も絶対配置レイアウトの一部)
1683
+ /* @__PURE__ */ f.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ f.jsx(uo, { columns: T.columns, numericTemplate: ft, numericTotal: re.numericTotal, nameWidth: re.nameWidth, scrollBarWidth: Be, allEntries: dr, className: T.footerClassName }) })
1663
1684
  ]
1664
1685
  }
1665
1686
  );
1666
- }, Ko = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
1667
- const [n, r] = mr(), [o, i] = de(() => {
1687
+ }, Jo = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
1688
+ const [n, r] = gr(), [a, i] = fe(() => {
1668
1689
  if (typeof window < "u" && t)
1669
1690
  try {
1670
- const m = window.localStorage.getItem(t);
1671
- if (m) {
1672
- const p = JSON.parse(m);
1673
- return new Set(p);
1691
+ const p = window.localStorage.getItem(t);
1692
+ if (p) {
1693
+ const w = JSON.parse(p);
1694
+ return new Set(w);
1674
1695
  }
1675
- } catch (m) {
1676
- console.error("[useDirectoryTreeState] Error reading from localStorage", m);
1696
+ } catch (p) {
1697
+ console.error("[useDirectoryTreeState] Error reading from localStorage", p);
1677
1698
  }
1678
1699
  return e;
1679
- }), l = _((m) => {
1700
+ }), l = _((p) => {
1680
1701
  r(() => {
1681
- i((p) => {
1682
- const v = new Set(p);
1683
- return m(v), v;
1702
+ i((w) => {
1703
+ const v = new Set(w);
1704
+ return p(v), v;
1684
1705
  });
1685
1706
  });
1686
1707
  }, []), d = _(
1687
- (m, p) => {
1708
+ (p, w) => {
1688
1709
  l((v) => {
1689
- for (const M of m)
1690
- p(v, M);
1710
+ for (const F of p)
1711
+ w(v, F);
1691
1712
  });
1692
1713
  },
1693
1714
  [l]
1694
1715
  );
1695
- Ae(() => {
1716
+ De(() => {
1696
1717
  if (t && typeof window < "u")
1697
1718
  try {
1698
- window.localStorage.setItem(t, JSON.stringify(Array.from(o)));
1699
- } catch (m) {
1700
- console.warn(`Error setting localStorage key "${t}":`, m);
1719
+ window.localStorage.setItem(t, JSON.stringify(Array.from(a)));
1720
+ } catch (p) {
1721
+ console.warn(`Error setting localStorage key "${t}":`, p);
1701
1722
  }
1702
- }, [o, t]);
1703
- const b = _(
1704
- (m) => {
1705
- d([m], (p, v) => {
1706
- p.has(v) ? p.delete(v) : p.add(v);
1723
+ }, [a, t]);
1724
+ const h = _(
1725
+ (p) => {
1726
+ d([p], (w, v) => {
1727
+ w.has(v) ? w.delete(v) : w.add(v);
1707
1728
  });
1708
1729
  },
1709
1730
  [d]
1710
- ), S = _(
1711
- (m) => {
1712
- d([m], (p, v) => {
1713
- p.add(v);
1731
+ ), b = _(
1732
+ (p) => {
1733
+ d([p], (w, v) => {
1734
+ w.add(v);
1714
1735
  });
1715
1736
  },
1716
1737
  [d]
1717
- ), w = _(
1718
- (m) => {
1719
- d([m], (p, v) => {
1720
- p.delete(v);
1738
+ ), N = _(
1739
+ (p) => {
1740
+ d([p], (w, v) => {
1741
+ w.delete(v);
1721
1742
  });
1722
1743
  },
1723
1744
  [d]
1724
- ), R = _(
1725
- (m) => {
1726
- d(m, (p, v) => {
1727
- p.delete(v);
1745
+ ), x = _(
1746
+ (p) => {
1747
+ d(p, (w, v) => {
1748
+ w.delete(v);
1728
1749
  });
1729
1750
  },
1730
1751
  [d]
1731
1752
  ), k = _(
1732
- (m) => {
1733
- d(m, (p, v) => {
1734
- p.add(v);
1753
+ (p) => {
1754
+ d(p, (w, v) => {
1755
+ w.add(v);
1735
1756
  });
1736
1757
  },
1737
1758
  [d]
1738
- ), h = _(() => {
1739
- l((m) => {
1740
- m.clear();
1759
+ ), m = _(() => {
1760
+ l((p) => {
1761
+ p.clear();
1741
1762
  });
1742
- }, [l]), g = _((m) => o.has(m), [o]);
1763
+ }, [l]), y = _((p) => a.has(p), [a]);
1743
1764
  return {
1744
- expanded: o,
1745
- toggle: b,
1746
- expand: S,
1747
- collapse: w,
1748
- collapseMultiple: R,
1765
+ expanded: a,
1766
+ toggle: h,
1767
+ expand: b,
1768
+ collapse: N,
1769
+ collapseMultiple: x,
1749
1770
  expandMultiple: k,
1750
- collapseAll: h,
1751
- isExpanded: g,
1771
+ collapseAll: m,
1772
+ isExpanded: y,
1752
1773
  isPending: n
1753
1774
  };
1754
1775
  };
1755
1776
  export {
1756
- ho as DIRECTORY_TREE_LABEL_CATALOGS,
1757
- On as DIRECTORY_TREE_LABEL_KEYS,
1758
- Vo as DirectoryTree,
1759
- eo as EXPAND_ICON_STYLE_PROPERTIES,
1760
- Qr as ROW_STYLE_PROPERTIES,
1761
- D as directoryTreeClasses,
1762
- po as resolveDirectoryTreeLabels,
1763
- Ko as useDirectoryTreeState
1777
+ yo as DIRECTORY_TREE_LABEL_CATALOGS,
1778
+ An as DIRECTORY_TREE_LABEL_KEYS,
1779
+ Uo as DirectoryTree,
1780
+ ro as EXPAND_ICON_STYLE_PROPERTIES,
1781
+ no as ROW_STYLE_PROPERTIES,
1782
+ L as directoryTreeClasses,
1783
+ bo as resolveDirectoryTreeLabels,
1784
+ Jo as useDirectoryTreeState
1764
1785
  };