@aiquants/directory-tree 3.11.2 → 3.12.0

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