@aiquants/directory-tree 3.8.0 → 3.8.1

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,15 +1,15 @@
1
- import br, { useRef as ne, useEffect as me, useCallback as F, memo as at, useState as le, useMemo as K, useLayoutEffect as vr, Fragment as gr, useTransition as wr } from "react";
2
- import { VirtualScroll as kr, ScrollBar as Sr } from "@aiquants/virtualscroll";
1
+ import * as oe from "react";
2
+ import br, { useRef as ne, useEffect as he, useCallback as F, memo as ot, useState as ie, useMemo as K, useLayoutEffect as gr, Fragment as wr, useTransition as kr } from "react";
3
+ import { VirtualScroll as Er, ScrollBar as Sr } from "@aiquants/virtualscroll";
3
4
  import { twMerge as A } from "tailwind-merge";
4
- import { FolderIcon as Ir, ChevronDownIcon as Er, ChevronRightIcon as Nr } from "@heroicons/react/24/solid";
5
- import { FileMd as Mt, FilePdf as Dt, FileXls as Ot, FileCsv as Ft, FileDoc as Lt, FilePpt as $t, FileImage as Ht, FileAudio as Wt, FileVideo as Bt, FileZip as zt, FileCode as Yt, FileText as Gt, FileIcon as jr } from "@phosphor-icons/react";
6
- var ze = { exports: {} }, Ce = {};
7
- var Vt;
8
- function Rr() {
9
- if (Vt) return Ce;
10
- Vt = 1;
5
+ import { FileMd as Dt, FilePdf as Ot, FileXls as Ft, FileCsv as Lt, FileDoc as $t, FilePpt as Ht, FileImage as Wt, FileAudio as Bt, FileVideo as zt, FileZip as Yt, FileCode as Gt, FileText as Vt, FileIcon as Nr } from "@phosphor-icons/react";
6
+ var Ye = { exports: {} }, Pe = {};
7
+ var Ut;
8
+ function Ir() {
9
+ if (Ut) return Pe;
10
+ Ut = 1;
11
11
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
12
- function a(n, r, l) {
12
+ function s(n, r, l) {
13
13
  var c = null;
14
14
  if (l !== void 0 && (c = "" + l), r.key !== void 0 && (c = "" + r.key), "key" in r) {
15
15
  l = {};
@@ -24,21 +24,21 @@ function Rr() {
24
24
  props: l
25
25
  };
26
26
  }
27
- return Ce.Fragment = t, Ce.jsx = a, Ce.jsxs = a, Ce;
27
+ return Pe.Fragment = t, Pe.jsx = s, Pe.jsxs = s, Pe;
28
28
  }
29
- var Pe = {};
30
- var Ut;
31
- function Tr() {
32
- return Ut || (Ut = 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 === $ ? null : s.displayName || s.name || null;
37
- if (typeof s == "string") return s;
38
- switch (s) {
29
+ var _e = {};
30
+ var Xt;
31
+ function Rr() {
32
+ return Xt || (Xt = 1, process.env.NODE_ENV !== "production" && (function() {
33
+ function e(a) {
34
+ if (a == null) return null;
35
+ if (typeof a == "function")
36
+ return a.$$typeof === $ ? null : a.displayName || a.name || null;
37
+ if (typeof a == "string") return a;
38
+ switch (a) {
39
39
  case y:
40
40
  return "Fragment";
41
- case R:
41
+ case j:
42
42
  return "Profiler";
43
43
  case k:
44
44
  return "StrictMode";
@@ -49,145 +49,145 @@ function Tr() {
49
49
  case ee:
50
50
  return "Activity";
51
51
  }
52
- if (typeof s == "object")
53
- switch (typeof s.tag == "number" && console.error(
52
+ if (typeof a == "object")
53
+ switch (typeof a.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) {
55
+ ), a.$$typeof) {
56
56
  case f:
57
57
  return "Portal";
58
- case S:
59
- return s.displayName || "Context";
60
- case N:
61
- return (s._context.displayName || "Context") + ".Consumer";
58
+ case E:
59
+ return a.displayName || "Context";
60
+ case I:
61
+ return (a._context.displayName || "Context") + ".Consumer";
62
62
  case p:
63
- var m = s.render;
64
- return s = s.displayName, s || (s = m.displayName || m.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
63
+ var m = a.render;
64
+ return a = a.displayName, a || (a = m.displayName || m.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
65
65
  case O:
66
- return m = s.displayName || null, m !== null ? m : e(s.type) || "Memo";
66
+ return m = a.displayName || null, m !== null ? m : e(a.type) || "Memo";
67
67
  case Q:
68
- m = s._payload, s = s._init;
68
+ m = a._payload, a = a._init;
69
69
  try {
70
- return e(s(m));
70
+ return e(a(m));
71
71
  } catch {
72
72
  }
73
73
  }
74
74
  return null;
75
75
  }
76
- function t(s) {
77
- return "" + s;
76
+ function t(a) {
77
+ return "" + a;
78
78
  }
79
- function a(s) {
79
+ function s(a) {
80
80
  try {
81
- t(s);
81
+ t(a);
82
82
  var m = !1;
83
83
  } catch {
84
84
  m = !0;
85
85
  }
86
86
  if (m) {
87
87
  m = console;
88
- var T = m.error, M = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
88
+ var T = m.error, M = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
89
89
  return T.call(
90
90
  m,
91
91
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
92
92
  M
93
- ), t(s);
93
+ ), t(a);
94
94
  }
95
95
  }
96
- function n(s) {
97
- if (s === y) return "<>";
98
- if (typeof s == "object" && s !== null && s.$$typeof === Q)
96
+ function n(a) {
97
+ if (a === y) return "<>";
98
+ if (typeof a == "object" && a !== null && a.$$typeof === Q)
99
99
  return "<...>";
100
100
  try {
101
- var m = e(s);
101
+ var m = e(a);
102
102
  return m ? "<" + m + ">" : "<...>";
103
103
  } catch {
104
104
  return "<...>";
105
105
  }
106
106
  }
107
107
  function r() {
108
- var s = J.A;
109
- return s === null ? null : s.getOwner();
108
+ var a = J.A;
109
+ return a === null ? null : a.getOwner();
110
110
  }
111
111
  function l() {
112
112
  return Error("react-stack-top-frame");
113
113
  }
114
- function c(s) {
115
- if (te.call(s, "key")) {
116
- var m = Object.getOwnPropertyDescriptor(s, "key").get;
114
+ function c(a) {
115
+ if (te.call(a, "key")) {
116
+ var m = Object.getOwnPropertyDescriptor(a, "key").get;
117
117
  if (m && m.isReactWarning) return !1;
118
118
  }
119
- return s.key !== void 0;
119
+ return a.key !== void 0;
120
120
  }
121
- function u(s, m) {
121
+ function u(a, m) {
122
122
  function T() {
123
123
  B || (B = !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
  m
126
126
  ));
127
127
  }
128
- T.isReactWarning = !0, Object.defineProperty(s, "key", {
128
+ T.isReactWarning = !0, Object.defineProperty(a, "key", {
129
129
  get: T,
130
130
  configurable: !0
131
131
  });
132
132
  }
133
- function j() {
134
- var s = e(this.type);
135
- return G[s] || (G[s] = !0, console.error(
133
+ function R() {
134
+ var a = e(this.type);
135
+ return G[a] || (G[a] = !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
+ )), a = this.props.ref, a !== void 0 ? a : null;
138
138
  }
139
- function v(s, m, T, M, se, oe) {
140
- var b = T.ref;
141
- return s = {
142
- $$typeof: E,
143
- type: s,
139
+ function b(a, m, T, M, se, le) {
140
+ var v = T.ref;
141
+ return a = {
142
+ $$typeof: N,
143
+ type: a,
144
144
  key: m,
145
145
  props: T,
146
146
  _owner: M
147
- }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(s, "ref", {
147
+ }, (v !== void 0 ? v : null) !== null ? Object.defineProperty(a, "ref", {
148
148
  enumerable: !1,
149
- get: j
150
- }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
149
+ get: R
150
+ }) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._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(a, "_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(a, "_debugStack", {
161
161
  configurable: !1,
162
162
  enumerable: !1,
163
163
  writable: !0,
164
164
  value: se
165
- }), Object.defineProperty(s, "_debugTask", {
165
+ }), Object.defineProperty(a, "_debugTask", {
166
166
  configurable: !1,
167
167
  enumerable: !1,
168
168
  writable: !0,
169
- value: oe
170
- }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
169
+ value: le
170
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
171
171
  }
172
- function d(s, m, T, M, se, oe) {
173
- var b = m.children;
174
- if (b !== void 0)
172
+ function d(a, m, T, M, se, le) {
173
+ var v = m.children;
174
+ if (v !== void 0)
175
175
  if (M)
176
- if (I(b)) {
177
- for (M = 0; M < b.length; M++)
178
- h(b[M]);
179
- Object.freeze && Object.freeze(b);
176
+ if (S(v)) {
177
+ for (M = 0; M < v.length; M++)
178
+ h(v[M]);
179
+ Object.freeze && Object.freeze(v);
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 h(b);
184
+ else h(v);
185
185
  if (te.call(m, "key")) {
186
- b = e(s);
186
+ v = e(a);
187
187
  var z = Object.keys(m).filter(function(V) {
188
188
  return V !== "key";
189
189
  });
190
- M = 0 < z.length ? "{key: someKey, " + z.join(": ..., ") + ": ...}" : "{key: someKey}", P[b + M] || (z = 0 < z.length ? "{" + z.join(": ..., ") + ": ...}" : "{}", console.error(
190
+ M = 0 < z.length ? "{key: someKey, " + z.join(": ..., ") + ": ...}" : "{key: someKey}", P[v + M] || (z = 0 < z.length ? "{" + z.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} />
@@ -195,75 +195,138 @@ React keys must be passed directly to JSX without using spread:
195
195
  let props = %s;
196
196
  <%s key={someKey} {...props} />`,
197
197
  M,
198
- b,
198
+ v,
199
199
  z,
200
- b
201
- ), P[b + M] = !0);
200
+ v
201
+ ), P[v + M] = !0);
202
202
  }
203
- if (b = null, T !== void 0 && (a(T), b = "" + T), c(m) && (a(m.key), b = "" + m.key), "key" in m) {
203
+ if (v = null, T !== void 0 && (s(T), v = "" + T), c(m) && (s(m.key), v = "" + m.key), "key" in m) {
204
204
  T = {};
205
205
  for (var H in m)
206
206
  H !== "key" && (T[H] = m[H]);
207
207
  } else T = m;
208
- return b && u(
208
+ return v && u(
209
209
  T,
210
- typeof s == "function" ? s.displayName || s.name || "Unknown" : s
211
- ), v(
212
- s,
213
- b,
210
+ typeof a == "function" ? a.displayName || a.name || "Unknown" : a
211
+ ), b(
212
+ a,
213
+ v,
214
214
  T,
215
215
  r(),
216
216
  se,
217
- oe
217
+ le
218
218
  );
219
219
  }
220
- function h(s) {
221
- g(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === Q && (s._payload.status === "fulfilled" ? g(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
220
+ function h(a) {
221
+ g(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === Q && (a._payload.status === "fulfilled" ? g(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
222
222
  }
223
- function g(s) {
224
- return typeof s == "object" && s !== null && s.$$typeof === E;
223
+ function g(a) {
224
+ return typeof a == "object" && a !== null && a.$$typeof === N;
225
225
  }
226
- var w = br, E = /* @__PURE__ */ Symbol.for("react.transitional.element"), f = /* @__PURE__ */ Symbol.for("react.portal"), y = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), R = /* @__PURE__ */ Symbol.for("react.profiler"), N = /* @__PURE__ */ Symbol.for("react.consumer"), S = /* @__PURE__ */ Symbol.for("react.context"), p = /* @__PURE__ */ Symbol.for("react.forward_ref"), L = /* @__PURE__ */ Symbol.for("react.suspense"), C = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), Q = /* @__PURE__ */ Symbol.for("react.lazy"), ee = /* @__PURE__ */ Symbol.for("react.activity"), $ = /* @__PURE__ */ Symbol.for("react.client.reference"), J = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, I = Array.isArray, Y = console.createTask ? console.createTask : function() {
226
+ var w = br, N = /* @__PURE__ */ Symbol.for("react.transitional.element"), f = /* @__PURE__ */ Symbol.for("react.portal"), y = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), j = /* @__PURE__ */ Symbol.for("react.profiler"), I = /* @__PURE__ */ Symbol.for("react.consumer"), E = /* @__PURE__ */ Symbol.for("react.context"), p = /* @__PURE__ */ Symbol.for("react.forward_ref"), L = /* @__PURE__ */ Symbol.for("react.suspense"), C = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), Q = /* @__PURE__ */ Symbol.for("react.lazy"), ee = /* @__PURE__ */ Symbol.for("react.activity"), $ = /* @__PURE__ */ Symbol.for("react.client.reference"), J = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, te = Object.prototype.hasOwnProperty, S = Array.isArray, Y = console.createTask ? console.createTask : function() {
227
227
  return null;
228
228
  };
229
229
  w = {
230
- react_stack_bottom_frame: function(s) {
231
- return s();
230
+ react_stack_bottom_frame: function(a) {
231
+ return a();
232
232
  }
233
233
  };
234
- var B, G = {}, ie = w.react_stack_bottom_frame.bind(
234
+ var B, G = {}, ce = w.react_stack_bottom_frame.bind(
235
235
  w,
236
236
  l
237
- )(), ce = Y(n(l)), P = {};
238
- Pe.Fragment = y, Pe.jsx = function(s, m, T) {
237
+ )(), de = Y(n(l)), P = {};
238
+ _e.Fragment = y, _e.jsx = function(a, m, T) {
239
239
  var M = 1e4 > J.recentlyCreatedOwnerStacks++;
240
240
  return d(
241
- s,
241
+ a,
242
242
  m,
243
243
  T,
244
244
  !1,
245
- M ? Error("react-stack-top-frame") : ie,
246
- M ? Y(n(s)) : ce
245
+ M ? Error("react-stack-top-frame") : ce,
246
+ M ? Y(n(a)) : de
247
247
  );
248
- }, Pe.jsxs = function(s, m, T) {
248
+ }, _e.jsxs = function(a, m, T) {
249
249
  var M = 1e4 > J.recentlyCreatedOwnerStacks++;
250
250
  return d(
251
- s,
251
+ a,
252
252
  m,
253
253
  T,
254
254
  !0,
255
- M ? Error("react-stack-top-frame") : ie,
256
- M ? Y(n(s)) : ce
255
+ M ? Error("react-stack-top-frame") : ce,
256
+ M ? Y(n(a)) : de
257
257
  );
258
258
  };
259
- })()), Pe;
259
+ })()), _e;
260
260
  }
261
- var Xt;
262
- function Cr() {
263
- return Xt || (Xt = 1, process.env.NODE_ENV === "production" ? ze.exports = Rr() : ze.exports = Tr()), ze.exports;
261
+ var Jt;
262
+ function jr() {
263
+ return Jt || (Jt = 1, process.env.NODE_ENV === "production" ? Ye.exports = Ir() : Ye.exports = Rr()), Ye.exports;
264
+ }
265
+ var i = jr();
266
+ function Tr({
267
+ title: e,
268
+ titleId: t,
269
+ ...s
270
+ }, n) {
271
+ return /* @__PURE__ */ oe.createElement("svg", Object.assign({
272
+ xmlns: "http://www.w3.org/2000/svg",
273
+ viewBox: "0 0 24 24",
274
+ fill: "currentColor",
275
+ "aria-hidden": "true",
276
+ "data-slot": "icon",
277
+ ref: n,
278
+ "aria-labelledby": t
279
+ }, s), e ? /* @__PURE__ */ oe.createElement("title", {
280
+ id: t
281
+ }, e) : null, /* @__PURE__ */ oe.createElement("path", {
282
+ fillRule: "evenodd",
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
+ clipRule: "evenodd"
285
+ }));
286
+ }
287
+ const Cr = /* @__PURE__ */ oe.forwardRef(Tr);
288
+ function Pr({
289
+ title: e,
290
+ titleId: t,
291
+ ...s
292
+ }, n) {
293
+ return /* @__PURE__ */ oe.createElement("svg", Object.assign({
294
+ xmlns: "http://www.w3.org/2000/svg",
295
+ viewBox: "0 0 24 24",
296
+ fill: "currentColor",
297
+ "aria-hidden": "true",
298
+ "data-slot": "icon",
299
+ ref: n,
300
+ "aria-labelledby": t
301
+ }, s), e ? /* @__PURE__ */ oe.createElement("title", {
302
+ id: t
303
+ }, e) : null, /* @__PURE__ */ oe.createElement("path", {
304
+ fillRule: "evenodd",
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
+ clipRule: "evenodd"
307
+ }));
264
308
  }
265
- var i = Cr();
266
- const Ye = 18, Ge = 12, Jt = 10, D = {
309
+ const _r = /* @__PURE__ */ oe.forwardRef(Pr);
310
+ function Ar({
311
+ title: e,
312
+ titleId: t,
313
+ ...s
314
+ }, n) {
315
+ return /* @__PURE__ */ oe.createElement("svg", Object.assign({
316
+ xmlns: "http://www.w3.org/2000/svg",
317
+ viewBox: "0 0 24 24",
318
+ fill: "currentColor",
319
+ "aria-hidden": "true",
320
+ "data-slot": "icon",
321
+ ref: n,
322
+ "aria-labelledby": t
323
+ }, s), e ? /* @__PURE__ */ oe.createElement("title", {
324
+ id: t
325
+ }, e) : null, /* @__PURE__ */ oe.createElement("path", {
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
+ }));
328
+ }
329
+ const Mr = /* @__PURE__ */ oe.forwardRef(Ar), Ge = 18, Ve = 12, Zt = 10, D = {
267
330
  container: "directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",
268
331
  containerPending: "opacity-70",
269
332
  entry: "directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",
@@ -284,12 +347,12 @@ const Ye = 18, Ge = 12, Jt = 10, D = {
284
347
  nameSelected: A("directory-tree-name--selected text-blue-800 font-semibold", "dark:text-blue-300")
285
348
  }, Se = (e) => {
286
349
  if (!e) return "";
287
- const t = e.split("?")[0].split("#")[0].split("/").pop() || e, a = t.lastIndexOf(".");
288
- return a <= 0 ? "" : t.slice(a + 1).toLowerCase();
289
- }, Qt = ({ isDirectory: e, isExpanded: t, showExpandIcons: a, useCanvasExpandIcons: n, expandIconSize: r }) => {
350
+ const t = e.split("?")[0].split("#")[0].split("/").pop() || e, s = t.lastIndexOf(".");
351
+ return s <= 0 ? "" : t.slice(s + 1).toLowerCase();
352
+ }, er = ({ isDirectory: e, isExpanded: t, showExpandIcons: s, useCanvasExpandIcons: n, expandIconSize: r }) => {
290
353
  const l = r ? { width: r, height: r } : void 0, c = r ? "" : "h-4 w-4";
291
- return !(a && e) || n ? /* @__PURE__ */ i.jsx("span", { className: c, style: l, "aria-hidden": "true" }) : t ? /* @__PURE__ */ i.jsx(Er, { className: c, style: l }) : /* @__PURE__ */ i.jsx(Nr, { className: c, style: l });
292
- }, nt = (e, t) => {
354
+ return !(s && e) || n ? /* @__PURE__ */ i.jsx("span", { className: c, style: l, "aria-hidden": "true" }) : t ? /* @__PURE__ */ i.jsx(Cr, { className: c, style: l }) : /* @__PURE__ */ i.jsx(_r, { className: c, style: l });
355
+ }, st = (e, t) => {
293
356
  if (e == null || typeof e == "boolean") return null;
294
357
  if (typeof e == "function")
295
358
  return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`), null;
@@ -297,85 +360,85 @@ const Ye = 18, Ge = 12, Jt = 10, D = {
297
360
  if ("then" in e)
298
361
  return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`), null;
299
362
  if (Array.isArray(e)) {
300
- const n = e.map((r) => nt(r, t)).filter(Boolean);
363
+ const n = e.map((r) => st(r, t)).filter(Boolean);
301
364
  return n.length ? n : null;
302
365
  }
303
- const a = e.type;
304
- if (a && a.$$typeof === /* @__PURE__ */ Symbol.for("react.lazy"))
366
+ const s = e.type;
367
+ if (s && s.$$typeof === /* @__PURE__ */ Symbol.for("react.lazy"))
305
368
  return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`), null;
306
369
  }
307
370
  return e;
308
- }, Pr = (e, t, a) => {
309
- const n = (t || (a ? Se(a) : "")).toLowerCase(), r = (e || "").toLowerCase();
371
+ }, Dr = (e, t, s) => {
372
+ const n = (t || (s ? Se(s) : "")).toLowerCase(), r = (e || "").toLowerCase();
310
373
  if (r && r !== "application/octet-stream") {
311
374
  if (r === "text/markdown" || r === "text/x-markdown")
312
- return /* @__PURE__ */ i.jsx(Mt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
375
+ return /* @__PURE__ */ i.jsx(Dt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
313
376
  if (r === "application/pdf")
314
- return /* @__PURE__ */ i.jsx(Dt, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
377
+ return /* @__PURE__ */ i.jsx(Ot, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
315
378
  if (r.includes("excel") || r.includes("spreadsheet") || r.includes("google-apps.spreadsheet"))
316
- return /* @__PURE__ */ i.jsx(Ot, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
317
- if (r === "text/csv" || r === "text/tab-separated-values")
318
379
  return /* @__PURE__ */ i.jsx(Ft, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
380
+ if (r === "text/csv" || r === "text/tab-separated-values")
381
+ return /* @__PURE__ */ i.jsx(Lt, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
319
382
  if (r.includes("word") || r.includes("msword") || r.includes("wordprocessingml") || r.includes("google-apps.document") || r === "application/rtf")
320
- return /* @__PURE__ */ i.jsx(Lt, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
383
+ return /* @__PURE__ */ i.jsx($t, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
321
384
  if (r.includes("powerpoint") || r.includes("presentation") || r.includes("google-apps.presentation"))
322
- return /* @__PURE__ */ i.jsx($t, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
385
+ return /* @__PURE__ */ i.jsx(Ht, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
323
386
  if (r.startsWith("image/"))
324
- return /* @__PURE__ */ i.jsx(Ht, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
387
+ return /* @__PURE__ */ i.jsx(Wt, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
325
388
  if (r.startsWith("audio/"))
326
- return /* @__PURE__ */ i.jsx(Wt, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
389
+ return /* @__PURE__ */ i.jsx(Bt, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
327
390
  if (r.startsWith("video/"))
328
- return /* @__PURE__ */ i.jsx(Bt, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
391
+ return /* @__PURE__ */ i.jsx(zt, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
329
392
  if (r.includes("zip") || r.includes("tar") || r.includes("compressed") || r.includes("archive"))
330
- return /* @__PURE__ */ i.jsx(zt, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
393
+ return /* @__PURE__ */ i.jsx(Yt, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
331
394
  if (r === "application/json" || r.includes("javascript") || r.includes("typescript") || r.includes("xml") || r.startsWith("text/html") || r.startsWith("text/css") || r.includes("x-python") || r.includes("x-sh") || r.includes("x-go") || r.includes("x-rust"))
332
- return /* @__PURE__ */ i.jsx(Yt, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
395
+ return /* @__PURE__ */ i.jsx(Gt, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
333
396
  if (r.startsWith("text/"))
334
- return /* @__PURE__ */ i.jsx(Gt, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
397
+ return /* @__PURE__ */ i.jsx(Vt, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
335
398
  }
336
399
  if (n) {
337
400
  if (n === "md" || n === "markdown" || n === "mdx")
338
- return /* @__PURE__ */ i.jsx(Mt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
401
+ return /* @__PURE__ */ i.jsx(Dt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
339
402
  if (n === "pdf")
340
- return /* @__PURE__ */ i.jsx(Dt, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
403
+ return /* @__PURE__ */ i.jsx(Ot, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
341
404
  if (["xls", "xlsx", "xlsm", "xlsb", "ods"].includes(n))
342
- return /* @__PURE__ */ i.jsx(Ot, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
343
- if (["csv", "tsv"].includes(n))
344
405
  return /* @__PURE__ */ i.jsx(Ft, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
406
+ if (["csv", "tsv"].includes(n))
407
+ return /* @__PURE__ */ i.jsx(Lt, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
345
408
  if (["doc", "docx", "rtf", "odt"].includes(n))
346
- return /* @__PURE__ */ i.jsx(Lt, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
409
+ return /* @__PURE__ */ i.jsx($t, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
347
410
  if (["ppt", "pptx", "odp"].includes(n))
348
- return /* @__PURE__ */ i.jsx($t, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
411
+ return /* @__PURE__ */ i.jsx(Ht, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
349
412
  if (["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp", "tiff", "avif"].includes(n))
350
- return /* @__PURE__ */ i.jsx(Ht, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
413
+ return /* @__PURE__ */ i.jsx(Wt, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
351
414
  if (["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"].includes(n))
352
- return /* @__PURE__ */ i.jsx(Yt, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
415
+ return /* @__PURE__ */ i.jsx(Gt, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
353
416
  if (["mp3", "wav", "ogg", "m4a", "flac", "aac", "wma"].includes(n))
354
- return /* @__PURE__ */ i.jsx(Wt, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
417
+ return /* @__PURE__ */ i.jsx(Bt, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
355
418
  if (["mp4", "webm", "mov", "avi", "mkv", "wmv", "flv"].includes(n))
356
- return /* @__PURE__ */ i.jsx(Bt, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
419
+ return /* @__PURE__ */ i.jsx(zt, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
357
420
  if (["zip", "tar", "gz", "7z", "rar", "tgz", "bz2"].includes(n))
358
- return /* @__PURE__ */ i.jsx(zt, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
421
+ return /* @__PURE__ */ i.jsx(Yt, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
359
422
  if (["txt", "log"].includes(n))
360
- return /* @__PURE__ */ i.jsx(Gt, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
423
+ return /* @__PURE__ */ i.jsx(Vt, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
361
424
  }
362
- return /* @__PURE__ */ i.jsx(jr, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" });
363
- }, er = (e, t) => {
364
- const { entry: a, isDirectory: n, isExpanded: r, extension: l, mimeType: c } = e;
425
+ return /* @__PURE__ */ i.jsx(Nr, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" });
426
+ }, tr = (e, t) => {
427
+ const { entry: s, isDirectory: n, isExpanded: r, extension: l, mimeType: c } = e;
365
428
  let u;
366
- const j = c || a.mimeType;
367
- return a.icon !== void 0 ? u = a.icon : n ? u = r && t?.directoryExpanded || t?.directory || /* @__PURE__ */ i.jsx(Ir, { className: "h-4 w-4" }) : l && t?.fileByExtension?.[l] ? u = t.fileByExtension[l] : u = t?.file || Pr(j, l, a.name), nt(typeof u == "function" ? u(e) : u, a.absolutePath);
368
- }, _r = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), tr = (e) => {
429
+ const R = c || s.mimeType;
430
+ return s.icon !== void 0 ? u = s.icon : n ? u = r && t?.directoryExpanded || t?.directory || /* @__PURE__ */ i.jsx(Mr, { className: "h-4 w-4" }) : l && t?.fileByExtension?.[l] ? u = t.fileByExtension[l] : u = t?.file || Dr(R, l, s.name), st(typeof u == "function" ? u(e) : u, s.absolutePath);
431
+ }, Or = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), rr = (e) => {
369
432
  if (!e)
370
433
  return;
371
- const t = Object.entries(e).filter(([, a]) => a != null);
434
+ const t = Object.entries(e).filter(([, s]) => s != null);
372
435
  if (t.length !== 0)
373
- return Object.fromEntries(t.map(([a, n]) => [`data-${_r(a)}`, String(n)]));
374
- }, Ar = 500, rr = ({ entry: e, isDirectory: t, isExpanded: a, isItemSelected: n, selectionMode: r, onSelectionChange: l, onEntryClick: c, toggleDirectory: u, onToggleDirectoryRecursive: j }) => {
375
- const v = ne(null);
376
- return me(
436
+ return Object.fromEntries(t.map(([s, n]) => [`data-${Or(s)}`, String(n)]));
437
+ }, Fr = 500, nr = ({ entry: e, isDirectory: t, isExpanded: s, isItemSelected: n, selectionMode: r, onSelectionChange: l, onEntryClick: c, toggleDirectory: u, onToggleDirectoryRecursive: R }) => {
438
+ const b = ne(null);
439
+ return he(
377
440
  () => () => {
378
- v.current && window.clearTimeout(v.current);
441
+ b.current && window.clearTimeout(b.current);
379
442
  },
380
443
  []
381
444
  ), F(
@@ -385,401 +448,401 @@ const Ye = 18, Ge = 12, Jt = 10, D = {
385
448
  c({
386
449
  entry: e,
387
450
  isDirectory: t,
388
- isExpanded: a,
451
+ isExpanded: s,
389
452
  preventDefault: () => {
390
453
  h = !0;
391
454
  }
392
- }), !(!t || h) && (v.current ? (window.clearTimeout(v.current), v.current = null, j(e)) : v.current = window.setTimeout(() => {
393
- u(e.absolutePath), v.current = null;
394
- }, Ar));
455
+ }), !(!t || h) && (b.current ? (window.clearTimeout(b.current), b.current = null, R(e)) : b.current = window.setTimeout(() => {
456
+ u(e.absolutePath), b.current = null;
457
+ }, Fr));
395
458
  },
396
- [t, e, a, j, u, c, r, l, n]
459
+ [t, e, s, R, u, c, r, l, n]
397
460
  );
398
- }, nr = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", qt = (e, t) => e.children !== void 0 && t(e.absolutePath), sr = (e, t) => ({
461
+ }, sr = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", qt = (e, t) => e.children !== void 0 && t(e.absolutePath), ar = (e, t) => ({
399
462
  width: e,
400
463
  gridTemplateColumns: t
401
- }), ar = at(
464
+ }), or = ot(
402
465
  ({
403
466
  entry: e,
404
467
  indentLevel: t,
405
- positionInSet: a,
468
+ positionInSet: s,
406
469
  setSize: n,
407
470
  rowIndex: r,
408
471
  isSelectedForAria: l,
409
472
  rowHeight: c,
410
473
  isDirOpen: u,
411
- columns: j,
412
- numericTemplate: v,
474
+ columns: R,
475
+ numericTemplate: b,
413
476
  numericTotal: d,
414
477
  nameWidth: h,
415
478
  rowClassName: g,
416
- selection: { onEntryClick: w, selectedPath: E, mode: f = "none", selectedItems: y, onSelectionChange: k },
417
- expansion: { toggleDirectory: R, onToggleDirectoryRecursive: N },
418
- visual: { iconOverrides: S, showExpandIcons: p = !0, showDirectoryIcons: L = !0, showFileIcons: C = !0, useCanvasExpandIcons: O = !1, expandIconSize: Q, indentSize: ee = Ge, highlightStyles: $ }
479
+ selection: { onEntryClick: w, selectedPath: N, mode: f = "none", selectedItems: y, onSelectionChange: k },
480
+ expansion: { toggleDirectory: j, onToggleDirectoryRecursive: I },
481
+ visual: { iconOverrides: E, showExpandIcons: p = !0, showDirectoryIcons: L = !0, showFileIcons: C = !0, useCanvasExpandIcons: O = !1, expandIconSize: Q, indentSize: ee = Ve, highlightStyles: $ }
419
482
  }) => {
420
- const [J, te] = le(!1), I = e.children !== void 0, Y = I && u(e.absolutePath), B = e.absolutePath === E, G = !I && !!y?.has(e.absolutePath), ie = I ? void 0 : Se(e.name) || Se(e.relativePath) || Se(e.absolutePath), ce = rr({ entry: e, isDirectory: I, isExpanded: Y, isItemSelected: G, selectionMode: f, onSelectionChange: k, onEntryClick: w, toggleDirectory: R, onToggleDirectoryRecursive: N }), P = J ? $?.hoverClassName !== void 0 ? $.hoverClassName : D.entryHover : "", s = (() => {
421
- if (I) {
483
+ const [J, te] = ie(!1), S = e.children !== void 0, Y = S && u(e.absolutePath), B = e.absolutePath === N, G = !S && !!y?.has(e.absolutePath), ce = S ? void 0 : Se(e.name) || Se(e.relativePath) || Se(e.absolutePath), de = nr({ entry: e, isDirectory: S, isExpanded: Y, isItemSelected: G, selectionMode: f, onSelectionChange: k, onEntryClick: w, toggleDirectory: j, onToggleDirectoryRecursive: I }), P = J ? $?.hoverClassName !== void 0 ? $.hoverClassName : D.entryHover : "", a = (() => {
484
+ if (S) {
422
485
  if (B) return $?.directorySelectedClassName !== void 0 ? $.directorySelectedClassName : D.entrySelected;
423
486
  } else if (B || G)
424
487
  return $?.itemSelectedClassName !== void 0 ? $.itemSelectedClassName : A(B && D.entrySelected, G && D.entryItemSelected);
425
488
  return "";
426
- })(), m = typeof g == "function" ? g(e) : g, T = A("dt-grid-row cursor-pointer select-none", P, s, m, e.className), M = A(D.expandIcon, (B || G) && D.expandIconSelected), se = A(D.typeIcon, (B || G) && D.typeIconSelected), oe = A("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", I && D.nameDirectory, (B || G) && D.nameSelected), b = Qt({ isDirectory: I, isExpanded: Y, showExpandIcons: p, useCanvasExpandIcons: O, expandIconSize: Q }), z = (I ? L : C) ? er({ entry: e, isDirectory: I, isExpanded: Y, isSelected: B, isItemSelected: G, extension: ie, mimeType: e.mimeType }, S) : null, H = { indentLevel: t, isDirectory: I, isExpanded: Y }, [V, ...Ie] = j, he = V?.render ? V.render(e, H) : e.label ?? e.name, ve = {
489
+ })(), m = typeof g == "function" ? g(e) : g, T = A("dt-grid-row cursor-pointer select-none", P, a, m, e.className), M = A(D.expandIcon, (B || G) && D.expandIconSelected), se = A(D.typeIcon, (B || G) && D.typeIconSelected), le = A("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", S && D.nameDirectory, (B || G) && D.nameSelected), v = er({ isDirectory: S, isExpanded: Y, showExpandIcons: p, useCanvasExpandIcons: O, expandIconSize: Q }), z = (S ? L : C) ? tr({ entry: e, isDirectory: S, isExpanded: Y, isSelected: B, isItemSelected: G, extension: ce, mimeType: e.mimeType }, E) : null, H = { indentLevel: t, isDirectory: S, isExpanded: Y }, [V, ...Ne] = R, pe = V?.render ? V.render(e, H) : e.label ?? e.name, ge = {
427
490
  ...J ? $?.hoverStyle : {},
428
- ...I && B ? $?.directorySelectedStyle : {},
429
- ...!I && (B || G) ? $?.itemSelectedStyle : {}
491
+ ...S && B ? $?.directorySelectedStyle : {},
492
+ ...!S && (B || G) ? $?.itemSelectedStyle : {}
430
493
  };
431
494
  return /* @__PURE__ */ i.jsxs(
432
495
  "div",
433
496
  {
434
497
  className: T,
435
- style: { height: c, ...ve, ...e.style },
498
+ style: { height: c, ...ge, ...e.style },
436
499
  role: "row",
437
- "aria-expanded": I ? Y : void 0,
500
+ "aria-expanded": S ? Y : void 0,
438
501
  "aria-level": t + 1,
439
- "aria-posinset": a,
502
+ "aria-posinset": s,
440
503
  "aria-setsize": n,
441
504
  "aria-rowindex": r,
442
505
  "aria-selected": f === "none" ? void 0 : l,
443
- ...tr(e.data),
444
- "data-entry-type": I ? "directory" : "file",
445
- "data-entry-expanded": I ? String(Y) : void 0,
506
+ ...rr(e.data),
507
+ "data-entry-type": S ? "directory" : "file",
508
+ "data-entry-expanded": S ? String(Y) : void 0,
446
509
  "data-entry-selected": B ? "true" : void 0,
447
510
  "data-entry-item-selected": G ? "true" : void 0,
448
- onClick: ce,
511
+ onClick: de,
449
512
  onMouseEnter: () => te(!0),
450
513
  onMouseLeave: () => te(!1),
451
- onKeyDown: (ae) => ae.key === "Enter" && ce(ae),
514
+ onKeyDown: (ae) => ae.key === "Enter" && de(ae),
452
515
  tabIndex: 0,
453
516
  children: [
454
517
  /* @__PURE__ */ i.jsxs("div", { className: A("dt-grid-name-cell", V?.className), role: "gridcell", style: { width: h, paddingLeft: Math.max(0, t * ee) }, children: [
455
- (p || O) && /* @__PURE__ */ i.jsx("span", { className: M, children: b }),
456
- (I ? L : C) && /* @__PURE__ */ i.jsx("span", { className: se, children: z }),
457
- /* @__PURE__ */ i.jsx("span", { className: oe, children: he })
518
+ (p || O) && /* @__PURE__ */ i.jsx("span", { className: M, children: v }),
519
+ (S ? L : C) && /* @__PURE__ */ i.jsx("span", { className: se, children: z }),
520
+ /* @__PURE__ */ i.jsx("span", { className: le, children: pe })
458
521
  ] }),
459
- Ie.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: sr(d, v), children: Ie.map((ae) => /* @__PURE__ */ i.jsx("div", { className: A("dt-grid-cell", nr(ae.align), ae.className), role: "gridcell", children: ae.render ? ae.render(e, H) : null }, ae.key)) }) })
522
+ Ne.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: ar(d, b), children: Ne.map((ae) => /* @__PURE__ */ i.jsx("div", { className: A("dt-grid-cell", sr(ae.align), ae.className), role: "gridcell", children: ae.render ? ae.render(e, H) : null }, ae.key)) }) })
460
523
  ]
461
524
  }
462
525
  );
463
526
  },
464
527
  (e, t) => {
465
528
  if (e.entry !== t.entry) return !1;
466
- const a = qt(e.entry, e.isDirOpen), n = qt(t.entry, t.isDirOpen);
467
- return e.indentLevel === t.indentLevel && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowIndex === t.rowIndex && e.isSelectedForAria === t.isSelectedForAria && e.rowHeight === t.rowHeight && a === n && 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.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
529
+ const s = qt(e.entry, e.isDirOpen), n = qt(t.entry, t.isDirOpen);
530
+ return e.indentLevel === t.indentLevel && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowIndex === t.rowIndex && e.isSelectedForAria === t.isSelectedForAria && e.rowHeight === t.rowHeight && s === n && 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.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
468
531
  }
469
532
  );
470
- ar.displayName = "DirectoryTreeGridRow";
471
- const or = ({
533
+ or.displayName = "DirectoryTreeGridRow";
534
+ const lr = ({
472
535
  kind: e,
473
536
  columns: t,
474
- numericTemplate: a,
537
+ numericTemplate: s,
475
538
  numericTotal: n,
476
539
  nameWidth: r,
477
540
  scrollBarWidth: l,
478
541
  className: c,
479
542
  nameContent: u,
480
- renderCell: j
543
+ renderCell: R
481
544
  }) => {
482
- const [, ...v] = t, d = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", h = e === "header" ? "dt-grid-header" : "dt-grid-footer", g = e === "header" ? "columnheader" : "gridcell";
545
+ const [, ...b] = t, d = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", h = e === "header" ? "dt-grid-header" : "dt-grid-footer", g = e === "header" ? "columnheader" : "gridcell";
483
546
  return /* @__PURE__ */ i.jsxs("div", { className: A(h, "text-gray-600 dark:text-gray-300", c), role: "row", children: [
484
547
  /* @__PURE__ */ i.jsx("div", { className: A(d, "px-1", t[0]?.className), role: g, style: { width: r }, children: u }),
485
- v.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: sr(n, a), children: v.map((w) => /* @__PURE__ */ i.jsx("div", { className: A("dt-grid-cell", nr(w.align), w.className), role: g, children: j(w) }, w.key)) }) }),
548
+ b.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: ar(n, s), children: b.map((w) => /* @__PURE__ */ i.jsx("div", { className: A("dt-grid-cell", sr(w.align), w.className), role: g, children: R(w) }, w.key)) }) }),
486
549
  /* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: l }, "aria-hidden": "true" })
487
550
  ] });
488
- }, Mr = ({ columns: e, className: t, ...a }) => /* @__PURE__ */ i.jsx(or, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (n) => n.header ?? null, ...a }), Zt = (e, t) => typeof e == "function" ? e(t) : e ?? null, Dr = ({ columns: e, allEntries: t, className: a, ...n }) => /* @__PURE__ */ i.jsx(or, { kind: "footer", columns: e, className: a, nameContent: Zt(e[0]?.footer, t), renderCell: (r) => Zt(r.footer, t), ...n }), Or = 240, lr = 96, ir = 12, st = (e, t) => {
489
- const a = e?.width;
490
- return typeof a == "number" && Number.isFinite(a) && a > 0 ? a : t;
491
- }, Fr = (e) => e.slice(1).map((t) => `${st(t, lr)}px`).join(" "), Lr = ({ measuredWidth: e, columns: t, scrollBarWidth: a = ir }) => {
492
- const n = st(t[0], Or), r = t.slice(1).reduce((j, v) => j + st(v, lr), 0), l = Number.isFinite(e) && e > 0 ? e : 0, c = Math.max(0, l - n - Math.max(0, a)), u = Math.max(0, r - c);
551
+ }, Lr = ({ columns: e, className: t, ...s }) => /* @__PURE__ */ i.jsx(lr, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (n) => n.header ?? null, ...s }), Kt = (e, t) => typeof e == "function" ? e(t) : e ?? null, $r = ({ columns: e, allEntries: t, className: s, ...n }) => /* @__PURE__ */ i.jsx(lr, { kind: "footer", columns: e, className: s, nameContent: Kt(e[0]?.footer, t), renderCell: (r) => Kt(r.footer, t), ...n }), Hr = 240, ir = 96, cr = 12, at = (e, t) => {
552
+ const s = e?.width;
553
+ return typeof s == "number" && Number.isFinite(s) && s > 0 ? s : t;
554
+ }, Wr = (e) => e.slice(1).map((t) => `${at(t, ir)}px`).join(" "), Br = ({ measuredWidth: e, columns: t, scrollBarWidth: s = cr }) => {
555
+ const n = at(t[0], Hr), r = t.slice(1).reduce((R, b) => R + at(b, ir), 0), l = Number.isFinite(e) && e > 0 ? e : 0, c = Math.max(0, l - n - Math.max(0, s)), u = Math.max(0, r - c);
493
556
  return { nameWidth: n, numericTotal: r, numericVisible: c, maxHScroll: u };
494
- }, rt = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, $r = (e) => {
495
- const t = [], a = (n) => {
557
+ }, nt = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, zr = (e) => {
558
+ const t = [], s = (n) => {
496
559
  for (const r of n)
497
- t.push(r), r.children && r.children.length > 0 && a(r.children);
560
+ t.push(r), r.children && r.children.length > 0 && s(r.children);
498
561
  };
499
- return a(e), t;
500
- }, Hr = (e, t) => {
501
- const a = e.length - 1;
502
- if (a <= 0) return 0;
503
- let n = 0, r = a - 1, l = 0;
562
+ return s(e), t;
563
+ }, Yr = (e, t) => {
564
+ const s = e.length - 1;
565
+ if (s <= 0) return 0;
566
+ let n = 0, r = s - 1, l = 0;
504
567
  for (; n <= r; ) {
505
568
  const c = n + r >>> 1;
506
569
  e[c] <= t ? (l = c, n = c + 1) : r = c - 1;
507
570
  }
508
571
  return l;
509
- }, Wr = (e, t, a) => {
510
- if (a <= 0 || e.length === 0 || t.length !== e.length + 1)
572
+ }, Gr = (e, t, s) => {
573
+ if (s <= 0 || e.length === 0 || t.length !== e.length + 1)
511
574
  return null;
512
- const n = Hr(t, a), r = e[n];
575
+ const n = Yr(t, s), r = e[n];
513
576
  return r ? {
514
577
  path: r.entry.absolutePath,
515
- offsetInViewport: a - t[n]
578
+ offsetInViewport: s - t[n]
516
579
  } : null;
517
- }, Br = (e, t, a) => {
518
- if (t.length === 0 || a.length !== t.length + 1)
580
+ }, Vr = (e, t, s) => {
581
+ if (t.length === 0 || s.length !== t.length + 1)
519
582
  return null;
520
583
  for (let n = 0; n < t.length; n++)
521
584
  if (t[n].entry.absolutePath === e.path)
522
- return Math.max(0, a[n] + e.offsetInViewport);
585
+ return Math.max(0, s[n] + e.offsetInViewport);
523
586
  return null;
524
- }, zr = (e, t, a) => {
587
+ }, Ur = (e, t, s) => {
525
588
  const n = [];
526
- for (let r = t; r < a; r++) {
589
+ for (let r = t; r < s; r++) {
527
590
  const l = e[r];
528
591
  if (!(!l || l.length === 0))
529
592
  for (const c of l)
530
593
  n.push(c);
531
594
  }
532
595
  return n;
533
- }, Yr = (e, t, a) => {
596
+ }, Xr = (e, t, s) => {
534
597
  const n = [];
535
- for (let r = t; r < a; r++) {
598
+ for (let r = t; r < s; r++) {
536
599
  const l = e[r];
537
600
  if (!(!l || l.length === 0))
538
601
  for (const c of l)
539
602
  n.push(c);
540
603
  }
541
604
  return n;
542
- }, Gr = (e, t, a, n) => {
543
- const r = Math.max(1, Math.floor(t * n)), l = Math.max(1, Math.floor(a * n));
605
+ }, Jr = (e, t, s, n) => {
606
+ const r = Math.max(1, Math.floor(t * n)), l = Math.max(1, Math.floor(s * n));
544
607
  (e.width !== r || e.height !== l) && (e.width = r, e.height = l);
545
608
  const c = e.style;
546
- c.width !== `${t}px` && (c.width = `${t}px`), c.height !== `${a}px` && (c.height = `${a}px`);
547
- }, Vr = (e, t, a) => {
548
- e.lineWidth = a, e.beginPath();
609
+ c.width !== `${t}px` && (c.width = `${t}px`), c.height !== `${s}px` && (c.height = `${s}px`);
610
+ }, Zr = (e, t, s) => {
611
+ e.lineWidth = s, e.beginPath();
549
612
  for (const n of t)
550
613
  e.moveTo(n.x1, n.y1), e.lineTo(n.x2, n.y2);
551
614
  e.stroke();
552
- }, Ur = (e, t) => {
553
- const a = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
554
- if (!a)
615
+ }, qr = (e, t) => {
616
+ const s = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
617
+ if (!s)
555
618
  return null;
556
- let n = a[1];
619
+ let n = s[1];
557
620
  n.length === 3 && (n = n.split("").map((u) => u + u).join(""));
558
621
  const r = Number.parseInt(n.slice(0, 2), 16), l = Number.parseInt(n.slice(2, 4), 16), c = Number.parseInt(n.slice(4, 6), 16);
559
622
  return `rgba(${r}, ${l}, ${c}, ${t})`;
560
- }, Xr = (e, t, a, n) => {
623
+ }, Kr = (e, t, s, n) => {
561
624
  if (t.length === 0)
562
625
  return;
563
- const r = Ur(a, 0.14), l = e.strokeStyle, c = e.fillStyle, u = e.lineWidth, j = e.lineCap, v = e.lineJoin;
564
- e.strokeStyle = a, e.lineCap = "round", e.lineJoin = "round";
626
+ const r = qr(s, 0.14), l = e.strokeStyle, c = e.fillStyle, u = e.lineWidth, R = e.lineCap, b = e.lineJoin;
627
+ e.strokeStyle = s, e.lineCap = "round", e.lineJoin = "round";
565
628
  for (const d of t) {
566
- const h = n ?? d.size, g = Math.max(0, h / 2), w = Math.max(1, Math.round(h * 0.08)), E = Math.max(1, Math.round(h * 0.14)), f = Math.max(0, g - w * 0.8), y = Math.max(0, f * 0.55);
567
- r && (e.fillStyle = r, e.beginPath(), e.arc(d.centerX, d.centerY, f, 0, Math.PI * 2), e.fill()), e.lineWidth = w, e.beginPath(), e.arc(d.centerX, d.centerY, Math.max(0, g - w * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = E, e.beginPath(), e.moveTo(d.centerX - y, d.centerY), e.lineTo(d.centerX + y, d.centerY), e.stroke(), d.isExpanded || (e.beginPath(), e.moveTo(d.centerX, d.centerY - y), e.lineTo(d.centerX, d.centerY + y), e.stroke());
629
+ const h = n ?? d.size, g = Math.max(0, h / 2), w = Math.max(1, Math.round(h * 0.08)), N = Math.max(1, Math.round(h * 0.14)), f = Math.max(0, g - w * 0.8), y = Math.max(0, f * 0.55);
630
+ r && (e.fillStyle = r, e.beginPath(), e.arc(d.centerX, d.centerY, f, 0, Math.PI * 2), e.fill()), e.lineWidth = w, e.beginPath(), e.arc(d.centerX, d.centerY, Math.max(0, g - w * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = N, e.beginPath(), e.moveTo(d.centerX - y, d.centerY), e.lineTo(d.centerX + y, d.centerY), e.stroke(), d.isExpanded || (e.beginPath(), e.moveTo(d.centerX, d.centerY - y), e.lineTo(d.centerX, d.centerY + y), e.stroke());
568
631
  }
569
- e.strokeStyle = l, e.fillStyle = c, e.lineWidth = u, e.lineCap = j, e.lineJoin = v;
570
- }, cr = at(({ segmentsByItem: e, glyphsByItem: t, itemHeight: a, width: n, viewportHeight: r, scrollPosition: l, color: c = "#a0aec0", strokeWidth: u = 1, renderStartIndex: j, renderEndIndex: v, lookaheadEndIndex: d, devicePixelRatio: h, expandGlyphColor: g, expandGlyphSize: w }) => {
571
- const E = ne(null), f = ne(null), y = ne({
632
+ e.strokeStyle = l, e.fillStyle = c, e.lineWidth = u, e.lineCap = R, e.lineJoin = b;
633
+ }, dr = ot(({ segmentsByItem: e, glyphsByItem: t, itemHeight: s, width: n, viewportHeight: r, scrollPosition: l, color: c = "#a0aec0", strokeWidth: u = 1, renderStartIndex: R, renderEndIndex: b, lookaheadEndIndex: d, devicePixelRatio: h, expandGlyphColor: g, expandGlyphSize: w }) => {
634
+ const N = ne(null), f = ne(null), y = ne({
572
635
  segmentsByItem: e,
573
636
  glyphsByItem: t,
574
- itemHeight: a,
637
+ itemHeight: s,
575
638
  width: n,
576
639
  viewportHeight: r,
577
640
  scrollPosition: l,
578
641
  color: c,
579
642
  strokeWidth: u,
580
- renderStartIndex: j,
581
- renderEndIndex: v,
643
+ renderStartIndex: R,
644
+ renderEndIndex: b,
582
645
  lookaheadEndIndex: d,
583
646
  devicePixelRatio: h,
584
647
  expandGlyphColor: g,
585
648
  expandGlyphSize: w
586
649
  }), k = F(() => {
587
650
  f.current = null;
588
- const N = E.current;
589
- if (!N)
651
+ const I = N.current;
652
+ if (!I)
590
653
  return;
591
- const S = N.getContext("2d");
592
- if (!S)
654
+ const E = I.getContext("2d");
655
+ if (!E)
593
656
  return;
594
657
  const p = y.current;
595
658
  if (p.width <= 0 || p.viewportHeight <= 0) {
596
- S.clearRect(0, 0, N.width, N.height);
659
+ E.clearRect(0, 0, I.width, I.height);
597
660
  return;
598
661
  }
599
662
  const L = Number.isFinite(p.devicePixelRatio ?? NaN) ? p.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
600
- Gr(N, p.width, p.viewportHeight, L);
663
+ Jr(I, p.width, p.viewportHeight, L);
601
664
  const C = p.segmentsByItem.length, O = typeof p.renderStartIndex == "number" && Number.isFinite(p.renderStartIndex) ? Math.max(0, Math.floor(p.renderStartIndex)) : Math.max(0, Math.floor(p.scrollPosition / p.itemHeight)), Q = Math.min(C, Math.ceil((p.scrollPosition + p.viewportHeight) / p.itemHeight)), ee = (() => {
602
665
  if (typeof p.renderEndIndex == "number" && Number.isFinite(p.renderEndIndex)) {
603
- const I = Math.floor(p.renderEndIndex);
604
- return Math.max(Math.min(C, I + 1), O);
666
+ const S = Math.floor(p.renderEndIndex);
667
+ return Math.max(Math.min(C, S + 1), O);
605
668
  }
606
669
  return Math.max(Q, O);
607
670
  })(), $ = (() => {
608
671
  if (typeof p.lookaheadEndIndex == "number" && Number.isFinite(p.lookaheadEndIndex)) {
609
- const I = Math.floor(p.lookaheadEndIndex), Y = Math.min(C, I + 1);
672
+ const S = Math.floor(p.lookaheadEndIndex), Y = Math.min(C, S + 1);
610
673
  return Math.max(Y, ee);
611
674
  }
612
675
  return Math.max(Q, ee);
613
- })(), J = zr(p.segmentsByItem, O, $), te = Yr(p.glyphsByItem, O, $);
614
- S.save(), S.scale(L, L), S.clearRect(0, 0, p.width, p.viewportHeight), S.translate(0, -p.scrollPosition), S.strokeStyle = p.color, Vr(S, J, p.strokeWidth), Xr(S, te, p.expandGlyphColor ?? p.color, p.expandGlyphSize), S.restore();
615
- }, []), R = F(() => {
676
+ })(), J = Ur(p.segmentsByItem, O, $), te = Xr(p.glyphsByItem, O, $);
677
+ E.save(), E.scale(L, L), E.clearRect(0, 0, p.width, p.viewportHeight), E.translate(0, -p.scrollPosition), E.strokeStyle = p.color, Zr(E, J, p.strokeWidth), Kr(E, te, p.expandGlyphColor ?? p.color, p.expandGlyphSize), E.restore();
678
+ }, []), j = F(() => {
616
679
  f.current === null && (f.current = window.requestAnimationFrame(k));
617
680
  }, [k]);
618
- return me(() => {
681
+ return he(() => {
619
682
  y.current = {
620
683
  segmentsByItem: e,
621
684
  glyphsByItem: t,
622
- itemHeight: a,
685
+ itemHeight: s,
623
686
  width: n,
624
687
  viewportHeight: r,
625
688
  scrollPosition: l,
626
689
  color: c,
627
690
  strokeWidth: u,
628
- renderStartIndex: j,
629
- renderEndIndex: v,
691
+ renderStartIndex: R,
692
+ renderEndIndex: b,
630
693
  lookaheadEndIndex: d,
631
694
  devicePixelRatio: h,
632
695
  expandGlyphColor: g,
633
696
  expandGlyphSize: w
634
- }, R();
635
- }, [e, t, a, n, r, l, c, u, j, v, d, h, g, w, R]), me(() => () => {
697
+ }, j();
698
+ }, [e, t, s, n, r, l, c, u, R, b, d, h, g, w, j]), he(() => () => {
636
699
  f.current !== null && (window.cancelAnimationFrame(f.current), f.current = null);
637
- }, []), /* @__PURE__ */ i.jsx("canvas", { ref: E, className: "pointer-events-none absolute top-0 left-0 z-0" });
700
+ }, []), /* @__PURE__ */ i.jsx("canvas", { ref: N, className: "pointer-events-none absolute top-0 left-0 z-0" });
638
701
  });
639
- cr.displayName = "TreeLineCanvas";
640
- const Jr = {
702
+ dr.displayName = "TreeLineCanvas";
703
+ const Qr = {
641
704
  msOverflowStyle: "none",
642
705
  scrollbarWidth: "none"
643
- }, qr = () => {
706
+ }, en = () => {
644
707
  let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
645
708
  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));
646
- }, Zr = (e, t, a, n, r) => {
709
+ }, tn = (e, t, s, n, r) => {
647
710
  const l = [], c = [];
648
711
  let u = 0;
649
- const j = (v, d, h) => {
650
- const g = r ? [...v].sort(r) : v;
712
+ const R = (b, d, h) => {
713
+ const g = r ? [...b].sort(r) : b;
651
714
  for (let w = 0; w < g.length; w++) {
652
- const E = g[w], f = w === g.length - 1, y = [...h, f], k = E.children !== void 0, R = k && t(E.absolutePath, E.relativePath);
653
- let N = d, S = y, p = h;
654
- n && (N = d - 1, S = y.slice(1), p = h.slice(1)), l.push({ entry: E, indentLevel: N, depth: d, positionInSet: w + 1, setSize: g.length, parentIsLast: S }), a && (N > u && (u = N), c.push({
655
- id: E.absolutePath,
656
- name: E.name,
657
- absolutePath: E.absolutePath,
658
- indentLevel: N,
715
+ const N = g[w], f = w === g.length - 1, y = [...h, f], k = N.children !== void 0, j = k && t(N.absolutePath, N.relativePath);
716
+ let I = d, E = y, p = h;
717
+ n && (I = d - 1, E = y.slice(1), p = h.slice(1)), l.push({ entry: N, indentLevel: I, depth: d, positionInSet: w + 1, setSize: g.length, parentIsLast: E }), s && (I > u && (u = I), c.push({
718
+ id: N.absolutePath,
719
+ name: N.name,
720
+ absolutePath: N.absolutePath,
721
+ indentLevel: I,
659
722
  isLastChild: f,
660
723
  isDirectory: k,
661
- isExpanded: R,
724
+ isExpanded: j,
662
725
  ancestorIsLast: [...p],
663
726
  hideLines: n && d === 0
664
- })), k && R && E.children && j(E.children, d + 1, y);
727
+ })), k && j && N.children && R(N.children, d + 1, y);
665
728
  }
666
729
  };
667
- return j(e, 0, []), { flatItems: l, lineItems: c, maxIndent: u };
668
- }, Kt = (e, t) => {
669
- const a = e.length - 1;
670
- if (a <= 0) return 0;
671
- let n = 0, r = a - 1, l = 0;
730
+ return R(e, 0, []), { flatItems: l, lineItems: c, maxIndent: u };
731
+ }, Qt = (e, t) => {
732
+ const s = e.length - 1;
733
+ if (s <= 0) return 0;
734
+ let n = 0, r = s - 1, l = 0;
672
735
  for (; n <= r; ) {
673
736
  const c = n + r >>> 1;
674
737
  e[c] <= t ? (l = c, n = c + 1) : r = c - 1;
675
738
  }
676
739
  return l;
677
- }, Kr = (e, t, a, n, r, l) => {
678
- const c = n?.renderStart ?? Math.max(0, Kt(l, r)), u = t > 0 ? Kt(l, r + t) + a : c + a, j = e > 0 ? Math.min(e - 1, Math.max(c, u)) : c, v = n?.renderEnd ?? j, d = e > 0 ? Math.min(e - 1, v + a) : v;
679
- return { renderStart: c, renderEnd: v, lookaheadEnd: d };
680
- }, Qr = (e, t, a, n, r, l) => {
740
+ }, rn = (e, t, s, n, r, l) => {
741
+ const c = n?.renderStart ?? Math.max(0, Qt(l, r)), u = t > 0 ? Qt(l, r + t) + s : c + s, R = e > 0 ? Math.min(e - 1, Math.max(c, u)) : c, b = n?.renderEnd ?? R, d = e > 0 ? Math.min(e - 1, b + s) : b;
742
+ return { renderStart: c, renderEnd: b, lookaheadEnd: d };
743
+ }, nn = (e, t, s, n, r, l) => {
681
744
  if (e.length === 0)
682
745
  return { segmentsByItem: [], glyphsByItem: [] };
683
- const c = Array.from({ length: e.length }, () => []), u = Array.from({ length: e.length }, () => []), j = (d) => r ? typeof l == "number" && Number.isFinite(l) && l > 0 ? l : Math.max(8, Math.min(n * 0.9, d * 0.7)) : 0, v = 3;
746
+ const c = Array.from({ length: e.length }, () => []), u = Array.from({ length: e.length }, () => []), R = (d) => r ? typeof l == "number" && Number.isFinite(l) && l > 0 ? l : Math.max(8, Math.min(n * 0.9, d * 0.7)) : 0, b = 3;
684
747
  for (let d = 0; d < e.length; d++) {
685
748
  const h = e[d];
686
749
  if (h.hideLines)
687
750
  continue;
688
- const g = [], w = t[d] ?? 0, E = a[d] ?? 0, f = E + w / 2, y = j(w), k = y > 0 ? y / 2 + 2 : n / 1.5;
689
- for (let S = 0; S < h.indentLevel; S++) {
690
- if (h.ancestorIsLast[S] ?? !1)
751
+ const g = [], w = t[d] ?? 0, N = s[d] ?? 0, f = N + w / 2, y = R(w), k = y > 0 ? y / 2 + 2 : n / 1.5;
752
+ for (let E = 0; E < h.indentLevel; E++) {
753
+ if (h.ancestorIsLast[E] ?? !1)
691
754
  continue;
692
755
  let L = !1;
693
756
  for (let C = d; C < e.length; C++) {
694
757
  const O = e[C];
695
- if (O.indentLevel > S && O.ancestorIsLast.length > S && !O.ancestorIsLast[S]) {
758
+ if (O.indentLevel > E && O.ancestorIsLast.length > E && !O.ancestorIsLast[E]) {
696
759
  L = !0;
697
760
  break;
698
761
  }
699
- if (C > d && O.indentLevel === S)
762
+ if (C > d && O.indentLevel === E)
700
763
  break;
701
764
  }
702
765
  if (L) {
703
- const C = S * n + n / 2 + v;
766
+ const C = E * n + n / 2 + b;
704
767
  g.push({
705
- key: `${h.id}-ancestor-${S}`,
768
+ key: `${h.id}-ancestor-${E}`,
706
769
  x1: C,
707
- y1: E,
770
+ y1: N,
708
771
  x2: C,
709
- y2: E + w,
772
+ y2: N + w,
710
773
  itemIndex: d
711
774
  });
712
775
  }
713
776
  }
714
- const R = h.indentLevel * n, N = R + n / 2 + v;
777
+ const j = h.indentLevel * n, I = j + n / 2 + b;
715
778
  if (h.isDirectory ? g.push({
716
779
  key: `${h.id}-connector-top`,
717
- x1: N,
718
- y1: E,
719
- x2: N,
780
+ x1: I,
781
+ y1: N,
782
+ x2: I,
720
783
  y2: f - k,
721
784
  itemIndex: d
722
785
  }) : g.push({
723
786
  key: `${h.id}-connector-top`,
724
- x1: N,
725
- y1: E,
726
- x2: N,
787
+ x1: I,
788
+ y1: N,
789
+ x2: I,
727
790
  y2: f,
728
791
  itemIndex: d
729
792
  }), !h.isDirectory && h.isLastChild && g.push({
730
793
  key: `${h.id}-connector-horizontal`,
731
- x1: N,
794
+ x1: I,
732
795
  y1: f,
733
- x2: R + n + v,
796
+ x2: j + n + b,
734
797
  y2: f,
735
798
  itemIndex: d
736
799
  }), h.isLastChild || (h.isDirectory ? g.push({
737
800
  key: `${h.id}-connector-bottom`,
738
- x1: N,
801
+ x1: I,
739
802
  y1: f + k,
740
- x2: N,
741
- y2: E + w,
803
+ x2: I,
804
+ y2: N + w,
742
805
  itemIndex: d
743
806
  }) : g.push({
744
807
  key: `${h.id}-connector-bottom`,
745
- x1: N,
808
+ x1: I,
746
809
  y1: f,
747
- x2: N,
748
- y2: E + w,
810
+ x2: I,
811
+ y2: N + w,
749
812
  itemIndex: d
750
813
  })), c[d] = g, r && h.isDirectory) {
751
- const S = y, p = N, L = f;
814
+ const E = y, p = I, L = f;
752
815
  u[d] = [
753
816
  {
754
817
  key: `${h.id}-glyph`,
755
818
  itemIndex: d,
756
819
  centerX: p,
757
820
  centerY: L,
758
- size: S,
821
+ size: E,
759
822
  isExpanded: h.isExpanded
760
823
  }
761
824
  ];
762
825
  }
763
826
  }
764
827
  return { segmentsByItem: c, glyphsByItem: u };
765
- }, ot = at(
828
+ }, lt = ot(
766
829
  ({
767
830
  entry: e,
768
831
  indentLevel: t,
769
- depth: a,
832
+ depth: s,
770
833
  positionInSet: n,
771
834
  setSize: r,
772
835
  isSelectedForAria: l,
773
836
  flatIndex: c,
774
837
  isActive: u,
775
- registerRowRef: j,
776
- onNavigationKeyDown: v,
838
+ registerRowRef: R,
839
+ onNavigationKeyDown: b,
777
840
  rowHeight: d,
778
841
  isDirOpen: h,
779
842
  parentIsLast: g,
780
843
  renderChildren: w = !0,
781
- expansion: { toggleDirectory: E, onToggleDirectoryRecursive: f },
782
- selection: { onEntryClick: y, selectedPath: k, mode: R = "none", selectedItems: N, onSelectionChange: S },
844
+ expansion: { toggleDirectory: N, onToggleDirectoryRecursive: f },
845
+ selection: { onEntryClick: y, selectedPath: k, mode: j = "none", selectedItems: I, onSelectionChange: E },
783
846
  visual: {
784
847
  iconOverrides: p,
785
848
  showExpandIcons: L = !0,
@@ -789,86 +852,86 @@ const Jr = {
789
852
  expandIconSize: ee,
790
853
  typeIconSize: $,
791
854
  fontSize: J,
792
- indentSize: te = Ge,
793
- highlightStyles: I,
855
+ indentSize: te = Ve,
856
+ highlightStyles: S,
794
857
  entryClassName: Y,
795
858
  entryStyle: B,
796
859
  nameClassName: G,
797
- nameStyle: ie,
798
- directoryNameClassName: ce,
860
+ nameStyle: ce,
861
+ directoryNameClassName: de,
799
862
  directoryNameStyle: P,
800
- fileNameClassName: s,
863
+ fileNameClassName: a,
801
864
  fileNameStyle: m
802
865
  }
803
866
  }) => {
804
- const [T, M] = le(null), [se, oe] = le(!1), b = e.children !== void 0, z = b && h(e.absolutePath), H = e.absolutePath === k, V = !b && N?.has(e.absolutePath), Ie = b ? void 0 : Se(e.name) || Se(e.relativePath) || Se(e.absolutePath);
805
- me(() => {
867
+ const [T, M] = ie(null), [se, le] = ie(!1), v = e.children !== void 0, z = v && h(e.absolutePath), H = e.absolutePath === k, V = !v && I?.has(e.absolutePath), Ne = v ? void 0 : Se(e.name) || Se(e.relativePath) || Se(e.absolutePath);
868
+ he(() => {
806
869
  M(z && e.children ? e.children : null);
807
870
  }, [z, e.children]);
808
- const he = rr({ entry: e, isDirectory: b, isExpanded: z, isItemSelected: !!V, selectionMode: R, onSelectionChange: S, onEntryClick: y, toggleDirectory: E, onToggleDirectoryRecursive: f }), ve = se ? I?.hoverClassName !== void 0 ? I.hoverClassName : D.entryHover : "", ae = (() => {
809
- if (b) {
871
+ const pe = nr({ entry: e, isDirectory: v, isExpanded: z, isItemSelected: !!V, selectionMode: j, onSelectionChange: E, onEntryClick: y, toggleDirectory: N, onToggleDirectoryRecursive: f }), ge = se ? S?.hoverClassName !== void 0 ? S.hoverClassName : D.entryHover : "", ae = (() => {
872
+ if (v) {
810
873
  if (H)
811
- return I?.directorySelectedClassName !== void 0 ? I.directorySelectedClassName : D.entrySelected;
874
+ return S?.directorySelectedClassName !== void 0 ? S.directorySelectedClassName : D.entrySelected;
812
875
  } else if (H || V)
813
- return I?.itemSelectedClassName !== void 0 ? I.itemSelectedClassName : A(H && D.entrySelected, V && D.entryItemSelected);
876
+ return S?.itemSelectedClassName !== void 0 ? S.itemSelectedClassName : A(H && D.entrySelected, V && D.entryItemSelected);
814
877
  return "";
815
- })(), Ve = A(D.entry, ve, ae, Y, e.className), Ee = A(D.expandIcon, (H || V) && D.expandIconSelected), _e = A(D.typeIcon, (H || V) && D.typeIconSelected), Ae = A(D.name, G, b && D.nameDirectory, b && ce, !b && s, (H || V) && D.nameSelected), Me = Qt({ isDirectory: b, isExpanded: z, showExpandIcons: L, useCanvasExpandIcons: Q, expandIconSize: ee }), De = (b ? C : O) ? er({ entry: e, isDirectory: b, isExpanded: z, isSelected: H, isItemSelected: !!V, extension: Ie, mimeType: e.mimeType }, p) : null, Oe = {
816
- ...se ? I?.hoverStyle : {},
817
- ...b && H ? I?.directorySelectedStyle : {},
818
- ...!b && (H || V) ? I?.itemSelectedStyle : {}
819
- }, pe = tr(e.data), Fe = $ ? { width: $, height: $ } : void 0, Re = J ? { fontSize: typeof J == "number" ? `${J}px` : J } : void 0;
820
- return /* @__PURE__ */ i.jsxs(gr, { children: [
878
+ })(), Ue = A(D.entry, ge, ae, Y, e.className), Ie = A(D.expandIcon, (H || V) && D.expandIconSelected), Ae = A(D.typeIcon, (H || V) && D.typeIconSelected), Me = A(D.name, G, v && D.nameDirectory, v && de, !v && a, (H || V) && D.nameSelected), De = er({ isDirectory: v, isExpanded: z, showExpandIcons: L, useCanvasExpandIcons: Q, expandIconSize: ee }), Oe = (v ? C : O) ? tr({ entry: e, isDirectory: v, isExpanded: z, isSelected: H, isItemSelected: !!V, extension: Ne, mimeType: e.mimeType }, p) : null, Fe = {
879
+ ...se ? S?.hoverStyle : {},
880
+ ...v && H ? S?.directorySelectedStyle : {},
881
+ ...!v && (H || V) ? S?.itemSelectedStyle : {}
882
+ }, ye = rr(e.data), Le = $ ? { width: $, height: $ } : void 0, Te = J ? { fontSize: typeof J == "number" ? `${J}px` : J } : void 0;
883
+ return /* @__PURE__ */ i.jsxs(wr, { children: [
821
884
  /* @__PURE__ */ i.jsxs(
822
885
  "div",
823
886
  {
824
- className: Ve,
887
+ className: Ue,
825
888
  style: {
826
889
  paddingLeft: `${Math.max(0, t * te)}px`,
827
890
  transform: t < 0 ? `translateX(${t * te}px)` : void 0,
828
891
  width: t < 0 ? `calc(100% + ${Math.abs(t * te)}px)` : void 0,
829
892
  height: `${d}px`,
830
- ...Re,
831
- ...Oe,
893
+ ...Te,
894
+ ...Fe,
832
895
  ...B,
833
896
  ...e.style
834
897
  },
835
- ...pe,
836
- "data-entry-type": b ? "directory" : "file",
837
- "data-entry-expanded": b ? String(z) : void 0,
898
+ ...ye,
899
+ "data-entry-type": v ? "directory" : "file",
900
+ "data-entry-expanded": v ? String(z) : void 0,
838
901
  "data-entry-selected": H ? "true" : void 0,
839
902
  "data-entry-item-selected": V ? "true" : void 0,
840
- onClick: he,
841
- onMouseEnter: () => oe(!0),
842
- onMouseLeave: () => oe(!1),
843
- ref: (re) => j(c, re),
903
+ onClick: pe,
904
+ onMouseEnter: () => le(!0),
905
+ onMouseLeave: () => le(!1),
906
+ ref: (re) => R(c, re),
844
907
  onKeyDown: (re) => {
845
908
  if (re.key === "Enter" || re.key === " ") {
846
- re.preventDefault(), he(re);
909
+ re.preventDefault(), pe(re);
847
910
  return;
848
911
  }
849
- v(re, c);
912
+ b(re, c);
850
913
  },
851
914
  tabIndex: u ? 0 : -1,
852
915
  role: "treeitem",
853
- "aria-expanded": b ? z : void 0,
854
- "aria-level": a + 1,
916
+ "aria-expanded": v ? z : void 0,
917
+ "aria-level": s + 1,
855
918
  "aria-posinset": n,
856
919
  "aria-setsize": r,
857
- "aria-selected": R === "none" ? void 0 : l,
858
- "aria-label": `${e.name} (${b ? "directory" : "file"})`,
920
+ "aria-selected": j === "none" ? void 0 : l,
921
+ "aria-label": `${e.name} (${v ? "directory" : "file"})`,
859
922
  children: [
860
- (L || Q) && /* @__PURE__ */ i.jsx("span", { className: Ee, children: Me }),
861
- (b ? C : O) && /* @__PURE__ */ i.jsx("span", { className: _e, style: Fe, children: De }),
923
+ (L || Q) && /* @__PURE__ */ i.jsx("span", { className: Ie, children: De }),
924
+ (v ? C : O) && /* @__PURE__ */ i.jsx("span", { className: Ae, style: Le, children: Oe }),
862
925
  /* @__PURE__ */ i.jsx(
863
926
  "span",
864
927
  {
865
- className: Ae,
928
+ className: Me,
866
929
  style: {
867
- ...Re,
868
- ...ie,
869
- ...b ? P : m
930
+ ...Te,
931
+ ...ce,
932
+ ...v ? P : m
870
933
  },
871
- "data-entry-type": b ? "directory" : "file",
934
+ "data-entry-type": v ? "directory" : "file",
872
935
  "data-entry-role": "name",
873
936
  children: e.label ?? e.name
874
937
  }
@@ -876,24 +939,24 @@ const Jr = {
876
939
  ]
877
940
  }
878
941
  ),
879
- z && T && w && /* @__PURE__ */ i.jsx("fieldset", { children: T.map((re, Te) => /* @__PURE__ */ i.jsx(
880
- ot,
942
+ z && T && w && /* @__PURE__ */ i.jsx("fieldset", { children: T.map((re, Ce) => /* @__PURE__ */ i.jsx(
943
+ lt,
881
944
  {
882
945
  entry: re,
883
946
  indentLevel: t + 1,
884
- depth: a + 1,
885
- positionInSet: Te + 1,
947
+ depth: s + 1,
948
+ positionInSet: Ce + 1,
886
949
  setSize: T.length,
887
- isSelectedForAria: !!N?.has(re.absolutePath),
950
+ isSelectedForAria: !!I?.has(re.absolutePath),
888
951
  flatIndex: -1,
889
952
  isActive: !1,
890
- registerRowRef: j,
891
- onNavigationKeyDown: v,
953
+ registerRowRef: R,
954
+ onNavigationKeyDown: b,
892
955
  rowHeight: d,
893
956
  isDirOpen: h,
894
- parentIsLast: [...g, Te === T.length - 1],
895
- expansion: { toggleDirectory: E, onToggleDirectoryRecursive: f },
896
- selection: { onEntryClick: y, selectedPath: k, mode: R, selectedItems: N, onSelectionChange: S },
957
+ parentIsLast: [...g, Ce === T.length - 1],
958
+ expansion: { toggleDirectory: N, onToggleDirectoryRecursive: f },
959
+ selection: { onEntryClick: y, selectedPath: k, mode: j, selectedItems: I, onSelectionChange: E },
897
960
  visual: {
898
961
  iconOverrides: p,
899
962
  showExpandIcons: L,
@@ -901,14 +964,14 @@ const Jr = {
901
964
  showFileIcons: O,
902
965
  useCanvasExpandIcons: Q,
903
966
  expandIconSize: ee,
904
- highlightStyles: I,
967
+ highlightStyles: S,
905
968
  entryClassName: Y,
906
969
  entryStyle: B,
907
970
  nameClassName: G,
908
- nameStyle: ie,
909
- directoryNameClassName: ce,
971
+ nameStyle: ce,
972
+ directoryNameClassName: de,
910
973
  directoryNameStyle: P,
911
- fileNameClassName: s,
974
+ fileNameClassName: a,
912
975
  fileNameStyle: m
913
976
  }
914
977
  },
@@ -918,265 +981,265 @@ const Jr = {
918
981
  },
919
982
  (e, t) => {
920
983
  if (e.entry !== t.entry) return !1;
921
- const a = e.entry.children !== void 0, n = t.entry.children !== void 0, r = a && e.isDirOpen(e.entry.absolutePath), l = n && t.isDirOpen(t.entry.absolutePath);
984
+ const s = e.entry.children !== void 0, n = t.entry.children !== void 0, r = s && e.isDirOpen(e.entry.absolutePath), l = n && t.isDirOpen(t.entry.absolutePath);
922
985
  return e.indentLevel === t.indentLevel && // 位置情報は aria として描画されるため、変化したら再描画が必要
923
986
  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 && r === l && e.selection.selectedPath === t.selection.selectedPath && 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.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.parentIsLast.length === t.parentIsLast.length && e.parentIsLast.every((c, u) => c === t.parentIsLast[u]);
924
987
  }
925
988
  );
926
- ot.displayName = "DirectoryEntryItem";
927
- const dr = (e) => {
989
+ lt.displayName = "DirectoryEntryItem";
990
+ const ur = (e) => {
928
991
  const t = [];
929
992
  if (e.children)
930
- for (const a of e.children)
931
- a.type === "directory" && (t.push(a.absolutePath), t.push(...dr(a)));
993
+ for (const s of e.children)
994
+ s.type === "directory" && (t.push(s.absolutePath), t.push(...ur(s)));
932
995
  return t;
933
- }, an = ({
996
+ }, cn = ({
934
997
  entries: e,
935
- expansion: { toggle: t, isExpanded: a, expandMultiple: n, collapseMultiple: r, isPending: l, alwaysExpanded: c = !1, doubleClickAction: u = "recursive" },
936
- selection: { onEntryClick: j, selectedPath: v, mode: d = "none", selectedItems: h, onSelectionChange: g },
998
+ expansion: { toggle: t, isExpanded: s, expandMultiple: n, collapseMultiple: r, isPending: l, alwaysExpanded: c = !1, doubleClickAction: u = "recursive" },
999
+ selection: { onEntryClick: R, selectedPath: b, mode: d = "none", selectedItems: h, onSelectionChange: g },
937
1000
  visual: {
938
1001
  className: w,
939
- style: E,
1002
+ style: N,
940
1003
  ariaLabel: f,
941
1004
  ariaLabelledBy: y,
942
1005
  lineColor: k = "#A0AEC0",
943
- showTreeLines: R = !0,
944
- showExpandIcons: N = !0,
945
- showDirectoryIcons: S = !0,
1006
+ showTreeLines: j = !0,
1007
+ showExpandIcons: I = !0,
1008
+ showDirectoryIcons: E = !0,
946
1009
  showFileIcons: p = !0,
947
1010
  iconOverrides: L,
948
1011
  expandIconSize: C,
949
- itemHeight: O = Ye,
1012
+ itemHeight: O = Ge,
950
1013
  removeRootIndent: Q = !1,
951
1014
  highlightStyles: ee,
952
1015
  entryClassName: $,
953
1016
  entryStyle: J,
954
1017
  nameClassName: te,
955
- nameStyle: I,
1018
+ nameStyle: S,
956
1019
  directoryNameClassName: Y,
957
1020
  directoryNameStyle: B,
958
1021
  fileNameClassName: G,
959
- fileNameStyle: ie
1022
+ fileNameStyle: ce
960
1023
  } = {},
961
- virtualScroll: ce,
1024
+ virtualScroll: de,
962
1025
  grid: P,
963
- sort: s
1026
+ sort: a
964
1027
  }) => {
965
- const m = P !== void 0, [T, M] = le(!1), se = ne(null), oe = ne(null), b = ne(null), [z, H] = le(0), [V, Ie] = le(0), [he, ve] = le(0), [ae, Ve] = le(null), {
966
- overscanCount: Ee = 15,
967
- className: _e,
968
- background: Ae,
969
- onScroll: Me,
970
- onRangeChange: De,
971
- initialScrollIndex: Oe,
972
- initialScrollOffset: pe,
973
- initialScrollAnchor: Fe,
974
- callbackThrottleMs: Re = 5,
1028
+ const m = P !== void 0, [T, M] = ie(!1), se = ne(null), le = ne(null), v = ne(null), [z, H] = ie(0), [V, Ne] = ie(0), [pe, ge] = ie(0), [ae, Ue] = ie(null), {
1029
+ overscanCount: Ie = 15,
1030
+ className: Ae,
1031
+ background: Me,
1032
+ onScroll: De,
1033
+ onRangeChange: Oe,
1034
+ initialScrollIndex: Fe,
1035
+ initialScrollOffset: ye,
1036
+ initialScrollAnchor: Le,
1037
+ callbackThrottleMs: Te = 5,
975
1038
  contentInsets: re,
976
- onItemFocus: Te,
977
- viewportHeightOverride: de,
978
- scrollBarOptions: Ue,
979
- behaviorOptions: lt,
980
- preserveScrollAnchor: it = !1,
981
- getItemKey: ur,
1039
+ onItemFocus: Ce,
1040
+ viewportHeightOverride: ue,
1041
+ scrollBarOptions: Xe,
1042
+ behaviorOptions: it,
1043
+ preserveScrollAnchor: ct = !1,
1044
+ getItemKey: fr,
982
1045
  // 素通しの pass-through。型で受け付けているものは実際に転送する
983
1046
  // (`role="tree"` は本コンポーネント自身のコンテナに付くため contentProps とは別要素で衝突しない)
984
- testId: ct,
985
- contentProps: Xe
986
- } = ce ?? {}, dt = K(() => m ? { role: "rowgroup", ...Xe } : Xe, [m, Xe]), [Le, ut] = le(typeof pe == "number" ? pe : 0), Je = ne(typeof pe == "number" ? pe : 0), ft = F(
1047
+ testId: dt,
1048
+ contentProps: Je
1049
+ } = de ?? {}, ut = K(() => m ? { role: "rowgroup", ...Je } : Je, [m, Je]), [$e, ft] = ie(typeof ye == "number" ? ye : 0), Ze = ne(typeof ye == "number" ? ye : 0), mt = F(
987
1050
  (o, x) => {
988
- Je.current = o, ut(o), Me?.(o, x);
1051
+ Ze.current = o, ft(o), De?.(o, x);
989
1052
  },
990
- [Me]
991
- ), mt = F(
1053
+ [De]
1054
+ ), ht = F(
992
1055
  (o) => {
993
1056
  const { renderingStartIndex: x, renderingEndIndex: _ } = o;
994
- Ve((W) => W && W.renderStart === x && W.renderEnd === _ ? W : { renderStart: x, renderEnd: _ }), De?.(o);
1057
+ Ue((W) => W && W.renderStart === x && W.renderEnd === _ ? W : { renderStart: x, renderEnd: _ }), Oe?.(o);
995
1058
  },
996
- [De]
1059
+ [Oe]
997
1060
  );
998
- me(() => {
999
- M(!0), qr();
1000
- }, []), me(() => {
1001
- const o = se.current, x = m ? oe.current : o, _ = () => {
1061
+ he(() => {
1062
+ M(!0), en();
1063
+ }, []), he(() => {
1064
+ const o = se.current, x = m ? le.current : o, _ = () => {
1002
1065
  if (o) {
1003
1066
  const U = o.clientWidth;
1004
- Ie((q) => Math.abs(q - U) > 1 ? U : q);
1067
+ Ne((Z) => Math.abs(Z - U) > 1 ? U : Z);
1005
1068
  }
1006
- if (typeof de == "number")
1007
- H((U) => Math.abs(U - de) > 1 ? de : U);
1069
+ if (typeof ue == "number")
1070
+ H((U) => Math.abs(U - ue) > 1 ? ue : U);
1008
1071
  else if (x) {
1009
1072
  const U = x.clientHeight;
1010
- H((q) => Math.abs(q - U) > 1 ? U : q);
1073
+ H((Z) => Math.abs(Z - U) > 1 ? U : Z);
1011
1074
  }
1012
1075
  };
1013
1076
  if (!(o || x)) return H(0);
1014
1077
  _();
1015
1078
  const W = new ResizeObserver(_);
1016
1079
  return o && W.observe(o), x && x !== o && W.observe(x), () => W.disconnect();
1017
- }, [de, m]);
1018
- const ye = typeof de == "number" ? de : z, ue = F((o) => c || (T ? a(o) : !1), [T, a, c]), ht = A(D.container, l && D.containerPending, w), pt = K(
1080
+ }, [ue, m]);
1081
+ const xe = typeof ue == "number" ? ue : z, fe = F((o) => c || (T ? s(o) : !1), [T, s, c]), pt = A(D.container, l && D.containerPending, w), yt = K(
1019
1082
  () => ({
1020
- ...Jr,
1021
- ...E ?? {},
1022
- ...typeof de == "number" ? { height: de, minHeight: de } : {}
1083
+ ...Qr,
1084
+ ...N ?? {},
1085
+ ...typeof ue == "number" ? { height: ue, minHeight: ue } : {}
1023
1086
  }),
1024
- [E, de]
1087
+ [N, ue]
1025
1088
  ), qe = F(
1026
1089
  (o, x) => {
1027
- const _ = [o.absolutePath, ...dr(o)], W = x || u;
1028
- if (_.every((fe) => ue(fe))) return r(_);
1029
- if (_.every((fe) => !ue(fe)) || W === "recursive") return n(_);
1090
+ const _ = [o.absolutePath, ...ur(o)], W = x || u;
1091
+ if (_.every((me) => fe(me))) return r(_);
1092
+ if (_.every((me) => !fe(me)) || W === "recursive") return n(_);
1030
1093
  if (W === "toggle") return r(_);
1031
1094
  console.warn(`[DirectoryTree] Unknown double click action: ${W}. No action taken.`);
1032
1095
  },
1033
- [ue, n, r, u]
1034
- ), yt = m ? !1 : Q, { flatItems: ge, lineItems: Ze, maxIndent: xt } = K(() => Zr(e, ue, R, yt, s), [e, ue, R, yt, s]), X = K(
1035
- () => ge.map((o, x) => {
1096
+ [fe, n, r, u]
1097
+ ), xt = m ? !1 : Q, { flatItems: we, lineItems: Ke, maxIndent: vt } = K(() => tn(e, fe, j, xt, a), [e, fe, j, xt, a]), X = K(
1098
+ () => we.map((o, x) => {
1036
1099
  const _ = typeof O == "function" ? O(o.entry, x) : O;
1037
- return { ...o, rowHeight: Number.isFinite(_) && _ > 0 ? _ : Ye };
1100
+ return { ...o, rowHeight: Number.isFinite(_) && _ > 0 ? _ : Ge };
1038
1101
  }),
1039
- [ge, O]
1040
- ), xe = K(() => X.map((o) => o.rowHeight), [X]), we = K(() => {
1041
- const o = new Array(xe.length + 1);
1102
+ [we, O]
1103
+ ), ve = K(() => X.map((o) => o.rowHeight), [X]), ke = K(() => {
1104
+ const o = new Array(ve.length + 1);
1042
1105
  o[0] = 0;
1043
- for (let x = 0; x < xe.length; x++)
1044
- o[x + 1] = o[x] + xe[x];
1106
+ for (let x = 0; x < ve.length; x++)
1107
+ o[x + 1] = o[x] + ve[x];
1045
1108
  return o;
1046
- }, [xe]), bt = F((o) => X[o]?.rowHeight ?? Ye, [X]), fr = F((o) => X[o]?.entry.absolutePath ?? o, [X]), vt = ur ?? fr, gt = ne(ge);
1047
- gt.current = ge;
1048
- const wt = ne(ue);
1049
- wt.current = ue;
1050
- const Ke = ne(t);
1051
- Ke.current = t;
1052
- const [kt, St] = le(0), Qe = ne(/* @__PURE__ */ new Map()), et = ne(null), It = F((o, x) => {
1053
- x ? (Qe.current.set(o, x), et.current === o && (et.current = null, x.focus())) : Qe.current.delete(o);
1054
- }, []), ke = F((o) => {
1109
+ }, [ve]), bt = F((o) => X[o]?.rowHeight ?? Ge, [X]), mr = F((o) => X[o]?.entry.absolutePath ?? o, [X]), gt = fr ?? mr, wt = ne(we);
1110
+ wt.current = we;
1111
+ const kt = ne(fe);
1112
+ kt.current = fe;
1113
+ const Qe = ne(t);
1114
+ Qe.current = t;
1115
+ const [Et, St] = ie(0), et = ne(/* @__PURE__ */ new Map()), tt = ne(null), Nt = F((o, x) => {
1116
+ x ? (et.current.set(o, x), tt.current === o && (tt.current = null, x.focus())) : et.current.delete(o);
1117
+ }, []), Ee = F((o) => {
1055
1118
  St(o);
1056
- const x = Qe.current.get(o);
1119
+ const x = et.current.get(o);
1057
1120
  if (x) {
1058
1121
  x.focus();
1059
1122
  return;
1060
1123
  }
1061
- et.current = o, b.current?.scrollToIndex(o);
1124
+ tt.current = o, v.current?.scrollToIndex(o);
1062
1125
  }, []);
1063
- me(() => {
1064
- St((o) => ge.length === 0 ? 0 : Math.min(o, ge.length - 1));
1065
- }, [ge.length]);
1066
- const Et = F(
1126
+ he(() => {
1127
+ St((o) => we.length === 0 ? 0 : Math.min(o, we.length - 1));
1128
+ }, [we.length]);
1129
+ const It = F(
1067
1130
  (o, x) => {
1068
- const _ = gt.current, W = _.length - 1;
1131
+ const _ = wt.current, W = _.length - 1;
1069
1132
  if (W < 0) return;
1070
- const U = _[x], q = U?.entry.children !== void 0, fe = q && wt.current(U.entry.absolutePath);
1133
+ const U = _[x], Z = U?.entry.children !== void 0, me = Z && kt.current(U.entry.absolutePath);
1071
1134
  switch (o.key) {
1072
1135
  case "ArrowDown":
1073
- o.preventDefault(), ke(Math.min(x + 1, W));
1136
+ o.preventDefault(), Ee(Math.min(x + 1, W));
1074
1137
  break;
1075
1138
  case "ArrowUp":
1076
- o.preventDefault(), ke(Math.max(x - 1, 0));
1139
+ o.preventDefault(), Ee(Math.max(x - 1, 0));
1077
1140
  break;
1078
1141
  case "Home":
1079
- o.preventDefault(), ke(0);
1142
+ o.preventDefault(), Ee(0);
1080
1143
  break;
1081
1144
  case "End":
1082
- o.preventDefault(), ke(W);
1145
+ o.preventDefault(), Ee(W);
1083
1146
  break;
1084
1147
  case "ArrowRight":
1085
- o.preventDefault(), q && !fe ? Ke.current(U.entry.absolutePath) : q && x < W && ke(x + 1);
1148
+ o.preventDefault(), Z && !me ? Qe.current(U.entry.absolutePath) : Z && x < W && Ee(x + 1);
1086
1149
  break;
1087
1150
  case "ArrowLeft": {
1088
- if (o.preventDefault(), q && fe) {
1089
- Ke.current(U.entry.absolutePath);
1151
+ if (o.preventDefault(), Z && me) {
1152
+ Qe.current(U.entry.absolutePath);
1090
1153
  break;
1091
1154
  }
1092
- const xr = U?.depth ?? 0;
1093
- for (let Be = x - 1; Be >= 0; Be--)
1094
- if (_[Be].depth < xr) {
1095
- ke(Be);
1155
+ const vr = U?.depth ?? 0;
1156
+ for (let ze = x - 1; ze >= 0; ze--)
1157
+ if (_[ze].depth < vr) {
1158
+ Ee(ze);
1096
1159
  break;
1097
1160
  }
1098
1161
  break;
1099
1162
  }
1100
1163
  }
1101
1164
  },
1102
- [ke]
1103
- ), $e = K(
1104
- () => !R || Ze.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : Qr(Ze, xe, we, Ge, R, C ?? Jt),
1105
- [Ze, xe, we, R, C]
1106
- ), He = K(() => !R || e.length === 0 ? 0 : (xt + 2) * Ge, [e.length, xt, R]), { renderStart: Nt, renderEnd: jt, lookaheadEnd: Rt } = K(
1107
- () => Kr(X.length, ye, Ee, ae, Le, we),
1108
- [X.length, ye, Ee, ae, Le, we]
1109
- ), tt = K(() => !R || He <= 0 || ye <= 0 || $e.segmentsByItem.length === 0 ? null : /* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("div", { className: "absolute top-0 left-0", style: { width: He, height: ye }, children: /* @__PURE__ */ i.jsx(
1110
- cr,
1165
+ [Ee]
1166
+ ), He = K(
1167
+ () => !j || Ke.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : nn(Ke, ve, ke, Ve, j, C ?? Zt),
1168
+ [Ke, ve, ke, j, C]
1169
+ ), We = K(() => !j || e.length === 0 ? 0 : (vt + 2) * Ve, [e.length, vt, j]), { renderStart: Rt, renderEnd: jt, lookaheadEnd: Tt } = K(
1170
+ () => rn(X.length, xe, Ie, ae, $e, ke),
1171
+ [X.length, xe, Ie, ae, $e, ke]
1172
+ ), rt = K(() => !j || We <= 0 || xe <= 0 || He.segmentsByItem.length === 0 ? null : /* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("div", { className: "absolute top-0 left-0", style: { width: We, height: xe }, children: /* @__PURE__ */ i.jsx(
1173
+ dr,
1111
1174
  {
1112
- segmentsByItem: $e.segmentsByItem,
1113
- glyphsByItem: $e.glyphsByItem,
1114
- itemHeight: xe[0] ?? Ye,
1115
- width: He,
1116
- viewportHeight: ye,
1117
- scrollPosition: Le,
1175
+ segmentsByItem: He.segmentsByItem,
1176
+ glyphsByItem: He.glyphsByItem,
1177
+ itemHeight: ve[0] ?? Ge,
1178
+ width: We,
1179
+ viewportHeight: xe,
1180
+ scrollPosition: $e,
1118
1181
  color: k,
1119
1182
  expandGlyphColor: k,
1120
- expandGlyphSize: C ?? Jt,
1121
- renderStartIndex: Nt,
1183
+ expandGlyphSize: C ?? Zt,
1184
+ renderStartIndex: Rt,
1122
1185
  renderEndIndex: jt,
1123
- lookaheadEndIndex: Rt
1186
+ lookaheadEndIndex: Tt
1124
1187
  }
1125
- ) }) }), [He, ye, Nt, jt, Rt, Le, $e, k, R, C, xe]), Tt = F((o) => X[o], [X]), Ct = ne(null);
1126
- vr(() => {
1127
- const o = Ct.current;
1128
- if (Ct.current = { items: X, offsets: we }, !it || !o || o.items === X)
1188
+ ) }) }), [We, xe, Rt, jt, Tt, $e, He, k, j, C, ve]), Ct = F((o) => X[o], [X]), Pt = ne(null);
1189
+ gr(() => {
1190
+ const o = Pt.current;
1191
+ if (Pt.current = { items: X, offsets: ke }, !ct || !o || o.items === X)
1129
1192
  return;
1130
- const x = b.current, _ = x?.getScrollPosition(), W = typeof _ == "number" && _ >= 0 ? _ : Je.current, U = Wr(o.items, o.offsets, W);
1193
+ const x = v.current, _ = x?.getScrollPosition(), W = typeof _ == "number" && _ >= 0 ? _ : Ze.current, U = Gr(o.items, o.offsets, W);
1131
1194
  if (!U)
1132
1195
  return;
1133
- const q = Br(U, X, we);
1134
- if (q === null || Math.abs(q - W) < 1)
1196
+ const Z = Vr(U, X, ke);
1197
+ if (Z === null || Math.abs(Z - W) < 1)
1135
1198
  return;
1136
- const fe = x ? x.scrollTo(q) : q;
1137
- Je.current = fe, ut(fe);
1138
- }, [X, we, it]);
1139
- const be = P?.columns, Ne = P?.scrollBarWidth ?? Ue?.width ?? ir, Z = K(() => be ? Lr({ measuredWidth: V, columns: be, scrollBarWidth: Ne }) : null, [be, V, Ne]), We = K(() => be ? Fr(be) : "", [be]), mr = K(() => P?.showFooter && be ? $r(e) : [], [P?.showFooter, be, e]), je = Z?.maxHScroll ?? 0;
1140
- me(() => {
1141
- ve((o) => rt(o, je));
1199
+ const me = x ? x.scrollTo(Z) : Z;
1200
+ Ze.current = me, ft(me);
1201
+ }, [X, ke, ct]);
1202
+ const be = P?.columns, Re = P?.scrollBarWidth ?? Xe?.width ?? cr, q = K(() => be ? Br({ measuredWidth: V, columns: be, scrollBarWidth: Re }) : null, [be, V, Re]), Be = K(() => be ? Wr(be) : "", [be]), hr = K(() => P?.showFooter && be ? zr(e) : [], [P?.showFooter, be, e]), je = q?.maxHScroll ?? 0;
1203
+ he(() => {
1204
+ ge((o) => nt(o, je));
1142
1205
  }, [je]);
1143
- const Pt = F((o) => ve((x) => rt(x + o, je)), [je]), _t = K(
1144
- () => ({ iconOverrides: L, showExpandIcons: N, showDirectoryIcons: S, showFileIcons: p, useCanvasExpandIcons: R, expandIconSize: C, highlightStyles: ee }),
1145
- [L, N, S, p, R, C, ee]
1146
- ), At = K(
1206
+ const _t = F((o) => ge((x) => nt(x + o, je)), [je]), At = K(
1207
+ () => ({ iconOverrides: L, showExpandIcons: I, showDirectoryIcons: E, showFileIcons: p, useCanvasExpandIcons: j, expandIconSize: C, highlightStyles: ee }),
1208
+ [L, I, E, p, j, C, ee]
1209
+ ), Mt = K(
1147
1210
  () => /* @__PURE__ */ i.jsx(
1148
- kr,
1211
+ Er,
1149
1212
  {
1150
- ref: b,
1213
+ ref: v,
1151
1214
  itemCount: X.length,
1152
- getItem: Tt,
1215
+ getItem: Ct,
1153
1216
  getItemHeight: bt,
1154
- getItemKey: vt,
1155
- testId: ct,
1156
- contentProps: dt,
1157
- viewportSize: ye,
1158
- overscanCount: Ee,
1159
- onScroll: ft,
1160
- onRangeChange: mt,
1161
- className: _e,
1162
- onWheelHorizontal: m ? Pt : void 0,
1217
+ getItemKey: gt,
1218
+ testId: dt,
1219
+ contentProps: ut,
1220
+ viewportSize: xe,
1221
+ overscanCount: Ie,
1222
+ onScroll: mt,
1223
+ onRangeChange: ht,
1224
+ className: Ae,
1225
+ onWheelHorizontal: m ? _t : void 0,
1163
1226
  background: /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
1164
- m && Z ? (
1227
+ m && q ? (
1165
1228
  // Clip the connector-line canvas to the frozen name column so deep trees never bleed into the numeric region.
1166
- /* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width: Z.nameWidth }, "aria-hidden": "true", children: tt })
1167
- ) : tt,
1168
- Ae
1229
+ /* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width: q.nameWidth }, "aria-hidden": "true", children: rt })
1230
+ ) : rt,
1231
+ Me
1169
1232
  ] }),
1170
- initialScrollIndex: Oe,
1171
- initialScrollOffset: pe,
1172
- initialScrollAnchor: Fe,
1173
- onItemFocus: Te,
1174
- callbackThrottleMs: Re,
1233
+ initialScrollIndex: Fe,
1234
+ initialScrollOffset: ye,
1235
+ initialScrollAnchor: Le,
1236
+ onItemFocus: Ce,
1237
+ callbackThrottleMs: Te,
1175
1238
  contentInsets: re,
1176
- scrollBarOptions: Ue,
1177
- behaviorOptions: lt,
1178
- children: (o, x) => o ? m && P && Z ? /* @__PURE__ */ i.jsx(
1179
- ar,
1239
+ scrollBarOptions: Xe,
1240
+ behaviorOptions: it,
1241
+ children: (o, x) => o ? m && P && q ? /* @__PURE__ */ i.jsx(
1242
+ or,
1180
1243
  {
1181
1244
  entry: o.entry,
1182
1245
  indentLevel: o.indentLevel,
@@ -1185,19 +1248,19 @@ const dr = (e) => {
1185
1248
  rowIndex: x + (P.showHeader ?? !0 ? 2 : 1),
1186
1249
  isSelectedForAria: !!h?.has(o.entry.absolutePath),
1187
1250
  rowHeight: o.rowHeight,
1188
- isDirOpen: ue,
1251
+ isDirOpen: fe,
1189
1252
  columns: P.columns,
1190
- numericTemplate: We,
1191
- numericTotal: Z.numericTotal,
1192
- nameWidth: Z.nameWidth,
1253
+ numericTemplate: Be,
1254
+ numericTotal: q.numericTotal,
1255
+ nameWidth: q.nameWidth,
1193
1256
  rowClassName: P.rowClassName,
1194
- selection: { onEntryClick: j, selectedPath: v ?? null, mode: d, selectedItems: h, onSelectionChange: g },
1257
+ selection: { onEntryClick: R, selectedPath: b ?? null, mode: d, selectedItems: h, onSelectionChange: g },
1195
1258
  expansion: { toggleDirectory: t, onToggleDirectoryRecursive: qe },
1196
- visual: _t
1259
+ visual: At
1197
1260
  },
1198
1261
  o.entry.absolutePath
1199
1262
  ) : /* @__PURE__ */ i.jsx(
1200
- ot,
1263
+ lt,
1201
1264
  {
1202
1265
  entry: o.entry,
1203
1266
  indentLevel: o.indentLevel,
@@ -1206,31 +1269,31 @@ const dr = (e) => {
1206
1269
  setSize: o.setSize,
1207
1270
  isSelectedForAria: !!h?.has(o.entry.absolutePath),
1208
1271
  flatIndex: x,
1209
- isActive: x === kt,
1210
- registerRowRef: It,
1211
- onNavigationKeyDown: Et,
1272
+ isActive: x === Et,
1273
+ registerRowRef: Nt,
1274
+ onNavigationKeyDown: It,
1212
1275
  rowHeight: o.rowHeight,
1213
- isDirOpen: ue,
1276
+ isDirOpen: fe,
1214
1277
  parentIsLast: o.parentIsLast,
1215
1278
  renderChildren: !1,
1216
1279
  expansion: { toggleDirectory: t, onToggleDirectoryRecursive: qe },
1217
- selection: { onEntryClick: j, selectedPath: v ?? null, mode: d, selectedItems: h, onSelectionChange: g },
1280
+ selection: { onEntryClick: R, selectedPath: b ?? null, mode: d, selectedItems: h, onSelectionChange: g },
1218
1281
  visual: {
1219
1282
  iconOverrides: L,
1220
- showExpandIcons: N,
1221
- showDirectoryIcons: S,
1283
+ showExpandIcons: I,
1284
+ showDirectoryIcons: E,
1222
1285
  showFileIcons: p,
1223
- useCanvasExpandIcons: R,
1286
+ useCanvasExpandIcons: j,
1224
1287
  expandIconSize: C,
1225
1288
  highlightStyles: ee,
1226
1289
  entryClassName: $,
1227
1290
  entryStyle: J,
1228
1291
  nameClassName: te,
1229
- nameStyle: I,
1292
+ nameStyle: S,
1230
1293
  directoryNameClassName: Y,
1231
1294
  directoryNameStyle: B,
1232
1295
  fileNameClassName: G,
1233
- fileNameStyle: ie
1296
+ fileNameStyle: ce
1234
1297
  }
1235
1298
  },
1236
1299
  o.entry.absolutePath
@@ -1239,103 +1302,103 @@ const dr = (e) => {
1239
1302
  ),
1240
1303
  [
1241
1304
  X.length,
1242
- Tt,
1305
+ Ct,
1243
1306
  bt,
1244
- vt,
1245
- ct,
1307
+ gt,
1246
1308
  dt,
1247
- kt,
1248
- It,
1309
+ ut,
1249
1310
  Et,
1250
- ye,
1251
- Ee,
1252
- ft,
1311
+ Nt,
1312
+ It,
1313
+ xe,
1314
+ Ie,
1253
1315
  mt,
1254
- _e,
1255
- m,
1256
- Pt,
1257
- Z,
1258
- tt,
1316
+ ht,
1259
1317
  Ae,
1260
- Oe,
1261
- pe,
1318
+ m,
1319
+ _t,
1320
+ q,
1321
+ rt,
1322
+ Me,
1262
1323
  Fe,
1324
+ ye,
1325
+ Le,
1326
+ Ce,
1263
1327
  Te,
1264
- Re,
1265
1328
  re,
1266
- Ue,
1267
- lt,
1329
+ Xe,
1330
+ it,
1268
1331
  P,
1269
- We,
1270
- ue,
1271
- j,
1272
- v,
1332
+ Be,
1333
+ fe,
1334
+ R,
1335
+ b,
1273
1336
  d,
1274
1337
  h,
1275
1338
  g,
1276
1339
  t,
1277
1340
  qe,
1278
- _t,
1341
+ At,
1279
1342
  L,
1280
- N,
1281
- S,
1343
+ I,
1344
+ E,
1282
1345
  p,
1283
- R,
1346
+ j,
1284
1347
  C,
1285
1348
  ee,
1286
1349
  $,
1287
1350
  J,
1288
1351
  te,
1289
- I,
1352
+ S,
1290
1353
  Y,
1291
1354
  B,
1292
1355
  G,
1293
- ie
1356
+ ce
1294
1357
  ]
1295
1358
  );
1296
- if (!(P && Z))
1297
- return /* @__PURE__ */ i.jsx("div", { ref: se, className: ht, style: pt, role: "tree", "aria-label": y ? void 0 : f, "aria-labelledby": y, "aria-multiselectable": d === "multiple" ? !0 : void 0, children: At });
1298
- const hr = P.showHeader ?? !0, pr = P.showFooter ?? !1, yr = { ...pt, "--dt-hscroll": `${he}px` };
1359
+ if (!(P && q))
1360
+ return /* @__PURE__ */ i.jsx("div", { ref: se, className: pt, style: yt, role: "tree", "aria-label": y ? void 0 : f, "aria-labelledby": y, "aria-multiselectable": d === "multiple" ? !0 : void 0, children: Mt });
1361
+ const pr = P.showHeader ?? !0, yr = P.showFooter ?? !1, xr = { ...yt, "--dt-hscroll": `${pe}px` };
1299
1362
  return /* @__PURE__ */ i.jsxs(
1300
1363
  "div",
1301
1364
  {
1302
1365
  ref: se,
1303
- className: A(ht, "dt-grid"),
1304
- style: yr,
1366
+ className: A(pt, "dt-grid"),
1367
+ style: xr,
1305
1368
  role: "treegrid",
1306
1369
  "aria-label": y ? void 0 : f,
1307
1370
  "aria-labelledby": y,
1308
1371
  "aria-multiselectable": d === "multiple" ? !0 : void 0,
1309
1372
  "aria-rowcount": X.length + (P.showHeader ?? !0 ? 1 : 0),
1310
1373
  children: [
1311
- hr && // biome-ignore lint/a11y/useSemanticElements: 仮想スクロールの treegrid は絶対配置行を使うため native table 要素にできない。ARIA ロールで意味を提供する
1312
- /* @__PURE__ */ i.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ i.jsx(Mr, { columns: P.columns, numericTemplate: We, numericTotal: Z.numericTotal, nameWidth: Z.nameWidth, scrollBarWidth: Ne, className: P.headerClassName }) }),
1313
- /* @__PURE__ */ i.jsx("div", { ref: oe, className: "dt-grid-body", children: At }),
1374
+ pr && // biome-ignore lint/a11y/useSemanticElements: 仮想スクロールの treegrid は絶対配置行を使うため native table 要素にできない。ARIA ロールで意味を提供する
1375
+ /* @__PURE__ */ i.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ i.jsx(Lr, { columns: P.columns, numericTemplate: Be, numericTotal: q.numericTotal, nameWidth: q.nameWidth, scrollBarWidth: Re, className: P.headerClassName }) }),
1376
+ /* @__PURE__ */ i.jsx("div", { ref: le, className: "dt-grid-body", children: Mt }),
1314
1377
  je > 0 && /* @__PURE__ */ i.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
1315
- /* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: Z.nameWidth }, "aria-hidden": "true" }),
1378
+ /* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: q.nameWidth }, "aria-hidden": "true" }),
1316
1379
  /* @__PURE__ */ i.jsx(
1317
1380
  Sr,
1318
1381
  {
1319
1382
  horizontal: !0,
1320
- contentSize: Z.numericTotal,
1321
- viewportSize: Z.numericVisible,
1322
- scrollPosition: he,
1323
- scrollBarWidth: Ne,
1383
+ contentSize: q.numericTotal,
1384
+ viewportSize: q.numericVisible,
1385
+ scrollPosition: pe,
1386
+ scrollBarWidth: Re,
1324
1387
  onScroll: (o) => {
1325
- const x = typeof o == "function" ? o(he) : o, _ = rt(x, je);
1326
- return ve(_), _;
1388
+ const x = typeof o == "function" ? o(pe) : o, _ = nt(x, je);
1389
+ return ge(_), _;
1327
1390
  }
1328
1391
  }
1329
1392
  ),
1330
- /* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: Ne }, "aria-hidden": "true" })
1393
+ /* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: Re }, "aria-hidden": "true" })
1331
1394
  ] }),
1332
- pr && // biome-ignore lint/a11y/useSemanticElements: 同上 (フッタ行も絶対配置レイアウトの一部)
1333
- /* @__PURE__ */ i.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ i.jsx(Dr, { columns: P.columns, numericTemplate: We, numericTotal: Z.numericTotal, nameWidth: Z.nameWidth, scrollBarWidth: Ne, allEntries: mr, className: P.footerClassName }) })
1395
+ yr && // biome-ignore lint/a11y/useSemanticElements: 同上 (フッタ行も絶対配置レイアウトの一部)
1396
+ /* @__PURE__ */ i.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ i.jsx($r, { columns: P.columns, numericTemplate: Be, numericTotal: q.numericTotal, nameWidth: q.nameWidth, scrollBarWidth: Re, allEntries: hr, className: P.footerClassName }) })
1334
1397
  ]
1335
1398
  }
1336
1399
  );
1337
- }, on = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
1338
- const [a, n] = wr(), [r, l] = le(() => {
1400
+ }, dn = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
1401
+ const [s, n] = kr(), [r, l] = ie(() => {
1339
1402
  if (typeof window < "u" && t)
1340
1403
  try {
1341
1404
  const f = window.localStorage.getItem(t);
@@ -1357,13 +1420,13 @@ const dr = (e) => {
1357
1420
  }, []), u = F(
1358
1421
  (f, y) => {
1359
1422
  c((k) => {
1360
- for (const R of f)
1361
- y(k, R);
1423
+ for (const j of f)
1424
+ y(k, j);
1362
1425
  });
1363
1426
  },
1364
1427
  [c]
1365
1428
  );
1366
- me(() => {
1429
+ he(() => {
1367
1430
  if (t && typeof window < "u")
1368
1431
  try {
1369
1432
  window.localStorage.setItem(t, JSON.stringify(Array.from(r)));
@@ -1371,14 +1434,14 @@ const dr = (e) => {
1371
1434
  console.warn(`Error setting localStorage key "${t}":`, f);
1372
1435
  }
1373
1436
  }, [r, t]);
1374
- const j = F(
1437
+ const R = F(
1375
1438
  (f) => {
1376
1439
  u([f], (y, k) => {
1377
1440
  y.has(k) ? y.delete(k) : y.add(k);
1378
1441
  });
1379
1442
  },
1380
1443
  [u]
1381
- ), v = F(
1444
+ ), b = F(
1382
1445
  (f) => {
1383
1446
  u([f], (y, k) => {
1384
1447
  y.add(k);
@@ -1410,21 +1473,21 @@ const dr = (e) => {
1410
1473
  c((f) => {
1411
1474
  f.clear();
1412
1475
  });
1413
- }, [c]), E = F((f) => r.has(f), [r]);
1476
+ }, [c]), N = F((f) => r.has(f), [r]);
1414
1477
  return {
1415
1478
  expanded: r,
1416
- toggle: j,
1417
- expand: v,
1479
+ toggle: R,
1480
+ expand: b,
1418
1481
  collapse: d,
1419
1482
  collapseMultiple: h,
1420
1483
  expandMultiple: g,
1421
1484
  collapseAll: w,
1422
- isExpanded: E,
1423
- isPending: a
1485
+ isExpanded: N,
1486
+ isPending: s
1424
1487
  };
1425
1488
  };
1426
1489
  export {
1427
- an as DirectoryTree,
1490
+ cn as DirectoryTree,
1428
1491
  D as directoryTreeClasses,
1429
- on as useDirectoryTreeState
1492
+ dn as useDirectoryTreeState
1430
1493
  };