@dtsx/dtsx 0.11.45 → 0.11.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +1 -1
- package/dist/{chunk-t88j01sz.js → chunk-013mp499.js} +2 -2
- package/dist/{chunk-hzy5z7x2.js → chunk-0af0hsfc.js} +2 -2
- package/dist/{chunk-qab5rsk8.js → chunk-0gwj2fct.js} +6 -6
- package/dist/{chunk-2cjs4r5v.js → chunk-0kvy1dh8.js} +4 -4
- package/dist/{chunk-t1js8enq.js → chunk-0nw1w523.js} +3 -3
- package/dist/{chunk-8xpkce3g.js → chunk-1xgcs6aq.js} +4 -4
- package/dist/{chunk-ybdp7k49.js → chunk-1y19tmb0.js} +3 -3
- package/dist/{chunk-f3avgz4y.js → chunk-1z9550gn.js} +8 -8
- package/dist/{chunk-8c5dzvwk.js → chunk-290jpwny.js} +3 -3
- package/dist/{chunk-jy5h728q.js → chunk-2h5p8n7w.js} +2 -2
- package/dist/{chunk-9knxvphg.js → chunk-2wxgt73q.js} +3 -3
- package/dist/{chunk-qkesb95f.js → chunk-2xp48sa2.js} +2 -2
- package/dist/{chunk-z82jsz2r.js → chunk-4kn7y9ns.js} +3 -3
- package/dist/{chunk-8zr7m1pk.js → chunk-4mrq1jdn.js} +2 -2
- package/dist/{chunk-4fspqk22.js → chunk-5cgpcdsb.js} +3 -3
- package/dist/{chunk-vher6t7j.js → chunk-6bmr0e81.js} +5 -5
- package/dist/{chunk-b7azvfdn.js → chunk-6m8f0y7w.js} +2 -2
- package/dist/{chunk-grpmcw9x.js → chunk-8ab8793q.js} +11 -11
- package/dist/{chunk-755bntty.js → chunk-8gksa73c.js} +3 -3
- package/dist/{chunk-xhgs3gx2.js → chunk-8qpzh9yc.js} +3 -3
- package/dist/{chunk-s013113f.js → chunk-986k5306.js} +2 -2
- package/dist/{chunk-zwcvtbt4.js → chunk-9kfzjkd1.js} +10 -10
- package/dist/{chunk-b3979d26.js → chunk-a0900w7b.js} +2 -2
- package/dist/{chunk-kthga8ar.js → chunk-a8djrg2n.js} +3 -3
- package/dist/{chunk-e9x8ywhv.js → chunk-ac95p5v4.js} +4 -4
- package/dist/{chunk-57xvwm7c.js → chunk-c7dw612y.js} +2 -2
- package/dist/{chunk-zb48dx6a.js → chunk-dhzr60ge.js} +2 -2
- package/dist/{chunk-r2e0r0pd.js → chunk-dpd2b7dd.js} +2 -2
- package/dist/{chunk-m8rvd58d.js → chunk-dw84pjmf.js} +4 -4
- package/dist/{chunk-fkdq1x5f.js → chunk-ehpz5rg3.js} +10 -10
- package/dist/{chunk-4t1we2h5.js → chunk-em9pz9s0.js} +2 -2
- package/dist/{chunk-d5q4qfys.js → chunk-g2191y9b.js} +4 -4
- package/dist/{chunk-bv1q1w42.js → chunk-g9kqk7y0.js} +4 -4
- package/dist/{chunk-1gy2z5an.js → chunk-ga769zw5.js} +5 -5
- package/dist/{chunk-48jvmndg.js → chunk-gqk2s9wt.js} +2 -2
- package/dist/{chunk-qj2yvdjn.js → chunk-gsvb5wey.js} +2 -2
- package/dist/{chunk-x9vpsya2.js → chunk-h7tsf2qg.js} +21 -21
- package/dist/{chunk-nfd9v8ba.js → chunk-hbe5sg17.js} +2 -2
- package/dist/{chunk-41d5ehn0.js → chunk-hcf0hd85.js} +1 -1
- package/dist/{chunk-gns23mhj.js → chunk-j0y149qx.js} +2 -2
- package/dist/{chunk-t76htvct.js → chunk-j32xn94r.js} +2 -2
- package/dist/{chunk-s6t0ff96.js → chunk-jtq24yb8.js} +2 -2
- package/dist/{chunk-c94sk67h.js → chunk-jwcw24cc.js} +4 -4
- package/dist/{chunk-wwjt0p6m.js → chunk-k0exaspt.js} +3 -3
- package/dist/{chunk-xtckj8w1.js → chunk-k472ve44.js} +2 -2
- package/dist/{chunk-y9bxeq10.js → chunk-k75z3nef.js} +2 -2
- package/dist/chunk-kcbbz8t7.js +37 -0
- package/dist/{chunk-exf6bsbe.js → chunk-kcfc6zg6.js} +1 -1
- package/dist/{chunk-55yw66ha.js → chunk-kdqckf54.js} +3 -3
- package/dist/{chunk-vrfp12ts.js → chunk-kp6qv2fb.js} +2 -2
- package/dist/{chunk-gwsjj23d.js → chunk-ktt2m4eh.js} +3 -3
- package/dist/{chunk-05cbfytc.js → chunk-nmjxxcvg.js} +3 -3
- package/dist/{chunk-783erq83.js → chunk-nxqap7nx.js} +4 -4
- package/dist/{chunk-4vtfqwpq.js → chunk-pjqd38w1.js} +2 -2
- package/dist/{chunk-870p7sky.js → chunk-pp9aevcb.js} +2 -2
- package/dist/{chunk-x5z8vprh.js → chunk-qmg1535a.js} +2 -2
- package/dist/{chunk-cd27mg71.js → chunk-rdb7j1d6.js} +2 -2
- package/dist/{chunk-vye45h9n.js → chunk-rkpwmkrm.js} +2 -2
- package/dist/{chunk-mc9kwthm.js → chunk-rnvqc8st.js} +2 -2
- package/dist/{chunk-6gvctv0q.js → chunk-rwdcmcx3.js} +3 -3
- package/dist/{chunk-7x4eqjfw.js → chunk-ry1c863d.js} +2 -2
- package/dist/{chunk-pydpyx8x.js → chunk-s9e2a0t7.js} +2 -2
- package/dist/{chunk-t73v233w.js → chunk-swmftav9.js} +4 -4
- package/dist/chunk-t03y036d.js +3 -0
- package/dist/{chunk-m14550z9.js → chunk-t7jvkq9j.js} +2 -2
- package/dist/{chunk-3x19egjd.js → chunk-t89jepjk.js} +2 -2
- package/dist/{chunk-51vf9de8.js → chunk-thzkm86y.js} +2 -2
- package/dist/{chunk-k0vthrqs.js → chunk-trvp818c.js} +1 -1
- package/dist/{chunk-j51p30sb.js → chunk-tsbthwf0.js} +3 -3
- package/dist/chunk-v4z6808c.js +3 -0
- package/dist/{chunk-3nmjt94q.js → chunk-vdhzc40m.js} +3 -3
- package/dist/{chunk-m29ph3cg.js → chunk-wrjrwren.js} +1 -1
- package/dist/{chunk-8c8pgvxv.js → chunk-wwmeat5n.js} +1 -1
- package/dist/{chunk-yh04e0n4.js → chunk-xg8yhpe6.js} +2 -2
- package/dist/{chunk-a4791583.js → chunk-xm63aee8.js} +2 -2
- package/dist/chunk-y1xq2hm4.js +3 -0
- package/dist/{chunk-f191378r.js → chunk-yapmefw7.js} +3 -3
- package/dist/{chunk-mvxcxnff.js → chunk-z0aa0gd8.js} +2 -2
- package/dist/{chunk-xvk9v148.js → chunk-zaka2jk1.js} +2 -2
- package/dist/src/augmentation-graph.js +1 -1
- package/dist/src/binding-patterns.js +1 -1
- package/dist/src/branded-types.js +1 -1
- package/dist/src/bundle-linker.js +1 -1
- package/dist/src/bundler.js +1 -1
- package/dist/src/cache.js +1 -1
- package/dist/src/call-signatures.js +1 -1
- package/dist/src/circular.js +1 -1
- package/dist/src/compat.d.ts +0 -29
- package/dist/src/compat.js +1 -1
- package/dist/src/computed-keys.js +1 -1
- package/dist/src/config.js +1 -1
- package/dist/src/dangling-refs.js +1 -1
- package/dist/src/declaration-project.js +1 -1
- package/dist/src/declaration-publication.js +1 -1
- package/dist/src/declaration-references.js +1 -1
- package/dist/src/diff.js +1 -1
- package/dist/src/docs.js +1 -1
- package/dist/src/enum-declarations.js +1 -1
- package/dist/src/errors.js +1 -1
- package/dist/src/extractor/directives.js +1 -1
- package/dist/src/extractor/extract.js +1 -1
- package/dist/src/extractor/scanner.d.ts +0 -13
- package/dist/src/extractor/scanner.js +1 -1
- package/dist/src/extractor.js +1 -1
- package/dist/src/formats.js +1 -1
- package/dist/src/formatter.js +1 -1
- package/dist/src/function-properties.js +1 -1
- package/dist/src/generator.js +1 -1
- package/dist/src/global-types.js +1 -1
- package/dist/src/import-sorter.js +1 -1
- package/dist/src/incremental.js +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/inferred-imports.js +1 -1
- package/dist/src/initializer-type-spans.js +1 -1
- package/dist/src/lexical.js +1 -1
- package/dist/src/logger.js +1 -1
- package/dist/src/lsp.js +1 -1
- package/dist/src/memory.js +1 -1
- package/dist/src/merger.js +1 -1
- package/dist/src/module-graph.js +1 -1
- package/dist/src/module-references.js +1 -1
- package/dist/src/native-checker.js +1 -1
- package/dist/src/native-engine.js +1 -1
- package/dist/src/native-extractor.js +1 -1
- package/dist/src/native-generation.js +1 -1
- package/dist/src/native-project.js +1 -1
- package/dist/src/numeric-literals.js +1 -1
- package/dist/src/optimizer.d.ts +0 -14
- package/dist/src/optimizer.js +1 -1
- package/dist/src/output-normalizer.js +1 -1
- package/dist/src/parallel-processor.js +1 -1
- package/dist/src/parameters.js +1 -1
- package/dist/src/parser.js +1 -1
- package/dist/src/plugins/bun.js +1 -1
- package/dist/src/plugins/esbuild.js +1 -1
- package/dist/src/plugins/index.js +1 -1
- package/dist/src/plugins/tsdown.js +1 -1
- package/dist/src/plugins/tsup.js +1 -1
- package/dist/src/plugins/vite.js +1 -1
- package/dist/src/plugins/webpack.js +1 -1
- package/dist/src/plugins.js +1 -1
- package/dist/src/process-source.js +1 -1
- package/dist/src/processor/cache.js +1 -1
- package/dist/src/processor/declarations.js +1 -1
- package/dist/src/processor/import-usage.js +1 -1
- package/dist/src/processor/imports.js +1 -1
- package/dist/src/processor/index.js +1 -1
- package/dist/src/processor/type-inference.d.ts +4 -0
- package/dist/src/processor/type-inference.js +1 -1
- package/dist/src/processor.js +1 -1
- package/dist/src/profiling.js +1 -1
- package/dist/src/return-type-scope.js +1 -1
- package/dist/src/security.js +1 -1
- package/dist/src/source-cache.js +1 -1
- package/dist/src/sourcemap.js +1 -1
- package/dist/src/stx.js +1 -1
- package/dist/src/tracking.js +1 -1
- package/dist/src/transformers.js +1 -1
- package/dist/src/tree-shaker.js +1 -1
- package/dist/src/type-mappings.js +1 -1
- package/dist/src/utils.js +1 -1
- package/dist/src/value-inference.js +1 -1
- package/dist/src/vue.js +1 -1
- package/dist/src/watcher.js +1 -1
- package/dist/src/worker-thread.js +1 -1
- package/dist/src/worker.js +1 -1
- package/dist/src/workspace.js +1 -1
- package/native/darwin-arm64/libzig-dtsx.dylib +0 -0
- package/native/darwin-x64/libzig-dtsx.dylib +0 -0
- package/native/freebsd-x64/libzig-dtsx.so +0 -0
- package/native/linux-arm64/libzig-dtsx.so +0 -0
- package/native/linux-x64/libzig-dtsx.so +0 -0
- package/native/windows-x64/zig-dtsx.dll +0 -0
- package/package.json +1 -1
- package/dist/chunk-83w2qbmb.js +0 -3
- package/dist/chunk-hvt855ms.js +0 -3
- package/dist/chunk-sqa3ke1a.js +0 -3
- package/dist/chunk-zmnb3yg1.js +0 -37
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Oi}from"../chunk-kcbbz8t7.js";import"../chunk-pjqd38w1.js";import"../chunk-j32xn94r.js";import"../chunk-nmjxxcvg.js";import"../chunk-hbe5sg17.js";import"../chunk-k75z3nef.js";import"../chunk-013mp499.js";import"../chunk-t89jepjk.js";import"../chunk-h7tsf2qg.js";import"../chunk-587w6ktw.js";import"../chunk-xg8yhpe6.js";import"../chunk-z0aa0gd8.js";import"../chunk-986k5306.js";import"../chunk-c7dw612y.js";import"../chunk-gsvb5wey.js";import"../chunk-wrjrwren.js";import"../chunk-tsbthwf0.js";import"../chunk-0af0hsfc.js";export{Oi as createReturnTypeScope};
|
package/dist/src/security.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{_,E,Ye,
|
|
2
|
+
import{_,E,Ye,Jr,gn,Yr,Xr,Zr,vt,hn,St,Qr,so,oo,ao,co}from"../chunk-rdb7j1d6.js";export{_ as DEFAULT_SECURITY_CONFIG,E as SecurityError,so as createSecureBatchProcessor,Qr as createSecureProcessor,co as createSecurityMiddleware,gn as isBlockedPath,ao as isSafePath,Xr as isSymlink,oo as sanitizeFilename,hn as validateFileBatch,vt as validateFilePath,Yr as validateFileSize,Ye as validatePath,Jr as validatePaths,Zr as validateSymlink,St as withTimeout};
|
package/dist/src/source-cache.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{_t,ue,
|
|
2
|
+
import{_t,ue,_n,jn,Gn,Vn,Un}from"../chunk-rnvqc8st.js";import"../chunk-srfpcjtn.js";import"../chunk-v6fwy63g.js";export{_n as batchParseSourceFiles,jn as clearSourceFileCache,Vn as getPendingParseCount,_t as getSourceFile,ue as getSourceFileAsync,Gn as getSourceFileCacheSize,Un as shouldUseAsyncParsing};
|
package/dist/src/sourcemap.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{dn,Ct,zs,Hs,Ks,qs,qr,Js,Ys}from"../chunk-0kvy1dh8.js";export{Ct as SourceMapConsumer,dn as SourceMapGenerator,Ks as appendInlineSourceMap,Hs as appendSourceMapComment,Ys as buildDeclarationMappings,zs as createSourceMap,Js as extractSourceMap,qr as readSourceMap,qs as writeSourceMap};
|
package/dist/src/stx.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{O,xa,I}from"../chunk-
|
|
2
|
+
import{O,xa,I}from"../chunk-kcfc6zg6.js";import"../chunk-8gksa73c.js";export{O as isStxFile,xa as parseStxScripts,I as transformStxToTs};
|
package/dist/src/tracking.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Yt,Xt,Zt,is,ss}from"../chunk-k0exaspt.js";export{Yt as Tracker,is as analyzeImports,ss as analyzeTypes,Xt as createTracker,Zt as trackDeclarations};
|
package/dist/src/transformers.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Si,$i,Ln,Fo,Ei,Bo,Te,Wo,it,_o,ki,jo,Ti,Go,Vo,Uo,zo,Ai,Pi,Ho,Ko,qo,Jo,Yo,Xo,Zo,Qo}from"../chunk-8qpzh9yc.js";import"../chunk-290jpwny.js";export{$i as cloneDeclaration,Bo as composeTransformers,Si as createDeclaration,Go as createJSDocTransformer,Ai as createModifierTransformer,Qo as createNamespacePrefixPlugin,zo as createParameterTransformer,ki as createPrefixTransformer,Ti as createRemoveTransformer,_o as createRenameTransformer,Uo as createReturnTypeTransformer,qo as createStripTagsTransformer,jo as createSuffixTransformer,it as createTransformerPlugin,Vo as createTypeTransformer,Jo as createWrapTypeTransformer,Zo as declarePlugin,Te as filterByKind,Wo as filterByPredicate,Fo as findDeclarations,Ei as mapDeclarations,Ko as optionalTransformer,Yo as readonlyPlugin,Pi as readonlyTransformer,Ho as requiredTransformer,Xo as stripPrivatePlugin,Ln as walkDeclarations};
|
package/dist/src/tree-shaker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{gt,ht,yt,
|
|
2
|
+
import{gt,ht,yt,hr,yr,br,os}from"../chunk-ktt2m4eh.js";export{br as analyzeDependencies,ht as buildDeclarationDependencyGraph,os as createTreeShaker,yt as extractTypeReferences,yr as findUnusedDeclarations,gt as treeShake,hr as treeShakeContent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{bi,wi,xi,Ci,vi,Rn,ie,Io,Lo,Rt,No}from"../chunk-j0y149qx.js";export{Rn as TypeMapper,No as TypeTransformers,Rt as applyTypeMappings,ie as createTypeMapper,Io as defaultTypeMapper,bi as defaultTypeMappings,vi as getPresetMappings,xi as readonlyTypeMappings,Ci as simplifiedTypeMappings,Lo as strictTypeMapper,wi as strictTypeMappings};
|
package/dist/src/utils.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{tt,
|
|
2
|
+
import{tt,Mo,Y,yi,re,Tt,At,Pt,Dt}from"../chunk-6bmr0e81.js";import"../chunk-hgg4aqvf.js";import"../chunk-rwdcmcx3.js";import"../chunk-dhzr60ge.js";import"../chunk-yapmefw7.js";import"../chunk-x6ddycvm.js";import"../chunk-g9emajpc.js";import"../chunk-2h5p8n7w.js";import"../chunk-qmg1535a.js";export{Dt as addSourceMapComment,Mo as assertNever,re as checkIsolatedDeclarationsConfig,At as createDiff,Pt as generateDeclarationMap,yi as getAllTypeScriptFiles,tt as sourceMapCommentPrefix,Tt as validateDtsContent,Y as writeToFile};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Jn}from"../chunk-hbe5sg17.js";import"../chunk-k75z3nef.js";import"../chunk-013mp499.js";import"../chunk-t89jepjk.js";import"../chunk-h7tsf2qg.js";import"../chunk-587w6ktw.js";import"../chunk-xg8yhpe6.js";import"../chunk-z0aa0gd8.js";import"../chunk-986k5306.js";import"../chunk-c7dw612y.js";import"../chunk-gsvb5wey.js";import"../chunk-tsbthwf0.js";import"../chunk-0af0hsfc.js";export{Jn as inferDeclarationValueAliases};
|
package/dist/src/vue.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{L,
|
|
2
|
+
import{L,Ca,Ot,It,c,Ne,ot,Lt,Nt,at,ct,lt,Ft,ut,Bt,Wt,N}from"../chunk-8gksa73c.js";export{Ft as collapseTypeText,Nt as extractDefaultExportOptions,ct as filterLocalValueStatements,Ne as findMacroCall,c as findMatching,at as getOptionValue,L as isVueFile,ot as mapRuntimeProps,It as maskNonCode,Ca as parseVueSfc,lt as removeInlinedDeclaration,Bt as resolveEmitsType,Wt as resolveExposedType,ut as resolvePropsType,Ot as skipNonCode,Lt as stripMacroStatements,N as transformVueSfcToTs};
|
package/dist/src/watcher.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Li,Ea,Ni,ka}from"../chunk-g2191y9b.js";export{ka as createWatchLogger,Li as createWatcher,Ni as formatWatchResult,Ea as watchAndGenerate};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import"../chunk-srfpcjtn.js";import"../chunk-
|
|
2
|
+
import"../chunk-srfpcjtn.js";import"../chunk-8gksa73c.js";import"../chunk-kcfc6zg6.js";import"../chunk-0af0hsfc.js";import"../chunk-tsbthwf0.js";import"../chunk-v6fwy63g.js";import"../chunk-gsvb5wey.js";import"../chunk-wrjrwren.js";import"../chunk-xg8yhpe6.js";import"../chunk-t89jepjk.js";import"../chunk-j32xn94r.js";import"../chunk-986k5306.js";import"../chunk-z0aa0gd8.js";import"../chunk-c7dw612y.js";import"../chunk-587w6ktw.js";import"../chunk-h7tsf2qg.js";import"../chunk-pjqd38w1.js";import"../chunk-nmjxxcvg.js";import"../chunk-kcbbz8t7.js";import"../chunk-013mp499.js";import"../chunk-k75z3nef.js";import"../chunk-hbe5sg17.js";import"../chunk-em9pz9s0.js";import"../chunk-rnvqc8st.js";import{r}from"../chunk-v4z6808c.js";import"../chunk-xm63aee8.js";import"../chunk-trvp818c.js";import{l}from"../chunk-vdhzc40m.js";import"../chunk-a0900w7b.js";import{Ze}from"../chunk-y1xq2hm4.js";import*as R from"fs";import{parentPort as M}from"worker_threads";var P=typeof Bun<"u"?Bun:null,S=P?null:R,T=Promise.resolve({extractDeclarations:r,processDeclarations:l});async function N(e){let u=Date.now();try{let{extractDeclarations:m,processDeclarations:A}=await T,f=e.config?.keepComments,C=e.config?.isolatedDeclarations,v=e.config?.importOrder,B=e.config?.engine;if(e.type==="process-batch"){let{filePaths:o,outPaths:D}=e,p=o?null:e.files||[],d=o?o.length:p.length,w=e.writeOutput===!0,g=w?null:Array(d),c=null,b=e.sources;if(!b&&d>0){let t=Array(d);for(let s=0;s<d;s++){let n=p?p[s]:null,h=n?n.sourceCode:void 0,i=o?o[s]:n.filePath;if(h!=null)t[s]=Promise.resolve(h);else if(P)t[s]=P.file(i).text();else t[s]=Promise.resolve(S.readFileSync(i,"utf-8"))}b=await Promise.all(t)}let x={filePath:"",sourceCode:"",declarations:[]},O=w&&P?Array(d):null,F=!0;for(let t=0;t<d;t++){let s=p?p[t]:null,n=o?o[t]:s.filePath,h=D?D[t]:s?s.outPath:void 0;try{let i=b?b[t]:s?.sourceCode||"",a=null,y=Ze(i,n,f??!0,v??["bun"],C??!1,B);if(y===null)a=m(i,n,f,C),x.filePath=n,x.sourceCode=i,x.declarations=a,y=A(a,x,f??!0,v);if(w){if(!h)throw Error(`Missing outPath for ${n}`);if(P)O[t]=P.write(h,y);else S.writeFileSync(h,y)}else if(g)g[t]={filePath:n,success:!0,content:y,declarations:a}}catch(i){let a=i&&i.message?i.message:String(i);if(w){if(!c)c=[];c.push({filePath:n,success:!1,error:a})}else if(g)g[t]={filePath:n,success:!1,error:a};F=!1}}if(O)await Promise.all(O);let E=c?.length?`${c[0].filePath}: ${c[0].error||"Worker batch failed"}`:void 0;return{id:e.id,success:F,filePath:e.filePath,batchResults:w?c||void 0:g,error:E,duration:Date.now()-u}}if(e.type==="extract"){let o=m(e.sourceCode,e.filePath,f,C);return{id:e.id,success:!0,filePath:e.filePath,declarations:o,duration:Date.now()-u}}if(e.type==="process"){let o=m(e.sourceCode,e.filePath,f,C),D=A(o,{filePath:e.filePath,sourceCode:e.sourceCode,declarations:o},f??!0,v);return{id:e.id,success:!0,filePath:e.filePath,content:D,declarations:o,duration:Date.now()-u}}throw Error(`Unknown task type: ${e.type}`)}catch(m){return{id:e.id,success:!1,filePath:e.filePath,error:m.message,duration:Date.now()-u}}}M?.on("message",async(e)=>{let u=await N(e);M.postMessage(u)});
|
package/dist/src/worker.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Jt,pr,Wi,_i,ji}from"../chunk-4kn7y9ns.js";import"../chunk-qmg1535a.js";export{Jt as WorkerPool,_i as batchFiles,ji as calculateOptimalBatchSize,pr as createWorkerPool,Wi as parallelProcess};
|
package/dist/src/workspace.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{ei,ti,yn,lo,ni,ri,uo}from"../chunk-kdqckf54.js";import"../chunk-ehpz5rg3.js";import"../chunk-s9e2a0t7.js";import"../chunk-9kfzjkd1.js";import"../chunk-y1xq2hm4.js";import"../chunk-vdhzc40m.js";import"../chunk-xm63aee8.js";import"../chunk-ac95p5v4.js";import"../chunk-t7jvkq9j.js";import"../chunk-hcf0hd85.js";import"../chunk-a0900w7b.js";import"../chunk-6bmr0e81.js";import"../chunk-hgg4aqvf.js";import"../chunk-8ab8793q.js";import"../chunk-j0y149qx.js";import"../chunk-rwdcmcx3.js";import"../chunk-dhzr60ge.js";import"../chunk-k472ve44.js";import"../chunk-290jpwny.js";import"../chunk-0nw1w523.js";import"../chunk-t03y036d.js";import"../chunk-trvp818c.js";import"../chunk-yapmefw7.js";import"../chunk-jtq24yb8.js";import"../chunk-x6ddycvm.js";import"../chunk-g9emajpc.js";import"../chunk-2h5p8n7w.js";import"../chunk-qmg1535a.js";import"../chunk-v4z6808c.js";import"../chunk-em9pz9s0.js";import"../chunk-kcfc6zg6.js";import"../chunk-8gksa73c.js";import"../chunk-rnvqc8st.js";import"../chunk-srfpcjtn.js";import"../chunk-v6fwy63g.js";import"../chunk-kcbbz8t7.js";import"../chunk-pjqd38w1.js";import"../chunk-j32xn94r.js";import"../chunk-nmjxxcvg.js";import"../chunk-hbe5sg17.js";import"../chunk-k75z3nef.js";import"../chunk-013mp499.js";import"../chunk-t89jepjk.js";import"../chunk-h7tsf2qg.js";import"../chunk-587w6ktw.js";import"../chunk-xg8yhpe6.js";import"../chunk-z0aa0gd8.js";import"../chunk-986k5306.js";import"../chunk-c7dw612y.js";import"../chunk-gsvb5wey.js";import"../chunk-wrjrwren.js";import"../chunk-tsbthwf0.js";import"../chunk-0af0hsfc.js";export{ni as discoverWorkspaceFromPackageJson,ei as discoverWorkspaceProjects,uo as generateFromPackageWorkspaces,lo as generateMonorepo,yn as generateWorkspace,ri as resolveWorkspacePatterns,ti as sortProjectsByDependencies};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/dist/chunk-83w2qbmb.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{L,N}from"./chunk-755bntty.js";import{O,I}from"./chunk-exf6bsbe.js";import{p}from"./chunk-v6fwy63g.js";import{P,F}from"./chunk-zmnb3yg1.js";import{Le}from"./chunk-4t1we2h5.js";import{l}from"./chunk-3nmjt94q.js";import{q,Ee}from"./chunk-b3979d26.js";function Ze(t,n,r,s,e,i){if(s.length!==1||s[0]!=="bun")return null;if(q(i)==="typescript")return null;let a=L(n??"")?N(t):O(n??"")?I(t):t;return Ee(a,{keepComments:r,isolatedDeclarations:e,engine:i,sourceFile:n})}var y=100,x=0,c=new Map;function $t(t,n,r=!0,s=["bun"],e=!1,i){let a=p(t),b=JSON.stringify([n,r,e,s,q(i)]),g=c.get(b);if(g&&g.contentHash===a)return g.lastAccess=++x,g.result;let h=Ze(t,n,r,s,e,i)??E(t,n,r,s,e);if(c.set(b,{result:h,contentHash:a,lastAccess:++x}),c.size>y){let S=Math.max(1,Math.ceil(c.size*0.1)),u=[];for(let[o,f]of c)u.push([o,f.lastAccess]);u.sort((o,f)=>o[1]-f[1]);for(let o=0;o<S&&o<u.length;o++)c.delete(u[o][0])}return h}function oi(t,n,r=!0,s=["bun"]){return $t(t,n,r,s,!0)}function ai(t,n,r=!0,s=["bun"]){return $t(t,n,r,s,!1)}function E(t,n,r,s,e){let i=Le(t,n,r,e);return l(i,{filePath:n??"stdin.ts",sourceCode:t,declarations:i},r,s)}function ci(){c.clear()}function Na(t,n,r=!0,s=["bun"],e=!1,i){return Ze(t,n,r,s,e,i)??$n(t,n,r,s,e)}function $n(t,n,r=!0,s=["bun"],e=!1){if(L(n??""))t=N(t);else if(O(n??""))t=I(t);let i=e?P(t,n,r):F(t,n,r);return l(i,{filePath:n??"stdin.ts",sourceCode:t,declarations:i},r,s)}
|
|
3
|
-
export{Ze,$t,oi,ai,ci,Na,$n};
|
package/dist/chunk-hvt855ms.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{u}from"./chunk-jy5h728q.js";import{h}from"./chunk-j51p30sb.js";import{x}from"./chunk-y9bxeq10.js";import{r}from"./chunk-sqa3ke1a.js";import{Me}from"./chunk-k0vthrqs.js";function ia(c){if(!c.includes("declare")||!c.includes("module"))return[];return h(c).filter((d)=>d.category==="augmentation").map((d)=>d.specifier)}function E(c,d){let m=new Set([c]);for(let v of m)for(let p of d(v))m.add(p);return m}async function Re(c,d,m=!1,v){let p=new Map,y=new Map;for(let e of c){let g=v?.get(e)??await u(e);p.set(e,g);let s=ia(g);if(s.length)y.set(e,s)}let M=new Map;if(y.size===0)return M;let l=new Map,b=(e,g)=>{let s=d(e,g);if(s.resolved)return s.resolved;if(!s.isRelative&&!s.isAlias)return`external:${e}`;return};for(let[e,g]of p){let s=r(g,e,!1,m),a=Me(s),f={edges:[],declarations:new Set,augmentations:new Set},w=(n,i,t)=>{let o=b(n.specifier,e);if(!o)return;if(p.has(o))f.edges.push({specifier:n.specifier,target:o,import:i});if(t)f.declarations.add(o)};for(let n of s){if(n.kind!=="import")continue;let i=n.isSideEffect||x(n.text).some((t)=>a.usedItems.has(t));for(let t of h(n.text))w(t,!0,!!i)}for(let n of h(a.referenceText))w(n,!1,!0);for(let n of y.get(e)??[]){let i=b(n,e);if(i)f.augmentations.add(i),f.declarations.add(i)}l.set(e,f)}let R=!0;while(R){R=!1;for(let[e,g]of l){let s=E(e,(a)=>l.get(a)?.declarations??[]);for(let[a,f]of l){if(s.has(a)||!f.augmentations.size||![...f.augmentations].some((t)=>s.has(t)))continue;let w=[e],n=new Map,i=new Set([e]);for(let t of w){if(t===a)break;for(let o of l.get(t).edges){if(i.has(o.target))continue;i.add(o.target),n.set(o.target,{from:t,edge:o}),w.push(o.target)}}if(!n.has(a))continue;for(let t=a;t!==e;){let{from:o,edge:I}=n.get(t),A=l.get(o);if(I.import){let S=M.get(o);if(!S)S=new Set,M.set(o,S);S.add(I.specifier)}if(!A.declarations.has(t))A.declarations.add(t),R=!0;t=o}}}}return M}
|
|
3
|
-
export{ia,Re};
|
package/dist/chunk-sqa3ke1a.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{G}from"./chunk-srfpcjtn.js";import{Le,Bn}from"./chunk-4t1we2h5.js";import{ue,_n}from"./chunk-mc9kwthm.js";function Pi(){_n(),Bn()}function r(e,t,c=!0,n=!1,o){return Le(e,t,c,n,o)}async function Fn(e,t,c=!0,n={}){return await ue(t,e,n),r(e,t,c)}async function Ri(e,t={}){let c=G(t.concurrency,4),n=new Map;for(let o=0;o<e.length;o+=c){let s=e.slice(o,o+c),i=await Promise.all(s.map(async(a)=>({path:a.filePath,declarations:await Fn(a.sourceCode,a.filePath,a.keepComments,t)})));for(let a of i)n.set(a.path,a.declarations)}return n}
|
|
3
|
-
export{Pi,r,Fn,Ri};
|
package/dist/chunk-zmnb3yg1.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{a,i,R,S,we,ze}from"./chunk-hzy5z7x2.js";import{t,m,d,Ue,h}from"./chunk-j51p30sb.js";import{ar}from"./chunk-qj2yvdjn.js";import{Ve}from"./chunk-m29ph3cg.js";import{rr}from"./chunk-yh04e0n4.js";import{V,tr}from"./chunk-3x19egjd.js";import{zn}from"./chunk-t76htvct.js";import{g,H}from"./chunk-s013113f.js";import{Q}from"./chunk-mvxcxnff.js";import{_e,xe,je}from"./chunk-57xvwm7c.js";import{n,B,W,nr,Ht,U,z}from"./chunk-x9vpsya2.js";import{Un}from"./chunk-4vtfqwpq.js";import{b}from"./chunk-05cbfytc.js";import{qn}from"./chunk-nfd9v8ba.js";function Mi(I,ne,K,X,le=""){let fe=new Map,f={start:0,end:I.length,header:0,name:"",children:[],results:new Map},Y=t(I),me=[],A=[],he=[],qe=new Map;for(let ie=0;ie<Y.length;ie++){let e=Y[ie];if(e.kind!=="punctuation")continue;let ve=I.slice(e.start,e.end);if(ve==="(")he.push(ie);else if(ve===")"){let pe=he.pop();if(pe!==void 0)qe.set(ie,pe)}else if(ve==="{")A.push(ie);else if(ve==="}"){let pe=A.pop();if(pe===void 0)continue;let ue=Y[pe].start,de=pe-1,oe=de>=0?I.slice(Y[de].start,Y[de].end):"";if(oe===")"){let Se=qe.get(de);if(Se!==void 0&&Se>0&&["if","for","while","switch","catch","with"].includes(I.slice(Y[Se-1].start,Y[Se-1].end)))ue=Y[Se-1].start}else if(["else","try","finally","do"].includes(oe))ue=Y[de].start;me.push({open:Y[pe].start,close:e.start,header:ue})}}let N=0,q=(ie,e=new Set)=>{let ve=new Set(e),pe=t(I.slice(ie.start,ie.end)),ue=0;for(let ce=0;ce+1<pe.length;ce++){let y=I.slice(ie.start+pe[ce].start,ie.start+pe[ce].end);if(y==="{")ue++;else if(y==="}")ue--;else if(!ue&&["type","interface"].includes(y))ve.add(I.slice(ie.start+pe[ce+1].start,ie.start+pe[ce+1].end))}let de="",oe=ie.start,Se=[...ie.results].map(([ce,y])=>({type:ce,name:y}));for(let ce of ie.children.sort((y,lt)=>y.header-lt.header)){let y=q(ce,ve);de+=I.slice(oe,ce.header)+`
|
|
3
|
-
declare namespace ${ce.name} {
|
|
4
|
-
${y.text}
|
|
5
|
-
}
|
|
6
|
-
`,oe=ce.end+1;for(let lt of y.exports)Se.push({type:`${ce.name}.${lt.name}`,name:lt.name})}de+=`${I.slice(oe,ie.end)}
|
|
7
|
-
;
|
|
8
|
-
${Se.map((ce)=>`export type ${ce.name} = ${ce.type};`).join(`
|
|
9
|
-
`)}`;let Ke=F(de,ne,!1);for(let ce of Se)ve.add(ce.name);let Z=le?zt(le).map((ce,y)=>[ce,`${ge}_capture_${y}`]):[],tt=Ke.map((ce)=>le&&["type","interface"].includes(ce.kind)?On(ce,le,Z,ve):(ce.kind==="variable"?b(ce,!1):ce.text).replace(/^export\s+/,"").replace(/^declare\s+/,"")).join(`
|
|
10
|
-
`);return{declarations:Ke,text:tt,exports:Se}},ge;return{resolve(ie,e){ge??=K();let ve=f;for(let ue of me.filter((de)=>de.open<e&&e<de.close).sort((de,oe)=>de.open-oe.open)){let de=ve.children.find((oe)=>oe.start===ue.open+1);if(!de)de={start:ue.open+1,end:ue.close,header:ue.header,name:`${ge}_scope_${N++}`,children:[],results:new Map},ve.children.push(de);ve=de}let pe=ve.results.get(ie);if(!pe)pe=`${ge}_result_${fe.size}`,ve.results.set(ie,pe),fe.set(pe,ie);return`${ge}.${pe}`},finish(ie){if(!ge)return ie;let e=q(f),ve=e.declarations,pe=new Set(fe.keys());if(ve.every((de)=>pe.has(de.name))){let de=new Map(fe),oe=t(ie),Se="",Ke=0;for(let Z=0;Z+2<oe.length;Z++){if(ie.slice(oe[Z].start,oe[Z].end)!==ge||ie.slice(oe[Z+1].start,oe[Z+1].end)!==".")continue;let tt=de.get(ie.slice(oe[Z+2].start,oe[Z+2].end));if(!tt)continue;Se+=ie.slice(Ke,oe[Z].start)+`(${tt})`,Ke=oe[Z+2].end,Z+=2}return Se+ie.slice(Ke)}if(le){let de=zt(le).join(", "),oe=t(ie),Se="",Ke=0;for(let Z=0;Z+2<oe.length;Z++){if(ie.slice(oe[Z].start,oe[Z].end)!==ge||ie.slice(oe[Z+1].start,oe[Z+1].end)!=="."||!pe.has(ie.slice(oe[Z+2].start,oe[Z+2].end)))continue;Se+=`${ie.slice(Ke,oe[Z+2].end)}<${de}>`,Ke=oe[Z+2].end,Z+=2}ie=Se+ie.slice(Ke)}let ue=e.text;return X({kind:"module",name:ge,text:`declare namespace ${ge} {
|
|
11
|
-
${ue}
|
|
12
|
-
}`,moduleForm:"namespace",isExported:!1}),ie}}}function zt(I){let ne=t(I),K=[],X=0,le=0,fe=!1;for(let f of ne){let Y=I.slice(f.start,f.end);if(Y==="<"){if(X++,X===1)fe=!0}else if(Y===">"&&I[f.start-1]!=="=")X--;else if(["(","[","{"].includes(Y))le++;else if([")","]","}"].includes(Y))le--;else if(Y===","&&X===1&&!le)fe=!0;else if(fe&&f.kind==="word"&&!["const","in","out"].includes(Y))K.push(Y),fe=!1}return K}function On(I,ne,K,X){let le=new Set(zt(I.generics||"")),fe=(q,ge,ie)=>{let e=t(q),ve="",pe=0;for(let ue=0;ue<e.length;ue++){let de=e[ue],oe=q.slice(de.start,de.end),Se=e[ue+1]&&q.slice(e[ue+1].start,e[ue+1].end),Ke=e[ue+2]&&q.slice(e[ue+2].start,e[ue+2].end),Z=e[ue-1]&&q.slice(e[ue-1].start,e[ue-1].end);if(de.kind!=="word"||Se===":"||Se==="?"&&Ke===":")continue;let tt=!ie.has(oe)&&Z!=="."&&K.find(([ce])=>ce===oe)?.[1];if(tt)ve+=q.slice(pe,de.start)+tt,pe=de.end;else if(ge&&X.has(oe)&&!ie.has(oe)){let ce=K.map(([,y])=>y).join(", ");ve+=`${q.slice(pe,de.end)}<${ce}${Se==="<"?", ":">"}`,pe=Se==="<"?e[++ue].end:de.end}}return ve+q.slice(pe)},f=t(I.text),Y=f.findIndex((q)=>["type","interface"].includes(I.text.slice(q.start,q.end))),me=f[Y+1],A=I.generics||"",he=A?I.text.indexOf(A,me.end)+A.length:me.end,qe=fe(_n(ne),!1,new Set),N=A?`, ${fe(A.slice(1,-1),!0,le)}`:"";return`${I.text.slice(0,me.end)}<${qe}${N}>${fe(I.text.slice(he),!0,le)}`.replace(/^export\s+/,"").replace(/^declare\s+/,"")}function _n(I){let ne=I.slice(1,-1),K=t(ne),X=0,le=0,fe=!1,f="";for(let Y=0;Y<K.length;Y++){let me=K[Y],A=ne.slice(me.start,me.end);if(["(","[","{","<"].includes(A))X++;else if([")","]","}"].includes(A)||A===">"&&ne[me.start-1]!=="=")X--;else if(!X&&A==="const")f+=ne.slice(le,me.start),le=me.end;else if(!X&&A==="="&&ne.slice(K[Y+1]?.start,K[Y+1]?.end)!==">")f+=ne.slice(le,me.start),fe=!0;else if(!X&&A===","&&fe)le=me.start,fe=!1}return f+(fe?"":ne.slice(le))}var Fe=32,Ge=9,ke=10,Oe=13,te=47,ye=42,Ae=39,be=34,We=96,Xe=92,L=123,ee=125,ae=40,Ce=41,Te=91,Pe=93,$e=60,De=62,re=59,Ye=58,Ie=61,et=44,st=46,St=63,ln=35,En=64,Rn=36;function He(I){return I===Fe||I===Ge||I===ke||I===Oe}function Pn(I){let ne=!0;for(let K=0;K<I.length;K++){let X=I.charCodeAt(K);if(X===st){if(ne)return!1;ne=!0}else if(ne){if(!a(X))return!1;ne=!1}else if(!i(X))return!1}return I.length>0&&!ne}function At(I,ne,K){let X=ne+1;while(X<I.length){let le=I.charCodeAt(X);if(le===Xe){X+=2;continue}if(X++,le===K)break}return X}function Mn(I){if(I==="any"||I==="object"||I==="unknown")return!0;if(I.startsWith("Record<")||I.startsWith("Array<"))return!0;return I.charCodeAt(0)===L&&I.includes("[")&&I.includes("]:")}var qt=["public","protected","private","readonly","override"];function Fa(I,ne,K=!0,X=!1){return X?P(I,ne,K):F(I,ne,K)}function P(I,ne,K=!0){return Ft(I,ne,K,!0)}function F(I,ne,K=!0,X){return Ft(I,ne,K,!1,!1,X)}function jt(I,ne,K=!0){return Ft(I,ne,K,!0,!0)}function Ft(I,ne,K,X,le=!1,fe){let f=I,Y=K,me=X,A=f.length,he=ze(f),qe=V(f),N=[],q=new Map,ge=new Map,ie=new Set,e=0,ve,pe=0,ue=[];function de(s){let r=/^this\.([\w$]+)$/.exec(s);if(r){let C=ue.at(-1);return C?.fields.get(`${C.isStatic?"static:":""}${r[1]}`)}let o=/^([\w$]+)\s*\(/.exec(s);if(!o||!s.endsWith(")"))return;let c=t(s),l=0;for(let C=1;C<c.length;C++){let w=s.slice(c[C].start,c[C].end);if(w==="(")l++;else if(w===")"&&--l===0&&C!==c.length-1)return}let u=[...N,...q.values()].filter((C)=>C.kind==="function"&&C.name===o[1]);if(u.length!==1||u[0].generics||Ve(f,o[1])!==1)return;return u[0].returnType}function oe(s){let r=s.trim(),o=de(r);if(o)return o;if(!r.startsWith("class"))return;let c=t(r);if(c[0]?.kind!=="word"||r.slice(c[0].start,c[0].end)!=="class")return;let l;do l=`__dtsx_class_${pe++}`;while(f.includes(l));let u=c[1],C=u?r.slice(u.start,u.end):"",w=u?.kind==="word"&&!["extends","implements"].includes(C),k=w?C:`${l}_value`,p=w?`export ${r}`:`export class ${k} ${r.slice(5)}`,x=F(p,ne,Y),O=x.find((T)=>T.kind==="class");if(!O)throw Error("Cannot extract the class expression declaration");if(t(p.slice(O.end??p.length)).some((T)=>p.slice((O.end??0)+T.start,(O.end??0)+T.end)!==";"))return;let M=x.map((T)=>T.text.replace(/^export\s+/,"").replace(/^declare\s+/,"")).join(`
|
|
13
|
-
`);return q.set(l,{kind:"module",name:l,text:`declare namespace ${l} {
|
|
14
|
-
${M}
|
|
15
|
-
}`,moduleForm:"namespace",isExported:!1,start:e,end:e}),`typeof ${l}.${k}`}function Se(s,r){let o=/^this\.([\w$]+)$/.exec(s);if(o)return ue.at(-1)?.fields.get(`${r?"static:":""}${o[1]}`);return oe(s)}function Ke(s){let r=ge.get(s.name);if(r)r.push(s);else ge.set(s.name,[s]);q.set(s.name,s)}if(e<A&&f.charCodeAt(e)===65279)e++;function Z(s,r){if(s<r){let o=f.charCodeAt(s),c=f.charCodeAt(r-1);if(o!==Fe&&o!==Ge&&o!==ke&&o!==Oe&&c!==Fe&&c!==Ge&&c!==ke&&c!==Oe)return f.slice(s,r)}while(s<r&&He(f.charCodeAt(s)))s++;while(r>s&&He(f.charCodeAt(r-1)))r--;return f.slice(s,r)}let tt=/[\r\n]/g;function ce(s){return tt.lastIndex=s,tt.exec(f)?.index??A}function y(){if(e>=A)return;let s=f.charCodeAt(e);if(s!==Fe&&s!==Ge&&s!==ke&&s!==Oe&&s!==te)return;while(e<A){let r=f.charCodeAt(e);if(r===Fe||r===Ge||r===ke||r===Oe){e++;continue}if(r===te&&e+1<A){let o=f.charCodeAt(e+1);if(o===te){e=ce(e+2);continue}if(o===ye){let c=f.indexOf("*/",e+2);e=c===-1?A:c+2;continue}}break}}function lt(s){if(s.indexOf("//")===-1&&s.indexOf("/*")===-1)return s;let r=0,o=0;while(o<s.length){let c=s.charCodeAt(o);if(c===Ae||c===be||c===We){o=At(s,o,c),r=o;continue}if(c===Xe){o+=2,r=Math.min(o,s.length);continue}if(c===te&&s.charCodeAt(o+1)===te){while(o<s.length&&s.charCodeAt(o)!==ke&&s.charCodeAt(o)!==Oe)o++;continue}if(c===te&&s.charCodeAt(o+1)===ye){let l=s.indexOf("*/",o+2);o=l===-1?s.length:l+2;continue}if(o++,c>32)r=o}return r<s.length?s.slice(0,r).trimEnd():s}function un(s){let r=s.length,o=0,c=r;for(let l=0;l<r;l++){let u=s.charCodeAt(l);if(o){if(u===Xe){l++;continue}if(u===o)o=0;continue}if(u===Ae||u===be||u===We){o=u;continue}if(u===te&&l+1<r){let C=s.charCodeAt(l+1);if(C===te){c=l;while(c>0&&(s.charCodeAt(c-1)===Fe||s.charCodeAt(c-1)===Ge))c--;return s.slice(0,c)}if(C===ye){let w=s.indexOf("*/",l+2);if(w!==-1){s=`${s.slice(0,l)} ${s.slice(w+2)}`,l--;continue}}}}c=r;while(c>0&&(s.charCodeAt(c-1)===Fe||s.charCodeAt(c-1)===Ge||s.charCodeAt(c-1)===Oe))c--;return c<r?s.slice(0,c):s}function nt(s){e++;let r=s===Ae?"'":'"';while(e<A){let o=f.indexOf(r,e);if(o===-1){e=A;return}let c=0,l=o-1;while(l>=0&&f.charCodeAt(l)===Xe)c++,l--;if(c%2===0){e=o+1;return}e=o+1}}function pt(){e++;let s=[];while(e<A){let r=f.charCodeAt(e);if(s.length===0){if(r===Xe){e+=2;continue}if(r===We){e++;return}if(r===Rn&&e+1<A&&f.charCodeAt(e+1)===L){e+=2,s.push(0);continue}e++;continue}if(r===Ae||r===be){nt(r);continue}if(r===We){pt();continue}if(r===te&&e+1<A){let o=f.charCodeAt(e+1);if(o===te){e=ce(e+2);continue}if(o===ye){let c=f.indexOf("*/",e+2);e=c===-1?A:c+2;continue}if(Gt()){Kt();continue}e++;continue}if(r===L){s[s.length-1]++,e++;continue}if(r===ee){let o=s[s.length-1];if(o===0){s.pop(),e++;continue}s[s.length-1]=o-1,e++;continue}e++}}let Tt=!1;function Ne(){Tt=!1;let s=f.charCodeAt(e);if(s===Ae||s===be)return nt(s),!0;if(s===We)return pt(),!0;if(s===te&&e+1<A){let r=f.charCodeAt(e+1);if(r===te)return e=ce(e+2),!0;if(r===ye){let o=f.indexOf("*/",e+2);return Tt=ce(e+2)<(o===-1?A:o),e=o===-1?A:o+2,!0}if(Gt())return Kt(),!0}return!1}function Gt(){return R(f,e)}function Kt(){e=S(f,e)}function Re(){let s=e;while(e<A&&i(f.charCodeAt(e)))e++;return f.slice(s,e)}function v(s){if(e+s.length>A)return!1;for(let r=0;r<s.length;r++)if(f.charCodeAt(e+r)!==s.charCodeAt(r))return!1;if(e+s.length<A&&i(f.charCodeAt(e+s.length)))return!1;return!0}function bt(s){let r=e+s;while(r<A){let o=f.charCodeAt(r);if(o===Fe||o===Ge||o===ke||o===Oe){r++;continue}return o!==st&&o!==Ie}return!1}function Ut(){if(!Tt)return!1;let s=e;y();let r=e>=A||Dt()||f.charCodeAt(e)===ee;return e=s,r}function Dt(){if(e>=A)return!1;switch(f.charCodeAt(e)){case 101:return v("export")||v("enum");case 105:return v("import")||v("interface");case 102:return v("function");case 99:return v("class")||v("const");case 116:return v("type");case 108:return v("let");case 118:return v("var");case 100:return v("declare")||v("default");case 109:return v("module");case 110:return v("namespace");case 97:return v("abstract")||v("async");default:return!1}}function ft(){let s=f.charCodeAt(e);if(s!==ke&&s!==Oe)return!1;let r=e;if(e++,s===Oe&&e<A&&f.charCodeAt(e)===ke)e++;while(e<A){let c=f.charCodeAt(e);if(c===Fe||c===Ge||c===Oe||c===ke){e++;continue}if(c===te&&e+1<A){let l=f.charCodeAt(e+1);if(l===te){e=ce(e+2);continue}if(l===ye){let u=f.indexOf("*/",e+2);e=u===-1?A:u+2;continue}}break}let o=e>=A||Dt()||f.charCodeAt(e)===ee;return e=r,o}function hn(s){let r=s-1;while(r>=0){let k=f.charCodeAt(r);if(k===Fe||k===Ge||k===Oe||k===ke){r--;continue}break}if(r<0)return!0;let o=f[r];if("+-*/%=<>&|^!~?:,.([{".includes(o))return!0;let c=r;while(c>0&&f.charCodeAt(c-1)!==ke)c--;let l=f.slice(c,r+1),u=l.lastIndexOf("<");if(u!==-1&&/^<[A-Za-z]/.test(l.slice(u))&&!l.slice(u).includes(">"))return!0;let C=r;while(C>=0&&/[a-z]/i.test(f[C]))C--;let w=f.slice(C+1,r+1);return["as","in","of","new","typeof","keyof","extends","instanceof","satisfies","await","return","yield","void"].includes(w)}function pn(s,r){let o=f.charCodeAt(e);if(o!==ke&&o!==Oe&&!(o===te&&(f[e+1]==="/"||f[e+1]==="*")))return!1;let c=m(f),l=0,u=c.length;while(l<u){let x=l+u>>>1;if(c[x].start<e)l=x+1;else u=x}let C=c[l-1],w=c[l];if(!C||C.start<s||!/[\r\n]/.test(f.slice(e,w?.start??A)))return!1;let k=f.slice(C.start,C.end);if(C.end!==r&&C.kind==="punctuation"&&"+-*/%=<>&|^!~?:,.([{".includes(k))return!1;if(C.kind==="word"&&["as","in","of","new","typeof","keyof","extends","instanceof","satisfies","await","return","yield","void"].includes(k))return!1;if(!w)return!0;let p=f.slice(w.start,w.end);return!(".?:)]},+-*/%<>=&|^`([".includes(p)||w.kind==="literal"&&f.charCodeAt(w.start)===We||["as","satisfies","instanceof","in"].includes(p))}function Vt(){let s=f.charCodeAt(e);if(s!==ke&&s!==Oe)return!1;if(hn(e))return!1;let r=e;e++;while(e<A){let l=f.charCodeAt(e);if(l===Fe||l===Ge||l===Oe||l===ke){e++;continue}if(l===te&&e+1<A){let u=f.charCodeAt(e+1);if(u===te){e=ce(e+2);continue}if(u===ye){let C=f.indexOf("*/",e+2);e=C===-1?A:C+2;continue}}break}let o=e<A?f[e]:"",c=o==="|"||o==="&"||o==="["||o==="."||o==="?"||o===":"||o===">"||o===")"||o===","||v("extends");return e=r,!c}function mt(){let s=f.charCodeAt(e);if(s!==ke&&s!==Oe)return!1;let r=e;if(e++,s===Oe&&e<A&&f.charCodeAt(e)===ke)e++;while(e<A){let c=f.charCodeAt(e);if(c===Fe||c===Ge||c===Oe||c===ke){e++;continue}if(c===te&&e+1<A&&f.charCodeAt(e+1)===te){e=ce(e+2);continue}break}if(e>=A)return e=r,!0;let o=f.charCodeAt(e);if(o===124||o===38||o===st||o===St||o===Ye)return e=r,!1;if(v("extends")||v("keyof")||v("typeof")||v("infer")||v("is")||v("as")||v("in"))return e=r,!1;return e=r,!0}let mn=/[{}'"`\/]/g,gn=/[()'"`\/]/g,Cn=/[[\]'"`\/]/g,An=/[<>'"`\/]/g;function Le(s,r){let o=1;e++;let c=s===L?mn:s===ae?gn:s===Te?Cn:An;c.lastIndex=e;let l;while((l=c.exec(f))!==null){let u=l.index,C=f.charCodeAt(u);if(C===Ae||C===be){e=u,nt(C),c.lastIndex=e;continue}if(C===We){e=u,pt(),c.lastIndex=e;continue}if(C===te){if(e=u,Ne()){c.lastIndex=e;continue}c.lastIndex=u+1;continue}if(C===s)o++;else if(C===r){if(r===De&&u>0&&f.charCodeAt(u-1)===Ie){c.lastIndex=u+1;continue}if(o--,o===0)return e=u+1,e}c.lastIndex=u+1}return e=A,e}function Ze(){return e>0&&f.charCodeAt(e-1)===Ie}function It(){return e+1<A&&f.charCodeAt(e+1)===De}let Qe=/[<{};'"`\/\n\r()[\]]/g;function Be(s=!1){let r=0,o=0,c=0,l=0,u=f.charCodeAt(e)===L;Qe.lastIndex=e;let C;while((C=Qe.exec(f))!==null){let w=C.index,k=f.charCodeAt(w);if(k===Ae||k===be){e=w,nt(k),Qe.lastIndex=e;continue}if(k===We){e=w,pt(),Qe.lastIndex=e;continue}if(k===te){if(w>0&&f.charCodeAt(w-1)===$e){Qe.lastIndex=w+1;continue}if(e=w,Ne()){if(r===0&&o===0&&c===0&&l===0&&Ut())return;Qe.lastIndex=e;continue}Qe.lastIndex=w+1;continue}if(k===$e){let p=he(w)?.delta??null;if(p!==null)l=Math.max(0,l+p);Qe.lastIndex=w+1;continue}if(k===ae){o++,Qe.lastIndex=w+1;continue}if(k===Ce){o--,Qe.lastIndex=w+1;continue}if(k===Te){c++,Qe.lastIndex=w+1;continue}if(k===Pe){c--,Qe.lastIndex=w+1;continue}if(k===L){r++,Qe.lastIndex=w+1;continue}if(k===ee){let p=r>0;if(!p&&s&&o===0&&c===0&&l===0){e=w;return}if(p)r--;if((!p||u)&&r===0&&o===0&&c===0&&l===0){e=w+1;return}if(p&&r===0&&o===0&&c===0&&l===0){e=w+1;let x=e;y();let O=Dt();if(e=x,O)return}Qe.lastIndex=w+1;continue}if(k===re&&r===0&&o===0&&c===0&&l===0){e=w+1;return}if((k===ke||k===Oe)&&r===0&&o===0&&c===0&&l===0){if(e=w,ft())return}Qe.lastIndex=w+1}e=A}function bn(){e++;while(e<A&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;let s=f.indexOf(`
|
|
16
|
-
`,e),r=s===-1?A:s,o=f.indexOf(";",e);if(o!==-1&&o<r){let c=o-1;while(c>=e&&(f.charCodeAt(c)===Fe||f.charCodeAt(c)===Ge))c--;let l=f.charCodeAt(e),u=f.charCodeAt(c);if(l===L&&u===ee||l===Te&&u===Pe||l===Ae&&u===Ae||l===be&&u===be||l===We&&u===We){e=o+1;return}}Be()}function Qt(){Le(L,ee);while(e<A&&He(f.charCodeAt(e)))e++;if(v("from")){e+=4;while(e<A&&He(f.charCodeAt(e)))e++;if(e<A){let s=f.charCodeAt(e);if(s===Ae||s===be)nt(s)}}while(e<A&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<A&&f.charCodeAt(e)===re)e++}function Jt(){e++;while(e<A&&He(f.charCodeAt(e)))e++;if(v("as")){e+=2;while(e<A&&He(f.charCodeAt(e)))e++;Re();while(e<A&&He(f.charCodeAt(e)))e++}if(v("from")){e+=4;while(e<A&&He(f.charCodeAt(e)))e++;if(e<A){let s=f.charCodeAt(e);if(s===Ae||s===be)nt(s)}}while(e<A&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<A&&f.charCodeAt(e)===re)e++}function kt(s){let r=s.indexOf("from ");if(r===-1)return;let o=r+5;while(o<s.length&&(s.charCodeAt(o)===32||s.charCodeAt(o)===9))o++;if(o>=s.length)return;let c=s.charCodeAt(o);if(c!==39&&c!==34)return;let l=s.indexOf(s[o],o+1);if(l===-1)return;return s.slice(o+1,l)}function Je(s){if(!Y)return;let r=s-1;while(r>=0&&He(f.charCodeAt(r)))r--;if(r<0)return;let o=[],c=!1;while(r>=0){if(r>=1&&f.charCodeAt(r)===te&&f.charCodeAt(r-1)===ye){let C=f.lastIndexOf("/*",r-2);if(C>=0){o.push(f.slice(C,r+1)),c=!0,r=C-1;while(r>=0&&He(f.charCodeAt(r)))r--;continue}break}let l=r;while(l>0&&f.charCodeAt(l-1)!==ke)l--;let u=Z(l,r+1);if(u.startsWith("//")){if(c)break;let C=[u];r=l-1;while(r>=0&&(f.charCodeAt(r)===ke||f.charCodeAt(r)===Oe))r--;while(r>=0){let w=r;while(w>0&&f.charCodeAt(w-1)!==ke)w--;let k=Z(w,r+1);if(k.startsWith("//")){C.push(k),r=w-1;while(r>=0&&(f.charCodeAt(r)===ke||f.charCodeAt(r)===Oe))r--}else if(k===""){r=w-1;while(r>=0&&(f.charCodeAt(r)===ke||f.charCodeAt(r)===Oe))r--}else break}C.reverse(),o.push(C.join(`
|
|
17
|
-
`));continue}break}if(o.length===0)return;return o.reverse(),o}function kn(s){let r=s,o=!1,c=0,l;while(e<A){let _=f.charCodeAt(e);if(_===te&&(f.charCodeAt(e+1)===te||f.charCodeAt(e+1)===ye)){y();continue}if(_===re){e++;break}if(_===L)c++;else if(_===ee&&c>0)c--;if(_===Ae||_===be){if(nt(_),c>0)continue;o=!0;let M=e;if(y(),f.charCodeAt(e)===Ce){let T=e+1;l=Ue(f.slice(r,T)),e=l?T:M}else e=M;while(e<A&&(f.charCodeAt(e)===Fe||f.charCodeAt(e)===Ge))e++;if(e<A&&f.charCodeAt(e)===re)e++;break}if(_===ke&&o)break;e++}let u=Z(r,e),C=h(u).find((_)=>_.category==="static-import"),w=t(u),k=l?.isTypeOnly??C?.isTypeOnly??!1,p=w[1]?.kind==="quoted",x=l?.source??C?.specifier??"",O=Je(r);return{kind:"import",name:"",text:u,isExported:!1,isTypeOnly:k,isSideEffect:p,source:x,leadingComments:O,start:r,end:e}}function Ot(){let s=e;return Le(L,ee),f.slice(s,e)}function Zt(s){let r=s.indexOf("(");if(r===-1)return s;let o=s.slice(r);if(o.indexOf("=")===-1)return s;let c=!1;for(let k=0;k<o.length;k++)if(o.charCodeAt(k)===61){let x=k>0?o.charCodeAt(k-1):0,O=k+1<o.length?o.charCodeAt(k+1):0;if(x!==61&&x!==33&&x!==60&&x!==62&&O!==61&&O!==62){c=!0;break}}if(!c)return s;let l=0,u=-1;for(let k=r;k<s.length;k++){let p=s.charCodeAt(k);if(p===40)l++;else if(p===41){if(l--,l===0){u=k;break}}}if(u===-1)return s;let C=s.slice(r,u+1),w=dt(C);return s.slice(0,r)+w+s.slice(u+1)}function Xt(s){let r=s.indexOf("//")!==-1||s.indexOf("/*")!==-1,o=s.split(`
|
|
18
|
-
`),c=[],l=[],u=[],C=!1,w=1/0;for(let x=0;x<o.length;x++){let O=o[x];if(r){if(C){if(O.includes("*/"))C=!1;continue}let _=O.trim();if(_.length===0)continue;let M=_.charCodeAt(0);if(M===te){let G=_.charCodeAt(1);if(G===te)continue;if(G===ye){if(!_.includes("*/"))C=!0;continue}}if(M===ye)continue;let T=un(O);if(T.charCodeAt(T.length-1)===re)T=T.slice(0,-1);T=Zt(T);let D=T.trim();if(!D)continue;c.push(T),l.push(D);let J=0;while(J<T.length&&He(T.charCodeAt(J)))J++;if(D!=="{"&&D!=="}"){if(J<w)w=J}u.push(J)}else{let _=O.length;while(_>0&&(O.charCodeAt(_-1)===Fe||O.charCodeAt(_-1)===Ge||O.charCodeAt(_-1)===Oe))_--;if(_===0)continue;let M=_<O.length?O.slice(0,_):O;if(M.charCodeAt(M.length-1)===re)M=M.slice(0,-1);M=Zt(M);let T=M.trim();if(!T)continue;c.push(M),l.push(T);let D=0;while(D<M.length&&He(M.charCodeAt(D)))D++;if(T!=="{"&&T!=="}"){if(D<w)w=D}u.push(D)}}if(c.length===0)return"{}";if(w===1/0||w<=2)return c.join(`
|
|
19
|
-
`);let k=w-2,p=Array(c.length);for(let x=0;x<c.length;x++){let O=l[x];if(O==="{"){p[x]=O;continue}let _=u[x];if(_>w)p[x]=c[x];else if(_===w&&(O.charCodeAt(0)===ee||O.charCodeAt(0)===Pe||O.charCodeAt(0)===Ce))p[x]=c[x];else{let M=Math.max(0,_-k);p[x]=" ".repeat(M)+O}}return p.join(`
|
|
20
|
-
`)}function it(){if(e>=A||f.charCodeAt(e)!==$e)return"";let s=e;Le($e,De);let r=f.slice(s,e);if(r.includes(`
|
|
21
|
-
`)){let o="",c=!1;for(let l=0;l<r.length;l++){let u=r.charCodeAt(l);if(u===32||u===9||u===10||u===13){if(!c&&o.length>0)o+=" ",c=!0}else o+=r[l],c=!1}if(o.charCodeAt(1)===32)o=`<${o.slice(2)}`;if(o.charCodeAt(o.length-2)===32)o=`${o.slice(0,-2)}>`;return o}return r}function rt(){if(e>=A||f.charCodeAt(e)!==ae)return"()";let s=e;return Le(ae,Ce),f.slice(s,e)}function wt(s){if(s.indexOf("/")===-1)return s;let r="",o=!1,c=0;for(let l=0;l<s.length;l++){let u=s.charCodeAt(l);if(o){if(r+=s[l],u===Xe&&l+1<s.length){r+=s[++l];continue}if(u===c)o=!1;continue}if(u===Ae||u===be||u===We){o=!0,c=u,r+=s[l];continue}if(u===te&&l+1<s.length){let C=s.charCodeAt(l+1);if(C===ye){let w=s.indexOf("*/",l+2);l=w===-1?s.length:w+1,r+=" ";continue}if(C===te){let w=s.indexOf(`
|
|
22
|
-
`,l+2);l=w===-1?s.length:w-1;continue}}r+=s[l]}return r.trim()}function dt(s){let r=s.slice(1,-1).trim();if(!r)return"()";if(s.indexOf(`
|
|
23
|
-
`)===-1&&r.indexOf(":")!==-1&&r.indexOf("{")===-1&&r.indexOf("[")===-1&&r.indexOf("=")===-1&&r.indexOf("@")===-1&&r.indexOf("...")===-1){let k=0,p=0,x=0;for(let O=0;O<r.length;O++){let _=r.charCodeAt(O);if(_===ae||_===$e||_===L)x++;else if(_===Ce||_===De||_===ee)x--;else if(x===0){if(_===Ye)k++;else if(_===et)p++}}if(k>=p+1){let O=!1;for(let _=0;_<qt.length;_++){let M=qt[_],T=r.indexOf(M);if(T!==-1){let D=T+M.length;if((T===0||!i(r.charCodeAt(T-1)))&&(D>=r.length||!i(r.charCodeAt(D)))){O=!0;break}}}if(!O)return s}}let o=[],c=0,l=0,u=!1,C=0;for(let k=0;k<=r.length;k++){if(k===r.length){o.push(wt(r.slice(c).trim()));break}let p=r.charCodeAt(k);if(u){if(p===Xe){k++;continue}if(p===C)u=!1;continue}if(p===te&&k+1<r.length){let x=r.charCodeAt(k+1);if(x===ye){k+=2;while(k+1<r.length&&!(r.charCodeAt(k)===ye&&r.charCodeAt(k+1)===te))k++;k++;continue}if(x===te){while(k<r.length&&r.charCodeAt(k)!==10)k++;continue}}if(p===Ae||p===be||p===We){u=!0,C=p;continue}if(p===ae||p===L||p===Te||p===$e)l++;else if(p===Ce||p===ee||p===Pe||p===De&&!(k>0&&r.charCodeAt(k-1)===Ie))l--;else if(p===et&&l===0)o.push(wt(r.slice(c,k).trim())),c=k+1}let w=[];for(let k of o){if(!k)continue;let p=k.trim();if(p.startsWith("//")||p.startsWith("/*"))continue;let x=k;{let O=!1,_=0,M=0,T=0;for(let D=0;D<x.length-1;D++){let J=x.charCodeAt(D);if(J===ke){T=D+1;continue}if(O){if(J===Xe){D++;continue}if(J===_)O=!1;continue}if(J===Ae||J===be||J===We){O=!0,_=J;continue}if(J===L||J===Te||J===ae||J===$e){M++;continue}if(J===ee||J===Pe||J===Ce||J===De){if(M>0)M--;continue}if(J===te&&x.charCodeAt(D+1)===te){if(M===0){x=x.slice(0,D).trimEnd();break}let G=x.indexOf(`
|
|
24
|
-
`,D);if(G===-1){x=x.slice(0,T).trimEnd();break}let j=x.slice(0,T),E=x.slice(G+1);x=`${j}${E}`,D=T-1}}}if(!x.trim())continue;w.push(Yt(x))}return _e(`(${w.join(", ")})`)}function wn(s){if(!s.startsWith("{")&&!s.startsWith("["))return s;let r="",o=0,c=0,l=!1,u=0;while(o<s.length){let C=s.charCodeAt(o);if(l){if(C===Xe&&o+1<s.length){r+=s[o]+s[o+1],o+=2;continue}if(C===u)l=!1;r+=s[o],o++;continue}if(C===te&&o+1<s.length){let w=s.charCodeAt(o+1);if(w===ye){let k=o;o+=2;while(o+1<s.length&&!(s.charCodeAt(o)===ye&&s.charCodeAt(o+1)===te))o++;o=Math.min(o+2,s.length),r+=s.slice(k,o);continue}if(w===te){let k=o;while(o<s.length&&s.charCodeAt(o)!==10)o++;r+=s.slice(k,o);continue}}if(C===Ae||C===be||C===We){l=!0,u=C,r+=s[o],o++;continue}if(C===L||C===Te||C===ae)c++;else if(C===ee||C===Pe||C===Ce)c--;if(c>=1&&C===Ie&&(o+1>=s.length||s.charCodeAt(o+1)!==Ie&&s.charCodeAt(o+1)!==De)){while(r.length>0&&(r[r.length-1]===" "||r[r.length-1]==="\t"||r[r.length-1]===`
|
|
25
|
-
`))r=r.slice(0,-1);o++;let w=0;while(o<s.length){let k=s.charCodeAt(o);if(k===Ae||k===be||k===We){let p=k;o++;while(o<s.length){if(s.charCodeAt(o)===Xe){o+=2;continue}if(s.charCodeAt(o)===p){o++;break}o++}continue}if(k===L||k===Te||k===ae)w++;else if(k===ee||k===Pe||k===Ce){if(w===0)break;w--}else if(k===et&&w===0)break;o++}continue}if(c===1&&C===st&&o+2<s.length&&s.charCodeAt(o+1)===st&&s.charCodeAt(o+2)===st){o+=3;continue}r+=s[o],o++}return r}function Yt(s){let r=s.trim(),o=r.startsWith("...");if(o)r=r.slice(3).trim();while(r.startsWith("@")){let T=1;while(T<r.length&&i(r.charCodeAt(T)))T++;if(T<r.length&&r.charCodeAt(T)===ae){let D=1;T++;while(T<r.length&&D>0){if(r.charCodeAt(T)===ae)D++;else if(r.charCodeAt(T)===Ce)D--;T++}}r=r.slice(T).trim()}let c=!0;while(c){c=!1;for(let T of qt)if(r.startsWith(T)&&r.length>T.length&&!i(r.charCodeAt(T.length))){let D=r.slice(T.length).trim();if(D.charCodeAt(0)===Ye||D.charCodeAt(0)===St&&D.length>1&&D.charCodeAt(1)===Ye)break;r=D,c=!0;break}}let l=-1,u=-1,C=0,w=!1,k=0;for(let T=0;T<r.length;T++){let D=r.charCodeAt(T);if(w){if(D===Xe){T++;continue}if(D===k)w=!1;continue}if(D===te&&T+1<r.length){let J=r.charCodeAt(T+1);if(J===ye){T+=2;while(T+1<r.length&&!(r.charCodeAt(T)===ye&&r.charCodeAt(T+1)===te))T++;T++;continue}if(J===te){while(T<r.length&&r.charCodeAt(T)!==10)T++;continue}}if(D===Ae||D===be||D===We){w=!0,k=D;continue}if(D===ae||D===L||D===Te||D===$e)C++;else if(D===Ce||D===ee||D===Pe||D===De&&!(T>0&&r.charCodeAt(T-1)===Ie))C--;else if(C===0){if(D===Ye&&l===-1)l=T;else if(D===Ie&&u===-1&&(T===0||r.charCodeAt(T-1)!==Ie)&&(T+1>=r.length||r.charCodeAt(T+1)!==Ie&&r.charCodeAt(T+1)!==De))u=T}}let p,x,O=u!==-1;if(l!==-1&&(u===-1||l<u))if(p=r.slice(0,l).trim(),u!==-1)x=r.slice(l+1,u).trim();else x=r.slice(l+1).trim();else if(u!==-1){p=r.slice(0,u).trim();let T=o?null:xe(p,r.slice(u+1));if(T)return je(T,gt);x=gt(r.slice(u+1).trim())}else p=r,x="unknown";if(p=wn(p),(p.startsWith("{")||p.startsWith("["))&&p.includes(`
|
|
26
|
-
`)){let T=p.replace(/\s*\n\s*/g," ").replace(/\s+/g," ");if(T.length<=40)p=T;else p=p.split(`
|
|
27
|
-
`).map((J)=>{let G=J.trim();if(!G)return"";if(G==="{"||G==="}"||G==="["||G==="]"||G.startsWith("}")||G.startsWith("]"))return G;return` ${G}`}).join(`
|
|
28
|
-
`)}let _=p.endsWith("?")||O;if(p.endsWith("?"))p=p.slice(0,-1).trim();let M=_&&!o?"?":"";if(o)return`...${p}: ${x}`;return`${p}${M}: ${x}`}function gt(s){let r=s.trim(),o=de(r);if(o)return o;if(r==="true"||r==="false")return"boolean";if(g(r))return"number";if(r.startsWith("'")&&r.endsWith("'")||r.startsWith('"')&&r.endsWith('"'))return"string";if(r.startsWith("["))return"unknown[]";if(r.startsWith("{"))return"Record<string, unknown>";return U(r)??"unknown"}function _t(s){let r=s.trim();if(r.endsWith("as const"))r=r.slice(0,-8).trim();if(r==="true"||r==="false")return r;if(g(r))return H(r);let o=$n(r);if(o!==null)return o;return U(r)??"unknown"}function $n(s){if(s==="")return null;if(s.charCodeAt(0)===Ae||s.charCodeAt(0)===be){if(At(s,0,s.charCodeAt(0))===s.length)return s}let r=xn(s,"+");if(r.length>1){let o=!1,c=!0,l=[];for(let u of r){let C=u.trim(),w=C.charCodeAt(0);if((w===Ae||w===be)&&At(C,0,w)===C.length)o=!0,l.push(yn(C));else c=!1}if(c)return vn(l.join(""));if(o)return"string";return null}if(/^[\d\s()+*/%.\-]+$/.test(s)&&/\d/.test(s)&&/[+*/%\-\s]/.test(s))return"number";return null}function xn(s,r){let o=[],c=0,l="",u=0;while(u<s.length){let C=s.charCodeAt(u);if(C===Ae||C===be||C===We){let w=At(s,u,C);l+=s.slice(u,w),u=w;continue}if(C===te&&(s.charCodeAt(u+1)===te||s.charCodeAt(u+1)===42)){if(s.charCodeAt(u+1)===te){let p=s.indexOf(`
|
|
29
|
-
`,u+2),x=p===-1?s.length:p;l+=s.slice(u,x),u=x;continue}let w=s.indexOf("*/",u+2),k=w===-1?s.length:w+2;l+=s.slice(u,k),u=k;continue}if(C===ae||C===Te||C===L)c++;else if(C===Ce||C===Pe||C===ee)c--;if(s[u]===r&&c===0){o.push(l),l="",u++;continue}l+=s[u],u++}return o.push(l),o}function yn(s){return s.slice(1,-1).replace(/\\(.)/g,(o,c)=>{if(c==="n")return`
|
|
30
|
-
`;if(c==="t")return"\t";if(c==="r")return"\r";if(c==="0")return"\x00";return c})}function vn(s){return`'${s.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}'`}function $t(s){if(s.endsWith("as const"))return null;let r=0,o=-1;for(let l=0;l<s.length;l++){let u=s.charCodeAt(l);if(u===Ae||u===be||u===We)l=At(s,l,u)-1;else if(u===123||u===91||u===40)r++;else if(u===125||u===93||u===41)r--;else if(r===0&&u===32&&l+4<=s.length&&s.substring(l,l+4)===" as ")o=l}if(o===-1)return null;return s.slice(o+4).trim()||null}function Ct(){if(y(),e<A&&f.charCodeAt(e)===Ye){let c=function(){let l=Z(s,o),u=(C)=>{let w=l.length-C.length;return w>=0&&l.endsWith(C)&&(w===0||!i(l.charCodeAt(w-1)))};return l.length===0||l.endsWith("=>")||l.endsWith("|")||l.endsWith("&")||u("is")||u("extends")};e++,y();let s=e,r=0,o=s;while(e<A){let l=e;if(Ne()){if(f.charCodeAt(l)!==te)o=e;continue}let u=f.charCodeAt(e);if(u===ae||u===Te||u===$e)r++;else if(u===Ce||u===Pe||u===De&&!Ze())r--;else if(u===L)if(r>0)r++;else if(c())r++;else break;else if(u===ee){if(r===0)break;r--}else if(r===0&&u===re)break;if(r===0&&mt()&&!c())break;if(!He(u))o=e+1;e++}return Z(s,e)}return""}function ot(s,r,o,c){e+=8,y();let l=e<A&&f.charCodeAt(e)===ye;if(l)e++,y();let u=Re();if(!u&&!c)return null;y();let C=it();y();let w=rt();y();let k=Ct(),p=k.length>0;if(!k)if(o&&l)k="AsyncGenerator<unknown, void, unknown>";else if(l)k="Generator<unknown, void, unknown>";else if(o)k="Promise<void>";else k="void";y();let x=!1;if(e<A&&f.charCodeAt(e)===L){x=!0;let G=e+1;if(Le(L,ee),!p&&!l){let j=f.slice(G,e-1),E=Mi(j,ne??"stdin.ts",()=>{let Ee;do Ee=`__dtsx_return_${pe++}`;while(f.includes(Ee));return Ee},(Ee)=>q.set(Ee.name,{...Ee,start:e,end:e}),C);k=E.finish(B(j,o,w,oe,E.resolve))}}else if(e<A&&f.charCodeAt(e)===re)e++;let O=dt(w),T=`${r?c?"export default function ":"export declare function ":"declare function "}${u||(c?"":"default")}${C}${O}: ${k};`,D=Je(s),J={kind:"function",name:u||"default",text:T,isExported:r,isDefault:c,isAsync:o,isGenerator:l,returnType:k,generics:C||void 0,leadingComments:D,start:s,end:e};if(x)ie.add(J);return J}let Et,Sn=0;function en(){Et??=new Set(t(f).filter((s)=>s.kind==="word").map((s)=>f.slice(s.start,s.end)));for(;;){let s=`__dtsx_binding_${Sn++}`;if(Et.has(s))continue;return Et.add(s),s}}function at(s,r,o){e+=r.length,y();let c=[];do{if(y(),e>=A)break;let l=f.charCodeAt(e),u,C=e;if(l===L||l===Te)Le(l,l===L?ee:Pe),u=f.slice(C,e);let w=u?en():Re();if(!w)return Be(),c;y();let k,p,x,O=!1;if(e<A&&f.charCodeAt(e)===Ye){e++,y();let G=e,j=0;while(e<A){if(Ne()){if(j===0&&Ut())break;continue}let E=f.charCodeAt(e);if(E===ae||E===L||E===Te||E===$e)j++;else if(E===Ce||E===ee||E===Pe||E===De&&!Ze())j--;else if(j===0&&(E===re||E===et))break;else if(j===0&&E===Ie&&!It())break;if(j===0&&(ft()||Vt()))break;e++}k=Z(G,e)}if(e<A&&f.charCodeAt(e)===Ie)if(me&&k&&(!Y||!Mn(k)))bn();else{e++,y();let G=e;x=G;let j=0,E=0,Ee;while(e<A){if(j===0&&E===0&&pn(G,Ee))break;if(Ne())continue;let se=f.charCodeAt(e);if(se===ae||se===L||se===Te)j++;else if(se===Ce||se===ee||se===Pe)j--;else if(se===$e){ve??=Q(f);let Me=j===0&&E===0?ve(e,G,Ee):void 0;if(Me?.parameters||Me?.completeOperand||Me&&ne!==void 0&&!/\.[jt]sx$/.test(ne)){e=Me.end,Ee=Me.completeOperand?Me.end:void 0;continue}let Nt=E>0||f[e+1]!=="/"&&we(f,e)?he(e):null;if(Nt){if(E=Math.max(0,E+Nt.delta),e=Nt.end+1,E===0)Ee=e;continue}else if(E===0){if(Me){e=Me.end,Ee=Me.completeOperand?Me.end:void 0;continue}}}else if(j===0&&E===0&&(se===re||se===et))break;e++}if(p=lt(Z(G,e)),p.endsWith(" as const")||p==="const"){if(O=!0,!k){let se=p.endsWith(" as const")?p.slice(0,-9).trim():p,Me=_t(se);k=Me!=="unknown"?Me:void 0}}else if(!k){let se=z(p)??$t(p)??oe(p);if(se)k=se}}let _=c.length===0?Je(s):void 0,M=u?"const":r,T=u?!1:o,D=`${T?"export ":""}declare ${M} ${w}: ${k||"unknown"};`,J={kind:"variable",name:w,text:D,isExported:T,typeAnnotation:k,value:p,initializerStart:x,modifiers:O?[M,"const assertion"]:[M],leadingComments:u?void 0:_,start:s,end:e};if(u)c.push(...ar({pattern:u,patternOffset:C,root:J,kind:r,exported:o,comments:_,allocateName:en}));else c.push(J);if(f.charCodeAt(e)===et){e++;continue}if(f.charCodeAt(e)===re)e++;break}while(e<A);return c}function Rt(s,r){e+=9,y();let o=Re();y();let c=it();y();let l="";if(v("extends")){e+=7,y();let p=e,x=0;while(e<A){if(Ne())continue;let O=f.charCodeAt(e);if(O===$e)x++;else if(O===De&&!Ze())x--;else if(O===L&&x===0)break;e++}l=Z(p,e)}y();let u=e<A&&f.charCodeAt(e)===L?Ot():"{}",C=Xt(u),w=`${r?"export ":""}declare interface ${o}${c}${l?` extends ${l}`:""} ${C}`,k=Je(s);return{kind:"interface",name:o,text:w,isExported:r,extends:l||void 0,generics:c||void 0,leadingComments:k,start:s,end:e}}function Pt(s,r){e+=4,y();let o=Re();y();let c=it();if(y(),e<A&&f.charCodeAt(e)===Ie)e++;y();let l=e,u=0;while(e<A){if(Ne())continue;let p=f.charCodeAt(e);if(p===ae||p===L||p===Te||p===$e)u++;else if(p===Ce||p===ee||p===Pe||p===De&&!Ze())u--;else if(u===0&&p===re)break;if(u===0&&(ft()||Vt()))break;e++}let C=Z(l,e);if(e<A&&f.charCodeAt(e)===re)e++;let w=`${r?"export ":""}type ${o}${c} = ${C}`,k=Je(s);return{kind:"type",name:o,text:w,isExported:r,generics:c||void 0,leadingComments:k,start:s,end:e}}function ut(s,r,o){e+=4,y();let c=Re();y();let l=e;if(e<A&&f.charCodeAt(e)===L)Le(L,ee);let u=Z(s,e),C=Je(s);return{kind:"enum",name:c,text:u,isExported:r,modifiers:o?["const"]:void 0,leadingComments:C,start:s,end:e}}function ct(s,r,o,c=!1){e+=5,y();let l=Re()||"AnonymousClass";y();let u=it();y();let C="";if(v("extends")){e+=7,y();let _=e,M=0;while(e<A){if(Ne())continue;let T=f.charCodeAt(e);if(T===$e)M++;else if(T===De&&!Ze())M--;else if(M===0&&(T===L||v("implements")))break;e++}C=Z(_,e)}let w;if(v("implements")){e+=10,y();let _=e,M=0;while(e<A){if(Ne())continue;let D=f.charCodeAt(e);if(D===$e)M++;else if(D===De&&!Ze())M--;else if(M===0&&D===L)break;e++}let T=Z(_,e);if(T)w=T.split(",").map((D)=>D.trim())}y();let k=Wt(),x=`${r?c?"export default ":"export declare ":"declare "}${o?"abstract ":""}class ${l}${u}${C?` extends ${C}`:""}${w&&w.length>0?` implements ${w.join(", ")}`:""} ${k}`,O=Je(s);return{kind:"class",name:l,text:x,isExported:r,isDefault:c,extends:C||void 0,implements:w,generics:u||void 0,modifiers:o?["abstract"]:void 0,leadingComments:O,start:s,end:e}}let Mt;function Wt(){if(e>=A||f.charCodeAt(e)!==L)return"{}";e++;let s={fields:new Map,pending:[],isStatic:!1};ue.push(s);let r=[],o=new Set;while(e<A){if(y(),e>=A)break;if(f.charCodeAt(e)===ee){e++;break}if(f.charCodeAt(e)===re){e++;continue}if(Mt=Je(e),v("static")&&yt("static")===L){e+=6,y(),Le(L,ee);continue}let c=!1,l=!1,u=!1,C=!1,w=!1,k=!1,p=!1,x=!1,O=!0;while(O){y();let G=e,j=Re();if(e=G,j){let E=yt(j);if(E===ae||E===$e||E===St||E===33||E===Ye||E===Ie||E===re||E===ee)break}if(v("private")){c=!0,e+=7;continue}if(v("protected")){l=!0,e+=9;continue}if(v("public")){e+=6;continue}if(v("static")){u=!0,e+=6;continue}if(v("abstract")){C=!0,e+=8;continue}if(v("readonly")){w=!0,e+=8;continue}if(v("override")){k=!0,e+=8;continue}if(v("accessor")){p=!0,e+=8;continue}if(v("async")){x=!0,e+=5;continue}if(v("declare")){e+=7;continue}break}if(y(),e>=A||f.charCodeAt(e)===ee)break;let _=e;if(s.isStatic=u,(v("get")||v("set"))&&Lt(yt(f.slice(e,e+3))))e+=3,y();if(f.charCodeAt(e)===ye)e++,y();let M=xt();e=_;let T=M.startsWith("#");if(T)c=!0;if(c&&M&&M!=="constructor"){let G=T?u?" static #private_static;":" #private;":` private ${u?"static ":""}${M};`,E=M[0]==="'"||M[0]==='"'?d(M)??M:M,Ee=T?`${u?"static":"instance"}#`:`${u?"static:":"instance:"}${E}`;if(!o.has(Ee))o.add(Ee),r.push(G)}let D=c?[]:r,J=" ";if(l)J+="protected ";if(u)J+="static ";if(C)J+="abstract ";if(w)J+="readonly ";if(v("constructor")){e+=11,y();let G=rt();if(y(),Dn(G,r),e<A&&f.charCodeAt(e)===L)Le(L,ee);else if(e<A&&f.charCodeAt(e)===re)e++;let j=dt(G);r.push(c?" private constructor();":` ${l?"protected ":""}constructor${j};`)}else if(v("get"))if(e+=3,y(),e<A&&Lt(f.charCodeAt(e))){let G=xt();if(G.startsWith("#")){if(y(),e<A&&f.charCodeAt(e)===ae)rt();if(y(),Ct(),y(),e<A&&f.charCodeAt(e)===L)Le(L,ee);else if(e<A&&f.charCodeAt(e)===re)e++;continue}y(),rt(),y();let j=Ct(),E;if(y(),e<A&&f.charCodeAt(e)===L){let se=e+1;if(Le(L,ee),!j&&!me)E=f.slice(se,e-1),j=B(E,!1,"()",(Me)=>Se(Me,u))}else if(e<A&&f.charCodeAt(e)===re)e++;let Ee=D.length;if(D.push(`${J}get ${G}(): ${E?W(j):j||"unknown"};`),E)s.pending.push(()=>{let se=B(E,!1,"()",(Me)=>Se(Me,u));D[Ee]=`${J}get ${G}(): ${W(se)};`})}else nn("get",J,u,w,x,D);else if(v("set"))if(e+=3,y(),e<A&&Lt(f.charCodeAt(e))){let G=xt();if(G.startsWith("#")){if(y(),e<A&&f.charCodeAt(e)===ae)rt();if(y(),e<A&&f.charCodeAt(e)===L)Le(L,ee);else if(e<A&&f.charCodeAt(e)===re)e++;continue}y();let j=rt();if(y(),e<A&&f.charCodeAt(e)===L)Le(L,ee);else if(e<A&&f.charCodeAt(e)===re)e++;let E=dt(j);D.push(`${J}set ${G}${E};`)}else nn("set",J,u,w,x,D);else{let G=f.charCodeAt(e)===ye;if(G)e++,y();let j=xt();if(!j){tn();continue}sn(j,J,u,w,G,C,x,D)}}for(let c of s.pending)c();return ue.pop(),`{
|
|
31
|
-
${r.join(`
|
|
32
|
-
`)}
|
|
33
|
-
}`}function Lt(s){return a(s)||s===Te||s===ln||s===Ae||s===be}function xt(){if(e>=A)return"";let s=f.charCodeAt(e);if(s===Te){let r=e;return Le(Te,Pe),f.slice(r,e)}if(s===ln)return e++,`#${Re()}`;if(s===Ae||s===be){let r=e;return nt(s),f.slice(r,e)}return Re()}function yt(s){let r=e;e+=s.length,y();let o=e<A?f.charCodeAt(e):0;return e=r,o}function tn(){let s=0;while(e<A){if(Ne())continue;let r=f.charCodeAt(e);if(r===L||r===ae)s++;else if(r===ee||r===Ce){if(s===0)return;s--}else if(r===re&&s===0){e++;return}if(s===0&&mt())return;e++}}function nn(s,r,o,c,l,u){sn(s,r,o,c,!1,!1,l,u)}function sn(s,r,o,c,l,u,C,w){let k=Mt;if(Mt=void 0,y(),e>=A)return;let p=f.charCodeAt(e),x=!1;if(p===St)x=!0,e++,y();if(e<A&&f.charCodeAt(e)===33)e++,y();let O=e<A?f.charCodeAt(e):0;if(O===ae||O===$e){let _=O===$e?it():"";y();let M=rt();y();let T=Ct(),D,J=T.length>0;if(!T)if(C&&l)T="AsyncGenerator<unknown, void, unknown>";else if(l)T="Generator<unknown, void, unknown>";else if(C)T="Promise<void>";else T="void";if(y(),e<A&&f.charCodeAt(e)===L){let Ee=e+1;if(Le(L,ee),!J&&!l)D=f.slice(Ee,e-1),T=B(D,C,M,(se)=>Se(se,o))}else if(e<A&&f.charCodeAt(e)===re)e++;let G=dt(M),j=x?"?":"",E=w.length;if(w.push(`${r}${s}${j}${_}${G}: ${D?W(T):T};`),D)ue.at(-1)?.pending.push(()=>{let Ee=B(D,C,M,(se)=>Se(se,o));w[E]=`${r}${s}${j}${_}${G}: ${W(Ee)};`})}else if(O===Ye||O===Ie||O===re||O===ee||O===ke||O===Oe){let _="";if(O===Ye){e++,y();let G=e,j=0;while(e<A){if(Ne())continue;let E=f.charCodeAt(e);if(E===ae||E===L||E===Te||E===$e)j++;else if(E===Ce||E===ee||E===Pe||E===De&&!Ze()){if(j===0)break;j--}else if(j===0&&(E===re||E===et))break;else if(j===0&&E===Ie&&!It())break;if(j===0&&mt())break;e++}_=Z(G,e)}let M="";if(e<A&&f.charCodeAt(e)===Ie)if(me&&_){e++;let G=0;while(e<A){if(Ne())continue;let j=f.charCodeAt(e);if(j===ae||j===L||j===Te)G++;else if(j===Ce||j===ee||j===Pe){if(G===0&&j===ee)break;G--}else if(G===0&&j===re)break;if(G===0&&mt())break;e++}}else{e++,y();let G=e,j=0;while(e<A){if(Ne())continue;let E=f.charCodeAt(e);if(E===ae||E===L||E===Te)j++;else if(E===Ce||E===ee||E===Pe){if(j===0&&E===ee)break;j--}else if(j===0&&E===re)break;if(j===0&&mt())break;e++}M=Z(G,e)}if(e<A&&f.charCodeAt(e)===re)e++;let T=_.length>0;if(!_)if(M){let G=$t(M);if(G)_=G;else _=M.endsWith("as const")||o&&c?_t(M):gt(M)}else _="unknown";let D=x?"?":"";ue.at(-1)?.fields.set(`${o?"static:":""}${s}`,x?`(${_}) | undefined`:_);let J=Y&&!T&&M?Ht(k,M,_):"";w.push(`${J}${r}${s}${D}: ${_};`)}else tn()}function Tn(s){let r=0;for(let o=0;o<s.length;o++){let c=s.charCodeAt(o);if(c===ae||c===L||c===Te||c===$e)r++;else if(c===Ce||c===ee||c===Pe||c===De&&s.charCodeAt(o-1)!==Ie)r--;else if(c===Ie&&r===0&&s.charCodeAt(o+1)!==De&&s.charCodeAt(o+1)!==Ie)return!0}return!1}function Dn(s,r){let o=s.slice(1,-1).trim();if(!o)return;let c=[],l=0,u=0,C=!1,w=0,k=[];for(let p=0;p<=o.length;p++){if(p===o.length){k.push(o.slice(l)),c.push(wt(o.slice(l).trim()));break}let x=o.charCodeAt(p);if(C){if(x===Xe){p++;continue}if(x===w)C=!1;continue}if(x===te&&p+1<o.length){let O=o.charCodeAt(p+1);if(O===ye){p+=2;while(p+1<o.length&&!(o.charCodeAt(p)===ye&&o.charCodeAt(p+1)===te))p++;p++;continue}if(O===te){while(p<o.length&&o.charCodeAt(p)!==10)p++;continue}}if(x===Ae||x===be||x===We){C=!0,w=x;continue}if(x===ae||x===L||x===Te||x===$e)u++;else if(x===Ce||x===ee||x===Pe||x===De&&!(p>0&&o.charCodeAt(p-1)===Ie))u--;else if(x===et&&u===0)k.push(o.slice(l,p)),c.push(wt(o.slice(l,p).trim())),l=p+1}for(let[p,x]of c.entries()){let O=x.startsWith("public ")||x.startsWith("public\t"),_=x.startsWith("protected ")||x.startsWith("protected\t"),M=x.startsWith("private ")||x.startsWith("private\t"),T=x.includes("readonly ");if(!O&&!_&&!M&&!T)continue;let D=x,J=[];if(M){let se=7;while(se<D.length&&He(D.charCodeAt(se)))se++;D=D.slice(se),J.push("private")}if(O){let se=6;while(se<D.length&&He(D.charCodeAt(se)))se++;D=D.slice(se),J.push("public")}if(_){let se=9;while(se<D.length&&He(D.charCodeAt(se)))se++;D=D.slice(se),J.push("protected")}if(T){let se=D.indexOf("readonly ");if(se!==-1){let Me=se+8;while(Me<D.length&&He(D.charCodeAt(Me)))Me++;D=D.slice(0,se)+D.slice(Me)}J.push("readonly")}let G=J.length>0?`${J.join(" ")} `:"",j=Yt(D),E=D.search(/[?:=]/);if(E!==-1&&D.charCodeAt(E)!==63&&Tn(D))j=j.replace(/^([\w$]+)\?:/,"$1:");let Ee="";if(Y&&!M&&E!==-1&&D.charCodeAt(E)===Ie){let se=D.slice(E+1);Ee=Ht(nr(k[p]),se,gt(se))}r.push(M?` private ${j.split(/[?:]/,1)[0]};`:`${Ee} ${G}${j};`)}}function Bt(s=" "){if(e>=A||f.charCodeAt(e)!==L)return"{}";e++;let r=[];while(e<A){if(y(),e>=A)break;if(f.charCodeAt(e)===ee){e++;break}if(f.charCodeAt(e)===re){e++;continue}let o=!1;if(v("export"))o=!0,e+=6,y();if(v("declare"))e+=7,y();let c=o?"export ":"";if(v("function")||v("async")&&In("async","function")){let l=!1;if(v("async"))l=!0,e+=5,y();if(e+=8,y(),e<A&&f.charCodeAt(e)===ye)e++,y();let C=Re();y();let w=it();y();let k=rt();y();let p=Ct();if(!p)p=l?"Promise<void>":"void";if(y(),e<A&&f.charCodeAt(e)===L)Le(L,ee);else if(e<A&&f.charCodeAt(e)===re)e++;let x=dt(k);r.push(`${s}${c}function ${C}${w}${x}: ${p};`)}else if(v("const")||v("let")||v("var")){let l=v("const")?"const":v("let")?"let":"var";e+=l.length,y();let u=Re();if(!u){Be(!0);continue}y();let C="";if(e<A&&f.charCodeAt(e)===Ye){e++,y();let k=e,p=0;while(e<A){if(Ne())continue;let x=f.charCodeAt(e);if(x===ae||x===L||x===Te||x===$e)p++;else if(x===ee&&p===0)break;else if(x===Ce||x===ee||x===Pe||x===De&&!Ze())p--;else if(p===0&&(x===re||x===et))break;else if(p===0&&x===Ie&&!It())break;if(p===0&&ft())break;e++}C=Z(k,e)}let w="";if(e<A&&f.charCodeAt(e)===Ie){e++,y();let k=e,p=0;while(e<A){if(Ne())continue;let x=f.charCodeAt(e);if(x===ae||x===L||x===Te||x===$e)p++;else if(x===ee&&p===0)break;else if(x===Ce||x===ee||x===Pe||x===De&&!Ze())p--;else if(p===0&&(x===re||x===et))break;if(p===0&&ft())break;e++}w=Z(k,e)}if(e<A&&f.charCodeAt(e)===re)e++;if(!C&&w){let k=$t(w);if(k)C=k;else if(l==="const")C=_t(w);else C=gt(w)}if(!C)C="unknown";r.push(`${s}${c}${l} ${u}: ${C};`)}else if(v("interface")){e+=9,y();let l=Re();y();let u=it();y();let C="";if(v("extends")){e+=7,y();let k=e,p=0;while(e<A){if(Ne())continue;let x=f.charCodeAt(e);if(x===$e)p++;else if(x===De&&!Ze())p--;else if(x===L&&p===0)break;e++}C=Z(k,e)}let w=Xt(Ot());r.push(`${s}${c}interface ${l}${u}${C?` extends ${C}`:""} ${w}`)}else if(v("type")){e+=4,y();let l=Re();y();let u=it();if(y(),e<A&&f.charCodeAt(e)===Ie){e++,y();let C=e,w=0;while(e<A){if(Ne())continue;let p=f.charCodeAt(e);if(p===ae||p===L||p===Te||p===$e)w++;else if(p===ee&&w===0)break;else if(p===Ce||p===ee||p===Pe||p===De&&!Ze())w--;else if(w===0&&p===re)break;if(w===0&&ft())break;e++}let k=Z(C,e);if(e<A&&f.charCodeAt(e)===re)e++;r.push(`${s}${c}type ${l}${u} = ${k}`)}}else if(v("class")){e+=5,y();let l=Re();y();let u=it();y();let C=e,w=0;while(e<A){if(Ne())continue;let O=f.charCodeAt(e);if(O===$e)w++;else if(O===De&&!Ze())w--;else if(O===L&&w===0)break;e++}let k=Z(C,e),p=k?` ${k}`:"",x=Wt();r.push(`${s}${c}class ${l}${u}${p} ${x}`)}else if(v("enum")){e+=4,y();let l=Re();y();let u=Ot();r.push(`${s}${c}enum ${l} ${u}`)}else if(v("namespace")||v("module")){let l=v("namespace")?"namespace":"module";e+=l.length,y();let u=Re();y();let C=Bt(s);r.push(`${s}${c}${l} ${u} ${C}`)}else if(v("abstract"))if(e+=8,y(),v("class")){e+=5,y();let l=Re();y();let u=it();y();let C=e,w=0;while(e<A){if(Ne())continue;let O=f.charCodeAt(e);if(O===$e)w++;else if(O===De&&!Ze())w--;else if(O===L&&w===0)break;e++}let k=Z(C,e),p=k?` ${k}`:"",x=Wt();r.push(`${s}${c}abstract class ${l}${u}${p} ${x}`)}else Be(!0);else if(o&&v("default")){e+=7,y();let l=e;Be(!0);let u=Z(l,e);if(u.charCodeAt(u.length-1)===re)u=u.slice(0,-1);if(u)r.push(`${s}export default ${u};`)}else if(!o&&(f.charCodeAt(e)===Ae||f.charCodeAt(e)===be||f.charCodeAt(e)===We))Be(!0);else Be(!0)}if(r.length===0)return"{}";return`{
|
|
34
|
-
${r.join(`
|
|
35
|
-
`)}
|
|
36
|
-
}`}function In(s,r){let o=e+s.length;while(o<A&&He(f.charCodeAt(o)))o++;for(let c=0;c<r.length;c++)if(o+c>=A||f.charCodeAt(o+c)!==r.charCodeAt(c))return!1;return o+r.length>=A||!i(f.charCodeAt(o+r.length))}function ht(s,r,o){e+=o.length,y();let c="",l=f.charCodeAt(e);if(l===Ae||l===be){let p=e;nt(l),c=f.slice(p,e)}else{c=Re();while(e<A&&f.charCodeAt(e)===st)e++,c+=`.${Re()}`}y();let u=e<A&&f.charCodeAt(e)===L?Bt():"{}",C=`${r?"export ":""}declare ${o} ${c} ${u}`,w=Je(s),k=c.startsWith("'")||c.startsWith('"');return{kind:"module",name:c,text:C,isExported:r,moduleForm:k?"quoted":o==="namespace"?"namespace":"identifier",source:k?c.slice(1,-1):void 0,leadingComments:w,start:s,end:e}}function rn(s,r){Be();let o=Z(r,e);if(o.charCodeAt(o.length-1)===re)o=o.slice(0,-1).trimEnd();if(!o)return;let c=a(o.charCodeAt(0));for(let x=1;c&&x<o.length;x++)c=i(o.charCodeAt(x));let l=Je(s);if(c){N.push({kind:"export",name:"default",text:`export default ${o};`,isExported:!0,isTypeOnly:!1,leadingComments:l,start:s,end:e});return}let u="__dtsx_default_export__",C=1;while(f.includes(u))u=`__dtsx_default_export_${C++}__`;let k=$t(o)||oe(o)||n(o,!1),p=k==="unknown"&&Pn(o)?`typeof ${o}`:k;N.push({kind:"variable",name:u,text:`declare const ${u}: ${p};`,isExported:!1,typeAnnotation:p,modifiers:["const"],start:s,end:e}),N.push({kind:"export",name:"default",text:`export default ${u};`,isExported:!0,isTypeOnly:!1,leadingComments:l,start:s,end:e})}function on(){if(f.charCodeAt(e)===L)return Le(L,ee),!0;let s=v("if"),r=v("do"),o=v("try"),c=v("for");if(!s&&!r&&!o&&!c&&!v("while")&&!v("switch")&&!v("with"))return!1;if(Re(),y(),c&&v("await"))e+=5,y();if(!r&&!o&&f.charCodeAt(e)===ae)Le(ae,Ce);if(vt(),y(),s&&v("else"))e+=4,vt();else if(r&&v("while")){if(e+=5,y(),f.charCodeAt(e)===ae)Le(ae,Ce);if(y(),f.charCodeAt(e)===re)e++}else if(o){if(v("catch")){if(e+=5,y(),f.charCodeAt(e)===ae)Le(ae,Ce);vt(),y()}if(v("finally"))e+=7,vt()}return!0}function vt(){if(y(),!on())Be()}while(e<A){if(y(),e>=A)break;if(on())continue;let s=e,r=f.charCodeAt(e);if(r===105&&v("import"))N.push(kn(s));else if(r===101&&v("export")){e+=6,y();let o=f.charCodeAt(e);if(o===100&&v("default")){e+=7,y();let c=e,l=f.charCodeAt(e);if(l===102&&v("function")){let u=ot(s,!0,!1,!0);if(u)N.push(u)}else if(l===97&&v("async")&&yt("async")!==re)if(e+=5,y(),v("function")){let u=ot(s,!0,!0,!0);if(u)N.push(u)}else rn(s,c);else if(l===99&&v("class")){let u=ct(s,!0,!1,!0);N.push(u)}else if(l===97&&v("abstract")){if(e+=8,y(),v("class")){let u=ct(s,!0,!0,!0);N.push(u)}}else rn(s,c)}else if(o===116&&v("type")){let c=e;if(e+=4,y(),e<A&&f.charCodeAt(e)===L){Qt();let l=Z(s,e),u=Je(s);N.push({kind:"export",name:"",text:l,isExported:!0,isTypeOnly:!0,source:kt(l),leadingComments:u,start:s,end:e})}else if(e<A&&f.charCodeAt(e)===ye){Jt();let l=Z(s,e);N.push({kind:"export",name:"",text:l,isExported:!0,isTypeOnly:!0,source:kt(l),start:s,end:e})}else{e=c;let l=Pt(s,!0);N.push(l)}}else if(o===105&&v("interface")){let c=Rt(s,!0);N.push(c)}else if(o===102&&v("function")){let c=ot(s,!0,!1,!1);if(c)N.push(c)}else if(o===97&&v("async"))if(e+=5,y(),v("function")){let c=ot(s,!0,!0,!1);if(c)N.push(c)}else Be();else if(o===99)if(v("class")){let c=ct(s,!0,!1);N.push(c)}else if(v("const")){let c=e;if(e+=5,y(),v("enum")){e=c+5,y();let l=ut(s,!0,!0);N.push(l)}else{e=c;let l=at(s,"const",!0);for(let u=0;u<l.length;u++)N.push(l[u])}}else Be();else if(o===97&&v("abstract")){if(e+=8,y(),v("class")){let c=ct(s,!0,!0);N.push(c)}}else if(o===108&&v("let")){let c=at(s,"let",!0);for(let l=0;l<c.length;l++)N.push(c[l])}else if(o===118&&v("var")){let c=at(s,"var",!0);for(let l=0;l<c.length;l++)N.push(c[l])}else if(o===101&&v("enum")){let c=ut(s,!0,!1);N.push(c)}else if(o===100&&v("declare"))e+=7,y(),an(s,!0);else if(o===110&&v("namespace")&&bt(9)){let c=ht(s,!0,"namespace");N.push(c)}else if(o===109&&v("module")&&bt(6)){let c=ht(s,!0,"module");N.push(c)}else if(o===L){Qt();let c=Z(s,e),l=c.includes("export type"),u=Je(s);N.push({kind:"export",name:"",text:c,isExported:!0,isTypeOnly:l,source:kt(c),leadingComments:u,start:s,end:e})}else if(o===ye){Jt();let c=Z(s,e),l=Je(s);N.push({kind:"export",name:"",text:c,isExported:!0,isTypeOnly:!1,source:kt(c),leadingComments:l,start:s,end:e})}else{Be();let c=Z(s,e);if(c)N.push({kind:"export",name:"",text:c,isExported:!0,start:s,end:e})}}else if(r===100&&v("declare"))e+=7,y(),an(s,!1);else if(r===105&&v("interface")){let o=Rt(s,!1);q.set(o.name,o)}else if(r===116&&v("type")){let o=Pt(s,!1);q.set(o.name,o),N.push(o)}else if(r===102&&v("function")){let o=ot(s,!1,!1,!1);if(o)Ke(o);else Be()}else if(r===97)if(v("async")){let o=e;if(e+=5,y(),v("function")){let c=ot(s,!1,!0,!1);if(c)Ke(c);else e=o,Be()}else e=o,Be()}else if(v("abstract"))if(e+=8,y(),v("class")){let o=ct(s,!1,!1);q.set(o.name,o),N.push(o)}else Be();else e++,Be();else if(r===99)if(v("class")){let o=ct(s,!1,!1);q.set(o.name,o),N.push(o)}else if(v("const")){let o=e;if(e+=5,y(),v("enum")){e=o+5,y();let c=ut(s,!1,!0);q.set(c.name,c),N.push(c)}else{e=o;let c=at(s,"const",!1);for(let l=0;l<c.length;l++)q.set(c[l].name,c[l])}}else e++,Be();else if(r===101&&v("enum")){let o=ut(s,!1,!1);q.set(o.name,o),N.push(o)}else if(r===108&&v("let")||r===118&&v("var")){let o=v("let")?"let":"var",c=at(s,o,!1);for(let l=0;l<c.length;l++)q.set(c[l].name,c[l])}else if(r===109&&v("module")&&bt(6)){let o=ht(s,!1,"module");N.push(o)}else if(r===110&&v("namespace")&&bt(9)){let o=ht(s,!1,"namespace");N.push(o)}else{let o=f.charCodeAt(e);if(o===re)e++;else if(o===Ae||o===be){if(nt(o),e<A&&f.charCodeAt(e)===re)e++}else if(o===We){if(pt(),e<A&&f.charCodeAt(e)===re)e++}else if(o===En){if(e++,Re(),y(),e<A&&f.charCodeAt(e)===st)e++,Re(),y();if(e<A&&f.charCodeAt(e)===ae)Le(ae,Ce)}else e++,Be()}}if(ie.size>0){cn(N);for(let s of ge.values())cn(s)}if(Un(f,N,q,ge),zn(N,q),rr(N,q),!me)qn(f,N,q,fe);if(le){let s=new Set(N);for(let r of[...q.values(),...[...ge.values()].flat()])if(!s.has(r))N.push(r),s.add(r);return N.sort((r,o)=>(r.start??0)-(o.start??0))}if(q.size>0)Wn(N,q,ge);return N;function cn(s){let r=new Map;for(let c of s)if(c.kind==="function")r.set(c.name,(r.get(c.name)||0)+1);let o=new Set;for(let[c,l]of r)if(l>1)o.add(c);if(o.size>0){let c=new Set;for(let l of o)for(let u=s.length-1;u>=0;u--)if(s[u].kind==="function"&&s[u].name===l&&ie.has(s[u])){c.add(u);break}if(c.size>0){let l=[...c].sort((u,C)=>C-u);for(let u of l)s.splice(u,1)}}}function an(s,r){if(v("function")){let o=ot(s,r,!1,!1);if(o)N.push(o)}else if(v("async")){if(e+=5,y(),v("function")){let o=ot(s,r,!0,!1);if(o)N.push(o)}}else if(v("class")){let o=ct(s,r,!1);N.push(o)}else if(v("abstract")){if(e+=8,y(),v("class")){let o=ct(s,r,!0);N.push(o)}}else if(v("interface")){let o=Rt(s,r);N.push(o)}else if(v("type")){let o=Pt(s,r);N.push(o)}else if(v("enum")){let o=ut(s,r,!1);N.push(o)}else if(v("const")){let o=e;if(e+=5,y(),v("enum")){e=o+5,y();let c=ut(s,r,!0);N.push(c)}else{e=o;let c=at(s,"const",r);for(let l=0;l<c.length;l++)if(r||!qe)N.push(c[l]);else q.set(c[l].name,c[l])}}else if(v("let")||v("var")){let o=v("let")?"let":"var",c=at(s,o,r);for(let l=0;l<c.length;l++)if(r||!qe)N.push(c[l]);else q.set(c[l].name,c[l])}else if(v("module")){let o=ht(s,r,"module");N.push(o)}else if(v("namespace")){let o=ht(s,r,"namespace");N.push(o)}else if(v("global")){e+=6,y();let c=`declare global ${e<A&&f.charCodeAt(e)===L?Bt():"{}"}`,l=Je(s);N.push({kind:"module",name:"global",text:c,isExported:!1,moduleForm:"global",leadingComments:l,start:s,end:e})}else Be()}}class dn{names;lengths=new Uint8Array(65);firstUnits=new Uint8Array(65536);size;constructor(I){this.names=I;for(let ne of I.keys()){if(!ne)continue;this.lengths[Math.min(ne.length,64)]=1,this.firstUnits[ne.charCodeAt(0)]=1}this.size=I.size}scan(I,ne){if(this.size===0)return!1;let K=!1,X=0,le=I.length;while(X<le){let fe=I.charCodeAt(X);if(fe>=65&&fe<=90||fe>=97&&fe<=122||fe===95||fe===36||fe>127){let f=X;X++;while(X<le){let Y=I.charCodeAt(X);if(Y>=65&&Y<=90||Y>=97&&Y<=122||Y>=48&&Y<=57||Y===95||Y===36||Y>127)X++;else break}if(this.firstUnits[fe]===1&&this.lengths[Math.min(X-f,64)]===1){let Y=I.substring(f,X),me=this.names.get(Y);if(me!==void 0){if(ne.add(Y),me.kind==="function"||me.kind==="variable")K=!0}}}else X++}return K}}function fn(I,ne){let K=0;while(K<I.length){let X=I.charCodeAt(K);if(X===Ae||X===be||X===We){let he=X;K++;while(K<I.length)if(I.charCodeAt(K)===Xe)K+=2;else if(I.charCodeAt(K++)===he)break;continue}if(X===te&&I.charCodeAt(K+1)===te){K+=2;while(K<I.length&&I.charCodeAt(K)!==ke&&I.charCodeAt(K)!==Oe)K++;continue}if(X===te&&I.charCodeAt(K+1)===ye){let he=I.indexOf("*/",K+2);K=he===-1?I.length:he+2;continue}if(!a(X)){K++;continue}let le=K++;while(K<I.length&&i(I.charCodeAt(K)))K++;let fe=le-1,f=K;while(fe>=0&&He(I.charCodeAt(fe)))fe--;while(f<I.length&&He(I.charCodeAt(f)))f++;let Y=fe>=0?I.charCodeAt(fe):0,me=f<I.length?I.charCodeAt(f):0,A=le>=3&&I.slice(le-3,le)==="...";if(me===Ye||Y===st&&!A)continue;if(me===ae&&(Y===L||Y===et))continue;ne.add(I.slice(le,K))}}function Wn(I,ne,K){let X=new Set,le=new Set;for(let he of I)le.add(he.name);let fe=new dn(ne),f=new Set,Y=new Set,me=(he)=>{if(fe.scan(he.text,f))tr(he,Y)},A=new Set;for(let he=0;he<I.length;he++){let qe=I[he];if(qe.kind!=="import"){if(me(qe),typeof qe.value==="string")fn(qe.value,A)}}for(;;){let he=[];for(let[q,ge]of ne){if(X.has(q))continue;if((ge.kind==="function"||ge.kind==="variable"?Y:f).has(q)||ge.kind!=="function"&&A.has(q)){if(!le.has(q)){let e=ge.kind==="function"?K.get(q):void 0;if(e)for(let ve of e)he.push(ve);else he.push(ge);le.add(q)}X.add(q)}}if(he.length===0)break;he.sort((q,ge)=>(q.start??1/0)-(ge.start??1/0));let qe=[],N=0;for(let q=0;q<I.length;q++){let ge=I[q].start??1/0;while(N<he.length&&(he[N].start??1/0)<=ge)qe.push(he[N++]);qe.push(I[q])}while(N<he.length)qe.push(he[N++]);I.length=0;for(let q=0;q<qe.length;q++)I.push(qe[q]);for(let q of he)if(q.kind!=="import"){if(me(q),typeof q.value==="string")fn(q.value,A)}}}
|
|
37
|
-
export{Mi,Fa,P,F,jt};
|