builder.io 1.1.23 → 1.1.24-2
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/cli/index.cjs +485 -257
- package/cli/index.cjs.map +7 -0
- package/cli/main.cjs +2 -0
- package/core/index.cjs +55 -74
- package/core/index.mjs +55 -74
- package/node/index.cjs +3 -1
- package/node/index.mjs +3 -1
- package/package.json +10 -6
- package/remix/build.cjs +1 -1
- package/remix/index.mjs +1 -1
- package/server/index.cjs +30 -46
- package/server/index.mjs +30 -46
- package/types/cli/builder-add/interface.d.ts +5 -2
- package/types/cli/builder-add/options.d.ts +2 -7
- package/types/cli/constants.d.ts +1 -0
- package/types/cli/figma-publish.d.ts +20 -1
- package/types/cli/index.d.ts +0 -1
- package/types/cli/sync-utils.d.ts +10 -0
- package/types/client/client-api.d.ts +1 -1
- package/types/common/builder/builder-api.d.ts +2 -1
- package/types/common/constants.d.ts +1 -0
- package/types/common/utils.d.ts +1 -1
- package/types/core/adapters/angular/angular-app-module-imports.d.ts +2 -2
- package/types/core/adapters/angular/angular-ensure-builder-setup.d.ts +1 -1
- package/types/core/adapters/react/react-ensure-builder-setup.d.ts +1 -1
- package/types/core/find-dependencies.d.ts +7 -0
- package/types/node/node-sys.d.ts +1 -0
- package/types/server/builder-connect.d.ts +2 -2
- package/types/types.d.ts +82 -1
- package/vite/index.cjs +1 -1
- package/vite/index.mjs +1 -1
- package/webpack/index.cjs +14 -15
- package/webpack/index.mjs +14 -15
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function addCommand(opts:
|
|
1
|
+
import type { AddCliOptions, FileNode, FolderNode, Snippet, SyncInfo } from "../../types";
|
|
2
|
+
export declare function addCommand(opts: AddCliOptions): Promise<SyncInfo | undefined>;
|
|
3
|
+
export declare function fetchSnippet(id: string): Promise<Snippet | null>;
|
|
4
|
+
export declare function writeFiles(snippet: Snippet, files: Array<FileNode | FolderNode>, rootPath: string): Promise<FileNode[]>;
|
|
5
|
+
export declare function suggestRootPath(framework: string): string;
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
cwd: string;
|
|
4
|
-
command?: string;
|
|
5
|
-
snippetId?: string;
|
|
6
|
-
path?: string;
|
|
7
|
-
}
|
|
1
|
+
import type { AddCliOptions } from "packages/dev-tools/types";
|
|
2
|
+
export declare function getOptions(cwd: string, args: string[]): AddCliOptions;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const apiAirV2Host = "https://air-layout-v2-tk43uighdq-uc.a.run.app";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { DevTools, DevToolsSys, ExportType } from "../types";
|
|
1
|
+
import type { DevTools, DevToolsSys, ExportType, RepoInfo } from "../types";
|
|
2
2
|
import type { FigmaArgs } from "./figma";
|
|
3
|
+
import { type FigmaAuth } from "./credentials";
|
|
4
|
+
import { spinner } from "@clack/prompts";
|
|
3
5
|
export interface FigmaBuilderLink {
|
|
4
6
|
builderName: string;
|
|
5
7
|
figmaName: string;
|
|
@@ -20,3 +22,20 @@ export interface FigmaBuilderData {
|
|
|
20
22
|
figmaBuilderLinks: FigmaBuilderLink[];
|
|
21
23
|
}
|
|
22
24
|
export declare function setPublicKey(sys: DevToolsSys, publicKey: string, devTools: DevTools | undefined, ensureFigmaImportPage?: boolean): Promise<boolean>;
|
|
25
|
+
export interface PublishedMapping {
|
|
26
|
+
repoInfo: RepoInfo | undefined;
|
|
27
|
+
figmaBuilderLinks: FigmaBuilderLink[];
|
|
28
|
+
spaceId: string;
|
|
29
|
+
privateKey: string;
|
|
30
|
+
userId: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function findMappingsFromFiles({ figmaAuth, force, mappingFiles, s, sys, }: {
|
|
33
|
+
figmaAuth?: FigmaAuth;
|
|
34
|
+
force?: boolean;
|
|
35
|
+
mappingFiles: string[];
|
|
36
|
+
s?: ReturnType<typeof spinner> | undefined;
|
|
37
|
+
sys: DevToolsSys;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
figmaBuilderLinks: FigmaBuilderLink[];
|
|
40
|
+
foundErrors: boolean;
|
|
41
|
+
}>;
|
package/types/cli/index.d.ts
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AddCliOptions, DevToolsSys, FileNode, SyncInfo } from "../types";
|
|
2
|
+
export declare function extractSignatureInfo(content: string): {
|
|
3
|
+
contentId?: string;
|
|
4
|
+
sessionKey?: string;
|
|
5
|
+
snippetId?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function findBuilderFiles(basePath: string, targetContentId: string, targetSessionKey: string): Promise<FileNode[]>;
|
|
8
|
+
export declare function watchDirectory(basePath: string, syncInfo: SyncInfo, onChange: (updatedSyncInfo: SyncInfo) => void): () => Promise<void>;
|
|
9
|
+
export declare function setupSyncServer(sys: DevToolsSys, initialSyncInfo?: SyncInfo): Promise<void>;
|
|
10
|
+
export declare function syncCommand(opts: AddCliOptions): Promise<SyncInfo | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentRegistry, ConnectedBuilder, GetRegistryOptions, LaunchEditorFile, LoadComponentOptions, RegisterComponentOptions, SetComponentInfoOptions, SetComponentInputOptions, UnregisterComponentOptions, ValidatedBuilder } from "../types";
|
|
2
|
-
export declare const apiConnectBuilder: (publicApiKey: string, privateAuthKey: string) => Promise<ConnectedBuilder>;
|
|
2
|
+
export declare const apiConnectBuilder: (publicApiKey: string, privateAuthKey: string, kind: string | null) => Promise<ConnectedBuilder>;
|
|
3
3
|
export declare const apiValidateBuilder: () => Promise<ValidatedBuilder>;
|
|
4
4
|
export declare const apiLaunchEditor: (file: LaunchEditorFile) => Promise<unknown>;
|
|
5
5
|
export declare const apiRegistry: (opts?: GetRegistryOptions) => Promise<ComponentRegistry>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DevToolsSys, type SPACE_KIND_VALUES } from "packages/dev-tools/types";
|
|
2
2
|
export declare function hasBuilderContentViaQueryAPI(opts: {
|
|
3
3
|
publicApiKey: string;
|
|
4
4
|
privateAuthKey: string;
|
|
@@ -10,6 +10,7 @@ export declare function hasBuilderContentUrl(sys: DevToolsSys, opts: {
|
|
|
10
10
|
privateAuthKey: string;
|
|
11
11
|
model: string;
|
|
12
12
|
pageUrl: string;
|
|
13
|
+
kind: SPACE_KIND_VALUES;
|
|
13
14
|
}): Promise<boolean>;
|
|
14
15
|
export declare function getBuilderContent(sys: DevToolsSys, opts: {
|
|
15
16
|
publicApiKey: string;
|
|
@@ -12,3 +12,4 @@ export declare const DEV_TOOLS_API_PATH = "/~builder-dev-tools";
|
|
|
12
12
|
export declare const DEV_TOOLS_CLIENT_SCRIPT_PATH = "/~builder-dev-tools.js";
|
|
13
13
|
export declare const DEV_TOOLS_SERVER_CLOSE_PATH = "/~builder-dev-tools-close";
|
|
14
14
|
export declare const AMPLITUDE_PROXY_URL = "https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";
|
|
15
|
+
export declare const SPACE_KIND_QS = "kind";
|
package/types/common/utils.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare function getComponentImportPath(sys: DevToolsSys, absFilePath: st
|
|
|
8
8
|
export declare function getDisplayFilePath(sys: DevToolsSys, filePath: string): string;
|
|
9
9
|
export declare function getComponentDisplayName(str: string): string;
|
|
10
10
|
export declare function sortComponents(cmps: ComponentInfo[]): ComponentInfo[];
|
|
11
|
-
export declare function getComponentId(sys: DevToolsSys, filePath: string, exportName: string): Promise<string>;
|
|
11
|
+
export declare function getComponentId(sys: DevToolsSys, filePath: string, exportName: string, externalImportPath?: string): Promise<string>;
|
|
12
12
|
export declare function getLocalAppId(sys: DevToolsSys): Promise<string>;
|
|
13
13
|
export declare function isNumber(v: any): v is number;
|
|
14
14
|
export declare function isBoolean(v: any): v is boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { AngularDevToolsSys } from ".";
|
|
2
|
-
export declare function angularUpdateAppModule(sys: AngularDevToolsSys): Promise<string | undefined>;
|
|
3
|
-
export declare function angularEnsureAppModuleImports(sys: AngularDevToolsSys,
|
|
2
|
+
export declare function angularUpdateAppModule(sys: AngularDevToolsSys, cmpName: string, cmpPath: string): Promise<string | undefined>;
|
|
3
|
+
export declare function angularEnsureAppModuleImports(sys: AngularDevToolsSys, appModulePath: string, cmpName: string, cmpPath: string, code: string): Promise<string>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ModifiedFile } from "../../../types";
|
|
2
2
|
import type { AngularDevToolsSys } from ".";
|
|
3
3
|
export declare function angularEnsureBuilderSetup(sys: AngularDevToolsSys): Promise<ModifiedFile[]>;
|
|
4
|
-
export declare function angularEnsureBuilderRegistry(sys: AngularDevToolsSys): Promise<ModifiedFile[]>;
|
|
5
4
|
export declare function angularEnsureFigmaImportSetup(sys: AngularDevToolsSys): Promise<ModifiedFile[]>;
|
|
5
|
+
export declare function angularEnsureBuilderRegistry(sys: AngularDevToolsSys): Promise<ModifiedFile[]>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type ModifiedFile } from "../../../types";
|
|
2
2
|
import type { ReactDevToolsSys } from ".";
|
|
3
3
|
export declare function reactEnsureBuilderSetup(sys: ReactDevToolsSys): Promise<ModifiedFile[]>;
|
|
4
|
-
export declare function reactEnsureFigmaImportSetup(
|
|
4
|
+
export declare function reactEnsureFigmaImportSetup(sys: ReactDevToolsSys): Promise<ModifiedFile[]>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DevToolsSys } from '../types';
|
|
2
|
+
export interface Package {
|
|
3
|
+
name: string;
|
|
4
|
+
subPackages: string[];
|
|
5
|
+
}
|
|
6
|
+
export type DependencyStructure = Package[];
|
|
7
|
+
export declare function findAllDependencies(sys: DevToolsSys, rootDir: string): Promise<DependencyStructure>;
|
package/types/node/node-sys.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export declare function createDevToolsNodeSys(opts: DevToolsNodeSysOptions): Pro
|
|
|
8
8
|
export declare function configHasProperty(contents: Record<string, any>, key: string): boolean;
|
|
9
9
|
export declare function readConfigFile(): Promise<any>;
|
|
10
10
|
export declare function writeConfigFile(contents: Record<string, any>): Promise<void>;
|
|
11
|
+
export declare function getGitRemoteURL(repoPath: string): string;
|
|
11
12
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare function connectBuilder(ctx: DevToolsServerContext, publicApiKey: string, privateAuthKey: string): Promise<ConnectedBuilder>;
|
|
1
|
+
import { type DevToolsServerContext, type ConnectedBuilder, type ValidatedBuilder, type SPACE_KIND_VALUES } from "../types";
|
|
2
|
+
export declare function connectBuilder(ctx: DevToolsServerContext, publicApiKey: string, privateAuthKey: string, kind: SPACE_KIND_VALUES): Promise<ConnectedBuilder>;
|
|
3
3
|
export declare function validateBuilder(ctx: DevToolsServerContext): Promise<ValidatedBuilder>;
|
package/types/types.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ export interface DevToolsPath {
|
|
|
8
8
|
relative: (from: string, to: string) => string;
|
|
9
9
|
resolve: (...pathSegments: string[]) => string;
|
|
10
10
|
}
|
|
11
|
+
export interface RepoInfo {
|
|
12
|
+
remoteUrl: string;
|
|
13
|
+
defaultBranch: string;
|
|
14
|
+
currentBranch: string;
|
|
15
|
+
commit: string;
|
|
16
|
+
}
|
|
11
17
|
export interface DevToolsSys extends DevToolsPath {
|
|
12
18
|
cwd: () => string;
|
|
13
19
|
getRootDir: () => string;
|
|
@@ -35,10 +41,12 @@ export interface DevToolsSys extends DevToolsPath {
|
|
|
35
41
|
platform: () => DevtoolsPlatform;
|
|
36
42
|
getDeviceId: () => Promise<string>;
|
|
37
43
|
getFrameworks: () => Framework[];
|
|
44
|
+
getRepoInfo: () => Promise<RepoInfo>;
|
|
38
45
|
ts: typeof import("typescript");
|
|
39
46
|
version: string;
|
|
40
47
|
sdkVersion: SDK_VERSION_VALUES | null;
|
|
41
48
|
ignoreMissingConfig?: boolean;
|
|
49
|
+
kind: SPACE_KIND_VALUES;
|
|
42
50
|
}
|
|
43
51
|
export interface DevtoolsPlatform {
|
|
44
52
|
runtime: string;
|
|
@@ -98,9 +106,18 @@ export interface DevTools extends DevToolsAdapter {
|
|
|
98
106
|
exportRegistry: () => Promise<string>;
|
|
99
107
|
importRegistry: (exportedRegistry: string) => Promise<ComponentRegistry>;
|
|
100
108
|
framework: string;
|
|
109
|
+
findAllDependencies: () => Promise<DependencyTree>;
|
|
101
110
|
}
|
|
102
111
|
export interface DevToolsServerOptions extends DevToolsSys, DevTools {
|
|
103
112
|
getClientId: () => string;
|
|
113
|
+
getPastSyncInfo?: (data: {
|
|
114
|
+
sessionKey: string;
|
|
115
|
+
since: number;
|
|
116
|
+
}) => any;
|
|
117
|
+
resyncSnippet?: (data: {
|
|
118
|
+
syncInfo: SyncInfo;
|
|
119
|
+
snippet: Snippet;
|
|
120
|
+
}) => any;
|
|
104
121
|
enableAppWatch: (enabled: boolean) => Promise<boolean>;
|
|
105
122
|
closeAppServer: () => Promise<void>;
|
|
106
123
|
restartAppServer: () => Promise<void>;
|
|
@@ -132,7 +149,7 @@ export interface EnvInfo {
|
|
|
132
149
|
export interface DevToolsServer {
|
|
133
150
|
getUrl: () => string;
|
|
134
151
|
}
|
|
135
|
-
export type ApiRequest = ApiConnectBuilderRequest | ApiDevToolsEnabledRequest | ApiGetRegistryRequest | ApiLaunchEditorRequest | ApiRegisterComponentRequest | ApiRegisteredComponentInfoRequest | ApiRegisteredComponentInputRequest | ApiLoadComponentRequest | ApiUnregisterComponentRequest | ApiValidateBuilderRequest | ApiFrameworksRequest | ApiReadFileRequest | ApiWriteFileRequest | ApiReaddirRequest | ApiGetBuilderCacheRequest | ApiEnsureFigmaImportPageRequest | ApiSetBuilderCacheRequest | ApiTranspileModuleRequest | ApiTranspileFileRequest;
|
|
152
|
+
export type ApiRequest = ApiConnectBuilderRequest | ApiDevToolsEnabledRequest | ApiGetRegistryRequest | ApiLaunchEditorRequest | ApiRegisterComponentRequest | ApiRegisteredComponentInfoRequest | ApiRegisteredComponentInputRequest | ApiLoadComponentRequest | ApiUnregisterComponentRequest | ApiValidateBuilderRequest | ApiFrameworksRequest | ApiReadFileRequest | ApiWriteFileRequest | ApiReaddirRequest | ApiGetBuilderCacheRequest | ApiEnsureFigmaImportPageRequest | ApiSetBuilderCacheRequest | ApiTranspileModuleRequest | ApiTranspileFileRequest | ApiPastSyncInfoRequest | ApiResyncSnippetRequest;
|
|
136
153
|
export interface ApiTranspileModuleRequest extends TranspileModuleOptions {
|
|
137
154
|
type: "transileModule";
|
|
138
155
|
}
|
|
@@ -146,6 +163,20 @@ export interface ApiSetBuilderCacheRequest {
|
|
|
146
163
|
type: "setCache";
|
|
147
164
|
data: Record<string, any>;
|
|
148
165
|
}
|
|
166
|
+
export interface ApiPastSyncInfoRequest {
|
|
167
|
+
type: "getPastSyncInfo";
|
|
168
|
+
data: {
|
|
169
|
+
sessionKey: string;
|
|
170
|
+
since: number;
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
export interface ApiResyncSnippetRequest {
|
|
174
|
+
type: "resyncSnippet";
|
|
175
|
+
data: {
|
|
176
|
+
syncInfo: SyncInfo;
|
|
177
|
+
snippet: Snippet;
|
|
178
|
+
};
|
|
179
|
+
}
|
|
149
180
|
export interface ApiEnsureFigmaImportPageRequest {
|
|
150
181
|
type: "ensureFigmaImportPage";
|
|
151
182
|
}
|
|
@@ -154,6 +185,7 @@ export interface ApiConnectBuilderRequest {
|
|
|
154
185
|
data: {
|
|
155
186
|
publicApiKey: string;
|
|
156
187
|
privateAuthKey: string;
|
|
188
|
+
kind: string | null;
|
|
157
189
|
};
|
|
158
190
|
}
|
|
159
191
|
export interface ApiDevToolsEnabledRequest {
|
|
@@ -227,6 +259,7 @@ export interface ConnectedBuilder {
|
|
|
227
259
|
pathname: string;
|
|
228
260
|
modifiedFiles: ModifiedFile[];
|
|
229
261
|
platform: DevtoolsPlatform;
|
|
262
|
+
kind: SPACE_KIND_VALUES;
|
|
230
263
|
}
|
|
231
264
|
export interface ModifiedFile {
|
|
232
265
|
filePath: string;
|
|
@@ -296,6 +329,7 @@ export interface ComponentInfo {
|
|
|
296
329
|
acceptsChildren?: boolean;
|
|
297
330
|
meta?: Record<string, any>;
|
|
298
331
|
dependencies?: AppDependency[];
|
|
332
|
+
externalImportPath?: string;
|
|
299
333
|
}
|
|
300
334
|
export interface MinimalComponentInfo {
|
|
301
335
|
filePath: string;
|
|
@@ -403,4 +437,51 @@ export interface UpdateRegistry {
|
|
|
403
437
|
nodeIndex: number;
|
|
404
438
|
components: ComponentInfo[];
|
|
405
439
|
}
|
|
440
|
+
export interface AddCliOptions {
|
|
441
|
+
cwd: string;
|
|
442
|
+
command?: string;
|
|
443
|
+
snippetId?: string;
|
|
444
|
+
snippet?: Snippet;
|
|
445
|
+
path?: string;
|
|
446
|
+
}
|
|
447
|
+
export interface FileNode {
|
|
448
|
+
name: string;
|
|
449
|
+
code: string;
|
|
450
|
+
path: string;
|
|
451
|
+
timestamp?: number;
|
|
452
|
+
snippetId?: string;
|
|
453
|
+
}
|
|
454
|
+
export interface FolderNode {
|
|
455
|
+
name: string;
|
|
456
|
+
path: string;
|
|
457
|
+
files: (FileNode | FolderNode)[];
|
|
458
|
+
}
|
|
459
|
+
export interface Snippet {
|
|
460
|
+
createdDate: number;
|
|
461
|
+
contentId: string;
|
|
462
|
+
code: string;
|
|
463
|
+
framework: string;
|
|
464
|
+
suggestedName: string;
|
|
465
|
+
id: string;
|
|
466
|
+
files: Array<FileNode | FolderNode>;
|
|
467
|
+
sessionKey: string;
|
|
468
|
+
}
|
|
469
|
+
export interface SyncInfo {
|
|
470
|
+
snippet: Snippet;
|
|
471
|
+
pathInput: string;
|
|
472
|
+
writtenFiles: Array<FileNode>;
|
|
473
|
+
timeStamp: number;
|
|
474
|
+
}
|
|
475
|
+
export interface Package {
|
|
476
|
+
name: string;
|
|
477
|
+
subPackages: string[];
|
|
478
|
+
}
|
|
479
|
+
export type DependencyTree = Package[];
|
|
480
|
+
export declare const SPACE_KIND: {
|
|
481
|
+
readonly CMS: "cms";
|
|
482
|
+
readonly VCP: "vcp";
|
|
483
|
+
readonly HYBRID: "hybrid";
|
|
484
|
+
};
|
|
485
|
+
type SPACE_KIND_KEYS = keyof typeof SPACE_KIND;
|
|
486
|
+
export type SPACE_KIND_VALUES = (typeof SPACE_KIND)[SPACE_KIND_KEYS] | null;
|
|
406
487
|
export {};
|
package/vite/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";var b=Object.create;var u=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var D=(n,e)=>{for(var t in e)u(n,t,{get:e[t],enumerable:!0})},g=(n,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!x.call(n,s)&&s!==t&&u(n,s,{get:()=>e[s],enumerable:!(o=h(e,s))||o.enumerable});return n};var V=(n,e,t)=>(t=n!=null?b(y(n)):{},g(e||!n||!n.__esModule?u(t,"default",{value:n,enumerable:!0}):t,n)),I=n=>g(u({},"__esModule",{value:!0}),n);var v={};D(v,{builderDevTools:()=>j});module.exports=I(v);var p=require("../core/index.cjs"),d=require("../node/index.cjs"),w=require("../server/index.cjs");async function f(n,e){let t=await n.readFile(e);return typeof t=="string"?R(t):null}function R(n){let e={},t=n.replace(/\r\n?/gm,`
|
|
2
2
|
`),o;for(;(o=C.exec(t))!=null;){let s=o[1],r=o[2]||"";r=r.trim();let c=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),c==='"'&&(r=r.replace(/\\n/g,`
|
|
3
|
-
`),r=r.replace(/\\r/g,"\r")),e[s]=r}return e}var C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;var m=V(require("path"),1);function j(n={}){return{name:"vite-plugin-builder-dev-tools",async configureServer(t){let o=await(0,d.createDevToolsNodeSys)({getRootDir:()=>m.default.normalize(t.config.root)}),s=await(0,p.createDevTools)(o),r=await(0,w.createDevToolsServer)({...s,getClientId:()=>"vite-builder-dev-tools",closeAppServer:async()=>{o.debug("close server"),await t?.close()},restartAppServer:async()=>{o.debug("restart server"),await t?.restart()},enableAppWatch:async c=>{if(c){o.debug("enable watch"),t?.watcher.add(t.config.root);let i=o.join(t.config.root,".git"),l=o.join(t.config.root,"node_modules");t?.watcher.unwatch([i,l])}else o.debug("disable watch"),t?.watcher.unwatch(t.config.root);return c},...o,...n});t.watcher.on("change",async c=>{if(c.includes(".env")){let i=await f(o,c);i&&Object.keys(i).forEach(a=>{process.env[a]=i[a]})}}),t.middlewares.use(async(c,i,l)=>{try{let a=i.end;i.end=function(...$){if((i.getHeader("Content-Type")||"").toString().includes("text/html")){let T=(0,p.getClientScript)(r.getUrl());i.write(`<script>${T}</script>`)}return a.apply(this,$)},l()}catch(a){l(a)}})}}}0&&(module.exports={builderDevTools});
|
|
3
|
+
`),r=r.replace(/\\r/g,"\r")),e[s]=r}return e}var C=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;var m=V(require("node:path"),1);function j(n={}){return{name:"vite-plugin-builder-dev-tools",async configureServer(t){let o=await(0,d.createDevToolsNodeSys)({getRootDir:()=>m.default.normalize(t.config.root)}),s=await(0,p.createDevTools)(o),r=await(0,w.createDevToolsServer)({...s,getClientId:()=>"vite-builder-dev-tools",closeAppServer:async()=>{o.debug("close server"),await t?.close()},restartAppServer:async()=>{o.debug("restart server"),await t?.restart()},enableAppWatch:async c=>{if(c){o.debug("enable watch"),t?.watcher.add(t.config.root);let i=o.join(t.config.root,".git"),l=o.join(t.config.root,"node_modules");t?.watcher.unwatch([i,l])}else o.debug("disable watch"),t?.watcher.unwatch(t.config.root);return c},...o,...n});t.watcher.on("change",async c=>{if(c.includes(".env")){let i=await f(o,c);i&&Object.keys(i).forEach(a=>{process.env[a]=i[a]})}}),t.middlewares.use(async(c,i,l)=>{try{let a=i.end;i.end=function(...$){if((i.getHeader("Content-Type")||"").toString().includes("text/html")){let T=(0,p.getClientScript)(r.getUrl());i.write(`<script>${T}</script>`)}return a.apply(this,$)},l()}catch(a){l(a)}})}}}0&&(module.exports={builderDevTools});
|
package/vite/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import{createDevTools as w,getClientScript as m}from"../core/index.mjs";import{createDevToolsNodeSys as $}from"../node/index.mjs";import{createDevToolsServer as T}from"../server/index.mjs";async function u(s,c){let t=await s.readFile(c);return typeof t=="string"?f(t):null}function f(s){let c={},t=s.replace(/\r\n?/gm,`
|
|
2
2
|
`),n;for(;(n=d.exec(t))!=null;){let l=n[1],e=n[2]||"";e=e.trim();let r=e[0];e=e.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),r==='"'&&(e=e.replace(/\\n/g,`
|
|
3
|
-
`),e=e.replace(/\\r/g,"\r")),c[l]=e}return c}var d=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;import b from"path";function R(s={}){return{name:"vite-plugin-builder-dev-tools",async configureServer(t){let n=await $({getRootDir:()=>b.normalize(t.config.root)}),l=await w(n),e=await T({...l,getClientId:()=>"vite-builder-dev-tools",closeAppServer:async()=>{n.debug("close server"),await t?.close()},restartAppServer:async()=>{n.debug("restart server"),await t?.restart()},enableAppWatch:async r=>{if(r){n.debug("enable watch"),t?.watcher.add(t.config.root);let o=n.join(t.config.root,".git"),a=n.join(t.config.root,"node_modules");t?.watcher.unwatch([o,a])}else n.debug("disable watch"),t?.watcher.unwatch(t.config.root);return r},...n,...s});t.watcher.on("change",async r=>{if(r.includes(".env")){let o=await u(n,r);o&&Object.keys(o).forEach(i=>{process.env[i]=o[i]})}}),t.middlewares.use(async(r,o,a)=>{try{let i=o.end;o.end=function(...p){if((o.getHeader("Content-Type")||"").toString().includes("text/html")){let g=m(e.getUrl());o.write(`<script>${g}</script>`)}return i.apply(this,p)},a()}catch(i){a(i)}})}}}export{R as builderDevTools};
|
|
3
|
+
`),e=e.replace(/\\r/g,"\r")),c[l]=e}return c}var d=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;import b from"node:path";function R(s={}){return{name:"vite-plugin-builder-dev-tools",async configureServer(t){let n=await $({getRootDir:()=>b.normalize(t.config.root)}),l=await w(n),e=await T({...l,getClientId:()=>"vite-builder-dev-tools",closeAppServer:async()=>{n.debug("close server"),await t?.close()},restartAppServer:async()=>{n.debug("restart server"),await t?.restart()},enableAppWatch:async r=>{if(r){n.debug("enable watch"),t?.watcher.add(t.config.root);let o=n.join(t.config.root,".git"),a=n.join(t.config.root,"node_modules");t?.watcher.unwatch([o,a])}else n.debug("disable watch"),t?.watcher.unwatch(t.config.root);return r},...n,...s});t.watcher.on("change",async r=>{if(r.includes(".env")){let o=await u(n,r);o&&Object.keys(o).forEach(i=>{process.env[i]=o[i]})}}),t.middlewares.use(async(r,o,a)=>{try{let i=o.end;o.end=function(...p){if((o.getHeader("Content-Type")||"").toString().includes("text/html")){let g=m(e.getUrl());o.write(`<script>${g}</script>`)}return i.apply(this,p)},a()}catch(i){a(i)}})}}}export{R as builderDevTools};
|
package/webpack/index.cjs
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
|
|
3
|
-
`)
|
|
4
|
-
`),
|
|
5
|
-
`)
|
|
6
|
-
`)
|
|
7
|
-
`)?
|
|
8
|
-
`),d=l?r.length+1:r.length,m=l?0:a.length,c=1,_=0,g=!1,A=-1,O=-1,y=-1,v=-1,q=(p,B,E,w,b,T)=>{if(g&&c<=r.length){let S,M=c,N=_,C=r[c-1];p!==c?(S=C.slice(_),c++,_=0):(S=C.slice(_,B),_=B),S&&t(S,M,N,A,O,y,v),g=!1}if(p>c&&_>0){if(c<=r.length){let S=r[c-1].slice(_);t(S,c,_,-1,-1,-1,-1)}c++,_=0}for(;p>c;)c<=r.length&&t(r[c-1],c,0,-1,-1,-1,-1),c++;if(B>_){if(c<=r.length){let S=r[c-1].slice(_,B);t(S,c,_,-1,-1,-1,-1)}_=B}E>=0&&(p<d||p===d&&B<m)&&(g=!0,A=E,O=w,y=b,v=T)};return le(o,q),q(d,m,-1,-1,-1,-1),{generatedLine:d,generatedColumn:m}},fs=(n,e,t,s,i)=>{let r=Xe(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,mappings:h}=e;for(let _=0;_<f.length;_++)s(_,oe(e,_),u&&u[_]||void 0);let o=1;for(le(h,(_,g,A,O,y,v)=>{if(!(A<0||_<o||_>r.length)){for(;_>o;)o<=r.length&&t(r[o-1],o,0,-1,-1,-1,-1),o++;_<=r.length&&(t(r[_-1],_,0,A,O,y,-1),o++)}});o<=r.length;o++)t(r[o-1],o,0,-1,-1,-1,-1);let l=r[r.length-1],d=l.endsWith(`
|
|
9
|
-
`),m=d?r.length+1:r.length,c=d?0:l.length;return{generatedLine:m,generatedColumn:c}},cs=(n,e,t,s,i)=>{let r=Je(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return r;let{sources:h,sourcesContent:o,names:a,mappings:l}=e;for(let c=0;c<h.length;c++)s(c,oe(e,c),o&&o[c]||void 0);if(a)for(let c=0;c<a.length;c++)i(c,a[c]);let d=0;return le(l,(c,_,g,A,O,y)=>{c>=f&&(_>=u||c>f)||(g>=0?(t(void 0,c,_,g,A,O,y),d=c):d===c&&(t(void 0,c,_,-1,-1,-1,-1),d=0))}),r},os=(n,e,t,s,i)=>{let r=Je(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return{generatedLine:1,generatedColumn:0};let{sources:h,sourcesContent:o,mappings:a}=e;for(let c=0;c<h.length;c++)s(c,oe(e,c),o&&o[c]||void 0);let l=u===0?f-1:f,d=1;return le(a,(c,_,g,A,O,y)=>{g>=0&&d<=c&&c<=l&&(t(void 0,c,0,g,A,O,-1),d=c+1)}),r};$e.exports=(n,e,t,s,i,r,f)=>f?r?cs(n,e,t,s,i):us(n,e,t,s,i):r?os(n,e,t,s,i):fs(n,e,t,s,i)});var Ze=j((sr,Ye)=>{"use strict";var Ke=Y(),Qe=X(),ls=(n,e,t,s,i,r,f,u,h,o,a)=>{let l=new Map,d=new Map,m=[],c=[],_=[],g=-2,A=[],O=[],y=[],v=[],q=[],p=[],B=[],E=(w,b)=>{if(w>B.length)return-1;let{mappingsData:T}=B[w-1],S=0,M=T.length/5;for(;S<M;){let N=S+M>>1;T[N*5]<=b?S=N+1:M=N}return S===0?-1:S-1};return Ke(n,e,(w,b,T,S,M,N,C)=>{if(S===g){let R=E(M,N);if(R!==-1){let{chunks:L,mappingsData:I}=B[M-1],H=R*5,z=I[H+1],k=I[H+2],F=I[H+3],U=I[H+4];if(z>=0){let Ct=L[R],qt=I[H],ee=N-qt;if(ee>0){let x=z<v.length?v[z]:null;if(x===void 0){let D=y[z];x=D?Qe(D):null,v[z]=x}if(x!==null){let D=k<=x.length?x[k-1].slice(F,F+ee):"";Ct.slice(0,ee)===D&&(F+=ee,U=-1)}}let te=z<A.length?A[z]:-2;if(te===-2){let[x,D]=z<O.length?O[z]:[null,void 0],J=l.get(x);J===void 0&&(l.set(x,J=l.size),u(J,x,D)),te=J,A[z]=te}let W=-1;if(U>=0){if(W=U<q.length?q[U]:-2,W===-2){let x=U<p.length?p[U]:void 0;if(x){let D=d.get(x);D===void 0&&(d.set(x,D=d.size),h(D,x)),W=D}else W=-1;q[U]=W}}else if(C>=0){let x=v[z];if(x===void 0){let D=y[z];x=D?Qe(D):null,v[z]=x}if(x!==null){let D=_[C],J=k<=x.length?x[k-1].slice(F,F+D.length):"";if(D===J&&(W=C<c.length?c[C]:-2,W===-2)){let se=_[C];if(se){let re=d.get(se);re===void 0&&(d.set(se,re=d.size),h(re,se)),W=re}else W=-1;c[C]=W}}}f(w,b,T,te,k,F,W);return}}if(r){f(w,b,T,-1,-1,-1,-1);return}else if(m[S]===-2){let L=l.get(t);L===void 0&&(l.set(n,L=l.size),u(L,t,s)),m[S]=L}}let P=S<0||S>=m.length?-1:m[S];if(P<0)f(w,b,T,-1,-1,-1,-1);else{let R=-1;if(C>=0&&C<c.length&&(R=c[C],R===-2)){let L=_[C],I=d.get(L);I===void 0&&(d.set(L,I=d.size),h(I,L)),R=I,c[C]=R}f(w,b,T,P,M,N,R)}},(w,b,T)=>{if(b===t)g=w,s!==void 0?T=s:s=T,m[w]=-2,Ke(T,i,(S,M,N,C,P,R,L)=>{for(;B.length<M;)B.push({mappingsData:[],chunks:[]});let I=B[M-1];I.mappingsData.push(N,C,P,R,L),I.chunks.push(S)},(S,M,N)=>{y[S]=N,v[S]=void 0,A[S]=-2,O[S]=[M,N]},(S,M)=>{q[S]=-2,p[S]=M},!1,a);else{let S=l.get(b);S===void 0&&(l.set(b,S=l.size),u(S,b,T)),m[w]=S}},(w,b)=>{c[w]=-2,_[w]=b},o,a)};Ye.exports=ls});var tt=j((rr,et)=>{"use strict";var as=G(),hs=Y(),ds=Ze(),{getMap:ps,getSourceAndMap:_s}=$(),Ae=class extends as{constructor(e,t,s,i,r,f){super();let u=Buffer.isBuffer(e);this._valueAsString=u?void 0:e,this._valueAsBuffer=u?e:void 0,this._name=t,this._hasSourceMap=!!s;let h=Buffer.isBuffer(s),o=typeof s=="string";this._sourceMapAsObject=h||o?void 0:s,this._sourceMapAsString=o?s:void 0,this._sourceMapAsBuffer=h?s:void 0,this._hasOriginalSource=!!i;let a=Buffer.isBuffer(i);this._originalSourceAsString=a?void 0:i,this._originalSourceAsBuffer=a?i:void 0,this._hasInnerSourceMap=!!r;let l=Buffer.isBuffer(r),d=typeof r=="string";this._innerSourceMapAsObject=l||d?void 0:r,this._innerSourceMapAsString=d?r:void 0,this._innerSourceMapAsBuffer=l?r:void 0,this._removeOriginalSource=f}_ensureValueBuffer(){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._valueAsString,"utf-8"))}_ensureValueString(){this._valueAsString===void 0&&(this._valueAsString=this._valueAsBuffer.toString("utf-8"))}_ensureOriginalSourceBuffer(){this._originalSourceAsBuffer===void 0&&this._hasOriginalSource&&(this._originalSourceAsBuffer=Buffer.from(this._originalSourceAsString,"utf-8"))}_ensureOriginalSourceString(){this._originalSourceAsString===void 0&&this._hasOriginalSource&&(this._originalSourceAsString=this._originalSourceAsBuffer.toString("utf-8"))}_ensureInnerSourceMapObject(){this._innerSourceMapAsObject===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsObject=JSON.parse(this._innerSourceMapAsString))}_ensureInnerSourceMapBuffer(){this._innerSourceMapAsBuffer===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsBuffer=Buffer.from(this._innerSourceMapAsString,"utf-8"))}_ensureInnerSourceMapString(){this._innerSourceMapAsString===void 0&&this._hasInnerSourceMap&&(this._innerSourceMapAsBuffer!==void 0?this._innerSourceMapAsString=this._innerSourceMapAsBuffer.toString("utf-8"):this._innerSourceMapAsString=JSON.stringify(this._innerSourceMapAsObject))}_ensureSourceMapObject(){this._sourceMapAsObject===void 0&&(this._ensureSourceMapString(),this._sourceMapAsObject=JSON.parse(this._sourceMapAsString))}_ensureSourceMapBuffer(){this._sourceMapAsBuffer===void 0&&(this._ensureSourceMapString(),this._sourceMapAsBuffer=Buffer.from(this._sourceMapAsString,"utf-8"))}_ensureSourceMapString(){this._sourceMapAsString===void 0&&(this._sourceMapAsBuffer!==void 0?this._sourceMapAsString=this._sourceMapAsBuffer.toString("utf-8"):this._sourceMapAsString=JSON.stringify(this._sourceMapAsObject))}getArgsAsBuffers(){return this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),[this._valueAsBuffer,this._name,this._sourceMapAsBuffer,this._originalSourceAsBuffer,this._innerSourceMapAsBuffer,this._removeOriginalSource]}buffer(){return this._ensureValueBuffer(),this._valueAsBuffer}source(){return this._ensureValueString(),this._valueAsString}map(e){return this._hasInnerSourceMap?ps(this,e):(this._ensureSourceMapObject(),this._sourceMapAsObject)}sourceAndMap(e){return this._hasInnerSourceMap?_s(this,e):(this._ensureValueString(),this._ensureSourceMapObject(),{source:this._valueAsString,map:this._sourceMapAsObject})}streamChunks(e,t,s,i){return this._ensureValueString(),this._ensureSourceMapObject(),this._ensureOriginalSourceString(),this._hasInnerSourceMap?(this._ensureInnerSourceMapObject(),ds(this._valueAsString,this._sourceMapAsObject,this._name,this._originalSourceAsString,this._innerSourceMapAsObject,this._removeOriginalSource,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))):hs(this._valueAsString,this._sourceMapAsObject,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))}updateHash(e){this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),e.update("SourceMapSource"),e.update(this._valueAsBuffer),e.update(this._sourceMapAsBuffer),this._hasOriginalSource&&e.update(this._originalSourceAsBuffer),this._hasInnerSourceMap&&e.update(this._innerSourceMapAsBuffer),e.update(this._removeOriginalSource?"true":"false")}};et.exports=Ae});var Z=j((nr,st)=>{"use strict";var gs=ue(),Ss=Y();st.exports=(n,e,t,s,i)=>{if(typeof n.streamChunks=="function")return n.streamChunks(e,t,s,i);{let r=n.sourceAndMap(e);return r.map?Ss(r.source,r.map,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1)):gs(r.source,t,s,i,!!(e&&e.finalSource))}}});var nt=j((ir,rt)=>{"use strict";var ms=ge(),As=Z(),Ms=(n,e,t,s,i)=>{let r="",f="",u=[],h=[],o=[],a=ms(Object.assign({},e,{columns:!0})),l=!!(e&&e.finalSource),{generatedLine:d,generatedColumn:m,source:c}=As(n,e,(g,A,O,y,v,q,p)=>(g!==void 0&&(r+=g),f+=a(A,O,y,v,q,p),t(l?void 0:g,A,O,y,v,q,p)),(g,A,O)=>{for(;u.length<g;)u.push(null);if(u[g]=A,O!==void 0){for(;h.length<g;)h.push(null);h[g]=O}return s(g,A,O)},(g,A)=>{for(;o.length<g;)o.push(null);return o[g]=A,i(g,A)}),_=c!==void 0?c:r;return{result:{generatedLine:d,generatedColumn:m,source:l?_:void 0},source:_,map:f.length>0?{version:3,file:"x",mappings:f,sources:u,sourcesContent:h.length>0?h:void 0,names:o}:null}};rt.exports=Ms});var ut=j((ur,it)=>{"use strict";var Bs=G(),vs=Y(),bs=ue(),Os=nt(),ys=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=Buffer.from(n.mappings,"utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&Buffer.from(t,"utf-8"))),e},ws=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=n.mappings.toString("utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&t.toString("utf-8"))),e},Me=class extends Bs{constructor(e,t){super(),this._source=e,this._cachedSourceType=t?t.source:void 0,this._cachedSource=void 0,this._cachedBuffer=t?t.buffer:void 0,this._cachedSize=t?t.size:void 0,this._cachedMaps=t?t.maps:new Map,this._cachedHashUpdate=t?t.hash:void 0}getCachedData(){let e=new Map;for(let t of this._cachedMaps){let s=t[1];s.bufferedMap===void 0&&(s.bufferedMap=ys(this._getMapFromCacheEntry(s))),e.set(t[0],{map:void 0,bufferedMap:s.bufferedMap})}return this._cachedSource&&this.buffer(),{buffer:this._cachedBuffer,source:this._cachedSourceType!==void 0?this._cachedSourceType:typeof this._cachedSource=="string"?!0:Buffer.isBuffer(this._cachedSource)?!1:void 0,size:this._cachedSize,maps:e,hash:this._cachedHashUpdate}}originalLazy(){return this._source}original(){return typeof this._source=="function"&&(this._source=this._source()),this._source}source(){let e=this._getCachedSource();return e!==void 0?e:this._cachedSource=this.original().source()}_getMapFromCacheEntry(e){if(e.map!==void 0)return e.map;if(e.bufferedMap!==void 0)return e.map=ws(e.bufferedMap)}_getCachedSource(){if(this._cachedSource!==void 0)return this._cachedSource;if(this._cachedBuffer&&this._cachedSourceType!==void 0)return this._cachedSource=this._cachedSourceType?this._cachedBuffer.toString("utf-8"):this._cachedBuffer}buffer(){if(this._cachedBuffer!==void 0)return this._cachedBuffer;if(this._cachedSource!==void 0)return Buffer.isBuffer(this._cachedSource)?this._cachedBuffer=this._cachedSource:this._cachedBuffer=Buffer.from(this._cachedSource,"utf-8");if(typeof this.original().buffer=="function")return this._cachedBuffer=this.original().buffer();let e=this.source();return Buffer.isBuffer(e)?this._cachedBuffer=e:this._cachedBuffer=Buffer.from(e,"utf-8")}size(){if(this._cachedSize!==void 0)return this._cachedSize;if(this._cachedBuffer!==void 0)return this._cachedSize=this._cachedBuffer.length;let e=this._getCachedSource();return e!==void 0?this._cachedSize=Buffer.byteLength(e):this._cachedSize=this.original().size()}sourceAndMap(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0){let f=this._getMapFromCacheEntry(s);return{source:this.source(),map:f}}let i=this._getCachedSource(),r;if(i!==void 0)r=this.original().map(e);else{let f=this.original().sourceAndMap(e);i=f.source,r=f.map,this._cachedSource=i}return this._cachedMaps.set(t,{map:r,bufferedMap:void 0}),{source:i,map:r}}streamChunks(e,t,s,i){let r=e?JSON.stringify(e):"{}";if(this._cachedMaps.has(r)&&(this._cachedBuffer!==void 0||this._cachedSource!==void 0)){let{source:o,map:a}=this.sourceAndMap(e);return a?vs(o,a,t,s,i,!!(e&&e.finalSource),!0):bs(o,t,s,i,!!(e&&e.finalSource))}let{result:f,source:u,map:h}=Os(this.original(),e,t,s,i);return this._cachedSource=u,this._cachedMaps.set(r,{map:h,bufferedMap:void 0}),f}map(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0)return this._getMapFromCacheEntry(s);let i=this.original().map(e);return this._cachedMaps.set(t,{map:i,bufferedMap:void 0}),i}updateHash(e){if(this._cachedHashUpdate!==void 0){for(let r of this._cachedHashUpdate)e.update(r);return}let t=[],s,i={update:r=>{typeof r=="string"&&r.length<10240?s===void 0?s=r:(s+=r,s.length>102400&&(t.push(Buffer.from(s)),s=void 0)):(s!==void 0&&(t.push(Buffer.from(s)),s=void 0),t.push(r))}};this.original().updateHash(i),s!==void 0&&t.push(Buffer.from(s));for(let r of t)e.update(r);this._cachedHashUpdate=t}};it.exports=Me});var ot=j((fr,ct)=>{"use strict";var Ts=G(),ft=fe(),zs=Z(),{getMap:Cs,getSourceAndMap:qs}=$(),Be=new WeakSet,ve=class n extends Ts{constructor(){super(),this._children=[];for(let e=0;e<arguments.length;e++){let t=arguments[e];if(t instanceof n)for(let s of t._children)this._children.push(s);else this._children.push(t)}this._isOptimized=arguments.length===0}getChildren(){return this._isOptimized||this._optimize(),this._children}add(e){if(e instanceof n)for(let t of e._children)this._children.push(t);else this._children.push(e);this._isOptimized=!1}addAllSkipOptimizing(e){for(let t of e)this._children.push(t)}buffer(){this._isOptimized||this._optimize();let e=[];for(let t of this._children)if(typeof t.buffer=="function")e.push(t.buffer());else{let s=t.source();Buffer.isBuffer(s)?e.push(s):e.push(Buffer.from(s,"utf-8"))}return Buffer.concat(e)}source(){this._isOptimized||this._optimize();let e="";for(let t of this._children)e+=t.source();return e}size(){this._isOptimized||this._optimize();let e=0;for(let t of this._children)e+=t.size();return e}map(e){return Cs(this,e)}sourceAndMap(e){return qs(this,e)}streamChunks(e,t,s,i){if(this._isOptimized||this._optimize(),this._children.length===1)return this._children[0].streamChunks(e,t,s,i);let r=0,f=0,u=new Map,h=new Map,o=!!(e&&e.finalSource),a="",l=!1;for(let d of this._children){let m=[],c=[],_=0,{generatedLine:g,generatedColumn:A,source:O}=zs(d,e,(y,v,q,p,B,E,w)=>{let b=v+r,T=v===1?q+f:q;l&&((v!==1||q!==0)&&t(void 0,r+1,f,-1,-1,-1,-1),l=!1);let S=p<0||p>=m.length?-1:m[p],M=w<0||w>=c.length?-1:c[w];_=S<0?0:v,o?(y!==void 0&&(a+=y),S>=0&&t(void 0,b,T,S,B,E,M)):S<0?t(y,b,T,-1,-1,-1,-1):t(y,b,T,S,B,E,M)},(y,v,q)=>{let p=u.get(v);p===void 0&&(u.set(v,p=u.size),s(p,v,q)),m[y]=p},(y,v)=>{let q=h.get(v);q===void 0&&(h.set(v,q=h.size),i(q,v)),c[y]=q});O!==void 0&&(a+=O),l&&(g!==1||A!==0)&&(t(void 0,r+1,f,-1,-1,-1,-1),l=!1),g>1?f=A:f+=A,l=l||o&&_===g,r+=g-1}return{generatedLine:r+1,generatedColumn:f,source:o?a:void 0}}updateHash(e){this._isOptimized||this._optimize(),e.update("ConcatSource");for(let t of this._children)t.updateHash(e)}_optimize(){let e=[],t,s,i=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u):s=[typeof s=="string"?s:s.source(),u]},r=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u.source()):s=[typeof s=="string"?s:s.source(),u.source()]},f=()=>{if(Array.isArray(s)){let u=new ft(s.join(""));Be.add(u),e.push(u)}else if(typeof s=="string"){let u=new ft(s);Be.add(u),e.push(u)}else e.push(s)};for(let u of this._children)typeof u=="string"?t===void 0?t=u:t+=u:(t!==void 0&&(i(t),t=void 0),Be.has(u)?r(u):(s!==void 0&&(f(),s=void 0),e.push(u)));t!==void 0&&i(t),s!==void 0&&f(),this._children=e,this._isOptimized=!0}};ct.exports=ve});var dt=j((cr,ht)=>{"use strict";var{getMap:Es,getSourceAndMap:Ns}=$(),js=Z(),xs=G(),be=X(),at=typeof process=="object"&&process.versions&&typeof process.versions.v8=="string"&&!/^[0-6]\./.test(process.versions.v8),lt=536870912,ae=class{constructor(e,t,s,i){this.start=e,this.end=t,this.content=s,this.name=i,at||(this.index=-1)}},Oe=class extends xs{constructor(e,t){super(),this._source=e,this._name=t,this._replacements=[],this._isSorted=!0}getName(){return this._name}getReplacements(){return this._sortReplacements(),this._replacements}replace(e,t,s,i){if(typeof s!="string")throw new Error("insertion must be a string, but is a "+typeof s);this._replacements.push(new ae(e,t,s,i)),this._isSorted=!1}insert(e,t,s){if(typeof t!="string")throw new Error("insertion must be a string, but is a "+typeof t+": "+t);this._replacements.push(new ae(e,e-1,t,s)),this._isSorted=!1}source(){if(this._replacements.length===0)return this._source.source();let e=this._source.source(),t=0,s=[];this._sortReplacements();for(let i of this._replacements){let r=Math.floor(i.start),f=Math.floor(i.end+1);if(t<r){let u=r-t;s.push(e.slice(0,u)),e=e.slice(u),t=r}if(s.push(i.content),t<f){let u=f-t;e=e.slice(u),t=f}}return s.push(e),s.join("")}map(e){return this._replacements.length===0?this._source.map(e):Es(this,e)}sourceAndMap(e){return this._replacements.length===0?this._source.sourceAndMap(e):Ns(this,e)}original(){return this._source}_sortReplacements(){this._isSorted||(at?this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:0}):(this._replacements.forEach((e,t)=>e.index=t),this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:e.index-t.index})),this._isSorted=!0)}streamChunks(e,t,s,i){this._sortReplacements();let r=this._replacements,f=0,u=0,h=-1,o=u<r.length?Math.floor(r[u].start):lt,a=0,l=0,d=0,m=[],c=new Map,_=[],g=(p,B,E,w)=>{let b=p<m.length?m[p]:void 0;if(b===void 0)return!1;typeof b=="string"&&(b=be(b),m[p]=b);let T=B<=b.length?b[B-1]:null;return T===null?!1:T.slice(E,E+w.length)===w},{generatedLine:A,generatedColumn:O}=js(this._source,Object.assign({},e,{finalSource:!1}),(p,B,E,w,b,T,S)=>{let M=0,N=f+p.length;if(h>f){if(h>=N){let P=B+a;p.endsWith(`
|
|
10
|
-
`)?
|
|
11
|
-
`)?d===
|
|
12
|
-
`)?
|
|
13
|
-
|
|
14
|
-
`+
|
|
15
|
-
`+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};_t.exports=ye});var mt=j((lr,St)=>{"use strict";var Hs=G(),we=class extends Hs{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};St.exports=we});var Bt=j((ar,Mt)=>{"use strict";var At=G(),Te=class n extends At{static from(e){return e instanceof At?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};Mt.exports=Te});var bt=j(vt=>{var V=(n,e)=>{let t;Object.defineProperty(vt,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>fe());V("OriginalSource",()=>Pe());V("SourceMapSource",()=>tt());V("CachedSource",()=>ut());V("ConcatSource",()=>ot());V("ReplaceSource",()=>dt());V("PrefixSource",()=>gt());V("SizeOnlySource",()=>mt());V("CompatSource",()=>Bt())});var Ws={};It(Ws,{BuilderDevToolsPlugin:()=>ze});module.exports=Rt(Ws);var yt=Dt(bt(),1),de=require("path"),Q=require("fs"),wt=require("../core/index.cjs"),Tt=require("../node/index.cjs"),zt=require("../server/index.cjs"),Ot="BuilderDevToolsPlugin",he=null;async function Ps(n){let e=await(0,Tt.createDevToolsNodeSys)({getRootDir:()=>process.cwd()});e.debug("webpack setupDevTools init");let t=await(0,wt.createDevTools)(e),s=await(0,zt.createDevToolsServer)({...t,getClientId:()=>"webpack-builder-dev-tools",closeAppServer:async()=>{},restartAppServer:async()=>{e.debug("restart server");let i=["next.config.js","next.config.ts","next.config.mjs","webpack.config.js","webpack.config.ts"].map(r=>(0,de.join)(e.getRootDir(),r));for(let r of i)if((0,Q.existsSync)(r)){e.debug(`restart server: ${r}`),(0,Q.writeFileSync)(r,(0,Q.readFileSync)(r)),await new Promise(f=>setTimeout(f,50));return}},enableAppWatch:async i=>i,...e,...n});return e.debug("webpack setupDevTools done"),{server:s,sys:e}}var ze=class{constructor(e){this.opts=e||{},typeof this.opts.enabled!="boolean"&&(this.opts.enabled=process.env.NODE_ENV!=="production"),this.opts.enabled&&he==null&&(he=Ps(this.opts))}apply(e){if(this.opts.enabled===!1)return;let t=e,s=t.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,i=new WeakMap;t.hooks.compilation.tap(Ot,r=>{r.hooks.processAssets.tapAsync({name:Ot,stage:s},async(f,u)=>{if(he!=null){for(let h of r.chunks)for(let o of h.files){let a=(0,de.basename)(o),{server:l,sys:d}=await he;if(d.getFrameworks().some(A=>A.name==="next")&&a!=="webpack.js")continue;d.getRootDir=()=>t.context;let m=new URL("/~builder-dev-tools.js",l.getUrl()),c=`
|
|
1
|
+
"use strict";var qt=Object.create;var ne=Object.defineProperty;var Nt=Object.getOwnPropertyDescriptor;var jt=Object.getOwnPropertyNames;var xt=Object.getPrototypeOf,kt=Object.prototype.hasOwnProperty;var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),It=(n,e)=>{for(var t in e)ne(n,t,{get:e[t],enumerable:!0})},ze=(n,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of jt(e))!kt.call(n,i)&&i!==t&&ne(n,i,{get:()=>e[i],enumerable:!(s=Nt(e,i))||s.enumerable});return n};var Dt=(n,e,t)=>(t=n!=null?qt(xt(n)):{},ze(e||!n||!n.__esModule?ne(t,"default",{value:n,enumerable:!0}):t,n)),Rt=n=>ze(ne({},"__esModule",{value:!0}),n);var G=j((Gs,Ee)=>{"use strict";var pe=class{source(){throw new Error("Abstract")}buffer(){let e=this.source();return Buffer.isBuffer(e)?e:Buffer.from(e,"utf-8")}size(){return this.buffer().length}map(e){return null}sourceAndMap(e){return{source:this.source(),map:this.map(e)}}updateHash(e){throw new Error("Abstract")}};Ee.exports=pe});var ie=j((Vs,qe)=>{"use strict";var Lt=n=>{if(n===void 0)return{};let e=n.lastIndexOf(`
|
|
2
|
+
`);if(e===-1)return{generatedLine:1,generatedColumn:n.length,source:n};let t=2;for(let s=0;s<e;s++)n.charCodeAt(s)===10&&t++;return{generatedLine:t,generatedColumn:n.length-e-1,source:n}};qe.exports=Lt});var X=j((Us,Ne)=>{var Ht=n=>{let e=[],t=n.length,s=0;for(;s<t;)if(n.charCodeAt(s)===10)e.push(`
|
|
3
|
+
`),s++;else{let r=s+1;for(;r<t&&n.charCodeAt(r)!==10;)r++;e.push(n.slice(s,r+1)),s=r+1}return e};Ne.exports=Ht});var ue=j((Fs,je)=>{"use strict";var Pt=ie(),Wt=X(),Gt=(n,e,t,s)=>{let i=1,r=Wt(n),f;for(f of r)e(f,i,0,-1,-1,-1,-1),i++;return r.length===0||f.endsWith(`
|
|
4
|
+
`)?{generatedLine:r.length+1,generatedColumn:0}:{generatedLine:r.length,generatedColumn:f.length}};je.exports=(n,e,t,s,i)=>i?Pt(n):Gt(n,e,t,s)});var fe=j((Js,xe)=>{"use strict";var Vt=ue(),Ut=G(),_e=class extends Ut{constructor(e,t=!1){super();let s=Buffer.isBuffer(e);if(!s&&typeof e!="string")throw new TypeError("argument 'value' must be either string of Buffer");this._valueIsBuffer=!t&&s,this._value=t&&s?void 0:e,this._valueAsBuffer=s?e:void 0,this._valueAsString=s?void 0:e}isBuffer(){return this._valueIsBuffer}source(){return this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),this._value}buffer(){return this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),this._valueAsBuffer}map(e){return null}streamChunks(e,t,s,i){return this._value===void 0&&(this._value=Buffer.from(this._valueAsBuffer,"utf-8")),this._valueAsString===void 0&&(this._valueAsString=typeof this._value=="string"?this._value:this._value.toString("utf-8")),Vt(this._valueAsString,t,s,i,!!(e&&e.finalSource))}updateHash(e){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),e.update("RawSource"),e.update(this._valueAsBuffer)}};xe.exports=_e});var ge=j((Xs,Ie)=>{"use strict";var ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),ke=32,Ft=n=>n&&n.columns===!1?Xt():Jt(),Jt=()=>{let n=1,e=0,t=0,s=1,i=0,r=0,f=!1,u=!1,h=!0;return(o,a,l,d,m,c)=>{if(f&&n===o){if(l===t&&d===s&&m===i&&!u&&c<0)return""}else if(l<0)return"";let _;n<o?(_=";".repeat(o-n),n=o,e=0,h=!1):h?(_="",h=!1):_=",";let g=A=>{let O=A>>>31&1,y=A>>31,E=(A+y^y)<<1|O;for(;;){let p=E&31;if(E>>=5,E===0){_+=ce[p];break}else _+=ce[p|ke]}};return g(a-e),e=a,l>=0?(f=!0,l===t?_+="A":(g(l-t),t=l),g(d-s),s=d,m===i?_+="A":(g(m-i),i=m),c>=0?(g(c-r),r=c,u=!0):u=!1):f=!1,_}},Xt=()=>{let n=0,e=1,t=0,s=1;return(i,r,f,u,h,o)=>{if(f<0||n===i)return"";let a,l=d=>{let m=d>>>31&1,c=d>>31,g=(d+c^c)<<1|m;for(;;){let A=g&31;if(g>>=5,g===0){a+=ce[A];break}else a+=ce[A|ke]}};return n=i,i===e+1?(e=i,f===t?(t=f,u===s+1?(s=u,";AACA"):(a=";AA",l(u-s),s=u,a+"A")):(a=";A",l(f-t),t=f,l(u-s),s=u,a+"A")):(a=";".repeat(i-e),e=i,f===t?(t=f,u===s+1?(s=u,a+"AACA"):(a+="AA",l(u-s),s=u,a+"A")):(a+="A",l(f-t),t=f,l(u-s),s=u,a+"A"))}};Ie.exports=Ft});var $=j(Se=>{"use strict";var De=ge();Se.getSourceAndMap=(n,e)=>{let t="",s="",i=[],r=[],f=[],u=De(e),{source:h}=n.streamChunks(Object.assign({},e,{finalSource:!0}),(o,a,l,d,m,c,_)=>{o!==void 0&&(t+=o),s+=u(a,l,d,m,c,_)},(o,a,l)=>{for(;i.length<o;)i.push(null);if(i[o]=a,l!==void 0){for(;r.length<o;)r.push(null);r[o]=l}},(o,a)=>{for(;f.length<o;)f.push(null);f[o]=a});return{source:h!==void 0?h:t,map:s.length>0?{version:3,file:"x",mappings:s,sources:i,sourcesContent:r.length>0?r:void 0,names:f}:null}};Se.getMap=(n,e)=>{let t="",s=[],i=[],r=[],f=De(e);return n.streamChunks(Object.assign({},e,{source:!1,finalSource:!0}),(u,h,o,a,l,d,m)=>{t+=f(h,o,a,l,d,m)},(u,h,o)=>{for(;s.length<u;)s.push(null);if(s[u]=h,o!==void 0){for(;i.length<u;)i.push(null);i[u]=o}},(u,h)=>{for(;r.length<u;)r.push(null);r[u]=h}),t.length>0?{version:3,file:"x",mappings:t,sources:s,sourcesContent:i.length>0?i:void 0,names:r}:null}});var Le=j((Ks,Re)=>{var $t=n=>{let e=n.length;if(e===0)return null;let t=[],s=0;for(;s<e;){let i=s;e:{let r=n.charCodeAt(s);for(;r!==10&&r!==59&&r!==123&&r!==125;){if(++s>=e)break e;r=n.charCodeAt(s)}for(;r===59||r===32||r===123||r===125||r===13||r===9;){if(++s>=e)break e;r=n.charCodeAt(s)}r===10&&s++}t.push(n.slice(i,s))}return t};Re.exports=$t});var Pe=j((Qs,He)=>{"use strict";var{getMap:Kt,getSourceAndMap:Qt}=$(),Yt=X(),Zt=ie(),es=G(),ts=Le(),me=class extends es{constructor(e,t){super();let s=Buffer.isBuffer(e);this._value=s?void 0:e,this._valueAsBuffer=s?e:void 0,this._name=t}getName(){return this._name}source(){return this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),this._value}buffer(){return this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),this._valueAsBuffer}map(e){return Kt(this,e)}sourceAndMap(e){return Qt(this,e)}streamChunks(e,t,s,i){this._value===void 0&&(this._value=this._valueAsBuffer.toString("utf-8")),s(0,this._name,this._value);let r=!!(e&&e.finalSource);if(!e||e.columns!==!1){let f=ts(this._value),u=1,h=0;if(f!==null)for(let o of f){let a=o.endsWith(`
|
|
5
|
+
`);a&&o.length===1?r||t(o,u,h,-1,-1,-1,-1):t(r?void 0:o,u,h,0,u,h,-1),a?(u++,h=0):h+=o.length}return{generatedLine:u,generatedColumn:h,source:r?this._value:void 0}}else if(r){let f=Zt(this._value),{generatedLine:u,generatedColumn:h}=f;if(h===0)for(let o=1;o<u;o++)t(void 0,o,0,0,o,0,-1);else for(let o=1;o<=u;o++)t(void 0,o,0,0,o,0,-1);return f}else{let f=1,u=Yt(this._value),h;for(h of u)t(r?void 0:h,f,0,0,f,0,-1),f++;return u.length===0||h.endsWith(`
|
|
6
|
+
`)?{generatedLine:u.length+1,generatedColumn:0,source:r?this._value:void 0}:{generatedLine:u.length,generatedColumn:h.length,source:r?this._value:void 0}}}updateHash(e){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._value,"utf-8")),e.update("OriginalSource"),e.update(this._valueAsBuffer),e.update(this._name||"")}};He.exports=me});var Ge=j((Ys,We)=>{"use strict";var ss=(n,e)=>{if(e<0)return null;let{sourceRoot:t,sources:s}=n,i=s[e];return t?t.endsWith("/")?t+i:t+"/"+i:i};We.exports=ss});var Fe=j((Zs,Ue)=>{"use strict";var Ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",K=new Uint8Array(123);{K.fill(66);for(let n=0;n<Ve.length;n++)K[Ve.charCodeAt(n)]=n;K[44]=64,K[59]=65}var rs=K.length-1,ns=(n,e)=>{let t=new Uint32Array([0,0,1,0,0]),s=0,i=0,r=0,f=1,u=-1;for(let h=0;h<n.length;h++){let o=n.charCodeAt(h);if(o>rs)continue;let a=K[o];if(a&64)t[0]>u&&(s===1?e(f,t[0],-1,-1,-1,-1):s===4?e(f,t[0],t[1],t[2],t[3],-1):s===5&&e(f,t[0],t[1],t[2],t[3],t[4]),u=t[0]),s=0,a===65&&(f++,t[0]=0,u=-1);else if(a&32)i|=(a&31)<<r,r+=5;else{i|=a<<r;let l=i&1?-(i>>1):i>>1;t[s++]+=l,r=0,i=0}}s===1?e(f,t[0],-1,-1,-1,-1):s===4?e(f,t[0],t[1],t[2],t[3],-1):s===5&&e(f,t[0],t[1],t[2],t[3],t[4])};Ue.exports=ns});var Y=j((er,$e)=>{"use strict";var Je=ie(),oe=Ge(),le=Fe(),Xe=X(),is=(n,e,t,s,i)=>{let r=Xe(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,names:h,mappings:o}=e;for(let p=0;p<f.length;p++)s(p,oe(e,p),u&&u[p]||void 0);if(h)for(let p=0;p<h.length;p++)i(p,h[p]);let a=r[r.length-1],l=a.endsWith(`
|
|
7
|
+
`),d=l?r.length+1:r.length,m=l?0:a.length,c=1,_=0,g=!1,A=-1,O=-1,y=-1,v=-1,E=(p,B,q,w,b,T)=>{if(g&&c<=r.length){let S,M=c,N=_,z=r[c-1];p!==c?(S=z.slice(_),c++,_=0):(S=z.slice(_,B),_=B),S&&t(S,M,N,A,O,y,v),g=!1}if(p>c&&_>0){if(c<=r.length){let S=r[c-1].slice(_);t(S,c,_,-1,-1,-1,-1)}c++,_=0}for(;p>c;)c<=r.length&&t(r[c-1],c,0,-1,-1,-1,-1),c++;if(B>_){if(c<=r.length){let S=r[c-1].slice(_,B);t(S,c,_,-1,-1,-1,-1)}_=B}q>=0&&(p<d||p===d&&B<m)&&(g=!0,A=q,O=w,y=b,v=T)};return le(o,E),E(d,m,-1,-1,-1,-1),{generatedLine:d,generatedColumn:m}},us=(n,e,t,s,i)=>{let r=Xe(n);if(r.length===0)return{generatedLine:1,generatedColumn:0};let{sources:f,sourcesContent:u,mappings:h}=e;for(let _=0;_<f.length;_++)s(_,oe(e,_),u&&u[_]||void 0);let o=1;for(le(h,(_,g,A,O,y,v)=>{if(!(A<0||_<o||_>r.length)){for(;_>o;)o<=r.length&&t(r[o-1],o,0,-1,-1,-1,-1),o++;_<=r.length&&(t(r[_-1],_,0,A,O,y,-1),o++)}});o<=r.length;o++)t(r[o-1],o,0,-1,-1,-1,-1);let l=r[r.length-1],d=l.endsWith(`
|
|
8
|
+
`),m=d?r.length+1:r.length,c=d?0:l.length;return{generatedLine:m,generatedColumn:c}},fs=(n,e,t,s,i)=>{let r=Je(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return r;let{sources:h,sourcesContent:o,names:a,mappings:l}=e;for(let c=0;c<h.length;c++)s(c,oe(e,c),o&&o[c]||void 0);if(a)for(let c=0;c<a.length;c++)i(c,a[c]);let d=0;return le(l,(c,_,g,A,O,y)=>{c>=f&&(_>=u||c>f)||(g>=0?(t(void 0,c,_,g,A,O,y),d=c):d===c&&(t(void 0,c,_,-1,-1,-1,-1),d=0))}),r},cs=(n,e,t,s,i)=>{let r=Je(n),{generatedLine:f,generatedColumn:u}=r;if(f===1&&u===0)return{generatedLine:1,generatedColumn:0};let{sources:h,sourcesContent:o,mappings:a}=e;for(let c=0;c<h.length;c++)s(c,oe(e,c),o&&o[c]||void 0);let l=u===0?f-1:f,d=1;return le(a,(c,_,g,A,O,y)=>{g>=0&&d<=c&&c<=l&&(t(void 0,c,0,g,A,O,-1),d=c+1)}),r};$e.exports=(n,e,t,s,i,r,f)=>f?r?fs(n,e,t,s,i):is(n,e,t,s,i):r?cs(n,e,t,s,i):us(n,e,t,s,i)});var Ze=j((tr,Ye)=>{"use strict";var Ke=Y(),Qe=X(),os=(n,e,t,s,i,r,f,u,h,o,a)=>{let l=new Map,d=new Map,m=[],c=[],_=[],g=-2,A=[],O=[],y=[],v=[],E=[],p=[],B=[],q=(w,b)=>{if(w>B.length)return-1;let{mappingsData:T}=B[w-1],S=0,M=T.length/5;for(;S<M;){let N=S+M>>1;T[N*5]<=b?S=N+1:M=N}return S===0?-1:S-1};return Ke(n,e,(w,b,T,S,M,N,z)=>{if(S===g){let R=q(M,N);if(R!==-1){let{chunks:L,mappingsData:I}=B[M-1],H=R*5,C=I[H+1],k=I[H+2],F=I[H+3],U=I[H+4];if(C>=0){let zt=L[R],Et=I[H],ee=N-Et;if(ee>0){let x=C<v.length?v[C]:null;if(x===void 0){let D=y[C];x=D?Qe(D):null,v[C]=x}if(x!==null){let D=k<=x.length?x[k-1].slice(F,F+ee):"";zt.slice(0,ee)===D&&(F+=ee,U=-1)}}let te=C<A.length?A[C]:-2;if(te===-2){let[x,D]=C<O.length?O[C]:[null,void 0],J=l.get(x);J===void 0&&(l.set(x,J=l.size),u(J,x,D)),te=J,A[C]=te}let W=-1;if(U>=0){if(W=U<E.length?E[U]:-2,W===-2){let x=U<p.length?p[U]:void 0;if(x){let D=d.get(x);D===void 0&&(d.set(x,D=d.size),h(D,x)),W=D}else W=-1;E[U]=W}}else if(z>=0){let x=v[C];if(x===void 0){let D=y[C];x=D?Qe(D):null,v[C]=x}if(x!==null){let D=_[z],J=k<=x.length?x[k-1].slice(F,F+D.length):"";if(D===J&&(W=z<c.length?c[z]:-2,W===-2)){let se=_[z];if(se){let re=d.get(se);re===void 0&&(d.set(se,re=d.size),h(re,se)),W=re}else W=-1;c[z]=W}}}f(w,b,T,te,k,F,W);return}}if(r){f(w,b,T,-1,-1,-1,-1);return}else if(m[S]===-2){let L=l.get(t);L===void 0&&(l.set(n,L=l.size),u(L,t,s)),m[S]=L}}let P=S<0||S>=m.length?-1:m[S];if(P<0)f(w,b,T,-1,-1,-1,-1);else{let R=-1;if(z>=0&&z<c.length&&(R=c[z],R===-2)){let L=_[z],I=d.get(L);I===void 0&&(d.set(L,I=d.size),h(I,L)),R=I,c[z]=R}f(w,b,T,P,M,N,R)}},(w,b,T)=>{if(b===t)g=w,s!==void 0?T=s:s=T,m[w]=-2,Ke(T,i,(S,M,N,z,P,R,L)=>{for(;B.length<M;)B.push({mappingsData:[],chunks:[]});let I=B[M-1];I.mappingsData.push(N,z,P,R,L),I.chunks.push(S)},(S,M,N)=>{y[S]=N,v[S]=void 0,A[S]=-2,O[S]=[M,N]},(S,M)=>{E[S]=-2,p[S]=M},!1,a);else{let S=l.get(b);S===void 0&&(l.set(b,S=l.size),u(S,b,T)),m[w]=S}},(w,b)=>{c[w]=-2,_[w]=b},o,a)};Ye.exports=os});var tt=j((sr,et)=>{"use strict";var ls=G(),as=Y(),hs=Ze(),{getMap:ds,getSourceAndMap:ps}=$(),Ae=class extends ls{constructor(e,t,s,i,r,f){super();let u=Buffer.isBuffer(e);this._valueAsString=u?void 0:e,this._valueAsBuffer=u?e:void 0,this._name=t,this._hasSourceMap=!!s;let h=Buffer.isBuffer(s),o=typeof s=="string";this._sourceMapAsObject=h||o?void 0:s,this._sourceMapAsString=o?s:void 0,this._sourceMapAsBuffer=h?s:void 0,this._hasOriginalSource=!!i;let a=Buffer.isBuffer(i);this._originalSourceAsString=a?void 0:i,this._originalSourceAsBuffer=a?i:void 0,this._hasInnerSourceMap=!!r;let l=Buffer.isBuffer(r),d=typeof r=="string";this._innerSourceMapAsObject=l||d?void 0:r,this._innerSourceMapAsString=d?r:void 0,this._innerSourceMapAsBuffer=l?r:void 0,this._removeOriginalSource=f}_ensureValueBuffer(){this._valueAsBuffer===void 0&&(this._valueAsBuffer=Buffer.from(this._valueAsString,"utf-8"))}_ensureValueString(){this._valueAsString===void 0&&(this._valueAsString=this._valueAsBuffer.toString("utf-8"))}_ensureOriginalSourceBuffer(){this._originalSourceAsBuffer===void 0&&this._hasOriginalSource&&(this._originalSourceAsBuffer=Buffer.from(this._originalSourceAsString,"utf-8"))}_ensureOriginalSourceString(){this._originalSourceAsString===void 0&&this._hasOriginalSource&&(this._originalSourceAsString=this._originalSourceAsBuffer.toString("utf-8"))}_ensureInnerSourceMapObject(){this._innerSourceMapAsObject===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsObject=JSON.parse(this._innerSourceMapAsString))}_ensureInnerSourceMapBuffer(){this._innerSourceMapAsBuffer===void 0&&this._hasInnerSourceMap&&(this._ensureInnerSourceMapString(),this._innerSourceMapAsBuffer=Buffer.from(this._innerSourceMapAsString,"utf-8"))}_ensureInnerSourceMapString(){this._innerSourceMapAsString===void 0&&this._hasInnerSourceMap&&(this._innerSourceMapAsBuffer!==void 0?this._innerSourceMapAsString=this._innerSourceMapAsBuffer.toString("utf-8"):this._innerSourceMapAsString=JSON.stringify(this._innerSourceMapAsObject))}_ensureSourceMapObject(){this._sourceMapAsObject===void 0&&(this._ensureSourceMapString(),this._sourceMapAsObject=JSON.parse(this._sourceMapAsString))}_ensureSourceMapBuffer(){this._sourceMapAsBuffer===void 0&&(this._ensureSourceMapString(),this._sourceMapAsBuffer=Buffer.from(this._sourceMapAsString,"utf-8"))}_ensureSourceMapString(){this._sourceMapAsString===void 0&&(this._sourceMapAsBuffer!==void 0?this._sourceMapAsString=this._sourceMapAsBuffer.toString("utf-8"):this._sourceMapAsString=JSON.stringify(this._sourceMapAsObject))}getArgsAsBuffers(){return this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),[this._valueAsBuffer,this._name,this._sourceMapAsBuffer,this._originalSourceAsBuffer,this._innerSourceMapAsBuffer,this._removeOriginalSource]}buffer(){return this._ensureValueBuffer(),this._valueAsBuffer}source(){return this._ensureValueString(),this._valueAsString}map(e){return this._hasInnerSourceMap?ds(this,e):(this._ensureSourceMapObject(),this._sourceMapAsObject)}sourceAndMap(e){return this._hasInnerSourceMap?ps(this,e):(this._ensureValueString(),this._ensureSourceMapObject(),{source:this._valueAsString,map:this._sourceMapAsObject})}streamChunks(e,t,s,i){return this._ensureValueString(),this._ensureSourceMapObject(),this._ensureOriginalSourceString(),this._hasInnerSourceMap?(this._ensureInnerSourceMapObject(),hs(this._valueAsString,this._sourceMapAsObject,this._name,this._originalSourceAsString,this._innerSourceMapAsObject,this._removeOriginalSource,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))):as(this._valueAsString,this._sourceMapAsObject,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1))}updateHash(e){this._ensureValueBuffer(),this._ensureSourceMapBuffer(),this._ensureOriginalSourceBuffer(),this._ensureInnerSourceMapBuffer(),e.update("SourceMapSource"),e.update(this._valueAsBuffer),e.update(this._sourceMapAsBuffer),this._hasOriginalSource&&e.update(this._originalSourceAsBuffer),this._hasInnerSourceMap&&e.update(this._innerSourceMapAsBuffer),e.update(this._removeOriginalSource?"true":"false")}};et.exports=Ae});var Z=j((rr,st)=>{"use strict";var _s=ue(),gs=Y();st.exports=(n,e,t,s,i)=>{if(typeof n.streamChunks=="function")return n.streamChunks(e,t,s,i);{let r=n.sourceAndMap(e);return r.map?gs(r.source,r.map,t,s,i,!!(e&&e.finalSource),!!(e&&e.columns!==!1)):_s(r.source,t,s,i,!!(e&&e.finalSource))}}});var nt=j((nr,rt)=>{"use strict";var Ss=ge(),ms=Z(),As=(n,e,t,s,i)=>{let r="",f="",u=[],h=[],o=[],a=Ss(Object.assign({},e,{columns:!0})),l=!!(e&&e.finalSource),{generatedLine:d,generatedColumn:m,source:c}=ms(n,e,(g,A,O,y,v,E,p)=>(g!==void 0&&(r+=g),f+=a(A,O,y,v,E,p),t(l?void 0:g,A,O,y,v,E,p)),(g,A,O)=>{for(;u.length<g;)u.push(null);if(u[g]=A,O!==void 0){for(;h.length<g;)h.push(null);h[g]=O}return s(g,A,O)},(g,A)=>{for(;o.length<g;)o.push(null);return o[g]=A,i(g,A)}),_=c!==void 0?c:r;return{result:{generatedLine:d,generatedColumn:m,source:l?_:void 0},source:_,map:f.length>0?{version:3,file:"x",mappings:f,sources:u,sourcesContent:h.length>0?h:void 0,names:o}:null}};rt.exports=As});var ut=j((ir,it)=>{"use strict";var Ms=G(),Bs=Y(),vs=ue(),bs=nt(),Os=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=Buffer.from(n.mappings,"utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&Buffer.from(t,"utf-8"))),e},ys=n=>{if(typeof n!="object"||!n)return n;let e=Object.assign({},n);return n.mappings&&(e.mappings=n.mappings.toString("utf-8")),n.sourcesContent&&(e.sourcesContent=n.sourcesContent.map(t=>t&&t.toString("utf-8"))),e},Me=class extends Ms{constructor(e,t){super(),this._source=e,this._cachedSourceType=t?t.source:void 0,this._cachedSource=void 0,this._cachedBuffer=t?t.buffer:void 0,this._cachedSize=t?t.size:void 0,this._cachedMaps=t?t.maps:new Map,this._cachedHashUpdate=t?t.hash:void 0}getCachedData(){let e=new Map;for(let t of this._cachedMaps){let s=t[1];s.bufferedMap===void 0&&(s.bufferedMap=Os(this._getMapFromCacheEntry(s))),e.set(t[0],{map:void 0,bufferedMap:s.bufferedMap})}return this._cachedSource&&this.buffer(),{buffer:this._cachedBuffer,source:this._cachedSourceType!==void 0?this._cachedSourceType:typeof this._cachedSource=="string"?!0:Buffer.isBuffer(this._cachedSource)?!1:void 0,size:this._cachedSize,maps:e,hash:this._cachedHashUpdate}}originalLazy(){return this._source}original(){return typeof this._source=="function"&&(this._source=this._source()),this._source}source(){let e=this._getCachedSource();return e!==void 0?e:this._cachedSource=this.original().source()}_getMapFromCacheEntry(e){if(e.map!==void 0)return e.map;if(e.bufferedMap!==void 0)return e.map=ys(e.bufferedMap)}_getCachedSource(){if(this._cachedSource!==void 0)return this._cachedSource;if(this._cachedBuffer&&this._cachedSourceType!==void 0)return this._cachedSource=this._cachedSourceType?this._cachedBuffer.toString("utf-8"):this._cachedBuffer}buffer(){if(this._cachedBuffer!==void 0)return this._cachedBuffer;if(this._cachedSource!==void 0)return Buffer.isBuffer(this._cachedSource)?this._cachedBuffer=this._cachedSource:this._cachedBuffer=Buffer.from(this._cachedSource,"utf-8");if(typeof this.original().buffer=="function")return this._cachedBuffer=this.original().buffer();let e=this.source();return Buffer.isBuffer(e)?this._cachedBuffer=e:this._cachedBuffer=Buffer.from(e,"utf-8")}size(){if(this._cachedSize!==void 0)return this._cachedSize;if(this._cachedBuffer!==void 0)return this._cachedSize=this._cachedBuffer.length;let e=this._getCachedSource();return e!==void 0?this._cachedSize=Buffer.byteLength(e):this._cachedSize=this.original().size()}sourceAndMap(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0){let f=this._getMapFromCacheEntry(s);return{source:this.source(),map:f}}let i=this._getCachedSource(),r;if(i!==void 0)r=this.original().map(e);else{let f=this.original().sourceAndMap(e);i=f.source,r=f.map,this._cachedSource=i}return this._cachedMaps.set(t,{map:r,bufferedMap:void 0}),{source:i,map:r}}streamChunks(e,t,s,i){let r=e?JSON.stringify(e):"{}";if(this._cachedMaps.has(r)&&(this._cachedBuffer!==void 0||this._cachedSource!==void 0)){let{source:o,map:a}=this.sourceAndMap(e);return a?Bs(o,a,t,s,i,!!(e&&e.finalSource),!0):vs(o,t,s,i,!!(e&&e.finalSource))}let{result:f,source:u,map:h}=bs(this.original(),e,t,s,i);return this._cachedSource=u,this._cachedMaps.set(r,{map:h,bufferedMap:void 0}),f}map(e){let t=e?JSON.stringify(e):"{}",s=this._cachedMaps.get(t);if(s!==void 0)return this._getMapFromCacheEntry(s);let i=this.original().map(e);return this._cachedMaps.set(t,{map:i,bufferedMap:void 0}),i}updateHash(e){if(this._cachedHashUpdate!==void 0){for(let r of this._cachedHashUpdate)e.update(r);return}let t=[],s,i={update:r=>{typeof r=="string"&&r.length<10240?s===void 0?s=r:(s+=r,s.length>102400&&(t.push(Buffer.from(s)),s=void 0)):(s!==void 0&&(t.push(Buffer.from(s)),s=void 0),t.push(r))}};this.original().updateHash(i),s!==void 0&&t.push(Buffer.from(s));for(let r of t)e.update(r);this._cachedHashUpdate=t}};it.exports=Me});var ot=j((ur,ct)=>{"use strict";var ws=G(),ft=fe(),Ts=Z(),{getMap:Cs,getSourceAndMap:zs}=$(),Be=new WeakSet,ve=class n extends ws{constructor(){super(),this._children=[];for(let e=0;e<arguments.length;e++){let t=arguments[e];if(t instanceof n)for(let s of t._children)this._children.push(s);else this._children.push(t)}this._isOptimized=arguments.length===0}getChildren(){return this._isOptimized||this._optimize(),this._children}add(e){if(e instanceof n)for(let t of e._children)this._children.push(t);else this._children.push(e);this._isOptimized=!1}addAllSkipOptimizing(e){for(let t of e)this._children.push(t)}buffer(){this._isOptimized||this._optimize();let e=[];for(let t of this._children)if(typeof t.buffer=="function")e.push(t.buffer());else{let s=t.source();Buffer.isBuffer(s)?e.push(s):e.push(Buffer.from(s,"utf-8"))}return Buffer.concat(e)}source(){this._isOptimized||this._optimize();let e="";for(let t of this._children)e+=t.source();return e}size(){this._isOptimized||this._optimize();let e=0;for(let t of this._children)e+=t.size();return e}map(e){return Cs(this,e)}sourceAndMap(e){return zs(this,e)}streamChunks(e,t,s,i){if(this._isOptimized||this._optimize(),this._children.length===1)return this._children[0].streamChunks(e,t,s,i);let r=0,f=0,u=new Map,h=new Map,o=!!(e&&e.finalSource),a="",l=!1;for(let d of this._children){let m=[],c=[],_=0,{generatedLine:g,generatedColumn:A,source:O}=Ts(d,e,(y,v,E,p,B,q,w)=>{let b=v+r,T=v===1?E+f:E;l&&((v!==1||E!==0)&&t(void 0,r+1,f,-1,-1,-1,-1),l=!1);let S=p<0||p>=m.length?-1:m[p],M=w<0||w>=c.length?-1:c[w];_=S<0?0:v,o?(y!==void 0&&(a+=y),S>=0&&t(void 0,b,T,S,B,q,M)):S<0?t(y,b,T,-1,-1,-1,-1):t(y,b,T,S,B,q,M)},(y,v,E)=>{let p=u.get(v);p===void 0&&(u.set(v,p=u.size),s(p,v,E)),m[y]=p},(y,v)=>{let E=h.get(v);E===void 0&&(h.set(v,E=h.size),i(E,v)),c[y]=E});O!==void 0&&(a+=O),l&&(g!==1||A!==0)&&(t(void 0,r+1,f,-1,-1,-1,-1),l=!1),g>1?f=A:f+=A,l=l||o&&_===g,r+=g-1}return{generatedLine:r+1,generatedColumn:f,source:o?a:void 0}}updateHash(e){this._isOptimized||this._optimize(),e.update("ConcatSource");for(let t of this._children)t.updateHash(e)}_optimize(){let e=[],t,s,i=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u):s=[typeof s=="string"?s:s.source(),u]},r=u=>{s===void 0?s=u:Array.isArray(s)?s.push(u.source()):s=[typeof s=="string"?s:s.source(),u.source()]},f=()=>{if(Array.isArray(s)){let u=new ft(s.join(""));Be.add(u),e.push(u)}else if(typeof s=="string"){let u=new ft(s);Be.add(u),e.push(u)}else e.push(s)};for(let u of this._children)typeof u=="string"?t===void 0?t=u:t+=u:(t!==void 0&&(i(t),t=void 0),Be.has(u)?r(u):(s!==void 0&&(f(),s=void 0),e.push(u)));t!==void 0&&i(t),s!==void 0&&f(),this._children=e,this._isOptimized=!0}};ct.exports=ve});var dt=j((fr,ht)=>{"use strict";var{getMap:Es,getSourceAndMap:qs}=$(),Ns=Z(),js=G(),be=X(),at=typeof process=="object"&&process.versions&&typeof process.versions.v8=="string"&&!/^[0-6]\./.test(process.versions.v8),lt=536870912,ae=class{constructor(e,t,s,i){this.start=e,this.end=t,this.content=s,this.name=i,at||(this.index=-1)}},Oe=class extends js{constructor(e,t){super(),this._source=e,this._name=t,this._replacements=[],this._isSorted=!0}getName(){return this._name}getReplacements(){return this._sortReplacements(),this._replacements}replace(e,t,s,i){if(typeof s!="string")throw new Error("insertion must be a string, but is a "+typeof s);this._replacements.push(new ae(e,t,s,i)),this._isSorted=!1}insert(e,t,s){if(typeof t!="string")throw new Error("insertion must be a string, but is a "+typeof t+": "+t);this._replacements.push(new ae(e,e-1,t,s)),this._isSorted=!1}source(){if(this._replacements.length===0)return this._source.source();let e=this._source.source(),t=0,s=[];this._sortReplacements();for(let i of this._replacements){let r=Math.floor(i.start),f=Math.floor(i.end+1);if(t<r){let u=r-t;s.push(e.slice(0,u)),e=e.slice(u),t=r}if(s.push(i.content),t<f){let u=f-t;e=e.slice(u),t=f}}return s.push(e),s.join("")}map(e){return this._replacements.length===0?this._source.map(e):Es(this,e)}sourceAndMap(e){return this._replacements.length===0?this._source.sourceAndMap(e):qs(this,e)}original(){return this._source}_sortReplacements(){this._isSorted||(at?this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:0}):(this._replacements.forEach((e,t)=>e.index=t),this._replacements.sort(function(e,t){let s=e.start-t.start;if(s!==0)return s;let i=e.end-t.end;return i!==0?i:e.index-t.index})),this._isSorted=!0)}streamChunks(e,t,s,i){this._sortReplacements();let r=this._replacements,f=0,u=0,h=-1,o=u<r.length?Math.floor(r[u].start):lt,a=0,l=0,d=0,m=[],c=new Map,_=[],g=(p,B,q,w)=>{let b=p<m.length?m[p]:void 0;if(b===void 0)return!1;typeof b=="string"&&(b=be(b),m[p]=b);let T=B<=b.length?b[B-1]:null;return T===null?!1:T.slice(q,q+w.length)===w},{generatedLine:A,generatedColumn:O}=Ns(this._source,Object.assign({},e,{finalSource:!1}),(p,B,q,w,b,T,S)=>{let M=0,N=f+p.length;if(h>f){if(h>=N){let P=B+a;p.endsWith(`
|
|
9
|
+
`)?(a--,d===P&&(l+=q)):d===P?l-=p.length:(l=-p.length,d=P),f=N;return}M=h-f,g(w,b,T,p.slice(0,M))&&(T+=M),f+=M;let z=B+a;d===z?l-=M:(l=-M,d=z),q+=M}if(o<N)do{let z=B+a;if(o>f){let C=o-f,k=p.slice(M,M+C);t(k,z,q+(z===d?l:0),w,b,T,S<0||S>=_.length?-1:_[S]),q+=C,M+=C,f=o,g(w,b,T,k)&&(T+=k.length)}let{content:P,name:R}=r[u],L=be(P),I=S;if(w>=0&&R){let C=c.get(R);C===void 0&&(C=c.size,c.set(R,C),i(C,R)),I=C}for(let C=0;C<L.length;C++){let k=L[C];t(k,z,q+(z===d?l:0),w,b,T,I),I=-1,C===L.length-1&&!k.endsWith(`
|
|
10
|
+
`)?d===z?l+=k.length:(l=k.length,d=z):(a++,z++,l=-q,d=z)}h=Math.max(h,Math.floor(r[u].end+1)),u++,o=u<r.length?Math.floor(r[u].start):lt;let H=p.length-N+h-M;if(H>0){if(h>=N){let k=B+a;p.endsWith(`
|
|
11
|
+
`)?(a--,d===k&&(l+=q)):d===k?l-=p.length-M:(l=M-p.length,d=k),f=N;return}let C=B+a;g(w,b,T,p.slice(M,M+H))&&(T+=H),M+=H,f+=H,d===C?l-=H:(l=-H,d=C),q+=H}}while(o<N);if(M<p.length){let z=M===0?p:p.slice(M),P=B+a;t(z,P,q+(P===d?l:0),w,b,T,S<0?-1:_[S])}f=N},(p,B,q)=>{for(;m.length<p;)m.push(void 0);m[p]=q,s(p,B,q)},(p,B)=>{let q=c.get(B);q===void 0&&(q=c.size,c.set(B,q),i(q,B)),_[p]=q}),y="";for(;u<r.length;u++)y+=r[u].content;let v=A+a,E=be(y);for(let p=0;p<E.length;p++){let B=E[p];t(B,v,O+(v===d?l:0),-1,-1,-1,-1),p===E.length-1&&!B.endsWith(`
|
|
12
|
+
`)?d===v?l+=B.length:(l=B.length,d=v):(a++,v++,l=-O,d=v)}return{generatedLine:v,generatedColumn:O+(v===d?l:0)}}updateHash(e){this._sortReplacements(),e.update("ReplaceSource"),this._source.updateHash(e),e.update(this._name||"");for(let t of this._replacements)e.update(`${t.start}${t.end}${t.content}${t.name}`)}};ht.exports=Oe});var gt=j((cr,_t)=>{"use strict";var xs=G(),ks=fe(),Is=Z(),{getMap:Ds,getSourceAndMap:Rs}=$(),pt=/\n(?=.|\s)/g,ye=class extends xs{constructor(e,t){super(),this._source=typeof t=="string"||Buffer.isBuffer(t)?new ks(t,!0):t,this._prefix=e}getPrefix(){return this._prefix}original(){return this._source}source(){let e=this._source.source(),t=this._prefix;return t+e.replace(pt,`
|
|
13
|
+
`+t)}map(e){return Ds(this,e)}sourceAndMap(e){return Rs(this,e)}streamChunks(e,t,s,i){let r=this._prefix,f=r.length,u=!!(e&&e.columns===!1),{generatedLine:h,generatedColumn:o,source:a}=Is(this._source,e,(l,d,m,c,_,g,A)=>{m!==0?m+=f:l!==void 0?u||c<0?l=r+l:f>0&&(t(r,d,m,-1,-1,-1,-1),m+=f):u||(m+=f),t(l,d,m,c,_,g,A)},s,i);return{generatedLine:h,generatedColumn:o===0?0:f+o,source:a!==void 0?r+a.replace(pt,`
|
|
14
|
+
`+r):void 0}}updateHash(e){e.update("PrefixSource"),this._source.updateHash(e),e.update(this._prefix)}};_t.exports=ye});var mt=j((or,St)=>{"use strict";var Ls=G(),we=class extends Ls{constructor(e){super(),this._size=e}_error(){return new Error("Content and Map of this Source is not available (only size() is supported)")}size(){return this._size}source(){throw this._error()}buffer(){throw this._error()}map(e){throw this._error()}updateHash(){throw this._error()}};St.exports=we});var Bt=j((lr,Mt)=>{"use strict";var At=G(),Te=class n extends At{static from(e){return e instanceof At?e:new n(e)}constructor(e){super(),this._sourceLike=e}source(){return this._sourceLike.source()}buffer(){return typeof this._sourceLike.buffer=="function"?this._sourceLike.buffer():super.buffer()}size(){return typeof this._sourceLike.size=="function"?this._sourceLike.size():super.size()}map(e){return typeof this._sourceLike.map=="function"?this._sourceLike.map(e):super.map(e)}sourceAndMap(e){return typeof this._sourceLike.sourceAndMap=="function"?this._sourceLike.sourceAndMap(e):super.sourceAndMap(e)}updateHash(e){if(typeof this._sourceLike.updateHash=="function")return this._sourceLike.updateHash(e);if(typeof this._sourceLike.map=="function")throw new Error("A Source-like object with a 'map' method must also provide an 'updateHash' method");e.update(this.buffer())}};Mt.exports=Te});var bt=j(vt=>{var V=(n,e)=>{let t;Object.defineProperty(vt,n,{get:()=>(e!==void 0&&(t=e(),e=void 0),t),configurable:!0})};V("Source",()=>G());V("RawSource",()=>fe());V("OriginalSource",()=>Pe());V("SourceMapSource",()=>tt());V("CachedSource",()=>ut());V("ConcatSource",()=>ot());V("ReplaceSource",()=>dt());V("PrefixSource",()=>gt());V("SizeOnlySource",()=>mt());V("CompatSource",()=>Bt())});var Ps={};It(Ps,{BuilderDevToolsPlugin:()=>Ce});module.exports=Rt(Ps);var yt=Dt(bt(),1),de=require("node:path"),Q=require("node:fs"),wt=require("../core/index.cjs"),Tt=require("../node/index.cjs"),Ct=require("../server/index.cjs"),Ot="BuilderDevToolsPlugin",he=null;async function Hs(n){let e=await(0,Tt.createDevToolsNodeSys)({getRootDir:()=>process.cwd()});e.debug("webpack setupDevTools init");let t=await(0,wt.createDevTools)(e),s=await(0,Ct.createDevToolsServer)({...t,getClientId:()=>"webpack-builder-dev-tools",closeAppServer:async()=>{},restartAppServer:async()=>{e.debug("restart server");let i=["next.config.js","next.config.ts","next.config.mjs","webpack.config.js","webpack.config.ts"].map(r=>(0,de.join)(e.getRootDir(),r));for(let r of i)if((0,Q.existsSync)(r)){e.debug(`restart server: ${r}`),(0,Q.writeFileSync)(r,(0,Q.readFileSync)(r)),await new Promise(f=>setTimeout(f,50));return}},enableAppWatch:async i=>i,...e,...n});return e.debug("webpack setupDevTools done"),{server:s,sys:e}}var Ce=class{constructor(e){this.opts=e||{},typeof this.opts.enabled!="boolean"&&(this.opts.enabled=process.env.NODE_ENV!=="production"),this.opts.enabled&&he==null&&(he=Hs(this.opts))}apply(e){if(this.opts.enabled===!1)return;let t=e,s=t.webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS,i=new WeakMap;t.hooks.compilation.tap(Ot,r=>{r.hooks.processAssets.tapAsync({name:Ot,stage:s},async(f,u)=>{if(he!=null){for(let h of r.chunks)for(let o of h.files){let a=(0,de.basename)(o),{server:l,sys:d}=await he;if(d.getFrameworks().some(A=>A.name==="next")&&a!=="webpack.js")continue;d.getRootDir=()=>t.context;let m=new URL("/~builder-dev-tools.js",l.getUrl()),c=`
|
|
16
15
|
;
|
|
17
16
|
/* Builder Devtools (Webpack) */
|
|
18
17
|
`;c+=`(() => {
|