@triflare/fx 2.3.0-beta.1 → 2.3.0-beta.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triflare/fx",
3
- "version": "2.3.0-beta.1",
3
+ "version": "2.3.0-beta.2",
4
4
  "description": "Code PenguinMod projects with text.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
package/product.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  # Identity
2
2
  name: "Triflare Fx"
3
3
  command: "fx"
4
- version: "2.3.0-beta.1"
4
+ version: "2.3.0-beta.2"
5
5
  tagline: "Code PenguinMod projects with text."
6
6
  author: "Triflare"
7
7
  homepage: "https://github.com/triflare/fx"
@@ -9,6 +9,7 @@ import { featureCommand } from "./feature.js";
9
9
  import { fmtCommand } from "./fmt.js";
10
10
  import { initCommand } from "./init.js";
11
11
  import { lintCommand } from "./lint.js";
12
+ import { openCommand } from "./open.js";
12
13
  import { packageCommand } from "./package.js";
13
14
  import { registerSprite } from "./sprite/index.js";
14
15
  import { runCommand } from "./run.js";
@@ -19,6 +20,7 @@ import { defineCommand } from "../define-command.js";
19
20
  const TOP_LEVEL = [
20
21
  buildCommand,
21
22
  devCommand,
23
+ openCommand,
22
24
  packageCommand,
23
25
  decompileCommand,
24
26
  checkCommand,
@@ -0,0 +1,141 @@
1
+ import path from "node:path";
2
+ import { build } from "../../build.js";
3
+ import { sourceExtension } from "../../brand.js";
4
+ import { openBrowser, startEditorServer } from "../../editor.js";
5
+ import { slugify } from "../../package.js";
6
+ import { loadProjectState, resolveInput } from "../context.js";
7
+ import { EXIT, UsageError } from "../errors.js";
8
+ import { formatDuration } from "../format.js";
9
+
10
+ const EXTENSION = sourceExtension();
11
+
12
+ export const openCommand = {
13
+ name: "open",
14
+ aliases: ["o"],
15
+ group: "Core Commands:",
16
+ summary: "Serve a build and open it in the PenguinMod editor",
17
+ description: `Compile the project, serve the .pmp from a local HTTP server, and
18
+ open the PenguinMod editor on it through "?project_url=". The server keeps
19
+ serving the build from when it started, so restart the command to see changes.`,
20
+ arguments: [`[input${EXTENSION}|dir]`],
21
+ options: [
22
+ { flags: "--host [host]", description: "Server host" },
23
+ { flags: "--lan", description: "Listen on all interfaces" },
24
+ { flags: "--port <port>", description: "Server port (default 3000)" },
25
+ {
26
+ flags: "--strict-port",
27
+ description: "Fail instead of choosing the next free port",
28
+ },
29
+ {
30
+ flags: "--no-open",
31
+ description: "Print the editor link without a browser",
32
+ },
33
+ ],
34
+ examples: ["fx open", "fx open --port 4000", "fx open --no-open --json"],
35
+ jsonEvents: true,
36
+ async run({ args, options, cwd, reporter, prompts }) {
37
+ const target = resolveInput(args[0], cwd);
38
+ if (target.file && path.extname(target.file).toLowerCase() === ".pmp")
39
+ throw new UsageError(
40
+ "fx open needs .tfx sources or a directory, not a .pmp archive",
41
+ );
42
+
43
+ let host = "127.0.0.1";
44
+ if (options.lan) host = "0.0.0.0";
45
+ else if (options.host === true) host = "0.0.0.0";
46
+ else if (typeof options.host === "string") host = options.host;
47
+
48
+ if (options.port === true) throw new UsageError("--port needs a number");
49
+ const port = options.port === undefined ? 3000 : Number(options.port);
50
+ if (!Number.isInteger(port) || port < 0 || port > 65535)
51
+ throw new UsageError("--port must be an integer between 0 and 65535");
52
+
53
+ const started = performance.now();
54
+ const state = await loadProjectState({
55
+ input: args[0],
56
+ cwd,
57
+ options,
58
+ reporter,
59
+ prompts,
60
+ });
61
+ const result = build({
62
+ ...state.target,
63
+ projectConfig: state.loaded.project,
64
+ fxConfig: state.loaded.fx,
65
+ catalog: state.catalog,
66
+ extensionUrls: state.extensionUrls,
67
+ useConfigFile: false,
68
+ });
69
+ for (const warning of result.warnings) reporter.warn(warning);
70
+
71
+ const filename = `${slugify(
72
+ result.config.name || path.basename(state.configDir),
73
+ )}.pmp`;
74
+ const server = await startEditorServer({
75
+ data: result.sb3,
76
+ filename,
77
+ host,
78
+ port,
79
+ strictPort: Boolean(options.strictPort),
80
+ log: { warn: (message) => reporter.warn(message) },
81
+ });
82
+
83
+ const startup = {
84
+ url: server.projectUrl,
85
+ projectUrls: server.projectUrls,
86
+ editorUrl: server.editorUrl,
87
+ editorUrls: server.editorUrls,
88
+ host,
89
+ port: server.port ?? port,
90
+ };
91
+ reporter.event("start", startup);
92
+
93
+ const durationMs = Math.round(performance.now() - started);
94
+ if (!reporter.json) {
95
+ reporter.success(`Serving ${filename} (${formatDuration(durationMs)})`);
96
+ reporter.text("");
97
+ reporter.detail("Project", server.projectUrl, { width: 9 });
98
+ server.editorUrls.forEach((link, index) => {
99
+ const label =
100
+ index < server.localUrls.length
101
+ ? index === 0
102
+ ? "Editor"
103
+ : "Local"
104
+ : "Network";
105
+ reporter.detail(label, link, { width: 9 });
106
+ });
107
+ if (state.unsandboxed.length)
108
+ reporter.detail(
109
+ "Unsandboxed",
110
+ `${state.unsandboxed.join(", ")} (must be allowed in the editor)`,
111
+ { width: 9 },
112
+ );
113
+ reporter.text(
114
+ ` ${reporter.muted("Restart to pick up changes. Press Ctrl+C to stop.")}`,
115
+ );
116
+ }
117
+
118
+ if (options.open !== false) {
119
+ const opened = await openBrowser(server.editorUrl);
120
+ if (!opened)
121
+ reporter.note(
122
+ "Could not launch a browser; open the editor link above.",
123
+ );
124
+ }
125
+
126
+ let stopping = false;
127
+ const shutdown = (signal) => {
128
+ if (stopping) return;
129
+ stopping = true;
130
+ server
131
+ .close()
132
+ .finally(() =>
133
+ process.exit(signal === "SIGINT" ? EXIT.INTERRUPTED : EXIT.OK),
134
+ );
135
+ };
136
+ process.once("SIGINT", () => shutdown("SIGINT"));
137
+ process.once("SIGTERM", () => shutdown("SIGTERM"));
138
+
139
+ return startup;
140
+ },
141
+ };
package/src/editor.js ADDED
@@ -0,0 +1,305 @@
1
+ /**
2
+ * Local project server for `fx open`.
3
+ *
4
+ * PenguinMod can load a project straight from a URL (`?project_url=`), but the
5
+ * editor fetches that URL from its own origin, so the server has to answer with
6
+ * CORS headers — including the private-network preflight Chrome sends when a
7
+ * public page reaches for a loopback address.
8
+ */
9
+ import { spawn } from "node:child_process";
10
+ import http from "node:http";
11
+ import { formatDevUrls } from "./dev.js";
12
+
13
+ /** Editor page that accepts a `project_url` query parameter. */
14
+ export const PENGUINMOD_EDITOR = "https://studio.penguinmod.com/editor.html";
15
+
16
+ /**
17
+ * CORS headers for the editor origin. Same-origin access (the landing page) is
18
+ * not subject to CORS, so restricting the header does not affect it.
19
+ * @param {string} origin
20
+ * @returns {Record<string, string>}
21
+ */
22
+ function corsHeaders(origin) {
23
+ return {
24
+ "Access-Control-Allow-Origin": origin,
25
+ "Access-Control-Allow-Methods": "GET, HEAD, OPTIONS",
26
+ "Access-Control-Allow-Headers": "*",
27
+ // Chrome asks before a public page may read a loopback address.
28
+ "Access-Control-Allow-Private-Network": "true",
29
+ };
30
+ }
31
+
32
+ /**
33
+ * Origin the visitor used to reach this server, taken from a validated `Host`
34
+ * header. Returns null when the header is missing or malformed.
35
+ * @param {import("node:http").IncomingMessage} request
36
+ * @returns {string | null}
37
+ */
38
+ function requestOrigin(request) {
39
+ const host = request.headers.host;
40
+ if (!host) return null;
41
+ try {
42
+ const url = new URL(`http://${host}`);
43
+ if (url.host.toLowerCase() !== host.toLowerCase()) return null;
44
+ return url.origin;
45
+ } catch {
46
+ return null;
47
+ }
48
+ }
49
+
50
+ /**
51
+ * Editor link that loads `projectUrl` directly into the editor.
52
+ * @param {string} projectUrl
53
+ * @param {string} [base]
54
+ * @returns {string}
55
+ */
56
+ export function editorUrl(projectUrl, base = PENGUINMOD_EDITOR) {
57
+ const url = new URL(base);
58
+ url.searchParams.set("project_url", projectUrl);
59
+ return url.href;
60
+ }
61
+
62
+ function escapeHtml(text) {
63
+ return String(text)
64
+ .replaceAll("&", "&amp;")
65
+ .replaceAll("<", "&lt;")
66
+ .replaceAll(">", "&gt;")
67
+ .replaceAll('"', "&quot;");
68
+ }
69
+
70
+ function indexPage({ filename, link }) {
71
+ return `<!doctype html>
72
+ <html>
73
+ <head><meta charset="utf-8"><title>${escapeHtml(filename)}</title></head>
74
+ <body style="margin:0;padding:24px;background:#0e0e12;color:#ddd;font:14px/1.5 ui-monospace,monospace">
75
+ <p>${escapeHtml(filename)} is served at <a style="color:#3cc6ab" href="/${escapeHtml(filename)}">/${escapeHtml(filename)}</a>.</p>
76
+ <p><a style="color:#3cc6ab" href="${escapeHtml(link)}">Open it in the PenguinMod editor</a></p>
77
+ </body>
78
+ </html>`;
79
+ }
80
+
81
+ /**
82
+ * Serve one project archive over HTTP until closed.
83
+ *
84
+ * @param {object} options
85
+ * @param {Buffer|Uint8Array} options.data Archive bytes.
86
+ * @param {string} options.filename Name the archive is served under.
87
+ * @param {string} [options.host="127.0.0.1"]
88
+ * @param {number} [options.port=3000] Port 0 asks the OS for a free port.
89
+ * @param {boolean} [options.strictPort=false]
90
+ * @param {string} [options.editorBase] Editor page to link to.
91
+ * @param {object} [options.log]
92
+ * @returns {Promise<object>}
93
+ */
94
+ export async function startEditorServer(options = {}) {
95
+ if (!options.data) throw new Error("startEditorServer requires project data");
96
+ if (!options.filename)
97
+ throw new Error("startEditorServer requires a filename");
98
+
99
+ const data = Buffer.from(options.data);
100
+ const filename = String(options.filename);
101
+ const host =
102
+ options.host === true || options.host == null
103
+ ? "127.0.0.1"
104
+ : String(options.host);
105
+ const requestedPort = options.port == null ? 3000 : Number(options.port);
106
+ if (
107
+ !Number.isInteger(requestedPort) ||
108
+ requestedPort < 0 ||
109
+ requestedPort > 65535
110
+ )
111
+ throw new Error(`Invalid port: ${options.port}`);
112
+ const strictPort = Boolean(options.strictPort);
113
+ const log = options.log || {};
114
+ const editorBase = options.editorBase
115
+ ? String(options.editorBase)
116
+ : PENGUINMOD_EDITOR;
117
+ const editorOrigin = new URL(editorBase).origin;
118
+ if (editorOrigin === "null")
119
+ throw new Error(`Invalid editor base: ${editorBase}`);
120
+ const cors = corsHeaders(editorOrigin);
121
+
122
+ let closed = false;
123
+ let currentUrl = null;
124
+ const projectPath = `/${encodeURIComponent(filename)}`;
125
+
126
+ const server = http.createServer((request, response) => {
127
+ let url;
128
+ try {
129
+ url = new URL(request.url || "/", "http://localhost");
130
+ } catch {
131
+ response.writeHead(400, {
132
+ ...cors,
133
+ "Content-Type": "text/plain; charset=utf-8",
134
+ });
135
+ response.end("Bad request\n");
136
+ return;
137
+ }
138
+
139
+ // Preflight, including Chrome's private-network request.
140
+ if (request.method === "OPTIONS") {
141
+ response.writeHead(204, cors);
142
+ response.end();
143
+ return;
144
+ }
145
+
146
+ if (request.method !== "GET" && request.method !== "HEAD") {
147
+ response.writeHead(405, {
148
+ ...cors,
149
+ Allow: "GET, HEAD, OPTIONS",
150
+ "Content-Type": "text/plain; charset=utf-8",
151
+ });
152
+ response.end("Method not allowed\n");
153
+ return;
154
+ }
155
+
156
+ const head = request.method === "HEAD";
157
+
158
+ if (url.pathname === projectPath) {
159
+ response.writeHead(200, {
160
+ ...cors,
161
+ "Content-Type": "application/octet-stream",
162
+ "Content-Length": data.length,
163
+ "Cache-Control": "no-store",
164
+ });
165
+ response.end(head ? undefined : data);
166
+ return;
167
+ }
168
+
169
+ if (url.pathname === "/" || url.pathname === "/index.html") {
170
+ response.writeHead(200, {
171
+ ...cors,
172
+ "Content-Type": "text/html; charset=utf-8",
173
+ "Cache-Control": "no-store",
174
+ });
175
+ // Link to the archive on the address the visitor actually reached, so
176
+ // remote visitors are not sent to their own loopback address.
177
+ const origin = requestOrigin(request);
178
+ const projectUrl = origin
179
+ ? `${origin}${projectPath}`
180
+ : currentUrl || projectPath;
181
+ response.end(
182
+ head
183
+ ? undefined
184
+ : indexPage({
185
+ filename,
186
+ link: editorUrl(projectUrl, editorBase),
187
+ }),
188
+ );
189
+ return;
190
+ }
191
+
192
+ if (url.pathname === "/favicon.ico") {
193
+ response.writeHead(204, cors);
194
+ response.end();
195
+ return;
196
+ }
197
+
198
+ response.writeHead(404, {
199
+ ...cors,
200
+ "Content-Type": "text/plain; charset=utf-8",
201
+ });
202
+ response.end(head ? undefined : `Not found: ${filename}\n`);
203
+ });
204
+
205
+ let port;
206
+ for (let attempt = 0; ; attempt += 1) {
207
+ try {
208
+ port = await new Promise((resolve, reject) => {
209
+ const onError = (error) => {
210
+ server.off("listening", onListening);
211
+ reject(error);
212
+ };
213
+ const onListening = () => {
214
+ server.off("error", onError);
215
+ resolve(server.address().port);
216
+ };
217
+ server.once("error", onError);
218
+ server.once("listening", onListening);
219
+ server.listen(requestedPort === 0 ? 0 : requestedPort + attempt, host);
220
+ });
221
+ break;
222
+ } catch (error) {
223
+ if (
224
+ error.code !== "EADDRINUSE" ||
225
+ strictPort ||
226
+ requestedPort === 0 ||
227
+ attempt >= 20
228
+ )
229
+ throw error;
230
+ log.warn?.(
231
+ `Port ${requestedPort + attempt} is in use, trying ${
232
+ requestedPort + attempt + 1
233
+ }…`,
234
+ );
235
+ }
236
+ }
237
+
238
+ const urls = formatDevUrls({ host, port });
239
+ const projectUrls = [...urls.local, ...urls.network].map(
240
+ (base) => `${base}${filename}`,
241
+ );
242
+ const editorUrls = projectUrls.map((projectUrl) =>
243
+ editorUrl(projectUrl, editorBase),
244
+ );
245
+ currentUrl = projectUrls[0];
246
+
247
+ return {
248
+ server,
249
+ host,
250
+ port,
251
+ data,
252
+ filename,
253
+ projectUrl: projectUrls[0],
254
+ projectUrls,
255
+ editorUrl: editorUrls[0],
256
+ editorUrls,
257
+ localUrls: urls.local,
258
+ networkUrls: urls.network,
259
+ async close() {
260
+ if (closed) return;
261
+ closed = true;
262
+ const finished = new Promise((resolve) => server.close(resolve));
263
+ server.closeIdleConnections?.();
264
+ // Stalled transfers must not hold shutdown open forever.
265
+ const force = setTimeout(() => server.closeAllConnections?.(), 2000);
266
+ force.unref?.();
267
+ await finished;
268
+ clearTimeout(force);
269
+ },
270
+ };
271
+ }
272
+
273
+ /**
274
+ * Open `url` in the platform browser. Resolves false when no opener is
275
+ * available, which is the normal case on servers and in containers.
276
+ * @param {string} url
277
+ * @returns {Promise<boolean>}
278
+ */
279
+ export function openBrowser(url) {
280
+ const [command, ...args] =
281
+ process.platform === "darwin"
282
+ ? ["open", url]
283
+ : process.platform === "win32"
284
+ ? ["cmd", "/c", "start", "", url]
285
+ : ["xdg-open", url];
286
+
287
+ return new Promise((resolve) => {
288
+ let settled = false;
289
+ const done = (opened) => {
290
+ if (settled) return;
291
+ settled = true;
292
+ resolve(opened);
293
+ };
294
+ try {
295
+ const child = spawn(command, args, { detached: true, stdio: "ignore" });
296
+ child.once("error", () => done(false));
297
+ child.once("spawn", () => {
298
+ child.unref();
299
+ done(true);
300
+ });
301
+ } catch {
302
+ done(false);
303
+ }
304
+ });
305
+ }
@@ -2,5 +2,5 @@
2
2
  "name": "@penguinmod/packager",
3
3
  "version": "1.9.2",
4
4
  "commit": "53f868b85ec21d2edab9ce00fd2d709da93da6d6",
5
- "builtAt": "2026-11-26T20:45:33.392Z"
5
+ "builtAt": "2026-11-29T03:58:05.128Z"
6
6
  }
@@ -3,5 +3,5 @@
3
3
  "version": "0.2.0",
4
4
  "commit": "3822f284c8cda2c3a0a5c6dd928221dd9ff2cee1",
5
5
  "inputHash": "bb8f99fcce9f4ecdc563f11df5a0510dcc94c25d256c6931c7f1f113e0a1998b",
6
- "builtAt": "2026-11-26T20:46:36.431Z"
6
+ "builtAt": "2026-11-29T03:58:50.545Z"
7
7
  }
@@ -1 +1 @@
1
- exports.ids=[0],exports.modules={402:function(e,t,r){function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,s,a,i,o=[],c=!0,d=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(e){d=!0,s=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(d)throw s}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const a=r(9),i=r(403),o="'none'",c={accelerometer:o,"ambient-light-sensor":o,battery:o,camera:o,"display-capture":o,"document-domain":o,"encrypted-media":o,fullscreen:o,geolocation:o,gyroscope:o,magnetometer:o,microphone:o,midi:o,payment:o,"picture-in-picture":o,"publickey-credentials-get":o,"speaker-selection":o,usb:o,vibrate:o,vr:o,"screen-wake-lock":o,"web-share":o,"interest-cohort":o};e.exports=class{constructor(){this.id=a(),this.isRemote=!0,this.ready=!1,this.queuedMessages=[],this.iframe=document.createElement("iframe"),this.iframe.className="tw-custom-extension-frame",this.iframe.dataset.id=this.id,this.iframe.style.display="none",this.iframe.setAttribute("aria-hidden","true"),this.iframe.sandbox="allow-scripts",this.iframe.allow=Object.entries(c).map(e=>{let t=n(e,2),r=t[0],s=t[1];return"".concat(r," ").concat(s)}).join("; "),document.body.appendChild(this.iframe),window.addEventListener("message",this._onWindowMessage.bind(this));const e=new Blob(["<!DOCTYPE html><body><script>window.__WRAPPED_IFRAME_ID__=".concat(JSON.stringify(this.id),";").concat(i,"<\/script></body>")],{type:"text/html; charset=utf-8"});this.iframe.src=URL.createObjectURL(e)}_onWindowMessage(e){if(e.data&&e.data.vmIframeId===this.id){if(e.data.ready){this.ready=!0;for(const e of this.queuedMessages){const t=e.data,r=e.transfer;this.postMessage(t,r)}this.queuedMessages.length=0}e.data.message&&this.onmessage({data:e.data.message})}}onmessage(){}postMessage(e,t){this.ready?t?this.iframe.contentWindow.postMessage(e,"*",t):this.iframe.contentWindow.postMessage(e,"*"):this.queuedMessages.push({data:e,transfer:t})}}},403:function(e,t){throw new Error("Not supported in non-web environment")}};
1
+ exports.ids=[0],exports.modules={402:function(e,t,r){function n(e,t){return function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==r||r===("undefined"!=typeof Symbol&&[][Symbol.iterator])||r===[]["@@iterator"]))return e;if(null!=r){var n,s,a,i,o=[],c=!0,d=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(e){d=!0,s=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(d)throw s}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}const a=r(9),i=r(403),o="'none'",c={accelerometer:o,"ambient-light-sensor":o,battery:o,camera:o,"display-capture":o,"document-domain":o,"encrypted-media":o,fullscreen:o,geolocation:o,gyroscope:o,magnetometer:o,microphone:o,midi:o,payment:o,"picture-in-picture":o,"publickey-credentials-get":o,"speaker-selection":o,usb:o,vibrate:o,vr:o,"screen-wake-lock":o,"web-share":o,"interest-cohort":o};e.exports=class{constructor(){this.id=a(),this.isRemote=!0,this.ready=!1,this.queuedMessages=[],this.iframe=document.createElement("iframe"),this.iframe.className="tw-custom-extension-frame",this.iframe.dataset.id=this.id,this.iframe.style.display="none",this.iframe.setAttribute("aria-hidden","true"),this.iframe.sandbox="allow-scripts",this.iframe.allow=Object.entries(c).map(e=>{let t=n(e,2),r=t[0],s=t[1];return"".concat(r," ").concat(s)}).join("; "),document.body.appendChild(this.iframe),window.addEventListener("message",this._onWindowMessage.bind(this));const e=new Blob(["<!DOCTYPE html><body><script>window.__WRAPPED_IFRAME_ID__=".concat(JSON.stringify(this.id),";").concat(i,"<\/script></body>")],{type:"text/html; charset=utf-8"});this.iframe.src=URL.createObjectURL(e)}_onWindowMessage(e){if(e.data&&e.data.vmIframeId===this.id){if(e.data.ready){this.ready=!0;for(const e of this.queuedMessages){const t=e.data,r=e.transfer;this.postMessage(t,r)}this.queuedMessages.length=0}e.data.message&&this.onmessage({data:e.data.message})}}onmessage(){}postMessage(e,t){this.ready?t?this.iframe.contentWindow.postMessage(e,"*",t):this.iframe.contentWindow.postMessage(e,"*"):this.queuedMessages.push({data:e,transfer:t})}}},403:function(e,t){throw new Error("Not supported in non-web environment")}};
@@ -0,0 +1 @@
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=13)}([function(e,t,n){function r(){}n(27).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",e,t,n)},r.prototype.end=function(){this.emit("end"),this.removeAllListeners()},r.prototype.pipe=function(e){var t=this;function n(){e.write.apply(e,Array.prototype.slice.call(arguments))}function r(){!e._isStdio&&e.end()}return t.emit("unpipe",e),e.emit("pipe",t),t.on("item",n),t.on("end",r),t.when("unpipe",(function(i){var a=i===e||void 0===i;return a&&(t.removeListener("item",n),t.removeListener("end",r),e.emit("unpipe")),a})),e},r.prototype.unpipe=function(e){return this.emit("unpipe",e),this},r.prototype.format=function(e){throw new Error(["Warning: .format() is deprecated in Minilog v2! Use .pipe() instead. For example:","var Minilog = require('minilog');","Minilog"," .pipe(Minilog.backends.console.formatClean)"," .pipe(Minilog.backends.console);"].join("\n"))},r.mixin=function(e){var t,n=r.prototype;for(t in n)n.hasOwnProperty(t)&&(e.prototype[t]=n[t])},e.exports=r},function(e,t){var n={bold:["",""],italic:["",""],underline:["",""],inverse:["",""],white:["",""],grey:["",""],black:["",""],blue:["",""],cyan:["",""],green:["",""],magenta:["",""],red:["",""],yellow:["",""]};t.levelMap={debug:1,info:2,warn:3,error:4},t.style=function(e,t){return n[t][0]+e+n[t][1]}},function(e,t,n){const r=n(26);r.enable(),e.exports=r("vm")},function(e,t){e.exports={ANGLE:"angle",BOOLEAN:"Boolean",COLOR:"color",NUMBER:"number",STRING:"string",MATRIX:"matrix",NOTE:"note",IMAGE:"image",POLYGON:"polygon",CUSTOM:"custom",COSTUME:"costume",SOUND:"sound",VARIABLE:"variable",LIST:"list",BROADCAST:"broadcast",SEPERATOR:"seperator"}},function(e,t){e.exports={BOOLEAN:"Boolean",BUTTON:"button",LABEL:"label",COMMAND:"command",CONDITIONAL:"conditional",EVENT:"event",HAT:"hat",LOOP:"loop",REPORTER:"reporter",XML:"xml"}},function(e,t){class n{static get RGB_BLACK(){return{r:0,g:0,b:0}}static get RGB_WHITE(){return{r:255,g:255,b:255}}static decimalToHex(e){e<0&&(e+=16777216);let t=Math.round(Number(e)).toString(16);return t="#".concat("000000".substr(0,6-t.length)).concat(t),t}static decimalToRgb(e){const t=e>>24&255;return{r:e>>16&255,g:e>>8&255,b:255&e,a:t>0?t:255}}static hexToRgb(e){e.startsWith("#")&&(e=e.substring(1)),8===e.length&&(e=e.slice(0,6));const t=parseInt(e,16);if(isNaN(t))return null;if(6===e.length)return{r:t>>16&255,g:t>>8&255,b:255&t};if(3===e.length){const e=t>>8&15,n=t>>4&15,r=15&t;return{r:e<<4|e,g:n<<4|n,b:r<<4|r}}return null}static rgbToHex(e){return n.decimalToHex(n.rgbToDecimal(e))}static rgbToDecimal(e){return(e.r<<16)+(e.g<<8)+e.b}static hexToDecimal(e){return n.rgbToDecimal(n.hexToRgb(e))}static hsvToRgb(e){let t=e.h%360;t<0&&(t+=360);const n=Math.max(0,Math.min(e.s,1)),r=Math.max(0,Math.min(e.v,1)),i=Math.floor(t/60),a=t/60-i,o=r*(1-n),s=r*(1-n*a),c=r*(1-n*(1-a));let l,u,f;switch(i){default:case 0:l=r,u=c,f=o;break;case 1:l=s,u=r,f=o;break;case 2:l=o,u=r,f=c;break;case 3:l=o,u=s,f=r;break;case 4:l=c,u=o,f=r;break;case 5:l=r,u=o,f=s}return{r:Math.floor(255*l),g:Math.floor(255*u),b:Math.floor(255*f)}}static rgbToHsv(e){const t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(Math.min(t,n),r),a=Math.max(Math.max(t,n),r);let o=0,s=0;if(i!==a){o=60*((t===i?3:n===i?5:1)-(t===i?n-r:n===i?r-t:t-n)/(a-i))%360,s=(a-i)/a}return{h:o,s:s,v:a}}static mixRgb(e,t,n){if(n<=0)return e;if(n>=1)return t;const r=1-n;return{r:r*e.r+n*t.r,g:r*e.g+n*t.g,b:r*e.b+n*t.b}}}e.exports=n},function(e,t,n){var r=n(0),i=n(28),a=new r,o=Array.prototype.slice;(t=e.exports=function(e){var n=function(){return a.write(e,void 0,o.call(arguments)),n};return n.debug=function(){return a.write(e,"debug",o.call(arguments)),n},n.info=function(){return a.write(e,"info",o.call(arguments)),n},n.warn=function(){return a.write(e,"warn",o.call(arguments)),n},n.error=function(){return a.write(e,"error",o.call(arguments)),n},n.log=n.debug,n.suggest=t.suggest,n.format=a.format,n}).defaultBackend=t.defaultFormatter=null,t.pipe=function(e){return a.pipe(e)},t.end=t.unpipe=t.disable=function(e){return a.unpipe(e)},t.Transform=r,t.Filter=i,t.suggest=new i,t.enable=function(){return t.defaultFormatter?a.pipe(t.suggest).pipe(t.defaultFormatter).pipe(t.defaultBackend):a.pipe(t.suggest).pipe(t.defaultBackend)}},function(e,t){e.exports=require("util")},function(e,t){var n={black:"#000",red:"#c23621",green:"#25bc26",yellow:"#bbbb00",blue:"#492ee1",magenta:"#d338d3",cyan:"#33bbc8",gray:"#808080",purple:"#708"};e.exports=function(e,t){return t?"color: #fff; background: "+n[e]+";":"color: "+n[e]+";"}},function(e,t){e.exports={isWorker:!0,centralDispatchService:self}},function(e,t){var n="long",r="short",i="numeric";e.exports={number:{decimal:{style:"decimal"},integer:{style:"decimal",maximumFractionDigits:0},currency:{style:"currency",currency:"USD"},percent:{style:"percent"},default:{style:"decimal"}},date:{short:{month:i,day:i,year:"2-digit"},medium:{month:r,day:i,year:i},long:{month:n,day:i,year:i},full:{month:n,day:i,year:i,weekday:n},default:{month:r,day:i,year:i}},time:{short:{hour:i,minute:i},medium:{hour:i,minute:i,second:i},long:{hour:i,minute:i,second:i,timeZoneName:r},full:{hour:i,minute:i,second:i,timeZoneName:r},default:{hour:i,minute:i,second:i}},duration:{default:{hours:{minimumIntegerDigits:1,maximumFractionDigits:0},minutes:{minimumIntegerDigits:2,maximumFractionDigits:0},seconds:{minimumIntegerDigits:2,maximumFractionDigits:3}}},parseNumberPattern:function(e){if(e){var t={},n=e.match(/\b[A-Z]{3}\b/i),r=e.replace(/[^¤]/g,"").length;if(!r&&n&&(r=1),r?(t.style="currency",t.currencyDisplay=1===r?"symbol":2===r?"code":"name",t.currency=n?n[0].toUpperCase():"USD"):e.indexOf("%")>=0&&(t.style="percent"),!/[@#0]/.test(e))return t.style?t:void 0;if(t.useGrouping=e.indexOf(",")>=0,/E\+?[@#0]+/i.test(e)||e.indexOf("@")>=0){var i=e.replace(/E\+?[@#0]+|[^@#0]/gi,"");t.minimumSignificantDigits=Math.min(Math.max(i.replace(/[^@0]/g,"").length,1),21),t.maximumSignificantDigits=Math.min(Math.max(i.length,1),21)}else{for(var a=e.replace(/[^#0.]/g,"").split("."),o=a[0],s=o.length-1;"0"===o[s];)--s;t.minimumIntegerDigits=Math.min(Math.max(o.length-1-s,1),21);var c=a[1]||"";for(s=0;"0"===c[s];)++s;for(t.minimumFractionDigits=Math.min(Math.max(s,0),20);"#"===c[s];)++s;t.maximumFractionDigits=Math.min(Math.max(s,0),20)}return t}},parseDatePattern:function(e){if(e){for(var t={},a=0;a<e.length;){for(var o=e[a],s=1;e[++a]===o;)++s;switch(o){case"G":t.era=5===s?"narrow":4===s?n:r;break;case"y":case"Y":t.year=2===s?"2-digit":i;break;case"M":case"L":s=Math.min(Math.max(s-1,0),4),t.month=[i,"2-digit",r,n,"narrow"][s];break;case"E":case"e":case"c":t.weekday=5===s?"narrow":4===s?n:r;break;case"d":case"D":t.day=2===s?"2-digit":i;break;case"h":case"K":t.hour12=!0,t.hour=2===s?"2-digit":i;break;case"H":case"k":t.hour12=!1,t.hour=2===s?"2-digit":i;break;case"m":t.minute=2===s?"2-digit":i;break;case"s":case"S":t.second=2===s?"2-digit":i;break;case"z":case"Z":case"v":case"V":t.timeZoneName=1===s?r:n}}return Object.keys(t).length?t:void 0}}}},function(e,t){e.exports=function(e,t){if("string"==typeof e&&t[e])return e;for(var n=[].concat(e||[]),r=0,i=n.length;r<i;++r)for(var a=n[r].split("-");a.length;){var o=a.join("-");if(t[o])return o;a.pop()}}},function(e,t,n){"use strict";var r="one",i="two",a="few",o="many",s="other",c=[function(e){return 1===+e?r:s},function(e){var t=+e;return 0<=t&&t<=1?r:s},function(e){return 0===Math.floor(Math.abs(+e))||1===+e?r:s},function(e){var t=+e;return 0===t?"zero":1===t?r:2===t?i:3<=t%100&&t%100<=10?a:11<=t%100&&t%100<=99?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 1===t&&0===n?r:s},function(e){var t=+e;return t%10==1&&t%100!=11?r:2<=t%10&&t%10<=4&&(t%100<12||14<t%100)?a:t%10==0||5<=t%10&&t%10<=9||11<=t%100&&t%100<=14?o:s},function(e){var t=+e;return t%10==1&&t%100!=11&&t%100!=71&&t%100!=91?r:t%10==2&&t%100!=12&&t%100!=72&&t%100!=92?i:(3<=t%10&&t%10<=4||t%10==9)&&(t%100<10||19<t%100)&&(t%100<70||79<t%100)&&(t%100<90||99<t%100)?a:0!==t&&t%1e6==0?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,i=+(e+".").split(".")[1];return 0===n&&t%10==1&&t%100!=11||i%10==1&&i%100!=11?r:0===n&&2<=t%10&&t%10<=4&&(t%100<12||14<t%100)||2<=i%10&&i%10<=4&&(i%100<12||14<i%100)?a:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 1===t&&0===n?r:2<=t&&t<=4&&0===n?a:0!==n?o:s},function(e){var t=+e;return 0===t?"zero":1===t?r:2===t?i:3===t?a:6===t?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=+(""+e).replace(/^[^.]*.?|0+$/g,"");return 1===+e||0!==n&&(0===t||1===t)?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,o=+(e+".").split(".")[1];return 0===n&&t%100==1||o%100==1?r:0===n&&t%100==2||o%100==2?i:0===n&&3<=t%100&&t%100<=4||3<=o%100&&o%100<=4?a:s},function(e){var t=Math.floor(Math.abs(+e));return 0===t||1===t?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,i=+(e+".").split(".")[1];return 0===n&&(1===t||2===t||3===t)||0===n&&t%10!=4&&t%10!=6&&t%10!=9||0!==n&&i%10!=4&&i%10!=6&&i%10!=9?r:s},function(e){var t=+e;return 1===t?r:2===t?i:3<=t&&t<=6?a:7<=t&&t<=10?o:s},function(e){var t=+e;return 1===t||11===t?r:2===t||12===t?i:3<=t&&t<=10||13<=t&&t<=19?a:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 0===n&&t%10==1?r:0===n&&t%10==2?i:0!==n||t%100!=0&&t%100!=20&&t%100!=40&&t%100!=60&&t%100!=80?0!==n?o:s:a},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,a=+e;return 1===t&&0===n?r:2===t&&0===n?i:0===n&&(a<0||10<a)&&a%10==0?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=+(""+e).replace(/^[^.]*.?|0+$/g,"");return 0===n&&t%10==1&&t%100!=11||0!==n?r:s},function(e){var t=+e;return 1===t?r:2===t?i:s},function(e){var t=+e;return 0===t?"zero":1===t?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=+e;return 0===n?"zero":0!==t&&1!==t||0===n?s:r},function(e){var t=+(e+".").split(".")[1],n=+e;return n%10==1&&(n%100<11||19<n%100)?r:2<=n%10&&n%10<=9&&(n%100<11||19<n%100)?a:0!==t?o:s},function(e){var t=(e+".").split(".")[1].length,n=+(e+".").split(".")[1],i=+e;return i%10==0||11<=i%100&&i%100<=19||2===t&&11<=n%100&&n%100<=19?"zero":i%10==1&&i%100!=11||2===t&&n%10==1&&n%100!=11||2!==t&&n%10==1?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,i=+(e+".").split(".")[1];return 0===n&&t%10==1&&t%100!=11||i%10==1&&i%100!=11?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length,i=+e;return 1===t&&0===n?r:0!==n||0===i||1!==i&&1<=i%100&&i%100<=19?a:s},function(e){var t=+e;return 1===t?r:0===t||2<=t%100&&t%100<=10?a:11<=t%100&&t%100<=19?o:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 1===t&&0===n?r:0===n&&2<=t%10&&t%10<=4&&(t%100<12||14<t%100)?a:0===n&&1!==t&&0<=t%10&&t%10<=1||0===n&&5<=t%10&&t%10<=9||0===n&&12<=t%100&&t%100<=14?o:s},function(e){var t=Math.floor(Math.abs(+e));return 0<=t&&t<=1?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 0===n&&t%10==1&&t%100!=11?r:0===n&&2<=t%10&&t%10<=4&&(t%100<12||14<t%100)?a:0===n&&t%10==0||0===n&&5<=t%10&&t%10<=9||0===n&&11<=t%100&&t%100<=14?o:s},function(e){var t=+e;return 0===Math.floor(Math.abs(+e))||1===t?r:2<=t&&t<=10?a:s},function(e){var t=Math.floor(Math.abs(+e)),n=+(e+".").split(".")[1],i=+e;return 0===i||1===i||0===t&&1===n?r:s},function(e){var t=Math.floor(Math.abs(+e)),n=(e+".").split(".")[1].length;return 0===n&&t%100==1?r:0===n&&t%100==2?i:0===n&&3<=t%100&&t%100<=4||0!==n?a:s},function(e){var t=+e;return 0<=t&&t<=1||11<=t&&t<=99?r:s},function(e){var t=+e;return 1===t||5===t||7===t||8===t||9===t||10===t?r:2===t||3===t?i:4===t?a:6===t?o:s},function(e){var t=Math.floor(Math.abs(+e));return t%10==1||t%10==2||t%10==5||t%10==7||t%10==8||t%100==20||t%100==50||t%100==70||t%100==80?r:t%10==3||t%10==4||t%1e3==100||t%1e3==200||t%1e3==300||t%1e3==400||t%1e3==500||t%1e3==600||t%1e3==700||t%1e3==800||t%1e3==900?a:0===t||t%10==6||t%100==40||t%100==60||t%100==90?o:s},function(e){var t=+e;return t%10!=2&&t%10!=3||t%100==12||t%100==13?s:a},function(e){var t=+e;return 1===t||3===t?r:2===t?i:4===t?a:s},function(e){var t=+e;return 0===t||7===t||8===t||9===t?"zero":1===t?r:2===t?i:3===t||4===t?a:5===t||6===t?o:s},function(e){var t=+e;return t%10==1&&t%100!=11?r:t%10==2&&t%100!=12?i:t%10==3&&t%100!=13?a:s},function(e){var t=+e;return 1===t||11===t?r:2===t||12===t?i:3===t||13===t?a:s},function(e){var t=+e;return 1===t?r:2===t||3===t?i:4===t?a:6===t?o:s},function(e){var t=+e;return 1===t||5===t?r:s},function(e){var t=+e;return 11===t||8===t||80===t||800===t?o:s},function(e){var t=Math.floor(Math.abs(+e));return 1===t?r:0===t||2<=t%100&&t%100<=20||t%100==40||t%100==60||t%100==80?o:s},function(e){var t=+e;return t%10==6||t%10==9||t%10==0&&0!==t?o:s},function(e){var t=Math.floor(Math.abs(+e));return t%10==1&&t%100!=11?r:t%10==2&&t%100!=12?i:t%10!=7&&t%10!=8||t%100==17||t%100==18?s:o},function(e){var t=+e;return 1===t?r:2===t||3===t?i:4===t?a:s},function(e){var t=+e;return 1<=t&&t<=4?r:s},function(e){var t=+e;return 1===t||5===t||7<=t&&t<=9?r:2===t||3===t?i:4===t?a:6===t?o:s},function(e){var t=+e;return 1===t?r:t%10==4&&t%100!=14?o:s},function(e){var t=+e;return t%10!=1&&t%10!=2||t%100==11||t%100==12?s:r},function(e){var t=+e;return t%10==6||t%10==9||10===t?a:s},function(e){var t=+e;return t%10==3&&t%100!=13?a:s}];e.exports={af:{cardinal:c[0]},ak:{cardinal:c[1]},am:{cardinal:c[2]},ar:{cardinal:c[3]},ars:{cardinal:c[3]},as:{cardinal:c[2],ordinal:c[34]},asa:{cardinal:c[0]},ast:{cardinal:c[4]},az:{cardinal:c[0],ordinal:c[35]},be:{cardinal:c[5],ordinal:c[36]},bem:{cardinal:c[0]},bez:{cardinal:c[0]},bg:{cardinal:c[0]},bh:{cardinal:c[1]},bn:{cardinal:c[2],ordinal:c[34]},br:{cardinal:c[6]},brx:{cardinal:c[0]},bs:{cardinal:c[7]},ca:{cardinal:c[4],ordinal:c[37]},ce:{cardinal:c[0]},cgg:{cardinal:c[0]},chr:{cardinal:c[0]},ckb:{cardinal:c[0]},cs:{cardinal:c[8]},cy:{cardinal:c[9],ordinal:c[38]},da:{cardinal:c[10]},de:{cardinal:c[4]},dsb:{cardinal:c[11]},dv:{cardinal:c[0]},ee:{cardinal:c[0]},el:{cardinal:c[0]},en:{cardinal:c[4],ordinal:c[39]},eo:{cardinal:c[0]},es:{cardinal:c[0]},et:{cardinal:c[4]},eu:{cardinal:c[0]},fa:{cardinal:c[2]},ff:{cardinal:c[12]},fi:{cardinal:c[4]},fil:{cardinal:c[13],ordinal:c[0]},fo:{cardinal:c[0]},fr:{cardinal:c[12],ordinal:c[0]},fur:{cardinal:c[0]},fy:{cardinal:c[4]},ga:{cardinal:c[14],ordinal:c[0]},gd:{cardinal:c[15],ordinal:c[40]},gl:{cardinal:c[4]},gsw:{cardinal:c[0]},gu:{cardinal:c[2],ordinal:c[41]},guw:{cardinal:c[1]},gv:{cardinal:c[16]},ha:{cardinal:c[0]},haw:{cardinal:c[0]},he:{cardinal:c[17]},hi:{cardinal:c[2],ordinal:c[41]},hr:{cardinal:c[7]},hsb:{cardinal:c[11]},hu:{cardinal:c[0],ordinal:c[42]},hy:{cardinal:c[12],ordinal:c[0]},ia:{cardinal:c[4]},io:{cardinal:c[4]},is:{cardinal:c[18]},it:{cardinal:c[4],ordinal:c[43]},iu:{cardinal:c[19]},iw:{cardinal:c[17]},jgo:{cardinal:c[0]},ji:{cardinal:c[4]},jmc:{cardinal:c[0]},ka:{cardinal:c[0],ordinal:c[44]},kab:{cardinal:c[12]},kaj:{cardinal:c[0]},kcg:{cardinal:c[0]},kk:{cardinal:c[0],ordinal:c[45]},kkj:{cardinal:c[0]},kl:{cardinal:c[0]},kn:{cardinal:c[2]},ks:{cardinal:c[0]},ksb:{cardinal:c[0]},ksh:{cardinal:c[20]},ku:{cardinal:c[0]},kw:{cardinal:c[19]},ky:{cardinal:c[0]},lag:{cardinal:c[21]},lb:{cardinal:c[0]},lg:{cardinal:c[0]},ln:{cardinal:c[1]},lt:{cardinal:c[22]},lv:{cardinal:c[23]},mas:{cardinal:c[0]},mg:{cardinal:c[1]},mgo:{cardinal:c[0]},mk:{cardinal:c[24],ordinal:c[46]},ml:{cardinal:c[0]},mn:{cardinal:c[0]},mo:{cardinal:c[25],ordinal:c[0]},mr:{cardinal:c[2],ordinal:c[47]},mt:{cardinal:c[26]},nah:{cardinal:c[0]},naq:{cardinal:c[19]},nb:{cardinal:c[0]},nd:{cardinal:c[0]},ne:{cardinal:c[0],ordinal:c[48]},nl:{cardinal:c[4]},nn:{cardinal:c[0]},nnh:{cardinal:c[0]},no:{cardinal:c[0]},nr:{cardinal:c[0]},nso:{cardinal:c[1]},ny:{cardinal:c[0]},nyn:{cardinal:c[0]},om:{cardinal:c[0]},or:{cardinal:c[0],ordinal:c[49]},os:{cardinal:c[0]},pa:{cardinal:c[1]},pap:{cardinal:c[0]},pl:{cardinal:c[27]},prg:{cardinal:c[23]},ps:{cardinal:c[0]},pt:{cardinal:c[28]},"pt-PT":{cardinal:c[4]},rm:{cardinal:c[0]},ro:{cardinal:c[25],ordinal:c[0]},rof:{cardinal:c[0]},ru:{cardinal:c[29]},rwk:{cardinal:c[0]},saq:{cardinal:c[0]},sc:{cardinal:c[4],ordinal:c[43]},scn:{cardinal:c[4],ordinal:c[43]},sd:{cardinal:c[0]},sdh:{cardinal:c[0]},se:{cardinal:c[19]},seh:{cardinal:c[0]},sh:{cardinal:c[7]},shi:{cardinal:c[30]},si:{cardinal:c[31]},sk:{cardinal:c[8]},sl:{cardinal:c[32]},sma:{cardinal:c[19]},smi:{cardinal:c[19]},smj:{cardinal:c[19]},smn:{cardinal:c[19]},sms:{cardinal:c[19]},sn:{cardinal:c[0]},so:{cardinal:c[0]},sq:{cardinal:c[0],ordinal:c[50]},sr:{cardinal:c[7]},ss:{cardinal:c[0]},ssy:{cardinal:c[0]},st:{cardinal:c[0]},sv:{cardinal:c[4],ordinal:c[51]},sw:{cardinal:c[4]},syr:{cardinal:c[0]},ta:{cardinal:c[0]},te:{cardinal:c[0]},teo:{cardinal:c[0]},ti:{cardinal:c[1]},tig:{cardinal:c[0]},tk:{cardinal:c[0],ordinal:c[52]},tl:{cardinal:c[13],ordinal:c[0]},tn:{cardinal:c[0]},tr:{cardinal:c[0]},ts:{cardinal:c[0]},tzm:{cardinal:c[33]},ug:{cardinal:c[0]},uk:{cardinal:c[29],ordinal:c[53]},ur:{cardinal:c[4]},uz:{cardinal:c[0]},ve:{cardinal:c[0]},vo:{cardinal:c[0]},vun:{cardinal:c[0]},wa:{cardinal:c[1]},wae:{cardinal:c[0]},xh:{cardinal:c[0]},xog:{cardinal:c[0]},yi:{cardinal:c[4]},zu:{cardinal:c[2]},lo:{ordinal:c[0]},ms:{ordinal:c[0]},vi:{ordinal:c[0]}}},function(e,t,n){function r(e,t){return function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==n||n===("undefined"!=typeof Symbol&&[][Symbol.iterator])||n===[]["@@iterator"]))return e;if(null!=n){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const a=n(14),o=n(22),s=n(24),c=n(2),l=n(9).isWorker,u=n(43)(null);global.Scratch=global.Scratch||{},Object.assign(global.Scratch,a,{canFetch:()=>Promise.resolve(!0),fetch:function(e){function t(t,n){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((e,t)=>fetch(e,t)),canOpenWindow:()=>Promise.resolve(!1),openWindow:()=>Promise.reject(new Error("Scratch.openWindow not supported in sandboxed extensions")),canRedirect:()=>Promise.resolve(!1),redirect:()=>Promise.reject(new Error("Scratch.redirect not supported in sandboxed extensions")),canRecordAudio:()=>Promise.resolve(!1),canRecordVideo:()=>Promise.resolve(!1),canReadClipboard:()=>Promise.resolve(!1),canNotify:()=>Promise.resolve(!1),canGeolocate:()=>Promise.resolve(!1),canEmbed:()=>Promise.resolve(!1),canUnsandbox:()=>Promise.resolve(!1),canScreenshotCamera:()=>Promise.resolve(!1),canDownload:()=>Promise.resolve(!1),download:()=>Promise.reject(new Error("Scratch.download not supported in sandboxed extensions")),translate:u});const f=new class{constructor(){this.nextExtensionId=0,this.initialRegistrations=[],this.firstRegistrationPromise=new Promise(e=>{this.firstRegistrationCallback=e}),s.waitForConnection.then(()=>{s.call("extensions","allocateWorker").then(async e=>{const t=r(e,2),n=t[0],i=t[1];this.workerId=n;try{await(e=>{if(!l)return new Promise((t,n)=>{const r=document.createElement("script");r.onload=()=>t(),r.onerror=()=>{n(new Error("Error in sandboxed script: ".concat(e,". Check the console for more information.")))},r.src=e,document.body.appendChild(r)});importScripts(e)})(i),await this.firstRegistrationPromise;const e=this.initialRegistrations;this.initialRegistrations=null,Promise.all(e).then(()=>s.call("extensions","onWorkerInit",n))}catch(e){c.error(e),s.call("extensions","onWorkerInit",n,"".concat(e))}})}),this.extensions=[]}register(e){const t=this.nextExtensionId++;this.extensions.push(e);const n="extension.".concat(this.workerId,".").concat(t),r=s.setService(n,e).then(()=>s.call("extensions","registerExtensionService",n));return this.initialRegistrations&&(this.firstRegistrationCallback(),this.initialRegistrations.push(r)),r}};global.Scratch.extensions={register:f.register.bind(f)},global.ScratchExtensions=o(global.Scratch)},function(e,t,n){const r={ArgumentType:n(3),ArgumentAlignment:n(15),BlockType:n(4),BlockShape:n(16),NotchShape:n(17),TargetType:n(18),Cast:n(19),Clone:n(20),Color:n(5),external:n(21)};e.exports=r},function(e,t){e.exports={DEFAULT:null,LEFT:"LEFT",CENTER:"CENTRE",RIGHT:"RIGHT"}},function(e,t){e.exports={HEXAGONAL:1,ROUND:2,SQUARE:3,LEAF:4,PLUS:5,OCTAGONAL:6,BUMPED:7,INDENTED:8,SCRAPPED:9,ARROW:10,TICKET:11}},function(e,t){e.exports={SWITCH:"switchCase",HEXAGON:"hexagon",ROUND:"round",SQUARE:"square",LEAF:"leaf",PLUS:"plus",OCTAGONAL:"octagonal",BUMPED:"bumped",INDENTED:"indented",SCRAPPED:"scrapped",ARROW:"arrow",TICKET:"ticket",JIGSAW:"jigsaw",INVERTED:"inverted",PINCER:"pincer"}},function(e,t){e.exports={SPRITE:"sprite",STAGE:"stage"}},function(e,t,n){const r=n(5),i=e=>{if("string"!=typeof e)return!1;for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(48===n||9===n)return!1}return!0};class a{static toNumber(e){if("number"==typeof e)return Number.isNaN(e)?0:e;const t=Number(e);return Number.isNaN(t)?0:t}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e?""!==e&&"0"!==e&&"false"!==e.toLowerCase():Boolean(e)}static toString(e){return String(e)}static toRgbColorList(e){const t=a.toRgbColorObject(e);return[t.r,t.g,t.b]}static toRgbColorObject(e){let t;return"object"==typeof e&&(e+=""),"string"==typeof e&&"#"===e.substring(0,1)?(t=r.hexToRgb(e),t||(t={r:0,g:0,b:0,a:255})):t=r.decimalToRgb(a.toNumber(e)),t}static isWhiteSpace(e){return null===e||"string"==typeof e&&0===e.trim().length}static compare(e,t){let n=Number(e),r=Number(t);if(0===n&&i(e)?n=NaN:0===r&&i(t)&&(r=NaN),isNaN(n)||isNaN(r)){const n=String(e).toLowerCase(),r=String(t).toLowerCase();return n<r?-1:n>r?1:0}return n===1/0&&r===1/0||n===-1/0&&r===-1/0?0:n-r}static isInt(e){return"number"==typeof e?!!isNaN(e)||e===Math.floor(e):"boolean"==typeof e||"string"==typeof e&&e.indexOf(".")<0}static get LIST_INVALID(){return"INVALID"}static get LIST_ALL(){return"ALL"}static toListIndex(e,t,n){if("number"!=typeof e){if("all"===e)return n?a.LIST_ALL:a.LIST_INVALID;if("last"===e)return t>0?t:a.LIST_INVALID;if("random"===e||"any"===e)return t>0?1+Math.floor(Math.random()*t):a.LIST_INVALID}return(e=Math.floor(a.toNumber(e)))<1||e>t?a.LIST_INVALID:e}}e.exports=a},function(e,t){e.exports=class{static simple(e){return JSON.parse(JSON.stringify(e))}}},function(e,t){const n=e=>{if(!(e.startsWith("http:")||e.startsWith("https:")||e.startsWith("data:")||e.startsWith("blob:")))throw new Error("Unsupported URL: ".concat(e))},r={importModule:e=>(n(e),import(e)),fetch:async e=>{n(e);const t=await fetch(e);if(!t.ok)throw new Error("HTTP ".concat(t.status," fetching ").concat(e));return t},dataURL:async e=>{const t=await r.fetch(e),n=await t.blob();return new Promise((e,t)=>{const r=new FileReader;r.onload=()=>e(r.result),r.onerror=()=>t(r.error),r.readAsDataURL(n)})},blob:async e=>(await r.fetch(e)).blob(),evalAndReturn:async(e,t)=>{const n=await r.fetch(e),i=await n.text(),a="".concat(i,"\nreturn ").concat(t,";");return new Function(a)()}};e.exports=r},function(e,t,n){const r=n(3),i=n(4),a=n(23),o=a.argumentIndexToId,s=a.generateExtensionId,c=e=>{if(""===e||" "===e||"w"===e)return{type:i.COMMAND,async:"w"===e};if("r"===e||"R"===e)return{type:i.REPORTER,async:"R"===e};if("b"===e)return{type:i.BOOLEAN,async:!1};if("h"===e)return{type:i.HAT,async:!1};throw new Error("Unknown ScratchX block type: ".concat(e))},l=(e,t)=>{const n={},i="string"==typeof(a=t)||"number"==typeof a||"boolean"==typeof a;var a;if(i&&(n.defaultValue=t),"s"===e)n.type=r.STRING,i||(n.defaultValue="");else if("n"===e)n.type=r.NUMBER,i||(n.defaultValue=0);else{if("m"!==e[0])throw new Error("Unknown ScratchX argument type: ".concat(e));{n.type=r.STRING;const t=e.split(/\.|:/)[1];n.menu=t}}return n},u=(e,t,n)=>r=>{const i=[];for(let e=0;e<t;e++)i.push(r[o(e)]);return n?new Promise(t=>{e(...i,t)}):e(...i)},f=new Map;e.exports=e=>({register:(t,n,r)=>{const i=((e,t,n)=>{const r={id:s(e),name:t.displayName||e,blocks:[],color1:"#4a4a5e",color2:"#31323f",color3:"#191a21"},i={getInfo:()=>r,_getStatus:n._getStatus};t.url&&(r.docsURI=t.url);for(const e of t.blocks){if(1===e.length){r.blocks.push("---");continue}const t=e[0],a=e[1],s=e[2],f=e.slice(3);let d="";const p=[],h=a.split(/%([\w.:]+)/g);for(let e=0;e<h.length;e++){const t=h[e];if(e%2==1){l(t);const n=Math.floor(e/2).toString(),r=f[n],i=o(n);p[i]=l(t,r),d+="[".concat(i,"]")}else d+=t}const m=c(t),g={opcode:s,blockType:m.type,text:d,arguments:p};r.blocks.push(g);const y=n[s],b=p.length;i[s]=u(y,b,m.async)}const a=t.menus;if(a){const e={};for(const t of Object.keys(a)||{}){const n={items:a[t]};e[t]=n}r.menus=e}return i})(t,n,r);f.set(t,i),e.extensions.register(i)},getStatus:e=>{const t=f.get(e);return t?t._getStatus():{status:0,msg:"does not exist"}}})},function(e,t){e.exports={generateExtensionId:e=>{const t=e.replace(/[^a-z0-9]/gi,"").toLowerCase();return"sbx".concat(t)},argumentIndexToId:e=>e.toString()}},function(e,t,n){const r=n(25),i=n(2),a=n(9).centralDispatchService;e.exports=new class extends r{constructor(){super(),this._connectionPromise=new Promise(e=>{this._onConnect=e}),this.services={},this._onMessage=this._onMessage.bind(this,a),"undefined"!=typeof self&&(self.onmessage=this._onMessage)}get waitForConnection(){return this._connectionPromise}setService(e,t){return this.services.hasOwnProperty(e)&&i.warn("Worker dispatch replacing existing service provider for ".concat(e)),this.services[e]=t,this.waitForConnection.then(()=>this._remoteCall(a,"dispatch","setService",e))}_getServiceProvider(e){const t=this.services[e];return{provider:t||a,isRemote:!t}}_onDispatchMessage(e,t){let n;switch(t.method){case"handshake":n=this._onConnect();break;case"terminate":setTimeout(()=>self.close(),0),n=Promise.resolve();break;default:i.error("Worker dispatch received message for unknown method: ".concat(t.method))}return n}}},function(e,t,n){function r(e,t){return function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==n||n===("undefined"!=typeof Symbol&&[][Symbol.iterator])||n===[]["@@iterator"]))return e;if(null!=n){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const a=n(2);e.exports=class{constructor(){this.callbacks=[],this.nextResponseId=0}call(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return this.transferCall(e,t,null,...r)}transferCall(e,t,n){try{const o=this._getServiceProvider(e),s=o.provider,c=o.isRemote;if(s){for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];if(c)return this._remoteTransferCall(s,e,t,n,...i);const o=s[t].apply(s,i);return Promise.resolve(o)}return Promise.reject(new Error("Service not found: ".concat(e)))}catch(e){return Promise.reject(e)}}_isRemoteService(e){var t,n;return null!==(t=null===(n=this._getServiceProvider(e))||void 0===n?void 0:n.isRemote)&&void 0!==t&&t}_remoteCall(e,t,n){for(var r=arguments.length,i=new Array(r>3?r-3:0),a=3;a<r;a++)i[a-3]=arguments[a];return this._remoteTransferCall(e,t,n,null,...i)}_remoteTransferCall(e,t,n,r){for(var i=arguments.length,a=new Array(i>4?i-4:0),o=4;o<i;o++)a[o-4]=arguments[o];return new Promise((i,o)=>{const s=this._storeCallbacks(i,o);a.length>0&&"function"==typeof a[a.length-1].func&&(a.pop(),a.pop()),r?e.postMessage({service:t,method:n,responseId:s,args:a},r):e.postMessage({service:t,method:n,responseId:s,args:a})})}_storeCallbacks(e,t){const n=this.nextResponseId++;return this.callbacks[n]=[e,t],n}_deliverResponse(e,t){try{const n=r(this.callbacks[e],2),i=n[0],a=n[1];delete this.callbacks[e],t.error?a(t.error):i(t.result)}catch(e){a.error("Dispatch callback failed: ".concat(e))}}_onMessage(e,t){const n=t.data;let r;n.args=n.args||[],n.service?r="dispatch"===n.service?this._onDispatchMessage(e,n):this.call(n.service,n.method,...n.args):void 0===n.responseId?a.error("Dispatch caught malformed message from a worker: ".concat(JSON.stringify(t))):this._deliverResponse(n.responseId,n),r&&(void 0===n.responseId?a.error("Dispatch message missing required response ID: ".concat(JSON.stringify(t))):r.then(t=>e.postMessage({responseId:n.responseId,result:t}),t=>e.postMessage({responseId:n.responseId,error:"".concat(t)})))}_getServiceProvider(e){throw new Error("Could not get provider for ".concat(e,": _getServiceProvider not implemented"))}_onDispatchMessage(e,t){throw new Error("Unimplemented dispatch message handler cannot handle ".concat(t.method," method"))}}},function(e,t,n){e.exports=n(6);var r=n(29);"undefined"!=typeof window&&window.process&&"renderer"===window.process.type&&(r=n(37).minilog),e.exports.Stringifier=n(40);var i=e.exports.pipe;e.exports.pipe=function(t){return t instanceof n(41)?i.call(e.exports,new e.exports.Stringifier).pipe(t):i.call(e.exports,t)},e.exports.defaultBackend=r,e.exports.defaultFormatter=r.formatMinilog,e.exports.backends={redis:n(42),nodeConsole:r,console:r}},function(e,t){function n(){this._events={}}n.prototype={on:function(e,t){this._events||(this._events={});var n=this._events;return(n[e]||(n[e]=[])).push(t),this},removeListener:function(e,t){var n,r=this._events[e]||[];for(n=r.length-1;n>=0&&r[n];n--)r[n]!==t&&r[n].cb!==t||r.splice(n,1)},removeAllListeners:function(e){e?this._events[e]&&(this._events[e]=[]):this._events={}},listeners:function(e){return this._events&&this._events[e]||[]},emit:function(e){this._events||(this._events={});var t,n=Array.prototype.slice.call(arguments,1),r=this._events[e]||[];for(t=r.length-1;t>=0&&r[t];t--)r[t].apply(this,n);return this},when:function(e,t){return this.once(e,t,!0)},once:function(e,t,n){if(!t)return this;function r(){n||this.removeListener(e,r),t.apply(this,arguments)&&n&&this.removeListener(e,r)}return r.cb=t,this.on(e,r),this}},n.mixin=function(e){var t,r=n.prototype;for(t in r)r.hasOwnProperty(t)&&(e.prototype[t]=r[t])},e.exports=n},function(e,t,n){var r=n(0),i={debug:1,info:2,warn:3,error:4};function a(){this.enabled=!0,this.defaultResult=!0,this.clear()}function o(e,t){return e.n.test?e.n.test(t):e.n==t}r.mixin(a),a.prototype.allow=function(e,t){return this._white.push({n:e,l:i[t]}),this},a.prototype.deny=function(e,t){return this._black.push({n:e,l:i[t]}),this},a.prototype.clear=function(){return this._white=[],this._black=[],this},a.prototype.test=function(e,t){var n,r=Math.max(this._white.length,this._black.length);for(n=0;n<r;n++){if(this._white[n]&&o(this._white[n],e)&&i[t]>=this._white[n].l)return!0;if(this._black[n]&&o(this._black[n],e)&&i[t]<=this._black[n].l)return!1}return this.defaultResult},a.prototype.write=function(e,t,n){if(!this.enabled||this.test(e,t))return this.emit("item",e,t,n)},e.exports=a},function(e,t,n){function r(){}n(0).mixin(r),r.prototype.write=function(){console.log.apply(console,arguments)};var i=new r;n(1).levelMap;i.filterEnv=function(){return console.error("Minilog.backends.console.filterEnv is deprecated in Minilog v2."),n(6)},i.formatters=["formatClean","formatColor","formatNpm","formatLearnboost","formatMinilog","formatWithStack","formatTime"],i.formatClean=new(n(30)),i.formatColor=new(n(31)),i.formatNpm=new(n(32)),i.formatLearnboost=new(n(33)),i.formatMinilog=new(n(34)),i.formatWithStack=new(n(35)),i.formatTime=new(n(36)),e.exports=i},function(e,t,n){function r(){}n(0).mixin(r),r.prototype.write=function(e,t,n){this.emit("item",(e?e+" ":"")+(t?t+" ":"")+n.join(" "))},e.exports=r},function(e,t,n){var r=n(0),i=n(1).style;function a(){}r.mixin(a),a.prototype.write=function(e,t,n){var r;this.emit("item",(e?e+" ":"")+(t?i("- "+((4==(r=t.toUpperCase()).toString().length?" "+r:r)+" -"),{debug:"magenta",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+n.join(" "))},e.exports=a},function(e,t,n){function r(){}n(0).mixin(r),r.prototype.write=function(e,t,n){var r={debug:"debug ",info:"info ",warn:"WARN ",error:"ERR! "};this.emit("item",(e?""+e+" ":"")+(t&&r[t]?r[t]:"")+n.join(" "))},e.exports=r},function(e,t,n){var r=n(0),i=n(1).style;function a(){}r.mixin(a),a.prototype.write=function(e,t,n){this.emit("item",(e?i(e+" ","grey"):"")+(t?i(t,{debug:"grey",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+n.join(" "))},e.exports=a},function(e,t,n){var r=n(0),i=n(1).style,a=n(7);function o(){}r.mixin(o),o.prototype.write=function(e,t,n){this.emit("item",(e?i(e+" ","grey"):"")+(t?i(t,{debug:"blue",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+n.map((function(e){return"string"==typeof e?e:a.inspect(e,null,3,!0)})).join(" "))},e.exports=o},function(e,t,n){var r=n(0),i=n(1).style;function a(){}function o(e){return e}r.mixin(a);var s={string:o,number:o,default:JSON.stringify.bind(JSON)};a.prototype.write=function(e,t,n){var r,o=function(){var e=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var t=new Error;Error.captureStackTrace(t,arguments.callee);var n=t.stack;return Error.prepareStackTrace=e,n}()[5],c=a.fullPath?o.getFileName():o.getFileName().replace(/^.*\/(.+)$/,"/$1");this.emit("item",(e?e+" ":"")+(t?i(4==(r=t).toString().length?" "+r:r,{debug:"magenta",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+i(c+":"+o.getLineNumber(),"grey")+" "+function(e){return e.map((function(e){return(s[typeof e]||s.default)(e)}))}(n).join(" "))},a.fullPath=!0,e.exports=a},function(e,t,n){var r=n(0),i=n(1).style,a=n(7);function o(){}r.mixin(o),o.prototype.write=function(e,t,n){var r;this.emit("item",i(("0"+(r=new Date).getDate()).slice(-2)+"-"+("0"+(r.getMonth()+1)).slice(-2)+"-"+r.getFullYear()+" "+("0"+r.getHours()).slice(-2)+":"+("0"+r.getMinutes()).slice(-2)+":"+("0"+r.getSeconds()).slice(-2)+"."+("00"+r.getMilliseconds()).slice(-3)+" ","grey")+(e?i(e+" ","grey"):"")+(t?i(t,{debug:"blue",info:"cyan",warn:"yellow",error:"red"}[t])+" ":"")+n.map((function(e){return"string"==typeof e?e:a.inspect(e,null,3,!0)})).join(" "))},e.exports=o},function(e,t,n){var r=n(0),i=/\n+$/,a=new r;a.write=function(e,t,n){var r=n.length-1;if("undefined"!=typeof console&&console.log){if(console.log.apply)return console.log.apply(console,[e,t].concat(n));if(JSON&&JSON.stringify){n[r]&&"string"==typeof n[r]&&(n[r]=n[r].replace(i,""));try{for(r=0;r<n.length;r++)n[r]=JSON.stringify(n[r])}catch(e){}console.log(n.join(" "))}}},a.formatters=["color","minilog"],a.color=n(38),a.minilog=n(39),e.exports=a},function(e,t,n){var r=n(0),i=n(8),a={debug:["cyan"],info:["purple"],warn:["yellow",!0],error:["red",!0]},o=new r;o.write=function(e,t,n){console.log;console[t]&&console[t].apply&&console[t].apply(console,["%c"+e+" %c"+t,i("gray"),i.apply(i,a[t])].concat(n))},o.pipe=function(){},e.exports=o},function(e,t,n){var r=n(0),i=n(8),a={debug:["gray"],info:["purple"],warn:["yellow",!0],error:["red",!0]},o=new r;o.write=function(e,t,n){var r=console.log;"debug"!=t&&console[t]&&(r=console[t]);var o=0;if("info"!=t){for(;o<n.length&&"string"==typeof n[o];o++);r.apply(console,["%c"+e+" "+n.slice(0,o).join(" "),i.apply(i,a[t])].concat(n.slice(o)))}else r.apply(console,["%c"+e,i.apply(i,a[t])].concat(n))},o.pipe=function(){},e.exports=o},function(e,t,n){function r(){}n(0).mixin(r),r.prototype.write=function(e,t,n){var r=[];e&&r.push(e),t&&r.push(t),r=r.concat(n);for(var i=0;i<r.length;i++)if(r[i]&&"object"==typeof r[i])if(r[i].constructor&&r[i].constructor.isBuffer)r[i]=r[i].toString();else try{r[i]=JSON.stringify(r[i])}catch(e){}else r[i]=r[i];this.emit("item",r.join(" ")+"\n")},e.exports=r},function(e,t){e.exports=require("stream")},function(e,t){function n(e){this.client=e.client,this.key=e.key}n.prototype.write=function(e){this.client.rpush(this.key,e)},n.prototype.end=function(){},n.prototype.clear=function(e){this.client.del(this.key,e)},e.exports=n},function(e,t,n){const r=n(44);e.exports=e=>{const t=r.namespace(),n=(e,n)=>{if(e&&"object"==typeof e);else{if("string"!=typeof e)throw new Error("unsupported data type in translate()");e={default:e}}return t(e,n)},i=e=>"_".concat(e),a=()=>e?e.getLocale():"undefined"!=typeof navigator?navigator.language:"en";let o={};return n.setup=e=>{e&&(o=e),t.setup({locale:a(),missingTranslation:"ignore",generateId:i,translations:o})},Object.defineProperty(n,"language",{configurable:!0,enumerable:!0,get:()=>a()}),n.setup({}),e&&e.on("LOCALE_CHANGED",()=>{n.setup(null)}),n}},function(e,t,n){"use strict";var r=n(45),i=n(46),a=n(12),o=n(11),s=n(10);function c(e,t){return Object.keys(t).forEach((function(n){e[n]=t[n]})),e}e.exports=function e(){var t=c({},s),n="en",l={},u=function(e){return e},f=null,d="warning",p={};function h(e,t,a){var o="string"==typeof e?e:e.default,s=y(o,"object"==typeof e&&e.id||u(o),a||n);return(s.format||(s.format=i(r(s.message),a||n,p)))(t)}h.rich=function(e,t,a){var o="string"==typeof e?e:e.default,s=y(o,"object"==typeof e&&e.id||u(o),a||n);return(s.toParts||(s.toParts=i.toParts(r(s.message,{tagsType:m}),a||n,p)))(t)};var m="<>";function g(e,t){var n=e[2];return function(e,t){var r="object"==typeof n?function(e,t){return Object.keys(e).reduce((function(n,r){return n[r]=e[r](t),n}),{})}(n,t):n;return"function"==typeof e?e(r):e}}function y(e,t,n){var r=o(n,l)||"en",i=l[r]||(l[r]={}),a=i[t];if("string"==typeof a&&(a=i[t]={message:a}),!a){var s='Translation for "'+t+'" in "'+r+'" is missing';if("warning"===d)"undefined"!=typeof console&&console.warn(s);else if("ignore"!==d)throw new Error(s);var c="function"==typeof f?f(e,t,r)||e:f||e;a=i[t]={message:c}}return a}function b(e,t,r,i,s){"object"==typeof r&&"object"!=typeof i&&(s=i,i=r,r=0);var c=o(s||n,a),l=c&&a[c][e]||v;return i["="+ +t]||i[l(t-r)]||i.other}function v(){return"other"}return p[m]=g,h.setup=function(e){return(e=e||{}).locale&&(n=e.locale),"translations"in e&&(l=e.translations||{}),e.generateId&&(u=e.generateId),"missingReplacement"in e&&(f=e.missingReplacement),e.missingTranslation&&(d=e.missingTranslation),e.formats&&(e.formats.number&&c(t.number,e.formats.number),e.formats.date&&c(t.date,e.formats.date),e.formats.time&&c(t.time,e.formats.time)),e.types&&((p=e.types)[m]=g),{locale:n,translations:l,generateId:u,missingReplacement:f,missingTranslation:d,formats:t,types:p}},h.number=function(e,r,i){var a=r&&t.number[r]||t.parseNumberPattern(r)||t.number.default;return new Intl.NumberFormat(i||n,a).format(e)},h.date=function(e,r,i){var a=r&&t.date[r]||t.parseDatePattern(r)||t.date.default;return new Intl.DateTimeFormat(i||n,a).format(e)},h.time=function(e,r,i){var a=r&&t.time[r]||t.parseDatePattern(r)||t.time.default;return new Intl.DateTimeFormat(i||n,a).format(e)},h.select=function(e,t){return t[e]||t.other},h.custom=function(e,t,n,r){return e[1]in p?p[e[1]](e,t)(n,r):n},h.plural=b.bind(null,"cardinal"),h.selectordinal=b.bind(null,"ordinal"),h.namespace=e,h}()},function(e,t,n){"use strict";var r=["number","date","time","ordinal","duration","spellout"],i=["plural","select","selectordinal"];function a(e,t){var n=e.pattern,r=n.length,i=[],a=e.index,s=o(e,t);for(s&&i.push(s),s&&e.tokens&&e.tokens.push(["text",n.slice(a,e.index)]);e.index<r;){if("}"===n[e.index]){if(!t)throw h(e);break}if(t&&e.tagsType&&"</"===n.slice(e.index,e.index+"</".length))break;i.push(l(e)),a=e.index,(s=o(e,t))&&i.push(s),s&&e.tokens&&e.tokens.push(["text",n.slice(a,e.index)])}return i}function o(e,t){for(var n=e.pattern,r=n.length,i="plural"===t||"selectordinal"===t,a=!!e.tagsType,o="{style}"===t,c="";e.index<r;){var l=n[e.index];if("{"===l||"}"===l||i&&"#"===l||a&&"<"===l||o&&s(l.charCodeAt(0)))break;if("'"===l)if("'"===(l=n[++e.index]))c+=l,++e.index;else if("{"===l||"}"===l||i&&"#"===l||a&&"<"===l||o)for(c+=l;++e.index<r;)if("'"===(l=n[e.index])&&"'"===n[e.index+1])c+="'",++e.index;else{if("'"===l){++e.index;break}c+=l}else c+="'";else c+=l,++e.index}return c}function s(e){return e>=9&&e<=13||32===e||133===e||160===e||6158===e||e>=8192&&e<=8205||8232===e||8233===e||8239===e||8287===e||8288===e||12288===e||65279===e}function c(e){for(var t=e.pattern,n=t.length,r=e.index;e.index<n&&s(t.charCodeAt(e.index));)++e.index;r<e.index&&e.tokens&&e.tokens.push(["space",e.pattern.slice(r,e.index)])}function l(e){var t=e.pattern;if("#"===t[e.index])return e.tokens&&e.tokens.push(["syntax","#"]),++e.index,["#"];var n=function(e){var t=e.tagsType;if(!t||"<"!==e.pattern[e.index])return;if("</"===e.pattern.slice(e.index,e.index+"</".length))throw h(e,null,"closing tag without matching opening tag");e.tokens&&e.tokens.push(["syntax","<"]);++e.index;var n=u(e,!0);if(!n)throw h(e,"placeholder id");e.tokens&&e.tokens.push(["id",n]);if(c(e),"/>"===e.pattern.slice(e.index,e.index+"/>".length))return e.tokens&&e.tokens.push(["syntax","/>"]),e.index+="/>".length,[n,t];if(">"!==e.pattern[e.index])throw h(e,">");e.tokens&&e.tokens.push(["syntax",">"]);++e.index;var r=a(e,t),i=e.index;if("</"!==e.pattern.slice(e.index,e.index+"</".length))throw h(e,"</"+n+">");e.tokens&&e.tokens.push(["syntax","</"]);e.index+="</".length;var o=u(e,!0);o&&e.tokens&&e.tokens.push(["id",o]);if(n!==o)throw e.index=i,h(e,"</"+n+">","</"+o+">");if(c(e),">"!==e.pattern[e.index])throw h(e,">");e.tokens&&e.tokens.push(["syntax",">"]);return++e.index,[n,t,{children:r}]}(e);if(n)return n;if("{"!==t[e.index])throw h(e,"{");e.tokens&&e.tokens.push(["syntax","{"]),++e.index,c(e);var i=u(e);if(!i)throw h(e,"placeholder id");e.tokens&&e.tokens.push(["id",i]),c(e);var o=t[e.index];if("}"===o)return e.tokens&&e.tokens.push(["syntax","}"]),++e.index,[i];if(","!==o)throw h(e,", or }");e.tokens&&e.tokens.push(["syntax",","]),++e.index,c(e);var s,l=u(e);if(!l)throw h(e,"placeholder type");if(e.tokens&&e.tokens.push(["type",l]),c(e),"}"===(o=t[e.index])){if(e.tokens&&e.tokens.push(["syntax","}"]),"plural"===l||"selectordinal"===l||"select"===l)throw h(e,l+" sub-messages");return++e.index,[i,l]}if(","!==o)throw h(e,", or }");if(e.tokens&&e.tokens.push(["syntax",","]),++e.index,c(e),"plural"===l||"selectordinal"===l){var p=function(e){var t=e.pattern,n=t.length,r=0;if("offset:"===t.slice(e.index,e.index+"offset:".length)){e.tokens&&e.tokens.push(["offset","offset"],["syntax",":"]),e.index+="offset:".length,c(e);for(var i=e.index;e.index<n&&((a=t.charCodeAt(e.index))>=48&&a<=57);)++e.index;if(i===e.index)throw h(e,"offset number");e.tokens&&e.tokens.push(["number",t.slice(i,e.index)]),r=+t.slice(i,e.index)}var a;return r}(e);c(e),s=[i,l,p,d(e,l)]}else if("select"===l)s=[i,l,d(e,l)];else if(r.indexOf(l)>=0)s=[i,l,f(e)];else{var m=e.index,g=f(e);c(e),"{"===t[e.index]&&(e.index=m,g=d(e,l)),s=[i,l,g]}if(c(e),"}"!==t[e.index])throw h(e,"}");return e.tokens&&e.tokens.push(["syntax","}"]),++e.index,s}function u(e,t){for(var n=e.pattern,r=n.length,i="";e.index<r;){var a=n[e.index];if("{"===a||"}"===a||","===a||"#"===a||"'"===a||s(a.charCodeAt(0))||t&&("<"===a||">"===a||"/"===a))break;i+=a,++e.index}return i}function f(e){var t=e.index,n=o(e,"{style}");if(!n)throw h(e,"placeholder style name");return e.tokens&&e.tokens.push(["style",e.pattern.slice(t,e.index)]),n}function d(e,t){for(var n=e.pattern,r=n.length,a={};e.index<r&&"}"!==n[e.index];){var o=u(e);if(!o)throw h(e,"sub-message selector");e.tokens&&e.tokens.push(["selector",o]),c(e),a[o]=p(e,t),c(e)}if(!a.other&&i.indexOf(t)>=0)throw h(e,null,null,'"other" sub-message must be specified in '+t);return a}function p(e,t){if("{"!==e.pattern[e.index])throw h(e,"{ to start sub-message");e.tokens&&e.tokens.push(["syntax","{"]),++e.index;var n=a(e,t);if("}"!==e.pattern[e.index])throw h(e,"} to end sub-message");return e.tokens&&e.tokens.push(["syntax","}"]),++e.index,n}function h(e,t,n,r){var i=e.pattern,a=i.slice(0,e.index).split(/\r?\n/),o=e.index,s=a.length,c=a.slice(-1)[0].length;return n=n||(e.index>=i.length?"end of message pattern":u(e)||i[e.index]),r||(r=function(e,t){return e?"Expected "+e+" but found "+t:"Unexpected "+t+" found"}(t,n)),new m(r+=" in "+i.replace(/\r?\n/g,"\n"),t,n,o,s,c)}function m(e,t,n,r,i,a){Error.call(this,e),this.name="SyntaxError",this.message=e,this.expected=t,this.found=n,this.offset=r,this.line=i,this.column=a}t=e.exports=function(e,t){return a({pattern:String(e),index:0,tagsType:t&&t.tagsType||null,tokens:t&&t.tokens||null},"")},m.prototype=Object.create(Error.prototype),t.SyntaxError=m},function(e,t,n){"use strict";var r=n(10),i=n(11),a=n(12);function o(e,t,n,r,i){var a=e.map((function(e){return function(e,t,n,r,i){if("string"==typeof e){var a=e;return function(){return a}}var c,l=e[0],u=e[1];if(t&&"#"===e[0]){l=t[0];var f=t[2],p=(r.number||d.number)([l,"number"],n);return function(e){return p(s(l,e)-f,e)}}"plural"===u||"selectordinal"===u?(c={},Object.keys(e[3]).forEach((function(t){c[t]=o(e[3][t],e,n,r,i)})),e=[e[0],e[1],e[2],c]):e[2]&&"object"==typeof e[2]&&(c={},Object.keys(e[2]).forEach((function(t){c[t]=o(e[2][t],e,n,r,i)})),e=[e[0],e[1],c]);var h=u&&(r[u]||d[u]);if(h){var m=h(e,n);return function(e){return m(s(l,e),e)}}return i?function(e){return String(s(l,e))}:function(e){return s(l,e)}}(e,t,n,r,i)}));return i?1===a.length?a[0]:function(e){for(var t="",n=0;n<a.length;++n)t+=a[n](e);return t}:function(e){return a.reduce((function(t,n){return t.concat(n(e))}),[])}}function s(e,t){if(t&&e in t)return t[e];for(var n=e.split("."),r=t,i=0,a=n.length;r&&i<a;++i)r=r[n[i]];return r}function c(e,t){var n=e[2],i=r.number[n]||r.parseNumberPattern(n)||r.number.default;return new Intl.NumberFormat(t,i).format}function l(e,t){var n=e[1],i=e[2],a=r[n][i]||r.parseDatePattern(i)||r[n].default;return new Intl.DateTimeFormat(t,a).format}function u(e,t){var n,r="selectordinal"===e[1]?"ordinal":"cardinal",o=e[2],s=e[3];if(Intl.PluralRules&&Intl.PluralRules.supportedLocalesOf(t).length>0)n=new Intl.PluralRules(t,{type:r});else{var c=i(t,a),l=c&&a[c][r]||f;n={select:l}}return function(e,t){return(s["="+ +e]||s[n.select(e-o)]||s.other)(t)}}function f(){return"other"}(t=e.exports=function(e,t,n){return o(e,null,t||"en",n||{},!0)}).toParts=function(e,t,n){return o(e,null,t||"en",n||{},!1)};var d={number:c,ordinal:c,spellout:c,duration:function(e,t){var n=e[2],i=r.duration[n]||r.duration.default,a=new Intl.NumberFormat(t,i.seconds).format,o=new Intl.NumberFormat(t,i.minutes).format,s=new Intl.NumberFormat(t,i.hours).format,c=/^fi$|^fi-|^da/.test(String(t))?".":":";return function(e,t){if(e=+e,!isFinite(e))return a(e);var n=~~(e/60/60),r=~~(e/60%60),i=(n?s(Math.abs(n))+c:"")+o(Math.abs(r))+c+a(Math.abs(e%60));return e<0?s(-1).replace(s(1),i):i}},date:l,time:l,plural:u,selectordinal:u,select:function(e,t){var n=e[2];return function(e,t){return(n[e]||n.other)(t)}}};t.types=d}]);