15 lines
53 KiB
JavaScript
15 lines
53 KiB
JavaScript
|
|
"use strict";var Kt=Object.defineProperty;var h=(s,e)=>Kt(s,"name",{value:e,configurable:!0});var q=require("node:path"),Te=require("node:url"),J=require("esbuild"),Yt=require("node:crypto"),Fe=require("./node-features-CQLdkVE6.cjs"),j=require("node:fs"),Qt=require("node:os"),Zt=require("./temporary-directory-B83uKxJF.cjs");const Ce=h(s=>Yt.createHash("sha1").update(s).digest("hex"),"sha1");var Vt=44,er=59,Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",We=new Uint8Array(64),tr=new Uint8Array(128);for(let s=0;s<Be.length;s++){const e=Be.charCodeAt(s);We[s]=e,tr[e]=s}function Q(s,e,r){let i=e-r;i=i<0?-i<<1|1:i<<1;do{let o=i&31;i>>>=5,i>0&&(o|=32),s.write(We[o])}while(i>0);return e}h(Q,"encodeInteger$1");var Pe=1024*16,qe=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(s){return Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString()}}:{decode(s){let e="";for(let r=0;r<s.length;r++)e+=String.fromCharCode(s[r]);return e}},rr=class{static{h(this,"StringWriter")}constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(Pe)}write(s){const{buffer:e}=this;e[this.pos++]=s,this.pos===Pe&&(this.out+=qe.decode(e),this.pos=0)}flush(){const{buffer:s,out:e,pos:r}=this;return r>0?e+qe.decode(s.subarray(0,r)):e}};function nr(s){const e=new rr;let r=0,i=0,o=0,c=0;for(let u=0;u<s.length;u++){const p=s[u];if(u>0&&e.write(er),p.length===0)continue;let g=0;for(let b=0;b<p.length;b++){const d=p[b];b>0&&e.write(Vt),g=Q(e,d[0],g),d.length!==1&&(r=Q(e,d[1],r),i=Q(e,d[2],i),o=Q(e,d[3],o),d.length!==4&&(c=Q(e,d[4],c)))}}return e.flush()}h(nr,"encode$1");class le{static{h(this,"BitSet")}constructor(e){this.bits=e instanceof le?e.bits.slice():[]}add(e){this.bits[e>>5]|=1<<(e&31)}has(e){return!!(this.bits[e>>5]&1<<(e&31))}}class ne{static{h(this,"Chunk")}constructor(e,r,i){this.start=e,this.end=r,this.original=i,this.intro="",this.outro="",this.content=i,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(e){this.outro+=e}appendRight(e){this.intro=this.intro+e}clone(){const e=new ne(this.start,this.end,this.original);return e.intro=this.intro,e.outro=this.outro,e.content=this.content,e.storeName=this.storeName,e.edited=this.edited,e}contains(e){return this.start<e&&e<this.end}eachNext(e){let r=this;for(;r;)e(r),r=r.next}eachPrevious(e){let r=this;for(;r;)e(r),r=r.previous}edit(e,r,i){return this.content=e,i||(this.intro="",this.outro=""),this.storeName=r,this.edited=!0,this}prependLeft(e){this.outro=e+this.outro}prependRight(e){this.intro=e+this.intro}reset(){this.intro="",this.outro="",this.edited&&(this.content=this.original,this.storeName=!1,this.edited=!1)}split(e){const r=e-this.start,i=this.original.slice(0,r),o=this.original.slice(r);this.original=i;const c=new ne(e,this.end,o);return c.outro=this.outro,this.outro="",this.end=e,this.edited?(c.edit("",!1),this.content=""):this.content=i,c.next=this.next,c.next&&(c.next.previous=c),c.previous=this,this.next=c,c}toString(){return this.intro+this.content+this.outro}trimEnd(e){if(this.outro=this.outro.replace(e,""),this.outro.length)return!0;const r=this.content.replace(e,"");if(r.length)return r!==this.content&&(this.split(this.start+r.length).edit("",void 0,!0),this.edited&&this.edit(r,this.storeName,!0)),!0;if(this.edit("",void 0,!0),this.intro=this.intro.replace(e,""),this.intro.length)return!0}trimStart(e){if(this.intro=this.intro.replace(e,""),this.intro.length)return!0;const r=this.content.replace(e,"");if(r.length){if(r!==this.content){const i=this.split(this.end-r.length);this.edited&&i.edit(r,this.storeName,!0),this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(e,""),this.outro.length)return!0}}function ir(){return typeof globalThis<"u"&&typeof globalThis.btoa=="function"?s=>globalThis.btoa(unescape(encodeURIComponent(s))):typeof Buffer=="function"?s=>Buffer.from(s,"utf-8").toString("base64"):()=>{throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}h(ir,"getBtoa");const sr=ir();let or=class{static{h(this,"SourceMap")}constructor(e){t
|
||
|
|
`),r=e.filter(c=>/^\t+/.test(c)),i=e.filter(c=>/^ {2,}/.test(c));if(r.length===0&&i.length===0)return null;if(r.length>=i.length)return" ";const o=i.reduce((c,u)=>{const p=/^ +/.exec(u)[0].length;return Math.min(p,c)},1/0);return new Array(o+1).join(" ")}h(ar,"guessIndent");function cr(s,e){const r=s.split(/[/\\]/),i=e.split(/[/\\]/);for(r.pop();r[0]===i[0];)r.shift(),i.shift();if(r.length){let o=r.length;for(;o--;)r[o]=".."}return r.concat(i).join("/")}h(cr,"getRelativePath");const ur=Object.prototype.toString;function lr(s){return ur.call(s)==="[object Object]"}h(lr,"isObject");function Je(s){const e=s.split(`
|
||
|
|
`),r=[];for(let i=0,o=0;i<e.length;i++)r.push(o),o+=e[i].length+1;return h(function(o){let c=0,u=r.length;for(;c<u;){const b=c+u>>1;o<r[b]?u=b:c=b+1}const p=c-1,g=o-r[p];return{line:p,column:g}},"locate")}h(Je,"getLocator");const fr=/\w/;class hr{static{h(this,"Mappings")}constructor(e){this.hires=e,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(e,r,i,o){if(r.length){const c=r.length-1;let u=r.indexOf(`
|
||
|
|
`,0),p=-1;for(;u>=0&&c>u;){const b=[this.generatedCodeColumn,e,i.line,i.column];o>=0&&b.push(o),this.rawSegments.push(b),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,p=u,u=r.indexOf(`
|
||
|
|
`,u+1)}const g=[this.generatedCodeColumn,e,i.line,i.column];o>=0&&g.push(o),this.rawSegments.push(g),this.advance(r.slice(p+1))}else this.pending&&(this.rawSegments.push(this.pending),this.advance(r));this.pending=null}addUneditedChunk(e,r,i,o,c){let u=r.start,p=!0,g=!1;for(;u<r.end;){if(i[u]===`
|
||
|
|
`)o.line+=1,o.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,p=!0,g=!1;else{if(this.hires||p||c.has(u)){const b=[this.generatedCodeColumn,e,o.line,o.column];this.hires==="boundary"?fr.test(i[u])?g||(this.rawSegments.push(b),g=!0):(this.rawSegments.push(b),g=!1):this.rawSegments.push(b)}o.column+=1,this.generatedCodeColumn+=1,p=!1}u+=1}this.pending=null}advance(e){if(!e)return;const r=e.split(`
|
||
|
|
`);if(r.length>1){for(let i=0;i<r.length-1;i++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=r[r.length-1].length}}const Z=`
|
||
|
|
`,G={insertLeft:!1,insertRight:!1,storeName:!1};class Me{static{h(this,"MagicString")}constructor(e,r={}){const i=new ne(0,e.length,e);Object.defineProperties(this,{original:{writable:!0,value:e},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:i},lastChunk:{writable:!0,value:i},lastSearchedChunk:{writable:!0,value:i},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:r.filename},indentExclusionRanges:{writable:!0,value:r.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new le},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:r.ignoreList},offset:{writable:!0,value:r.offset||0}}),this.byStart[0]=i,this.byEnd[e.length]=i}addSourcemapLocation(e){this.sourcemapLocations.add(e)}append(e){if(typeof e!="string")throw new TypeError("outro content must be a string");return this.outro+=e,this}appendLeft(e,r){if(e=e+this.offset,typeof r!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];return i?i.appendLeft(r):this.intro+=r,this}appendRight(e,r){if(e=e+this.offset,typeof r!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];return i?i.appendRight(r):this.outro+=r,this}clone(){const e=new Me(this.original,{filename:this.filename,offset:this.offset});let r=this.firstChunk,i=e.firstChunk=e.lastSearchedChunk=r.clone();for(;r;){e.byStart[i.start]=i,e.byEnd[i.end]=i;const o=r.next,c=o&&o.clone();c&&(i.next=c,c.previous=i,i=c),r=o}return e.lastChunk=i,this.indentExclusionRanges&&(e.indentExclusionRanges=this.indentExclusionRanges.slice()),e.sourcemapLocations=new le(this.sourcemapLocations),e.intro=this.intro,e.outro=this.outro,e}generateDecodedMap(e){e=e||{};const r=0,i=Object.keys(this.storedNames),o=new hr(e.hires),c=Je(this.original);return this.intro&&o.advance(this.intro),this.firstChunk.eachNext(u=>{const p=c(u.start);u.intro.length&&o.advance(u.intro),u.edited?o.addEdit(r,u.content,p,u.storeName?i.indexOf(u.original):-1):o.addUneditedChunk(r,u,this.original,p,this.sourcemapLocations),u.outro.length&&o.advance(u.outro)}),{file:e.file?e.file.split(/[/\\]/).pop():void 0,sources:[e.source?cr(e.file||"",e.source):e.file||""],sourcesContent:e.includeContent?[this.original]:void 0,names:i,mappings:o.raw,x_google_ignoreList:this.ignoreList?[r]:void 0}}generateMap(e){return new or(this.generateDecodedMap(e))}_ensureindentStr(){this.indentStr===void 0&&(this.indentStr=ar(this.original))}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?" ":this.indentStr}indent(e,r){const i=/^[^\r\n]/gm;if(lr(e)&&(r=e,e=void 0),e===void 0&&(this._ensureindentStr(),e=this.indentStr||" "),e==="")return this;r=r||{};const o={};r.exclude&&(typeof r.exclude[0]=="number"?[r.exclude]:r.exclude).forEach(d=>{for(let n=d[0];n<d[1];n+=1)o[n]=!0});let c=r.indentStart!==!1;const u=h(b=>c?`${e}${b}`:(c=!0,b),"replacer");this.intro=this.intro.replace(i,u);let p=0,g=this.firstChunk;for(;g;){const b=g.end;if(g.edited)o[p]||(g.content=g.content.replace(i,u),g.content.length&&(c=g.content[g.content.length-1]===`
|
||
|
|
`));else for(p=g.start;p<b;){if(!o[p]){const d=this.original[p];d===`
|
||
|
|
`?c=!0:d!=="\r"&&c&&(c=!1,p===g.start||(this._splitChunk(g,p),g=g.next),g.prependRight(e))}p+=1}p=g.end,g=g.next}return this.outro=this.outro.replace(i,u),this}insert(){throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(e,r){return G.insertLeft||(console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),G.insertLeft=!0),this.appendLeft(e,r)}insertRight(e,r){return G.insertRight||(console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),G.insertRight=!0),this.prependRight(e,r)}move(e,r,i){if(e=e+this.offset,r=r+this.offset,i=i+this.offset,i>=e&&i<=r)throw new Error("Cannot move a selection inside itself");this._split(e),this._split(r),this._split(i);const o=this.byStart[e],c=this.byEnd[r],u=o.previous,p=c.next,g=this.byStart[i];if(!g&&c===this.lastChunk)return this;const b=g?g.previous:this.lastChunk;return u&&(u.next=p),p&&(p.previous=u),b&&(b.next=o),g&&(g.previous=c),o.previous||(this.firstChunk=c.next),c.next||(this.lastChunk=o.previous,this.lastChunk.next=null),o.previous=b,c.next=g||null,b||(this.firstChunk=o),g||(this.lastChunk=c),this}overwrite(e,r,i,o){return o=o||{},this.update(e,r,i,{...o,overwrite:!o.contentOnly})}update(e,r,i,o){if(e=e+this.offset,r=r+this.offset,typeof i!="string")throw new TypeError("replacement content must be a string");if(this.original.length!==0){for(;e<0;)e+=this.original.length;for(;r<0;)r+=this.original.length}if(r>this.original.length)throw new Error("end is out of bounds");if(e===r)throw new Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");this._split(e),this._split(r),o===!0&&(G.storeName||(console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),G.storeName=!0),o={storeName:!0});const c=o!==void 0?o.storeName:!1,u=o!==void 0?o.overwrite:!1;if(c){const b=this.original.slice(e,r);Object.defineProperty(this.storedNames,b,{writable:!0,value:!0,enumerable:!0})}const p=this.byStart[e],g=this.byEnd[r];if(p){let b=p;for(;b!==g;){if(b.next!==this.byStart[b.end])throw new Error("Cannot overwrite across a split point");b=b.next,b.edit("",!1)}p.edit(i,c,!u)}else{const b=new ne(e,r,"").edit(i,c);g.next=b,b.previous=g}return this}prepend(e){if(typeof e!="string")throw new TypeError("outro content must be a string");return this.intro=e+this.intro,this}prependLeft(e,r){if(e=e+this.offset,typeof r!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byEnd[e];return i?i.prependLeft(r):this.intro=r+this.intro,this}prependRight(e,r){if(e=e+this.offset,typeof r!="string")throw new TypeError("inserted content must be a string");this._split(e);const i=this.byStart[e];return i?i.prependRight(r):this.outro=r+this.outro,this}remove(e,r){if(e=e+this.offset,r=r+this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;r<0;)r+=this.original.length}if(e===r)return this;if(e<0||r>this.original.length)throw new Error("Character is out of bounds");if(e>r)throw new Error("end must be greater than start");this._split(e),this._split(r);let i=this.byStart[e];for(;i;)i.intro="",i.outro="",i.edit(""),i=r>i.end?this.byStart[i.end]:null;return this}reset(e,r){if(e=e+this.offset,r=r+this.offset,this.original.length!==0){for(;e<0;)e+=this.original.length;for(;r<0;)r+=this.original.length}if(e===r)return this;if(e<0||r>this.original.length)throw new Error("Character is out of bounds");if(e>r)throw new Error("end must be greater than start");this._split(e),this._split(r);let i=this.byStart[e];for(;i;)i.reset(),i=r>i.end?this.byStart[i.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let e=this.lastChunk;do{if(e.outro.length)return e.outro[e.outro.length-1];if(e.content.length)return e.content[e.content.length-1];if(e.intro.length)return e.intro[e.intro.length-1]}while(e=e.previous);return this.intro.length?this.intro[this.intro.length-1]:""}lastLine(){
|
||
|
|
`;case 114:return"\r";case 120:return String.fromCharCode(xe(2));case 117:return function(){const e=_.charCodeAt(y);let r;return e===123?(++y,r=xe(_.indexOf("}",y)-y),++y,r>1114111&&D()):r=xe(4),r<=65535?String.fromCharCode(r):(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r)))}();case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:_.charCodeAt(y)===10&&++y;case 10:return"";case 56:case 57:D();default:if(s>=48&&s<=55){let e=_.substr(y-1,3).match(/^[0-7]+/)[0],r=parseInt(e,8);return r>255&&(e=e.slice(0,-1),r=parseInt(e,8)),y+=e.length-1,s=_.charCodeAt(y),e==="0"&&s!==56&&s!==57||D(),String.fromCharCode(r)}return He(s)?"":String.fromCharCode(s)}}h(br,"k");function xe(s){const e=y;let r=0,i=0;for(let o=0;o<s;++o,++y){let c,u=_.charCodeAt(y);if(u!==95){if(u>=97)c=u-97+10;else if(u>=65)c=u-65+10;else{if(!(u>=48&&u<=57))break;c=u-48}if(c>=16)break;i=u,r=16*r+c}else i!==95&&o!==0||D(),i=u}return i!==95&&y-e===s||D(),r}h(xe,"l");function He(s){return s===13||s===10}h(He,"u");function D(){throw Object.assign(Error(`Parse error ${ze}:${_.slice(0,y).split(`
|
||
|
|
`).length}:${y-_.lastIndexOf(`
|
||
|
|
`,y-1)}`),{idx:y})}h(D,"o");let Ee;typeof WebAssembly<"u"&&(async()=>{const{parse:s,init:e}=await Promise.resolve().then(function(){return require("./lexer-DgIbo0BU.cjs")});await e,Ee=s})();const _e=h((s,e)=>Ee?Ee(s,e):gr(s,e),"parseEsm"),pr=h(s=>{if(!s.includes("import")&&!s.includes("export"))return!1;try{return _e(s)[3]}catch{return!0}},"isESM"),Le="2",wr=(s=>{const e="default";return s[e]&&typeof s[e]=="object"&&"__esModule"in s[e]?s[e]:s}).toString(),mr=`.then(${wr})`,ae=h((s,e,r)=>{if(r){if(!e.includes("import("))return}else if(!e.includes("import"))return;const o=_e(e,s)[0].filter(g=>g.d>-1);if(o.length===0)return;const c=new Me(e);for(const g of o)c.appendRight(g.se,mr);const u=c.toString(),p=c.generateMap({source:s,includeContent:!1,hires:"boundary"});return{code:u,map:p}},"transformDynamicImport"),Xe=h(s=>{try{const e=j.readFileSync(s,"utf8");return JSON.parse(e)}catch{}},"readJsonFile"),Ke=h(()=>{},"noop"),Ye=h(()=>Math.floor(Date.now()/1e8),"getTime");class kr extends Map{static{h(this,"FileCache")}cacheDirectory=Zt.tmpdir;oldCacheDirectory=q.join(Qt.tmpdir(),"tsx");cacheFiles;constructor(){super(),j.mkdirSync(this.cacheDirectory,{recursive:!0}),this.cacheFiles=j.readdirSync(this.cacheDirectory).map(e=>{const[r,i]=e.split("-");return{time:Number(r),key:i,fileName:e}}),setImmediate(()=>{this.expireDiskCache(),this.removeOldCacheDirectory()})}get(e){const r=super.get(e);if(r)return r;const i=this.cacheFiles.find(u=>u.key===e);if(!i)return;const o=q.join(this.cacheDirectory,i.fileName),c=Xe(o);if(!c){j.promises.unlink(o).then(()=>{const u=this.cacheFiles.indexOf(i);this.cacheFiles.splice(u,1)},()=>{});return}return super.set(e,c),c}set(e,r){if(super.set(e,r),r){const i=Ye();j.promises.writeFile(q.join(this.cacheDirectory,`${i}-${e}`),JSON.stringify(r)).catch(Ke)}return this}expireDiskCache(){const e=Ye();for(const r of this.cacheFiles)e-r.time>7&&j.promises.unlink(q.join(this.cacheDirectory,r.fileName)).catch(Ke)}async removeOldCacheDirectory(){try{await j.promises.access(this.oldCacheDirectory).then(()=>!0)&&("rm"in j.promises?await j.promises.rm(this.oldCacheDirectory,{recursive:!0,force:!0}):await j.promises.rmdir(this.oldCacheDirectory,{recursive:!0}))}catch{}}}var z=process.env.TSX_DISABLE_CACHE?new Map:new kr;const Qe=44,yr=59,Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ve=new Uint8Array(64),et=new Uint8Array(128);for(let s=0;s<Ze.length;s++){const e=Ze.charCodeAt(s);Ve[s]=e,et[e]=s}const Oe=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(s){return Buffer.from(s.buffer,s.byteOffset,s.byteLength).toString()}}:{decode(s){let e="";for(let r=0;r<s.length;r++)e+=String.fromCharCode(s[r]);return e}};function Cr(s){const e=new Int32Array(5),r=[];let i=0;do{const o=Sr(s,i),c=[];let u=!0,p=0;e[0]=0;for(let g=i;g<o;g++){let b;g=ee(s,g,e,0);const d=e[0];d<p&&(u=!1),p=d,tt(s,g,o)?(g=ee(s,g,e,1),g=ee(s,g,e,2),g=ee(s,g,e,3),tt(s,g,o)?(g=ee(s,g,e,4),b=[d,e[1],e[2],e[3],e[4]]):b=[d,e[1],e[2],e[3]]):b=[d],c.push(b)}u||vr(c),r.push(c),i=o+1}while(i<=s.length);return r}h(Cr,"decode");function Sr(s,e){const r=s.indexOf(";",e);return r===-1?s.length:r}h(Sr,"indexOf");function ee(s,e,r,i){let o=0,c=0,u=0;do{const g=s.charCodeAt(e++);u=et[g],o|=(u&31)<<c,c+=5}while(u&32);const p=o&1;return o>>>=1,p&&(o=-2147483648|-o),r[i]+=o,e}h(ee,"decodeInteger");function tt(s,e,r){return e>=r?!1:s.charCodeAt(e)!==Qe}h(tt,"hasMoreVlq");function vr(s){s.sort(xr)}h(vr,"sort");function xr(s,e){return s[0]-e[0]}h(xr,"sortComparator$1");function Er(s){const e=new Int32Array(5),r=1024*16,i=r-36,o=new Uint8Array(r),c=o.subarray(0,i);let u=0,p="";for(let g=0;g<s.length;g++){const b=s[g];if(g>0&&(u===r&&(p+=Oe.decode(o),u=0),o[u++]=yr),b.length!==0){e[0]=0;for(let d=0;d<b.length;d++){const n=b[d];u>i&&(p+=Oe.decode(c),o.copyWithin(0,i,u),u-=i),d>0&&(o[u++]=Qe),u=te(o,u,e,n,0),n.length!==1&&(u=te(o,u,e,n,1),u=te(o,u,e,n,2),u=te(o,u,e,n,3),n.length!==4&&(u=te(o,u,e,n,4)))}}}return p+Oe.decode(o.subarray(0,u))}h(Er,"encode");function te(s,e,r,i,o){const c=i[o];let u=c-r[o];r[o]=c,u=u<0?-u<<1|1:u<<1;do{let p=u&3
|
||
|
|
Did you specify these with the most recent transformation maps first?`);let o=yt(i,e,"",0);for(let c=r.length-1;c>=0;c--)o=mt(r[c],[o]);return o}h(bn,"buildSourceMapTree");function yt(s,e,r,i){const{resolvedSources:o,sourcesContent:c,ignoreList:u}=s,p=i+1,g=o.map((b,d)=>{const n={importer:r,depth:p,source:b||"",content:void 0,ignore:void 0},A=e(n.source,n),{source:O,content:E,ignore:I}=n;if(A)return yt(new ut(A,O),e,O,p);const $=E!==void 0?E:c?c[d]:null,B=I!==void 0?I:u?u.includes(d):!1;return hn(O,$,B)});return mt(s,g)}h(yt,"build");class pn{static{h(this,"SourceMap")}constructor(e,r){const i=r.decodedMappings?dt(e):nn(e);this.version=i.version,this.file=i.file,this.mappings=i.mappings,this.names=i.names,this.ignoreList=i.ignoreList,this.sourceRoot=i.sourceRoot,this.sources=i.sources,r.excludeContent||(this.sourcesContent=i.sourcesContent)}toString(){return JSON.stringify(this)}}function Ct(s,e,r){const i={excludeContent:!!r,decodedMappings:!1},o=bn(s,e);return new pn(dn(o),i)}h(Ct,"remapping");const St=h((s,e,r)=>{const i=[],o={code:e};for(const c of r){const u=c(s,o.code);u&&(Object.assign(o,u),i.unshift(u.map))}return{...o,map:Ct(i,()=>null)}},"applyTransformersSync"),wn=h(async(s,e,r)=>{const i=[],o={code:e};for(const c of r){const u=await c(s,o.code);u&&(Object.assign(o,u),i.unshift(u.map))}return{...o,map:Ct(i,()=>null)}},"applyTransformers"),mn=Object.freeze({target:`node${process.versions.node}`,loader:"default"}),kn=/^--inspect(?:-brk|-port|-publish-uid|-wait)?(?:=|$)/,yn=process.execArgv.some(s=>kn.test(s)),Re={...mn,sourcemap:!0,sourcesContent:!!process.env.NODE_V8_COVERAGE||yn,minifyWhitespace:!0,keepNames:!0},Ie=h(s=>{const e=s.sourcefile;if(e){const r=q.extname(e.split("?")[0]);r?r===".cts"||r===".mts"?s.sourcefile=`${e.slice(0,-3)}ts`:r===".mjs"&&(s.sourcefile=`${e.slice(0,-3)}js`):s.sourcefile+=".js"}return r=>(r.map&&(s.sourcefile!==e&&(r.map=r.map.replace(JSON.stringify(s.sourcefile),JSON.stringify(e))),r.map=JSON.parse(r.map)),r)},"patchOptions"),Ne=h(s=>{throw s.name="TransformError",delete s.errors,delete s.warnings,s},"formatEsbuildError"),Cn=h((s,e)=>({...Fe.isFeatureSupported(Fe.importMetaPathProperties)?{dirname:q.dirname(s),filename:s}:{},url:e}),"getImportMeta"),Sn=h((s,e,r)=>{let i,o,c;if(e.startsWith("file://")){i=e;const n=new URL(e);o=Te.fileURLToPath(n)}else[o,c]=e.split("?"),i=Te.pathToFileURL(o)+(c?`?${c}`:"");const{cjsBanner:u,...p}=r??{},g={...Re,format:"cjs",sourcefile:o,banner:`__filename=${JSON.stringify(o)};(()=>{${u??""}`,footer:"})()",platform:"node",...p};s.includes("import.meta")&&g.format==="cjs"&&!o.endsWith(".cjs")&&!o.endsWith(".cts")&&(g.define={...g.define,"import.meta":JSON.stringify(Cn(o,i))});const b=Ce([s,i,JSON.stringify(g),J.version,Le].join("-"));let d=z.get(b);return d||(d=St(e,s,[(n,A)=>{const O=Ie(g);let E;try{E=J.transformSync(A,g)}catch(I){throw Ne(I)}return O(E)},(n,A)=>ae(n,A,!0)]),z.set(b,d)),d},"transformSync"),vn=h(async(s,e,r)=>{const i={...Re,format:"esm",sourcefile:e,...r},o=Ce([s,JSON.stringify(i),J.version,Le].join("-"));let c=z.get(o);return c||(c=await wn(e,s,[async(u,p)=>{const g=Ie(i);let b;try{b=await J.transform(p,i)}catch(d){throw Ne(d)}return g(b)},(u,p)=>ae(u,p,!0)]),z.set(o,c)),c},"transform"),xn=h((s,e,r)=>{const i={...Re,format:"esm",sourcefile:e,...r},o=Ce([s,JSON.stringify(i),J.version,Le].join("-"));let c=z.get(o);return c||(c=St(e,s,[(u,p)=>{const g=Ie(i);let b;try{b=J.transformSync(p,i)}catch(d){throw Ne(d)}return g(b)},(u,p)=>ae(u,p,!0)]),z.set(o,c)),c},"transformEsmSync");exports.isESM=pr,exports.parseEsm=_e,exports.readJsonFile=Xe,exports.transform=vn,exports.transformDynamicImport=ae,exports.transformEsmSync=xn,exports.transformSync=Sn;
|