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