{"version":3,"sources":["jsdelivr-header.js","/npm/@depack/depack@2.2.1/compile/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,KACJ,KAAI,SAAE,SAAQ,QAAE,QAAO,YAAE,YAAW,WAAE,WAAU,oBAAE,oBAAmB,yBACrE,yBAAwB,cAAE,eACxB,QAAQ,YAYZ,SAAS,IAAI,EAAM,GACjB,OAAO,KAAK,EAAM,EACpB,CAMA,SAAS,qBACP,OAAO,qBACT,CAkBA,SAAS,QAAQ,EAAS,EAAY,GACpC,OAAO,SAAS,EAAS,EAAY,EACvC,CAcA,SAAS,OAAO,EAAS,EAAY,GACnC,OAAO,QAAQ,EAAS,EAAY,EACtC,CAuBA,SAAS,aAAa,EAAS,EAAY,GACzC,OAAO,cAAc,EAAS,EAAY,EAC5C,CAoBA,SAAS,WAAW,GAClB,OAAO,YAAY,EACrB,CAQA,SAAS,UAAU,EAAQ,GACzB,OAAO,WAAW,EAAQ,EAC5B,CAMA,MAAM,wBAA0B,yBAEhC,OAAO,QAAQ,IAAM,IACrB,OAAO,QAAQ,QAAU,QACzB,OAAO,QAAQ,OAAS,OACxB,OAAO,QAAQ,aAAe,aAC9B,OAAO,QAAQ,WAAa,WAC5B,OAAO,QAAQ,UAAY,UAC3B,OAAO,QAAQ,mBAAqB,mBACpC,OAAO,QAAQ,wBAA0B","file":"/npm/@depack/depack@2.2.1/compile/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@depack/depack@2.2.1/compile/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const {\n  _run, _Compile, _Bundle, _getOptions, _getOutput, _getCompilerVersion,\n  _GOOGLE_CLOSURE_COMPILER, _BundleChunks,\n} = require('./depack')\n\n/**\n * Low-level API used by `Compile` and `Bundle`. Spawns _Java_ and executes the compilation. To debug a possible bug in the _GCC_, the sources after each pass can be saved to the file specified with the `debug` command. Also, _GCC_ does not add `// # sourceMappingURL=output.map` comment, therefore it's done by this method. Returns `stdout` of the _Java_ process. Returns the _stdout_ of the Java process.\n * @param {!Array<string>} args The arguments to Java.\n * @param {!_depack.RunConfig} [opts] General options for running of the compiler.\n * @param {string} [opts.output] The path where the output will be saved. Prints to `stdout` if not passed.\n * @param {string} [opts.debug] The name of the file where to save sources after each pass. Useful when there's a potential bug in _GCC_.\n * @param {string} [opts.compilerVersion] Used in the display message. Obtained with the `getCompilerVersion` method.\n * @param {boolean} [opts.noSourceMap=false] Disables source maps. Default `false`.\n * @return {Promise<string>}\n */\nfunction run(args, opts) {\n  return _run(args, opts)\n}\n\n/**\n * If `GOOGLE_CLOSURE_COMPILER` was set using an environment variable, returns `target`, otherwise reads the version from the `google-closure-compiler-java` package.json file.\n * @return {Promise<string>}\n */\nfunction getCompilerVersion() {\n  return _getCompilerVersion()\n}\n\n/**\n * Compiles a _Node.JS_ source file with dependencies into a single executable (with the `+x` addition). Performs regex-based static analysis of the whole of the dependency tree to construct the list of JS files. If any of the files use `require`, adds the `--process_common_js_modules` flag. Returns the `stdout` of the compiler, and prints to the console if output is not given in `runOptions`.\n * @param {!_depack.CompileConfig} options Options for the Node.JS package compiler.\n * @param {string} options.src The entry file to bundle. Currently only single files are supported.\n * @param {boolean} [options.noStrict=false] Removes `use strict` from the output. Default `false`.\n * @param {boolean} [options.verbose=false] Print all arguments to the compiler. Default `false`.\n * @param {boolean} [options.silent=false] If output is not given, don't print to `stdout`. By default, the output will be printed. Default `false`.\n * @param {boolean} [options.library=false] Whether to create a library. Default `false`.\n * @param {!_depack.RunConfig} [runOptions] General options for running of the compiler.\n * @param {string} [runOptions.output] The path where the output will be saved. Prints to `stdout` if not passed.\n * @param {string} [runOptions.debug] The name of the file where to save sources after each pass. Useful when there's a potential bug in _GCC_.\n * @param {string} [runOptions.compilerVersion] Used in the display message. Obtained with the `getCompilerVersion` method.\n * @param {boolean} [runOptions.noSourceMap=false] Disables source maps. Default `false`.\n * @param {!Array<string>=} [compilerArgs] The compiler args got with `getOptions` and/or manually extended. `getOptions` needs to be called first to find out the compiler's JAR at minimum.\n * @return {Promise<string>}\n */\nfunction Compile(options, runOptions, compilerArgs) {\n  return _Compile(options, runOptions, compilerArgs)\n}\n\n/**\n * Bundles the browser source code into a _JavaScript_ file. If there are any _JSX_ dependencies, the bundler will transpile them first using [ÀLaMode/JSX](https://github.com/a-la/jsx). Returns the `stdout` of the compiler, and prints to the console if output is not given in `runOptions`.\n * @param {!_depack.BundleConfig} options Options for the Bundle method.\n * @param {string} options.src The entry file to bundle. Only a single file is accepted. To compile multiple files at once, use chunks.\n * @param {!_depack.RunConfig} [runOptions] General options for running of the compiler.\n * @param {string} [runOptions.output] The path where the output will be saved. Prints to `stdout` if not passed.\n * @param {string} [runOptions.debug] The name of the file where to save sources after each pass. Useful when there's a potential bug in _GCC_.\n * @param {string} [runOptions.compilerVersion] Used in the display message. Obtained with the `getCompilerVersion` method.\n * @param {boolean} [runOptions.noSourceMap=false] Disables source maps. Default `false`.\n * @param {!Array<string>=} [compilerArgs] The compiler args got with `getOptions` and/or manually extended.\n * @return {Promise<string>}\n */\nfunction Bundle(options, runOptions, compilerArgs) {\n  return _Bundle(options, runOptions, compilerArgs)\n}\n/**\n * Bundles the browser source code into multiple _JavaScript_ file. Works in the same way as `Bundle`, generating a temp dir for JSX dependencies.\n * @param {!_depack.ChunksConfig} options Options for the BundleChunks method.\n * @param {!Array<string>} options.srcs The entry files to bundle. Chunks will be created according to the strategy (only `common` strategy is supported at the moment, which places any dependency which is required in more than one file in a `common` chunk).\n * @param {string} options.rel Directory to which sources of chunks are relative. By default, the basenames are used for chunk names, but if sources are from multiple dirs, this prop can be set. Because chunk names cannot contain `/`, separators will be substituted for `-`. For example, given the following input:\n * - `src/lib.js`\n * - `src/source1.js`\n * - `src/dir/source2.js`\n * \n * and using `rel=src`, the following chunks are created:\n * - `lib`\n * - `source1`\n * - `dir-source2`\n * @param {(analysis: !Array<!_staticAnalysis.Detection>) => !Promise<(boolean|undefined)>} [options.checkCache] A function to be executed to compare the an existing static analysis result with the new one, to see if any files/dependencies were updated. Should return `true` when caches match to skip processing and return void.\n * @param {!_depack.RunConfig} [runOptions] General options for running of the compiler.\n * @param {string} [runOptions.output] The path where the output will be saved. Prints to `stdout` if not passed.\n * @param {string} [runOptions.debug] The name of the file where to save sources after each pass. Useful when there's a potential bug in _GCC_.\n * @param {string} [runOptions.compilerVersion] Used in the display message. Obtained with the `getCompilerVersion` method.\n * @param {boolean} [runOptions.noSourceMap=false] Disables source maps. Default `false`.\n * @param {!Array<string>=} [compilerArgs] The compiler args got with `getOptions` and/or manually extended.\n * @return {Promise<string>}\n */\nfunction BundleChunks(options, runOptions, compilerArgs) {\n  return _BundleChunks(options, runOptions, compilerArgs)\n}\n\n/**\n * Returns an array of options to pass to the compiler for `Compile`, `Bundle` and `BundleChunks` methods. [Full list of supported arguments](https://github.com/google/closure-compiler/wiki/Flags-and-Options).\n * @param {!_depack.GetOptions} options Parameters for `getOptions`.\n * @param {string} [options.compiler] The path to the compiler JAR. Default value will be got from `require.resolve('google-closure-compiler-java/compiler.jar')`.\n * @param {string} [options.output] Sets the `--js_output_file` flag.\n * @param {string} [options.chunkOutput] Sets the `--chunk_output_path_prefix` flag.\n * @param {string} [options.level] Sets the `--compilation_level` flag.\n * @param {boolean} [options.advanced=false] Sets the `--compilation_level` flag to `ADVANCED`. Default `false`.\n * @param {(string|number)} [options.languageIn] Sets the `--language_in` flag. If a year is passed, adjusts it to `ECMASCRIPT_{YEAR}` automatically.\n * @param {(string|number)} [options.languageOut] Sets the `--language_out` flag. If a number is passed, adjusts it to `ECMASCRIPT_{YEAR}` automatically.\n * @param {boolean} [options.sourceMap=true] Adds the `--create_source_map %outname%.map` flag. Default `true`.\n * @param {boolean} [options.prettyPrint=false] Adds the `--formatting PRETTY_PRINT` flag. Default `false`.\n * @param {boolean} [options.iife=false] Adds the `--isolation_mode IIFE` flag. Default `false`.\n * @param {boolean} [options.noWarnings=false] Sets the `--warning_level QUIET` flag. Default `false`.\n * @param {string} [options.debug] The location of the file where to save sources after each pass. Disables source maps as these 2 options are incompatible.\n * @param {!Array<string>} [options.argv] Any additional arguments to the compiler.\n * @return {!Array<string>}\n */\nfunction getOptions(options) {\n  return _getOptions(options)\n}\n\n/**\n * Returns the location of the output file, even when the directory is given.\n * @param {string} output The path to the output dir or file.\n * @param {string} src The path to the source file. Will be used when the output is a dir.\n * @return {string}\n */\nfunction getOutput(output, src) {\n  return _getOutput(output, src)\n}\n\n/**\n * If the `GOOGLE_CLOSURE_COMPILER` jar path was set using the environment variable, it will be returned in this named exported.\n * @type {string}\n */\nconst GOOGLE_CLOSURE_COMPILER = _GOOGLE_CLOSURE_COMPILER\n\nmodule.exports.run = run\nmodule.exports.Compile = Compile\nmodule.exports.Bundle = Bundle\nmodule.exports.BundleChunks = BundleChunks\nmodule.exports.getOptions = getOptions\nmodule.exports.getOutput = getOutput\nmodule.exports.getCompilerVersion = getCompilerVersion\nmodule.exports.GOOGLE_CLOSURE_COMPILER = GOOGLE_CLOSURE_COMPILER\n\n/* typal types/index.xml namespace */\n/**\n * @typedef {_depack.RunConfig} RunConfig General options for running of the compiler.\n * @typedef {Object} _depack.RunConfig General options for running of the compiler.\n * @prop {string} [output] The path where the output will be saved. Prints to `stdout` if not passed.\n * @prop {string} [debug] The name of the file where to save sources after each pass. Useful when there's a potential bug in _GCC_.\n * @prop {string} [compilerVersion] Used in the display message. Obtained with the `getCompilerVersion` method.\n * @prop {boolean} [noSourceMap=false] Disables source maps. Default `false`.\n */\n\n/* typal types/options.xml namespace */\n/**\n * @typedef {_depack.GetOptions} GetOptions `＠record` Parameters for `getOptions`.\n * @typedef {Object} _depack.GetOptions `＠record` Parameters for `getOptions`.\n * @prop {string} [compiler] The path to the compiler JAR. Default value will be got from `require.resolve('google-closure-compiler-java/compiler.jar')`.\n * @prop {string} [output] Sets the `--js_output_file` flag.\n * @prop {string} [chunkOutput] Sets the `--chunk_output_path_prefix` flag.\n * @prop {string} [level] Sets the `--compilation_level` flag.\n * @prop {boolean} [advanced=false] Sets the `--compilation_level` flag to `ADVANCED`. Default `false`.\n * @prop {(string|number)} [languageIn] Sets the `--language_in` flag. If a year is passed, adjusts it to `ECMASCRIPT_{YEAR}` automatically.\n * @prop {(string|number)} [languageOut] Sets the `--language_out` flag. If a number is passed, adjusts it to `ECMASCRIPT_{YEAR}` automatically.\n * @prop {boolean} [sourceMap=true] Adds the `--create_source_map %outname%.map` flag. Default `true`.\n * @prop {boolean} [prettyPrint=false] Adds the `--formatting PRETTY_PRINT` flag. Default `false`.\n * @prop {boolean} [iife=false] Adds the `--isolation_mode IIFE` flag. Default `false`.\n * @prop {boolean} [noWarnings=false] Sets the `--warning_level QUIET` flag. Default `false`.\n * @prop {string} [debug] The location of the file where to save sources after each pass. Disables source maps as these 2 options are incompatible.\n * @prop {!Array<string>} [argv] Any additional arguments to the compiler.\n */\n\n/* typal types/compile.xml namespace */\n/**\n * @typedef {_depack.CompileConfig} CompileConfig Options for the Node.JS package compiler.\n * @typedef {Object} _depack.CompileConfig Options for the Node.JS package compiler.\n * @prop {string} src The entry file to bundle. Currently only single files are supported.\n * @prop {boolean} [noStrict=false] Removes `use strict` from the output. Default `false`.\n * @prop {boolean} [verbose=false] Print all arguments to the compiler. Default `false`.\n * @prop {boolean} [silent=false] If output is not given, don't print to `stdout`. By default, the output will be printed. Default `false`.\n * @prop {boolean} [library=false] Whether to create a library. Default `false`.\n */\n\n/* typal types/bundle.xml namespace */\n/**\n * @typedef {import('static-analysis').Detection} _staticAnalysis.Detection\n * @typedef {_depack.BundleBase} BundleBase `＠record` Options for the web bundler.\n * @typedef {Object} _depack.BundleBase `＠record` Options for the web bundler.\n * @prop {string} [tempDir=\"depack-temp\"] Where to save prepared JSX files. Default `depack-temp`.\n * @prop {boolean} [preact=false] Adds `import { h } from 'preact'` automatically, so that the bundle will be compiled **together** with _Preact_. Default `false`.\n * @prop {boolean} [silent=false] If output is not given, don't print to `stdout`. By default, the output will be printed. Default `false`.\n * @prop {boolean} [preactExtern=false] Adds `import { h } from '＠preact/extern'` automatically, assuming that `preact` will be available in the global scope and won't be included in the compilation. It will also rename any `preact` imports into `＠externs/preact`, so that the actual source code does not need manual editing. Default `false`.\n * @typedef {_depack.BundleConfig} BundleConfig `＠record` Options for the Bundle method.\n * @typedef {_depack.BundleBase & _depack.$BundleConfig} _depack.BundleConfig `＠record` Options for the Bundle method.\n * @typedef {Object} _depack.$BundleConfig `＠record` Options for the Bundle method.\n * @prop {string} src The entry file to bundle. Only a single file is accepted. To compile multiple files at once, use chunks.\n * @typedef {_depack.ChunksConfig} ChunksConfig `＠record` Options for the BundleChunks method.\n * @typedef {_depack.BundleBase & _depack.$ChunksConfig} _depack.ChunksConfig `＠record` Options for the BundleChunks method.\n * @typedef {Object} _depack.$ChunksConfig `＠record` Options for the BundleChunks method.\n * @prop {!Array<string>} srcs The entry files to bundle. Chunks will be created according to the strategy (only `common` strategy is supported at the moment, which places any dependency which is required in more than one file in a `common` chunk).\n * @prop {string} rel Directory to which sources of chunks are relative. By default, the basenames are used for chunk names, but if sources are from multiple dirs, this prop can be set. Because chunk names cannot contain `/`, separators will be substituted for `-`. For example, given the following input:\n * - `src/lib.js`\n * - `src/source1.js`\n * - `src/dir/source2.js`\n *\n * and using `rel=src`, the following chunks are created:\n * - `lib`\n * - `source1`\n * - `dir-source2`\n * @prop {(analysis: !Array<!_staticAnalysis.Detection>) => !Promise<(boolean|undefined)>} [checkCache] A function to be executed to compare the an existing static analysis result with the new one, to see if any files/dependencies were updated. Should return `true` when caches match to skip processing and return void.\n */\n"]}