From 247bd010b8fb2ffb2f350192a05249924d333425 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 11:49:15 -0400 Subject: [PATCH 01/14] [Shared][Web] Refactor shared components --- shared/.eslintignore | 14 + shared/.eslintrc.js | 26 + shared/{submission-runner => }/.gitignore | 0 shared/.prettierignore | 2 + shared/.prettierrc | 7 + .../contest-monitor-types/package-lock.json | 10 - shared/contest-monitor-types/package.json | 3 - shared/contest-monitor-types/tsconfig.json | 12 - shared/dist/submission-runner/cpp.cjs | 207 ++ shared/dist/submission-runner/cpp.cjs.map | 1 + shared/dist/submission-runner/cpp.d.cts | 12 + shared/dist/submission-runner/cpp.d.cts.map | 1 + shared/dist/submission-runner/csharp.cjs | 129 ++ shared/dist/submission-runner/csharp.cjs.map | 1 + shared/dist/submission-runner/csharp.d.cts | 3 + .../dist/submission-runner/csharp.d.cts.map | 1 + shared/dist/submission-runner/java.cjs | 183 ++ shared/dist/submission-runner/java.cjs.map | 1 + .../submission-runner}/java.d.cts | 12 +- shared/dist/submission-runner/java.d.cts.map | 1 + shared/dist/submission-runner/settings.cjs | 5 + .../dist/submission-runner/settings.cjs.map | 1 + .../submission-runner}/settings.d.cts | 2 +- .../dist/submission-runner/settings.d.cts.map | 1 + shared/dist/submission-runner/types.cjs | 21 + shared/dist/submission-runner/types.cjs.map | 1 + shared/dist/submission-runner/types.d.cts | 53 + shared/dist/submission-runner/types.d.cts.map | 1 + shared/dist/tsconfig.tsbuildinfo | 1 + shared/package-lock.json | 1765 +++++++++++++++++ shared/package.json | 21 + shared/submission-runner/cpp.cts | 241 ++- shared/submission-runner/csharp.cts | 158 +- shared/submission-runner/dist/cpp.cjs | 157 -- shared/submission-runner/dist/cpp.cjs.map | 1 - shared/submission-runner/dist/cpp.d.cts | 12 - shared/submission-runner/dist/cpp.d.cts.map | 1 - shared/submission-runner/dist/csharp.cjs | 119 -- shared/submission-runner/dist/csharp.cjs.map | 1 - shared/submission-runner/dist/csharp.d.cts | 3 - .../submission-runner/dist/csharp.d.cts.map | 1 - shared/submission-runner/dist/java.cjs | 135 -- shared/submission-runner/dist/java.cjs.map | 1 - shared/submission-runner/dist/java.d.cts.map | 1 - shared/submission-runner/dist/settings.cjs | 5 - .../submission-runner/dist/settings.cjs.map | 1 - .../submission-runner/dist/settings.d.cts.map | 1 - .../dist/tsconfig.tsbuildinfo | 1 - shared/submission-runner/dist/types.cjs | 21 - shared/submission-runner/dist/types.cjs.map | 1 - shared/submission-runner/dist/types.d.cts | 39 - shared/submission-runner/dist/types.d.cts.map | 1 - shared/submission-runner/package-lock.json | 118 -- shared/submission-runner/package.json | 13 - shared/submission-runner/settings.cts | 2 +- shared/submission-runner/tsconfig.json | 14 - shared/submission-runner/types.cts | 9 +- shared/tsconfig.json | 14 + .../contestMonitorTypes.d.ts | 0 web/.prettierignore | 1 + web/.vscode/settings.json | 3 + web/package-lock.json | 28 +- web/package.json | 2 +- .../lib/contestMonitor/contestMonitorUtils.ts | 2 +- .../team/[session]/contestState/+server.ts | 2 +- .../api/team/[session]/submit/+server.ts | 2 +- 66 files changed, 2709 insertions(+), 900 deletions(-) create mode 100644 shared/.eslintignore create mode 100644 shared/.eslintrc.js rename shared/{submission-runner => }/.gitignore (100%) create mode 100644 shared/.prettierignore create mode 100644 shared/.prettierrc delete mode 100644 shared/contest-monitor-types/package-lock.json delete mode 100644 shared/contest-monitor-types/package.json delete mode 100644 shared/contest-monitor-types/tsconfig.json create mode 100644 shared/dist/submission-runner/cpp.cjs create mode 100644 shared/dist/submission-runner/cpp.cjs.map create mode 100644 shared/dist/submission-runner/cpp.d.cts create mode 100644 shared/dist/submission-runner/cpp.d.cts.map create mode 100644 shared/dist/submission-runner/csharp.cjs create mode 100644 shared/dist/submission-runner/csharp.cjs.map create mode 100644 shared/dist/submission-runner/csharp.d.cts create mode 100644 shared/dist/submission-runner/csharp.d.cts.map create mode 100644 shared/dist/submission-runner/java.cjs create mode 100644 shared/dist/submission-runner/java.cjs.map rename shared/{submission-runner/dist => dist/submission-runner}/java.d.cts (52%) create mode 100644 shared/dist/submission-runner/java.d.cts.map create mode 100644 shared/dist/submission-runner/settings.cjs create mode 100644 shared/dist/submission-runner/settings.cjs.map rename shared/{submission-runner/dist => dist/submission-runner}/settings.d.cts (51%) create mode 100644 shared/dist/submission-runner/settings.d.cts.map create mode 100644 shared/dist/submission-runner/types.cjs create mode 100644 shared/dist/submission-runner/types.cjs.map create mode 100644 shared/dist/submission-runner/types.d.cts create mode 100644 shared/dist/submission-runner/types.d.cts.map create mode 100644 shared/dist/tsconfig.tsbuildinfo create mode 100644 shared/package-lock.json create mode 100644 shared/package.json delete mode 100644 shared/submission-runner/dist/cpp.cjs delete mode 100644 shared/submission-runner/dist/cpp.cjs.map delete mode 100644 shared/submission-runner/dist/cpp.d.cts delete mode 100644 shared/submission-runner/dist/cpp.d.cts.map delete mode 100644 shared/submission-runner/dist/csharp.cjs delete mode 100644 shared/submission-runner/dist/csharp.cjs.map delete mode 100644 shared/submission-runner/dist/csharp.d.cts delete mode 100644 shared/submission-runner/dist/csharp.d.cts.map delete mode 100644 shared/submission-runner/dist/java.cjs delete mode 100644 shared/submission-runner/dist/java.cjs.map delete mode 100644 shared/submission-runner/dist/java.d.cts.map delete mode 100644 shared/submission-runner/dist/settings.cjs delete mode 100644 shared/submission-runner/dist/settings.cjs.map delete mode 100644 shared/submission-runner/dist/settings.d.cts.map delete mode 100644 shared/submission-runner/dist/tsconfig.tsbuildinfo delete mode 100644 shared/submission-runner/dist/types.cjs delete mode 100644 shared/submission-runner/dist/types.cjs.map delete mode 100644 shared/submission-runner/dist/types.d.cts delete mode 100644 shared/submission-runner/dist/types.d.cts.map delete mode 100644 shared/submission-runner/package-lock.json delete mode 100644 shared/submission-runner/package.json delete mode 100644 shared/submission-runner/tsconfig.json create mode 100644 shared/tsconfig.json rename shared/{contest-monitor-types => types}/contestMonitorTypes.d.ts (100%) create mode 100644 web/.vscode/settings.json diff --git a/shared/.eslintignore b/shared/.eslintignore new file mode 100644 index 0000000..47a3f23 --- /dev/null +++ b/shared/.eslintignore @@ -0,0 +1,14 @@ +.DS_Store +node_modules +/build +/.svelte-kit +/dist +/package +.env +.env.* +!.env.example + +# Ignore files for PNPM, NPM and YARN +pnpm-lock.yaml +package-lock.json +yarn.lock diff --git a/shared/.eslintrc.js b/shared/.eslintrc.js new file mode 100644 index 0000000..23cf85f --- /dev/null +++ b/shared/.eslintrc.js @@ -0,0 +1,26 @@ +module.exports = { + env: { + browser: true, + es2021: true, + node: true + }, + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + overrides: [ + { + env: { + node: true + }, + files: ['.eslintrc.{js,cjs}'], + parserOptions: { + sourceType: 'script' + } + } + ], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module' + }, + plugins: ['@typescript-eslint'], + rules: {} +}; diff --git a/shared/submission-runner/.gitignore b/shared/.gitignore similarity index 100% rename from shared/submission-runner/.gitignore rename to shared/.gitignore diff --git a/shared/.prettierignore b/shared/.prettierignore new file mode 100644 index 0000000..b2d59d1 --- /dev/null +++ b/shared/.prettierignore @@ -0,0 +1,2 @@ +/node_modules +/dist \ No newline at end of file diff --git a/shared/.prettierrc b/shared/.prettierrc new file mode 100644 index 0000000..86d4b8b --- /dev/null +++ b/shared/.prettierrc @@ -0,0 +1,7 @@ +{ + "tabWidth": 2, + "useTabs": true, + "singleQuote": true, + "trailingComma": "none", + "printWidth": 100 +} diff --git a/shared/contest-monitor-types/package-lock.json b/shared/contest-monitor-types/package-lock.json deleted file mode 100644 index 95b84d2..0000000 --- a/shared/contest-monitor-types/package-lock.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "extensionWeb", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "devDependencies": {} - } - } -} diff --git a/shared/contest-monitor-types/package.json b/shared/contest-monitor-types/package.json deleted file mode 100644 index d612ff4..0000000 --- a/shared/contest-monitor-types/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": "contest-monitor-types" -} diff --git a/shared/contest-monitor-types/tsconfig.json b/shared/contest-monitor-types/tsconfig.json deleted file mode 100644 index c75e988..0000000 --- a/shared/contest-monitor-types/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "composite": true, - "emitDeclarationOnly": true, - "outDir": "./build", - "strict": true, - "target": "ESNext", - "moduleResolution": "Node" - }, - "include": ["*.ts"] -} diff --git a/shared/dist/submission-runner/cpp.cjs b/shared/dist/submission-runner/cpp.cjs new file mode 100644 index 0000000..ccf1bd8 --- /dev/null +++ b/shared/dist/submission-runner/cpp.cjs @@ -0,0 +1,207 @@ +'use strict'; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function () { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, 'default', { enumerable: true, value: v }); + } + : function (o, v) { + o['default'] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; +var __importDefault = + (this && this.__importDefault) || + function (mod) { + return mod && mod.__esModule ? mod : { default: mod }; + }; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.runCpp = void 0; +const path_1 = require('path'); +const child_process_1 = require('child_process'); +const util = __importStar(require('util')); +const settings_cjs_1 = require('./settings.cjs'); +const tree_kill_1 = __importDefault(require('tree-kill')); +const os = __importStar(require('os')); +const fs = __importStar(require('fs-extra')); +const execPromise = util.promisify(child_process_1.exec); +const runCpp = function (params) { + return __awaiter(this, void 0, void 0, function* () { + var _a, _b; + const tmpDir = os.tmpdir(); + const buildDir = (0, path_1.join)(tmpDir, 'bwcontest-cpp'); + if (fs.existsSync(buildDir)) { + fs.removeSync(buildDir); + } + fs.mkdirSync(buildDir); + console.log(`- BUILD: ${params.problemName}`); + const configureCommand = `cmake -S ${params.srcDir} -B ${buildDir}`; + try { + yield execPromise(configureCommand); + } catch (e) { + const buildErrorText = + (_a = e === null || e === void 0 ? void 0 : e.toString()) !== null && _a !== void 0 + ? _a + : 'Unknown build errors.'; + console.log('Build errors: ' + buildErrorText); + return { + success: false, + runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } + }; + } + const compileCommand = `cmake --build ${buildDir} --target ${params.problemName}`; + try { + yield execPromise(compileCommand); + } catch (e) { + const buildErrorText = + (_b = e === null || e === void 0 ? void 0 : e.toString()) !== null && _b !== void 0 + ? _b + : 'Unknown build errors.'; + console.log('Build errors: ' + buildErrorText); + return { + success: false, + runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } + }; + } + console.log(`- RUN: ${params.problemName}`); + let runCommand = ''; + if (params.cppPlatform === 'VisualStudio') { + runCommand = `${(0, path_1.join)(buildDir, 'Debug', `${params.problemName}.exe`)}`; + } else { + runCommand = `${(0, path_1.join)(buildDir, params.problemName)}`; + } + try { + let outputBuffer = ''; + const child = (0, child_process_1.spawn)(runCommand, { shell: true }); + child.stdout.setEncoding('utf8'); + child.stdout.on('data', (data) => { + outputBuffer += data.toString(); + }); + child.stderr.setEncoding('utf8'); + child.stderr.on('data', (data) => { + outputBuffer += data.toString(); + }); + const runStartTime = performance.now(); + child.stdin.write(params.input); + child.stdin.end(); + let timeLimitExceeded = false; + let completedNormally = false; + return { + success: true, + runResult: new Promise((resolve) => { + child.on('close', () => { + completedNormally = !timeLimitExceeded; + const runEndTime = performance.now(); + const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); + if (completedNormally) { + clearTimeout(timeoutHandle); + resolve({ + kind: 'Completed', + output: outputBuffer, + exitCode: child.exitCode, + runtimeMilliseconds + }); + } else { + console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); + resolve({ + kind: 'TimeLimitExceeded', + output: outputBuffer, + resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds` + }); + } + }); + const timeoutHandle = setTimeout(() => { + if (completedNormally) { + return; + } + console.log( + `Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...` + ); + timeLimitExceeded = true; + child.stdin.end(); + child.stdin.destroy(); + child.stdout.destroy(); + child.stderr.destroy(); + child.kill('SIGKILL'); + }, settings_cjs_1.timeoutSeconds * 1000); + }), + killFunc() { + var _a; + if (child.pid !== undefined) { + if (!completedNormally && !timeLimitExceeded) { + (0, tree_kill_1.default)(child.pid); + (_a = params.outputCallback) === null || _a === void 0 + ? void 0 + : _a.call(params, '\n[Manually stopped]'); + } + } + } + }; + } catch (error) { + return { success: false, runResult: { kind: 'RunError' } }; + } + }); +}; +exports.runCpp = runCpp; +//# sourceMappingURL=cpp.cjs.map diff --git a/shared/dist/submission-runner/cpp.cjs.map b/shared/dist/submission-runner/cpp.cjs.map new file mode 100644 index 0000000..c76fbba --- /dev/null +++ b/shared/dist/submission-runner/cpp.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"cpp.cjs","sourceRoot":"","sources":["../../submission-runner/cpp.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B;AAC5B,iDAA4C;AAC5C,2CAA6B;AAE7B,iDAAgD;AAChD,0DAA6B;AAC7B,uCAAyB;AACzB,6CAA+B;AAE/B,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAYlC,MAAM,MAAM,GAA8B,UAChD,MAAwB;;;QAExB,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAC/C,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;QACD,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAEvB,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAE9C,MAAM,gBAAgB,GAAG,YAAY,MAAM,CAAC,MAAM,OAAO,QAAQ,EAAE,CAAC;QACpE,IAAI,CAAC;YACJ,MAAM,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACtE,CAAC;QACH,CAAC;QAED,MAAM,cAAc,GAAG,iBAAiB,QAAQ,aAAa,MAAM,CAAC,WAAW,EAAE,CAAC;QAClF,IAAI,CAAC;YACJ,MAAM,WAAW,CAAC,cAAc,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACtE,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAE5C,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,IAAI,MAAM,CAAC,WAAW,KAAK,cAAc,EAAE,CAAC;YAC3C,UAAU,GAAG,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,WAAW,MAAM,CAAC,EAAE,CAAC;QACxE,CAAC;aAAM,CAAC;YACP,UAAU,GAAG,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACtD,CAAC;QACD,IAAI,CAAC;YACJ,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjC,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjC,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC7C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACtB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACvB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACP,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACnB,CAAC,CAAC;wBACJ,CAAC;6BAAM,CAAC;4BACP,OAAO,CAAC,GAAG,CAAC,2CAA2C,mBAAmB,IAAI,CAAC,CAAC;4BAChF,OAAO,CAAC;gCACP,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC3D,CAAC,CAAC;wBACJ,CAAC;oBACF,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACrC,IAAI,iBAAiB,EAAE,CAAC;4BACvB,OAAO;wBACR,CAAC;wBAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,6BAAc,8BAA8B,CAAC,CAAC;wBACjF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACvB,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC3B,CAAC,CAAC;gBACF,QAAQ;;oBACP,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC9C,IAAA,mBAAI,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBACjD,CAAC;oBACF,CAAC;gBACF,CAAC;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,CAAC;IACF,CAAC;CAAA,CAAC;AArHW,QAAA,MAAM,UAqHjB"} \ No newline at end of file diff --git a/shared/dist/submission-runner/cpp.d.cts b/shared/dist/submission-runner/cpp.d.cts new file mode 100644 index 0000000..94c9a6b --- /dev/null +++ b/shared/dist/submission-runner/cpp.d.cts @@ -0,0 +1,12 @@ +import type { IRunner, IRunnerParams } from './types.cjs'; +export type CppPlatform = 'VisualStudio' | 'GCC'; +interface IRunnerParamsCpp extends IRunnerParams { + srcDir: string; + problemName: string; + input: string; + cppPlatform: CppPlatform; + outputCallback?: (data: string) => void; +} +export declare const runCpp: IRunner; +export {}; +//# sourceMappingURL=cpp.d.cts.map diff --git a/shared/dist/submission-runner/cpp.d.cts.map b/shared/dist/submission-runner/cpp.d.cts.map new file mode 100644 index 0000000..f559267 --- /dev/null +++ b/shared/dist/submission-runner/cpp.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"cpp.d.cts","sourceRoot":"","sources":["../../submission-runner/cpp.cts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAA4B,MAAM,aAAa,CAAC;AAQpF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,KAAK,CAAC;AAEjD,UAAU,gBAAiB,SAAQ,aAAa;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAqH5C,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/csharp.cjs b/shared/dist/submission-runner/csharp.cjs new file mode 100644 index 0000000..e30778c --- /dev/null +++ b/shared/dist/submission-runner/csharp.cjs @@ -0,0 +1,129 @@ +'use strict'; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; +var __importDefault = + (this && this.__importDefault) || + function (mod) { + return mod && mod.__esModule ? mod : { default: mod }; + }; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.runCSharp = void 0; +const child_process_1 = require('child_process'); +const tree_kill_1 = __importDefault(require('tree-kill')); +const settings_cjs_1 = require('./settings.cjs'); +const runCSharp = function (params) { + return __awaiter(this, void 0, void 0, function* () { + console.log(`- RUN: ${params.srcDir}`); + const child = (0, child_process_1.spawn)('dotnet run', { shell: true, cwd: params.srcDir }); + try { + let outputBuffer = ''; + child.stdout.setEncoding('utf8'); + child.stdout.on('data', (data) => { + var _a; + outputBuffer += data.toString(); + (_a = params.outputCallback) === null || _a === void 0 + ? void 0 + : _a.call(params, data.toString()); + }); + child.stderr.setEncoding('utf8'); + child.stderr.on('data', (data) => { + var _a; + outputBuffer += data.toString(); + (_a = params.outputCallback) === null || _a === void 0 + ? void 0 + : _a.call(params, data.toString()); + }); + const runStartTime = performance.now(); + child.stdin.write(params.input); + child.stdin.end(); + let timeLimitExceeded = false; + let completedNormally = false; + return { + success: true, + runResult: new Promise((resolve) => { + child.on('close', () => { + completedNormally = !timeLimitExceeded; + const runEndTime = performance.now(); + const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); + if (completedNormally) { + clearTimeout(timeoutHandle); + resolve({ + kind: 'Completed', + output: outputBuffer, + exitCode: child.exitCode, + runtimeMilliseconds + }); + } else { + console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); + resolve({ + kind: 'TimeLimitExceeded', + output: outputBuffer, + resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds` + }); + } + }); + const timeoutHandle = setTimeout(() => { + if (completedNormally) { + return; + } + console.log( + `Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...` + ); + timeLimitExceeded = true; + child.stdin.end(); + child.stdin.destroy(); + child.stdout.destroy(); + child.stderr.destroy(); + if (child.pid !== undefined) { + (0, tree_kill_1.default)(child.pid); + } + }, settings_cjs_1.timeoutSeconds * 1000); + }), + killFunc() { + var _a; + if (child.pid !== undefined) { + if (!completedNormally && !timeLimitExceeded) { + (0, tree_kill_1.default)(child.pid); + (_a = params.outputCallback) === null || _a === void 0 + ? void 0 + : _a.call(params, '\n[Manually stopped]'); + } + } + } + }; + } catch (error) { + return { success: false, runResult: { kind: 'RunError' } }; + } + }); +}; +exports.runCSharp = runCSharp; +//# sourceMappingURL=csharp.cjs.map diff --git a/shared/dist/submission-runner/csharp.cjs.map b/shared/dist/submission-runner/csharp.cjs.map new file mode 100644 index 0000000..f182bb9 --- /dev/null +++ b/shared/dist/submission-runner/csharp.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"csharp.cjs","sourceRoot":"","sources":["../../submission-runner/csharp.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAsC;AACtC,0DAA6B;AAE7B,iDAAgD;AAEzC,MAAM,SAAS,GAAY,UAAgB,MAIjD;;QACA,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAEvE,IAAI,CAAC;YACJ,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC7C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACtB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACvB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACP,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACnB,CAAC,CAAC;wBACJ,CAAC;6BAAM,CAAC;4BACP,OAAO,CAAC,GAAG,CAAC,2CAA2C,mBAAmB,IAAI,CAAC,CAAC;4BAChF,OAAO,CAAC;gCACP,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC3D,CAAC,CAAC;wBACJ,CAAC;oBACF,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACrC,IAAI,iBAAiB,EAAE,CAAC;4BACvB,OAAO;wBACR,CAAC;wBAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,6BAAc,8BAA8B,CAAC,CAAC;wBACjF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;4BAC7B,IAAA,mBAAI,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBACjB,CAAC;oBACF,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC3B,CAAC,CAAC;gBACF,QAAQ;;oBACP,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC9C,IAAA,mBAAI,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBACjD,CAAC;oBACF,CAAC;gBACF,CAAC;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,CAAC;IACF,CAAC;CAAA,CAAC;AApFW,QAAA,SAAS,aAoFpB"} \ No newline at end of file diff --git a/shared/dist/submission-runner/csharp.d.cts b/shared/dist/submission-runner/csharp.d.cts new file mode 100644 index 0000000..fed9556 --- /dev/null +++ b/shared/dist/submission-runner/csharp.d.cts @@ -0,0 +1,3 @@ +import type { IRunner } from './types.cjs'; +export declare const runCSharp: IRunner; +//# sourceMappingURL=csharp.d.cts.map diff --git a/shared/dist/submission-runner/csharp.d.cts.map b/shared/dist/submission-runner/csharp.d.cts.map new file mode 100644 index 0000000..16237ed --- /dev/null +++ b/shared/dist/submission-runner/csharp.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"csharp.d.cts","sourceRoot":"","sources":["../../submission-runner/csharp.cts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAA4B,MAAM,aAAa,CAAC;AAGrE,eAAO,MAAM,SAAS,EAAE,OAoFvB,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/java.cjs b/shared/dist/submission-runner/java.cjs new file mode 100644 index 0000000..bea0bc9 --- /dev/null +++ b/shared/dist/submission-runner/java.cjs @@ -0,0 +1,183 @@ +'use strict'; +var __createBinding = + (this && this.__createBinding) || + (Object.create + ? function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { + enumerable: true, + get: function () { + return m[k]; + } + }; + } + Object.defineProperty(o, k2, desc); + } + : function (o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; + }); +var __setModuleDefault = + (this && this.__setModuleDefault) || + (Object.create + ? function (o, v) { + Object.defineProperty(o, 'default', { enumerable: true, value: v }); + } + : function (o, v) { + o['default'] = v; + }); +var __importStar = + (this && this.__importStar) || + function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) + for (var k in mod) + if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) + __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; + }; +var __awaiter = + (this && this.__awaiter) || + function (thisArg, _arguments, P, generator) { + function adopt(value) { + return value instanceof P + ? value + : new P(function (resolve) { + resolve(value); + }); + } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + } + function rejected(value) { + try { + step(generator['throw'](value)); + } catch (e) { + reject(e); + } + } + function step(result) { + result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); + } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); + }; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.runJava = void 0; +const path_1 = require('path'); +const child_process_1 = require('child_process'); +const util = __importStar(require('util')); +const settings_cjs_1 = require('./settings.cjs'); +const kill = require('tree-kill'); +const execPromise = util.promisify(child_process_1.exec); +const runJava = function (params) { + return __awaiter(this, void 0, void 0, function* () { + var _a; + console.log(`- BUILD: ${params.mainFile}`); + const compileCommand = `javac -cp ${(0, path_1.join)(params.srcDir, 'src')} ${params.mainFile} -d ${(0, path_1.join)(params.srcDir, 'build')}`; + try { + yield execPromise(compileCommand); + } catch (e) { + const buildErrorText = + (_a = e === null || e === void 0 ? void 0 : e.toString()) !== null && _a !== void 0 + ? _a + : 'Unknown build errors.'; + console.log('Build errors: ' + buildErrorText); + return { + success: false, + runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } + }; + } + console.log(`- RUN: ${params.mainClass}`); + const runCommand = `java -cp "${(0, path_1.join)(params.srcDir, 'build')}" ${params.mainClass}`; + try { + let outputBuffer = ''; + const child = (0, child_process_1.spawn)(runCommand, { shell: true }); + child.stdout.setEncoding('utf8'); + child.stdout.on('data', (data) => { + var _a; + outputBuffer += data.toString(); + (_a = params.outputCallback) === null || _a === void 0 + ? void 0 + : _a.call(params, data.toString()); + }); + child.stderr.setEncoding('utf8'); + child.stderr.on('data', (data) => { + var _a; + outputBuffer += data.toString(); + (_a = params.outputCallback) === null || _a === void 0 + ? void 0 + : _a.call(params, data.toString()); + }); + const runStartTime = performance.now(); + child.stdin.write(params.input); + child.stdin.end(); + let timeLimitExceeded = false; + let completedNormally = false; + return { + success: true, + runResult: new Promise((resolve) => { + child.on('close', () => { + completedNormally = !timeLimitExceeded; + const runEndTime = performance.now(); + const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); + if (completedNormally) { + clearTimeout(timeoutHandle); + resolve({ + kind: 'Completed', + output: outputBuffer, + exitCode: child.exitCode, + runtimeMilliseconds + }); + } else { + console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); + resolve({ + kind: 'TimeLimitExceeded', + output: outputBuffer, + resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds` + }); + } + }); + const timeoutHandle = setTimeout(() => { + if (completedNormally) { + return; + } + console.log( + `Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...` + ); + timeLimitExceeded = true; + child.stdin.end(); + child.stdin.destroy(); + child.stdout.destroy(); + child.stderr.destroy(); + child.kill('SIGKILL'); + }, settings_cjs_1.timeoutSeconds * 1000); + }), + killFunc() { + var _a; + if (child.pid !== undefined) { + if (!completedNormally && !timeLimitExceeded) { + kill(child.pid); + (_a = params.outputCallback) === null || _a === void 0 + ? void 0 + : _a.call(params, '\n[Manually stopped]'); + } + } + } + }; + } catch (error) { + return { success: false, runResult: { kind: 'RunError' } }; + } + }); +}; +exports.runJava = runJava; +//# sourceMappingURL=java.cjs.map diff --git a/shared/dist/submission-runner/java.cjs.map b/shared/dist/submission-runner/java.cjs.map new file mode 100644 index 0000000..12657ef --- /dev/null +++ b/shared/dist/submission-runner/java.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"java.cjs","sourceRoot":"","sources":["../../submission-runner/java.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B;AAC5B,iDAA4C;AAC5C,2CAA6B;AAE7B,iDAAgD;AAEhD,kCAAmC;AAEnC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAUlC,MAAM,OAAO,GAA+B,UAClD,MAAyB;;;QAEzB,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3C,MAAM,cAAc,GAAG,aAAa,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,OAAO,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QAEvH,IAAI,CAAC;YACJ,MAAM,WAAW,CAAC,cAAc,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACtE,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1C,MAAM,UAAU,GAAG,aAAa,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;QAEpF,IAAI,CAAC;YACJ,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC7C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACtB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACvB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACP,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACnB,CAAC,CAAC;wBACJ,CAAC;6BAAM,CAAC;4BACP,OAAO,CAAC,GAAG,CAAC,2CAA2C,mBAAmB,IAAI,CAAC,CAAC;4BAChF,OAAO,CAAC;gCACP,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC3D,CAAC,CAAC;wBACJ,CAAC;oBACF,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACrC,IAAI,iBAAiB,EAAE,CAAC;4BACvB,OAAO;wBACR,CAAC;wBAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,6BAAc,8BAA8B,CAAC,CAAC;wBACjF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACvB,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC3B,CAAC,CAAC;gBACF,QAAQ;;oBACP,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBACjD,CAAC;oBACF,CAAC;gBACF,CAAC;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,CAAC;IACF,CAAC;CAAA,CAAC;AA/FW,QAAA,OAAO,WA+FlB"} \ No newline at end of file diff --git a/shared/submission-runner/dist/java.d.cts b/shared/dist/submission-runner/java.d.cts similarity index 52% rename from shared/submission-runner/dist/java.d.cts rename to shared/dist/submission-runner/java.d.cts index 97d6aa3..7b95dab 100644 --- a/shared/submission-runner/dist/java.d.cts +++ b/shared/dist/submission-runner/java.d.cts @@ -1,11 +1,11 @@ import type { IRunner, IRunnerParams } from './types.cjs'; interface IRunnerParamsJava extends IRunnerParams { - srcDir: string; - mainFile: string; - mainClass: string; - input: string; - outputCallback?: (data: string) => void; + srcDir: string; + mainFile: string; + mainClass: string; + input: string; + outputCallback?: (data: string) => void; } export declare const runJava: IRunner; export {}; -//# sourceMappingURL=java.d.cts.map \ No newline at end of file +//# sourceMappingURL=java.d.cts.map diff --git a/shared/dist/submission-runner/java.d.cts.map b/shared/dist/submission-runner/java.d.cts.map new file mode 100644 index 0000000..dc2f69f --- /dev/null +++ b/shared/dist/submission-runner/java.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"java.d.cts","sourceRoot":"","sources":["../../submission-runner/java.cts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAA4B,MAAM,aAAa,CAAC;AAOpF,UAAU,iBAAkB,SAAQ,aAAa;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,iBAAiB,CA+F9C,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/settings.cjs b/shared/dist/submission-runner/settings.cjs new file mode 100644 index 0000000..1a9089c --- /dev/null +++ b/shared/dist/submission-runner/settings.cjs @@ -0,0 +1,5 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.timeoutSeconds = void 0; +exports.timeoutSeconds = 30; +//# sourceMappingURL=settings.cjs.map diff --git a/shared/dist/submission-runner/settings.cjs.map b/shared/dist/submission-runner/settings.cjs.map new file mode 100644 index 0000000..edfee02 --- /dev/null +++ b/shared/dist/submission-runner/settings.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"settings.cjs","sourceRoot":"","sources":["../../submission-runner/settings.cts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/shared/submission-runner/dist/settings.d.cts b/shared/dist/submission-runner/settings.d.cts similarity index 51% rename from shared/submission-runner/dist/settings.d.cts rename to shared/dist/submission-runner/settings.d.cts index ada5067..1381f2c 100644 --- a/shared/submission-runner/dist/settings.d.cts +++ b/shared/dist/submission-runner/settings.d.cts @@ -1,2 +1,2 @@ export declare const timeoutSeconds = 30; -//# sourceMappingURL=settings.d.cts.map \ No newline at end of file +//# sourceMappingURL=settings.d.cts.map diff --git a/shared/dist/submission-runner/settings.d.cts.map b/shared/dist/submission-runner/settings.d.cts.map new file mode 100644 index 0000000..4df0761 --- /dev/null +++ b/shared/dist/submission-runner/settings.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"settings.d.cts","sourceRoot":"","sources":["../../submission-runner/settings.cts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,KAAK,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/types.cjs b/shared/dist/submission-runner/types.cjs new file mode 100644 index 0000000..f70e256 --- /dev/null +++ b/shared/dist/submission-runner/types.cjs @@ -0,0 +1,21 @@ +'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); +exports.RunResultZod = void 0; +const zod_1 = require('zod'); +const RunResultKind = zod_1.z.enum([ + 'CompileFailed', + 'TimeLimitExceeded', + 'Completed', + 'SandboxError', + 'RunError' +]); +exports.RunResultZod = zod_1.z + .object({ + kind: RunResultKind, + output: zod_1.z.string().optional(), + exitCode: zod_1.z.number().optional(), + runtimeMilliseconds: zod_1.z.number().optional(), + resultKindReason: zod_1.z.string().optional() + }) + .strict(); +//# sourceMappingURL=types.cjs.map diff --git a/shared/dist/submission-runner/types.cjs.map b/shared/dist/submission-runner/types.cjs.map new file mode 100644 index 0000000..92777ba --- /dev/null +++ b/shared/dist/submission-runner/types.cjs.map @@ -0,0 +1 @@ +{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../submission-runner/types.cts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,aAAa,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5B,eAAe;IACf,mBAAmB;IACnB,WAAW;IACX,cAAc;IACd,UAAU;CACV,CAAC,CAAC;AAIU,QAAA,YAAY,GAAG,OAAC;KAC3B,MAAM,CAAC;IACP,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC;KACD,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/types.d.cts b/shared/dist/submission-runner/types.d.cts new file mode 100644 index 0000000..c0db0da --- /dev/null +++ b/shared/dist/submission-runner/types.d.cts @@ -0,0 +1,53 @@ +import { z } from 'zod'; +declare const RunResultKind: z.ZodEnum< + ['CompileFailed', 'TimeLimitExceeded', 'Completed', 'SandboxError', 'RunError'] +>; +export type RunResultKind = z.infer; +export declare const RunResultZod: z.ZodObject< + { + kind: z.ZodEnum< + ['CompileFailed', 'TimeLimitExceeded', 'Completed', 'SandboxError', 'RunError'] + >; + output: z.ZodOptional; + exitCode: z.ZodOptional; + runtimeMilliseconds: z.ZodOptional; + resultKindReason: z.ZodOptional; + }, + 'strict', + z.ZodTypeAny, + { + kind: 'CompileFailed' | 'TimeLimitExceeded' | 'Completed' | 'SandboxError' | 'RunError'; + output?: string | undefined; + exitCode?: number | undefined; + runtimeMilliseconds?: number | undefined; + resultKindReason?: string | undefined; + }, + { + kind: 'CompileFailed' | 'TimeLimitExceeded' | 'Completed' | 'SandboxError' | 'RunError'; + output?: string | undefined; + exitCode?: number | undefined; + runtimeMilliseconds?: number | undefined; + resultKindReason?: string | undefined; + } +>; +export type RunResult = z.infer; +export interface IRunnerParams { + srcDir: string; + input: string; + outputCallback?: (data: string) => void; +} +export type IRunnerReturn = + | { + success: true; + killFunc: () => void; + runResult: Promise; + } + | { + success: false; + runResult: RunResult; + }; +export type IRunner = ( + params: T +) => Promise; +export {}; +//# sourceMappingURL=types.d.cts.map diff --git a/shared/dist/submission-runner/types.d.cts.map b/shared/dist/submission-runner/types.d.cts.map new file mode 100644 index 0000000..ae81917 --- /dev/null +++ b/shared/dist/submission-runner/types.d.cts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../submission-runner/types.cts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,aAAa,4FAMjB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;EAQf,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAErD,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,MAAM,aAAa,GACtB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAAE,GACtE;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AAE5C,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,CAC9D,MAAM,EAAE,CAAC,KACL,OAAO,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/shared/dist/tsconfig.tsbuildinfo b/shared/dist/tsconfig.tsbuildinfo new file mode 100644 index 0000000..e2af3cb --- /dev/null +++ b/shared/dist/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2016.full.d.ts","../node_modules/zod/lib/helpers/typeAliases.d.ts","../node_modules/zod/lib/helpers/util.d.ts","../node_modules/zod/lib/ZodError.d.ts","../node_modules/zod/lib/locales/en.d.ts","../node_modules/zod/lib/errors.d.ts","../node_modules/zod/lib/helpers/parseUtil.d.ts","../node_modules/zod/lib/helpers/enumUtil.d.ts","../node_modules/zod/lib/helpers/errorUtil.d.ts","../node_modules/zod/lib/helpers/partialUtil.d.ts","../node_modules/zod/lib/types.d.ts","../node_modules/zod/lib/external.d.ts","../node_modules/zod/lib/index.d.ts","../node_modules/zod/index.d.ts","../submission-runner/types.cts","../submission-runner/settings.cts","../node_modules/tree-kill/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/jsonfile/index.d.ts","../node_modules/@types/jsonfile/utils.d.ts","../node_modules/@types/fs-extra/index.d.ts","../submission-runner/cpp.cts","../submission-runner/csharp.cts","../submission-runner/java.cts","../types/contestMonitorTypes.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"807e0e0bdc67605dd28efe18f20ab5fcd75d944ef95936120702335f9379094b","5487b97cfa28b26b4a9ef0770f872bdbebd4c46124858de00f242c3eed7519f4","7a01f546ace66019156e4232a1bee2fabc2f8eabeb052473d926ee1693956265","fb53b1c6a6c799b7e3cc2de3fb5c9a1c04a1c60d4380a37792d84c5f8b33933b","8485b6da53ec35637d072e516631d25dae53984500de70a6989058f24354666f","ebe80346928736532e4a822154eb77f57ef3389dbe2b3ba4e571366a15448ef2","c2cb3c8ff388781258ea9ddbcd8a947f751bddd6886e1d3b3ea09ddaa895df80","f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","98a9cc18f661d28e6bd31c436e1984f3980f35e0f0aa9cf795c54f8ccb667ffe","c76b0c5727302341d0bdfa2cc2cee4b19ff185b554edb6e8543f0661d8487116","2a317fff5810a628d205a507998a77521120b462b03d36babf6eb387da991bee","f5ef066942e4f0bd98200aa6a6694b831e73200c9b3ade77ad0aa2409e8fe1b1","b9e99cd94f4166a245f5158f7286c05406e2a4c694619bceb7a4f3519d1d768e","5568d7c32e5cf5f35e092649f4e5e168c3114c800b1d7545b7ae5e0415704802",{"version":"5f48141dfa43072bddf45a657c3b87359e860a61af66d9ed1b4f2a013eb36bf7","signature":"66b8c0ccdd3c78425a0a3404062832b5de907d5d49a4a5972198da37ac7da261"},{"version":"825b3ed6c26f78a78b3a8f650455ebe1e09404801f7d73b460c9734d8a90cccb","signature":"acb8dd08d6b5134cd84c0ac9d62b5cf23ae691fe1cfb8565be2ebe16eca3c03e"},"8323e3f5b91261ed250bd7c6b7aba2aa10f8e1c2ef348297c1f7752a403abebd","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"7fd7fcbf021a5845bdd9397d4649fcf2fe17152d2098140fc723099a215d19ad","affectsGlobalScope":true},"df3389f71a71a38bc931aaf1ef97a65fada98f0a27f19dd12f8b8de2b0f4e461","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"a1d2988ad9d2aef7b9915a22b5e52c165c83a878f2851c35621409046bbe3c05","affectsGlobalScope":true},"bd3f5d05b6b5e4bfcea7739a45f3ffb4a7f4a3442ba7baf93e0200799285b8f1","4c775c2fccabf49483c03cd5e3673f87c1ffb6079d98e7b81089c3def79e29c6","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"674168aa3db414ea0a19b2a31d901b2d49705c7a495e43ffdc96928543010f8c","affectsGlobalScope":true},"fe1fd6afdfe77976d4c702f3746c05fb05a7e566845c890e0e970fe9376d6a90","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","afb1701fd4be413a8a5a88df6befdd4510c30a31372c07a4138facf61594c66d","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"c07146dbbbd8b347241b5df250a51e48f2d7bef19b1e187b1a3f20c849988ff1","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"ae5507fc333d637dec9f37c6b3f4d423105421ea2820a64818de55db85214d66","affectsGlobalScope":true},{"version":"0666f4c99b8688c7be5956df8fecf5d1779d3b22f8f2a88258ae7072c7b6026f","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","54e854615c4eafbdd3fd7688bd02a3aafd0ccf0e87c98f79d3e9109f047ce6b8","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","8221b00f271cf7f535a8eeec03b0f80f0929c7a16116e2d2df089b41066de69b","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","7424817d5eb498771e6d1808d726ec38f75d2eaf3fa359edd5c0c540c52725c1","9a9634296cca836c3308923ba7aa094fa6ed76bb1e366d8ddcf5c65888ab1024",{"version":"bddce945d552a963c9733db106b17a25474eefcab7fc990157a2134ef55d4954","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","4b55240c2a03b2c71e98a7fc528b16136faa762211c92e781a01c37821915ea6","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"94c086dff8dbc5998749326bc69b520e8e4273fb5b7b58b50e0210e0885dfcde","affectsGlobalScope":true},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true},"ebe5facd12fd7745cda5f4bc3319f91fb29dc1f96e57e9c6f8b260a7cc5b67ee","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","37dc027f781c75f0f546e329cfac7cf92a6b289f42458f47a9adc25e516b6839",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","211440ce81e87b3491cdf07155881344b0a61566df6e749acff0be7e8b9d1a07","5d9a0b6e6be8dbb259f64037bce02f34692e8c1519f5cd5d467d7fa4490dced4","880da0e0f3ebca42f9bd1bc2d3e5e7df33f2619d85f18ee0ed4bd16d1800bc32",{"version":"675fe8ad8203245d751a4014b8bc1f1e09f7f97c5f3aae0bd2d4a8528c0aad0f","signature":"82d159f5edb9039c79dbcbf86106ee6b84ba0b8bd4693055843c7bece7f12c17"},{"version":"13ed0b4f30bbbbd5d69f0a283fa35f2d84fe3c0e32144200a5bc560b0d3b1a98","signature":"4d164bb798fb511bf3f7789d3ebc1905a96fc6ede79132c49cc81d5c345704ad"},{"version":"4499adcc0f309c7c9cbe74f8b7025a1c6e892da4953f48027f370d3a1b29627e","signature":"28e13d30e85e06577560d06dcbdb08bcc5758eb3d649592ddef0b9fe1f199135"},"19d2e8aacb34c888cf6917760fbec060f14b84e72801d942d022c4288259949c","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4"],"root":[64,65,[156,159]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./","sourceMap":true,"strict":true,"target":3},"fileIdsList":[[116,152,153,154],[116,144,152],[67],[102],[103,108,136],[104,115,116,123,133,144],[104,105,115,123],[106,145],[107,108,116,124],[108,133,141],[109,111,115,123],[102,110],[111,112],[115],[113,115],[102,115],[115,116,117,133,144],[115,116,117,130,133,136],[100,103,149],[111,115,118,123,133,144],[115,116,118,119,123,133,141,144],[118,120,133,141,144],[67,68,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151],[115,121],[122,144,149],[111,115,123,133],[124],[125],[102,126],[127,143,149],[128],[129],[115,130,131],[130,132,145,147],[103,115,133,134,135,136],[103,133,135],[133,134],[136],[137],[102,133],[115,139,140],[139,140],[108,123,133,141],[142],[123,143],[103,118,129,144],[108,145],[133,146],[122,147],[148],[103,108,115,117,126,133,144,147,149],[133,150],[161,200],[161,185,200],[200],[161],[161,186,200],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199],[186,200],[77,81,144],[77,133,144],[72],[74,77,141,144],[123,141],[152],[72,152],[74,77,123,144],[69,70,73,76,103,115,133,144],[69,75],[73,77,103,136,144,152],[103,152],[93,103,152],[71,72,152],[77],[71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99],[77,84,85],[75,77,85,86],[76],[69,72,77],[77,81,85,86],[81],[75,77,80,144],[69,74,75,77,81,84],[103,133],[72,77,93,103,149,152],[62],[51,52,62],[53,54],[51,52,53,55,56,60],[52,53],[61],[53],[51,52,53,56,57,58,59],[64,65,66,104,124,125,145,155],[64,65,66,104],[64,65,66,104,125,145],[63],[64]],"referencedMap":[[155,1],[153,2],[67,3],[68,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,12],[111,13],[112,13],[114,14],[113,15],[115,16],[116,17],[117,18],[101,19],[118,20],[119,21],[120,22],[152,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,32],[130,33],[131,33],[132,34],[133,35],[135,36],[134,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,51],[150,52],[185,53],[186,54],[161,55],[164,55],[183,53],[184,53],[174,53],[173,56],[171,53],[166,53],[179,53],[177,53],[181,53],[165,53],[178,53],[182,53],[167,53],[168,53],[180,53],[162,53],[169,53],[170,53],[172,53],[176,53],[187,57],[175,53],[163,53],[200,58],[194,57],[196,59],[195,57],[188,57],[189,57],[191,57],[193,57],[197,59],[198,59],[190,59],[192,59],[84,60],[91,61],[83,60],[98,62],[75,63],[74,64],[97,65],[92,66],[95,67],[77,68],[76,69],[72,70],[71,71],[94,72],[73,73],[78,74],[82,74],[100,75],[99,74],[86,76],[87,77],[89,78],[85,79],[88,80],[93,65],[80,81],[81,82],[90,83],[70,84],[96,85],[63,86],[53,87],[55,88],[61,89],[56,90],[59,86],[62,91],[54,92],[60,93],[156,94],[157,95],[158,96],[64,97]],"exportedModulesMap":[[155,1],[153,2],[67,3],[68,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,12],[111,13],[112,13],[114,14],[113,15],[115,16],[116,17],[117,18],[101,19],[118,20],[119,21],[120,22],[152,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,32],[130,33],[131,33],[132,34],[133,35],[135,36],[134,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,51],[150,52],[185,53],[186,54],[161,55],[164,55],[183,53],[184,53],[174,53],[173,56],[171,53],[166,53],[179,53],[177,53],[181,53],[165,53],[178,53],[182,53],[167,53],[168,53],[180,53],[162,53],[169,53],[170,53],[172,53],[176,53],[187,57],[175,53],[163,53],[200,58],[194,57],[196,59],[195,57],[188,57],[189,57],[191,57],[193,57],[197,59],[198,59],[190,59],[192,59],[84,60],[91,61],[83,60],[98,62],[75,63],[74,64],[97,65],[92,66],[95,67],[77,68],[76,69],[72,70],[71,71],[94,72],[73,73],[78,74],[82,74],[100,75],[99,74],[86,76],[87,77],[89,78],[85,79],[88,80],[93,65],[80,81],[81,82],[90,83],[70,84],[96,85],[63,86],[53,87],[55,88],[61,89],[56,90],[59,86],[62,91],[54,92],[60,93],[156,98],[157,98],[158,98],[64,97]],"semanticDiagnosticsPerFile":[155,160,153,154,67,68,102,103,104,105,106,107,108,109,110,111,112,114,113,115,116,117,101,151,118,119,120,152,121,122,123,124,125,126,127,128,129,130,131,132,133,135,134,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,185,186,161,164,183,184,174,173,171,166,179,177,181,165,178,182,167,168,180,162,169,170,172,176,187,175,163,200,199,194,196,195,188,189,191,193,197,198,190,192,66,48,49,8,9,13,12,2,14,15,16,17,18,19,20,21,3,50,22,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,1,47,11,10,84,91,83,98,75,74,97,92,95,77,76,72,71,94,73,78,79,82,69,100,99,86,87,89,85,88,93,80,81,90,70,96,63,53,55,61,57,58,56,59,51,52,62,54,60,156,157,158,65,64,159],"latestChangedDtsFile":"./submission-runner/java.d.cts"},"version":"5.4.2"} \ No newline at end of file diff --git a/shared/package-lock.json b/shared/package-lock.json new file mode 100644 index 0000000..8457105 --- /dev/null +++ b/shared/package-lock.json @@ -0,0 +1,1765 @@ +{ + "name": "bwcontest-shared", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bwcontest-shared", + "devDependencies": { + "@types/fs-extra": "^11.0.4", + "@types/node": "20.x", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "eslint": "^8.57.0", + "fs-extra": "^11.2.0", + "prettier": "^3.2.5", + "tree-kill": "^1.2.2", + "typescript": "^5.4.2", + "zod": "^3.22.4" + } + }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/fs-extra": { + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", + "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", + "dev": true, + "dependencies": { + "@types/jsonfile": "*", + "@types/node": "*" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/jsonfile": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.4.tgz", + "integrity": "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "20.11.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.26.tgz", + "integrity": "sha512-YwOMmyhNnAWijOBQweOJnQPl068Oqd4K3OFbTc6AHJwzweUwwWG3GIFY74OKks2PJUDkQPeddOQES9mLn1CTEQ==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz", + "integrity": "sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/type-utils": "7.2.0", + "@typescript-eslint/utils": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", + "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", + "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz", + "integrity": "sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/utils": "7.2.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", + "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", + "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.2.0.tgz", + "integrity": "sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", + "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.2.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", + "dev": true, + "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-api-utils": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "3.22.4", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", + "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/shared/package.json b/shared/package.json new file mode 100644 index 0000000..96660c1 --- /dev/null +++ b/shared/package.json @@ -0,0 +1,21 @@ +{ + "name": "bwcontest-shared", + "scripts": { + "build": "tsc", + "format": "prettier --write .", + "lint": "prettier --check . && eslint .", + "check": "tsc -noEmit" + }, + "devDependencies": { + "@types/fs-extra": "^11.0.4", + "@types/node": "20.x", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "eslint": "^8.57.0", + "fs-extra": "^11.2.0", + "prettier": "^3.2.5", + "tree-kill": "^1.2.2", + "typescript": "^5.4.2", + "zod": "^3.22.4" + } +} diff --git a/shared/submission-runner/cpp.cts b/shared/submission-runner/cpp.cts index bb2cfa9..a7b6722 100644 --- a/shared/submission-runner/cpp.cts +++ b/shared/submission-runner/cpp.cts @@ -1,148 +1,139 @@ -import { join } from "path"; -import { exec, spawn } from "child_process"; -import * as util from "util"; -import type { - IRunner, - IRunnerParams, - IRunnerReturn, - RunResult, -} from "./types.cjs"; -import { timeoutSeconds } from "./settings.cjs"; -import kill from "tree-kill"; -import * as os from "os"; -import * as fs from "fs-extra"; +import { join } from 'path'; +import { exec, spawn } from 'child_process'; +import * as util from 'util'; +import type { IRunner, IRunnerParams, IRunnerReturn, RunResult } from './types.cjs'; +import { timeoutSeconds } from './settings.cjs'; +import kill from 'tree-kill'; +import * as os from 'os'; +import * as fs from 'fs-extra'; const execPromise = util.promisify(exec); -export type CppPlatform = "VisualStudio" | "GCC"; +export type CppPlatform = 'VisualStudio' | 'GCC'; interface IRunnerParamsCpp extends IRunnerParams { - srcDir: string; - problemName: string; - input: string; - cppPlatform: CppPlatform; - outputCallback?: (data: string) => void; + srcDir: string; + problemName: string; + input: string; + cppPlatform: CppPlatform; + outputCallback?: (data: string) => void; } export const runCpp: IRunner = async function ( - params: IRunnerParamsCpp + params: IRunnerParamsCpp ): Promise { - const tmpDir = os.tmpdir(); - const buildDir = join(tmpDir, "bwcontest-cpp"); - if (fs.existsSync(buildDir)) { - fs.removeSync(buildDir); - } - fs.mkdirSync(buildDir); + const tmpDir = os.tmpdir(); + const buildDir = join(tmpDir, 'bwcontest-cpp'); + if (fs.existsSync(buildDir)) { + fs.removeSync(buildDir); + } + fs.mkdirSync(buildDir); - console.log(`- BUILD: ${params.problemName}`); + console.log(`- BUILD: ${params.problemName}`); - const configureCommand = `cmake -S ${params.srcDir} -B ${buildDir}`; - try { - await execPromise(configureCommand); - } catch (e) { - const buildErrorText = e?.toString() ?? "Unknown build errors."; - console.log("Build errors: " + buildErrorText); - return { - success: false, - runResult: { kind: "CompileFailed", resultKindReason: buildErrorText }, - }; - } + const configureCommand = `cmake -S ${params.srcDir} -B ${buildDir}`; + try { + await execPromise(configureCommand); + } catch (e) { + const buildErrorText = e?.toString() ?? 'Unknown build errors.'; + console.log('Build errors: ' + buildErrorText); + return { + success: false, + runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } + }; + } - const compileCommand = `cmake --build ${buildDir} --target ${params.problemName}`; - try { - await execPromise(compileCommand); - } catch (e) { - const buildErrorText = e?.toString() ?? "Unknown build errors."; - console.log("Build errors: " + buildErrorText); - return { - success: false, - runResult: { kind: "CompileFailed", resultKindReason: buildErrorText }, - }; - } + const compileCommand = `cmake --build ${buildDir} --target ${params.problemName}`; + try { + await execPromise(compileCommand); + } catch (e) { + const buildErrorText = e?.toString() ?? 'Unknown build errors.'; + console.log('Build errors: ' + buildErrorText); + return { + success: false, + runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } + }; + } - console.log(`- RUN: ${params.problemName}`); + console.log(`- RUN: ${params.problemName}`); - let runCommand = ""; - if (params.cppPlatform === "VisualStudio") { - runCommand = `${join(buildDir, "Debug", `${params.problemName}.exe`)}`; - } else { - runCommand = `${join(buildDir, params.problemName)}`; - } - try { - let outputBuffer = ""; - const child = spawn(runCommand, { shell: true }); - child.stdout.setEncoding("utf8"); - child.stdout.on("data", (data) => { - outputBuffer += data.toString(); - }); - child.stderr.setEncoding("utf8"); - child.stderr.on("data", (data) => { - outputBuffer += data.toString(); - }); + let runCommand = ''; + if (params.cppPlatform === 'VisualStudio') { + runCommand = `${join(buildDir, 'Debug', `${params.problemName}.exe`)}`; + } else { + runCommand = `${join(buildDir, params.problemName)}`; + } + try { + let outputBuffer = ''; + const child = spawn(runCommand, { shell: true }); + child.stdout.setEncoding('utf8'); + child.stdout.on('data', (data) => { + outputBuffer += data.toString(); + }); + child.stderr.setEncoding('utf8'); + child.stderr.on('data', (data) => { + outputBuffer += data.toString(); + }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); + const runStartTime = performance.now(); + child.stdin.write(params.input); + child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; + let timeLimitExceeded = false; + let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on("close", () => { - completedNormally = !timeLimitExceeded; + return { + success: true, + runResult: new Promise((resolve) => { + child.on('close', () => { + completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); + const runEndTime = performance.now(); + const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: "Completed", - output: outputBuffer, - exitCode: child.exitCode!, - runtimeMilliseconds, - }); - } else { - console.log( - `Process terminated, total sandbox time: ${runtimeMilliseconds}ms` - ); - resolve({ - kind: "TimeLimitExceeded", - output: outputBuffer, - resultKindReason: `Timeout after ${timeoutSeconds} seconds`, - }); - } - }); + if (completedNormally) { + clearTimeout(timeoutHandle); + resolve({ + kind: 'Completed', + output: outputBuffer, + exitCode: child.exitCode!, + runtimeMilliseconds + }); + } else { + console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); + resolve({ + kind: 'TimeLimitExceeded', + output: outputBuffer, + resultKindReason: `Timeout after ${timeoutSeconds} seconds` + }); + } + }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } + const timeoutHandle = setTimeout(() => { + if (completedNormally) { + return; + } - console.log( - `Run timed out after ${timeoutSeconds} seconds, killing process...` - ); - timeLimitExceeded = true; + console.log(`Run timed out after ${timeoutSeconds} seconds, killing process...`); + timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - child.kill("SIGKILL"); - }, timeoutSeconds * 1000); - }), - killFunc() { - if (child.pid !== undefined) { - if (!completedNormally && !timeLimitExceeded) { - kill(child.pid); - params.outputCallback?.("\n[Manually stopped]"); - } - } - }, - }; - } catch (error) { - return { success: false, runResult: { kind: "RunError" } }; - } + child.stdin.end(); + child.stdin.destroy(); + child.stdout.destroy(); + child.stderr.destroy(); + child.kill('SIGKILL'); + }, timeoutSeconds * 1000); + }), + killFunc() { + if (child.pid !== undefined) { + if (!completedNormally && !timeLimitExceeded) { + kill(child.pid); + params.outputCallback?.('\n[Manually stopped]'); + } + } + } + }; + } catch (error) { + return { success: false, runResult: { kind: 'RunError' } }; + } }; diff --git a/shared/submission-runner/csharp.cts b/shared/submission-runner/csharp.cts index ff05ad5..17cced7 100644 --- a/shared/submission-runner/csharp.cts +++ b/shared/submission-runner/csharp.cts @@ -1,94 +1,90 @@ -import { spawn } from "child_process"; -import kill from "tree-kill"; -import type { IRunner, IRunnerReturn, RunResult } from "./types.cjs"; -import { timeoutSeconds } from "./settings.cjs"; +import { spawn } from 'child_process'; +import kill from 'tree-kill'; +import type { IRunner, IRunnerReturn, RunResult } from './types.cjs'; +import { timeoutSeconds } from './settings.cjs'; export const runCSharp: IRunner = async function (params: { - srcDir: string; - input: string; - outputCallback?: (data: string) => void; + srcDir: string; + input: string; + outputCallback?: (data: string) => void; }): Promise { - console.log(`- RUN: ${params.srcDir}`); - const child = spawn("dotnet run", { shell: true, cwd: params.srcDir }); + console.log(`- RUN: ${params.srcDir}`); + const child = spawn('dotnet run', { shell: true, cwd: params.srcDir }); - try { - let outputBuffer = ""; - child.stdout.setEncoding("utf8"); - child.stdout.on("data", (data) => { - outputBuffer += data.toString(); - params.outputCallback?.(data.toString()); - }); - child.stderr.setEncoding("utf8"); - child.stderr.on("data", (data) => { - outputBuffer += data.toString(); - params.outputCallback?.(data.toString()); - }); + try { + let outputBuffer = ''; + child.stdout.setEncoding('utf8'); + child.stdout.on('data', (data) => { + outputBuffer += data.toString(); + params.outputCallback?.(data.toString()); + }); + child.stderr.setEncoding('utf8'); + child.stderr.on('data', (data) => { + outputBuffer += data.toString(); + params.outputCallback?.(data.toString()); + }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); + const runStartTime = performance.now(); + child.stdin.write(params.input); + child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; + let timeLimitExceeded = false; + let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on("close", () => { - completedNormally = !timeLimitExceeded; + return { + success: true, + runResult: new Promise((resolve) => { + child.on('close', () => { + completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); + const runEndTime = performance.now(); + const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: "Completed", - output: outputBuffer, - exitCode: child.exitCode!, - runtimeMilliseconds, - }); - } else { - console.log( - `Process terminated, total sandbox time: ${runtimeMilliseconds}ms` - ); - resolve({ - kind: "TimeLimitExceeded", - output: outputBuffer, - resultKindReason: `Timeout after ${timeoutSeconds} seconds`, - }); - } - }); + if (completedNormally) { + clearTimeout(timeoutHandle); + resolve({ + kind: 'Completed', + output: outputBuffer, + exitCode: child.exitCode!, + runtimeMilliseconds + }); + } else { + console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); + resolve({ + kind: 'TimeLimitExceeded', + output: outputBuffer, + resultKindReason: `Timeout after ${timeoutSeconds} seconds` + }); + } + }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } + const timeoutHandle = setTimeout(() => { + if (completedNormally) { + return; + } - console.log( - `Run timed out after ${timeoutSeconds} seconds, killing process...` - ); - timeLimitExceeded = true; + console.log(`Run timed out after ${timeoutSeconds} seconds, killing process...`); + timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - if (child.pid !== undefined) { - kill(child.pid); - } - }, timeoutSeconds * 1000); - }), - killFunc() { - if (child.pid !== undefined) { - if (!completedNormally && !timeLimitExceeded) { - kill(child.pid); - params.outputCallback?.("\n[Manually stopped]"); - } - } - }, - }; - } catch (error) { - return { success: false, runResult: { kind: "RunError" } }; - } + child.stdin.end(); + child.stdin.destroy(); + child.stdout.destroy(); + child.stderr.destroy(); + if (child.pid !== undefined) { + kill(child.pid); + } + }, timeoutSeconds * 1000); + }), + killFunc() { + if (child.pid !== undefined) { + if (!completedNormally && !timeLimitExceeded) { + kill(child.pid); + params.outputCallback?.('\n[Manually stopped]'); + } + } + } + }; + } catch (error) { + return { success: false, runResult: { kind: 'RunError' } }; + } }; diff --git a/shared/submission-runner/dist/cpp.cjs b/shared/submission-runner/dist/cpp.cjs deleted file mode 100644 index 1935def..0000000 --- a/shared/submission-runner/dist/cpp.cjs +++ /dev/null @@ -1,157 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.runCpp = void 0; -const path_1 = require("path"); -const child_process_1 = require("child_process"); -const util = __importStar(require("util")); -const settings_cjs_1 = require("./settings.cjs"); -const kill = __importStar(require("kill")); -const os = __importStar(require("os")); -const fs = __importStar(require("fs-extra")); -const execPromise = util.promisify(child_process_1.exec); -const runCpp = function (params) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b; - const tmpDir = os.tmpdir(); - const buildDir = (0, path_1.join)(tmpDir, "bwcontest-cpp"); - if (fs.existsSync(buildDir)) { - fs.removeSync(buildDir); - } - fs.mkdirSync(buildDir); - console.log(`- BUILD: ${params.problemName}`); - const configureCommand = `cmake -S ${params.srcDir} -B ${buildDir}`; - try { - yield execPromise(configureCommand); - } - catch (e) { - const buildErrorText = (_a = e === null || e === void 0 ? void 0 : e.toString()) !== null && _a !== void 0 ? _a : "Unknown build errors."; - console.log("Build errors: " + buildErrorText); - return { - success: false, - runResult: { kind: "CompileFailed", resultKindReason: buildErrorText }, - }; - } - const compileCommand = `cmake --build ${buildDir} --target ${params.problemName}`; - try { - yield execPromise(compileCommand); - } - catch (e) { - const buildErrorText = (_b = e === null || e === void 0 ? void 0 : e.toString()) !== null && _b !== void 0 ? _b : "Unknown build errors."; - console.log("Build errors: " + buildErrorText); - return { - success: false, - runResult: { kind: "CompileFailed", resultKindReason: buildErrorText }, - }; - } - console.log(`- RUN: ${params.problemName}`); - let runCommand = ""; - if (params.cppPlatform === "VisualStudio") { - runCommand = `${(0, path_1.join)(buildDir, "Debug", `${params.problemName}.exe`)}`; - } - else { - runCommand = `${(0, path_1.join)(buildDir, params.problemName)}`; - } - try { - let outputBuffer = ""; - const child = (0, child_process_1.spawn)(runCommand, { shell: true }); - child.stdout.setEncoding("utf8"); - child.stdout.on("data", (data) => { - outputBuffer += data.toString(); - }); - child.stderr.setEncoding("utf8"); - child.stderr.on("data", (data) => { - outputBuffer += data.toString(); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on("close", () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: "Completed", - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds, - }); - } - else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: "TimeLimitExceeded", - output: outputBuffer, - resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds`, - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log(`Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...`); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - child.kill("SIGKILL"); - }, settings_cjs_1.timeoutSeconds * 1000); - }), - killFunc() { - var _a; - if (child.pid !== undefined) { - if (!completedNormally && !timeLimitExceeded) { - kill(child.pid); - (_a = params.outputCallback) === null || _a === void 0 ? void 0 : _a.call(params, "\n[Manually stopped]"); - } - } - }, - }; - } - catch (error) { - return { success: false, runResult: { kind: "RunError" } }; - } - }); -}; -exports.runCpp = runCpp; -//# sourceMappingURL=cpp.cjs.map \ No newline at end of file diff --git a/shared/submission-runner/dist/cpp.cjs.map b/shared/submission-runner/dist/cpp.cjs.map deleted file mode 100644 index b298605..0000000 --- a/shared/submission-runner/dist/cpp.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cpp.cjs","sourceRoot":"","sources":["../cpp.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B;AAC5B,iDAA4C;AAC5C,2CAA6B;AAO7B,iDAAgD;AAChD,2CAA6B;AAC7B,uCAAyB;AACzB,6CAA+B;AAE/B,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAYlC,MAAM,MAAM,GAA8B,UAC/C,MAAwB;;;QAExB,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAC/C,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC1B,CAAC;QACD,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAEvB,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAE9C,MAAM,gBAAgB,GAAG,YAAY,MAAM,CAAC,MAAM,OAAO,QAAQ,EAAE,CAAC;QACpE,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACtC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACvE,CAAC;QACJ,CAAC;QAED,MAAM,cAAc,GAAG,iBAAiB,QAAQ,aAAa,MAAM,CAAC,WAAW,EAAE,CAAC;QAClF,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,cAAc,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACvE,CAAC;QACJ,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAE5C,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,IAAI,MAAM,CAAC,WAAW,KAAK,cAAc,EAAE,CAAC;YAC1C,UAAU,GAAG,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,WAAW,MAAM,CAAC,EAAE,CAAC;QACzE,CAAC;aAAM,CAAC;YACN,UAAU,GAAG,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACvD,CAAC;QACD,IAAI,CAAC;YACH,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC/B,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBAC/B,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC5C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACrB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACtB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACN,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACpB,CAAC,CAAC;wBACL,CAAC;6BAAM,CAAC;4BACN,OAAO,CAAC,GAAG,CACT,2CAA2C,mBAAmB,IAAI,CACnE,CAAC;4BACF,OAAO,CAAC;gCACN,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC5D,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACpC,IAAI,iBAAiB,EAAE,CAAC;4BACtB,OAAO;wBACT,CAAC;wBAED,OAAO,CAAC,GAAG,CACT,uBAAuB,6BAAc,8BAA8B,CACpE,CAAC;wBACF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACxB,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC5B,CAAC,CAAC;gBACF,QAAQ;;oBACN,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC5B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC7C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBAClD,CAAC;oBACH,CAAC;gBACH,CAAC;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC7D,CAAC;IACH,CAAC;CAAA,CAAC;AAzHW,QAAA,MAAM,UAyHjB"} \ No newline at end of file diff --git a/shared/submission-runner/dist/cpp.d.cts b/shared/submission-runner/dist/cpp.d.cts deleted file mode 100644 index 9083eea..0000000 --- a/shared/submission-runner/dist/cpp.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import type { IRunner, IRunnerParams } from "./types.cjs"; -export type CppPlatform = "VisualStudio" | "GCC"; -interface IRunnerParamsCpp extends IRunnerParams { - srcDir: string; - problemName: string; - input: string; - cppPlatform: CppPlatform; - outputCallback?: (data: string) => void; -} -export declare const runCpp: IRunner; -export {}; -//# sourceMappingURL=cpp.d.cts.map \ No newline at end of file diff --git a/shared/submission-runner/dist/cpp.d.cts.map b/shared/submission-runner/dist/cpp.d.cts.map deleted file mode 100644 index fbeb823..0000000 --- a/shared/submission-runner/dist/cpp.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cpp.d.cts","sourceRoot":"","sources":["../cpp.cts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EAGd,MAAM,aAAa,CAAC;AAQrB,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,KAAK,CAAC;AAEjD,UAAU,gBAAiB,SAAQ,aAAa;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAyH5C,CAAC"} \ No newline at end of file diff --git a/shared/submission-runner/dist/csharp.cjs b/shared/submission-runner/dist/csharp.cjs deleted file mode 100644 index e2f0863..0000000 --- a/shared/submission-runner/dist/csharp.cjs +++ /dev/null @@ -1,119 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.runCSharp = void 0; -const child_process_1 = require("child_process"); -const kill = __importStar(require("tree-kill")); -const settings_cjs_1 = require("./settings.cjs"); -const runCSharp = function (params) { - return __awaiter(this, void 0, void 0, function* () { - console.log(`- RUN: ${params.srcDir}`); - const child = (0, child_process_1.spawn)("dotnet run", { shell: true, cwd: params.srcDir }); - try { - let outputBuffer = ""; - child.stdout.setEncoding("utf8"); - child.stdout.on("data", (data) => { - var _a; - outputBuffer += data.toString(); - (_a = params.outputCallback) === null || _a === void 0 ? void 0 : _a.call(params, data.toString()); - }); - child.stderr.setEncoding("utf8"); - child.stderr.on("data", (data) => { - var _a; - outputBuffer += data.toString(); - (_a = params.outputCallback) === null || _a === void 0 ? void 0 : _a.call(params, data.toString()); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on("close", () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: "Completed", - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds, - }); - } - else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: "TimeLimitExceeded", - output: outputBuffer, - resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds`, - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log(`Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...`); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - if (child.pid !== undefined) { - kill(child.pid); - } - }, settings_cjs_1.timeoutSeconds * 1000); - }), - killFunc() { - var _a; - if (child.pid !== undefined) { - if (!completedNormally && !timeLimitExceeded) { - kill(child.pid); - (_a = params.outputCallback) === null || _a === void 0 ? void 0 : _a.call(params, "\n[Manually stopped]"); - } - } - }, - }; - } - catch (error) { - return { success: false, runResult: { kind: "RunError" } }; - } - }); -}; -exports.runCSharp = runCSharp; -//# sourceMappingURL=csharp.cjs.map \ No newline at end of file diff --git a/shared/submission-runner/dist/csharp.cjs.map b/shared/submission-runner/dist/csharp.cjs.map deleted file mode 100644 index 51d2c85..0000000 --- a/shared/submission-runner/dist/csharp.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"csharp.cjs","sourceRoot":"","sources":["../csharp.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAsC;AACtC,gDAAkC;AAElC,iDAAgD;AAEzC,MAAM,SAAS,GAAY,UAAgB,MAIjD;;QACC,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAEvE,IAAI,CAAC;YACH,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAC/B,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAC/B,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC3C,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC5C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACrB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACtB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACN,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACpB,CAAC,CAAC;wBACL,CAAC;6BAAM,CAAC;4BACN,OAAO,CAAC,GAAG,CACT,2CAA2C,mBAAmB,IAAI,CACnE,CAAC;4BACF,OAAO,CAAC;gCACN,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC5D,CAAC,CAAC;wBACL,CAAC;oBACH,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACpC,IAAI,iBAAiB,EAAE,CAAC;4BACtB,OAAO;wBACT,CAAC;wBAED,OAAO,CAAC,GAAG,CACT,uBAAuB,6BAAc,8BAA8B,CACpE,CAAC;wBACF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;4BAC5B,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBAClB,CAAC;oBACH,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC5B,CAAC,CAAC;gBACF,QAAQ;;oBACN,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC5B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC7C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBAClD,CAAC;oBACH,CAAC;gBACH,CAAC;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC7D,CAAC;IACH,CAAC;CAAA,CAAC;AAxFW,QAAA,SAAS,aAwFpB"} \ No newline at end of file diff --git a/shared/submission-runner/dist/csharp.d.cts b/shared/submission-runner/dist/csharp.d.cts deleted file mode 100644 index e894b7b..0000000 --- a/shared/submission-runner/dist/csharp.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IRunner } from "./types.cjs"; -export declare const runCSharp: IRunner; -//# sourceMappingURL=csharp.d.cts.map \ No newline at end of file diff --git a/shared/submission-runner/dist/csharp.d.cts.map b/shared/submission-runner/dist/csharp.d.cts.map deleted file mode 100644 index cb17bac..0000000 --- a/shared/submission-runner/dist/csharp.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"csharp.d.cts","sourceRoot":"","sources":["../csharp.cts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAA4B,MAAM,aAAa,CAAC;AAGrE,eAAO,MAAM,SAAS,EAAE,OAwFvB,CAAC"} \ No newline at end of file diff --git a/shared/submission-runner/dist/java.cjs b/shared/submission-runner/dist/java.cjs deleted file mode 100644 index ed52545..0000000 --- a/shared/submission-runner/dist/java.cjs +++ /dev/null @@ -1,135 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.runJava = void 0; -const path_1 = require("path"); -const child_process_1 = require("child_process"); -const util = __importStar(require("util")); -const settings_cjs_1 = require("./settings.cjs"); -const kill = require("tree-kill"); -const execPromise = util.promisify(child_process_1.exec); -const runJava = function (params) { - return __awaiter(this, void 0, void 0, function* () { - var _a; - console.log(`- BUILD: ${params.mainFile}`); - const compileCommand = `javac -cp ${(0, path_1.join)(params.srcDir, 'src')} ${params.mainFile} -d ${(0, path_1.join)(params.srcDir, 'build')}`; - try { - yield execPromise(compileCommand); - } - catch (e) { - const buildErrorText = (_a = e === null || e === void 0 ? void 0 : e.toString()) !== null && _a !== void 0 ? _a : 'Unknown build errors.'; - console.log('Build errors: ' + buildErrorText); - return { - success: false, - runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } - }; - } - console.log(`- RUN: ${params.mainClass}`); - const runCommand = `java -cp "${(0, path_1.join)(params.srcDir, 'build')}" ${params.mainClass}`; - try { - let outputBuffer = ''; - const child = (0, child_process_1.spawn)(runCommand, { shell: true }); - child.stdout.setEncoding('utf8'); - child.stdout.on('data', (data) => { - var _a; - outputBuffer += data.toString(); - (_a = params.outputCallback) === null || _a === void 0 ? void 0 : _a.call(params, data.toString()); - }); - child.stderr.setEncoding('utf8'); - child.stderr.on('data', (data) => { - var _a; - outputBuffer += data.toString(); - (_a = params.outputCallback) === null || _a === void 0 ? void 0 : _a.call(params, data.toString()); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on('close', () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: 'Completed', - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds - }); - } - else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: 'TimeLimitExceeded', - output: outputBuffer, - resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds` - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log(`Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...`); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - child.kill('SIGKILL'); - }, settings_cjs_1.timeoutSeconds * 1000); - }), - killFunc() { - var _a; - if (child.pid !== undefined) { - if (!completedNormally && !timeLimitExceeded) { - kill(child.pid); - (_a = params.outputCallback) === null || _a === void 0 ? void 0 : _a.call(params, '\n[Manually stopped]'); - } - } - } - }; - } - catch (error) { - return { success: false, runResult: { kind: 'RunError' } }; - } - }); -}; -exports.runJava = runJava; -//# sourceMappingURL=java.cjs.map \ No newline at end of file diff --git a/shared/submission-runner/dist/java.cjs.map b/shared/submission-runner/dist/java.cjs.map deleted file mode 100644 index 4b43898..0000000 --- a/shared/submission-runner/dist/java.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"java.cjs","sourceRoot":"","sources":["../java.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B;AAC5B,iDAA4C;AAC5C,2CAA6B;AAE7B,iDAAgD;AAEhD,kCAAmC;AAEnC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAUlC,MAAM,OAAO,GAA+B,UAClD,MAAyB;;;QAEzB,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3C,MAAM,cAAc,GAAG,aAAa,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,OAAO,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QAEvH,IAAI,CAAC;YACJ,MAAM,WAAW,CAAC,cAAc,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACtE,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1C,MAAM,UAAU,GAAG,aAAa,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;QAEpF,IAAI,CAAC;YACJ,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC7C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACtB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACvB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACP,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACnB,CAAC,CAAC;wBACJ,CAAC;6BAAM,CAAC;4BACP,OAAO,CAAC,GAAG,CAAC,2CAA2C,mBAAmB,IAAI,CAAC,CAAC;4BAChF,OAAO,CAAC;gCACP,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC3D,CAAC,CAAC;wBACJ,CAAC;oBACF,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACrC,IAAI,iBAAiB,EAAE,CAAC;4BACvB,OAAO;wBACR,CAAC;wBAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,6BAAc,8BAA8B,CAAC,CAAC;wBACjF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACvB,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC3B,CAAC,CAAC;gBACF,QAAQ;;oBACP,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBACjD,CAAC;oBACF,CAAC;gBACF,CAAC;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,CAAC;IACF,CAAC;CAAA,CAAC;AA/FW,QAAA,OAAO,WA+FlB"} \ No newline at end of file diff --git a/shared/submission-runner/dist/java.d.cts.map b/shared/submission-runner/dist/java.d.cts.map deleted file mode 100644 index b87f707..0000000 --- a/shared/submission-runner/dist/java.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"java.d.cts","sourceRoot":"","sources":["../java.cts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAA4B,MAAM,aAAa,CAAC;AAOpF,UAAU,iBAAkB,SAAQ,aAAa;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,iBAAiB,CA+F9C,CAAC"} \ No newline at end of file diff --git a/shared/submission-runner/dist/settings.cjs b/shared/submission-runner/dist/settings.cjs deleted file mode 100644 index ba0f793..0000000 --- a/shared/submission-runner/dist/settings.cjs +++ /dev/null @@ -1,5 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.timeoutSeconds = void 0; -exports.timeoutSeconds = 30; -//# sourceMappingURL=settings.cjs.map \ No newline at end of file diff --git a/shared/submission-runner/dist/settings.cjs.map b/shared/submission-runner/dist/settings.cjs.map deleted file mode 100644 index b910414..0000000 --- a/shared/submission-runner/dist/settings.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.cjs","sourceRoot":"","sources":["../settings.cts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/shared/submission-runner/dist/settings.d.cts.map b/shared/submission-runner/dist/settings.d.cts.map deleted file mode 100644 index f0b6f7e..0000000 --- a/shared/submission-runner/dist/settings.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.d.cts","sourceRoot":"","sources":["../settings.cts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,KAAK,CAAC"} \ No newline at end of file diff --git a/shared/submission-runner/dist/tsconfig.tsbuildinfo b/shared/submission-runner/dist/tsconfig.tsbuildinfo deleted file mode 100644 index 63b5cb1..0000000 --- a/shared/submission-runner/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2016.full.d.ts","../node_modules/zod/lib/helpers/typealiases.d.ts","../node_modules/zod/lib/helpers/util.d.ts","../node_modules/zod/lib/zoderror.d.ts","../node_modules/zod/lib/locales/en.d.ts","../node_modules/zod/lib/errors.d.ts","../node_modules/zod/lib/helpers/parseutil.d.ts","../node_modules/zod/lib/helpers/enumutil.d.ts","../node_modules/zod/lib/helpers/errorutil.d.ts","../node_modules/zod/lib/helpers/partialutil.d.ts","../node_modules/zod/lib/types.d.ts","../node_modules/zod/lib/external.d.ts","../node_modules/zod/lib/index.d.ts","../node_modules/zod/index.d.ts","../types.cts","../settings.cts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/jsonfile/index.d.ts","../node_modules/@types/jsonfile/utils.d.ts","../node_modules/@types/fs-extra/index.d.ts","../cpp.cts","../node_modules/tree-kill/index.d.ts","../csharp.cts","../java.cts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"807e0e0bdc67605dd28efe18f20ab5fcd75d944ef95936120702335f9379094b","5487b97cfa28b26b4a9ef0770f872bdbebd4c46124858de00f242c3eed7519f4","7a01f546ace66019156e4232a1bee2fabc2f8eabeb052473d926ee1693956265","fb53b1c6a6c799b7e3cc2de3fb5c9a1c04a1c60d4380a37792d84c5f8b33933b","8485b6da53ec35637d072e516631d25dae53984500de70a6989058f24354666f","ebe80346928736532e4a822154eb77f57ef3389dbe2b3ba4e571366a15448ef2","c2cb3c8ff388781258ea9ddbcd8a947f751bddd6886e1d3b3ea09ddaa895df80","f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","98a9cc18f661d28e6bd31c436e1984f3980f35e0f0aa9cf795c54f8ccb667ffe","c76b0c5727302341d0bdfa2cc2cee4b19ff185b554edb6e8543f0661d8487116","2a317fff5810a628d205a507998a77521120b462b03d36babf6eb387da991bee","f5ef066942e4f0bd98200aa6a6694b831e73200c9b3ade77ad0aa2409e8fe1b1","b9e99cd94f4166a245f5158f7286c05406e2a4c694619bceb7a4f3519d1d768e","5568d7c32e5cf5f35e092649f4e5e168c3114c800b1d7545b7ae5e0415704802",{"version":"0e8210e953575253adcbd281ad25394dc839e28b6b6b204bdb92c2563a87f90b","signature":"66b8c0ccdd3c78425a0a3404062832b5de907d5d49a4a5972198da37ac7da261"},{"version":"a0faf348065305506294a0fb4f77668138a648ee7ea99824776a481c18ca2e8b","signature":"acb8dd08d6b5134cd84c0ac9d62b5cf23ae691fe1cfb8565be2ebe16eca3c03e"},"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"7fd7fcbf021a5845bdd9397d4649fcf2fe17152d2098140fc723099a215d19ad","affectsGlobalScope":true},"df3389f71a71a38bc931aaf1ef97a65fada98f0a27f19dd12f8b8de2b0f4e461","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"a1d2988ad9d2aef7b9915a22b5e52c165c83a878f2851c35621409046bbe3c05","affectsGlobalScope":true},"bd3f5d05b6b5e4bfcea7739a45f3ffb4a7f4a3442ba7baf93e0200799285b8f1","4c775c2fccabf49483c03cd5e3673f87c1ffb6079d98e7b81089c3def79e29c6","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"674168aa3db414ea0a19b2a31d901b2d49705c7a495e43ffdc96928543010f8c","affectsGlobalScope":true},"fe1fd6afdfe77976d4c702f3746c05fb05a7e566845c890e0e970fe9376d6a90","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","afb1701fd4be413a8a5a88df6befdd4510c30a31372c07a4138facf61594c66d","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"c07146dbbbd8b347241b5df250a51e48f2d7bef19b1e187b1a3f20c849988ff1","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"ae5507fc333d637dec9f37c6b3f4d423105421ea2820a64818de55db85214d66","affectsGlobalScope":true},{"version":"0666f4c99b8688c7be5956df8fecf5d1779d3b22f8f2a88258ae7072c7b6026f","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","54e854615c4eafbdd3fd7688bd02a3aafd0ccf0e87c98f79d3e9109f047ce6b8","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","8221b00f271cf7f535a8eeec03b0f80f0929c7a16116e2d2df089b41066de69b","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","7424817d5eb498771e6d1808d726ec38f75d2eaf3fa359edd5c0c540c52725c1","9a9634296cca836c3308923ba7aa094fa6ed76bb1e366d8ddcf5c65888ab1024",{"version":"bddce945d552a963c9733db106b17a25474eefcab7fc990157a2134ef55d4954","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","4b55240c2a03b2c71e98a7fc528b16136faa762211c92e781a01c37821915ea6","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"94c086dff8dbc5998749326bc69b520e8e4273fb5b7b58b50e0210e0885dfcde","affectsGlobalScope":true},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true},"ebe5facd12fd7745cda5f4bc3319f91fb29dc1f96e57e9c6f8b260a7cc5b67ee","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","37dc027f781c75f0f546e329cfac7cf92a6b289f42458f47a9adc25e516b6839",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","211440ce81e87b3491cdf07155881344b0a61566df6e749acff0be7e8b9d1a07","5d9a0b6e6be8dbb259f64037bce02f34692e8c1519f5cd5d467d7fa4490dced4","880da0e0f3ebca42f9bd1bc2d3e5e7df33f2619d85f18ee0ed4bd16d1800bc32",{"version":"60caceee9512baf05b4581ff527edae01315de7e118fd0cfd063630e5719217e","signature":"2f6007676f1b10310713ddde0d24f1ecd97310fb5ff0e103a7454394a6eb19f8"},"8323e3f5b91261ed250bd7c6b7aba2aa10f8e1c2ef348297c1f7752a403abebd",{"version":"c80b9cd15821480e77c56f488c971ad71128e70d68300f5ccbcecfc5d78831be","signature":"07fe03fc9da559b7d1f1f1dd575bdc399aec87f8aa72b06d313cfb3329530909"},{"version":"4499adcc0f309c7c9cbe74f8b7025a1c6e892da4953f48027f370d3a1b29627e","signature":"28e13d30e85e06577560d06dcbdb08bcc5758eb3d649592ddef0b9fe1f199135"}],"root":[64,65,155,157,158],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./","sourceMap":true,"strict":true,"target":3},"fileIdsList":[[64,65,103,123,124,144,154],[64,65,103,156],[64,65,103,124,144,156],[115,151,152,153],[115,143,151],[66],[101],[102,107,135],[103,114,115,122,132,143],[103,104,114,122],[105,144],[106,107,115,123],[107,132,140],[108,110,114,122],[101,109],[110,111],[114],[112,114],[101,114],[114,115,116,132,143],[114,115,116,129,132,135],[99,102,148],[110,114,117,122,132,143],[114,115,117,118,122,132,140,143],[117,119,132,140,143],[66,67,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150],[114,120],[121,143,148],[110,114,122,132],[123],[124],[101,125],[126,142,148],[127],[128],[114,129,130],[129,131,144,146],[102,114,132,133,134,135],[102,132,134],[132,133],[135],[136],[101,132],[114,138,139],[138,139],[107,122,132,140],[141],[122,142],[102,117,128,143],[107,144],[132,145],[121,146],[147],[102,107,114,116,125,132,143,146,148],[132,149],[76,80,143],[76,132,143],[71],[73,76,140,143],[122,140],[151],[71,151],[73,76,122,143],[68,69,72,75,102,114,132,143],[68,74],[72,76,102,135,143,151],[102,151],[92,102,151],[70,71,151],[76],[70,71,72,73,74,75,76,77,78,80,81,82,83,84,85,86,87,88,89,90,91,93,94,95,96,97,98],[76,83,84],[74,76,84,85],[75],[68,71,76],[76,80,84,85],[80],[74,76,79,143],[68,73,74,76,80,83],[102,132],[71,76,92,102,148,151],[62],[53,54],[51,52,53,55,56,60],[52,53],[61],[53],[51,52,53,56,57,58,59],[51,52,62],[63],[64]],"referencedMap":[[155,1],[157,2],[158,3],[154,4],[152,5],[66,6],[67,6],[101,7],[102,8],[103,9],[104,10],[105,11],[106,12],[107,13],[108,14],[109,15],[110,16],[111,16],[113,17],[112,18],[114,19],[115,20],[116,21],[100,22],[117,23],[118,24],[119,25],[151,26],[120,27],[121,28],[122,29],[123,30],[124,31],[125,32],[126,33],[127,34],[128,35],[129,36],[130,36],[131,37],[132,38],[134,39],[133,40],[135,41],[136,42],[137,43],[138,44],[139,45],[140,46],[141,47],[142,48],[143,49],[144,50],[145,51],[146,52],[147,53],[148,54],[149,55],[83,56],[90,57],[82,56],[97,58],[74,59],[73,60],[96,61],[91,62],[94,63],[76,64],[75,65],[71,66],[70,67],[93,68],[72,69],[77,70],[81,70],[99,71],[98,70],[85,72],[86,73],[88,74],[84,75],[87,76],[92,61],[79,77],[80,78],[89,79],[69,80],[95,81],[63,82],[55,83],[61,84],[56,85],[59,82],[62,86],[54,87],[60,88],[53,89],[64,90]],"exportedModulesMap":[[155,91],[157,91],[158,91],[154,4],[152,5],[66,6],[67,6],[101,7],[102,8],[103,9],[104,10],[105,11],[106,12],[107,13],[108,14],[109,15],[110,16],[111,16],[113,17],[112,18],[114,19],[115,20],[116,21],[100,22],[117,23],[118,24],[119,25],[151,26],[120,27],[121,28],[122,29],[123,30],[124,31],[125,32],[126,33],[127,34],[128,35],[129,36],[130,36],[131,37],[132,38],[134,39],[133,40],[135,41],[136,42],[137,43],[138,44],[139,45],[140,46],[141,47],[142,48],[143,49],[144,50],[145,51],[146,52],[147,53],[148,54],[149,55],[83,56],[90,57],[82,56],[97,58],[74,59],[73,60],[96,61],[91,62],[94,63],[76,64],[75,65],[71,66],[70,67],[93,68],[72,69],[77,70],[81,70],[99,71],[98,70],[85,72],[86,73],[88,74],[84,75],[87,76],[92,61],[79,77],[80,78],[89,79],[69,80],[95,81],[63,82],[55,83],[61,84],[56,85],[59,82],[62,86],[54,87],[60,88],[53,89],[64,90]],"semanticDiagnosticsPerFile":[[155,[{"file":"../cpp.cts","start":269,"length":6,"messageText":"Cannot find module 'kill' or its corresponding type declarations.","category":1,"code":2307}]],[157,[{"file":"../csharp.cts","start":2403,"length":4,"code":2349,"category":1,"messageText":{"messageText":"This expression is not callable.","category":1,"code":2349,"next":[{"messageText":"Type '{ default: { (pid: number, callback?: ((error?: Error | undefined) => void) | undefined): void; (pid: number, signal?: string | number | undefined, callback?: ((error?: Error | undefined) => void) | undefined): void; }; }' has no call signatures.","category":1,"code":2757}]},"relatedInformation":[{"file":"../csharp.cts","start":39,"length":34,"messageText":"Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.","category":3,"code":7038}]},{"file":"../csharp.cts","start":2605,"length":4,"code":2349,"category":1,"messageText":{"messageText":"This expression is not callable.","category":1,"code":2349,"next":[{"messageText":"Type '{ default: { (pid: number, callback?: ((error?: Error | undefined) => void) | undefined): void; (pid: number, signal?: string | number | undefined, callback?: ((error?: Error | undefined) => void) | undefined): void; }; }' has no call signatures.","category":1,"code":2757}]},"relatedInformation":[{"file":"../csharp.cts","start":39,"length":34,"messageText":"Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.","category":3,"code":7038}]}]],158,154,152,153,66,67,101,102,103,104,105,106,107,108,109,110,111,113,112,114,115,116,100,150,117,118,119,151,120,121,122,123,124,125,126,127,128,129,130,131,132,134,133,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,156,48,49,8,9,13,12,2,14,15,16,17,18,19,20,21,3,50,22,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,1,47,11,10,83,90,82,97,74,73,96,91,94,76,75,71,70,93,72,77,78,81,68,99,98,85,86,88,84,87,92,79,80,89,69,95,63,55,61,57,58,56,59,51,52,62,54,60,53,65,64],"latestChangedDtsFile":"./java.d.cts"},"version":"5.4.2"} \ No newline at end of file diff --git a/shared/submission-runner/dist/types.cjs b/shared/submission-runner/dist/types.cjs deleted file mode 100644 index 6328ef9..0000000 --- a/shared/submission-runner/dist/types.cjs +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.RunResultZod = void 0; -const zod_1 = require("zod"); -const RunResultKind = zod_1.z.enum([ - 'CompileFailed', - 'TimeLimitExceeded', - 'Completed', - 'SandboxError', - 'RunError' -]); -exports.RunResultZod = zod_1.z - .object({ - kind: RunResultKind, - output: zod_1.z.string().optional(), - exitCode: zod_1.z.number().optional(), - runtimeMilliseconds: zod_1.z.number().optional(), - resultKindReason: zod_1.z.string().optional() -}) - .strict(); -//# sourceMappingURL=types.cjs.map \ No newline at end of file diff --git a/shared/submission-runner/dist/types.cjs.map b/shared/submission-runner/dist/types.cjs.map deleted file mode 100644 index ce0c025..0000000 --- a/shared/submission-runner/dist/types.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../types.cts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,aAAa,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5B,eAAe;IACf,mBAAmB;IACnB,WAAW;IACX,cAAc;IACd,UAAU;CACV,CAAC,CAAC;AAIU,QAAA,YAAY,GAAG,OAAC;KAC3B,MAAM,CAAC;IACP,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC;KACD,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/shared/submission-runner/dist/types.d.cts b/shared/submission-runner/dist/types.d.cts deleted file mode 100644 index fc8d6af..0000000 --- a/shared/submission-runner/dist/types.d.cts +++ /dev/null @@ -1,39 +0,0 @@ -import { z } from 'zod'; -declare const RunResultKind: z.ZodEnum<["CompileFailed", "TimeLimitExceeded", "Completed", "SandboxError", "RunError"]>; -export type RunResultKind = z.infer; -export declare const RunResultZod: z.ZodObject<{ - kind: z.ZodEnum<["CompileFailed", "TimeLimitExceeded", "Completed", "SandboxError", "RunError"]>; - output: z.ZodOptional; - exitCode: z.ZodOptional; - runtimeMilliseconds: z.ZodOptional; - resultKindReason: z.ZodOptional; -}, "strict", z.ZodTypeAny, { - kind: "CompileFailed" | "TimeLimitExceeded" | "Completed" | "SandboxError" | "RunError"; - output?: string | undefined; - exitCode?: number | undefined; - runtimeMilliseconds?: number | undefined; - resultKindReason?: string | undefined; -}, { - kind: "CompileFailed" | "TimeLimitExceeded" | "Completed" | "SandboxError" | "RunError"; - output?: string | undefined; - exitCode?: number | undefined; - runtimeMilliseconds?: number | undefined; - resultKindReason?: string | undefined; -}>; -export type RunResult = z.infer; -export interface IRunnerParams { - srcDir: string; - input: string; - outputCallback?: (data: string) => void; -} -export type IRunnerReturn = { - success: true; - killFunc: () => void; - runResult: Promise; -} | { - success: false; - runResult: RunResult; -}; -export type IRunner = (params: T) => Promise; -export {}; -//# sourceMappingURL=types.d.cts.map \ No newline at end of file diff --git a/shared/submission-runner/dist/types.d.cts.map b/shared/submission-runner/dist/types.d.cts.map deleted file mode 100644 index de98fb7..0000000 --- a/shared/submission-runner/dist/types.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../types.cts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,aAAa,4FAMjB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;EAQf,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAErD,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,MAAM,aAAa,GACxB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAAE,GACtE;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AAE1C,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAC1D,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/shared/submission-runner/package-lock.json b/shared/submission-runner/package-lock.json deleted file mode 100644 index 3958d68..0000000 --- a/shared/submission-runner/package-lock.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "name": "submissionRunner", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "dependencies": { - "fs-extra": "^11.2.0", - "tree-kill": "^1.2.2", - "typescript": "^5.4.2", - "zod": "^3.22.4" - }, - "devDependencies": { - "@types/fs-extra": "^11.0.4", - "@types/node": "20.x" - } - }, - "node_modules/@types/fs-extra": { - "version": "11.0.4", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-11.0.4.tgz", - "integrity": "sha512-yTbItCNreRooED33qjunPthRcSjERP1r4MqCZc7wv0u2sUkzTFp45tgUfS5+r7FrZPdmCCNflLhVSP/o+SemsQ==", - "dev": true, - "dependencies": { - "@types/jsonfile": "*", - "@types/node": "*" - } - }, - "node_modules/@types/jsonfile": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/@types/jsonfile/-/jsonfile-6.1.4.tgz", - "integrity": "sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==", - "dev": true, - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", - "dev": true, - "dependencies": { - "undici-types": "~5.26.4" - } - }, - "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/tree-kill": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", - "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", - "bin": { - "tree-kill": "cli.js" - } - }, - "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true - }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/zod": { - "version": "3.22.4", - "resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz", - "integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==", - "funding": { - "url": "https://github.com/sponsors/colinhacks" - } - } - } -} diff --git a/shared/submission-runner/package.json b/shared/submission-runner/package.json deleted file mode 100644 index 36dab5d..0000000 --- a/shared/submission-runner/package.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "submission-runner", - "scripts": { - "build": "tsc" - }, - "devDependencies": { - "@types/node": "20.x", - "@types/fs-extra": "^11.0.4", - "zod": "^3.22.4", - "tree-kill": "^1.2.2", - "fs-extra": "^11.2.0" - } -} diff --git a/shared/submission-runner/settings.cts b/shared/submission-runner/settings.cts index 394d79e..2922168 100644 --- a/shared/submission-runner/settings.cts +++ b/shared/submission-runner/settings.cts @@ -1 +1 @@ -export const timeoutSeconds = 30; \ No newline at end of file +export const timeoutSeconds = 30; diff --git a/shared/submission-runner/tsconfig.json b/shared/submission-runner/tsconfig.json deleted file mode 100644 index d927d5c..0000000 --- a/shared/submission-runner/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "target": "es2016", - "module": "commonjs", - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "outDir": "./dist", - "esModuleInterop": true, - "strict": true, - }, - "include": ["*.cts"] -} \ No newline at end of file diff --git a/shared/submission-runner/types.cts b/shared/submission-runner/types.cts index c8ec4b5..33cdd64 100644 --- a/shared/submission-runner/types.cts +++ b/shared/submission-runner/types.cts @@ -29,8 +29,9 @@ export interface IRunnerParams { } export type IRunnerReturn = - { success: true; killFunc: () => void; runResult: Promise } | - { success: false; runResult: RunResult }; + | { success: true; killFunc: () => void; runResult: Promise } + | { success: false; runResult: RunResult }; -export type IRunner = - (params: T) => Promise; \ No newline at end of file +export type IRunner = ( + params: T +) => Promise; diff --git a/shared/tsconfig.json b/shared/tsconfig.json new file mode 100644 index 0000000..e93972e --- /dev/null +++ b/shared/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "composite": true, + "target": "es2016", + "module": "commonjs", + "declaration": true, + "declarationMap": true, + "sourceMap": true, + "outDir": "./dist", + "esModuleInterop": true, + "strict": true + }, + "include": ["**/*.cts", "**/*.ts"] +} diff --git a/shared/contest-monitor-types/contestMonitorTypes.d.ts b/shared/types/contestMonitorTypes.d.ts similarity index 100% rename from shared/contest-monitor-types/contestMonitorTypes.d.ts rename to shared/types/contestMonitorTypes.d.ts diff --git a/web/.prettierignore b/web/.prettierignore index 3897265..6db60aa 100644 --- a/web/.prettierignore +++ b/web/.prettierignore @@ -6,6 +6,7 @@ node_modules .env .env.* !.env.example +/db # Ignore files for PNPM, NPM and YARN pnpm-lock.yaml diff --git a/web/.vscode/settings.json b/web/.vscode/settings.json new file mode 100644 index 0000000..bcdbaee --- /dev/null +++ b/web/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cSpell.words": ["bwcontest"] +} diff --git a/web/package-lock.json b/web/package-lock.json index 896fd3f..ec25e20 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -14,7 +14,7 @@ "bcrypt": "^5.1.1", "bootstrap": "^5.3.3", "bootstrap-icons": "^1.11.3", - "contest-monitor-types": "file:../shared/contest-monitor-types", + "bwcontest-shared": "file:../shared", "diff": "^5.2.0", "diff2html": "^3.4.47", "eslint-plugin-svelte": "^2.35.1", @@ -50,7 +50,23 @@ "vite": "^5.1.6" } }, - "../shared/contest-monitor-types": {}, + "../shared": { + "devDependencies": { + "@types/fs-extra": "^11.0.4", + "@types/node": "20.x", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "eslint": "^8.57.0", + "fs-extra": "^11.2.0", + "prettier": "^3.2.5", + "tree-kill": "^1.2.2", + "typescript": "^5.4.2", + "zod": "^3.22.4" + } + }, + "../shared/contest-monitor-types": { + "extraneous": true + }, "node_modules/@aashutoshrathi/word-wrap": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", @@ -1596,6 +1612,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bwcontest-shared": { + "resolved": "../shared", + "link": true + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -1730,10 +1750,6 @@ "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" }, - "node_modules/contest-monitor-types": { - "resolved": "../shared/contest-monitor-types", - "link": true - }, "node_modules/cookie": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", diff --git a/web/package.json b/web/package.json index a5c8359..91282fd 100644 --- a/web/package.json +++ b/web/package.json @@ -41,7 +41,7 @@ "bcrypt": "^5.1.1", "bootstrap": "^5.3.3", "bootstrap-icons": "^1.11.3", - "contest-monitor-types": "file:../shared/contest-monitor-types", + "bwcontest-shared": "file:../shared", "diff": "^5.2.0", "diff2html": "^3.4.47", "eslint-plugin-svelte": "^2.35.1", diff --git a/web/src/lib/contestMonitor/contestMonitorUtils.ts b/web/src/lib/contestMonitor/contestMonitorUtils.ts index 4984a8e..72ea31b 100644 --- a/web/src/lib/contestMonitor/contestMonitorUtils.ts +++ b/web/src/lib/contestMonitor/contestMonitorUtils.ts @@ -1,5 +1,5 @@ import type { SubmissionState } from '@prisma/client'; -import type { SubmissionStateForExtension } from 'contest-monitor-types/contestMonitorTypes'; +import type { SubmissionStateForExtension } from 'bwcontest-shared/types/contestMonitorTypes'; export function convertSubmissionStateForExtension( state: SubmissionState diff --git a/web/src/routes/api/team/[session]/contestState/+server.ts b/web/src/routes/api/team/[session]/contestState/+server.ts index 6219b7a..ba5ea6f 100644 --- a/web/src/routes/api/team/[session]/contestState/+server.ts +++ b/web/src/routes/api/team/[session]/contestState/+server.ts @@ -5,7 +5,7 @@ import type { ContestStateForExtension, FullStateForExtension, SubmissionForExtension -} from 'contest-monitor-types/contestMonitorTypes'; +} from 'bwcontest-shared/types/contestMonitorTypes'; import { convertSubmissionStateForExtension } from '$lib/contestMonitor/contestMonitorUtils'; export const GET = (async ({ params }) => { diff --git a/web/src/routes/api/team/[session]/submit/+server.ts b/web/src/routes/api/team/[session]/submit/+server.ts index 8ef9269..17619bb 100644 --- a/web/src/routes/api/team/[session]/submit/+server.ts +++ b/web/src/routes/api/team/[session]/submit/+server.ts @@ -3,7 +3,7 @@ import { error, json } from '@sveltejs/kit'; import type { RequestHandler } from './$types'; import { z } from 'zod'; import { SubmissionState } from '@prisma/client'; -import type { SubmissionForExtension } from 'contest-monitor-types/contestMonitorTypes'; +import type { SubmissionForExtension } from 'bwcontest-shared/types/contestMonitorTypes'; import { convertSubmissionStateForExtension } from '$lib/contestMonitor/contestMonitorUtils'; const submitPostData = z.object({ From 8f56a6aa4c72fe72de6c376198192173ce131fb9 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:11:59 -0400 Subject: [PATCH 02/14] [Shared][Extension] Update shared --- extension/bwcontest/package-lock.json | 36 +- extension/bwcontest/package.json | 3 +- extension/bwcontest/src/SidebarProvider.ts | 2 +- .../contestMonitor/contestStateSyncManager.ts | 2 +- extension/bwcontest/src/problemPanel.ts | 6 +- extension/bwcontest/src/submit.ts | 2 +- shared/.gitignore | 1 + shared/dist/cpp.js | 2462 +++++++++++ shared/dist/csharp.js | 227 + shared/dist/java.js | 241 ++ shared/dist/settings.js | 30 + shared/dist/submission-runner/cpp.cjs | 207 - shared/dist/submission-runner/cpp.cjs.map | 1 - shared/dist/submission-runner/cpp.d.cts | 12 - shared/dist/submission-runner/cpp.d.cts.map | 1 - shared/dist/submission-runner/csharp.cjs | 129 - shared/dist/submission-runner/csharp.cjs.map | 1 - shared/dist/submission-runner/csharp.d.cts | 3 - .../dist/submission-runner/csharp.d.cts.map | 1 - shared/dist/submission-runner/java.cjs | 183 - shared/dist/submission-runner/java.cjs.map | 1 - shared/dist/submission-runner/java.d.cts | 11 - shared/dist/submission-runner/java.d.cts.map | 1 - shared/dist/submission-runner/settings.cjs | 5 - .../dist/submission-runner/settings.cjs.map | 1 - shared/dist/submission-runner/settings.d.cts | 2 - .../dist/submission-runner/settings.d.cts.map | 1 - shared/dist/submission-runner/types.cjs | 21 - shared/dist/submission-runner/types.cjs.map | 1 - shared/dist/submission-runner/types.d.cts | 53 - shared/dist/submission-runner/types.d.cts.map | 1 - shared/dist/tsconfig.tsbuildinfo | 2 +- shared/dist/types.js | 3778 +++++++++++++++++ shared/package-lock.json | 407 ++ shared/package.json | 3 +- 35 files changed, 7181 insertions(+), 657 deletions(-) create mode 100644 shared/dist/cpp.js create mode 100644 shared/dist/csharp.js create mode 100644 shared/dist/java.js create mode 100644 shared/dist/settings.js delete mode 100644 shared/dist/submission-runner/cpp.cjs delete mode 100644 shared/dist/submission-runner/cpp.cjs.map delete mode 100644 shared/dist/submission-runner/cpp.d.cts delete mode 100644 shared/dist/submission-runner/cpp.d.cts.map delete mode 100644 shared/dist/submission-runner/csharp.cjs delete mode 100644 shared/dist/submission-runner/csharp.cjs.map delete mode 100644 shared/dist/submission-runner/csharp.d.cts delete mode 100644 shared/dist/submission-runner/csharp.d.cts.map delete mode 100644 shared/dist/submission-runner/java.cjs delete mode 100644 shared/dist/submission-runner/java.cjs.map delete mode 100644 shared/dist/submission-runner/java.d.cts delete mode 100644 shared/dist/submission-runner/java.d.cts.map delete mode 100644 shared/dist/submission-runner/settings.cjs delete mode 100644 shared/dist/submission-runner/settings.cjs.map delete mode 100644 shared/dist/submission-runner/settings.d.cts delete mode 100644 shared/dist/submission-runner/settings.d.cts.map delete mode 100644 shared/dist/submission-runner/types.cjs delete mode 100644 shared/dist/submission-runner/types.cjs.map delete mode 100644 shared/dist/submission-runner/types.d.cts delete mode 100644 shared/dist/submission-runner/types.d.cts.map create mode 100644 shared/dist/types.js diff --git a/extension/bwcontest/package-lock.json b/extension/bwcontest/package-lock.json index 1a3eba8..4e0485a 100644 --- a/extension/bwcontest/package-lock.json +++ b/extension/bwcontest/package-lock.json @@ -10,10 +10,9 @@ "dependencies": { "@vscode/vsce": "^2.22.0", "axios": "^1.6.5", - "contest-monitor-types": "file:../../shared/contest-monitor-types", + "bwcontest-shared": "file:../../shared", "fs-extra": "^11.2.0", "isomorphic-git": "^1.25.3", - "submission-runner": "file:../../shared/submission-runner", "tree-kill": "^1.2.2", "url-join": "^5.0.0", "zod": "^3.22.4" @@ -54,8 +53,27 @@ "vscode": "^1.85.0" } }, - "../../shared/contest-monitor-types": {}, + "../../shared": { + "name": "bwcontest-shared", + "devDependencies": { + "@types/fs-extra": "^11.0.4", + "@types/node": "20.x", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "esbuild": "^0.20.1", + "eslint": "^8.57.0", + "fs-extra": "^11.2.0", + "prettier": "^3.2.5", + "tree-kill": "^1.2.2", + "typescript": "^5.4.2", + "zod": "^3.22.4" + } + }, + "../../shared/contest-monitor-types": { + "extraneous": true + }, "../../shared/submission-runner": { + "extraneous": true, "dependencies": { "fs-extra": "^11.2.0", "tree-kill": "^1.2.2", @@ -1744,6 +1762,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bwcontest-shared": { + "resolved": "../../shared", + "link": true + }, "node_modules/call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -2205,10 +2227,6 @@ "node": ">=12" } }, - "node_modules/contest-monitor-types": { - "resolved": "../../shared/contest-monitor-types", - "link": true - }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -6128,10 +6146,6 @@ "postcss": "^8.2.15" } }, - "node_modules/submission-runner": { - "resolved": "../../shared/submission-runner", - "link": true - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", diff --git a/extension/bwcontest/package.json b/extension/bwcontest/package.json index aa36af7..cf49131 100644 --- a/extension/bwcontest/package.json +++ b/extension/bwcontest/package.json @@ -116,10 +116,9 @@ "dependencies": { "@vscode/vsce": "^2.22.0", "axios": "^1.6.5", - "contest-monitor-types": "file:../../shared/contest-monitor-types", + "bwcontest-shared": "file:../../shared", "fs-extra": "^11.2.0", "isomorphic-git": "^1.25.3", - "submission-runner": "file:../../shared/submission-runner", "tree-kill": "^1.2.2", "url-join": "^5.0.0", "zod": "^3.22.4" diff --git a/extension/bwcontest/src/SidebarProvider.ts b/extension/bwcontest/src/SidebarProvider.ts index 1ef18bb..3ae72db 100644 --- a/extension/bwcontest/src/SidebarProvider.ts +++ b/extension/bwcontest/src/SidebarProvider.ts @@ -9,7 +9,7 @@ import type { ProblemNameForExtension, SubmissionForExtension, SubmissionStateForExtension -} from 'contest-monitor-types/contestMonitorTypes'; +} from 'bwcontest-shared/types/contestMonitorTypes'; import { TeamData } from './sharedTypes'; import { ContestTeamState, diff --git a/extension/bwcontest/src/contestMonitor/contestStateSyncManager.ts b/extension/bwcontest/src/contestMonitor/contestStateSyncManager.ts index 75df388..7cc16be 100644 --- a/extension/bwcontest/src/contestMonitor/contestStateSyncManager.ts +++ b/extension/bwcontest/src/contestMonitor/contestStateSyncManager.ts @@ -7,7 +7,7 @@ import type { ProblemNameForExtension, FullStateForExtension, SubmissionForExtension -} from 'contest-monitor-types/contestMonitorTypes'; +} from 'bwcontest-shared/types/contestMonitorTypes'; import { LiteEvent } from '../utilities/LiteEvent'; export type ContestTeamState = { diff --git a/extension/bwcontest/src/problemPanel.ts b/extension/bwcontest/src/problemPanel.ts index 132f9bd..1e2fe00 100644 --- a/extension/bwcontest/src/problemPanel.ts +++ b/extension/bwcontest/src/problemPanel.ts @@ -2,11 +2,11 @@ import * as vscode from 'vscode'; import { getNonce } from './getNonce'; import urlJoin from 'url-join'; import { extensionSettings } from './extension'; -import { runJava } from 'submission-runner/java.cjs'; +import { runJava } from 'bwcontest-shared/submission-runner/java.cjs'; import { join } from 'path'; import { submitProblem } from './submit'; -import { runCSharp } from 'submission-runner/csharp.cjs'; -import { runCpp } from 'submission-runner/cpp.cjs'; +import { runCSharp } from 'bwcontest-shared/submission-runner/csharp.cjs'; +import { runCpp } from 'bwcontest-shared/submission-runner/cpp.cjs'; import { TeamData } from './sharedTypes'; import outputPanelLog from './outputPanelLog'; import { recordInitialSubmission } from './contestMonitor/contestStateSyncManager'; diff --git a/extension/bwcontest/src/submit.ts b/extension/bwcontest/src/submit.ts index 90e76f1..4601bcc 100644 --- a/extension/bwcontest/src/submit.ts +++ b/extension/bwcontest/src/submit.ts @@ -5,7 +5,7 @@ import path = require('path'); import http from 'isomorphic-git/http/node'; import urlJoin from 'url-join'; import outputPanelLog from './outputPanelLog'; -import type { SubmissionForExtension } from 'contest-monitor-types/contestMonitorTypes'; +import type { SubmissionForExtension } from 'bwcontest-shared/types/contestMonitorTypes'; export async function submitProblem( sessionToken: string, diff --git a/shared/.gitignore b/shared/.gitignore index 3c3629e..f18af4e 100644 --- a/shared/.gitignore +++ b/shared/.gitignore @@ -1 +1,2 @@ node_modules +dist/tsconfig/tsbuildinfo diff --git a/shared/dist/cpp.js b/shared/dist/cpp.js new file mode 100644 index 0000000..6ec29ae --- /dev/null +++ b/shared/dist/cpp.js @@ -0,0 +1,2462 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/tree-kill/index.js +var require_tree_kill = __commonJS({ + "node_modules/tree-kill/index.js"(exports2, module2) { + "use strict"; + var childProcess = require("child_process"); + var spawn2 = childProcess.spawn; + var exec2 = childProcess.exec; + module2.exports = function(pid, signal, callback) { + if (typeof signal === "function" && callback === void 0) { + callback = signal; + signal = void 0; + } + pid = parseInt(pid); + if (Number.isNaN(pid)) { + if (callback) { + return callback(new Error("pid must be a number")); + } else { + throw new Error("pid must be a number"); + } + } + var tree = {}; + var pidsToProcess = {}; + tree[pid] = []; + pidsToProcess[pid] = 1; + switch (process.platform) { + case "win32": + exec2("taskkill /pid " + pid + " /T /F", callback); + break; + case "darwin": + buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { + return spawn2("pgrep", ["-P", parentPid]); + }, function() { + killAll(tree, signal, callback); + }); + break; + default: + buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { + return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]); + }, function() { + killAll(tree, signal, callback); + }); + break; + } + }; + function killAll(tree, signal, callback) { + var killed = {}; + try { + Object.keys(tree).forEach(function(pid) { + tree[pid].forEach(function(pidpid) { + if (!killed[pidpid]) { + killPid(pidpid, signal); + killed[pidpid] = 1; + } + }); + if (!killed[pid]) { + killPid(pid, signal); + killed[pid] = 1; + } + }); + } catch (err) { + if (callback) { + return callback(err); + } else { + throw err; + } + } + if (callback) { + return callback(); + } + } + function killPid(pid, signal) { + try { + process.kill(parseInt(pid, 10), signal); + } catch (err) { + if (err.code !== "ESRCH") + throw err; + } + } + function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) { + var ps = spawnChildProcessesList(parentPid); + var allData = ""; + ps.stdout.on("data", function(data) { + var data = data.toString("ascii"); + allData += data; + }); + var onClose = function(code) { + delete pidsToProcess[parentPid]; + if (code != 0) { + if (Object.keys(pidsToProcess).length == 0) { + cb(); + } + return; + } + allData.match(/\d+/g).forEach(function(pid) { + pid = parseInt(pid, 10); + tree[parentPid].push(pid); + tree[pid] = []; + pidsToProcess[pid] = 1; + buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb); + }); + }; + ps.on("close", onClose); + } + } +}); + +// node_modules/universalify/index.js +var require_universalify = __commonJS({ + "node_modules/universalify/index.js"(exports2) { + "use strict"; + exports2.fromCallback = function(fn) { + return Object.defineProperty(function(...args) { + if (typeof args[args.length - 1] === "function") + fn.apply(this, args); + else { + return new Promise((resolve, reject) => { + args.push((err, res) => err != null ? reject(err) : resolve(res)); + fn.apply(this, args); + }); + } + }, "name", { value: fn.name }); + }; + exports2.fromPromise = function(fn) { + return Object.defineProperty(function(...args) { + const cb = args[args.length - 1]; + if (typeof cb !== "function") + return fn.apply(this, args); + else { + args.pop(); + fn.apply(this, args).then((r) => cb(null, r), cb); + } + }, "name", { value: fn.name }); + }; + } +}); + +// node_modules/graceful-fs/polyfills.js +var require_polyfills = __commonJS({ + "node_modules/graceful-fs/polyfills.js"(exports2, module2) { + var constants = require("constants"); + var origCwd = process.cwd; + var cwd = null; + var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; + process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process); + return cwd; + }; + try { + process.cwd(); + } catch (er) { + } + if (typeof process.chdir === "function") { + chdir = process.chdir; + process.chdir = function(d) { + cwd = null; + chdir.call(process, d); + }; + if (Object.setPrototypeOf) + Object.setPrototypeOf(process.chdir, chdir); + } + var chdir; + module2.exports = patch; + function patch(fs2) { + if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs2); + } + if (!fs2.lutimes) { + patchLutimes(fs2); + } + fs2.chown = chownFix(fs2.chown); + fs2.fchown = chownFix(fs2.fchown); + fs2.lchown = chownFix(fs2.lchown); + fs2.chmod = chmodFix(fs2.chmod); + fs2.fchmod = chmodFix(fs2.fchmod); + fs2.lchmod = chmodFix(fs2.lchmod); + fs2.chownSync = chownFixSync(fs2.chownSync); + fs2.fchownSync = chownFixSync(fs2.fchownSync); + fs2.lchownSync = chownFixSync(fs2.lchownSync); + fs2.chmodSync = chmodFixSync(fs2.chmodSync); + fs2.fchmodSync = chmodFixSync(fs2.fchmodSync); + fs2.lchmodSync = chmodFixSync(fs2.lchmodSync); + fs2.stat = statFix(fs2.stat); + fs2.fstat = statFix(fs2.fstat); + fs2.lstat = statFix(fs2.lstat); + fs2.statSync = statFixSync(fs2.statSync); + fs2.fstatSync = statFixSync(fs2.fstatSync); + fs2.lstatSync = statFixSync(fs2.lstatSync); + if (fs2.chmod && !fs2.lchmod) { + fs2.lchmod = function(path, mode, cb) { + if (cb) + process.nextTick(cb); + }; + fs2.lchmodSync = function() { + }; + } + if (fs2.chown && !fs2.lchown) { + fs2.lchown = function(path, uid, gid, cb) { + if (cb) + process.nextTick(cb); + }; + fs2.lchownSync = function() { + }; + } + if (platform === "win32") { + fs2.rename = typeof fs2.rename !== "function" ? fs2.rename : function(fs$rename) { + function rename(from, to, cb) { + var start = Date.now(); + var backoff = 0; + fs$rename(from, to, function CB(er) { + if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { + setTimeout(function() { + fs2.stat(to, function(stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er); + }); + }, backoff); + if (backoff < 100) + backoff += 10; + return; + } + if (cb) + cb(er); + }); + } + if (Object.setPrototypeOf) + Object.setPrototypeOf(rename, fs$rename); + return rename; + }(fs2.rename); + } + fs2.read = typeof fs2.read !== "function" ? fs2.read : function(fs$read) { + function read(fd, buffer, offset, length, position, callback_) { + var callback; + if (callback_ && typeof callback_ === "function") { + var eagCounter = 0; + callback = function(er, _, __) { + if (er && er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + return fs$read.call(fs2, fd, buffer, offset, length, position, callback); + } + callback_.apply(this, arguments); + }; + } + return fs$read.call(fs2, fd, buffer, offset, length, position, callback); + } + if (Object.setPrototypeOf) + Object.setPrototypeOf(read, fs$read); + return read; + }(fs2.read); + fs2.readSync = typeof fs2.readSync !== "function" ? fs2.readSync : /* @__PURE__ */ function(fs$readSync) { + return function(fd, buffer, offset, length, position) { + var eagCounter = 0; + while (true) { + try { + return fs$readSync.call(fs2, fd, buffer, offset, length, position); + } catch (er) { + if (er.code === "EAGAIN" && eagCounter < 10) { + eagCounter++; + continue; + } + throw er; + } + } + }; + }(fs2.readSync); + function patchLchmod(fs3) { + fs3.lchmod = function(path, mode, callback) { + fs3.open( + path, + constants.O_WRONLY | constants.O_SYMLINK, + mode, + function(err, fd) { + if (err) { + if (callback) + callback(err); + return; + } + fs3.fchmod(fd, mode, function(err2) { + fs3.close(fd, function(err22) { + if (callback) + callback(err2 || err22); + }); + }); + } + ); + }; + fs3.lchmodSync = function(path, mode) { + var fd = fs3.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode); + var threw = true; + var ret; + try { + ret = fs3.fchmodSync(fd, mode); + threw = false; + } finally { + if (threw) { + try { + fs3.closeSync(fd); + } catch (er) { + } + } else { + fs3.closeSync(fd); + } + } + return ret; + }; + } + function patchLutimes(fs3) { + if (constants.hasOwnProperty("O_SYMLINK") && fs3.futimes) { + fs3.lutimes = function(path, at, mt, cb) { + fs3.open(path, constants.O_SYMLINK, function(er, fd) { + if (er) { + if (cb) + cb(er); + return; + } + fs3.futimes(fd, at, mt, function(er2) { + fs3.close(fd, function(er22) { + if (cb) + cb(er2 || er22); + }); + }); + }); + }; + fs3.lutimesSync = function(path, at, mt) { + var fd = fs3.openSync(path, constants.O_SYMLINK); + var ret; + var threw = true; + try { + ret = fs3.futimesSync(fd, at, mt); + threw = false; + } finally { + if (threw) { + try { + fs3.closeSync(fd); + } catch (er) { + } + } else { + fs3.closeSync(fd); + } + } + return ret; + }; + } else if (fs3.futimes) { + fs3.lutimes = function(_a, _b, _c, cb) { + if (cb) + process.nextTick(cb); + }; + fs3.lutimesSync = function() { + }; + } + } + function chmodFix(orig) { + if (!orig) + return orig; + return function(target, mode, cb) { + return orig.call(fs2, target, mode, function(er) { + if (chownErOk(er)) + er = null; + if (cb) + cb.apply(this, arguments); + }); + }; + } + function chmodFixSync(orig) { + if (!orig) + return orig; + return function(target, mode) { + try { + return orig.call(fs2, target, mode); + } catch (er) { + if (!chownErOk(er)) + throw er; + } + }; + } + function chownFix(orig) { + if (!orig) + return orig; + return function(target, uid, gid, cb) { + return orig.call(fs2, target, uid, gid, function(er) { + if (chownErOk(er)) + er = null; + if (cb) + cb.apply(this, arguments); + }); + }; + } + function chownFixSync(orig) { + if (!orig) + return orig; + return function(target, uid, gid) { + try { + return orig.call(fs2, target, uid, gid); + } catch (er) { + if (!chownErOk(er)) + throw er; + } + }; + } + function statFix(orig) { + if (!orig) + return orig; + return function(target, options, cb) { + if (typeof options === "function") { + cb = options; + options = null; + } + function callback(er, stats) { + if (stats) { + if (stats.uid < 0) + stats.uid += 4294967296; + if (stats.gid < 0) + stats.gid += 4294967296; + } + if (cb) + cb.apply(this, arguments); + } + return options ? orig.call(fs2, target, options, callback) : orig.call(fs2, target, callback); + }; + } + function statFixSync(orig) { + if (!orig) + return orig; + return function(target, options) { + var stats = options ? orig.call(fs2, target, options) : orig.call(fs2, target); + if (stats) { + if (stats.uid < 0) + stats.uid += 4294967296; + if (stats.gid < 0) + stats.gid += 4294967296; + } + return stats; + }; + } + function chownErOk(er) { + if (!er) + return true; + if (er.code === "ENOSYS") + return true; + var nonroot = !process.getuid || process.getuid() !== 0; + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true; + } + return false; + } + } + } +}); + +// node_modules/graceful-fs/legacy-streams.js +var require_legacy_streams = __commonJS({ + "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { + var Stream = require("stream").Stream; + module2.exports = legacy; + function legacy(fs2) { + return { + ReadStream, + WriteStream + }; + function ReadStream(path, options) { + if (!(this instanceof ReadStream)) + return new ReadStream(path, options); + Stream.call(this); + var self = this; + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + this.flags = "r"; + this.mode = 438; + this.bufferSize = 64 * 1024; + options = options || {}; + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + if (this.encoding) + this.setEncoding(this.encoding); + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); + } + if (this.end === void 0) { + this.end = Infinity; + } else if ("number" !== typeof this.end) { + throw TypeError("end must be a Number"); + } + if (this.start > this.end) { + throw new Error("start must be <= end"); + } + this.pos = this.start; + } + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + fs2.open(this.path, this.flags, this.mode, function(err, fd) { + if (err) { + self.emit("error", err); + self.readable = false; + return; + } + self.fd = fd; + self.emit("open", fd); + self._read(); + }); + } + function WriteStream(path, options) { + if (!(this instanceof WriteStream)) + return new WriteStream(path, options); + Stream.call(this); + this.path = path; + this.fd = null; + this.writable = true; + this.flags = "w"; + this.encoding = "binary"; + this.mode = 438; + this.bytesWritten = 0; + options = options || {}; + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + if (this.start !== void 0) { + if ("number" !== typeof this.start) { + throw TypeError("start must be a Number"); + } + if (this.start < 0) { + throw new Error("start must be >= zero"); + } + this.pos = this.start; + } + this.busy = false; + this._queue = []; + if (this.fd === null) { + this._open = fs2.open; + this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); + this.flush(); + } + } + } + } +}); + +// node_modules/graceful-fs/clone.js +var require_clone = __commonJS({ + "node_modules/graceful-fs/clone.js"(exports2, module2) { + "use strict"; + module2.exports = clone; + var getPrototypeOf = Object.getPrototypeOf || function(obj) { + return obj.__proto__; + }; + function clone(obj) { + if (obj === null || typeof obj !== "object") + return obj; + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) }; + else + var copy = /* @__PURE__ */ Object.create(null); + Object.getOwnPropertyNames(obj).forEach(function(key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); + }); + return copy; + } + } +}); + +// node_modules/graceful-fs/graceful-fs.js +var require_graceful_fs = __commonJS({ + "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { + var fs2 = require("fs"); + var polyfills = require_polyfills(); + var legacy = require_legacy_streams(); + var clone = require_clone(); + var util2 = require("util"); + var gracefulQueue; + var previousSymbol; + if (typeof Symbol === "function" && typeof Symbol.for === "function") { + gracefulQueue = Symbol.for("graceful-fs.queue"); + previousSymbol = Symbol.for("graceful-fs.previous"); + } else { + gracefulQueue = "___graceful-fs.queue"; + previousSymbol = "___graceful-fs.previous"; + } + function noop() { + } + function publishQueue(context, queue2) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue2; + } + }); + } + var debug = noop; + if (util2.debuglog) + debug = util2.debuglog("gfs4"); + else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) + debug = function() { + var m = util2.format.apply(util2, arguments); + m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); + console.error(m); + }; + if (!fs2[gracefulQueue]) { + queue = global[gracefulQueue] || []; + publishQueue(fs2, queue); + fs2.close = function(fs$close) { + function close(fd, cb) { + return fs$close.call(fs2, fd, function(err) { + if (!err) { + resetQueue(); + } + if (typeof cb === "function") + cb.apply(this, arguments); + }); + } + Object.defineProperty(close, previousSymbol, { + value: fs$close + }); + return close; + }(fs2.close); + fs2.closeSync = function(fs$closeSync) { + function closeSync(fd) { + fs$closeSync.apply(fs2, arguments); + resetQueue(); + } + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }); + return closeSync; + }(fs2.closeSync); + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { + process.on("exit", function() { + debug(fs2[gracefulQueue]); + require("assert").equal(fs2[gracefulQueue].length, 0); + }); + } + } + var queue; + if (!global[gracefulQueue]) { + publishQueue(global, fs2[gracefulQueue]); + } + module2.exports = patch(clone(fs2)); + if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs2.__patched) { + module2.exports = patch(fs2); + fs2.__patched = true; + } + function patch(fs3) { + polyfills(fs3); + fs3.gracefulify = patch; + fs3.createReadStream = createReadStream; + fs3.createWriteStream = createWriteStream; + var fs$readFile = fs3.readFile; + fs3.readFile = readFile; + function readFile(path, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$readFile(path, options, cb); + function go$readFile(path2, options2, cb2, startTime) { + return fs$readFile(path2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + var fs$writeFile = fs3.writeFile; + fs3.writeFile = writeFile; + function writeFile(path, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$writeFile(path, data, options, cb); + function go$writeFile(path2, data2, options2, cb2, startTime) { + return fs$writeFile(path2, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + var fs$appendFile = fs3.appendFile; + if (fs$appendFile) + fs3.appendFile = appendFile; + function appendFile(path, data, options, cb) { + if (typeof options === "function") + cb = options, options = null; + return go$appendFile(path, data, options, cb); + function go$appendFile(path2, data2, options2, cb2, startTime) { + return fs$appendFile(path2, data2, options2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + var fs$copyFile = fs3.copyFile; + if (fs$copyFile) + fs3.copyFile = copyFile; + function copyFile(src, dest, flags, cb) { + if (typeof flags === "function") { + cb = flags; + flags = 0; + } + return go$copyFile(src, dest, flags, cb); + function go$copyFile(src2, dest2, flags2, cb2, startTime) { + return fs$copyFile(src2, dest2, flags2, function(err) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + var fs$readdir = fs3.readdir; + fs3.readdir = readdir; + var noReaddirOptionVersions = /^v[0-5]\./; + function readdir(path, options, cb) { + if (typeof options === "function") + cb = options, options = null; + var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) { + return fs$readdir(path2, fs$readdirCallback( + path2, + options2, + cb2, + startTime + )); + } : function go$readdir2(path2, options2, cb2, startTime) { + return fs$readdir(path2, options2, fs$readdirCallback( + path2, + options2, + cb2, + startTime + )); + }; + return go$readdir(path, options, cb); + function fs$readdirCallback(path2, options2, cb2, startTime) { + return function(err, files) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([ + go$readdir, + [path2, options2, cb2], + err, + startTime || Date.now(), + Date.now() + ]); + else { + if (files && files.sort) + files.sort(); + if (typeof cb2 === "function") + cb2.call(this, err, files); + } + }; + } + } + if (process.version.substr(0, 4) === "v0.8") { + var legStreams = legacy(fs3); + ReadStream = legStreams.ReadStream; + WriteStream = legStreams.WriteStream; + } + var fs$ReadStream = fs3.ReadStream; + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype); + ReadStream.prototype.open = ReadStream$open; + } + var fs$WriteStream = fs3.WriteStream; + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype); + WriteStream.prototype.open = WriteStream$open; + } + Object.defineProperty(fs3, "ReadStream", { + get: function() { + return ReadStream; + }, + set: function(val) { + ReadStream = val; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(fs3, "WriteStream", { + get: function() { + return WriteStream; + }, + set: function(val) { + WriteStream = val; + }, + enumerable: true, + configurable: true + }); + var FileReadStream = ReadStream; + Object.defineProperty(fs3, "FileReadStream", { + get: function() { + return FileReadStream; + }, + set: function(val) { + FileReadStream = val; + }, + enumerable: true, + configurable: true + }); + var FileWriteStream = WriteStream; + Object.defineProperty(fs3, "FileWriteStream", { + get: function() { + return FileWriteStream; + }, + set: function(val) { + FileWriteStream = val; + }, + enumerable: true, + configurable: true + }); + function ReadStream(path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this; + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments); + } + function ReadStream$open() { + var that = this; + open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + if (that.autoClose) + that.destroy(); + that.emit("error", err); + } else { + that.fd = fd; + that.emit("open", fd); + that.read(); + } + }); + } + function WriteStream(path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this; + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments); + } + function WriteStream$open() { + var that = this; + open(that.path, that.flags, that.mode, function(err, fd) { + if (err) { + that.destroy(); + that.emit("error", err); + } else { + that.fd = fd; + that.emit("open", fd); + } + }); + } + function createReadStream(path, options) { + return new fs3.ReadStream(path, options); + } + function createWriteStream(path, options) { + return new fs3.WriteStream(path, options); + } + var fs$open = fs3.open; + fs3.open = open; + function open(path, flags, mode, cb) { + if (typeof mode === "function") + cb = mode, mode = null; + return go$open(path, flags, mode, cb); + function go$open(path2, flags2, mode2, cb2, startTime) { + return fs$open(path2, flags2, mode2, function(err, fd) { + if (err && (err.code === "EMFILE" || err.code === "ENFILE")) + enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); + else { + if (typeof cb2 === "function") + cb2.apply(this, arguments); + } + }); + } + } + return fs3; + } + function enqueue(elem) { + debug("ENQUEUE", elem[0].name, elem[1]); + fs2[gracefulQueue].push(elem); + retry(); + } + var retryTimer; + function resetQueue() { + var now = Date.now(); + for (var i = 0; i < fs2[gracefulQueue].length; ++i) { + if (fs2[gracefulQueue][i].length > 2) { + fs2[gracefulQueue][i][3] = now; + fs2[gracefulQueue][i][4] = now; + } + } + retry(); + } + function retry() { + clearTimeout(retryTimer); + retryTimer = void 0; + if (fs2[gracefulQueue].length === 0) + return; + var elem = fs2[gracefulQueue].shift(); + var fn = elem[0]; + var args = elem[1]; + var err = elem[2]; + var startTime = elem[3]; + var lastTime = elem[4]; + if (startTime === void 0) { + debug("RETRY", fn.name, args); + fn.apply(null, args); + } else if (Date.now() - startTime >= 6e4) { + debug("TIMEOUT", fn.name, args); + var cb = args.pop(); + if (typeof cb === "function") + cb.call(null, err); + } else { + var sinceAttempt = Date.now() - lastTime; + var sinceStart = Math.max(lastTime - startTime, 1); + var desiredDelay = Math.min(sinceStart * 1.2, 100); + if (sinceAttempt >= desiredDelay) { + debug("RETRY", fn.name, args); + fn.apply(null, args.concat([startTime])); + } else { + fs2[gracefulQueue].push(elem); + } + } + if (retryTimer === void 0) { + retryTimer = setTimeout(retry, 0); + } + } + } +}); + +// node_modules/fs-extra/lib/fs/index.js +var require_fs = __commonJS({ + "node_modules/fs-extra/lib/fs/index.js"(exports2) { + "use strict"; + var u = require_universalify().fromCallback; + var fs2 = require_graceful_fs(); + var api = [ + "access", + "appendFile", + "chmod", + "chown", + "close", + "copyFile", + "fchmod", + "fchown", + "fdatasync", + "fstat", + "fsync", + "ftruncate", + "futimes", + "lchmod", + "lchown", + "link", + "lstat", + "mkdir", + "mkdtemp", + "open", + "opendir", + "readdir", + "readFile", + "readlink", + "realpath", + "rename", + "rm", + "rmdir", + "stat", + "symlink", + "truncate", + "unlink", + "utimes", + "writeFile" + ].filter((key) => { + return typeof fs2[key] === "function"; + }); + Object.assign(exports2, fs2); + api.forEach((method) => { + exports2[method] = u(fs2[method]); + }); + exports2.exists = function(filename, callback) { + if (typeof callback === "function") { + return fs2.exists(filename, callback); + } + return new Promise((resolve) => { + return fs2.exists(filename, resolve); + }); + }; + exports2.read = function(fd, buffer, offset, length, position, callback) { + if (typeof callback === "function") { + return fs2.read(fd, buffer, offset, length, position, callback); + } + return new Promise((resolve, reject) => { + fs2.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => { + if (err) + return reject(err); + resolve({ bytesRead, buffer: buffer2 }); + }); + }); + }; + exports2.write = function(fd, buffer, ...args) { + if (typeof args[args.length - 1] === "function") { + return fs2.write(fd, buffer, ...args); + } + return new Promise((resolve, reject) => { + fs2.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => { + if (err) + return reject(err); + resolve({ bytesWritten, buffer: buffer2 }); + }); + }); + }; + exports2.readv = function(fd, buffers, ...args) { + if (typeof args[args.length - 1] === "function") { + return fs2.readv(fd, buffers, ...args); + } + return new Promise((resolve, reject) => { + fs2.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => { + if (err) + return reject(err); + resolve({ bytesRead, buffers: buffers2 }); + }); + }); + }; + exports2.writev = function(fd, buffers, ...args) { + if (typeof args[args.length - 1] === "function") { + return fs2.writev(fd, buffers, ...args); + } + return new Promise((resolve, reject) => { + fs2.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => { + if (err) + return reject(err); + resolve({ bytesWritten, buffers: buffers2 }); + }); + }); + }; + if (typeof fs2.realpath.native === "function") { + exports2.realpath.native = u(fs2.realpath.native); + } else { + process.emitWarning( + "fs.realpath.native is not a function. Is fs being monkey-patched?", + "Warning", + "fs-extra-WARN0003" + ); + } + } +}); + +// node_modules/fs-extra/lib/mkdirs/utils.js +var require_utils = __commonJS({ + "node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) { + "use strict"; + var path = require("path"); + module2.exports.checkPath = function checkPath(pth) { + if (process.platform === "win32") { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, "")); + if (pathHasInvalidWinCharacters) { + const error = new Error(`Path contains invalid characters: ${pth}`); + error.code = "EINVAL"; + throw error; + } + } + }; + } +}); + +// node_modules/fs-extra/lib/mkdirs/make-dir.js +var require_make_dir = __commonJS({ + "node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) { + "use strict"; + var fs2 = require_fs(); + var { checkPath } = require_utils(); + var getMode = (options) => { + const defaults = { mode: 511 }; + if (typeof options === "number") + return options; + return { ...defaults, ...options }.mode; + }; + module2.exports.makeDir = async (dir, options) => { + checkPath(dir); + return fs2.mkdir(dir, { + mode: getMode(options), + recursive: true + }); + }; + module2.exports.makeDirSync = (dir, options) => { + checkPath(dir); + return fs2.mkdirSync(dir, { + mode: getMode(options), + recursive: true + }); + }; + } +}); + +// node_modules/fs-extra/lib/mkdirs/index.js +var require_mkdirs = __commonJS({ + "node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + var { makeDir: _makeDir, makeDirSync } = require_make_dir(); + var makeDir = u(_makeDir); + module2.exports = { + mkdirs: makeDir, + mkdirsSync: makeDirSync, + // alias + mkdirp: makeDir, + mkdirpSync: makeDirSync, + ensureDir: makeDir, + ensureDirSync: makeDirSync + }; + } +}); + +// node_modules/fs-extra/lib/path-exists/index.js +var require_path_exists = __commonJS({ + "node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + var fs2 = require_fs(); + function pathExists(path) { + return fs2.access(path).then(() => true).catch(() => false); + } + module2.exports = { + pathExists: u(pathExists), + pathExistsSync: fs2.existsSync + }; + } +}); + +// node_modules/fs-extra/lib/util/utimes.js +var require_utimes = __commonJS({ + "node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) { + "use strict"; + var fs2 = require_fs(); + var u = require_universalify().fromPromise; + async function utimesMillis(path, atime, mtime) { + const fd = await fs2.open(path, "r+"); + let closeErr = null; + try { + await fs2.futimes(fd, atime, mtime); + } finally { + try { + await fs2.close(fd); + } catch (e) { + closeErr = e; + } + } + if (closeErr) { + throw closeErr; + } + } + function utimesMillisSync(path, atime, mtime) { + const fd = fs2.openSync(path, "r+"); + fs2.futimesSync(fd, atime, mtime); + return fs2.closeSync(fd); + } + module2.exports = { + utimesMillis: u(utimesMillis), + utimesMillisSync + }; + } +}); + +// node_modules/fs-extra/lib/util/stat.js +var require_stat = __commonJS({ + "node_modules/fs-extra/lib/util/stat.js"(exports2, module2) { + "use strict"; + var fs2 = require_fs(); + var path = require("path"); + var u = require_universalify().fromPromise; + function getStats(src, dest, opts) { + const statFunc = opts.dereference ? (file) => fs2.stat(file, { bigint: true }) : (file) => fs2.lstat(file, { bigint: true }); + return Promise.all([ + statFunc(src), + statFunc(dest).catch((err) => { + if (err.code === "ENOENT") + return null; + throw err; + }) + ]).then(([srcStat, destStat]) => ({ srcStat, destStat })); + } + function getStatsSync(src, dest, opts) { + let destStat; + const statFunc = opts.dereference ? (file) => fs2.statSync(file, { bigint: true }) : (file) => fs2.lstatSync(file, { bigint: true }); + const srcStat = statFunc(src); + try { + destStat = statFunc(dest); + } catch (err) { + if (err.code === "ENOENT") + return { srcStat, destStat: null }; + throw err; + } + return { srcStat, destStat }; + } + async function checkPaths(src, dest, funcName, opts) { + const { srcStat, destStat } = await getStats(src, dest, opts); + if (destStat) { + if (areIdentical(srcStat, destStat)) { + const srcBaseName = path.basename(src); + const destBaseName = path.basename(dest); + if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { + return { srcStat, destStat, isChangingCase: true }; + } + throw new Error("Source and destination must not be the same."); + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); + } + } + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new Error(errMsg(src, dest, funcName)); + } + return { srcStat, destStat }; + } + function checkPathsSync(src, dest, funcName, opts) { + const { srcStat, destStat } = getStatsSync(src, dest, opts); + if (destStat) { + if (areIdentical(srcStat, destStat)) { + const srcBaseName = path.basename(src); + const destBaseName = path.basename(dest); + if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { + return { srcStat, destStat, isChangingCase: true }; + } + throw new Error("Source and destination must not be the same."); + } + if (srcStat.isDirectory() && !destStat.isDirectory()) { + throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); + } + if (!srcStat.isDirectory() && destStat.isDirectory()) { + throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); + } + } + if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { + throw new Error(errMsg(src, dest, funcName)); + } + return { srcStat, destStat }; + } + async function checkParentPaths(src, srcStat, dest, funcName) { + const srcParent = path.resolve(path.dirname(src)); + const destParent = path.resolve(path.dirname(dest)); + if (destParent === srcParent || destParent === path.parse(destParent).root) + return; + let destStat; + try { + destStat = await fs2.stat(destParent, { bigint: true }); + } catch (err) { + if (err.code === "ENOENT") + return; + throw err; + } + if (areIdentical(srcStat, destStat)) { + throw new Error(errMsg(src, dest, funcName)); + } + return checkParentPaths(src, srcStat, destParent, funcName); + } + function checkParentPathsSync(src, srcStat, dest, funcName) { + const srcParent = path.resolve(path.dirname(src)); + const destParent = path.resolve(path.dirname(dest)); + if (destParent === srcParent || destParent === path.parse(destParent).root) + return; + let destStat; + try { + destStat = fs2.statSync(destParent, { bigint: true }); + } catch (err) { + if (err.code === "ENOENT") + return; + throw err; + } + if (areIdentical(srcStat, destStat)) { + throw new Error(errMsg(src, dest, funcName)); + } + return checkParentPathsSync(src, srcStat, destParent, funcName); + } + function areIdentical(srcStat, destStat) { + return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev; + } + function isSrcSubdir(src, dest) { + const srcArr = path.resolve(src).split(path.sep).filter((i) => i); + const destArr = path.resolve(dest).split(path.sep).filter((i) => i); + return srcArr.every((cur, i) => destArr[i] === cur); + } + function errMsg(src, dest, funcName) { + return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`; + } + module2.exports = { + // checkPaths + checkPaths: u(checkPaths), + checkPathsSync, + // checkParent + checkParentPaths: u(checkParentPaths), + checkParentPathsSync, + // Misc + isSrcSubdir, + areIdentical + }; + } +}); + +// node_modules/fs-extra/lib/copy/copy.js +var require_copy = __commonJS({ + "node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) { + "use strict"; + var fs2 = require_fs(); + var path = require("path"); + var { mkdirs } = require_mkdirs(); + var { pathExists } = require_path_exists(); + var { utimesMillis } = require_utimes(); + var stat = require_stat(); + async function copy(src, dest, opts = {}) { + if (typeof opts === "function") { + opts = { filter: opts }; + } + opts.clobber = "clobber" in opts ? !!opts.clobber : true; + opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; + if (opts.preserveTimestamps && process.arch === "ia32") { + process.emitWarning( + "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", + "Warning", + "fs-extra-WARN0001" + ); + } + const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts); + await stat.checkParentPaths(src, srcStat, dest, "copy"); + const include = await runFilter(src, dest, opts); + if (!include) + return; + const destParent = path.dirname(dest); + const dirExists = await pathExists(destParent); + if (!dirExists) { + await mkdirs(destParent); + } + await getStatsAndPerformCopy(destStat, src, dest, opts); + } + async function runFilter(src, dest, opts) { + if (!opts.filter) + return true; + return opts.filter(src, dest); + } + async function getStatsAndPerformCopy(destStat, src, dest, opts) { + const statFn = opts.dereference ? fs2.stat : fs2.lstat; + const srcStat = await statFn(src); + if (srcStat.isDirectory()) + return onDir(srcStat, destStat, src, dest, opts); + if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) + return onFile(srcStat, destStat, src, dest, opts); + if (srcStat.isSymbolicLink()) + return onLink(destStat, src, dest, opts); + if (srcStat.isSocket()) + throw new Error(`Cannot copy a socket file: ${src}`); + if (srcStat.isFIFO()) + throw new Error(`Cannot copy a FIFO pipe: ${src}`); + throw new Error(`Unknown file: ${src}`); + } + async function onFile(srcStat, destStat, src, dest, opts) { + if (!destStat) + return copyFile(srcStat, src, dest, opts); + if (opts.overwrite) { + await fs2.unlink(dest); + return copyFile(srcStat, src, dest, opts); + } + if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`); + } + } + async function copyFile(srcStat, src, dest, opts) { + await fs2.copyFile(src, dest); + if (opts.preserveTimestamps) { + if (fileIsNotWritable(srcStat.mode)) { + await makeFileWritable(dest, srcStat.mode); + } + const updatedSrcStat = await fs2.stat(src); + await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime); + } + return fs2.chmod(dest, srcStat.mode); + } + function fileIsNotWritable(srcMode) { + return (srcMode & 128) === 0; + } + function makeFileWritable(dest, srcMode) { + return fs2.chmod(dest, srcMode | 128); + } + async function onDir(srcStat, destStat, src, dest, opts) { + if (!destStat) { + await fs2.mkdir(dest); + } + const items = await fs2.readdir(src); + await Promise.all(items.map(async (item) => { + const srcItem = path.join(src, item); + const destItem = path.join(dest, item); + const include = await runFilter(srcItem, destItem, opts); + if (!include) + return; + const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts); + return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts); + })); + if (!destStat) { + await fs2.chmod(dest, srcStat.mode); + } + } + async function onLink(destStat, src, dest, opts) { + let resolvedSrc = await fs2.readlink(src); + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc); + } + if (!destStat) { + return fs2.symlink(resolvedSrc, dest); + } + let resolvedDest = null; + try { + resolvedDest = await fs2.readlink(dest); + } catch (e) { + if (e.code === "EINVAL" || e.code === "UNKNOWN") + return fs2.symlink(resolvedSrc, dest); + throw e; + } + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest); + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); + } + if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); + } + await fs2.unlink(dest); + return fs2.symlink(resolvedSrc, dest); + } + module2.exports = copy; + } +}); + +// node_modules/fs-extra/lib/copy/copy-sync.js +var require_copy_sync = __commonJS({ + "node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) { + "use strict"; + var fs2 = require_graceful_fs(); + var path = require("path"); + var mkdirsSync = require_mkdirs().mkdirsSync; + var utimesMillisSync = require_utimes().utimesMillisSync; + var stat = require_stat(); + function copySync(src, dest, opts) { + if (typeof opts === "function") { + opts = { filter: opts }; + } + opts = opts || {}; + opts.clobber = "clobber" in opts ? !!opts.clobber : true; + opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; + if (opts.preserveTimestamps && process.arch === "ia32") { + process.emitWarning( + "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", + "Warning", + "fs-extra-WARN0002" + ); + } + const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts); + stat.checkParentPathsSync(src, srcStat, dest, "copy"); + if (opts.filter && !opts.filter(src, dest)) + return; + const destParent = path.dirname(dest); + if (!fs2.existsSync(destParent)) + mkdirsSync(destParent); + return getStats(destStat, src, dest, opts); + } + function getStats(destStat, src, dest, opts) { + const statSync = opts.dereference ? fs2.statSync : fs2.lstatSync; + const srcStat = statSync(src); + if (srcStat.isDirectory()) + return onDir(srcStat, destStat, src, dest, opts); + else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) + return onFile(srcStat, destStat, src, dest, opts); + else if (srcStat.isSymbolicLink()) + return onLink(destStat, src, dest, opts); + else if (srcStat.isSocket()) + throw new Error(`Cannot copy a socket file: ${src}`); + else if (srcStat.isFIFO()) + throw new Error(`Cannot copy a FIFO pipe: ${src}`); + throw new Error(`Unknown file: ${src}`); + } + function onFile(srcStat, destStat, src, dest, opts) { + if (!destStat) + return copyFile(srcStat, src, dest, opts); + return mayCopyFile(srcStat, src, dest, opts); + } + function mayCopyFile(srcStat, src, dest, opts) { + if (opts.overwrite) { + fs2.unlinkSync(dest); + return copyFile(srcStat, src, dest, opts); + } else if (opts.errorOnExist) { + throw new Error(`'${dest}' already exists`); + } + } + function copyFile(srcStat, src, dest, opts) { + fs2.copyFileSync(src, dest); + if (opts.preserveTimestamps) + handleTimestamps(srcStat.mode, src, dest); + return setDestMode(dest, srcStat.mode); + } + function handleTimestamps(srcMode, src, dest) { + if (fileIsNotWritable(srcMode)) + makeFileWritable(dest, srcMode); + return setDestTimestamps(src, dest); + } + function fileIsNotWritable(srcMode) { + return (srcMode & 128) === 0; + } + function makeFileWritable(dest, srcMode) { + return setDestMode(dest, srcMode | 128); + } + function setDestMode(dest, srcMode) { + return fs2.chmodSync(dest, srcMode); + } + function setDestTimestamps(src, dest) { + const updatedSrcStat = fs2.statSync(src); + return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime); + } + function onDir(srcStat, destStat, src, dest, opts) { + if (!destStat) + return mkDirAndCopy(srcStat.mode, src, dest, opts); + return copyDir(src, dest, opts); + } + function mkDirAndCopy(srcMode, src, dest, opts) { + fs2.mkdirSync(dest); + copyDir(src, dest, opts); + return setDestMode(dest, srcMode); + } + function copyDir(src, dest, opts) { + fs2.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts)); + } + function copyDirItem(item, src, dest, opts) { + const srcItem = path.join(src, item); + const destItem = path.join(dest, item); + if (opts.filter && !opts.filter(srcItem, destItem)) + return; + const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts); + return getStats(destStat, srcItem, destItem, opts); + } + function onLink(destStat, src, dest, opts) { + let resolvedSrc = fs2.readlinkSync(src); + if (opts.dereference) { + resolvedSrc = path.resolve(process.cwd(), resolvedSrc); + } + if (!destStat) { + return fs2.symlinkSync(resolvedSrc, dest); + } else { + let resolvedDest; + try { + resolvedDest = fs2.readlinkSync(dest); + } catch (err) { + if (err.code === "EINVAL" || err.code === "UNKNOWN") + return fs2.symlinkSync(resolvedSrc, dest); + throw err; + } + if (opts.dereference) { + resolvedDest = path.resolve(process.cwd(), resolvedDest); + } + if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { + throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); + } + if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { + throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); + } + return copyLink(resolvedSrc, dest); + } + } + function copyLink(resolvedSrc, dest) { + fs2.unlinkSync(dest); + return fs2.symlinkSync(resolvedSrc, dest); + } + module2.exports = copySync; + } +}); + +// node_modules/fs-extra/lib/copy/index.js +var require_copy2 = __commonJS({ + "node_modules/fs-extra/lib/copy/index.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + module2.exports = { + copy: u(require_copy()), + copySync: require_copy_sync() + }; + } +}); + +// node_modules/fs-extra/lib/remove/index.js +var require_remove = __commonJS({ + "node_modules/fs-extra/lib/remove/index.js"(exports2, module2) { + "use strict"; + var fs2 = require_graceful_fs(); + var u = require_universalify().fromCallback; + function remove(path, callback) { + fs2.rm(path, { recursive: true, force: true }, callback); + } + function removeSync2(path) { + fs2.rmSync(path, { recursive: true, force: true }); + } + module2.exports = { + remove: u(remove), + removeSync: removeSync2 + }; + } +}); + +// node_modules/fs-extra/lib/empty/index.js +var require_empty = __commonJS({ + "node_modules/fs-extra/lib/empty/index.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + var fs2 = require_fs(); + var path = require("path"); + var mkdir = require_mkdirs(); + var remove = require_remove(); + var emptyDir = u(async function emptyDir2(dir) { + let items; + try { + items = await fs2.readdir(dir); + } catch { + return mkdir.mkdirs(dir); + } + return Promise.all(items.map((item) => remove.remove(path.join(dir, item)))); + }); + function emptyDirSync(dir) { + let items; + try { + items = fs2.readdirSync(dir); + } catch { + return mkdir.mkdirsSync(dir); + } + items.forEach((item) => { + item = path.join(dir, item); + remove.removeSync(item); + }); + } + module2.exports = { + emptyDirSync, + emptydirSync: emptyDirSync, + emptyDir, + emptydir: emptyDir + }; + } +}); + +// node_modules/fs-extra/lib/ensure/file.js +var require_file = __commonJS({ + "node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + var path = require("path"); + var fs2 = require_fs(); + var mkdir = require_mkdirs(); + async function createFile(file) { + let stats; + try { + stats = await fs2.stat(file); + } catch { + } + if (stats && stats.isFile()) + return; + const dir = path.dirname(file); + let dirStats = null; + try { + dirStats = await fs2.stat(dir); + } catch (err) { + if (err.code === "ENOENT") { + await mkdir.mkdirs(dir); + await fs2.writeFile(file, ""); + return; + } else { + throw err; + } + } + if (dirStats.isDirectory()) { + await fs2.writeFile(file, ""); + } else { + await fs2.readdir(dir); + } + } + function createFileSync(file) { + let stats; + try { + stats = fs2.statSync(file); + } catch { + } + if (stats && stats.isFile()) + return; + const dir = path.dirname(file); + try { + if (!fs2.statSync(dir).isDirectory()) { + fs2.readdirSync(dir); + } + } catch (err) { + if (err && err.code === "ENOENT") + mkdir.mkdirsSync(dir); + else + throw err; + } + fs2.writeFileSync(file, ""); + } + module2.exports = { + createFile: u(createFile), + createFileSync + }; + } +}); + +// node_modules/fs-extra/lib/ensure/link.js +var require_link = __commonJS({ + "node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + var path = require("path"); + var fs2 = require_fs(); + var mkdir = require_mkdirs(); + var { pathExists } = require_path_exists(); + var { areIdentical } = require_stat(); + async function createLink(srcpath, dstpath) { + let dstStat; + try { + dstStat = await fs2.lstat(dstpath); + } catch { + } + let srcStat; + try { + srcStat = await fs2.lstat(srcpath); + } catch (err) { + err.message = err.message.replace("lstat", "ensureLink"); + throw err; + } + if (dstStat && areIdentical(srcStat, dstStat)) + return; + const dir = path.dirname(dstpath); + const dirExists = await pathExists(dir); + if (!dirExists) { + await mkdir.mkdirs(dir); + } + await fs2.link(srcpath, dstpath); + } + function createLinkSync(srcpath, dstpath) { + let dstStat; + try { + dstStat = fs2.lstatSync(dstpath); + } catch { + } + try { + const srcStat = fs2.lstatSync(srcpath); + if (dstStat && areIdentical(srcStat, dstStat)) + return; + } catch (err) { + err.message = err.message.replace("lstat", "ensureLink"); + throw err; + } + const dir = path.dirname(dstpath); + const dirExists = fs2.existsSync(dir); + if (dirExists) + return fs2.linkSync(srcpath, dstpath); + mkdir.mkdirsSync(dir); + return fs2.linkSync(srcpath, dstpath); + } + module2.exports = { + createLink: u(createLink), + createLinkSync + }; + } +}); + +// node_modules/fs-extra/lib/ensure/symlink-paths.js +var require_symlink_paths = __commonJS({ + "node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) { + "use strict"; + var path = require("path"); + var fs2 = require_fs(); + var { pathExists } = require_path_exists(); + var u = require_universalify().fromPromise; + async function symlinkPaths(srcpath, dstpath) { + if (path.isAbsolute(srcpath)) { + try { + await fs2.lstat(srcpath); + } catch (err) { + err.message = err.message.replace("lstat", "ensureSymlink"); + throw err; + } + return { + toCwd: srcpath, + toDst: srcpath + }; + } + const dstdir = path.dirname(dstpath); + const relativeToDst = path.join(dstdir, srcpath); + const exists = await pathExists(relativeToDst); + if (exists) { + return { + toCwd: relativeToDst, + toDst: srcpath + }; + } + try { + await fs2.lstat(srcpath); + } catch (err) { + err.message = err.message.replace("lstat", "ensureSymlink"); + throw err; + } + return { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + }; + } + function symlinkPathsSync(srcpath, dstpath) { + if (path.isAbsolute(srcpath)) { + const exists2 = fs2.existsSync(srcpath); + if (!exists2) + throw new Error("absolute srcpath does not exist"); + return { + toCwd: srcpath, + toDst: srcpath + }; + } + const dstdir = path.dirname(dstpath); + const relativeToDst = path.join(dstdir, srcpath); + const exists = fs2.existsSync(relativeToDst); + if (exists) { + return { + toCwd: relativeToDst, + toDst: srcpath + }; + } + const srcExists = fs2.existsSync(srcpath); + if (!srcExists) + throw new Error("relative srcpath does not exist"); + return { + toCwd: srcpath, + toDst: path.relative(dstdir, srcpath) + }; + } + module2.exports = { + symlinkPaths: u(symlinkPaths), + symlinkPathsSync + }; + } +}); + +// node_modules/fs-extra/lib/ensure/symlink-type.js +var require_symlink_type = __commonJS({ + "node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) { + "use strict"; + var fs2 = require_fs(); + var u = require_universalify().fromPromise; + async function symlinkType(srcpath, type) { + if (type) + return type; + let stats; + try { + stats = await fs2.lstat(srcpath); + } catch { + return "file"; + } + return stats && stats.isDirectory() ? "dir" : "file"; + } + function symlinkTypeSync(srcpath, type) { + if (type) + return type; + let stats; + try { + stats = fs2.lstatSync(srcpath); + } catch { + return "file"; + } + return stats && stats.isDirectory() ? "dir" : "file"; + } + module2.exports = { + symlinkType: u(symlinkType), + symlinkTypeSync + }; + } +}); + +// node_modules/fs-extra/lib/ensure/symlink.js +var require_symlink = __commonJS({ + "node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + var path = require("path"); + var fs2 = require_fs(); + var { mkdirs, mkdirsSync } = require_mkdirs(); + var { symlinkPaths, symlinkPathsSync } = require_symlink_paths(); + var { symlinkType, symlinkTypeSync } = require_symlink_type(); + var { pathExists } = require_path_exists(); + var { areIdentical } = require_stat(); + async function createSymlink(srcpath, dstpath, type) { + let stats; + try { + stats = await fs2.lstat(dstpath); + } catch { + } + if (stats && stats.isSymbolicLink()) { + const [srcStat, dstStat] = await Promise.all([ + fs2.stat(srcpath), + fs2.stat(dstpath) + ]); + if (areIdentical(srcStat, dstStat)) + return; + } + const relative = await symlinkPaths(srcpath, dstpath); + srcpath = relative.toDst; + const toType = await symlinkType(relative.toCwd, type); + const dir = path.dirname(dstpath); + if (!await pathExists(dir)) { + await mkdirs(dir); + } + return fs2.symlink(srcpath, dstpath, toType); + } + function createSymlinkSync(srcpath, dstpath, type) { + let stats; + try { + stats = fs2.lstatSync(dstpath); + } catch { + } + if (stats && stats.isSymbolicLink()) { + const srcStat = fs2.statSync(srcpath); + const dstStat = fs2.statSync(dstpath); + if (areIdentical(srcStat, dstStat)) + return; + } + const relative = symlinkPathsSync(srcpath, dstpath); + srcpath = relative.toDst; + type = symlinkTypeSync(relative.toCwd, type); + const dir = path.dirname(dstpath); + const exists = fs2.existsSync(dir); + if (exists) + return fs2.symlinkSync(srcpath, dstpath, type); + mkdirsSync(dir); + return fs2.symlinkSync(srcpath, dstpath, type); + } + module2.exports = { + createSymlink: u(createSymlink), + createSymlinkSync + }; + } +}); + +// node_modules/fs-extra/lib/ensure/index.js +var require_ensure = __commonJS({ + "node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) { + "use strict"; + var { createFile, createFileSync } = require_file(); + var { createLink, createLinkSync } = require_link(); + var { createSymlink, createSymlinkSync } = require_symlink(); + module2.exports = { + // file + createFile, + createFileSync, + ensureFile: createFile, + ensureFileSync: createFileSync, + // link + createLink, + createLinkSync, + ensureLink: createLink, + ensureLinkSync: createLinkSync, + // symlink + createSymlink, + createSymlinkSync, + ensureSymlink: createSymlink, + ensureSymlinkSync: createSymlinkSync + }; + } +}); + +// node_modules/jsonfile/utils.js +var require_utils2 = __commonJS({ + "node_modules/jsonfile/utils.js"(exports2, module2) { + function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) { + const EOF = finalEOL ? EOL : ""; + const str = JSON.stringify(obj, replacer, spaces); + return str.replace(/\n/g, EOL) + EOF; + } + function stripBom(content) { + if (Buffer.isBuffer(content)) + content = content.toString("utf8"); + return content.replace(/^\uFEFF/, ""); + } + module2.exports = { stringify, stripBom }; + } +}); + +// node_modules/jsonfile/index.js +var require_jsonfile = __commonJS({ + "node_modules/jsonfile/index.js"(exports2, module2) { + var _fs; + try { + _fs = require_graceful_fs(); + } catch (_) { + _fs = require("fs"); + } + var universalify = require_universalify(); + var { stringify, stripBom } = require_utils2(); + async function _readFile(file, options = {}) { + if (typeof options === "string") { + options = { encoding: options }; + } + const fs2 = options.fs || _fs; + const shouldThrow = "throws" in options ? options.throws : true; + let data = await universalify.fromCallback(fs2.readFile)(file, options); + data = stripBom(data); + let obj; + try { + obj = JSON.parse(data, options ? options.reviver : null); + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}`; + throw err; + } else { + return null; + } + } + return obj; + } + var readFile = universalify.fromPromise(_readFile); + function readFileSync(file, options = {}) { + if (typeof options === "string") { + options = { encoding: options }; + } + const fs2 = options.fs || _fs; + const shouldThrow = "throws" in options ? options.throws : true; + try { + let content = fs2.readFileSync(file, options); + content = stripBom(content); + return JSON.parse(content, options.reviver); + } catch (err) { + if (shouldThrow) { + err.message = `${file}: ${err.message}`; + throw err; + } else { + return null; + } + } + } + async function _writeFile(file, obj, options = {}) { + const fs2 = options.fs || _fs; + const str = stringify(obj, options); + await universalify.fromCallback(fs2.writeFile)(file, str, options); + } + var writeFile = universalify.fromPromise(_writeFile); + function writeFileSync(file, obj, options = {}) { + const fs2 = options.fs || _fs; + const str = stringify(obj, options); + return fs2.writeFileSync(file, str, options); + } + var jsonfile = { + readFile, + readFileSync, + writeFile, + writeFileSync + }; + module2.exports = jsonfile; + } +}); + +// node_modules/fs-extra/lib/json/jsonfile.js +var require_jsonfile2 = __commonJS({ + "node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) { + "use strict"; + var jsonFile = require_jsonfile(); + module2.exports = { + // jsonfile exports + readJson: jsonFile.readFile, + readJsonSync: jsonFile.readFileSync, + writeJson: jsonFile.writeFile, + writeJsonSync: jsonFile.writeFileSync + }; + } +}); + +// node_modules/fs-extra/lib/output-file/index.js +var require_output_file = __commonJS({ + "node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + var fs2 = require_fs(); + var path = require("path"); + var mkdir = require_mkdirs(); + var pathExists = require_path_exists().pathExists; + async function outputFile(file, data, encoding = "utf-8") { + const dir = path.dirname(file); + if (!await pathExists(dir)) { + await mkdir.mkdirs(dir); + } + return fs2.writeFile(file, data, encoding); + } + function outputFileSync(file, ...args) { + const dir = path.dirname(file); + if (!fs2.existsSync(dir)) { + mkdir.mkdirsSync(dir); + } + fs2.writeFileSync(file, ...args); + } + module2.exports = { + outputFile: u(outputFile), + outputFileSync + }; + } +}); + +// node_modules/fs-extra/lib/json/output-json.js +var require_output_json = __commonJS({ + "node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) { + "use strict"; + var { stringify } = require_utils2(); + var { outputFile } = require_output_file(); + async function outputJson(file, data, options = {}) { + const str = stringify(data, options); + await outputFile(file, str, options); + } + module2.exports = outputJson; + } +}); + +// node_modules/fs-extra/lib/json/output-json-sync.js +var require_output_json_sync = __commonJS({ + "node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) { + "use strict"; + var { stringify } = require_utils2(); + var { outputFileSync } = require_output_file(); + function outputJsonSync(file, data, options) { + const str = stringify(data, options); + outputFileSync(file, str, options); + } + module2.exports = outputJsonSync; + } +}); + +// node_modules/fs-extra/lib/json/index.js +var require_json = __commonJS({ + "node_modules/fs-extra/lib/json/index.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + var jsonFile = require_jsonfile2(); + jsonFile.outputJson = u(require_output_json()); + jsonFile.outputJsonSync = require_output_json_sync(); + jsonFile.outputJSON = jsonFile.outputJson; + jsonFile.outputJSONSync = jsonFile.outputJsonSync; + jsonFile.writeJSON = jsonFile.writeJson; + jsonFile.writeJSONSync = jsonFile.writeJsonSync; + jsonFile.readJSON = jsonFile.readJson; + jsonFile.readJSONSync = jsonFile.readJsonSync; + module2.exports = jsonFile; + } +}); + +// node_modules/fs-extra/lib/move/move.js +var require_move = __commonJS({ + "node_modules/fs-extra/lib/move/move.js"(exports2, module2) { + "use strict"; + var fs2 = require_fs(); + var path = require("path"); + var { copy } = require_copy2(); + var { remove } = require_remove(); + var { mkdirp } = require_mkdirs(); + var { pathExists } = require_path_exists(); + var stat = require_stat(); + async function move(src, dest, opts = {}) { + const overwrite = opts.overwrite || opts.clobber || false; + const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts); + await stat.checkParentPaths(src, srcStat, dest, "move"); + const destParent = path.dirname(dest); + const parsedParentPath = path.parse(destParent); + if (parsedParentPath.root !== destParent) { + await mkdirp(destParent); + } + return doRename(src, dest, overwrite, isChangingCase); + } + async function doRename(src, dest, overwrite, isChangingCase) { + if (!isChangingCase) { + if (overwrite) { + await remove(dest); + } else if (await pathExists(dest)) { + throw new Error("dest already exists."); + } + } + try { + await fs2.rename(src, dest); + } catch (err) { + if (err.code !== "EXDEV") { + throw err; + } + await moveAcrossDevice(src, dest, overwrite); + } + } + async function moveAcrossDevice(src, dest, overwrite) { + const opts = { + overwrite, + errorOnExist: true, + preserveTimestamps: true + }; + await copy(src, dest, opts); + return remove(src); + } + module2.exports = move; + } +}); + +// node_modules/fs-extra/lib/move/move-sync.js +var require_move_sync = __commonJS({ + "node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) { + "use strict"; + var fs2 = require_graceful_fs(); + var path = require("path"); + var copySync = require_copy2().copySync; + var removeSync2 = require_remove().removeSync; + var mkdirpSync = require_mkdirs().mkdirpSync; + var stat = require_stat(); + function moveSync(src, dest, opts) { + opts = opts || {}; + const overwrite = opts.overwrite || opts.clobber || false; + const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts); + stat.checkParentPathsSync(src, srcStat, dest, "move"); + if (!isParentRoot(dest)) + mkdirpSync(path.dirname(dest)); + return doRename(src, dest, overwrite, isChangingCase); + } + function isParentRoot(dest) { + const parent = path.dirname(dest); + const parsedPath = path.parse(parent); + return parsedPath.root === parent; + } + function doRename(src, dest, overwrite, isChangingCase) { + if (isChangingCase) + return rename(src, dest, overwrite); + if (overwrite) { + removeSync2(dest); + return rename(src, dest, overwrite); + } + if (fs2.existsSync(dest)) + throw new Error("dest already exists."); + return rename(src, dest, overwrite); + } + function rename(src, dest, overwrite) { + try { + fs2.renameSync(src, dest); + } catch (err) { + if (err.code !== "EXDEV") + throw err; + return moveAcrossDevice(src, dest, overwrite); + } + } + function moveAcrossDevice(src, dest, overwrite) { + const opts = { + overwrite, + errorOnExist: true, + preserveTimestamps: true + }; + copySync(src, dest, opts); + return removeSync2(src); + } + module2.exports = moveSync; + } +}); + +// node_modules/fs-extra/lib/move/index.js +var require_move2 = __commonJS({ + "node_modules/fs-extra/lib/move/index.js"(exports2, module2) { + "use strict"; + var u = require_universalify().fromPromise; + module2.exports = { + move: u(require_move()), + moveSync: require_move_sync() + }; + } +}); + +// node_modules/fs-extra/lib/index.js +var require_lib = __commonJS({ + "node_modules/fs-extra/lib/index.js"(exports2, module2) { + "use strict"; + module2.exports = { + // Export promiseified graceful-fs: + ...require_fs(), + // Export extra methods: + ...require_copy2(), + ...require_empty(), + ...require_ensure(), + ...require_json(), + ...require_mkdirs(), + ...require_move2(), + ...require_output_file(), + ...require_path_exists(), + ...require_remove() + }; + } +}); + +// submission-runner/cpp.cts +var cpp_exports = {}; +__export(cpp_exports, { + runCpp: () => runCpp +}); +module.exports = __toCommonJS(cpp_exports); +var import_path = require("path"); +var import_child_process = require("child_process"); +var util = __toESM(require("util")); + +// submission-runner/settings.cts +var timeoutSeconds = 30; + +// submission-runner/cpp.cts +var import_tree_kill = __toESM(require_tree_kill()); +var os = __toESM(require("os")); +var fs = __toESM(require_lib()); +var execPromise = util.promisify(import_child_process.exec); +var runCpp = async function(params) { + const tmpDir = os.tmpdir(); + const buildDir = (0, import_path.join)(tmpDir, "bwcontest-cpp"); + if (fs.existsSync(buildDir)) { + fs.removeSync(buildDir); + } + fs.mkdirSync(buildDir); + console.log(`- BUILD: ${params.problemName}`); + const configureCommand = `cmake -S ${params.srcDir} -B ${buildDir}`; + try { + await execPromise(configureCommand); + } catch (e) { + const buildErrorText = e?.toString() ?? "Unknown build errors."; + console.log("Build errors: " + buildErrorText); + return { + success: false, + runResult: { kind: "CompileFailed", resultKindReason: buildErrorText } + }; + } + const compileCommand = `cmake --build ${buildDir} --target ${params.problemName}`; + try { + await execPromise(compileCommand); + } catch (e) { + const buildErrorText = e?.toString() ?? "Unknown build errors."; + console.log("Build errors: " + buildErrorText); + return { + success: false, + runResult: { kind: "CompileFailed", resultKindReason: buildErrorText } + }; + } + console.log(`- RUN: ${params.problemName}`); + let runCommand = ""; + if (params.cppPlatform === "VisualStudio") { + runCommand = `${(0, import_path.join)(buildDir, "Debug", `${params.problemName}.exe`)}`; + } else { + runCommand = `${(0, import_path.join)(buildDir, params.problemName)}`; + } + try { + let outputBuffer = ""; + const child = (0, import_child_process.spawn)(runCommand, { shell: true }); + child.stdout.setEncoding("utf8"); + child.stdout.on("data", (data) => { + outputBuffer += data.toString(); + }); + child.stderr.setEncoding("utf8"); + child.stderr.on("data", (data) => { + outputBuffer += data.toString(); + }); + const runStartTime = performance.now(); + child.stdin.write(params.input); + child.stdin.end(); + let timeLimitExceeded = false; + let completedNormally = false; + return { + success: true, + runResult: new Promise((resolve) => { + child.on("close", () => { + completedNormally = !timeLimitExceeded; + const runEndTime = performance.now(); + const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); + if (completedNormally) { + clearTimeout(timeoutHandle); + resolve({ + kind: "Completed", + output: outputBuffer, + exitCode: child.exitCode, + runtimeMilliseconds + }); + } else { + console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); + resolve({ + kind: "TimeLimitExceeded", + output: outputBuffer, + resultKindReason: `Timeout after ${timeoutSeconds} seconds` + }); + } + }); + const timeoutHandle = setTimeout(() => { + if (completedNormally) { + return; + } + console.log(`Run timed out after ${timeoutSeconds} seconds, killing process...`); + timeLimitExceeded = true; + child.stdin.end(); + child.stdin.destroy(); + child.stdout.destroy(); + child.stderr.destroy(); + child.kill("SIGKILL"); + }, timeoutSeconds * 1e3); + }), + killFunc() { + if (child.pid !== void 0) { + if (!completedNormally && !timeLimitExceeded) { + (0, import_tree_kill.default)(child.pid); + params.outputCallback?.("\n[Manually stopped]"); + } + } + } + }; + } catch (error) { + return { success: false, runResult: { kind: "RunError" } }; + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + runCpp +}); diff --git a/shared/dist/csharp.js b/shared/dist/csharp.js new file mode 100644 index 0000000..069178e --- /dev/null +++ b/shared/dist/csharp.js @@ -0,0 +1,227 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/tree-kill/index.js +var require_tree_kill = __commonJS({ + "node_modules/tree-kill/index.js"(exports2, module2) { + "use strict"; + var childProcess = require("child_process"); + var spawn2 = childProcess.spawn; + var exec = childProcess.exec; + module2.exports = function(pid, signal, callback) { + if (typeof signal === "function" && callback === void 0) { + callback = signal; + signal = void 0; + } + pid = parseInt(pid); + if (Number.isNaN(pid)) { + if (callback) { + return callback(new Error("pid must be a number")); + } else { + throw new Error("pid must be a number"); + } + } + var tree = {}; + var pidsToProcess = {}; + tree[pid] = []; + pidsToProcess[pid] = 1; + switch (process.platform) { + case "win32": + exec("taskkill /pid " + pid + " /T /F", callback); + break; + case "darwin": + buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { + return spawn2("pgrep", ["-P", parentPid]); + }, function() { + killAll(tree, signal, callback); + }); + break; + default: + buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { + return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]); + }, function() { + killAll(tree, signal, callback); + }); + break; + } + }; + function killAll(tree, signal, callback) { + var killed = {}; + try { + Object.keys(tree).forEach(function(pid) { + tree[pid].forEach(function(pidpid) { + if (!killed[pidpid]) { + killPid(pidpid, signal); + killed[pidpid] = 1; + } + }); + if (!killed[pid]) { + killPid(pid, signal); + killed[pid] = 1; + } + }); + } catch (err) { + if (callback) { + return callback(err); + } else { + throw err; + } + } + if (callback) { + return callback(); + } + } + function killPid(pid, signal) { + try { + process.kill(parseInt(pid, 10), signal); + } catch (err) { + if (err.code !== "ESRCH") + throw err; + } + } + function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) { + var ps = spawnChildProcessesList(parentPid); + var allData = ""; + ps.stdout.on("data", function(data) { + var data = data.toString("ascii"); + allData += data; + }); + var onClose = function(code) { + delete pidsToProcess[parentPid]; + if (code != 0) { + if (Object.keys(pidsToProcess).length == 0) { + cb(); + } + return; + } + allData.match(/\d+/g).forEach(function(pid) { + pid = parseInt(pid, 10); + tree[parentPid].push(pid); + tree[pid] = []; + pidsToProcess[pid] = 1; + buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb); + }); + }; + ps.on("close", onClose); + } + } +}); + +// submission-runner/csharp.cts +var csharp_exports = {}; +__export(csharp_exports, { + runCSharp: () => runCSharp +}); +module.exports = __toCommonJS(csharp_exports); +var import_child_process = require("child_process"); +var import_tree_kill = __toESM(require_tree_kill()); + +// submission-runner/settings.cts +var timeoutSeconds = 30; + +// submission-runner/csharp.cts +var runCSharp = async function(params) { + console.log(`- RUN: ${params.srcDir}`); + const child = (0, import_child_process.spawn)("dotnet run", { shell: true, cwd: params.srcDir }); + try { + let outputBuffer = ""; + child.stdout.setEncoding("utf8"); + child.stdout.on("data", (data) => { + outputBuffer += data.toString(); + params.outputCallback?.(data.toString()); + }); + child.stderr.setEncoding("utf8"); + child.stderr.on("data", (data) => { + outputBuffer += data.toString(); + params.outputCallback?.(data.toString()); + }); + const runStartTime = performance.now(); + child.stdin.write(params.input); + child.stdin.end(); + let timeLimitExceeded = false; + let completedNormally = false; + return { + success: true, + runResult: new Promise((resolve) => { + child.on("close", () => { + completedNormally = !timeLimitExceeded; + const runEndTime = performance.now(); + const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); + if (completedNormally) { + clearTimeout(timeoutHandle); + resolve({ + kind: "Completed", + output: outputBuffer, + exitCode: child.exitCode, + runtimeMilliseconds + }); + } else { + console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); + resolve({ + kind: "TimeLimitExceeded", + output: outputBuffer, + resultKindReason: `Timeout after ${timeoutSeconds} seconds` + }); + } + }); + const timeoutHandle = setTimeout(() => { + if (completedNormally) { + return; + } + console.log(`Run timed out after ${timeoutSeconds} seconds, killing process...`); + timeLimitExceeded = true; + child.stdin.end(); + child.stdin.destroy(); + child.stdout.destroy(); + child.stderr.destroy(); + if (child.pid !== void 0) { + (0, import_tree_kill.default)(child.pid); + } + }, timeoutSeconds * 1e3); + }), + killFunc() { + if (child.pid !== void 0) { + if (!completedNormally && !timeLimitExceeded) { + (0, import_tree_kill.default)(child.pid); + params.outputCallback?.("\n[Manually stopped]"); + } + } + } + }; + } catch (error) { + return { success: false, runResult: { kind: "RunError" } }; + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + runCSharp +}); diff --git a/shared/dist/java.js b/shared/dist/java.js new file mode 100644 index 0000000..5da3e5f --- /dev/null +++ b/shared/dist/java.js @@ -0,0 +1,241 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/tree-kill/index.js +var require_tree_kill = __commonJS({ + "node_modules/tree-kill/index.js"(exports2, module2) { + "use strict"; + var childProcess = require("child_process"); + var spawn2 = childProcess.spawn; + var exec2 = childProcess.exec; + module2.exports = function(pid, signal, callback) { + if (typeof signal === "function" && callback === void 0) { + callback = signal; + signal = void 0; + } + pid = parseInt(pid); + if (Number.isNaN(pid)) { + if (callback) { + return callback(new Error("pid must be a number")); + } else { + throw new Error("pid must be a number"); + } + } + var tree = {}; + var pidsToProcess = {}; + tree[pid] = []; + pidsToProcess[pid] = 1; + switch (process.platform) { + case "win32": + exec2("taskkill /pid " + pid + " /T /F", callback); + break; + case "darwin": + buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { + return spawn2("pgrep", ["-P", parentPid]); + }, function() { + killAll(tree, signal, callback); + }); + break; + default: + buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { + return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]); + }, function() { + killAll(tree, signal, callback); + }); + break; + } + }; + function killAll(tree, signal, callback) { + var killed = {}; + try { + Object.keys(tree).forEach(function(pid) { + tree[pid].forEach(function(pidpid) { + if (!killed[pidpid]) { + killPid(pidpid, signal); + killed[pidpid] = 1; + } + }); + if (!killed[pid]) { + killPid(pid, signal); + killed[pid] = 1; + } + }); + } catch (err) { + if (callback) { + return callback(err); + } else { + throw err; + } + } + if (callback) { + return callback(); + } + } + function killPid(pid, signal) { + try { + process.kill(parseInt(pid, 10), signal); + } catch (err) { + if (err.code !== "ESRCH") + throw err; + } + } + function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) { + var ps = spawnChildProcessesList(parentPid); + var allData = ""; + ps.stdout.on("data", function(data) { + var data = data.toString("ascii"); + allData += data; + }); + var onClose = function(code) { + delete pidsToProcess[parentPid]; + if (code != 0) { + if (Object.keys(pidsToProcess).length == 0) { + cb(); + } + return; + } + allData.match(/\d+/g).forEach(function(pid) { + pid = parseInt(pid, 10); + tree[parentPid].push(pid); + tree[pid] = []; + pidsToProcess[pid] = 1; + buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb); + }); + }; + ps.on("close", onClose); + } + } +}); + +// submission-runner/java.cts +var java_exports = {}; +__export(java_exports, { + runJava: () => runJava +}); +module.exports = __toCommonJS(java_exports); +var import_path = require("path"); +var import_child_process = require("child_process"); +var util = __toESM(require("util")); + +// submission-runner/settings.cts +var timeoutSeconds = 30; + +// submission-runner/java.cts +var kill = require_tree_kill(); +var execPromise = util.promisify(import_child_process.exec); +var runJava = async function(params) { + console.log(`- BUILD: ${params.mainFile}`); + const compileCommand = `javac -cp ${(0, import_path.join)(params.srcDir, "src")} ${params.mainFile} -d ${(0, import_path.join)(params.srcDir, "build")}`; + try { + await execPromise(compileCommand); + } catch (e) { + const buildErrorText = e?.toString() ?? "Unknown build errors."; + console.log("Build errors: " + buildErrorText); + return { + success: false, + runResult: { kind: "CompileFailed", resultKindReason: buildErrorText } + }; + } + console.log(`- RUN: ${params.mainClass}`); + const runCommand = `java -cp "${(0, import_path.join)(params.srcDir, "build")}" ${params.mainClass}`; + try { + let outputBuffer = ""; + const child = (0, import_child_process.spawn)(runCommand, { shell: true }); + child.stdout.setEncoding("utf8"); + child.stdout.on("data", (data) => { + outputBuffer += data.toString(); + params.outputCallback?.(data.toString()); + }); + child.stderr.setEncoding("utf8"); + child.stderr.on("data", (data) => { + outputBuffer += data.toString(); + params.outputCallback?.(data.toString()); + }); + const runStartTime = performance.now(); + child.stdin.write(params.input); + child.stdin.end(); + let timeLimitExceeded = false; + let completedNormally = false; + return { + success: true, + runResult: new Promise((resolve) => { + child.on("close", () => { + completedNormally = !timeLimitExceeded; + const runEndTime = performance.now(); + const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); + if (completedNormally) { + clearTimeout(timeoutHandle); + resolve({ + kind: "Completed", + output: outputBuffer, + exitCode: child.exitCode, + runtimeMilliseconds + }); + } else { + console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); + resolve({ + kind: "TimeLimitExceeded", + output: outputBuffer, + resultKindReason: `Timeout after ${timeoutSeconds} seconds` + }); + } + }); + const timeoutHandle = setTimeout(() => { + if (completedNormally) { + return; + } + console.log(`Run timed out after ${timeoutSeconds} seconds, killing process...`); + timeLimitExceeded = true; + child.stdin.end(); + child.stdin.destroy(); + child.stdout.destroy(); + child.stderr.destroy(); + child.kill("SIGKILL"); + }, timeoutSeconds * 1e3); + }), + killFunc() { + if (child.pid !== void 0) { + if (!completedNormally && !timeLimitExceeded) { + kill(child.pid); + params.outputCallback?.("\n[Manually stopped]"); + } + } + } + }; + } catch (error) { + return { success: false, runResult: { kind: "RunError" } }; + } +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + runJava +}); diff --git a/shared/dist/settings.js b/shared/dist/settings.js new file mode 100644 index 0000000..57ab5f0 --- /dev/null +++ b/shared/dist/settings.js @@ -0,0 +1,30 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// submission-runner/settings.cts +var settings_exports = {}; +__export(settings_exports, { + timeoutSeconds: () => timeoutSeconds +}); +module.exports = __toCommonJS(settings_exports); +var timeoutSeconds = 30; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + timeoutSeconds +}); diff --git a/shared/dist/submission-runner/cpp.cjs b/shared/dist/submission-runner/cpp.cjs deleted file mode 100644 index ccf1bd8..0000000 --- a/shared/dist/submission-runner/cpp.cjs +++ /dev/null @@ -1,207 +0,0 @@ -'use strict'; -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k]; - } - }; - } - Object.defineProperty(o, k2, desc); - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); -var __setModuleDefault = - (this && this.__setModuleDefault) || - (Object.create - ? function (o, v) { - Object.defineProperty(o, 'default', { enumerable: true, value: v }); - } - : function (o, v) { - o['default'] = v; - }); -var __importStar = - (this && this.__importStar) || - function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) - for (var k in mod) - if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator['throw'](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod }; - }; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.runCpp = void 0; -const path_1 = require('path'); -const child_process_1 = require('child_process'); -const util = __importStar(require('util')); -const settings_cjs_1 = require('./settings.cjs'); -const tree_kill_1 = __importDefault(require('tree-kill')); -const os = __importStar(require('os')); -const fs = __importStar(require('fs-extra')); -const execPromise = util.promisify(child_process_1.exec); -const runCpp = function (params) { - return __awaiter(this, void 0, void 0, function* () { - var _a, _b; - const tmpDir = os.tmpdir(); - const buildDir = (0, path_1.join)(tmpDir, 'bwcontest-cpp'); - if (fs.existsSync(buildDir)) { - fs.removeSync(buildDir); - } - fs.mkdirSync(buildDir); - console.log(`- BUILD: ${params.problemName}`); - const configureCommand = `cmake -S ${params.srcDir} -B ${buildDir}`; - try { - yield execPromise(configureCommand); - } catch (e) { - const buildErrorText = - (_a = e === null || e === void 0 ? void 0 : e.toString()) !== null && _a !== void 0 - ? _a - : 'Unknown build errors.'; - console.log('Build errors: ' + buildErrorText); - return { - success: false, - runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } - }; - } - const compileCommand = `cmake --build ${buildDir} --target ${params.problemName}`; - try { - yield execPromise(compileCommand); - } catch (e) { - const buildErrorText = - (_b = e === null || e === void 0 ? void 0 : e.toString()) !== null && _b !== void 0 - ? _b - : 'Unknown build errors.'; - console.log('Build errors: ' + buildErrorText); - return { - success: false, - runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } - }; - } - console.log(`- RUN: ${params.problemName}`); - let runCommand = ''; - if (params.cppPlatform === 'VisualStudio') { - runCommand = `${(0, path_1.join)(buildDir, 'Debug', `${params.problemName}.exe`)}`; - } else { - runCommand = `${(0, path_1.join)(buildDir, params.problemName)}`; - } - try { - let outputBuffer = ''; - const child = (0, child_process_1.spawn)(runCommand, { shell: true }); - child.stdout.setEncoding('utf8'); - child.stdout.on('data', (data) => { - outputBuffer += data.toString(); - }); - child.stderr.setEncoding('utf8'); - child.stderr.on('data', (data) => { - outputBuffer += data.toString(); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on('close', () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: 'Completed', - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds - }); - } else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: 'TimeLimitExceeded', - output: outputBuffer, - resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds` - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log( - `Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...` - ); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - child.kill('SIGKILL'); - }, settings_cjs_1.timeoutSeconds * 1000); - }), - killFunc() { - var _a; - if (child.pid !== undefined) { - if (!completedNormally && !timeLimitExceeded) { - (0, tree_kill_1.default)(child.pid); - (_a = params.outputCallback) === null || _a === void 0 - ? void 0 - : _a.call(params, '\n[Manually stopped]'); - } - } - } - }; - } catch (error) { - return { success: false, runResult: { kind: 'RunError' } }; - } - }); -}; -exports.runCpp = runCpp; -//# sourceMappingURL=cpp.cjs.map diff --git a/shared/dist/submission-runner/cpp.cjs.map b/shared/dist/submission-runner/cpp.cjs.map deleted file mode 100644 index c76fbba..0000000 --- a/shared/dist/submission-runner/cpp.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cpp.cjs","sourceRoot":"","sources":["../../submission-runner/cpp.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B;AAC5B,iDAA4C;AAC5C,2CAA6B;AAE7B,iDAAgD;AAChD,0DAA6B;AAC7B,uCAAyB;AACzB,6CAA+B;AAE/B,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAYlC,MAAM,MAAM,GAA8B,UAChD,MAAwB;;;QAExB,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAC/C,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7B,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC;QACD,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;QAEvB,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAE9C,MAAM,gBAAgB,GAAG,YAAY,MAAM,CAAC,MAAM,OAAO,QAAQ,EAAE,CAAC;QACpE,IAAI,CAAC;YACJ,MAAM,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACrC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACtE,CAAC;QACH,CAAC;QAED,MAAM,cAAc,GAAG,iBAAiB,QAAQ,aAAa,MAAM,CAAC,WAAW,EAAE,CAAC;QAClF,IAAI,CAAC;YACJ,MAAM,WAAW,CAAC,cAAc,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACtE,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAE5C,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,IAAI,MAAM,CAAC,WAAW,KAAK,cAAc,EAAE,CAAC;YAC3C,UAAU,GAAG,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,WAAW,MAAM,CAAC,EAAE,CAAC;QACxE,CAAC;aAAM,CAAC;YACP,UAAU,GAAG,GAAG,IAAA,WAAI,EAAC,QAAQ,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;QACtD,CAAC;QACD,IAAI,CAAC;YACJ,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjC,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACjC,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC7C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACtB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACvB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACP,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACnB,CAAC,CAAC;wBACJ,CAAC;6BAAM,CAAC;4BACP,OAAO,CAAC,GAAG,CAAC,2CAA2C,mBAAmB,IAAI,CAAC,CAAC;4BAChF,OAAO,CAAC;gCACP,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC3D,CAAC,CAAC;wBACJ,CAAC;oBACF,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACrC,IAAI,iBAAiB,EAAE,CAAC;4BACvB,OAAO;wBACR,CAAC;wBAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,6BAAc,8BAA8B,CAAC,CAAC;wBACjF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACvB,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC3B,CAAC,CAAC;gBACF,QAAQ;;oBACP,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC9C,IAAA,mBAAI,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBACjD,CAAC;oBACF,CAAC;gBACF,CAAC;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,CAAC;IACF,CAAC;CAAA,CAAC;AArHW,QAAA,MAAM,UAqHjB"} \ No newline at end of file diff --git a/shared/dist/submission-runner/cpp.d.cts b/shared/dist/submission-runner/cpp.d.cts deleted file mode 100644 index 94c9a6b..0000000 --- a/shared/dist/submission-runner/cpp.d.cts +++ /dev/null @@ -1,12 +0,0 @@ -import type { IRunner, IRunnerParams } from './types.cjs'; -export type CppPlatform = 'VisualStudio' | 'GCC'; -interface IRunnerParamsCpp extends IRunnerParams { - srcDir: string; - problemName: string; - input: string; - cppPlatform: CppPlatform; - outputCallback?: (data: string) => void; -} -export declare const runCpp: IRunner; -export {}; -//# sourceMappingURL=cpp.d.cts.map diff --git a/shared/dist/submission-runner/cpp.d.cts.map b/shared/dist/submission-runner/cpp.d.cts.map deleted file mode 100644 index f559267..0000000 --- a/shared/dist/submission-runner/cpp.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cpp.d.cts","sourceRoot":"","sources":["../../submission-runner/cpp.cts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAA4B,MAAM,aAAa,CAAC;AAQpF,MAAM,MAAM,WAAW,GAAG,cAAc,GAAG,KAAK,CAAC;AAEjD,UAAU,gBAAiB,SAAQ,aAAa;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,WAAW,CAAC;IACzB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAqH5C,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/csharp.cjs b/shared/dist/submission-runner/csharp.cjs deleted file mode 100644 index e30778c..0000000 --- a/shared/dist/submission-runner/csharp.cjs +++ /dev/null @@ -1,129 +0,0 @@ -'use strict'; -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator['throw'](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; -var __importDefault = - (this && this.__importDefault) || - function (mod) { - return mod && mod.__esModule ? mod : { default: mod }; - }; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.runCSharp = void 0; -const child_process_1 = require('child_process'); -const tree_kill_1 = __importDefault(require('tree-kill')); -const settings_cjs_1 = require('./settings.cjs'); -const runCSharp = function (params) { - return __awaiter(this, void 0, void 0, function* () { - console.log(`- RUN: ${params.srcDir}`); - const child = (0, child_process_1.spawn)('dotnet run', { shell: true, cwd: params.srcDir }); - try { - let outputBuffer = ''; - child.stdout.setEncoding('utf8'); - child.stdout.on('data', (data) => { - var _a; - outputBuffer += data.toString(); - (_a = params.outputCallback) === null || _a === void 0 - ? void 0 - : _a.call(params, data.toString()); - }); - child.stderr.setEncoding('utf8'); - child.stderr.on('data', (data) => { - var _a; - outputBuffer += data.toString(); - (_a = params.outputCallback) === null || _a === void 0 - ? void 0 - : _a.call(params, data.toString()); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on('close', () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: 'Completed', - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds - }); - } else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: 'TimeLimitExceeded', - output: outputBuffer, - resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds` - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log( - `Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...` - ); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - if (child.pid !== undefined) { - (0, tree_kill_1.default)(child.pid); - } - }, settings_cjs_1.timeoutSeconds * 1000); - }), - killFunc() { - var _a; - if (child.pid !== undefined) { - if (!completedNormally && !timeLimitExceeded) { - (0, tree_kill_1.default)(child.pid); - (_a = params.outputCallback) === null || _a === void 0 - ? void 0 - : _a.call(params, '\n[Manually stopped]'); - } - } - } - }; - } catch (error) { - return { success: false, runResult: { kind: 'RunError' } }; - } - }); -}; -exports.runCSharp = runCSharp; -//# sourceMappingURL=csharp.cjs.map diff --git a/shared/dist/submission-runner/csharp.cjs.map b/shared/dist/submission-runner/csharp.cjs.map deleted file mode 100644 index f182bb9..0000000 --- a/shared/dist/submission-runner/csharp.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"csharp.cjs","sourceRoot":"","sources":["../../submission-runner/csharp.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAsC;AACtC,0DAA6B;AAE7B,iDAAgD;AAEzC,MAAM,SAAS,GAAY,UAAgB,MAIjD;;QACA,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;QAEvE,IAAI,CAAC;YACJ,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC7C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACtB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACvB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACP,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACnB,CAAC,CAAC;wBACJ,CAAC;6BAAM,CAAC;4BACP,OAAO,CAAC,GAAG,CAAC,2CAA2C,mBAAmB,IAAI,CAAC,CAAC;4BAChF,OAAO,CAAC;gCACP,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC3D,CAAC,CAAC;wBACJ,CAAC;oBACF,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACrC,IAAI,iBAAiB,EAAE,CAAC;4BACvB,OAAO;wBACR,CAAC;wBAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,6BAAc,8BAA8B,CAAC,CAAC;wBACjF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;4BAC7B,IAAA,mBAAI,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBACjB,CAAC;oBACF,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC3B,CAAC,CAAC;gBACF,QAAQ;;oBACP,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC9C,IAAA,mBAAI,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBACjD,CAAC;oBACF,CAAC;gBACF,CAAC;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,CAAC;IACF,CAAC;CAAA,CAAC;AApFW,QAAA,SAAS,aAoFpB"} \ No newline at end of file diff --git a/shared/dist/submission-runner/csharp.d.cts b/shared/dist/submission-runner/csharp.d.cts deleted file mode 100644 index fed9556..0000000 --- a/shared/dist/submission-runner/csharp.d.cts +++ /dev/null @@ -1,3 +0,0 @@ -import type { IRunner } from './types.cjs'; -export declare const runCSharp: IRunner; -//# sourceMappingURL=csharp.d.cts.map diff --git a/shared/dist/submission-runner/csharp.d.cts.map b/shared/dist/submission-runner/csharp.d.cts.map deleted file mode 100644 index 16237ed..0000000 --- a/shared/dist/submission-runner/csharp.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"csharp.d.cts","sourceRoot":"","sources":["../../submission-runner/csharp.cts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAA4B,MAAM,aAAa,CAAC;AAGrE,eAAO,MAAM,SAAS,EAAE,OAoFvB,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/java.cjs b/shared/dist/submission-runner/java.cjs deleted file mode 100644 index bea0bc9..0000000 --- a/shared/dist/submission-runner/java.cjs +++ /dev/null @@ -1,183 +0,0 @@ -'use strict'; -var __createBinding = - (this && this.__createBinding) || - (Object.create - ? function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ('get' in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { - enumerable: true, - get: function () { - return m[k]; - } - }; - } - Object.defineProperty(o, k2, desc); - } - : function (o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; - }); -var __setModuleDefault = - (this && this.__setModuleDefault) || - (Object.create - ? function (o, v) { - Object.defineProperty(o, 'default', { enumerable: true, value: v }); - } - : function (o, v) { - o['default'] = v; - }); -var __importStar = - (this && this.__importStar) || - function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) - for (var k in mod) - if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k)) - __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; - }; -var __awaiter = - (this && this.__awaiter) || - function (thisArg, _arguments, P, generator) { - function adopt(value) { - return value instanceof P - ? value - : new P(function (resolve) { - resolve(value); - }); - } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { - try { - step(generator.next(value)); - } catch (e) { - reject(e); - } - } - function rejected(value) { - try { - step(generator['throw'](value)); - } catch (e) { - reject(e); - } - } - function step(result) { - result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); - } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - }; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.runJava = void 0; -const path_1 = require('path'); -const child_process_1 = require('child_process'); -const util = __importStar(require('util')); -const settings_cjs_1 = require('./settings.cjs'); -const kill = require('tree-kill'); -const execPromise = util.promisify(child_process_1.exec); -const runJava = function (params) { - return __awaiter(this, void 0, void 0, function* () { - var _a; - console.log(`- BUILD: ${params.mainFile}`); - const compileCommand = `javac -cp ${(0, path_1.join)(params.srcDir, 'src')} ${params.mainFile} -d ${(0, path_1.join)(params.srcDir, 'build')}`; - try { - yield execPromise(compileCommand); - } catch (e) { - const buildErrorText = - (_a = e === null || e === void 0 ? void 0 : e.toString()) !== null && _a !== void 0 - ? _a - : 'Unknown build errors.'; - console.log('Build errors: ' + buildErrorText); - return { - success: false, - runResult: { kind: 'CompileFailed', resultKindReason: buildErrorText } - }; - } - console.log(`- RUN: ${params.mainClass}`); - const runCommand = `java -cp "${(0, path_1.join)(params.srcDir, 'build')}" ${params.mainClass}`; - try { - let outputBuffer = ''; - const child = (0, child_process_1.spawn)(runCommand, { shell: true }); - child.stdout.setEncoding('utf8'); - child.stdout.on('data', (data) => { - var _a; - outputBuffer += data.toString(); - (_a = params.outputCallback) === null || _a === void 0 - ? void 0 - : _a.call(params, data.toString()); - }); - child.stderr.setEncoding('utf8'); - child.stderr.on('data', (data) => { - var _a; - outputBuffer += data.toString(); - (_a = params.outputCallback) === null || _a === void 0 - ? void 0 - : _a.call(params, data.toString()); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on('close', () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: 'Completed', - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds - }); - } else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: 'TimeLimitExceeded', - output: outputBuffer, - resultKindReason: `Timeout after ${settings_cjs_1.timeoutSeconds} seconds` - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log( - `Run timed out after ${settings_cjs_1.timeoutSeconds} seconds, killing process...` - ); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - child.kill('SIGKILL'); - }, settings_cjs_1.timeoutSeconds * 1000); - }), - killFunc() { - var _a; - if (child.pid !== undefined) { - if (!completedNormally && !timeLimitExceeded) { - kill(child.pid); - (_a = params.outputCallback) === null || _a === void 0 - ? void 0 - : _a.call(params, '\n[Manually stopped]'); - } - } - } - }; - } catch (error) { - return { success: false, runResult: { kind: 'RunError' } }; - } - }); -}; -exports.runJava = runJava; -//# sourceMappingURL=java.cjs.map diff --git a/shared/dist/submission-runner/java.cjs.map b/shared/dist/submission-runner/java.cjs.map deleted file mode 100644 index 12657ef..0000000 --- a/shared/dist/submission-runner/java.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"java.cjs","sourceRoot":"","sources":["../../submission-runner/java.cts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B;AAC5B,iDAA4C;AAC5C,2CAA6B;AAE7B,iDAAgD;AAEhD,kCAAmC;AAEnC,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAUlC,MAAM,OAAO,GAA+B,UAClD,MAAyB;;;QAEzB,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC3C,MAAM,cAAc,GAAG,aAAa,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,OAAO,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QAEvH,IAAI,CAAC;YACJ,MAAM,WAAW,CAAC,cAAc,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACZ,MAAM,cAAc,GAAG,MAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,QAAQ,EAAE,mCAAI,uBAAuB,CAAC;YAChE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,cAAc,CAAC,CAAC;YAC/C,OAAO;gBACN,OAAO,EAAE,KAAK;gBACd,SAAS,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAE;aACtE,CAAC;QACH,CAAC;QAED,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1C,MAAM,UAAU,GAAG,aAAa,IAAA,WAAI,EAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;QAEpF,IAAI,CAAC;YACJ,IAAI,YAAY,GAAG,EAAE,CAAC;YACtB,MAAM,KAAK,GAAG,IAAA,qBAAK,EAAC,UAAU,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YACjD,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YACH,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YACjC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;;gBAChC,YAAY,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,MAAA,MAAM,CAAC,cAAc,uDAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;YAEH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;YACvC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAChC,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YAElB,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAC9B,IAAI,iBAAiB,GAAG,KAAK,CAAC;YAE9B,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,IAAI,OAAO,CAAY,CAAC,OAAO,EAAE,EAAE;oBAC7C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;wBACtB,iBAAiB,GAAG,CAAC,iBAAiB,CAAC;wBAEvC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;wBACrC,MAAM,mBAAmB,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,YAAY,CAAC,CAAC;wBAElE,IAAI,iBAAiB,EAAE,CAAC;4BACvB,YAAY,CAAC,aAAa,CAAC,CAAC;4BAC5B,OAAO,CAAC;gCACP,IAAI,EAAE,WAAW;gCACjB,MAAM,EAAE,YAAY;gCACpB,QAAQ,EAAE,KAAK,CAAC,QAAS;gCACzB,mBAAmB;6BACnB,CAAC,CAAC;wBACJ,CAAC;6BAAM,CAAC;4BACP,OAAO,CAAC,GAAG,CAAC,2CAA2C,mBAAmB,IAAI,CAAC,CAAC;4BAChF,OAAO,CAAC;gCACP,IAAI,EAAE,mBAAmB;gCACzB,MAAM,EAAE,YAAY;gCACpB,gBAAgB,EAAE,iBAAiB,6BAAc,UAAU;6BAC3D,CAAC,CAAC;wBACJ,CAAC;oBACF,CAAC,CAAC,CAAC;oBAEH,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;wBACrC,IAAI,iBAAiB,EAAE,CAAC;4BACvB,OAAO;wBACR,CAAC;wBAED,OAAO,CAAC,GAAG,CAAC,uBAAuB,6BAAc,8BAA8B,CAAC,CAAC;wBACjF,iBAAiB,GAAG,IAAI,CAAC;wBAEzB,KAAK,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;wBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;wBACtB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;wBACvB,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;oBACvB,CAAC,EAAE,6BAAc,GAAG,IAAI,CAAC,CAAC;gBAC3B,CAAC,CAAC;gBACF,QAAQ;;oBACP,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;wBAC7B,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BAC9C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;4BAChB,MAAA,MAAM,CAAC,cAAc,uDAAG,sBAAsB,CAAC,CAAC;wBACjD,CAAC;oBACF,CAAC;gBACF,CAAC;aACD,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;QAC5D,CAAC;IACF,CAAC;CAAA,CAAC;AA/FW,QAAA,OAAO,WA+FlB"} \ No newline at end of file diff --git a/shared/dist/submission-runner/java.d.cts b/shared/dist/submission-runner/java.d.cts deleted file mode 100644 index 7b95dab..0000000 --- a/shared/dist/submission-runner/java.d.cts +++ /dev/null @@ -1,11 +0,0 @@ -import type { IRunner, IRunnerParams } from './types.cjs'; -interface IRunnerParamsJava extends IRunnerParams { - srcDir: string; - mainFile: string; - mainClass: string; - input: string; - outputCallback?: (data: string) => void; -} -export declare const runJava: IRunner; -export {}; -//# sourceMappingURL=java.d.cts.map diff --git a/shared/dist/submission-runner/java.d.cts.map b/shared/dist/submission-runner/java.d.cts.map deleted file mode 100644 index dc2f69f..0000000 --- a/shared/dist/submission-runner/java.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"java.d.cts","sourceRoot":"","sources":["../../submission-runner/java.cts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAA4B,MAAM,aAAa,CAAC;AAOpF,UAAU,iBAAkB,SAAQ,aAAa;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,iBAAiB,CA+F9C,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/settings.cjs b/shared/dist/submission-runner/settings.cjs deleted file mode 100644 index 1a9089c..0000000 --- a/shared/dist/submission-runner/settings.cjs +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.timeoutSeconds = void 0; -exports.timeoutSeconds = 30; -//# sourceMappingURL=settings.cjs.map diff --git a/shared/dist/submission-runner/settings.cjs.map b/shared/dist/submission-runner/settings.cjs.map deleted file mode 100644 index edfee02..0000000 --- a/shared/dist/submission-runner/settings.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.cjs","sourceRoot":"","sources":["../../submission-runner/settings.cts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG,EAAE,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/settings.d.cts b/shared/dist/submission-runner/settings.d.cts deleted file mode 100644 index 1381f2c..0000000 --- a/shared/dist/submission-runner/settings.d.cts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const timeoutSeconds = 30; -//# sourceMappingURL=settings.d.cts.map diff --git a/shared/dist/submission-runner/settings.d.cts.map b/shared/dist/submission-runner/settings.d.cts.map deleted file mode 100644 index 4df0761..0000000 --- a/shared/dist/submission-runner/settings.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.d.cts","sourceRoot":"","sources":["../../submission-runner/settings.cts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,KAAK,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/types.cjs b/shared/dist/submission-runner/types.cjs deleted file mode 100644 index f70e256..0000000 --- a/shared/dist/submission-runner/types.cjs +++ /dev/null @@ -1,21 +0,0 @@ -'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -exports.RunResultZod = void 0; -const zod_1 = require('zod'); -const RunResultKind = zod_1.z.enum([ - 'CompileFailed', - 'TimeLimitExceeded', - 'Completed', - 'SandboxError', - 'RunError' -]); -exports.RunResultZod = zod_1.z - .object({ - kind: RunResultKind, - output: zod_1.z.string().optional(), - exitCode: zod_1.z.number().optional(), - runtimeMilliseconds: zod_1.z.number().optional(), - resultKindReason: zod_1.z.string().optional() - }) - .strict(); -//# sourceMappingURL=types.cjs.map diff --git a/shared/dist/submission-runner/types.cjs.map b/shared/dist/submission-runner/types.cjs.map deleted file mode 100644 index 92777ba..0000000 --- a/shared/dist/submission-runner/types.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../submission-runner/types.cts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,aAAa,GAAG,OAAC,CAAC,IAAI,CAAC;IAC5B,eAAe;IACf,mBAAmB;IACnB,WAAW;IACX,cAAc;IACd,UAAU;CACV,CAAC,CAAC;AAIU,QAAA,YAAY,GAAG,OAAC;KAC3B,MAAM,CAAC;IACP,IAAI,EAAE,aAAa;IACnB,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC;KACD,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/shared/dist/submission-runner/types.d.cts b/shared/dist/submission-runner/types.d.cts deleted file mode 100644 index c0db0da..0000000 --- a/shared/dist/submission-runner/types.d.cts +++ /dev/null @@ -1,53 +0,0 @@ -import { z } from 'zod'; -declare const RunResultKind: z.ZodEnum< - ['CompileFailed', 'TimeLimitExceeded', 'Completed', 'SandboxError', 'RunError'] ->; -export type RunResultKind = z.infer; -export declare const RunResultZod: z.ZodObject< - { - kind: z.ZodEnum< - ['CompileFailed', 'TimeLimitExceeded', 'Completed', 'SandboxError', 'RunError'] - >; - output: z.ZodOptional; - exitCode: z.ZodOptional; - runtimeMilliseconds: z.ZodOptional; - resultKindReason: z.ZodOptional; - }, - 'strict', - z.ZodTypeAny, - { - kind: 'CompileFailed' | 'TimeLimitExceeded' | 'Completed' | 'SandboxError' | 'RunError'; - output?: string | undefined; - exitCode?: number | undefined; - runtimeMilliseconds?: number | undefined; - resultKindReason?: string | undefined; - }, - { - kind: 'CompileFailed' | 'TimeLimitExceeded' | 'Completed' | 'SandboxError' | 'RunError'; - output?: string | undefined; - exitCode?: number | undefined; - runtimeMilliseconds?: number | undefined; - resultKindReason?: string | undefined; - } ->; -export type RunResult = z.infer; -export interface IRunnerParams { - srcDir: string; - input: string; - outputCallback?: (data: string) => void; -} -export type IRunnerReturn = - | { - success: true; - killFunc: () => void; - runResult: Promise; - } - | { - success: false; - runResult: RunResult; - }; -export type IRunner = ( - params: T -) => Promise; -export {}; -//# sourceMappingURL=types.d.cts.map diff --git a/shared/dist/submission-runner/types.d.cts.map b/shared/dist/submission-runner/types.d.cts.map deleted file mode 100644 index ae81917..0000000 --- a/shared/dist/submission-runner/types.d.cts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../submission-runner/types.cts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,aAAa,4FAMjB,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAE1D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;EAQf,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAErD,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,MAAM,aAAa,GACtB;IAAE,OAAO,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;CAAE,GACtE;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC;AAE5C,MAAM,MAAM,OAAO,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,CAC9D,MAAM,EAAE,CAAC,KACL,OAAO,CAAC,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/shared/dist/tsconfig.tsbuildinfo b/shared/dist/tsconfig.tsbuildinfo index e2af3cb..ec23207 100644 --- a/shared/dist/tsconfig.tsbuildinfo +++ b/shared/dist/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2016.full.d.ts","../node_modules/zod/lib/helpers/typeAliases.d.ts","../node_modules/zod/lib/helpers/util.d.ts","../node_modules/zod/lib/ZodError.d.ts","../node_modules/zod/lib/locales/en.d.ts","../node_modules/zod/lib/errors.d.ts","../node_modules/zod/lib/helpers/parseUtil.d.ts","../node_modules/zod/lib/helpers/enumUtil.d.ts","../node_modules/zod/lib/helpers/errorUtil.d.ts","../node_modules/zod/lib/helpers/partialUtil.d.ts","../node_modules/zod/lib/types.d.ts","../node_modules/zod/lib/external.d.ts","../node_modules/zod/lib/index.d.ts","../node_modules/zod/index.d.ts","../submission-runner/types.cts","../submission-runner/settings.cts","../node_modules/tree-kill/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/jsonfile/index.d.ts","../node_modules/@types/jsonfile/utils.d.ts","../node_modules/@types/fs-extra/index.d.ts","../submission-runner/cpp.cts","../submission-runner/csharp.cts","../submission-runner/java.cts","../types/contestMonitorTypes.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"807e0e0bdc67605dd28efe18f20ab5fcd75d944ef95936120702335f9379094b","5487b97cfa28b26b4a9ef0770f872bdbebd4c46124858de00f242c3eed7519f4","7a01f546ace66019156e4232a1bee2fabc2f8eabeb052473d926ee1693956265","fb53b1c6a6c799b7e3cc2de3fb5c9a1c04a1c60d4380a37792d84c5f8b33933b","8485b6da53ec35637d072e516631d25dae53984500de70a6989058f24354666f","ebe80346928736532e4a822154eb77f57ef3389dbe2b3ba4e571366a15448ef2","c2cb3c8ff388781258ea9ddbcd8a947f751bddd6886e1d3b3ea09ddaa895df80","f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","98a9cc18f661d28e6bd31c436e1984f3980f35e0f0aa9cf795c54f8ccb667ffe","c76b0c5727302341d0bdfa2cc2cee4b19ff185b554edb6e8543f0661d8487116","2a317fff5810a628d205a507998a77521120b462b03d36babf6eb387da991bee","f5ef066942e4f0bd98200aa6a6694b831e73200c9b3ade77ad0aa2409e8fe1b1","b9e99cd94f4166a245f5158f7286c05406e2a4c694619bceb7a4f3519d1d768e","5568d7c32e5cf5f35e092649f4e5e168c3114c800b1d7545b7ae5e0415704802",{"version":"5f48141dfa43072bddf45a657c3b87359e860a61af66d9ed1b4f2a013eb36bf7","signature":"66b8c0ccdd3c78425a0a3404062832b5de907d5d49a4a5972198da37ac7da261"},{"version":"825b3ed6c26f78a78b3a8f650455ebe1e09404801f7d73b460c9734d8a90cccb","signature":"acb8dd08d6b5134cd84c0ac9d62b5cf23ae691fe1cfb8565be2ebe16eca3c03e"},"8323e3f5b91261ed250bd7c6b7aba2aa10f8e1c2ef348297c1f7752a403abebd","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"7fd7fcbf021a5845bdd9397d4649fcf2fe17152d2098140fc723099a215d19ad","affectsGlobalScope":true},"df3389f71a71a38bc931aaf1ef97a65fada98f0a27f19dd12f8b8de2b0f4e461","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"a1d2988ad9d2aef7b9915a22b5e52c165c83a878f2851c35621409046bbe3c05","affectsGlobalScope":true},"bd3f5d05b6b5e4bfcea7739a45f3ffb4a7f4a3442ba7baf93e0200799285b8f1","4c775c2fccabf49483c03cd5e3673f87c1ffb6079d98e7b81089c3def79e29c6","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"674168aa3db414ea0a19b2a31d901b2d49705c7a495e43ffdc96928543010f8c","affectsGlobalScope":true},"fe1fd6afdfe77976d4c702f3746c05fb05a7e566845c890e0e970fe9376d6a90","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","afb1701fd4be413a8a5a88df6befdd4510c30a31372c07a4138facf61594c66d","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"c07146dbbbd8b347241b5df250a51e48f2d7bef19b1e187b1a3f20c849988ff1","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"ae5507fc333d637dec9f37c6b3f4d423105421ea2820a64818de55db85214d66","affectsGlobalScope":true},{"version":"0666f4c99b8688c7be5956df8fecf5d1779d3b22f8f2a88258ae7072c7b6026f","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","54e854615c4eafbdd3fd7688bd02a3aafd0ccf0e87c98f79d3e9109f047ce6b8","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","8221b00f271cf7f535a8eeec03b0f80f0929c7a16116e2d2df089b41066de69b","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","7424817d5eb498771e6d1808d726ec38f75d2eaf3fa359edd5c0c540c52725c1","9a9634296cca836c3308923ba7aa094fa6ed76bb1e366d8ddcf5c65888ab1024",{"version":"bddce945d552a963c9733db106b17a25474eefcab7fc990157a2134ef55d4954","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","4b55240c2a03b2c71e98a7fc528b16136faa762211c92e781a01c37821915ea6","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"94c086dff8dbc5998749326bc69b520e8e4273fb5b7b58b50e0210e0885dfcde","affectsGlobalScope":true},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true},"ebe5facd12fd7745cda5f4bc3319f91fb29dc1f96e57e9c6f8b260a7cc5b67ee","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","37dc027f781c75f0f546e329cfac7cf92a6b289f42458f47a9adc25e516b6839",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","211440ce81e87b3491cdf07155881344b0a61566df6e749acff0be7e8b9d1a07","5d9a0b6e6be8dbb259f64037bce02f34692e8c1519f5cd5d467d7fa4490dced4","880da0e0f3ebca42f9bd1bc2d3e5e7df33f2619d85f18ee0ed4bd16d1800bc32",{"version":"675fe8ad8203245d751a4014b8bc1f1e09f7f97c5f3aae0bd2d4a8528c0aad0f","signature":"82d159f5edb9039c79dbcbf86106ee6b84ba0b8bd4693055843c7bece7f12c17"},{"version":"13ed0b4f30bbbbd5d69f0a283fa35f2d84fe3c0e32144200a5bc560b0d3b1a98","signature":"4d164bb798fb511bf3f7789d3ebc1905a96fc6ede79132c49cc81d5c345704ad"},{"version":"4499adcc0f309c7c9cbe74f8b7025a1c6e892da4953f48027f370d3a1b29627e","signature":"28e13d30e85e06577560d06dcbdb08bcc5758eb3d649592ddef0b9fe1f199135"},"19d2e8aacb34c888cf6917760fbec060f14b84e72801d942d022c4288259949c","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4"],"root":[64,65,[156,159]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./","sourceMap":true,"strict":true,"target":3},"fileIdsList":[[116,152,153,154],[116,144,152],[67],[102],[103,108,136],[104,115,116,123,133,144],[104,105,115,123],[106,145],[107,108,116,124],[108,133,141],[109,111,115,123],[102,110],[111,112],[115],[113,115],[102,115],[115,116,117,133,144],[115,116,117,130,133,136],[100,103,149],[111,115,118,123,133,144],[115,116,118,119,123,133,141,144],[118,120,133,141,144],[67,68,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151],[115,121],[122,144,149],[111,115,123,133],[124],[125],[102,126],[127,143,149],[128],[129],[115,130,131],[130,132,145,147],[103,115,133,134,135,136],[103,133,135],[133,134],[136],[137],[102,133],[115,139,140],[139,140],[108,123,133,141],[142],[123,143],[103,118,129,144],[108,145],[133,146],[122,147],[148],[103,108,115,117,126,133,144,147,149],[133,150],[161,200],[161,185,200],[200],[161],[161,186,200],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199],[186,200],[77,81,144],[77,133,144],[72],[74,77,141,144],[123,141],[152],[72,152],[74,77,123,144],[69,70,73,76,103,115,133,144],[69,75],[73,77,103,136,144,152],[103,152],[93,103,152],[71,72,152],[77],[71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99],[77,84,85],[75,77,85,86],[76],[69,72,77],[77,81,85,86],[81],[75,77,80,144],[69,74,75,77,81,84],[103,133],[72,77,93,103,149,152],[62],[51,52,62],[53,54],[51,52,53,55,56,60],[52,53],[61],[53],[51,52,53,56,57,58,59],[64,65,66,104,124,125,145,155],[64,65,66,104],[64,65,66,104,125,145],[63],[64]],"referencedMap":[[155,1],[153,2],[67,3],[68,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,12],[111,13],[112,13],[114,14],[113,15],[115,16],[116,17],[117,18],[101,19],[118,20],[119,21],[120,22],[152,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,32],[130,33],[131,33],[132,34],[133,35],[135,36],[134,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,51],[150,52],[185,53],[186,54],[161,55],[164,55],[183,53],[184,53],[174,53],[173,56],[171,53],[166,53],[179,53],[177,53],[181,53],[165,53],[178,53],[182,53],[167,53],[168,53],[180,53],[162,53],[169,53],[170,53],[172,53],[176,53],[187,57],[175,53],[163,53],[200,58],[194,57],[196,59],[195,57],[188,57],[189,57],[191,57],[193,57],[197,59],[198,59],[190,59],[192,59],[84,60],[91,61],[83,60],[98,62],[75,63],[74,64],[97,65],[92,66],[95,67],[77,68],[76,69],[72,70],[71,71],[94,72],[73,73],[78,74],[82,74],[100,75],[99,74],[86,76],[87,77],[89,78],[85,79],[88,80],[93,65],[80,81],[81,82],[90,83],[70,84],[96,85],[63,86],[53,87],[55,88],[61,89],[56,90],[59,86],[62,91],[54,92],[60,93],[156,94],[157,95],[158,96],[64,97]],"exportedModulesMap":[[155,1],[153,2],[67,3],[68,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,12],[111,13],[112,13],[114,14],[113,15],[115,16],[116,17],[117,18],[101,19],[118,20],[119,21],[120,22],[152,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,32],[130,33],[131,33],[132,34],[133,35],[135,36],[134,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,51],[150,52],[185,53],[186,54],[161,55],[164,55],[183,53],[184,53],[174,53],[173,56],[171,53],[166,53],[179,53],[177,53],[181,53],[165,53],[178,53],[182,53],[167,53],[168,53],[180,53],[162,53],[169,53],[170,53],[172,53],[176,53],[187,57],[175,53],[163,53],[200,58],[194,57],[196,59],[195,57],[188,57],[189,57],[191,57],[193,57],[197,59],[198,59],[190,59],[192,59],[84,60],[91,61],[83,60],[98,62],[75,63],[74,64],[97,65],[92,66],[95,67],[77,68],[76,69],[72,70],[71,71],[94,72],[73,73],[78,74],[82,74],[100,75],[99,74],[86,76],[87,77],[89,78],[85,79],[88,80],[93,65],[80,81],[81,82],[90,83],[70,84],[96,85],[63,86],[53,87],[55,88],[61,89],[56,90],[59,86],[62,91],[54,92],[60,93],[156,98],[157,98],[158,98],[64,97]],"semanticDiagnosticsPerFile":[155,160,153,154,67,68,102,103,104,105,106,107,108,109,110,111,112,114,113,115,116,117,101,151,118,119,120,152,121,122,123,124,125,126,127,128,129,130,131,132,133,135,134,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,185,186,161,164,183,184,174,173,171,166,179,177,181,165,178,182,167,168,180,162,169,170,172,176,187,175,163,200,199,194,196,195,188,189,191,193,197,198,190,192,66,48,49,8,9,13,12,2,14,15,16,17,18,19,20,21,3,50,22,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,1,47,11,10,84,91,83,98,75,74,97,92,95,77,76,72,71,94,73,78,79,82,69,100,99,86,87,89,85,88,93,80,81,90,70,96,63,53,55,61,57,58,56,59,51,52,62,54,60,156,157,158,65,64,159],"latestChangedDtsFile":"./submission-runner/java.d.cts"},"version":"5.4.2"} \ No newline at end of file +{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2016.full.d.ts","../node_modules/zod/lib/helpers/typealiases.d.ts","../node_modules/zod/lib/helpers/util.d.ts","../node_modules/zod/lib/zoderror.d.ts","../node_modules/zod/lib/locales/en.d.ts","../node_modules/zod/lib/errors.d.ts","../node_modules/zod/lib/helpers/parseutil.d.ts","../node_modules/zod/lib/helpers/enumutil.d.ts","../node_modules/zod/lib/helpers/errorutil.d.ts","../node_modules/zod/lib/helpers/partialutil.d.ts","../node_modules/zod/lib/types.d.ts","../node_modules/zod/lib/external.d.ts","../node_modules/zod/lib/index.d.ts","../node_modules/zod/index.d.ts","../submission-runner/types.cts","../submission-runner/settings.cts","../node_modules/tree-kill/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/jsonfile/index.d.ts","../node_modules/@types/jsonfile/utils.d.ts","../node_modules/@types/fs-extra/index.d.ts","../submission-runner/cpp.cts","../submission-runner/csharp.cts","../submission-runner/java.cts","../types/contestmonitortypes.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"807e0e0bdc67605dd28efe18f20ab5fcd75d944ef95936120702335f9379094b","5487b97cfa28b26b4a9ef0770f872bdbebd4c46124858de00f242c3eed7519f4","7a01f546ace66019156e4232a1bee2fabc2f8eabeb052473d926ee1693956265","fb53b1c6a6c799b7e3cc2de3fb5c9a1c04a1c60d4380a37792d84c5f8b33933b","8485b6da53ec35637d072e516631d25dae53984500de70a6989058f24354666f","ebe80346928736532e4a822154eb77f57ef3389dbe2b3ba4e571366a15448ef2","c2cb3c8ff388781258ea9ddbcd8a947f751bddd6886e1d3b3ea09ddaa895df80","f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","98a9cc18f661d28e6bd31c436e1984f3980f35e0f0aa9cf795c54f8ccb667ffe","c76b0c5727302341d0bdfa2cc2cee4b19ff185b554edb6e8543f0661d8487116","2a317fff5810a628d205a507998a77521120b462b03d36babf6eb387da991bee","f5ef066942e4f0bd98200aa6a6694b831e73200c9b3ade77ad0aa2409e8fe1b1","b9e99cd94f4166a245f5158f7286c05406e2a4c694619bceb7a4f3519d1d768e","5568d7c32e5cf5f35e092649f4e5e168c3114c800b1d7545b7ae5e0415704802","5f48141dfa43072bddf45a657c3b87359e860a61af66d9ed1b4f2a013eb36bf7","825b3ed6c26f78a78b3a8f650455ebe1e09404801f7d73b460c9734d8a90cccb","8323e3f5b91261ed250bd7c6b7aba2aa10f8e1c2ef348297c1f7752a403abebd","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"7fd7fcbf021a5845bdd9397d4649fcf2fe17152d2098140fc723099a215d19ad","affectsGlobalScope":true},"df3389f71a71a38bc931aaf1ef97a65fada98f0a27f19dd12f8b8de2b0f4e461","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"a1d2988ad9d2aef7b9915a22b5e52c165c83a878f2851c35621409046bbe3c05","affectsGlobalScope":true},"bd3f5d05b6b5e4bfcea7739a45f3ffb4a7f4a3442ba7baf93e0200799285b8f1","4c775c2fccabf49483c03cd5e3673f87c1ffb6079d98e7b81089c3def79e29c6","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"674168aa3db414ea0a19b2a31d901b2d49705c7a495e43ffdc96928543010f8c","affectsGlobalScope":true},"fe1fd6afdfe77976d4c702f3746c05fb05a7e566845c890e0e970fe9376d6a90","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","afb1701fd4be413a8a5a88df6befdd4510c30a31372c07a4138facf61594c66d","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"c07146dbbbd8b347241b5df250a51e48f2d7bef19b1e187b1a3f20c849988ff1","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"ae5507fc333d637dec9f37c6b3f4d423105421ea2820a64818de55db85214d66","affectsGlobalScope":true},{"version":"0666f4c99b8688c7be5956df8fecf5d1779d3b22f8f2a88258ae7072c7b6026f","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","54e854615c4eafbdd3fd7688bd02a3aafd0ccf0e87c98f79d3e9109f047ce6b8","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","8221b00f271cf7f535a8eeec03b0f80f0929c7a16116e2d2df089b41066de69b","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","7424817d5eb498771e6d1808d726ec38f75d2eaf3fa359edd5c0c540c52725c1","9a9634296cca836c3308923ba7aa094fa6ed76bb1e366d8ddcf5c65888ab1024",{"version":"bddce945d552a963c9733db106b17a25474eefcab7fc990157a2134ef55d4954","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","4b55240c2a03b2c71e98a7fc528b16136faa762211c92e781a01c37821915ea6","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"94c086dff8dbc5998749326bc69b520e8e4273fb5b7b58b50e0210e0885dfcde","affectsGlobalScope":true},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true},"ebe5facd12fd7745cda5f4bc3319f91fb29dc1f96e57e9c6f8b260a7cc5b67ee","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","37dc027f781c75f0f546e329cfac7cf92a6b289f42458f47a9adc25e516b6839",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","211440ce81e87b3491cdf07155881344b0a61566df6e749acff0be7e8b9d1a07","5d9a0b6e6be8dbb259f64037bce02f34692e8c1519f5cd5d467d7fa4490dced4","880da0e0f3ebca42f9bd1bc2d3e5e7df33f2619d85f18ee0ed4bd16d1800bc32","675fe8ad8203245d751a4014b8bc1f1e09f7f97c5f3aae0bd2d4a8528c0aad0f","13ed0b4f30bbbbd5d69f0a283fa35f2d84fe3c0e32144200a5bc560b0d3b1a98","4499adcc0f309c7c9cbe74f8b7025a1c6e892da4953f48027f370d3a1b29627e","19d2e8aacb34c888cf6917760fbec060f14b84e72801d942d022c4288259949c","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4"],"root":[64,65,[156,159]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./","sourceMap":true,"strict":true,"target":3},"fileIdsList":[[116,152,153,154],[116,144,152],[67],[102],[103,108,136],[104,115,116,123,133,144],[104,105,115,123],[106,145],[107,108,116,124],[108,133,141],[109,111,115,123],[102,110],[111,112],[115],[113,115],[102,115],[115,116,117,133,144],[115,116,117,130,133,136],[100,103,149],[111,115,118,123,133,144],[115,116,118,119,123,133,141,144],[118,120,133,141,144],[67,68,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151],[115,121],[122,144,149],[111,115,123,133],[124],[125],[102,126],[127,143,149],[128],[129],[115,130,131],[130,132,145,147],[103,115,133,134,135,136],[103,133,135],[133,134],[136],[137],[102,133],[115,139,140],[139,140],[108,123,133,141],[142],[123,143],[103,118,129,144],[108,145],[133,146],[122,147],[148],[103,108,115,117,126,133,144,147,149],[133,150],[161,200],[161,185,200],[200],[161],[161,186,200],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199],[186,200],[77,81,144],[77,133,144],[72],[74,77,141,144],[123,141],[152],[72,152],[74,77,123,144],[69,70,73,76,103,115,133,144],[69,75],[73,77,103,136,144,152],[103,152],[93,103,152],[71,72,152],[77],[71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99],[77,84,85],[75,77,85,86],[76],[69,72,77],[77,81,85,86],[81],[75,77,80,144],[69,74,75,77,81,84],[103,133],[72,77,93,103,149,152],[62],[53,54],[51,52,53,55,56,60],[52,53],[61],[53],[51,52,53,56,57,58,59],[51,52,62],[64,65,66,104,124,125,145,155],[64,65,66,104],[64,65,66,104,125,145],[63]],"referencedMap":[[155,1],[153,2],[67,3],[68,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,12],[111,13],[112,13],[114,14],[113,15],[115,16],[116,17],[117,18],[101,19],[118,20],[119,21],[120,22],[152,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,32],[130,33],[131,33],[132,34],[133,35],[135,36],[134,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,51],[150,52],[185,53],[186,54],[161,55],[164,55],[183,53],[184,53],[174,53],[173,56],[171,53],[166,53],[179,53],[177,53],[181,53],[165,53],[178,53],[182,53],[167,53],[168,53],[180,53],[162,53],[169,53],[170,53],[172,53],[176,53],[187,57],[175,53],[163,53],[200,58],[194,57],[196,59],[195,57],[188,57],[189,57],[191,57],[193,57],[197,59],[198,59],[190,59],[192,59],[84,60],[91,61],[83,60],[98,62],[75,63],[74,64],[97,65],[92,66],[95,67],[77,68],[76,69],[72,70],[71,71],[94,72],[73,73],[78,74],[82,74],[100,75],[99,74],[86,76],[87,77],[89,78],[85,79],[88,80],[93,65],[80,81],[81,82],[90,83],[70,84],[96,85],[63,86],[55,87],[61,88],[56,89],[59,86],[62,90],[54,91],[60,92],[53,93],[156,94],[157,95],[158,96],[64,97]],"exportedModulesMap":[[155,1],[153,2],[67,3],[68,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,12],[111,13],[112,13],[114,14],[113,15],[115,16],[116,17],[117,18],[101,19],[118,20],[119,21],[120,22],[152,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,32],[130,33],[131,33],[132,34],[133,35],[135,36],[134,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,51],[150,52],[185,53],[186,54],[161,55],[164,55],[183,53],[184,53],[174,53],[173,56],[171,53],[166,53],[179,53],[177,53],[181,53],[165,53],[178,53],[182,53],[167,53],[168,53],[180,53],[162,53],[169,53],[170,53],[172,53],[176,53],[187,57],[175,53],[163,53],[200,58],[194,57],[196,59],[195,57],[188,57],[189,57],[191,57],[193,57],[197,59],[198,59],[190,59],[192,59],[84,60],[91,61],[83,60],[98,62],[75,63],[74,64],[97,65],[92,66],[95,67],[77,68],[76,69],[72,70],[71,71],[94,72],[73,73],[78,74],[82,74],[100,75],[99,74],[86,76],[87,77],[89,78],[85,79],[88,80],[93,65],[80,81],[81,82],[90,83],[70,84],[96,85],[63,86],[55,87],[61,88],[56,89],[59,86],[62,90],[54,91],[60,92],[53,93],[156,94],[157,95],[158,96],[64,97]],"semanticDiagnosticsPerFile":[155,160,153,154,67,68,102,103,104,105,106,107,108,109,110,111,112,114,113,115,116,117,101,151,118,119,120,152,121,122,123,124,125,126,127,128,129,130,131,132,133,135,134,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,185,186,161,164,183,184,174,173,171,166,179,177,181,165,178,182,167,168,180,162,169,170,172,176,187,175,163,200,199,194,196,195,188,189,191,193,197,198,190,192,66,48,49,8,9,13,12,2,14,15,16,17,18,19,20,21,3,50,22,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,1,47,11,10,84,91,83,98,75,74,97,92,95,77,76,72,71,94,73,78,79,82,69,100,99,86,87,89,85,88,93,80,81,90,70,96,63,55,61,57,58,56,59,51,52,62,54,60,53,156,157,158,65,64,159],"affectedFilesPendingEmit":[156,157,158,65,64],"emitSignatures":[64,65,156,157,158]},"version":"5.4.2"} \ No newline at end of file diff --git a/shared/dist/types.js b/shared/dist/types.js new file mode 100644 index 0000000..49f6477 --- /dev/null +++ b/shared/dist/types.js @@ -0,0 +1,3778 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// submission-runner/types.cts +var types_exports = {}; +__export(types_exports, { + RunResultZod: () => RunResultZod +}); +module.exports = __toCommonJS(types_exports); + +// node_modules/zod/lib/index.mjs +var util; +(function(util2) { + util2.assertEqual = (val) => val; + function assertIs(_arg) { + } + util2.assertIs = assertIs; + function assertNever(_x) { + throw new Error(); + } + util2.assertNever = assertNever; + util2.arrayToEnum = (items) => { + const obj = {}; + for (const item of items) { + obj[item] = item; + } + return obj; + }; + util2.getValidEnumValues = (obj) => { + const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); + const filtered = {}; + for (const k of validKeys) { + filtered[k] = obj[k]; + } + return util2.objectValues(filtered); + }; + util2.objectValues = (obj) => { + return util2.objectKeys(obj).map(function(e) { + return obj[e]; + }); + }; + util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => { + const keys = []; + for (const key in object) { + if (Object.prototype.hasOwnProperty.call(object, key)) { + keys.push(key); + } + } + return keys; + }; + util2.find = (arr, checker) => { + for (const item of arr) { + if (checker(item)) + return item; + } + return void 0; + }; + util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val; + function joinValues(array, separator = " | ") { + return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); + } + util2.joinValues = joinValues; + util2.jsonStringifyReplacer = (_, value) => { + if (typeof value === "bigint") { + return value.toString(); + } + return value; + }; +})(util || (util = {})); +var objectUtil; +(function(objectUtil2) { + objectUtil2.mergeShapes = (first, second) => { + return { + ...first, + ...second + // second overwrites first + }; + }; +})(objectUtil || (objectUtil = {})); +var ZodParsedType = util.arrayToEnum([ + "string", + "nan", + "number", + "integer", + "float", + "boolean", + "date", + "bigint", + "symbol", + "function", + "undefined", + "null", + "array", + "object", + "unknown", + "promise", + "void", + "never", + "map", + "set" +]); +var getParsedType = (data) => { + const t = typeof data; + switch (t) { + case "undefined": + return ZodParsedType.undefined; + case "string": + return ZodParsedType.string; + case "number": + return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number; + case "boolean": + return ZodParsedType.boolean; + case "function": + return ZodParsedType.function; + case "bigint": + return ZodParsedType.bigint; + case "symbol": + return ZodParsedType.symbol; + case "object": + if (Array.isArray(data)) { + return ZodParsedType.array; + } + if (data === null) { + return ZodParsedType.null; + } + if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { + return ZodParsedType.promise; + } + if (typeof Map !== "undefined" && data instanceof Map) { + return ZodParsedType.map; + } + if (typeof Set !== "undefined" && data instanceof Set) { + return ZodParsedType.set; + } + if (typeof Date !== "undefined" && data instanceof Date) { + return ZodParsedType.date; + } + return ZodParsedType.object; + default: + return ZodParsedType.unknown; + } +}; +var ZodIssueCode = util.arrayToEnum([ + "invalid_type", + "invalid_literal", + "custom", + "invalid_union", + "invalid_union_discriminator", + "invalid_enum_value", + "unrecognized_keys", + "invalid_arguments", + "invalid_return_type", + "invalid_date", + "invalid_string", + "too_small", + "too_big", + "invalid_intersection_types", + "not_multiple_of", + "not_finite" +]); +var quotelessJson = (obj) => { + const json = JSON.stringify(obj, null, 2); + return json.replace(/"([^"]+)":/g, "$1:"); +}; +var ZodError = class extends Error { + constructor(issues) { + super(); + this.issues = []; + this.addIssue = (sub) => { + this.issues = [...this.issues, sub]; + }; + this.addIssues = (subs = []) => { + this.issues = [...this.issues, ...subs]; + }; + const actualProto = new.target.prototype; + if (Object.setPrototypeOf) { + Object.setPrototypeOf(this, actualProto); + } else { + this.__proto__ = actualProto; + } + this.name = "ZodError"; + this.issues = issues; + } + get errors() { + return this.issues; + } + format(_mapper) { + const mapper = _mapper || function(issue) { + return issue.message; + }; + const fieldErrors = { _errors: [] }; + const processError = (error) => { + for (const issue of error.issues) { + if (issue.code === "invalid_union") { + issue.unionErrors.map(processError); + } else if (issue.code === "invalid_return_type") { + processError(issue.returnTypeError); + } else if (issue.code === "invalid_arguments") { + processError(issue.argumentsError); + } else if (issue.path.length === 0) { + fieldErrors._errors.push(mapper(issue)); + } else { + let curr = fieldErrors; + let i = 0; + while (i < issue.path.length) { + const el = issue.path[i]; + const terminal = i === issue.path.length - 1; + if (!terminal) { + curr[el] = curr[el] || { _errors: [] }; + } else { + curr[el] = curr[el] || { _errors: [] }; + curr[el]._errors.push(mapper(issue)); + } + curr = curr[el]; + i++; + } + } + } + }; + processError(this); + return fieldErrors; + } + toString() { + return this.message; + } + get message() { + return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2); + } + get isEmpty() { + return this.issues.length === 0; + } + flatten(mapper = (issue) => issue.message) { + const fieldErrors = {}; + const formErrors = []; + for (const sub of this.issues) { + if (sub.path.length > 0) { + fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; + fieldErrors[sub.path[0]].push(mapper(sub)); + } else { + formErrors.push(mapper(sub)); + } + } + return { formErrors, fieldErrors }; + } + get formErrors() { + return this.flatten(); + } +}; +ZodError.create = (issues) => { + const error = new ZodError(issues); + return error; +}; +var errorMap = (issue, _ctx) => { + let message; + switch (issue.code) { + case ZodIssueCode.invalid_type: + if (issue.received === ZodParsedType.undefined) { + message = "Required"; + } else { + message = `Expected ${issue.expected}, received ${issue.received}`; + } + break; + case ZodIssueCode.invalid_literal: + message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`; + break; + case ZodIssueCode.unrecognized_keys: + message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`; + break; + case ZodIssueCode.invalid_union: + message = `Invalid input`; + break; + case ZodIssueCode.invalid_union_discriminator: + message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`; + break; + case ZodIssueCode.invalid_enum_value: + message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`; + break; + case ZodIssueCode.invalid_arguments: + message = `Invalid function arguments`; + break; + case ZodIssueCode.invalid_return_type: + message = `Invalid function return type`; + break; + case ZodIssueCode.invalid_date: + message = `Invalid date`; + break; + case ZodIssueCode.invalid_string: + if (typeof issue.validation === "object") { + if ("includes" in issue.validation) { + message = `Invalid input: must include "${issue.validation.includes}"`; + if (typeof issue.validation.position === "number") { + message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; + } + } else if ("startsWith" in issue.validation) { + message = `Invalid input: must start with "${issue.validation.startsWith}"`; + } else if ("endsWith" in issue.validation) { + message = `Invalid input: must end with "${issue.validation.endsWith}"`; + } else { + util.assertNever(issue.validation); + } + } else if (issue.validation !== "regex") { + message = `Invalid ${issue.validation}`; + } else { + message = "Invalid"; + } + break; + case ZodIssueCode.too_small: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode.too_big: + if (issue.type === "array") + message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; + else if (issue.type === "string") + message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; + else if (issue.type === "number") + message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; + else if (issue.type === "bigint") + message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; + else if (issue.type === "date") + message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`; + else + message = "Invalid input"; + break; + case ZodIssueCode.custom: + message = `Invalid input`; + break; + case ZodIssueCode.invalid_intersection_types: + message = `Intersection results could not be merged`; + break; + case ZodIssueCode.not_multiple_of: + message = `Number must be a multiple of ${issue.multipleOf}`; + break; + case ZodIssueCode.not_finite: + message = "Number must be finite"; + break; + default: + message = _ctx.defaultError; + util.assertNever(issue); + } + return { message }; +}; +var overrideErrorMap = errorMap; +function setErrorMap(map) { + overrideErrorMap = map; +} +function getErrorMap() { + return overrideErrorMap; +} +var makeIssue = (params) => { + const { data, path, errorMaps, issueData } = params; + const fullPath = [...path, ...issueData.path || []]; + const fullIssue = { + ...issueData, + path: fullPath + }; + let errorMessage = ""; + const maps = errorMaps.filter((m) => !!m).slice().reverse(); + for (const map of maps) { + errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; + } + return { + ...issueData, + path: fullPath, + message: issueData.message || errorMessage + }; +}; +var EMPTY_PATH = []; +function addIssueToContext(ctx, issueData) { + const issue = makeIssue({ + issueData, + data: ctx.data, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + getErrorMap(), + errorMap + // then global default map + ].filter((x) => !!x) + }); + ctx.common.issues.push(issue); +} +var ParseStatus = class _ParseStatus { + constructor() { + this.value = "valid"; + } + dirty() { + if (this.value === "valid") + this.value = "dirty"; + } + abort() { + if (this.value !== "aborted") + this.value = "aborted"; + } + static mergeArray(status, results) { + const arrayValue = []; + for (const s of results) { + if (s.status === "aborted") + return INVALID; + if (s.status === "dirty") + status.dirty(); + arrayValue.push(s.value); + } + return { status: status.value, value: arrayValue }; + } + static async mergeObjectAsync(status, pairs) { + const syncPairs = []; + for (const pair of pairs) { + syncPairs.push({ + key: await pair.key, + value: await pair.value + }); + } + return _ParseStatus.mergeObjectSync(status, syncPairs); + } + static mergeObjectSync(status, pairs) { + const finalObject = {}; + for (const pair of pairs) { + const { key, value } = pair; + if (key.status === "aborted") + return INVALID; + if (value.status === "aborted") + return INVALID; + if (key.status === "dirty") + status.dirty(); + if (value.status === "dirty") + status.dirty(); + if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { + finalObject[key.value] = value.value; + } + } + return { status: status.value, value: finalObject }; + } +}; +var INVALID = Object.freeze({ + status: "aborted" +}); +var DIRTY = (value) => ({ status: "dirty", value }); +var OK = (value) => ({ status: "valid", value }); +var isAborted = (x) => x.status === "aborted"; +var isDirty = (x) => x.status === "dirty"; +var isValid = (x) => x.status === "valid"; +var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; +var errorUtil; +(function(errorUtil2) { + errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {}; + errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; +})(errorUtil || (errorUtil = {})); +var ParseInputLazyPath = class { + constructor(parent, value, path, key) { + this._cachedPath = []; + this.parent = parent; + this.data = value; + this._path = path; + this._key = key; + } + get path() { + if (!this._cachedPath.length) { + if (this._key instanceof Array) { + this._cachedPath.push(...this._path, ...this._key); + } else { + this._cachedPath.push(...this._path, this._key); + } + } + return this._cachedPath; + } +}; +var handleResult = (ctx, result) => { + if (isValid(result)) { + return { success: true, data: result.value }; + } else { + if (!ctx.common.issues.length) { + throw new Error("Validation failed but no issues detected."); + } + return { + success: false, + get error() { + if (this._error) + return this._error; + const error = new ZodError(ctx.common.issues); + this._error = error; + return this._error; + } + }; + } +}; +function processCreateParams(params) { + if (!params) + return {}; + const { errorMap: errorMap2, invalid_type_error, required_error, description } = params; + if (errorMap2 && (invalid_type_error || required_error)) { + throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); + } + if (errorMap2) + return { errorMap: errorMap2, description }; + const customMap = (iss, ctx) => { + if (iss.code !== "invalid_type") + return { message: ctx.defaultError }; + if (typeof ctx.data === "undefined") { + return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError }; + } + return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError }; + }; + return { errorMap: customMap, description }; +} +var ZodType = class { + constructor(def) { + this.spa = this.safeParseAsync; + this._def = def; + this.parse = this.parse.bind(this); + this.safeParse = this.safeParse.bind(this); + this.parseAsync = this.parseAsync.bind(this); + this.safeParseAsync = this.safeParseAsync.bind(this); + this.spa = this.spa.bind(this); + this.refine = this.refine.bind(this); + this.refinement = this.refinement.bind(this); + this.superRefine = this.superRefine.bind(this); + this.optional = this.optional.bind(this); + this.nullable = this.nullable.bind(this); + this.nullish = this.nullish.bind(this); + this.array = this.array.bind(this); + this.promise = this.promise.bind(this); + this.or = this.or.bind(this); + this.and = this.and.bind(this); + this.transform = this.transform.bind(this); + this.brand = this.brand.bind(this); + this.default = this.default.bind(this); + this.catch = this.catch.bind(this); + this.describe = this.describe.bind(this); + this.pipe = this.pipe.bind(this); + this.readonly = this.readonly.bind(this); + this.isNullable = this.isNullable.bind(this); + this.isOptional = this.isOptional.bind(this); + } + get description() { + return this._def.description; + } + _getType(input) { + return getParsedType(input.data); + } + _getOrReturnCtx(input, ctx) { + return ctx || { + common: input.parent.common, + data: input.data, + parsedType: getParsedType(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent + }; + } + _processInputParams(input) { + return { + status: new ParseStatus(), + ctx: { + common: input.parent.common, + data: input.data, + parsedType: getParsedType(input.data), + schemaErrorMap: this._def.errorMap, + path: input.path, + parent: input.parent + } + }; + } + _parseSync(input) { + const result = this._parse(input); + if (isAsync(result)) { + throw new Error("Synchronous parse encountered promise."); + } + return result; + } + _parseAsync(input) { + const result = this._parse(input); + return Promise.resolve(result); + } + parse(data, params) { + const result = this.safeParse(data, params); + if (result.success) + return result.data; + throw result.error; + } + safeParse(data, params) { + var _a; + const ctx = { + common: { + issues: [], + async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false, + contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap + }, + path: (params === null || params === void 0 ? void 0 : params.path) || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType(data) + }; + const result = this._parseSync({ data, path: ctx.path, parent: ctx }); + return handleResult(ctx, result); + } + async parseAsync(data, params) { + const result = await this.safeParseAsync(data, params); + if (result.success) + return result.data; + throw result.error; + } + async safeParseAsync(data, params) { + const ctx = { + common: { + issues: [], + contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, + async: true + }, + path: (params === null || params === void 0 ? void 0 : params.path) || [], + schemaErrorMap: this._def.errorMap, + parent: null, + data, + parsedType: getParsedType(data) + }; + const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); + const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); + return handleResult(ctx, result); + } + refine(check, message) { + const getIssueProperties = (val) => { + if (typeof message === "string" || typeof message === "undefined") { + return { message }; + } else if (typeof message === "function") { + return message(val); + } else { + return message; + } + }; + return this._refinement((val, ctx) => { + const result = check(val); + const setError = () => ctx.addIssue({ + code: ZodIssueCode.custom, + ...getIssueProperties(val) + }); + if (typeof Promise !== "undefined" && result instanceof Promise) { + return result.then((data) => { + if (!data) { + setError(); + return false; + } else { + return true; + } + }); + } + if (!result) { + setError(); + return false; + } else { + return true; + } + }); + } + refinement(check, refinementData) { + return this._refinement((val, ctx) => { + if (!check(val)) { + ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); + return false; + } else { + return true; + } + }); + } + _refinement(refinement) { + return new ZodEffects({ + schema: this, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "refinement", refinement } + }); + } + superRefine(refinement) { + return this._refinement(refinement); + } + optional() { + return ZodOptional.create(this, this._def); + } + nullable() { + return ZodNullable.create(this, this._def); + } + nullish() { + return this.nullable().optional(); + } + array() { + return ZodArray.create(this, this._def); + } + promise() { + return ZodPromise.create(this, this._def); + } + or(option) { + return ZodUnion.create([this, option], this._def); + } + and(incoming) { + return ZodIntersection.create(this, incoming, this._def); + } + transform(transform) { + return new ZodEffects({ + ...processCreateParams(this._def), + schema: this, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect: { type: "transform", transform } + }); + } + default(def) { + const defaultValueFunc = typeof def === "function" ? def : () => def; + return new ZodDefault({ + ...processCreateParams(this._def), + innerType: this, + defaultValue: defaultValueFunc, + typeName: ZodFirstPartyTypeKind.ZodDefault + }); + } + brand() { + return new ZodBranded({ + typeName: ZodFirstPartyTypeKind.ZodBranded, + type: this, + ...processCreateParams(this._def) + }); + } + catch(def) { + const catchValueFunc = typeof def === "function" ? def : () => def; + return new ZodCatch({ + ...processCreateParams(this._def), + innerType: this, + catchValue: catchValueFunc, + typeName: ZodFirstPartyTypeKind.ZodCatch + }); + } + describe(description) { + const This = this.constructor; + return new This({ + ...this._def, + description + }); + } + pipe(target) { + return ZodPipeline.create(this, target); + } + readonly() { + return ZodReadonly.create(this); + } + isOptional() { + return this.safeParse(void 0).success; + } + isNullable() { + return this.safeParse(null).success; + } +}; +var cuidRegex = /^c[^\s-]{8,}$/i; +var cuid2Regex = /^[a-z][a-z0-9]*$/; +var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; +var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; +var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; +var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; +var emojiRegex; +var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/; +var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/; +var datetimeRegex = (args) => { + if (args.precision) { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`); + } + } else if (args.precision === 0) { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`); + } + } else { + if (args.offset) { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`); + } else { + return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`); + } + } +}; +function isValidIP(ip, version) { + if ((version === "v4" || !version) && ipv4Regex.test(ip)) { + return true; + } + if ((version === "v6" || !version) && ipv6Regex.test(ip)) { + return true; + } + return false; +} +var ZodString = class _ZodString extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = String(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.string) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext( + ctx2, + { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.string, + received: ctx2.parsedType + } + // + ); + return INVALID; + } + const status = new ParseStatus(); + let ctx = void 0; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.length < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "max") { + if (input.data.length > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: false, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "length") { + const tooBig = input.data.length > check.value; + const tooSmall = input.data.length < check.value; + if (tooBig || tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + if (tooBig) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message + }); + } else if (tooSmall) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "string", + inclusive: true, + exact: true, + message: check.message + }); + } + status.dirty(); + } + } else if (check.kind === "email") { + if (!emailRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "email", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "emoji") { + if (!emojiRegex) { + emojiRegex = new RegExp(_emojiRegex, "u"); + } + if (!emojiRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "emoji", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "uuid") { + if (!uuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "uuid", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "cuid") { + if (!cuidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cuid", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "cuid2") { + if (!cuid2Regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "cuid2", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "ulid") { + if (!ulidRegex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "ulid", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "url") { + try { + new URL(input.data); + } catch (_a) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "url", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "regex") { + check.regex.lastIndex = 0; + const testResult = check.regex.test(input.data); + if (!testResult) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "regex", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "trim") { + input.data = input.data.trim(); + } else if (check.kind === "includes") { + if (!input.data.includes(check.value, check.position)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { includes: check.value, position: check.position }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "toLowerCase") { + input.data = input.data.toLowerCase(); + } else if (check.kind === "toUpperCase") { + input.data = input.data.toUpperCase(); + } else if (check.kind === "startsWith") { + if (!input.data.startsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { startsWith: check.value }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "endsWith") { + if (!input.data.endsWith(check.value)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: { endsWith: check.value }, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "datetime") { + const regex = datetimeRegex(check); + if (!regex.test(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_string, + validation: "datetime", + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "ip") { + if (!isValidIP(input.data, check.version)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + validation: "ip", + code: ZodIssueCode.invalid_string, + message: check.message + }); + status.dirty(); + } + } else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + _regex(regex, validation, message) { + return this.refinement((data) => regex.test(data), { + validation, + code: ZodIssueCode.invalid_string, + ...errorUtil.errToObj(message) + }); + } + _addCheck(check) { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + email(message) { + return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) }); + } + url(message) { + return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) }); + } + emoji(message) { + return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) }); + } + uuid(message) { + return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) }); + } + cuid(message) { + return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) }); + } + cuid2(message) { + return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) }); + } + ulid(message) { + return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) }); + } + ip(options) { + return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) }); + } + datetime(options) { + var _a; + if (typeof options === "string") { + return this._addCheck({ + kind: "datetime", + precision: null, + offset: false, + message: options + }); + } + return this._addCheck({ + kind: "datetime", + precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, + offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false, + ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) + }); + } + regex(regex, message) { + return this._addCheck({ + kind: "regex", + regex, + ...errorUtil.errToObj(message) + }); + } + includes(value, options) { + return this._addCheck({ + kind: "includes", + value, + position: options === null || options === void 0 ? void 0 : options.position, + ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) + }); + } + startsWith(value, message) { + return this._addCheck({ + kind: "startsWith", + value, + ...errorUtil.errToObj(message) + }); + } + endsWith(value, message) { + return this._addCheck({ + kind: "endsWith", + value, + ...errorUtil.errToObj(message) + }); + } + min(minLength, message) { + return this._addCheck({ + kind: "min", + value: minLength, + ...errorUtil.errToObj(message) + }); + } + max(maxLength, message) { + return this._addCheck({ + kind: "max", + value: maxLength, + ...errorUtil.errToObj(message) + }); + } + length(len, message) { + return this._addCheck({ + kind: "length", + value: len, + ...errorUtil.errToObj(message) + }); + } + /** + * @deprecated Use z.string().min(1) instead. + * @see {@link ZodString.min} + */ + nonempty(message) { + return this.min(1, errorUtil.errToObj(message)); + } + trim() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "trim" }] + }); + } + toLowerCase() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toLowerCase" }] + }); + } + toUpperCase() { + return new _ZodString({ + ...this._def, + checks: [...this._def.checks, { kind: "toUpperCase" }] + }); + } + get isDatetime() { + return !!this._def.checks.find((ch) => ch.kind === "datetime"); + } + get isEmail() { + return !!this._def.checks.find((ch) => ch.kind === "email"); + } + get isURL() { + return !!this._def.checks.find((ch) => ch.kind === "url"); + } + get isEmoji() { + return !!this._def.checks.find((ch) => ch.kind === "emoji"); + } + get isUUID() { + return !!this._def.checks.find((ch) => ch.kind === "uuid"); + } + get isCUID() { + return !!this._def.checks.find((ch) => ch.kind === "cuid"); + } + get isCUID2() { + return !!this._def.checks.find((ch) => ch.kind === "cuid2"); + } + get isULID() { + return !!this._def.checks.find((ch) => ch.kind === "ulid"); + } + get isIP() { + return !!this._def.checks.find((ch) => ch.kind === "ip"); + } + get minLength() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxLength() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } +}; +ZodString.create = (params) => { + var _a; + return new ZodString({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodString, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params) + }); +}; +function floatSafeRemainder(val, step) { + const valDecCount = (val.toString().split(".")[1] || "").length; + const stepDecCount = (step.toString().split(".")[1] || "").length; + const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; + const valInt = parseInt(val.toFixed(decCount).replace(".", "")); + const stepInt = parseInt(step.toFixed(decCount).replace(".", "")); + return valInt % stepInt / Math.pow(10, decCount); +} +var ZodNumber = class _ZodNumber extends ZodType { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + this.step = this.multipleOf; + } + _parse(input) { + if (this._def.coerce) { + input.data = Number(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.number) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.number, + received: ctx2.parsedType + }); + return INVALID; + } + let ctx = void 0; + const status = new ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "int") { + if (!util.isInteger(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: "integer", + received: "float", + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "min") { + const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "max") { + const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: check.value, + type: "number", + inclusive: check.inclusive, + exact: false, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "multipleOf") { + if (floatSafeRemainder(input.data, check.value) !== 0) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "finite") { + if (!Number.isFinite(input.data)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_finite, + message: check.message + }); + status.dirty(); + } + } else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new _ZodNumber({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil.toString(message) + } + ] + }); + } + _addCheck(check) { + return new _ZodNumber({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + int(message) { + return this._addCheck({ + kind: "int", + message: errorUtil.toString(message) + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: false, + message: errorUtil.toString(message) + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: false, + message: errorUtil.toString(message) + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: 0, + inclusive: true, + message: errorUtil.toString(message) + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: 0, + inclusive: true, + message: errorUtil.toString(message) + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil.toString(message) + }); + } + finite(message) { + return this._addCheck({ + kind: "finite", + message: errorUtil.toString(message) + }); + } + safe(message) { + return this._addCheck({ + kind: "min", + inclusive: true, + value: Number.MIN_SAFE_INTEGER, + message: errorUtil.toString(message) + })._addCheck({ + kind: "max", + inclusive: true, + value: Number.MAX_SAFE_INTEGER, + message: errorUtil.toString(message) + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } + get isInt() { + return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value)); + } + get isFinite() { + let max = null, min = null; + for (const ch of this._def.checks) { + if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") { + return true; + } else if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } else if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return Number.isFinite(min) && Number.isFinite(max); + } +}; +ZodNumber.create = (params) => { + return new ZodNumber({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodNumber, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params) + }); +}; +var ZodBigInt = class _ZodBigInt extends ZodType { + constructor() { + super(...arguments); + this.min = this.gte; + this.max = this.lte; + } + _parse(input) { + if (this._def.coerce) { + input.data = BigInt(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.bigint) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.bigint, + received: ctx2.parsedType + }); + return INVALID; + } + let ctx = void 0; + const status = new ParseStatus(); + for (const check of this._def.checks) { + if (check.kind === "min") { + const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; + if (tooSmall) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + type: "bigint", + minimum: check.value, + inclusive: check.inclusive, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "max") { + const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; + if (tooBig) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + type: "bigint", + maximum: check.value, + inclusive: check.inclusive, + message: check.message + }); + status.dirty(); + } + } else if (check.kind === "multipleOf") { + if (input.data % check.value !== BigInt(0)) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.not_multiple_of, + multipleOf: check.value, + message: check.message + }); + status.dirty(); + } + } else { + util.assertNever(check); + } + } + return { status: status.value, value: input.data }; + } + gte(value, message) { + return this.setLimit("min", value, true, errorUtil.toString(message)); + } + gt(value, message) { + return this.setLimit("min", value, false, errorUtil.toString(message)); + } + lte(value, message) { + return this.setLimit("max", value, true, errorUtil.toString(message)); + } + lt(value, message) { + return this.setLimit("max", value, false, errorUtil.toString(message)); + } + setLimit(kind, value, inclusive, message) { + return new _ZodBigInt({ + ...this._def, + checks: [ + ...this._def.checks, + { + kind, + value, + inclusive, + message: errorUtil.toString(message) + } + ] + }); + } + _addCheck(check) { + return new _ZodBigInt({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + positive(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: false, + message: errorUtil.toString(message) + }); + } + negative(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: false, + message: errorUtil.toString(message) + }); + } + nonpositive(message) { + return this._addCheck({ + kind: "max", + value: BigInt(0), + inclusive: true, + message: errorUtil.toString(message) + }); + } + nonnegative(message) { + return this._addCheck({ + kind: "min", + value: BigInt(0), + inclusive: true, + message: errorUtil.toString(message) + }); + } + multipleOf(value, message) { + return this._addCheck({ + kind: "multipleOf", + value, + message: errorUtil.toString(message) + }); + } + get minValue() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min; + } + get maxValue() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max; + } +}; +ZodBigInt.create = (params) => { + var _a; + return new ZodBigInt({ + checks: [], + typeName: ZodFirstPartyTypeKind.ZodBigInt, + coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, + ...processCreateParams(params) + }); +}; +var ZodBoolean = class extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = Boolean(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.boolean) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.boolean, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodBoolean.create = (params) => { + return new ZodBoolean({ + typeName: ZodFirstPartyTypeKind.ZodBoolean, + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + ...processCreateParams(params) + }); +}; +var ZodDate = class _ZodDate extends ZodType { + _parse(input) { + if (this._def.coerce) { + input.data = new Date(input.data); + } + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.date) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.date, + received: ctx2.parsedType + }); + return INVALID; + } + if (isNaN(input.data.getTime())) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_date + }); + return INVALID; + } + const status = new ParseStatus(); + let ctx = void 0; + for (const check of this._def.checks) { + if (check.kind === "min") { + if (input.data.getTime() < check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + message: check.message, + inclusive: true, + exact: false, + minimum: check.value, + type: "date" + }); + status.dirty(); + } + } else if (check.kind === "max") { + if (input.data.getTime() > check.value) { + ctx = this._getOrReturnCtx(input, ctx); + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + message: check.message, + inclusive: true, + exact: false, + maximum: check.value, + type: "date" + }); + status.dirty(); + } + } else { + util.assertNever(check); + } + } + return { + status: status.value, + value: new Date(input.data.getTime()) + }; + } + _addCheck(check) { + return new _ZodDate({ + ...this._def, + checks: [...this._def.checks, check] + }); + } + min(minDate, message) { + return this._addCheck({ + kind: "min", + value: minDate.getTime(), + message: errorUtil.toString(message) + }); + } + max(maxDate, message) { + return this._addCheck({ + kind: "max", + value: maxDate.getTime(), + message: errorUtil.toString(message) + }); + } + get minDate() { + let min = null; + for (const ch of this._def.checks) { + if (ch.kind === "min") { + if (min === null || ch.value > min) + min = ch.value; + } + } + return min != null ? new Date(min) : null; + } + get maxDate() { + let max = null; + for (const ch of this._def.checks) { + if (ch.kind === "max") { + if (max === null || ch.value < max) + max = ch.value; + } + } + return max != null ? new Date(max) : null; + } +}; +ZodDate.create = (params) => { + return new ZodDate({ + checks: [], + coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, + typeName: ZodFirstPartyTypeKind.ZodDate, + ...processCreateParams(params) + }); +}; +var ZodSymbol = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.symbol) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.symbol, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodSymbol.create = (params) => { + return new ZodSymbol({ + typeName: ZodFirstPartyTypeKind.ZodSymbol, + ...processCreateParams(params) + }); +}; +var ZodUndefined = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.undefined, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodUndefined.create = (params) => { + return new ZodUndefined({ + typeName: ZodFirstPartyTypeKind.ZodUndefined, + ...processCreateParams(params) + }); +}; +var ZodNull = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.null) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.null, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodNull.create = (params) => { + return new ZodNull({ + typeName: ZodFirstPartyTypeKind.ZodNull, + ...processCreateParams(params) + }); +}; +var ZodAny = class extends ZodType { + constructor() { + super(...arguments); + this._any = true; + } + _parse(input) { + return OK(input.data); + } +}; +ZodAny.create = (params) => { + return new ZodAny({ + typeName: ZodFirstPartyTypeKind.ZodAny, + ...processCreateParams(params) + }); +}; +var ZodUnknown = class extends ZodType { + constructor() { + super(...arguments); + this._unknown = true; + } + _parse(input) { + return OK(input.data); + } +}; +ZodUnknown.create = (params) => { + return new ZodUnknown({ + typeName: ZodFirstPartyTypeKind.ZodUnknown, + ...processCreateParams(params) + }); +}; +var ZodNever = class extends ZodType { + _parse(input) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.never, + received: ctx.parsedType + }); + return INVALID; + } +}; +ZodNever.create = (params) => { + return new ZodNever({ + typeName: ZodFirstPartyTypeKind.ZodNever, + ...processCreateParams(params) + }); +}; +var ZodVoid = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.undefined) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.void, + received: ctx.parsedType + }); + return INVALID; + } + return OK(input.data); + } +}; +ZodVoid.create = (params) => { + return new ZodVoid({ + typeName: ZodFirstPartyTypeKind.ZodVoid, + ...processCreateParams(params) + }); +}; +var ZodArray = class _ZodArray extends ZodType { + _parse(input) { + const { ctx, status } = this._processInputParams(input); + const def = this._def; + if (ctx.parsedType !== ZodParsedType.array) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: ctx.parsedType + }); + return INVALID; + } + if (def.exactLength !== null) { + const tooBig = ctx.data.length > def.exactLength.value; + const tooSmall = ctx.data.length < def.exactLength.value; + if (tooBig || tooSmall) { + addIssueToContext(ctx, { + code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, + minimum: tooSmall ? def.exactLength.value : void 0, + maximum: tooBig ? def.exactLength.value : void 0, + type: "array", + inclusive: true, + exact: true, + message: def.exactLength.message + }); + status.dirty(); + } + } + if (def.minLength !== null) { + if (ctx.data.length < def.minLength.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: def.minLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.minLength.message + }); + status.dirty(); + } + } + if (def.maxLength !== null) { + if (ctx.data.length > def.maxLength.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: def.maxLength.value, + type: "array", + inclusive: true, + exact: false, + message: def.maxLength.message + }); + status.dirty(); + } + } + if (ctx.common.async) { + return Promise.all([...ctx.data].map((item, i) => { + return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); + })).then((result2) => { + return ParseStatus.mergeArray(status, result2); + }); + } + const result = [...ctx.data].map((item, i) => { + return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); + }); + return ParseStatus.mergeArray(status, result); + } + get element() { + return this._def.type; + } + min(minLength, message) { + return new _ZodArray({ + ...this._def, + minLength: { value: minLength, message: errorUtil.toString(message) } + }); + } + max(maxLength, message) { + return new _ZodArray({ + ...this._def, + maxLength: { value: maxLength, message: errorUtil.toString(message) } + }); + } + length(len, message) { + return new _ZodArray({ + ...this._def, + exactLength: { value: len, message: errorUtil.toString(message) } + }); + } + nonempty(message) { + return this.min(1, message); + } +}; +ZodArray.create = (schema, params) => { + return new ZodArray({ + type: schema, + minLength: null, + maxLength: null, + exactLength: null, + typeName: ZodFirstPartyTypeKind.ZodArray, + ...processCreateParams(params) + }); +}; +function deepPartialify(schema) { + if (schema instanceof ZodObject) { + const newShape = {}; + for (const key in schema.shape) { + const fieldSchema = schema.shape[key]; + newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); + } + return new ZodObject({ + ...schema._def, + shape: () => newShape + }); + } else if (schema instanceof ZodArray) { + return new ZodArray({ + ...schema._def, + type: deepPartialify(schema.element) + }); + } else if (schema instanceof ZodOptional) { + return ZodOptional.create(deepPartialify(schema.unwrap())); + } else if (schema instanceof ZodNullable) { + return ZodNullable.create(deepPartialify(schema.unwrap())); + } else if (schema instanceof ZodTuple) { + return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); + } else { + return schema; + } +} +var ZodObject = class _ZodObject extends ZodType { + constructor() { + super(...arguments); + this._cached = null; + this.nonstrict = this.passthrough; + this.augment = this.extend; + } + _getCached() { + if (this._cached !== null) + return this._cached; + const shape = this._def.shape(); + const keys = util.objectKeys(shape); + return this._cached = { shape, keys }; + } + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.object) { + const ctx2 = this._getOrReturnCtx(input); + addIssueToContext(ctx2, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx2.parsedType + }); + return INVALID; + } + const { status, ctx } = this._processInputParams(input); + const { shape, keys: shapeKeys } = this._getCached(); + const extraKeys = []; + if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { + for (const key in ctx.data) { + if (!shapeKeys.includes(key)) { + extraKeys.push(key); + } + } + } + const pairs = []; + for (const key of shapeKeys) { + const keyValidator = shape[key]; + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), + alwaysSet: key in ctx.data + }); + } + if (this._def.catchall instanceof ZodNever) { + const unknownKeys = this._def.unknownKeys; + if (unknownKeys === "passthrough") { + for (const key of extraKeys) { + pairs.push({ + key: { status: "valid", value: key }, + value: { status: "valid", value: ctx.data[key] } + }); + } + } else if (unknownKeys === "strict") { + if (extraKeys.length > 0) { + addIssueToContext(ctx, { + code: ZodIssueCode.unrecognized_keys, + keys: extraKeys + }); + status.dirty(); + } + } else if (unknownKeys === "strip") + ; + else { + throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); + } + } else { + const catchall = this._def.catchall; + for (const key of extraKeys) { + const value = ctx.data[key]; + pairs.push({ + key: { status: "valid", value: key }, + value: catchall._parse( + new ParseInputLazyPath(ctx, value, ctx.path, key) + //, ctx.child(key), value, getParsedType(value) + ), + alwaysSet: key in ctx.data + }); + } + } + if (ctx.common.async) { + return Promise.resolve().then(async () => { + const syncPairs = []; + for (const pair of pairs) { + const key = await pair.key; + syncPairs.push({ + key, + value: await pair.value, + alwaysSet: pair.alwaysSet + }); + } + return syncPairs; + }).then((syncPairs) => { + return ParseStatus.mergeObjectSync(status, syncPairs); + }); + } else { + return ParseStatus.mergeObjectSync(status, pairs); + } + } + get shape() { + return this._def.shape(); + } + strict(message) { + errorUtil.errToObj; + return new _ZodObject({ + ...this._def, + unknownKeys: "strict", + ...message !== void 0 ? { + errorMap: (issue, ctx) => { + var _a, _b, _c, _d; + const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError; + if (issue.code === "unrecognized_keys") + return { + message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError + }; + return { + message: defaultError + }; + } + } : {} + }); + } + strip() { + return new _ZodObject({ + ...this._def, + unknownKeys: "strip" + }); + } + passthrough() { + return new _ZodObject({ + ...this._def, + unknownKeys: "passthrough" + }); + } + // const AugmentFactory = + // (def: Def) => + // ( + // augmentation: Augmentation + // ): ZodObject< + // extendShape, Augmentation>, + // Def["unknownKeys"], + // Def["catchall"] + // > => { + // return new ZodObject({ + // ...def, + // shape: () => ({ + // ...def.shape(), + // ...augmentation, + // }), + // }) as any; + // }; + extend(augmentation) { + return new _ZodObject({ + ...this._def, + shape: () => ({ + ...this._def.shape(), + ...augmentation + }) + }); + } + /** + * Prior to zod@1.0.12 there was a bug in the + * inferred type of merged objects. Please + * upgrade if you are experiencing issues. + */ + merge(merging) { + const merged = new _ZodObject({ + unknownKeys: merging._def.unknownKeys, + catchall: merging._def.catchall, + shape: () => ({ + ...this._def.shape(), + ...merging._def.shape() + }), + typeName: ZodFirstPartyTypeKind.ZodObject + }); + return merged; + } + // merge< + // Incoming extends AnyZodObject, + // Augmentation extends Incoming["shape"], + // NewOutput extends { + // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation + // ? Augmentation[k]["_output"] + // : k extends keyof Output + // ? Output[k] + // : never; + // }, + // NewInput extends { + // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation + // ? Augmentation[k]["_input"] + // : k extends keyof Input + // ? Input[k] + // : never; + // } + // >( + // merging: Incoming + // ): ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"], + // NewOutput, + // NewInput + // > { + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + setKey(key, schema) { + return this.augment({ [key]: schema }); + } + // merge( + // merging: Incoming + // ): //ZodObject = (merging) => { + // ZodObject< + // extendShape>, + // Incoming["_def"]["unknownKeys"], + // Incoming["_def"]["catchall"] + // > { + // // const mergedShape = objectUtil.mergeShapes( + // // this._def.shape(), + // // merging._def.shape() + // // ); + // const merged: any = new ZodObject({ + // unknownKeys: merging._def.unknownKeys, + // catchall: merging._def.catchall, + // shape: () => + // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), + // typeName: ZodFirstPartyTypeKind.ZodObject, + // }) as any; + // return merged; + // } + catchall(index) { + return new _ZodObject({ + ...this._def, + catchall: index + }); + } + pick(mask) { + const shape = {}; + util.objectKeys(mask).forEach((key) => { + if (mask[key] && this.shape[key]) { + shape[key] = this.shape[key]; + } + }); + return new _ZodObject({ + ...this._def, + shape: () => shape + }); + } + omit(mask) { + const shape = {}; + util.objectKeys(this.shape).forEach((key) => { + if (!mask[key]) { + shape[key] = this.shape[key]; + } + }); + return new _ZodObject({ + ...this._def, + shape: () => shape + }); + } + /** + * @deprecated + */ + deepPartial() { + return deepPartialify(this); + } + partial(mask) { + const newShape = {}; + util.objectKeys(this.shape).forEach((key) => { + const fieldSchema = this.shape[key]; + if (mask && !mask[key]) { + newShape[key] = fieldSchema; + } else { + newShape[key] = fieldSchema.optional(); + } + }); + return new _ZodObject({ + ...this._def, + shape: () => newShape + }); + } + required(mask) { + const newShape = {}; + util.objectKeys(this.shape).forEach((key) => { + if (mask && !mask[key]) { + newShape[key] = this.shape[key]; + } else { + const fieldSchema = this.shape[key]; + let newField = fieldSchema; + while (newField instanceof ZodOptional) { + newField = newField._def.innerType; + } + newShape[key] = newField; + } + }); + return new _ZodObject({ + ...this._def, + shape: () => newShape + }); + } + keyof() { + return createZodEnum(util.objectKeys(this.shape)); + } +}; +ZodObject.create = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params) + }); +}; +ZodObject.strictCreate = (shape, params) => { + return new ZodObject({ + shape: () => shape, + unknownKeys: "strict", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params) + }); +}; +ZodObject.lazycreate = (shape, params) => { + return new ZodObject({ + shape, + unknownKeys: "strip", + catchall: ZodNever.create(), + typeName: ZodFirstPartyTypeKind.ZodObject, + ...processCreateParams(params) + }); +}; +var ZodUnion = class extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const options = this._def.options; + function handleResults(results) { + for (const result of results) { + if (result.result.status === "valid") { + return result.result; + } + } + for (const result of results) { + if (result.result.status === "dirty") { + ctx.common.issues.push(...result.ctx.common.issues); + return result.result; + } + } + const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues)); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union, + unionErrors + }); + return INVALID; + } + if (ctx.common.async) { + return Promise.all(options.map(async (option) => { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [] + }, + parent: null + }; + return { + result: await option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: childCtx + }), + ctx: childCtx + }; + })).then(handleResults); + } else { + let dirty = void 0; + const issues = []; + for (const option of options) { + const childCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [] + }, + parent: null + }; + const result = option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: childCtx + }); + if (result.status === "valid") { + return result; + } else if (result.status === "dirty" && !dirty) { + dirty = { result, ctx: childCtx }; + } + if (childCtx.common.issues.length) { + issues.push(childCtx.common.issues); + } + } + if (dirty) { + ctx.common.issues.push(...dirty.ctx.common.issues); + return dirty.result; + } + const unionErrors = issues.map((issues2) => new ZodError(issues2)); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union, + unionErrors + }); + return INVALID; + } + } + get options() { + return this._def.options; + } +}; +ZodUnion.create = (types, params) => { + return new ZodUnion({ + options: types, + typeName: ZodFirstPartyTypeKind.ZodUnion, + ...processCreateParams(params) + }); +}; +var getDiscriminator = (type) => { + if (type instanceof ZodLazy) { + return getDiscriminator(type.schema); + } else if (type instanceof ZodEffects) { + return getDiscriminator(type.innerType()); + } else if (type instanceof ZodLiteral) { + return [type.value]; + } else if (type instanceof ZodEnum) { + return type.options; + } else if (type instanceof ZodNativeEnum) { + return Object.keys(type.enum); + } else if (type instanceof ZodDefault) { + return getDiscriminator(type._def.innerType); + } else if (type instanceof ZodUndefined) { + return [void 0]; + } else if (type instanceof ZodNull) { + return [null]; + } else { + return null; + } +}; +var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.object) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType + }); + return INVALID; + } + const discriminator = this.discriminator; + const discriminatorValue = ctx.data[discriminator]; + const option = this.optionsMap.get(discriminatorValue); + if (!option) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_union_discriminator, + options: Array.from(this.optionsMap.keys()), + path: [discriminator] + }); + return INVALID; + } + if (ctx.common.async) { + return option._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + } else { + return option._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + } + } + get discriminator() { + return this._def.discriminator; + } + get options() { + return this._def.options; + } + get optionsMap() { + return this._def.optionsMap; + } + /** + * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. + * However, it only allows a union of objects, all of which need to share a discriminator property. This property must + * have a different value for each object in the union. + * @param discriminator the name of the discriminator property + * @param types an array of object schemas + * @param params + */ + static create(discriminator, options, params) { + const optionsMap = /* @__PURE__ */ new Map(); + for (const type of options) { + const discriminatorValues = getDiscriminator(type.shape[discriminator]); + if (!discriminatorValues) { + throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); + } + for (const value of discriminatorValues) { + if (optionsMap.has(value)) { + throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); + } + optionsMap.set(value, type); + } + } + return new _ZodDiscriminatedUnion({ + typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, + discriminator, + options, + optionsMap, + ...processCreateParams(params) + }); + } +}; +function mergeValues(a, b) { + const aType = getParsedType(a); + const bType = getParsedType(b); + if (a === b) { + return { valid: true, data: a }; + } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { + const bKeys = util.objectKeys(b); + const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1); + const newObj = { ...a, ...b }; + for (const key of sharedKeys) { + const sharedValue = mergeValues(a[key], b[key]); + if (!sharedValue.valid) { + return { valid: false }; + } + newObj[key] = sharedValue.data; + } + return { valid: true, data: newObj }; + } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { + if (a.length !== b.length) { + return { valid: false }; + } + const newArray = []; + for (let index = 0; index < a.length; index++) { + const itemA = a[index]; + const itemB = b[index]; + const sharedValue = mergeValues(itemA, itemB); + if (!sharedValue.valid) { + return { valid: false }; + } + newArray.push(sharedValue.data); + } + return { valid: true, data: newArray }; + } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) { + return { valid: true, data: a }; + } else { + return { valid: false }; + } +} +var ZodIntersection = class extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const handleParsed = (parsedLeft, parsedRight) => { + if (isAborted(parsedLeft) || isAborted(parsedRight)) { + return INVALID; + } + const merged = mergeValues(parsedLeft.value, parsedRight.value); + if (!merged.valid) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_intersection_types + }); + return INVALID; + } + if (isDirty(parsedLeft) || isDirty(parsedRight)) { + status.dirty(); + } + return { status: status.value, value: merged.data }; + }; + if (ctx.common.async) { + return Promise.all([ + this._def.left._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }), + this._def.right._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }) + ]).then(([left, right]) => handleParsed(left, right)); + } else { + return handleParsed(this._def.left._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }), this._def.right._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + })); + } + } +}; +ZodIntersection.create = (left, right, params) => { + return new ZodIntersection({ + left, + right, + typeName: ZodFirstPartyTypeKind.ZodIntersection, + ...processCreateParams(params) + }); +}; +var ZodTuple = class _ZodTuple extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.array) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.array, + received: ctx.parsedType + }); + return INVALID; + } + if (ctx.data.length < this._def.items.length) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: this._def.items.length, + inclusive: true, + exact: false, + type: "array" + }); + return INVALID; + } + const rest = this._def.rest; + if (!rest && ctx.data.length > this._def.items.length) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: this._def.items.length, + inclusive: true, + exact: false, + type: "array" + }); + status.dirty(); + } + const items = [...ctx.data].map((item, itemIndex) => { + const schema = this._def.items[itemIndex] || this._def.rest; + if (!schema) + return null; + return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); + }).filter((x) => !!x); + if (ctx.common.async) { + return Promise.all(items).then((results) => { + return ParseStatus.mergeArray(status, results); + }); + } else { + return ParseStatus.mergeArray(status, items); + } + } + get items() { + return this._def.items; + } + rest(rest) { + return new _ZodTuple({ + ...this._def, + rest + }); + } +}; +ZodTuple.create = (schemas, params) => { + if (!Array.isArray(schemas)) { + throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); + } + return new ZodTuple({ + items: schemas, + typeName: ZodFirstPartyTypeKind.ZodTuple, + rest: null, + ...processCreateParams(params) + }); +}; +var ZodRecord = class _ZodRecord extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.object) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.object, + received: ctx.parsedType + }); + return INVALID; + } + const pairs = []; + const keyType = this._def.keyType; + const valueType = this._def.valueType; + for (const key in ctx.data) { + pairs.push({ + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), + value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)) + }); + } + if (ctx.common.async) { + return ParseStatus.mergeObjectAsync(status, pairs); + } else { + return ParseStatus.mergeObjectSync(status, pairs); + } + } + get element() { + return this._def.valueType; + } + static create(first, second, third) { + if (second instanceof ZodType) { + return new _ZodRecord({ + keyType: first, + valueType: second, + typeName: ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(third) + }); + } + return new _ZodRecord({ + keyType: ZodString.create(), + valueType: first, + typeName: ZodFirstPartyTypeKind.ZodRecord, + ...processCreateParams(second) + }); + } +}; +var ZodMap = class extends ZodType { + get keySchema() { + return this._def.keyType; + } + get valueSchema() { + return this._def.valueType; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.map) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.map, + received: ctx.parsedType + }); + return INVALID; + } + const keyType = this._def.keyType; + const valueType = this._def.valueType; + const pairs = [...ctx.data.entries()].map(([key, value], index) => { + return { + key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])), + value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])) + }; + }); + if (ctx.common.async) { + const finalMap = /* @__PURE__ */ new Map(); + return Promise.resolve().then(async () => { + for (const pair of pairs) { + const key = await pair.key; + const value = await pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return INVALID; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + }); + } else { + const finalMap = /* @__PURE__ */ new Map(); + for (const pair of pairs) { + const key = pair.key; + const value = pair.value; + if (key.status === "aborted" || value.status === "aborted") { + return INVALID; + } + if (key.status === "dirty" || value.status === "dirty") { + status.dirty(); + } + finalMap.set(key.value, value.value); + } + return { status: status.value, value: finalMap }; + } + } +}; +ZodMap.create = (keyType, valueType, params) => { + return new ZodMap({ + valueType, + keyType, + typeName: ZodFirstPartyTypeKind.ZodMap, + ...processCreateParams(params) + }); +}; +var ZodSet = class _ZodSet extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.set) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.set, + received: ctx.parsedType + }); + return INVALID; + } + const def = this._def; + if (def.minSize !== null) { + if (ctx.data.size < def.minSize.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_small, + minimum: def.minSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.minSize.message + }); + status.dirty(); + } + } + if (def.maxSize !== null) { + if (ctx.data.size > def.maxSize.value) { + addIssueToContext(ctx, { + code: ZodIssueCode.too_big, + maximum: def.maxSize.value, + type: "set", + inclusive: true, + exact: false, + message: def.maxSize.message + }); + status.dirty(); + } + } + const valueType = this._def.valueType; + function finalizeSet(elements2) { + const parsedSet = /* @__PURE__ */ new Set(); + for (const element of elements2) { + if (element.status === "aborted") + return INVALID; + if (element.status === "dirty") + status.dirty(); + parsedSet.add(element.value); + } + return { status: status.value, value: parsedSet }; + } + const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); + if (ctx.common.async) { + return Promise.all(elements).then((elements2) => finalizeSet(elements2)); + } else { + return finalizeSet(elements); + } + } + min(minSize, message) { + return new _ZodSet({ + ...this._def, + minSize: { value: minSize, message: errorUtil.toString(message) } + }); + } + max(maxSize, message) { + return new _ZodSet({ + ...this._def, + maxSize: { value: maxSize, message: errorUtil.toString(message) } + }); + } + size(size, message) { + return this.min(size, message).max(size, message); + } + nonempty(message) { + return this.min(1, message); + } +}; +ZodSet.create = (valueType, params) => { + return new ZodSet({ + valueType, + minSize: null, + maxSize: null, + typeName: ZodFirstPartyTypeKind.ZodSet, + ...processCreateParams(params) + }); +}; +var ZodFunction = class _ZodFunction extends ZodType { + constructor() { + super(...arguments); + this.validate = this.implement; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.function) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.function, + received: ctx.parsedType + }); + return INVALID; + } + function makeArgsIssue(args, error) { + return makeIssue({ + data: args, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + getErrorMap(), + errorMap + ].filter((x) => !!x), + issueData: { + code: ZodIssueCode.invalid_arguments, + argumentsError: error + } + }); + } + function makeReturnsIssue(returns, error) { + return makeIssue({ + data: returns, + path: ctx.path, + errorMaps: [ + ctx.common.contextualErrorMap, + ctx.schemaErrorMap, + getErrorMap(), + errorMap + ].filter((x) => !!x), + issueData: { + code: ZodIssueCode.invalid_return_type, + returnTypeError: error + } + }); + } + const params = { errorMap: ctx.common.contextualErrorMap }; + const fn = ctx.data; + if (this._def.returns instanceof ZodPromise) { + const me = this; + return OK(async function(...args) { + const error = new ZodError([]); + const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => { + error.addIssue(makeArgsIssue(args, e)); + throw error; + }); + const result = await Reflect.apply(fn, this, parsedArgs); + const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => { + error.addIssue(makeReturnsIssue(result, e)); + throw error; + }); + return parsedReturns; + }); + } else { + const me = this; + return OK(function(...args) { + const parsedArgs = me._def.args.safeParse(args, params); + if (!parsedArgs.success) { + throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); + } + const result = Reflect.apply(fn, this, parsedArgs.data); + const parsedReturns = me._def.returns.safeParse(result, params); + if (!parsedReturns.success) { + throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]); + } + return parsedReturns.data; + }); + } + } + parameters() { + return this._def.args; + } + returnType() { + return this._def.returns; + } + args(...items) { + return new _ZodFunction({ + ...this._def, + args: ZodTuple.create(items).rest(ZodUnknown.create()) + }); + } + returns(returnType) { + return new _ZodFunction({ + ...this._def, + returns: returnType + }); + } + implement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + strictImplement(func) { + const validatedFunc = this.parse(func); + return validatedFunc; + } + static create(args, returns, params) { + return new _ZodFunction({ + args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), + returns: returns || ZodUnknown.create(), + typeName: ZodFirstPartyTypeKind.ZodFunction, + ...processCreateParams(params) + }); + } +}; +var ZodLazy = class extends ZodType { + get schema() { + return this._def.getter(); + } + _parse(input) { + const { ctx } = this._processInputParams(input); + const lazySchema = this._def.getter(); + return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); + } +}; +ZodLazy.create = (getter, params) => { + return new ZodLazy({ + getter, + typeName: ZodFirstPartyTypeKind.ZodLazy, + ...processCreateParams(params) + }); +}; +var ZodLiteral = class extends ZodType { + _parse(input) { + if (input.data !== this._def.value) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_literal, + expected: this._def.value + }); + return INVALID; + } + return { status: "valid", value: input.data }; + } + get value() { + return this._def.value; + } +}; +ZodLiteral.create = (value, params) => { + return new ZodLiteral({ + value, + typeName: ZodFirstPartyTypeKind.ZodLiteral, + ...processCreateParams(params) + }); +}; +function createZodEnum(values, params) { + return new ZodEnum({ + values, + typeName: ZodFirstPartyTypeKind.ZodEnum, + ...processCreateParams(params) + }); +} +var ZodEnum = class _ZodEnum extends ZodType { + _parse(input) { + if (typeof input.data !== "string") { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext(ctx, { + expected: util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode.invalid_type + }); + return INVALID; + } + if (this._def.values.indexOf(input.data) === -1) { + const ctx = this._getOrReturnCtx(input); + const expectedValues = this._def.values; + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_enum_value, + options: expectedValues + }); + return INVALID; + } + return OK(input.data); + } + get options() { + return this._def.values; + } + get enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Values() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + get Enum() { + const enumValues = {}; + for (const val of this._def.values) { + enumValues[val] = val; + } + return enumValues; + } + extract(values) { + return _ZodEnum.create(values); + } + exclude(values) { + return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt))); + } +}; +ZodEnum.create = createZodEnum; +var ZodNativeEnum = class extends ZodType { + _parse(input) { + const nativeEnumValues = util.getValidEnumValues(this._def.values); + const ctx = this._getOrReturnCtx(input); + if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { + const expectedValues = util.objectValues(nativeEnumValues); + addIssueToContext(ctx, { + expected: util.joinValues(expectedValues), + received: ctx.parsedType, + code: ZodIssueCode.invalid_type + }); + return INVALID; + } + if (nativeEnumValues.indexOf(input.data) === -1) { + const expectedValues = util.objectValues(nativeEnumValues); + addIssueToContext(ctx, { + received: ctx.data, + code: ZodIssueCode.invalid_enum_value, + options: expectedValues + }); + return INVALID; + } + return OK(input.data); + } + get enum() { + return this._def.values; + } +}; +ZodNativeEnum.create = (values, params) => { + return new ZodNativeEnum({ + values, + typeName: ZodFirstPartyTypeKind.ZodNativeEnum, + ...processCreateParams(params) + }); +}; +var ZodPromise = class extends ZodType { + unwrap() { + return this._def.type; + } + _parse(input) { + const { ctx } = this._processInputParams(input); + if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.promise, + received: ctx.parsedType + }); + return INVALID; + } + const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); + return OK(promisified.then((data) => { + return this._def.type.parseAsync(data, { + path: ctx.path, + errorMap: ctx.common.contextualErrorMap + }); + })); + } +}; +ZodPromise.create = (schema, params) => { + return new ZodPromise({ + type: schema, + typeName: ZodFirstPartyTypeKind.ZodPromise, + ...processCreateParams(params) + }); +}; +var ZodEffects = class extends ZodType { + innerType() { + return this._def.schema; + } + sourceType() { + return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; + } + _parse(input) { + const { status, ctx } = this._processInputParams(input); + const effect = this._def.effect || null; + const checkCtx = { + addIssue: (arg) => { + addIssueToContext(ctx, arg); + if (arg.fatal) { + status.abort(); + } else { + status.dirty(); + } + }, + get path() { + return ctx.path; + } + }; + checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); + if (effect.type === "preprocess") { + const processed = effect.transform(ctx.data, checkCtx); + if (ctx.common.issues.length) { + return { + status: "dirty", + value: ctx.data + }; + } + if (ctx.common.async) { + return Promise.resolve(processed).then((processed2) => { + return this._def.schema._parseAsync({ + data: processed2, + path: ctx.path, + parent: ctx + }); + }); + } else { + return this._def.schema._parseSync({ + data: processed, + path: ctx.path, + parent: ctx + }); + } + } + if (effect.type === "refinement") { + const executeRefinement = (acc) => { + const result = effect.refinement(acc, checkCtx); + if (ctx.common.async) { + return Promise.resolve(result); + } + if (result instanceof Promise) { + throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); + } + return acc; + }; + if (ctx.common.async === false) { + const inner = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inner.status === "aborted") + return INVALID; + if (inner.status === "dirty") + status.dirty(); + executeRefinement(inner.value); + return { status: status.value, value: inner.value }; + } else { + return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => { + if (inner.status === "aborted") + return INVALID; + if (inner.status === "dirty") + status.dirty(); + return executeRefinement(inner.value).then(() => { + return { status: status.value, value: inner.value }; + }); + }); + } + } + if (effect.type === "transform") { + if (ctx.common.async === false) { + const base = this._def.schema._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (!isValid(base)) + return base; + const result = effect.transform(base.value, checkCtx); + if (result instanceof Promise) { + throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); + } + return { status: status.value, value: result }; + } else { + return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => { + if (!isValid(base)) + return base; + return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result })); + }); + } + } + util.assertNever(effect); + } +}; +ZodEffects.create = (schema, effect, params) => { + return new ZodEffects({ + schema, + typeName: ZodFirstPartyTypeKind.ZodEffects, + effect, + ...processCreateParams(params) + }); +}; +ZodEffects.createWithPreprocess = (preprocess, schema, params) => { + return new ZodEffects({ + schema, + effect: { type: "preprocess", transform: preprocess }, + typeName: ZodFirstPartyTypeKind.ZodEffects, + ...processCreateParams(params) + }); +}; +var ZodOptional = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === ZodParsedType.undefined) { + return OK(void 0); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } +}; +ZodOptional.create = (type, params) => { + return new ZodOptional({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodOptional, + ...processCreateParams(params) + }); +}; +var ZodNullable = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType === ZodParsedType.null) { + return OK(null); + } + return this._def.innerType._parse(input); + } + unwrap() { + return this._def.innerType; + } +}; +ZodNullable.create = (type, params) => { + return new ZodNullable({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodNullable, + ...processCreateParams(params) + }); +}; +var ZodDefault = class extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + let data = ctx.data; + if (ctx.parsedType === ZodParsedType.undefined) { + data = this._def.defaultValue(); + } + return this._def.innerType._parse({ + data, + path: ctx.path, + parent: ctx + }); + } + removeDefault() { + return this._def.innerType; + } +}; +ZodDefault.create = (type, params) => { + return new ZodDefault({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodDefault, + defaultValue: typeof params.default === "function" ? params.default : () => params.default, + ...processCreateParams(params) + }); +}; +var ZodCatch = class extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const newCtx = { + ...ctx, + common: { + ...ctx.common, + issues: [] + } + }; + const result = this._def.innerType._parse({ + data: newCtx.data, + path: newCtx.path, + parent: { + ...newCtx + } + }); + if (isAsync(result)) { + return result.then((result2) => { + return { + status: "valid", + value: result2.status === "valid" ? result2.value : this._def.catchValue({ + get error() { + return new ZodError(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + }); + } else { + return { + status: "valid", + value: result.status === "valid" ? result.value : this._def.catchValue({ + get error() { + return new ZodError(newCtx.common.issues); + }, + input: newCtx.data + }) + }; + } + } + removeCatch() { + return this._def.innerType; + } +}; +ZodCatch.create = (type, params) => { + return new ZodCatch({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodCatch, + catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, + ...processCreateParams(params) + }); +}; +var ZodNaN = class extends ZodType { + _parse(input) { + const parsedType = this._getType(input); + if (parsedType !== ZodParsedType.nan) { + const ctx = this._getOrReturnCtx(input); + addIssueToContext(ctx, { + code: ZodIssueCode.invalid_type, + expected: ZodParsedType.nan, + received: ctx.parsedType + }); + return INVALID; + } + return { status: "valid", value: input.data }; + } +}; +ZodNaN.create = (params) => { + return new ZodNaN({ + typeName: ZodFirstPartyTypeKind.ZodNaN, + ...processCreateParams(params) + }); +}; +var BRAND = Symbol("zod_brand"); +var ZodBranded = class extends ZodType { + _parse(input) { + const { ctx } = this._processInputParams(input); + const data = ctx.data; + return this._def.type._parse({ + data, + path: ctx.path, + parent: ctx + }); + } + unwrap() { + return this._def.type; + } +}; +var ZodPipeline = class _ZodPipeline extends ZodType { + _parse(input) { + const { status, ctx } = this._processInputParams(input); + if (ctx.common.async) { + const handleAsync = async () => { + const inResult = await this._def.in._parseAsync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inResult.status === "aborted") + return INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return DIRTY(inResult.value); + } else { + return this._def.out._parseAsync({ + data: inResult.value, + path: ctx.path, + parent: ctx + }); + } + }; + return handleAsync(); + } else { + const inResult = this._def.in._parseSync({ + data: ctx.data, + path: ctx.path, + parent: ctx + }); + if (inResult.status === "aborted") + return INVALID; + if (inResult.status === "dirty") { + status.dirty(); + return { + status: "dirty", + value: inResult.value + }; + } else { + return this._def.out._parseSync({ + data: inResult.value, + path: ctx.path, + parent: ctx + }); + } + } + } + static create(a, b) { + return new _ZodPipeline({ + in: a, + out: b, + typeName: ZodFirstPartyTypeKind.ZodPipeline + }); + } +}; +var ZodReadonly = class extends ZodType { + _parse(input) { + const result = this._def.innerType._parse(input); + if (isValid(result)) { + result.value = Object.freeze(result.value); + } + return result; + } +}; +ZodReadonly.create = (type, params) => { + return new ZodReadonly({ + innerType: type, + typeName: ZodFirstPartyTypeKind.ZodReadonly, + ...processCreateParams(params) + }); +}; +var custom = (check, params = {}, fatal) => { + if (check) + return ZodAny.create().superRefine((data, ctx) => { + var _a, _b; + if (!check(data)) { + const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params; + const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true; + const p2 = typeof p === "string" ? { message: p } : p; + ctx.addIssue({ code: "custom", ...p2, fatal: _fatal }); + } + }); + return ZodAny.create(); +}; +var late = { + object: ZodObject.lazycreate +}; +var ZodFirstPartyTypeKind; +(function(ZodFirstPartyTypeKind2) { + ZodFirstPartyTypeKind2["ZodString"] = "ZodString"; + ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber"; + ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN"; + ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt"; + ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean"; + ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate"; + ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol"; + ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined"; + ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull"; + ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny"; + ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown"; + ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever"; + ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid"; + ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray"; + ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject"; + ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion"; + ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; + ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection"; + ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple"; + ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord"; + ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap"; + ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet"; + ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction"; + ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy"; + ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral"; + ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum"; + ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects"; + ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum"; + ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional"; + ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable"; + ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault"; + ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch"; + ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise"; + ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded"; + ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline"; + ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly"; +})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); +var instanceOfType = (cls, params = { + message: `Input not instance of ${cls.name}` +}) => custom((data) => data instanceof cls, params); +var stringType = ZodString.create; +var numberType = ZodNumber.create; +var nanType = ZodNaN.create; +var bigIntType = ZodBigInt.create; +var booleanType = ZodBoolean.create; +var dateType = ZodDate.create; +var symbolType = ZodSymbol.create; +var undefinedType = ZodUndefined.create; +var nullType = ZodNull.create; +var anyType = ZodAny.create; +var unknownType = ZodUnknown.create; +var neverType = ZodNever.create; +var voidType = ZodVoid.create; +var arrayType = ZodArray.create; +var objectType = ZodObject.create; +var strictObjectType = ZodObject.strictCreate; +var unionType = ZodUnion.create; +var discriminatedUnionType = ZodDiscriminatedUnion.create; +var intersectionType = ZodIntersection.create; +var tupleType = ZodTuple.create; +var recordType = ZodRecord.create; +var mapType = ZodMap.create; +var setType = ZodSet.create; +var functionType = ZodFunction.create; +var lazyType = ZodLazy.create; +var literalType = ZodLiteral.create; +var enumType = ZodEnum.create; +var nativeEnumType = ZodNativeEnum.create; +var promiseType = ZodPromise.create; +var effectsType = ZodEffects.create; +var optionalType = ZodOptional.create; +var nullableType = ZodNullable.create; +var preprocessType = ZodEffects.createWithPreprocess; +var pipelineType = ZodPipeline.create; +var ostring = () => stringType().optional(); +var onumber = () => numberType().optional(); +var oboolean = () => booleanType().optional(); +var coerce = { + string: (arg) => ZodString.create({ ...arg, coerce: true }), + number: (arg) => ZodNumber.create({ ...arg, coerce: true }), + boolean: (arg) => ZodBoolean.create({ + ...arg, + coerce: true + }), + bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }), + date: (arg) => ZodDate.create({ ...arg, coerce: true }) +}; +var NEVER = INVALID; +var z = /* @__PURE__ */ Object.freeze({ + __proto__: null, + defaultErrorMap: errorMap, + setErrorMap, + getErrorMap, + makeIssue, + EMPTY_PATH, + addIssueToContext, + ParseStatus, + INVALID, + DIRTY, + OK, + isAborted, + isDirty, + isValid, + isAsync, + get util() { + return util; + }, + get objectUtil() { + return objectUtil; + }, + ZodParsedType, + getParsedType, + ZodType, + ZodString, + ZodNumber, + ZodBigInt, + ZodBoolean, + ZodDate, + ZodSymbol, + ZodUndefined, + ZodNull, + ZodAny, + ZodUnknown, + ZodNever, + ZodVoid, + ZodArray, + ZodObject, + ZodUnion, + ZodDiscriminatedUnion, + ZodIntersection, + ZodTuple, + ZodRecord, + ZodMap, + ZodSet, + ZodFunction, + ZodLazy, + ZodLiteral, + ZodEnum, + ZodNativeEnum, + ZodPromise, + ZodEffects, + ZodTransformer: ZodEffects, + ZodOptional, + ZodNullable, + ZodDefault, + ZodCatch, + ZodNaN, + BRAND, + ZodBranded, + ZodPipeline, + ZodReadonly, + custom, + Schema: ZodType, + ZodSchema: ZodType, + late, + get ZodFirstPartyTypeKind() { + return ZodFirstPartyTypeKind; + }, + coerce, + any: anyType, + array: arrayType, + bigint: bigIntType, + boolean: booleanType, + date: dateType, + discriminatedUnion: discriminatedUnionType, + effect: effectsType, + "enum": enumType, + "function": functionType, + "instanceof": instanceOfType, + intersection: intersectionType, + lazy: lazyType, + literal: literalType, + map: mapType, + nan: nanType, + nativeEnum: nativeEnumType, + never: neverType, + "null": nullType, + nullable: nullableType, + number: numberType, + object: objectType, + oboolean, + onumber, + optional: optionalType, + ostring, + pipeline: pipelineType, + preprocess: preprocessType, + promise: promiseType, + record: recordType, + set: setType, + strictObject: strictObjectType, + string: stringType, + symbol: symbolType, + transformer: effectsType, + tuple: tupleType, + "undefined": undefinedType, + union: unionType, + unknown: unknownType, + "void": voidType, + NEVER, + ZodIssueCode, + quotelessJson, + ZodError +}); + +// submission-runner/types.cts +var RunResultKind = z.enum([ + "CompileFailed", + "TimeLimitExceeded", + "Completed", + "SandboxError", + "RunError" +]); +var RunResultZod = z.object({ + kind: RunResultKind, + output: z.string().optional(), + exitCode: z.number().optional(), + runtimeMilliseconds: z.number().optional(), + resultKindReason: z.string().optional() +}).strict(); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + RunResultZod +}); diff --git a/shared/package-lock.json b/shared/package-lock.json index 8457105..3508abf 100644 --- a/shared/package-lock.json +++ b/shared/package-lock.json @@ -10,6 +10,7 @@ "@types/node": "20.x", "@typescript-eslint/eslint-plugin": "^7.2.0", "@typescript-eslint/parser": "^7.2.0", + "esbuild": "^0.20.1", "eslint": "^8.57.0", "fs-extra": "^11.2.0", "prettier": "^3.2.5", @@ -27,6 +28,374 @@ "node": ">=0.10.0" } }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.1.tgz", + "integrity": "sha512-m55cpeupQ2DbuRGQMMZDzbv9J9PgVelPjlcmM5kxHnrBdBx6REaEd7LamYV7Dm8N7rCyR/XwU6rVP8ploKtIkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.1.tgz", + "integrity": "sha512-4j0+G27/2ZXGWR5okcJi7pQYhmkVgb4D7UKwxcqrjhvp5TKWx3cUjgB1CGj1mfdmJBQ9VnUGgUhign+FPF2Zgw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.1.tgz", + "integrity": "sha512-hCnXNF0HM6AjowP+Zou0ZJMWWa1VkD77BXe959zERgGJBBxB+sV+J9f/rcjeg2c5bsukD/n17RKWXGFCO5dD5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.1.tgz", + "integrity": "sha512-MSfZMBoAsnhpS+2yMFYIQUPs8Z19ajwfuaSZx+tSl09xrHZCjbeXXMsUF/0oq7ojxYEpsSo4c0SfjxOYXRbpaA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.1.tgz", + "integrity": "sha512-Ylk6rzgMD8klUklGPzS414UQLa5NPXZD5tf8JmQU8GQrj6BrFA/Ic9tb2zRe1kOZyCbGl+e8VMbDRazCEBqPvA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.1.tgz", + "integrity": "sha512-pFIfj7U2w5sMp52wTY1XVOdoxw+GDwy9FsK3OFz4BpMAjvZVs0dT1VXs8aQm22nhwoIWUmIRaE+4xow8xfIDZA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.1.tgz", + "integrity": "sha512-UyW1WZvHDuM4xDz0jWun4qtQFauNdXjXOtIy7SYdf7pbxSWWVlqhnR/T2TpX6LX5NI62spt0a3ldIIEkPM6RHw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.1.tgz", + "integrity": "sha512-itPwCw5C+Jh/c624vcDd9kRCCZVpzpQn8dtwoYIt2TJF3S9xJLiRohnnNrKwREvcZYx0n8sCSbvGH349XkcQeg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.1.tgz", + "integrity": "sha512-LojC28v3+IhIbfQ+Vu4Ut5n3wKcgTu6POKIHN9Wpt0HnfgUGlBuyDDQR4jWZUZFyYLiz4RBBBmfU6sNfn6RhLw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.1.tgz", + "integrity": "sha512-cX8WdlF6Cnvw/DO9/X7XLH2J6CkBnz7Twjpk56cshk9sjYVcuh4sXQBy5bmTwzBjNVZze2yaV1vtcJS04LbN8w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.1.tgz", + "integrity": "sha512-4H/sQCy1mnnGkUt/xszaLlYJVTz3W9ep52xEefGtd6yXDQbz/5fZE5dFLUgsPdbUOQANcVUa5iO6g3nyy5BJiw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.1.tgz", + "integrity": "sha512-c0jgtB+sRHCciVXlyjDcWb2FUuzlGVRwGXgI+3WqKOIuoo8AmZAddzeOHeYLtD+dmtHw3B4Xo9wAUdjlfW5yYA==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.1.tgz", + "integrity": "sha512-TgFyCfIxSujyuqdZKDZ3yTwWiGv+KnlOeXXitCQ+trDODJ+ZtGOzLkSWngynP0HZnTsDyBbPy7GWVXWaEl6lhA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.1.tgz", + "integrity": "sha512-b+yuD1IUeL+Y93PmFZDZFIElwbmFfIKLKlYI8M6tRyzE6u7oEP7onGk0vZRh8wfVGC2dZoy0EqX1V8qok4qHaw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.1.tgz", + "integrity": "sha512-wpDlpE0oRKZwX+GfomcALcouqjjV8MIX8DyTrxfyCfXxoKQSDm45CZr9fanJ4F6ckD4yDEPT98SrjvLwIqUCgg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.1.tgz", + "integrity": "sha512-5BepC2Au80EohQ2dBpyTquqGCES7++p7G+7lXe1bAIvMdXm4YYcEfZtQrP4gaoZ96Wv1Ute61CEHFU7h4FMueQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.1.tgz", + "integrity": "sha512-5gRPk7pKuaIB+tmH+yKd2aQTRpqlf1E4f/mC+tawIm/CGJemZcHZpp2ic8oD83nKgUPMEd0fNanrnFljiruuyA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.1.tgz", + "integrity": "sha512-4fL68JdrLV2nVW2AaWZBv3XEm3Ae3NZn/7qy2KGAt3dexAgSVT+Hc97JKSZnqezgMlv9x6KV0ZkZY7UO5cNLCg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.1.tgz", + "integrity": "sha512-GhRuXlvRE+twf2ES+8REbeCb/zeikNqwD3+6S5y5/x+DYbAQUNl0HNBs4RQJqrechS4v4MruEr8ZtAin/hK5iw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.1.tgz", + "integrity": "sha512-ZnWEyCM0G1Ex6JtsygvC3KUUrlDXqOihw8RicRuQAzw+c4f1D66YlPNNV3rkjVW90zXVsHwZYWbJh3v+oQFM9Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.1.tgz", + "integrity": "sha512-QZ6gXue0vVQY2Oon9WyLFCdSuYbXSoxaZrPuJ4c20j6ICedfsDilNPYfHLlMH7vGfU5DQR0czHLmJvH4Nzis/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.1.tgz", + "integrity": "sha512-HzcJa1NcSWTAU0MJIxOho8JftNp9YALui3o+Ny7hCh0v5f90nprly1U3Sj1Ldj/CvKKdvvFsCRvDkpsEMp4DNw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.1.tgz", + "integrity": "sha512-0MBh53o6XtI6ctDnRMeQ+xoCN8kD2qI1rY1KgF/xdWQwoFeKou7puvDfV8/Wv4Ctx2rRpET/gGdz3YlNtNACSA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -644,6 +1013,44 @@ "node": ">=6.0.0" } }, + "node_modules/esbuild": { + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.1.tgz", + "integrity": "sha512-OJwEgrpWm/PCMsLVWXKqvcjme3bHNpOgN7Tb6cQnR5n0TPbQx1/Xrn7rqM+wn17bYeT6MGB5sn1Bh5YiGi70nA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.20.1", + "@esbuild/android-arm": "0.20.1", + "@esbuild/android-arm64": "0.20.1", + "@esbuild/android-x64": "0.20.1", + "@esbuild/darwin-arm64": "0.20.1", + "@esbuild/darwin-x64": "0.20.1", + "@esbuild/freebsd-arm64": "0.20.1", + "@esbuild/freebsd-x64": "0.20.1", + "@esbuild/linux-arm": "0.20.1", + "@esbuild/linux-arm64": "0.20.1", + "@esbuild/linux-ia32": "0.20.1", + "@esbuild/linux-loong64": "0.20.1", + "@esbuild/linux-mips64el": "0.20.1", + "@esbuild/linux-ppc64": "0.20.1", + "@esbuild/linux-riscv64": "0.20.1", + "@esbuild/linux-s390x": "0.20.1", + "@esbuild/linux-x64": "0.20.1", + "@esbuild/netbsd-x64": "0.20.1", + "@esbuild/openbsd-x64": "0.20.1", + "@esbuild/sunos-x64": "0.20.1", + "@esbuild/win32-arm64": "0.20.1", + "@esbuild/win32-ia32": "0.20.1", + "@esbuild/win32-x64": "0.20.1" + } + }, "node_modules/escape-string-regexp": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", diff --git a/shared/package.json b/shared/package.json index 96660c1..01ba0ec 100644 --- a/shared/package.json +++ b/shared/package.json @@ -1,7 +1,7 @@ { "name": "bwcontest-shared", "scripts": { - "build": "tsc", + "build": "esbuild submission-runner/*.cts --bundle --outdir=dist --format=cjs --platform=node", "format": "prettier --write .", "lint": "prettier --check . && eslint .", "check": "tsc -noEmit" @@ -11,6 +11,7 @@ "@types/node": "20.x", "@typescript-eslint/eslint-plugin": "^7.2.0", "@typescript-eslint/parser": "^7.2.0", + "esbuild": "^0.20.1", "eslint": "^8.57.0", "fs-extra": "^11.2.0", "prettier": "^3.2.5", From 0901765707f0babfb92e18ef2ef722225baa6350 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:13:31 -0400 Subject: [PATCH 03/14] [Web] Update shared import --- web/package-lock.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/package-lock.json b/web/package-lock.json index ec25e20..502d3e1 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -51,11 +51,13 @@ } }, "../shared": { + "name": "bwcontest-shared", "devDependencies": { "@types/fs-extra": "^11.0.4", "@types/node": "20.x", "@typescript-eslint/eslint-plugin": "^7.2.0", "@typescript-eslint/parser": "^7.2.0", + "esbuild": "^0.20.1", "eslint": "^8.57.0", "fs-extra": "^11.2.0", "prettier": "^3.2.5", From 24c91932118090b8ccd2fdf72abde0ddababfa69 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:16:07 -0400 Subject: [PATCH 04/14] [Sandbox] Update shared import --- sandbox/.vscode/settings.json | 3 +++ sandbox/package-lock.json | 27 ++++++++++++++++++++++----- sandbox/package.json | 2 +- sandbox/src/index.ts | 8 ++++---- sandbox/tsconfig.json | 2 +- 5 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 sandbox/.vscode/settings.json diff --git a/sandbox/.vscode/settings.json b/sandbox/.vscode/settings.json new file mode 100644 index 0000000..bcdbaee --- /dev/null +++ b/sandbox/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "cSpell.words": ["bwcontest"] +} diff --git a/sandbox/package-lock.json b/sandbox/package-lock.json index 0ea5ace..d143798 100644 --- a/sandbox/package-lock.json +++ b/sandbox/package-lock.json @@ -9,11 +9,11 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "bwcontest-shared": "file:../shared", "dotenv": "^16.4.5", "fs-extra": "^11.2.0", "rollup": "^4.12.1", "simple-git": "^3.22.0", - "submission-runner": "file:../shared/submission-runner", "tree-kill": "^1.2.2", "url-join": "^5.0.0", "zod": "^3.22.4" @@ -33,7 +33,24 @@ "typescript": "^5.4.2" } }, + "../shared": { + "name": "bwcontest-shared", + "devDependencies": { + "@types/fs-extra": "^11.0.4", + "@types/node": "20.x", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "esbuild": "^0.20.1", + "eslint": "^8.57.0", + "fs-extra": "^11.2.0", + "prettier": "^3.2.5", + "tree-kill": "^1.2.2", + "typescript": "^5.4.2", + "zod": "^3.22.4" + } + }, "../shared/submission-runner": { + "extraneous": true, "dependencies": { "fs-extra": "^11.2.0", "tree-kill": "^1.2.2", @@ -1336,6 +1353,10 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bwcontest-shared": { + "resolved": "../shared", + "link": true + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -2693,10 +2714,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/submission-runner": { - "resolved": "../shared/submission-runner", - "link": true - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", diff --git a/sandbox/package.json b/sandbox/package.json index 866a9a7..acbfb20 100644 --- a/sandbox/package.json +++ b/sandbox/package.json @@ -28,11 +28,11 @@ "typescript": "^5.4.2" }, "dependencies": { + "bwcontest-shared": "file:../shared", "dotenv": "^16.4.5", "fs-extra": "^11.2.0", "rollup": "^4.12.1", "simple-git": "^3.22.0", - "submission-runner": "file:../shared/submission-runner", "tree-kill": "^1.2.2", "url-join": "^5.0.0", "zod": "^3.22.4" diff --git a/sandbox/src/index.ts b/sandbox/src/index.ts index 62d9f74..d3fb502 100644 --- a/sandbox/src/index.ts +++ b/sandbox/src/index.ts @@ -4,10 +4,10 @@ import urlJoin from 'url-join'; import os, { EOL } from 'os'; import { join } from 'path'; import { simpleGit, SimpleGit } from 'simple-git'; -import { runJava } from 'submission-runner/java.cjs'; -import { runCSharp } from 'submission-runner/csharp.cjs'; -import { runCpp } from 'submission-runner/cpp.cjs'; -import { RunResult, RunResultZod } from 'submission-runner/types.cjs'; +import { runJava } from 'bwcontest-shared/submission-runner/java.cjs'; +import { runCSharp } from 'bwcontest-shared/submission-runner/csharp.cjs'; +import { runCpp } from 'bwcontest-shared/submission-runner/cpp.cjs'; +import { RunResult, RunResultZod } from 'bwcontest-shared/submission-runner/types.cjs'; import { z } from 'zod'; const submissionPostData = z diff --git a/sandbox/tsconfig.json b/sandbox/tsconfig.json index 0a6b16a..b3097aa 100644 --- a/sandbox/tsconfig.json +++ b/sandbox/tsconfig.json @@ -4,7 +4,7 @@ "sourceMap": true, "outDir": "./build", "esModuleInterop": true, - "strict": true, + "strict": true }, "include": ["src/**/*.ts"] } From 8321ef3b5107dc1e0c916fe4e5240734927a94e8 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:18:09 -0400 Subject: [PATCH 05/14] [Shared] Remove tsbuildinfo --- shared/dist/tsconfig.tsbuildinfo | 1 - 1 file changed, 1 deletion(-) delete mode 100644 shared/dist/tsconfig.tsbuildinfo diff --git a/shared/dist/tsconfig.tsbuildinfo b/shared/dist/tsconfig.tsbuildinfo deleted file mode 100644 index ec23207..0000000 --- a/shared/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.dom.iterable.d.ts","../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../node_modules/typescript/lib/lib.scripthost.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2016.intl.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../node_modules/typescript/lib/lib.es2016.full.d.ts","../node_modules/zod/lib/helpers/typealiases.d.ts","../node_modules/zod/lib/helpers/util.d.ts","../node_modules/zod/lib/zoderror.d.ts","../node_modules/zod/lib/locales/en.d.ts","../node_modules/zod/lib/errors.d.ts","../node_modules/zod/lib/helpers/parseutil.d.ts","../node_modules/zod/lib/helpers/enumutil.d.ts","../node_modules/zod/lib/helpers/errorutil.d.ts","../node_modules/zod/lib/helpers/partialutil.d.ts","../node_modules/zod/lib/types.d.ts","../node_modules/zod/lib/external.d.ts","../node_modules/zod/lib/index.d.ts","../node_modules/zod/index.d.ts","../submission-runner/types.cts","../submission-runner/settings.cts","../node_modules/tree-kill/index.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/jsonfile/index.d.ts","../node_modules/@types/jsonfile/utils.d.ts","../node_modules/@types/fs-extra/index.d.ts","../submission-runner/cpp.cts","../submission-runner/csharp.cts","../submission-runner/java.cts","../types/contestmonitortypes.d.ts","../node_modules/@types/json-schema/index.d.ts","../node_modules/@types/semver/classes/semver.d.ts","../node_modules/@types/semver/functions/parse.d.ts","../node_modules/@types/semver/functions/valid.d.ts","../node_modules/@types/semver/functions/clean.d.ts","../node_modules/@types/semver/functions/inc.d.ts","../node_modules/@types/semver/functions/diff.d.ts","../node_modules/@types/semver/functions/major.d.ts","../node_modules/@types/semver/functions/minor.d.ts","../node_modules/@types/semver/functions/patch.d.ts","../node_modules/@types/semver/functions/prerelease.d.ts","../node_modules/@types/semver/functions/compare.d.ts","../node_modules/@types/semver/functions/rcompare.d.ts","../node_modules/@types/semver/functions/compare-loose.d.ts","../node_modules/@types/semver/functions/compare-build.d.ts","../node_modules/@types/semver/functions/sort.d.ts","../node_modules/@types/semver/functions/rsort.d.ts","../node_modules/@types/semver/functions/gt.d.ts","../node_modules/@types/semver/functions/lt.d.ts","../node_modules/@types/semver/functions/eq.d.ts","../node_modules/@types/semver/functions/neq.d.ts","../node_modules/@types/semver/functions/gte.d.ts","../node_modules/@types/semver/functions/lte.d.ts","../node_modules/@types/semver/functions/cmp.d.ts","../node_modules/@types/semver/functions/coerce.d.ts","../node_modules/@types/semver/classes/comparator.d.ts","../node_modules/@types/semver/classes/range.d.ts","../node_modules/@types/semver/functions/satisfies.d.ts","../node_modules/@types/semver/ranges/max-satisfying.d.ts","../node_modules/@types/semver/ranges/min-satisfying.d.ts","../node_modules/@types/semver/ranges/to-comparators.d.ts","../node_modules/@types/semver/ranges/min-version.d.ts","../node_modules/@types/semver/ranges/valid.d.ts","../node_modules/@types/semver/ranges/outside.d.ts","../node_modules/@types/semver/ranges/gtr.d.ts","../node_modules/@types/semver/ranges/ltr.d.ts","../node_modules/@types/semver/ranges/intersects.d.ts","../node_modules/@types/semver/ranges/simplify.d.ts","../node_modules/@types/semver/ranges/subset.d.ts","../node_modules/@types/semver/internals/identifiers.d.ts","../node_modules/@types/semver/index.d.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"80e18897e5884b6723488d4f5652167e7bb5024f946743134ecc4aa4ee731f89","affectsGlobalScope":true},{"version":"cd034f499c6cdca722b60c04b5b1b78e058487a7085a8e0d6fb50809947ee573","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},"807e0e0bdc67605dd28efe18f20ab5fcd75d944ef95936120702335f9379094b","5487b97cfa28b26b4a9ef0770f872bdbebd4c46124858de00f242c3eed7519f4","7a01f546ace66019156e4232a1bee2fabc2f8eabeb052473d926ee1693956265","fb53b1c6a6c799b7e3cc2de3fb5c9a1c04a1c60d4380a37792d84c5f8b33933b","8485b6da53ec35637d072e516631d25dae53984500de70a6989058f24354666f","ebe80346928736532e4a822154eb77f57ef3389dbe2b3ba4e571366a15448ef2","c2cb3c8ff388781258ea9ddbcd8a947f751bddd6886e1d3b3ea09ddaa895df80","f672c876c1a04a223cf2023b3d91e8a52bb1544c576b81bf64a8fec82be9969c","98a9cc18f661d28e6bd31c436e1984f3980f35e0f0aa9cf795c54f8ccb667ffe","c76b0c5727302341d0bdfa2cc2cee4b19ff185b554edb6e8543f0661d8487116","2a317fff5810a628d205a507998a77521120b462b03d36babf6eb387da991bee","f5ef066942e4f0bd98200aa6a6694b831e73200c9b3ade77ad0aa2409e8fe1b1","b9e99cd94f4166a245f5158f7286c05406e2a4c694619bceb7a4f3519d1d768e","5568d7c32e5cf5f35e092649f4e5e168c3114c800b1d7545b7ae5e0415704802","5f48141dfa43072bddf45a657c3b87359e860a61af66d9ed1b4f2a013eb36bf7","825b3ed6c26f78a78b3a8f650455ebe1e09404801f7d73b460c9734d8a90cccb","8323e3f5b91261ed250bd7c6b7aba2aa10f8e1c2ef348297c1f7752a403abebd","efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"7fd7fcbf021a5845bdd9397d4649fcf2fe17152d2098140fc723099a215d19ad","affectsGlobalScope":true},"df3389f71a71a38bc931aaf1ef97a65fada98f0a27f19dd12f8b8de2b0f4e461","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"a1d2988ad9d2aef7b9915a22b5e52c165c83a878f2851c35621409046bbe3c05","affectsGlobalScope":true},"bd3f5d05b6b5e4bfcea7739a45f3ffb4a7f4a3442ba7baf93e0200799285b8f1","4c775c2fccabf49483c03cd5e3673f87c1ffb6079d98e7b81089c3def79e29c6","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"674168aa3db414ea0a19b2a31d901b2d49705c7a495e43ffdc96928543010f8c","affectsGlobalScope":true},"fe1fd6afdfe77976d4c702f3746c05fb05a7e566845c890e0e970fe9376d6a90","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","afb1701fd4be413a8a5a88df6befdd4510c30a31372c07a4138facf61594c66d","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"c07146dbbbd8b347241b5df250a51e48f2d7bef19b1e187b1a3f20c849988ff1","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"ae5507fc333d637dec9f37c6b3f4d423105421ea2820a64818de55db85214d66","affectsGlobalScope":true},{"version":"0666f4c99b8688c7be5956df8fecf5d1779d3b22f8f2a88258ae7072c7b6026f","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","54e854615c4eafbdd3fd7688bd02a3aafd0ccf0e87c98f79d3e9109f047ce6b8","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","8221b00f271cf7f535a8eeec03b0f80f0929c7a16116e2d2df089b41066de69b","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","7424817d5eb498771e6d1808d726ec38f75d2eaf3fa359edd5c0c540c52725c1","9a9634296cca836c3308923ba7aa094fa6ed76bb1e366d8ddcf5c65888ab1024",{"version":"bddce945d552a963c9733db106b17a25474eefcab7fc990157a2134ef55d4954","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","4b55240c2a03b2c71e98a7fc528b16136faa762211c92e781a01c37821915ea6","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"94c086dff8dbc5998749326bc69b520e8e4273fb5b7b58b50e0210e0885dfcde","affectsGlobalScope":true},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true},"ebe5facd12fd7745cda5f4bc3319f91fb29dc1f96e57e9c6f8b260a7cc5b67ee","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","37dc027f781c75f0f546e329cfac7cf92a6b289f42458f47a9adc25e516b6839",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","211440ce81e87b3491cdf07155881344b0a61566df6e749acff0be7e8b9d1a07","5d9a0b6e6be8dbb259f64037bce02f34692e8c1519f5cd5d467d7fa4490dced4","880da0e0f3ebca42f9bd1bc2d3e5e7df33f2619d85f18ee0ed4bd16d1800bc32","675fe8ad8203245d751a4014b8bc1f1e09f7f97c5f3aae0bd2d4a8528c0aad0f","13ed0b4f30bbbbd5d69f0a283fa35f2d84fe3c0e32144200a5bc560b0d3b1a98","4499adcc0f309c7c9cbe74f8b7025a1c6e892da4953f48027f370d3a1b29627e","19d2e8aacb34c888cf6917760fbec060f14b84e72801d942d022c4288259949c","f3d8c757e148ad968f0d98697987db363070abada5f503da3c06aefd9d4248c1","cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4"],"root":[64,65,[156,159]],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"outDir":"./","sourceMap":true,"strict":true,"target":3},"fileIdsList":[[116,152,153,154],[116,144,152],[67],[102],[103,108,136],[104,115,116,123,133,144],[104,105,115,123],[106,145],[107,108,116,124],[108,133,141],[109,111,115,123],[102,110],[111,112],[115],[113,115],[102,115],[115,116,117,133,144],[115,116,117,130,133,136],[100,103,149],[111,115,118,123,133,144],[115,116,118,119,123,133,141,144],[118,120,133,141,144],[67,68,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151],[115,121],[122,144,149],[111,115,123,133],[124],[125],[102,126],[127,143,149],[128],[129],[115,130,131],[130,132,145,147],[103,115,133,134,135,136],[103,133,135],[133,134],[136],[137],[102,133],[115,139,140],[139,140],[108,123,133,141],[142],[123,143],[103,118,129,144],[108,145],[133,146],[122,147],[148],[103,108,115,117,126,133,144,147,149],[133,150],[161,200],[161,185,200],[200],[161],[161,186,200],[161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199],[186,200],[77,81,144],[77,133,144],[72],[74,77,141,144],[123,141],[152],[72,152],[74,77,123,144],[69,70,73,76,103,115,133,144],[69,75],[73,77,103,136,144,152],[103,152],[93,103,152],[71,72,152],[77],[71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,94,95,96,97,98,99],[77,84,85],[75,77,85,86],[76],[69,72,77],[77,81,85,86],[81],[75,77,80,144],[69,74,75,77,81,84],[103,133],[72,77,93,103,149,152],[62],[53,54],[51,52,53,55,56,60],[52,53],[61],[53],[51,52,53,56,57,58,59],[51,52,62],[64,65,66,104,124,125,145,155],[64,65,66,104],[64,65,66,104,125,145],[63]],"referencedMap":[[155,1],[153,2],[67,3],[68,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,12],[111,13],[112,13],[114,14],[113,15],[115,16],[116,17],[117,18],[101,19],[118,20],[119,21],[120,22],[152,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,32],[130,33],[131,33],[132,34],[133,35],[135,36],[134,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,51],[150,52],[185,53],[186,54],[161,55],[164,55],[183,53],[184,53],[174,53],[173,56],[171,53],[166,53],[179,53],[177,53],[181,53],[165,53],[178,53],[182,53],[167,53],[168,53],[180,53],[162,53],[169,53],[170,53],[172,53],[176,53],[187,57],[175,53],[163,53],[200,58],[194,57],[196,59],[195,57],[188,57],[189,57],[191,57],[193,57],[197,59],[198,59],[190,59],[192,59],[84,60],[91,61],[83,60],[98,62],[75,63],[74,64],[97,65],[92,66],[95,67],[77,68],[76,69],[72,70],[71,71],[94,72],[73,73],[78,74],[82,74],[100,75],[99,74],[86,76],[87,77],[89,78],[85,79],[88,80],[93,65],[80,81],[81,82],[90,83],[70,84],[96,85],[63,86],[55,87],[61,88],[56,89],[59,86],[62,90],[54,91],[60,92],[53,93],[156,94],[157,95],[158,96],[64,97]],"exportedModulesMap":[[155,1],[153,2],[67,3],[68,3],[102,4],[103,5],[104,6],[105,7],[106,8],[107,9],[108,10],[109,11],[110,12],[111,13],[112,13],[114,14],[113,15],[115,16],[116,17],[117,18],[101,19],[118,20],[119,21],[120,22],[152,23],[121,24],[122,25],[123,26],[124,27],[125,28],[126,29],[127,30],[128,31],[129,32],[130,33],[131,33],[132,34],[133,35],[135,36],[134,37],[136,38],[137,39],[138,40],[139,41],[140,42],[141,43],[142,44],[143,45],[144,46],[145,47],[146,48],[147,49],[148,50],[149,51],[150,52],[185,53],[186,54],[161,55],[164,55],[183,53],[184,53],[174,53],[173,56],[171,53],[166,53],[179,53],[177,53],[181,53],[165,53],[178,53],[182,53],[167,53],[168,53],[180,53],[162,53],[169,53],[170,53],[172,53],[176,53],[187,57],[175,53],[163,53],[200,58],[194,57],[196,59],[195,57],[188,57],[189,57],[191,57],[193,57],[197,59],[198,59],[190,59],[192,59],[84,60],[91,61],[83,60],[98,62],[75,63],[74,64],[97,65],[92,66],[95,67],[77,68],[76,69],[72,70],[71,71],[94,72],[73,73],[78,74],[82,74],[100,75],[99,74],[86,76],[87,77],[89,78],[85,79],[88,80],[93,65],[80,81],[81,82],[90,83],[70,84],[96,85],[63,86],[55,87],[61,88],[56,89],[59,86],[62,90],[54,91],[60,92],[53,93],[156,94],[157,95],[158,96],[64,97]],"semanticDiagnosticsPerFile":[155,160,153,154,67,68,102,103,104,105,106,107,108,109,110,111,112,114,113,115,116,117,101,151,118,119,120,152,121,122,123,124,125,126,127,128,129,130,131,132,133,135,134,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,185,186,161,164,183,184,174,173,171,166,179,177,181,165,178,182,167,168,180,162,169,170,172,176,187,175,163,200,199,194,196,195,188,189,191,193,197,198,190,192,66,48,49,8,9,13,12,2,14,15,16,17,18,19,20,21,3,50,22,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,1,47,11,10,84,91,83,98,75,74,97,92,95,77,76,72,71,94,73,78,79,82,69,100,99,86,87,89,85,88,93,80,81,90,70,96,63,55,61,57,58,56,59,51,52,62,54,60,53,156,157,158,65,64,159],"affectedFilesPendingEmit":[156,157,158,65,64],"emitSignatures":[64,65,156,157,158]},"version":"5.4.2"} \ No newline at end of file From 24b1b2b4adda3fc1fe75f065df360cd405168cc9 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:25:28 -0400 Subject: [PATCH 06/14] [Web][Sandbox] Fix docker builds --- sandbox/Dockerfile | 10 +++------- shared/.dockerignore | 1 + web/Dockerfile | 10 +++------- 3 files changed, 7 insertions(+), 14 deletions(-) create mode 100644 shared/.dockerignore diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile index 08230b7..6f0f273 100644 --- a/sandbox/Dockerfile +++ b/sandbox/Dockerfile @@ -31,16 +31,12 @@ COPY ./sandbox/package*.json ./ RUN npm install COPY ./sandbox/ . -# Prep SubmissionRunner +# Prep Shared WORKDIR /app RUN mkdir shared -RUN mkdir shared/submissionRunner -WORKDIR /app/shared/submissionRunner - -COPY ./shared/submissionRunner/package*.json . -RUN npm install -COPY ./shared/submissionRunner/ . +WORKDIR /app/shared +COPY ./shared . # Build/Run diff --git a/shared/.dockerignore b/shared/.dockerignore new file mode 100644 index 0000000..30bc162 --- /dev/null +++ b/shared/.dockerignore @@ -0,0 +1 @@ +/node_modules \ No newline at end of file diff --git a/web/Dockerfile b/web/Dockerfile index 2482f81..a5a4816 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -20,16 +20,12 @@ COPY ./web/package*.json ./ RUN npm install COPY ./web/ . -# Prep extensionWeb +# Prep Shared WORKDIR /app RUN mkdir shared -RUN mkdir shared/extensionWeb -WORKDIR /app/shared/extensionWeb - -COPY ./shared/extensionWeb/package*.json . -RUN npm install -COPY ./shared/extensionWeb/ . +WORKDIR /app/shared +COPY ./shared/ . # Env/Build/Run From 4c02999c0a405de9043d8d1647d10f1243b84249 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:37:19 -0400 Subject: [PATCH 07/14] [Shared][Web][Sandbox] Build shared in docker --- sandbox/.dockerignore | 2 + sandbox/Dockerfile | 22 +- shared/.dockerignore | 3 +- shared/.gitignore | 2 +- shared/dist/cpp.js | 2462 ------------------------- shared/dist/csharp.js | 227 --- shared/dist/java.js | 241 --- shared/dist/settings.js | 30 - shared/dist/types.js | 3778 --------------------------------------- shared/package.json | 2 +- web/Dockerfile | 22 +- 11 files changed, 28 insertions(+), 6763 deletions(-) create mode 100644 sandbox/.dockerignore delete mode 100644 shared/dist/cpp.js delete mode 100644 shared/dist/csharp.js delete mode 100644 shared/dist/java.js delete mode 100644 shared/dist/settings.js delete mode 100644 shared/dist/types.js diff --git a/sandbox/.dockerignore b/sandbox/.dockerignore new file mode 100644 index 0000000..563ba71 --- /dev/null +++ b/sandbox/.dockerignore @@ -0,0 +1,2 @@ +/node_modules +/build \ No newline at end of file diff --git a/sandbox/Dockerfile b/sandbox/Dockerfile index 6f0f273..c2229f4 100644 --- a/sandbox/Dockerfile +++ b/sandbox/Dockerfile @@ -2,9 +2,6 @@ FROM ubuntu:22.04 # Setup -RUN mkdir sandbox -WORKDIR /app/sandbox - RUN apt-get update RUN apt-get install curl -y @@ -23,21 +20,24 @@ ENV DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true RUN git config --global user.name "Admin" RUN git config --global user.email noemail@example.com -# Prep Sandbox - -WORKDIR /app/sandbox - -COPY ./sandbox/package*.json ./ -RUN npm install -COPY ./sandbox/ . - # Prep Shared WORKDIR /app RUN mkdir shared WORKDIR /app/shared +COPY ./shared/package*.json ./ +RUN npm ci COPY ./shared . +# Prep Sandbox + +RUN mkdir sandbox +WORKDIR /app/sandbox +COPY ./sandbox/package*.json ./ +RUN npm ci +COPY ./sandbox/ . + + # Build/Run WORKDIR /app/sandbox diff --git a/shared/.dockerignore b/shared/.dockerignore index 30bc162..563ba71 100644 --- a/shared/.dockerignore +++ b/shared/.dockerignore @@ -1 +1,2 @@ -/node_modules \ No newline at end of file +/node_modules +/build \ No newline at end of file diff --git a/shared/.gitignore b/shared/.gitignore index f18af4e..8c08c51 100644 --- a/shared/.gitignore +++ b/shared/.gitignore @@ -1,2 +1,2 @@ node_modules -dist/tsconfig/tsbuildinfo +/build diff --git a/shared/dist/cpp.js b/shared/dist/cpp.js deleted file mode 100644 index 6ec29ae..0000000 --- a/shared/dist/cpp.js +++ /dev/null @@ -1,2462 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/tree-kill/index.js -var require_tree_kill = __commonJS({ - "node_modules/tree-kill/index.js"(exports2, module2) { - "use strict"; - var childProcess = require("child_process"); - var spawn2 = childProcess.spawn; - var exec2 = childProcess.exec; - module2.exports = function(pid, signal, callback) { - if (typeof signal === "function" && callback === void 0) { - callback = signal; - signal = void 0; - } - pid = parseInt(pid); - if (Number.isNaN(pid)) { - if (callback) { - return callback(new Error("pid must be a number")); - } else { - throw new Error("pid must be a number"); - } - } - var tree = {}; - var pidsToProcess = {}; - tree[pid] = []; - pidsToProcess[pid] = 1; - switch (process.platform) { - case "win32": - exec2("taskkill /pid " + pid + " /T /F", callback); - break; - case "darwin": - buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { - return spawn2("pgrep", ["-P", parentPid]); - }, function() { - killAll(tree, signal, callback); - }); - break; - default: - buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { - return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]); - }, function() { - killAll(tree, signal, callback); - }); - break; - } - }; - function killAll(tree, signal, callback) { - var killed = {}; - try { - Object.keys(tree).forEach(function(pid) { - tree[pid].forEach(function(pidpid) { - if (!killed[pidpid]) { - killPid(pidpid, signal); - killed[pidpid] = 1; - } - }); - if (!killed[pid]) { - killPid(pid, signal); - killed[pid] = 1; - } - }); - } catch (err) { - if (callback) { - return callback(err); - } else { - throw err; - } - } - if (callback) { - return callback(); - } - } - function killPid(pid, signal) { - try { - process.kill(parseInt(pid, 10), signal); - } catch (err) { - if (err.code !== "ESRCH") - throw err; - } - } - function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) { - var ps = spawnChildProcessesList(parentPid); - var allData = ""; - ps.stdout.on("data", function(data) { - var data = data.toString("ascii"); - allData += data; - }); - var onClose = function(code) { - delete pidsToProcess[parentPid]; - if (code != 0) { - if (Object.keys(pidsToProcess).length == 0) { - cb(); - } - return; - } - allData.match(/\d+/g).forEach(function(pid) { - pid = parseInt(pid, 10); - tree[parentPid].push(pid); - tree[pid] = []; - pidsToProcess[pid] = 1; - buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb); - }); - }; - ps.on("close", onClose); - } - } -}); - -// node_modules/universalify/index.js -var require_universalify = __commonJS({ - "node_modules/universalify/index.js"(exports2) { - "use strict"; - exports2.fromCallback = function(fn) { - return Object.defineProperty(function(...args) { - if (typeof args[args.length - 1] === "function") - fn.apply(this, args); - else { - return new Promise((resolve, reject) => { - args.push((err, res) => err != null ? reject(err) : resolve(res)); - fn.apply(this, args); - }); - } - }, "name", { value: fn.name }); - }; - exports2.fromPromise = function(fn) { - return Object.defineProperty(function(...args) { - const cb = args[args.length - 1]; - if (typeof cb !== "function") - return fn.apply(this, args); - else { - args.pop(); - fn.apply(this, args).then((r) => cb(null, r), cb); - } - }, "name", { value: fn.name }); - }; - } -}); - -// node_modules/graceful-fs/polyfills.js -var require_polyfills = __commonJS({ - "node_modules/graceful-fs/polyfills.js"(exports2, module2) { - var constants = require("constants"); - var origCwd = process.cwd; - var cwd = null; - var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform; - process.cwd = function() { - if (!cwd) - cwd = origCwd.call(process); - return cwd; - }; - try { - process.cwd(); - } catch (er) { - } - if (typeof process.chdir === "function") { - chdir = process.chdir; - process.chdir = function(d) { - cwd = null; - chdir.call(process, d); - }; - if (Object.setPrototypeOf) - Object.setPrototypeOf(process.chdir, chdir); - } - var chdir; - module2.exports = patch; - function patch(fs2) { - if (constants.hasOwnProperty("O_SYMLINK") && process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { - patchLchmod(fs2); - } - if (!fs2.lutimes) { - patchLutimes(fs2); - } - fs2.chown = chownFix(fs2.chown); - fs2.fchown = chownFix(fs2.fchown); - fs2.lchown = chownFix(fs2.lchown); - fs2.chmod = chmodFix(fs2.chmod); - fs2.fchmod = chmodFix(fs2.fchmod); - fs2.lchmod = chmodFix(fs2.lchmod); - fs2.chownSync = chownFixSync(fs2.chownSync); - fs2.fchownSync = chownFixSync(fs2.fchownSync); - fs2.lchownSync = chownFixSync(fs2.lchownSync); - fs2.chmodSync = chmodFixSync(fs2.chmodSync); - fs2.fchmodSync = chmodFixSync(fs2.fchmodSync); - fs2.lchmodSync = chmodFixSync(fs2.lchmodSync); - fs2.stat = statFix(fs2.stat); - fs2.fstat = statFix(fs2.fstat); - fs2.lstat = statFix(fs2.lstat); - fs2.statSync = statFixSync(fs2.statSync); - fs2.fstatSync = statFixSync(fs2.fstatSync); - fs2.lstatSync = statFixSync(fs2.lstatSync); - if (fs2.chmod && !fs2.lchmod) { - fs2.lchmod = function(path, mode, cb) { - if (cb) - process.nextTick(cb); - }; - fs2.lchmodSync = function() { - }; - } - if (fs2.chown && !fs2.lchown) { - fs2.lchown = function(path, uid, gid, cb) { - if (cb) - process.nextTick(cb); - }; - fs2.lchownSync = function() { - }; - } - if (platform === "win32") { - fs2.rename = typeof fs2.rename !== "function" ? fs2.rename : function(fs$rename) { - function rename(from, to, cb) { - var start = Date.now(); - var backoff = 0; - fs$rename(from, to, function CB(er) { - if (er && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") && Date.now() - start < 6e4) { - setTimeout(function() { - fs2.stat(to, function(stater, st) { - if (stater && stater.code === "ENOENT") - fs$rename(from, to, CB); - else - cb(er); - }); - }, backoff); - if (backoff < 100) - backoff += 10; - return; - } - if (cb) - cb(er); - }); - } - if (Object.setPrototypeOf) - Object.setPrototypeOf(rename, fs$rename); - return rename; - }(fs2.rename); - } - fs2.read = typeof fs2.read !== "function" ? fs2.read : function(fs$read) { - function read(fd, buffer, offset, length, position, callback_) { - var callback; - if (callback_ && typeof callback_ === "function") { - var eagCounter = 0; - callback = function(er, _, __) { - if (er && er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - return fs$read.call(fs2, fd, buffer, offset, length, position, callback); - } - callback_.apply(this, arguments); - }; - } - return fs$read.call(fs2, fd, buffer, offset, length, position, callback); - } - if (Object.setPrototypeOf) - Object.setPrototypeOf(read, fs$read); - return read; - }(fs2.read); - fs2.readSync = typeof fs2.readSync !== "function" ? fs2.readSync : /* @__PURE__ */ function(fs$readSync) { - return function(fd, buffer, offset, length, position) { - var eagCounter = 0; - while (true) { - try { - return fs$readSync.call(fs2, fd, buffer, offset, length, position); - } catch (er) { - if (er.code === "EAGAIN" && eagCounter < 10) { - eagCounter++; - continue; - } - throw er; - } - } - }; - }(fs2.readSync); - function patchLchmod(fs3) { - fs3.lchmod = function(path, mode, callback) { - fs3.open( - path, - constants.O_WRONLY | constants.O_SYMLINK, - mode, - function(err, fd) { - if (err) { - if (callback) - callback(err); - return; - } - fs3.fchmod(fd, mode, function(err2) { - fs3.close(fd, function(err22) { - if (callback) - callback(err2 || err22); - }); - }); - } - ); - }; - fs3.lchmodSync = function(path, mode) { - var fd = fs3.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode); - var threw = true; - var ret; - try { - ret = fs3.fchmodSync(fd, mode); - threw = false; - } finally { - if (threw) { - try { - fs3.closeSync(fd); - } catch (er) { - } - } else { - fs3.closeSync(fd); - } - } - return ret; - }; - } - function patchLutimes(fs3) { - if (constants.hasOwnProperty("O_SYMLINK") && fs3.futimes) { - fs3.lutimes = function(path, at, mt, cb) { - fs3.open(path, constants.O_SYMLINK, function(er, fd) { - if (er) { - if (cb) - cb(er); - return; - } - fs3.futimes(fd, at, mt, function(er2) { - fs3.close(fd, function(er22) { - if (cb) - cb(er2 || er22); - }); - }); - }); - }; - fs3.lutimesSync = function(path, at, mt) { - var fd = fs3.openSync(path, constants.O_SYMLINK); - var ret; - var threw = true; - try { - ret = fs3.futimesSync(fd, at, mt); - threw = false; - } finally { - if (threw) { - try { - fs3.closeSync(fd); - } catch (er) { - } - } else { - fs3.closeSync(fd); - } - } - return ret; - }; - } else if (fs3.futimes) { - fs3.lutimes = function(_a, _b, _c, cb) { - if (cb) - process.nextTick(cb); - }; - fs3.lutimesSync = function() { - }; - } - } - function chmodFix(orig) { - if (!orig) - return orig; - return function(target, mode, cb) { - return orig.call(fs2, target, mode, function(er) { - if (chownErOk(er)) - er = null; - if (cb) - cb.apply(this, arguments); - }); - }; - } - function chmodFixSync(orig) { - if (!orig) - return orig; - return function(target, mode) { - try { - return orig.call(fs2, target, mode); - } catch (er) { - if (!chownErOk(er)) - throw er; - } - }; - } - function chownFix(orig) { - if (!orig) - return orig; - return function(target, uid, gid, cb) { - return orig.call(fs2, target, uid, gid, function(er) { - if (chownErOk(er)) - er = null; - if (cb) - cb.apply(this, arguments); - }); - }; - } - function chownFixSync(orig) { - if (!orig) - return orig; - return function(target, uid, gid) { - try { - return orig.call(fs2, target, uid, gid); - } catch (er) { - if (!chownErOk(er)) - throw er; - } - }; - } - function statFix(orig) { - if (!orig) - return orig; - return function(target, options, cb) { - if (typeof options === "function") { - cb = options; - options = null; - } - function callback(er, stats) { - if (stats) { - if (stats.uid < 0) - stats.uid += 4294967296; - if (stats.gid < 0) - stats.gid += 4294967296; - } - if (cb) - cb.apply(this, arguments); - } - return options ? orig.call(fs2, target, options, callback) : orig.call(fs2, target, callback); - }; - } - function statFixSync(orig) { - if (!orig) - return orig; - return function(target, options) { - var stats = options ? orig.call(fs2, target, options) : orig.call(fs2, target); - if (stats) { - if (stats.uid < 0) - stats.uid += 4294967296; - if (stats.gid < 0) - stats.gid += 4294967296; - } - return stats; - }; - } - function chownErOk(er) { - if (!er) - return true; - if (er.code === "ENOSYS") - return true; - var nonroot = !process.getuid || process.getuid() !== 0; - if (nonroot) { - if (er.code === "EINVAL" || er.code === "EPERM") - return true; - } - return false; - } - } - } -}); - -// node_modules/graceful-fs/legacy-streams.js -var require_legacy_streams = __commonJS({ - "node_modules/graceful-fs/legacy-streams.js"(exports2, module2) { - var Stream = require("stream").Stream; - module2.exports = legacy; - function legacy(fs2) { - return { - ReadStream, - WriteStream - }; - function ReadStream(path, options) { - if (!(this instanceof ReadStream)) - return new ReadStream(path, options); - Stream.call(this); - var self = this; - this.path = path; - this.fd = null; - this.readable = true; - this.paused = false; - this.flags = "r"; - this.mode = 438; - this.bufferSize = 64 * 1024; - options = options || {}; - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.encoding) - this.setEncoding(this.encoding); - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.end === void 0) { - this.end = Infinity; - } else if ("number" !== typeof this.end) { - throw TypeError("end must be a Number"); - } - if (this.start > this.end) { - throw new Error("start must be <= end"); - } - this.pos = this.start; - } - if (this.fd !== null) { - process.nextTick(function() { - self._read(); - }); - return; - } - fs2.open(this.path, this.flags, this.mode, function(err, fd) { - if (err) { - self.emit("error", err); - self.readable = false; - return; - } - self.fd = fd; - self.emit("open", fd); - self._read(); - }); - } - function WriteStream(path, options) { - if (!(this instanceof WriteStream)) - return new WriteStream(path, options); - Stream.call(this); - this.path = path; - this.fd = null; - this.writable = true; - this.flags = "w"; - this.encoding = "binary"; - this.mode = 438; - this.bytesWritten = 0; - options = options || {}; - var keys = Object.keys(options); - for (var index = 0, length = keys.length; index < length; index++) { - var key = keys[index]; - this[key] = options[key]; - } - if (this.start !== void 0) { - if ("number" !== typeof this.start) { - throw TypeError("start must be a Number"); - } - if (this.start < 0) { - throw new Error("start must be >= zero"); - } - this.pos = this.start; - } - this.busy = false; - this._queue = []; - if (this.fd === null) { - this._open = fs2.open; - this._queue.push([this._open, this.path, this.flags, this.mode, void 0]); - this.flush(); - } - } - } - } -}); - -// node_modules/graceful-fs/clone.js -var require_clone = __commonJS({ - "node_modules/graceful-fs/clone.js"(exports2, module2) { - "use strict"; - module2.exports = clone; - var getPrototypeOf = Object.getPrototypeOf || function(obj) { - return obj.__proto__; - }; - function clone(obj) { - if (obj === null || typeof obj !== "object") - return obj; - if (obj instanceof Object) - var copy = { __proto__: getPrototypeOf(obj) }; - else - var copy = /* @__PURE__ */ Object.create(null); - Object.getOwnPropertyNames(obj).forEach(function(key) { - Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)); - }); - return copy; - } - } -}); - -// node_modules/graceful-fs/graceful-fs.js -var require_graceful_fs = __commonJS({ - "node_modules/graceful-fs/graceful-fs.js"(exports2, module2) { - var fs2 = require("fs"); - var polyfills = require_polyfills(); - var legacy = require_legacy_streams(); - var clone = require_clone(); - var util2 = require("util"); - var gracefulQueue; - var previousSymbol; - if (typeof Symbol === "function" && typeof Symbol.for === "function") { - gracefulQueue = Symbol.for("graceful-fs.queue"); - previousSymbol = Symbol.for("graceful-fs.previous"); - } else { - gracefulQueue = "___graceful-fs.queue"; - previousSymbol = "___graceful-fs.previous"; - } - function noop() { - } - function publishQueue(context, queue2) { - Object.defineProperty(context, gracefulQueue, { - get: function() { - return queue2; - } - }); - } - var debug = noop; - if (util2.debuglog) - debug = util2.debuglog("gfs4"); - else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) - debug = function() { - var m = util2.format.apply(util2, arguments); - m = "GFS4: " + m.split(/\n/).join("\nGFS4: "); - console.error(m); - }; - if (!fs2[gracefulQueue]) { - queue = global[gracefulQueue] || []; - publishQueue(fs2, queue); - fs2.close = function(fs$close) { - function close(fd, cb) { - return fs$close.call(fs2, fd, function(err) { - if (!err) { - resetQueue(); - } - if (typeof cb === "function") - cb.apply(this, arguments); - }); - } - Object.defineProperty(close, previousSymbol, { - value: fs$close - }); - return close; - }(fs2.close); - fs2.closeSync = function(fs$closeSync) { - function closeSync(fd) { - fs$closeSync.apply(fs2, arguments); - resetQueue(); - } - Object.defineProperty(closeSync, previousSymbol, { - value: fs$closeSync - }); - return closeSync; - }(fs2.closeSync); - if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) { - process.on("exit", function() { - debug(fs2[gracefulQueue]); - require("assert").equal(fs2[gracefulQueue].length, 0); - }); - } - } - var queue; - if (!global[gracefulQueue]) { - publishQueue(global, fs2[gracefulQueue]); - } - module2.exports = patch(clone(fs2)); - if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs2.__patched) { - module2.exports = patch(fs2); - fs2.__patched = true; - } - function patch(fs3) { - polyfills(fs3); - fs3.gracefulify = patch; - fs3.createReadStream = createReadStream; - fs3.createWriteStream = createWriteStream; - var fs$readFile = fs3.readFile; - fs3.readFile = readFile; - function readFile(path, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$readFile(path, options, cb); - function go$readFile(path2, options2, cb2, startTime) { - return fs$readFile(path2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$readFile, [path2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$writeFile = fs3.writeFile; - fs3.writeFile = writeFile; - function writeFile(path, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$writeFile(path, data, options, cb); - function go$writeFile(path2, data2, options2, cb2, startTime) { - return fs$writeFile(path2, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$writeFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$appendFile = fs3.appendFile; - if (fs$appendFile) - fs3.appendFile = appendFile; - function appendFile(path, data, options, cb) { - if (typeof options === "function") - cb = options, options = null; - return go$appendFile(path, data, options, cb); - function go$appendFile(path2, data2, options2, cb2, startTime) { - return fs$appendFile(path2, data2, options2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$appendFile, [path2, data2, options2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$copyFile = fs3.copyFile; - if (fs$copyFile) - fs3.copyFile = copyFile; - function copyFile(src, dest, flags, cb) { - if (typeof flags === "function") { - cb = flags; - flags = 0; - } - return go$copyFile(src, dest, flags, cb); - function go$copyFile(src2, dest2, flags2, cb2, startTime) { - return fs$copyFile(src2, dest2, flags2, function(err) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$copyFile, [src2, dest2, flags2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - var fs$readdir = fs3.readdir; - fs3.readdir = readdir; - var noReaddirOptionVersions = /^v[0-5]\./; - function readdir(path, options, cb) { - if (typeof options === "function") - cb = options, options = null; - var go$readdir = noReaddirOptionVersions.test(process.version) ? function go$readdir2(path2, options2, cb2, startTime) { - return fs$readdir(path2, fs$readdirCallback( - path2, - options2, - cb2, - startTime - )); - } : function go$readdir2(path2, options2, cb2, startTime) { - return fs$readdir(path2, options2, fs$readdirCallback( - path2, - options2, - cb2, - startTime - )); - }; - return go$readdir(path, options, cb); - function fs$readdirCallback(path2, options2, cb2, startTime) { - return function(err, files) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([ - go$readdir, - [path2, options2, cb2], - err, - startTime || Date.now(), - Date.now() - ]); - else { - if (files && files.sort) - files.sort(); - if (typeof cb2 === "function") - cb2.call(this, err, files); - } - }; - } - } - if (process.version.substr(0, 4) === "v0.8") { - var legStreams = legacy(fs3); - ReadStream = legStreams.ReadStream; - WriteStream = legStreams.WriteStream; - } - var fs$ReadStream = fs3.ReadStream; - if (fs$ReadStream) { - ReadStream.prototype = Object.create(fs$ReadStream.prototype); - ReadStream.prototype.open = ReadStream$open; - } - var fs$WriteStream = fs3.WriteStream; - if (fs$WriteStream) { - WriteStream.prototype = Object.create(fs$WriteStream.prototype); - WriteStream.prototype.open = WriteStream$open; - } - Object.defineProperty(fs3, "ReadStream", { - get: function() { - return ReadStream; - }, - set: function(val) { - ReadStream = val; - }, - enumerable: true, - configurable: true - }); - Object.defineProperty(fs3, "WriteStream", { - get: function() { - return WriteStream; - }, - set: function(val) { - WriteStream = val; - }, - enumerable: true, - configurable: true - }); - var FileReadStream = ReadStream; - Object.defineProperty(fs3, "FileReadStream", { - get: function() { - return FileReadStream; - }, - set: function(val) { - FileReadStream = val; - }, - enumerable: true, - configurable: true - }); - var FileWriteStream = WriteStream; - Object.defineProperty(fs3, "FileWriteStream", { - get: function() { - return FileWriteStream; - }, - set: function(val) { - FileWriteStream = val; - }, - enumerable: true, - configurable: true - }); - function ReadStream(path, options) { - if (this instanceof ReadStream) - return fs$ReadStream.apply(this, arguments), this; - else - return ReadStream.apply(Object.create(ReadStream.prototype), arguments); - } - function ReadStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - if (that.autoClose) - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - that.read(); - } - }); - } - function WriteStream(path, options) { - if (this instanceof WriteStream) - return fs$WriteStream.apply(this, arguments), this; - else - return WriteStream.apply(Object.create(WriteStream.prototype), arguments); - } - function WriteStream$open() { - var that = this; - open(that.path, that.flags, that.mode, function(err, fd) { - if (err) { - that.destroy(); - that.emit("error", err); - } else { - that.fd = fd; - that.emit("open", fd); - } - }); - } - function createReadStream(path, options) { - return new fs3.ReadStream(path, options); - } - function createWriteStream(path, options) { - return new fs3.WriteStream(path, options); - } - var fs$open = fs3.open; - fs3.open = open; - function open(path, flags, mode, cb) { - if (typeof mode === "function") - cb = mode, mode = null; - return go$open(path, flags, mode, cb); - function go$open(path2, flags2, mode2, cb2, startTime) { - return fs$open(path2, flags2, mode2, function(err, fd) { - if (err && (err.code === "EMFILE" || err.code === "ENFILE")) - enqueue([go$open, [path2, flags2, mode2, cb2], err, startTime || Date.now(), Date.now()]); - else { - if (typeof cb2 === "function") - cb2.apply(this, arguments); - } - }); - } - } - return fs3; - } - function enqueue(elem) { - debug("ENQUEUE", elem[0].name, elem[1]); - fs2[gracefulQueue].push(elem); - retry(); - } - var retryTimer; - function resetQueue() { - var now = Date.now(); - for (var i = 0; i < fs2[gracefulQueue].length; ++i) { - if (fs2[gracefulQueue][i].length > 2) { - fs2[gracefulQueue][i][3] = now; - fs2[gracefulQueue][i][4] = now; - } - } - retry(); - } - function retry() { - clearTimeout(retryTimer); - retryTimer = void 0; - if (fs2[gracefulQueue].length === 0) - return; - var elem = fs2[gracefulQueue].shift(); - var fn = elem[0]; - var args = elem[1]; - var err = elem[2]; - var startTime = elem[3]; - var lastTime = elem[4]; - if (startTime === void 0) { - debug("RETRY", fn.name, args); - fn.apply(null, args); - } else if (Date.now() - startTime >= 6e4) { - debug("TIMEOUT", fn.name, args); - var cb = args.pop(); - if (typeof cb === "function") - cb.call(null, err); - } else { - var sinceAttempt = Date.now() - lastTime; - var sinceStart = Math.max(lastTime - startTime, 1); - var desiredDelay = Math.min(sinceStart * 1.2, 100); - if (sinceAttempt >= desiredDelay) { - debug("RETRY", fn.name, args); - fn.apply(null, args.concat([startTime])); - } else { - fs2[gracefulQueue].push(elem); - } - } - if (retryTimer === void 0) { - retryTimer = setTimeout(retry, 0); - } - } - } -}); - -// node_modules/fs-extra/lib/fs/index.js -var require_fs = __commonJS({ - "node_modules/fs-extra/lib/fs/index.js"(exports2) { - "use strict"; - var u = require_universalify().fromCallback; - var fs2 = require_graceful_fs(); - var api = [ - "access", - "appendFile", - "chmod", - "chown", - "close", - "copyFile", - "fchmod", - "fchown", - "fdatasync", - "fstat", - "fsync", - "ftruncate", - "futimes", - "lchmod", - "lchown", - "link", - "lstat", - "mkdir", - "mkdtemp", - "open", - "opendir", - "readdir", - "readFile", - "readlink", - "realpath", - "rename", - "rm", - "rmdir", - "stat", - "symlink", - "truncate", - "unlink", - "utimes", - "writeFile" - ].filter((key) => { - return typeof fs2[key] === "function"; - }); - Object.assign(exports2, fs2); - api.forEach((method) => { - exports2[method] = u(fs2[method]); - }); - exports2.exists = function(filename, callback) { - if (typeof callback === "function") { - return fs2.exists(filename, callback); - } - return new Promise((resolve) => { - return fs2.exists(filename, resolve); - }); - }; - exports2.read = function(fd, buffer, offset, length, position, callback) { - if (typeof callback === "function") { - return fs2.read(fd, buffer, offset, length, position, callback); - } - return new Promise((resolve, reject) => { - fs2.read(fd, buffer, offset, length, position, (err, bytesRead, buffer2) => { - if (err) - return reject(err); - resolve({ bytesRead, buffer: buffer2 }); - }); - }); - }; - exports2.write = function(fd, buffer, ...args) { - if (typeof args[args.length - 1] === "function") { - return fs2.write(fd, buffer, ...args); - } - return new Promise((resolve, reject) => { - fs2.write(fd, buffer, ...args, (err, bytesWritten, buffer2) => { - if (err) - return reject(err); - resolve({ bytesWritten, buffer: buffer2 }); - }); - }); - }; - exports2.readv = function(fd, buffers, ...args) { - if (typeof args[args.length - 1] === "function") { - return fs2.readv(fd, buffers, ...args); - } - return new Promise((resolve, reject) => { - fs2.readv(fd, buffers, ...args, (err, bytesRead, buffers2) => { - if (err) - return reject(err); - resolve({ bytesRead, buffers: buffers2 }); - }); - }); - }; - exports2.writev = function(fd, buffers, ...args) { - if (typeof args[args.length - 1] === "function") { - return fs2.writev(fd, buffers, ...args); - } - return new Promise((resolve, reject) => { - fs2.writev(fd, buffers, ...args, (err, bytesWritten, buffers2) => { - if (err) - return reject(err); - resolve({ bytesWritten, buffers: buffers2 }); - }); - }); - }; - if (typeof fs2.realpath.native === "function") { - exports2.realpath.native = u(fs2.realpath.native); - } else { - process.emitWarning( - "fs.realpath.native is not a function. Is fs being monkey-patched?", - "Warning", - "fs-extra-WARN0003" - ); - } - } -}); - -// node_modules/fs-extra/lib/mkdirs/utils.js -var require_utils = __commonJS({ - "node_modules/fs-extra/lib/mkdirs/utils.js"(exports2, module2) { - "use strict"; - var path = require("path"); - module2.exports.checkPath = function checkPath(pth) { - if (process.platform === "win32") { - const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, "")); - if (pathHasInvalidWinCharacters) { - const error = new Error(`Path contains invalid characters: ${pth}`); - error.code = "EINVAL"; - throw error; - } - } - }; - } -}); - -// node_modules/fs-extra/lib/mkdirs/make-dir.js -var require_make_dir = __commonJS({ - "node_modules/fs-extra/lib/mkdirs/make-dir.js"(exports2, module2) { - "use strict"; - var fs2 = require_fs(); - var { checkPath } = require_utils(); - var getMode = (options) => { - const defaults = { mode: 511 }; - if (typeof options === "number") - return options; - return { ...defaults, ...options }.mode; - }; - module2.exports.makeDir = async (dir, options) => { - checkPath(dir); - return fs2.mkdir(dir, { - mode: getMode(options), - recursive: true - }); - }; - module2.exports.makeDirSync = (dir, options) => { - checkPath(dir); - return fs2.mkdirSync(dir, { - mode: getMode(options), - recursive: true - }); - }; - } -}); - -// node_modules/fs-extra/lib/mkdirs/index.js -var require_mkdirs = __commonJS({ - "node_modules/fs-extra/lib/mkdirs/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var { makeDir: _makeDir, makeDirSync } = require_make_dir(); - var makeDir = u(_makeDir); - module2.exports = { - mkdirs: makeDir, - mkdirsSync: makeDirSync, - // alias - mkdirp: makeDir, - mkdirpSync: makeDirSync, - ensureDir: makeDir, - ensureDirSync: makeDirSync - }; - } -}); - -// node_modules/fs-extra/lib/path-exists/index.js -var require_path_exists = __commonJS({ - "node_modules/fs-extra/lib/path-exists/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var fs2 = require_fs(); - function pathExists(path) { - return fs2.access(path).then(() => true).catch(() => false); - } - module2.exports = { - pathExists: u(pathExists), - pathExistsSync: fs2.existsSync - }; - } -}); - -// node_modules/fs-extra/lib/util/utimes.js -var require_utimes = __commonJS({ - "node_modules/fs-extra/lib/util/utimes.js"(exports2, module2) { - "use strict"; - var fs2 = require_fs(); - var u = require_universalify().fromPromise; - async function utimesMillis(path, atime, mtime) { - const fd = await fs2.open(path, "r+"); - let closeErr = null; - try { - await fs2.futimes(fd, atime, mtime); - } finally { - try { - await fs2.close(fd); - } catch (e) { - closeErr = e; - } - } - if (closeErr) { - throw closeErr; - } - } - function utimesMillisSync(path, atime, mtime) { - const fd = fs2.openSync(path, "r+"); - fs2.futimesSync(fd, atime, mtime); - return fs2.closeSync(fd); - } - module2.exports = { - utimesMillis: u(utimesMillis), - utimesMillisSync - }; - } -}); - -// node_modules/fs-extra/lib/util/stat.js -var require_stat = __commonJS({ - "node_modules/fs-extra/lib/util/stat.js"(exports2, module2) { - "use strict"; - var fs2 = require_fs(); - var path = require("path"); - var u = require_universalify().fromPromise; - function getStats(src, dest, opts) { - const statFunc = opts.dereference ? (file) => fs2.stat(file, { bigint: true }) : (file) => fs2.lstat(file, { bigint: true }); - return Promise.all([ - statFunc(src), - statFunc(dest).catch((err) => { - if (err.code === "ENOENT") - return null; - throw err; - }) - ]).then(([srcStat, destStat]) => ({ srcStat, destStat })); - } - function getStatsSync(src, dest, opts) { - let destStat; - const statFunc = opts.dereference ? (file) => fs2.statSync(file, { bigint: true }) : (file) => fs2.lstatSync(file, { bigint: true }); - const srcStat = statFunc(src); - try { - destStat = statFunc(dest); - } catch (err) { - if (err.code === "ENOENT") - return { srcStat, destStat: null }; - throw err; - } - return { srcStat, destStat }; - } - async function checkPaths(src, dest, funcName, opts) { - const { srcStat, destStat } = await getStats(src, dest, opts); - if (destStat) { - if (areIdentical(srcStat, destStat)) { - const srcBaseName = path.basename(src); - const destBaseName = path.basename(dest); - if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { - return { srcStat, destStat, isChangingCase: true }; - } - throw new Error("Source and destination must not be the same."); - } - if (srcStat.isDirectory() && !destStat.isDirectory()) { - throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); - } - if (!srcStat.isDirectory() && destStat.isDirectory()) { - throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); - } - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - throw new Error(errMsg(src, dest, funcName)); - } - return { srcStat, destStat }; - } - function checkPathsSync(src, dest, funcName, opts) { - const { srcStat, destStat } = getStatsSync(src, dest, opts); - if (destStat) { - if (areIdentical(srcStat, destStat)) { - const srcBaseName = path.basename(src); - const destBaseName = path.basename(dest); - if (funcName === "move" && srcBaseName !== destBaseName && srcBaseName.toLowerCase() === destBaseName.toLowerCase()) { - return { srcStat, destStat, isChangingCase: true }; - } - throw new Error("Source and destination must not be the same."); - } - if (srcStat.isDirectory() && !destStat.isDirectory()) { - throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`); - } - if (!srcStat.isDirectory() && destStat.isDirectory()) { - throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`); - } - } - if (srcStat.isDirectory() && isSrcSubdir(src, dest)) { - throw new Error(errMsg(src, dest, funcName)); - } - return { srcStat, destStat }; - } - async function checkParentPaths(src, srcStat, dest, funcName) { - const srcParent = path.resolve(path.dirname(src)); - const destParent = path.resolve(path.dirname(dest)); - if (destParent === srcParent || destParent === path.parse(destParent).root) - return; - let destStat; - try { - destStat = await fs2.stat(destParent, { bigint: true }); - } catch (err) { - if (err.code === "ENOENT") - return; - throw err; - } - if (areIdentical(srcStat, destStat)) { - throw new Error(errMsg(src, dest, funcName)); - } - return checkParentPaths(src, srcStat, destParent, funcName); - } - function checkParentPathsSync(src, srcStat, dest, funcName) { - const srcParent = path.resolve(path.dirname(src)); - const destParent = path.resolve(path.dirname(dest)); - if (destParent === srcParent || destParent === path.parse(destParent).root) - return; - let destStat; - try { - destStat = fs2.statSync(destParent, { bigint: true }); - } catch (err) { - if (err.code === "ENOENT") - return; - throw err; - } - if (areIdentical(srcStat, destStat)) { - throw new Error(errMsg(src, dest, funcName)); - } - return checkParentPathsSync(src, srcStat, destParent, funcName); - } - function areIdentical(srcStat, destStat) { - return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev; - } - function isSrcSubdir(src, dest) { - const srcArr = path.resolve(src).split(path.sep).filter((i) => i); - const destArr = path.resolve(dest).split(path.sep).filter((i) => i); - return srcArr.every((cur, i) => destArr[i] === cur); - } - function errMsg(src, dest, funcName) { - return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`; - } - module2.exports = { - // checkPaths - checkPaths: u(checkPaths), - checkPathsSync, - // checkParent - checkParentPaths: u(checkParentPaths), - checkParentPathsSync, - // Misc - isSrcSubdir, - areIdentical - }; - } -}); - -// node_modules/fs-extra/lib/copy/copy.js -var require_copy = __commonJS({ - "node_modules/fs-extra/lib/copy/copy.js"(exports2, module2) { - "use strict"; - var fs2 = require_fs(); - var path = require("path"); - var { mkdirs } = require_mkdirs(); - var { pathExists } = require_path_exists(); - var { utimesMillis } = require_utimes(); - var stat = require_stat(); - async function copy(src, dest, opts = {}) { - if (typeof opts === "function") { - opts = { filter: opts }; - } - opts.clobber = "clobber" in opts ? !!opts.clobber : true; - opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; - if (opts.preserveTimestamps && process.arch === "ia32") { - process.emitWarning( - "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", - "Warning", - "fs-extra-WARN0001" - ); - } - const { srcStat, destStat } = await stat.checkPaths(src, dest, "copy", opts); - await stat.checkParentPaths(src, srcStat, dest, "copy"); - const include = await runFilter(src, dest, opts); - if (!include) - return; - const destParent = path.dirname(dest); - const dirExists = await pathExists(destParent); - if (!dirExists) { - await mkdirs(destParent); - } - await getStatsAndPerformCopy(destStat, src, dest, opts); - } - async function runFilter(src, dest, opts) { - if (!opts.filter) - return true; - return opts.filter(src, dest); - } - async function getStatsAndPerformCopy(destStat, src, dest, opts) { - const statFn = opts.dereference ? fs2.stat : fs2.lstat; - const srcStat = await statFn(src); - if (srcStat.isDirectory()) - return onDir(srcStat, destStat, src, dest, opts); - if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) - return onFile(srcStat, destStat, src, dest, opts); - if (srcStat.isSymbolicLink()) - return onLink(destStat, src, dest, opts); - if (srcStat.isSocket()) - throw new Error(`Cannot copy a socket file: ${src}`); - if (srcStat.isFIFO()) - throw new Error(`Cannot copy a FIFO pipe: ${src}`); - throw new Error(`Unknown file: ${src}`); - } - async function onFile(srcStat, destStat, src, dest, opts) { - if (!destStat) - return copyFile(srcStat, src, dest, opts); - if (opts.overwrite) { - await fs2.unlink(dest); - return copyFile(srcStat, src, dest, opts); - } - if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`); - } - } - async function copyFile(srcStat, src, dest, opts) { - await fs2.copyFile(src, dest); - if (opts.preserveTimestamps) { - if (fileIsNotWritable(srcStat.mode)) { - await makeFileWritable(dest, srcStat.mode); - } - const updatedSrcStat = await fs2.stat(src); - await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime); - } - return fs2.chmod(dest, srcStat.mode); - } - function fileIsNotWritable(srcMode) { - return (srcMode & 128) === 0; - } - function makeFileWritable(dest, srcMode) { - return fs2.chmod(dest, srcMode | 128); - } - async function onDir(srcStat, destStat, src, dest, opts) { - if (!destStat) { - await fs2.mkdir(dest); - } - const items = await fs2.readdir(src); - await Promise.all(items.map(async (item) => { - const srcItem = path.join(src, item); - const destItem = path.join(dest, item); - const include = await runFilter(srcItem, destItem, opts); - if (!include) - return; - const { destStat: destStat2 } = await stat.checkPaths(srcItem, destItem, "copy", opts); - return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts); - })); - if (!destStat) { - await fs2.chmod(dest, srcStat.mode); - } - } - async function onLink(destStat, src, dest, opts) { - let resolvedSrc = await fs2.readlink(src); - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc); - } - if (!destStat) { - return fs2.symlink(resolvedSrc, dest); - } - let resolvedDest = null; - try { - resolvedDest = await fs2.readlink(dest); - } catch (e) { - if (e.code === "EINVAL" || e.code === "UNKNOWN") - return fs2.symlink(resolvedSrc, dest); - throw e; - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest); - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); - } - if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); - } - await fs2.unlink(dest); - return fs2.symlink(resolvedSrc, dest); - } - module2.exports = copy; - } -}); - -// node_modules/fs-extra/lib/copy/copy-sync.js -var require_copy_sync = __commonJS({ - "node_modules/fs-extra/lib/copy/copy-sync.js"(exports2, module2) { - "use strict"; - var fs2 = require_graceful_fs(); - var path = require("path"); - var mkdirsSync = require_mkdirs().mkdirsSync; - var utimesMillisSync = require_utimes().utimesMillisSync; - var stat = require_stat(); - function copySync(src, dest, opts) { - if (typeof opts === "function") { - opts = { filter: opts }; - } - opts = opts || {}; - opts.clobber = "clobber" in opts ? !!opts.clobber : true; - opts.overwrite = "overwrite" in opts ? !!opts.overwrite : opts.clobber; - if (opts.preserveTimestamps && process.arch === "ia32") { - process.emitWarning( - "Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269", - "Warning", - "fs-extra-WARN0002" - ); - } - const { srcStat, destStat } = stat.checkPathsSync(src, dest, "copy", opts); - stat.checkParentPathsSync(src, srcStat, dest, "copy"); - if (opts.filter && !opts.filter(src, dest)) - return; - const destParent = path.dirname(dest); - if (!fs2.existsSync(destParent)) - mkdirsSync(destParent); - return getStats(destStat, src, dest, opts); - } - function getStats(destStat, src, dest, opts) { - const statSync = opts.dereference ? fs2.statSync : fs2.lstatSync; - const srcStat = statSync(src); - if (srcStat.isDirectory()) - return onDir(srcStat, destStat, src, dest, opts); - else if (srcStat.isFile() || srcStat.isCharacterDevice() || srcStat.isBlockDevice()) - return onFile(srcStat, destStat, src, dest, opts); - else if (srcStat.isSymbolicLink()) - return onLink(destStat, src, dest, opts); - else if (srcStat.isSocket()) - throw new Error(`Cannot copy a socket file: ${src}`); - else if (srcStat.isFIFO()) - throw new Error(`Cannot copy a FIFO pipe: ${src}`); - throw new Error(`Unknown file: ${src}`); - } - function onFile(srcStat, destStat, src, dest, opts) { - if (!destStat) - return copyFile(srcStat, src, dest, opts); - return mayCopyFile(srcStat, src, dest, opts); - } - function mayCopyFile(srcStat, src, dest, opts) { - if (opts.overwrite) { - fs2.unlinkSync(dest); - return copyFile(srcStat, src, dest, opts); - } else if (opts.errorOnExist) { - throw new Error(`'${dest}' already exists`); - } - } - function copyFile(srcStat, src, dest, opts) { - fs2.copyFileSync(src, dest); - if (opts.preserveTimestamps) - handleTimestamps(srcStat.mode, src, dest); - return setDestMode(dest, srcStat.mode); - } - function handleTimestamps(srcMode, src, dest) { - if (fileIsNotWritable(srcMode)) - makeFileWritable(dest, srcMode); - return setDestTimestamps(src, dest); - } - function fileIsNotWritable(srcMode) { - return (srcMode & 128) === 0; - } - function makeFileWritable(dest, srcMode) { - return setDestMode(dest, srcMode | 128); - } - function setDestMode(dest, srcMode) { - return fs2.chmodSync(dest, srcMode); - } - function setDestTimestamps(src, dest) { - const updatedSrcStat = fs2.statSync(src); - return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime); - } - function onDir(srcStat, destStat, src, dest, opts) { - if (!destStat) - return mkDirAndCopy(srcStat.mode, src, dest, opts); - return copyDir(src, dest, opts); - } - function mkDirAndCopy(srcMode, src, dest, opts) { - fs2.mkdirSync(dest); - copyDir(src, dest, opts); - return setDestMode(dest, srcMode); - } - function copyDir(src, dest, opts) { - fs2.readdirSync(src).forEach((item) => copyDirItem(item, src, dest, opts)); - } - function copyDirItem(item, src, dest, opts) { - const srcItem = path.join(src, item); - const destItem = path.join(dest, item); - if (opts.filter && !opts.filter(srcItem, destItem)) - return; - const { destStat } = stat.checkPathsSync(srcItem, destItem, "copy", opts); - return getStats(destStat, srcItem, destItem, opts); - } - function onLink(destStat, src, dest, opts) { - let resolvedSrc = fs2.readlinkSync(src); - if (opts.dereference) { - resolvedSrc = path.resolve(process.cwd(), resolvedSrc); - } - if (!destStat) { - return fs2.symlinkSync(resolvedSrc, dest); - } else { - let resolvedDest; - try { - resolvedDest = fs2.readlinkSync(dest); - } catch (err) { - if (err.code === "EINVAL" || err.code === "UNKNOWN") - return fs2.symlinkSync(resolvedSrc, dest); - throw err; - } - if (opts.dereference) { - resolvedDest = path.resolve(process.cwd(), resolvedDest); - } - if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) { - throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`); - } - if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) { - throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`); - } - return copyLink(resolvedSrc, dest); - } - } - function copyLink(resolvedSrc, dest) { - fs2.unlinkSync(dest); - return fs2.symlinkSync(resolvedSrc, dest); - } - module2.exports = copySync; - } -}); - -// node_modules/fs-extra/lib/copy/index.js -var require_copy2 = __commonJS({ - "node_modules/fs-extra/lib/copy/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - module2.exports = { - copy: u(require_copy()), - copySync: require_copy_sync() - }; - } -}); - -// node_modules/fs-extra/lib/remove/index.js -var require_remove = __commonJS({ - "node_modules/fs-extra/lib/remove/index.js"(exports2, module2) { - "use strict"; - var fs2 = require_graceful_fs(); - var u = require_universalify().fromCallback; - function remove(path, callback) { - fs2.rm(path, { recursive: true, force: true }, callback); - } - function removeSync2(path) { - fs2.rmSync(path, { recursive: true, force: true }); - } - module2.exports = { - remove: u(remove), - removeSync: removeSync2 - }; - } -}); - -// node_modules/fs-extra/lib/empty/index.js -var require_empty = __commonJS({ - "node_modules/fs-extra/lib/empty/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var fs2 = require_fs(); - var path = require("path"); - var mkdir = require_mkdirs(); - var remove = require_remove(); - var emptyDir = u(async function emptyDir2(dir) { - let items; - try { - items = await fs2.readdir(dir); - } catch { - return mkdir.mkdirs(dir); - } - return Promise.all(items.map((item) => remove.remove(path.join(dir, item)))); - }); - function emptyDirSync(dir) { - let items; - try { - items = fs2.readdirSync(dir); - } catch { - return mkdir.mkdirsSync(dir); - } - items.forEach((item) => { - item = path.join(dir, item); - remove.removeSync(item); - }); - } - module2.exports = { - emptyDirSync, - emptydirSync: emptyDirSync, - emptyDir, - emptydir: emptyDir - }; - } -}); - -// node_modules/fs-extra/lib/ensure/file.js -var require_file = __commonJS({ - "node_modules/fs-extra/lib/ensure/file.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var path = require("path"); - var fs2 = require_fs(); - var mkdir = require_mkdirs(); - async function createFile(file) { - let stats; - try { - stats = await fs2.stat(file); - } catch { - } - if (stats && stats.isFile()) - return; - const dir = path.dirname(file); - let dirStats = null; - try { - dirStats = await fs2.stat(dir); - } catch (err) { - if (err.code === "ENOENT") { - await mkdir.mkdirs(dir); - await fs2.writeFile(file, ""); - return; - } else { - throw err; - } - } - if (dirStats.isDirectory()) { - await fs2.writeFile(file, ""); - } else { - await fs2.readdir(dir); - } - } - function createFileSync(file) { - let stats; - try { - stats = fs2.statSync(file); - } catch { - } - if (stats && stats.isFile()) - return; - const dir = path.dirname(file); - try { - if (!fs2.statSync(dir).isDirectory()) { - fs2.readdirSync(dir); - } - } catch (err) { - if (err && err.code === "ENOENT") - mkdir.mkdirsSync(dir); - else - throw err; - } - fs2.writeFileSync(file, ""); - } - module2.exports = { - createFile: u(createFile), - createFileSync - }; - } -}); - -// node_modules/fs-extra/lib/ensure/link.js -var require_link = __commonJS({ - "node_modules/fs-extra/lib/ensure/link.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var path = require("path"); - var fs2 = require_fs(); - var mkdir = require_mkdirs(); - var { pathExists } = require_path_exists(); - var { areIdentical } = require_stat(); - async function createLink(srcpath, dstpath) { - let dstStat; - try { - dstStat = await fs2.lstat(dstpath); - } catch { - } - let srcStat; - try { - srcStat = await fs2.lstat(srcpath); - } catch (err) { - err.message = err.message.replace("lstat", "ensureLink"); - throw err; - } - if (dstStat && areIdentical(srcStat, dstStat)) - return; - const dir = path.dirname(dstpath); - const dirExists = await pathExists(dir); - if (!dirExists) { - await mkdir.mkdirs(dir); - } - await fs2.link(srcpath, dstpath); - } - function createLinkSync(srcpath, dstpath) { - let dstStat; - try { - dstStat = fs2.lstatSync(dstpath); - } catch { - } - try { - const srcStat = fs2.lstatSync(srcpath); - if (dstStat && areIdentical(srcStat, dstStat)) - return; - } catch (err) { - err.message = err.message.replace("lstat", "ensureLink"); - throw err; - } - const dir = path.dirname(dstpath); - const dirExists = fs2.existsSync(dir); - if (dirExists) - return fs2.linkSync(srcpath, dstpath); - mkdir.mkdirsSync(dir); - return fs2.linkSync(srcpath, dstpath); - } - module2.exports = { - createLink: u(createLink), - createLinkSync - }; - } -}); - -// node_modules/fs-extra/lib/ensure/symlink-paths.js -var require_symlink_paths = __commonJS({ - "node_modules/fs-extra/lib/ensure/symlink-paths.js"(exports2, module2) { - "use strict"; - var path = require("path"); - var fs2 = require_fs(); - var { pathExists } = require_path_exists(); - var u = require_universalify().fromPromise; - async function symlinkPaths(srcpath, dstpath) { - if (path.isAbsolute(srcpath)) { - try { - await fs2.lstat(srcpath); - } catch (err) { - err.message = err.message.replace("lstat", "ensureSymlink"); - throw err; - } - return { - toCwd: srcpath, - toDst: srcpath - }; - } - const dstdir = path.dirname(dstpath); - const relativeToDst = path.join(dstdir, srcpath); - const exists = await pathExists(relativeToDst); - if (exists) { - return { - toCwd: relativeToDst, - toDst: srcpath - }; - } - try { - await fs2.lstat(srcpath); - } catch (err) { - err.message = err.message.replace("lstat", "ensureSymlink"); - throw err; - } - return { - toCwd: srcpath, - toDst: path.relative(dstdir, srcpath) - }; - } - function symlinkPathsSync(srcpath, dstpath) { - if (path.isAbsolute(srcpath)) { - const exists2 = fs2.existsSync(srcpath); - if (!exists2) - throw new Error("absolute srcpath does not exist"); - return { - toCwd: srcpath, - toDst: srcpath - }; - } - const dstdir = path.dirname(dstpath); - const relativeToDst = path.join(dstdir, srcpath); - const exists = fs2.existsSync(relativeToDst); - if (exists) { - return { - toCwd: relativeToDst, - toDst: srcpath - }; - } - const srcExists = fs2.existsSync(srcpath); - if (!srcExists) - throw new Error("relative srcpath does not exist"); - return { - toCwd: srcpath, - toDst: path.relative(dstdir, srcpath) - }; - } - module2.exports = { - symlinkPaths: u(symlinkPaths), - symlinkPathsSync - }; - } -}); - -// node_modules/fs-extra/lib/ensure/symlink-type.js -var require_symlink_type = __commonJS({ - "node_modules/fs-extra/lib/ensure/symlink-type.js"(exports2, module2) { - "use strict"; - var fs2 = require_fs(); - var u = require_universalify().fromPromise; - async function symlinkType(srcpath, type) { - if (type) - return type; - let stats; - try { - stats = await fs2.lstat(srcpath); - } catch { - return "file"; - } - return stats && stats.isDirectory() ? "dir" : "file"; - } - function symlinkTypeSync(srcpath, type) { - if (type) - return type; - let stats; - try { - stats = fs2.lstatSync(srcpath); - } catch { - return "file"; - } - return stats && stats.isDirectory() ? "dir" : "file"; - } - module2.exports = { - symlinkType: u(symlinkType), - symlinkTypeSync - }; - } -}); - -// node_modules/fs-extra/lib/ensure/symlink.js -var require_symlink = __commonJS({ - "node_modules/fs-extra/lib/ensure/symlink.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var path = require("path"); - var fs2 = require_fs(); - var { mkdirs, mkdirsSync } = require_mkdirs(); - var { symlinkPaths, symlinkPathsSync } = require_symlink_paths(); - var { symlinkType, symlinkTypeSync } = require_symlink_type(); - var { pathExists } = require_path_exists(); - var { areIdentical } = require_stat(); - async function createSymlink(srcpath, dstpath, type) { - let stats; - try { - stats = await fs2.lstat(dstpath); - } catch { - } - if (stats && stats.isSymbolicLink()) { - const [srcStat, dstStat] = await Promise.all([ - fs2.stat(srcpath), - fs2.stat(dstpath) - ]); - if (areIdentical(srcStat, dstStat)) - return; - } - const relative = await symlinkPaths(srcpath, dstpath); - srcpath = relative.toDst; - const toType = await symlinkType(relative.toCwd, type); - const dir = path.dirname(dstpath); - if (!await pathExists(dir)) { - await mkdirs(dir); - } - return fs2.symlink(srcpath, dstpath, toType); - } - function createSymlinkSync(srcpath, dstpath, type) { - let stats; - try { - stats = fs2.lstatSync(dstpath); - } catch { - } - if (stats && stats.isSymbolicLink()) { - const srcStat = fs2.statSync(srcpath); - const dstStat = fs2.statSync(dstpath); - if (areIdentical(srcStat, dstStat)) - return; - } - const relative = symlinkPathsSync(srcpath, dstpath); - srcpath = relative.toDst; - type = symlinkTypeSync(relative.toCwd, type); - const dir = path.dirname(dstpath); - const exists = fs2.existsSync(dir); - if (exists) - return fs2.symlinkSync(srcpath, dstpath, type); - mkdirsSync(dir); - return fs2.symlinkSync(srcpath, dstpath, type); - } - module2.exports = { - createSymlink: u(createSymlink), - createSymlinkSync - }; - } -}); - -// node_modules/fs-extra/lib/ensure/index.js -var require_ensure = __commonJS({ - "node_modules/fs-extra/lib/ensure/index.js"(exports2, module2) { - "use strict"; - var { createFile, createFileSync } = require_file(); - var { createLink, createLinkSync } = require_link(); - var { createSymlink, createSymlinkSync } = require_symlink(); - module2.exports = { - // file - createFile, - createFileSync, - ensureFile: createFile, - ensureFileSync: createFileSync, - // link - createLink, - createLinkSync, - ensureLink: createLink, - ensureLinkSync: createLinkSync, - // symlink - createSymlink, - createSymlinkSync, - ensureSymlink: createSymlink, - ensureSymlinkSync: createSymlinkSync - }; - } -}); - -// node_modules/jsonfile/utils.js -var require_utils2 = __commonJS({ - "node_modules/jsonfile/utils.js"(exports2, module2) { - function stringify(obj, { EOL = "\n", finalEOL = true, replacer = null, spaces } = {}) { - const EOF = finalEOL ? EOL : ""; - const str = JSON.stringify(obj, replacer, spaces); - return str.replace(/\n/g, EOL) + EOF; - } - function stripBom(content) { - if (Buffer.isBuffer(content)) - content = content.toString("utf8"); - return content.replace(/^\uFEFF/, ""); - } - module2.exports = { stringify, stripBom }; - } -}); - -// node_modules/jsonfile/index.js -var require_jsonfile = __commonJS({ - "node_modules/jsonfile/index.js"(exports2, module2) { - var _fs; - try { - _fs = require_graceful_fs(); - } catch (_) { - _fs = require("fs"); - } - var universalify = require_universalify(); - var { stringify, stripBom } = require_utils2(); - async function _readFile(file, options = {}) { - if (typeof options === "string") { - options = { encoding: options }; - } - const fs2 = options.fs || _fs; - const shouldThrow = "throws" in options ? options.throws : true; - let data = await universalify.fromCallback(fs2.readFile)(file, options); - data = stripBom(data); - let obj; - try { - obj = JSON.parse(data, options ? options.reviver : null); - } catch (err) { - if (shouldThrow) { - err.message = `${file}: ${err.message}`; - throw err; - } else { - return null; - } - } - return obj; - } - var readFile = universalify.fromPromise(_readFile); - function readFileSync(file, options = {}) { - if (typeof options === "string") { - options = { encoding: options }; - } - const fs2 = options.fs || _fs; - const shouldThrow = "throws" in options ? options.throws : true; - try { - let content = fs2.readFileSync(file, options); - content = stripBom(content); - return JSON.parse(content, options.reviver); - } catch (err) { - if (shouldThrow) { - err.message = `${file}: ${err.message}`; - throw err; - } else { - return null; - } - } - } - async function _writeFile(file, obj, options = {}) { - const fs2 = options.fs || _fs; - const str = stringify(obj, options); - await universalify.fromCallback(fs2.writeFile)(file, str, options); - } - var writeFile = universalify.fromPromise(_writeFile); - function writeFileSync(file, obj, options = {}) { - const fs2 = options.fs || _fs; - const str = stringify(obj, options); - return fs2.writeFileSync(file, str, options); - } - var jsonfile = { - readFile, - readFileSync, - writeFile, - writeFileSync - }; - module2.exports = jsonfile; - } -}); - -// node_modules/fs-extra/lib/json/jsonfile.js -var require_jsonfile2 = __commonJS({ - "node_modules/fs-extra/lib/json/jsonfile.js"(exports2, module2) { - "use strict"; - var jsonFile = require_jsonfile(); - module2.exports = { - // jsonfile exports - readJson: jsonFile.readFile, - readJsonSync: jsonFile.readFileSync, - writeJson: jsonFile.writeFile, - writeJsonSync: jsonFile.writeFileSync - }; - } -}); - -// node_modules/fs-extra/lib/output-file/index.js -var require_output_file = __commonJS({ - "node_modules/fs-extra/lib/output-file/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var fs2 = require_fs(); - var path = require("path"); - var mkdir = require_mkdirs(); - var pathExists = require_path_exists().pathExists; - async function outputFile(file, data, encoding = "utf-8") { - const dir = path.dirname(file); - if (!await pathExists(dir)) { - await mkdir.mkdirs(dir); - } - return fs2.writeFile(file, data, encoding); - } - function outputFileSync(file, ...args) { - const dir = path.dirname(file); - if (!fs2.existsSync(dir)) { - mkdir.mkdirsSync(dir); - } - fs2.writeFileSync(file, ...args); - } - module2.exports = { - outputFile: u(outputFile), - outputFileSync - }; - } -}); - -// node_modules/fs-extra/lib/json/output-json.js -var require_output_json = __commonJS({ - "node_modules/fs-extra/lib/json/output-json.js"(exports2, module2) { - "use strict"; - var { stringify } = require_utils2(); - var { outputFile } = require_output_file(); - async function outputJson(file, data, options = {}) { - const str = stringify(data, options); - await outputFile(file, str, options); - } - module2.exports = outputJson; - } -}); - -// node_modules/fs-extra/lib/json/output-json-sync.js -var require_output_json_sync = __commonJS({ - "node_modules/fs-extra/lib/json/output-json-sync.js"(exports2, module2) { - "use strict"; - var { stringify } = require_utils2(); - var { outputFileSync } = require_output_file(); - function outputJsonSync(file, data, options) { - const str = stringify(data, options); - outputFileSync(file, str, options); - } - module2.exports = outputJsonSync; - } -}); - -// node_modules/fs-extra/lib/json/index.js -var require_json = __commonJS({ - "node_modules/fs-extra/lib/json/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - var jsonFile = require_jsonfile2(); - jsonFile.outputJson = u(require_output_json()); - jsonFile.outputJsonSync = require_output_json_sync(); - jsonFile.outputJSON = jsonFile.outputJson; - jsonFile.outputJSONSync = jsonFile.outputJsonSync; - jsonFile.writeJSON = jsonFile.writeJson; - jsonFile.writeJSONSync = jsonFile.writeJsonSync; - jsonFile.readJSON = jsonFile.readJson; - jsonFile.readJSONSync = jsonFile.readJsonSync; - module2.exports = jsonFile; - } -}); - -// node_modules/fs-extra/lib/move/move.js -var require_move = __commonJS({ - "node_modules/fs-extra/lib/move/move.js"(exports2, module2) { - "use strict"; - var fs2 = require_fs(); - var path = require("path"); - var { copy } = require_copy2(); - var { remove } = require_remove(); - var { mkdirp } = require_mkdirs(); - var { pathExists } = require_path_exists(); - var stat = require_stat(); - async function move(src, dest, opts = {}) { - const overwrite = opts.overwrite || opts.clobber || false; - const { srcStat, isChangingCase = false } = await stat.checkPaths(src, dest, "move", opts); - await stat.checkParentPaths(src, srcStat, dest, "move"); - const destParent = path.dirname(dest); - const parsedParentPath = path.parse(destParent); - if (parsedParentPath.root !== destParent) { - await mkdirp(destParent); - } - return doRename(src, dest, overwrite, isChangingCase); - } - async function doRename(src, dest, overwrite, isChangingCase) { - if (!isChangingCase) { - if (overwrite) { - await remove(dest); - } else if (await pathExists(dest)) { - throw new Error("dest already exists."); - } - } - try { - await fs2.rename(src, dest); - } catch (err) { - if (err.code !== "EXDEV") { - throw err; - } - await moveAcrossDevice(src, dest, overwrite); - } - } - async function moveAcrossDevice(src, dest, overwrite) { - const opts = { - overwrite, - errorOnExist: true, - preserveTimestamps: true - }; - await copy(src, dest, opts); - return remove(src); - } - module2.exports = move; - } -}); - -// node_modules/fs-extra/lib/move/move-sync.js -var require_move_sync = __commonJS({ - "node_modules/fs-extra/lib/move/move-sync.js"(exports2, module2) { - "use strict"; - var fs2 = require_graceful_fs(); - var path = require("path"); - var copySync = require_copy2().copySync; - var removeSync2 = require_remove().removeSync; - var mkdirpSync = require_mkdirs().mkdirpSync; - var stat = require_stat(); - function moveSync(src, dest, opts) { - opts = opts || {}; - const overwrite = opts.overwrite || opts.clobber || false; - const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, "move", opts); - stat.checkParentPathsSync(src, srcStat, dest, "move"); - if (!isParentRoot(dest)) - mkdirpSync(path.dirname(dest)); - return doRename(src, dest, overwrite, isChangingCase); - } - function isParentRoot(dest) { - const parent = path.dirname(dest); - const parsedPath = path.parse(parent); - return parsedPath.root === parent; - } - function doRename(src, dest, overwrite, isChangingCase) { - if (isChangingCase) - return rename(src, dest, overwrite); - if (overwrite) { - removeSync2(dest); - return rename(src, dest, overwrite); - } - if (fs2.existsSync(dest)) - throw new Error("dest already exists."); - return rename(src, dest, overwrite); - } - function rename(src, dest, overwrite) { - try { - fs2.renameSync(src, dest); - } catch (err) { - if (err.code !== "EXDEV") - throw err; - return moveAcrossDevice(src, dest, overwrite); - } - } - function moveAcrossDevice(src, dest, overwrite) { - const opts = { - overwrite, - errorOnExist: true, - preserveTimestamps: true - }; - copySync(src, dest, opts); - return removeSync2(src); - } - module2.exports = moveSync; - } -}); - -// node_modules/fs-extra/lib/move/index.js -var require_move2 = __commonJS({ - "node_modules/fs-extra/lib/move/index.js"(exports2, module2) { - "use strict"; - var u = require_universalify().fromPromise; - module2.exports = { - move: u(require_move()), - moveSync: require_move_sync() - }; - } -}); - -// node_modules/fs-extra/lib/index.js -var require_lib = __commonJS({ - "node_modules/fs-extra/lib/index.js"(exports2, module2) { - "use strict"; - module2.exports = { - // Export promiseified graceful-fs: - ...require_fs(), - // Export extra methods: - ...require_copy2(), - ...require_empty(), - ...require_ensure(), - ...require_json(), - ...require_mkdirs(), - ...require_move2(), - ...require_output_file(), - ...require_path_exists(), - ...require_remove() - }; - } -}); - -// submission-runner/cpp.cts -var cpp_exports = {}; -__export(cpp_exports, { - runCpp: () => runCpp -}); -module.exports = __toCommonJS(cpp_exports); -var import_path = require("path"); -var import_child_process = require("child_process"); -var util = __toESM(require("util")); - -// submission-runner/settings.cts -var timeoutSeconds = 30; - -// submission-runner/cpp.cts -var import_tree_kill = __toESM(require_tree_kill()); -var os = __toESM(require("os")); -var fs = __toESM(require_lib()); -var execPromise = util.promisify(import_child_process.exec); -var runCpp = async function(params) { - const tmpDir = os.tmpdir(); - const buildDir = (0, import_path.join)(tmpDir, "bwcontest-cpp"); - if (fs.existsSync(buildDir)) { - fs.removeSync(buildDir); - } - fs.mkdirSync(buildDir); - console.log(`- BUILD: ${params.problemName}`); - const configureCommand = `cmake -S ${params.srcDir} -B ${buildDir}`; - try { - await execPromise(configureCommand); - } catch (e) { - const buildErrorText = e?.toString() ?? "Unknown build errors."; - console.log("Build errors: " + buildErrorText); - return { - success: false, - runResult: { kind: "CompileFailed", resultKindReason: buildErrorText } - }; - } - const compileCommand = `cmake --build ${buildDir} --target ${params.problemName}`; - try { - await execPromise(compileCommand); - } catch (e) { - const buildErrorText = e?.toString() ?? "Unknown build errors."; - console.log("Build errors: " + buildErrorText); - return { - success: false, - runResult: { kind: "CompileFailed", resultKindReason: buildErrorText } - }; - } - console.log(`- RUN: ${params.problemName}`); - let runCommand = ""; - if (params.cppPlatform === "VisualStudio") { - runCommand = `${(0, import_path.join)(buildDir, "Debug", `${params.problemName}.exe`)}`; - } else { - runCommand = `${(0, import_path.join)(buildDir, params.problemName)}`; - } - try { - let outputBuffer = ""; - const child = (0, import_child_process.spawn)(runCommand, { shell: true }); - child.stdout.setEncoding("utf8"); - child.stdout.on("data", (data) => { - outputBuffer += data.toString(); - }); - child.stderr.setEncoding("utf8"); - child.stderr.on("data", (data) => { - outputBuffer += data.toString(); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on("close", () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: "Completed", - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds - }); - } else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: "TimeLimitExceeded", - output: outputBuffer, - resultKindReason: `Timeout after ${timeoutSeconds} seconds` - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log(`Run timed out after ${timeoutSeconds} seconds, killing process...`); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - child.kill("SIGKILL"); - }, timeoutSeconds * 1e3); - }), - killFunc() { - if (child.pid !== void 0) { - if (!completedNormally && !timeLimitExceeded) { - (0, import_tree_kill.default)(child.pid); - params.outputCallback?.("\n[Manually stopped]"); - } - } - } - }; - } catch (error) { - return { success: false, runResult: { kind: "RunError" } }; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - runCpp -}); diff --git a/shared/dist/csharp.js b/shared/dist/csharp.js deleted file mode 100644 index 069178e..0000000 --- a/shared/dist/csharp.js +++ /dev/null @@ -1,227 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/tree-kill/index.js -var require_tree_kill = __commonJS({ - "node_modules/tree-kill/index.js"(exports2, module2) { - "use strict"; - var childProcess = require("child_process"); - var spawn2 = childProcess.spawn; - var exec = childProcess.exec; - module2.exports = function(pid, signal, callback) { - if (typeof signal === "function" && callback === void 0) { - callback = signal; - signal = void 0; - } - pid = parseInt(pid); - if (Number.isNaN(pid)) { - if (callback) { - return callback(new Error("pid must be a number")); - } else { - throw new Error("pid must be a number"); - } - } - var tree = {}; - var pidsToProcess = {}; - tree[pid] = []; - pidsToProcess[pid] = 1; - switch (process.platform) { - case "win32": - exec("taskkill /pid " + pid + " /T /F", callback); - break; - case "darwin": - buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { - return spawn2("pgrep", ["-P", parentPid]); - }, function() { - killAll(tree, signal, callback); - }); - break; - default: - buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { - return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]); - }, function() { - killAll(tree, signal, callback); - }); - break; - } - }; - function killAll(tree, signal, callback) { - var killed = {}; - try { - Object.keys(tree).forEach(function(pid) { - tree[pid].forEach(function(pidpid) { - if (!killed[pidpid]) { - killPid(pidpid, signal); - killed[pidpid] = 1; - } - }); - if (!killed[pid]) { - killPid(pid, signal); - killed[pid] = 1; - } - }); - } catch (err) { - if (callback) { - return callback(err); - } else { - throw err; - } - } - if (callback) { - return callback(); - } - } - function killPid(pid, signal) { - try { - process.kill(parseInt(pid, 10), signal); - } catch (err) { - if (err.code !== "ESRCH") - throw err; - } - } - function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) { - var ps = spawnChildProcessesList(parentPid); - var allData = ""; - ps.stdout.on("data", function(data) { - var data = data.toString("ascii"); - allData += data; - }); - var onClose = function(code) { - delete pidsToProcess[parentPid]; - if (code != 0) { - if (Object.keys(pidsToProcess).length == 0) { - cb(); - } - return; - } - allData.match(/\d+/g).forEach(function(pid) { - pid = parseInt(pid, 10); - tree[parentPid].push(pid); - tree[pid] = []; - pidsToProcess[pid] = 1; - buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb); - }); - }; - ps.on("close", onClose); - } - } -}); - -// submission-runner/csharp.cts -var csharp_exports = {}; -__export(csharp_exports, { - runCSharp: () => runCSharp -}); -module.exports = __toCommonJS(csharp_exports); -var import_child_process = require("child_process"); -var import_tree_kill = __toESM(require_tree_kill()); - -// submission-runner/settings.cts -var timeoutSeconds = 30; - -// submission-runner/csharp.cts -var runCSharp = async function(params) { - console.log(`- RUN: ${params.srcDir}`); - const child = (0, import_child_process.spawn)("dotnet run", { shell: true, cwd: params.srcDir }); - try { - let outputBuffer = ""; - child.stdout.setEncoding("utf8"); - child.stdout.on("data", (data) => { - outputBuffer += data.toString(); - params.outputCallback?.(data.toString()); - }); - child.stderr.setEncoding("utf8"); - child.stderr.on("data", (data) => { - outputBuffer += data.toString(); - params.outputCallback?.(data.toString()); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on("close", () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: "Completed", - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds - }); - } else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: "TimeLimitExceeded", - output: outputBuffer, - resultKindReason: `Timeout after ${timeoutSeconds} seconds` - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log(`Run timed out after ${timeoutSeconds} seconds, killing process...`); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - if (child.pid !== void 0) { - (0, import_tree_kill.default)(child.pid); - } - }, timeoutSeconds * 1e3); - }), - killFunc() { - if (child.pid !== void 0) { - if (!completedNormally && !timeLimitExceeded) { - (0, import_tree_kill.default)(child.pid); - params.outputCallback?.("\n[Manually stopped]"); - } - } - } - }; - } catch (error) { - return { success: false, runResult: { kind: "RunError" } }; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - runCSharp -}); diff --git a/shared/dist/java.js b/shared/dist/java.js deleted file mode 100644 index 5da3e5f..0000000 --- a/shared/dist/java.js +++ /dev/null @@ -1,241 +0,0 @@ -"use strict"; -var __create = Object.create; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __getProtoOf = Object.getPrototypeOf; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; -}; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod -)); -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// node_modules/tree-kill/index.js -var require_tree_kill = __commonJS({ - "node_modules/tree-kill/index.js"(exports2, module2) { - "use strict"; - var childProcess = require("child_process"); - var spawn2 = childProcess.spawn; - var exec2 = childProcess.exec; - module2.exports = function(pid, signal, callback) { - if (typeof signal === "function" && callback === void 0) { - callback = signal; - signal = void 0; - } - pid = parseInt(pid); - if (Number.isNaN(pid)) { - if (callback) { - return callback(new Error("pid must be a number")); - } else { - throw new Error("pid must be a number"); - } - } - var tree = {}; - var pidsToProcess = {}; - tree[pid] = []; - pidsToProcess[pid] = 1; - switch (process.platform) { - case "win32": - exec2("taskkill /pid " + pid + " /T /F", callback); - break; - case "darwin": - buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { - return spawn2("pgrep", ["-P", parentPid]); - }, function() { - killAll(tree, signal, callback); - }); - break; - default: - buildProcessTree(pid, tree, pidsToProcess, function(parentPid) { - return spawn2("ps", ["-o", "pid", "--no-headers", "--ppid", parentPid]); - }, function() { - killAll(tree, signal, callback); - }); - break; - } - }; - function killAll(tree, signal, callback) { - var killed = {}; - try { - Object.keys(tree).forEach(function(pid) { - tree[pid].forEach(function(pidpid) { - if (!killed[pidpid]) { - killPid(pidpid, signal); - killed[pidpid] = 1; - } - }); - if (!killed[pid]) { - killPid(pid, signal); - killed[pid] = 1; - } - }); - } catch (err) { - if (callback) { - return callback(err); - } else { - throw err; - } - } - if (callback) { - return callback(); - } - } - function killPid(pid, signal) { - try { - process.kill(parseInt(pid, 10), signal); - } catch (err) { - if (err.code !== "ESRCH") - throw err; - } - } - function buildProcessTree(parentPid, tree, pidsToProcess, spawnChildProcessesList, cb) { - var ps = spawnChildProcessesList(parentPid); - var allData = ""; - ps.stdout.on("data", function(data) { - var data = data.toString("ascii"); - allData += data; - }); - var onClose = function(code) { - delete pidsToProcess[parentPid]; - if (code != 0) { - if (Object.keys(pidsToProcess).length == 0) { - cb(); - } - return; - } - allData.match(/\d+/g).forEach(function(pid) { - pid = parseInt(pid, 10); - tree[parentPid].push(pid); - tree[pid] = []; - pidsToProcess[pid] = 1; - buildProcessTree(pid, tree, pidsToProcess, spawnChildProcessesList, cb); - }); - }; - ps.on("close", onClose); - } - } -}); - -// submission-runner/java.cts -var java_exports = {}; -__export(java_exports, { - runJava: () => runJava -}); -module.exports = __toCommonJS(java_exports); -var import_path = require("path"); -var import_child_process = require("child_process"); -var util = __toESM(require("util")); - -// submission-runner/settings.cts -var timeoutSeconds = 30; - -// submission-runner/java.cts -var kill = require_tree_kill(); -var execPromise = util.promisify(import_child_process.exec); -var runJava = async function(params) { - console.log(`- BUILD: ${params.mainFile}`); - const compileCommand = `javac -cp ${(0, import_path.join)(params.srcDir, "src")} ${params.mainFile} -d ${(0, import_path.join)(params.srcDir, "build")}`; - try { - await execPromise(compileCommand); - } catch (e) { - const buildErrorText = e?.toString() ?? "Unknown build errors."; - console.log("Build errors: " + buildErrorText); - return { - success: false, - runResult: { kind: "CompileFailed", resultKindReason: buildErrorText } - }; - } - console.log(`- RUN: ${params.mainClass}`); - const runCommand = `java -cp "${(0, import_path.join)(params.srcDir, "build")}" ${params.mainClass}`; - try { - let outputBuffer = ""; - const child = (0, import_child_process.spawn)(runCommand, { shell: true }); - child.stdout.setEncoding("utf8"); - child.stdout.on("data", (data) => { - outputBuffer += data.toString(); - params.outputCallback?.(data.toString()); - }); - child.stderr.setEncoding("utf8"); - child.stderr.on("data", (data) => { - outputBuffer += data.toString(); - params.outputCallback?.(data.toString()); - }); - const runStartTime = performance.now(); - child.stdin.write(params.input); - child.stdin.end(); - let timeLimitExceeded = false; - let completedNormally = false; - return { - success: true, - runResult: new Promise((resolve) => { - child.on("close", () => { - completedNormally = !timeLimitExceeded; - const runEndTime = performance.now(); - const runtimeMilliseconds = Math.floor(runEndTime - runStartTime); - if (completedNormally) { - clearTimeout(timeoutHandle); - resolve({ - kind: "Completed", - output: outputBuffer, - exitCode: child.exitCode, - runtimeMilliseconds - }); - } else { - console.log(`Process terminated, total sandbox time: ${runtimeMilliseconds}ms`); - resolve({ - kind: "TimeLimitExceeded", - output: outputBuffer, - resultKindReason: `Timeout after ${timeoutSeconds} seconds` - }); - } - }); - const timeoutHandle = setTimeout(() => { - if (completedNormally) { - return; - } - console.log(`Run timed out after ${timeoutSeconds} seconds, killing process...`); - timeLimitExceeded = true; - child.stdin.end(); - child.stdin.destroy(); - child.stdout.destroy(); - child.stderr.destroy(); - child.kill("SIGKILL"); - }, timeoutSeconds * 1e3); - }), - killFunc() { - if (child.pid !== void 0) { - if (!completedNormally && !timeLimitExceeded) { - kill(child.pid); - params.outputCallback?.("\n[Manually stopped]"); - } - } - } - }; - } catch (error) { - return { success: false, runResult: { kind: "RunError" } }; - } -}; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - runJava -}); diff --git a/shared/dist/settings.js b/shared/dist/settings.js deleted file mode 100644 index 57ab5f0..0000000 --- a/shared/dist/settings.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// submission-runner/settings.cts -var settings_exports = {}; -__export(settings_exports, { - timeoutSeconds: () => timeoutSeconds -}); -module.exports = __toCommonJS(settings_exports); -var timeoutSeconds = 30; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - timeoutSeconds -}); diff --git a/shared/dist/types.js b/shared/dist/types.js deleted file mode 100644 index 49f6477..0000000 --- a/shared/dist/types.js +++ /dev/null @@ -1,3778 +0,0 @@ -"use strict"; -var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - -// submission-runner/types.cts -var types_exports = {}; -__export(types_exports, { - RunResultZod: () => RunResultZod -}); -module.exports = __toCommonJS(types_exports); - -// node_modules/zod/lib/index.mjs -var util; -(function(util2) { - util2.assertEqual = (val) => val; - function assertIs(_arg) { - } - util2.assertIs = assertIs; - function assertNever(_x) { - throw new Error(); - } - util2.assertNever = assertNever; - util2.arrayToEnum = (items) => { - const obj = {}; - for (const item of items) { - obj[item] = item; - } - return obj; - }; - util2.getValidEnumValues = (obj) => { - const validKeys = util2.objectKeys(obj).filter((k) => typeof obj[obj[k]] !== "number"); - const filtered = {}; - for (const k of validKeys) { - filtered[k] = obj[k]; - } - return util2.objectValues(filtered); - }; - util2.objectValues = (obj) => { - return util2.objectKeys(obj).map(function(e) { - return obj[e]; - }); - }; - util2.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => { - const keys = []; - for (const key in object) { - if (Object.prototype.hasOwnProperty.call(object, key)) { - keys.push(key); - } - } - return keys; - }; - util2.find = (arr, checker) => { - for (const item of arr) { - if (checker(item)) - return item; - } - return void 0; - }; - util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val; - function joinValues(array, separator = " | ") { - return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator); - } - util2.joinValues = joinValues; - util2.jsonStringifyReplacer = (_, value) => { - if (typeof value === "bigint") { - return value.toString(); - } - return value; - }; -})(util || (util = {})); -var objectUtil; -(function(objectUtil2) { - objectUtil2.mergeShapes = (first, second) => { - return { - ...first, - ...second - // second overwrites first - }; - }; -})(objectUtil || (objectUtil = {})); -var ZodParsedType = util.arrayToEnum([ - "string", - "nan", - "number", - "integer", - "float", - "boolean", - "date", - "bigint", - "symbol", - "function", - "undefined", - "null", - "array", - "object", - "unknown", - "promise", - "void", - "never", - "map", - "set" -]); -var getParsedType = (data) => { - const t = typeof data; - switch (t) { - case "undefined": - return ZodParsedType.undefined; - case "string": - return ZodParsedType.string; - case "number": - return isNaN(data) ? ZodParsedType.nan : ZodParsedType.number; - case "boolean": - return ZodParsedType.boolean; - case "function": - return ZodParsedType.function; - case "bigint": - return ZodParsedType.bigint; - case "symbol": - return ZodParsedType.symbol; - case "object": - if (Array.isArray(data)) { - return ZodParsedType.array; - } - if (data === null) { - return ZodParsedType.null; - } - if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") { - return ZodParsedType.promise; - } - if (typeof Map !== "undefined" && data instanceof Map) { - return ZodParsedType.map; - } - if (typeof Set !== "undefined" && data instanceof Set) { - return ZodParsedType.set; - } - if (typeof Date !== "undefined" && data instanceof Date) { - return ZodParsedType.date; - } - return ZodParsedType.object; - default: - return ZodParsedType.unknown; - } -}; -var ZodIssueCode = util.arrayToEnum([ - "invalid_type", - "invalid_literal", - "custom", - "invalid_union", - "invalid_union_discriminator", - "invalid_enum_value", - "unrecognized_keys", - "invalid_arguments", - "invalid_return_type", - "invalid_date", - "invalid_string", - "too_small", - "too_big", - "invalid_intersection_types", - "not_multiple_of", - "not_finite" -]); -var quotelessJson = (obj) => { - const json = JSON.stringify(obj, null, 2); - return json.replace(/"([^"]+)":/g, "$1:"); -}; -var ZodError = class extends Error { - constructor(issues) { - super(); - this.issues = []; - this.addIssue = (sub) => { - this.issues = [...this.issues, sub]; - }; - this.addIssues = (subs = []) => { - this.issues = [...this.issues, ...subs]; - }; - const actualProto = new.target.prototype; - if (Object.setPrototypeOf) { - Object.setPrototypeOf(this, actualProto); - } else { - this.__proto__ = actualProto; - } - this.name = "ZodError"; - this.issues = issues; - } - get errors() { - return this.issues; - } - format(_mapper) { - const mapper = _mapper || function(issue) { - return issue.message; - }; - const fieldErrors = { _errors: [] }; - const processError = (error) => { - for (const issue of error.issues) { - if (issue.code === "invalid_union") { - issue.unionErrors.map(processError); - } else if (issue.code === "invalid_return_type") { - processError(issue.returnTypeError); - } else if (issue.code === "invalid_arguments") { - processError(issue.argumentsError); - } else if (issue.path.length === 0) { - fieldErrors._errors.push(mapper(issue)); - } else { - let curr = fieldErrors; - let i = 0; - while (i < issue.path.length) { - const el = issue.path[i]; - const terminal = i === issue.path.length - 1; - if (!terminal) { - curr[el] = curr[el] || { _errors: [] }; - } else { - curr[el] = curr[el] || { _errors: [] }; - curr[el]._errors.push(mapper(issue)); - } - curr = curr[el]; - i++; - } - } - } - }; - processError(this); - return fieldErrors; - } - toString() { - return this.message; - } - get message() { - return JSON.stringify(this.issues, util.jsonStringifyReplacer, 2); - } - get isEmpty() { - return this.issues.length === 0; - } - flatten(mapper = (issue) => issue.message) { - const fieldErrors = {}; - const formErrors = []; - for (const sub of this.issues) { - if (sub.path.length > 0) { - fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || []; - fieldErrors[sub.path[0]].push(mapper(sub)); - } else { - formErrors.push(mapper(sub)); - } - } - return { formErrors, fieldErrors }; - } - get formErrors() { - return this.flatten(); - } -}; -ZodError.create = (issues) => { - const error = new ZodError(issues); - return error; -}; -var errorMap = (issue, _ctx) => { - let message; - switch (issue.code) { - case ZodIssueCode.invalid_type: - if (issue.received === ZodParsedType.undefined) { - message = "Required"; - } else { - message = `Expected ${issue.expected}, received ${issue.received}`; - } - break; - case ZodIssueCode.invalid_literal: - message = `Invalid literal value, expected ${JSON.stringify(issue.expected, util.jsonStringifyReplacer)}`; - break; - case ZodIssueCode.unrecognized_keys: - message = `Unrecognized key(s) in object: ${util.joinValues(issue.keys, ", ")}`; - break; - case ZodIssueCode.invalid_union: - message = `Invalid input`; - break; - case ZodIssueCode.invalid_union_discriminator: - message = `Invalid discriminator value. Expected ${util.joinValues(issue.options)}`; - break; - case ZodIssueCode.invalid_enum_value: - message = `Invalid enum value. Expected ${util.joinValues(issue.options)}, received '${issue.received}'`; - break; - case ZodIssueCode.invalid_arguments: - message = `Invalid function arguments`; - break; - case ZodIssueCode.invalid_return_type: - message = `Invalid function return type`; - break; - case ZodIssueCode.invalid_date: - message = `Invalid date`; - break; - case ZodIssueCode.invalid_string: - if (typeof issue.validation === "object") { - if ("includes" in issue.validation) { - message = `Invalid input: must include "${issue.validation.includes}"`; - if (typeof issue.validation.position === "number") { - message = `${message} at one or more positions greater than or equal to ${issue.validation.position}`; - } - } else if ("startsWith" in issue.validation) { - message = `Invalid input: must start with "${issue.validation.startsWith}"`; - } else if ("endsWith" in issue.validation) { - message = `Invalid input: must end with "${issue.validation.endsWith}"`; - } else { - util.assertNever(issue.validation); - } - } else if (issue.validation !== "regex") { - message = `Invalid ${issue.validation}`; - } else { - message = "Invalid"; - } - break; - case ZodIssueCode.too_small: - if (issue.type === "array") - message = `Array must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `more than`} ${issue.minimum} element(s)`; - else if (issue.type === "string") - message = `String must contain ${issue.exact ? "exactly" : issue.inclusive ? `at least` : `over`} ${issue.minimum} character(s)`; - else if (issue.type === "number") - message = `Number must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${issue.minimum}`; - else if (issue.type === "date") - message = `Date must be ${issue.exact ? `exactly equal to ` : issue.inclusive ? `greater than or equal to ` : `greater than `}${new Date(Number(issue.minimum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode.too_big: - if (issue.type === "array") - message = `Array must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `less than`} ${issue.maximum} element(s)`; - else if (issue.type === "string") - message = `String must contain ${issue.exact ? `exactly` : issue.inclusive ? `at most` : `under`} ${issue.maximum} character(s)`; - else if (issue.type === "number") - message = `Number must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; - else if (issue.type === "bigint") - message = `BigInt must be ${issue.exact ? `exactly` : issue.inclusive ? `less than or equal to` : `less than`} ${issue.maximum}`; - else if (issue.type === "date") - message = `Date must be ${issue.exact ? `exactly` : issue.inclusive ? `smaller than or equal to` : `smaller than`} ${new Date(Number(issue.maximum))}`; - else - message = "Invalid input"; - break; - case ZodIssueCode.custom: - message = `Invalid input`; - break; - case ZodIssueCode.invalid_intersection_types: - message = `Intersection results could not be merged`; - break; - case ZodIssueCode.not_multiple_of: - message = `Number must be a multiple of ${issue.multipleOf}`; - break; - case ZodIssueCode.not_finite: - message = "Number must be finite"; - break; - default: - message = _ctx.defaultError; - util.assertNever(issue); - } - return { message }; -}; -var overrideErrorMap = errorMap; -function setErrorMap(map) { - overrideErrorMap = map; -} -function getErrorMap() { - return overrideErrorMap; -} -var makeIssue = (params) => { - const { data, path, errorMaps, issueData } = params; - const fullPath = [...path, ...issueData.path || []]; - const fullIssue = { - ...issueData, - path: fullPath - }; - let errorMessage = ""; - const maps = errorMaps.filter((m) => !!m).slice().reverse(); - for (const map of maps) { - errorMessage = map(fullIssue, { data, defaultError: errorMessage }).message; - } - return { - ...issueData, - path: fullPath, - message: issueData.message || errorMessage - }; -}; -var EMPTY_PATH = []; -function addIssueToContext(ctx, issueData) { - const issue = makeIssue({ - issueData, - data: ctx.data, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - ctx.schemaErrorMap, - getErrorMap(), - errorMap - // then global default map - ].filter((x) => !!x) - }); - ctx.common.issues.push(issue); -} -var ParseStatus = class _ParseStatus { - constructor() { - this.value = "valid"; - } - dirty() { - if (this.value === "valid") - this.value = "dirty"; - } - abort() { - if (this.value !== "aborted") - this.value = "aborted"; - } - static mergeArray(status, results) { - const arrayValue = []; - for (const s of results) { - if (s.status === "aborted") - return INVALID; - if (s.status === "dirty") - status.dirty(); - arrayValue.push(s.value); - } - return { status: status.value, value: arrayValue }; - } - static async mergeObjectAsync(status, pairs) { - const syncPairs = []; - for (const pair of pairs) { - syncPairs.push({ - key: await pair.key, - value: await pair.value - }); - } - return _ParseStatus.mergeObjectSync(status, syncPairs); - } - static mergeObjectSync(status, pairs) { - const finalObject = {}; - for (const pair of pairs) { - const { key, value } = pair; - if (key.status === "aborted") - return INVALID; - if (value.status === "aborted") - return INVALID; - if (key.status === "dirty") - status.dirty(); - if (value.status === "dirty") - status.dirty(); - if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) { - finalObject[key.value] = value.value; - } - } - return { status: status.value, value: finalObject }; - } -}; -var INVALID = Object.freeze({ - status: "aborted" -}); -var DIRTY = (value) => ({ status: "dirty", value }); -var OK = (value) => ({ status: "valid", value }); -var isAborted = (x) => x.status === "aborted"; -var isDirty = (x) => x.status === "dirty"; -var isValid = (x) => x.status === "valid"; -var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise; -var errorUtil; -(function(errorUtil2) { - errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {}; - errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === void 0 ? void 0 : message.message; -})(errorUtil || (errorUtil = {})); -var ParseInputLazyPath = class { - constructor(parent, value, path, key) { - this._cachedPath = []; - this.parent = parent; - this.data = value; - this._path = path; - this._key = key; - } - get path() { - if (!this._cachedPath.length) { - if (this._key instanceof Array) { - this._cachedPath.push(...this._path, ...this._key); - } else { - this._cachedPath.push(...this._path, this._key); - } - } - return this._cachedPath; - } -}; -var handleResult = (ctx, result) => { - if (isValid(result)) { - return { success: true, data: result.value }; - } else { - if (!ctx.common.issues.length) { - throw new Error("Validation failed but no issues detected."); - } - return { - success: false, - get error() { - if (this._error) - return this._error; - const error = new ZodError(ctx.common.issues); - this._error = error; - return this._error; - } - }; - } -}; -function processCreateParams(params) { - if (!params) - return {}; - const { errorMap: errorMap2, invalid_type_error, required_error, description } = params; - if (errorMap2 && (invalid_type_error || required_error)) { - throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`); - } - if (errorMap2) - return { errorMap: errorMap2, description }; - const customMap = (iss, ctx) => { - if (iss.code !== "invalid_type") - return { message: ctx.defaultError }; - if (typeof ctx.data === "undefined") { - return { message: required_error !== null && required_error !== void 0 ? required_error : ctx.defaultError }; - } - return { message: invalid_type_error !== null && invalid_type_error !== void 0 ? invalid_type_error : ctx.defaultError }; - }; - return { errorMap: customMap, description }; -} -var ZodType = class { - constructor(def) { - this.spa = this.safeParseAsync; - this._def = def; - this.parse = this.parse.bind(this); - this.safeParse = this.safeParse.bind(this); - this.parseAsync = this.parseAsync.bind(this); - this.safeParseAsync = this.safeParseAsync.bind(this); - this.spa = this.spa.bind(this); - this.refine = this.refine.bind(this); - this.refinement = this.refinement.bind(this); - this.superRefine = this.superRefine.bind(this); - this.optional = this.optional.bind(this); - this.nullable = this.nullable.bind(this); - this.nullish = this.nullish.bind(this); - this.array = this.array.bind(this); - this.promise = this.promise.bind(this); - this.or = this.or.bind(this); - this.and = this.and.bind(this); - this.transform = this.transform.bind(this); - this.brand = this.brand.bind(this); - this.default = this.default.bind(this); - this.catch = this.catch.bind(this); - this.describe = this.describe.bind(this); - this.pipe = this.pipe.bind(this); - this.readonly = this.readonly.bind(this); - this.isNullable = this.isNullable.bind(this); - this.isOptional = this.isOptional.bind(this); - } - get description() { - return this._def.description; - } - _getType(input) { - return getParsedType(input.data); - } - _getOrReturnCtx(input, ctx) { - return ctx || { - common: input.parent.common, - data: input.data, - parsedType: getParsedType(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent - }; - } - _processInputParams(input) { - return { - status: new ParseStatus(), - ctx: { - common: input.parent.common, - data: input.data, - parsedType: getParsedType(input.data), - schemaErrorMap: this._def.errorMap, - path: input.path, - parent: input.parent - } - }; - } - _parseSync(input) { - const result = this._parse(input); - if (isAsync(result)) { - throw new Error("Synchronous parse encountered promise."); - } - return result; - } - _parseAsync(input) { - const result = this._parse(input); - return Promise.resolve(result); - } - parse(data, params) { - const result = this.safeParse(data, params); - if (result.success) - return result.data; - throw result.error; - } - safeParse(data, params) { - var _a; - const ctx = { - common: { - issues: [], - async: (_a = params === null || params === void 0 ? void 0 : params.async) !== null && _a !== void 0 ? _a : false, - contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap - }, - path: (params === null || params === void 0 ? void 0 : params.path) || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - const result = this._parseSync({ data, path: ctx.path, parent: ctx }); - return handleResult(ctx, result); - } - async parseAsync(data, params) { - const result = await this.safeParseAsync(data, params); - if (result.success) - return result.data; - throw result.error; - } - async safeParseAsync(data, params) { - const ctx = { - common: { - issues: [], - contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap, - async: true - }, - path: (params === null || params === void 0 ? void 0 : params.path) || [], - schemaErrorMap: this._def.errorMap, - parent: null, - data, - parsedType: getParsedType(data) - }; - const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx }); - const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult)); - return handleResult(ctx, result); - } - refine(check, message) { - const getIssueProperties = (val) => { - if (typeof message === "string" || typeof message === "undefined") { - return { message }; - } else if (typeof message === "function") { - return message(val); - } else { - return message; - } - }; - return this._refinement((val, ctx) => { - const result = check(val); - const setError = () => ctx.addIssue({ - code: ZodIssueCode.custom, - ...getIssueProperties(val) - }); - if (typeof Promise !== "undefined" && result instanceof Promise) { - return result.then((data) => { - if (!data) { - setError(); - return false; - } else { - return true; - } - }); - } - if (!result) { - setError(); - return false; - } else { - return true; - } - }); - } - refinement(check, refinementData) { - return this._refinement((val, ctx) => { - if (!check(val)) { - ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData); - return false; - } else { - return true; - } - }); - } - _refinement(refinement) { - return new ZodEffects({ - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: "refinement", refinement } - }); - } - superRefine(refinement) { - return this._refinement(refinement); - } - optional() { - return ZodOptional.create(this, this._def); - } - nullable() { - return ZodNullable.create(this, this._def); - } - nullish() { - return this.nullable().optional(); - } - array() { - return ZodArray.create(this, this._def); - } - promise() { - return ZodPromise.create(this, this._def); - } - or(option) { - return ZodUnion.create([this, option], this._def); - } - and(incoming) { - return ZodIntersection.create(this, incoming, this._def); - } - transform(transform) { - return new ZodEffects({ - ...processCreateParams(this._def), - schema: this, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect: { type: "transform", transform } - }); - } - default(def) { - const defaultValueFunc = typeof def === "function" ? def : () => def; - return new ZodDefault({ - ...processCreateParams(this._def), - innerType: this, - defaultValue: defaultValueFunc, - typeName: ZodFirstPartyTypeKind.ZodDefault - }); - } - brand() { - return new ZodBranded({ - typeName: ZodFirstPartyTypeKind.ZodBranded, - type: this, - ...processCreateParams(this._def) - }); - } - catch(def) { - const catchValueFunc = typeof def === "function" ? def : () => def; - return new ZodCatch({ - ...processCreateParams(this._def), - innerType: this, - catchValue: catchValueFunc, - typeName: ZodFirstPartyTypeKind.ZodCatch - }); - } - describe(description) { - const This = this.constructor; - return new This({ - ...this._def, - description - }); - } - pipe(target) { - return ZodPipeline.create(this, target); - } - readonly() { - return ZodReadonly.create(this); - } - isOptional() { - return this.safeParse(void 0).success; - } - isNullable() { - return this.safeParse(null).success; - } -}; -var cuidRegex = /^c[^\s-]{8,}$/i; -var cuid2Regex = /^[a-z][a-z0-9]*$/; -var ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/; -var uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i; -var emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i; -var _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`; -var emojiRegex; -var ipv4Regex = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/; -var ipv6Regex = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/; -var datetimeRegex = (args) => { - if (args.precision) { - if (args.offset) { - return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); - } else { - return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${args.precision}}Z$`); - } - } else if (args.precision === 0) { - if (args.offset) { - return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$`); - } else { - return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$`); - } - } else { - if (args.offset) { - return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$`); - } else { - return new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$`); - } - } -}; -function isValidIP(ip, version) { - if ((version === "v4" || !version) && ipv4Regex.test(ip)) { - return true; - } - if ((version === "v6" || !version) && ipv6Regex.test(ip)) { - return true; - } - return false; -} -var ZodString = class _ZodString extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = String(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.string) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext( - ctx2, - { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.string, - received: ctx2.parsedType - } - // - ); - return INVALID; - } - const status = new ParseStatus(); - let ctx = void 0; - for (const check of this._def.checks) { - if (check.kind === "min") { - if (input.data.length < check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "string", - inclusive: true, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (input.data.length > check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "string", - inclusive: true, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "length") { - const tooBig = input.data.length > check.value; - const tooSmall = input.data.length < check.value; - if (tooBig || tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - if (tooBig) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "string", - inclusive: true, - exact: true, - message: check.message - }); - } else if (tooSmall) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "string", - inclusive: true, - exact: true, - message: check.message - }); - } - status.dirty(); - } - } else if (check.kind === "email") { - if (!emailRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "email", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "emoji") { - if (!emojiRegex) { - emojiRegex = new RegExp(_emojiRegex, "u"); - } - if (!emojiRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "emoji", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "uuid") { - if (!uuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "uuid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cuid") { - if (!cuidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cuid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "cuid2") { - if (!cuid2Regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "cuid2", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "ulid") { - if (!ulidRegex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "ulid", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "url") { - try { - new URL(input.data); - } catch (_a) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "url", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "regex") { - check.regex.lastIndex = 0; - const testResult = check.regex.test(input.data); - if (!testResult) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "regex", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "trim") { - input.data = input.data.trim(); - } else if (check.kind === "includes") { - if (!input.data.includes(check.value, check.position)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { includes: check.value, position: check.position }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "toLowerCase") { - input.data = input.data.toLowerCase(); - } else if (check.kind === "toUpperCase") { - input.data = input.data.toUpperCase(); - } else if (check.kind === "startsWith") { - if (!input.data.startsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { startsWith: check.value }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "endsWith") { - if (!input.data.endsWith(check.value)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: { endsWith: check.value }, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "datetime") { - const regex = datetimeRegex(check); - if (!regex.test(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_string, - validation: "datetime", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "ip") { - if (!isValidIP(input.data, check.version)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - validation: "ip", - code: ZodIssueCode.invalid_string, - message: check.message - }); - status.dirty(); - } - } else { - util.assertNever(check); - } - } - return { status: status.value, value: input.data }; - } - _regex(regex, validation, message) { - return this.refinement((data) => regex.test(data), { - validation, - code: ZodIssueCode.invalid_string, - ...errorUtil.errToObj(message) - }); - } - _addCheck(check) { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - email(message) { - return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) }); - } - url(message) { - return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) }); - } - emoji(message) { - return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) }); - } - uuid(message) { - return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) }); - } - cuid(message) { - return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) }); - } - cuid2(message) { - return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) }); - } - ulid(message) { - return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) }); - } - ip(options) { - return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) }); - } - datetime(options) { - var _a; - if (typeof options === "string") { - return this._addCheck({ - kind: "datetime", - precision: null, - offset: false, - message: options - }); - } - return this._addCheck({ - kind: "datetime", - precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision, - offset: (_a = options === null || options === void 0 ? void 0 : options.offset) !== null && _a !== void 0 ? _a : false, - ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) - }); - } - regex(regex, message) { - return this._addCheck({ - kind: "regex", - regex, - ...errorUtil.errToObj(message) - }); - } - includes(value, options) { - return this._addCheck({ - kind: "includes", - value, - position: options === null || options === void 0 ? void 0 : options.position, - ...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message) - }); - } - startsWith(value, message) { - return this._addCheck({ - kind: "startsWith", - value, - ...errorUtil.errToObj(message) - }); - } - endsWith(value, message) { - return this._addCheck({ - kind: "endsWith", - value, - ...errorUtil.errToObj(message) - }); - } - min(minLength, message) { - return this._addCheck({ - kind: "min", - value: minLength, - ...errorUtil.errToObj(message) - }); - } - max(maxLength, message) { - return this._addCheck({ - kind: "max", - value: maxLength, - ...errorUtil.errToObj(message) - }); - } - length(len, message) { - return this._addCheck({ - kind: "length", - value: len, - ...errorUtil.errToObj(message) - }); - } - /** - * @deprecated Use z.string().min(1) instead. - * @see {@link ZodString.min} - */ - nonempty(message) { - return this.min(1, errorUtil.errToObj(message)); - } - trim() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "trim" }] - }); - } - toLowerCase() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toLowerCase" }] - }); - } - toUpperCase() { - return new _ZodString({ - ...this._def, - checks: [...this._def.checks, { kind: "toUpperCase" }] - }); - } - get isDatetime() { - return !!this._def.checks.find((ch) => ch.kind === "datetime"); - } - get isEmail() { - return !!this._def.checks.find((ch) => ch.kind === "email"); - } - get isURL() { - return !!this._def.checks.find((ch) => ch.kind === "url"); - } - get isEmoji() { - return !!this._def.checks.find((ch) => ch.kind === "emoji"); - } - get isUUID() { - return !!this._def.checks.find((ch) => ch.kind === "uuid"); - } - get isCUID() { - return !!this._def.checks.find((ch) => ch.kind === "cuid"); - } - get isCUID2() { - return !!this._def.checks.find((ch) => ch.kind === "cuid2"); - } - get isULID() { - return !!this._def.checks.find((ch) => ch.kind === "ulid"); - } - get isIP() { - return !!this._def.checks.find((ch) => ch.kind === "ip"); - } - get minLength() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min; - } - get maxLength() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max; - } -}; -ZodString.create = (params) => { - var _a; - return new ZodString({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodString, - coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, - ...processCreateParams(params) - }); -}; -function floatSafeRemainder(val, step) { - const valDecCount = (val.toString().split(".")[1] || "").length; - const stepDecCount = (step.toString().split(".")[1] || "").length; - const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount; - const valInt = parseInt(val.toFixed(decCount).replace(".", "")); - const stepInt = parseInt(step.toFixed(decCount).replace(".", "")); - return valInt % stepInt / Math.pow(10, decCount); -} -var ZodNumber = class _ZodNumber extends ZodType { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - this.step = this.multipleOf; - } - _parse(input) { - if (this._def.coerce) { - input.data = Number(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.number) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.number, - received: ctx2.parsedType - }); - return INVALID; - } - let ctx = void 0; - const status = new ParseStatus(); - for (const check of this._def.checks) { - if (check.kind === "int") { - if (!util.isInteger(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: "integer", - received: "float", - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "min") { - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: check.value, - type: "number", - inclusive: check.inclusive, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: check.value, - type: "number", - inclusive: check.inclusive, - exact: false, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "multipleOf") { - if (floatSafeRemainder(input.data, check.value) !== 0) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "finite") { - if (!Number.isFinite(input.data)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_finite, - message: check.message - }); - status.dirty(); - } - } else { - util.assertNever(check); - } - } - return { status: status.value, value: input.data }; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new _ZodNumber({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil.toString(message) - } - ] - }); - } - _addCheck(check) { - return new _ZodNumber({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - int(message) { - return this._addCheck({ - kind: "int", - message: errorUtil.toString(message) - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: false, - message: errorUtil.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: 0, - inclusive: true, - message: errorUtil.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil.toString(message) - }); - } - finite(message) { - return this._addCheck({ - kind: "finite", - message: errorUtil.toString(message) - }); - } - safe(message) { - return this._addCheck({ - kind: "min", - inclusive: true, - value: Number.MIN_SAFE_INTEGER, - message: errorUtil.toString(message) - })._addCheck({ - kind: "max", - inclusive: true, - value: Number.MAX_SAFE_INTEGER, - message: errorUtil.toString(message) - }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max; - } - get isInt() { - return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value)); - } - get isFinite() { - let max = null, min = null; - for (const ch of this._def.checks) { - if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") { - return true; - } else if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } else if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return Number.isFinite(min) && Number.isFinite(max); - } -}; -ZodNumber.create = (params) => { - return new ZodNumber({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodNumber, - coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, - ...processCreateParams(params) - }); -}; -var ZodBigInt = class _ZodBigInt extends ZodType { - constructor() { - super(...arguments); - this.min = this.gte; - this.max = this.lte; - } - _parse(input) { - if (this._def.coerce) { - input.data = BigInt(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.bigint) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.bigint, - received: ctx2.parsedType - }); - return INVALID; - } - let ctx = void 0; - const status = new ParseStatus(); - for (const check of this._def.checks) { - if (check.kind === "min") { - const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value; - if (tooSmall) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - type: "bigint", - minimum: check.value, - inclusive: check.inclusive, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "max") { - const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value; - if (tooBig) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - type: "bigint", - maximum: check.value, - inclusive: check.inclusive, - message: check.message - }); - status.dirty(); - } - } else if (check.kind === "multipleOf") { - if (input.data % check.value !== BigInt(0)) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.not_multiple_of, - multipleOf: check.value, - message: check.message - }); - status.dirty(); - } - } else { - util.assertNever(check); - } - } - return { status: status.value, value: input.data }; - } - gte(value, message) { - return this.setLimit("min", value, true, errorUtil.toString(message)); - } - gt(value, message) { - return this.setLimit("min", value, false, errorUtil.toString(message)); - } - lte(value, message) { - return this.setLimit("max", value, true, errorUtil.toString(message)); - } - lt(value, message) { - return this.setLimit("max", value, false, errorUtil.toString(message)); - } - setLimit(kind, value, inclusive, message) { - return new _ZodBigInt({ - ...this._def, - checks: [ - ...this._def.checks, - { - kind, - value, - inclusive, - message: errorUtil.toString(message) - } - ] - }); - } - _addCheck(check) { - return new _ZodBigInt({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - positive(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }); - } - negative(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: false, - message: errorUtil.toString(message) - }); - } - nonpositive(message) { - return this._addCheck({ - kind: "max", - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }); - } - nonnegative(message) { - return this._addCheck({ - kind: "min", - value: BigInt(0), - inclusive: true, - message: errorUtil.toString(message) - }); - } - multipleOf(value, message) { - return this._addCheck({ - kind: "multipleOf", - value, - message: errorUtil.toString(message) - }); - } - get minValue() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min; - } - get maxValue() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max; - } -}; -ZodBigInt.create = (params) => { - var _a; - return new ZodBigInt({ - checks: [], - typeName: ZodFirstPartyTypeKind.ZodBigInt, - coerce: (_a = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a !== void 0 ? _a : false, - ...processCreateParams(params) - }); -}; -var ZodBoolean = class extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = Boolean(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.boolean) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.boolean, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodBoolean.create = (params) => { - return new ZodBoolean({ - typeName: ZodFirstPartyTypeKind.ZodBoolean, - coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, - ...processCreateParams(params) - }); -}; -var ZodDate = class _ZodDate extends ZodType { - _parse(input) { - if (this._def.coerce) { - input.data = new Date(input.data); - } - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.date) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.date, - received: ctx2.parsedType - }); - return INVALID; - } - if (isNaN(input.data.getTime())) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_date - }); - return INVALID; - } - const status = new ParseStatus(); - let ctx = void 0; - for (const check of this._def.checks) { - if (check.kind === "min") { - if (input.data.getTime() < check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - message: check.message, - inclusive: true, - exact: false, - minimum: check.value, - type: "date" - }); - status.dirty(); - } - } else if (check.kind === "max") { - if (input.data.getTime() > check.value) { - ctx = this._getOrReturnCtx(input, ctx); - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - message: check.message, - inclusive: true, - exact: false, - maximum: check.value, - type: "date" - }); - status.dirty(); - } - } else { - util.assertNever(check); - } - } - return { - status: status.value, - value: new Date(input.data.getTime()) - }; - } - _addCheck(check) { - return new _ZodDate({ - ...this._def, - checks: [...this._def.checks, check] - }); - } - min(minDate, message) { - return this._addCheck({ - kind: "min", - value: minDate.getTime(), - message: errorUtil.toString(message) - }); - } - max(maxDate, message) { - return this._addCheck({ - kind: "max", - value: maxDate.getTime(), - message: errorUtil.toString(message) - }); - } - get minDate() { - let min = null; - for (const ch of this._def.checks) { - if (ch.kind === "min") { - if (min === null || ch.value > min) - min = ch.value; - } - } - return min != null ? new Date(min) : null; - } - get maxDate() { - let max = null; - for (const ch of this._def.checks) { - if (ch.kind === "max") { - if (max === null || ch.value < max) - max = ch.value; - } - } - return max != null ? new Date(max) : null; - } -}; -ZodDate.create = (params) => { - return new ZodDate({ - checks: [], - coerce: (params === null || params === void 0 ? void 0 : params.coerce) || false, - typeName: ZodFirstPartyTypeKind.ZodDate, - ...processCreateParams(params) - }); -}; -var ZodSymbol = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.symbol) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.symbol, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodSymbol.create = (params) => { - return new ZodSymbol({ - typeName: ZodFirstPartyTypeKind.ZodSymbol, - ...processCreateParams(params) - }); -}; -var ZodUndefined = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.undefined, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodUndefined.create = (params) => { - return new ZodUndefined({ - typeName: ZodFirstPartyTypeKind.ZodUndefined, - ...processCreateParams(params) - }); -}; -var ZodNull = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.null) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.null, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodNull.create = (params) => { - return new ZodNull({ - typeName: ZodFirstPartyTypeKind.ZodNull, - ...processCreateParams(params) - }); -}; -var ZodAny = class extends ZodType { - constructor() { - super(...arguments); - this._any = true; - } - _parse(input) { - return OK(input.data); - } -}; -ZodAny.create = (params) => { - return new ZodAny({ - typeName: ZodFirstPartyTypeKind.ZodAny, - ...processCreateParams(params) - }); -}; -var ZodUnknown = class extends ZodType { - constructor() { - super(...arguments); - this._unknown = true; - } - _parse(input) { - return OK(input.data); - } -}; -ZodUnknown.create = (params) => { - return new ZodUnknown({ - typeName: ZodFirstPartyTypeKind.ZodUnknown, - ...processCreateParams(params) - }); -}; -var ZodNever = class extends ZodType { - _parse(input) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.never, - received: ctx.parsedType - }); - return INVALID; - } -}; -ZodNever.create = (params) => { - return new ZodNever({ - typeName: ZodFirstPartyTypeKind.ZodNever, - ...processCreateParams(params) - }); -}; -var ZodVoid = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.undefined) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.void, - received: ctx.parsedType - }); - return INVALID; - } - return OK(input.data); - } -}; -ZodVoid.create = (params) => { - return new ZodVoid({ - typeName: ZodFirstPartyTypeKind.ZodVoid, - ...processCreateParams(params) - }); -}; -var ZodArray = class _ZodArray extends ZodType { - _parse(input) { - const { ctx, status } = this._processInputParams(input); - const def = this._def; - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }); - return INVALID; - } - if (def.exactLength !== null) { - const tooBig = ctx.data.length > def.exactLength.value; - const tooSmall = ctx.data.length < def.exactLength.value; - if (tooBig || tooSmall) { - addIssueToContext(ctx, { - code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small, - minimum: tooSmall ? def.exactLength.value : void 0, - maximum: tooBig ? def.exactLength.value : void 0, - type: "array", - inclusive: true, - exact: true, - message: def.exactLength.message - }); - status.dirty(); - } - } - if (def.minLength !== null) { - if (ctx.data.length < def.minLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.minLength.message - }); - status.dirty(); - } - } - if (def.maxLength !== null) { - if (ctx.data.length > def.maxLength.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxLength.value, - type: "array", - inclusive: true, - exact: false, - message: def.maxLength.message - }); - status.dirty(); - } - } - if (ctx.common.async) { - return Promise.all([...ctx.data].map((item, i) => { - return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i)); - })).then((result2) => { - return ParseStatus.mergeArray(status, result2); - }); - } - const result = [...ctx.data].map((item, i) => { - return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i)); - }); - return ParseStatus.mergeArray(status, result); - } - get element() { - return this._def.type; - } - min(minLength, message) { - return new _ZodArray({ - ...this._def, - minLength: { value: minLength, message: errorUtil.toString(message) } - }); - } - max(maxLength, message) { - return new _ZodArray({ - ...this._def, - maxLength: { value: maxLength, message: errorUtil.toString(message) } - }); - } - length(len, message) { - return new _ZodArray({ - ...this._def, - exactLength: { value: len, message: errorUtil.toString(message) } - }); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodArray.create = (schema, params) => { - return new ZodArray({ - type: schema, - minLength: null, - maxLength: null, - exactLength: null, - typeName: ZodFirstPartyTypeKind.ZodArray, - ...processCreateParams(params) - }); -}; -function deepPartialify(schema) { - if (schema instanceof ZodObject) { - const newShape = {}; - for (const key in schema.shape) { - const fieldSchema = schema.shape[key]; - newShape[key] = ZodOptional.create(deepPartialify(fieldSchema)); - } - return new ZodObject({ - ...schema._def, - shape: () => newShape - }); - } else if (schema instanceof ZodArray) { - return new ZodArray({ - ...schema._def, - type: deepPartialify(schema.element) - }); - } else if (schema instanceof ZodOptional) { - return ZodOptional.create(deepPartialify(schema.unwrap())); - } else if (schema instanceof ZodNullable) { - return ZodNullable.create(deepPartialify(schema.unwrap())); - } else if (schema instanceof ZodTuple) { - return ZodTuple.create(schema.items.map((item) => deepPartialify(item))); - } else { - return schema; - } -} -var ZodObject = class _ZodObject extends ZodType { - constructor() { - super(...arguments); - this._cached = null; - this.nonstrict = this.passthrough; - this.augment = this.extend; - } - _getCached() { - if (this._cached !== null) - return this._cached; - const shape = this._def.shape(); - const keys = util.objectKeys(shape); - return this._cached = { shape, keys }; - } - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.object) { - const ctx2 = this._getOrReturnCtx(input); - addIssueToContext(ctx2, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx2.parsedType - }); - return INVALID; - } - const { status, ctx } = this._processInputParams(input); - const { shape, keys: shapeKeys } = this._getCached(); - const extraKeys = []; - if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) { - for (const key in ctx.data) { - if (!shapeKeys.includes(key)) { - extraKeys.push(key); - } - } - } - const pairs = []; - for (const key of shapeKeys) { - const keyValidator = shape[key]; - const value = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)), - alwaysSet: key in ctx.data - }); - } - if (this._def.catchall instanceof ZodNever) { - const unknownKeys = this._def.unknownKeys; - if (unknownKeys === "passthrough") { - for (const key of extraKeys) { - pairs.push({ - key: { status: "valid", value: key }, - value: { status: "valid", value: ctx.data[key] } - }); - } - } else if (unknownKeys === "strict") { - if (extraKeys.length > 0) { - addIssueToContext(ctx, { - code: ZodIssueCode.unrecognized_keys, - keys: extraKeys - }); - status.dirty(); - } - } else if (unknownKeys === "strip") - ; - else { - throw new Error(`Internal ZodObject error: invalid unknownKeys value.`); - } - } else { - const catchall = this._def.catchall; - for (const key of extraKeys) { - const value = ctx.data[key]; - pairs.push({ - key: { status: "valid", value: key }, - value: catchall._parse( - new ParseInputLazyPath(ctx, value, ctx.path, key) - //, ctx.child(key), value, getParsedType(value) - ), - alwaysSet: key in ctx.data - }); - } - } - if (ctx.common.async) { - return Promise.resolve().then(async () => { - const syncPairs = []; - for (const pair of pairs) { - const key = await pair.key; - syncPairs.push({ - key, - value: await pair.value, - alwaysSet: pair.alwaysSet - }); - } - return syncPairs; - }).then((syncPairs) => { - return ParseStatus.mergeObjectSync(status, syncPairs); - }); - } else { - return ParseStatus.mergeObjectSync(status, pairs); - } - } - get shape() { - return this._def.shape(); - } - strict(message) { - errorUtil.errToObj; - return new _ZodObject({ - ...this._def, - unknownKeys: "strict", - ...message !== void 0 ? { - errorMap: (issue, ctx) => { - var _a, _b, _c, _d; - const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === void 0 ? void 0 : _b.call(_a, issue, ctx).message) !== null && _c !== void 0 ? _c : ctx.defaultError; - if (issue.code === "unrecognized_keys") - return { - message: (_d = errorUtil.errToObj(message).message) !== null && _d !== void 0 ? _d : defaultError - }; - return { - message: defaultError - }; - } - } : {} - }); - } - strip() { - return new _ZodObject({ - ...this._def, - unknownKeys: "strip" - }); - } - passthrough() { - return new _ZodObject({ - ...this._def, - unknownKeys: "passthrough" - }); - } - // const AugmentFactory = - // (def: Def) => - // ( - // augmentation: Augmentation - // ): ZodObject< - // extendShape, Augmentation>, - // Def["unknownKeys"], - // Def["catchall"] - // > => { - // return new ZodObject({ - // ...def, - // shape: () => ({ - // ...def.shape(), - // ...augmentation, - // }), - // }) as any; - // }; - extend(augmentation) { - return new _ZodObject({ - ...this._def, - shape: () => ({ - ...this._def.shape(), - ...augmentation - }) - }); - } - /** - * Prior to zod@1.0.12 there was a bug in the - * inferred type of merged objects. Please - * upgrade if you are experiencing issues. - */ - merge(merging) { - const merged = new _ZodObject({ - unknownKeys: merging._def.unknownKeys, - catchall: merging._def.catchall, - shape: () => ({ - ...this._def.shape(), - ...merging._def.shape() - }), - typeName: ZodFirstPartyTypeKind.ZodObject - }); - return merged; - } - // merge< - // Incoming extends AnyZodObject, - // Augmentation extends Incoming["shape"], - // NewOutput extends { - // [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation - // ? Augmentation[k]["_output"] - // : k extends keyof Output - // ? Output[k] - // : never; - // }, - // NewInput extends { - // [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation - // ? Augmentation[k]["_input"] - // : k extends keyof Input - // ? Input[k] - // : never; - // } - // >( - // merging: Incoming - // ): ZodObject< - // extendShape>, - // Incoming["_def"]["unknownKeys"], - // Incoming["_def"]["catchall"], - // NewOutput, - // NewInput - // > { - // const merged: any = new ZodObject({ - // unknownKeys: merging._def.unknownKeys, - // catchall: merging._def.catchall, - // shape: () => - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), - // typeName: ZodFirstPartyTypeKind.ZodObject, - // }) as any; - // return merged; - // } - setKey(key, schema) { - return this.augment({ [key]: schema }); - } - // merge( - // merging: Incoming - // ): //ZodObject = (merging) => { - // ZodObject< - // extendShape>, - // Incoming["_def"]["unknownKeys"], - // Incoming["_def"]["catchall"] - // > { - // // const mergedShape = objectUtil.mergeShapes( - // // this._def.shape(), - // // merging._def.shape() - // // ); - // const merged: any = new ZodObject({ - // unknownKeys: merging._def.unknownKeys, - // catchall: merging._def.catchall, - // shape: () => - // objectUtil.mergeShapes(this._def.shape(), merging._def.shape()), - // typeName: ZodFirstPartyTypeKind.ZodObject, - // }) as any; - // return merged; - // } - catchall(index) { - return new _ZodObject({ - ...this._def, - catchall: index - }); - } - pick(mask) { - const shape = {}; - util.objectKeys(mask).forEach((key) => { - if (mask[key] && this.shape[key]) { - shape[key] = this.shape[key]; - } - }); - return new _ZodObject({ - ...this._def, - shape: () => shape - }); - } - omit(mask) { - const shape = {}; - util.objectKeys(this.shape).forEach((key) => { - if (!mask[key]) { - shape[key] = this.shape[key]; - } - }); - return new _ZodObject({ - ...this._def, - shape: () => shape - }); - } - /** - * @deprecated - */ - deepPartial() { - return deepPartialify(this); - } - partial(mask) { - const newShape = {}; - util.objectKeys(this.shape).forEach((key) => { - const fieldSchema = this.shape[key]; - if (mask && !mask[key]) { - newShape[key] = fieldSchema; - } else { - newShape[key] = fieldSchema.optional(); - } - }); - return new _ZodObject({ - ...this._def, - shape: () => newShape - }); - } - required(mask) { - const newShape = {}; - util.objectKeys(this.shape).forEach((key) => { - if (mask && !mask[key]) { - newShape[key] = this.shape[key]; - } else { - const fieldSchema = this.shape[key]; - let newField = fieldSchema; - while (newField instanceof ZodOptional) { - newField = newField._def.innerType; - } - newShape[key] = newField; - } - }); - return new _ZodObject({ - ...this._def, - shape: () => newShape - }); - } - keyof() { - return createZodEnum(util.objectKeys(this.shape)); - } -}; -ZodObject.create = (shape, params) => { - return new ZodObject({ - shape: () => shape, - unknownKeys: "strip", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }); -}; -ZodObject.strictCreate = (shape, params) => { - return new ZodObject({ - shape: () => shape, - unknownKeys: "strict", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }); -}; -ZodObject.lazycreate = (shape, params) => { - return new ZodObject({ - shape, - unknownKeys: "strip", - catchall: ZodNever.create(), - typeName: ZodFirstPartyTypeKind.ZodObject, - ...processCreateParams(params) - }); -}; -var ZodUnion = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const options = this._def.options; - function handleResults(results) { - for (const result of results) { - if (result.result.status === "valid") { - return result.result; - } - } - for (const result of results) { - if (result.result.status === "dirty") { - ctx.common.issues.push(...result.ctx.common.issues); - return result.result; - } - } - const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues)); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }); - return INVALID; - } - if (ctx.common.async) { - return Promise.all(options.map(async (option) => { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - return { - result: await option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }), - ctx: childCtx - }; - })).then(handleResults); - } else { - let dirty = void 0; - const issues = []; - for (const option of options) { - const childCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - }, - parent: null - }; - const result = option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: childCtx - }); - if (result.status === "valid") { - return result; - } else if (result.status === "dirty" && !dirty) { - dirty = { result, ctx: childCtx }; - } - if (childCtx.common.issues.length) { - issues.push(childCtx.common.issues); - } - } - if (dirty) { - ctx.common.issues.push(...dirty.ctx.common.issues); - return dirty.result; - } - const unionErrors = issues.map((issues2) => new ZodError(issues2)); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union, - unionErrors - }); - return INVALID; - } - } - get options() { - return this._def.options; - } -}; -ZodUnion.create = (types, params) => { - return new ZodUnion({ - options: types, - typeName: ZodFirstPartyTypeKind.ZodUnion, - ...processCreateParams(params) - }); -}; -var getDiscriminator = (type) => { - if (type instanceof ZodLazy) { - return getDiscriminator(type.schema); - } else if (type instanceof ZodEffects) { - return getDiscriminator(type.innerType()); - } else if (type instanceof ZodLiteral) { - return [type.value]; - } else if (type instanceof ZodEnum) { - return type.options; - } else if (type instanceof ZodNativeEnum) { - return Object.keys(type.enum); - } else if (type instanceof ZodDefault) { - return getDiscriminator(type._def.innerType); - } else if (type instanceof ZodUndefined) { - return [void 0]; - } else if (type instanceof ZodNull) { - return [null]; - } else { - return null; - } -}; -var ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const discriminator = this.discriminator; - const discriminatorValue = ctx.data[discriminator]; - const option = this.optionsMap.get(discriminatorValue); - if (!option) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_union_discriminator, - options: Array.from(this.optionsMap.keys()), - path: [discriminator] - }); - return INVALID; - } - if (ctx.common.async) { - return option._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } else { - return option._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - } - } - get discriminator() { - return this._def.discriminator; - } - get options() { - return this._def.options; - } - get optionsMap() { - return this._def.optionsMap; - } - /** - * The constructor of the discriminated union schema. Its behaviour is very similar to that of the normal z.union() constructor. - * However, it only allows a union of objects, all of which need to share a discriminator property. This property must - * have a different value for each object in the union. - * @param discriminator the name of the discriminator property - * @param types an array of object schemas - * @param params - */ - static create(discriminator, options, params) { - const optionsMap = /* @__PURE__ */ new Map(); - for (const type of options) { - const discriminatorValues = getDiscriminator(type.shape[discriminator]); - if (!discriminatorValues) { - throw new Error(`A discriminator value for key \`${discriminator}\` could not be extracted from all schema options`); - } - for (const value of discriminatorValues) { - if (optionsMap.has(value)) { - throw new Error(`Discriminator property ${String(discriminator)} has duplicate value ${String(value)}`); - } - optionsMap.set(value, type); - } - } - return new _ZodDiscriminatedUnion({ - typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion, - discriminator, - options, - optionsMap, - ...processCreateParams(params) - }); - } -}; -function mergeValues(a, b) { - const aType = getParsedType(a); - const bType = getParsedType(b); - if (a === b) { - return { valid: true, data: a }; - } else if (aType === ZodParsedType.object && bType === ZodParsedType.object) { - const bKeys = util.objectKeys(b); - const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1); - const newObj = { ...a, ...b }; - for (const key of sharedKeys) { - const sharedValue = mergeValues(a[key], b[key]); - if (!sharedValue.valid) { - return { valid: false }; - } - newObj[key] = sharedValue.data; - } - return { valid: true, data: newObj }; - } else if (aType === ZodParsedType.array && bType === ZodParsedType.array) { - if (a.length !== b.length) { - return { valid: false }; - } - const newArray = []; - for (let index = 0; index < a.length; index++) { - const itemA = a[index]; - const itemB = b[index]; - const sharedValue = mergeValues(itemA, itemB); - if (!sharedValue.valid) { - return { valid: false }; - } - newArray.push(sharedValue.data); - } - return { valid: true, data: newArray }; - } else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) { - return { valid: true, data: a }; - } else { - return { valid: false }; - } -} -var ZodIntersection = class extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const handleParsed = (parsedLeft, parsedRight) => { - if (isAborted(parsedLeft) || isAborted(parsedRight)) { - return INVALID; - } - const merged = mergeValues(parsedLeft.value, parsedRight.value); - if (!merged.valid) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_intersection_types - }); - return INVALID; - } - if (isDirty(parsedLeft) || isDirty(parsedRight)) { - status.dirty(); - } - return { status: status.value, value: merged.data }; - }; - if (ctx.common.async) { - return Promise.all([ - this._def.left._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), - this._def.right._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }) - ]).then(([left, right]) => handleParsed(left, right)); - } else { - return handleParsed(this._def.left._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }), this._def.right._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - })); - } - } -}; -ZodIntersection.create = (left, right, params) => { - return new ZodIntersection({ - left, - right, - typeName: ZodFirstPartyTypeKind.ZodIntersection, - ...processCreateParams(params) - }); -}; -var ZodTuple = class _ZodTuple extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.array) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.array, - received: ctx.parsedType - }); - return INVALID; - } - if (ctx.data.length < this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - return INVALID; - } - const rest = this._def.rest; - if (!rest && ctx.data.length > this._def.items.length) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: this._def.items.length, - inclusive: true, - exact: false, - type: "array" - }); - status.dirty(); - } - const items = [...ctx.data].map((item, itemIndex) => { - const schema = this._def.items[itemIndex] || this._def.rest; - if (!schema) - return null; - return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex)); - }).filter((x) => !!x); - if (ctx.common.async) { - return Promise.all(items).then((results) => { - return ParseStatus.mergeArray(status, results); - }); - } else { - return ParseStatus.mergeArray(status, items); - } - } - get items() { - return this._def.items; - } - rest(rest) { - return new _ZodTuple({ - ...this._def, - rest - }); - } -}; -ZodTuple.create = (schemas, params) => { - if (!Array.isArray(schemas)) { - throw new Error("You must pass an array of schemas to z.tuple([ ... ])"); - } - return new ZodTuple({ - items: schemas, - typeName: ZodFirstPartyTypeKind.ZodTuple, - rest: null, - ...processCreateParams(params) - }); -}; -var ZodRecord = class _ZodRecord extends ZodType { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.object) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.object, - received: ctx.parsedType - }); - return INVALID; - } - const pairs = []; - const keyType = this._def.keyType; - const valueType = this._def.valueType; - for (const key in ctx.data) { - pairs.push({ - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, key)), - value: valueType._parse(new ParseInputLazyPath(ctx, ctx.data[key], ctx.path, key)) - }); - } - if (ctx.common.async) { - return ParseStatus.mergeObjectAsync(status, pairs); - } else { - return ParseStatus.mergeObjectSync(status, pairs); - } - } - get element() { - return this._def.valueType; - } - static create(first, second, third) { - if (second instanceof ZodType) { - return new _ZodRecord({ - keyType: first, - valueType: second, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(third) - }); - } - return new _ZodRecord({ - keyType: ZodString.create(), - valueType: first, - typeName: ZodFirstPartyTypeKind.ZodRecord, - ...processCreateParams(second) - }); - } -}; -var ZodMap = class extends ZodType { - get keySchema() { - return this._def.keyType; - } - get valueSchema() { - return this._def.valueType; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.map) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.map, - received: ctx.parsedType - }); - return INVALID; - } - const keyType = this._def.keyType; - const valueType = this._def.valueType; - const pairs = [...ctx.data.entries()].map(([key, value], index) => { - return { - key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])), - value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"])) - }; - }); - if (ctx.common.async) { - const finalMap = /* @__PURE__ */ new Map(); - return Promise.resolve().then(async () => { - for (const pair of pairs) { - const key = await pair.key; - const value = await pair.value; - if (key.status === "aborted" || value.status === "aborted") { - return INVALID; - } - if (key.status === "dirty" || value.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value.value); - } - return { status: status.value, value: finalMap }; - }); - } else { - const finalMap = /* @__PURE__ */ new Map(); - for (const pair of pairs) { - const key = pair.key; - const value = pair.value; - if (key.status === "aborted" || value.status === "aborted") { - return INVALID; - } - if (key.status === "dirty" || value.status === "dirty") { - status.dirty(); - } - finalMap.set(key.value, value.value); - } - return { status: status.value, value: finalMap }; - } - } -}; -ZodMap.create = (keyType, valueType, params) => { - return new ZodMap({ - valueType, - keyType, - typeName: ZodFirstPartyTypeKind.ZodMap, - ...processCreateParams(params) - }); -}; -var ZodSet = class _ZodSet extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.set) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.set, - received: ctx.parsedType - }); - return INVALID; - } - const def = this._def; - if (def.minSize !== null) { - if (ctx.data.size < def.minSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_small, - minimum: def.minSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.minSize.message - }); - status.dirty(); - } - } - if (def.maxSize !== null) { - if (ctx.data.size > def.maxSize.value) { - addIssueToContext(ctx, { - code: ZodIssueCode.too_big, - maximum: def.maxSize.value, - type: "set", - inclusive: true, - exact: false, - message: def.maxSize.message - }); - status.dirty(); - } - } - const valueType = this._def.valueType; - function finalizeSet(elements2) { - const parsedSet = /* @__PURE__ */ new Set(); - for (const element of elements2) { - if (element.status === "aborted") - return INVALID; - if (element.status === "dirty") - status.dirty(); - parsedSet.add(element.value); - } - return { status: status.value, value: parsedSet }; - } - const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i))); - if (ctx.common.async) { - return Promise.all(elements).then((elements2) => finalizeSet(elements2)); - } else { - return finalizeSet(elements); - } - } - min(minSize, message) { - return new _ZodSet({ - ...this._def, - minSize: { value: minSize, message: errorUtil.toString(message) } - }); - } - max(maxSize, message) { - return new _ZodSet({ - ...this._def, - maxSize: { value: maxSize, message: errorUtil.toString(message) } - }); - } - size(size, message) { - return this.min(size, message).max(size, message); - } - nonempty(message) { - return this.min(1, message); - } -}; -ZodSet.create = (valueType, params) => { - return new ZodSet({ - valueType, - minSize: null, - maxSize: null, - typeName: ZodFirstPartyTypeKind.ZodSet, - ...processCreateParams(params) - }); -}; -var ZodFunction = class _ZodFunction extends ZodType { - constructor() { - super(...arguments); - this.validate = this.implement; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.function) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.function, - received: ctx.parsedType - }); - return INVALID; - } - function makeArgsIssue(args, error) { - return makeIssue({ - data: args, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - ctx.schemaErrorMap, - getErrorMap(), - errorMap - ].filter((x) => !!x), - issueData: { - code: ZodIssueCode.invalid_arguments, - argumentsError: error - } - }); - } - function makeReturnsIssue(returns, error) { - return makeIssue({ - data: returns, - path: ctx.path, - errorMaps: [ - ctx.common.contextualErrorMap, - ctx.schemaErrorMap, - getErrorMap(), - errorMap - ].filter((x) => !!x), - issueData: { - code: ZodIssueCode.invalid_return_type, - returnTypeError: error - } - }); - } - const params = { errorMap: ctx.common.contextualErrorMap }; - const fn = ctx.data; - if (this._def.returns instanceof ZodPromise) { - const me = this; - return OK(async function(...args) { - const error = new ZodError([]); - const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => { - error.addIssue(makeArgsIssue(args, e)); - throw error; - }); - const result = await Reflect.apply(fn, this, parsedArgs); - const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => { - error.addIssue(makeReturnsIssue(result, e)); - throw error; - }); - return parsedReturns; - }); - } else { - const me = this; - return OK(function(...args) { - const parsedArgs = me._def.args.safeParse(args, params); - if (!parsedArgs.success) { - throw new ZodError([makeArgsIssue(args, parsedArgs.error)]); - } - const result = Reflect.apply(fn, this, parsedArgs.data); - const parsedReturns = me._def.returns.safeParse(result, params); - if (!parsedReturns.success) { - throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]); - } - return parsedReturns.data; - }); - } - } - parameters() { - return this._def.args; - } - returnType() { - return this._def.returns; - } - args(...items) { - return new _ZodFunction({ - ...this._def, - args: ZodTuple.create(items).rest(ZodUnknown.create()) - }); - } - returns(returnType) { - return new _ZodFunction({ - ...this._def, - returns: returnType - }); - } - implement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - strictImplement(func) { - const validatedFunc = this.parse(func); - return validatedFunc; - } - static create(args, returns, params) { - return new _ZodFunction({ - args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()), - returns: returns || ZodUnknown.create(), - typeName: ZodFirstPartyTypeKind.ZodFunction, - ...processCreateParams(params) - }); - } -}; -var ZodLazy = class extends ZodType { - get schema() { - return this._def.getter(); - } - _parse(input) { - const { ctx } = this._processInputParams(input); - const lazySchema = this._def.getter(); - return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx }); - } -}; -ZodLazy.create = (getter, params) => { - return new ZodLazy({ - getter, - typeName: ZodFirstPartyTypeKind.ZodLazy, - ...processCreateParams(params) - }); -}; -var ZodLiteral = class extends ZodType { - _parse(input) { - if (input.data !== this._def.value) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_literal, - expected: this._def.value - }); - return INVALID; - } - return { status: "valid", value: input.data }; - } - get value() { - return this._def.value; - } -}; -ZodLiteral.create = (value, params) => { - return new ZodLiteral({ - value, - typeName: ZodFirstPartyTypeKind.ZodLiteral, - ...processCreateParams(params) - }); -}; -function createZodEnum(values, params) { - return new ZodEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodEnum, - ...processCreateParams(params) - }); -} -var ZodEnum = class _ZodEnum extends ZodType { - _parse(input) { - if (typeof input.data !== "string") { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }); - return INVALID; - } - if (this._def.values.indexOf(input.data) === -1) { - const ctx = this._getOrReturnCtx(input); - const expectedValues = this._def.values; - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }); - return INVALID; - } - return OK(input.data); - } - get options() { - return this._def.values; - } - get enum() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - get Values() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - get Enum() { - const enumValues = {}; - for (const val of this._def.values) { - enumValues[val] = val; - } - return enumValues; - } - extract(values) { - return _ZodEnum.create(values); - } - exclude(values) { - return _ZodEnum.create(this.options.filter((opt) => !values.includes(opt))); - } -}; -ZodEnum.create = createZodEnum; -var ZodNativeEnum = class extends ZodType { - _parse(input) { - const nativeEnumValues = util.getValidEnumValues(this._def.values); - const ctx = this._getOrReturnCtx(input); - if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) { - const expectedValues = util.objectValues(nativeEnumValues); - addIssueToContext(ctx, { - expected: util.joinValues(expectedValues), - received: ctx.parsedType, - code: ZodIssueCode.invalid_type - }); - return INVALID; - } - if (nativeEnumValues.indexOf(input.data) === -1) { - const expectedValues = util.objectValues(nativeEnumValues); - addIssueToContext(ctx, { - received: ctx.data, - code: ZodIssueCode.invalid_enum_value, - options: expectedValues - }); - return INVALID; - } - return OK(input.data); - } - get enum() { - return this._def.values; - } -}; -ZodNativeEnum.create = (values, params) => { - return new ZodNativeEnum({ - values, - typeName: ZodFirstPartyTypeKind.ZodNativeEnum, - ...processCreateParams(params) - }); -}; -var ZodPromise = class extends ZodType { - unwrap() { - return this._def.type; - } - _parse(input) { - const { ctx } = this._processInputParams(input); - if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) { - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.promise, - received: ctx.parsedType - }); - return INVALID; - } - const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data); - return OK(promisified.then((data) => { - return this._def.type.parseAsync(data, { - path: ctx.path, - errorMap: ctx.common.contextualErrorMap - }); - })); - } -}; -ZodPromise.create = (schema, params) => { - return new ZodPromise({ - type: schema, - typeName: ZodFirstPartyTypeKind.ZodPromise, - ...processCreateParams(params) - }); -}; -var ZodEffects = class extends ZodType { - innerType() { - return this._def.schema; - } - sourceType() { - return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema; - } - _parse(input) { - const { status, ctx } = this._processInputParams(input); - const effect = this._def.effect || null; - const checkCtx = { - addIssue: (arg) => { - addIssueToContext(ctx, arg); - if (arg.fatal) { - status.abort(); - } else { - status.dirty(); - } - }, - get path() { - return ctx.path; - } - }; - checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx); - if (effect.type === "preprocess") { - const processed = effect.transform(ctx.data, checkCtx); - if (ctx.common.issues.length) { - return { - status: "dirty", - value: ctx.data - }; - } - if (ctx.common.async) { - return Promise.resolve(processed).then((processed2) => { - return this._def.schema._parseAsync({ - data: processed2, - path: ctx.path, - parent: ctx - }); - }); - } else { - return this._def.schema._parseSync({ - data: processed, - path: ctx.path, - parent: ctx - }); - } - } - if (effect.type === "refinement") { - const executeRefinement = (acc) => { - const result = effect.refinement(acc, checkCtx); - if (ctx.common.async) { - return Promise.resolve(result); - } - if (result instanceof Promise) { - throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead."); - } - return acc; - }; - if (ctx.common.async === false) { - const inner = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inner.status === "aborted") - return INVALID; - if (inner.status === "dirty") - status.dirty(); - executeRefinement(inner.value); - return { status: status.value, value: inner.value }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => { - if (inner.status === "aborted") - return INVALID; - if (inner.status === "dirty") - status.dirty(); - return executeRefinement(inner.value).then(() => { - return { status: status.value, value: inner.value }; - }); - }); - } - } - if (effect.type === "transform") { - if (ctx.common.async === false) { - const base = this._def.schema._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (!isValid(base)) - return base; - const result = effect.transform(base.value, checkCtx); - if (result instanceof Promise) { - throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`); - } - return { status: status.value, value: result }; - } else { - return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => { - if (!isValid(base)) - return base; - return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({ status: status.value, value: result })); - }); - } - } - util.assertNever(effect); - } -}; -ZodEffects.create = (schema, effect, params) => { - return new ZodEffects({ - schema, - typeName: ZodFirstPartyTypeKind.ZodEffects, - effect, - ...processCreateParams(params) - }); -}; -ZodEffects.createWithPreprocess = (preprocess, schema, params) => { - return new ZodEffects({ - schema, - effect: { type: "preprocess", transform: preprocess }, - typeName: ZodFirstPartyTypeKind.ZodEffects, - ...processCreateParams(params) - }); -}; -var ZodOptional = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType === ZodParsedType.undefined) { - return OK(void 0); - } - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodOptional.create = (type, params) => { - return new ZodOptional({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodOptional, - ...processCreateParams(params) - }); -}; -var ZodNullable = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType === ZodParsedType.null) { - return OK(null); - } - return this._def.innerType._parse(input); - } - unwrap() { - return this._def.innerType; - } -}; -ZodNullable.create = (type, params) => { - return new ZodNullable({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodNullable, - ...processCreateParams(params) - }); -}; -var ZodDefault = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - let data = ctx.data; - if (ctx.parsedType === ZodParsedType.undefined) { - data = this._def.defaultValue(); - } - return this._def.innerType._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - removeDefault() { - return this._def.innerType; - } -}; -ZodDefault.create = (type, params) => { - return new ZodDefault({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodDefault, - defaultValue: typeof params.default === "function" ? params.default : () => params.default, - ...processCreateParams(params) - }); -}; -var ZodCatch = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const newCtx = { - ...ctx, - common: { - ...ctx.common, - issues: [] - } - }; - const result = this._def.innerType._parse({ - data: newCtx.data, - path: newCtx.path, - parent: { - ...newCtx - } - }); - if (isAsync(result)) { - return result.then((result2) => { - return { - status: "valid", - value: result2.status === "valid" ? result2.value : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - }); - } else { - return { - status: "valid", - value: result.status === "valid" ? result.value : this._def.catchValue({ - get error() { - return new ZodError(newCtx.common.issues); - }, - input: newCtx.data - }) - }; - } - } - removeCatch() { - return this._def.innerType; - } -}; -ZodCatch.create = (type, params) => { - return new ZodCatch({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodCatch, - catchValue: typeof params.catch === "function" ? params.catch : () => params.catch, - ...processCreateParams(params) - }); -}; -var ZodNaN = class extends ZodType { - _parse(input) { - const parsedType = this._getType(input); - if (parsedType !== ZodParsedType.nan) { - const ctx = this._getOrReturnCtx(input); - addIssueToContext(ctx, { - code: ZodIssueCode.invalid_type, - expected: ZodParsedType.nan, - received: ctx.parsedType - }); - return INVALID; - } - return { status: "valid", value: input.data }; - } -}; -ZodNaN.create = (params) => { - return new ZodNaN({ - typeName: ZodFirstPartyTypeKind.ZodNaN, - ...processCreateParams(params) - }); -}; -var BRAND = Symbol("zod_brand"); -var ZodBranded = class extends ZodType { - _parse(input) { - const { ctx } = this._processInputParams(input); - const data = ctx.data; - return this._def.type._parse({ - data, - path: ctx.path, - parent: ctx - }); - } - unwrap() { - return this._def.type; - } -}; -var ZodPipeline = class _ZodPipeline extends ZodType { - _parse(input) { - const { status, ctx } = this._processInputParams(input); - if (ctx.common.async) { - const handleAsync = async () => { - const inResult = await this._def.in._parseAsync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID; - if (inResult.status === "dirty") { - status.dirty(); - return DIRTY(inResult.value); - } else { - return this._def.out._parseAsync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - }; - return handleAsync(); - } else { - const inResult = this._def.in._parseSync({ - data: ctx.data, - path: ctx.path, - parent: ctx - }); - if (inResult.status === "aborted") - return INVALID; - if (inResult.status === "dirty") { - status.dirty(); - return { - status: "dirty", - value: inResult.value - }; - } else { - return this._def.out._parseSync({ - data: inResult.value, - path: ctx.path, - parent: ctx - }); - } - } - } - static create(a, b) { - return new _ZodPipeline({ - in: a, - out: b, - typeName: ZodFirstPartyTypeKind.ZodPipeline - }); - } -}; -var ZodReadonly = class extends ZodType { - _parse(input) { - const result = this._def.innerType._parse(input); - if (isValid(result)) { - result.value = Object.freeze(result.value); - } - return result; - } -}; -ZodReadonly.create = (type, params) => { - return new ZodReadonly({ - innerType: type, - typeName: ZodFirstPartyTypeKind.ZodReadonly, - ...processCreateParams(params) - }); -}; -var custom = (check, params = {}, fatal) => { - if (check) - return ZodAny.create().superRefine((data, ctx) => { - var _a, _b; - if (!check(data)) { - const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params; - const _fatal = (_b = (_a = p.fatal) !== null && _a !== void 0 ? _a : fatal) !== null && _b !== void 0 ? _b : true; - const p2 = typeof p === "string" ? { message: p } : p; - ctx.addIssue({ code: "custom", ...p2, fatal: _fatal }); - } - }); - return ZodAny.create(); -}; -var late = { - object: ZodObject.lazycreate -}; -var ZodFirstPartyTypeKind; -(function(ZodFirstPartyTypeKind2) { - ZodFirstPartyTypeKind2["ZodString"] = "ZodString"; - ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber"; - ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN"; - ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt"; - ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean"; - ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate"; - ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol"; - ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined"; - ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull"; - ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny"; - ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown"; - ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever"; - ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid"; - ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray"; - ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject"; - ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion"; - ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion"; - ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection"; - ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple"; - ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord"; - ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap"; - ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet"; - ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction"; - ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy"; - ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral"; - ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum"; - ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects"; - ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum"; - ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional"; - ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable"; - ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault"; - ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch"; - ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise"; - ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded"; - ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline"; - ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly"; -})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {})); -var instanceOfType = (cls, params = { - message: `Input not instance of ${cls.name}` -}) => custom((data) => data instanceof cls, params); -var stringType = ZodString.create; -var numberType = ZodNumber.create; -var nanType = ZodNaN.create; -var bigIntType = ZodBigInt.create; -var booleanType = ZodBoolean.create; -var dateType = ZodDate.create; -var symbolType = ZodSymbol.create; -var undefinedType = ZodUndefined.create; -var nullType = ZodNull.create; -var anyType = ZodAny.create; -var unknownType = ZodUnknown.create; -var neverType = ZodNever.create; -var voidType = ZodVoid.create; -var arrayType = ZodArray.create; -var objectType = ZodObject.create; -var strictObjectType = ZodObject.strictCreate; -var unionType = ZodUnion.create; -var discriminatedUnionType = ZodDiscriminatedUnion.create; -var intersectionType = ZodIntersection.create; -var tupleType = ZodTuple.create; -var recordType = ZodRecord.create; -var mapType = ZodMap.create; -var setType = ZodSet.create; -var functionType = ZodFunction.create; -var lazyType = ZodLazy.create; -var literalType = ZodLiteral.create; -var enumType = ZodEnum.create; -var nativeEnumType = ZodNativeEnum.create; -var promiseType = ZodPromise.create; -var effectsType = ZodEffects.create; -var optionalType = ZodOptional.create; -var nullableType = ZodNullable.create; -var preprocessType = ZodEffects.createWithPreprocess; -var pipelineType = ZodPipeline.create; -var ostring = () => stringType().optional(); -var onumber = () => numberType().optional(); -var oboolean = () => booleanType().optional(); -var coerce = { - string: (arg) => ZodString.create({ ...arg, coerce: true }), - number: (arg) => ZodNumber.create({ ...arg, coerce: true }), - boolean: (arg) => ZodBoolean.create({ - ...arg, - coerce: true - }), - bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }), - date: (arg) => ZodDate.create({ ...arg, coerce: true }) -}; -var NEVER = INVALID; -var z = /* @__PURE__ */ Object.freeze({ - __proto__: null, - defaultErrorMap: errorMap, - setErrorMap, - getErrorMap, - makeIssue, - EMPTY_PATH, - addIssueToContext, - ParseStatus, - INVALID, - DIRTY, - OK, - isAborted, - isDirty, - isValid, - isAsync, - get util() { - return util; - }, - get objectUtil() { - return objectUtil; - }, - ZodParsedType, - getParsedType, - ZodType, - ZodString, - ZodNumber, - ZodBigInt, - ZodBoolean, - ZodDate, - ZodSymbol, - ZodUndefined, - ZodNull, - ZodAny, - ZodUnknown, - ZodNever, - ZodVoid, - ZodArray, - ZodObject, - ZodUnion, - ZodDiscriminatedUnion, - ZodIntersection, - ZodTuple, - ZodRecord, - ZodMap, - ZodSet, - ZodFunction, - ZodLazy, - ZodLiteral, - ZodEnum, - ZodNativeEnum, - ZodPromise, - ZodEffects, - ZodTransformer: ZodEffects, - ZodOptional, - ZodNullable, - ZodDefault, - ZodCatch, - ZodNaN, - BRAND, - ZodBranded, - ZodPipeline, - ZodReadonly, - custom, - Schema: ZodType, - ZodSchema: ZodType, - late, - get ZodFirstPartyTypeKind() { - return ZodFirstPartyTypeKind; - }, - coerce, - any: anyType, - array: arrayType, - bigint: bigIntType, - boolean: booleanType, - date: dateType, - discriminatedUnion: discriminatedUnionType, - effect: effectsType, - "enum": enumType, - "function": functionType, - "instanceof": instanceOfType, - intersection: intersectionType, - lazy: lazyType, - literal: literalType, - map: mapType, - nan: nanType, - nativeEnum: nativeEnumType, - never: neverType, - "null": nullType, - nullable: nullableType, - number: numberType, - object: objectType, - oboolean, - onumber, - optional: optionalType, - ostring, - pipeline: pipelineType, - preprocess: preprocessType, - promise: promiseType, - record: recordType, - set: setType, - strictObject: strictObjectType, - string: stringType, - symbol: symbolType, - transformer: effectsType, - tuple: tupleType, - "undefined": undefinedType, - union: unionType, - unknown: unknownType, - "void": voidType, - NEVER, - ZodIssueCode, - quotelessJson, - ZodError -}); - -// submission-runner/types.cts -var RunResultKind = z.enum([ - "CompileFailed", - "TimeLimitExceeded", - "Completed", - "SandboxError", - "RunError" -]); -var RunResultZod = z.object({ - kind: RunResultKind, - output: z.string().optional(), - exitCode: z.number().optional(), - runtimeMilliseconds: z.number().optional(), - resultKindReason: z.string().optional() -}).strict(); -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - RunResultZod -}); diff --git a/shared/package.json b/shared/package.json index 01ba0ec..d298ebf 100644 --- a/shared/package.json +++ b/shared/package.json @@ -1,7 +1,7 @@ { "name": "bwcontest-shared", "scripts": { - "build": "esbuild submission-runner/*.cts --bundle --outdir=dist --format=cjs --platform=node", + "build": "esbuild submission-runner/*.cts --bundle --outdir=build --format=cjs --platform=node --sourcemap", "format": "prettier --write .", "lint": "prettier --check . && eslint .", "check": "tsc -noEmit" diff --git a/web/Dockerfile b/web/Dockerfile index a5a4816..5c166fb 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -2,9 +2,6 @@ FROM ubuntu:22.04 # Setup -RUN mkdir web -WORKDIR /app/web - RUN apt-get update RUN apt-get install curl -y @@ -14,23 +11,26 @@ RUN apt-get install nodejs git -y RUN git config --global user.name "Admin" RUN git config --global user.email noemail@example.com -# Prep Web - -COPY ./web/package*.json ./ -RUN npm install -COPY ./web/ . - # Prep Shared WORKDIR /app RUN mkdir shared WORKDIR /app/shared +COPY ./shared/package*.json ./ +RUN npm ci COPY ./shared/ . +RUN npm run build + +# Prep Web + +RUN mkdir web +WORKDIR /app/web +COPY ./web/package*.json ./ +RUN npm ci +COPY ./web/ . # Env/Build/Run -WORKDIR /app/web - ENV PORT=3000 EXPOSE 3000 EXPOSE 7006 From ffb2dba603d3e0b53569d0928de15b24c2baade0 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:45:49 -0400 Subject: [PATCH 08/14] [Web] Update README --- web/README.md | 34 +++------------------------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/web/README.md b/web/README.md index ef66ea2..5637c2f 100644 --- a/web/README.md +++ b/web/README.md @@ -30,36 +30,6 @@ node --version # You should get back 20.x.x ``` -You will need a database to work with so you need to install Postgres. - -```bash -sudo apt install postgresql -``` - -Then start and enable it - -```bash -sudo service postgresql start -sudo service postgresql enable -``` - -We will now create a database and user to work with - -```bash -sudo -u postgres psql -``` - -This will open the postgres terminal, run these commands - -```postgres -CREATE ROLE bwcontest WITH LOGIN PASSWORD 'pass123'; -CREATE DATABASE bwcontest; -ALTER DATABASE bwcontest OWNER TO bwcontest; -GRANT ALL PRIVILEGES ON DATABASE bwcontest TO bwcontest; -``` - -Then type `\q` to exit. Feel free to change the role name, database name, and password to whatever you want. Just make sure to remember them. This is only for local development so it doesn't need to be very secure. - Now we can clone the repo. Remember, all development must be in WSL so we will clone the repo in WSL. So inside of WSL, I like to create a folder called `dev` inside my home folder, but feel free to clone it anywhere else inside of WSL. Ensure git is installed in WSL with `sudo apt install git -y` ```bash @@ -76,10 +46,12 @@ Make sure you have the WSL extension installed. You can then connect WSL by open npm install ``` +You will need a database to work with. There is a provided `docker-compose.yml` file to spin up a Postgres database for development. Navigate to the `web/docker/dev-postgress` directory and run `docker compose up -d`. This will spin up the database. You can stop it by running `docker compose down` in the same directory. To check running docker containers you can run `docker ps`. + Now you need to fill out an environment file for local development. Create a `.env` file in `web/.env`. Add this information or changed with the relevant details related to how you set up your database. ```env -DATABASE_URL=postgresql://bwcontest:pass123@127.0.0.1:5432/bwcontest +DATABASE_URL=postgresql://bwcontest:pass123@127.0.0.1:5433/bwcontest ``` You now need to push the schema generated via the Prisma ORM to set up the tables in the database. This can be done by running... From 2111dcc3f93a6338c2f81986a37dc88020792326 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:46:15 -0400 Subject: [PATCH 09/14] [Web] Fix typo --- web/README.md | 2 +- web/docker/{dev-postgress => dev-postgres}/docker-compose.yml | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename web/docker/{dev-postgress => dev-postgres}/docker-compose.yml (100%) diff --git a/web/README.md b/web/README.md index 5637c2f..df2d362 100644 --- a/web/README.md +++ b/web/README.md @@ -46,7 +46,7 @@ Make sure you have the WSL extension installed. You can then connect WSL by open npm install ``` -You will need a database to work with. There is a provided `docker-compose.yml` file to spin up a Postgres database for development. Navigate to the `web/docker/dev-postgress` directory and run `docker compose up -d`. This will spin up the database. You can stop it by running `docker compose down` in the same directory. To check running docker containers you can run `docker ps`. +You will need a database to work with. There is a provided `docker-compose.yml` file to spin up a Postgres database for development. Navigate to the `web/docker/dev-postgres` directory and run `docker compose up -d`. This will spin up the database. You can stop it by running `docker compose down` in the same directory. To check running docker containers you can run `docker ps`. Now you need to fill out an environment file for local development. Create a `.env` file in `web/.env`. Add this information or changed with the relevant details related to how you set up your database. diff --git a/web/docker/dev-postgress/docker-compose.yml b/web/docker/dev-postgres/docker-compose.yml similarity index 100% rename from web/docker/dev-postgress/docker-compose.yml rename to web/docker/dev-postgres/docker-compose.yml From 54ab79626f8cb8bf1b4cdbc1e19f38314516ba33 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:53:08 -0400 Subject: [PATCH 10/14] [Web] Update deps --- web/package-lock.json | 168 +++++++++++++++++++++--------------------- web/package.json | 12 +-- 2 files changed, 90 insertions(+), 90 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index 502d3e1..0eb12aa 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -8,7 +8,7 @@ "name": "bw-hspc-contest-web", "version": "0.0.1", "dependencies": { - "@prisma/client": "^5.10.2", + "@prisma/client": "^5.11.0", "@sveltejs/adapter-node": "^5.0.1", "@types/fs-extra": "^11.0.4", "bcrypt": "^5.1.1", @@ -23,7 +23,7 @@ "js-cookie": "^3.0.5", "memfs": "^4.7.7", "node-git-server": "^1.0.0", - "prisma": "^5.10.2", + "prisma": "^5.11.0", "uuid": "^9.0.1", "zod": "^3.22.4" }, @@ -34,17 +34,17 @@ "@types/bootstrap": "^5.2.10", "@types/diff": "^5.0.9", "@types/js-cookie": "^3.0.6", - "@types/node": "^20.11.25", + "@types/node": "^20.11.26", "@types/uuid": "^9.0.8", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "prettier": "^3.2.5", "prettier-plugin-svelte": "^3.2.2", "sass": "^1.71.1", "svelte": "^4.2.12", - "svelte-check": "^3.6.6", + "svelte-check": "^3.6.7", "tslib": "^2.6.2", "typescript": "^5.4.2", "vite": "^5.1.6" @@ -644,9 +644,9 @@ } }, "node_modules/@prisma/client": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.10.2.tgz", - "integrity": "sha512-ef49hzB2yJZCvM5gFHMxSFL9KYrIP9udpT5rYo0CsHD4P9IKj473MbhU1gjKKftiwWBTIyrt9jukprzZXazyag==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.11.0.tgz", + "integrity": "sha512-SWshvS5FDXvgJKM/a0y9nDC1rqd7KG0Q6ZVzd+U7ZXK5soe73DJxJJgbNBt2GNXOa+ysWB4suTpdK5zfFPhwiw==", "hasInstallScript": true, "engines": { "node": ">=16.13" @@ -661,43 +661,43 @@ } }, "node_modules/@prisma/debug": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.10.2.tgz", - "integrity": "sha512-bkBOmH9dpEBbMKFJj8V+Zp8IZHIBjy3fSyhLhxj4FmKGb/UBSt9doyfA6k1UeUREsMJft7xgPYBbHSOYBr8XCA==" + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.11.0.tgz", + "integrity": "sha512-N6yYr3AbQqaiUg+OgjkdPp3KPW1vMTAgtKX6+BiB/qB2i1TjLYCrweKcUjzOoRM5BriA4idrkTej9A9QqTfl3A==" }, "node_modules/@prisma/engines": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.10.2.tgz", - "integrity": "sha512-HkSJvix6PW8YqEEt3zHfCYYJY69CXsNdhU+wna+4Y7EZ+AwzeupMnUThmvaDA7uqswiHkgm5/SZ6/4CStjaGmw==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.11.0.tgz", + "integrity": "sha512-gbrpQoBTYWXDRqD+iTYMirDlF9MMlQdxskQXbhARhG6A/uFQjB7DZMYocMQLoiZXO/IskfDOZpPoZE8TBQKtEw==", "hasInstallScript": true, "dependencies": { - "@prisma/debug": "5.10.2", - "@prisma/engines-version": "5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9", - "@prisma/fetch-engine": "5.10.2", - "@prisma/get-platform": "5.10.2" + "@prisma/debug": "5.11.0", + "@prisma/engines-version": "5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102", + "@prisma/fetch-engine": "5.11.0", + "@prisma/get-platform": "5.11.0" } }, "node_modules/@prisma/engines-version": { - "version": "5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9", - "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9.tgz", - "integrity": "sha512-uCy/++3Jx/O3ufM+qv2H1L4tOemTNqcP/gyEVOlZqTpBvYJUe0tWtW0y3o2Ueq04mll4aM5X3f6ugQftOSLdFQ==" + "version": "5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102.tgz", + "integrity": "sha512-WXCuyoymvrS4zLz4wQagSsc3/nE6CHy8znyiMv8RKazKymOMd5o9FP5RGwGHAtgoxd+aB/BWqxuP/Ckfu7/3MA==" }, "node_modules/@prisma/fetch-engine": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.10.2.tgz", - "integrity": "sha512-dSmXcqSt6DpTmMaLQ9K8ZKzVAMH3qwGCmYEZr/uVnzVhxRJ1EbT/w2MMwIdBNq1zT69Rvh0h75WMIi0mrIw7Hg==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.11.0.tgz", + "integrity": "sha512-994viazmHTJ1ymzvWugXod7dZ42T2ROeFuH6zHPcUfp/69+6cl5r9u3NFb6bW8lLdNjwLYEVPeu3hWzxpZeC0w==", "dependencies": { - "@prisma/debug": "5.10.2", - "@prisma/engines-version": "5.10.0-34.5a9203d0590c951969e85a7d07215503f4672eb9", - "@prisma/get-platform": "5.10.2" + "@prisma/debug": "5.11.0", + "@prisma/engines-version": "5.11.0-15.efd2449663b3d73d637ea1fd226bafbcf45b3102", + "@prisma/get-platform": "5.11.0" } }, "node_modules/@prisma/get-platform": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.10.2.tgz", - "integrity": "sha512-nqXP6vHiY2PIsebBAuDeWiUYg8h8mfjBckHh6Jezuwej0QJNnjDiOq30uesmg+JXxGk99nqyG3B7wpcOODzXvg==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.11.0.tgz", + "integrity": "sha512-rxtHpMLxNTHxqWuGOLzR2QOyQi79rK1u1XYAVLZxDGTLz/A+uoDnjz9veBFlicrpWjwuieM4N6jcnjj/DDoidw==", "dependencies": { - "@prisma/debug": "5.10.2" + "@prisma/debug": "5.11.0" } }, "node_modules/@rollup/plugin-commonjs": { @@ -1127,9 +1127,9 @@ } }, "node_modules/@types/node": { - "version": "20.11.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.25.tgz", - "integrity": "sha512-TBHyJxk2b7HceLVGFcpAUjsa5zIdsPWlR6XHfyGzd0SFu+/NFgQgMAl96MSDZgQDvJAvV6BKsFOrt6zIL09JDw==", + "version": "20.11.26", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.26.tgz", + "integrity": "sha512-YwOMmyhNnAWijOBQweOJnQPl068Oqd4K3OFbTc6AHJwzweUwwWG3GIFY74OKks2PJUDkQPeddOQES9mLn1CTEQ==", "dependencies": { "undici-types": "~5.26.4" } @@ -1158,16 +1158,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.1.1.tgz", - "integrity": "sha512-zioDz623d0RHNhvx0eesUmGfIjzrk18nSBC8xewepKXbBvN/7c1qImV7Hg8TI1URTxKax7/zxfxj3Uph8Chcuw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz", + "integrity": "sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.1.1", - "@typescript-eslint/type-utils": "7.1.1", - "@typescript-eslint/utils": "7.1.1", - "@typescript-eslint/visitor-keys": "7.1.1", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/type-utils": "7.2.0", + "@typescript-eslint/utils": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1193,15 +1193,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.1.1.tgz", - "integrity": "sha512-ZWUFyL0z04R1nAEgr9e79YtV5LbafdOtN7yapNbn1ansMyaegl2D4bL7vHoJ4HPSc4CaLwuCVas8CVuneKzplQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", + "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.1.1", - "@typescript-eslint/types": "7.1.1", - "@typescript-eslint/typescript-estree": "7.1.1", - "@typescript-eslint/visitor-keys": "7.1.1", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", "debug": "^4.3.4" }, "engines": { @@ -1221,13 +1221,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.1.1.tgz", - "integrity": "sha512-cirZpA8bJMRb4WZ+rO6+mnOJrGFDd38WoXCEI57+CYBqta8Yc8aJym2i7vyqLL1vVYljgw0X27axkUXz32T8TA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", + "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.1", - "@typescript-eslint/visitor-keys": "7.1.1" + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1238,13 +1238,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.1.1.tgz", - "integrity": "sha512-5r4RKze6XHEEhlZnJtR3GYeCh1IueUHdbrukV2KSlLXaTjuSfeVF8mZUVPLovidCuZfbVjfhi4c0DNSa/Rdg5g==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz", + "integrity": "sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.1.1", - "@typescript-eslint/utils": "7.1.1", + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/utils": "7.2.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -1265,9 +1265,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.1.1.tgz", - "integrity": "sha512-KhewzrlRMrgeKm1U9bh2z5aoL4s7K3tK5DwHDn8MHv0yQfWFz/0ZR6trrIHHa5CsF83j/GgHqzdbzCXJ3crx0Q==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", + "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1278,13 +1278,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.1.1.tgz", - "integrity": "sha512-9ZOncVSfr+sMXVxxca2OJOPagRwT0u/UHikM2Rd6L/aB+kL/QAuTnsv6MeXtjzCJYb8PzrXarypSGIPx3Jemxw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", + "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.1", - "@typescript-eslint/visitor-keys": "7.1.1", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1330,17 +1330,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.1.1.tgz", - "integrity": "sha512-thOXM89xA03xAE0lW7alstvnyoBUbBX38YtY+zAUcpRPcq9EIhXPuJ0YTv948MbzmKh6e1AUszn5cBFK49Umqg==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.2.0.tgz", + "integrity": "sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.1.1", - "@typescript-eslint/types": "7.1.1", - "@typescript-eslint/typescript-estree": "7.1.1", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", "semver": "^7.5.4" }, "engines": { @@ -1355,12 +1355,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.1.1.tgz", - "integrity": "sha512-yTdHDQxY7cSoCcAtiBzVzxleJhkGB9NncSIyMYe2+OGON1ZsP9zOPws/Pqgopa65jvknOjlk/w7ulPlZ78PiLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", + "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.1.1", + "@typescript-eslint/types": "7.2.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3411,12 +3411,12 @@ } }, "node_modules/prisma": { - "version": "5.10.2", - "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.10.2.tgz", - "integrity": "sha512-hqb/JMz9/kymRE25pMWCxkdyhbnIWrq+h7S6WysJpdnCvhstbJSNP/S6mScEcqiB8Qv2F+0R3yG+osRaWqZacQ==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.11.0.tgz", + "integrity": "sha512-KCLiug2cs0Je7kGkQBN9jDWoZ90ogE/kvZTUTgz2h94FEo8pczCkPH7fPNXkD1sGU7Yh65risGGD1HQ5DF3r3g==", "hasInstallScript": true, "dependencies": { - "@prisma/engines": "5.10.2" + "@prisma/engines": "5.11.0" }, "bin": { "prisma": "build/index.js" @@ -3898,9 +3898,9 @@ } }, "node_modules/svelte-check": { - "version": "3.6.6", - "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.6.6.tgz", - "integrity": "sha512-b9q9rOHOMYF3U8XllK7LmXTq1LeWQ98waGfEJzrFutViadkNl1tgdEtxIQ8yuPx+VQ4l7YrknYol+0lfZocaZw==", + "version": "3.6.7", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.6.7.tgz", + "integrity": "sha512-tKEjemK9FYCySAseCaIt+ps5o0XRvLC7ECjyJXXtO7vOQhR9E6JavgoUbGP1PCulD2OTcB/fi9RjV3nyF1AROw==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.17", diff --git a/web/package.json b/web/package.json index 91282fd..3ab4d28 100644 --- a/web/package.json +++ b/web/package.json @@ -18,24 +18,24 @@ "@types/bootstrap": "^5.2.10", "@types/diff": "^5.0.9", "@types/js-cookie": "^3.0.6", - "@types/node": "^20.11.25", + "@types/node": "^20.11.26", "@types/uuid": "^9.0.8", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "prettier": "^3.2.5", "prettier-plugin-svelte": "^3.2.2", "sass": "^1.71.1", "svelte": "^4.2.12", - "svelte-check": "^3.6.6", + "svelte-check": "^3.6.7", "tslib": "^2.6.2", "typescript": "^5.4.2", "vite": "^5.1.6" }, "type": "module", "dependencies": { - "@prisma/client": "^5.10.2", + "@prisma/client": "^5.11.0", "@sveltejs/adapter-node": "^5.0.1", "@types/fs-extra": "^11.0.4", "bcrypt": "^5.1.1", @@ -50,7 +50,7 @@ "js-cookie": "^3.0.5", "memfs": "^4.7.7", "node-git-server": "^1.0.0", - "prisma": "^5.10.2", + "prisma": "^5.11.0", "uuid": "^9.0.1", "zod": "^3.22.4" } From 9d3f09146c2cad3d5f1a54761729128b04c7a9c1 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 12:55:41 -0400 Subject: [PATCH 11/14] [Extension] Update deps --- extension/bwcontest/package-lock.json | 497 ++++++++++++-------------- extension/bwcontest/package.json | 36 +- 2 files changed, 252 insertions(+), 281 deletions(-) diff --git a/extension/bwcontest/package-lock.json b/extension/bwcontest/package-lock.json index 4e0485a..1796796 100644 --- a/extension/bwcontest/package-lock.json +++ b/extension/bwcontest/package-lock.json @@ -8,11 +8,11 @@ "name": "bwcontest", "version": "0.0.1", "dependencies": { - "@vscode/vsce": "^2.22.0", - "axios": "^1.6.5", + "@vscode/vsce": "^2.24.0", + "axios": "^1.6.7", "bwcontest-shared": "file:../../shared", "fs-extra": "^11.2.0", - "isomorphic-git": "^1.25.3", + "isomorphic-git": "^1.25.6", "tree-kill": "^1.2.2", "url-join": "^5.0.0", "zod": "^3.22.4" @@ -27,27 +27,27 @@ "@types/glob": "^8.1.0", "@types/mocha": "^10.0.6", "@types/node": "20.x", - "@types/vscode": "^1.85.0", - "@typescript-eslint/eslint-plugin": "^6.19.0", - "@typescript-eslint/parser": "^6.19.0", - "@vscode/test-electron": "^2.3.8", + "@types/vscode": "^1.87.0", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "@vscode/test-electron": "^2.3.9", "concurrently": "^8.2.2", - "esbuild": "^0.19.11", - "eslint": "^8.56.0", + "esbuild": "^0.20.1", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.35.1", "glob": "^10.3.10", - "mocha": "^10.2.0", - "postcss": "^8.4.33", - "prettier": "^3.2.2", - "prettier-plugin-svelte": "^3.1.2", + "mocha": "^10.3.0", + "postcss": "^8.4.35", + "prettier": "^3.2.5", + "prettier-plugin-svelte": "^3.2.2", "rollup-plugin-css-only": "^4.5.2", "rollup-plugin-postcss": "^4.0.2", - "rollup-plugin-svelte": "^7.1.6", - "svelte": "^4.2.8", - "svelte-check": "^3.6.3", + "rollup-plugin-svelte": "^7.2.0", + "svelte": "^4.2.12", + "svelte-check": "^3.6.7", "svelte-preprocess": "^5.1.3", - "typescript": "^5.3.3" + "typescript": "^5.4.2" }, "engines": { "vscode": "^1.85.0" @@ -133,9 +133,9 @@ } }, "node_modules/@esbuild/aix-ppc64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.19.11.tgz", - "integrity": "sha512-FnzU0LyE3ySQk7UntJO4+qIiQgI7KoODnZg5xzXIrFJlKd2P2gwHsHY4927xj9y5PJmJSzULiUCWmv7iWnNa7g==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.1.tgz", + "integrity": "sha512-m55cpeupQ2DbuRGQMMZDzbv9J9PgVelPjlcmM5kxHnrBdBx6REaEd7LamYV7Dm8N7rCyR/XwU6rVP8ploKtIkA==", "cpu": [ "ppc64" ], @@ -149,9 +149,9 @@ } }, "node_modules/@esbuild/android-arm": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.11.tgz", - "integrity": "sha512-5OVapq0ClabvKvQ58Bws8+wkLCV+Rxg7tUVbo9xu034Nm536QTII4YzhaFriQ7rMrorfnFKUsArD2lqKbFY4vw==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.1.tgz", + "integrity": "sha512-4j0+G27/2ZXGWR5okcJi7pQYhmkVgb4D7UKwxcqrjhvp5TKWx3cUjgB1CGj1mfdmJBQ9VnUGgUhign+FPF2Zgw==", "cpu": [ "arm" ], @@ -165,9 +165,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.11.tgz", - "integrity": "sha512-aiu7K/5JnLj//KOnOfEZ0D90obUkRzDMyqd/wNAUQ34m4YUPVhRZpnqKV9uqDGxT7cToSDnIHsGooyIczu9T+Q==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.1.tgz", + "integrity": "sha512-hCnXNF0HM6AjowP+Zou0ZJMWWa1VkD77BXe959zERgGJBBxB+sV+J9f/rcjeg2c5bsukD/n17RKWXGFCO5dD5A==", "cpu": [ "arm64" ], @@ -181,9 +181,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.11.tgz", - "integrity": "sha512-eccxjlfGw43WYoY9QgB82SgGgDbibcqyDTlk3l3C0jOVHKxrjdc9CTwDUQd0vkvYg5um0OH+GpxYvp39r+IPOg==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.1.tgz", + "integrity": "sha512-MSfZMBoAsnhpS+2yMFYIQUPs8Z19ajwfuaSZx+tSl09xrHZCjbeXXMsUF/0oq7ojxYEpsSo4c0SfjxOYXRbpaA==", "cpu": [ "x64" ], @@ -197,9 +197,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.11.tgz", - "integrity": "sha512-ETp87DRWuSt9KdDVkqSoKoLFHYTrkyz2+65fj9nfXsaV3bMhTCjtQfw3y+um88vGRKRiF7erPrh/ZuIdLUIVxQ==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.1.tgz", + "integrity": "sha512-Ylk6rzgMD8klUklGPzS414UQLa5NPXZD5tf8JmQU8GQrj6BrFA/Ic9tb2zRe1kOZyCbGl+e8VMbDRazCEBqPvA==", "cpu": [ "arm64" ], @@ -213,9 +213,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.11.tgz", - "integrity": "sha512-fkFUiS6IUK9WYUO/+22omwetaSNl5/A8giXvQlcinLIjVkxwTLSktbF5f/kJMftM2MJp9+fXqZ5ezS7+SALp4g==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.1.tgz", + "integrity": "sha512-pFIfj7U2w5sMp52wTY1XVOdoxw+GDwy9FsK3OFz4BpMAjvZVs0dT1VXs8aQm22nhwoIWUmIRaE+4xow8xfIDZA==", "cpu": [ "x64" ], @@ -229,9 +229,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.11.tgz", - "integrity": "sha512-lhoSp5K6bxKRNdXUtHoNc5HhbXVCS8V0iZmDvyWvYq9S5WSfTIHU2UGjcGt7UeS6iEYp9eeymIl5mJBn0yiuxA==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.1.tgz", + "integrity": "sha512-UyW1WZvHDuM4xDz0jWun4qtQFauNdXjXOtIy7SYdf7pbxSWWVlqhnR/T2TpX6LX5NI62spt0a3ldIIEkPM6RHw==", "cpu": [ "arm64" ], @@ -245,9 +245,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.11.tgz", - "integrity": "sha512-JkUqn44AffGXitVI6/AbQdoYAq0TEullFdqcMY/PCUZ36xJ9ZJRtQabzMA+Vi7r78+25ZIBosLTOKnUXBSi1Kw==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.1.tgz", + "integrity": "sha512-itPwCw5C+Jh/c624vcDd9kRCCZVpzpQn8dtwoYIt2TJF3S9xJLiRohnnNrKwREvcZYx0n8sCSbvGH349XkcQeg==", "cpu": [ "x64" ], @@ -261,9 +261,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.11.tgz", - "integrity": "sha512-3CRkr9+vCV2XJbjwgzjPtO8T0SZUmRZla+UL1jw+XqHZPkPgZiyWvbDvl9rqAN8Zl7qJF0O/9ycMtjU67HN9/Q==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.1.tgz", + "integrity": "sha512-LojC28v3+IhIbfQ+Vu4Ut5n3wKcgTu6POKIHN9Wpt0HnfgUGlBuyDDQR4jWZUZFyYLiz4RBBBmfU6sNfn6RhLw==", "cpu": [ "arm" ], @@ -277,9 +277,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.11.tgz", - "integrity": "sha512-LneLg3ypEeveBSMuoa0kwMpCGmpu8XQUh+mL8XXwoYZ6Be2qBnVtcDI5azSvh7vioMDhoJFZzp9GWp9IWpYoUg==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.1.tgz", + "integrity": "sha512-cX8WdlF6Cnvw/DO9/X7XLH2J6CkBnz7Twjpk56cshk9sjYVcuh4sXQBy5bmTwzBjNVZze2yaV1vtcJS04LbN8w==", "cpu": [ "arm64" ], @@ -293,9 +293,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.11.tgz", - "integrity": "sha512-caHy++CsD8Bgq2V5CodbJjFPEiDPq8JJmBdeyZ8GWVQMjRD0sU548nNdwPNvKjVpamYYVL40AORekgfIubwHoA==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.1.tgz", + "integrity": "sha512-4H/sQCy1mnnGkUt/xszaLlYJVTz3W9ep52xEefGtd6yXDQbz/5fZE5dFLUgsPdbUOQANcVUa5iO6g3nyy5BJiw==", "cpu": [ "ia32" ], @@ -309,9 +309,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.11.tgz", - "integrity": "sha512-ppZSSLVpPrwHccvC6nQVZaSHlFsvCQyjnvirnVjbKSHuE5N24Yl8F3UwYUUR1UEPaFObGD2tSvVKbvR+uT1Nrg==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.1.tgz", + "integrity": "sha512-c0jgtB+sRHCciVXlyjDcWb2FUuzlGVRwGXgI+3WqKOIuoo8AmZAddzeOHeYLtD+dmtHw3B4Xo9wAUdjlfW5yYA==", "cpu": [ "loong64" ], @@ -325,9 +325,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.11.tgz", - "integrity": "sha512-B5x9j0OgjG+v1dF2DkH34lr+7Gmv0kzX6/V0afF41FkPMMqaQ77pH7CrhWeR22aEeHKaeZVtZ6yFwlxOKPVFyg==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.1.tgz", + "integrity": "sha512-TgFyCfIxSujyuqdZKDZ3yTwWiGv+KnlOeXXitCQ+trDODJ+ZtGOzLkSWngynP0HZnTsDyBbPy7GWVXWaEl6lhA==", "cpu": [ "mips64el" ], @@ -341,9 +341,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.11.tgz", - "integrity": "sha512-MHrZYLeCG8vXblMetWyttkdVRjQlQUb/oMgBNurVEnhj4YWOr4G5lmBfZjHYQHHN0g6yDmCAQRR8MUHldvvRDA==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.1.tgz", + "integrity": "sha512-b+yuD1IUeL+Y93PmFZDZFIElwbmFfIKLKlYI8M6tRyzE6u7oEP7onGk0vZRh8wfVGC2dZoy0EqX1V8qok4qHaw==", "cpu": [ "ppc64" ], @@ -357,9 +357,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.11.tgz", - "integrity": "sha512-f3DY++t94uVg141dozDu4CCUkYW+09rWtaWfnb3bqe4w5NqmZd6nPVBm+qbz7WaHZCoqXqHz5p6CM6qv3qnSSQ==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.1.tgz", + "integrity": "sha512-wpDlpE0oRKZwX+GfomcALcouqjjV8MIX8DyTrxfyCfXxoKQSDm45CZr9fanJ4F6ckD4yDEPT98SrjvLwIqUCgg==", "cpu": [ "riscv64" ], @@ -373,9 +373,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.11.tgz", - "integrity": "sha512-A5xdUoyWJHMMlcSMcPGVLzYzpcY8QP1RtYzX5/bS4dvjBGVxdhuiYyFwp7z74ocV7WDc0n1harxmpq2ePOjI0Q==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.1.tgz", + "integrity": "sha512-5BepC2Au80EohQ2dBpyTquqGCES7++p7G+7lXe1bAIvMdXm4YYcEfZtQrP4gaoZ96Wv1Ute61CEHFU7h4FMueQ==", "cpu": [ "s390x" ], @@ -389,9 +389,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.11.tgz", - "integrity": "sha512-grbyMlVCvJSfxFQUndw5mCtWs5LO1gUlwP4CDi4iJBbVpZcqLVT29FxgGuBJGSzyOxotFG4LoO5X+M1350zmPA==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.1.tgz", + "integrity": "sha512-5gRPk7pKuaIB+tmH+yKd2aQTRpqlf1E4f/mC+tawIm/CGJemZcHZpp2ic8oD83nKgUPMEd0fNanrnFljiruuyA==", "cpu": [ "x64" ], @@ -405,9 +405,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.11.tgz", - "integrity": "sha512-13jvrQZJc3P230OhU8xgwUnDeuC/9egsjTkXN49b3GcS5BKvJqZn86aGM8W9pd14Kd+u7HuFBMVtrNGhh6fHEQ==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.1.tgz", + "integrity": "sha512-4fL68JdrLV2nVW2AaWZBv3XEm3Ae3NZn/7qy2KGAt3dexAgSVT+Hc97JKSZnqezgMlv9x6KV0ZkZY7UO5cNLCg==", "cpu": [ "x64" ], @@ -421,9 +421,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.11.tgz", - "integrity": "sha512-ysyOGZuTp6SNKPE11INDUeFVVQFrhcNDVUgSQVDzqsqX38DjhPEPATpid04LCoUr2WXhQTEZ8ct/EgJCUDpyNw==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.1.tgz", + "integrity": "sha512-GhRuXlvRE+twf2ES+8REbeCb/zeikNqwD3+6S5y5/x+DYbAQUNl0HNBs4RQJqrechS4v4MruEr8ZtAin/hK5iw==", "cpu": [ "x64" ], @@ -437,9 +437,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.11.tgz", - "integrity": "sha512-Hf+Sad9nVwvtxy4DXCZQqLpgmRTQqyFyhT3bZ4F2XlJCjxGmRFF0Shwn9rzhOYRB61w9VMXUkxlBy56dk9JJiQ==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.1.tgz", + "integrity": "sha512-ZnWEyCM0G1Ex6JtsygvC3KUUrlDXqOihw8RicRuQAzw+c4f1D66YlPNNV3rkjVW90zXVsHwZYWbJh3v+oQFM9Q==", "cpu": [ "x64" ], @@ -453,9 +453,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.11.tgz", - "integrity": "sha512-0P58Sbi0LctOMOQbpEOvOL44Ne0sqbS0XWHMvvrg6NE5jQ1xguCSSw9jQeUk2lfrXYsKDdOe6K+oZiwKPilYPQ==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.1.tgz", + "integrity": "sha512-QZ6gXue0vVQY2Oon9WyLFCdSuYbXSoxaZrPuJ4c20j6ICedfsDilNPYfHLlMH7vGfU5DQR0czHLmJvH4Nzis/A==", "cpu": [ "arm64" ], @@ -469,9 +469,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.11.tgz", - "integrity": "sha512-6YOrWS+sDJDmshdBIQU+Uoyh7pQKrdykdefC1avn76ss5c+RN6gut3LZA4E2cH5xUEp5/cA0+YxRaVtRAb0xBg==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.1.tgz", + "integrity": "sha512-HzcJa1NcSWTAU0MJIxOho8JftNp9YALui3o+Ny7hCh0v5f90nprly1U3Sj1Ldj/CvKKdvvFsCRvDkpsEMp4DNw==", "cpu": [ "ia32" ], @@ -485,9 +485,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.11.tgz", - "integrity": "sha512-vfkhltrjCAb603XaFhqhAF4LGDi2M4OrCRrFusyQ+iTLQ/o60QQXxc9cZC/FFpihBI9N1Grn6SMKVJ4KP7Fuiw==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.1.tgz", + "integrity": "sha512-0MBh53o6XtI6ctDnRMeQ+xoCN8kD2qI1rY1KgF/xdWQwoFeKou7puvDfV8/Wv4Ctx2rRpET/gGdz3YlNtNACSA==", "cpu": [ "x64" ], @@ -548,22 +548,22 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -584,9 +584,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@isaacs/cliui": { @@ -1059,28 +1059,28 @@ "dev": true }, "node_modules/@types/semver": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", - "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "node_modules/@types/vscode": { - "version": "1.85.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.85.0.tgz", - "integrity": "sha512-CF/RBon/GXwdfmnjZj0WTUMZN5H6YITOfBCP4iEZlOtVQXuzw6t7Le7+cR+7JzdMrnlm7Mfp49Oj2TuSXIWo3g==", + "version": "1.87.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.87.0.tgz", + "integrity": "sha512-y3yYJV2esWr8LNjp3VNbSMWG7Y43jC8pCldG8YwiHGAQbsymkkMMt0aDT1xZIOFM2eFcNiUc+dJMx1+Z0UT8fg==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.0.tgz", - "integrity": "sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.2.0.tgz", + "integrity": "sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/type-utils": "6.19.0", - "@typescript-eslint/utils": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/type-utils": "7.2.0", + "@typescript-eslint/utils": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -1096,8 +1096,8 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1106,15 +1106,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.19.0.tgz", - "integrity": "sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.2.0.tgz", + "integrity": "sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/typescript-estree": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", "debug": "^4.3.4" }, "engines": { @@ -1125,7 +1125,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1134,13 +1134,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz", - "integrity": "sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.2.0.tgz", + "integrity": "sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0" + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1151,13 +1151,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.19.0.tgz", - "integrity": "sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.2.0.tgz", + "integrity": "sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.19.0", - "@typescript-eslint/utils": "6.19.0", + "@typescript-eslint/typescript-estree": "7.2.0", + "@typescript-eslint/utils": "7.2.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -1169,7 +1169,7 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -1178,9 +1178,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.19.0.tgz", - "integrity": "sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.2.0.tgz", + "integrity": "sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -1191,13 +1191,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz", - "integrity": "sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.2.0.tgz", + "integrity": "sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/visitor-keys": "6.19.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/visitor-keys": "7.2.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -1243,17 +1243,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.19.0.tgz", - "integrity": "sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.2.0.tgz", + "integrity": "sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.19.0", - "@typescript-eslint/types": "6.19.0", - "@typescript-eslint/typescript-estree": "6.19.0", + "@typescript-eslint/scope-manager": "7.2.0", + "@typescript-eslint/types": "7.2.0", + "@typescript-eslint/typescript-estree": "7.2.0", "semver": "^7.5.4" }, "engines": { @@ -1264,16 +1264,16 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.19.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz", - "integrity": "sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.2.0.tgz", + "integrity": "sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.19.0", + "@typescript-eslint/types": "7.2.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -1291,9 +1291,9 @@ "dev": true }, "node_modules/@vscode/test-electron": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.8.tgz", - "integrity": "sha512-b4aZZsBKtMGdDljAsOPObnAi7+VWIaYl3ylCz1jTs+oV6BZ4TNHcVNC3xUn0azPeszBmwSBDQYfFESIaUQnrOg==", + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.9.tgz", + "integrity": "sha512-z3eiChaCQXMqBnk2aHHSEkobmC2VRalFQN0ApOAtydL172zXGxTwGrRtviT5HnUB+Q+G3vtEYFtuQkYqBzYgMA==", "dev": true, "dependencies": { "http-proxy-agent": "^4.0.1", @@ -1306,9 +1306,9 @@ } }, "node_modules/@vscode/vsce": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.22.0.tgz", - "integrity": "sha512-8df4uJiM3C6GZ2Sx/KilSKVxsetrTBBIUb3c0W4B1EWHcddioVs5mkyDKtMNP0khP/xBILVSzlXxhV+nm2rC9A==", + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.24.0.tgz", + "integrity": "sha512-p6CIXpH5HXDqmUkgFXvIKTjZpZxy/uDx4d/UsfhS9vQUun43KDNUbYeZocyAHgqcJlPEurgArHz9te1PPiqPyA==", "dependencies": { "azure-devops-node-api": "^11.0.1", "chalk": "^2.4.2", @@ -1566,9 +1566,9 @@ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/axios": { - "version": "1.6.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.5.tgz", - "integrity": "sha512-Ii012v05KEVuUoFWmMW/UQv9aRIc3ZwkWDcM+h5Il8izZCtRVpDUfwpoFf7eOtajT3QiGR4yDUx7lPqHJULgbg==", + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", + "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", "dependencies": { "follow-redirects": "^1.15.4", "form-data": "^4.0.0", @@ -1576,9 +1576,9 @@ } }, "node_modules/axobject-query": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.2.1.tgz", - "integrity": "sha512-jsyHu61e6N4Vbz/v18DHwWYKK0bSWLqn47eeDSKPB7m8tqMHF9YJ+mhIk2lVteyZrY8tnSj/jHOv4YiTCuCJgg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.0.0.tgz", + "integrity": "sha512-+60uv1hiVFhHZeO+Lz0RYzsVHy5Wr1ayX0mwda9KPDVLNJgZ1T9Ny7VmFbLDzxsH0D87I86vgj3gFrjTJUYznw==", "dev": true, "dependencies": { "dequal": "^2.0.3" @@ -2663,9 +2663,9 @@ "dev": true }, "node_modules/esbuild": { - "version": "0.19.11", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.11.tgz", - "integrity": "sha512-HJ96Hev2hX/6i5cDVwcqiJBBtuo9+FeIJOtZ9W1kA5M6AMJRHUZlpYZ1/SbEwtO0ioNAW8rUooVpC/WehY2SfA==", + "version": "0.20.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.1.tgz", + "integrity": "sha512-OJwEgrpWm/PCMsLVWXKqvcjme3bHNpOgN7Tb6cQnR5n0TPbQx1/Xrn7rqM+wn17bYeT6MGB5sn1Bh5YiGi70nA==", "dev": true, "hasInstallScript": true, "bin": { @@ -2675,29 +2675,29 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/aix-ppc64": "0.19.11", - "@esbuild/android-arm": "0.19.11", - "@esbuild/android-arm64": "0.19.11", - "@esbuild/android-x64": "0.19.11", - "@esbuild/darwin-arm64": "0.19.11", - "@esbuild/darwin-x64": "0.19.11", - "@esbuild/freebsd-arm64": "0.19.11", - "@esbuild/freebsd-x64": "0.19.11", - "@esbuild/linux-arm": "0.19.11", - "@esbuild/linux-arm64": "0.19.11", - "@esbuild/linux-ia32": "0.19.11", - "@esbuild/linux-loong64": "0.19.11", - "@esbuild/linux-mips64el": "0.19.11", - "@esbuild/linux-ppc64": "0.19.11", - "@esbuild/linux-riscv64": "0.19.11", - "@esbuild/linux-s390x": "0.19.11", - "@esbuild/linux-x64": "0.19.11", - "@esbuild/netbsd-x64": "0.19.11", - "@esbuild/openbsd-x64": "0.19.11", - "@esbuild/sunos-x64": "0.19.11", - "@esbuild/win32-arm64": "0.19.11", - "@esbuild/win32-ia32": "0.19.11", - "@esbuild/win32-x64": "0.19.11" + "@esbuild/aix-ppc64": "0.20.1", + "@esbuild/android-arm": "0.20.1", + "@esbuild/android-arm64": "0.20.1", + "@esbuild/android-x64": "0.20.1", + "@esbuild/darwin-arm64": "0.20.1", + "@esbuild/darwin-x64": "0.20.1", + "@esbuild/freebsd-arm64": "0.20.1", + "@esbuild/freebsd-x64": "0.20.1", + "@esbuild/linux-arm": "0.20.1", + "@esbuild/linux-arm64": "0.20.1", + "@esbuild/linux-ia32": "0.20.1", + "@esbuild/linux-loong64": "0.20.1", + "@esbuild/linux-mips64el": "0.20.1", + "@esbuild/linux-ppc64": "0.20.1", + "@esbuild/linux-riscv64": "0.20.1", + "@esbuild/linux-s390x": "0.20.1", + "@esbuild/linux-x64": "0.20.1", + "@esbuild/netbsd-x64": "0.20.1", + "@esbuild/openbsd-x64": "0.20.1", + "@esbuild/sunos-x64": "0.20.1", + "@esbuild/win32-arm64": "0.20.1", + "@esbuild/win32-ia32": "0.20.1", + "@esbuild/win32-x64": "0.20.1" } }, "node_modules/escalade": { @@ -2722,16 +2722,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -3731,9 +3731,9 @@ "dev": true }, "node_modules/isomorphic-git": { - "version": "1.25.3", - "resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.25.3.tgz", - "integrity": "sha512-iUaDB5kObupWpwjQ+EGkDQmaYQzbq1XaPqo+xJCCfbPViGZL94rU2RvK4EDJKpYbyiwbq5OSLEjkXHa8r5I1aw==", + "version": "1.25.6", + "resolved": "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.25.6.tgz", + "integrity": "sha512-zA3k3QOO7doqOnBgwsaXJwHKSIIl5saEdH4xxalu082WHVES4KghsG6RE2SDwjXMCIlNa1bWocbitH6bRIrmLQ==", "dependencies": { "async-lock": "^1.1.0", "clean-git-ref": "^2.0.1", @@ -4169,9 +4169,9 @@ "optional": true }, "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.3.0.tgz", + "integrity": "sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", @@ -4181,13 +4181,12 @@ "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.2.0", + "glob": "8.1.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -4202,44 +4201,27 @@ }, "engines": { "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/mocha/node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", @@ -4302,18 +4284,6 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -4694,9 +4664,9 @@ } }, "node_modules/postcss": { - "version": "8.4.33", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.33.tgz", - "integrity": "sha512-Kkpbhhdjw2qQs2O2DGX+8m5OVqEcbB9HRBvuYM9pgrjEFUg30A9LmXNlTAUj4S9kgtGyrMbTzVjH7E+s5Re2yg==", + "version": "8.4.35", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.35.tgz", + "integrity": "sha512-u5U8qYpBCpN13BsiEB0CbR1Hhh4Gc0zLFuedrHJKMctHCHAGrMdG0PRM/KErzAL3CU6/eckEtmHNB3x6e3c0vA==", "dev": true, "funding": [ { @@ -5348,9 +5318,9 @@ } }, "node_modules/prettier": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.2.tgz", - "integrity": "sha512-HTByuKZzw7utPiDO523Tt2pLtEyK7OibUD9suEJQrPUCYQqrHr74GGX6VidMrovbf/I50mPqr8j/II6oBAuc5A==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "dev": true, "bin": { "prettier": "bin/prettier.cjs" @@ -5363,9 +5333,9 @@ } }, "node_modules/prettier-plugin-svelte": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.1.2.tgz", - "integrity": "sha512-7xfMZtwgAWHMT0iZc8jN4o65zgbAQ3+O32V6W7pXrqNvKnHnkoyQCGCbKeUyXKZLbYE0YhFRnamfxfkEGxm8qA==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/prettier-plugin-svelte/-/prettier-plugin-svelte-3.2.2.tgz", + "integrity": "sha512-ZzzE/wMuf48/1+Lf2Ffko0uDa6pyCfgHV6+uAhtg2U0AAXGrhCSW88vEJNAkAxW5qyrFY1y1zZ4J8TgHrjW++Q==", "dev": true, "peerDependencies": { "prettier": "^3.0.0", @@ -5668,9 +5638,9 @@ } }, "node_modules/rollup-plugin-svelte": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.1.6.tgz", - "integrity": "sha512-nVFRBpGWI2qUY1OcSiEEA/kjCY2+vAjO9BI8SzA7NRrh2GTunLd6w2EYmnMt/atgdg8GvcNjLsmZmbQs/u4SQA==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-7.2.0.tgz", + "integrity": "sha512-Qvo5VNFQZtaI+sHSjcCIFDP+olfKVyslAoJIkL3DxuhUpNY5Ys0+hhxUY3kuEKt9BXFgkFJiiic/XRb07zdSbg==", "dev": true, "dependencies": { "@rollup/pluginutils": "^4.1.0", @@ -6171,17 +6141,18 @@ } }, "node_modules/svelte": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.8.tgz", - "integrity": "sha512-hU6dh1MPl8gh6klQZwK/n73GiAHiR95IkFsesLPbMeEZi36ydaXL/ZAb4g9sayT0MXzpxyZjR28yderJHxcmYA==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-4.2.12.tgz", + "integrity": "sha512-d8+wsh5TfPwqVzbm4/HCXC783/KPHV60NvwitJnyTA5lWn1elhXMNWhXGCJ7PwPa8qFUnyJNIyuIRt2mT0WMug==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", "@jridgewell/sourcemap-codec": "^1.4.15", "@jridgewell/trace-mapping": "^0.3.18", + "@types/estree": "^1.0.1", "acorn": "^8.9.0", "aria-query": "^5.3.0", - "axobject-query": "^3.2.1", + "axobject-query": "^4.0.0", "code-red": "^1.0.3", "css-tree": "^2.3.1", "estree-walker": "^3.0.3", @@ -6195,9 +6166,9 @@ } }, "node_modules/svelte-check": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.6.3.tgz", - "integrity": "sha512-Q2nGnoysxUnB9KjnjpQLZwdjK62DHyW6nuH/gm2qteFnDk0lCehe/6z8TsIvYeKjC6luKaWxiNGyOcWiLLPSwA==", + "version": "3.6.7", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-3.6.7.tgz", + "integrity": "sha512-tKEjemK9FYCySAseCaIt+ps5o0XRvLC7ECjyJXXtO7vOQhR9E6JavgoUbGP1PCulD2OTcB/fi9RjV3nyF1AROw==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.17", @@ -6206,7 +6177,7 @@ "import-fresh": "^3.2.1", "picocolors": "^1.0.0", "sade": "^1.7.4", - "svelte-preprocess": "^5.1.0", + "svelte-preprocess": "^5.1.3", "typescript": "^5.0.3" }, "bin": { @@ -6471,12 +6442,12 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.2.tgz", - "integrity": "sha512-Cbu4nIqnEdd+THNEsBdkolnOXhg0I8XteoHaEKgvsxpsbWda4IsUut2c187HxywQCvveojow0Dgw/amxtSKVkQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { - "node": ">=16.13.0" + "node": ">=16" }, "peerDependencies": { "typescript": ">=4.2.0" @@ -6545,9 +6516,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/extension/bwcontest/package.json b/extension/bwcontest/package.json index cf49131..b629e35 100644 --- a/extension/bwcontest/package.json +++ b/extension/bwcontest/package.json @@ -4,7 +4,7 @@ "description": "The student extension for BW's HSPC", "version": "0.0.1", "engines": { - "vscode": "^1.85.0" + "vscode": "^1.87.0" }, "categories": [ "Other" @@ -91,34 +91,34 @@ "@types/glob": "^8.1.0", "@types/mocha": "^10.0.6", "@types/node": "20.x", - "@types/vscode": "^1.85.0", - "@typescript-eslint/eslint-plugin": "^6.19.0", - "@typescript-eslint/parser": "^6.19.0", - "@vscode/test-electron": "^2.3.8", + "@types/vscode": "^1.87.0", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "@vscode/test-electron": "^2.3.9", "concurrently": "^8.2.2", - "esbuild": "^0.19.11", - "eslint": "^8.56.0", + "esbuild": "^0.20.1", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-svelte": "^2.35.1", "glob": "^10.3.10", - "mocha": "^10.2.0", - "postcss": "^8.4.33", - "prettier": "^3.2.2", - "prettier-plugin-svelte": "^3.1.2", + "mocha": "^10.3.0", + "postcss": "^8.4.35", + "prettier": "^3.2.5", + "prettier-plugin-svelte": "^3.2.2", "rollup-plugin-css-only": "^4.5.2", "rollup-plugin-postcss": "^4.0.2", - "rollup-plugin-svelte": "^7.1.6", - "svelte": "^4.2.8", - "svelte-check": "^3.6.3", + "rollup-plugin-svelte": "^7.2.0", + "svelte": "^4.2.12", + "svelte-check": "^3.6.7", "svelte-preprocess": "^5.1.3", - "typescript": "^5.3.3" + "typescript": "^5.4.2" }, "dependencies": { - "@vscode/vsce": "^2.22.0", - "axios": "^1.6.5", + "@vscode/vsce": "^2.24.0", + "axios": "^1.6.7", "bwcontest-shared": "file:../../shared", "fs-extra": "^11.2.0", - "isomorphic-git": "^1.25.3", + "isomorphic-git": "^1.25.6", "tree-kill": "^1.2.2", "url-join": "^5.0.0", "zod": "^3.22.4" From f71dbb441c54c1b419ffe91af392fec0c6254bd6 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 13:02:27 -0400 Subject: [PATCH 12/14] [Shared] Update tsconfig outDir --- shared/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/tsconfig.json b/shared/tsconfig.json index e93972e..32bd32c 100644 --- a/shared/tsconfig.json +++ b/shared/tsconfig.json @@ -6,7 +6,7 @@ "declaration": true, "declarationMap": true, "sourceMap": true, - "outDir": "./dist", + "outDir": "./build", "esModuleInterop": true, "strict": true }, From c5d0aaed86339e99bb1c1b0465691efb3f35992a Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 13:03:45 -0400 Subject: [PATCH 13/14] [Shared] Use default import --- shared/submission-runner/java.cts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared/submission-runner/java.cts b/shared/submission-runner/java.cts index 9ca3707..5823f94 100644 --- a/shared/submission-runner/java.cts +++ b/shared/submission-runner/java.cts @@ -3,8 +3,7 @@ import { exec, spawn } from 'child_process'; import * as util from 'util'; import type { IRunner, IRunnerParams, IRunnerReturn, RunResult } from './types.cjs'; import { timeoutSeconds } from './settings.cjs'; - -import kill = require('tree-kill'); +import kill from 'tree-kill'; const execPromise = util.promisify(exec); From 23fd3956ea888e0b6f04d086756b2b3ef66eadb8 Mon Sep 17 00:00:00 2001 From: orosmatthew Date: Tue, 12 Mar 2024 13:07:28 -0400 Subject: [PATCH 14/14] [Shared] Update esbuild outdir --- shared/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/package.json b/shared/package.json index d298ebf..6a5e626 100644 --- a/shared/package.json +++ b/shared/package.json @@ -1,7 +1,7 @@ { "name": "bwcontest-shared", "scripts": { - "build": "esbuild submission-runner/*.cts --bundle --outdir=build --format=cjs --platform=node --sourcemap", + "build": "esbuild submission-runner/*.cts --bundle --outdir=build/submission-runner --format=cjs --platform=node --sourcemap", "format": "prettier --write .", "lint": "prettier --check . && eslint .", "check": "tsc -noEmit"