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