@wp-playground/components 3.0.22 → 3.0.33
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/BinaryFilePreview/index.d.ts +9 -0
- package/FilePickerControl/index.d.ts +1 -1
- package/FilePickerTree/index.d.ts +2 -14
- package/PlaygroundFileEditor/code-editor.d.ts +18 -0
- package/PlaygroundFileEditor/file-explorer-sidebar.d.ts +13 -0
- package/PlaygroundFileEditor/file-utils.d.ts +23 -0
- package/PlaygroundFileEditor/index.d.ts +4 -0
- package/PlaygroundFileEditor/playground-file-editor.d.ts +21 -0
- package/e2e-harnesses/file-picker-tree-harness.d.ts +1 -1
- package/index.cjs +10 -10
- package/index.cjs.map +1 -1
- package/index.d.ts +2 -0
- package/index.js +1760 -1028
- package/index.js.map +1 -1
- package/package.json +20 -2
- package/style.css +1 -1
package/index.js
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { forwardRef as
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import o, { forwardRef as Bt, useMemo as Nt, useState as Q, useRef as M, useEffect as I, useImperativeHandle as Wt, useLayoutEffect as Gt, useCallback as ft } from "react";
|
|
2
|
+
import { dirname as Oe, joinPaths as We, basename as Ot, normalizePath as At } from "@php-wasm/util";
|
|
3
|
+
import { __experimentalTreeGrid as Kt, Popover as qt, NavigableMenu as Jt, MenuItem as qe, __experimentalTreeGridRow as Xt, __experimentalTreeGridCell as Qt, Button as mt, Modal as er, Icon as Ft, Notice as tr } from "@wordpress/components";
|
|
4
|
+
import et from "classnames";
|
|
5
|
+
import { forwardRef as Ht, cloneElement as rr, createElement as nr } from "@wordpress/element";
|
|
6
|
+
import ar from "clsx";
|
|
7
|
+
import { Compartment as Tt, EditorSelection as pt, EditorState as or } from "@codemirror/state";
|
|
8
|
+
import { ViewPlugin as ir, lineNumbers as sr, highlightActiveLineGutter as lr, highlightActiveLine as cr, dropCursor as ur, rectangularSelection as fr, crosshairCursor as dr, EditorView as Qe, keymap as mr } from "@codemirror/view";
|
|
9
|
+
import { history as pr, historyKeymap as hr, defaultKeymap as wr, indentWithTab as vr } from "@codemirror/commands";
|
|
10
|
+
import { highlightSelectionMatches as gr, searchKeymap as Er } from "@codemirror/search";
|
|
11
|
+
import { closeBrackets as yr, autocompletion as _r, closeBracketsKeymap as br, completionKeymap as Cr } from "@codemirror/autocomplete";
|
|
12
|
+
import { foldGutter as xr, syntaxHighlighting as Rr, indentOnInput as Tr, bracketMatching as Pr, defaultHighlightStyle as kr, foldKeymap as Sr } from "@codemirror/language";
|
|
13
|
+
import { php as tt } from "@codemirror/lang-php";
|
|
14
|
+
import { FilePickerTree as Nr, BinaryFilePreview as Dr } from "@wp-playground/components";
|
|
15
|
+
import { logger as dt } from "@php-wasm/logger";
|
|
16
|
+
import Lt from "@php-wasm/universal/mime-types";
|
|
17
|
+
const fa = (n) => /* @__PURE__ */ o.createElement(
|
|
8
18
|
"svg",
|
|
9
19
|
{
|
|
10
20
|
width: "32",
|
|
@@ -12,9 +22,9 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
12
22
|
viewBox: "0 0 32 32",
|
|
13
23
|
fill: "none",
|
|
14
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15
|
-
...
|
|
25
|
+
...n
|
|
16
26
|
},
|
|
17
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ o.createElement(
|
|
18
28
|
"rect",
|
|
19
29
|
{
|
|
20
30
|
width: "10.4176",
|
|
@@ -25,7 +35,7 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
25
35
|
strokeWidth: "0.965644"
|
|
26
36
|
}
|
|
27
37
|
),
|
|
28
|
-
/* @__PURE__ */
|
|
38
|
+
/* @__PURE__ */ o.createElement(
|
|
29
39
|
"rect",
|
|
30
40
|
{
|
|
31
41
|
width: "13.2346",
|
|
@@ -36,7 +46,7 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
36
46
|
strokeWidth: "1.44847"
|
|
37
47
|
}
|
|
38
48
|
),
|
|
39
|
-
/* @__PURE__ */
|
|
49
|
+
/* @__PURE__ */ o.createElement(
|
|
40
50
|
"rect",
|
|
41
51
|
{
|
|
42
52
|
width: "17.451",
|
|
@@ -47,7 +57,7 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
47
57
|
strokeWidth: "1.93129"
|
|
48
58
|
}
|
|
49
59
|
)
|
|
50
|
-
),
|
|
60
|
+
), da = (n) => /* @__PURE__ */ o.createElement(
|
|
51
61
|
"svg",
|
|
52
62
|
{
|
|
53
63
|
width: "16",
|
|
@@ -55,9 +65,9 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
55
65
|
viewBox: "0 0 16 17",
|
|
56
66
|
fill: "none",
|
|
57
67
|
xmlns: "http://www.w3.org/2000/svg",
|
|
58
|
-
...
|
|
68
|
+
...n
|
|
59
69
|
},
|
|
60
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ o.createElement(
|
|
61
71
|
"path",
|
|
62
72
|
{
|
|
63
73
|
fillRule: "evenodd",
|
|
@@ -66,7 +76,7 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
66
76
|
fill: "#949494"
|
|
67
77
|
}
|
|
68
78
|
)
|
|
69
|
-
),
|
|
79
|
+
), ma = (n) => /* @__PURE__ */ o.createElement(
|
|
70
80
|
"svg",
|
|
71
81
|
{
|
|
72
82
|
width: "20",
|
|
@@ -74,16 +84,16 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
74
84
|
viewBox: "0 0 20 21",
|
|
75
85
|
fill: "none",
|
|
76
86
|
xmlns: "http://www.w3.org/2000/svg",
|
|
77
|
-
...
|
|
87
|
+
...n
|
|
78
88
|
},
|
|
79
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ o.createElement(
|
|
80
90
|
"path",
|
|
81
91
|
{
|
|
82
92
|
d: "M20 10.5C20 4.99 15.51 0.5 10 0.5C4.48 0.5 0 4.99 0 10.5C0 16.02 4.48 20.5 10 20.5C15.51 20.5 20 16.02 20 10.5ZM7.78 15.87L4.37 6.72C4.92 6.7 5.54 6.64 5.54 6.64C6.04 6.58 5.98 5.51 5.48 5.53C5.48 5.53 4.03 5.64 3.11 5.64C2.93 5.64 2.74 5.64 2.53 5.63C4.12 3.19 6.87 1.61 10 1.61C12.33 1.61 14.45 2.48 16.05 3.95C15.37 3.84 14.4 4.34 14.4 5.53C14.4 6.27 14.85 6.89 15.3 7.63C15.65 8.24 15.85 8.99 15.85 10.09C15.85 11.58 14.45 15.09 14.45 15.09L11.42 6.72C11.96 6.7 12.24 6.55 12.24 6.55C12.74 6.5 12.68 5.3 12.18 5.33C12.18 5.33 10.74 5.45 9.8 5.45C8.93 5.45 7.47 5.33 7.47 5.33C6.97 5.3 6.91 6.53 7.41 6.55L8.33 6.63L9.59 10.04L7.78 15.87ZM17.41 10.5C17.65 9.86 18.15 8.63 17.84 6.25C18.54 7.54 18.89 8.96 18.89 10.5C18.89 13.79 17.16 16.74 14.49 18.28C15.46 15.69 16.43 13.08 17.41 10.5ZM6.1 18.59C3.12 17.15 1.11 14.03 1.11 10.5C1.11 9.2 1.34 8.02 1.83 6.91C3.25 10.8 4.67 14.7 6.1 18.59ZM10.13 11.96L12.71 18.94C11.85 19.23 10.95 19.39 10 19.39C9.21 19.39 8.43 19.28 7.71 19.06C8.52 16.68 9.33 14.32 10.13 11.96Z",
|
|
83
93
|
fill: "#ffffff"
|
|
84
94
|
}
|
|
85
95
|
)
|
|
86
|
-
),
|
|
96
|
+
), Or = /* @__PURE__ */ o.createElement(
|
|
87
97
|
"svg",
|
|
88
98
|
{
|
|
89
99
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -92,7 +102,7 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
92
102
|
viewBox: "0 0 15 14",
|
|
93
103
|
fill: "none"
|
|
94
104
|
},
|
|
95
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ o.createElement(
|
|
96
106
|
"path",
|
|
97
107
|
{
|
|
98
108
|
fillRule: "evenodd",
|
|
@@ -100,7 +110,7 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
100
110
|
d: "M7.59196 3.59524L6.77745 1.96623C6.70755 1.82641 6.56464 1.7381 6.40832 1.7381H1.65079C1.42287 1.7381 1.2381 1.92287 1.2381 2.15079V11.8492C1.2381 12.0771 1.42287 12.2619 1.65079 12.2619H13.2063C13.4343 12.2619 13.619 12.0771 13.619 11.8492V4.00794C13.619 3.78001 13.4343 3.59524 13.2063 3.59524H7.59196ZM8.35714 2.35714L7.88484 1.41254C7.60521 0.853274 7.0336 0.5 6.40832 0.5H1.65079C0.739085 0.5 0 1.23909 0 2.15079V11.8492C0 12.7609 0.739085 13.5 1.65079 13.5H13.2063C14.1181 13.5 14.8571 12.7609 14.8571 11.8492V4.00794C14.8571 3.09623 14.1181 2.35714 13.2063 2.35714H8.35714Z"
|
|
101
111
|
}
|
|
102
112
|
)
|
|
103
|
-
),
|
|
113
|
+
), Ar = /* @__PURE__ */ o.createElement(
|
|
104
114
|
"svg",
|
|
105
115
|
{
|
|
106
116
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -110,8 +120,8 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
110
120
|
className: "bi bi-file-earmark",
|
|
111
121
|
viewBox: "0 0 16 16"
|
|
112
122
|
},
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
),
|
|
123
|
+
/* @__PURE__ */ o.createElement("path", { d: "M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5z" })
|
|
124
|
+
), pa = (n) => /* @__PURE__ */ o.createElement(
|
|
115
125
|
"svg",
|
|
116
126
|
{
|
|
117
127
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -119,9 +129,9 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
119
129
|
height: "18",
|
|
120
130
|
viewBox: "0 0 14 14",
|
|
121
131
|
fill: "none",
|
|
122
|
-
...
|
|
132
|
+
...n
|
|
123
133
|
},
|
|
124
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ o.createElement(
|
|
125
135
|
"path",
|
|
126
136
|
{
|
|
127
137
|
fillRule: "evenodd",
|
|
@@ -130,7 +140,7 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
130
140
|
fill: "#949494"
|
|
131
141
|
}
|
|
132
142
|
)
|
|
133
|
-
),
|
|
143
|
+
), ha = /* @__PURE__ */ o.createElement(
|
|
134
144
|
"svg",
|
|
135
145
|
{
|
|
136
146
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -139,7 +149,7 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
139
149
|
viewBox: "0 0 14 14",
|
|
140
150
|
fill: "none"
|
|
141
151
|
},
|
|
142
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ o.createElement(
|
|
143
153
|
"path",
|
|
144
154
|
{
|
|
145
155
|
fillRule: "evenodd",
|
|
@@ -149,18 +159,18 @@ const wr = (s) => /* @__PURE__ */ f.createElement(
|
|
|
149
159
|
}
|
|
150
160
|
)
|
|
151
161
|
);
|
|
152
|
-
function
|
|
153
|
-
return `data:${
|
|
162
|
+
function wa(n) {
|
|
163
|
+
return `data:${n.mime};base64,${n.data}`;
|
|
154
164
|
}
|
|
155
|
-
function
|
|
156
|
-
size:
|
|
157
|
-
sidebarActive:
|
|
165
|
+
function va({
|
|
166
|
+
size: n = 24,
|
|
167
|
+
sidebarActive: u = !1
|
|
158
168
|
}) {
|
|
159
|
-
return /* @__PURE__ */
|
|
169
|
+
return /* @__PURE__ */ o.createElement(
|
|
160
170
|
"svg",
|
|
161
171
|
{
|
|
162
|
-
width:
|
|
163
|
-
height:
|
|
172
|
+
width: n,
|
|
173
|
+
height: n,
|
|
164
174
|
viewBox: "0 0 24 24",
|
|
165
175
|
xmlns: "http://www.w3.org/2000/svg",
|
|
166
176
|
fill: "none",
|
|
@@ -169,8 +179,8 @@ function br({
|
|
|
169
179
|
strokeLinecap: "round",
|
|
170
180
|
strokeLinejoin: "round"
|
|
171
181
|
},
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
|
|
182
|
+
/* @__PURE__ */ o.createElement("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }),
|
|
183
|
+
u ? /* @__PURE__ */ o.createElement(
|
|
174
184
|
"rect",
|
|
175
185
|
{
|
|
176
186
|
x: "3",
|
|
@@ -181,7 +191,7 @@ function br({
|
|
|
181
191
|
ry: "2",
|
|
182
192
|
fill: "currentColor"
|
|
183
193
|
}
|
|
184
|
-
) : /* @__PURE__ */
|
|
194
|
+
) : /* @__PURE__ */ o.createElement(
|
|
185
195
|
"rect",
|
|
186
196
|
{
|
|
187
197
|
x: "3",
|
|
@@ -197,17 +207,17 @@ function br({
|
|
|
197
207
|
)
|
|
198
208
|
);
|
|
199
209
|
}
|
|
200
|
-
const
|
|
201
|
-
icon:
|
|
202
|
-
size:
|
|
203
|
-
...
|
|
204
|
-
},
|
|
205
|
-
width:
|
|
206
|
-
height:
|
|
207
|
-
...
|
|
208
|
-
ref:
|
|
210
|
+
const jt = Ht(({
|
|
211
|
+
icon: n,
|
|
212
|
+
size: u = 24,
|
|
213
|
+
...l
|
|
214
|
+
}, m) => rr(n, {
|
|
215
|
+
width: u,
|
|
216
|
+
height: u,
|
|
217
|
+
...l,
|
|
218
|
+
ref: m
|
|
209
219
|
}));
|
|
210
|
-
var
|
|
220
|
+
var Dt = { exports: {} }, Je = {};
|
|
211
221
|
/**
|
|
212
222
|
* @license React
|
|
213
223
|
* react-jsx-runtime.production.min.js
|
|
@@ -217,21 +227,21 @@ var ht = { exports: {} }, Ye = {};
|
|
|
217
227
|
* This source code is licensed under the MIT license found in the
|
|
218
228
|
* LICENSE file in the root directory of this source tree.
|
|
219
229
|
*/
|
|
220
|
-
var
|
|
221
|
-
function
|
|
222
|
-
if (
|
|
223
|
-
|
|
224
|
-
var
|
|
225
|
-
function
|
|
226
|
-
var
|
|
227
|
-
|
|
228
|
-
for (
|
|
229
|
-
if (
|
|
230
|
-
return { $$typeof:
|
|
230
|
+
var It;
|
|
231
|
+
function Fr() {
|
|
232
|
+
if (It) return Je;
|
|
233
|
+
It = 1;
|
|
234
|
+
var n = o, u = Symbol.for("react.element"), l = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, E = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, g = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
235
|
+
function k(V, T, y) {
|
|
236
|
+
var v, N = {}, P = null, j = null;
|
|
237
|
+
y !== void 0 && (P = "" + y), T.key !== void 0 && (P = "" + T.key), T.ref !== void 0 && (j = T.ref);
|
|
238
|
+
for (v in T) m.call(T, v) && !g.hasOwnProperty(v) && (N[v] = T[v]);
|
|
239
|
+
if (V && V.defaultProps) for (v in T = V.defaultProps, T) N[v] === void 0 && (N[v] = T[v]);
|
|
240
|
+
return { $$typeof: u, type: V, key: P, ref: j, props: N, _owner: E.current };
|
|
231
241
|
}
|
|
232
|
-
return
|
|
242
|
+
return Je.Fragment = l, Je.jsx = k, Je.jsxs = k, Je;
|
|
233
243
|
}
|
|
234
|
-
var
|
|
244
|
+
var Xe = {};
|
|
235
245
|
/**
|
|
236
246
|
* @license React
|
|
237
247
|
* react-jsx-runtime.development.js
|
|
@@ -241,91 +251,91 @@ var ze = {};
|
|
|
241
251
|
* This source code is licensed under the MIT license found in the
|
|
242
252
|
* LICENSE file in the root directory of this source tree.
|
|
243
253
|
*/
|
|
244
|
-
var
|
|
245
|
-
function
|
|
246
|
-
return
|
|
247
|
-
var
|
|
248
|
-
function
|
|
254
|
+
var Mt;
|
|
255
|
+
function Lr() {
|
|
256
|
+
return Mt || (Mt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
257
|
+
var n = o, u = Symbol.for("react.element"), l = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), E = Symbol.for("react.strict_mode"), g = Symbol.for("react.profiler"), k = Symbol.for("react.provider"), V = Symbol.for("react.context"), T = Symbol.for("react.forward_ref"), y = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), j = Symbol.for("react.offscreen"), Z = Symbol.iterator, A = "@@iterator";
|
|
258
|
+
function D(e) {
|
|
249
259
|
if (e === null || typeof e != "object")
|
|
250
260
|
return null;
|
|
251
|
-
var
|
|
252
|
-
return typeof
|
|
261
|
+
var c = Z && e[Z] || e[A];
|
|
262
|
+
return typeof c == "function" ? c : null;
|
|
253
263
|
}
|
|
254
|
-
var
|
|
255
|
-
function
|
|
264
|
+
var p = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
265
|
+
function b(e) {
|
|
256
266
|
{
|
|
257
|
-
for (var
|
|
258
|
-
|
|
259
|
-
|
|
267
|
+
for (var c = arguments.length, f = new Array(c > 1 ? c - 1 : 0), R = 1; R < c; R++)
|
|
268
|
+
f[R - 1] = arguments[R];
|
|
269
|
+
q("error", e, f);
|
|
260
270
|
}
|
|
261
271
|
}
|
|
262
|
-
function
|
|
272
|
+
function q(e, c, f) {
|
|
263
273
|
{
|
|
264
|
-
var
|
|
265
|
-
|
|
266
|
-
var
|
|
267
|
-
return String(
|
|
274
|
+
var R = p.ReactDebugCurrentFrame, $ = R.getStackAddendum();
|
|
275
|
+
$ !== "" && (c += "%s", f = f.concat([$]));
|
|
276
|
+
var Y = f.map(function(L) {
|
|
277
|
+
return String(L);
|
|
268
278
|
});
|
|
269
|
-
|
|
279
|
+
Y.unshift("Warning: " + c), Function.prototype.apply.call(console[e], console, Y);
|
|
270
280
|
}
|
|
271
281
|
}
|
|
272
|
-
var
|
|
273
|
-
|
|
274
|
-
function
|
|
275
|
-
return !!(typeof e == "string" || typeof e == "function" || e ===
|
|
282
|
+
var B = !1, G = !1, ee = !1, W = !1, F = !1, te;
|
|
283
|
+
te = Symbol.for("react.module.reference");
|
|
284
|
+
function _(e) {
|
|
285
|
+
return !!(typeof e == "string" || typeof e == "function" || e === m || e === g || F || e === E || e === y || e === v || W || e === j || B || G || ee || typeof e == "object" && e !== null && (e.$$typeof === P || e.$$typeof === N || e.$$typeof === k || e.$$typeof === V || e.$$typeof === T || // This needs to include all possible module reference object
|
|
276
286
|
// types supported by any Flight configuration anywhere since
|
|
277
287
|
// we don't know which Flight build this will end up being used
|
|
278
288
|
// with.
|
|
279
|
-
e.$$typeof ===
|
|
289
|
+
e.$$typeof === te || e.getModuleId !== void 0));
|
|
280
290
|
}
|
|
281
|
-
function H(e,
|
|
282
|
-
var
|
|
283
|
-
if (
|
|
284
|
-
return
|
|
285
|
-
var
|
|
286
|
-
return
|
|
291
|
+
function H(e, c, f) {
|
|
292
|
+
var R = e.displayName;
|
|
293
|
+
if (R)
|
|
294
|
+
return R;
|
|
295
|
+
var $ = c.displayName || c.name || "";
|
|
296
|
+
return $ !== "" ? f + "(" + $ + ")" : f;
|
|
287
297
|
}
|
|
288
|
-
function
|
|
298
|
+
function de(e) {
|
|
289
299
|
return e.displayName || "Context";
|
|
290
300
|
}
|
|
291
|
-
function
|
|
301
|
+
function ae(e) {
|
|
292
302
|
if (e == null)
|
|
293
303
|
return null;
|
|
294
|
-
if (typeof e.tag == "number" &&
|
|
304
|
+
if (typeof e.tag == "number" && b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
295
305
|
return e.displayName || e.name || null;
|
|
296
306
|
if (typeof e == "string")
|
|
297
307
|
return e;
|
|
298
308
|
switch (e) {
|
|
299
|
-
case
|
|
309
|
+
case m:
|
|
300
310
|
return "Fragment";
|
|
301
|
-
case
|
|
311
|
+
case l:
|
|
302
312
|
return "Portal";
|
|
303
|
-
case
|
|
313
|
+
case g:
|
|
304
314
|
return "Profiler";
|
|
305
|
-
case
|
|
315
|
+
case E:
|
|
306
316
|
return "StrictMode";
|
|
307
|
-
case
|
|
317
|
+
case y:
|
|
308
318
|
return "Suspense";
|
|
309
|
-
case
|
|
319
|
+
case v:
|
|
310
320
|
return "SuspenseList";
|
|
311
321
|
}
|
|
312
322
|
if (typeof e == "object")
|
|
313
323
|
switch (e.$$typeof) {
|
|
314
|
-
case
|
|
315
|
-
var o = e;
|
|
316
|
-
return oe(o) + ".Consumer";
|
|
317
|
-
case M:
|
|
324
|
+
case V:
|
|
318
325
|
var c = e;
|
|
319
|
-
return
|
|
320
|
-
case
|
|
326
|
+
return de(c) + ".Consumer";
|
|
327
|
+
case k:
|
|
328
|
+
var f = e;
|
|
329
|
+
return de(f._context) + ".Provider";
|
|
330
|
+
case T:
|
|
321
331
|
return H(e, e.render, "ForwardRef");
|
|
322
|
-
case
|
|
323
|
-
var
|
|
324
|
-
return
|
|
325
|
-
case
|
|
326
|
-
var
|
|
332
|
+
case N:
|
|
333
|
+
var R = e.displayName || null;
|
|
334
|
+
return R !== null ? R : ae(e.type) || "Memo";
|
|
335
|
+
case P: {
|
|
336
|
+
var $ = e, Y = $._payload, L = $._init;
|
|
327
337
|
try {
|
|
328
|
-
return
|
|
338
|
+
return ae(L(Y));
|
|
329
339
|
} catch {
|
|
330
340
|
return null;
|
|
331
341
|
}
|
|
@@ -333,18 +343,18 @@ function Yt() {
|
|
|
333
343
|
}
|
|
334
344
|
return null;
|
|
335
345
|
}
|
|
336
|
-
var
|
|
337
|
-
function
|
|
346
|
+
var re = Object.assign, ue = 0, oe, be, Re, Te, Pe, le, S;
|
|
347
|
+
function C() {
|
|
338
348
|
}
|
|
339
|
-
|
|
340
|
-
function
|
|
349
|
+
C.__reactDisabledLog = !0;
|
|
350
|
+
function J() {
|
|
341
351
|
{
|
|
342
|
-
if (
|
|
343
|
-
|
|
352
|
+
if (ue === 0) {
|
|
353
|
+
oe = console.log, be = console.info, Re = console.warn, Te = console.error, Pe = console.group, le = console.groupCollapsed, S = console.groupEnd;
|
|
344
354
|
var e = {
|
|
345
355
|
configurable: !0,
|
|
346
356
|
enumerable: !0,
|
|
347
|
-
value:
|
|
357
|
+
value: C,
|
|
348
358
|
writable: !0
|
|
349
359
|
};
|
|
350
360
|
Object.defineProperties(console, {
|
|
@@ -357,332 +367,332 @@ function Yt() {
|
|
|
357
367
|
groupEnd: e
|
|
358
368
|
});
|
|
359
369
|
}
|
|
360
|
-
|
|
370
|
+
ue++;
|
|
361
371
|
}
|
|
362
372
|
}
|
|
363
|
-
function
|
|
373
|
+
function z() {
|
|
364
374
|
{
|
|
365
|
-
if (
|
|
375
|
+
if (ue--, ue === 0) {
|
|
366
376
|
var e = {
|
|
367
377
|
configurable: !0,
|
|
368
378
|
enumerable: !0,
|
|
369
379
|
writable: !0
|
|
370
380
|
};
|
|
371
381
|
Object.defineProperties(console, {
|
|
372
|
-
log:
|
|
373
|
-
value:
|
|
382
|
+
log: re({}, e, {
|
|
383
|
+
value: oe
|
|
374
384
|
}),
|
|
375
|
-
info:
|
|
376
|
-
value:
|
|
385
|
+
info: re({}, e, {
|
|
386
|
+
value: be
|
|
377
387
|
}),
|
|
378
|
-
warn:
|
|
379
|
-
value:
|
|
388
|
+
warn: re({}, e, {
|
|
389
|
+
value: Re
|
|
380
390
|
}),
|
|
381
|
-
error:
|
|
382
|
-
value:
|
|
391
|
+
error: re({}, e, {
|
|
392
|
+
value: Te
|
|
383
393
|
}),
|
|
384
|
-
group:
|
|
385
|
-
value:
|
|
394
|
+
group: re({}, e, {
|
|
395
|
+
value: Pe
|
|
386
396
|
}),
|
|
387
|
-
groupCollapsed:
|
|
388
|
-
value:
|
|
397
|
+
groupCollapsed: re({}, e, {
|
|
398
|
+
value: le
|
|
389
399
|
}),
|
|
390
|
-
groupEnd:
|
|
391
|
-
value:
|
|
400
|
+
groupEnd: re({}, e, {
|
|
401
|
+
value: S
|
|
392
402
|
})
|
|
393
403
|
});
|
|
394
404
|
}
|
|
395
|
-
|
|
405
|
+
ue < 0 && b("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
396
406
|
}
|
|
397
407
|
}
|
|
398
|
-
var
|
|
399
|
-
function
|
|
408
|
+
var ie = p.ReactCurrentDispatcher, Ee;
|
|
409
|
+
function ve(e, c, f) {
|
|
400
410
|
{
|
|
401
|
-
if (
|
|
411
|
+
if (Ee === void 0)
|
|
402
412
|
try {
|
|
403
413
|
throw Error();
|
|
404
|
-
} catch (
|
|
405
|
-
var
|
|
406
|
-
|
|
414
|
+
} catch ($) {
|
|
415
|
+
var R = $.stack.trim().match(/\n( *(at )?)/);
|
|
416
|
+
Ee = R && R[1] || "";
|
|
407
417
|
}
|
|
408
418
|
return `
|
|
409
|
-
` +
|
|
419
|
+
` + Ee + e;
|
|
410
420
|
}
|
|
411
421
|
}
|
|
412
|
-
var
|
|
422
|
+
var ce = !1, U;
|
|
413
423
|
{
|
|
414
|
-
var
|
|
415
|
-
|
|
424
|
+
var h = typeof WeakMap == "function" ? WeakMap : Map;
|
|
425
|
+
U = new h();
|
|
416
426
|
}
|
|
417
|
-
function
|
|
418
|
-
if (!e ||
|
|
427
|
+
function ge(e, c) {
|
|
428
|
+
if (!e || ce)
|
|
419
429
|
return "";
|
|
420
430
|
{
|
|
421
|
-
var
|
|
422
|
-
if (
|
|
423
|
-
return
|
|
431
|
+
var f = U.get(e);
|
|
432
|
+
if (f !== void 0)
|
|
433
|
+
return f;
|
|
424
434
|
}
|
|
425
|
-
var
|
|
426
|
-
|
|
427
|
-
var
|
|
435
|
+
var R;
|
|
436
|
+
ce = !0;
|
|
437
|
+
var $ = Error.prepareStackTrace;
|
|
428
438
|
Error.prepareStackTrace = void 0;
|
|
429
|
-
var
|
|
430
|
-
|
|
439
|
+
var Y;
|
|
440
|
+
Y = ie.current, ie.current = null, J();
|
|
431
441
|
try {
|
|
432
|
-
if (
|
|
433
|
-
var
|
|
442
|
+
if (c) {
|
|
443
|
+
var L = function() {
|
|
434
444
|
throw Error();
|
|
435
445
|
};
|
|
436
|
-
if (Object.defineProperty(
|
|
446
|
+
if (Object.defineProperty(L.prototype, "props", {
|
|
437
447
|
set: function() {
|
|
438
448
|
throw Error();
|
|
439
449
|
}
|
|
440
450
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
441
451
|
try {
|
|
442
|
-
Reflect.construct(
|
|
443
|
-
} catch (
|
|
444
|
-
|
|
452
|
+
Reflect.construct(L, []);
|
|
453
|
+
} catch (he) {
|
|
454
|
+
R = he;
|
|
445
455
|
}
|
|
446
|
-
Reflect.construct(e, [],
|
|
456
|
+
Reflect.construct(e, [], L);
|
|
447
457
|
} else {
|
|
448
458
|
try {
|
|
449
|
-
|
|
450
|
-
} catch (
|
|
451
|
-
|
|
459
|
+
L.call();
|
|
460
|
+
} catch (he) {
|
|
461
|
+
R = he;
|
|
452
462
|
}
|
|
453
|
-
e.call(
|
|
463
|
+
e.call(L.prototype);
|
|
454
464
|
}
|
|
455
465
|
} else {
|
|
456
466
|
try {
|
|
457
467
|
throw Error();
|
|
458
|
-
} catch (
|
|
459
|
-
|
|
468
|
+
} catch (he) {
|
|
469
|
+
R = he;
|
|
460
470
|
}
|
|
461
471
|
e();
|
|
462
472
|
}
|
|
463
|
-
} catch (
|
|
464
|
-
if (
|
|
465
|
-
for (var
|
|
466
|
-
`),
|
|
467
|
-
`),
|
|
468
|
-
|
|
469
|
-
for (;
|
|
470
|
-
if (
|
|
471
|
-
if (
|
|
473
|
+
} catch (he) {
|
|
474
|
+
if (he && R && typeof he.stack == "string") {
|
|
475
|
+
for (var O = he.stack.split(`
|
|
476
|
+
`), pe = R.stack.split(`
|
|
477
|
+
`), ne = O.length - 1, se = pe.length - 1; ne >= 1 && se >= 0 && O[ne] !== pe[se]; )
|
|
478
|
+
se--;
|
|
479
|
+
for (; ne >= 1 && se >= 0; ne--, se--)
|
|
480
|
+
if (O[ne] !== pe[se]) {
|
|
481
|
+
if (ne !== 1 || se !== 1)
|
|
472
482
|
do
|
|
473
|
-
if (
|
|
474
|
-
var
|
|
475
|
-
` +
|
|
476
|
-
return e.displayName &&
|
|
483
|
+
if (ne--, se--, se < 0 || O[ne] !== pe[se]) {
|
|
484
|
+
var _e = `
|
|
485
|
+
` + O[ne].replace(" at new ", " at ");
|
|
486
|
+
return e.displayName && _e.includes("<anonymous>") && (_e = _e.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, _e), _e;
|
|
477
487
|
}
|
|
478
|
-
while (
|
|
488
|
+
while (ne >= 1 && se >= 0);
|
|
479
489
|
break;
|
|
480
490
|
}
|
|
481
491
|
}
|
|
482
492
|
} finally {
|
|
483
|
-
|
|
493
|
+
ce = !1, ie.current = Y, z(), Error.prepareStackTrace = $;
|
|
484
494
|
}
|
|
485
|
-
var
|
|
486
|
-
return typeof e == "function" &&
|
|
495
|
+
var Be = e ? e.displayName || e.name : "", je = Be ? ve(Be) : "";
|
|
496
|
+
return typeof e == "function" && U.set(e, je), je;
|
|
487
497
|
}
|
|
488
|
-
function
|
|
489
|
-
return
|
|
498
|
+
function me(e, c, f) {
|
|
499
|
+
return ge(e, !1);
|
|
490
500
|
}
|
|
491
|
-
function
|
|
492
|
-
var
|
|
493
|
-
return !!(
|
|
501
|
+
function ye(e) {
|
|
502
|
+
var c = e.prototype;
|
|
503
|
+
return !!(c && c.isReactComponent);
|
|
494
504
|
}
|
|
495
|
-
function
|
|
505
|
+
function ke(e, c, f) {
|
|
496
506
|
if (e == null)
|
|
497
507
|
return "";
|
|
498
508
|
if (typeof e == "function")
|
|
499
|
-
return
|
|
509
|
+
return ge(e, ye(e));
|
|
500
510
|
if (typeof e == "string")
|
|
501
|
-
return
|
|
511
|
+
return ve(e);
|
|
502
512
|
switch (e) {
|
|
503
|
-
case
|
|
504
|
-
return
|
|
505
|
-
case
|
|
506
|
-
return
|
|
513
|
+
case y:
|
|
514
|
+
return ve("Suspense");
|
|
515
|
+
case v:
|
|
516
|
+
return ve("SuspenseList");
|
|
507
517
|
}
|
|
508
518
|
if (typeof e == "object")
|
|
509
519
|
switch (e.$$typeof) {
|
|
510
|
-
case
|
|
511
|
-
return
|
|
512
|
-
case
|
|
513
|
-
return
|
|
514
|
-
case
|
|
515
|
-
var
|
|
520
|
+
case T:
|
|
521
|
+
return me(e.render);
|
|
522
|
+
case N:
|
|
523
|
+
return ke(e.type, c, f);
|
|
524
|
+
case P: {
|
|
525
|
+
var R = e, $ = R._payload, Y = R._init;
|
|
516
526
|
try {
|
|
517
|
-
return
|
|
527
|
+
return ke(Y($), c, f);
|
|
518
528
|
} catch {
|
|
519
529
|
}
|
|
520
530
|
}
|
|
521
531
|
}
|
|
522
532
|
return "";
|
|
523
533
|
}
|
|
524
|
-
var
|
|
525
|
-
function
|
|
534
|
+
var Ne = Object.prototype.hasOwnProperty, Ae = {}, ze = p.ReactDebugCurrentFrame;
|
|
535
|
+
function Me(e) {
|
|
526
536
|
if (e) {
|
|
527
|
-
var
|
|
528
|
-
|
|
537
|
+
var c = e._owner, f = ke(e.type, e._source, c ? c.type : null);
|
|
538
|
+
ze.setExtraStackFrame(f);
|
|
529
539
|
} else
|
|
530
|
-
|
|
540
|
+
ze.setExtraStackFrame(null);
|
|
531
541
|
}
|
|
532
|
-
function
|
|
542
|
+
function Ue(e, c, f, R, $) {
|
|
533
543
|
{
|
|
534
|
-
var
|
|
535
|
-
for (var
|
|
536
|
-
if (
|
|
537
|
-
var
|
|
544
|
+
var Y = Function.call.bind(Ne);
|
|
545
|
+
for (var L in e)
|
|
546
|
+
if (Y(e, L)) {
|
|
547
|
+
var O = void 0;
|
|
538
548
|
try {
|
|
539
|
-
if (typeof e[
|
|
540
|
-
var
|
|
541
|
-
throw
|
|
549
|
+
if (typeof e[L] != "function") {
|
|
550
|
+
var pe = Error((R || "React class") + ": " + f + " type `" + L + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[L] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
551
|
+
throw pe.name = "Invariant Violation", pe;
|
|
542
552
|
}
|
|
543
|
-
|
|
544
|
-
} catch (
|
|
545
|
-
|
|
553
|
+
O = e[L](c, L, R, f, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
554
|
+
} catch (ne) {
|
|
555
|
+
O = ne;
|
|
546
556
|
}
|
|
547
|
-
|
|
557
|
+
O && !(O instanceof Error) && (Me($), b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", R || "React class", f, L, typeof O), Me(null)), O instanceof Error && !(O.message in Ae) && (Ae[O.message] = !0, Me($), b("Failed %s type: %s", f, O.message), Me(null));
|
|
548
558
|
}
|
|
549
559
|
}
|
|
550
560
|
}
|
|
551
|
-
var
|
|
552
|
-
function
|
|
553
|
-
return
|
|
561
|
+
var ht = Array.isArray;
|
|
562
|
+
function Fe(e) {
|
|
563
|
+
return ht(e);
|
|
554
564
|
}
|
|
555
|
-
function
|
|
565
|
+
function wt(e) {
|
|
556
566
|
{
|
|
557
|
-
var
|
|
558
|
-
return
|
|
567
|
+
var c = typeof Symbol == "function" && Symbol.toStringTag, f = c && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
568
|
+
return f;
|
|
559
569
|
}
|
|
560
570
|
}
|
|
561
|
-
function
|
|
571
|
+
function vt(e) {
|
|
562
572
|
try {
|
|
563
|
-
return
|
|
573
|
+
return at(e), !1;
|
|
564
574
|
} catch {
|
|
565
575
|
return !0;
|
|
566
576
|
}
|
|
567
577
|
}
|
|
568
|
-
function
|
|
578
|
+
function at(e) {
|
|
569
579
|
return "" + e;
|
|
570
580
|
}
|
|
571
|
-
function
|
|
572
|
-
if (
|
|
573
|
-
return
|
|
581
|
+
function ot(e) {
|
|
582
|
+
if (vt(e))
|
|
583
|
+
return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", wt(e)), at(e);
|
|
574
584
|
}
|
|
575
|
-
var
|
|
585
|
+
var it = p.ReactCurrentOwner, gt = {
|
|
576
586
|
key: !0,
|
|
577
587
|
ref: !0,
|
|
578
588
|
__self: !0,
|
|
579
589
|
__source: !0
|
|
580
|
-
},
|
|
581
|
-
function
|
|
582
|
-
if (
|
|
583
|
-
var
|
|
584
|
-
if (
|
|
590
|
+
}, st, Le;
|
|
591
|
+
function Ve(e) {
|
|
592
|
+
if (Ne.call(e, "ref")) {
|
|
593
|
+
var c = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
594
|
+
if (c && c.isReactWarning)
|
|
585
595
|
return !1;
|
|
586
596
|
}
|
|
587
597
|
return e.ref !== void 0;
|
|
588
598
|
}
|
|
589
|
-
function
|
|
590
|
-
if (
|
|
591
|
-
var
|
|
592
|
-
if (
|
|
599
|
+
function Et(e) {
|
|
600
|
+
if (Ne.call(e, "key")) {
|
|
601
|
+
var c = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
602
|
+
if (c && c.isReactWarning)
|
|
593
603
|
return !1;
|
|
594
604
|
}
|
|
595
605
|
return e.key !== void 0;
|
|
596
606
|
}
|
|
597
|
-
function
|
|
598
|
-
typeof e.ref == "string" &&
|
|
607
|
+
function yt(e, c) {
|
|
608
|
+
typeof e.ref == "string" && it.current;
|
|
599
609
|
}
|
|
600
|
-
function
|
|
610
|
+
function _t(e, c) {
|
|
601
611
|
{
|
|
602
|
-
var
|
|
603
|
-
|
|
612
|
+
var f = function() {
|
|
613
|
+
st || (st = !0, b("%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://reactjs.org/link/special-props)", c));
|
|
604
614
|
};
|
|
605
|
-
|
|
606
|
-
get:
|
|
615
|
+
f.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
616
|
+
get: f,
|
|
607
617
|
configurable: !0
|
|
608
618
|
});
|
|
609
619
|
}
|
|
610
620
|
}
|
|
611
|
-
function
|
|
621
|
+
function bt(e, c) {
|
|
612
622
|
{
|
|
613
|
-
var
|
|
614
|
-
|
|
623
|
+
var f = function() {
|
|
624
|
+
Le || (Le = !0, b("%s: `ref` 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://reactjs.org/link/special-props)", c));
|
|
615
625
|
};
|
|
616
|
-
|
|
617
|
-
get:
|
|
626
|
+
f.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
627
|
+
get: f,
|
|
618
628
|
configurable: !0
|
|
619
629
|
});
|
|
620
630
|
}
|
|
621
631
|
}
|
|
622
|
-
var
|
|
623
|
-
var
|
|
632
|
+
var Ct = function(e, c, f, R, $, Y, L) {
|
|
633
|
+
var O = {
|
|
624
634
|
// This tag allows us to uniquely identify this as a React Element
|
|
625
|
-
$$typeof:
|
|
635
|
+
$$typeof: u,
|
|
626
636
|
// Built-in properties that belong on the element
|
|
627
637
|
type: e,
|
|
628
|
-
key:
|
|
629
|
-
ref:
|
|
630
|
-
props:
|
|
638
|
+
key: c,
|
|
639
|
+
ref: f,
|
|
640
|
+
props: L,
|
|
631
641
|
// Record the component responsible for creating this element.
|
|
632
|
-
_owner:
|
|
642
|
+
_owner: Y
|
|
633
643
|
};
|
|
634
|
-
return
|
|
644
|
+
return O._store = {}, Object.defineProperty(O._store, "validated", {
|
|
635
645
|
configurable: !1,
|
|
636
646
|
enumerable: !1,
|
|
637
647
|
writable: !0,
|
|
638
648
|
value: !1
|
|
639
|
-
}), Object.defineProperty(
|
|
649
|
+
}), Object.defineProperty(O, "_self", {
|
|
640
650
|
configurable: !1,
|
|
641
651
|
enumerable: !1,
|
|
642
652
|
writable: !1,
|
|
643
|
-
value:
|
|
644
|
-
}), Object.defineProperty(
|
|
653
|
+
value: R
|
|
654
|
+
}), Object.defineProperty(O, "_source", {
|
|
645
655
|
configurable: !1,
|
|
646
656
|
enumerable: !1,
|
|
647
657
|
writable: !1,
|
|
648
|
-
value:
|
|
649
|
-
}), Object.freeze && (Object.freeze(
|
|
658
|
+
value: $
|
|
659
|
+
}), Object.freeze && (Object.freeze(O.props), Object.freeze(O)), O;
|
|
650
660
|
};
|
|
651
|
-
function
|
|
661
|
+
function lt(e, c, f, R, $) {
|
|
652
662
|
{
|
|
653
|
-
var
|
|
654
|
-
|
|
655
|
-
for (
|
|
656
|
-
|
|
663
|
+
var Y, L = {}, O = null, pe = null;
|
|
664
|
+
f !== void 0 && (ot(f), O = "" + f), Et(c) && (ot(c.key), O = "" + c.key), Ve(c) && (pe = c.ref, yt(c, $));
|
|
665
|
+
for (Y in c)
|
|
666
|
+
Ne.call(c, Y) && !gt.hasOwnProperty(Y) && (L[Y] = c[Y]);
|
|
657
667
|
if (e && e.defaultProps) {
|
|
658
|
-
var
|
|
659
|
-
for (
|
|
660
|
-
|
|
668
|
+
var ne = e.defaultProps;
|
|
669
|
+
for (Y in ne)
|
|
670
|
+
L[Y] === void 0 && (L[Y] = ne[Y]);
|
|
661
671
|
}
|
|
662
|
-
if (
|
|
663
|
-
var
|
|
664
|
-
|
|
672
|
+
if (O || pe) {
|
|
673
|
+
var se = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
674
|
+
O && _t(L, se), pe && bt(L, se);
|
|
665
675
|
}
|
|
666
|
-
return
|
|
676
|
+
return Ct(e, O, pe, $, R, it.current, L);
|
|
667
677
|
}
|
|
668
678
|
}
|
|
669
|
-
var
|
|
670
|
-
function
|
|
679
|
+
var $e = p.ReactCurrentOwner, Ye = p.ReactDebugCurrentFrame;
|
|
680
|
+
function De(e) {
|
|
671
681
|
if (e) {
|
|
672
|
-
var
|
|
673
|
-
|
|
682
|
+
var c = e._owner, f = ke(e.type, e._source, c ? c.type : null);
|
|
683
|
+
Ye.setExtraStackFrame(f);
|
|
674
684
|
} else
|
|
675
|
-
|
|
685
|
+
Ye.setExtraStackFrame(null);
|
|
676
686
|
}
|
|
677
|
-
var
|
|
678
|
-
|
|
679
|
-
function
|
|
680
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
687
|
+
var Ze;
|
|
688
|
+
Ze = !1;
|
|
689
|
+
function Ge(e) {
|
|
690
|
+
return typeof e == "object" && e !== null && e.$$typeof === u;
|
|
681
691
|
}
|
|
682
|
-
function
|
|
692
|
+
function ct() {
|
|
683
693
|
{
|
|
684
|
-
if (
|
|
685
|
-
var e =
|
|
694
|
+
if ($e.current) {
|
|
695
|
+
var e = ae($e.current.type);
|
|
686
696
|
if (e)
|
|
687
697
|
return `
|
|
688
698
|
|
|
@@ -691,149 +701,148 @@ Check the render method of \`` + e + "`.";
|
|
|
691
701
|
return "";
|
|
692
702
|
}
|
|
693
703
|
}
|
|
694
|
-
function
|
|
704
|
+
function xt(e) {
|
|
695
705
|
return "";
|
|
696
706
|
}
|
|
697
|
-
var
|
|
698
|
-
function
|
|
707
|
+
var ut = {};
|
|
708
|
+
function t(e) {
|
|
699
709
|
{
|
|
700
|
-
var
|
|
701
|
-
if (!
|
|
702
|
-
var
|
|
703
|
-
|
|
710
|
+
var c = ct();
|
|
711
|
+
if (!c) {
|
|
712
|
+
var f = typeof e == "string" ? e : e.displayName || e.name;
|
|
713
|
+
f && (c = `
|
|
704
714
|
|
|
705
|
-
Check the top-level render call using <` +
|
|
715
|
+
Check the top-level render call using <` + f + ">.");
|
|
706
716
|
}
|
|
707
|
-
return
|
|
717
|
+
return c;
|
|
708
718
|
}
|
|
709
719
|
}
|
|
710
|
-
function
|
|
720
|
+
function r(e, c) {
|
|
711
721
|
{
|
|
712
722
|
if (!e._store || e._store.validated || e.key != null)
|
|
713
723
|
return;
|
|
714
724
|
e._store.validated = !0;
|
|
715
|
-
var
|
|
716
|
-
if (
|
|
725
|
+
var f = t(c);
|
|
726
|
+
if (ut[f])
|
|
717
727
|
return;
|
|
718
|
-
|
|
719
|
-
var
|
|
720
|
-
e && e._owner && e._owner !==
|
|
728
|
+
ut[f] = !0;
|
|
729
|
+
var R = "";
|
|
730
|
+
e && e._owner && e._owner !== $e.current && (R = " It was passed a child from " + ae(e._owner.type) + "."), De(e), b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', f, R), De(null);
|
|
721
731
|
}
|
|
722
732
|
}
|
|
723
|
-
function a(e,
|
|
733
|
+
function a(e, c) {
|
|
724
734
|
{
|
|
725
735
|
if (typeof e != "object")
|
|
726
736
|
return;
|
|
727
|
-
if (
|
|
728
|
-
for (var
|
|
729
|
-
var
|
|
730
|
-
|
|
737
|
+
if (Fe(e))
|
|
738
|
+
for (var f = 0; f < e.length; f++) {
|
|
739
|
+
var R = e[f];
|
|
740
|
+
Ge(R) && r(R, c);
|
|
731
741
|
}
|
|
732
|
-
else if (
|
|
742
|
+
else if (Ge(e))
|
|
733
743
|
e._store && (e._store.validated = !0);
|
|
734
744
|
else if (e) {
|
|
735
|
-
var
|
|
736
|
-
if (typeof
|
|
737
|
-
for (var
|
|
738
|
-
|
|
745
|
+
var $ = D(e);
|
|
746
|
+
if (typeof $ == "function" && $ !== e.entries)
|
|
747
|
+
for (var Y = $.call(e), L; !(L = Y.next()).done; )
|
|
748
|
+
Ge(L.value) && r(L.value, c);
|
|
739
749
|
}
|
|
740
750
|
}
|
|
741
751
|
}
|
|
742
|
-
function
|
|
752
|
+
function s(e) {
|
|
743
753
|
{
|
|
744
|
-
var
|
|
745
|
-
if (
|
|
754
|
+
var c = e.type;
|
|
755
|
+
if (c == null || typeof c == "string")
|
|
746
756
|
return;
|
|
747
|
-
var
|
|
748
|
-
if (typeof
|
|
749
|
-
|
|
750
|
-
else if (typeof
|
|
757
|
+
var f;
|
|
758
|
+
if (typeof c == "function")
|
|
759
|
+
f = c.propTypes;
|
|
760
|
+
else if (typeof c == "object" && (c.$$typeof === T || // Note: Memo only checks outer props here.
|
|
751
761
|
// Inner props are checked in the reconciler.
|
|
752
|
-
|
|
753
|
-
|
|
762
|
+
c.$$typeof === N))
|
|
763
|
+
f = c.propTypes;
|
|
754
764
|
else
|
|
755
765
|
return;
|
|
756
|
-
if (
|
|
757
|
-
var
|
|
758
|
-
|
|
759
|
-
} else if (
|
|
760
|
-
|
|
761
|
-
var
|
|
762
|
-
|
|
766
|
+
if (f) {
|
|
767
|
+
var R = ae(c);
|
|
768
|
+
Ue(f, e.props, "prop", R, e);
|
|
769
|
+
} else if (c.PropTypes !== void 0 && !Ze) {
|
|
770
|
+
Ze = !0;
|
|
771
|
+
var $ = ae(c);
|
|
772
|
+
b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", $ || "Unknown");
|
|
763
773
|
}
|
|
764
|
-
typeof
|
|
774
|
+
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
765
775
|
}
|
|
766
776
|
}
|
|
767
|
-
function
|
|
777
|
+
function i(e) {
|
|
768
778
|
{
|
|
769
|
-
for (var
|
|
770
|
-
var
|
|
771
|
-
if (
|
|
772
|
-
|
|
779
|
+
for (var c = Object.keys(e.props), f = 0; f < c.length; f++) {
|
|
780
|
+
var R = c[f];
|
|
781
|
+
if (R !== "children" && R !== "key") {
|
|
782
|
+
De(e), b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", R), De(null);
|
|
773
783
|
break;
|
|
774
784
|
}
|
|
775
785
|
}
|
|
776
|
-
e.ref !== null && (
|
|
786
|
+
e.ref !== null && (De(e), b("Invalid attribute `ref` supplied to `React.Fragment`."), De(null));
|
|
777
787
|
}
|
|
778
788
|
}
|
|
779
|
-
var
|
|
780
|
-
function
|
|
789
|
+
var w = {};
|
|
790
|
+
function d(e, c, f, R, $, Y) {
|
|
781
791
|
{
|
|
782
|
-
var
|
|
783
|
-
if (!
|
|
784
|
-
var
|
|
785
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (
|
|
786
|
-
var
|
|
787
|
-
|
|
788
|
-
var
|
|
789
|
-
e === null ?
|
|
792
|
+
var L = _(e);
|
|
793
|
+
if (!L) {
|
|
794
|
+
var O = "";
|
|
795
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (O += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
796
|
+
var pe = xt();
|
|
797
|
+
pe ? O += pe : O += ct();
|
|
798
|
+
var ne;
|
|
799
|
+
e === null ? ne = "null" : Fe(e) ? ne = "array" : e !== void 0 && e.$$typeof === u ? (ne = "<" + (ae(e.type) || "Unknown") + " />", O = " Did you accidentally export a JSX literal instead of a component?") : ne = typeof e, b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ne, O);
|
|
790
800
|
}
|
|
791
|
-
var
|
|
792
|
-
if (
|
|
793
|
-
return
|
|
794
|
-
if (
|
|
795
|
-
var
|
|
796
|
-
if (
|
|
797
|
-
if (
|
|
798
|
-
if (
|
|
799
|
-
for (var
|
|
800
|
-
a(
|
|
801
|
-
Object.freeze && Object.freeze(
|
|
801
|
+
var se = lt(e, c, f, $, Y);
|
|
802
|
+
if (se == null)
|
|
803
|
+
return se;
|
|
804
|
+
if (L) {
|
|
805
|
+
var _e = c.children;
|
|
806
|
+
if (_e !== void 0)
|
|
807
|
+
if (R)
|
|
808
|
+
if (Fe(_e)) {
|
|
809
|
+
for (var Be = 0; Be < _e.length; Be++)
|
|
810
|
+
a(_e[Be], e);
|
|
811
|
+
Object.freeze && Object.freeze(_e);
|
|
802
812
|
} else
|
|
803
|
-
|
|
813
|
+
b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
804
814
|
else
|
|
805
|
-
a(
|
|
815
|
+
a(_e, e);
|
|
806
816
|
}
|
|
807
|
-
if (
|
|
808
|
-
var
|
|
809
|
-
return
|
|
810
|
-
}),
|
|
811
|
-
if (!
|
|
812
|
-
var
|
|
813
|
-
|
|
817
|
+
if (Ne.call(c, "key")) {
|
|
818
|
+
var je = ae(e), he = Object.keys(c).filter(function(Zt) {
|
|
819
|
+
return Zt !== "key";
|
|
820
|
+
}), Rt = he.length > 0 ? "{key: someKey, " + he.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
821
|
+
if (!w[je + Rt]) {
|
|
822
|
+
var Yt = he.length > 0 ? "{" + he.join(": ..., ") + ": ...}" : "{}";
|
|
823
|
+
b(`A props object containing a "key" prop is being spread into JSX:
|
|
814
824
|
let props = %s;
|
|
815
825
|
<%s {...props} />
|
|
816
826
|
React keys must be passed directly to JSX without using spread:
|
|
817
827
|
let props = %s;
|
|
818
|
-
<%s key={someKey} {...props} />`,
|
|
828
|
+
<%s key={someKey} {...props} />`, Rt, je, Yt, je), w[je + Rt] = !0;
|
|
819
829
|
}
|
|
820
830
|
}
|
|
821
|
-
return e ===
|
|
831
|
+
return e === m ? i(se) : s(se), se;
|
|
822
832
|
}
|
|
823
833
|
}
|
|
824
|
-
function
|
|
825
|
-
return
|
|
834
|
+
function x(e, c, f) {
|
|
835
|
+
return d(e, c, f, !0);
|
|
826
836
|
}
|
|
827
|
-
function
|
|
828
|
-
return
|
|
837
|
+
function X(e, c, f) {
|
|
838
|
+
return d(e, c, f, !1);
|
|
829
839
|
}
|
|
830
|
-
var
|
|
831
|
-
|
|
832
|
-
}()),
|
|
840
|
+
var Se = X, Ke = x;
|
|
841
|
+
Xe.Fragment = m, Xe.jsx = Se, Xe.jsxs = Ke;
|
|
842
|
+
}()), Xe;
|
|
833
843
|
}
|
|
834
|
-
process.env.NODE_ENV === "production" ?
|
|
835
|
-
var
|
|
836
|
-
const xt = (s) => Vt("path", s), wt = Ct(
|
|
844
|
+
process.env.NODE_ENV === "production" ? Dt.exports = Fr() : Dt.exports = Lr();
|
|
845
|
+
var xe = Dt.exports, rt = (n) => nr("path", n), nt = Ht(
|
|
837
846
|
/**
|
|
838
847
|
* @param {SVGProps} props isPressed indicates whether the SVG should appear as pressed.
|
|
839
848
|
* Other props will be passed through to svg component.
|
|
@@ -841,371 +850,388 @@ const xt = (s) => Vt("path", s), wt = Ct(
|
|
|
841
850
|
*
|
|
842
851
|
* @return {JSX.Element} Stop component
|
|
843
852
|
*/
|
|
844
|
-
({ className:
|
|
845
|
-
const
|
|
846
|
-
...
|
|
847
|
-
className:
|
|
853
|
+
({ className: n, isPressed: u, ...l }, m) => {
|
|
854
|
+
const E = {
|
|
855
|
+
...l,
|
|
856
|
+
className: ar(n, { "is-pressed": u }) || void 0,
|
|
848
857
|
"aria-hidden": !0,
|
|
849
858
|
focusable: !1
|
|
850
859
|
};
|
|
851
|
-
return /* @__PURE__ */
|
|
860
|
+
return /* @__PURE__ */ xe.jsx("svg", { ...E, ref: m });
|
|
852
861
|
}
|
|
853
862
|
);
|
|
854
|
-
|
|
855
|
-
const
|
|
863
|
+
nt.displayName = "SVG";
|
|
864
|
+
const jr = /* @__PURE__ */ xe.jsx(nt, {
|
|
856
865
|
viewBox: "0 0 24 24",
|
|
857
866
|
xmlns: "http://www.w3.org/2000/svg",
|
|
858
|
-
children: /* @__PURE__ */
|
|
867
|
+
children: /* @__PURE__ */ xe.jsx(rt, {
|
|
859
868
|
d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"
|
|
860
869
|
})
|
|
861
|
-
}),
|
|
870
|
+
}), Ir = /* @__PURE__ */ xe.jsx(nt, {
|
|
862
871
|
xmlns: "http://www.w3.org/2000/svg",
|
|
863
872
|
viewBox: "0 0 24 24",
|
|
864
|
-
children: /* @__PURE__ */
|
|
873
|
+
children: /* @__PURE__ */ xe.jsx(rt, {
|
|
865
874
|
d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"
|
|
866
875
|
})
|
|
867
|
-
}),
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
876
|
+
}), Mr = /* @__PURE__ */ xe.jsx(nt, {
|
|
877
|
+
viewBox: "0 0 24 24",
|
|
878
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
879
|
+
children: /* @__PURE__ */ xe.jsx(rt, {
|
|
880
|
+
fillRule: "evenodd",
|
|
881
|
+
clipRule: "evenodd",
|
|
882
|
+
d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z"
|
|
883
|
+
})
|
|
884
|
+
}), Vr = /* @__PURE__ */ xe.jsxs(nt, {
|
|
885
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
886
|
+
viewBox: "0 0 24 24",
|
|
887
|
+
children: [/* @__PURE__ */ xe.jsx(rt, {
|
|
888
|
+
d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z"
|
|
889
|
+
}), /* @__PURE__ */ xe.jsx(rt, {
|
|
890
|
+
d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z"
|
|
891
|
+
})]
|
|
892
|
+
}), $r = "_file-picker-tree_3rwm2_1", Br = "_file-node-button_3rwm2_17", Wr = "_selected_3rwm2_53", Hr = "_focused_3rwm2_65", zr = "_dropTarget_3rwm2_70", Ur = "_dropTargetInvalid_3rwm2_79", Yr = "_renaming_3rwm2_88", Zr = "_renameInput_3rwm2_93", Gr = "_file-name_3rwm2_108", we = {
|
|
893
|
+
filePickerTree: $r,
|
|
894
|
+
fileNodeButton: Br,
|
|
895
|
+
selected: Wr,
|
|
896
|
+
focused: Hr,
|
|
897
|
+
dropTarget: zr,
|
|
898
|
+
dropTargetInvalid: Ur,
|
|
899
|
+
renaming: Yr,
|
|
900
|
+
renameInput: Zr,
|
|
901
|
+
fileName: Gr
|
|
877
902
|
};
|
|
878
|
-
function
|
|
879
|
-
if (!
|
|
880
|
-
const
|
|
881
|
-
let
|
|
882
|
-
|
|
883
|
-
for (const
|
|
884
|
-
!
|
|
885
|
-
return
|
|
903
|
+
function Pt(n) {
|
|
904
|
+
if (!n) return [];
|
|
905
|
+
const u = n.replaceAll(/\\+/g, "/").replace(/\/{2,}/g, "/").replace(/\/$/, "") || n, l = u.startsWith("/"), m = u.split("/").filter(Boolean), E = [];
|
|
906
|
+
let g = l ? "/" : "";
|
|
907
|
+
l && E.push("/");
|
|
908
|
+
for (const k of m)
|
|
909
|
+
!g || g === "/" ? g = g === "/" ? `/${k}` : k : g = `${g}/${k}`, E.push(g);
|
|
910
|
+
return E;
|
|
886
911
|
}
|
|
887
|
-
function
|
|
888
|
-
if (!
|
|
889
|
-
const
|
|
890
|
-
return
|
|
912
|
+
function Kr(n, u) {
|
|
913
|
+
if (!n || !u || n === u) return !1;
|
|
914
|
+
const l = n === "/" ? "/" : n.replace(/\/{2,}/g, "/"), m = u.replace(/\/{2,}/g, "/");
|
|
915
|
+
return l === "/" ? m.startsWith("/") && m !== "/" : m.startsWith(`${l}/`);
|
|
891
916
|
}
|
|
892
|
-
function
|
|
893
|
-
return
|
|
917
|
+
function kt(n, u, l) {
|
|
918
|
+
return n && (n === u ? l : n.startsWith(u === "/" ? "/" : `${u}/`) ? l + n.slice(u.length) : n);
|
|
894
919
|
}
|
|
895
|
-
const
|
|
920
|
+
const qr = Bt(function({
|
|
921
|
+
withContextMenu: u = !0,
|
|
896
922
|
filesystem: l,
|
|
897
|
-
root:
|
|
898
|
-
initialSelectedPath:
|
|
899
|
-
onSelect:
|
|
923
|
+
root: m = "/wordpress",
|
|
924
|
+
initialSelectedPath: E,
|
|
925
|
+
onSelect: g = () => {
|
|
900
926
|
},
|
|
901
|
-
onDoubleClickFile:
|
|
902
|
-
},
|
|
903
|
-
const
|
|
904
|
-
let t = (
|
|
927
|
+
onDoubleClickFile: k
|
|
928
|
+
}, V) {
|
|
929
|
+
const T = Nt(() => {
|
|
930
|
+
let t = (m || "/").replace(/\\+/g, "/");
|
|
905
931
|
return t.startsWith("/") || (t = `/${t}`), t = t.replace(/\/{2,}/g, "/"), t.length > 1 && t.endsWith("/") && (t = t.slice(0, -1)), t || "/";
|
|
906
|
-
}, [
|
|
907
|
-
if (!
|
|
932
|
+
}, [m]), y = (t) => !t || t === "." || t === ".." ? !1 : !/[\\/]/.test(t), [v, N] = Q(() => {
|
|
933
|
+
if (!E)
|
|
908
934
|
return {};
|
|
909
935
|
const t = {};
|
|
910
|
-
for (const r of
|
|
936
|
+
for (const r of Pt(E))
|
|
911
937
|
t[r] = !0;
|
|
912
938
|
return t;
|
|
913
|
-
}), [
|
|
914
|
-
() =>
|
|
915
|
-
), [
|
|
916
|
-
() =>
|
|
917
|
-
), [
|
|
939
|
+
}), [P, j] = Q(
|
|
940
|
+
() => E ?? null
|
|
941
|
+
), [Z, A] = Q(
|
|
942
|
+
() => E ?? null
|
|
943
|
+
), [D, p] = Q({}), [b, q] = Q(
|
|
918
944
|
{}
|
|
919
|
-
), [
|
|
945
|
+
), [B, G] = Q(null), [ee, W] = Q(
|
|
920
946
|
null
|
|
921
|
-
),
|
|
922
|
-
for (const t of Object.keys(
|
|
923
|
-
clearTimeout(
|
|
924
|
-
},
|
|
925
|
-
const r =
|
|
926
|
-
r && (clearTimeout(r), delete
|
|
947
|
+
), F = M({}), te = M(!1), _ = M(null), H = M(null), de = M(b), ae = M(D), re = () => {
|
|
948
|
+
for (const t of Object.keys(F.current))
|
|
949
|
+
clearTimeout(F.current[t]), delete F.current[t];
|
|
950
|
+
}, ue = (t) => {
|
|
951
|
+
const r = F.current[t];
|
|
952
|
+
r && (clearTimeout(r), delete F.current[t]);
|
|
927
953
|
};
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
}, [
|
|
931
|
-
|
|
932
|
-
}, [
|
|
933
|
-
const
|
|
934
|
-
var
|
|
935
|
-
const r = (
|
|
954
|
+
I(() => {
|
|
955
|
+
de.current = b;
|
|
956
|
+
}, [b]), I(() => {
|
|
957
|
+
ae.current = D;
|
|
958
|
+
}, [D]);
|
|
959
|
+
const oe = (t) => {
|
|
960
|
+
var a;
|
|
961
|
+
const r = (a = _.current) == null ? void 0 : a.querySelector(
|
|
936
962
|
`[data-path="${t}"]`
|
|
937
963
|
);
|
|
938
964
|
r && typeof r.focus == "function" && (r.focus(), r.scrollIntoView({
|
|
939
965
|
behavior: "smooth",
|
|
940
966
|
block: "nearest"
|
|
941
967
|
}));
|
|
942
|
-
},
|
|
943
|
-
const
|
|
944
|
-
for (const
|
|
945
|
-
const
|
|
946
|
-
|
|
947
|
-
}
|
|
948
|
-
return
|
|
949
|
-
var
|
|
950
|
-
if (
|
|
951
|
-
const
|
|
952
|
-
if (
|
|
953
|
-
if (
|
|
954
|
-
if (
|
|
968
|
+
}, be = (t, r = "") => (r ? `${r}/${t.name}` : t.name).replaceAll(/\\+/g, "/").replace(/\/{2,}/g, "/"), Re = (t, r) => t.children ? t.children : D[r], Te = async (t, r) => {
|
|
969
|
+
const a = await t.listFiles(r), s = [];
|
|
970
|
+
for (const i of a) {
|
|
971
|
+
const w = r === "/" ? `/${i}` : `${r}/${i}`, d = await t.isDir(w);
|
|
972
|
+
s.push({ name: i, type: d ? "folder" : "file" });
|
|
973
|
+
}
|
|
974
|
+
return s.sort((i, w) => {
|
|
975
|
+
var Se;
|
|
976
|
+
if (i.type !== w.type) return i.type === "folder" ? -1 : 1;
|
|
977
|
+
const d = r === "/" ? `/${i.name}` : `${r}/${i.name}`, x = r === "/" ? `/${w.name}` : `${r}/${w.name}`, X = (Se = ye.current) == null ? void 0 : Se.tempPath;
|
|
978
|
+
if (X) {
|
|
979
|
+
if (d === X) return -1;
|
|
980
|
+
if (x === X) return 1;
|
|
955
981
|
}
|
|
956
|
-
return
|
|
957
|
-
}),
|
|
958
|
-
},
|
|
982
|
+
return i.name.localeCompare(w.name);
|
|
983
|
+
}), s;
|
|
984
|
+
}, Pe = async (t) => await Te(l, t), le = (t, r) => {
|
|
959
985
|
if (r.type !== "folder")
|
|
960
986
|
return r.children;
|
|
961
|
-
const
|
|
962
|
-
return
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
...
|
|
966
|
-
[t]:
|
|
967
|
-
})), i
|
|
987
|
+
const a = r.children ?? ae.current[t];
|
|
988
|
+
return a || de.current[t] ? a : (q((s) => ({ ...s, [t]: !0 })), new Promise((s) => {
|
|
989
|
+
Pe(t).then((i) => {
|
|
990
|
+
p((w) => ({
|
|
991
|
+
...w,
|
|
992
|
+
[t]: i ?? []
|
|
993
|
+
})), s(i ?? []);
|
|
968
994
|
}).catch(() => {
|
|
969
|
-
|
|
995
|
+
s([]);
|
|
970
996
|
}).finally(() => {
|
|
971
|
-
|
|
972
|
-
const
|
|
973
|
-
return delete
|
|
997
|
+
q((i) => {
|
|
998
|
+
const w = { ...i };
|
|
999
|
+
return delete w[t], w;
|
|
974
1000
|
});
|
|
975
1001
|
});
|
|
976
1002
|
}));
|
|
977
|
-
},
|
|
978
|
-
r.type === "folder" && (typeof window > "u" ||
|
|
979
|
-
|
|
1003
|
+
}, S = (t, r) => {
|
|
1004
|
+
r.type === "folder" && (typeof window > "u" || F.current[t] || (F.current[t] = window.setTimeout(() => {
|
|
1005
|
+
N((a) => a[t] ? a : { ...a, [t]: !0 }), le(t, r), delete F.current[t];
|
|
980
1006
|
}, 600)));
|
|
981
|
-
},
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
...
|
|
985
|
-
[t]:
|
|
986
|
-
})), r(
|
|
1007
|
+
}, C = (t) => (q((r) => ({ ...r, [t]: !0 })), new Promise((r) => {
|
|
1008
|
+
Pe(t).then((a) => {
|
|
1009
|
+
p((s) => ({
|
|
1010
|
+
...s,
|
|
1011
|
+
[t]: a ?? []
|
|
1012
|
+
})), r(a ?? []);
|
|
987
1013
|
}).catch(() => {
|
|
988
1014
|
r([]);
|
|
989
1015
|
}).finally(() => {
|
|
990
|
-
|
|
991
|
-
const
|
|
992
|
-
return delete
|
|
1016
|
+
q((a) => {
|
|
1017
|
+
const s = { ...a };
|
|
1018
|
+
return delete s[t], s;
|
|
993
1019
|
});
|
|
994
1020
|
});
|
|
995
|
-
})),
|
|
996
|
-
|
|
997
|
-
...
|
|
998
|
-
[t]:
|
|
999
|
-
})),
|
|
1000
|
-
if (
|
|
1001
|
-
return
|
|
1002
|
-
const
|
|
1003
|
-
return delete
|
|
1021
|
+
})), J = (t, r, a) => {
|
|
1022
|
+
N((s) => ({
|
|
1023
|
+
...s,
|
|
1024
|
+
[t]: a
|
|
1025
|
+
})), a ? le(t, r) : p((s) => {
|
|
1026
|
+
if (s[t] === void 0)
|
|
1027
|
+
return s;
|
|
1028
|
+
const i = { ...s };
|
|
1029
|
+
return delete i[t], i;
|
|
1004
1030
|
});
|
|
1005
|
-
},
|
|
1031
|
+
}, z = async (t) => {
|
|
1006
1032
|
if (!t) return;
|
|
1007
|
-
const r =
|
|
1033
|
+
const r = Pt(t);
|
|
1008
1034
|
if (r.length === 0) return;
|
|
1009
|
-
|
|
1010
|
-
const
|
|
1011
|
-
for (const
|
|
1012
|
-
|
|
1013
|
-
return
|
|
1035
|
+
N((i) => {
|
|
1036
|
+
const w = { ...i };
|
|
1037
|
+
for (const d of r)
|
|
1038
|
+
w[d] = !0;
|
|
1039
|
+
return w;
|
|
1014
1040
|
});
|
|
1015
|
-
let
|
|
1016
|
-
{ name:
|
|
1017
|
-
],
|
|
1018
|
-
for (const
|
|
1019
|
-
const
|
|
1020
|
-
if (!
|
|
1021
|
-
|
|
1041
|
+
let a = [
|
|
1042
|
+
{ name: T, type: "folder" }
|
|
1043
|
+
], s = "";
|
|
1044
|
+
for (const i of r) {
|
|
1045
|
+
const w = a == null ? void 0 : a.find((x) => be(x, s) === i);
|
|
1046
|
+
if (!w || w.type !== "folder") {
|
|
1047
|
+
s = i, a = [];
|
|
1022
1048
|
continue;
|
|
1023
1049
|
}
|
|
1024
|
-
|
|
1050
|
+
a = await le(i, w) ?? ae.current[i], s = i;
|
|
1025
1051
|
}
|
|
1026
|
-
},
|
|
1052
|
+
}, ie = (t, r) => {
|
|
1027
1053
|
if (!t || !r || t === r)
|
|
1028
1054
|
return;
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
let
|
|
1032
|
-
const
|
|
1033
|
-
for (const
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1055
|
+
const a = t === "/" ? "/" : `${t}/`, s = (i) => i === t ? r : i.startsWith(a) ? r + i.slice(t.length) : null;
|
|
1056
|
+
N((i) => {
|
|
1057
|
+
let w = !1;
|
|
1058
|
+
const d = { ...i };
|
|
1059
|
+
for (const x of Object.keys(i)) {
|
|
1060
|
+
const X = s(x);
|
|
1061
|
+
X && X !== x && (d[X] = i[x], delete d[x], w = !0);
|
|
1036
1062
|
}
|
|
1037
|
-
return
|
|
1038
|
-
}),
|
|
1039
|
-
let
|
|
1040
|
-
const
|
|
1041
|
-
for (const
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1063
|
+
return w ? d : i;
|
|
1064
|
+
}), p((i) => {
|
|
1065
|
+
let w = !1;
|
|
1066
|
+
const d = { ...i };
|
|
1067
|
+
for (const x of Object.keys(i)) {
|
|
1068
|
+
const X = s(x);
|
|
1069
|
+
X && X !== x && (d[X] = i[x], delete d[x], w = !0);
|
|
1044
1070
|
}
|
|
1045
|
-
return
|
|
1046
|
-
}),
|
|
1047
|
-
},
|
|
1048
|
-
|
|
1049
|
-
},
|
|
1050
|
-
|
|
1051
|
-
},
|
|
1052
|
-
|
|
1053
|
-
|
|
1071
|
+
return w ? d : i;
|
|
1072
|
+
}), j((i) => i && (s(i) ?? i)), A((i) => i && (s(i) ?? i));
|
|
1073
|
+
}, Ee = () => {
|
|
1074
|
+
G(null), W(null), re();
|
|
1075
|
+
}, ve = (t, r = !0) => {
|
|
1076
|
+
j(t), r && g(t);
|
|
1077
|
+
}, ce = Nt(() => [{ name: T, type: "folder" }], [T]), [U, h] = Q(null), [ge, me] = Q(null), ye = M(null), ke = ge;
|
|
1078
|
+
Wt(
|
|
1079
|
+
V,
|
|
1054
1080
|
() => ({
|
|
1055
1081
|
focusPath: (t, r = {}) => {
|
|
1056
1082
|
if (!t) return;
|
|
1057
1083
|
const {
|
|
1058
|
-
select:
|
|
1059
|
-
domFocus:
|
|
1060
|
-
notify:
|
|
1084
|
+
select: a = !0,
|
|
1085
|
+
domFocus: s = !0,
|
|
1086
|
+
notify: i = !1
|
|
1061
1087
|
} = r;
|
|
1062
|
-
|
|
1088
|
+
a && ve(t, i), A(t), s && oe(t);
|
|
1063
1089
|
},
|
|
1064
1090
|
selectPath: (t) => {
|
|
1065
|
-
t && (
|
|
1091
|
+
t && (ve(t), A(t), oe(t));
|
|
1066
1092
|
},
|
|
1067
|
-
getSelectedPath: () =>
|
|
1068
|
-
expandToPath: async (t) => await
|
|
1069
|
-
refresh: async (t) => await
|
|
1070
|
-
remapPath:
|
|
1093
|
+
getSelectedPath: () => P,
|
|
1094
|
+
expandToPath: async (t) => await z(t),
|
|
1095
|
+
refresh: async (t) => await C(t),
|
|
1096
|
+
remapPath: ie,
|
|
1071
1097
|
createFile: async (t) => {
|
|
1072
|
-
await
|
|
1098
|
+
await Ve(t, "file", "untitled.php");
|
|
1073
1099
|
},
|
|
1074
1100
|
createFolder: async (t) => {
|
|
1075
|
-
await
|
|
1101
|
+
await Ve(t, "folder", "New Folder");
|
|
1076
1102
|
}
|
|
1077
1103
|
}),
|
|
1078
|
-
[
|
|
1104
|
+
[P, C, ie, z]
|
|
1079
1105
|
);
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
),
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
}, [
|
|
1086
|
-
|
|
1087
|
-
}, [
|
|
1088
|
-
if (!
|
|
1106
|
+
const Ne = M(!1), Ae = M(
|
|
1107
|
+
E ?? null
|
|
1108
|
+
), ze = M(E);
|
|
1109
|
+
I(() => {
|
|
1110
|
+
te.current = !1;
|
|
1111
|
+
}, [T]), I(() => {
|
|
1112
|
+
E && E !== ze.current ? Ae.current = E : E || (Ae.current = null), ze.current = E;
|
|
1113
|
+
}, [E]), I(() => {
|
|
1114
|
+
if (!E || Ne.current)
|
|
1089
1115
|
return;
|
|
1090
|
-
|
|
1091
|
-
const t =
|
|
1092
|
-
|
|
1093
|
-
const
|
|
1094
|
-
for (const
|
|
1095
|
-
i
|
|
1096
|
-
return
|
|
1116
|
+
Ne.current = !0;
|
|
1117
|
+
const t = Pt(E);
|
|
1118
|
+
N((a) => {
|
|
1119
|
+
const s = { ...a };
|
|
1120
|
+
for (const i of t)
|
|
1121
|
+
s[i] = !0;
|
|
1122
|
+
return s;
|
|
1097
1123
|
});
|
|
1098
|
-
const r = t[t.length - 1] ||
|
|
1099
|
-
|
|
1100
|
-
}, [
|
|
1101
|
-
const t =
|
|
1102
|
-
!t ||
|
|
1103
|
-
}, [
|
|
1104
|
-
if (!
|
|
1105
|
-
if (
|
|
1106
|
-
const t =
|
|
1107
|
-
|
|
1124
|
+
const r = t[t.length - 1] || E;
|
|
1125
|
+
A(r), j(r), z(E);
|
|
1126
|
+
}, [E, z]), I(() => {
|
|
1127
|
+
const t = Ae.current;
|
|
1128
|
+
!t || ce.length === 0 || (Ae.current = null, z(t));
|
|
1129
|
+
}, [ce, z]), I(() => {
|
|
1130
|
+
if (!Z) {
|
|
1131
|
+
if (ce.length > 0) {
|
|
1132
|
+
const t = be(ce[0]);
|
|
1133
|
+
A(t);
|
|
1108
1134
|
}
|
|
1109
1135
|
return;
|
|
1110
1136
|
}
|
|
1111
|
-
|
|
1112
|
-
}, [
|
|
1113
|
-
if (
|
|
1137
|
+
ke && ke === Z || oe(Z);
|
|
1138
|
+
}, [ce, Z, ke]), I(() => {
|
|
1139
|
+
if (ce.length === 0)
|
|
1114
1140
|
return;
|
|
1115
|
-
const t =
|
|
1116
|
-
if ((t == null ? void 0 : t.type) !== "folder" ||
|
|
1141
|
+
const t = ce[0];
|
|
1142
|
+
if ((t == null ? void 0 : t.type) !== "folder" || te.current)
|
|
1117
1143
|
return;
|
|
1118
1144
|
const r = t.name;
|
|
1119
|
-
|
|
1120
|
-
(
|
|
1121
|
-
), !
|
|
1122
|
-
}, [
|
|
1123
|
-
|
|
1124
|
-
}, []),
|
|
1125
|
-
|
|
1145
|
+
te.current = !0, N(
|
|
1146
|
+
(a) => a[r] ? a : { ...a, [r]: !0 }
|
|
1147
|
+
), !ae.current[r] && !de.current[r] && le(r, t);
|
|
1148
|
+
}, [ce, le, T]), I(() => () => {
|
|
1149
|
+
H.current && clearTimeout(H.current), re();
|
|
1150
|
+
}, []), I(() => {
|
|
1151
|
+
U && setTimeout(() => {
|
|
1126
1152
|
const t = document.querySelector(
|
|
1127
1153
|
'[role="menu"] [role="menuitem"]'
|
|
1128
1154
|
);
|
|
1129
1155
|
t && typeof t.focus == "function" && t.focus();
|
|
1130
1156
|
}, 0);
|
|
1131
|
-
}, [
|
|
1132
|
-
const [
|
|
1157
|
+
}, [U]);
|
|
1158
|
+
const [Me, Ue] = Q(""), ht = (t, r) => {
|
|
1133
1159
|
if (t.type === "folder")
|
|
1134
1160
|
return r;
|
|
1135
|
-
const
|
|
1136
|
-
return
|
|
1137
|
-
},
|
|
1138
|
-
const
|
|
1139
|
-
if (!
|
|
1161
|
+
const a = Oe(r);
|
|
1162
|
+
return a && a || "/";
|
|
1163
|
+
}, Fe = (t, r, a) => {
|
|
1164
|
+
const s = ht(t, r);
|
|
1165
|
+
if (!s)
|
|
1140
1166
|
return { allowed: !1, state: "invalid", destination: null };
|
|
1141
|
-
if (
|
|
1142
|
-
if (
|
|
1167
|
+
if (a) {
|
|
1168
|
+
if (s === a)
|
|
1143
1169
|
return { allowed: !1, state: "invalid", destination: null };
|
|
1144
|
-
if (
|
|
1170
|
+
if (Kr(a, s))
|
|
1145
1171
|
return { allowed: !1, state: "invalid", destination: null };
|
|
1146
1172
|
}
|
|
1147
|
-
return { allowed: !0, state: "valid", destination:
|
|
1148
|
-
},
|
|
1149
|
-
r.type !== "folder" && r.type !== "file" || (
|
|
1173
|
+
return { allowed: !0, state: "valid", destination: s };
|
|
1174
|
+
}, wt = (t, r, a) => {
|
|
1175
|
+
r.type !== "folder" && r.type !== "file" || (G(a), W(null), t.dataTransfer && (t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData(
|
|
1150
1176
|
"application/x-wp-playground-path",
|
|
1151
|
-
|
|
1152
|
-
), t.dataTransfer.setData("text/plain",
|
|
1153
|
-
},
|
|
1154
|
-
|
|
1155
|
-
}, at = (t, r,
|
|
1156
|
-
const
|
|
1157
|
-
|
|
1158
|
-
},
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
},
|
|
1162
|
-
|
|
1163
|
-
const
|
|
1164
|
-
|
|
1165
|
-
},
|
|
1166
|
-
const
|
|
1167
|
-
if (!
|
|
1168
|
-
|
|
1177
|
+
a
|
|
1178
|
+
), t.dataTransfer.setData("text/plain", a)));
|
|
1179
|
+
}, vt = () => {
|
|
1180
|
+
Ee();
|
|
1181
|
+
}, at = (t, r, a) => {
|
|
1182
|
+
const s = Fe(r, a, B);
|
|
1183
|
+
s.allowed && r.type === "folder" && S(a, r), W((i) => (i == null ? void 0 : i.path) === a && i.state === s.state ? i : { path: a, state: s.state });
|
|
1184
|
+
}, ot = (t, r, a) => {
|
|
1185
|
+
const s = Fe(r, a, B);
|
|
1186
|
+
s.allowed && s.destination ? (t.preventDefault(), t.dataTransfer && (t.dataTransfer.dropEffect = B ? "move" : "copy"), r.type === "folder" && S(a, r), W((i) => (i == null ? void 0 : i.path) === a && i.state === s.state ? i : { path: a, state: s.state })) : (t.dataTransfer && (t.dataTransfer.dropEffect = "none"), ue(a), W((i) => (i == null ? void 0 : i.path) === a && i.state === "invalid" ? i : { path: a, state: "invalid" }));
|
|
1187
|
+
}, it = (t, r, a) => {
|
|
1188
|
+
ue(a);
|
|
1189
|
+
const s = t.relatedTarget;
|
|
1190
|
+
s && t.currentTarget.contains(s) || W((i) => (i == null ? void 0 : i.path) === a ? null : i);
|
|
1191
|
+
}, gt = async (t, r, a) => {
|
|
1192
|
+
const s = B, i = Fe(r, a, s);
|
|
1193
|
+
if (!i.allowed || !i.destination) {
|
|
1194
|
+
Ee();
|
|
1169
1195
|
return;
|
|
1170
1196
|
}
|
|
1171
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1197
|
+
t.preventDefault(), t.stopPropagation(), ue(a), W(null);
|
|
1172
1198
|
try {
|
|
1173
|
-
|
|
1199
|
+
s ? await _t(s, i.destination) : await De(t, i.destination);
|
|
1174
1200
|
} finally {
|
|
1175
|
-
|
|
1201
|
+
Ee();
|
|
1176
1202
|
}
|
|
1177
|
-
},
|
|
1178
|
-
t.preventDefault(), t.stopPropagation(),
|
|
1179
|
-
absPath:
|
|
1203
|
+
}, st = (t, r, a) => {
|
|
1204
|
+
u && (t.preventDefault(), t.stopPropagation(), me(null), h({
|
|
1205
|
+
absPath: a,
|
|
1180
1206
|
type: r.type,
|
|
1181
1207
|
x: t.clientX,
|
|
1182
1208
|
y: t.clientY
|
|
1183
|
-
});
|
|
1184
|
-
},
|
|
1185
|
-
let
|
|
1186
|
-
const
|
|
1187
|
-
const
|
|
1188
|
-
return
|
|
1189
|
-
},
|
|
1190
|
-
for (; await (l == null ? void 0 : l.fileExists(`${
|
|
1191
|
-
|
|
1192
|
-
const { stem:
|
|
1193
|
-
|
|
1194
|
-
}
|
|
1195
|
-
return
|
|
1196
|
-
},
|
|
1209
|
+
}));
|
|
1210
|
+
}, Le = async (t, r) => {
|
|
1211
|
+
let a = r, s = 0;
|
|
1212
|
+
const i = (d) => {
|
|
1213
|
+
const x = d.lastIndexOf(".");
|
|
1214
|
+
return x > 0 ? { stem: d.slice(0, x), ext: d.slice(x) } : { stem: d, ext: "" };
|
|
1215
|
+
}, w = t === "/" ? "" : t;
|
|
1216
|
+
for (; await (l == null ? void 0 : l.fileExists(`${w}/${a}`)) || await (l == null ? void 0 : l.isDir(`${w}/${a}`)); ) {
|
|
1217
|
+
s += 1;
|
|
1218
|
+
const { stem: d, ext: x } = i(r);
|
|
1219
|
+
a = `${d} (${s})${x}`;
|
|
1220
|
+
}
|
|
1221
|
+
return a;
|
|
1222
|
+
}, Ve = async (t, r, a) => {
|
|
1197
1223
|
if (!l) return;
|
|
1198
|
-
let
|
|
1224
|
+
let s = t || P || T;
|
|
1199
1225
|
try {
|
|
1200
|
-
await l.isDir(
|
|
1226
|
+
await l.isDir(s) || (s = Oe(s));
|
|
1201
1227
|
} catch {
|
|
1202
|
-
|
|
1228
|
+
s = Oe(s);
|
|
1203
1229
|
}
|
|
1204
|
-
const
|
|
1205
|
-
r === "folder" ? await l.mkdir(
|
|
1206
|
-
|
|
1230
|
+
const i = s, w = await Le(i, a), d = We(i, w);
|
|
1231
|
+
r === "folder" ? await l.mkdir(d) : await l.writeFile(d, ""), ye.current = { type: r, tempPath: d }, me(d), await C(i), setTimeout(() => {
|
|
1232
|
+
A(d), oe(d);
|
|
1207
1233
|
}, 0);
|
|
1208
|
-
},
|
|
1234
|
+
}, Et = async (t) => {
|
|
1209
1235
|
if (!l) return !1;
|
|
1210
1236
|
try {
|
|
1211
1237
|
if (await l.fileExists(t))
|
|
@@ -1218,7 +1244,7 @@ const nr = St(function({
|
|
|
1218
1244
|
} catch {
|
|
1219
1245
|
}
|
|
1220
1246
|
return !1;
|
|
1221
|
-
},
|
|
1247
|
+
}, yt = async (t) => {
|
|
1222
1248
|
if (l)
|
|
1223
1249
|
try {
|
|
1224
1250
|
await l.mkdir(t);
|
|
@@ -1226,242 +1252,250 @@ const nr = St(function({
|
|
|
1226
1252
|
if (!await l.isDir(t).catch(() => !1))
|
|
1227
1253
|
throw r;
|
|
1228
1254
|
}
|
|
1229
|
-
},
|
|
1255
|
+
}, _t = async (t, r) => {
|
|
1230
1256
|
if (!l) return;
|
|
1231
|
-
const
|
|
1232
|
-
if (
|
|
1257
|
+
const a = Ot(t), s = We(r, a);
|
|
1258
|
+
if (s === t || await Et(s))
|
|
1233
1259
|
return;
|
|
1234
|
-
const
|
|
1260
|
+
const i = Oe(t);
|
|
1235
1261
|
try {
|
|
1236
|
-
await l.mv(t,
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1262
|
+
await l.mv(t, s), ie(t, s);
|
|
1263
|
+
const w = kt(
|
|
1264
|
+
P,
|
|
1239
1265
|
t,
|
|
1240
|
-
|
|
1266
|
+
s
|
|
1241
1267
|
);
|
|
1242
|
-
|
|
1243
|
-
(
|
|
1244
|
-
),
|
|
1245
|
-
...
|
|
1268
|
+
P && (P === t || P.startsWith(`${t}/`)) && g(w), A(
|
|
1269
|
+
(d) => kt(d, t, s)
|
|
1270
|
+
), N((d) => ({
|
|
1271
|
+
...d,
|
|
1246
1272
|
[r]: !0
|
|
1247
1273
|
})), await Promise.all([
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
]),
|
|
1251
|
-
(
|
|
1252
|
-
),
|
|
1274
|
+
C(i),
|
|
1275
|
+
C(r)
|
|
1276
|
+
]), j(
|
|
1277
|
+
(d) => kt(d, t, s)
|
|
1278
|
+
), oe(s);
|
|
1253
1279
|
} catch {
|
|
1254
1280
|
}
|
|
1255
|
-
},
|
|
1281
|
+
}, bt = (t) => {
|
|
1256
1282
|
const r = t;
|
|
1257
1283
|
return r.webkitGetAsEntry ? r.webkitGetAsEntry() : null;
|
|
1258
|
-
},
|
|
1259
|
-
t.file(r,
|
|
1260
|
-
}),
|
|
1284
|
+
}, Ct = (t) => new Promise((r, a) => {
|
|
1285
|
+
t.file(r, a);
|
|
1286
|
+
}), lt = async (t, r) => {
|
|
1261
1287
|
if (!l) return;
|
|
1262
|
-
const
|
|
1263
|
-
await l.writeFile(
|
|
1264
|
-
},
|
|
1265
|
-
const
|
|
1266
|
-
await
|
|
1267
|
-
},
|
|
1268
|
-
const
|
|
1288
|
+
const a = t.name || "untitled", s = await Le(r, a), i = We(r, s), w = new Uint8Array(await t.arrayBuffer());
|
|
1289
|
+
await l.writeFile(i, w);
|
|
1290
|
+
}, $e = async (t, r) => {
|
|
1291
|
+
const a = await Ct(t);
|
|
1292
|
+
await lt(a, r);
|
|
1293
|
+
}, Ye = async (t, r) => {
|
|
1294
|
+
const a = await Le(
|
|
1269
1295
|
r,
|
|
1270
1296
|
t.name || "New Folder"
|
|
1271
|
-
),
|
|
1272
|
-
await
|
|
1273
|
-
const
|
|
1274
|
-
|
|
1275
|
-
(
|
|
1276
|
-
|
|
1297
|
+
), s = We(r, a);
|
|
1298
|
+
await yt(s);
|
|
1299
|
+
const i = t.createReader(), w = () => new Promise((d, x) => {
|
|
1300
|
+
i.readEntries(
|
|
1301
|
+
(X) => d(Array.from(X)),
|
|
1302
|
+
x
|
|
1277
1303
|
);
|
|
1278
1304
|
});
|
|
1279
1305
|
for (; ; ) {
|
|
1280
|
-
const
|
|
1281
|
-
if (!
|
|
1306
|
+
const d = await w();
|
|
1307
|
+
if (!d.length)
|
|
1282
1308
|
break;
|
|
1283
|
-
for (const
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
) :
|
|
1288
|
-
|
|
1289
|
-
|
|
1309
|
+
for (const x of d)
|
|
1310
|
+
x.isFile ? await $e(
|
|
1311
|
+
x,
|
|
1312
|
+
s
|
|
1313
|
+
) : x.isDirectory && await Ye(
|
|
1314
|
+
x,
|
|
1315
|
+
s
|
|
1290
1316
|
);
|
|
1291
1317
|
}
|
|
1292
|
-
},
|
|
1293
|
-
var
|
|
1318
|
+
}, De = async (t, r) => {
|
|
1319
|
+
var i, w;
|
|
1294
1320
|
if (!l) return;
|
|
1295
|
-
const
|
|
1296
|
-
if (
|
|
1297
|
-
for (const
|
|
1298
|
-
|
|
1299
|
-
|
|
1321
|
+
const s = ((i = t.dataTransfer) != null && i.items ? Array.from(t.dataTransfer.items) : []).filter((d) => d.kind === "file").map((d) => bt(d)).filter((d) => !!d);
|
|
1322
|
+
if (s.length > 0)
|
|
1323
|
+
for (const d of s)
|
|
1324
|
+
d.isFile ? await $e(
|
|
1325
|
+
d,
|
|
1300
1326
|
r
|
|
1301
|
-
) :
|
|
1302
|
-
|
|
1327
|
+
) : d.isDirectory && await Ye(
|
|
1328
|
+
d,
|
|
1303
1329
|
r
|
|
1304
1330
|
);
|
|
1305
1331
|
else {
|
|
1306
|
-
const
|
|
1307
|
-
for (const
|
|
1308
|
-
await
|
|
1332
|
+
const d = (w = t.dataTransfer) != null && w.files ? Array.from(t.dataTransfer.files) : [];
|
|
1333
|
+
for (const x of d)
|
|
1334
|
+
await lt(x, r);
|
|
1309
1335
|
}
|
|
1310
|
-
await
|
|
1311
|
-
...
|
|
1336
|
+
await C(r), N((d) => ({
|
|
1337
|
+
...d,
|
|
1312
1338
|
[r]: !0
|
|
1313
1339
|
}));
|
|
1314
|
-
},
|
|
1340
|
+
}, Ze = async (t, r) => {
|
|
1315
1341
|
if (!l) return;
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1342
|
+
const a = t;
|
|
1343
|
+
h(null);
|
|
1318
1344
|
try {
|
|
1319
|
-
r === "folder" ? await l.rmdir(
|
|
1345
|
+
r === "folder" ? await l.rmdir(a, { recursive: !0 }) : await l.unlink(a);
|
|
1320
1346
|
} catch {
|
|
1321
1347
|
} finally {
|
|
1322
|
-
|
|
1323
|
-
const
|
|
1324
|
-
await
|
|
1348
|
+
me(null);
|
|
1349
|
+
const s = Oe(a);
|
|
1350
|
+
await C(s), P && (P === a || P.startsWith(`${a}/`)) && g(null);
|
|
1325
1351
|
}
|
|
1326
|
-
},
|
|
1352
|
+
}, Ge = async (t) => {
|
|
1353
|
+
if (l)
|
|
1354
|
+
try {
|
|
1355
|
+
const a = await (await l.read(t)).arrayBuffer(), s = new Blob([a]), i = URL.createObjectURL(s), w = document.createElement("a");
|
|
1356
|
+
w.href = i, w.download = Ot(t) || "download", document.body.appendChild(w), w.click(), document.body.removeChild(w), setTimeout(() => URL.revokeObjectURL(i), 6e4);
|
|
1357
|
+
} catch (r) {
|
|
1358
|
+
console.error("Failed to download file", r);
|
|
1359
|
+
}
|
|
1360
|
+
}, ct = (t) => {
|
|
1327
1361
|
var r;
|
|
1328
|
-
if (!
|
|
1362
|
+
if (!ge)
|
|
1329
1363
|
if (t.key.length === 1 && t.key.match(/\S/)) {
|
|
1330
|
-
const
|
|
1331
|
-
if (
|
|
1332
|
-
|
|
1333
|
-
}, 1e3), !
|
|
1364
|
+
const a = Me + t.key.toLowerCase();
|
|
1365
|
+
if (Ue(a), H.current && clearTimeout(H.current), H.current = setTimeout(() => {
|
|
1366
|
+
Ue("");
|
|
1367
|
+
}, 1e3), !_.current)
|
|
1334
1368
|
return;
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1337
|
-
),
|
|
1338
|
-
let
|
|
1339
|
-
|
|
1340
|
-
|
|
1369
|
+
const s = Array.from(
|
|
1370
|
+
_.current.querySelectorAll(".file-node-button")
|
|
1371
|
+
), i = document.activeElement;
|
|
1372
|
+
let w = 0;
|
|
1373
|
+
i && s.includes(i) && (w = s.indexOf(
|
|
1374
|
+
i
|
|
1341
1375
|
));
|
|
1342
|
-
for (let
|
|
1343
|
-
const
|
|
1344
|
-
if ((r =
|
|
1345
|
-
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1376
|
+
for (let d = 0; d < s.length; d++) {
|
|
1377
|
+
const x = (w + d) % s.length, X = s[x];
|
|
1378
|
+
if ((r = X.textContent) != null && r.toLowerCase().trim().startsWith(a)) {
|
|
1379
|
+
X.focus();
|
|
1380
|
+
const Se = X.getAttribute("data-path");
|
|
1381
|
+
Se && A(Se);
|
|
1348
1382
|
break;
|
|
1349
1383
|
}
|
|
1350
1384
|
}
|
|
1351
1385
|
} else
|
|
1352
|
-
|
|
1353
|
-
},
|
|
1354
|
-
const
|
|
1355
|
-
if (!
|
|
1356
|
-
if (
|
|
1386
|
+
Ue(""), H.current && clearTimeout(H.current);
|
|
1387
|
+
}, xt = async (t, r) => {
|
|
1388
|
+
const a = ye.current, s = (a == null ? void 0 : a.tempPath) === t, i = Oe(t), w = (r || "").trim();
|
|
1389
|
+
if (!y(w)) {
|
|
1390
|
+
if (s) {
|
|
1357
1391
|
try {
|
|
1358
|
-
|
|
1392
|
+
a.type === "folder" ? await l.rmdir(t, {
|
|
1359
1393
|
recursive: !0
|
|
1360
1394
|
}) : await l.unlink(t);
|
|
1361
1395
|
} catch {
|
|
1362
1396
|
}
|
|
1363
|
-
|
|
1397
|
+
ye.current = null;
|
|
1364
1398
|
}
|
|
1365
|
-
|
|
1399
|
+
me(s ? null : t);
|
|
1366
1400
|
return;
|
|
1367
1401
|
}
|
|
1368
|
-
let
|
|
1369
|
-
if (
|
|
1370
|
-
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
|
|
1402
|
+
let d = We(i, w), x = d;
|
|
1403
|
+
if (x === t) {
|
|
1404
|
+
me(null);
|
|
1405
|
+
const e = s && (a == null ? void 0 : a.type) === "file";
|
|
1406
|
+
s && (ye.current = null), setTimeout(() => {
|
|
1407
|
+
A(x), oe(x), e && k && k(x);
|
|
1374
1408
|
}, 0);
|
|
1375
1409
|
return;
|
|
1376
1410
|
}
|
|
1377
|
-
const
|
|
1378
|
-
if ((
|
|
1379
|
-
if (
|
|
1411
|
+
const X = await l.fileExists(x), Se = await l.isDir(x);
|
|
1412
|
+
if ((X || Se) && x !== t)
|
|
1413
|
+
if (s)
|
|
1380
1414
|
try {
|
|
1381
|
-
const
|
|
1382
|
-
|
|
1383
|
-
|
|
1415
|
+
const e = await Le(
|
|
1416
|
+
i === "/" ? "/" : i,
|
|
1417
|
+
w
|
|
1384
1418
|
);
|
|
1385
|
-
|
|
1419
|
+
d = We(i, e), x = d;
|
|
1386
1420
|
} catch {
|
|
1387
1421
|
}
|
|
1388
1422
|
else {
|
|
1389
|
-
|
|
1423
|
+
me(t);
|
|
1390
1424
|
return;
|
|
1391
1425
|
}
|
|
1392
|
-
let
|
|
1426
|
+
let Ke = (a == null ? void 0 : a.type) === "folder";
|
|
1393
1427
|
try {
|
|
1394
|
-
await l.mv(t,
|
|
1428
|
+
await l.mv(t, d), a || (Ke = await l.isDir(d)), Ke && ie(t, x), P === t && g(x), await C(i), A(x), oe(x), s && !Ke && k && k(x);
|
|
1395
1429
|
} catch {
|
|
1396
|
-
if (
|
|
1430
|
+
if (s)
|
|
1397
1431
|
try {
|
|
1398
|
-
(
|
|
1432
|
+
(a == null ? void 0 : a.type) === "folder" ? await l.rmdir(t, {
|
|
1399
1433
|
recursive: !0
|
|
1400
1434
|
}) : await l.unlink(t);
|
|
1401
1435
|
} catch {
|
|
1402
1436
|
}
|
|
1403
1437
|
} finally {
|
|
1404
|
-
|
|
1438
|
+
ye.current = null, me(null);
|
|
1405
1439
|
}
|
|
1406
|
-
},
|
|
1407
|
-
const r =
|
|
1440
|
+
}, ut = async (t) => {
|
|
1441
|
+
const r = ye.current;
|
|
1408
1442
|
if (!l || (r == null ? void 0 : r.tempPath) !== t) {
|
|
1409
|
-
|
|
1443
|
+
me((s) => s === t ? null : s);
|
|
1410
1444
|
return;
|
|
1411
1445
|
}
|
|
1412
1446
|
try {
|
|
1413
1447
|
r.type === "folder" ? await l.rmdir(t, { recursive: !0 }) : await l.unlink(t);
|
|
1414
1448
|
} catch {
|
|
1415
1449
|
}
|
|
1416
|
-
|
|
1417
|
-
const
|
|
1418
|
-
await
|
|
1450
|
+
ye.current = null, me(null);
|
|
1451
|
+
const a = Oe(t);
|
|
1452
|
+
await C(a), A(a), oe(a);
|
|
1419
1453
|
};
|
|
1420
|
-
return /* @__PURE__ */
|
|
1421
|
-
|
|
1454
|
+
return /* @__PURE__ */ o.createElement("div", { onKeyDown: ct, ref: _ }, /* @__PURE__ */ o.createElement(Kt, { className: we.filePickerTree }, ce.map((t, r) => /* @__PURE__ */ o.createElement(
|
|
1455
|
+
zt,
|
|
1422
1456
|
{
|
|
1423
1457
|
key: t.name,
|
|
1424
1458
|
node: t,
|
|
1425
1459
|
level: 0,
|
|
1426
1460
|
position: r + 1,
|
|
1427
|
-
setSize:
|
|
1428
|
-
expandedNodePaths:
|
|
1429
|
-
onToggle:
|
|
1430
|
-
selectedNode:
|
|
1431
|
-
focusPath: (
|
|
1432
|
-
focusedNode:
|
|
1433
|
-
selectPath:
|
|
1434
|
-
generatePath:
|
|
1435
|
-
getChildren:
|
|
1436
|
-
onContextMenu:
|
|
1437
|
-
renamingPath:
|
|
1438
|
-
onRename:
|
|
1439
|
-
onRenameCancel:
|
|
1440
|
-
dropIndicator:
|
|
1441
|
-
onDragStart:
|
|
1442
|
-
onDragEnd:
|
|
1461
|
+
setSize: ce.length,
|
|
1462
|
+
expandedNodePaths: v,
|
|
1463
|
+
onToggle: J,
|
|
1464
|
+
selectedNode: P,
|
|
1465
|
+
focusPath: (a) => A(a),
|
|
1466
|
+
focusedNode: Z,
|
|
1467
|
+
selectPath: ve,
|
|
1468
|
+
generatePath: be,
|
|
1469
|
+
getChildren: Re,
|
|
1470
|
+
onContextMenu: st,
|
|
1471
|
+
renamingPath: ke,
|
|
1472
|
+
onRename: xt,
|
|
1473
|
+
onRenameCancel: ut,
|
|
1474
|
+
dropIndicator: ee,
|
|
1475
|
+
onDragStart: wt,
|
|
1476
|
+
onDragEnd: vt,
|
|
1443
1477
|
onDragEnter: at,
|
|
1444
|
-
onDragOver:
|
|
1445
|
-
onDragLeave:
|
|
1446
|
-
onDrop:
|
|
1447
|
-
rootPath:
|
|
1448
|
-
onDoubleClickFile:
|
|
1449
|
-
}
|
|
1450
|
-
))),
|
|
1451
|
-
|
|
1478
|
+
onDragOver: ot,
|
|
1479
|
+
onDragLeave: it,
|
|
1480
|
+
onDrop: gt,
|
|
1481
|
+
rootPath: T,
|
|
1482
|
+
onDoubleClickFile: k
|
|
1483
|
+
}
|
|
1484
|
+
))), U && /* @__PURE__ */ o.createElement(
|
|
1485
|
+
qt,
|
|
1452
1486
|
{
|
|
1453
1487
|
placement: "bottom-start",
|
|
1454
|
-
onClose: () =>
|
|
1488
|
+
onClose: () => h(null),
|
|
1455
1489
|
anchor: {
|
|
1456
1490
|
getBoundingClientRect: () => ({
|
|
1457
|
-
x:
|
|
1458
|
-
y:
|
|
1491
|
+
x: U.x,
|
|
1492
|
+
y: U.y,
|
|
1459
1493
|
width: 0,
|
|
1460
1494
|
height: 0,
|
|
1461
|
-
top:
|
|
1462
|
-
left:
|
|
1463
|
-
right:
|
|
1464
|
-
bottom:
|
|
1495
|
+
top: U.y,
|
|
1496
|
+
left: U.x,
|
|
1497
|
+
right: U.x,
|
|
1498
|
+
bottom: U.y,
|
|
1465
1499
|
toJSON: () => ({})
|
|
1466
1500
|
}),
|
|
1467
1501
|
ownerDocument: document
|
|
@@ -1470,344 +1504,1042 @@ const nr = St(function({
|
|
|
1470
1504
|
resize: !1,
|
|
1471
1505
|
focusOnMount: "firstElement"
|
|
1472
1506
|
},
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
|
|
1507
|
+
/* @__PURE__ */ o.createElement(Jt, { role: "menu" }, U.type === "folder" && /* @__PURE__ */ o.createElement(
|
|
1508
|
+
qe,
|
|
1475
1509
|
{
|
|
1476
1510
|
role: "menuitem",
|
|
1477
1511
|
onClick: async () => {
|
|
1478
|
-
|
|
1479
|
-
|
|
1512
|
+
h(null), await Ve(
|
|
1513
|
+
U.absPath,
|
|
1480
1514
|
"file",
|
|
1481
1515
|
"untitled.php"
|
|
1482
1516
|
);
|
|
1483
1517
|
}
|
|
1484
1518
|
},
|
|
1485
1519
|
"Create file"
|
|
1486
|
-
),
|
|
1487
|
-
|
|
1520
|
+
), U.type === "folder" && /* @__PURE__ */ o.createElement(
|
|
1521
|
+
qe,
|
|
1488
1522
|
{
|
|
1489
1523
|
role: "menuitem",
|
|
1490
1524
|
onClick: async () => {
|
|
1491
|
-
|
|
1492
|
-
|
|
1525
|
+
h(null), await Ve(
|
|
1526
|
+
U.absPath,
|
|
1493
1527
|
"folder",
|
|
1494
1528
|
"New Folder"
|
|
1495
1529
|
);
|
|
1496
1530
|
}
|
|
1497
1531
|
},
|
|
1498
1532
|
"Create directory"
|
|
1499
|
-
), /* @__PURE__ */
|
|
1500
|
-
|
|
1533
|
+
), /* @__PURE__ */ o.createElement(
|
|
1534
|
+
qe,
|
|
1501
1535
|
{
|
|
1502
1536
|
role: "menuitem",
|
|
1503
1537
|
onClick: () => {
|
|
1504
|
-
|
|
1538
|
+
h(null), me(U.absPath);
|
|
1505
1539
|
}
|
|
1506
1540
|
},
|
|
1507
1541
|
"Rename"
|
|
1508
|
-
), /* @__PURE__ */
|
|
1509
|
-
|
|
1542
|
+
), U.type === "file" && /* @__PURE__ */ o.createElement(
|
|
1543
|
+
qe,
|
|
1544
|
+
{
|
|
1545
|
+
role: "menuitem",
|
|
1546
|
+
onClick: async () => {
|
|
1547
|
+
h(null), await Ge(
|
|
1548
|
+
U.absPath
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1551
|
+
},
|
|
1552
|
+
"Download"
|
|
1553
|
+
), /* @__PURE__ */ o.createElement(
|
|
1554
|
+
qe,
|
|
1510
1555
|
{
|
|
1511
1556
|
role: "menuitem",
|
|
1512
|
-
onClick: () =>
|
|
1513
|
-
|
|
1514
|
-
|
|
1557
|
+
onClick: () => Ze(
|
|
1558
|
+
U.absPath,
|
|
1559
|
+
U.type
|
|
1515
1560
|
)
|
|
1516
1561
|
},
|
|
1517
1562
|
"Delete"
|
|
1518
1563
|
))
|
|
1519
1564
|
));
|
|
1520
|
-
}),
|
|
1521
|
-
node:
|
|
1522
|
-
level:
|
|
1523
|
-
position:
|
|
1524
|
-
setSize:
|
|
1525
|
-
expandedNodePaths:
|
|
1526
|
-
onToggle:
|
|
1527
|
-
selectedNode:
|
|
1528
|
-
focusPath:
|
|
1529
|
-
focusedNode:
|
|
1530
|
-
selectPath:
|
|
1531
|
-
generatePath:
|
|
1532
|
-
getChildren:
|
|
1533
|
-
onContextMenu:
|
|
1534
|
-
renamingPath:
|
|
1535
|
-
onRename:
|
|
1536
|
-
onRenameCancel:
|
|
1537
|
-
parentPath:
|
|
1538
|
-
dropIndicator:
|
|
1539
|
-
onDragStart:
|
|
1540
|
-
onDragEnd:
|
|
1541
|
-
onDragEnter:
|
|
1542
|
-
onDragOver:
|
|
1543
|
-
onDragLeave:
|
|
1544
|
-
onDrop:
|
|
1545
|
-
rootPath:
|
|
1546
|
-
onDoubleClickFile:
|
|
1565
|
+
}), zt = ({
|
|
1566
|
+
node: n,
|
|
1567
|
+
level: u,
|
|
1568
|
+
position: l,
|
|
1569
|
+
setSize: m,
|
|
1570
|
+
expandedNodePaths: E,
|
|
1571
|
+
onToggle: g,
|
|
1572
|
+
selectedNode: k,
|
|
1573
|
+
focusPath: V,
|
|
1574
|
+
focusedNode: T,
|
|
1575
|
+
selectPath: y,
|
|
1576
|
+
generatePath: v,
|
|
1577
|
+
getChildren: N,
|
|
1578
|
+
onContextMenu: P,
|
|
1579
|
+
renamingPath: j,
|
|
1580
|
+
onRename: Z,
|
|
1581
|
+
onRenameCancel: A,
|
|
1582
|
+
parentPath: D = "",
|
|
1583
|
+
dropIndicator: p,
|
|
1584
|
+
onDragStart: b,
|
|
1585
|
+
onDragEnd: q,
|
|
1586
|
+
onDragEnter: B,
|
|
1587
|
+
onDragOver: G,
|
|
1588
|
+
onDragLeave: ee,
|
|
1589
|
+
onDrop: W,
|
|
1590
|
+
rootPath: F,
|
|
1591
|
+
onDoubleClickFile: te
|
|
1547
1592
|
}) => {
|
|
1548
|
-
const
|
|
1549
|
-
onDragEnter: (
|
|
1550
|
-
onDragOver: (
|
|
1551
|
-
onDragLeave: (
|
|
1552
|
-
onDrop: (
|
|
1553
|
-
},
|
|
1554
|
-
|
|
1555
|
-
var
|
|
1556
|
-
|
|
1557
|
-
var
|
|
1558
|
-
(
|
|
1559
|
-
}) : (
|
|
1560
|
-
}, [
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1563
|
-
},
|
|
1564
|
-
var
|
|
1565
|
-
if (
|
|
1566
|
-
H ?
|
|
1567
|
-
`[data-path="${
|
|
1568
|
-
)) == null ||
|
|
1569
|
-
else if (
|
|
1593
|
+
const _ = v(n, D), H = E[_], de = j === _, ae = M(null), [re, ue] = Q(n.name), oe = M(!1), be = (p == null ? void 0 : p.path) === _, Re = be && (p == null ? void 0 : p.state) === "valid", Te = be && (p == null ? void 0 : p.state) === "invalid", Pe = !de && _ !== F, le = M(null), S = {
|
|
1594
|
+
onDragEnter: (h) => B == null ? void 0 : B(h, n, _),
|
|
1595
|
+
onDragOver: (h) => G == null ? void 0 : G(h, n, _),
|
|
1596
|
+
onDragLeave: (h) => ee == null ? void 0 : ee(h, n, _),
|
|
1597
|
+
onDrop: (h) => W == null ? void 0 : W(h, n, _)
|
|
1598
|
+
}, C = N(n, _) ?? [];
|
|
1599
|
+
I(() => {
|
|
1600
|
+
var h;
|
|
1601
|
+
de ? (ue(n.name), oe.current = !1, typeof window < "u" && requestAnimationFrame ? requestAnimationFrame(() => {
|
|
1602
|
+
var ge;
|
|
1603
|
+
(ge = ae.current) == null || ge.select();
|
|
1604
|
+
}) : (h = ae.current) == null || h.select()) : oe.current = !1;
|
|
1605
|
+
}, [de, n.name]);
|
|
1606
|
+
const J = () => {
|
|
1607
|
+
n.type === "folder" && g(_, n, !H);
|
|
1608
|
+
}, z = (h) => {
|
|
1609
|
+
var ge, me;
|
|
1610
|
+
if (h.key === "ArrowLeft")
|
|
1611
|
+
H ? J() : (ge = document.querySelector(
|
|
1612
|
+
`[data-path="${D}"]`
|
|
1613
|
+
)) == null || ge.focus(), h.preventDefault(), h.stopPropagation();
|
|
1614
|
+
else if (h.key === "ArrowRight") {
|
|
1570
1615
|
if (H) {
|
|
1571
|
-
if (
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1574
|
-
|
|
1616
|
+
if (C != null && C.length) {
|
|
1617
|
+
const ye = v(
|
|
1618
|
+
C[0],
|
|
1619
|
+
_
|
|
1575
1620
|
);
|
|
1576
|
-
(
|
|
1577
|
-
`[data-path="${
|
|
1578
|
-
)) == null ||
|
|
1621
|
+
(me = document.querySelector(
|
|
1622
|
+
`[data-path="${ye}"]`
|
|
1623
|
+
)) == null || me.focus();
|
|
1579
1624
|
}
|
|
1580
1625
|
} else
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
} else
|
|
1584
|
-
},
|
|
1585
|
-
|
|
1586
|
-
},
|
|
1587
|
-
|
|
1588
|
-
},
|
|
1589
|
-
if (
|
|
1590
|
-
|
|
1626
|
+
J();
|
|
1627
|
+
h.preventDefault(), h.stopPropagation();
|
|
1628
|
+
} else h.key === " " || h.key === "Space" || h.key === "Spacebar" ? (n.type === "folder" && g(_, n, !H), h.preventDefault()) : h.key === "Enter" && (n.type === "folder" ? g(_, n, !H) : (y(_, !1), V(_), te ? te(_) : y(_, !0)), h.preventDefault());
|
|
1629
|
+
}, ie = (h) => {
|
|
1630
|
+
P == null || P(h, n, _);
|
|
1631
|
+
}, Ee = (h) => {
|
|
1632
|
+
h.preventDefault(), oe.current = !0, Z == null || Z(_, re.trim());
|
|
1633
|
+
}, ve = (h) => {
|
|
1634
|
+
if (h.key === "Escape") {
|
|
1635
|
+
h.preventDefault(), h.stopPropagation(), oe.current = !0, A == null || A(_);
|
|
1591
1636
|
return;
|
|
1592
1637
|
}
|
|
1593
|
-
(
|
|
1594
|
-
},
|
|
1595
|
-
|
|
1596
|
-
},
|
|
1597
|
-
if (
|
|
1598
|
-
|
|
1638
|
+
(h.key === "ArrowLeft" || h.key === "ArrowRight" || h.key === "ArrowUp" || h.key === "ArrowDown") && h.stopPropagation();
|
|
1639
|
+
}, ce = () => {
|
|
1640
|
+
oe.current || A == null || A(_), oe.current = !1;
|
|
1641
|
+
}, U = () => {
|
|
1642
|
+
if (n.type === "folder") {
|
|
1643
|
+
J(), y(_), V(_);
|
|
1599
1644
|
return;
|
|
1600
1645
|
}
|
|
1601
|
-
const
|
|
1602
|
-
if (
|
|
1603
|
-
|
|
1646
|
+
const h = le.current !== null;
|
|
1647
|
+
if (h && le.current && clearTimeout(le.current), le.current = null, h) {
|
|
1648
|
+
te ? te(_) : y(_, !0);
|
|
1604
1649
|
return;
|
|
1605
1650
|
}
|
|
1606
|
-
|
|
1607
|
-
|
|
1651
|
+
y(_, !1), V(_), y(_, !0), le.current = window.setTimeout(() => {
|
|
1652
|
+
le.current = null;
|
|
1608
1653
|
}, 300);
|
|
1609
1654
|
};
|
|
1610
|
-
return
|
|
1611
|
-
|
|
1612
|
-
}, []), /* @__PURE__ */
|
|
1613
|
-
|
|
1655
|
+
return I(() => () => {
|
|
1656
|
+
le.current !== null && typeof window < "u" && clearTimeout(le.current);
|
|
1657
|
+
}, []), /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
1658
|
+
Xt,
|
|
1614
1659
|
{
|
|
1615
|
-
level:
|
|
1616
|
-
positionInSet:
|
|
1617
|
-
setSize:
|
|
1660
|
+
level: u,
|
|
1661
|
+
positionInSet: l,
|
|
1662
|
+
setSize: m
|
|
1618
1663
|
},
|
|
1619
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ o.createElement(Qt, null, () => /* @__PURE__ */ o.createElement(o.Fragment, null, de ? /* @__PURE__ */ o.createElement(
|
|
1620
1665
|
"form",
|
|
1621
1666
|
{
|
|
1622
|
-
onSubmit:
|
|
1623
|
-
className:
|
|
1624
|
-
|
|
1625
|
-
|
|
1667
|
+
onSubmit: Ee,
|
|
1668
|
+
className: et(
|
|
1669
|
+
we.fileNodeButton,
|
|
1670
|
+
we.renaming,
|
|
1626
1671
|
"file-node-button",
|
|
1627
1672
|
{
|
|
1628
|
-
[
|
|
1629
|
-
[
|
|
1630
|
-
[
|
|
1631
|
-
[
|
|
1673
|
+
[we.selected]: k === _,
|
|
1674
|
+
[we.focused]: T === _,
|
|
1675
|
+
[we.dropTarget]: Re,
|
|
1676
|
+
[we.dropTargetInvalid]: Te
|
|
1632
1677
|
}
|
|
1633
1678
|
),
|
|
1634
|
-
"data-path":
|
|
1635
|
-
onContextMenu:
|
|
1636
|
-
...
|
|
1679
|
+
"data-path": _,
|
|
1680
|
+
onContextMenu: ie,
|
|
1681
|
+
...S
|
|
1637
1682
|
},
|
|
1638
|
-
/* @__PURE__ */
|
|
1639
|
-
|
|
1683
|
+
/* @__PURE__ */ o.createElement(
|
|
1684
|
+
Vt,
|
|
1640
1685
|
{
|
|
1641
|
-
node:
|
|
1642
|
-
isOpen:
|
|
1643
|
-
level:
|
|
1686
|
+
node: n,
|
|
1687
|
+
isOpen: n.type === "folder" && H,
|
|
1688
|
+
level: u,
|
|
1644
1689
|
hideName: !0
|
|
1645
1690
|
}
|
|
1646
1691
|
),
|
|
1647
|
-
/* @__PURE__ */
|
|
1692
|
+
/* @__PURE__ */ o.createElement(
|
|
1648
1693
|
"input",
|
|
1649
1694
|
{
|
|
1650
|
-
ref:
|
|
1651
|
-
className:
|
|
1652
|
-
value:
|
|
1653
|
-
onChange: (
|
|
1654
|
-
onBlur:
|
|
1655
|
-
onFocus: () =>
|
|
1656
|
-
onKeyDown:
|
|
1695
|
+
ref: ae,
|
|
1696
|
+
className: we.renameInput,
|
|
1697
|
+
value: re,
|
|
1698
|
+
onChange: (h) => ue(h.target.value),
|
|
1699
|
+
onBlur: ce,
|
|
1700
|
+
onFocus: () => V(_),
|
|
1701
|
+
onKeyDown: ve
|
|
1657
1702
|
}
|
|
1658
1703
|
)
|
|
1659
|
-
) : /* @__PURE__ */
|
|
1660
|
-
|
|
1704
|
+
) : /* @__PURE__ */ o.createElement(
|
|
1705
|
+
mt,
|
|
1661
1706
|
{
|
|
1662
|
-
...
|
|
1663
|
-
draggable:
|
|
1664
|
-
onDragStart: (
|
|
1665
|
-
onDragEnd: (
|
|
1666
|
-
onClick:
|
|
1667
|
-
onKeyDown:
|
|
1707
|
+
...S,
|
|
1708
|
+
draggable: Pe,
|
|
1709
|
+
onDragStart: (h) => b == null ? void 0 : b(h, n, _),
|
|
1710
|
+
onDragEnd: (h) => q == null ? void 0 : q(h, n, _),
|
|
1711
|
+
onClick: U,
|
|
1712
|
+
onKeyDown: z,
|
|
1668
1713
|
onFocus: () => {
|
|
1669
|
-
|
|
1714
|
+
V(_);
|
|
1670
1715
|
},
|
|
1671
|
-
onContextMenu:
|
|
1672
|
-
className:
|
|
1673
|
-
|
|
1716
|
+
onContextMenu: ie,
|
|
1717
|
+
className: et(
|
|
1718
|
+
we.fileNodeButton,
|
|
1674
1719
|
"file-node-button",
|
|
1675
1720
|
{
|
|
1676
|
-
[
|
|
1677
|
-
[
|
|
1678
|
-
[
|
|
1679
|
-
[
|
|
1721
|
+
[we.selected]: k === _,
|
|
1722
|
+
[we.focused]: T === _,
|
|
1723
|
+
[we.dropTarget]: Re,
|
|
1724
|
+
[we.dropTargetInvalid]: Te
|
|
1680
1725
|
}
|
|
1681
1726
|
),
|
|
1682
|
-
"data-path":
|
|
1727
|
+
"data-path": _,
|
|
1683
1728
|
"data-expanded": H ? "true" : "false"
|
|
1684
1729
|
},
|
|
1685
|
-
/* @__PURE__ */
|
|
1686
|
-
|
|
1730
|
+
/* @__PURE__ */ o.createElement(
|
|
1731
|
+
Vt,
|
|
1687
1732
|
{
|
|
1688
|
-
node:
|
|
1689
|
-
isOpen:
|
|
1690
|
-
level:
|
|
1733
|
+
node: n,
|
|
1734
|
+
isOpen: n.type === "folder" && H,
|
|
1735
|
+
level: u
|
|
1691
1736
|
}
|
|
1692
1737
|
)
|
|
1693
1738
|
)))
|
|
1694
|
-
), H &&
|
|
1695
|
-
|
|
1739
|
+
), H && C && C.map((h, ge) => /* @__PURE__ */ o.createElement(
|
|
1740
|
+
zt,
|
|
1696
1741
|
{
|
|
1697
|
-
key:
|
|
1698
|
-
node:
|
|
1699
|
-
level:
|
|
1700
|
-
position:
|
|
1701
|
-
setSize:
|
|
1702
|
-
expandedNodePaths:
|
|
1703
|
-
onToggle:
|
|
1704
|
-
selectedNode:
|
|
1705
|
-
focusPath:
|
|
1706
|
-
focusedNode:
|
|
1707
|
-
selectPath:
|
|
1708
|
-
generatePath:
|
|
1709
|
-
getChildren:
|
|
1710
|
-
onContextMenu:
|
|
1711
|
-
renamingPath:
|
|
1712
|
-
onRename:
|
|
1713
|
-
onRenameCancel:
|
|
1714
|
-
parentPath:
|
|
1715
|
-
dropIndicator:
|
|
1716
|
-
onDragStart:
|
|
1717
|
-
onDragEnd:
|
|
1718
|
-
onDragEnter:
|
|
1719
|
-
onDragOver:
|
|
1720
|
-
onDragLeave:
|
|
1721
|
-
onDrop:
|
|
1722
|
-
rootPath:
|
|
1723
|
-
onDoubleClickFile:
|
|
1742
|
+
key: h.name,
|
|
1743
|
+
node: h,
|
|
1744
|
+
level: u + 1,
|
|
1745
|
+
position: ge + 1,
|
|
1746
|
+
setSize: C.length,
|
|
1747
|
+
expandedNodePaths: E,
|
|
1748
|
+
onToggle: g,
|
|
1749
|
+
selectedNode: k,
|
|
1750
|
+
focusPath: V,
|
|
1751
|
+
focusedNode: T,
|
|
1752
|
+
selectPath: y,
|
|
1753
|
+
generatePath: v,
|
|
1754
|
+
getChildren: N,
|
|
1755
|
+
onContextMenu: P,
|
|
1756
|
+
renamingPath: j,
|
|
1757
|
+
onRename: Z,
|
|
1758
|
+
onRenameCancel: A,
|
|
1759
|
+
parentPath: _,
|
|
1760
|
+
dropIndicator: p,
|
|
1761
|
+
onDragStart: b,
|
|
1762
|
+
onDragEnd: q,
|
|
1763
|
+
onDragEnter: B,
|
|
1764
|
+
onDragOver: G,
|
|
1765
|
+
onDragLeave: ee,
|
|
1766
|
+
onDrop: W,
|
|
1767
|
+
rootPath: F,
|
|
1768
|
+
onDoubleClickFile: te
|
|
1724
1769
|
}
|
|
1725
1770
|
)));
|
|
1726
|
-
},
|
|
1727
|
-
const
|
|
1728
|
-
for (let
|
|
1729
|
-
|
|
1730
|
-
return /* @__PURE__ */
|
|
1771
|
+
}, Vt = ({ node: n, level: u, isOpen: l, hideName: m = !1 }) => {
|
|
1772
|
+
const E = [];
|
|
1773
|
+
for (let g = 0; g < u; g++)
|
|
1774
|
+
E.push(" ");
|
|
1775
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
1731
1776
|
"span",
|
|
1732
1777
|
{
|
|
1733
1778
|
"aria-hidden": "true",
|
|
1734
|
-
dangerouslySetInnerHTML: { __html:
|
|
1735
|
-
}
|
|
1736
|
-
),
|
|
1737
|
-
},
|
|
1738
|
-
control:
|
|
1739
|
-
browseLabel:
|
|
1740
|
-
pathPreview:
|
|
1741
|
-
modal:
|
|
1742
|
-
modalFooter:
|
|
1779
|
+
dangerouslySetInnerHTML: { __html: E.join("") }
|
|
1780
|
+
}
|
|
1781
|
+
), n.type === "folder" ? /* @__PURE__ */ o.createElement(jt, { width: 16, icon: l ? jr : Ir }) : /* @__PURE__ */ o.createElement("div", { style: { width: 16 } }, " "), /* @__PURE__ */ o.createElement(jt, { width: 16, icon: n.type === "folder" ? Or : Ar }), !m && /* @__PURE__ */ o.createElement("span", { className: we.fileName }, n.name));
|
|
1782
|
+
}, Jr = "_control_kp9d9_1", Xr = "_browse-label_kp9d9_11", Qr = "_path-preview_kp9d9_37", en = "_modal_kp9d9_43", tn = "_modal-footer_kp9d9_48", He = {
|
|
1783
|
+
control: Jr,
|
|
1784
|
+
browseLabel: Xr,
|
|
1785
|
+
pathPreview: Qr,
|
|
1786
|
+
modal: en,
|
|
1787
|
+
modalFooter: tn
|
|
1743
1788
|
};
|
|
1744
|
-
function
|
|
1745
|
-
if (!
|
|
1746
|
-
return /* @__PURE__ */
|
|
1747
|
-
const
|
|
1748
|
-
let
|
|
1749
|
-
|
|
1750
|
-
const
|
|
1789
|
+
function rn({ path: n }) {
|
|
1790
|
+
if (!n)
|
|
1791
|
+
return /* @__PURE__ */ o.createElement("div", { className: He.pathPreview }, /* @__PURE__ */ o.createElement("i", null, "Select a path"));
|
|
1792
|
+
const u = n.split("/");
|
|
1793
|
+
let l = (u.length > 2 ? "/" : "") + u.pop();
|
|
1794
|
+
l.length > 10 && (l = l.substring(l.length - 10));
|
|
1795
|
+
const m = n.substring(
|
|
1751
1796
|
0,
|
|
1752
|
-
|
|
1797
|
+
n.length - l.length
|
|
1753
1798
|
);
|
|
1754
|
-
return /* @__PURE__ */
|
|
1799
|
+
return /* @__PURE__ */ o.createElement(
|
|
1755
1800
|
"div",
|
|
1756
1801
|
{
|
|
1757
|
-
className:
|
|
1758
|
-
"data-content-start":
|
|
1759
|
-
"data-content-end":
|
|
1802
|
+
className: He.pathPreview,
|
|
1803
|
+
"data-content-start": m,
|
|
1804
|
+
"data-content-end": l
|
|
1760
1805
|
}
|
|
1761
1806
|
);
|
|
1762
1807
|
}
|
|
1763
|
-
function
|
|
1764
|
-
value:
|
|
1765
|
-
onChange:
|
|
1766
|
-
filesystem:
|
|
1808
|
+
function ga({
|
|
1809
|
+
value: n = "",
|
|
1810
|
+
onChange: u,
|
|
1811
|
+
filesystem: l
|
|
1767
1812
|
}) {
|
|
1768
|
-
const [
|
|
1769
|
-
|
|
1813
|
+
const [m, E] = Q(!1), g = () => E(!0), k = () => E(!1), [V, T] = Q(
|
|
1814
|
+
n || null
|
|
1770
1815
|
);
|
|
1771
|
-
function
|
|
1772
|
-
|
|
1816
|
+
function y(v) {
|
|
1817
|
+
v == null || v.preventDefault(), u(V || ""), k();
|
|
1773
1818
|
}
|
|
1774
|
-
return /* @__PURE__ */
|
|
1775
|
-
|
|
1819
|
+
return /* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement(
|
|
1820
|
+
mt,
|
|
1776
1821
|
{
|
|
1777
1822
|
variant: "tertiary",
|
|
1778
|
-
className:
|
|
1779
|
-
onClick:
|
|
1823
|
+
className: He.control,
|
|
1824
|
+
onClick: g
|
|
1780
1825
|
},
|
|
1781
|
-
/* @__PURE__ */
|
|
1782
|
-
/* @__PURE__ */
|
|
1783
|
-
),
|
|
1784
|
-
|
|
1826
|
+
/* @__PURE__ */ o.createElement("span", { className: He.browseLabel }, "Browse"),
|
|
1827
|
+
/* @__PURE__ */ o.createElement(rn, { path: n || "" })
|
|
1828
|
+
), m && /* @__PURE__ */ o.createElement(
|
|
1829
|
+
er,
|
|
1785
1830
|
{
|
|
1786
1831
|
title: "Select a path ",
|
|
1787
|
-
onRequestClose:
|
|
1788
|
-
className:
|
|
1832
|
+
onRequestClose: k,
|
|
1833
|
+
className: He.modal
|
|
1789
1834
|
},
|
|
1790
|
-
/* @__PURE__ */
|
|
1791
|
-
|
|
1835
|
+
/* @__PURE__ */ o.createElement("form", { onSubmit: y }, /* @__PURE__ */ o.createElement(
|
|
1836
|
+
qr,
|
|
1792
1837
|
{
|
|
1793
|
-
filesystem:
|
|
1794
|
-
initialSelectedPath:
|
|
1795
|
-
onSelect:
|
|
1838
|
+
filesystem: l,
|
|
1839
|
+
initialSelectedPath: n,
|
|
1840
|
+
onSelect: T
|
|
1796
1841
|
}
|
|
1797
|
-
), /* @__PURE__ */
|
|
1842
|
+
), /* @__PURE__ */ o.createElement("div", { className: He.modalFooter }, /* @__PURE__ */ o.createElement(mt, { type: "submit", variant: "primary" }, "Select Path")))
|
|
1798
1843
|
));
|
|
1799
1844
|
}
|
|
1845
|
+
const nn = "_container_1h0az_1", an = "_header_1h0az_9", on = "_filename_1h0az_18", sn = "_downloadLink_1h0az_26", ln = "_previewArea_1h0az_38", cn = "_imagePreview_1h0az_51", un = "_videoPreview_1h0az_57", fn = "_audioPreview_1h0az_64", dn = "_unsupportedMessage_1h0az_68", mn = "_actions_1h0az_74", Ce = {
|
|
1846
|
+
container: nn,
|
|
1847
|
+
header: an,
|
|
1848
|
+
filename: on,
|
|
1849
|
+
downloadLink: sn,
|
|
1850
|
+
previewArea: ln,
|
|
1851
|
+
imagePreview: cn,
|
|
1852
|
+
videoPreview: un,
|
|
1853
|
+
audioPreview: fn,
|
|
1854
|
+
unsupportedMessage: dn,
|
|
1855
|
+
actions: mn
|
|
1856
|
+
}, pn = (n) => {
|
|
1857
|
+
if (!n)
|
|
1858
|
+
return {
|
|
1859
|
+
isImage: !1,
|
|
1860
|
+
isVideo: !1,
|
|
1861
|
+
isAudio: !1
|
|
1862
|
+
};
|
|
1863
|
+
const u = n.toLowerCase();
|
|
1864
|
+
return {
|
|
1865
|
+
isImage: u.startsWith("image/"),
|
|
1866
|
+
isVideo: u.startsWith("video/"),
|
|
1867
|
+
isAudio: u.startsWith("audio/")
|
|
1868
|
+
};
|
|
1869
|
+
};
|
|
1870
|
+
function Ea({
|
|
1871
|
+
filename: n,
|
|
1872
|
+
mimeType: u,
|
|
1873
|
+
dataUrl: l,
|
|
1874
|
+
downloadUrl: m,
|
|
1875
|
+
showHeader: E = !0
|
|
1876
|
+
}) {
|
|
1877
|
+
const { isImage: g, isVideo: k, isAudio: V } = pn(u), T = E !== !1, y = !!(m && n), v = () => y ? /* @__PURE__ */ o.createElement(
|
|
1878
|
+
"a",
|
|
1879
|
+
{
|
|
1880
|
+
className: Ce.downloadLink,
|
|
1881
|
+
href: m,
|
|
1882
|
+
download: n
|
|
1883
|
+
},
|
|
1884
|
+
"Download"
|
|
1885
|
+
) : null, N = () => g ? /* @__PURE__ */ o.createElement(
|
|
1886
|
+
"img",
|
|
1887
|
+
{
|
|
1888
|
+
className: Ce.imagePreview,
|
|
1889
|
+
src: l,
|
|
1890
|
+
alt: n || "Preview"
|
|
1891
|
+
}
|
|
1892
|
+
) : k ? /* @__PURE__ */ o.createElement(
|
|
1893
|
+
"video",
|
|
1894
|
+
{
|
|
1895
|
+
className: Ce.videoPreview,
|
|
1896
|
+
controls: !0,
|
|
1897
|
+
preload: "metadata"
|
|
1898
|
+
},
|
|
1899
|
+
/* @__PURE__ */ o.createElement("source", { src: l, type: u }),
|
|
1900
|
+
"Your browser does not support the video tag."
|
|
1901
|
+
) : V ? /* @__PURE__ */ o.createElement("audio", { className: Ce.audioPreview, controls: !0 }, /* @__PURE__ */ o.createElement("source", { src: l, type: u }), "Your browser does not support the audio tag.") : /* @__PURE__ */ o.createElement("div", { className: Ce.unsupportedMessage }, /* @__PURE__ */ o.createElement("p", null, "Preview unavailable for this file type."), y ? /* @__PURE__ */ o.createElement("p", null, v()) : /* @__PURE__ */ o.createElement("p", null, "Download the file to inspect its contents."));
|
|
1902
|
+
return /* @__PURE__ */ o.createElement("div", { className: Ce.container }, T && /* @__PURE__ */ o.createElement("div", { className: Ce.header }, /* @__PURE__ */ o.createElement("span", { className: Ce.filename, title: n }, n), v()), /* @__PURE__ */ o.createElement("div", { className: Ce.previewArea }, N()), !T && y && /* @__PURE__ */ o.createElement("div", { className: Ce.actions }, v()));
|
|
1903
|
+
}
|
|
1904
|
+
const St = /* @__PURE__ */ new Map(), hn = async (n) => {
|
|
1905
|
+
var E;
|
|
1906
|
+
if (!n)
|
|
1907
|
+
return tt();
|
|
1908
|
+
const u = (E = n.split(".").pop()) == null ? void 0 : E.toLowerCase();
|
|
1909
|
+
if (!u || u === "php")
|
|
1910
|
+
return tt();
|
|
1911
|
+
const l = n;
|
|
1912
|
+
if (St.has(l))
|
|
1913
|
+
return St.get(l);
|
|
1914
|
+
let m;
|
|
1915
|
+
switch (u) {
|
|
1916
|
+
case "css":
|
|
1917
|
+
m = await import("@codemirror/lang-css").then(
|
|
1918
|
+
(g) => g.css()
|
|
1919
|
+
);
|
|
1920
|
+
break;
|
|
1921
|
+
case "js":
|
|
1922
|
+
case "jsx":
|
|
1923
|
+
case "ts":
|
|
1924
|
+
case "tsx":
|
|
1925
|
+
m = await import("@codemirror/lang-javascript").then(
|
|
1926
|
+
(g) => g.javascript({
|
|
1927
|
+
jsx: u === "jsx" || u === "tsx",
|
|
1928
|
+
typescript: u === "ts" || u === "tsx"
|
|
1929
|
+
})
|
|
1930
|
+
);
|
|
1931
|
+
break;
|
|
1932
|
+
case "json":
|
|
1933
|
+
m = await import("@codemirror/lang-json").then(
|
|
1934
|
+
(g) => g.json()
|
|
1935
|
+
);
|
|
1936
|
+
break;
|
|
1937
|
+
case "html":
|
|
1938
|
+
case "htm":
|
|
1939
|
+
m = await import("@codemirror/lang-html").then(
|
|
1940
|
+
(g) => g.html()
|
|
1941
|
+
);
|
|
1942
|
+
break;
|
|
1943
|
+
case "md":
|
|
1944
|
+
case "markdown":
|
|
1945
|
+
m = await import("@codemirror/lang-markdown").then(
|
|
1946
|
+
(g) => g.markdown()
|
|
1947
|
+
);
|
|
1948
|
+
break;
|
|
1949
|
+
default:
|
|
1950
|
+
m = tt();
|
|
1951
|
+
}
|
|
1952
|
+
return St.set(l, m), m;
|
|
1953
|
+
};
|
|
1954
|
+
class wn {
|
|
1955
|
+
constructor(u) {
|
|
1956
|
+
this.view = u, this.handleClick = this.handleClick.bind(this), this.view.dom.addEventListener("mousedown", this.handleClick);
|
|
1957
|
+
}
|
|
1958
|
+
handleClick(u) {
|
|
1959
|
+
const l = u.target;
|
|
1960
|
+
if ((l.classList.contains("cm-scroller") || l.classList.contains("cm-content")) && this.view.posAtCoords({
|
|
1961
|
+
x: u.clientX,
|
|
1962
|
+
y: u.clientY
|
|
1963
|
+
}) === null) {
|
|
1964
|
+
const E = this.view.state.doc.length, g = pt.create([
|
|
1965
|
+
pt.range(E, E)
|
|
1966
|
+
]);
|
|
1967
|
+
this.view.dispatch({
|
|
1968
|
+
selection: g,
|
|
1969
|
+
effects: Qe.scrollIntoView(E, {
|
|
1970
|
+
y: "center"
|
|
1971
|
+
})
|
|
1972
|
+
}), this.view.focus(), u.preventDefault();
|
|
1973
|
+
}
|
|
1974
|
+
}
|
|
1975
|
+
destroy() {
|
|
1976
|
+
this.view.dom.removeEventListener("mousedown", this.handleClick);
|
|
1977
|
+
}
|
|
1978
|
+
}
|
|
1979
|
+
const vn = ir.define(
|
|
1980
|
+
(n) => new wn(n)
|
|
1981
|
+
), Ut = Bt(
|
|
1982
|
+
function({
|
|
1983
|
+
code: u,
|
|
1984
|
+
onChange: l,
|
|
1985
|
+
currentPath: m,
|
|
1986
|
+
className: E,
|
|
1987
|
+
onSaveShortcut: g,
|
|
1988
|
+
readOnly: k = !1,
|
|
1989
|
+
additionalExtensions: V
|
|
1990
|
+
}, T) {
|
|
1991
|
+
const y = M(
|
|
1992
|
+
null
|
|
1993
|
+
), v = M(null), N = M(new Tt()), P = M(new Tt()), j = M(new Tt()), Z = M(u), A = M(l), D = M(!1);
|
|
1994
|
+
return Wt(T, () => ({
|
|
1995
|
+
focus: () => {
|
|
1996
|
+
var p;
|
|
1997
|
+
(p = v.current) == null || p.focus();
|
|
1998
|
+
},
|
|
1999
|
+
blur: () => {
|
|
2000
|
+
const p = v.current;
|
|
2001
|
+
p && p.contentDOM.blur();
|
|
2002
|
+
},
|
|
2003
|
+
getCursorPosition: () => v.current ? v.current.state.selection.main.anchor : null,
|
|
2004
|
+
setCursorPosition: (p) => {
|
|
2005
|
+
if (!v.current)
|
|
2006
|
+
return;
|
|
2007
|
+
const b = Math.min(
|
|
2008
|
+
p,
|
|
2009
|
+
v.current.state.doc.length
|
|
2010
|
+
), q = pt.create([
|
|
2011
|
+
pt.range(b, b)
|
|
2012
|
+
]);
|
|
2013
|
+
v.current.dispatch({
|
|
2014
|
+
selection: q,
|
|
2015
|
+
scrollIntoView: !0
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
})), I(() => {
|
|
2019
|
+
Z.current = u;
|
|
2020
|
+
}, [u]), I(() => {
|
|
2021
|
+
A.current = l;
|
|
2022
|
+
}, [l]), I(() => {
|
|
2023
|
+
if (v.current)
|
|
2024
|
+
return;
|
|
2025
|
+
const p = y.current;
|
|
2026
|
+
if (!p)
|
|
2027
|
+
return;
|
|
2028
|
+
const b = or.create({
|
|
2029
|
+
doc: u,
|
|
2030
|
+
extensions: [
|
|
2031
|
+
j.current.of(V ?? []),
|
|
2032
|
+
sr(),
|
|
2033
|
+
lr(),
|
|
2034
|
+
cr(),
|
|
2035
|
+
xr(),
|
|
2036
|
+
ur(),
|
|
2037
|
+
fr(),
|
|
2038
|
+
dr(),
|
|
2039
|
+
vn,
|
|
2040
|
+
N.current.of(tt()),
|
|
2041
|
+
P.current.of(
|
|
2042
|
+
Qe.editable.of(!k)
|
|
2043
|
+
),
|
|
2044
|
+
Rr(kr),
|
|
2045
|
+
Tr(),
|
|
2046
|
+
Pr(),
|
|
2047
|
+
yr(),
|
|
2048
|
+
pr(),
|
|
2049
|
+
gr(),
|
|
2050
|
+
_r(),
|
|
2051
|
+
Qe.updateListener.of((B) => {
|
|
2052
|
+
if (!B.docChanged)
|
|
2053
|
+
return;
|
|
2054
|
+
const G = B.state.doc.toString();
|
|
2055
|
+
G !== Z.current && (Z.current = G, A.current(G));
|
|
2056
|
+
}),
|
|
2057
|
+
mr.of([
|
|
2058
|
+
{
|
|
2059
|
+
key: "Mod-s",
|
|
2060
|
+
preventDefault: !0,
|
|
2061
|
+
run: () => (g == null || g(), !0)
|
|
2062
|
+
},
|
|
2063
|
+
...br,
|
|
2064
|
+
...Cr,
|
|
2065
|
+
...Sr,
|
|
2066
|
+
...Er,
|
|
2067
|
+
...hr,
|
|
2068
|
+
...wr,
|
|
2069
|
+
vr
|
|
2070
|
+
])
|
|
2071
|
+
]
|
|
2072
|
+
}), q = new Qe({ state: b, parent: p });
|
|
2073
|
+
return v.current = q, () => {
|
|
2074
|
+
q.destroy(), v.current = null;
|
|
2075
|
+
};
|
|
2076
|
+
}, []), I(() => {
|
|
2077
|
+
const p = v.current;
|
|
2078
|
+
p && p.dispatch({
|
|
2079
|
+
effects: j.current.reconfigure(
|
|
2080
|
+
V ?? []
|
|
2081
|
+
)
|
|
2082
|
+
});
|
|
2083
|
+
}, [V]), I(() => {
|
|
2084
|
+
const p = v.current;
|
|
2085
|
+
if (!p)
|
|
2086
|
+
return;
|
|
2087
|
+
const b = p.state.doc.toString();
|
|
2088
|
+
u !== b && p.dispatch({
|
|
2089
|
+
changes: { from: 0, to: p.state.doc.length, insert: u }
|
|
2090
|
+
});
|
|
2091
|
+
}, [u]), I(() => {
|
|
2092
|
+
var G;
|
|
2093
|
+
const p = v.current;
|
|
2094
|
+
if (!p)
|
|
2095
|
+
return;
|
|
2096
|
+
const b = (G = m == null ? void 0 : m.split(".").pop()) == null ? void 0 : G.toLowerCase();
|
|
2097
|
+
(!b || b === "php") && p.dispatch({
|
|
2098
|
+
effects: N.current.reconfigure(tt())
|
|
2099
|
+
});
|
|
2100
|
+
let B = !1;
|
|
2101
|
+
return hn(m).then((ee) => {
|
|
2102
|
+
B || !v.current || v.current.dispatch({
|
|
2103
|
+
effects: N.current.reconfigure(ee)
|
|
2104
|
+
});
|
|
2105
|
+
}), () => {
|
|
2106
|
+
B = !0;
|
|
2107
|
+
};
|
|
2108
|
+
}, [m]), I(() => {
|
|
2109
|
+
const p = v.current;
|
|
2110
|
+
p && (p.hasFocus && (D.current = !0), p.dispatch({
|
|
2111
|
+
effects: P.current.reconfigure(
|
|
2112
|
+
Qe.editable.of(!k)
|
|
2113
|
+
)
|
|
2114
|
+
}));
|
|
2115
|
+
}, [k]), Gt(() => {
|
|
2116
|
+
const p = v.current;
|
|
2117
|
+
p && D.current && !p.hasFocus && (p.focus(), D.current = !1);
|
|
2118
|
+
}, [m, k]), /* @__PURE__ */ o.createElement("div", { ref: y, className: E });
|
|
2119
|
+
}
|
|
2120
|
+
);
|
|
2121
|
+
Ut.displayName = "CodeEditor";
|
|
2122
|
+
const gn = "_fileExplorerContainer_1m4t6_1", En = "_fileExplorerHeader_1m4t6_14", yn = "_fileExplorerTitle_1m4t6_23", _n = "_fileExplorerActions_1m4t6_31", bn = "_fileExplorerButton_1m4t6_37", Cn = "_fileExplorerTree_1m4t6_84", Ie = {
|
|
2123
|
+
fileExplorerContainer: gn,
|
|
2124
|
+
fileExplorerHeader: En,
|
|
2125
|
+
fileExplorerTitle: yn,
|
|
2126
|
+
fileExplorerActions: _n,
|
|
2127
|
+
fileExplorerButton: bn,
|
|
2128
|
+
fileExplorerTree: Cn
|
|
2129
|
+
}, xn = 1024 * 1024, Rn = (n) => {
|
|
2130
|
+
const u = n.byteLength;
|
|
2131
|
+
for (let l = 0; l < Math.min(u, 4096); l++)
|
|
2132
|
+
if (n[l] === 0)
|
|
2133
|
+
return !0;
|
|
2134
|
+
try {
|
|
2135
|
+
return new TextDecoder("utf-8", { fatal: !0 }).decode(n), !1;
|
|
2136
|
+
} catch {
|
|
2137
|
+
return !0;
|
|
2138
|
+
}
|
|
2139
|
+
}, $t = (n, u) => {
|
|
2140
|
+
const l = new Blob([n]), m = URL.createObjectURL(l);
|
|
2141
|
+
return setTimeout(() => URL.revokeObjectURL(m), 6e4), { url: m, filename: u };
|
|
2142
|
+
}, Tn = (n) => {
|
|
2143
|
+
const u = n.split(".").pop();
|
|
2144
|
+
return Lt[u] || Lt._default;
|
|
2145
|
+
}, Pn = (n) => n.startsWith("image/") || n.startsWith("video/") || n.startsWith("audio/");
|
|
2146
|
+
function kn({
|
|
2147
|
+
filesystem: n,
|
|
2148
|
+
currentPath: u,
|
|
2149
|
+
selectedDirPath: l,
|
|
2150
|
+
setSelectedDirPath: m,
|
|
2151
|
+
onFileOpened: E,
|
|
2152
|
+
onSelectionCleared: g,
|
|
2153
|
+
onShowMessage: k,
|
|
2154
|
+
documentRoot: V
|
|
2155
|
+
}) {
|
|
2156
|
+
const T = M(null), y = Nt(() => At(
|
|
2157
|
+
u ? Oe(At(u)) : l ?? V
|
|
2158
|
+
), [u, V]), [v, N] = Q(
|
|
2159
|
+
null
|
|
2160
|
+
), P = async (j, Z) => {
|
|
2161
|
+
try {
|
|
2162
|
+
const A = await n.read(j), D = new Uint8Array(await A.arrayBuffer()), p = D.byteLength, b = j.split("/").pop() || "download";
|
|
2163
|
+
if (p > xn) {
|
|
2164
|
+
const { url: B, filename: G } = $t(
|
|
2165
|
+
D,
|
|
2166
|
+
b
|
|
2167
|
+
);
|
|
2168
|
+
await k(
|
|
2169
|
+
j,
|
|
2170
|
+
/* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("p", null, "File too large to open (>1MB)."), /* @__PURE__ */ o.createElement("p", null, /* @__PURE__ */ o.createElement("a", { href: B, download: G }, "Download ", G)))
|
|
2171
|
+
);
|
|
2172
|
+
return;
|
|
2173
|
+
}
|
|
2174
|
+
if (Rn(D)) {
|
|
2175
|
+
const B = Tn(b), { url: G, filename: ee } = $t(
|
|
2176
|
+
D,
|
|
2177
|
+
b
|
|
2178
|
+
);
|
|
2179
|
+
if (Pn(B)) {
|
|
2180
|
+
const W = new Blob([D], { type: B }), F = URL.createObjectURL(W);
|
|
2181
|
+
await k(
|
|
2182
|
+
j,
|
|
2183
|
+
/* @__PURE__ */ o.createElement(
|
|
2184
|
+
Dr,
|
|
2185
|
+
{
|
|
2186
|
+
filename: ee,
|
|
2187
|
+
mimeType: B,
|
|
2188
|
+
dataUrl: F,
|
|
2189
|
+
downloadUrl: G
|
|
2190
|
+
}
|
|
2191
|
+
)
|
|
2192
|
+
);
|
|
2193
|
+
return;
|
|
2194
|
+
}
|
|
2195
|
+
await k(
|
|
2196
|
+
j,
|
|
2197
|
+
/* @__PURE__ */ o.createElement(o.Fragment, null, /* @__PURE__ */ o.createElement("p", null, "Binary file. Cannot be edited."), /* @__PURE__ */ o.createElement("p", null, /* @__PURE__ */ o.createElement("a", { href: G, download: ee }, "Download ", ee)))
|
|
2198
|
+
);
|
|
2199
|
+
return;
|
|
2200
|
+
}
|
|
2201
|
+
const q = new TextDecoder("utf-8").decode(D);
|
|
2202
|
+
await E(j, q, Z);
|
|
2203
|
+
} catch (A) {
|
|
2204
|
+
dt.error("Could not open file", A), await k(null, "Could not open file.");
|
|
2205
|
+
}
|
|
2206
|
+
};
|
|
2207
|
+
return /* @__PURE__ */ o.createElement("div", { className: Ie.fileExplorerContainer }, /* @__PURE__ */ o.createElement("div", { className: Ie.fileExplorerHeader }, /* @__PURE__ */ o.createElement("span", { className: Ie.fileExplorerTitle }, "Files"), /* @__PURE__ */ o.createElement("div", { className: Ie.fileExplorerActions }, /* @__PURE__ */ o.createElement(
|
|
2208
|
+
"button",
|
|
2209
|
+
{
|
|
2210
|
+
className: Ie.fileExplorerButton,
|
|
2211
|
+
type: "button",
|
|
2212
|
+
onClick: () => {
|
|
2213
|
+
T.current && T.current.createFile(
|
|
2214
|
+
v ?? void 0
|
|
2215
|
+
);
|
|
2216
|
+
},
|
|
2217
|
+
title: "Create new file"
|
|
2218
|
+
},
|
|
2219
|
+
/* @__PURE__ */ o.createElement(Ft, { icon: Vr, size: 16 }),
|
|
2220
|
+
"New File"
|
|
2221
|
+
), /* @__PURE__ */ o.createElement(
|
|
2222
|
+
"button",
|
|
2223
|
+
{
|
|
2224
|
+
className: Ie.fileExplorerButton,
|
|
2225
|
+
type: "button",
|
|
2226
|
+
onClick: () => {
|
|
2227
|
+
T.current && T.current.createFolder(
|
|
2228
|
+
v ?? void 0
|
|
2229
|
+
);
|
|
2230
|
+
},
|
|
2231
|
+
title: "Create new folder"
|
|
2232
|
+
},
|
|
2233
|
+
/* @__PURE__ */ o.createElement(Ft, { icon: Mr, size: 16 }),
|
|
2234
|
+
"New Folder"
|
|
2235
|
+
))), /* @__PURE__ */ o.createElement("div", { className: Ie.fileExplorerTree }, /* @__PURE__ */ o.createElement(
|
|
2236
|
+
Nr,
|
|
2237
|
+
{
|
|
2238
|
+
ref: T,
|
|
2239
|
+
filesystem: n,
|
|
2240
|
+
root: V,
|
|
2241
|
+
initialSelectedPath: y,
|
|
2242
|
+
onSelect: async (j) => {
|
|
2243
|
+
if (N(j), !j) {
|
|
2244
|
+
await g();
|
|
2245
|
+
return;
|
|
2246
|
+
}
|
|
2247
|
+
try {
|
|
2248
|
+
if (await n.isDir(j)) {
|
|
2249
|
+
m(j);
|
|
2250
|
+
return;
|
|
2251
|
+
}
|
|
2252
|
+
} catch {
|
|
2253
|
+
}
|
|
2254
|
+
await P(j, !1);
|
|
2255
|
+
},
|
|
2256
|
+
onDoubleClickFile: async (j) => {
|
|
2257
|
+
await P(j, !0);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
)));
|
|
2261
|
+
}
|
|
2262
|
+
const Sn = "_container_15o5h_1", Nn = "_content_15o5h_9", Dn = "_sidebarWrapper_15o5h_17", On = "_editorWrapper_15o5h_28", An = "_editorHeader_15o5h_37", Fn = "_editorPath_15o5h_49", Ln = "_editorPathPlaceholder_15o5h_60", jn = "_saveStatus_15o5h_71", In = "_saveStatusSaving_15o5h_78", Mn = "_saveStatusPending_15o5h_79", Vn = "_saveStatusError_15o5h_83", $n = "_editor_15o5h_28", Bn = "_placeholder_15o5h_105", Wn = "_messageArea_15o5h_116", Hn = "_mobileToggle_15o5h_152", zn = "_mobileOverlay_15o5h_156", Un = "_sidebarOpen_15o5h_171", fe = {
|
|
2263
|
+
container: Sn,
|
|
2264
|
+
content: Nn,
|
|
2265
|
+
sidebarWrapper: Dn,
|
|
2266
|
+
editorWrapper: On,
|
|
2267
|
+
editorHeader: An,
|
|
2268
|
+
editorPath: Fn,
|
|
2269
|
+
editorPathPlaceholder: Ln,
|
|
2270
|
+
saveStatus: jn,
|
|
2271
|
+
saveStatusSaving: In,
|
|
2272
|
+
saveStatusPending: Mn,
|
|
2273
|
+
saveStatusError: Vn,
|
|
2274
|
+
editor: $n,
|
|
2275
|
+
placeholder: Bn,
|
|
2276
|
+
messageArea: Wn,
|
|
2277
|
+
mobileToggle: Hn,
|
|
2278
|
+
mobileOverlay: zn,
|
|
2279
|
+
sidebarOpen: Un
|
|
2280
|
+
}, Yn = 1500, K = {
|
|
2281
|
+
IDLE: "idle",
|
|
2282
|
+
PENDING: "pending",
|
|
2283
|
+
SAVING: "saving",
|
|
2284
|
+
SAVED: "saved",
|
|
2285
|
+
ERROR: "error"
|
|
2286
|
+
};
|
|
2287
|
+
function ya({
|
|
2288
|
+
filesystem: n,
|
|
2289
|
+
isVisible: u = !0,
|
|
2290
|
+
documentRoot: l,
|
|
2291
|
+
initialPath: m = null,
|
|
2292
|
+
placeholderText: E = "Select a file to view or edit its contents.",
|
|
2293
|
+
onSaveFile: g,
|
|
2294
|
+
onBeforeFilesystemChange: k
|
|
2295
|
+
}) {
|
|
2296
|
+
const [V, T] = Q(
|
|
2297
|
+
l
|
|
2298
|
+
), [y, v] = Q(null), [N, P] = Q(""), [j, Z] = Q(!0), [A, D] = Q(K.IDLE), [p, b] = Q(null), [q, B] = Q(!1), [G, ee] = Q(null), W = M(null), F = M(null), te = M(!1), _ = M(N), H = M(y), de = M(n), ae = M(null), re = M(/* @__PURE__ */ new Map()), ue = M(!1);
|
|
2299
|
+
I(() => {
|
|
2300
|
+
_.current = N;
|
|
2301
|
+
}, [N]), I(() => {
|
|
2302
|
+
H.current = y;
|
|
2303
|
+
}, [y]), I(() => {
|
|
2304
|
+
de.current = n;
|
|
2305
|
+
}, [n]), I(() => {
|
|
2306
|
+
const S = ae.current;
|
|
2307
|
+
S && S !== n && k && k(S), ae.current = n;
|
|
2308
|
+
}, [n, k]), I(() => {
|
|
2309
|
+
n || (te.current = !0, P(""), v(null), Z(!0), D(K.IDLE), b(null), B(!1), ee(null), ue.current = !1);
|
|
2310
|
+
}, [n]), I(() => {
|
|
2311
|
+
if (!n || !m || ue.current)
|
|
2312
|
+
return;
|
|
2313
|
+
(async () => {
|
|
2314
|
+
try {
|
|
2315
|
+
if (await n.fileExists(m)) {
|
|
2316
|
+
const J = await n.readFileAsText(m);
|
|
2317
|
+
te.current = !0, v(m), P(J), Z(!1), D(K.IDLE), b(null), setTimeout(() => {
|
|
2318
|
+
var z;
|
|
2319
|
+
(z = W.current) == null || z.focus();
|
|
2320
|
+
}, 100);
|
|
2321
|
+
}
|
|
2322
|
+
} catch (C) {
|
|
2323
|
+
dt.debug("Could not auto-open initial path:", C);
|
|
2324
|
+
} finally {
|
|
2325
|
+
ue.current = !0;
|
|
2326
|
+
}
|
|
2327
|
+
})();
|
|
2328
|
+
}, [n, m]), I(() => {
|
|
2329
|
+
T(l), v(null), P(""), Z(!0), D(K.IDLE), b(null), te.current = !0, ee(null), ue.current = !1;
|
|
2330
|
+
}, [l]), I(() => () => {
|
|
2331
|
+
F.current !== null && (window.clearTimeout(F.current), F.current = null);
|
|
2332
|
+
}, []), I(() => {
|
|
2333
|
+
const S = de.current;
|
|
2334
|
+
if (!S || !y) {
|
|
2335
|
+
F.current !== null && (window.clearTimeout(F.current), F.current = null), y || D(K.IDLE);
|
|
2336
|
+
return;
|
|
2337
|
+
}
|
|
2338
|
+
if (te.current) {
|
|
2339
|
+
te.current = !1;
|
|
2340
|
+
return;
|
|
2341
|
+
}
|
|
2342
|
+
F.current !== null && (window.clearTimeout(F.current), F.current = null), D(K.PENDING);
|
|
2343
|
+
const C = window.setTimeout(async () => {
|
|
2344
|
+
F.current = null, D(K.SAVING);
|
|
2345
|
+
try {
|
|
2346
|
+
const J = H.current, z = _.current;
|
|
2347
|
+
g ? await g(J, z) : await S.writeFile(J, z), D(K.SAVED), b(null);
|
|
2348
|
+
} catch (J) {
|
|
2349
|
+
dt.error("Failed to save file", J), D(K.ERROR), b("Could not save changes. Try again.");
|
|
2350
|
+
}
|
|
2351
|
+
}, Yn);
|
|
2352
|
+
return F.current = C, () => {
|
|
2353
|
+
F.current === C && (window.clearTimeout(C), F.current = null);
|
|
2354
|
+
};
|
|
2355
|
+
}, [N, y, g]), I(() => {
|
|
2356
|
+
if (A !== K.SAVED)
|
|
2357
|
+
return;
|
|
2358
|
+
const S = window.setTimeout(() => {
|
|
2359
|
+
D(
|
|
2360
|
+
(C) => C === K.SAVED ? K.IDLE : C
|
|
2361
|
+
);
|
|
2362
|
+
}, 2e3);
|
|
2363
|
+
return () => window.clearTimeout(S);
|
|
2364
|
+
}, [A]);
|
|
2365
|
+
const oe = ft(
|
|
2366
|
+
async (S, C, J = !0) => {
|
|
2367
|
+
var ie;
|
|
2368
|
+
const z = (ie = W.current) == null ? void 0 : ie.getCursorPosition();
|
|
2369
|
+
z != null && H.current && re.current.set(
|
|
2370
|
+
H.current,
|
|
2371
|
+
z
|
|
2372
|
+
), te.current = !0, v(S), P(C), ee(null), Z(!1), D(K.IDLE), b(null), B(!1), setTimeout(() => {
|
|
2373
|
+
var ve, ce, U;
|
|
2374
|
+
const Ee = re.current.get(S);
|
|
2375
|
+
Ee !== void 0 && ((ve = W.current) == null || ve.setCursorPosition(Ee)), J ? (ce = W.current) == null || ce.focus() : (U = W.current) == null || U.blur();
|
|
2376
|
+
}, 50);
|
|
2377
|
+
},
|
|
2378
|
+
[]
|
|
2379
|
+
);
|
|
2380
|
+
I(() => {
|
|
2381
|
+
var J;
|
|
2382
|
+
if (!y)
|
|
2383
|
+
return;
|
|
2384
|
+
const S = setInterval(() => {
|
|
2385
|
+
var ie;
|
|
2386
|
+
const z = (ie = W.current) == null ? void 0 : ie.getCursorPosition();
|
|
2387
|
+
z != null && re.current.set(y, z);
|
|
2388
|
+
}, 1e3), C = (J = W.current) == null ? void 0 : J.getCursorPosition();
|
|
2389
|
+
return C != null && re.current.set(y, C), () => {
|
|
2390
|
+
var ie;
|
|
2391
|
+
clearInterval(S);
|
|
2392
|
+
const z = (ie = W.current) == null ? void 0 : ie.getCursorPosition();
|
|
2393
|
+
z != null && re.current.set(y, z);
|
|
2394
|
+
};
|
|
2395
|
+
}, [y]), I(() => {
|
|
2396
|
+
if (!u || !y)
|
|
2397
|
+
return;
|
|
2398
|
+
const S = setTimeout(() => {
|
|
2399
|
+
var J;
|
|
2400
|
+
const C = re.current.get(y);
|
|
2401
|
+
C !== void 0 && ((J = W.current) == null || J.setCursorPosition(C));
|
|
2402
|
+
}, 100);
|
|
2403
|
+
return () => clearTimeout(S);
|
|
2404
|
+
}, [u, y]);
|
|
2405
|
+
const be = ft(async () => {
|
|
2406
|
+
var C;
|
|
2407
|
+
const S = (C = W.current) == null ? void 0 : C.getCursorPosition();
|
|
2408
|
+
S != null && H.current && re.current.set(H.current, S), te.current = !0, v(null), P(""), ee(null), Z(!0), D(K.IDLE), b(null);
|
|
2409
|
+
}, []), Re = ft(
|
|
2410
|
+
async (S, C) => {
|
|
2411
|
+
te.current = !0, v(null), typeof C == "string" ? (P(C), ee(null)) : (P(""), ee(C)), Z(!0), D(K.IDLE), b(null), B(!1);
|
|
2412
|
+
},
|
|
2413
|
+
[]
|
|
2414
|
+
), Te = ft(async () => {
|
|
2415
|
+
if (F.current !== null) {
|
|
2416
|
+
if (!de.current || !H.current) {
|
|
2417
|
+
window.clearTimeout(F.current), F.current = null;
|
|
2418
|
+
return;
|
|
2419
|
+
}
|
|
2420
|
+
window.clearTimeout(F.current), F.current = null, D(K.SAVING);
|
|
2421
|
+
try {
|
|
2422
|
+
const S = H.current, C = _.current;
|
|
2423
|
+
g ? await g(S, C) : await de.current.writeFile(
|
|
2424
|
+
S,
|
|
2425
|
+
C
|
|
2426
|
+
), D(K.SAVED), b(null);
|
|
2427
|
+
} catch (S) {
|
|
2428
|
+
dt.error("Failed to save file", S), D(K.ERROR), b("Could not save changes. Try again.");
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
}, [g]), Pe = Zn(A, p), le = Gn(A, fe);
|
|
2432
|
+
return n ? /* @__PURE__ */ o.createElement("div", { className: fe.container }, /* @__PURE__ */ o.createElement(
|
|
2433
|
+
"div",
|
|
2434
|
+
{
|
|
2435
|
+
className: et(fe.content, {
|
|
2436
|
+
[fe.sidebarOpen]: q
|
|
2437
|
+
})
|
|
2438
|
+
},
|
|
2439
|
+
/* @__PURE__ */ o.createElement(
|
|
2440
|
+
"div",
|
|
2441
|
+
{
|
|
2442
|
+
className: fe.mobileOverlay,
|
|
2443
|
+
onClick: () => B(!1)
|
|
2444
|
+
}
|
|
2445
|
+
),
|
|
2446
|
+
/* @__PURE__ */ o.createElement("aside", { className: fe.sidebarWrapper }, /* @__PURE__ */ o.createElement(
|
|
2447
|
+
kn,
|
|
2448
|
+
{
|
|
2449
|
+
filesystem: n,
|
|
2450
|
+
currentPath: y,
|
|
2451
|
+
selectedDirPath: V,
|
|
2452
|
+
setSelectedDirPath: T,
|
|
2453
|
+
onFileOpened: oe,
|
|
2454
|
+
onSelectionCleared: be,
|
|
2455
|
+
onShowMessage: Re,
|
|
2456
|
+
documentRoot: l
|
|
2457
|
+
}
|
|
2458
|
+
)),
|
|
2459
|
+
/* @__PURE__ */ o.createElement("section", { className: fe.editorWrapper }, /* @__PURE__ */ o.createElement("div", { className: fe.editorHeader }, /* @__PURE__ */ o.createElement(
|
|
2460
|
+
mt,
|
|
2461
|
+
{
|
|
2462
|
+
className: fe.mobileToggle,
|
|
2463
|
+
variant: "secondary",
|
|
2464
|
+
onClick: () => B((S) => !S)
|
|
2465
|
+
},
|
|
2466
|
+
q ? "Hide files" : "Browse files"
|
|
2467
|
+
), /* @__PURE__ */ o.createElement(
|
|
2468
|
+
"div",
|
|
2469
|
+
{
|
|
2470
|
+
className: et(fe.editorPath, {
|
|
2471
|
+
[fe.editorPathPlaceholder]: !(y != null && y.length)
|
|
2472
|
+
})
|
|
2473
|
+
},
|
|
2474
|
+
y != null && y.length ? y : `Browse files under ${l}`
|
|
2475
|
+
), /* @__PURE__ */ o.createElement(
|
|
2476
|
+
"div",
|
|
2477
|
+
{
|
|
2478
|
+
className: et(
|
|
2479
|
+
fe.saveStatus,
|
|
2480
|
+
le
|
|
2481
|
+
)
|
|
2482
|
+
},
|
|
2483
|
+
Pe
|
|
2484
|
+
)), p ? /* @__PURE__ */ o.createElement("div", { style: { padding: "8px 16px" } }, /* @__PURE__ */ o.createElement(tr, { status: "error", isDismissible: !1 }, p)) : null, y || N || G ? G ? /* @__PURE__ */ o.createElement("div", { className: fe.messageArea }, G) : /* @__PURE__ */ o.createElement(
|
|
2485
|
+
Ut,
|
|
2486
|
+
{
|
|
2487
|
+
ref: W,
|
|
2488
|
+
code: N,
|
|
2489
|
+
onChange: P,
|
|
2490
|
+
currentPath: y,
|
|
2491
|
+
className: fe.editor,
|
|
2492
|
+
onSaveShortcut: Te,
|
|
2493
|
+
readOnly: j
|
|
2494
|
+
}
|
|
2495
|
+
) : /* @__PURE__ */ o.createElement("div", { className: fe.placeholder }, E))
|
|
2496
|
+
)) : /* @__PURE__ */ o.createElement("div", { className: fe.container }, /* @__PURE__ */ o.createElement("div", { className: fe.placeholder }, E));
|
|
2497
|
+
}
|
|
2498
|
+
function Zn(n, u) {
|
|
2499
|
+
switch (n) {
|
|
2500
|
+
case K.PENDING:
|
|
2501
|
+
case K.SAVING:
|
|
2502
|
+
return "Saving…";
|
|
2503
|
+
case K.SAVED:
|
|
2504
|
+
return "Saved";
|
|
2505
|
+
case K.ERROR:
|
|
2506
|
+
return u ?? "Save failed";
|
|
2507
|
+
default:
|
|
2508
|
+
return "";
|
|
2509
|
+
}
|
|
2510
|
+
}
|
|
2511
|
+
function Gn(n, u) {
|
|
2512
|
+
switch (n) {
|
|
2513
|
+
case K.PENDING:
|
|
2514
|
+
return u.saveStatusPending;
|
|
2515
|
+
case K.SAVING:
|
|
2516
|
+
return u.saveStatusSaving;
|
|
2517
|
+
case K.ERROR:
|
|
2518
|
+
return u.saveStatusError;
|
|
2519
|
+
default:
|
|
2520
|
+
return;
|
|
2521
|
+
}
|
|
2522
|
+
}
|
|
1800
2523
|
export {
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
2524
|
+
Ea as BinaryFilePreview,
|
|
2525
|
+
pa as ClockIcon,
|
|
2526
|
+
Ut as CodeEditor,
|
|
2527
|
+
kn as FileExplorerSidebar,
|
|
2528
|
+
ga as FilePickerControl,
|
|
2529
|
+
qr as FilePickerTree,
|
|
2530
|
+
xn as MAX_INLINE_FILE_BYTES,
|
|
2531
|
+
ya as PlaygroundFileEditor,
|
|
2532
|
+
va as SiteManagerIcon,
|
|
2533
|
+
ma as WordPressIcon,
|
|
2534
|
+
$t as createDownloadUrl,
|
|
2535
|
+
Ar as file,
|
|
2536
|
+
Or as folder,
|
|
2537
|
+
wa as getLogoDataURL,
|
|
2538
|
+
Tn as getMimeType,
|
|
2539
|
+
Pn as isPreviewableBinary,
|
|
2540
|
+
ha as layout,
|
|
2541
|
+
fa as playgroundLogo,
|
|
2542
|
+
Rn as seemsLikeBinary,
|
|
2543
|
+
da as temporaryStorage
|
|
1812
2544
|
};
|
|
1813
2545
|
//# sourceMappingURL=index.js.map
|