added to remote repo

This commit is contained in:
Philipp committed 2026-05-21 08:18:29 +02:00
1 parent 8697c9f405
commit cc599b6e18
8049 files changed
+1096323

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) Pooya Parsa <pooya@pi0.io>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+164
View File
@@ -0,0 +1,164 @@
# jiti
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![bundle][bundle-src]][bundle-href]
[![License][license-src]][license-href]
Runtime Typescript and ESM support for Node.js.
> [!IMPORTANT]
> This is the support branch for jiti v1. Check out [jiti/main](https://github.com/unjs/jiti/tree/main) for the latest version and [unjs/jiti#174](https://github.com/unjs/jiti/issues/174) for the roadmap.
## Features
- Seamless typescript and ESM syntax support
- Seamless interoperability between ESM and CommonJS
- Synchronous API to replace `require`
- Super slim and zero dependency
- Smart syntax detection to avoid extra transforms
- CommonJS cache integration
- Filesystem transpile hard cache
- V8 compile cache
- Custom resolve alias
## Usage
### Programmatic
```js
const jiti = require("jiti")(__filename);
jiti("./path/to/file.ts");
```
You can also pass options as second argument:
```js
const jiti = require("jiti")(__filename, { debug: true });
```
### CLI
```bash
jiti index.ts
# or npx jiti index.ts
```
### Register require hook
```bash
node -r jiti/register index.ts
```
Alternatively, you can register `jiti` as a require hook programmatically:
```js
const jiti = require("jiti")();
const unregister = jiti.register();
```
## Options
### `debug`
- Type: Boolean
- Default: `false`
- Environment Variable: `JITI_DEBUG`
Enable debug to see which files are transpiled
### `cache`
- Type: Boolean | String
- Default: `true`
- Environment Variable: `JITI_CACHE`
Use transpile cache
If set to `true` will use `node_modules/.cache/jiti` (if exists) or `{TMP_DIR}/node-jiti`
### `esmResolve`
- Type: Boolean | String
- Default: `false`
- Environment Variable: `JITI_ESM_RESOLVE`
Using esm resolution algorithm to support `import` condition.
### `transform`
- Type: Function
- Default: Babel (lazy loaded)
Transform function. See [src/babel](./src/babel.ts) for more details
### `sourceMaps`
- Type: Boolean
- Default `false`
- Environment Variable: `JITI_SOURCE_MAPS`
Add inline source map to transformed source for better debugging.
### `interopDefault`
- Type: Boolean
- Default: `false`
Return the `.default` export of a module at the top-level.
### `alias`
- Type: Object
- Default: -
- Environment Variable: `JITI_ALIAS`
Custom alias map used to resolve ids.
### `nativeModules`
- Type: Array
- Default: ['typescript`]
- Environment Variable: `JITI_NATIVE_MODULES`
List of modules (within `node_modules`) to always use native require for them.
### `transformModules`
- Type: Array
- Default: []
- Environment Variable: `JITI_TRANSFORM_MODULES`
List of modules (within `node_modules`) to transform them regardless of syntax.
### `experimentalBun`
- Type: Boolean
- Default: Enabled if `process.versions.bun` exists (Bun runtime)
- Environment Variable: `JITI_EXPERIMENTAL_BUN`
Enable experimental native Bun support for transformations.
## Development
- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run `pnpm dev`
- Run `pnpm jiti ./test/path/to/file.ts`
## License
MIT. Made with 💖
<!-- Badged -->
[npm-version-src]: https://img.shields.io/npm/v/jiti?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/jiti
[npm-downloads-src]: https://img.shields.io/npm/dm/jiti?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/jiti
[bundle-src]: https://img.shields.io/bundlephobia/minzip/jiti?style=flat&colorA=18181B&colorB=F0DB4F
[bundle-href]: https://bundlephobia.com/result?p=h3
[license-src]: https://img.shields.io/github/license/unjs/jiti.svg?style=flat&colorA=18181B&colorB=F0DB4F
[license-href]: https://github.com/unjs/jiti/blob/main/LICENSE
Generated Vendored Executable
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env node
const { resolve } = require("node:path");
const script = process.argv.splice(2, 1)[0];
if (!script) {
console.error("Usage: jiti <path> [...arguments]");
process.exit(1);
}
const pwd = process.cwd();
const jiti = require("..")(pwd);
const resolved = (process.argv[1] = jiti.resolve(resolve(pwd, script)));
jiti(resolved);
+2
View File
@@ -0,0 +1,2 @@
import { TransformOptions, TRANSFORM_RESULT } from "./types";
export default function transform(opts: TransformOptions): TRANSFORM_RESULT;
+227
View File
@@ -0,0 +1,227 @@
(()=>{var __webpack_modules__={"./node_modules/.pnpm/@ampproject+remapping@2.3.0/node_modules/@ampproject/remapping/dist/remapping.umd.js":function(module,__unused_webpack_exports,__webpack_require__){module.exports=function(traceMapping,genMapping){"use strict";const SOURCELESS_MAPPING=SegmentObject("",-1,-1,"",null,!1),EMPTY_SOURCES=[];function SegmentObject(source,line,column,name,content,ignore){return{source,line,column,name,content,ignore}}function Source(map,sources,source,content,ignore){return{map,sources,source,content,ignore}}function MapSource(map,sources){return Source(map,sources,"",null,!1)}function OriginalSource(source,content,ignore){return Source(null,EMPTY_SOURCES,source,content,ignore)}function traceMappings(tree){const gen=new genMapping.GenMapping({file:tree.map.file}),{sources:rootSources,map}=tree,rootNames=map.names,rootMappings=traceMapping.decodedMappings(map);for(let i=0;i<rootMappings.length;i++){const segments=rootMappings[i];for(let j=0;j<segments.length;j++){const segment=segments[j],genCol=segment[0];let traced=SOURCELESS_MAPPING;if(1!==segment.length&&(traced=originalPositionFor(rootSources[segment[1]],segment[2],segment[3],5===segment.length?rootNames[segment[4]]:""),null==traced))continue;const{column,line,name,content,source,ignore}=traced;genMapping.maybeAddSegment(gen,i,genCol,source,line,column,name),source&&null!=content&&genMapping.setSourceContent(gen,source,content),ignore&&genMapping.setIgnore(gen,source,!0)}}return gen}function originalPositionFor(source,line,column,name){if(!source.map)return SegmentObject(source.source,line,column,name,source.content,source.ignore);const segment=traceMapping.traceSegment(source.map,line,column);return null==segment?null:1===segment.length?SOURCELESS_MAPPING:originalPositionFor(source.sources[segment[1]],segment[2],segment[3],5===segment.length?source.map.names[segment[4]]:name)}function asArray(value){return Array.isArray(value)?value:[value]}function buildSourceMapTree(input,loader){const maps=asArray(input).map((m=>new traceMapping.TraceMap(m,""))),map=maps.pop();for(let i=0;i<maps.length;i++)if(maps[i].sources.length>1)throw new Error(`Transformation map ${i} must have exactly one source file.\nDid you specify these with the most recent transformation maps first?`);let tree=build(map,loader,"",0);for(let i=maps.length-1;i>=0;i--)tree=MapSource(maps[i],[tree]);return tree}function build(map,loader,importer,importerDepth){const{resolvedSources,sourcesContent,ignoreList}=map,depth=importerDepth+1;return MapSource(map,resolvedSources.map(((sourceFile,i)=>{const ctx={importer,depth,source:sourceFile||"",content:void 0,ignore:void 0},sourceMap=loader(ctx.source,ctx),{source,content,ignore}=ctx;return sourceMap?build(new traceMapping.TraceMap(sourceMap,source),loader,source,depth):OriginalSource(source,void 0!==content?content:sourcesContent?sourcesContent[i]:null,void 0!==ignore?ignore:!!ignoreList&&ignoreList.includes(i))})))}class SourceMap{constructor(map,options){const out=options.decodedMappings?genMapping.toDecodedMap(map):genMapping.toEncodedMap(map);this.version=out.version,this.file=out.file,this.mappings=out.mappings,this.names=out.names,this.ignoreList=out.ignoreList,this.sourceRoot=out.sourceRoot,this.sources=out.sources,options.excludeContent||(this.sourcesContent=out.sourcesContent)}toString(){return JSON.stringify(this)}}function remapping(input,loader,options){const opts="object"==typeof options?options:{excludeContent:!!options,decodedMappings:!1},tree=buildSourceMapTree(input,loader);return new SourceMap(traceMappings(tree),opts)}return remapping}(__webpack_require__("./node_modules/.pnpm/@jridgewell+trace-mapping@0.3.25/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.umd.js"),__webpack_require__("./node_modules/.pnpm/@jridgewell+gen-mapping@0.3.8/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.umd.js"))},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files lazy recursive":module=>{function webpackEmptyAsyncContext(req){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}))}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files lazy recursive",module.exports=webpackEmptyAsyncContext},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files sync recursive":module=>{function webpackEmptyContext(req){var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}webpackEmptyContext.keys=()=>[],webpackEmptyContext.resolve=webpackEmptyContext,webpackEmptyContext.id="./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/files sync recursive",module.exports=webpackEmptyContext},"./node_modules/.pnpm/@babel+plugin-syntax-class-properties@7.12.13_@babel+core@7.26.0/node_modules/@babel/plugin-synLine truncated
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(AMD_ARGUMENTS, factory);
} else if (typeof exports === "object") {
factory(COMMON_ARGUMENTS);
} else {
factory(BROWSER_ARGUMENTS);
}
})(UMD_ROOT, function (FACTORY_PARAMETERS) {
FACTORY_BODY
});
`(replacements);function buildGlobal(allowlist){const namespace=identifier("babelHelpers"),body=[],container=functionExpression(null,[identifier("global")],blockStatement(body)),tree=program([expressionStatement(callExpression(container,[conditionalExpression(binaryExpression("===",unaryExpression("typeof",identifier("global")),stringLiteral("undefined")),identifier("self"),identifier("global"))]))]);return body.push(variableDeclaration("var",[variableDeclarator(namespace,assignmentExpression("=",memberExpression(identifier("global"),namespace),objectExpression([])))])),buildHelpers(body,namespace,allowlist),tree}function buildModule(allowlist){const body=[],refs=buildHelpers(body,null,allowlist);return body.unshift(exportNamedDeclaration(null,Object.keys(refs).map((name=>exportSpecifier(cloneNode(refs[name]),identifier(name)))))),program(body,[],"module")}function buildUmd(allowlist){const namespace=identifier("babelHelpers"),body=[];return body.push(variableDeclaration("var",[variableDeclarator(namespace,identifier("global"))])),buildHelpers(body,namespace,allowlist),program([buildUmdWrapper({FACTORY_PARAMETERS:identifier("global"),BROWSER_ARGUMENTS:assignmentExpression("=",memberExpression(identifier("root"),namespace),objectExpression([])),COMMON_ARGUMENTS:identifier("exports"),AMD_ARGUMENTS:arrayExpression([stringLiteral("exports")]),FACTORY_BODY:body,UMD_ROOT:identifier("this")})])}function buildVar(allowlist){const namespace=identifier("babelHelpers"),body=[];body.push(variableDeclaration("var",[variableDeclarator(namespace,objectExpression([]))]));const tree=program(body);return buildHelpers(body,namespace,allowlist),body.push(expressionStatement(namespace)),tree}function buildHelpers(body,namespace,allowlist){const getHelperReference=name=>namespace?memberExpression(namespace,identifier(name)):identifier(`_${name}`),refs={};return helpers().list.forEach((function(name){if(allowlist&&!allowlist.includes(name))return;const ref=refs[name]=getHelperReference(name),{nodes}=helpers().get(name,getHelperReference,namespace?null:`_${name}`,[],namespace?(ast,exportName,mapExportBindingAssignments)=>{mapExportBindingAssignments((node=>assignmentExpression("=",ref,node))),ast.body.push(expressionStatement(assignmentExpression("=",ref,identifier(exportName))))}:null);body.push(...nodes)})),refs}},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/transform-ast.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";function _gensync(){const data=__webpack_require__("./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js");return _gensync=function(){return data},data}Object.defineProperty(exports,"__esModule",{value:!0}),exports.transformFromAst=void 0,exports.transformFromAstAsync=function(...args){return(0,_rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.async)(...args)},exports.transformFromAstSync=function(...args){return(0,_rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(...args)};var _index=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/index.js"),_index2=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/transformation/index.js"),_rewriteStackTrace=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/errors/rewrite-stack-trace.js");const transformFromAstRunner=_gensync()((function*(ast,code,opts){const config=yield*(0,_index.default)(opts);if(null===config)return null;if(!ast)throw new Error("No AST given");return yield*(0,_index2.run)(config,code,ast)}));exports.transformFromAst=function(ast,code,optsOrCallback,maybeCallback){let opts,callback;if("function"==typeof optsOrCallback?(callback=optsOrCallback,opts=void 0):(opts=optsOrCallback,callback=maybeCallback),void 0===callback)return(0,_rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.sync)(ast,code,opts);(0,_rewriteStackTrace.beginHiddenCallStack)(transformFromAstRunner.errback)(ast,code,opts,callback)}},"./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/transform-file.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";function _gensync(){const data=__webpack_require__("./node_modules/.pnpm/gensync@1.0.0-beta.2/node_modules/gensync/index.js");return _gensync=function(){return data},data}Object.defineProperty(exports,"__esModule",{value:!0}),exports.transformFile=function(...args){transformFileRunner.errback(...args)},exports.transformFileAsync=function(...args){return transformFileRunner.async(...args)},exports.transformFileSync=function(...args){return transformFileRunner.sync(...args)};var _index=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/config/index.js"),_index2=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/transformation/index.js"),fs=__webpack_require__("./node_modules/.pnpm/@babel+core@7 Line truncated
${function(file){return file.addHelper("decorate")}(file)}(
${classDecorators||_core.types.nullLiteral()},
function (${initializeId}, ${superClass?_core.types.cloneNode(superId):null}) {
${node}
return { F: ${_core.types.cloneNode(node.id)}, d: ${definitions} };
},
${superClass}
)
`;isStrict||wrapperCall.arguments[1].body.directives.push(_core.types.directive(_core.types.directiveLiteral("use strict")));let replacement=wrapperCall,classPathDesc="arguments.1.body.body.0";isDeclaration&&(replacement=_core.template.statement.ast`let ${ref} = ${wrapperCall}`,classPathDesc="declarations.0.init."+classPathDesc);return{instanceNodes:[_core.template.statement.ast`
${_core.types.cloneNode(initializeId)}(this)
`],wrapClass:path=>(path.replaceWith(replacement),path.get(classPathDesc))}},exports.hasDecorators=function(node){return hasOwnDecorators(node)||node.body.body.some(hasOwnDecorators)},exports.hasOwnDecorators=hasOwnDecorators;var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_helperReplaceSupers=__webpack_require__("./node_modules/.pnpm/@babel+helper-replace-supers@7.25.9_@babel+core@7.26.0/node_modules/@babel/helper-replace-supers/lib/index.js");function hasOwnDecorators(node){var _node$decorators;return!(null==(_node$decorators=node.decorators)||!_node$decorators.length)}function prop(key,value){return value?_core.types.objectProperty(_core.types.identifier(key),value):null}function takeDecorators(node){let result;return node.decorators&&node.decorators.length>0&&(result=_core.types.arrayExpression(node.decorators.map((decorator=>decorator.expression)))),node.decorators=void 0,result}function getKey(node){return node.computed?node.key:_core.types.isIdentifier(node.key)?_core.types.stringLiteral(node.key.name):_core.types.stringLiteral(String(node.key.value))}},"./node_modules/.pnpm/@babel+helper-create-class-features-plugin@7.25.9_@babel+core@7.26.0/node_modules/@babel/helper-create-class-features-plugin/lib/decorators.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function({assertVersion,assumption},{loose},version,inherits){var _assumption,_assumption2;assertVersion("2023-11"===version||"2023-05"===version||"2023-01"===version?"^7.21.0":"2021-12"===version?"^7.16.0":"^7.19.0");const VISITED=new WeakSet,constantSuper=null!=(_assumption=assumption("constantSuper"))?_assumption:loose,ignoreFunctionLength=null!=(_assumption2=assumption("ignoreFunctionLength"))?_assumption2:loose,namedEvaluationVisitor=function(isAnonymous,visitor){function handleComputedProperty(propertyPath,key,state){switch(key.type){case"StringLiteral":return _core.types.stringLiteral(key.value);case"NumericLiteral":case"BigIntLiteral":{const keyValue=key.value+"";return propertyPath.get("key").replaceWith(_core.types.stringLiteral(keyValue)),_core.types.stringLiteral(keyValue)}default:{const ref=propertyPath.scope.maybeGenerateMemoised(key);return propertyPath.get("key").replaceWith(_core.types.assignmentExpression("=",ref,createToPropertyKeyCall(state,key))),_core.types.cloneNode(ref)}}}return{VariableDeclarator(path,state){const id=path.node.id;if("Identifier"===id.type){const initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("init"));if(isAnonymous(initializer)){const name=id.name;visitor(initializer,state,name)}}},AssignmentExpression(path,state){const id=path.node.left;if("Identifier"===id.type){const initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("right"));if(isAnonymous(initializer))switch(path.node.operator){case"=":case"&&=":case"||=":case"??=":visitor(initializer,state,id.name)}}},AssignmentPattern(path,state){const id=path.node.left;if("Identifier"===id.type){const initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("right"));if(isAnonymous(initializer)){const name=id.name;visitor(initializer,state,name)}}},ObjectExpression(path,state){for(const propertyPath of path.get("properties")){if(!propertyPath.isObjectProperty())continue;const{node}=propertyPath,id=node.key,initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(propertyPath.get("value"));if(isAnonymous(initializer))if(node.computed){const ref=handleComputedProperty(propertyPath,id,state);visitor(initializer,state,ref)}else if(!isProtoKey(id))if("Identifier"===id.type)visitor(initializer,state,id.name);else{const className=_core.types.stringLiteral(id.value+"");visitor(initializer,state,className)}}},ClassPrivateProperty(path,state){const{node}=path,initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));if(isAnonymous(initializer)){const className=_core.types.stringLiteral("#"+node.key.id.name);visitor(initializer,state,className)}},ClassAccessorProperty(path,state){const{node}=path,id=node.key,initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));if(isAnonymous(initializer))if(node.computed){const ref=handleComputedProperty(path,id,state);visitor(initializer,state,ref)}else if("Identifier"===id.type)visitor(initializer,state,id.name);else if("PrivateName"===id.type){const className=_core.types.stringLiteral("#"+id.id.name);visitor(initializer,state,className)}else{const className=_core.types.stringLiteral(id.value+"");visitor(initializer,state,className)}},ClassProperty(path,state){const{node}=path,id=node.key,initializer=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path.get("value"));if(isAnonymous(initializer))if(node.c Line truncated
class extends ${state.addHelper("identity")} {}
`;staticsClass.body.body=[_core.types.classProperty(_core.types.toExpression(originalClass),void 0,void 0,void 0,!0,!0),...statics];const constructorBody=[],newExpr=_core.types.newExpression(staticsClass,[]);staticFieldInitializerExpressions.length>0&&constructorBody.push(...staticFieldInitializerExpressions),classInitCall&&(classInitInjected=!0,constructorBody.push(classInitCall)),constructorBody.length>0?(constructorBody.unshift(_core.types.callExpression(_core.types.super(),[_core.types.cloneNode(classIdLocal)])),staticsClass.body.body.push(createConstructorFromExpressions(constructorBody,!1))):newExpr.arguments.push(_core.types.cloneNode(classIdLocal));const[newPath]=path.replaceWith(newExpr);originalClassPath=newPath.get("callee").get("body").get("body.0.key")}}!classInitInjected&&classInitCall&&path.node.body.body.push(_core.types.staticBlock([_core.types.expressionStatement(classInitCall)]));let{superClass}=originalClass;if(superClass&&("2023-11"===version||"2023-05"===version)){const id=path.scope.maybeGenerateMemoised(superClass);id&&(originalClass.superClass=_core.types.assignmentExpression("=",id,superClass),superClass=id)}const applyDecoratorWrapper=_core.types.staticBlock([]);originalClass.body.body.unshift(applyDecoratorWrapper);const applyDecsBody=applyDecoratorWrapper.body;if(computedKeyAssignments.length>0){const elements=originalClassPath.get("body.body");let firstPublicElement;for(const path of elements)if((path.isClassProperty()||path.isClassMethod())&&"constructor"!==path.node.kind){firstPublicElement=path;break}null!=firstPublicElement?(!function(path){const{node}=path;node.computed=!0,_core.types.isIdentifier(node.key)&&(node.key=_core.types.stringLiteral(node.key.name))}(firstPublicElement),prependExpressionsToComputedKey(computedKeyAssignments,firstPublicElement)):(originalClass.body.body.unshift(_core.types.classProperty(_core.types.sequenceExpression([...computedKeyAssignments,_core.types.stringLiteral("_")]),void 0,void 0,void 0,!0,!0)),applyDecsBody.push(_core.types.expressionStatement(_core.types.unaryExpression("delete",_core.types.memberExpression(_core.types.thisExpression(),_core.types.identifier("_")))))),computedKeyAssignments=[]}applyDecsBody.push(_core.types.expressionStatement(function(elementLocals,classLocals,elementDecorations,classDecorations,classDecorationsFlag,maybePrivateBrandName,setClassName,superClass,state,version){let lhs,rhs;const args=[setClassName?createSetFunctionNameCall(state,setClassName):_core.types.thisExpression(),classDecorations,elementDecorations];"2023-11"!==version&&args.splice(1,2,elementDecorations,classDecorations);if("2021-12"===version||"2022-03"===version&&!state.availableHelper("applyDecs2203R"))return lhs=_core.types.arrayPattern([...elementLocals,...classLocals]),rhs=_core.types.callExpression(state.addHelper("2021-12"===version?"applyDecs":"applyDecs2203"),args),_core.types.assignmentExpression("=",lhs,rhs);"2022-03"===version?rhs=_core.types.callExpression(state.addHelper("applyDecs2203R"),args):"2023-01"===version?(maybePrivateBrandName&&args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)),rhs=_core.types.callExpression(state.addHelper("applyDecs2301"),args)):"2023-05"===version&&((maybePrivateBrandName||superClass||0!==classDecorationsFlag.value)&&args.push(classDecorationsFlag),maybePrivateBrandName?args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)):superClass&&args.push(_core.types.unaryExpression("void",_core.types.numericLiteral(0))),superClass&&args.push(superClass),rhs=_core.types.callExpression(state.addHelper("applyDecs2305"),args));"2023-11"===version&&((maybePrivateBrandName||superClass||0!==classDecorationsFlag.value)&&args.push(classDecorationsFlag),maybePrivateBrandName?args.push(createPrivateBrandCheckClosure(maybePrivateBrandName)):superClass&&args.push(_core.types.unaryExpression("void",_core.types.numericLiteral(0))),superClass&&args.push(superClass),rhs=_core.types.callExpression(state.addHelper("applyDecs2311"),args));elementLocals.length>0?classLocals.length>0?lhs=_core.types.objectPattern([_core.types.objectProperty(_core.types.identifier("e"),_core.types.arrayPattern(elementLocals)),_core.types.objectProperty(_core.types.identifier("c"),_core.types.arrayPattern(classLocals))]):(lhs=_core.types.arrayPattern(elementLocals),rhs=_core.types.memberExpression(rhs,_core.types.identifier("e"),!1,!1)):(lhs=_core.types.arrayPattern(classLocals),rhs=_core.types.memberExpression(rhs,_core.types.identifier("c"),!1,!1));return _core.types.assignmentExpression("=",lhs,rhs)}(elementLocals,classLocals,elementDecorations,null!=(_classDecorationsId=classDecorationsId)?_classDecorationsId:_core.types.arrayExpression(classDecorations),_core.types.numericLiteral(classDecorationsFlag),needsInstancePrivateBrandCheck?lastInstancePrivateName:null,setClassName,_core.types.cloneNode(superClass),state,version))),staticInitLocal&&applyDecsBody.push(_core.types.expressionStatement(_core.types.callExpressi Line truncated
function () {
return this.${_core.types.cloneNode(targetKey)};
}
`,_core.template.expression.ast`
function (value) {
this.${_core.types.cloneNode(targetKey)} = value;
}
`]:[_core.template.expression.ast`
o => o.${_core.types.cloneNode(targetKey)}
`,_core.template.expression.ast`
(o, v) => o.${_core.types.cloneNode(targetKey)} = v
`]}function getComputedKeyLastElement(path){if((path=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers)(path)).isSequenceExpression()){const expressions=path.get("expressions");return getComputedKeyLastElement(expressions[expressions.length-1])}return path}function getComputedKeyMemoiser(path){const element=getComputedKeyLastElement(path);if(element.isConstantExpression())return _core.types.cloneNode(path.node);if(element.isIdentifier()&&path.scope.hasUid(element.node.name))return _core.types.cloneNode(path.node);if(element.isAssignmentExpression()&&element.get("left").isIdentifier())return _core.types.cloneNode(element.node.left);throw new Error(`Internal Error: the computed key ${path.toString()} has not yet been memoised.`)}function prependExpressionsToComputedKey(expressions,fieldPath){const key=fieldPath.get("key");key.isSequenceExpression()?expressions.push(...key.node.expressions):expressions.push(key.node),key.replaceWith(maybeSequenceExpression(expressions))}function prependExpressionsToFieldInitializer(expressions,fieldPath){const initializer=fieldPath.get("value");initializer.node?expressions.push(initializer.node):expressions.length>0&&(expressions[expressions.length-1]=_core.types.unaryExpression("void",expressions[expressions.length-1])),initializer.replaceWith(maybeSequenceExpression(expressions))}function prependExpressionsToStaticBlock(expressions,blockPath){blockPath.unshiftContainer("body",_core.types.expressionStatement(maybeSequenceExpression(expressions)))}function isProtoInitCallExpression(expression,protoInitCall){return _core.types.isCallExpression(expression)&&_core.types.isIdentifier(expression.callee,{name:protoInitCall.name})}function createConstructorFromExpressions(expressions,isDerivedClass){const body=[_core.types.expressionStatement(maybeSequenceExpression(expressions))];return isDerivedClass&&body.unshift(_core.types.expressionStatement(_core.types.callExpression(_core.types.super(),[_core.types.spreadElement(_core.types.identifier("args"))]))),_core.types.classMethod("constructor",_core.types.identifier("constructor"),isDerivedClass?[_core.types.restElement(_core.types.identifier("args"))]:[],_core.types.blockStatement(body))}function createStaticBlockFromExpressions(expressions){return _core.types.staticBlock([_core.types.expressionStatement(maybeSequenceExpression(expressions))])}const FIELD=0,ACCESSOR=1,METHOD=2,GETTER=3,SETTER=4,STATIC_OLD_VERSION=5,STATIC=8,DECORATORS_HAVE_THIS=16;function getElementKind(element){switch(element.node.type){case"ClassProperty":case"ClassPrivateProperty":return FIELD;case"ClassAccessorProperty":return ACCESSOR;case"ClassMethod":case"ClassPrivateMethod":return"get"===element.node.kind?GETTER:"set"===element.node.kind?SETTER:METHOD}}function generateDecorationList(decorators,decoratorsThis,version){const decsCount=decorators.length,haveOneThis=decoratorsThis.some(Boolean),decs=[];for(let i=0;i<decsCount;i++)"2023-11"!==version&&"2023-05"!==version||!haveOneThis||decs.push(decoratorsThis[i]||_core.types.unaryExpression("void",_core.types.numericLiteral(0))),decs.push(decorators[i].expression);return{haveThis:haveOneThis,decs}}function addCallAccessorsFor(version,element,key,getId,setId,isStatic){element.insertAfter(_core.types.classPrivateMethod("get",_core.types.cloneNode(key),[],_core.types.blockStatement([_core.types.returnStatement(_core.types.callExpression(_core.types.cloneNode(getId),"2023-11"===version&&isStatic?[]:[_core.types.thisExpression()]))]),isStatic)),element.insertAfter(_core.types.classPrivateMethod("set",_core.types.cloneNode(key),[_core.types.identifier("v")],_core.types.blockStatement([_core.types.expressionStatement(_core.types.callExpression(_core.types.cloneNode(setId),"2023-11"===version&&isStatic?[_core.types.identifier("v")]:[_core.types.thisExpression(),_core.types.identifier("v")]))]),isStatic))}function movePrivateAccessor(element,key,methodLocalVar,isStatic){let params,block;"set"===element.node.kind?(params=[_core.types.identifier("v")],block=[_core.types.expressionStatement(_core.types.callExpression(methodLocalVar,[_core.types.thisExpression(),_core.types.identifier("v")]))]):(params=[],block=[_core.types.returnStatement(_core.types.callExpression(methodLocalVar,[_core.types.thisExpression()]))]),element.replaceWith(_core.types.classPrivateMethod(element.node.kind,_core.types.cloneNode(key),params,_core.types.blockStatement(block),isStatic))}function isClassDecoratableElementPath(path){const{type}=path;return"TSDeclareMethod"!==type&&"TSIndexSignature"!==type&&"StaticBlock"!==type}function maybeSequenceExpression(exprs){return 0===exprs.length?_core.types.unaryExpression("void",_core.types.numericLiteral(0)):1===exprs.length?exprs[0]:_core.types.sequenceExpression(exprs)}function createFunctionExpressionFromPrivateMethod(node){const{params,body,generator:isGenerator,async:isAsync}=node;return _core.types.functionExpression(void 0,params,body,isGenerator,isAsync)}function createS Line truncated
Object.prototype.hasOwnProperty.call(${buildCheckInRHS(right,file)}, ${_core.types.cloneNode(id)})
`)}const{id,static:isStatic}=privateNamesMap.get(name);isStatic?path.replaceWith(_core.template.expression.ast`${buildCheckInRHS(right,file)} === ${_core.types.cloneNode(this.classRef)}`):path.replaceWith(_core.template.expression.ast`${_core.types.cloneNode(id)}.has(${buildCheckInRHS(right,file)})`)}});function readOnlyError(file,name){return _core.types.callExpression(file.addHelper("readOnlyError"),[_core.types.stringLiteral(`#${name}`)])}function writeOnlyError(file,name){return file.availableHelper("writeOnlyError")?_core.types.callExpression(file.addHelper("writeOnlyError"),[_core.types.stringLiteral(`#${name}`)]):(console.warn("@babel/helpers is outdated, update it to silence this warning."),_core.types.buildUndefinedNode())}function buildStaticPrivateFieldAccess(expr,noUninitializedPrivateFieldAccess){return noUninitializedPrivateFieldAccess?expr:_core.types.memberExpression(expr,_core.types.identifier("_"))}function autoInherits(fn){return function(member){return _core.types.inherits(fn.apply(this,arguments),member.node)}}const privateNameHandlerSpec={memoise(member,count){const{scope}=member,{object}=member.node,memo=scope.maybeGenerateMemoised(object);memo&&this.memoiser.set(object,memo,count)},receiver(member){const{object}=member.node;return this.memoiser.has(object)?_core.types.cloneNode(this.memoiser.get(object)):_core.types.cloneNode(object)},get:autoInherits((function(member){const{classRef,privateNamesMap,file,innerBinding,noUninitializedPrivateFieldAccess}=this,privateName=member.node.property,{name}=privateName.id,{id,static:isStatic,method:isMethod,methodId,getId,setId}=privateNamesMap.get(name),isGetterOrSetter=getId||setId,cloneId=id=>_core.types.inherits(_core.types.cloneNode(id),privateName);if(isStatic){if(unshadow(classRef.name,member.scope,innerBinding),!newHelpers(file)){const helperName=isMethod&&!isGetterOrSetter?"classStaticPrivateMethodGet":"classStaticPrivateFieldSpecGet";return _core.types.callExpression(file.addHelper(helperName),[this.receiver(member),_core.types.cloneNode(classRef),cloneId(id)])}const receiver=this.receiver(member),skipCheck=_core.types.isIdentifier(receiver)&&receiver.name===classRef.name;if(!isMethod)return buildStaticPrivateFieldAccess(skipCheck?cloneId(id):_core.types.callExpression(file.addHelper("assertClassBrand"),[_core.types.cloneNode(classRef),receiver,cloneId(id)]),noUninitializedPrivateFieldAccess);if(getId)return skipCheck?_core.types.callExpression(cloneId(getId),[receiver]):_core.types.callExpression(file.addHelper("classPrivateGetter"),[_core.types.cloneNode(classRef),receiver,cloneId(getId)]);if(setId){const err=_core.types.buildUndefinedNode();return skipCheck?err:_core.types.sequenceExpression([_core.types.callExpression(file.addHelper("assertClassBrand"),[_core.types.cloneNode(classRef),receiver]),err])}return skipCheck?cloneId(id):_core.types.callExpression(file.addHelper("assertClassBrand"),[_core.types.cloneNode(classRef),receiver,cloneId(id)])}return isMethod?isGetterOrSetter?getId?newHelpers(file)?_core.types.callExpression(file.addHelper("classPrivateGetter"),[_core.types.cloneNode(id),this.receiver(member),cloneId(getId)]):_core.types.callExpression(file.addHelper("classPrivateFieldGet"),[this.receiver(member),cloneId(id)]):_core.types.sequenceExpression([this.receiver(member),writeOnlyError(file,name)]):newHelpers(file)?_core.types.callExpression(file.addHelper("assertClassBrand"),[_core.types.cloneNode(id),this.receiver(member),cloneId(methodId)]):_core.types.callExpression(file.addHelper("classPrivateMethodGet"),[this.receiver(member),_core.types.cloneNode(id),cloneId(methodId)]):newHelpers(file)?_core.types.callExpression(file.addHelper("classPrivateFieldGet2"),[cloneId(id),this.receiver(member)]):_core.types.callExpression(file.addHelper("classPrivateFieldGet"),[this.receiver(member),cloneId(id)])})),boundGet(member){return this.memoise(member,1),_core.types.callExpression(_core.types.memberExpression(this.get(member),_core.types.identifier("bind")),[this.receiver(member)])},set:autoInherits((function(member,value){const{classRef,privateNamesMap,file,noUninitializedPrivateFieldAccess}=this,privateName=member.node.property,{name}=privateName.id,{id,static:isStatic,method:isMethod,setId,getId}=privateNamesMap.get(name),isGetterOrSetter=getId||setId,cloneId=id=>_core.types.inherits(_core.types.cloneNode(id),privateName);if(isStatic){if(!newHelpers(file)){const helperName=isMethod&&!isGetterOrSetter?"classStaticPrivateMethodSet":"classStaticPrivateFieldSpecSet";return _core.types.callExpression(file.addHelper(helperName),[this.receiver(member),_core.types.cloneNode(classRef),cloneId(id),value])}const receiver=this.receiver(member),skipCheck=_core.types.isIdentifier(receiver)&&receiver.name===classRef.name;if(isMethod&&!setId){const err=readOnlyError(file,name);return skipCheck?_core.types.sequenceExpression([value,err]):_core.types.sequenceExpression([value,_core.types.callExpression(file.addHelper("assertClassBrand"), Line truncated
Object.defineProperty(${ref}, ${_core.types.cloneNode(id)}, {
// configurable is false by default
// enumerable is false by default
writable: true,
value: ${value}
});
`,prop)}function buildPrivateInstanceFieldInitSpec(ref,prop,privateNamesMap,state){const{id}=privateNamesMap.get(prop.node.key.id.name),value=prop.node.value||prop.scope.buildUndefinedNode();if(!state.availableHelper("classPrivateFieldInitSpec"))return inheritPropComments(_core.template.statement.ast`${_core.types.cloneNode(id)}.set(${ref}, {
// configurable is always false for private elements
// enumerable is always false for private elements
writable: true,
value: ${value},
})`,prop);const helper=state.addHelper("classPrivateFieldInitSpec");return inheritLoc(inheritPropComments(_core.types.expressionStatement(_core.types.callExpression(helper,[_core.types.thisExpression(),inheritLoc(_core.types.cloneNode(id),prop.node.key),newHelpers(state)?value:_core.template.expression.ast`{ writable: true, value: ${value} }`])),prop),prop.node)}function buildPrivateStaticFieldInitSpec(prop,privateNamesMap,noUninitializedPrivateFieldAccess){const privateName=privateNamesMap.get(prop.node.key.id.name),value=noUninitializedPrivateFieldAccess?prop.node.value:_core.template.expression.ast`{
_: ${prop.node.value||_core.types.buildUndefinedNode()}
}`;return inheritPropComments(_core.types.variableDeclaration("var",[_core.types.variableDeclarator(_core.types.cloneNode(privateName.id),value)]),prop)}var buildPrivateStaticFieldInitSpecOld=function(prop,privateNamesMap){const privateName=privateNamesMap.get(prop.node.key.id.name),{id,getId,setId,initAdded}=privateName,isGetterOrSetter=getId||setId;if(!prop.isProperty()&&(initAdded||!isGetterOrSetter))return;if(isGetterOrSetter)return privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),inheritPropComments(_core.template.statement.ast`
var ${_core.types.cloneNode(id)} = {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
}
`,prop);const value=prop.node.value||prop.scope.buildUndefinedNode();return inheritPropComments(_core.template.statement.ast`
var ${_core.types.cloneNode(id)} = {
// configurable is false by default
// enumerable is false by default
writable: true,
value: ${value}
};
`,prop)};function buildPrivateMethodInitLoose(ref,prop,privateNamesMap){const privateName=privateNamesMap.get(prop.node.key.id.name),{methodId,id,getId,setId,initAdded}=privateName;if(initAdded)return;if(methodId)return inheritPropComments(_core.template.statement.ast`
Object.defineProperty(${ref}, ${id}, {
// configurable is false by default
// enumerable is false by default
// writable is false by default
value: ${methodId.name}
});
`,prop);return getId||setId?(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),inheritPropComments(_core.template.statement.ast`
Object.defineProperty(${ref}, ${id}, {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
});
`,prop)):void 0}function buildPrivateInstanceMethodInitSpec(ref,prop,privateNamesMap,state){const privateName=privateNamesMap.get(prop.node.key.id.name);if(!privateName.initAdded){if(!newHelpers(state)){if(privateName.getId||privateName.setId)return function(ref,prop,privateNamesMap,state){const privateName=privateNamesMap.get(prop.node.key.id.name),{id,getId,setId}=privateName;if(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),!state.availableHelper("classPrivateFieldInitSpec"))return inheritPropComments(_core.template.statement.ast`
${id}.set(${ref}, {
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
});
`,prop);const helper=state.addHelper("classPrivateFieldInitSpec");return inheritLoc(inheritPropComments(_core.template.statement.ast`${helper}(
${_core.types.thisExpression()},
${_core.types.cloneNode(id)},
{
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
},
)`,prop),prop.node)}(ref,prop,privateNamesMap,state)}return function(ref,prop,privateNamesMap,state){const privateName=privateNamesMap.get(prop.node.key.id.name),{id}=privateName;if(!state.availableHelper("classPrivateMethodInitSpec"))return inheritPropComments(_core.template.statement.ast`${id}.add(${ref})`,prop);const helper=state.addHelper("classPrivateMethodInitSpec");return inheritPropComments(_core.template.statement.ast`${helper}(
${_core.types.thisExpression()},
${_core.types.cloneNode(id)}
)`,prop)}(ref,prop,privateNamesMap,state)}}function buildPublicFieldInitLoose(ref,prop){const{key,computed}=prop.node,value=prop.node.value||prop.scope.buildUndefinedNode();return inheritPropComments(_core.types.expressionStatement(_core.types.assignmentExpression("=",_core.types.memberExpression(ref,key,computed||_core.types.isLiteral(key)),value)),prop)}function buildPublicFieldInitSpec(ref,prop,state){const{key,computed}=prop.node,value=prop.node.value||prop.scope.buildUndefinedNode();return inheritPropComments(_core.types.expressionStatement(_core.types.callExpression(state.addHelper("defineProperty"),[ref,computed||_core.types.isLiteral(key)?key:_core.types.stringLiteral(key.name),value])),prop)}function buildPrivateStaticMethodInitLoose(ref,prop,state,privateNamesMap){const privateName=privateNamesMap.get(prop.node.key.id.name),{id,methodId,getId,setId,initAdded}=privateName;if(initAdded)return;return getId||setId?(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),inheritPropComments(_core.template.statement.ast`
Object.defineProperty(${ref}, ${id}, {
// configurable is false by default
// enumerable is false by default
// writable is false by default
get: ${getId?getId.name:prop.scope.buildUndefinedNode()},
set: ${setId?setId.name:prop.scope.buildUndefinedNode()}
})
`,prop)):inheritPropComments(_core.template.statement.ast`
Object.defineProperty(${ref}, ${id}, {
// configurable is false by default
// enumerable is false by default
// writable is false by default
value: ${methodId.name}
});
`,prop)}function buildPrivateMethodDeclaration(file,prop,privateNamesMap,privateFieldsAsSymbolsOrProperties=!1){const privateName=privateNamesMap.get(prop.node.key.id.name),{id,methodId,getId,setId,getterDeclared,setterDeclared,static:isStatic}=privateName,{params,body,generator,async}=prop.node,isGetter=getId&&0===params.length,isSetter=setId&&params.length>0;if(isGetter&&getterDeclared||isSetter&&setterDeclared)return privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{initAdded:!0})),null;if(newHelpers(file)&&(isGetter||isSetter)&&!privateFieldsAsSymbolsOrProperties){const scope=prop.get("body").scope,thisArg=scope.generateUidIdentifier("this"),state={thisRef:thisArg,argumentsPath:[]};if(prop.traverse(thisContextVisitor,state),state.argumentsPath.length){const argumentsId=scope.generateUidIdentifier("arguments");scope.push({id:argumentsId,init:_core.template.expression.ast`[].slice.call(arguments, 1)`});for(const path of state.argumentsPath)path.replaceWith(_core.types.cloneNode(argumentsId))}params.unshift(_core.types.cloneNode(thisArg))}let declId=methodId;return isGetter?(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{getterDeclared:!0,initAdded:!0})),declId=getId):isSetter?(privateNamesMap.set(prop.node.key.id.name,Object.assign({},privateName,{setterDeclared:!0,initAdded:!0})),declId=setId):isStatic&&!privateFieldsAsSymbolsOrProperties&&(declId=id),inheritPropComments(_core.types.functionDeclaration(_core.types.cloneNode(declId),params,body,generator,async),prop)}const thisContextVisitor=_traverse.visitors.environmentVisitor({Identifier(path,state){state.argumentsPath&&"arguments"===path.node.name&&state.argumentsPath.push(path)},UnaryExpression(path){const{node}=path;if("delete"===node.operator){const argument=(0,_helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes)(node.argument);_core.types.isThisExpression(argument)&&path.replaceWith(_core.types.booleanLiteral(!0))}},ThisExpression(path,state){state.needsClassRef=!0,path.replaceWith(_core.types.cloneNode(state.thisRef))},MetaProperty(path){const{node,scope}=path;"new"===node.meta.name&&"target"===node.property.name&&path.replaceWith(scope.buildUndefinedNode())}}),innerReferencesVisitor={ReferencedIdentifier(path,state){path.scope.bindingIdentifierEquals(path.node.name,state.innerBinding)&&(state.needsClassRef=!0,path.node.name=state.thisRef.name)}};function replaceThisContext(path,ref,innerBindingRef){var _state$thisRef;const state={thisRef:ref,needsClassRef:!1,innerBinding:innerBindingRef};return path.isMethod()||path.traverse(thisContextVisitor,state),null!=innerBindingRef&&null!=(_state$thisRef=state.thisRef)&&_state$thisRef.name&&state.thisRef.name!==innerBindingRef.name&&path.traverse(innerReferencesVisitor,state),state.needsClassRef}function isNameOrLength({key,computed}){return"Identifier"===key.type?!computed&&("name"===key.name||"length"===key.name):"StringLiteral"===key.type&&("name"===key.value||"length"===key.value)}function inheritPropComments(node,prop){return _core.types.inheritLeadingComments(node,prop.node),_core.types.inheritInnerComments(node,prop.node),node}function inheritLoc(node,original){return node.start=original.start,node.end=original.end,node.loc=original.loc,node}},"./node_modules/.pnpm/@babel+helper-create-class-features-plugin@7.25.9_@babel+core@7.26.0/node_modules/@babel/helper-create-class-features-plugin/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"FEATURES",{enumerable:!0,get:function(){return _features.FEATURES}}),Object.defineProperty(exports,"buildCheckInRHS",{enumerable:!0,get:function(){return _fields.buildCheckInRHS}}),exports.createClassFeaturePlugin=function({name,feature,loose,manipulateOptions,api,inherits,decoratorVersion}){var _api$assumption;if(feature&_features.FEATURES.decorators&&("2023-11"===decoratorVersion||"2023-05"===decoratorVersion||"2023-01"===decoratorVersion||"2022-03"===decoratorVersion||"2021-12"===decoratorVersion))return(0,_decorators.default)(api,{loose},decoratorVersion,inherits);null!=api||(api={assumption:()=>{}});const setPublicClassFields=api.assumption("setPublicClassFields"),privateFieldsAsSymbols=api.assumption("privateFieldsAsSymbols"),privateFieldsAsProperties=api.assumption("privateFieldsAsProperties"),noUninitializedPrivateFieldAccess=null!=(_api$assumption=api.assumption("noUninitializedPrivateFieldAccess"))&&_api$assumption,constantSuper=api.assumption("constantSuper"),noDocumentAll=api.assumption("noDocumentAll");if(privateFieldsAsProperties&&privateFieldsAsSymbols)throw new Error('Cannot enable both the "privateFieldsAsProperties" and "privateFieldsAsSymbols" assumptions as the same time.');const privateFieldsAsSymbolsOrProperties=privateFieldsAsProperties||privateFieldsAsSymbols;if(!0===loose){const explicit=[];void 0!==setPublicClassFields&&explicit.push('"setPublicClassFi Line truncated
Promise.resolve().then(() => ${builder(specifier)})
`:builder(specifier);const specifierToString=_core.types.isTemplateLiteral(specifier)?_core.types.identifier("specifier"):_core.types.templateLiteral([_core.types.templateElement({raw:""}),_core.types.templateElement({raw:""})],[_core.types.identifier("specifier")]);return deferToThen?_core.template.expression.ast`
(specifier =>
new Promise(r => r(${specifierToString}))
.then(s => ${builder(_core.types.identifier("s"))})
)(${specifier})
`:wrapWithPromise?_core.template.expression.ast`
(specifier =>
new Promise(r => r(${builder(specifierToString)}))
)(${specifier})
`:_core.template.expression.ast`
(specifier => ${builder(specifierToString)})(${specifier})
`};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js");exports.getDynamicImportSource=function(node){const[source]=node.arguments;return _core.types.isStringLiteral(source)||_core.types.isTemplateLiteral(source)?source:_core.template.expression.ast`\`\${${source}}\``}},"./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/get-module-name.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=getModuleName;{const originalGetModuleName=getModuleName;exports.default=getModuleName=function(rootOpts,pluginOpts){var _pluginOpts$moduleId,_pluginOpts$moduleIds,_pluginOpts$getModule,_pluginOpts$moduleRoo;return originalGetModuleName(rootOpts,{moduleId:null!=(_pluginOpts$moduleId=pluginOpts.moduleId)?_pluginOpts$moduleId:rootOpts.moduleId,moduleIds:null!=(_pluginOpts$moduleIds=pluginOpts.moduleIds)?_pluginOpts$moduleIds:rootOpts.moduleIds,getModuleId:null!=(_pluginOpts$getModule=pluginOpts.getModuleId)?_pluginOpts$getModule:rootOpts.getModuleId,moduleRoot:null!=(_pluginOpts$moduleRoo=pluginOpts.moduleRoot)?_pluginOpts$moduleRoo:rootOpts.moduleRoot})}}function getModuleName(rootOpts,pluginOpts){const{filename,filenameRelative=filename,sourceRoot=pluginOpts.moduleRoot}=rootOpts,{moduleId,moduleIds=!!moduleId,getModuleId,moduleRoot=sourceRoot}=pluginOpts;if(!moduleIds)return null;if(null!=moduleId&&!getModuleId)return moduleId;let moduleName=null!=moduleRoot?moduleRoot+"/":"";if(filenameRelative){const sourceRootReplacer=null!=sourceRoot?new RegExp("^"+sourceRoot+"/?"):"";moduleName+=filenameRelative.replace(sourceRootReplacer,"").replace(/\.\w*$/,"")}return moduleName=moduleName.replace(/\\/g,"/"),getModuleId&&getModuleId(moduleName)||moduleName}},"./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"buildDynamicImport",{enumerable:!0,get:function(){return _dynamicImport.buildDynamicImport}}),exports.buildNamespaceInitStatements=function(metadata,sourceMetadata,constantReexports=!1,wrapReference=Lazy.wrapReference){var _wrapReference;const statements=[],srcNamespaceId=_core.types.identifier(sourceMetadata.name);for(const localName of sourceMetadata.importsNamespace)localName!==sourceMetadata.name&&statements.push(_core.template.statement`var NAME = SOURCE;`({NAME:localName,SOURCE:_core.types.cloneNode(srcNamespaceId)}));const srcNamespace=null!=(_wrapReference=wrapReference(srcNamespaceId,sourceMetadata.wrap))?_wrapReference:srcNamespaceId;constantReexports&&statements.push(...buildReexportsFromMeta(metadata,sourceMetadata,!0,wrapReference));for(const exportName of sourceMetadata.reexportNamespace)statements.push((_core.types.isIdentifier(srcNamespace)?_core.template.statement`EXPORTS.NAME = NAMESPACE;`:_core.template.statement`
Object.defineProperty(EXPORTS, "NAME", {
enumerable: true,
get: function() {
return NAMESPACE;
}
});
`)({EXPORTS:metadata.exportName,NAME:exportName,NAMESPACE:_core.types.cloneNode(srcNamespace)}));if(sourceMetadata.reexportAll){const statement=function(metadata,namespace,constantReexports){return(constantReexports?_core.template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
EXPORTS[key] = NAMESPACE[key];
});
`:_core.template.statement`
Object.keys(NAMESPACE).forEach(function(key) {
if (key === "default" || key === "__esModule") return;
VERIFY_NAME_LIST;
if (key in EXPORTS && EXPORTS[key] === NAMESPACE[key]) return;
Object.defineProperty(EXPORTS, key, {
enumerable: true,
get: function() {
return NAMESPACE[key];
},
});
});
`)({NAMESPACE:namespace,EXPORTS:metadata.exportName,VERIFY_NAME_LIST:metadata.exportNameListName?_core.template`
if (Object.prototype.hasOwnProperty.call(EXPORTS_LIST, key)) return;
`({EXPORTS_LIST:metadata.exportNameListName}):null})}(metadata,_core.types.cloneNode(srcNamespace),constantReexports);statement.loc=sourceMetadata.reexportAll.loc,statements.push(statement)}return statements},exports.ensureStatementsHoisted=function(statements){statements.forEach((header=>{header._blockHoist=3}))},Object.defineProperty(exports,"getModuleName",{enumerable:!0,get:function(){return _getModuleName.default}}),Object.defineProperty(exports,"hasExports",{enumerable:!0,get:function(){return _normalizeAndLoadMetadata.hasExports}}),Object.defineProperty(exports,"isModule",{enumerable:!0,get:function(){return _helperModuleImports.isModule}}),Object.defineProperty(exports,"isSideEffectImport",{enumerable:!0,get:function(){return _normalizeAndLoadMetadata.isSideEffectImport}}),exports.rewriteModuleStatementsAndPrepareHeader=function(path,{exportName,strict,allowTopLevelThis,strictMode,noInterop,importInterop=noInterop?"none":"babel",lazy,getWrapperPayload=Lazy.toGetWrapperPayload(null!=lazy&&lazy),wrapReference=Lazy.wrapReference,esNamespaceOnly,filename,constantReexports=arguments[1].loose,enumerableModuleMeta=arguments[1].loose,noIncompleteNsImportDetection}){(0,_normalizeAndLoadMetadata.validateImportInteropOption)(importInterop),_assert((0,_helperModuleImports.isModule)(path),"Cannot process module statements in a script"),path.node.sourceType="script";const meta=(0,_normalizeAndLoadMetadata.default)(path,exportName,{importInterop,initializeReexports:constantReexports,getWrapperPayload,esNamespaceOnly,filename});allowTopLevelThis||(0,_rewriteThis.default)(path);if((0,_rewriteLiveReferences.default)(path,meta,wrapReference),!1!==strictMode){path.node.directives.some((directive=>"use strict"===directive.value.value))||path.unshiftContainer("directives",_core.types.directive(_core.types.directiveLiteral("use strict")))}const headers=[];(0,_normalizeAndLoadMetadata.hasExports)(meta)&&!strict&&headers.push(function(metadata,enumerableModuleMeta=!1){return(enumerableModuleMeta?_core.template.statement`
EXPORTS.__esModule = true;
`:_core.template.statement`
Object.defineProperty(EXPORTS, "__esModule", {
value: true,
});
`)({EXPORTS:metadata.exportName})}(meta,enumerableModuleMeta));const nameList=function(programPath,metadata){const exportedVars=Object.create(null);for(const data of metadata.local.values())for(const name of data.names)exportedVars[name]=!0;let hasReexport=!1;for(const data of metadata.source.values()){for(const exportName of data.reexports.keys())exportedVars[exportName]=!0;for(const exportName of data.reexportNamespace)exportedVars[exportName]=!0;hasReexport=hasReexport||!!data.reexportAll}if(!hasReexport||0===Object.keys(exportedVars).length)return null;const name=programPath.scope.generateUidIdentifier("exportNames");return delete exportedVars.default,{name:name.name,statement:_core.types.variableDeclaration("var",[_core.types.variableDeclarator(name,_core.types.valueToNode(exportedVars))])}}(path,meta);nameList&&(meta.exportNameListName=nameList.name,headers.push(nameList.statement));return headers.push(...function(programPath,metadata,wrapReference,constantReexports=!1,noIncompleteNsImportDetection=!1){const initStatements=[];for(const[localName,data]of metadata.local)if("import"===data.kind);else if("hoisted"===data.kind)initStatements.push([data.names[0],buildInitStatement(metadata,data.names,_core.types.identifier(localName))]);else if(!noIncompleteNsImportDetection)for(const exportName of data.names)initStatements.push([exportName,null]);for(const data of metadata.source.values()){if(!constantReexports){const reexportsStatements=buildReexportsFromMeta(metadata,data,!1,wrapReference),reexports=[...data.reexports.keys()];for(let i=0;i<reexportsStatements.length;i++)initStatements.push([reexports[i],reexportsStatements[i]])}if(!noIncompleteNsImportDetection)for(const exportName of data.reexportNamespace)initStatements.push([exportName,null])}initStatements.sort((([a],[b])=>a<b?-1:b<a?1:0));const results=[];if(noIncompleteNsImportDetection)for(const[,initStatement]of initStatements)results.push(initStatement);else{const chunkSize=100;for(let i=0;i<initStatements.length;i+=chunkSize){let uninitializedExportNames=[];for(let j=0;j<chunkSize&&i+j<initStatements.length;j++){const[exportName,initStatement]=initStatements[i+j];null!==initStatement?(uninitializedExportNames.length>0&&(results.push(buildInitStatement(metadata,uninitializedExportNames,programPath.scope.buildUndefinedNode())),uninitializedExportNames=[]),results.push(initStatement)):uninitializedExportNames.push(exportName)}uninitializedExportNames.length>0&&results.push(buildInitStatement(metadata,uninitializedExportNames,programPath.scope.buildUndefinedNode()))}}return results}(path,meta,wrapReference,constantReexports,noIncompleteNsImportDetection)),{meta,headers}},Object.defineProperty(exports,"rewriteThis",{enumerable:!0,get:function(){return _rewriteThis.default}}),exports.wrapInterop=function(programPath,expr,type){if("none"===type)return null;if("node-namespace"===type)return _core.types.callExpression(programPath.hub.addHelper("interopRequireWildcard"),[expr,_core.types.booleanLiteral(!0)]);if("node-default"===type)return null;let helper;if("default"===type)helper="interopRequireDefault";else{if("namespace"!==type)throw new Error(`Unknown interop: ${type}`);helper="interopRequireWildcard"}return _core.types.callExpression(programPath.hub.addHelper(helper),[expr])};var _assert=__webpack_require__("assert"),_core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_helperModuleImports=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-imports@7.25.9/node_modules/@babel/helper-module-imports/lib/index.js"),_rewriteThis=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/rewrite-this.js"),_rewriteLiveReferences=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/rewrite-live-references.js"),_normalizeAndLoadMetadata=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js"),Lazy=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js"),_dynamicImport=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js"),_getModuleName=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/get-module-name.js");exports.getDynamicImportSource=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/dynamic-import.js").getDynamicImportSource;const ReexportTemplate={constant:({expor Line truncated
${exports}.${exportName} = ${namespaceImport};
`,constantComputed:({exports,exportName,namespaceImport})=>_core.template.statement.ast`
${exports}["${exportName}"] = ${namespaceImport};
`,spec:({exports,exportName,namespaceImport})=>_core.template.statement.ast`
Object.defineProperty(${exports}, "${exportName}", {
enumerable: true,
get: function() {
return ${namespaceImport};
},
});
`};function buildReexportsFromMeta(meta,metadata,constantReexports,wrapReference){var _wrapReference2;let namespace=_core.types.identifier(metadata.name);namespace=null!=(_wrapReference2=wrapReference(namespace,metadata.wrap))?_wrapReference2:namespace;const{stringSpecifiers}=meta;return Array.from(metadata.reexports,(([exportName,importName])=>{let namespaceImport=_core.types.cloneNode(namespace);"default"===importName&&"node-default"===metadata.interop||(namespaceImport=stringSpecifiers.has(importName)?_core.types.memberExpression(namespaceImport,_core.types.stringLiteral(importName),!0):_core.types.memberExpression(namespaceImport,_core.types.identifier(importName)));const astNodes={exports:meta.exportName,exportName,namespaceImport};return constantReexports||_core.types.isIdentifier(namespaceImport)?stringSpecifiers.has(exportName)?ReexportTemplate.constantComputed(astNodes):ReexportTemplate.constant(astNodes):ReexportTemplate.spec(astNodes)}))}const InitTemplate={computed:({exports,name,value})=>_core.template.expression.ast`${exports}["${name}"] = ${value}`,default:({exports,name,value})=>_core.template.expression.ast`${exports}.${name} = ${value}`,define:({exports,name,value})=>_core.template.expression.ast`
Object.defineProperty(${exports}, "${name}", {
enumerable: true,
value: void 0,
writable: true
})["${name}"] = ${value}`};function buildInitStatement(metadata,exportNames,initExpr){const{stringSpecifiers,exportName:exports}=metadata;return _core.types.expressionStatement(exportNames.reduce(((value,name)=>{const params={exports,name,value};return"__proto__"===name?InitTemplate.define(params):stringSpecifiers.has(name)?InitTemplate.computed(params):InitTemplate.default(params)}),initExpr))}},"./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/lazy-modules.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.toGetWrapperPayload=function(lazy){return(source,metadata)=>{if(!1===lazy)return null;if((0,_normalizeAndLoadMetadata.isSideEffectImport)(metadata)||metadata.reexportAll)return null;if(!0===lazy)return source.includes(".")?null:"lazy";if(Array.isArray(lazy))return lazy.includes(source)?"lazy":null;if("function"==typeof lazy)return lazy(source)?"lazy":null;throw new Error(".lazy must be a boolean, string array, or function")}},exports.wrapReference=function(ref,payload){return"lazy"===payload?_core.types.callExpression(ref,[]):null};var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_normalizeAndLoadMetadata=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js")},"./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/normalize-and-load-metadata.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=function(programPath,exportName,{importInterop,initializeReexports=!1,getWrapperPayload,esNamespaceOnly=!1,filename}){exportName||(exportName=programPath.scope.generateUidIdentifier("exports").name);const stringSpecifiers=new Set;!function(programPath){programPath.get("body").forEach((child=>{child.isExportDefaultDeclaration()&&(null!=child.splitExportDeclaration||(child.splitExportDeclaration=__webpack_require__("./node_modules/.pnpm/@babel+traverse@7.26.4/node_modules/@babel/traverse/lib/index.js").NodePath.prototype.splitExportDeclaration),child.splitExportDeclaration())}))}(programPath);const{local,sources,hasExports}=function(programPath,{getWrapperPayload,initializeReexports},stringSpecifiers){const localData=function(programPath,initializeReexports,stringSpecifiers){const bindingKindLookup=new Map;programPath.get("body").forEach((child=>{let kind;if(child.isImportDeclaration())kind="import";else{if(child.isExportDefaultDeclaration()&&(child=child.get("declaration")),child.isExportNamedDeclaration())if(child.node.declaration)child=child.get("declaration");else if(initializeReexports&&child.node.source&&child.get("source").isStringLiteral())return void child.get("specifiers").forEach((spec=>{assertExportSpecifier(spec),bindingKindLookup.set(spec.get("local").node.name,"block")}));if(child.isFunctionDeclaration())kind="hoisted";else if(child.isClassDeclaration())kind="block";else if(child.isVariableDeclaration({kind:"var"}))kind="var";else{if(!child.isVariableDeclaration())return;kind="block"}}Object.keys(child.getOuterBindingIdentifiers()).forEach((name=>{bindingKindLookup.set(name,kind)}))}));const localMetadata=new Map,getLocalMetadata=idPath=>{const localName=idPath.node.name;let metadata=localMetadata.get(localName);if(!metadata){const kind=bindingKindLookup.get(localName);if(void 0===kind)throw idPath.buildCodeFrameError(`Exporting local "${localName}", which is not declared.`);metadata={names:[],kind},localMetadata.set(localName,metadata)}return metadata};return programPath.get("body").forEach((child=>{if(!child.isExportNamedDeclaration()||!initializeReexports&&child.node.source){if(child.isExportDefaultDeclaration()){const declaration=child.get("declaration");if(!declaration.isFunctionDeclaration()&&!declaration.isClassDeclaration())throw declaration.buildCodeFrameError("Unexpected default expression export.");getLocalMetadata(declaration.get("id")).names.push("default")}}else if(child.node.declaration){const declaration=child.get("declaration"),ids=declaration.getOuterBindingIdentifierPaths();Object.keys(ids).forEach((name=>{if("__esModule"===name)throw declaration.buildCodeFrameError('Illegal export "__esModule".');getLocalMetadata(ids[name]).names.push(name)}))}else child.get("specifiers").forEach((spec=>{const local=spec.get("local"),exported=spec.get("exported"),localMetadata=getLocalMetadata(local),exportName=getExportSpecifierName(exported,stringSpecifiers);if("__esModule"===exportName)throw exported.buildCodeFrameError('Illegal export "__esModule".');localMetadata.names.push(exportName)}))})),localMetadata}(programPath,initializeReexports,stringSpecifiers),importNodes=new Map,sou Line truncated
(function() {
throw new Error('"' + '${localName}' + '" is read-only.');
})()
`,rewriteReferencesVisitor={ReferencedIdentifier(path){const{seen,buildImportReference,scope,imported,requeueInParent}=this;if(seen.has(path.node))return;seen.add(path.node);const localName=path.node.name,importData=imported.get(localName);if(importData){if(function(path){do{switch(path.parent.type){case"TSTypeAnnotation":case"TSTypeAliasDeclaration":case"TSTypeReference":case"TypeAnnotation":case"TypeAlias":return!0;case"ExportSpecifier":return"type"===path.parentPath.parent.exportKind;default:if(path.parentPath.isStatement()||path.parentPath.isExpression())return!1}}while(path=path.parentPath)}(path))throw path.buildCodeFrameError(`Cannot transform the imported binding "${localName}" since it's also used in a type annotation. Please strip type annotations using @babel/preset-typescript or @babel/preset-flow.`);const localBinding=path.scope.getBinding(localName);if(scope.getBinding(localName)!==localBinding)return;const ref=buildImportReference(importData,path.node);if(ref.loc=path.node.loc,(path.parentPath.isCallExpression({callee:path.node})||path.parentPath.isOptionalCallExpression({callee:path.node})||path.parentPath.isTaggedTemplateExpression({tag:path.node}))&&_core.types.isMemberExpression(ref))path.replaceWith(_core.types.sequenceExpression([_core.types.numericLiteral(0),ref]));else if(path.isJSXIdentifier()&&_core.types.isMemberExpression(ref)){const{object,property}=ref;path.replaceWith(_core.types.jsxMemberExpression(_core.types.jsxIdentifier(object.name),_core.types.jsxIdentifier(property.name)))}else path.replaceWith(ref);requeueInParent(path),path.skip()}},UpdateExpression(path){const{scope,seen,imported,exported,requeueInParent,buildImportReference}=this;if(seen.has(path.node))return;seen.add(path.node);const arg=path.get("argument");if(arg.isMemberExpression())return;const update=path.node;if(arg.isIdentifier()){const localName=arg.node.name;if(scope.getBinding(localName)!==path.scope.getBinding(localName))return;const exportedNames=exported.get(localName),importData=imported.get(localName);if((null==exportedNames?void 0:exportedNames.length)>0||importData)if(importData)path.replaceWith(_core.types.assignmentExpression(update.operator[0]+"=",buildImportReference(importData,arg.node),buildImportThrow(localName)));else if(update.prefix)path.replaceWith(buildBindingExportAssignmentExpression(this.metadata,exportedNames,_core.types.cloneNode(update),path.scope));else{const ref=scope.generateDeclaredUidIdentifier(localName);path.replaceWith(_core.types.sequenceExpression([_core.types.assignmentExpression("=",_core.types.cloneNode(ref),_core.types.cloneNode(update)),buildBindingExportAssignmentExpression(this.metadata,exportedNames,_core.types.identifier(localName),path.scope),_core.types.cloneNode(ref)]))}}requeueInParent(path),path.skip()},AssignmentExpression:{exit(path){const{scope,seen,imported,exported,requeueInParent,buildImportReference}=this;if(seen.has(path.node))return;seen.add(path.node);const left=path.get("left");if(!left.isMemberExpression())if(left.isIdentifier()){const localName=left.node.name;if(scope.getBinding(localName)!==path.scope.getBinding(localName))return;const exportedNames=exported.get(localName),importData=imported.get(localName);if((null==exportedNames?void 0:exportedNames.length)>0||importData){const assignment=path.node;importData&&(assignment.left=buildImportReference(importData,left.node),assignment.right=_core.types.sequenceExpression([assignment.right,buildImportThrow(localName)]));const{operator}=assignment;let newExpr;newExpr="="===operator?assignment:"&&="===operator||"||="===operator||"??="===operator?_core.types.assignmentExpression("=",assignment.left,_core.types.logicalExpression(operator.slice(0,-1),_core.types.cloneNode(assignment.left),assignment.right)):_core.types.assignmentExpression("=",assignment.left,_core.types.binaryExpression(operator.slice(0,-1),_core.types.cloneNode(assignment.left),assignment.right)),path.replaceWith(buildBindingExportAssignmentExpression(this.metadata,exportedNames,newExpr,path.scope)),requeueInParent(path),path.skip()}}else{const ids=left.getOuterBindingIdentifiers(),programScopeIds=Object.keys(ids).filter((localName=>scope.getBinding(localName)===path.scope.getBinding(localName))),id=programScopeIds.find((localName=>imported.has(localName)));id&&(path.node.right=_core.types.sequenceExpression([path.node.right,buildImportThrow(id)]));const items=[];if(programScopeIds.forEach((localName=>{const exportedNames=exported.get(localName)||[];exportedNames.length>0&&items.push(buildBindingExportAssignmentExpression(this.metadata,exportedNames,_core.types.identifier(localName),path.scope))})),items.length>0){let node=_core.types.sequenceExpression(items);path.parentPath.isExpressionStatement()&&(node=_core.types.expressionStatement(node),node._blockHoist=path.parentPath.node._blockHoist);requeueInParent(path.insertAfter(node)[0])}}}},ForXStatement(path){const{scope,node}=path,{left}=node,{exported,imported,scope:programScope} Line truncated
function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
`]):_core.template.expression.ast`
function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
`}},specHandlers_old={memoise(superMember,count){const{scope,node}=superMember,{computed,property}=node;if(!computed)return;const memo=scope.maybeGenerateMemoised(property);memo&&this.memoiser.set(property,memo,count)},prop(superMember){const{computed,property}=superMember.node;return this.memoiser.has(property)?cloneNode(this.memoiser.get(property)):computed?cloneNode(property):stringLiteral(property.name)},_getPrototypeOfExpression(){const objectRef=cloneNode(this.getObjectRef()),targetRef=this.isStatic||this.isPrivateMethod?objectRef:memberExpression(objectRef,identifier("prototype"));return callExpression(this.file.addHelper("getPrototypeOf"),[targetRef])},get(superMember){return this._get(superMember)},_get(superMember){const proto=this._getPrototypeOfExpression();return callExpression(this.file.addHelper("get"),[this.isDerivedConstructor?sequenceExpression([thisExpression(),proto]):proto,this.prop(superMember),thisExpression()])},set(superMember,value){const proto=this._getPrototypeOfExpression();return callExpression(this.file.addHelper("set"),[this.isDerivedConstructor?sequenceExpression([thisExpression(),proto]):proto,this.prop(superMember),value,thisExpression(),_core.types.booleanLiteral(superMember.isInStrictMode())])},destructureSet(superMember){throw superMember.buildCodeFrameError("Destructuring to a super field is not supported yet.")},call(superMember,args){return(0,_helperOptimiseCallExpression.default)(this._get(superMember),thisExpression(),args,!1)},optionalCall(superMember,args){return(0,_helperOptimiseCallExpression.default)(this._get(superMember),cloneNode(thisExpression()),args,!0)},delete(superMember){return superMember.node.computed?sequenceExpression([callExpression(this.file.addHelper("toPropertyKey"),[cloneNode(superMember.node.property)]),_core.template.expression.ast`
function () { throw new ReferenceError("'delete super[expr]' is invalid"); }()
`]):_core.template.expression.ast`
function () { throw new ReferenceError("'delete super.prop' is invalid"); }()
`}},looseHandlers=Object.assign({},specHandlers,{prop(superMember){const{property}=superMember.node;return this.memoiser.has(property)?cloneNode(this.memoiser.get(property)):cloneNode(property)},get(superMember){const{isStatic,getSuperRef}=this,{computed}=superMember.node,prop=this.prop(superMember);let object;var _getSuperRef,_getSuperRef2;isStatic?object=null!=(_getSuperRef=getSuperRef())?_getSuperRef:memberExpression(identifier("Function"),identifier("prototype")):object=memberExpression(null!=(_getSuperRef2=getSuperRef())?_getSuperRef2:identifier("Object"),identifier("prototype"));return memberExpression(object,prop,computed)},set(superMember,value){const{computed}=superMember.node,prop=this.prop(superMember);return assignmentExpression("=",memberExpression(thisExpression(),prop,computed),value)},destructureSet(superMember){const{computed}=superMember.node,prop=this.prop(superMember);return memberExpression(thisExpression(),prop,computed)},call(superMember,args){return(0,_helperOptimiseCallExpression.default)(this.get(superMember),thisExpression(),args,!1)},optionalCall(superMember,args){return(0,_helperOptimiseCallExpression.default)(this.get(superMember),thisExpression(),args,!0)}});exports.default=class{constructor(opts){var _opts$constantSuper;const path=opts.methodPath;this.methodPath=path,this.isDerivedConstructor=path.isClassMethod({kind:"constructor"})&&!!opts.superRef,this.isStatic=path.isObjectMethod()||path.node.static||(null==path.isStaticBlock?void 0:path.isStaticBlock()),this.isPrivateMethod=path.isPrivate()&&path.isMethod(),this.file=opts.file,this.constantSuper=null!=(_opts$constantSuper=opts.constantSuper)?_opts$constantSuper:opts.isLoose,this.opts=opts}getObjectRef(){return cloneNode(this.opts.objectRef||this.opts.getObjectRef())}getSuperRef(){return this.opts.superRef?cloneNode(this.opts.superRef):this.opts.getSuperRef?cloneNode(this.opts.getSuperRef()):void 0}replace(){const{methodPath}=this;this.opts.refToPreserve&&methodPath.traverse(unshadowSuperBindingVisitor,{refName:this.opts.refToPreserve.name});const handler=this.constantSuper?looseHandlers:this.file.availableHelper("superPropSet")?specHandlers:specHandlers_old;visitor.shouldSkip=path=>{if(path.parentPath===methodPath&&("decorators"===path.parentKey||"key"===path.parentKey))return!0},(0,_helperMemberExpressionToFunctions.default)(methodPath,visitor,Object.assign({file:this.file,scope:this.methodPath.scope,isDerivedConstructor:this.isDerivedConstructor,isStatic:this.isStatic,isPrivateMethod:this.isPrivateMethod,getObjectRef:this.getObjectRef.bind(this),getSuperRef:this.getSuperRef.bind(this),boundGet:handler.get},handler))}}},"./node_modules/.pnpm/@babel+helper-skip-transparent-expression-wrappers@7.25.9/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.isTransparentExprWrapper=isTransparentExprWrapper,exports.skipTransparentExprWrapperNodes=function(node){for(;isTransparentExprWrapper(node);)node=node.expression;return node},exports.skipTransparentExprWrappers=function(path){for(;isTransparentExprWrapper(path.node);)path=path.get("expression");return path};var _t=__webpack_require__("./node_modules/.pnpm/@babel+types@7.26.3/node_modules/@babel/types/lib/index.js");const{isParenthesizedExpression,isTSAsExpression,isTSNonNullExpression,isTSSatisfiesExpression,isTSTypeAssertion,isTypeCastExpression}=_t;function isTransparentExprWrapper(node){return isTSAsExpression(node)||isTSSatisfiesExpression(node)||isTSTypeAssertion(node)||isTSNonNullExpression(node)||isTypeCastExpression(node)||isParenthesizedExpression(node)}},"./node_modules/.pnpm/@babel+helper-string-parser@7.25.9/node_modules/@babel/helper-string-parser/lib/index.js":(__unused_webpack_module,exports)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.readCodePoint=readCodePoint,exports.readInt=readInt,exports.readStringContents=function(type,input,pos,lineStart,curLine,errors){const initialPos=pos,initialLineStart=lineStart,initialCurLine=curLine;let out="",firstInvalidLoc=null,chunkStart=pos;const{length}=input;for(;;){if(pos>=length){errors.unterminated(initialPos,initialLineStart,initialCurLine),out+=input.slice(chunkStart,pos);break}const ch=input.charCodeAt(pos);if(isStringEnd(type,ch,input,pos)){out+=input.slice(chunkStart,pos);break}if(92===ch){out+=input.slice(chunkStart,pos);const res=readEscapedChar(input,pos,lineStart,curLine,"template"===type,errors);null!==res.ch||firstInvalidLoc?out+=res.ch:firstInvalidLoc={pos,lineStart,curLine},({pos,lineStart,curLine}=res),chunkStart=pos}else 8232===ch||8233===ch?(++curLine,lineStart=++pos):10===ch||13===ch?"template"===type?(out+=input.slice(chunkStart,pos)+"\n",++pos,13===ch&&10===input.charCodeAt(pos)&&++pos,++curLine,chunkStart=lineStart=pos):errors.unterminated(initialPos,initialLineStart,initialCurLine):++pos}return{pos,str Line truncated
(function(){
throw new Error(
"The CommonJS '" + "${localName}" + "' variable is not available in ES6 modules." +
"Consider setting setting sourceType:script or sourceType:unambiguous in your " +
"Babel config for this file.");
})()
`,moduleExportsVisitor={ReferencedIdentifier(path){const localName=path.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);this.scope.getBinding(localName)!==localBinding||path.parentPath.isObjectProperty({value:path.node})&&path.parentPath.parentPath.isObjectPattern()||path.parentPath.isAssignmentExpression({left:path.node})||path.isAssignmentExpression({left:path.node})||path.replaceWith(getAssertion(localName))},UpdateExpression(path){const arg=path.get("argument");if(!arg.isIdentifier())return;const localName=arg.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);this.scope.getBinding(localName)===localBinding&&path.replaceWith(_core.types.assignmentExpression(path.node.operator[0]+"=",arg.node,getAssertion(localName)))},AssignmentExpression(path){const left=path.get("left");if(left.isIdentifier()){const localName=left.node.name;if("module"!==localName&&"exports"!==localName)return;const localBinding=path.scope.getBinding(localName);if(this.scope.getBinding(localName)!==localBinding)return;const right=path.get("right");right.replaceWith(_core.types.sequenceExpression([right.node,getAssertion(localName)]))}else if(left.isPattern()){const ids=left.getOuterBindingIdentifiers(),localName=Object.keys(ids).find((localName=>("module"===localName||"exports"===localName)&&this.scope.getBinding(localName)===path.scope.getBinding(localName)));if(localName){const right=path.get("right");right.replaceWith(_core.types.sequenceExpression([right.node,getAssertion(localName)]))}}}};return{name:"transform-modules-commonjs",pre(){this.file.set("@babel/plugin-transform-modules-*","commonjs"),lazy&&(0,_hooks.defineCommonJSHook)(this.file,(0,_lazy.lazyImportsHook)(lazy))},visitor:{["CallExpression"+(api.types.importExpression?"|ImportExpression":"")](path){if(!this.file.has("@babel/plugin-proposal-dynamic-import"))return;if(path.isCallExpression()&&!_core.types.isImport(path.node.callee))return;let{scope}=path;do{scope.rename("require")}while(scope=scope.parent);(0,_dynamicImport.transformDynamicImport)(path,noInterop,this.file)},Program:{exit(path,state){if(!(0,_helperModuleTransforms.isModule)(path))return;path.scope.rename("exports"),path.scope.rename("module"),path.scope.rename("require"),path.scope.rename("__filename"),path.scope.rename("__dirname"),allowCommonJSExports||path.traverse(moduleExportsVisitor,{scope:path.scope});let moduleName=(0,_helperModuleTransforms.getModuleName)(this.file.opts,options);moduleName&&(moduleName=_core.types.stringLiteral(moduleName));const hooks=(0,_hooks.makeInvokers)(this.file),{meta,headers}=(0,_helperModuleTransforms.rewriteModuleStatementsAndPrepareHeader)(path,{exportName:"exports",constantReexports,enumerableModuleMeta,strict,strictMode,allowTopLevelThis,noInterop,importInterop,wrapReference:hooks.wrapReference,getWrapperPayload:hooks.getWrapperPayload,esNamespaceOnly:"string"==typeof state.filename&&/\.mjs$/.test(state.filename)?mjsStrictNamespace:strictNamespace,noIncompleteNsImportDetection,filename:this.file.opts.filename});for(const[source,metadata]of meta.source){const loadExpr=_core.types.callExpression(_core.types.identifier("require"),[_core.types.stringLiteral(source)]);let header;if((0,_helperModuleTransforms.isSideEffectImport)(metadata)){if(lazy&&"function"===metadata.wrap)throw new Error("Assertion failure");header=_core.types.expressionStatement(loadExpr)}else{const init=(0,_helperModuleTransforms.wrapInterop)(path,loadExpr,metadata.interop)||loadExpr;if(metadata.wrap){const res=hooks.buildRequireWrapper(metadata.name,init,metadata.wrap,metadata.referenced);if(!1===res)continue;header=res}null!=header||(header=_core.template.statement.ast`
var ${metadata.name} = ${init};
`)}header.loc=metadata.loc,headers.push(header),headers.push(...(0,_helperModuleTransforms.buildNamespaceInitStatements)(meta,metadata,constantReexports,hooks.wrapReference))}(0,_helperModuleTransforms.ensureStatementsHoisted)(headers),path.unshiftContainer("body",headers),path.get("body").forEach((path=>{headers.includes(path.node)&&path.isVariableDeclaration()&&path.scope.registerDeclaration(path)}))}}}}}))},"./node_modules/.pnpm/@babel+plugin-transform-modules-commonjs@7.26.3_@babel+core@7.26.0/node_modules/@babel/plugin-transform-modules-commonjs/lib/lazy.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.lazyImportsHook=void 0;var _core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),_helperModuleTransforms=__webpack_require__("./node_modules/.pnpm/@babel+helper-module-transforms@7.26.0_@babel+core@7.26.0/node_modules/@babel/helper-module-transforms/lib/index.js");exports.lazyImportsHook=lazy=>({name:"@babel/plugin-transform-modules-commonjs/lazy",version:"7.26.3",getWrapperPayload:(source,metadata)=>(0,_helperModuleTransforms.isSideEffectImport)(metadata)||metadata.reexportAll?null:!0===lazy?source.includes(".")?null:"lazy/function":Array.isArray(lazy)?lazy.includes(source)?"lazy/function":null:"function"==typeof lazy?lazy(source)?"lazy/function":null:void 0,buildRequireWrapper(name,init,payload,referenced){if("lazy/function"===payload)return!!referenced&&_core.template.statement.ast`
function ${name}() {
const data = ${init};
${name} = function(){ return data; };
return data;
}
`},wrapReference(ref,payload){if("lazy/function"===payload)return _core.types.callExpression(ref,[])}})},"./node_modules/.pnpm/@babel+plugin-transform-nullish-coalescing-operator@7.25.9_@babel+core@7.26.0/node_modules/@babel/plugin-transform-nullish-coalescing-operator/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var _helperPluginUtils=__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.25.9/node_modules/@babel/helper-plugin-utils/lib/index.js"),_core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js");exports.default=(0,_helperPluginUtils.declare)(((api,{loose=!1})=>{var _api$assumption;api.assertVersion("^7.0.0-0 || >8.0.0-alpha <8.0.0-beta");const noDocumentAll=null!=(_api$assumption=api.assumption("noDocumentAll"))?_api$assumption:loose;return{name:"transform-nullish-coalescing-operator",manipulateOptions:(_,parser)=>parser.plugins.push("nullishCoalescingOperator"),visitor:{LogicalExpression(path){const{node,scope}=path;if("??"!==node.operator)return;let ref,assignment;if(scope.isStatic(node.left))ref=node.left,assignment=_core.types.cloneNode(node.left);else{if(scope.path.isPattern())return void path.replaceWith(_core.template.statement.ast`(() => ${path.node})()`);ref=scope.generateUidIdentifierBasedOnNode(node.left),scope.push({id:_core.types.cloneNode(ref)}),assignment=_core.types.assignmentExpression("=",ref,node.left)}path.replaceWith(_core.types.conditionalExpression(noDocumentAll?_core.types.binaryExpression("!=",assignment,_core.types.nullLiteral()):_core.types.logicalExpression("&&",_core.types.binaryExpression("!==",assignment,_core.types.nullLiteral()),_core.types.binaryExpression("!==",_core.types.cloneNode(ref),scope.buildUndefinedNode())),_core.types.cloneNode(ref),node.right))}}}}))},"./node_modules/.pnpm/@babel+plugin-transform-optional-chaining@7.25.9_@babel+core@7.26.0/node_modules/@babel/plugin-transform-optional-chaining/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helperPluginUtils=__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.25.9/node_modules/@babel/helper-plugin-utils/lib/index.js"),core=__webpack_require__("./node_modules/.pnpm/@babel+core@7.26.0/node_modules/@babel/core/lib/index.js"),helperSkipTransparentExpressionWrappers=__webpack_require__("./node_modules/.pnpm/@babel+helper-skip-transparent-expression-wrappers@7.25.9/node_modules/@babel/helper-skip-transparent-expression-wrappers/lib/index.js");function willPathCastToBoolean(path){const maybeWrapped=findOutermostTransparentParent(path),{node,parentPath}=maybeWrapped;if(parentPath.isLogicalExpression()){const{operator,right}=parentPath.node;if("&&"===operator||"||"===operator||"??"===operator&&node===right)return willPathCastToBoolean(parentPath)}if(parentPath.isSequenceExpression()){const{expressions}=parentPath.node;return expressions[expressions.length-1]!==node||willPathCastToBoolean(parentPath)}return parentPath.isConditional({test:node})||parentPath.isUnaryExpression({operator:"!"})||parentPath.isLoop({test:node})}function findOutermostTransparentParent(path){let maybeWrapped=path;return path.findParent((p=>{if(!helperSkipTransparentExpressionWrappers.isTransparentExprWrapper(p.node))return!0;maybeWrapped=p})),maybeWrapped}function isSimpleMemberExpression(expression){return expression=helperSkipTransparentExpressionWrappers.skipTransparentExprWrapperNodes(expression),core.types.isIdentifier(expression)||core.types.isSuper(expression)||core.types.isMemberExpression(expression)&&!expression.computed&&isSimpleMemberExpression(expression.object)}const NULLISH_CHECK=core.template.expression("%%check%% === null || %%ref%% === void 0"),NULLISH_CHECK_NO_DDA=core.template.expression("%%check%% == null"),NULLISH_CHECK_NEG=core.template.expression("%%check%% !== null && %%ref%% !== void 0"),NULLISH_CHECK_NO_DDA_NEG=core.template.expression("%%check%% != null");function transformOptionalChain(path,{pureGetters,noDocumentAll},replacementPath,ifNullish,wrapLast){const{scope}=path;if(scope.path.isPattern()&&function(path){let optionalPath=path;const{scope}=path;for(;optionalPath.isOptionalMemberExpression()||optionalPath.isOptionalCallExpression();){const{node}=optionalPath,childPath=helperSkipTransparentExpressionWrappers.skipTransparentExprWrappers(optionalPath.isOptionalMemberExpression()?optionalPath.get("object"):optionalPath.get("callee"));if(node.optional)return!scope.isStatic(childPath.node);optionalPath=childPath}}(path))return void replacementPath.replaceWith(core.template.expression.ast`(() => ${replacementPath.node})()`);const optionals=[];let optionalPath=path;for(;optionalPath.isOptionalMemberExpression()||optionalPath.isOptionalCallExpression();){const{node}=optionalPath;node.optional&&optionals.push(node),op Line truncated
this.${t.cloneNode(id)} = ${t.cloneNode(id)}
`),paramPath.replaceWith(paramPath.get("parameter")),scope.registerBinding("param",paramPath)}}(0,_helperCreateClassFeaturesPlugin.injectInitialization)(classPath,path,assigns)}};return{name:"transform-typescript",inherits:_pluginSyntaxTypescript.default,visitor:{Pattern:visitPattern,Identifier:visitPattern,RestElement:visitPattern,Program:{enter(path,state){const{file}=state;let fileJsxPragma=null,fileJsxPragmaFrag=null;const programScope=path.scope;if(_globalTypes.GLOBAL_TYPES.has(programScope)||_globalTypes.GLOBAL_TYPES.set(programScope,new Set),file.ast.comments)for(const comment of file.ast.comments){const jsxMatches=JSX_PRAGMA_REGEX.exec(comment.value);jsxMatches&&(jsxMatches[1]?fileJsxPragmaFrag=jsxMatches[2]:fileJsxPragma=jsxMatches[2])}let pragmaImportName=fileJsxPragma||jsxPragma;pragmaImportName&&([pragmaImportName]=pragmaImportName.split("."));let pragmaFragImportName=fileJsxPragmaFrag||jsxPragmaFrag;pragmaFragImportName&&([pragmaFragImportName]=pragmaFragImportName.split("."));for(let stmt of path.get("body"))if(stmt.isImportDeclaration()){if(NEEDS_EXPLICIT_ESM.has(state.file.ast.program)||NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!0),"type"===stmt.node.importKind){for(const specifier of stmt.node.specifiers)(0,_globalTypes.registerGlobalType)(programScope,specifier.local.name);stmt.remove();continue}const importsToRemove=new Set,specifiersLength=stmt.node.specifiers.length,isAllSpecifiersElided=()=>specifiersLength>0&&specifiersLength===importsToRemove.size;for(const specifier of stmt.node.specifiers)if("ImportSpecifier"===specifier.type&&"type"===specifier.importKind){(0,_globalTypes.registerGlobalType)(programScope,specifier.local.name);const binding=stmt.scope.getBinding(specifier.local.name);binding&&importsToRemove.add(binding.path)}if(onlyRemoveTypeImports)NEEDS_EXPLICIT_ESM.set(path.node,!1);else{if(0===stmt.node.specifiers.length){NEEDS_EXPLICIT_ESM.set(path.node,!1);continue}for(const specifier of stmt.node.specifiers){const binding=stmt.scope.getBinding(specifier.local.name);binding&&!importsToRemove.has(binding.path)&&(isImportTypeOnly({binding,programPath:path,pragmaImportName,pragmaFragImportName})?importsToRemove.add(binding.path):NEEDS_EXPLICIT_ESM.set(path.node,!1))}}if(isAllSpecifiersElided()&&!onlyRemoveTypeImports)stmt.remove();else for(const importPath of importsToRemove)importPath.remove()}else if(stmt.isExportDeclaration()&&(stmt=stmt.get("declaration")),stmt.isVariableDeclaration({declare:!0}))for(const name of Object.keys(stmt.getBindingIdentifiers()))(0,_globalTypes.registerGlobalType)(programScope,name);else(stmt.isTSTypeAliasDeclaration()||stmt.isTSDeclareFunction()&&stmt.get("id").isIdentifier()||stmt.isTSInterfaceDeclaration()||stmt.isClassDeclaration({declare:!0})||stmt.isTSEnumDeclaration({declare:!0})||stmt.isTSModuleDeclaration({declare:!0})&&stmt.get("id").isIdentifier())&&(0,_globalTypes.registerGlobalType)(programScope,stmt.node.id.name)},exit(path){"module"===path.node.sourceType&&NEEDS_EXPLICIT_ESM.get(path.node)&&path.pushContainer("body",t.exportNamedDeclaration())}},ExportNamedDeclaration(path,state){if(NEEDS_EXPLICIT_ESM.has(state.file.ast.program)||NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!0),"type"!==path.node.exportKind)if(path.node.source&&path.node.specifiers.length>0&&path.node.specifiers.every((specifier=>"ExportSpecifier"===specifier.type&&"type"===specifier.exportKind)))path.remove();else if(!path.node.source&&path.node.specifiers.length>0&&path.node.specifiers.every((specifier=>t.isExportSpecifier(specifier)&&(0,_globalTypes.isGlobalType)(path,specifier.local.name))))path.remove();else{if(t.isTSModuleDeclaration(path.node.declaration)){const namespace=path.node.declaration;if(!t.isStringLiteral(namespace.id)){const id=(0,_namespace.getFirstIdentifier)(namespace.id);if(path.scope.hasOwnBinding(id.name))path.replaceWith(namespace);else{const[newExport]=path.replaceWithMultiple([t.exportNamedDeclaration(t.variableDeclaration("let",[t.variableDeclarator(t.cloneNode(id))])),namespace]);path.scope.registerDeclaration(newExport)}}}NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!1)}else path.remove()},ExportAllDeclaration(path){"type"===path.node.exportKind&&path.remove()},ExportSpecifier(path){(!path.parent.source&&(0,_globalTypes.isGlobalType)(path,path.node.local.name)||"type"===path.node.exportKind)&&path.remove()},ExportDefaultDeclaration(path,state){NEEDS_EXPLICIT_ESM.has(state.file.ast.program)||NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!0),t.isIdentifier(path.node.declaration)&&(0,_globalTypes.isGlobalType)(path,path.node.declaration.name)?path.remove():NEEDS_EXPLICIT_ESM.set(state.file.ast.program,!1)},TSDeclareFunction(path){safeRemove(path)},TSDeclareMethod(path){safeRemove(path)},VariableDeclaration(path){path.node.declare&&safeRemove(path)},VariableDeclarator({node}){node.definite&&(node.definite=null)},TSIndexSignature(path){path.remove()},ClassDeclaration(path){const{node}=path;node.declare&&safeRemove(path)},C Line truncated
${_core.types.cloneNode(memberExpr)} ||
(${_core.types.cloneNode(memberExpr)} = ${fallthroughValue})
`}return _core.template.statement.ast`
(function (${_core.types.identifier(name)}) {
${namespaceTopLevel}
})(${realName} || (${_core.types.cloneNode(realName)} = ${fallthroughValue}));
`}},"./node_modules/.pnpm/@babel+preset-typescript@7.26.0_@babel+core@7.26.0/node_modules/@babel/preset-typescript/lib/index.js":(__unused_webpack_module,exports,__webpack_require__)=>{"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var helperPluginUtils=__webpack_require__("./node_modules/.pnpm/@babel+helper-plugin-utils@7.25.9/node_modules/@babel/helper-plugin-utils/lib/index.js"),transformTypeScript=__webpack_require__("./node_modules/.pnpm/@babel+plugin-transform-typescript@7.26.3_@babel+core@7.26.0/node_modules/@babel/plugin-transform-typescript/lib/index.js");__webpack_require__("./node_modules/.pnpm/@babel+plugin-syntax-jsx@7.25.9_@babel+core@7.26.0/node_modules/@babel/plugin-syntax-jsx/lib/index.js");var transformModulesCommonJS=__webpack_require__("./node_modules/.pnpm/@babel+plugin-transform-modules-commonjs@7.26.3_@babel+core@7.26.0/node_modules/@babel/plugin-transform-modules-commonjs/lib/index.js"),helperValidatorOption=__webpack_require__("./node_modules/.pnpm/@babel+helper-validator-option@7.25.9/node_modules/@babel/helper-validator-option/lib/index.js");function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var transformTypeScript__default=_interopDefault(transformTypeScript),transformModulesCommonJS__default=_interopDefault(transformModulesCommonJS);const v=new helperValidatorOption.OptionValidator("@babel/preset-typescript");var pluginRewriteTSImports=helperPluginUtils.declare((function({types:t,template}){function maybeReplace(source,path){source&&(t.isStringLiteral(source)?/[\\/]/.test(source.value)&&(source.value=source.value.replace(/(\.[mc]?)ts$/,"$1js").replace(/\.tsx$/,".js")):path.replaceWith(template.expression.ast`(${source} + "").replace(/([\\/].*\.[mc]?)tsx?$/, "$1js")`))}return{name:"preset-typescript/plugin-rewrite-ts-imports",visitor:{"ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration"(path){const node=path.node;"value"===(t.isImportDeclaration(node)?node.importKind:node.exportKind)&&maybeReplace(node.source,path.get("source"))},CallExpression(path){t.isImport(path.node.callee)&&maybeReplace(path.node.arguments[0],path.get("arguments.0"))},ImportExpression(path){maybeReplace(path.node.source,path.get("source"))}}}})),index=helperPluginUtils.declarePreset(((api,opts)=>{api.assertVersion(7);const{allExtensions,ignoreExtensions,allowNamespaces,disallowAmbiguousJSXLike,isTSX,jsxPragma,jsxPragmaFrag,onlyRemoveTypeImports,optimizeConstEnums,rewriteImportExtensions}=function(options={}){let{allowNamespaces=!0,jsxPragma,onlyRemoveTypeImports}=options;const TopLevelOptions_ignoreExtensions="ignoreExtensions",TopLevelOptions_disallowAmbiguousJSXLike="disallowAmbiguousJSXLike",TopLevelOptions_jsxPragmaFrag="jsxPragmaFrag",TopLevelOptions_optimizeConstEnums="optimizeConstEnums",TopLevelOptions_rewriteImportExtensions="rewriteImportExtensions",TopLevelOptions_allExtensions="allExtensions",TopLevelOptions_isTSX="isTSX",jsxPragmaFrag=v.validateStringOption(TopLevelOptions_jsxPragmaFrag,options.jsxPragmaFrag,"React.Fragment");var allExtensions=v.validateBooleanOption(TopLevelOptions_allExtensions,options.allExtensions,!1),isTSX=v.validateBooleanOption(TopLevelOptions_isTSX,options.isTSX,!1);isTSX&&v.invariant(allExtensions,"isTSX:true requires allExtensions:true");const ignoreExtensions=v.validateBooleanOption(TopLevelOptions_ignoreExtensions,options.ignoreExtensions,!1),disallowAmbiguousJSXLike=v.validateBooleanOption(TopLevelOptions_disallowAmbiguousJSXLike,options.disallowAmbiguousJSXLike,!1);disallowAmbiguousJSXLike&&v.invariant(allExtensions,"disallowAmbiguousJSXLike:true requires allExtensions:true");const normalized={ignoreExtensions,allowNamespaces,disallowAmbiguousJSXLike,jsxPragma,jsxPragmaFrag,onlyRemoveTypeImports,optimizeConstEnums:v.validateBooleanOption(TopLevelOptions_optimizeConstEnums,options.optimizeConstEnums,!1),rewriteImportExtensions:v.validateBooleanOption(TopLevelOptions_rewriteImportExtensions,options.rewriteImportExtensions,!1)};return normalized.allExtensions=allExtensions,normalized.isTSX=isTSX,normalized}(opts),pluginOptions=disallowAmbiguousJSXLike=>({allowDeclareFields:opts.allowDeclareFields,allowNamespaces,disallowAmbiguousJSXLike,jsxPragma,jsxPragmaFrag,onlyRemoveTypeImports,optimizeConstEnums}),getPlugins=(isTSX,disallowAmbiguousJSXLike)=>[[transformTypeScript__default.default,Object.assign({isTSX},pluginOptions(disallowAmbiguousJSXLike))]];return{plugins:rewriteImportExtensions?[pluginRewriteTSImports]:[],overrides:allExtensions||ignoreExtensions?[{plugins:getPlugins(isTSX,disallowAmbiguousJSXLike)}]:[{test:/\.ts$/,plugins:getPlugins(!1,!1)},{test:/\.mts$/,sourceType:"module",plugins:getPlugins(!1,!0)},{test:/\.cts$/,sourceType:"unambiguous",plugins:[[transformModulesCommonJS__default.default,{allowTopLevelThis:!0}],[transformTypeScript__default.default,pluginOptions(!0)]]},{test:/\.tsx$/,plugins:getPlugins(!0,!1)}]}}));exports.default=index},"./node_modules/.pnpm/@babel+template@7.25.9/node_modules/@babel/tem Line truncated
(function (${key}) {
function ${id}(${params}) {
return ${cloneNode(key)}.apply(this, arguments);
}
${cloneNode(id)}.toString = function () {
return ${cloneNode(key)}.toString();
}
return ${cloneNode(id)};
})(${toExpression(this.node)})
`;return this.replaceWith(call)[0].get("arguments.0")},exports.splitExportDeclaration=function(){if(!this.isExportDeclaration()||this.isExportAllDeclaration())throw new Error("Only default and named export declarations can be split.");if(this.isExportNamedDeclaration()&&this.get("specifiers").length>0)throw new Error("It doesn't make sense to split exported specifiers.");const declaration=this.get("declaration");if(this.isExportDefaultDeclaration()){const standaloneDeclaration=declaration.isFunctionDeclaration()||declaration.isClassDeclaration(),exportExpr=declaration.isFunctionExpression()||declaration.isClassExpression(),scope=declaration.isScope()?declaration.scope.parent:declaration.scope;let id=declaration.node.id,needBindingRegistration=!1;id?exportExpr&&scope.hasBinding(id.name)&&(needBindingRegistration=!0,id=scope.generateUidIdentifier(id.name)):(needBindingRegistration=!0,id=scope.generateUidIdentifier("default"),(standaloneDeclaration||exportExpr)&&(declaration.node.id=cloneNode(id)));const updatedDeclaration=standaloneDeclaration?declaration.node:variableDeclaration("var",[variableDeclarator(cloneNode(id),declaration.node)]),updatedExportDeclaration=exportNamedDeclaration(null,[exportSpecifier(cloneNode(id),identifier("default"))]);return this.insertAfter(updatedExportDeclaration),this.replaceWith(updatedDeclaration),needBindingRegistration&&scope.registerDeclaration(this),this}if(this.get("specifiers").length>0)throw new Error("It doesn't make sense to split exported specifiers.");const bindingIdentifiers=declaration.getOuterBindingIdentifiers(),specifiers=Object.keys(bindingIdentifiers).map((name=>exportSpecifier(identifier(name),identifier(name)))),aliasDeclar=exportNamedDeclaration(null,specifiers);return this.insertAfter(aliasDeclar),this.replaceWith(declaration.node),this},exports.toComputedKey=function(){let key;if(this.isMemberExpression())key=this.node.property;else{if(!this.isProperty()&&!this.isMethod())throw new ReferenceError("todo");key=this.node.key}this.node.computed||isIdentifier(key)&&(key=stringLiteral(key.name));return key},exports.unwrapFunctionEnvironment=function(){if(!this.isArrowFunctionExpression()&&!this.isFunctionExpression()&&!this.isFunctionDeclaration())throw this.buildCodeFrameError("Can only unwrap the environment of a function.");hoistFunctionEnvironment(this)};var _t=__webpack_require__("./node_modules/.pnpm/@babel+types@7.26.3/node_modules/@babel/types/lib/index.js"),_template=__webpack_require__("./node_modules/.pnpm/@babel+template@7.25.9/node_modules/@babel/template/lib/index.js"),_visitors=__webpack_require__("./node_modules/.pnpm/@babel+traverse@7.26.4/node_modules/@babel/traverse/lib/visitors.js"),_context=__webpack_require__("./node_modules/.pnpm/@babel+traverse@7.26.4/node_modules/@babel/traverse/lib/path/context.js");const{arrowFunctionExpression,assignmentExpression,binaryExpression,blockStatement,callExpression,conditionalExpression,expressionStatement,identifier,isIdentifier,jsxIdentifier,logicalExpression,LOGICAL_OPERATORS,memberExpression,metaProperty,numericLiteral,objectExpression,restElement,returnStatement,sequenceExpression,spreadElement,stringLiteral,super:_super,thisExpression,toExpression,unaryExpression,toBindingIdentifierName,isFunction,isAssignmentPattern,isRestElement,getFunctionName,cloneNode,variableDeclaration,variableDeclarator,exportNamedDeclaration,exportSpecifier,inherits}=_t;exports.arrowFunctionToShadowed=function(){this.isArrowFunctionExpression()&&this.arrowFunctionToExpression()};const getSuperCallsVisitor=(0,_visitors.environmentVisitor)({CallExpression(child,{allSuperCalls}){child.get("callee").isSuper()&&allSuperCalls.push(child)}});function hoistFunctionEnvironment(fnPath,noNewArrows=!0,allowInsertArrow=!0,allowInsertArrowWithRest=!0){let arrowParent,thisEnvFn=fnPath.findParent((p=>p.isArrowFunctionExpression()?(null!=arrowParent||(arrowParent=p),!1):p.isFunction()||p.isProgram()||p.isClassProperty({static:!1})||p.isClassPrivateProperty({static:!1})));const inConstructor=thisEnvFn.isClassMethod({kind:"constructor"});if(thisEnvFn.isClassProperty()||thisEnvFn.isClassPrivateProperty())if(arrowParent)thisEnvFn=arrowParent;else{if(!allowInsertArrow)throw fnPath.buildCodeFrameError("Unable to transform arrow inside class property");fnPath.replaceWith(callExpression(arrowFunctionExpression([],toExpression(fnPath.node)),[])),thisEnvFn=fnPath.get("callee"),fnPath=thisEnvFn.get("body")}const{thisPaths,argumentsPaths,newTargetPaths,superProps,superCalls}=function(fnPath){const thisPaths=[],argumentsPaths=[],newTargetPaths=[],superProps=[],superCalls=[];return fnPath.traverse(getScopeInformationVisitor,{thisPaths,argumentsPaths,newTargetPaths,superProps,superCalls}),{thisPaths,argumentsPaths,newTargetPaths,superProps,superCalls}}(fnPath);if(inConstructor&&superCalls.length>0){if(!allowInsertArrow)throw superCalls[0].buildCodeFrameError("When using '@babel/plugin-transform-arrow-functions', it's not possible to compile `super()`Line truncated
+20
View File
@@ -0,0 +1,20 @@
import { Module } from "module";
import { TransformOptions, JITIOptions, JITIImportOptions } from "./types";
export type { JITIOptions, TransformOptions } from "./types";
type Require = typeof require;
type Module = typeof module;
type ModuleCache = Record<string, Module>;
export type EvalModuleOptions = Partial<{
id: string;
filename: string;
ext: string;
cache: ModuleCache;
}>;
export interface JITI extends Require {
transform: (opts: TransformOptions) => string;
register: () => () => void;
evalModule: (source: string, options?: EvalModuleOptions) => unknown;
/** @experimental Behavior of `jiti.import` might change in the future. */
import: (id: string, importOptions: JITIImportOptions) => Promise<unknown>;
}
export default function createJITI(_filename: string, opts?: JITIOptions, parentModule?: Module, parentCache?: ModuleCache): JITI;
+1
View File
@@ -0,0 +1 @@
(()=>{var __webpack_modules__={"./node_modules/.pnpm/create-require@1.1.1/node_modules/create-require/create-require.js":(module,__unused_webpack_exports,__webpack_require__)=>{const nativeModule=__webpack_require__("module"),path=__webpack_require__("path"),fs=__webpack_require__("fs");module.exports=function(filename){return filename||(filename=process.cwd()),function(path){try{return fs.lstatSync(path).isDirectory()}catch(e){return!1}}(filename)&&(filename=path.join(filename,"index.js")),nativeModule.createRequire?nativeModule.createRequire(filename):nativeModule.createRequireFromPath?nativeModule.createRequireFromPath(filename):function(filename){const mod=new nativeModule.Module(filename,null);return mod.filename=filename,mod.paths=nativeModule.Module._nodeModulePaths(path.dirname(filename)),mod._compile("module.exports = require;",filename),mod.exports}(filename)}},"./node_modules/.pnpm/mlly@1.7.3/node_modules/mlly/dist lazy recursive":module=>{function webpackEmptyAsyncContext(req){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+req+"'");throw e.code="MODULE_NOT_FOUND",e}))}webpackEmptyAsyncContext.keys=()=>[],webpackEmptyAsyncContext.resolve=webpackEmptyAsyncContext,webpackEmptyAsyncContext.id="./node_modules/.pnpm/mlly@1.7.3/node_modules/mlly/dist lazy recursive",module.exports=webpackEmptyAsyncContext},"./node_modules/.pnpm/object-hash@3.0.0/node_modules/object-hash/index.js":(module,exports,__webpack_require__)=>{"use strict";var crypto=__webpack_require__("crypto");function objectHash(object,options){return function(object,options){var hashingStream;hashingStream="passthrough"!==options.algorithm?crypto.createHash(options.algorithm):new PassThrough;void 0===hashingStream.write&&(hashingStream.write=hashingStream.update,hashingStream.end=hashingStream.update);var hasher=typeHasher(options,hashingStream);hasher.dispatch(object),hashingStream.update||hashingStream.end("");if(hashingStream.digest)return hashingStream.digest("buffer"===options.encoding?void 0:options.encoding);var buf=hashingStream.read();if("buffer"===options.encoding)return buf;return buf.toString(options.encoding)}(object,options=applyDefaults(object,options))}(exports=module.exports=objectHash).sha1=function(object){return objectHash(object)},exports.keys=function(object){return objectHash(object,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},exports.MD5=function(object){return objectHash(object,{algorithm:"md5",encoding:"hex"})},exports.keysMD5=function(object){return objectHash(object,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var hashes=crypto.getHashes?crypto.getHashes().slice():["sha1","md5"];hashes.push("passthrough");var encodings=["buffer","hex","binary","base64"];function applyDefaults(object,sourceOptions){sourceOptions=sourceOptions||{};var options={};if(options.algorithm=sourceOptions.algorithm||"sha1",options.encoding=sourceOptions.encoding||"hex",options.excludeValues=!!sourceOptions.excludeValues,options.algorithm=options.algorithm.toLowerCase(),options.encoding=options.encoding.toLowerCase(),options.ignoreUnknown=!0===sourceOptions.ignoreUnknown,options.respectType=!1!==sourceOptions.respectType,options.respectFunctionNames=!1!==sourceOptions.respectFunctionNames,options.respectFunctionProperties=!1!==sourceOptions.respectFunctionProperties,options.unorderedArrays=!0===sourceOptions.unorderedArrays,options.unorderedSets=!1!==sourceOptions.unorderedSets,options.unorderedObjects=!1!==sourceOptions.unorderedObjects,options.replacer=sourceOptions.replacer||void 0,options.excludeKeys=sourceOptions.excludeKeys||void 0,void 0===object)throw new Error("Object argument required.");for(var i=0;i<hashes.length;++i)hashes[i].toLowerCase()===options.algorithm.toLowerCase()&&(options.algorithm=hashes[i]);if(-1===hashes.indexOf(options.algorithm))throw new Error('Algorithm "'+options.algorithm+'" not supported. supported values: '+hashes.join(", "));if(-1===encodings.indexOf(options.encoding)&&"passthrough"!==options.algorithm)throw new Error('Encoding "'+options.encoding+'" not supported. supported values: '+encodings.join(", "));return options}function isNativeFunction(f){if("function"!=typeof f)return!1;return null!=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(f))}function typeHasher(options,writeTo,context){context=context||[];var write=function(str){return writeTo.update?writeTo.update(str,"utf8"):writeTo.write(str,"utf8")};return{dispatch:function(value){options.replacer&&(value=options.replacer(value));var type=typeof value;return null===value&&(type="null"),this["_"+type](value)},_object:function(object){var objString=Object.prototype.toString.call(object),objType=/\[object (.*)\]/i.exec(objString);objType=(objType=objType?objType[1]:"unknown:["+objString+"]").toLowerCase();var objectNumber;if((objectNumber=context.indexOf(object))>=0)return this.dispatch("[CIRCULAR:"+objectNumber+"]");if(context.push(object),"undefined"!=typeofLine truncated
@@ -0,0 +1,4 @@
import type { PluginObj } from "@babel/core";
export declare function TransformImportMetaPlugin(_ctx: any, opts: {
filename?: string;
}): PluginObj;
+5
View File
@@ -0,0 +1,5 @@
/**
* Forked from https://github.com/iendeavor/import-meta-env/tree/main/packages/babel 0.4.2 (MIT License - Copyright (c) 2021 Ernest)
*/
import type { PluginObj } from "@babel/core";
export declare function importMetaEnvPlugin({ template, types }: any): PluginObj;
+35
View File
@@ -0,0 +1,35 @@
export type TransformOptions = {
source: string;
filename?: string;
ts?: boolean;
retainLines?: boolean;
legacy?: boolean;
[key: string]: any;
};
export type TRANSFORM_RESULT = {
code: string;
error?: any;
};
export type JITIOptions = {
transform?: (opts: TransformOptions) => TRANSFORM_RESULT;
debug?: boolean;
cache?: boolean | string;
sourceMaps?: boolean;
requireCache?: boolean;
v8cache?: boolean;
interopDefault?: boolean;
esmResolve?: boolean;
cacheVersion?: string;
onError?: (error: Error) => void;
legacy?: boolean;
extensions?: string[];
transformOptions?: Omit<TransformOptions, "source">;
alias?: Record<string, string>;
nativeModules?: string[];
transformModules?: string[];
experimentalBun?: boolean;
};
export interface JITIImportOptions {
/** @internal */
_import?: () => Promise<any>;
}
+8
View File
@@ -0,0 +1,8 @@
import type { PackageJson } from "pkg-types";
export declare function getCacheDir(): string;
export declare function isDir(filename: string): boolean;
export declare function isWritable(filename: string): boolean;
export declare function md5(content: string, len?: number): string;
export declare function detectLegacySyntax(code: string): RegExpMatchArray | null;
export declare function isObject(val: any): boolean;
export declare function readNearestPackageJSON(path: string): PackageJson | undefined;
+15
View File
@@ -0,0 +1,15 @@
function onError(err) {
throw err; /* ↓ Check stack trace ↓ */
}
module.exports = function jiti(filename, opts) {
const jiti = require("../dist/jiti");
opts = { onError, ...opts };
if (!opts.transform) {
opts.transform = require("../dist/babel");
}
return jiti(filename, opts);
};
+81
View File
@@ -0,0 +1,81 @@
{
"name": "jiti",
"version": "1.21.7",
"description": "Runtime typescript and ESM support for Node.js",
"repository": "unjs/jiti",
"license": "MIT",
"main": "./lib/index.js",
"types": "dist/jiti.d.ts",
"bin": "bin/jiti.js",
"files": [
"lib",
"dist",
"register.js"
],
"scripts": {
"build": "pnpm clean && NODE_ENV=production pnpm webpack",
"clean": "rm -rf dist",
"dev": "pnpm clean && pnpm webpack --watch",
"jiti": "JITI_DEBUG=1 JITI_CACHE=false JITI_REQUIRE_CACHE=false ./bin/jiti.js",
"jiti:legacy": "JITI_DEBUG=1 npx node@12 ./bin/jiti.js",
"lint": "eslint . && prettier -c src lib test stubs",
"lint:fix": "eslint --fix . && prettier -w src lib test stubs",
"release": "pnpm build && pnpm test && changelogen --release --push && npm publish --tag 1x",
"test": "pnpm lint && vitest run --coverage && pnpm test:bun",
"test:bun": "bun --bun test test/bun"
},
"devDependencies": {
"@babel/core": "^7.26.0",
"@babel/plugin-proposal-decorators": "^7.25.9",
"@babel/plugin-syntax-class-properties": "^7.12.13",
"@babel/plugin-syntax-import-assertions": "^7.26.0",
"@babel/plugin-transform-export-namespace-from": "^7.25.9",
"@babel/plugin-transform-modules-commonjs": "^7.26.3",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.25.9",
"@babel/plugin-transform-optional-chaining": "^7.25.9",
"@babel/plugin-transform-typescript": "^7.26.3",
"@babel/preset-typescript": "^7.26.0",
"@babel/template": "^7.25.9",
"@babel/types": "^7.26.3",
"@types/babel__core": "^7.20.5",
"@types/babel__template": "^7.4.4",
"@types/node": "^22.10.2",
"@types/object-hash": "^3.0.6",
"@types/resolve": "^1.20.6",
"@types/semver": "^7.5.8",
"@vitest/coverage-v8": "^2.1.8",
"acorn": "^8.14.0",
"babel-plugin-dynamic-import-node": "^2.3.3",
"babel-plugin-parameter-decorator": "^1.0.16",
"babel-plugin-transform-typescript-metadata": "^0.3.2",
"changelogen": "^0.5.7",
"config": "^3.3.12",
"create-require": "^1.1.1",
"destr": "^2.0.3",
"escape-string-regexp": "^5.0.0",
"eslint": "^9.17.0",
"eslint-config-unjs": "^0.4.2",
"esm": "^3.2.25",
"estree-walker": "^3.0.3",
"execa": "^9.5.2",
"fast-glob": "^3.3.2",
"mlly": "^1.7.3",
"object-hash": "^3.0.0",
"pathe": "^1.1.2",
"pirates": "^4.0.6",
"pkg-types": "^1.2.1",
"prettier": "^3.4.2",
"reflect-metadata": "^0.2.2",
"semver": "^7.6.3",
"std-env": "^3.8.0",
"terser-webpack-plugin": "^5.3.11",
"ts-loader": "^9.5.1",
"tslib": "^2.8.1",
"typescript": "^5.7.2",
"vite": "^6.0.3",
"vitest": "^2.1.8",
"webpack": "^5.97.1",
"webpack-cli": "^5.1.4"
},
"packageManager": "pnpm@9.15.0"
}
+3
View File
@@ -0,0 +1,3 @@
const jiti = require(".")();
jiti.register();