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