@prozilla-os/terminal 1.1.18 → 1.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/cat-DGK7wWrK.js +16 -0
- package/dist/chunks/{cat-DO8KEMio.js.map → cat-DGK7wWrK.js.map} +1 -1
- package/dist/chunks/{cd-DFGtb_Wk.js → cd-DvjkW_6o.js} +5 -6
- package/dist/chunks/{cd-DFGtb_Wk.js.map → cd-DvjkW_6o.js.map} +1 -1
- package/dist/chunks/{clear-DtYBxmDr.js → clear-BF9eb1Dq.js} +2 -2
- package/dist/chunks/{clear-DtYBxmDr.js.map → clear-BF9eb1Dq.js.map} +1 -1
- package/dist/chunks/{cmatrix-CVXcw_wK.js → cmatrix-VYovsHQW.js} +4 -5
- package/dist/chunks/{cmatrix-CVXcw_wK.js.map → cmatrix-VYovsHQW.js.map} +1 -1
- package/dist/chunks/compgen-3TwdgHm_.js +13 -0
- package/dist/chunks/{compgen-WxsGxWC9.js.map → compgen-3TwdgHm_.js.map} +1 -1
- package/dist/chunks/{cowsay-DZHMvxAZ.js → cowsay-IfArfPSJ.js} +4 -5
- package/dist/chunks/{cowsay-DZHMvxAZ.js.map → cowsay-IfArfPSJ.js.map} +1 -1
- package/dist/chunks/{dir-BlrznBqV.js → dir-B_Ipo5xb.js} +2 -2
- package/dist/chunks/{dir-BlrznBqV.js.map → dir-B_Ipo5xb.js.map} +1 -1
- package/dist/chunks/{echo-PyZ6XYF6.js → echo-DX-Ar2Ut.js} +2 -2
- package/dist/chunks/{echo-PyZ6XYF6.js.map → echo-DX-Ar2Ut.js.map} +1 -1
- package/dist/chunks/{eval-CnKC-mrj.js → eval-C7InkmFY.js} +2 -2
- package/dist/chunks/{eval-CnKC-mrj.js.map → eval-C7InkmFY.js.map} +1 -1
- package/dist/chunks/{exit-CizX3N_u.js → exit-D7PPqtiE.js} +2 -2
- package/dist/chunks/{exit-CizX3N_u.js.map → exit-D7PPqtiE.js.map} +1 -1
- package/dist/chunks/{fortune-Cs0PtMgs.js → fortune-zyxpnYNP.js} +2 -2
- package/dist/chunks/{fortune-Cs0PtMgs.js.map → fortune-zyxpnYNP.js.map} +1 -1
- package/dist/chunks/{help-DnMOR9rH.js → help-BEgNbwLL.js} +8 -9
- package/dist/chunks/{help-DnMOR9rH.js.map → help-BEgNbwLL.js.map} +1 -1
- package/dist/chunks/{hostname-BBOQWx6L.js → hostname-DU1lQde2.js} +2 -2
- package/dist/chunks/{hostname-BBOQWx6L.js.map → hostname-DU1lQde2.js.map} +1 -1
- package/dist/chunks/lolcat-5-mBWD9l.js +35 -0
- package/dist/chunks/{lolcat-vYhIbqEJ.js.map → lolcat-5-mBWD9l.js.map} +1 -1
- package/dist/chunks/{ls-23P3QzxI.js → ls-DnkSPHVM.js} +4 -5
- package/dist/chunks/{ls-23P3QzxI.js.map → ls-DnkSPHVM.js.map} +1 -1
- package/dist/chunks/{main-Dvaf0Ocd.js → main-CXiltWT-.js} +385 -335
- package/dist/chunks/main-CXiltWT-.js.map +1 -0
- package/dist/chunks/{make-CKvFYB_1.js → make-DqVQDThH.js} +2 -3
- package/dist/chunks/{make-CKvFYB_1.js.map → make-DqVQDThH.js.map} +1 -1
- package/dist/chunks/{man-BN3-oDjw.js → man-D_hBUTDt.js} +4 -5
- package/dist/chunks/{man-BN3-oDjw.js.map → man-D_hBUTDt.js.map} +1 -1
- package/dist/chunks/{mkdir-BTSAC1PK.js → mkdir-BCvMrPTX.js} +2 -2
- package/dist/chunks/{mkdir-BTSAC1PK.js.map → mkdir-BCvMrPTX.js.map} +1 -1
- package/dist/chunks/{neofetch-UHKALL5e.js → neofetch-BFHOITJj.js} +10 -11
- package/dist/chunks/neofetch-BFHOITJj.js.map +1 -0
- package/dist/chunks/{pwd-CSapfDtw.js → pwd-C21tQanw.js} +2 -2
- package/dist/chunks/{pwd-CSapfDtw.js.map → pwd-C21tQanw.js.map} +1 -1
- package/dist/chunks/{reboot-Bwxhoa8q.js → reboot-C2t7a3Av.js} +2 -2
- package/dist/chunks/{reboot-Bwxhoa8q.js.map → reboot-C2t7a3Av.js.map} +1 -1
- package/dist/chunks/reload-C9o_dGZw.js +10 -0
- package/dist/chunks/{reload-RsBNPWJI.js.map → reload-C9o_dGZw.js.map} +1 -1
- package/dist/chunks/{rev-C8qQIyj_.js → rev-CBibYebM.js} +2 -2
- package/dist/chunks/{rev-C8qQIyj_.js.map → rev-CBibYebM.js.map} +1 -1
- package/dist/chunks/rm-ChTrwld4.js +12 -0
- package/dist/chunks/{rm-B4-5j-xh.js.map → rm-ChTrwld4.js.map} +1 -1
- package/dist/chunks/rmdir-CUM4xt2w.js +11 -0
- package/dist/chunks/{rmdir-hAWOHScY.js.map → rmdir-CUM4xt2w.js.map} +1 -1
- package/dist/chunks/{sl-yhx6cve3.js → sl-DrATMkz6.js} +4 -5
- package/dist/chunks/{sl-yhx6cve3.js.map → sl-DrATMkz6.js.map} +1 -1
- package/dist/chunks/touch-CqBIAjMe.js +19 -0
- package/dist/chunks/{touch-DptR1Wm4.js.map → touch-CqBIAjMe.js.map} +1 -1
- package/dist/chunks/{uptime-BYmCcOUM.js → uptime-xM-0FRzA.js} +2 -2
- package/dist/chunks/{uptime-BYmCcOUM.js.map → uptime-xM-0FRzA.js.map} +1 -1
- package/dist/chunks/whatis-vXemLo9m.js +13 -0
- package/dist/chunks/{whatis-CFFc4GDV.js.map → whatis-vXemLo9m.js.map} +1 -1
- package/dist/chunks/{whoami-CQNGmqxL.js → whoami-CnUR69yX.js} +2 -2
- package/dist/chunks/{whoami-CQNGmqxL.js.map → whoami-CnUR69yX.js.map} +1 -1
- package/dist/main.d.ts +101 -1
- package/dist/main.js +5 -2
- package/dist/main.js.map +1 -1
- package/package.json +5 -5
- package/dist/chunks/cat-DO8KEMio.js +0 -17
- package/dist/chunks/command-nBL1aO7T.js +0 -43
- package/dist/chunks/command-nBL1aO7T.js.map +0 -1
- package/dist/chunks/compgen-WxsGxWC9.js +0 -14
- package/dist/chunks/lolcat-vYhIbqEJ.js +0 -36
- package/dist/chunks/main-Dvaf0Ocd.js.map +0 -1
- package/dist/chunks/neofetch-UHKALL5e.js.map +0 -1
- package/dist/chunks/reload-RsBNPWJI.js +0 -11
- package/dist/chunks/rm-B4-5j-xh.js +0 -13
- package/dist/chunks/rmdir-hAWOHScY.js +0 -12
- package/dist/chunks/touch-DptR1Wm4.js +0 -20
- package/dist/chunks/whatis-CFFc4GDV.js +0 -14
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
var He = Object.defineProperty;
|
|
2
|
+
var pe = (t) => {
|
|
3
|
+
throw TypeError(t);
|
|
4
|
+
};
|
|
5
|
+
var je = (t, e, s) => e in t ? He(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
6
|
+
var S = (t, e, s) => je(t, typeof e != "symbol" ? e + "" : e, s), de = (t, e, s) => e.has(t) || pe("Cannot " + s);
|
|
7
|
+
var _e = (t, e, s) => (de(t, e, "read from private field"), s ? s.call(t) : e.get(t)), ve = (t, e, s) => e.has(t) ? pe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), be = (t, e, s, n) => (de(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s);
|
|
8
|
+
import { useSystemManager as Fe, useVirtualRoot as qe, useSettingsManager as Je, App as Ve, AppsConfig as We } from "@prozilla-os/core";
|
|
9
|
+
import { jsx as N, jsxs as Y } from "react/jsx-runtime";
|
|
10
|
+
import * as G from "react";
|
|
11
|
+
import { forwardRef as ze, useState as T, useRef as ye, useEffect as z } from "react";
|
|
12
|
+
import { ANSI as v, EventEmitter as Ge, clamp as Be, removeFromArray as we } from "@prozilla-os/shared";
|
|
13
|
+
const Ke = "_Terminal_1n5va_1", Ue = "_Prefix_1n5va_26", Xe = "_Input_1n5va_32", Ze = "_Output_1n5va_32", Qe = "_blink_1n5va_1", M = {
|
|
14
|
+
Terminal: Ke,
|
|
15
|
+
Prefix: Ue,
|
|
16
|
+
Input: Xe,
|
|
17
|
+
Output: Ze,
|
|
14
18
|
"Input-container": "_Input-container_1n5va_47",
|
|
15
|
-
blink:
|
|
19
|
+
blink: Qe,
|
|
16
20
|
"ansi-black-fg": "_ansi-black-fg_1n5va_99",
|
|
17
21
|
"ansi-red-fg": "_ansi-red-fg_1n5va_100",
|
|
18
22
|
"ansi-green-fg": "_ansi-green-fg_1n5va_101",
|
|
@@ -39,26 +43,26 @@ const We = "_Terminal_1n5va_1", ze = "_Prefix_1n5va_26", qe = "_Input_1n5va_32",
|
|
|
39
43
|
"ansi-white-bg": "_ansi-white-bg_1n5va_124",
|
|
40
44
|
"ansi-dim": "_ansi-dim_1n5va_126"
|
|
41
45
|
};
|
|
42
|
-
function
|
|
43
|
-
return
|
|
46
|
+
function Ye(t) {
|
|
47
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
44
48
|
}
|
|
45
|
-
var
|
|
46
|
-
function e
|
|
47
|
-
for (var
|
|
48
|
-
var f = s[
|
|
49
|
-
f.enumerable = f.enumerable || !1, f.configurable = !0, "value" in f && (f.writable = !0), Object.defineProperty(
|
|
49
|
+
var ke = /* @__PURE__ */ function() {
|
|
50
|
+
function t(e, s) {
|
|
51
|
+
for (var n = 0; n < s.length; n++) {
|
|
52
|
+
var f = s[n];
|
|
53
|
+
f.enumerable = f.enumerable || !1, f.configurable = !0, "value" in f && (f.writable = !0), Object.defineProperty(e, f.key, f);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
|
-
return function(
|
|
53
|
-
return s && e
|
|
56
|
+
return function(e, s, n) {
|
|
57
|
+
return s && t(e.prototype, s), n && t(e, n), e;
|
|
54
58
|
};
|
|
55
59
|
}();
|
|
56
|
-
function
|
|
57
|
-
if (!(
|
|
60
|
+
function et(t, e) {
|
|
61
|
+
if (!(t instanceof e))
|
|
58
62
|
throw new TypeError("Cannot call a class as a function");
|
|
59
63
|
}
|
|
60
|
-
var
|
|
61
|
-
|
|
64
|
+
var L = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class: "ansi-red" }, { color: "0, 187, 0", class: "ansi-green" }, { color: "187, 187, 0", class: "ansi-yellow" }, { color: "0, 0, 187", class: "ansi-blue" }, { color: "187, 0, 187", class: "ansi-magenta" }, { color: "0, 187, 187", class: "ansi-cyan" }, { color: "255,255,255", class: "ansi-white" }], [{ color: "85, 85, 85", class: "ansi-bright-black" }, { color: "255, 85, 85", class: "ansi-bright-red" }, { color: "0, 255, 0", class: "ansi-bright-green" }, { color: "255, 255, 85", class: "ansi-bright-yellow" }, { color: "85, 85, 255", class: "ansi-bright-blue" }, { color: "255, 85, 255", class: "ansi-bright-magenta" }, { color: "85, 255, 255", class: "ansi-bright-cyan" }, { color: "255, 255, 255", class: "ansi-bright-white" }]], tt = /(https?:\/\/(?:[A-Za-z0-9#;/?:@=+$',_.!~*()[\]-]|&|%[A-Fa-f0-9]{2})+)/gm, st = function() {
|
|
65
|
+
ke(t, null, [{
|
|
62
66
|
key: "escapeForHtml",
|
|
63
67
|
/**
|
|
64
68
|
* Anser.escapeForHtml
|
|
@@ -74,7 +78,7 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
74
78
|
* @returns {String} The escaped html.
|
|
75
79
|
*/
|
|
76
80
|
value: function(s) {
|
|
77
|
-
return new
|
|
81
|
+
return new t().escapeForHtml(s);
|
|
78
82
|
}
|
|
79
83
|
/**
|
|
80
84
|
* Anser.linkify
|
|
@@ -91,7 +95,7 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
91
95
|
}, {
|
|
92
96
|
key: "linkify",
|
|
93
97
|
value: function(s) {
|
|
94
|
-
return new
|
|
98
|
+
return new t().linkify(s);
|
|
95
99
|
}
|
|
96
100
|
/**
|
|
97
101
|
* Anser.ansiToHtml
|
|
@@ -119,8 +123,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
119
123
|
*/
|
|
120
124
|
}, {
|
|
121
125
|
key: "ansiToHtml",
|
|
122
|
-
value: function(s,
|
|
123
|
-
return new
|
|
126
|
+
value: function(s, n) {
|
|
127
|
+
return new t().ansiToHtml(s, n);
|
|
124
128
|
}
|
|
125
129
|
/**
|
|
126
130
|
* Anser.ansiToJson
|
|
@@ -134,8 +138,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
134
138
|
*/
|
|
135
139
|
}, {
|
|
136
140
|
key: "ansiToJson",
|
|
137
|
-
value: function(s,
|
|
138
|
-
return new
|
|
141
|
+
value: function(s, n) {
|
|
142
|
+
return new t().ansiToJson(s, n);
|
|
139
143
|
}
|
|
140
144
|
/**
|
|
141
145
|
* Anser.ansiToText
|
|
@@ -149,7 +153,7 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
149
153
|
}, {
|
|
150
154
|
key: "ansiToText",
|
|
151
155
|
value: function(s) {
|
|
152
|
-
return new
|
|
156
|
+
return new t().ansiToText(s);
|
|
153
157
|
}
|
|
154
158
|
/**
|
|
155
159
|
* Anser
|
|
@@ -160,22 +164,22 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
160
164
|
* @returns {Anser}
|
|
161
165
|
*/
|
|
162
166
|
}]);
|
|
163
|
-
function
|
|
164
|
-
|
|
167
|
+
function t() {
|
|
168
|
+
et(this, t), this.fg = this.bg = this.fg_truecolor = this.bg_truecolor = null, this.bright = 0, this.decorations = [];
|
|
165
169
|
}
|
|
166
|
-
return
|
|
170
|
+
return ke(t, [{
|
|
167
171
|
key: "setupPalette",
|
|
168
172
|
value: function() {
|
|
169
173
|
this.PALETTE_COLORS = [];
|
|
170
174
|
for (var s = 0; s < 2; ++s)
|
|
171
|
-
for (var
|
|
172
|
-
this.PALETTE_COLORS.push(
|
|
173
|
-
for (var f = [0, 95, 135, 175, 215, 255], y = function(
|
|
174
|
-
return f[
|
|
175
|
-
},
|
|
175
|
+
for (var n = 0; n < 8; ++n)
|
|
176
|
+
this.PALETTE_COLORS.push(L[s][n].color);
|
|
177
|
+
for (var f = [0, 95, 135, 175, 215, 255], y = function(a, b, k) {
|
|
178
|
+
return f[a] + ", " + f[b] + ", " + f[k];
|
|
179
|
+
}, i = 0; i < 6; ++i)
|
|
176
180
|
for (var u = 0; u < 6; ++u)
|
|
177
181
|
for (var c = 0; c < 6; ++c)
|
|
178
|
-
this.PALETTE_COLORS.push(y(
|
|
182
|
+
this.PALETTE_COLORS.push(y(i, u, c));
|
|
179
183
|
for (var o = 8, r = 0; r < 24; ++r, o += 10)
|
|
180
184
|
this.PALETTE_COLORS.push(y(o, o, o));
|
|
181
185
|
}
|
|
@@ -191,8 +195,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
191
195
|
}, {
|
|
192
196
|
key: "escapeForHtml",
|
|
193
197
|
value: function(s) {
|
|
194
|
-
return s.replace(/[&<>\"]/gm, function(
|
|
195
|
-
return
|
|
198
|
+
return s.replace(/[&<>\"]/gm, function(n) {
|
|
199
|
+
return n == "&" ? "&" : n == '"' ? """ : n == "<" ? "<" : n == ">" ? ">" : "";
|
|
196
200
|
});
|
|
197
201
|
}
|
|
198
202
|
/**
|
|
@@ -207,8 +211,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
207
211
|
}, {
|
|
208
212
|
key: "linkify",
|
|
209
213
|
value: function(s) {
|
|
210
|
-
return s.replace(
|
|
211
|
-
return '<a href="' +
|
|
214
|
+
return s.replace(tt, function(n) {
|
|
215
|
+
return '<a href="' + n + '">' + n + "</a>";
|
|
212
216
|
});
|
|
213
217
|
}
|
|
214
218
|
/**
|
|
@@ -223,8 +227,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
223
227
|
*/
|
|
224
228
|
}, {
|
|
225
229
|
key: "ansiToHtml",
|
|
226
|
-
value: function(s,
|
|
227
|
-
return this.process(s,
|
|
230
|
+
value: function(s, n) {
|
|
231
|
+
return this.process(s, n, !0);
|
|
228
232
|
}
|
|
229
233
|
/**
|
|
230
234
|
* ansiToJson
|
|
@@ -238,8 +242,8 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
238
242
|
*/
|
|
239
243
|
}, {
|
|
240
244
|
key: "ansiToJson",
|
|
241
|
-
value: function(s,
|
|
242
|
-
return
|
|
245
|
+
value: function(s, n) {
|
|
246
|
+
return n = n || {}, n.json = !0, n.clearLine = !1, this.process(s, n, !0);
|
|
243
247
|
}
|
|
244
248
|
/**
|
|
245
249
|
* ansiToText
|
|
@@ -271,16 +275,16 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
271
275
|
*/
|
|
272
276
|
}, {
|
|
273
277
|
key: "process",
|
|
274
|
-
value: function(s,
|
|
275
|
-
var y = this,
|
|
276
|
-
|
|
277
|
-
var o = u.map(function(
|
|
278
|
-
return y.processChunk(
|
|
278
|
+
value: function(s, n, f) {
|
|
279
|
+
var y = this, i = this, u = s.split(/\033\[/), c = u.shift();
|
|
280
|
+
n == null && (n = {}), n.clearLine = /\r/.test(s);
|
|
281
|
+
var o = u.map(function(_) {
|
|
282
|
+
return y.processChunk(_, n, f);
|
|
279
283
|
});
|
|
280
|
-
if (
|
|
281
|
-
var r =
|
|
282
|
-
return r.content = c, r.clearLine =
|
|
283
|
-
return !
|
|
284
|
+
if (n && n.json) {
|
|
285
|
+
var r = i.processChunkJson("");
|
|
286
|
+
return r.content = c, r.clearLine = n.clearLine, o.unshift(r), n.remove_empty && (o = o.filter(function(_) {
|
|
287
|
+
return !_.isEmpty();
|
|
284
288
|
})), o;
|
|
285
289
|
} else
|
|
286
290
|
o.unshift(c);
|
|
@@ -313,16 +317,16 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
313
317
|
*/
|
|
314
318
|
}, {
|
|
315
319
|
key: "processChunkJson",
|
|
316
|
-
value: function(s,
|
|
317
|
-
|
|
318
|
-
var y =
|
|
320
|
+
value: function(s, n, f) {
|
|
321
|
+
n = typeof n > "u" ? {} : n;
|
|
322
|
+
var y = n.use_classes = typeof n.use_classes < "u" && n.use_classes, i = n.key = y ? "class" : "color", u = {
|
|
319
323
|
content: s,
|
|
320
324
|
fg: null,
|
|
321
325
|
bg: null,
|
|
322
326
|
fg_truecolor: null,
|
|
323
327
|
bg_truecolor: null,
|
|
324
328
|
isInverted: !1,
|
|
325
|
-
clearLine:
|
|
329
|
+
clearLine: n.clearLine,
|
|
326
330
|
decoration: null,
|
|
327
331
|
decorations: [],
|
|
328
332
|
was_processed: !1,
|
|
@@ -336,55 +340,55 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
336
340
|
if (c[1] !== "" || c[3] !== "m" || !f)
|
|
337
341
|
return u;
|
|
338
342
|
for (var r = this; o.length > 0; ) {
|
|
339
|
-
var
|
|
340
|
-
if (isNaN(
|
|
343
|
+
var _ = o.shift(), a = parseInt(_);
|
|
344
|
+
if (isNaN(a) || a === 0)
|
|
341
345
|
r.fg = r.bg = null, r.decorations = [];
|
|
342
|
-
else if (
|
|
346
|
+
else if (a === 1)
|
|
343
347
|
r.decorations.push("bold");
|
|
344
|
-
else if (
|
|
348
|
+
else if (a === 2)
|
|
345
349
|
r.decorations.push("dim");
|
|
346
|
-
else if (
|
|
350
|
+
else if (a === 3)
|
|
347
351
|
r.decorations.push("italic");
|
|
348
|
-
else if (
|
|
352
|
+
else if (a === 4)
|
|
349
353
|
r.decorations.push("underline");
|
|
350
|
-
else if (
|
|
354
|
+
else if (a === 5)
|
|
351
355
|
r.decorations.push("blink");
|
|
352
|
-
else if (
|
|
356
|
+
else if (a === 7)
|
|
353
357
|
r.decorations.push("reverse");
|
|
354
|
-
else if (
|
|
358
|
+
else if (a === 8)
|
|
355
359
|
r.decorations.push("hidden");
|
|
356
|
-
else if (
|
|
360
|
+
else if (a === 9)
|
|
357
361
|
r.decorations.push("strikethrough");
|
|
358
|
-
else if (
|
|
362
|
+
else if (a === 21)
|
|
359
363
|
r.removeDecoration("bold");
|
|
360
|
-
else if (
|
|
364
|
+
else if (a === 22)
|
|
361
365
|
r.removeDecoration("bold"), r.removeDecoration("dim");
|
|
362
|
-
else if (
|
|
366
|
+
else if (a === 23)
|
|
363
367
|
r.removeDecoration("italic");
|
|
364
|
-
else if (
|
|
368
|
+
else if (a === 24)
|
|
365
369
|
r.removeDecoration("underline");
|
|
366
|
-
else if (
|
|
370
|
+
else if (a === 25)
|
|
367
371
|
r.removeDecoration("blink");
|
|
368
|
-
else if (
|
|
372
|
+
else if (a === 27)
|
|
369
373
|
r.removeDecoration("reverse");
|
|
370
|
-
else if (
|
|
374
|
+
else if (a === 28)
|
|
371
375
|
r.removeDecoration("hidden");
|
|
372
|
-
else if (
|
|
376
|
+
else if (a === 29)
|
|
373
377
|
r.removeDecoration("strikethrough");
|
|
374
|
-
else if (
|
|
378
|
+
else if (a === 39)
|
|
375
379
|
r.fg = null;
|
|
376
|
-
else if (
|
|
380
|
+
else if (a === 49)
|
|
377
381
|
r.bg = null;
|
|
378
|
-
else if (
|
|
379
|
-
r.fg =
|
|
380
|
-
else if (
|
|
381
|
-
r.fg =
|
|
382
|
-
else if (
|
|
383
|
-
r.bg =
|
|
384
|
-
else if (
|
|
385
|
-
r.bg =
|
|
386
|
-
else if (
|
|
387
|
-
var b =
|
|
382
|
+
else if (a >= 30 && a < 38)
|
|
383
|
+
r.fg = L[0][a % 10][i];
|
|
384
|
+
else if (a >= 90 && a < 98)
|
|
385
|
+
r.fg = L[1][a % 10][i];
|
|
386
|
+
else if (a >= 40 && a < 48)
|
|
387
|
+
r.bg = L[0][a % 10][i];
|
|
388
|
+
else if (a >= 100 && a < 108)
|
|
389
|
+
r.bg = L[1][a % 10][i];
|
|
390
|
+
else if (a === 38 || a === 48) {
|
|
391
|
+
var b = a === 38;
|
|
388
392
|
if (o.length >= 1) {
|
|
389
393
|
var k = o.shift();
|
|
390
394
|
if (k === "5" && o.length >= 1) {
|
|
@@ -393,14 +397,14 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
393
397
|
if (!y)
|
|
394
398
|
this.PALETTE_COLORS || r.setupPalette(), b ? r.fg = this.PALETTE_COLORS[h] : r.bg = this.PALETTE_COLORS[h];
|
|
395
399
|
else {
|
|
396
|
-
var
|
|
397
|
-
b ? r.fg =
|
|
400
|
+
var E = h >= 16 ? "ansi-palette-" + h : L[h > 7 ? 1 : 0][h % 8].class;
|
|
401
|
+
b ? r.fg = E : r.bg = E;
|
|
398
402
|
}
|
|
399
403
|
} else if (k === "2" && o.length >= 3) {
|
|
400
|
-
var
|
|
401
|
-
if (
|
|
402
|
-
var
|
|
403
|
-
y ? b ? (r.fg = "ansi-truecolor", r.fg_truecolor =
|
|
404
|
+
var $ = parseInt(o.shift()), R = parseInt(o.shift()), D = parseInt(o.shift());
|
|
405
|
+
if ($ >= 0 && $ <= 255 && R >= 0 && R <= 255 && D >= 0 && D <= 255) {
|
|
406
|
+
var A = $ + ", " + R + ", " + D;
|
|
407
|
+
y ? b ? (r.fg = "ansi-truecolor", r.fg_truecolor = A) : (r.bg = "ansi-truecolor", r.bg_truecolor = A) : b ? r.fg = A : r.bg = A;
|
|
404
408
|
}
|
|
405
409
|
}
|
|
406
410
|
}
|
|
@@ -425,201 +429,201 @@ var A = [[{ color: "0, 0, 0", class: "ansi-black" }, { color: "187, 0, 0", class
|
|
|
425
429
|
*/
|
|
426
430
|
}, {
|
|
427
431
|
key: "processChunk",
|
|
428
|
-
value: function(s,
|
|
432
|
+
value: function(s, n, f) {
|
|
429
433
|
var y = this;
|
|
430
|
-
|
|
431
|
-
var
|
|
432
|
-
if (
|
|
434
|
+
n = n || {};
|
|
435
|
+
var i = this.processChunkJson(s, n, f), u = n.use_classes;
|
|
436
|
+
if (i.decorations = i.decorations.filter(function(b) {
|
|
433
437
|
if (b === "reverse") {
|
|
434
|
-
|
|
435
|
-
var k =
|
|
436
|
-
|
|
437
|
-
var h =
|
|
438
|
-
return
|
|
438
|
+
i.fg || (i.fg = L[0][7][u ? "class" : "color"]), i.bg || (i.bg = L[0][0][u ? "class" : "color"]);
|
|
439
|
+
var k = i.fg;
|
|
440
|
+
i.fg = i.bg, i.bg = k;
|
|
441
|
+
var h = i.fg_truecolor;
|
|
442
|
+
return i.fg_truecolor = i.bg_truecolor, i.bg_truecolor = h, i.isInverted = !0, !1;
|
|
439
443
|
}
|
|
440
444
|
return !0;
|
|
441
|
-
}),
|
|
442
|
-
return
|
|
443
|
-
if (
|
|
445
|
+
}), n.json)
|
|
446
|
+
return i;
|
|
447
|
+
if (i.isEmpty())
|
|
444
448
|
return "";
|
|
445
|
-
if (!
|
|
446
|
-
return
|
|
447
|
-
var c = [], o = [], r = [],
|
|
448
|
-
var h = [],
|
|
449
|
-
for (
|
|
450
|
-
k.hasOwnProperty(
|
|
449
|
+
if (!i.was_processed)
|
|
450
|
+
return i.content;
|
|
451
|
+
var c = [], o = [], r = [], _ = {}, a = function(k) {
|
|
452
|
+
var h = [], E = void 0;
|
|
453
|
+
for (E in k)
|
|
454
|
+
k.hasOwnProperty(E) && h.push("data-" + E + '="' + y.escapeForHtml(k[E]) + '"');
|
|
451
455
|
return h.length > 0 ? " " + h.join(" ") : "";
|
|
452
456
|
};
|
|
453
|
-
return
|
|
457
|
+
return i.isInverted && (_["ansi-is-inverted"] = "true"), i.fg && (u ? (c.push(i.fg + "-fg"), i.fg_truecolor !== null && (_["ansi-truecolor-fg"] = i.fg_truecolor, i.fg_truecolor = null)) : c.push("color:rgb(" + i.fg + ")")), i.bg && (u ? (c.push(i.bg + "-bg"), i.bg_truecolor !== null && (_["ansi-truecolor-bg"] = i.bg_truecolor, i.bg_truecolor = null)) : c.push("background-color:rgb(" + i.bg + ")")), i.decorations.forEach(function(b) {
|
|
454
458
|
if (u) {
|
|
455
459
|
o.push("ansi-" + b);
|
|
456
460
|
return;
|
|
457
461
|
}
|
|
458
462
|
b === "bold" ? o.push("font-weight:bold") : b === "dim" ? o.push("opacity:0.5") : b === "italic" ? o.push("font-style:italic") : b === "hidden" ? o.push("visibility:hidden") : b === "strikethrough" ? r.push("line-through") : r.push(b);
|
|
459
|
-
}), r.length && o.push("text-decoration:" + r.join(" ")), u ? '<span class="' + c.concat(o).join(" ") + '"' +
|
|
463
|
+
}), r.length && o.push("text-decoration:" + r.join(" ")), u ? '<span class="' + c.concat(o).join(" ") + '"' + a(_) + ">" + i.content + "</span>" : '<span style="' + c.concat(o).join(";") + '"' + a(_) + ">" + i.content + "</span>";
|
|
460
464
|
}
|
|
461
465
|
}, {
|
|
462
466
|
key: "removeDecoration",
|
|
463
467
|
value: function(s) {
|
|
464
|
-
var
|
|
465
|
-
|
|
468
|
+
var n = this.decorations.indexOf(s);
|
|
469
|
+
n >= 0 && this.decorations.splice(n, 1);
|
|
466
470
|
}
|
|
467
|
-
}]),
|
|
468
|
-
}(),
|
|
469
|
-
const
|
|
470
|
-
var
|
|
471
|
-
function
|
|
472
|
-
if (!
|
|
473
|
-
if (!/\r/.test(
|
|
474
|
-
for (
|
|
475
|
-
`); /\r./.test(
|
|
476
|
-
|
|
477
|
-
return
|
|
471
|
+
}]), t;
|
|
472
|
+
}(), nt = st;
|
|
473
|
+
const rt = /* @__PURE__ */ Ye(nt);
|
|
474
|
+
var ee = { exports: {} };
|
|
475
|
+
function te(t) {
|
|
476
|
+
if (!t) return "";
|
|
477
|
+
if (!/\r/.test(t)) return t;
|
|
478
|
+
for (t = t.replace(/\r+\n/gm, `
|
|
479
|
+
`); /\r./.test(t); )
|
|
480
|
+
t = t.replace(/^([^\r\n]*)\r+([^\r\n]+)/gm, function(e, s, n) {
|
|
481
|
+
return n + s.slice(n.length);
|
|
478
482
|
});
|
|
479
|
-
return
|
|
483
|
+
return t;
|
|
480
484
|
}
|
|
481
|
-
function
|
|
482
|
-
for (var
|
|
483
|
-
e
|
|
484
|
-
return
|
|
485
|
+
function it(t) {
|
|
486
|
+
for (var e = 0, s = 0; s < t.length; s++)
|
|
487
|
+
t[e].length <= t[s].length && (e = s);
|
|
488
|
+
return e;
|
|
485
489
|
}
|
|
486
|
-
function
|
|
487
|
-
if (!/\r/.test(
|
|
488
|
-
for (var
|
|
489
|
-
var
|
|
490
|
-
s.push(n
|
|
490
|
+
function Ce(t) {
|
|
491
|
+
if (!/\r/.test(t)) return t;
|
|
492
|
+
for (var e = t.split("\r"), s = []; e.length > 0; ) {
|
|
493
|
+
var n = it(e);
|
|
494
|
+
s.push(e[n]), e = e.slice(n + 1);
|
|
491
495
|
}
|
|
492
496
|
return s.join("\r");
|
|
493
497
|
}
|
|
494
|
-
function
|
|
495
|
-
if (!
|
|
496
|
-
if (!/\r/.test(
|
|
497
|
-
if (!/\n/.test(
|
|
498
|
-
|
|
498
|
+
function at(t) {
|
|
499
|
+
if (!t) return "";
|
|
500
|
+
if (!/\r/.test(t)) return t;
|
|
501
|
+
if (!/\n/.test(t)) return Ce(t);
|
|
502
|
+
t = t.replace(/\r+\n/gm, `
|
|
499
503
|
`);
|
|
500
|
-
var
|
|
504
|
+
var e = t.lastIndexOf(`
|
|
501
505
|
`);
|
|
502
|
-
return
|
|
503
|
-
` +
|
|
506
|
+
return te(t.slice(0, e)) + `
|
|
507
|
+
` + Ce(t.slice(e + 1));
|
|
504
508
|
}
|
|
505
|
-
|
|
506
|
-
var
|
|
507
|
-
|
|
508
|
-
function
|
|
509
|
-
return
|
|
509
|
+
ee.exports = te;
|
|
510
|
+
var ot = ee.exports.escapeCarriageReturn = te;
|
|
511
|
+
ee.exports.escapeCarriageReturnSafe = at;
|
|
512
|
+
function lt(t, e) {
|
|
513
|
+
return t = ot(ht(t)), rt.ansiToJson(t, {
|
|
510
514
|
json: !0,
|
|
511
515
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
512
516
|
remove_empty: !0,
|
|
513
517
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
514
|
-
use_classes:
|
|
518
|
+
use_classes: e
|
|
515
519
|
});
|
|
516
520
|
}
|
|
517
|
-
function
|
|
518
|
-
const
|
|
519
|
-
return
|
|
521
|
+
function ct(t) {
|
|
522
|
+
const e = [];
|
|
523
|
+
return t.bg && e.push(M[`${t.bg}-bg`]), t.fg && e.push(M[`${t.fg}-fg`]), t.decoration && e.push(M[`ansi-${t.decoration}`]), e.length === 0 ? null : e.join(" ");
|
|
520
524
|
}
|
|
521
|
-
function
|
|
522
|
-
const
|
|
523
|
-
switch (
|
|
525
|
+
function ut(t) {
|
|
526
|
+
const e = {};
|
|
527
|
+
switch (t.bg && (e.backgroundColor = `rgb(${t.bg})`), t.fg && (e.color = `rgb(${t.fg})`), t.decoration) {
|
|
524
528
|
case "bold":
|
|
525
|
-
|
|
529
|
+
e.fontWeight = "bold";
|
|
526
530
|
break;
|
|
527
531
|
case "dim":
|
|
528
|
-
|
|
532
|
+
e.opacity = "0.5";
|
|
529
533
|
break;
|
|
530
534
|
case "italic":
|
|
531
|
-
|
|
535
|
+
e.fontStyle = "italic";
|
|
532
536
|
break;
|
|
533
537
|
case "hidden":
|
|
534
|
-
|
|
538
|
+
e.visibility = "hidden";
|
|
535
539
|
break;
|
|
536
540
|
case "strikethrough":
|
|
537
|
-
|
|
541
|
+
e.textDecoration = "line-through";
|
|
538
542
|
break;
|
|
539
543
|
case "underline":
|
|
540
|
-
|
|
544
|
+
e.textDecoration = "underline";
|
|
541
545
|
break;
|
|
542
546
|
case "blink":
|
|
543
|
-
|
|
547
|
+
e.textDecoration = "blink";
|
|
544
548
|
break;
|
|
545
549
|
}
|
|
546
|
-
return
|
|
550
|
+
return e;
|
|
547
551
|
}
|
|
548
|
-
function
|
|
549
|
-
const f =
|
|
550
|
-
if (!
|
|
551
|
-
return
|
|
552
|
+
function ft(t, e, s, n) {
|
|
553
|
+
const f = e ? null : ut(s), y = e ? ct(s) : null;
|
|
554
|
+
if (!t)
|
|
555
|
+
return G.createElement(
|
|
552
556
|
"pre",
|
|
553
|
-
{ style: f, key:
|
|
557
|
+
{ style: f, key: n, className: y },
|
|
554
558
|
s.content
|
|
555
559
|
);
|
|
556
|
-
const
|
|
560
|
+
const i = [], u = /(\s|^)(https?:\/\/(?:www\.|(?!www))[^\s.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/g;
|
|
557
561
|
let c = 0, o;
|
|
558
562
|
for (; (o = u.exec(s.content)) !== null; ) {
|
|
559
|
-
const [, r,
|
|
560
|
-
|
|
561
|
-
const b =
|
|
562
|
-
|
|
563
|
-
|
|
563
|
+
const [, r, _] = o, a = o.index + r.length;
|
|
564
|
+
a > c && i.push(s.content.substring(c, a));
|
|
565
|
+
const b = _.startsWith("www.") ? `http://${_}` : _;
|
|
566
|
+
i.push(
|
|
567
|
+
G.createElement(
|
|
564
568
|
"a",
|
|
565
569
|
{
|
|
566
570
|
key: c,
|
|
567
571
|
href: b,
|
|
568
572
|
target: "_blank"
|
|
569
573
|
},
|
|
570
|
-
`${
|
|
574
|
+
`${_}`
|
|
571
575
|
)
|
|
572
576
|
), c = u.lastIndex;
|
|
573
577
|
}
|
|
574
|
-
return c < s.content.length &&
|
|
578
|
+
return c < s.content.length && i.push(s.content.substring(c)), G.createElement("span", { style: f, key: n, className: y }, i);
|
|
575
579
|
}
|
|
576
|
-
function
|
|
577
|
-
const { className:
|
|
578
|
-
return
|
|
580
|
+
function Se(t) {
|
|
581
|
+
const { className: e, useClasses: s, children: n, linkify: f } = t;
|
|
582
|
+
return G.createElement(
|
|
579
583
|
"code",
|
|
580
|
-
{ className:
|
|
581
|
-
|
|
584
|
+
{ className: e },
|
|
585
|
+
lt(n ?? "", s ?? !1).map(
|
|
582
586
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
583
|
-
|
|
587
|
+
ft.bind(null, f ?? !1, s ?? !1)
|
|
584
588
|
)
|
|
585
589
|
);
|
|
586
590
|
}
|
|
587
|
-
function
|
|
588
|
-
let
|
|
591
|
+
function ht(t) {
|
|
592
|
+
let e = t;
|
|
589
593
|
do
|
|
590
|
-
|
|
591
|
-
while (
|
|
592
|
-
return
|
|
594
|
+
t = e, e = t.replace(/[^\n]\x08/gm, "");
|
|
595
|
+
while (e.length < t.length);
|
|
596
|
+
return t;
|
|
593
597
|
}
|
|
594
|
-
const
|
|
595
|
-
const s =
|
|
598
|
+
const Oe = ze(({ text: t }, e) => {
|
|
599
|
+
const s = t == null ? void 0 : t.split(`
|
|
596
600
|
`);
|
|
597
|
-
return /* @__PURE__ */
|
|
598
|
-
(
|
|
601
|
+
return /* @__PURE__ */ N("div", { ref: e, children: s == null ? void 0 : s.map(
|
|
602
|
+
(n, f) => /* @__PURE__ */ N(Se, { className: M.Output, useClasses: !0, children: n === "" ? " " : n }, f)
|
|
599
603
|
) });
|
|
600
604
|
});
|
|
601
|
-
function
|
|
602
|
-
const [
|
|
605
|
+
function gt({ value: t, prefix: e, onChange: s, onKeyUp: n, onKeyDown: f, inputRef: y }) {
|
|
606
|
+
const [i, u] = T(0), c = () => {
|
|
603
607
|
var r;
|
|
604
608
|
const o = (r = y.current) == null ? void 0 : r.selectionStart;
|
|
605
609
|
o != null && u(o);
|
|
606
610
|
};
|
|
607
|
-
return /* @__PURE__ */ Y("span", { className:
|
|
608
|
-
|
|
609
|
-
/* @__PURE__ */ Y("span", { className:
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
/* @__PURE__ */
|
|
611
|
+
return /* @__PURE__ */ Y("span", { className: M.Input, children: [
|
|
612
|
+
e && /* @__PURE__ */ N(Se, { className: M.Prefix, useClasses: !0, children: e }),
|
|
613
|
+
/* @__PURE__ */ Y("span", { className: M["Input-container"], style: { "--cursor-offset": i }, children: [
|
|
614
|
+
/* @__PURE__ */ N("span", { "aria-hidden": "true", children: t }),
|
|
615
|
+
/* @__PURE__ */ N(
|
|
612
616
|
"input",
|
|
613
617
|
{
|
|
614
618
|
id: "input",
|
|
615
|
-
value:
|
|
619
|
+
value: t,
|
|
616
620
|
"aria-label": "Command input",
|
|
617
621
|
onChange: (o) => {
|
|
618
622
|
s(o), c();
|
|
619
623
|
},
|
|
620
624
|
ref: y,
|
|
621
625
|
onKeyUp: (o) => {
|
|
622
|
-
|
|
626
|
+
n == null || n(o);
|
|
623
627
|
},
|
|
624
628
|
onKeyDown: (o) => {
|
|
625
629
|
f == null || f(o), c();
|
|
@@ -638,9 +642,9 @@ function lt({ value: e, prefix: n, onChange: s, onKeyUp: t, onKeyDown: f, inputR
|
|
|
638
642
|
] })
|
|
639
643
|
] });
|
|
640
644
|
}
|
|
641
|
-
const Z = "user", Q = "prozilla-os",
|
|
642
|
-
${
|
|
643
|
-
`,
|
|
645
|
+
const Z = "user", Q = "prozilla-os", kt = 50, Ee = `${v.fg.cyan + v.decoration.dim}$APP_NAME - Made by Prozilla${v.reset}
|
|
646
|
+
${v.decoration.dim}Type 'help' for a list of commands.${v.reset}
|
|
647
|
+
`, O = v.fg.cyan, Ct = `
|
|
644
648
|
:.
|
|
645
649
|
-==.
|
|
646
650
|
.=====:
|
|
@@ -648,22 +652,22 @@ ${_.decoration.dim}Type 'help' for a list of commands.${_.reset}
|
|
|
648
652
|
:===+=----------::..
|
|
649
653
|
=+=---------------:..
|
|
650
654
|
--------------------:.
|
|
651
|
-
.:-+=----${
|
|
652
|
-
:==+----${
|
|
653
|
-
.=----${
|
|
654
|
-
==----${
|
|
655
|
+
.:-+=----${v.fg.white}*###*${O}--${v.fg.white}*####=${O}---.
|
|
656
|
+
:==+----${v.fg.white}#%+${O}-${v.fg.white}+%#${O}-${v.fg.white}##%*+${O}----:.
|
|
657
|
+
.=----${v.fg.white}#%+${O}-${v.fg.white}+%#${O}-${v.fg.white}*+${O}-${v.fg.white}%#+${O}---:.
|
|
658
|
+
==----${v.fg.white}*###*${O}--${v.fg.white}*###*${O}----.
|
|
655
659
|
==+-------------------:.
|
|
656
660
|
...::---------------:.
|
|
657
661
|
.::---------::..
|
|
658
|
-
....::... `,
|
|
662
|
+
....::... `, mt = {
|
|
659
663
|
new: "new",
|
|
660
664
|
start: "start",
|
|
661
665
|
stop: "stop"
|
|
662
666
|
};
|
|
663
|
-
class P extends
|
|
667
|
+
class P extends Ge {
|
|
664
668
|
constructor() {
|
|
665
669
|
super(...arguments);
|
|
666
|
-
|
|
670
|
+
S(this, "enabled", !1);
|
|
667
671
|
}
|
|
668
672
|
start(s) {
|
|
669
673
|
return this.enabled ? this : (s == null || s(this), this.enabled = !0, this.emit("start"), this);
|
|
@@ -675,72 +679,65 @@ class P extends Je {
|
|
|
675
679
|
return this.enabled && this.emit("new", s), this;
|
|
676
680
|
}
|
|
677
681
|
}
|
|
678
|
-
|
|
679
|
-
function
|
|
680
|
-
return `${
|
|
682
|
+
S(P, "EVENT_NAMES", mt);
|
|
683
|
+
function q(t, e) {
|
|
684
|
+
return `${v.fg.red}${t}: ${e}${v.reset}`;
|
|
681
685
|
}
|
|
682
|
-
function
|
|
683
|
-
return
|
|
686
|
+
function Ot(t) {
|
|
687
|
+
return t.replace(/\u001b\[([0-9]+)m/gm, "");
|
|
684
688
|
}
|
|
685
|
-
let
|
|
686
|
-
const
|
|
687
|
-
|
|
688
|
-
for (const
|
|
689
|
-
|
|
690
|
-
const s = Object.keys(
|
|
691
|
-
|
|
689
|
+
let B = [];
|
|
690
|
+
const $e = /* @__PURE__ */ Object.assign({ "./commands/cat.ts": () => import("./cat-DGK7wWrK.js"), "./commands/cd.ts": () => import("./cd-DvjkW_6o.js"), "./commands/clear.ts": () => import("./clear-BF9eb1Dq.js"), "./commands/cmatrix.ts": () => import("./cmatrix-VYovsHQW.js"), "./commands/compgen.ts": () => import("./compgen-3TwdgHm_.js"), "./commands/cowsay.ts": () => import("./cowsay-IfArfPSJ.js"), "./commands/dir.ts": () => import("./dir-B_Ipo5xb.js"), "./commands/echo.ts": () => import("./echo-DX-Ar2Ut.js"), "./commands/eval.ts": () => import("./eval-C7InkmFY.js"), "./commands/exit.ts": () => import("./exit-D7PPqtiE.js"), "./commands/fortune.ts": () => import("./fortune-zyxpnYNP.js"), "./commands/help.ts": () => import("./help-BEgNbwLL.js"), "./commands/history.ts": () => import("./history-l0sNRNKZ.js"), "./commands/hostname.ts": () => import("./hostname-DU1lQde2.js"), "./commands/lolcat.ts": () => import("./lolcat-5-mBWD9l.js"), "./commands/ls.ts": () => import("./ls-DnkSPHVM.js"), "./commands/make.ts": () => import("./make-DqVQDThH.js"), "./commands/man.ts": () => import("./man-D_hBUTDt.js"), "./commands/mkdir.ts": () => import("./mkdir-BCvMrPTX.js"), "./commands/neofetch.ts": () => import("./neofetch-BFHOITJj.js"), "./commands/pwd.ts": () => import("./pwd-C21tQanw.js"), "./commands/reboot.ts": () => import("./reboot-C2t7a3Av.js"), "./commands/reload.ts": () => import("./reload-C9o_dGZw.js"), "./commands/rev.ts": () => import("./rev-CBibYebM.js"), "./commands/rm.ts": () => import("./rm-ChTrwld4.js"), "./commands/rmdir.ts": () => import("./rmdir-CUM4xt2w.js"), "./commands/sl.ts": () => import("./sl-DrATMkz6.js"), "./commands/touch.ts": () => import("./touch-CqBIAjMe.js"), "./commands/uptime.ts": () => import("./uptime-xM-0FRzA.js"), "./commands/whatis.ts": () => import("./whatis-vXemLo9m.js"), "./commands/whoami.ts": () => import("./whoami-CnUR69yX.js") }), Te = () => {
|
|
691
|
+
B = [];
|
|
692
|
+
for (const t in $e)
|
|
693
|
+
$e[t]().then((e) => {
|
|
694
|
+
const s = Object.keys(e)[0], n = e[s];
|
|
695
|
+
n != null && (n.name || n.setName(s.toLowerCase()), B.push(n));
|
|
692
696
|
});
|
|
693
697
|
};
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
static
|
|
697
|
-
|
|
698
|
-
return this.COMMANDS.forEach((t) => {
|
|
699
|
-
if (t.name === n) {
|
|
700
|
-
s = t;
|
|
701
|
-
return;
|
|
702
|
-
}
|
|
703
|
-
}), s;
|
|
698
|
+
Te();
|
|
699
|
+
class se {
|
|
700
|
+
static addCommand(e) {
|
|
701
|
+
this.COMMANDS.push(e);
|
|
704
702
|
}
|
|
705
|
-
static
|
|
706
|
-
return this.COMMANDS.
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
703
|
+
static find(e) {
|
|
704
|
+
return this.COMMANDS.find((s) => s.name == e);
|
|
705
|
+
}
|
|
706
|
+
static search(e) {
|
|
707
|
+
return this.COMMANDS.filter((s) => s.name.match(e));
|
|
710
708
|
}
|
|
711
709
|
static reload() {
|
|
712
|
-
|
|
710
|
+
Te(), this.COMMANDS = B;
|
|
713
711
|
}
|
|
714
|
-
}
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
text: e ? ye.replace("$APP_NAME", e.name) : ye,
|
|
712
|
+
}
|
|
713
|
+
S(se, "COMMANDS", B);
|
|
714
|
+
function pt({ app: t, path: e, input: s, setTitle: n, close: f, active: y, focus: i }) {
|
|
715
|
+
const u = Fe(), [c, o] = T(0), [r, _] = T(s ?? ""), [a, b] = T([{
|
|
716
|
+
text: t ? Ee.replace("$APP_NAME", t.name) : Ee,
|
|
720
717
|
isInput: !1
|
|
721
|
-
}]), k =
|
|
718
|
+
}]), k = qe(), [h, E] = T(k == null ? void 0 : k.navigate(e ?? "~")), $ = ye(null), [R, D] = T(0), [A, K] = T(null), [U, ne] = T(null), x = ye(null), [re, ie] = T(!1), Ae = Je();
|
|
722
719
|
z(() => {
|
|
723
|
-
h != null && (
|
|
724
|
-
}, [h == null ? void 0 : h.path, h == null ? void 0 : h.root,
|
|
725
|
-
|
|
726
|
-
}, [
|
|
727
|
-
const
|
|
728
|
-
|
|
720
|
+
h != null && (n == null || n(`${Z}@${Q}: ${h.root ? "/" : h.path}`));
|
|
721
|
+
}, [h == null ? void 0 : h.path, h == null ? void 0 : h.root, n]), z(() => {
|
|
722
|
+
!$.current || !y || $.current.focus();
|
|
723
|
+
}, [$, y]);
|
|
724
|
+
const ae = () => {
|
|
725
|
+
x.current.scrollTop = x.current.scrollHeight;
|
|
729
726
|
};
|
|
730
727
|
z(() => {
|
|
731
|
-
re ||
|
|
732
|
-
}, [re, U,
|
|
733
|
-
|
|
728
|
+
re || x.current == null || U == null || (ae(), ie(!0));
|
|
729
|
+
}, [re, U, x]), z(() => {
|
|
730
|
+
x.current == null || A != null || ae();
|
|
734
731
|
}, [r]);
|
|
735
|
-
const oe = `${
|
|
732
|
+
const oe = `${v.fg.cyan + Z}@${Q + v.reset}:${v.fg.blue + (h != null && h.root || h == null ? "/" : h == null ? void 0 : h.path) + v.reset}$ `, le = a, X = (l) => {
|
|
736
733
|
le.push(l), b(le);
|
|
737
|
-
},
|
|
734
|
+
}, V = (l) => {
|
|
738
735
|
X({
|
|
739
736
|
text: l,
|
|
740
737
|
isInput: !1
|
|
741
738
|
});
|
|
742
|
-
},
|
|
743
|
-
K(l),
|
|
739
|
+
}, Ie = (l, p) => {
|
|
740
|
+
K(l), ie(!1);
|
|
744
741
|
const g = (d) => {
|
|
745
742
|
y && (d.ctrlKey || d.metaKey) && d.key === "c" && l.stop();
|
|
746
743
|
};
|
|
@@ -751,13 +748,13 @@ function ut({ app: e, path: n, input: s, setTitle: t, close: f, active: y, focus
|
|
|
751
748
|
for (const I of p)
|
|
752
749
|
w instanceof P || (w = await ce(w ? `${I} ${w}` : I));
|
|
753
750
|
if (w instanceof P) {
|
|
754
|
-
l.stop(),
|
|
751
|
+
l.stop(), V(v.fg.red + "Stream failed");
|
|
755
752
|
return;
|
|
756
753
|
}
|
|
757
|
-
m = w,
|
|
754
|
+
m = w, ne(w);
|
|
758
755
|
})();
|
|
759
756
|
}), l.on(P.EVENT_NAMES.stop, () => {
|
|
760
|
-
document.removeEventListener("keydown", g),
|
|
757
|
+
document.removeEventListener("keydown", g), V(m), K(null), ne(null);
|
|
761
758
|
}), document.addEventListener("keydown", g);
|
|
762
759
|
}, ce = async (l) => {
|
|
763
760
|
var he;
|
|
@@ -768,41 +765,41 @@ function ut({ app: e, path: n, input: s, setTitle: t, close: f, active: y, focus
|
|
|
768
765
|
d[0].toLowerCase() === "sudo" && d.length >= 2 && d.shift();
|
|
769
766
|
const w = (he = d.shift()) == null ? void 0 : he.toLowerCase();
|
|
770
767
|
if (w == null) return;
|
|
771
|
-
const I =
|
|
772
|
-
if (!I) return
|
|
768
|
+
const I = se.find(w);
|
|
769
|
+
if (!I) return q(w, "Command not found");
|
|
773
770
|
d = d.map((C) => C.startsWith('"') && C.endsWith('"') ? C.slice(1, -1) : C);
|
|
774
771
|
const H = [], fe = {};
|
|
775
772
|
if (d.filter((C) => C.startsWith("-")).forEach((C) => {
|
|
776
|
-
const ge = (
|
|
777
|
-
if (H.includes(
|
|
773
|
+
const ge = (F) => {
|
|
774
|
+
if (H.includes(F))
|
|
778
775
|
return;
|
|
779
|
-
H.push(
|
|
780
|
-
const
|
|
781
|
-
if (
|
|
776
|
+
H.push(F);
|
|
777
|
+
const j = I.getOption(H[H.length - 1]);
|
|
778
|
+
if (j != null && j.isInput) {
|
|
782
779
|
const me = d[d.indexOf(C) + 1];
|
|
783
|
-
fe[
|
|
780
|
+
fe[j.short] = me, we(me, d);
|
|
784
781
|
}
|
|
785
782
|
};
|
|
786
783
|
if (C.startsWith("--")) {
|
|
787
|
-
const
|
|
788
|
-
ge(
|
|
784
|
+
const F = C.substring(2).toLowerCase();
|
|
785
|
+
ge(F);
|
|
789
786
|
} else
|
|
790
|
-
C.substring(1).split("").forEach((
|
|
791
|
-
ge(
|
|
787
|
+
C.substring(1).split("").forEach((j) => {
|
|
788
|
+
ge(j);
|
|
792
789
|
});
|
|
793
|
-
|
|
790
|
+
we(C, d);
|
|
794
791
|
}), I.requireArgs && d.length === 0)
|
|
795
|
-
return
|
|
792
|
+
return q(w, `Incorrect usage: ${w} requires at least 1 argument`);
|
|
796
793
|
if (I.requireOptions && H.length === 0)
|
|
797
|
-
return
|
|
798
|
-
let
|
|
794
|
+
return q(w, `Incorrect usage: ${w} requires at least 1 option`);
|
|
795
|
+
let W = null;
|
|
799
796
|
try {
|
|
800
|
-
if (
|
|
801
|
-
promptOutput:
|
|
797
|
+
if (W = await I.execute(d, {
|
|
798
|
+
promptOutput: V,
|
|
802
799
|
pushHistory: X,
|
|
803
800
|
virtualRoot: k,
|
|
804
801
|
currentDirectory: h,
|
|
805
|
-
setCurrentDirectory:
|
|
802
|
+
setCurrentDirectory: E,
|
|
806
803
|
username: Z,
|
|
807
804
|
hostname: Q,
|
|
808
805
|
rawInputValue: g,
|
|
@@ -810,19 +807,19 @@ function ut({ app: e, path: n, input: s, setTitle: t, close: f, active: y, focus
|
|
|
810
807
|
exit: f,
|
|
811
808
|
inputs: fe,
|
|
812
809
|
timestamp: m,
|
|
813
|
-
settingsManager:
|
|
810
|
+
settingsManager: Ae,
|
|
814
811
|
systemManager: u,
|
|
815
|
-
app:
|
|
816
|
-
}),
|
|
817
|
-
return
|
|
818
|
-
if (!
|
|
819
|
-
return
|
|
812
|
+
app: t
|
|
813
|
+
}), W == null)
|
|
814
|
+
return q(w, "Command failed");
|
|
815
|
+
if (!W.blank)
|
|
816
|
+
return W;
|
|
820
817
|
} catch (C) {
|
|
821
|
-
return console.error(C),
|
|
818
|
+
return console.error(C), q(w, "Command failed");
|
|
822
819
|
}
|
|
823
|
-
},
|
|
824
|
-
|
|
825
|
-
},
|
|
820
|
+
}, Le = () => {
|
|
821
|
+
_(""), D(0);
|
|
822
|
+
}, Ne = async (l) => {
|
|
826
823
|
X({
|
|
827
824
|
text: oe + l,
|
|
828
825
|
isInput: !0,
|
|
@@ -833,58 +830,58 @@ function ut({ app: e, path: n, input: s, setTitle: t, close: f, active: y, focus
|
|
|
833
830
|
let m = null;
|
|
834
831
|
for (const d of p)
|
|
835
832
|
m instanceof P || (m = await ce(m ? `${d} ${m}` : d), g.push(d));
|
|
836
|
-
|
|
833
|
+
Le(), p = p.filter((d) => !g.includes(d)), m && (m instanceof P ? Ie(m, p) : V(`${m}
|
|
837
834
|
`));
|
|
838
835
|
}, ue = (l) => {
|
|
839
|
-
const p =
|
|
840
|
-
if (g ===
|
|
841
|
-
l < 0 &&
|
|
836
|
+
const p = a.filter(({ isInput: m }) => m), g = Be(R + l, 0, p.length);
|
|
837
|
+
if (g === R) {
|
|
838
|
+
l < 0 && _("");
|
|
842
839
|
return;
|
|
843
840
|
}
|
|
844
|
-
|
|
845
|
-
},
|
|
841
|
+
_(g === 0 ? "" : p[p.length - g].value ?? ""), D(g);
|
|
842
|
+
}, Me = (l) => {
|
|
846
843
|
const p = l.target.value, { key: g } = l;
|
|
847
|
-
g === "Enter" ? (
|
|
848
|
-
},
|
|
844
|
+
g === "Enter" ? (Ne(p), o((m) => m + 1)) : g === "ArrowUp" ? (l.preventDefault(), ue(1)) : g === "ArrowDown" ? (l.preventDefault(), ue(-1)) : !A && (l.ctrlKey || l.metaKey) && g === "c" && _((m) => m + "^C");
|
|
845
|
+
}, Pe = (l) => {
|
|
849
846
|
const p = l.target.value;
|
|
850
|
-
return
|
|
851
|
-
},
|
|
852
|
-
const l =
|
|
847
|
+
return _(p);
|
|
848
|
+
}, Re = () => {
|
|
849
|
+
const l = a.slice(-16);
|
|
853
850
|
let p = 0;
|
|
854
851
|
return l.forEach((g, m) => {
|
|
855
852
|
g.clear && (p = m + 1);
|
|
856
|
-
}), l.slice(p).map(({ text: g }, m) => /* @__PURE__ */
|
|
857
|
-
},
|
|
853
|
+
}), l.slice(p).map(({ text: g }, m) => /* @__PURE__ */ N(Oe, { text: g }, m));
|
|
854
|
+
}, De = (l) => {
|
|
858
855
|
var p, g;
|
|
859
|
-
|
|
860
|
-
|
|
856
|
+
i == null || i(l), l.button === 2 && (l.preventDefault(), (g = (p = navigator.clipboard).readText) == null || g.call(p).then((m) => {
|
|
857
|
+
_(r + m);
|
|
861
858
|
}).catch((m) => {
|
|
862
859
|
console.error(m);
|
|
863
860
|
}));
|
|
864
|
-
},
|
|
861
|
+
}, xe = (l) => {
|
|
865
862
|
l.preventDefault();
|
|
866
863
|
};
|
|
867
864
|
return /* @__PURE__ */ Y(
|
|
868
865
|
"div",
|
|
869
866
|
{
|
|
870
|
-
ref:
|
|
871
|
-
className:
|
|
872
|
-
onMouseDown:
|
|
873
|
-
onContextMenu:
|
|
867
|
+
ref: x,
|
|
868
|
+
className: M.Terminal,
|
|
869
|
+
onMouseDown: De,
|
|
870
|
+
onContextMenu: xe,
|
|
874
871
|
onClick: (l) => {
|
|
875
872
|
var p, g;
|
|
876
|
-
((p = window.getSelection()) == null ? void 0 : p.toString()) === "" && (l.preventDefault(), (g =
|
|
873
|
+
((p = window.getSelection()) == null ? void 0 : p.toString()) === "" && (l.preventDefault(), (g = $.current) == null || g.focus());
|
|
877
874
|
},
|
|
878
875
|
children: [
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
876
|
+
Re(),
|
|
877
|
+
A ? /* @__PURE__ */ N(Oe, { text: U ?? "" }) : /* @__PURE__ */ N(
|
|
878
|
+
gt,
|
|
882
879
|
{
|
|
883
880
|
value: r,
|
|
884
881
|
prefix: oe,
|
|
885
|
-
onKeyDown:
|
|
886
|
-
onChange:
|
|
887
|
-
inputRef:
|
|
882
|
+
onKeyDown: Me,
|
|
883
|
+
onChange: Pe,
|
|
884
|
+
inputRef: $
|
|
888
885
|
},
|
|
889
886
|
c
|
|
890
887
|
)
|
|
@@ -892,16 +889,69 @@ function ut({ app: e, path: n, input: s, setTitle: t, close: f, active: y, focus
|
|
|
892
889
|
}
|
|
893
890
|
);
|
|
894
891
|
}
|
|
895
|
-
|
|
896
|
-
|
|
892
|
+
class dt extends Ve {
|
|
893
|
+
constructor() {
|
|
894
|
+
super("Terminal", "terminal", pt), this.setIconUrl("https://os.prozilla.dev/assets/apps/icons/terminal.svg"), this.setRole(We.APP_ROLES.terminal), this.setCategory("Utilities & tools");
|
|
895
|
+
}
|
|
896
|
+
addCommands(e) {
|
|
897
|
+
return e.forEach((s) => this.addCommand(s)), this;
|
|
898
|
+
}
|
|
899
|
+
addCommand(e) {
|
|
900
|
+
return se.addCommand(e), this;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
var J;
|
|
904
|
+
class Et {
|
|
905
|
+
constructor() {
|
|
906
|
+
ve(this, J);
|
|
907
|
+
S(this, "options", []);
|
|
908
|
+
S(this, "manual");
|
|
909
|
+
S(this, "requireArgs");
|
|
910
|
+
S(this, "requireOptions");
|
|
911
|
+
S(this, "execute", () => {
|
|
912
|
+
});
|
|
913
|
+
}
|
|
914
|
+
setName(e) {
|
|
915
|
+
var s;
|
|
916
|
+
return be(this, J, e), e && !((s = this.manual) != null && s.usage) && (this.manual || (this.manual = {}), this.manual.usage = e), this;
|
|
917
|
+
}
|
|
918
|
+
get name() {
|
|
919
|
+
return _e(this, J) ?? "";
|
|
920
|
+
}
|
|
921
|
+
setExecute(e) {
|
|
922
|
+
return this.execute = e, this;
|
|
923
|
+
}
|
|
924
|
+
setRequireArgs(e) {
|
|
925
|
+
return this.requireArgs = e, this;
|
|
926
|
+
}
|
|
927
|
+
setRequireOptions(e) {
|
|
928
|
+
return this.requireOptions = e, this;
|
|
929
|
+
}
|
|
930
|
+
setManual({ purpose: e, usage: s, description: n, options: f }) {
|
|
931
|
+
return this.manual = { purpose: e, usage: s, description: n, options: f }, this;
|
|
932
|
+
}
|
|
933
|
+
addOption({ short: e, long: s, isInput: n }) {
|
|
934
|
+
return this.options.push({ short: e, long: s, isInput: n }), this;
|
|
935
|
+
}
|
|
936
|
+
getOption(e) {
|
|
937
|
+
let s = null;
|
|
938
|
+
return this.options.forEach((n) => {
|
|
939
|
+
(n.short === e || n.long === e) && (s = n);
|
|
940
|
+
}), s;
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
J = new WeakMap();
|
|
944
|
+
const $t = new dt();
|
|
897
945
|
export {
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
946
|
+
O as A,
|
|
947
|
+
Et as C,
|
|
948
|
+
kt as M,
|
|
901
949
|
P as S,
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
950
|
+
dt as T,
|
|
951
|
+
se as a,
|
|
952
|
+
Ct as b,
|
|
953
|
+
q as f,
|
|
954
|
+
Ot as r,
|
|
955
|
+
$t as t
|
|
906
956
|
};
|
|
907
|
-
//# sourceMappingURL=main-
|
|
957
|
+
//# sourceMappingURL=main-CXiltWT-.js.map
|