"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=default_1;const tslib_1=require("tslib"),path_1=tslib_1.__importDefault(require("path")),pluginconfig_1=require("../pluginconfig"),babel_script_task_1=require("./script_task/babel_script_task");function default_1(t){return{name:"summer-typescript",resolveExt:{js:"ts"},workerMethods:{async doLoad(t,e,s){const r={sourceCode:t,inputMap:s};return await(0,babel_script_task_1.babelTransformTS)(r,e)}},async load(e,s){if(!(0,pluginconfig_1.couldUseSWCMode)(t.setting)&&s.endsWith(".ts")){const r=Date.now(),a=path_1.default.relative(t.projectPath,s),i=t.getFile("",a).toString(),o=t.stat("",a),n=await this.runWorkerMethod("doLoad",i,s);return{targetPath:e,source:Object.assign(Object.assign({},n),{mtime:null==o?void 0:o.mtimeMs}),process:[{cost:Date.now()-r,pluginName:"summer-typescript",action:"load"}]}}}}}