bitburner-src/dist/main.bundle.js

22 lines
2.0 MiB
JavaScript
Raw Normal View History

2022-10-17 22:16:59 +02:00
!function(t){function e(e){for(var a,o,s=e[0],c=e[1],l=e[2],u=0,m=[];u<s.length;u++)o=s[u],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&m.push(r[o][0]),r[o]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(t[a]=c[a]);for(f&&f(e);m.length;)m.shift()();return i.push.apply(i,l||[]),n()}function n(){for(var t,e=0;e<i.length;e++){for(var n=i[e],a=!0,s=1;s<n.length;s++){var c=n[s];0!==r[c]&&(a=!1)}a&&(i.splice(e--,1),t=o(o.s=n[0]))}return t}var a={},r={0:0},i=[];function o(e){if(a[e])return a[e].exports;var n=a[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=t,o.c=a,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)o.d(n,a,function(e){return t[e]}.bind(null,a));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="";var s=window.webpackJsonp=window.webpackJsonp||[],c=s.push.bind(s);s.push=e,s=s.slice();for(var l=0;l<s.length;l++)e(s[l]);var f=c;i.push([1571,1]),n()}([,function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));var a=n(589),r=n(111),i=n(16);let o=new a.a;function s(t){o=JSON.parse(t,i.c),o.money=parseFloat(o.money+""),o.exploits=Object(r.c)(o.exploits)}},function(t,e,n){"use strict";n.d(e,"c",(function(){return C})),n.d(e,"a",(function(){return x})),n.d(e,"b",(function(){return F}));var a=n(393),r=n(26),i=n(1),o=n(314),s=n(7),c=n(17),l=n(46),f=n(100),u=n(422),m=n(29),h=n(25),d=n(15),p=n(382),g=n(1086),y=n(191),b=n(599),E=n(468),v=n(629),k=n(265),w=n(292),S=n(93),_=n(19);const C={string:O,number:function(t,e,n){if("string"==typeof n){const t=parseFloat(n);if(!isNaN(t))return t}else if("number"==typeof n){if(isNaN(n))throw T(t,`'${e}' is NaN.`);return n}throw T(t,`'${e}' should be a number. ${L(n)}`,"TYPE")},scriptArgs:M,argsToString:function(t){let e="";for(let n of t)null!==n?void 0!==n?(n=Object(v.a)(n),e+="object"==typeof n?JSON.stringify(n):""+n):e+="undefined":e+="null";return e},makeBasicErrorMsg:A,makeRuntimeErrorMsg:T,resolveNetscriptRequestedThreads:function(t,e){const n=t.workerScript.scriptRef.threads;if(!e)return isNaN(n)||n<1?1:n;const a=0|e;if(isNaN(e)||a<1)throw T(t,`Invalid thread count: ${e}. Threads must be a positive number.`);if(a>n)throw T(t,`Too many threads requested by ${t.function}. Requested: ${e}. Has: ${n}.`);return a},checkEnvFlags:function(t){const e=t.workerScript;if(e.env.stopFlag)throw P(t,()=>"Failed to run due to script being killed."),new o.a(e);if(e.env.runningFn&&"asleep"!==t.function){var n;throw null===(n=e.delayReject)||void 0===n||n.call(e,new o.a(e)),e.env.stopFlag=!0,P(t,()=>"Failed to run due to failed concurrency check."),T(t,`Concurrent calls to Netscript functions are not allowed!\n Did you forget to await hack(), grow(), or some other\n promise-returning function?\n Currently running: ${e.env.runningFn} tried to run: ${t.function}`,"CONCURRENCY")}},checkSingularityAccess:function(t){if(4!==i.a.bitNodeN&&0===i.a.sourceFileLvl(4))throw T(t,"This singularity function requires Source-File 4 to run. A power up you obtain later in the game.\n It will be very obvious when and how you can obtain it.","API ACCESS")},netscriptDelay:function(t,e){const n=t.workerScript;return new Promise((function(a,r){n.delay=window.setTimeout(()=>{n.delay=null,n.delayReject=void 0,n.env.runningFn="",n.env.stopFlag?r(new o.a(n)):a()},e),n.delayReject=r,n.env.runningFn=t.function}))},updateDynamicRam:function(t,e){const n=t.workerScript,a=t.function;if(n.dynamicLoadedFns[a])return;n.dynamicLoadedFns[a]=!0;let r=n.s
2022-04-12 23:35:16 +02:00
/**
* @license
* JavaScript Interpreter
*
* Copyright 2013 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
2022-10-17 22:16:59 +02:00
*/r.PARSE_OPTIONS={ecmaVersion:5,locations:!0},r.READONLY_DESCRIPTOR={configurable:!0,enumerable:!0,writable:!1},r.NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!0},r.READONLY_NONENUMERABLE_DESCRIPTOR={configurable:!0,enumerable:!1,writable:!1},r.VARIABLE_DESCRIPTOR={configurable:!1,enumerable:!0,writable:!0},r.STEP_ERROR={},r.SCOPE_REFERENCE={},r.VALUE_IN_DESCRIPTOR={},r.toStringCycles_=[],r.prototype.getErrorLineNumber=function(t){var e=this.sourceCode;if(null==t||null==t.start)return NaN;try{return((e=e.substring(0,t.start)).match(/\n/g)||[]).length+1-this.sourceCodeLineOffset}catch(t){return NaN}},r.prototype.getErrorLineNumberMessage=function(t){return isNaN(t)?" (Unknown line number)":t<=0?" (Error occurred in an imported function)":" (Line Number "+t+". This line number is probably incorrect if your script is importing any functions. This is being worked on)"},r.prototype.appendCode=function(t){var e=this.stateStack[0];if(!e||"Program"!==e.node.type)throw Error("Expecting original AST to start with a Program node.");if("string"==typeof t&&(t=a.a(t,r.PARSE_OPTIONS)),!t||"Program"!==t.type)throw Error("Expecting new AST to start with a Program node.");this.populateScope_(t,e.scope);for(var n,i=0;n=t.body[i];i++)e.node.body.push(n);e.done=!1},r.prototype.step=function(){var t=this.stateStack,e=t[t.length-1];if(!e)return!1;var n=e.node,a=n.type;if("Program"===a&&e.done)return!1;if(this.paused_)return!0;try{var i=this.stepFunctions_[a](t,e,n)}catch(t){if(t!==r.STEP_ERROR)throw t}return i&&t.push(i),!!n.end||this.step()},r.prototype.run=function(){for(;!this.paused_&&this.step(););return this.paused_},r.prototype.initGlobalScope=function(t){this.setProperty(t,"NaN",NaN,r.READONLY_DESCRIPTOR),this.setProperty(t,"Infinity",1/0,r.READONLY_DESCRIPTOR),this.setProperty(t,"undefined",void 0,r.READONLY_DESCRIPTOR),this.setProperty(t,"window",t,r.READONLY_DESCRIPTOR),this.setProperty(t,"this",t,r.READONLY_DESCRIPTOR),this.setProperty(t,"self",t),this.OBJECT_PROTO=new r.Object(null),this.FUNCTION_PROTO=new r.Object(this.OBJECT_PROTO),this.initFunction(t),this.initObject(t),t.proto=this.OBJECT_PROTO,this.setProperty(t,"constructor",this.OBJECT,r.NONENUMERABLE_DESCRIPTOR),this.initArray(t),this.initString(t),this.initBoolean(t),this.initNumber(t),this.initDate(t),this.initRegExp(t),this.initError(t),this.initMath(t),this.initJSON(t);var e=this,n=this.createNativeFunction((function(t){throw EvalError("Can't happen")}),!1);n.eval=!0,this.setProperty(t,"eval",n),this.setProperty(t,"parseInt",this.createNativeFunction(parseInt,!1)),this.setProperty(t,"parseFloat",this.createNativeFunction(parseFloat,!1)),this.setProperty(t,"isNaN",this.createNativeFunction(isNaN,!1)),this.setProperty(t,"isFinite",this.createNativeFunction(isFinite,!1));for(var a=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]],i=0;i<a.length;i++){var o=function(t){return function(n){try{return t(n)}catch(t){e.throwException(e.URI_ERROR,t.message)}}}(a[i][0]);this.setProperty(t,a[i][1],this.createNativeFunction(o,!1),r.NONENUMERABLE_DESCRIPTOR)}this.OBJECT=this.OBJECT,this.OBJECT_PROTO=this.OBJECT_PROTO,this.FUNCTION=this.FUNCTION,this.FUNCTION_PROTO=this.FUNCTION_PROTO,this.ARRAY=this.ARRAY,this.ARRAY_PROTO=this.ARRAY_PROTO,this.REGEXP=this.REGEXP,this.REGEXP_PROTO=this.REGEXP_PROTO,this.DATE=this.DATE,this.DATE_PROTO=this.DATE_PROTO,this.UNDEFINED=void 0,this.NULL=null,this.NAN=NaN,this.TRUE=!0,this.FALSE=!1,this.STRING_EMPTY="",this.NUMBER_ZERO=0,this.NUMBER_ONE=1,this.initFunc_&&this.initFunc_(this,t)},r.prototype.initFunction=function(t){var e,n=this,i=/^[A-Za-z_$][\w$]*$/;(e=function(t){if(n.calledWithNew())var e=this;else e=n.createObjectProto(n.FUNCTION_PROTO);if(arguments.length)var o=String(arguments[arguments.length-1]);else o="";var s=Array.prototype.slice.call(arguments,0,-1).join(",").trim();if(s){for(var c=s.split(/\s*,\s*/),l=0;l<c.length;l++){var f=c[l];i.test(f)||n.throwException(n.SYNTAX_ERROR,"Invalid func
2022-08-23 18:48:51 +02:00
//!shouldCompile ensures that script.module is non-null, hence the "as".
2022-10-17 22:16:59 +02:00
if(!shouldCompile(script,scripts))return script.module;if(script.queueCompile=!0,await script.module,!script.queueCompile)return script.module;script.queueCompile=!1,script.updateRamUsage(scripts);const uurls=_getScriptUrls(script,scripts,[]),url=uurls[uurls.length-1].url;return script.url&&script.url!==url&&URL.revokeObjectURL(script.url),script.dependencies.length>0&&script.dependencies.forEach(t=>URL.revokeObjectURL(t.url)),script.url=uurls[uurls.length-1].url,script.module=new Promise(resolve=>resolve(eval("import(uurls[uurls.length - 1].url)"))),script.dependencies=uurls,script.module}function isDependencyOutOfDate(t,e,n){const a=e.find(e=>e.filename==t);if(!a)return!0;return a.moduleSequenceNumber>n}function shouldCompile(t,e){return!t.module||!!t.dependencies.some(n=>isDependencyOutOfDate(n.filename,e,t.moduleSequenceNumber))&&(t.module=null,!0)}function _getScriptUrls(t,e,n){const a=[];for(const e of n)t.dependents.some(t=>t.server===e.server&&t.filename==e.filename)||t.dependents.push({server:e.server,filename:e.filename});n.push(t);try{const r=Object(acorn__WEBPACK_IMPORTED_MODULE_1__.a)(t.code,{sourceType:"module",ecmaVersion:"latest",ranges:!0}),i=[];acorn_walk__WEBPACK_IMPORTED_MODULE_0__.b(r,{ImportDeclaration(t){t.source&&i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})},ExportNamedDeclaration(t){t.source&&i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})},ExportAllDeclaration(t){t.source&&i.push({filename:t.source.value,start:t.source.range[0]+1,end:t.source.range[1]-1})}}),i.sort((t,e)=>e.start-t.start);let o=t.code;for(const t of i){const r=t.filename.startsWith("./")?t.filename.substring(2):t.filename,i=e.filter(t=>Object(_Terminal_DirectoryHelpers__WEBPACK_IMPORTED_MODULE_3__.b)(t.filename,r));if(0===i.length)continue;const[s]=i,c=_getScriptUrls(s,e,n);a.push(...c);const l=c[c.length-1].url;o=o.substring(0,t.start)+l+o.substring(t.end)}o+=`\n//# sourceURL=${t.server}/${t.filename}`;const s=URL.createObjectURL(makeScriptBlob(o));return a.push(new _Script_ScriptUrl__WEBPACK_IMPORTED_MODULE_2__.a(t.filename,s,t.moduleSequenceNumber)),a}catch(t){for(const t of a)URL.revokeObjectURL(t.url);throw t}finally{n.pop()}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(26);function r(t){if(null!=t.ramUsage&&t.ramUsage>0)return t.ramUsage;const e=Object(a.d)(t.server);if(null==e)return 0;for(let n=0;n<e.scripts.length;++n)if(e.scripts[n].filename===t.filename)return t.ramUsage=e.scripts[n].ramUsage,t.ramUsage;return 0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(9),r=n(77),i=n(23),o=n(95),s=n(1131),c=n(132);const l="/** @param {NS} ns */\nexport async function main(ns) {\n\n}";function f({args:t,server:e}){if(1==t.length&&(""+t[0]).includes("*")){return function(t,e){const n={glob:t,preGlob:"",postGlob:"",globError:"",globMatches:[],globAgainst:e};if(1!==(t=t.replace("**","*")).split("").filter(t=>"*"==t).length)return n.globError="Only a single glob is supported per command.\nexample: `nano my-dir/*.js`",n;[n.preGlob,n.postGlob]=t.split("*"),n.preGlob=Object(r.k)(n.preGlob);const i=Object(r.l)(a.a.cwd());return n.preGlob=`${i}/${n.preGlob}`,e.forEach(t=>{const e=t.filename.startsWith("/")?t.filename:"/"+t.filename;e.startsWith(n.preGlob)&&e.endsWith(n.postGlob)&&n.globMatches.push(e)}),n.glob=`${n.preGlob}*${n.postGlob}`,n}(""+t[0],e.scripts)}return null}function u(t,{args:e,server:n},r){if(e.length<1)return void a.a.error(`Incorrect usage of ${t} command. Usage: ${t} [scriptname]`);let u=e;try{const m=f({args:e,server:n});if(m){if(!1===Object(c.isEmpty)(m.globError))throw new Error(m.globError);u=m.globMatches}const h=u.map(e=>{const n=""+e;if(Object(o.a)(n)){const t=a.a.getFilepath(n),e=a.a.getScript(n),r=function(t){return t.endsWith(".js")}(n),i=null!==e?e.code:r?l:"";return i===l&&s.a.saveCursor(n,{row:3,column:5}),[t,i]}if(n.endsWith(".txt")){const t=a.a.getFilepath(n),e=a.a.getTextFile(n);return[t,null===e?"":e.text]}throw new Error("Invalid file. Only scripts (.script or .js), or text
2022-04-12 23:35:16 +02:00
//# sourceMappingURL=main.bundle.js.map