@rsdoctor/client 0.4.12 → 0.4.13
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/index.html +1 -1
- package/dist/resource/js/{773.3443dfd6.js → 773.f0f2a001.js} +1 -1
- package/dist/resource/js/index.8d2a87e4.js +163 -0
- package/dist/resource/js/{rc-1.aee467be.js → rc-1.910174e5.js} +1 -1
- package/dist/resource/js/{react.37d7f565.js → react.0a0039a0.js} +1 -1
- package/dist/resource/js/vender.15439729.js +1 -0
- package/package.json +6 -6
- package/dist/resource/js/index.ec707922.js +0 -163
- package/dist/resource/js/vender.a0f6fb83.js +0 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
(()=>{var e={19749:function(){},98878:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5264:function(e,t){"use strict";var r,n,s,i,l,a;Object.defineProperty(t,"__esModule",{value:!0}),t.RsdoctorClientDiffState=t.RsdoctorClientRoutes=t.RsdoctorClientUrlQuery=void 0,(i=r||(t.RsdoctorClientUrlQuery=r={})).BundleDiffFiles="__bundle_files__",i.ManifestFile="manifest",(l=n||(t.RsdoctorClientRoutes=n={})).Overall="/overall",l.WebpackLoaderOverall="/webpack/loaders/overall",l.WebpackLoaderAnalysis="/webpack/loaders/analysis",l.ModuleResolve="/module/resolve",l.WebpackPlugins="/webpack/plugins",l.BundleSize="/bundle/size",l.ModuleAnalyze="/module/analyze",l.TreeShaking="/treeshaking",l.BundleDiff="/resources/bundle/diff",l.RuleIndex="/resources/rules",l.Uploader="/resources/uploader",l.EmoCheck="/emo/check",(a=s||(t.RsdoctorClientDiffState=s={})).Equal="-",a.Up="UP",a.Down="DOWN"},43900:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},81046:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WINDOW_RSDOCTOR_TAG=t.RsdoctorClientUrl=t.RsdoctorProcessEnvDebugKey=t.RsdoctorMonitorDocBId=t.RsdoctorMonitorWebBId=t.RsdoctorMonitorNodeBId=t.StatsFilePath=t.RsdoctorOutputManifestPath=t.RsdoctorOutputManifest=t.RsdoctorOutputFolder=t.MapExtensions=t.FontExtensions=t.MediaExtensions=t.ImgExtensions=t.HtmlExtension=t.CSSExtension=t.JSExtension=void 0,t.JSExtension=".js",t.CSSExtension=".css",t.HtmlExtension=".html",t.ImgExtensions=[".png",".jpg",".svg",".webp",".jpeg",".gif",".bmp"],t.MediaExtensions=[".mp3",".mp4",".avi",".wav",".flv",".mov",".mpg",".mpeg"],t.FontExtensions=[".ttf",".fnt",".fon",".otf",".woff",".woff2"],t.MapExtensions=[".js.map",".css.map",".ts.map",".LICENSE.txt"],t.RsdoctorOutputFolder=".rsdoctor",t.RsdoctorOutputManifest="manifest.json",t.RsdoctorOutputManifestPath=`${t.RsdoctorOutputFolder}/${t.RsdoctorOutputManifest}`,t.StatsFilePath="dist/stats.json",t.RsdoctorMonitorNodeBId="Rsdoctor",t.RsdoctorMonitorWebBId="Rsdoctor-Client",t.RsdoctorMonitorDocBId="Rsdoctor-Doc",t.RsdoctorProcessEnvDebugKey="RSDOCTOR_DEBUG",t.RsdoctorClientUrl="",t.WINDOW_RSDOCTOR_TAG="__RSDOCTOR__"},38159:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorLevel=void 0,(n=r||(t.ErrorLevel=r={}))[n.Ignore=0]="Ignore",n[n.Warn=1]="Warn",n[n.Error=2]="Error"},99982:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},78741:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Plugin=t.Constants=t.Client=t.Thirdparty=t.Rule=t.Linter=t.Modules=t.SDK=t.Logger=t.Err=t.Common=t.Babel=t.Esbuild=t.Manifest=void 0,t.Manifest=i(r(41657)),t.Esbuild=i(r(99982)),t.Babel=i(r(98878)),t.Common=i(r(43900)),t.Err=i(r(38159)),t.Logger=i(r(79841)),t.SDK=i(r(2167)),t.Modules=i(r(25775)),t.Linter=i(r(57274)),t.Rule=i(r(30518)),t.Thirdparty=i(r(11549)),t.Client=i(r(5264)),t.Constants=i(r(81046)),t.Plugin=i(r(87428))},46615:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Severity=void 0;var n=r(38159);Object.defineProperty(t,"Severity",{enumerable:!0,get:function(){return n.ErrorLevel}})},57274:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"!==r&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(46615),t),s(r(57222),t)},57222:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79841:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.LogLevel=void 0,(n=r||(t.LogLevel=r={}))[n.Silent=0]="Silent",n[n.Error=1]="Error",n[n.Warning=2]="Warning",n[n.Info=3]="Info",n[n.Debug=4]="Debug",n[n.Verbose=5]="Verbose"},41657:function(e,t){"use strict";var r,n,s;Object.defineProperty(t,"__esModule",{value:!0}),t.RsdoctorManifestClientConstant=t.RsdoctorManifestClientRoutes=void 0,(s=r||(t.RsdoctorManifestClientRoutes=r={})).Overall="Overall",s.WebpackLoaders="Compile.WebpackLoaders",s.ModuleResolve="Compile.ModuleResolve",s.WebpackPlugins="Compile.WebpackPlugins",s.BundleSize="Bundle.BundleSize",s.ModuleGraph="Bundle.ModuleGraph",s.TreeShaking="Bundle.TreeShaking",(n||(t.RsdoctorManifestClientConstant=n={})).WindowPropertyForManifestUrl="__DEVTOOLS_MANIFEST_URL__"},25775:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82122:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},13709:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},29842:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87428:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"!==r&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(82122),t),s(r(29842),t),s(r(63345),t),s(r(13709),t)},63345:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},5312:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.message=t.code=void 0,t.code="E1001",t.message={code:t.code,title:"Duplicate Packages",type:"markdown",category:"bundle",description:`
|
|
2
|
+
#### Description
|
|
3
|
+
|
|
4
|
+
there is a same name package which bundled more than one version in your application.
|
|
5
|
+
|
|
6
|
+
it is not good to the bundle size of your application.
|
|
7
|
+
|
|
8
|
+
#### General Solution
|
|
9
|
+
|
|
10
|
+
add an entry in \`resolve.alias\` which will configure Webpack to route any package references to a single specified path.
|
|
11
|
+
|
|
12
|
+
For example, if \`lodash\` is duplicated in your bundle, the following configuration would render all Lodash imports to always refer to the \`lodash\` instance found at \`./node_modules/lodash\`:
|
|
13
|
+
|
|
14
|
+
\`\`\`js
|
|
15
|
+
{
|
|
16
|
+
alias: {
|
|
17
|
+
lodash: path.resolve(__dirname, 'node_modules/lodash')
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
\`\`\`
|
|
21
|
+
`}},88659:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.message=t.code=void 0,t.code="E1002",t.message={code:t.code,title:"Default Import Check",type:"markdown",category:"compile",description:`
|
|
22
|
+
#### Description
|
|
23
|
+
|
|
24
|
+
Usually webpack will automatically compatible different modules that has different types, but in a special case, the operation of compatibility will fail.
|
|
25
|
+
That is, when you use \`Default Import\` to import a cjs module, and this cjs module do not have the compatible statement, such as \`exports.default = \`.
|
|
26
|
+
|
|
27
|
+
#### General Solution
|
|
28
|
+
|
|
29
|
+
1. for cjs module, write a \`exports.default = \` statement for default export.
|
|
30
|
+
2. use \`Namespace Import\` for import the cjs module.
|
|
31
|
+
|
|
32
|
+
For example, for the package \`htmlparser2@7.2.0\`:
|
|
33
|
+
|
|
34
|
+
\`\`\`ts
|
|
35
|
+
// you should use this
|
|
36
|
+
import * as Parser from 'htmlparser2';
|
|
37
|
+
|
|
38
|
+
// can not use this
|
|
39
|
+
import Parser from 'htmlparser2';
|
|
40
|
+
\`\`\`
|
|
41
|
+
`}},46580:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.message=t.code=void 0,t.code="E1003",t.message={code:t.code,title:"Loader Performance Optimization",type:"markdown",category:"compile",description:`
|
|
42
|
+
#### Description
|
|
43
|
+
|
|
44
|
+
Usually the slow compile of most projects is due to the slow execution of the loaders.
|
|
45
|
+
|
|
46
|
+
And the loaders always pre-process many unnecessary files, such as \`node_modules files\` and \`already compiled files\`.
|
|
47
|
+
|
|
48
|
+
#### General Solution
|
|
49
|
+
|
|
50
|
+
Set \`exclude\` to the \`module.rules\` of webpack configuration for target loader.
|
|
51
|
+
|
|
52
|
+
For example, if \`node_modules/lodash\` is processed by the \`babel-loader\` that make the compile slowly:
|
|
53
|
+
|
|
54
|
+
\`\`\`
|
|
55
|
+
{
|
|
56
|
+
module: {
|
|
57
|
+
rules: [
|
|
58
|
+
{
|
|
59
|
+
test: /\\.js$/,
|
|
60
|
+
use: 'babel-loader',
|
|
61
|
+
exclude: [
|
|
62
|
+
/node_modules\\/lodash/
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
\`\`\`
|
|
69
|
+
`}},58686:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.message=t.code=void 0,t.code="E1004",t.message={code:t.code,title:"ECMA Version Check",type:"markdown",category:"bundle",description:`
|
|
70
|
+
#### Description
|
|
71
|
+
|
|
72
|
+
Detect if there is a newer version of ECMA syntax in the js bundle file
|
|
73
|
+
`}},43450:function(e,t,r){"use strict";var n,s=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&s(t,e,r);return i(t,e),t},a=this&&this.__exportStar||function(e,t){for(var r in e)"default"!==r&&!Object.prototype.hasOwnProperty.call(t,r)&&s(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.RsdoctorRuleClientConstant=t.RuleErrorMap=void 0;let o=l(r(5312)),d=l(r(88659)),c=l(r(46580)),u=l(r(58686));t.RuleErrorMap={[o.code]:o.message,[d.code]:d.message,[c.code]:c.message,[u.code]:u.message},(n||(t.RsdoctorRuleClientConstant=n={})).UrlQueryForErrorCode="code",a(r(22552),t)},22552:function(e,t){"use strict";var r,n,s,i;Object.defineProperty(t,"__esModule",{value:!0}),t.RuleMessageCategory=t.RuleMessageCodeEnumerated=void 0,(s=r||(t.RuleMessageCodeEnumerated=r={})).Extend="EXTEND",s.Overlay="OVERLAY",(i=n||(t.RuleMessageCategory=n={})).Compile="compile",i.Bundle="bundle",i.EMO="emo"},83014:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30518:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"!==r&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(43450),t),s(r(83014),t)},23012:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},83033:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},62353:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},76532:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},19753:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},2167:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__exportStar||function(e,t){for(var r in e)"default"!==r&&!Object.prototype.hasOwnProperty.call(t,r)&&n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),s(r(48051),t),s(r(58615),t),s(r(82635),t),s(r(89258),t),s(r(23012),t),s(r(99342),t),s(r(62757),t),s(r(66596),t),s(r(62353),t),s(r(83033),t),s(r(18377),t),s(r(64420),t),s(r(46147),t),s(r(76532),t),s(r(12674),t),s(r(19753),t)},12674:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.IMode=void 0,(n=r||(t.IMode=r={}))[n.brief=0]="brief",n[n.lite=1]="lite",n[n.normal=2]="normal"},48051:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},89258:function(e,t){"use strict";var r,n,s,i,l,a;Object.defineProperty(t,"__esModule",{value:!0}),t.ToDataType=t.ModuleKind=t.DependencyKind=void 0,(i=r||(t.DependencyKind=r={}))[i.Unknown=0]="Unknown",i[i.ImportStatement=1]="ImportStatement",i[i.DynamicImport=2]="DynamicImport",i[i.RequireCall=3]="RequireCall",i[i.AMDRequire=4]="AMDRequire",(l=n||(t.ModuleKind=n={}))[l.Normal=0]="Normal",l[l.Concatenation=1]="Concatenation",(a=s||(t.ToDataType=s={}))[a.NoCode=0]="NoCode",a[a.Normal=1]="Normal",a[a.NoSource=2]="NoSource",a[a.NoSourceAndAssets=3]="NoSourceAndAssets",a[a.All=4]="All"},66596:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},82635:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},58615:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},99342:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},43866:function(e,t,r){"use strict";var n,s,i,l=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"!==r&&!Object.prototype.hasOwnProperty.call(t,r)&&l(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.APIExtends=t.API=void 0,a(r(50028),t),(n=s||(t.API=s={})).ApplyErrorFix="/api/apply/error/fix",n.Env="/api/env",n.EntryHtml="/index.html",n.Manifest="/api/manifest.json",n.LoadDataByKey="/api/data/key",n.SendAPIDataToClient="/api/socket/send",n.GetProjectInfo="/api/project/info",n.GetClientRoutes="/api/routes",n.ReportLoader="/api/loader/report",n.GetLoaderNames="/api/loader/names",n.GetLoaderChartData="/api/loader/chart/data",n.GetLoaderFileTree="/api/loader/filetree",n.GetLoaderFileDetails="/api/loader/file",n.GetLoaderFolderStatistics="/api/loader/folder/statics",n.GetLoaderFileFirstInput="/api/loader/input",n.GetLoaderFileInputAndOutput="/api/loader/inputandoutput",n.ReportSourceMap="/api/sourcemap/report",n.GetResolverFileTree="/api/resolver/filetree",n.GetResolverFileDetails="/api/resolver/file",n.GetPluginSummary="/api/plugins/summary",n.GetPluginData="/api/plugins/data",n.GetAssetsSummary="/api/graph/assets/summary",n.GetAssetDetails="/api/graph/asset/details",n.GetChunksByModuleId="/api/graph/chunk/module",n.GetModuleDetails="/api/graph/module/details",n.GetModulesByModuleIds="/api/graph/modules/ids",n.GetEntryPoints="/api/graph/entrypoints",n.GetModuleCodeByModuleId="/api/graph/module/code",n.GetModuleCodeByModuleIds="/api/graph/module/codes",n.GetAllModuleGraph="/api/graph/module/all",n.GetAllChunkGraph="/api/graph/chunk/all",n.GetLayers="/api/graph/layers",n.GetPackageRelationAlertDetails="/api/alerts/details/package/relation",n.GetOverlayAlerts="/api/alerts/overlay",n.BundleDiffManifest="/api/bundle_diff/manifest.json",n.GetBundleDiffSummary="/api/bundle_diff/summary",n.GetTileReportHtml="/api/tile/report",(i||(t.APIExtends=i={})).GetCompileProgress="/api/progress"},50028:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},18377:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var s=Object.getOwnPropertyDescriptor(t,r);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,s)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return s(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ServerAPI=void 0,t.ServerAPI=i(r(43866))},64420:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.StatementKind=void 0,(n=r||(t.StatementKind=r={}))[n.ImportDefault=100]="ImportDefault",n[n.ImportNamed=101]="ImportNamed",n[n.ImportDefaultWithNamed=102]="ImportDefaultWithNamed",n[n.ImportDefaultWithNamespace=103]="ImportDefaultWithNamespace",n[n.ImportNamespace=104]="ImportNamespace",n[n.ImportSideEffect=105]="ImportSideEffect",n[n.ImportDynamic=106]="ImportDynamic",n[n.ExportDeclaration=200]="ExportDeclaration",n[n.ExportList=201]="ExportList",n[n.ExportDefault=202]="ExportDefault",n[n.ExportAggregating=203]="ExportAggregating",n[n.ExportNamespace=204]="ExportNamespace",n[n.RequireCall=300]="RequireCall",n[n.RequireName=301]="RequireName",n[n.RequireExports=302]="RequireExports",n[n.RequireExportAggregating=303]="RequireExportAggregating",n[n.RequireExportName=304]="RequireExportName",n[n.Unknown=999]="Unknown"},62757:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},46147:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},11549:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},79266:function(e,t,r){"use strict";let n;var s,i,l,a,o,d,c,u,h,p,x,m,f={};r.r(f),r.d(f,{APILoaderMode4Dev:()=>P,Color:()=>k,ComponentState:()=>M,Language:()=>w,MAIN_BG:()=>A,PageState:()=>S,ROOT_BG_COLOR:()=>E,Size:()=>I,TAG_PALLETE:()=>T,Theme:()=>v,ViewMode:()=>C,drawerWidth:()=>D});var g={};r.r(g),r.d(g,{LoaderInternalPropertyName:()=>eh,findLoaderTotalTiming:()=>et,getLoaderChartData:()=>el,getLoaderCosts:()=>en,getLoaderFileDetails:()=>eo,getLoaderFileFirstInput:()=>ec,getLoaderFileInputAndOutput:()=>eu,getLoaderFileTree:()=>ea,getLoaderFolderStatistics:()=>ed,getLoaderNames:()=>es,getLoadersCosts:()=>er,getLoadersTransformData:()=>ei,isVue:()=>ep});var j={};r.r(j),r.d(j,{formatCosts:()=>ej,getCurrentTimestamp:()=>ey,getUnit:()=>eg,toFixedDigits:()=>ef});var y=r("31549"),Z=r("81346"),b=r("61139");var v=((s=v||{}).Light="light",s.Dark="dark",s);var S=((i=S||{})[i.Success=0]="Success",i[i.Pending=1]="Pending",i[i.Fail=2]="Fail",i);var M=((l=M||{})[l.Success=0]="Success",l[l.Pending=1]="Pending",l[l.Updating=2]="Updating",l[l.Fail=3]="Fail",l);var C=((a=C||{}).List="list",a.Group="group",a);var w=((o=w||{}).Cn="cn",o.En="en",o);var P=((d=P||{}).Local="local",d.Remote="remote",d.Default="default",d);var I=((c=I||{})[c.BasePadding=24]="BasePadding",c[c.BaseBorderRadius=8]="BaseBorderRadius",c[c.NavBarHeight=54]="NavBarHeight",c);var k=((u=k||{}).Red="#e17055",u.Green="#52c41a",u.Yellow="#faad14",u.Blue="#1677ff",u);let D="undefined"==typeof window?0:.85*window.innerWidth>=1100?.85*window.innerWidth:1100,T={COLOR_A:"#90DCE9",COLOR_B:"green",COLOR_C:"#4EAAB9",COLOR_D:"#B7E9F4",COLOR_E:"#2E7CBE",DARK_BLUE:"#1554ad"},A="",E="rgb(105, 177, 255)";function N(e){return window.localStorage.getItem(`__RSDOCTOR__STORAGE__${e}`)}function _(e,t){try{return window.localStorage.setItem(`__RSDOCTOR__STORAGE__${e}`,t),!0}catch(e){return console.error(e),!1}}function z(){return N("LOCALE")||w.En}function R(){return!!N("VIEWMODE")}Z.ZP.use(b.Db).init({lng:z(),resources:{en:{translations:{Overall:"Overall","Compile Analysis":"Compile Analysis",LoadersAnalysis:"Loaders Analysis","Loaders Timeline":"Loaders Timeline","Loaders Analysis":"Loaders Analysis",PluginsAnalysis:"Plugins Analysis",ModuleResolve:"Module Resolve","Bundle Analysis":"Bundle Analysis",BundleSize:"Bundle Size","Module Graph":"Module Graph",TreeShaking:"Tree Shaking","Rule Index":"Rule Index",Resources:"Resources","Project Overall":"Project Overall","Compile Overall":"Compile Overall","Bundle Overall":"Bundle Overall","Expand Omitted":"By default, the reasons tree collapses to the middle of the module introduced by a third party. Click on this icon to view the full tree diagram","Concatenated Tag":"Concatenated Module,hover can display the name of the concatenated main module. Note: the bundled size of the concatenated module is zero, possibly because it is aggregated into the main module.","the file content not changed after transpiled by this loader":"the file content not changed after transpiled by this loader","Output Assets List":"Output Assets List","filter the output assets which size is greater than the input value":"filter the output assets which size is greater than the input value","filter the modules which size is greater than the input value":"filter the modules which size is greater than the input value","After Compile":"After Compile","After Bundle":"After Bundle",CodeModeExplain:"In lite mode or pure stats.json upload, only source code.",DuplicatePakCodeExplain:"There is no code, when in the case of pure stats.json."}},cn:{translations:{Overall:"概览","Compile Analysis":"编译分析",LoadersAnalysis:"Loaders 分析","Loaders Timeline":"Loaders 概览","Loaders Analysis":"Loaders 分析",PluginsAnalysis:"Plugins 分析",ModuleResolve:"Module Resolve 分析","Bundle Analysis":"产物分析",BundleSize:"产物体积分析","Module Graph":"Module Graph",TreeShaking:"Tree Shaking","Rule Index":"错误索引信息",Resources:"资源","Project Overall":"项目信息概览","Compile Overall":"编译数据概览","Bundle Overall":"产物数据概览","Expand Omitted":" reasons 树会默认折叠中间的第三方引入的模块,点击这个图标可以查看完整树图","Concatenated Tag":"串联模块,hover 上去可以显示聚合成的主模块名称。注:聚合模块 bundled size 为零,有可能是因为被聚合到了主模块中。","the file content not changed after transpiled by this loader":"该文件内容在 loader 处理前后没有发生变化","Output Assets List":"产物文件列表","filter the output assets which size is greater than the input value":"筛选大小大于输入值的产物文件","filter the modules which size is greater than the input value":"筛选大小大于输入值的模块","After Compile":"编译后","After Bundle":"打包后",CodeModeExplain:"Lite 模式下或纯 stats.json 上传的情况下只有 source code.",DuplicatePakCodeExplain:"纯 stats.json 输入的情况下没有代码,可使用 Rsdoctor 插件参与构建会有对应代码。"}}},fallbackLng:{"zh-CN":["cn"],default:["en"]},debug:!1,ns:["translations"],defaultNS:"translations",keySeparator:!1,interpolation:{escapeValue:!1}});var O=r("67302"),B=r("46715"),L=r("9679"),$=r("28949"),G=r("15185"),F=r("78741"),W=r("44194");var K=((h=K||{}).Bootstrap="bootstrap->beforeCompile",h.Compile="beforeCompile->afterCompile",h.Done="afterCompile->done",h.Minify="minify(webpack4:optimizeChunkAssets|webpack5:processAssets|rspack:processAssets)",h),H=r("62802"),U=r("57861");function Y(e){let t,r;e.sort((e,t)=>e[0]-t[0]);let n=[];for(let s=0;s<e.length;s++)r=e[s],!t||r[0]>t[1]?(t=r,n.push(r)):t[1]=Math.max(t[1],r[1]);return n}function V(e){return(0,H.inflateSync)(U.Buffer.from(e,"base64")).toString()}r("47309"),r("49646"),r(73656);var J=r("77410"),q=r.n(J);function Q(e){return/^https?:\/\//.test(e)}function X(e){return!!(Array.isArray(e)&&e.length>0&&e.every(e=>(function(e){if("string"==typeof e){var t;if(Q(e)||(t=e,(0,J.isAbsolute)(t)))return!0}return!1})(e)))||!1}async function ee(e,t){let r=await Promise.all(e.map(e=>t(e))),n=0===r.length?[]:r.reduce((e,t)=>e+t);return"object"==typeof n?n:JSON.parse(V(n))}function et(e){let t=1/0,r=-1/0;for(let n=0;n<e.length;n++){let s=e[n];s.startAt<=t&&(t=s.startAt),s.endAt>=r&&(r=s.endAt)}return{start:t,end:r}}function er(e,t){let r={},n={};t.forEach(t=>{e(t)?(!r[t.pid]&&(r[t.pid]=[]),r[t.pid].push([t.startAt,t.endAt])):(!n[t.pid]&&(n[t.pid]=[]),n[t.pid].push([t.startAt,t.endAt]))});let s=0,i=Object.keys(r);for(let e=0;e<i.length;e++){let t=i[e],l=Y(r[t]),a=Y(n[t]||[]).filter(([e,t])=>l.some(r=>e>=r[0]&&t<=r[1])),o=l.length?l.reduce((e,t)=>e+=t[1]-t[0],0):0;s+=o-(a.length?a.reduce((e,t)=>e+=t[1]-t[0],0):0)}return s}function en(e,t){let r=t.filter(t=>t!==e&&t.pid===e.pid&&!!(t.startAt>=e.startAt)&&!!(t.endAt<=e.endAt)||!1),n=e.endAt-e.startAt;return r.length&&Y(r.map(t=>[Math.max(t.startAt,e.startAt),Math.min(t.endAt,e.endAt)])).forEach(e=>{let t=e[1]-e[0];n-=t}),n}function es(e){let t=new Set;return e.forEach(e=>e.loaders.forEach(e=>t.add(e.loader))),[...t]}function ei(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r];for(let e=0;e<n.loaders.length;e++){let r=n.loaders[e];t.push(r)}}return t}function el(e){let t=[],r=ei(e);return e.forEach(e=>{e.loaders.forEach(n=>{t.push({layer:e.resource.layer,loader:n.loader,isPitch:n.isPitch,startAt:n.startAt,endAt:n.endAt,pid:n.pid,sync:n.sync,resource:e.resource.path,costs:en(n,r)})})}),t}function ea(e){let t=ei(e);return e.map(e=>{let{loaders:r,resource:n}=e;return{path:n.path,layer:n.layer,loaders:r.map(e=>({key:e.path,loader:e.loader,path:e.path,errors:e.errors,costs:en(e,t)}))}})}function eo(e,t){let r=t.find(t=>t.resource.path===e);if(!r)throw Error(`"${e}" not match any loader data`);let n=ei(t);return{...r,loaders:r.loaders.map(e=>({...e,costs:en(e,n)}))}}function ed(e,t){let r=t.filter(t=>{let{path:r}=t.resource;return r.startsWith(e)}),n=ei(t);return r.reduce((e,t)=>{let{loaders:r}=t;return r.forEach(t=>{let r=e.find(e=>e.loader===t.loader),s=en(t,n);r?(r.files++,r.costs+=s):e.push({loader:t.loader,path:t.path,files:1,costs:s})}),e},[])}function ec(e,t){for(let r=0;r<t.length;r++){let n=t[r];if(n.resource.path===e){let e=n.loaders.filter(e=>!e.isPitch);if(!e.length)return"";return e[0].input||""}}return""}function eu(e,t,r,n){for(let s=0;s<n.length;s++){let i=n[s];if(i.resource.path===e)for(let e=0;e<i.loaders.length;e++){let n=i.loaders[e];if(n.loader===t&&n.loaderIndex===r)return{input:n.input||"",output:n.result||""};return{input:"",output:""}}}return{input:"",output:""}}let eh="__l__",ep=e=>("module"in e.options&&e.options.module.rules||[]).some(e=>!!(e&&"object"==typeof e&&e.test instanceof RegExp&&e.test?.test(".vue"))||!1);var ex=r("73656"),em=r(73656);function ef(e,t=2){return 0===t?Math.floor(e):+e.toFixed(t)}function eg(e,t){let r;return r="m"===t?e>1?"mins":"min":e>1?"hours":"hour"}function ej(e){if((e=Number(e))>=1e3){let t=e/1e3;if(t>=60){let e=t/60;if(e>=60){let t=ef(e/60,0),r=ef(e%60,1),n=eg(t,"h");return r>0?`${t}${n} ${r}${eg(r,"m")}`:`${t}${n}`}let r=eg(e=ef(e,0),"m"),n=ef(t%60,0);return n>0?`${e}${r} ${n}s`:`${e}${r}`}return`${ef(t,1)}s`}if(e>=10)return`${+ef(e,0)}ms`;if(e>=1)return`${+ef(e,1)}ms`;let t=+ef(e,2);return 0===t&&(t=+ef(e,3)),`${t}ms`}function ey(e,t){let r=(0,ex.hrtime)(t);return e+1e3*r[0]+(em.env.VITEST?Math.round(r[1]/1e6):r[1]/1e6)}function eZ(e){return!!e.result}function eb(e){return e.chunks?e.chunks:[]}function ev(e,t){return e.chunks.length?eS(e.chunks,t):[]}function eS(e,t){return e.length?e.map(e=>{var r;return r=e,t.find(e=>e.id===r)}).filter(Boolean):[]}function eM(e,t){return eS(eb(e),t)}function eC(e,t,r){return function(e,t){let r=[];return e.forEach(e=>{var n,s;(n=e,s=t,(function(e){let{modules:t=[]}=e;return t})(n).map(e=>s.find(t=>t.id===e)).filter(Boolean)).forEach(e=>{!r.filter(t=>t.id===e.id).length&&r.push(e)})}),r}(eS(eb(e),t),r)}let ew=RegExp(`(.*)${/[-|.]/.source}${/[a-z|A-Z|0-9]{4,32}/.source}(${/(?:\.[a-z|A-Z|0-9]{2,}){1,}/.source})$`);function eP(e,t){let r=t?.split("."),n="",s=e;if(r?.length&&r.length>=3&&r[r.length-2]?.indexOf("[")<0&&"js|css|html".indexOf(r[r.length-1])>-1)return n=r[r.length-2],s=e.replace(/(.*)(\.[a-f0-9]{4,32})([^.]*.[^.]+){2,}/g,"$1"),`${s}.${n}.${e.substring(e.lastIndexOf(".")+1)}`;return e.replace(ew,"$1$2")}function eI(e,t){return e.path.slice(-t.length)===t||function(e){let t=e.split("?")[0].match(/\.([0-9a-z]+)(?:[\?#]|$)/i);return t?`.${t[1]}`:""}(e.path)===t}function ek(e,t){return!!t.length&&t.some(t=>eI(e,t))}function eD(e,t){if(t){if("function"==typeof t)e=e.filter(t);else{var r,n;r=e,e="string"==typeof(n=t)?r.filter(e=>eI(e,n)):Array.isArray(n)?r.filter(e=>ek(e,n)):[]}}return e}function eT(e,t,r={}){let{withFileContent:n=!0,filterOrExtensions:s}=r;return(e=e.filter(e=>!ek(e,F.Constants.MapExtensions)),s&&(e=eD(e,s)),e.length)?{count:e.length,size:e.reduce((e,t)=>e+t.size,0),files:e.map(e=>({path:e.path,size:e.size,initial:eA(e,t),content:n?e.content:void 0}))}:{count:0,size:0,files:[]}}function eA(e,t){var r,n;return(r=e,n=t,eS(eb(r),n)).some(e=>!!e.initial)}function eE(e,t,r={}){return r.filterOrExtensions&&(e=eD(e,r.filterOrExtensions)),eT(e,t,{...r,filterOrExtensions:e=>eA(e,t)})}function eN(e,t){let r=e===t,n=r?0:0===e?100:Math.abs(t-e)/e*100;return{percent:n,state:r?F.Client.RsdoctorClientDiffState.Equal:e>t?F.Client.RsdoctorClientDiffState.Down:F.Client.RsdoctorClientDiffState.Up}}function e_(e,t,r,n=!1){let s,i;let{size:l,count:a}=n?eE(e.assets,e.chunks,{filterOrExtensions:r}):eT(e.assets,e.chunks,{filterOrExtensions:r});if(e===t)s=l,i=a;else{let{size:e,count:l}=n?eE(t.assets,t.chunks,{filterOrExtensions:r}):eT(t.assets,t.chunks,{filterOrExtensions:r});s=e,i=l}let{percent:o,state:d}=eN(l,s);return{size:{baseline:l,current:s},count:{baseline:a,current:i},percent:o,state:d}}function ez(e){return Object.keys(e)}function eR(e){let t=ez(e),r=new Set;return t.forEach(t=>{e[t].forEach(e=>{r.add(e.tapName)})}),[...r]}function eO(e,t,r,n,s){return n.slice().reverse().map(n=>{let i=t.find(e=>e.id===n.dependencyId);if(!i)return null;let l=e.find(e=>e.id===i.module);return l?{group:n.group,module:l,dependency:i,relativePath:(0,J.relative)(r,l.path),moduleCode:s?.[l.id]}:null}).filter(Boolean)}class eB{constructor(e){this.loader=e,this.loadAPI=this.loadAPI.bind(this)}log(...e){console.log(`[${this.constructor.name}]`,...e)}loadAPI(...e){let[t,r]=e;switch(t){case F.SDK.ServerAPI.API.LoadDataByKey:return this.loader.loadData(r.key);case F.SDK.ServerAPI.API.GetProjectInfo:return Promise.all([this.loader.loadData("root"),this.loader.loadData("pid"),this.loader.loadData("hash"),this.loader.loadData("summary"),this.loader.loadData("configs"),this.loader.loadData("envinfo"),this.loader.loadData("errors")]).then(([e,t,r,n,s,i,l])=>({root:e,pid:t,hash:r,summary:n,configs:s,envinfo:i,errors:l}));case F.SDK.ServerAPI.API.GetClientRoutes:if("undefined"!=typeof window&&window?.[F.Constants.WINDOW_RSDOCTOR_TAG])return window[F.Constants.WINDOW_RSDOCTOR_TAG].enableRoutes;return this.loader.loadManifest().then(e=>{let{enableRoutes:t=[]}=e.client||{};return t});case F.SDK.ServerAPI.API.GetLoaderNames:return this.loader.loadData("loader").then(e=>es(e||[]));case F.SDK.ServerAPI.API.GetLayers:return this.loader.loadData("moduleGraph").then(e=>{let{layers:t}=e||{};return t});case F.SDK.ServerAPI.API.GetLoaderChartData:return this.loader.loadData("loader").then(e=>el(e||[]));case F.SDK.ServerAPI.API.GetLoaderFileTree:return this.loader.loadData("loader").then(e=>ea(e||[]));case F.SDK.ServerAPI.API.GetLoaderFileDetails:return this.loader.loadData("loader").then(e=>eo(r.path,e||[]));case F.SDK.ServerAPI.API.GetLoaderFolderStatistics:return this.loader.loadData("loader").then(e=>ed(r.folder,e||[]));case F.SDK.ServerAPI.API.GetLoaderFileFirstInput:return this.loader.loadData("loader").then(e=>ec(r.file,e||[]));case F.SDK.ServerAPI.API.GetLoaderFileInputAndOutput:return this.loader.loadData("loader").then(e=>ec(r.file,e||[]));case F.SDK.ServerAPI.API.GetResolverFileTree:return this.loader.loadData("resolver").then(e=>(e||[]).map(e=>({issuerPath:e.issuerPath})));case F.SDK.ServerAPI.API.GetResolverFileDetails:return Promise.all([this.loader.loadData("resolver"),this.loader.loadData("moduleGraph.modules"),this.loader.loadData("moduleCodeMap")]).then(e=>{let t=e[0],n=e[1],s=e[2];return function(e,t,r,n){let s=r.find(t=>t.path===e),i=t.filter(t=>t.issuerPath===e),l=s&&n&&n[s.id]?n[s.id].source:"",a=i.reduce((e,t)=>t.request&&t.result?e.replace(RegExp(`["']${t.request}["']`),`"${t.result}"`):e,l);return{filepath:e,before:l,after:a,resolvers:i.map(e=>({...e,costs:function(e,t){let r=t.filter(t=>t!==e&&t.pid===e.pid&&t.startAt>=e.startAt&&t.endAt<=e.endAt),n=e.endAt-e.startAt;return r.length&&Y(r.map(t=>[Math.max(t.startAt,e.startAt),Math.min(t.endAt,e.endAt)])).forEach(e=>{let t=e[1]-e[0];n-=t}),n}(e,t)}))}}(r.filepath,t||[],n||[],s||{})});case F.SDK.ServerAPI.API.GetPluginSummary:return this.loader.loadData("plugin").then(e=>{var t;return{hooks:ez(t=e||{}),tapNames:eR(t)}});case F.SDK.ServerAPI.API.GetPluginData:return this.loader.loadData("plugin").then(e=>{let{hooks:t,tapNames:n}=r;return function(e,t=[],r=[]){let n=ez(e).filter(e=>(!t.length||-1!==t.indexOf(e))&&!0);return n.length?eR(e).reduce((t,s)=>r.length&&-1===r.indexOf(s)?t:(n.forEach(r=>{let n=e[r].filter(e=>e.tapName===s);0!==n.length&&t.push({tapName:s,hook:r,data:n.map(e=>({startAt:e.startAt,endAt:e.endAt,costs:e.costs,type:e.type}))})}),t),[]):[]}(e||{},t,n)});case F.SDK.ServerAPI.API.GetAssetsSummary:return this.loader.loadData("chunkGraph").then(e=>{let{withFileContent:t=!0}=r,{assets:n=[],chunks:s=[]}=e||{};return function(e,t,r={}){let n={...r,filterOrExtensions:F.Constants.JSExtension},s={...r,filterOrExtensions:F.Constants.CSSExtension},i={...r,filterOrExtensions:F.Constants.ImgExtensions},l={...r,filterOrExtensions:F.Constants.HtmlExtension},a={...r,filterOrExtensions:F.Constants.MediaExtensions},o={...r,filterOrExtensions:F.Constants.FontExtensions},d={...r,filterOrExtensions:e=>!ek(e,[F.Constants.JSExtension,F.Constants.CSSExtension,F.Constants.HtmlExtension].concat(F.Constants.ImgExtensions,F.Constants.MediaExtensions,F.Constants.FontExtensions,F.Constants.MapExtensions))};return{all:{total:eT(e,t,r)},js:{total:eT(e,t,n),initial:eE(e,t,n)},css:{total:eT(e,t,s),initial:eE(e,t,s)},imgs:{total:eT(e,t,i)},html:{total:eT(e,t,l)},media:{total:eT(e,t,a)},fonts:{total:eT(e,t,o)},others:{total:eT(e,t,d)}}}(n,s,{withFileContent:t})});case F.SDK.ServerAPI.API.GetAssetDetails:return Promise.all([this.loader.loadData("chunkGraph"),this.loader.loadData("moduleGraph")]).then(e=>{let{assetPath:t}=r,{assets:n=[],chunks:s=[]}=e[0]||{},{modules:i=[]}=e[1]||{};return function(e,t,r,n){var s,i;let l=t.find(t=>t.path===e);return{asset:l,chunks:(s=l,i=r,eS(eb(s),i)),modules:eC(l,r,n)}}(t,n,s,i)});case F.SDK.ServerAPI.API.GetChunksByModuleId:return Promise.all([this.loader.loadData("chunkGraph"),this.loader.loadData("moduleGraph")]).then(e=>{let{moduleId:t}=r,{chunks:n=[]}=e[0]||{},{modules:s=[]}=e[1]||{};return function(e,t,r){let n=t.find(t=>t.id===e);return n?ev(n,r):[]}(t,s,n)});case F.SDK.ServerAPI.API.GetModuleDetails:return Promise.all([this.loader.loadData("chunkGraph"),this.loader.loadData("moduleGraph")]).then(e=>{let{moduleId:t}=r,{modules:n=[],dependencies:s=[]}=e[1]||{};return function(e,t,r){var n,s;let i=t.find(t=>t.id===e);return{module:i,dependencies:(n=i,s=r,n.dependencies.map(e=>s.find(t=>t.id===e)).filter(Boolean))}}(t,n,s)});case F.SDK.ServerAPI.API.GetModulesByModuleIds:return this.loader.loadData("moduleGraph").then(e=>{var t,n;let{moduleIds:s}=r,{modules:i=[]}=e||{};return t=s,n=i,t.map(e=>n.find(t=>t.id===e)).filter(Boolean)});case F.SDK.ServerAPI.API.GetEntryPoints:return Promise.all([this.loader.loadData("chunkGraph")]).then(e=>{let[t]=e,{entrypoints:r=[]}=t||{};return r});case F.SDK.ServerAPI.API.GetModuleCodeByModuleId:return this.loader.loadData("moduleCodeMap").then(e=>{let{moduleId:t}=r;return e?e[t]:{source:"",transformed:"",parsedSource:""}});case F.SDK.ServerAPI.API.GetModuleCodeByModuleIds:return this.loader.loadData("moduleCodeMap").then(e=>{let{moduleIds:t}=r,n={};return e?(t.forEach(t=>{n[t]=e[t]}),n):[]});case F.SDK.ServerAPI.API.GetAllModuleGraph:return this.loader.loadData("moduleGraph").then(e=>e?.modules);case F.SDK.ServerAPI.API.GetAllChunkGraph:return this.loader.loadData("chunkGraph").then(e=>e?.chunks);case F.SDK.ServerAPI.API.GetPackageRelationAlertDetails:return Promise.all([this.loader.loadData("moduleGraph"),this.loader.loadData("errors"),this.loader.loadData("root"),this.loader.loadData("moduleCodeMap")]).then(e=>{let{id:t,target:n}=r,[s,i=[],l="",a]=e,{modules:o=[],dependencies:d=[]}=s||{},{packages:c=[]}=i.find(e=>e.id===t)||{},{dependencies:u=[]}=c.find(e=>e.target.name===n.name&&e.target.root===n.root&&e.target.version===n.version)||{};return eO(o,d,l,u,a||{})});case F.SDK.ServerAPI.API.GetOverlayAlerts:return this.loader.loadData("errors").then(e=>(e||[]).filter(e=>e.code===F.Rule.RuleMessageCodeEnumerated.Overlay));case F.SDK.ServerAPI.API.BundleDiffManifest:return this.loader.loadManifest();case F.SDK.ServerAPI.API.GetBundleDiffSummary:return Promise.all([this.loader.loadManifest(),this.loader.loadData("root"),this.loader.loadData("hash"),this.loader.loadData("errors"),this.loader.loadData("chunkGraph"),this.loader.loadData("moduleGraph"),this.loader.loadData("moduleCodeMap"),this.loader.loadData("packageGraph"),this.loader.loadData("configs")]).then(([e,t="",r="",n={},s={},i={},l={},a={},o=[]])=>{let d="";return"string"==typeof o[0]?.config?.output?.chunkFilename&&(d=o[0]?.config.output.chunkFilename),{root:t,hash:r,errors:n,chunkGraph:s,moduleGraph:i,packageGraph:a,outputFilename:d,moduleCodeMap:l}});case F.SDK.ServerAPI.API.GetTileReportHtml:return this.loader.loadData("otherReports").then(e=>e?.tileReportHtml);default:throw Error(`API not implement: "${t}"`)}}}let eL=/[a-zA-Z0-9]+(?:[-|_|.]+[a-zA-Z0-9]+)*/;function e$(e){return void 0===e}function eG(e){return"number"==typeof e&&!Number.isNaN(e)}RegExp(`(?:${/(?:node_modules|~)(?:\/\.pnpm)?/.source}/)(?:(?:@${eL.source}[/|+])?(?:${eL.source}\\+)*(?:${eL.source})(?:${/@[\w|\-|_|.]+/.source})?)(?:_(?:@${eL.source}[/|+])?(?:${eL.source})(?:@${eL.source})?)*/`,"g");function eF(e){return null==e}var eW=r("50002");class eK{constructor(e){this.manifest=e,this.pool=new Map,this.disposed=!1,this.shardingDataMap=new Map,this.loader=new eB(this),console.log("[DataLoader] isLocal: ",this.isLocal())}get(e){if(this.manifest)return this.manifest[e]}getData(e,t="data"){let r=this.get(t);if(r)return r[e]}getKeys(e){return e.split(".")}joinKeys(e){return e.join(".")}dispose(){this.disposed=!0}limit(e,t){if(this.pool.has(e))return this.pool.get(e);let r=t().finally(()=>this.pool.delete(e));return this.pool.set(e,r),r}log(...e){console.log(`[${this.constructor.name}]`,...e)}async loadManifest(){return this.manifest}}var eH=r("33800");let eU=new Map,eY=location.protocol.includes("https")?"wss":"ws",eV=`${eY}://${location.host}`;function eJ(e){let t=function({port:e,protocol:t,hostname:r}){if("undefined"!=typeof URL){let t=new URL("http://localhost");return t.port=String(e),t.hostname=r,t.protocol=location.protocol.includes("https")?"wss":"ws",t.toString()}let n=-1===t.indexOf(":")?":":"";return`${t}${n}//${r}:${e}`}({port:e,hostname:location.hostname,protocol:location.protocol});return function(e=eV){if(!eU.has(e)){let t=(0,eH.io)(e,{});t.on("connect",()=>{console.log(`Socket Connect ${e}`)}),eU.set(e,t)}return eU.get(e)}(e?t:eV)}class eq extends eK{constructor(){super(...arguments),this.events=new Map}isLocal(){return!0}async loadData(e){return this.limit(e,async()=>{let[t,...r]=this.getKeys(e),n=this.getData(t);if(!n)return;let s=n;if(X(s)){if(!this.shardingDataMap.has(e)){let t=new Promise(t=>{eJ().emit(F.SDK.ServerAPI.API.LoadDataByKey,{key:e},e=>{t(e.res)})});this.shardingDataMap.set(e,t)}return s=await this.shardingDataMap.get(e),this.shardingDataMap.delete(e),s}return r.length>0?(0,eW.Z)(s,this.joinKeys(r)):s})}async loadAPI(...e){let[t,r]=e,n=r?`${t}_${JSON.stringify(r)}`:`${t}`,s=this.get("__SOCKET__PORT__")??"";return this.limit(n,async()=>new Promise(e=>{eJ(s).emit(t,r,t=>{e(t.res)})}))}dispose(){super.dispose(),this.events.forEach((e,t)=>{e.forEach(e=>{this.removeOnDataUpdate(t,e)}),e.clear()}),this.events.clear()}onDataUpdate(e,t){if(!this.events.has(e)&&this.events.set(e,new Set),!this.events.get(e).has(t))this.events.get(e).add(t),eJ().on(e,t)}removeOnDataUpdate(e,t){eJ().off(e,t),this.events.get(e).delete(t)}}var eQ=r("56175"),eX=r("89730"),e0=r.n(eX),e1=r("45641");function e2(e){return e.startsWith("data:text/javascript;")}let e4=e=>{if(e?.indexOf("node_modules")>=0){let t=e.split("node_modules");return`node_modules${t[t.length-1]}`}return e?.length?`${e?.split("/").slice(-4).join("/")}`:e};function e3(e){return null!=e}async function e5(e){return Q(e)?eQ.Z.get(e,{timeout:999999,responseType:"text"}).then(e=>e.data):e}async function e9(e){let t=await eQ.Z.get(e,{timeout:3e4}).then(e=>e.data);return"string"==typeof t&&(t=JSON.parse(t)),console.log("[json] ",e,t),t}let e6=new Map;async function e8(e=(!(n=window[F.Manifest.RsdoctorManifestClientConstant.WindowPropertyForManifestUrl]?window[F.Manifest.RsdoctorManifestClientConstant.WindowPropertyForManifestUrl]:function(){let{query:e}=e0()(location.href,!0),t=e[F.Client.RsdoctorClientUrlQuery.ManifestFile];if(t)return decodeURIComponent(t)}())&&(n=F.SDK.ServerAPI.API.Manifest),n)){return!e6.has(e)&&e6.set(e,e9(e).catch(t=>{throw e6.delete(e),t})),await e6.get(e)}class e7 extends eK{isLocal(){return!1}async loadData(e){return this.limit(e,async()=>{let[t,...r]=this.getKeys(e),n=this.getData(t,"cloudData");if(!n)return;let s=n;if(X(s)){if(!this.shardingDataMap.has(t)){let r=ee(s,e5).catch(t=>{throw this.log("loadData error: ",s,e),t});this.shardingDataMap.set(t,r)}s=await this.shardingDataMap.get(t)}return r.length>0?(0,eW.Z)(s,this.joinKeys(r)):s})}async loadAPI(...e){let[t,r]=e,n=r?`${t}_${JSON.stringify(r)}`:`${t}`;return this.limit(n,async()=>this.loader.loadAPI(...e))}dispose(){super.dispose()}onDataUpdate(){}removeOnDataUpdate(){}}class te extends eK{isLocal(){return!1}async loadData(e){console.log(`[loadData]-[key]: ${e}`);let[t]=this.getKeys(e);console.log(`[loadData]-[scope]: ${t}`);let r=this.getData(t);if(console.log(`[loadData]-[data]: ${r}`),!r)return;let n=r;if(!this.shardingDataMap.has(t)){let e="object"==typeof n?n:JSON.parse(V(n));console.log(`[loadData]-[scopeData]: ${e}`),this.shardingDataMap.set(t,e)}return n=await this.shardingDataMap.get(t)}getData(e){return console.log(`[getData]-[scope]: ${e}`),window[F.Constants.WINDOW_RSDOCTOR_TAG][e]}async loadAPI(...e){return this.loader.loadAPI(...e)}dispose(){super.dispose()}onDataUpdate(){}removeOnDataUpdate(){}}let tt=new WeakMap;async function tr(e){try{if(e.__LOCAL__SERVER__)return console.log("[LocalServerDataLoader]"),new eq(e)}catch(e){console.log("[DataLoader] fallback to RemoteDataLoader")}return new e7(e)}function tn(e){let[t,r]=(0,W.useState)(void 0);return(0,W.useEffect)(()=>{window[F.Constants.WINDOW_RSDOCTOR_TAG]&&(console.log("[brief mode]"),r(new te({data:[]})))},[]),(0,W.useEffect)(()=>{if(!!e){if(!tt.has(e)){let t=tr(e);tt.set(e,t)}tt.get(e).then(e=>{r(e)})}},[e]),{loader:t}}var ts=r("96883");let ti=(e,t="/")=>{let r=e?.indexOf(t);return -1===r?null:0===r?t+(ti(e?.slice(1))||""):e?.slice(0,r)};function tl(e,t=2,r=()=>!0){let n=0,s=[],i=e;for(;n<t&&(i.filter(r).forEach(e=>{!e.isLeaf&&s.push(e.key)}),(i=i.reduce((e,t)=>e.concat(t.children||[]),[])).length);){;n++}return s}let ta="__BASENAME__";function to({files:e,sep:t="/",inlinedResourcePathKey:r="__RESOURCEPATH__",fileTitle:n=(e,t)=>t,dirTitle:s=(e,t)=>t}){let i=new RegExp(t),l=e.reduce((e,s)=>{let l=ti(s,t),a=l?s?.slice(l.length+1):s,o=e;for(;l;){let e=o.children.find(e=>e.title===l);if(!e){let n=[o[r],l].filter(Boolean).join(t);e={title:l,key:n,children:[],[r]:n,[ta]:l},o.children.push(e)}o=e,a=(l=ti(a))?a.slice(l.length).replace(i,""):a}return o.children.some(e=>(0,eW.Z)(e,r)===s)?e:(o.children.push({title:()=>n(s,a),key:s,isLeaf:!0,[r]:s,[ta]:a}),e)},{key:"0",children:[]}).children;return l.forEach(e=>{e.children&&e.children.forEach(n=>(function e(t,r,n="/",s,i=(e,t)=>t){if(!t.isLeaf){if(r.children&&1===r.children.length){let l=[r[ta],t[ta]].join(n);r[s]=t[s],r[ta]=l,r.key=[r.key,t.key].join("-"),r.children=t.children,r.title=i(r,l),t.children&&t.children.forEach(t=>{e(t,r,n,s,i)})}else t.title=i(t,t[ta]),t.children&&t.children.forEach(r=>{e(r,t,n,s,i)})}})(n,e,t,r,s))}),l}function td(e,t){return(0,ts.Z)(e,t)?e.replace(t,"."):e}function tc(e,t){let r=td(e,t),n="/node_modules/",s=r.lastIndexOf(n);return s>-1?{alias:r.slice(s+n.length),inNodeModules:!0}:{alias:r,inNodeModules:!1}}var tu=r("40521"),th=r("2321"),tp=r("78493"),tx=r("11741"),tm=r("91425");let tf=F.Client.RsdoctorClientRoutes.RuleIndex,tg=()=>{let{i18n:e,...t}=(0,tx.$)();return{...t,i18n:{...e,changeLanguage:(t,r)=>e.changeLanguage(t,(e,n)=>{if(!e)_("LOCALE",t);r&&r(e,n)})}}};function tj(e,t){let r=(0,tm.s0)();return t?()=>window.open(t,"__blank"):()=>{r(`${tf}?${F.Rule.RsdoctorRuleClientConstant.UrlQueryForErrorCode}=${e}`)}}function ty(){let e=(0,tm.TH)().search||location.search,{query:t}=e0()(e,!0);return t}function tZ(e){let t=e;return"string"==typeof t&&(e=JSON.parse(V(t))),function(e,t){if(e&&"object"==typeof e)return(0,tu.Z)(e)?t:(0,th.Z)(e,t);return t}(e,{dependencies:[],modules:[],moduleGraphModules:[],exports:[],sideEffects:[],variables:[]})}function tb(e){return(0,tp.Z)(e,e=>e.path)}function tv(e){return(0,tu.Z)(e)?e.filter(e=>e.category===F.Rule.RuleMessageCategory.Bundle&&e.code!==F.Rule.RuleMessageCodeEnumerated.Overlay):[]}function tS(e){return tv(e).filter(e=>e.code===F.Rule.RuleErrorMap.E1001.code)}var tM=r("20197"),tC=r("79019");let tw=1;class tP{constructor(e,t,r,n,s){this.statements=[],this.meta={exportsType:"default-with-named"},this.id=tw++,this.request=e,this.module=t,this._originDependency=r,this.kind=n,this.statements=s??[]}static init(){tw=1}get resolvedRequest(){return this.dependency.path}get dependency(){return this.originDependency.rootModule??this.originDependency}get originDependency(){return this._originDependency}get kindString(){return F.SDK.DependencyKind[this.kind]}get resolveConcatenationModule(){return this.dependency.kind===F.SDK.ModuleKind.Concatenation}isSameWithoutStatements(e){return this.request===e.request&&this.kind===e.kind&&this.module.id===e.module.id&&this.dependency.id===e.dependency.id}addStatement(e){!this.hasStatement(e)&&this.statements.push(e)}hasStatement(e){return this.statements.some(t=>t.isSame(e))}setBuildMeta(e){this.meta={...this.meta,...e}}toData(){return{id:this.id,request:this.request,resolvedRequest:this.resolvedRequest,kind:this.kind,module:this.module.id,dependency:this.dependency.id,originDependency:this.originDependency.id,statements:this.statements.map(e=>e.toData())}}}function tI(e,t){return e.line===t.line&&e.column===t.column}tP.kind=F.SDK.DependencyKind;let tk=/!/,tD=/\s\+\s\d*\smodules$/,tT=/^css\s.*node_modules(?!\/)/;class tA{static getDefaultStatement(e){let t={line:1,column:0},r={start:{...t},end:{...t}};return new tA(e,{source:{...r},transformed:{...r}})}constructor(e,t){this.module=e,this.position=t}isSame(e){return this.module.id===e.module.id&&function(e,t){var r,n;if(!tI(e.start,t.start))return!1;if(null!=(r=e.end)&&null!=(n=t.end))return tI(e.end,t.end);return void 0===e.end&&void 0===t.end}(this.position.transformed,e.position.transformed)}getSourcePosition(){let{module:e,position:t}=this;return t.source?t.source:e.getSourceMap()?(t.source=e.getSourceRange(t.transformed),t.source):void 0}getLineCode(){let e=this.module.isPreferSource&&this.position.source,t=this.module.getSource(),r=e?t.source:t.transformed,n=e?this.position.source.start.line:this.position.transformed.start.line;if("number"==typeof n)return r.split("\n")[n-1]}toData(){let e={transformed:this.position.transformed};return this.position.source&&(e.source=this.position.source),{position:e,module:this.module.id}}}let tE=1;class tN{constructor(e,t,r=!1,n=F.SDK.ModuleKind.Normal,s=""){this.source={source:"",transformed:"",parsedSource:""},this.size={sourceSize:0,transformedSize:0,parsedSize:0},this.chunks=[],this.dependencies=[],this.imported=[],this.modules=[],this.concatenationModules=[],this.meta={hasSetEsModuleStatement:!1,strictHarmonyModule:!1},this.id=tE++,this.webpackId=e,this.path=t,this.isEntry=r,this.kind=n,this.layer=s}static init(){tE=1}get rootModule(){return this.modules.find(e=>e.path===this.path)}get isPreferSource(){if("boolean"==typeof this._isPreferSource)return this._isPreferSource;let e=this.source.source.length>0&&"test code"!==this.source.source&&!!this.sourceMap;return this._isPreferSource=e,e}getChunks(){return this.chunks.slice()}addChunk(e){!this.chunks.includes(e)&&(this.chunks.push(e),e.addModule(this))}removeChunk(e){this.chunks=this.chunks.filter(t=>t!==e)}getDependencies(){return this.dependencies.slice()}getDependencyByRequest(e){return this.dependencies.find(t=>t.request===e)}getDependencyByModule(e){return this.dependencies.find(t=>t.originDependency===e||t.dependency===e)}addDependency(e,t,r,n){let s=new tP(e,this,t,r,n);if(this.dependencies.every(e=>!e.isSameWithoutStatements(s)))return this.dependencies.push(s),t.addImported(this),t.rootModule&&t.rootModule.addImported(this),s}removeDependency(e){this.dependencies=this.dependencies.filter(t=>t===e)}removeDependencyByModule(e){let t=this.getDependencyByModule(e);t&&this.removeDependency(t)}getImported(){return this.imported.slice()}addImported(e){!this.imported.includes(e)&&this.imported.push(e)}removeImported(e){this.imported=this.imported.filter(t=>t===e)}setProgram(e){this.program=e}getProgram(){return this.program}setSource(e){let{source:t}=this;t.source=e.source??t.source,t.transformed=e.transformed??t.transformed,t.parsedSource=e.parsedSource??t.parsedSource}getSource(e=F.SDK.ToDataType.Normal){return e===F.SDK.ToDataType.NoCode?{source:"",transformed:"",parsedSource:""}:e===F.SDK.ToDataType.NoSourceAndAssets||e===F.SDK.ToDataType.NoSource?{source:"",transformed:"",parsedSource:this.isPreferSource?"":this.source.parsedSource}:e===F.SDK.ToDataType.All?{source:this.source.source,transformed:this.source.transformed,parsedSource:this.isPreferSource?"":this.source.parsedSource}:{source:this.source.source,transformed:"",parsedSource:this.isPreferSource?"":this.source.parsedSource}}setSourceMap(e){this.sourceMap=e}getSourceMap(){return this.sourceMap}setSize(e){let{size:t}=this;t.sourceSize=e.sourceSize??t.sourceSize,t.transformedSize=e.transformedSize??t.transformedSize,t.parsedSize=e.parsedSize??t.parsedSize}getSize(){return{...this.size}}getStatement(e){return new tA(this,{source:this.getSourceRange(e),transformed:{start:{...e.start},end:e.end?{...e.end}:void 0}})}getSourceRange(e){let{sourceMap:t}=this;if(!t)return;let r={start:{}},n=t.originalPositionFor({line:e.start.line??0,column:e.start.column??0,bias:1});if(eG(n.line)&&(r.start={line:n.line,column:n.column??void 0}),e.end){let n=t.originalPositionFor({line:e.end.line??0,column:e.end.column??0});eG(n.line)&&(r.end={line:n.line,column:n.column??void 0})}return r}addNormalModule(e){!this.modules.includes(e)&&(this.modules.push(e),e.addConcatenationModule(this))}getNormalModules(){return this.modules.slice()}addConcatenationModule(e){!this.concatenationModules.includes(e)&&this.concatenationModules.push(e)}getConcatenationModules(){return this.concatenationModules.slice()}toData(e){let{isPreferSource:t}=this,r=function(e){if(!e)return"";if(tk.test(e)){var t;let r=(t=e.split(tk))[t.length-1];if(r?.trim())return r}return tD.test(e)?e.replace(tD,""):tT.test(e)?e.replace(tT,""):e}(this.webpackId),n={id:this.id,webpackId:e&&r.indexOf(".")>0?q().relative(e,r):this.webpackId,path:this.path,isPreferSource:t,dependencies:this.dependencies.map(e=>e.id),imported:this.imported.map(e=>e.id),chunks:this.chunks.map(e=>e.id),size:this.getSize(),kind:this.kind,...this.layer?{layer:this.layer}:{}};return(this.meta.hasSetEsModuleStatement||this.meta.strictHarmonyModule)&&(n.meta={},this.meta.hasSetEsModuleStatement&&(n.meta.hasSetEsModuleStatement=!0),this.meta.strictHarmonyModule&&(n.meta.strictHarmonyModule=!0)),this.isEntry&&(n.isEntry=this.isEntry),this.modules.length>0&&(n.modules=this.modules.map(e=>e.id)),this.rootModule&&(n.rootModule=this.rootModule.id),this.concatenationModules.length>0&&(n.concatenationModules=this.concatenationModules.map(e=>e.id)),n}}tN.kind=F.SDK.ModuleKind;let t_=1;class tz{constructor(e,t,r){this.id=t_++,this._sideEffects=[],this.name=e,this.identifier=t,this._variable=r}static init(){t_=1}get isReExport(){return!!this.from}set variable(e){this._variable=e}get variable(){if(this._variable)return this._variable;if(!this.from||!1===this._variable){this._variable=!1;return}let e=this.getRecursiveExport()?.variable;return!e&&(this._variable=!1),e}addSideEffect(e){this._sideEffects.every(t=>t.id!==e.id)&&(this._sideEffects.push(e),this.from&&this.from.addSideEffect(e))}getSideEffects(){return this._sideEffects.slice()}setFromExport(e){this.from=e}getRecursiveExport(e=1/0){if(0===e)throw Error("`getRecursiveExport` method parameter depth must be greater than 1.");if(!this.from)return this;let t=0,r=this;for(;r.from&&t<e;)t++,r=r.from;return r}toData(){let e={id:this.id,name:this.name,isReExport:this.isReExport,used:this._sideEffects.map(e=>e.id)};return this.from&&(e.from=this.from.id,e.root=this.getRecursiveExport().id),this.variable&&(e.variable=this.variable.id),e}}let tR=1,tO=class e{constructor(t,r,n,s,i){this.id=tR++,this._exports=[],this.name=t,this.module=r,this.identifier=n,s&&(this.fromDependency=this.module.getDependencyByRequest(s)),i===e.NamespaceSymbol?this.isNameSpace=!0:(this.isNameSpace=!1,this.originName=i)}static init(){tR=1}get variable(){if(void 0!==this._variable)return this._variable?this._variable:void 0;let e=this.exports[0]?.getRecursiveExport()?.variable;return this._variable=e??!1,e}get exports(){return this._exports?.slice()??[]}setModuleExport(e){e.getExports().forEach(e=>this.setExportInfo(e))}setExportInfo(e){this._exports.push(e),e.addSideEffect(this)}toData(){let e={id:this.id,name:this.name,identifier:this.identifier.toData(),module:this.module.id};return this.fromDependency&&(e.fromDependency=this.fromDependency.id),this.isNameSpace&&(e.isNameSpace=this.isNameSpace),this.exports.length>0&&(e.exports=this.exports.map(e=>e.id)),this.variable&&(e.variable=this.variable.id),e}};tO.NamespaceSymbol=Symbol("namespace");let tB=1;class tL{constructor(e,t,r,n){this.id=tB++,this.name=e,this.module=t,this.usedInfo=r,this.identifier=n}static init(){tB=1}get isUsed(){return!!this._exported&&this._exported.getSideEffects().length>0}setExportInfo(e){this._exported=e,e.variable=this}getExportInfo(){return this._exported}toData(){let e={id:this.id,name:this.name,module:this.module.id,identifier:this.identifier.toData(),usedInfo:this.usedInfo};return this._exported&&(e.exported=this._exported.id),e}}class t${constructor(e,t,r){this.exports=[],this.sideEffects=[],this.variables=[],this.module=e,this._graph=t,"boolean"==typeof this._dynamic&&(this._dynamic=r)}static init(){tz.init(),tO.init(),tL.init()}get dynamic(){return"boolean"==typeof this._dynamic?this._dynamic:this.module.getImported().map(e=>e.getDependencyByModule(this.module)).some(e=>e&&"dynamic"===e.meta.exportsType)}addExportInfo(e){this.exports.push(e),this._graph.addExportInfo(e)}addSideEffect(e){this.sideEffects.push(e),this._graph.addSideEffect(e)}addVariable(e){this.variables.push(e),this._graph.addVariable(e)}getExports(){return this.exports.slice()}getSideEffects(e){return e?this.sideEffects.filter(t=>t.name===e):this.sideEffects.slice()}getOwnExports(){return this.exports.filter(e=>!e.isReExport)}getExport(e){return this.exports.find(t=>t.name===e)}getReExports(){return this.exports.filter(e=>e.isReExport)}getOwnExport(e){return this.getOwnExports().find(t=>t.name===e)}getReExport(e){return this.getReExports().find(t=>t.name===e)}toData(){return{module:this.module.id,dynamic:this.dynamic,exports:this.exports.map(e=>e.id),sideEffects:this.sideEffects.map(e=>e.id),variables:this.variables.map(e=>e.id)}}}class tG{constructor(){this._dependenciesIdMap=new Map,this._moduleWebpackIdMap=new Map,this._moduleIdMap=new Map,this._moduleGraphModules=new Map,this._exportIdMap=new Map,this._sideEffectIdMap=new Map,this._varIdMap=new Map,this._layers=new Map}static init(){tN.init(),tP.init(),t$.init()}static fromData(e){let t=new tG,r=e=>new tA(t.getModuleById(e.module),e.position);for(let r of e.modules??[]){let e=new tN(String(r.id),r.path,r.isEntry,r.kind,r.layer);e.id=r.id,e.setSize(r.size),e.meta={strictHarmonyModule:r.meta?.strictHarmonyModule??!1,hasSetEsModuleStatement:r.meta?.hasSetEsModuleStatement??!1},e._isPreferSource=r.isPreferSource,e.chunks=r.chunks,t.addModule(e)}for(let n of e.modules??[]){let s=t.getModuleById(n.id);for(let i of n.dependencies){let n=(e.dependencies??[]).find(e=>e.id===i),l=n&&t.getModuleById(n.originDependency);if(!n||!l){console.warn(`The connection data ID is empty: ${i}`);continue}let a=s.addDependency(n.request,l,n.kind,n.statements.map(r));if(!!a)a.id=n.id,t.addDependency(a)}for(let e of n.modules??[]){let r=t.getModuleById(e);if(!r){console.warn(`Add the ordinary module ID as empty: ${e}`);continue}s.addNormalModule(r)}for(let e of n.concatenationModules??[]){let r=t.getModuleById(e);if(!r){console.warn(`The aggregation module ID is empty: ${r}`);continue}s.addConcatenationModule(r)}}for(let n of e.exports??[]){let e=new tz(n.name,n.identifier?r(n.identifier):void 0);e.id=n.id,t.addExportInfo(e)}for(let r of e.exports??[])if(r.from){let e=t._exportIdMap.get(r.id),n=t._exportIdMap.get(r.from);e&&n&&e.setFromExport(n)}for(let n of e.variables??[]){let e=t.getModuleById(n.module);if(!e){console.warn(`The module ID in the variable is empty:${n.module}`);continue}let s=new tL(n.name,e,n.usedInfo,r(n.identifier)),i=t._exportIdMap.get(n.exported??-1);i&&s.setExportInfo(i),s.id=n.id,t.addVariable(s)}for(let n of e.sideEffects??[]){let e=t.getModuleById(n.module);if(!e){console.warn(`The module ID in the side effects is empty:${n.module}`);continue}let s=new tO(n.name,e,r(n.identifier),n.originName);for(let e of(s.isNameSpace=n.isNameSpace,s.id=n.id,n.exports??[])){let r=t._exportIdMap.get(e);r&&r.addSideEffect(s)}if(n.variable){let e=t._varIdMap.get(n.variable);e&&(s._variable=e)}t.addSideEffect(s)}for(let r of e.moduleGraphModules??[]){let e=t.getModuleById(r.module);if(!e){console.warn(`The module ID in ModuleGraphModule is empty: ${r.module}`);continue}let n=new t$(e,t,r.dynamic);t.addModuleGraphModule(n),r.exports.forEach(e=>{let r=t._exportIdMap.get(e);r&&n.addExportInfo(r)}),r.sideEffects.forEach(e=>{let r=t._sideEffectIdMap.get(e);r&&n.addSideEffect(r)}),r.variables.forEach(e=>{let r=t._varIdMap.get(e);r&&n.addVariable(r)})}return tG.init(),t}clear(){this._dependenciesIdMap=new Map,this._moduleWebpackIdMap=new Map,this._moduleIdMap=new Map,this._moduleGraphModules=new Map,this._exportIdMap=new Map,this._sideEffectIdMap=new Map,this._varIdMap=new Map,this._layers=new Map}size(){return this._moduleIdMap.size}fromInstance(e){this._dependenciesIdMap=new Map(e._dependenciesIdMap),this._moduleWebpackIdMap=new Map(e._moduleWebpackIdMap),this._moduleIdMap=new Map(e._moduleIdMap),this._moduleGraphModules=new Map(e._moduleGraphModules),this._exportIdMap=new Map(e._exportIdMap),this._sideEffectIdMap=new Map(e._sideEffectIdMap),this._varIdMap=new Map(e._varIdMap),this._layers=new Map(e._layers)}getSubGraphByModule(e){let t=new Set,r=[e];t.add(e);for(let e=0;e<r.length;e++)for(let{dependency:n}of r[e].getDependencies()){if(!t.has(n))t.add(n),r.push(n)}return r}getModules(){return Array.from(this._moduleWebpackIdMap.values())}getDependencies(){return Array.from(this._dependenciesIdMap.values())}getEntryModules(){return this.getModules().filter(e=>e.isEntry&&e.kind!==F.SDK.ModuleKind.Concatenation)}getModuleById(e){return this._moduleIdMap.get(e)}getDependencyById(e){return this._dependenciesIdMap.get(e)}getModuleByWebpackId(e){return this._moduleWebpackIdMap.get(e)}getModuleByFile(e){return this.getModules().find(t=>t.path===e)}addModule(...e){for(let t of e)!this._moduleIdMap.has(t.id)&&(this._moduleWebpackIdMap.set(t.webpackId,t),this._moduleIdMap.set(t.id,t),t.layer&&this.addLayer(t.layer))}addDependency(...e){for(let t of e)!this._dependenciesIdMap.has(t.id)&&(this._dependenciesIdMap.set(t.id,t),this.addModule(t.module),this.addModule(t.dependency))}removeModule(e){for(let t of(this._moduleIdMap.delete(e.id),this._moduleWebpackIdMap.delete(e.webpackId),e.getDependencies()))this.removeDependency(t),this._dependenciesIdMap.delete(t.id);for(let t of e.getImported())t.removeDependencyByModule(t)}removeDependency(e){e.module.removeDependency(e),e.dependency.removeImported(e.module),this._dependenciesIdMap.delete(e.id)}addModuleGraphModule(e){!this._moduleGraphModules.has(e.module)&&this._moduleGraphModules.set(e.module,e)}getModuleGraphModule(e){return this._moduleGraphModules.get(e)}getModuleGraphModules(){return Array.from(this._moduleGraphModules.values())}addExportInfo(e){this._exportIdMap.set(e.id,e)}addSideEffect(e){this._sideEffectIdMap.set(e.id,e)}addVariable(e){this._varIdMap.set(e.id,e)}addLayer(e){!this._layers.get(e)&&this._layers.set(e,1)}getLayers(){return this._layers}toData(e){return{dependencies:this.getDependencies().map(e=>e.toData()),modules:this.getModules().map(t=>t.toData(e?.contextPath)),moduleGraphModules:Array.from(this._moduleGraphModules.values()).map(e=>e.toData()),exports:Array.from(this._exportIdMap.values()).map(e=>e.toData()),sideEffects:Array.from(this._sideEffectIdMap.values()).map(e=>e.toData()),variables:Array.from(this._varIdMap.values()).map(e=>e.toData()),layers:Array.from(this._layers.keys())}}toCodeData(e=F.SDK.ToDataType.Normal){let t={};return this.getModules().forEach(r=>{t[r.id]=r.getSource(e)}),t}}r("76174");let tF={locale:z(),theme:N("THEME")||v.Light,pageState:S.Pending,viewMode:function(){let e={bundleAlerts:C.List,compileAlerts:C.List};try{let t=N("VIEWMODE");if(t)return JSON.parse(t)||e;return e}catch(t){return e}}(),json:{},setTheme(){},setManifest(){},setPageState(e){},setViewMode(){}},tW=(0,W.createContext)({...tF});function tK(){let{theme:e,setTheme:t}=(0,W.useContext)(tW),r=e===v.Dark;return{theme:e,setTheme:t,isDark:r,isLight:!r}}function tH(){let{viewMode:e,setViewMode:t}=(0,W.useContext)(tW),{bundleAlerts:r,compileAlerts:n}=e;return{viewMode:e,setViewMode:t,setCompileAlertsViewMode(e){t({compileAlerts:e})},setBundleAlertsViewMode(e){t({bundleAlerts:e})},isCompileList:n===C.List,isBundleList:r===C.List}}var tU=r("61521");let tY=tU._m.init();function tV(e){if(e2(e))return"javascript";let t=(0,J.extname)(e).slice(1);switch(t){case"js":case"jsx":return"javascript";case"ts":case"tsx":return"typescript";default:return t}}function tJ(e){let t=(0,J.extname)(e).slice(1);switch(t){case"js":case"jsx":case"ts":case"tsx":return"javascript";default:return t}}function tq(e,t){let{start:r,end:n}=e,{line:s=1,column:i=0}=r;return new t(s,i+1,n?.line??s,(n?.column??9999)+1)}let tQ=e=>new Promise((t,r)=>{if(e.value){t();return}tY.then(t=>{e.value=t}).catch(e=>{e?.type!=="cancelation"&&(console.error("Monaco initialization error:",e),r())})});var tX=r("457");function t0(e){let t;return t=e>=1e9?`${(e/1e9).toFixed(2)} GB`:e>=1e6?`${(e/1e6).toFixed(2)} MB`:e>=1e3?`${(e/1e3).toFixed(2)} KB`:e>1?`${e} bytes`:1===e?`${e} byte`:"0 bytes"}function t1(e){return`${+e.toFixed(2)}%`}let{toFixedDigits:t2,getUnit:t4,formatCosts:t3}=j;r("19749");class t5{constructor(e){this.worker=e,this.timer=0,this.callbacks=new Map,this.setup()}setup(){this.worker.onmessage=e=>{let{data:t}=e;if(this.callbacks.has(t.id)){let e=this.callbacks.get(t.id);this.callbacks.delete(t.id),e(t.data)}}}createEventId(){return`${Date.now()}_${++this.timer}`}emit(e,t){var r;let n=this.createEventId();return this.callbacks.set(n,t),r={id:n,data:e},this.worker.postMessage(r),{abort:()=>this.callbacks.delete(n)}}dispose(){this.worker.terminate()}}new class e{constructor(){this._workerMap=new WeakMap}detectWorker(e){if(this._workerMap.has(e))return this._workerMap.get(e);let t=new t5(e());return this._workerMap.set(e,t),t}};let{findLoaderTotalTiming:t9,getLoaderCosts:t6}=g;function t8(e,t,r,n,s,i){return!(r&&-1===e.indexOf(r)||s&&i&&s!==i||n?.length&&!(0,tX.Z)(n,t))&&!0}let t7=({data:e})=>{let{title:t,description:r="",level:n,code:s}=e,i=tj(s,e.link);return(0,y.jsx)(O.Z,{showIcon:!0,message:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{code:!0,strong:!0,onClick:i,style:{cursor:"pointer"},children:(0,y.jsx)("a",{children:s})}),(0,y.jsx)(L.Z.Text,{strong:!0,children:t})]}),description:(0,y.jsx)("div",{dangerouslySetInnerHTML:{__html:r}}),type:"warn"===n?"info":n,action:(0,y.jsxs)($.ZP,{type:"link",onClick:i,size:"small",children:["More",(0,y.jsx)(G.Z,{})]})})},re=({data:e})=>{let{description:t="",level:r}=e;return(0,y.jsx)(O.Z,{type:"warn"===r?"info":r,description:t})};var rt=r("99892"),rr=r("27039"),rn=r("60509"),rs=r("90722"),ri=r("66583"),rl=r("95830"),ra=r("37963"),ro=r("14253"),rd=r("22379"),rc=r("20875"),ru=r("53395"),rh=r("48161"),rp=r("94218"),rx=r("3624"),rm=r("45216"),rf=r("95842");let rg="Load data failed, please try again",rj="retry",ry=W.memo(({title:e=rg,buttonText:t=rj,retry:r})=>(0,y.jsx)(rl.Z,{description:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsx)(L.Z.Text,{children:e}),(0,y.jsx)($.ZP,{type:"primary",onClick:()=>{r()},children:t})]})}));var rZ=r("39399"),rb=r("83053"),rv=r("83911"),rS=r("12496");let rM=e=>{let t;let{manifestLoader:r=e8,api:n,children:s,body:i=null,showSkeleton:l=!0,fallbackComponent:a}=e,[o,d]=(0,W.useState)(),[c,u]=(0,W.useState)(M.Pending),[h,p]=(0,W.useState)({}),{loader:x}=tn(o);function m(e){window[F.Constants.WINDOW_RSDOCTOR_TAG]?g(e):(function(e){return e.then(e=>{d(e)}).catch(e=>{throw u(M.Fail),e})})(t=r()).then(()=>{g(e)})}let f=(0,W.useCallback)(({req:e,res:t})=>{e.api===n&&((0,rb.Z)(e.body,i)||(0,rv.Z)(e.body)&&(0,rv.Z)(i))&&!(0,rb.Z)(h,t)&&p(t),u(M.Success)},[h,n,i]);(0,W.useEffect)(()=>{m(x)},[x,n,i]),(0,W.useEffect)(()=>{if(x)return x.onDataUpdate(n,f),()=>{x.removeOnDataUpdate(n,f)}},[x,n,i]);function g(e){if(!e)return;let t=(0,rS.Z)(F.SDK.ServerAPI.APIExtends);if((0,tX.Z)(t,n)){u(M.Success);return}e.loadAPI(n,i).then(e=>{if(!(0,rv.Z)(e))p(e),u(M.Success)}).catch(e=>{console.error(e),u(M.Fail)})}if(c===M.Pending)return l?(0,y.jsx)(rf.Z,{active:!0}):null;if(c===M.Fail)return a?a:(0,y.jsx)(ry,{retry:()=>{u(M.Pending),t=r(),m()}});return c===M.Updating?(0,y.jsx)(rZ.Z,{spinning:!0,children:s(h)}):s(h)};function rC({Component:e,api:t,responsePropName:r,body:n,fallbackComponent:s,showSkeleton:i}){return function(l){let{body:a=n,...o}=l;return(0,y.jsx)(rM,{api:t,body:a,showSkeleton:i,fallbackComponent:s,children:t=>{let n={...o,[r]:t};return(0,y.jsx)(e,{...n})}})}}let rw=({duplicatePackages:e=[],cwd:t,children:r,...n})=>(0,y.jsx)(rk,{...n,buttonStyle:{fontSize:"inherit",...n.buttonStyle},buttonProps:{type:"text",...n.buttonProps},text:(0,y.jsx)(rx.Z,{title:"Click to show the details of duplicate packages",children:(0,y.jsxs)(B.Z,{style:{fontSize:"inherit"},children:[(0,y.jsx)(L.Z.Text,{strong:!0,style:{fontSize:"inherit",color:"inherit",...n.textStyle},children:e.length}),(0,y.jsx)(rm.Z,{})]})}),drawerProps:{title:"Duplicate Packages Viewer",...n.drawerProps},children:(0,y.jsx)(rt.Z,{gutter:[I.BasePadding,I.BasePadding],children:e.map((e,n)=>(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(rz,{data:e,cwd:t,getPackageRelationContentComponent:r})},n))})}),rP=({moduleGraph:e,...t})=>(0,y.jsx)(rw,{...t,children:r=>(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetModuleCodeByModuleIds,body:{moduleIds:e.modules.map(e=>e.id)},children:n=>(0,y.jsx)(rN,{data:eO(e.modules,e.dependencies,t.cwd,r.package.dependencies,n),cwd:t.cwd})})}),rI=e=>(0,y.jsx)(rw,{...e,children:t=>(0,y.jsx)(r_,{body:{id:t.data.id,target:t.package.target},cwd:e.cwd})}),rk=e=>{let[t,r]=(0,W.useState)(!1);return(0,y.jsxs)(W.Fragment,{children:[e.button?(0,y.jsx)("div",{onClick:()=>r(!t),children:e.button}):(0,y.jsx)($.ZP,{type:"link",...e.buttonProps,onClick:()=>r(!t),style:{padding:0,...e.buttonStyle},children:e.text}),(0,y.jsx)(rp.Z,{maskClosable:!0,width:D,zIndex:999,...e.drawerProps,open:t,onClose:()=>r(!1),destroyOnClose:!0,children:e.children})]})};var rD=r("30664");let rT=({upperFirst:e=!0,fontSize:t=16,text:r,hash:n})=>{let s="string"==typeof r&&e?(0,rD.Z)(r):r;return(0,y.jsx)(L.Z.Text,{style:{fontSize:t},strong:!0,children:n?(0,y.jsx)("a",{href:n,id:n.replace(/^#/,""),style:{color:"inherit"},children:s}):s})},rA={default:"linear-gradient(to bottom, #3ea2ff 0%, #0072db 100%)",success:"linear-gradient(to bottom, #6cf42a 0%, #52C41A 100%)",warn:"linear-gradient(to bottom, #ffc100 0%, #f59025 100%)",error:"linear-gradient(to bottom, rgb(250 127 22), #FF4D4F 100%)"},rE=({label:e,value:t,type:r="default",tooltip:n})=>{let s={height:"100%",lineHeight:"22px",width:"auto",display:"inline-block",boxSizing:"border-box",padding:"0 6px",color:"#fff",fontSize:12,textAlign:"center",verticalAlign:"middle"},i=(0,y.jsxs)("div",{style:{height:22,margin:0,padding:0,boxSizing:"border-box",borderRadius:4,fontSize:0,whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",display:"flex",justifyContent:"flex-start",alignItems:"center"},children:[(0,y.jsx)("div",{style:{...s,borderTopLeftRadius:4,borderBottomLeftRadius:4,background:"linear-gradient(to bottom, #525252a3 0%, #1F1F1F 100%)"},children:e}),(0,y.jsx)("div",{style:{...s,borderTopRightRadius:4,borderBottomRightRadius:4,overflow:"hidden",textOverflow:"ellipsis",background:rA[r]||rA.default},children:t})]});return n?(0,y.jsx)(rx.Z,{title:!0===n?t:n,placement:"topLeft",children:i}):i},rN=({data:e})=>{let[t,r]=(0,W.useState)(0),{t:n}=tg();return(0,y.jsx)(rt.Z,{gutter:I.BasePadding,wrap:!1,align:"top",children:(0,y.jsx)(rr.Z,{span:20,style:{height:"100%"},children:(0,y.jsx)(rn.Z,{title:"The reasons for importing this version",style:{height:"100%"},extra:(0,y.jsx)(rs.Z,{content:(0,y.jsx)(L.Z.Text,{children:n("DuplicatePakCodeExplain")}),children:(0,y.jsx)("a",{href:"#",children:"Explain"})}),bodyStyle:{overflow:"scroll"},children:e.length?(0,y.jsxs)(W.Fragment,{children:[(0,y.jsx)("div",{style:{marginBottom:I.BasePadding},children:(0,y.jsx)(L.Z.Text,{type:"secondary",strong:!0,children:"Click the file path below to show the reason in code viewer."})}),(0,y.jsx)(ri.Z,{children:e.map((n,s)=>{let{dependency:i,module:l,relativePath:a}=n,{statements:o}=i,{start:d}=o?.[0]?.position?l.isPreferSource?o[0].position.source:o[0].position.transformed:{start:{line:0,column:0}},c=`${a}:${d.line}:${d.column||1}`;return(0,y.jsx)(ri.Z.Item,{style:{cursor:"pointer"},dot:s===e.length-1?void 0:"⬇️",children:(0,y.jsx)(L.Z.Text,{copyable:{text:a},onClick:e=>{e.preventDefault(),e.stopPropagation(),r(s)},strong:s===t,style:{color:s===t?k.Blue:"inherit",display:"block"},children:c})},c)})})]}):(0,y.jsx)(rl.Z,{description:"This package no dependencies"})})})})},r_=rC({Component:rN,api:F.SDK.ServerAPI.API.GetPackageRelationAlertDetails,responsePropName:"data"}),rz=({data:e,getPackageRelationContentComponent:t})=>{let{level:r,code:n,packages:s}=e,i=tj(n,e.link),l=t0((0,ru.Z)(s,e=>e.targetSize.sourceSize)),{xs:a,lg:o,xxl:d}=ra.ZP.useBreakpoint(),{name:c}=s.find(e=>!!e.target.name).target,u=s.map(e=>e.target.version);return(0,y.jsx)(O.Z,{showIcon:!a,message:(0,y.jsxs)(B.Z,{wrap:!0,split:a?null:(0,y.jsx)(ro.Z,{type:"vertical"}),align:"center",children:[(0,y.jsxs)(B.Z,{wrap:!1,children:[(0,y.jsx)(L.Z.Text,{code:!0,strong:!0,onClick:i,style:{cursor:"pointer"},children:(0,y.jsx)("a",{children:n})}),(0,y.jsx)(L.Z.Text,{strong:!0,children:F.Rule.RuleErrorMap[n]?.title||e.title})]}),(0,y.jsxs)(L.Z.Paragraph,{ellipsis:{rows:1},style:{marginBottom:0},children:[(0,y.jsx)(L.Z.Text,{strong:!0,code:!0,children:c}),(0,y.jsxs)(L.Z.Text,{strong:!0,children:[" ",e.packages.length]}),(0,y.jsx)(L.Z.Text,{children:" versions was found"})]}),(0,y.jsx)(rE,{label:"total size",value:l,type:"error",tooltip:`total size of ${e.packages.length} versions is ${l}`})]}),description:(0,y.jsx)(B.Z,{direction:"vertical",wrap:!1,children:e.packages.map(({target:e,targetSize:t})=>{let r=t0(t.sourceSize),n=t.parsedSize?t0(t.parsedSize):null,s=`${e.name}@${e.version}`;return(0,y.jsxs)(B.Z,{style:{wordBreak:"break-all"},align:"center",split:a?null:(0,y.jsx)(ro.Z,{type:"vertical"}),wrap:!0,children:[(0,y.jsxs)(B.Z,{wrap:!1,children:[(0,y.jsx)(L.Z.Text,{style:{marginLeft:4},children:"└"}),(0,y.jsx)(rE,{label:e.name,value:`v${e.version}`,tooltip:s})]}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rE,{label:(0,y.jsxs)("div",{color:"rgb(255, 255, 255)",children:["Source Size ",(0,y.jsx)(G.Z,{})]}),value:r,tooltip:`The bundle size of "${s}" is ${r}, this is source size.`,type:"error"}),(0,y.jsx)(rE,{label:"Bundled size",value:n||"CONCATENATED",tooltip:`The bundle size of "${s}" is ${r}, this is after bundled, concatenated module cannot get bundled size. `,type:"error"})]}),(0,y.jsx)(L.Z.Paragraph,{style:{marginBottom:0,width:d?"40rem":o?"30rem":"20rem"},copyable:{text:e.root},ellipsis:{rows:1,expandable:!0,symbol:(0,y.jsx)(rh.Z,{}),tooltip:e.root},code:!0,children:e.root})]},e.version)})}),type:"warn"===r?"info":r,action:(0,y.jsxs)(W.Fragment,{children:[s&&s.length>0?(0,y.jsx)(rk,{text:"Show Relations",buttonProps:{size:"small"},drawerProps:{title:e.title,width:"60%"},children:(0,y.jsxs)(B.Z,{direction:"vertical",className:"alert-space",children:[(0,y.jsxs)(B.Z,{style:{marginBottom:I.BasePadding/2},children:[(0,y.jsx)(rT,{text:c,upperFirst:!1}),(0,y.jsx)(L.Z.Text,{strong:!0,children:u.length}),(0,y.jsx)(L.Z.Text,{children:" versions was found: "}),u.map(e=>(0,y.jsx)(L.Z.Text,{strong:!0,code:!0,children:e},e))]}),(0,y.jsx)(rd.Z,{type:"card",size:"middle",className:"tabs-space",defaultActiveKey:u[0],items:s.map(r=>{let{target:n,targetSize:s}=r;return{label:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:`${c}@${n.version}`}),(0,y.jsx)(rc.Z,{color:k.Red,children:t0(s.sourceSize)})]}),key:`${n.root}${n.name}${n.version}`,children:t({data:e,package:r})}})})]})}):null,(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)($.ZP,{type:"link",onClick:i,size:"small",icon:(0,y.jsx)(G.Z,{})})]})})};var rR=r("80930"),rO=r("39562");let rB=+Date.now().toString().slice(-4)+1e3,rL=({cwd:e,url:t,loc:r,windowId:n=rB,label:s,disabled:i,code:l=!1})=>{let a=q().resolve(e,function(e){let t=e.split(" "),r="";return 1===t.length?[r]=t:[r]=t.filter(e=>q().isAbsolute(e)||(0,ts.Z)(e,"./")),r||e}(t)),{line:o,columnStart:d}=function(e){if(!e)return{line:1,column:1};let[t,r=""]=e.split(":"),[n=1,s]=r.split("-");return{line:t,columnStart:n,columnEnd:s||n}}(r);return(0,y.jsxs)("span",{style:{wordBreak:"break-all"},children:[(0,y.jsx)(L.Z.Text,{copyable:{text:a},children:(0,y.jsxs)(L.Z.Text,{code:l,onClick:()=>{!i&&!function({file:e,line:t=1,column:r=1,windowId:n}){let s={windowId:n},i=Object.keys(s).map(e=>{let t=s[e];return(0,rv.Z)(t)||""===t?null:`${e}=${t}`}).filter(Boolean).join("&"),l=`vscode://file/${e}:${t}:${r}`;i&&(l+=`?${i}`),window.open(l)}({file:a,line:o,column:d,windowId:n})},style:{cursor:i?"revert":"pointer"},children:[s||t,r?`:${r}`:""]})}),(0,y.jsx)("div",{style:{display:"inline-block"}})]})},r$=({before:e,after:t,filepath:r,className:n,editorProps:s})=>(0,y.jsx)(tU.SV,{className:n,originalLanguage:tV(r),modifiedLanguage:tJ(r),theme:"vs-dark",original:e,modified:t,width:"100%",...s,options:{readOnly:!0,originalEditable:!1,renderSideBySide:!0,renderIndicators:!0,lineDecorationsWidth:I.BasePadding,definitionLinkOpensInPeek:!1,domReadOnly:!0,fontSize:14,minimap:{enabled:!1},diffWordWrap:"on",...s?.options}});var rG=r("77590"),rF=r("47980");let rW={readOnly:!0,domReadOnly:!0,fontSize:12,renderValidationDecorations:"off",hideCursorInOverviewRuler:!0,smoothScrolling:!0,wordWrap:"bounded",colorDecorators:!0,codeLens:!1,cursorWidth:0,minimap:{enabled:!1}},rK=({content:e,ranges:t,path:r,defaultLine:n,editorConfig:s={},emptyReason:i})=>e?(0,y.jsx)(tU.ZP,{theme:"vs-dark",language:tV(r),value:e,width:"100%",height:window.innerHeight/1.5,options:{...rW,...s},onMount:(e,r)=>{(0,rG.Z)(n)&&e.revealLine(n),t&&t.length>0&&e.deltaDecorations([],t.map(e=>({range:tq(e,r.Range),options:{inlineClassName:"file-inline-decoration"}})))}}):(0,y.jsx)(rl.Z,{description:i}),rH=e=>(0,y.jsx)(rk,{text:"",buttonProps:{size:"small",icon:(0,y.jsx)(rF.Z,{}),type:"default"},buttonStyle:{padding:"0 4px"},drawerProps:{destroyOnClose:!0,title:`Code of "${e.path}"`},children:(0,y.jsx)(rK,{...e})}),rU=({data:e,setIsFixed:t,cwd:r})=>{let{file:n,id:s}=e,{path:i,line:l,isFixed:a,actual:o,expected:d}=n,c=()=>{eQ.Z.post(F.SDK.ServerAPI.API.ApplyErrorFix,{id:s}).then(()=>{t(!0)})};return(0,y.jsxs)(B.Z,{direction:"vertical",className:"alert-space",children:[(0,y.jsxs)("div",{children:[(0,y.jsx)(rT,{text:a?"Fix History":"Suggest Fix"}),(0,y.jsx)("span",{className:"code-change-tag-list",children:(0,y.jsx)(()=>(0,y.jsx)(rR.Z,{title:"Did you confirm to apply the change i the area below ?",onConfirm:c,okText:"Yes",cancelText:"Cancel",zIndex:99999,disabled:a,placement:"bottom",children:(0,y.jsx)($.ZP,{type:"primary",size:"small",icon:a?(0,y.jsx)(rO.Z,{}):void 0,disabled:a,children:a?"Fix Applied":"Apply Fix"})}),{})})]}),(0,y.jsx)(rL,{cwd:r,url:i,loc:String(l),code:!0,disabled:!0}),(0,y.jsxs)(rt.Z,{children:[(0,y.jsx)(rr.Z,{span:12,children:(0,y.jsx)(L.Z.Text,{strong:!0,children:"Before"})}),(0,y.jsx)(rr.Z,{span:12,children:(0,y.jsx)(L.Z.Text,{strong:!0,children:"After"})})]}),(0,y.jsx)(r$,{className:"full-space",filepath:i,before:o,after:d})]})},rY=({data:e,cwd:t})=>{let{title:r,description:n="",level:s,code:i,file:l}=e,[a,o]=(0,W.useState)(l.isFixed??!1),d=tj(i,e.link),c=(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsx)(L.Z.Text,{children:n}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:"File:"}),(0,y.jsx)(L.Z.Text,{strong:!0,code:!0,children:l.path}),(0,y.jsx)(L.Z.Text,{children:"in line"}),(0,y.jsx)(L.Z.Text,{strong:!0,code:!0,children:l.line})]})]});return(0,y.jsx)(O.Z,{showIcon:!0,message:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{code:!0,strong:!0,onClick:d,style:{cursor:"pointer"},children:(0,y.jsx)("a",{children:i})}),(0,y.jsx)(L.Z.Text,{strong:!0,children:r})]}),description:c,type:a?"success":"warn"===s?"info":s,action:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rk,{text:a?"Fixed | Show Fix History":"Show Fix Suggestion",buttonProps:{size:"small"},children:(0,y.jsx)(rU,{data:e,setIsFixed:e=>{o(e),l.isFixed=e},cwd:t})}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)($.ZP,{type:"link",onClick:d,size:"small",children:(0,y.jsx)(G.Z,{})})]})})},rV=({data:e,cwd:t})=>{let{file:r}=e,{path:n,ranges:s}=r,i=s?.[0].start.line;return(0,y.jsxs)(B.Z,{direction:"vertical",className:"alert-space",children:[(0,y.jsx)(rT,{text:"Code Viewer"}),(0,y.jsx)(rL,{cwd:t,url:n,loc:(0,rG.Z)(i)?String(i):void 0,code:!0,disabled:!0}),(0,y.jsx)(rK,{path:r.path,content:r.content,ranges:s,defaultLine:i})]})},rJ=({data:e,cwd:t})=>{let{title:r,description:n="",level:s,code:i,file:l}=e,a=tj(i,e.link),o=l.ranges?.[0].start.line,d=(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsx)(L.Z.Text,{children:n}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:"File:"}),(0,y.jsx)(L.Z.Text,{strong:!0,code:!0,children:l.path}),(0,rG.Z)(o)?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(L.Z.Text,{children:"in line"}),(0,y.jsx)(L.Z.Text,{strong:!0,code:!0,children:o})]}):""]})]});return(0,y.jsx)(O.Z,{showIcon:!0,message:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{code:!0,strong:!0,onClick:a,style:{cursor:"pointer"},children:(0,y.jsx)("a",{children:i})}),(0,y.jsx)(L.Z.Text,{strong:!0,children:r})]}),description:d,type:"warn"===s?"info":s,action:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rk,{text:"Show Source Code",buttonProps:{size:"small"},children:(0,y.jsx)(rV,{data:e,cwd:t})}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)($.ZP,{type:"link",onClick:a,size:"small",icon:(0,y.jsx)(G.Z,{})})]})]})})},rq=e=>{let{data:t,cwd:r=""}=e;if("file-relation"===t.type)return(0,y.jsx)(re,{data:t});if("code-view"===t.type)return(0,y.jsx)(rJ,{data:t,cwd:r});if("code-change"===t.type)return(0,y.jsx)(rY,{data:t,cwd:r});if("package-relation"===t.type){let{getPackageRelationContentComponent:n}=e;return(0,y.jsx)(rz,{data:t,cwd:r,getPackageRelationContentComponent:n})}return(0,y.jsx)(t7,{data:t})};var rQ=r("94133"),rX=r("34777"),r0=r("72589"),r1=r("49626"),r2=r("16633"),r4=r("99203"),r3=r("60782"),r5=r("79776"),r9=r("614");let r6=({title:e,value:t,statisticProps:r,boxProps:n})=>{let{theme:s}=tK();return(0,y.jsx)("div",{className:`statistic-card statistic-card-${s}`,...n,children:(0,y.jsx)(r9.Z,{title:(0,y.jsx)("div",{className:"statistic-card-title",children:e}),valueRender:()=>t,valueStyle:{fontSize:24},...r})})},r8=({baseline:e,current:t,...r})=>{let n=eN(e,t);return(0,y.jsx)(r7,{...r,...n})},r7=({percent:e,state:t,fontSize:r=14})=>{let n=+e.toFixed(2);if(n>0){let e=`${n}`;if(t===F.Client.RsdoctorClientDiffState.Up)return(0,y.jsxs)(L.Z.Text,{strong:!0,style:{fontSize:r,color:k.Red},children:["+",e,"%"]});if(t===F.Client.RsdoctorClientDiffState.Down)return(0,y.jsxs)(L.Z.Text,{strong:!0,style:{fontSize:r,color:k.Green},children:["-",e,"%"]})}return null},ne=({data:e,formatter:t})=>{let{percent:r,state:n,size:s}=e,{baseline:i,current:l}=s,a=t?t(i,"baseline"):t0(i),o=t?t(l,"current"):t0(l);return(0,y.jsx)(B.Z,{align:"start",children:(0,y.jsxs)(B.Z,{direction:"vertical",style:{textAlign:"left"},children:[(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{style:{fontSize:10,color:"inherit"},keyboard:!0,children:"Current"}),(0,y.jsx)(rx.Z,{title:"number"==typeof o||"string"==typeof o?`Value of Current is ${o}`:void 0,children:(0,y.jsx)(L.Z.Text,{style:{fontSize:16,color:"inherit"},strong:!0,children:o})}),(0,y.jsx)(r7,{percent:r,state:n})]}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{style:{fontSize:10,color:"inherit"},keyboard:!0,children:"Baseline"}),(0,y.jsx)(rx.Z,{title:"number"==typeof a||"string"==typeof a?`Value of Baseline is ${a}`:void 0,children:(0,y.jsx)(L.Z.Text,{style:{fontSize:14},type:"secondary",children:a})})]})]})})},nt=({titles:e,datas:t,formatter:r,showPercentInTitle:n})=>{let[s,i]=(0,W.useState)(0);return(0,y.jsx)(r6,{title:e.length>1?(0,y.jsx)(r5.Z,{defaultValue:e[s],options:n?e.map((e,r)=>{let n=t[r];return{label:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:e}),(0,y.jsx)(r7,{percent:n.percent,state:n.state})]}),value:e}}):e,onChange:t=>{i(e.indexOf(t))},size:"small",style:{transition:"transform 0.3s ease"},value:e[s]||e[0]}):e[s],value:(0,y.jsx)(ne,{data:t[s],formatter:r}),statisticProps:{style:{textAlign:"left"}}})},nr=({collapsable:e=!1,children:t,title:r,dividerStyle:n,defaultCollapsed:s=!1,...i})=>{let[l,a]=(0,W.useState)(s);return r&&e?(0,y.jsx)(rn.Z,{...i,title:(0,y.jsxs)(B.Z,{style:{fontSize:"inherit"},children:[(0,y.jsx)($.ZP,{icon:l?(0,y.jsx)(r4.Z,{}):(0,y.jsx)(r3.Z,{}),onClick:()=>a(!l),size:"small"}),r]}),children:l?(0,y.jsx)(ro.Z,{orientation:"center",style:n,plain:!0,children:(0,y.jsx)($.ZP,{icon:(0,y.jsx)(r4.Z,{}),type:"text",onClick:()=>a(!l),children:"show more"})}):t}):(0,y.jsx)(rn.Z,{title:r,...i,children:t})},nn={warn:1,error:2},ns=({dataSource:e,extraData:t})=>{let r=(0,W.useMemo)(()=>e.slice().sort((e,t)=>nn[t.level]-nn[e.level]),[e]);return(0,y.jsx)(B.Z,{direction:"vertical",style:{wordBreak:"break-all",width:"100%"},children:r.map((e,r)=>(0,y.jsx)(rq,{data:e,...t},r))})},ni=({dataSource:e,extraData:t})=>{let r=(0,W.useMemo)(()=>{let t=e.toSorted((e,t)=>{let r=0,n=0;return"package-relation"===e.type&&(r=(0,ru.Z)(e.packages,e=>e.targetSize.sourceSize)),"package-relation"===t.type&&(n=(0,ru.Z)(t.packages,e=>e.targetSize.sourceSize)),n-r}),r=(0,r2.Z)(t,e=>e.code);return(0,rS.Z)(r)},[e]);return(0,y.jsx)(B.Z,{direction:"vertical",style:{wordBreak:"break-all",width:"100%"},children:(0,y.jsx)(rQ.Z,{children:r.map(e=>{let[r]=e;return(0,y.jsx)(rQ.Z.Panel,{header:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{code:!0,strong:!0,style:{cursor:"pointer"},children:r.code}),(0,y.jsx)(L.Z.Text,{strong:!0,children:F.Rule.RuleErrorMap[r.code]?.title||r.title}),(0,y.jsx)(rE,{label:"count",value:e.length,type:"error"})]}),children:(0,y.jsx)(B.Z,{direction:"vertical",size:16,style:{width:"100%"},children:e.map((e,r)=>(0,y.jsx)(rq,{data:e,...t},r))})},r.code)})})})},nl=({title:e,dataSource:t,extraData:r,viewMode:n,setViewMode:s,extraCom:i})=>t.length?(0,y.jsx)(nr,{title:e,style:{marginTop:I.BasePadding},collapsable:!0,extra:i||(0,y.jsx)(rX.ZP.Group,{options:[{label:(0,y.jsx)(rx.Z,{title:"display by list",children:(0,y.jsx)(r0.Z,{})}),value:C.List},{label:(0,y.jsx)(rx.Z,{title:"display by group",children:(0,y.jsx)(r1.Z,{})}),value:C.Group}],value:n,optionType:"button",size:"small",onChange:e=>{s(e.target.value)}}),children:n===C.List?(0,y.jsx)(ns,{dataSource:t,extraData:r}):(0,y.jsx)(ni,{dataSource:t,extraData:r})}):null;var na=r("76202");let no=rC({api:F.SDK.ServerAPI.API.GetProjectInfo,responsePropName:"project",Component:({filter:e,project:t})=>{let{errors:r,root:n}=t,s=tv(r),{setBundleAlertsViewMode:i,viewMode:l,setViewMode:a}=tH(),o=e?s.filter(e):s;return(0,W.useEffect)(()=>{!R()&&a({bundleAlerts:s.length>=5?C.Group:C.List},!1)},[]),(0,y.jsx)(na.ZP,{theme:{components:{Alert:{colorInfoBg:"#e6f4ff57",colorInfoBorder:"none"}}},children:(0,y.jsx)(nl,{title:"Bundle Alerts",dataSource:o,extraData:{cwd:n,getPackageRelationContentComponent:e=>(0,y.jsx)(r_,{body:{id:e.data.id,target:e.package.target},cwd:n})},viewMode:l.bundleAlerts,setViewMode:i,cwd:n})})}}),nd=rC({api:F.SDK.ServerAPI.API.GetProjectInfo,responsePropName:"project",Component:({filter:e,project:t})=>{var r;let{root:n,errors:s}=t;let i=(r=s,(0,tu.Z)(r)?r.filter(e=>e.category===F.Rule.RuleMessageCategory.Compile&&e.code!==F.Rule.RuleMessageCodeEnumerated.Overlay):[]),{setCompileAlertsViewMode:l,viewMode:a,setViewMode:o}=tH(),d=e?i.filter(e):i;return(0,W.useEffect)(()=>{!R()&&o({compileAlerts:i.length>=5?C.Group:C.List},!1)},[]),(0,y.jsx)(nl,{title:"Compile Alerts",dataSource:d,extraData:{cwd:n,getPackageRelationContentComponent:e=>(0,y.jsx)(r_,{body:{id:e.data.id,target:e.package.target},cwd:n})},viewMode:a.compileAlerts,setViewMode:l,cwd:n})}});var nc=r("22778"),nu=r("82381"),nh=r("64196"),np=r("56079"),nx=r("15715"),nm=r("86698"),nf=r.n(nm);function ng(e){let t=0,r=0;e.forEach(e=>{"warn"===e.level?t++:r++});let n=0!==t&&0!==r?"problems":0===t?"errors":"warns";return{title:`${e.length} compiled ${n}`,detail:(0,y.jsxs)(L.Z.Text,{strong:!0,style:{color:"#fff",marginBottom:0},children:[(0,y.jsx)(L.Z.Text,{style:{color:"inherit",fontSize:16},children:"Compiled with "}),(0,y.jsxs)(L.Z.Text,{strong:!0,style:{color:k.Red,fontSize:16},children:[r," errors"]}),(0,y.jsx)(L.Z.Text,{style:{color:"inherit",fontSize:16},children:" and "}),(0,y.jsxs)(L.Z.Text,{strong:!0,style:{color:k.Yellow,fontSize:16},children:[t," warnings"]})]}),warns:t,errors:r}}r("83741");let nj=({alerts:e=[],open:t,onClose:r})=>e.length?(0,y.jsxs)(nx.Z,{visible:t,onClose:()=>r(),style:{width:"100%",height:"100%",margin:0,zIndex:1e3},closable:!1,modalRender:e=>W.cloneElement(e,{style:{background:"rgba(0, 0, 0, 0.7)",color:"#fff",height:"100%",overflow:"scroll",borderRadius:0}}),children:[(0,y.jsxs)(rt.Z,{justify:"space-between",align:"middle",children:[ng(e).detail,(0,y.jsx)($.ZP,{onClick:()=>r(),type:"text",style:{color:"#fff"},size:"large",icon:(0,y.jsx)(nc.Z,{})})]}),(0,y.jsx)(rt.Z,{gutter:[0,I.BasePadding],children:e.map(e=>(0,y.jsx)(rr.Z,{span:24,style:{whiteSpace:"pre-wrap",lineHeight:"16px",fontSize:14},children:(0,y.jsx)(rQ.Z,{ghost:!0,style:{background:"#000"},defaultActiveKey:[e.id],expandIcon:e=>e.isActive?(0,y.jsx)(nu.Z,{style:{color:"#fff"}}):(0,y.jsx)(nh.Z,{style:{color:"#fff"}}),children:(0,y.jsx)(rQ.Z.Panel,{header:(0,y.jsxs)("div",{style:{color:"#fff"},children:["warn"===e.level?(0,y.jsx)(rc.Z,{color:k.Yellow,children:"WARNING"}):(0,y.jsx)(rc.Z,{color:k.Red,children:"ERROR"}),(0,y.jsx)(nf(),{children:e.description||e.title})]}),children:(0,y.jsx)("div",{style:{color:"#fff"},children:(0,y.jsx)(nf(),{children:e.stack})})},e.id)})},e.id))})]}):null,ny=rC({api:F.SDK.ServerAPI.API.GetOverlayAlerts,Component:({alerts:e=[]})=>{if(!e.length)return null;let{errors:t}=ng(e),[r,n]=(0,W.useState)(t>0);return(0,y.jsxs)(W.Fragment,{children:[(0,y.jsx)($.ZP,{icon:(0,y.jsx)(np.Z,{}),danger:!0,size:"small",onClick:()=>n(!r),children:ng(e).title}),(0,y.jsx)(nj,{alerts:e,open:r,onClose:()=>n(!1)})]})},responsePropName:"alerts",fallbackComponent:()=>null}),nZ=rC({api:F.SDK.ServerAPI.API.GetOverlayAlerts,Component:({alerts:e=[],defaultOpen:t=e.length>0})=>{if(!e.length)return null;let[r,n]=(0,W.useState)(t);return(0,y.jsxs)(W.Fragment,{children:[(0,y.jsx)(O.Z,{banner:!0,message:W.cloneElement(ng(e).detail,{style:{color:"#000"}}),icon:(0,y.jsx)(np.Z,{}),action:(0,y.jsx)($.ZP,{onClick:()=>n(!0),size:"small",children:"More"})}),(0,y.jsx)(nj,{alerts:e,open:r,onClose:()=>n(!1)})]})},responsePropName:"alerts",fallbackComponent:()=>null});var nb=r("81294"),nv=r("18884"),nS=r("70991"),nM=r("84167"),nC=r("60784");let nw=()=>{let[e,t]=(0,W.useState)(""),[r,n]=(0,W.useState)([]);return((0,W.useEffect)(()=>{e8().then(({name:e,series:r})=>{e&&t(e),r&&r.length>0&&n(r)})},[]),e.length<=0||r.length<=0)?(0,y.jsx)(y.Fragment,{}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(ro.Z,{type:"vertical",style:{margin:"0 24px"}}),(0,y.jsx)("img",{src:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDQ4IDQ4IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik01IDI0TDQzIDI0IiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggZD0iTTI4IDRIMjBDMTguODk1NCA0IDE4IDQuODk1NDMgMTggNlYxNEMxOCAxNS4xMDQ2IDE4Ljg5NTQgMTYgMjAgMTZIMjhDMjkuMTA0NiAxNiAzMCAxNS4xMDQ2IDMwIDE0VjZDMzAgNC44OTU0MyAyOS4xMDQ2IDQgMjggNFoiIGZpbGw9Im5vbmUiIHN0cm9rZT0iIzMzMyIgc3Ryb2tlLXdpZHRoPSI0IiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHBhdGggZD0iTTE2IDMySDhDNi44OTU0MyAzMiA2IDMyLjg5NTQgNiAzNFY0MkM2IDQzLjEwNDYgNi44OTU0MyA0NCA4IDQ0SDE2QzE3LjEwNDYgNDQgMTggNDMuMTA0NiAxOCA0MlYzNEMxOCAzMi44OTU0IDE3LjEwNDYgMzIgMTYgMzJaIiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxwYXRoIGQ9Ik00MCAzMkgzMkMzMC44OTU0IDMyIDMwIDMyLjg5NTQgMzAgMzRWNDJDMzAgNDMuMTA0NiAzMC44OTU0IDQ0IDMyIDQ0SDQwQzQxLjEwNDYgNDQgNDIgNDMuMTA0NiA0MiA0MlYzNEM0MiAzMi44OTU0IDQxLjEwNDYgMzIgNDAgMzJaIiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iNCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxwYXRoIGQ9Ik0yNCAyNFYxNiIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9IjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxwYXRoIGQ9Ik0zNiAzMlYyNCIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9IjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjxwYXRoIGQ9Ik0xMiAzMlYyNCIgc3Ryb2tlPSIjMzMzIiBzdHJva2Utd2lkdGg9IjQiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPjwvc3ZnPg==",style:{marginRight:6,height:16}}),(0,y.jsx)(L.Z,{children:"Compiler"}),(0,y.jsx)(nC.Z,{className:"builder-selector",defaultValue:e,bordered:!1,style:{minWidth:100},onChange:e=>{let t=r.find(t=>t.name===e);t&&(t.origin?location.href=function(e){var t;let r=e0()(location.href,!0),n=e0()(e,!0);return t=r,(0,e1.Z)(t.hash,F.Client.RsdoctorClientRoutes.Uploader)&&t.set("hash",F.Client.RsdoctorClientRoutes.Overall),r.set("origin",e),r.set("protocol",n.protocol),r.set("host",n.host),r.set("port",n.port),r.toString()}(t.origin):console.error("No RsdoctorManifestSeriesData.origin"))},children:r.map((e,t)=>(0,y.jsx)(nC.Z.Option,{value:e.name,className:"builder-selector-option-item",children:e.name},t))})]})};var nP=r("98699"),nI=r("55762"),nk=r("5688"),nD=r("38478"),nT=r("75924"),nA=r("82444"),nE=r("49128"),nN=r("10294");let n_=F.Client.RsdoctorClientRoutes.Overall;var nz=r("17970"),nR=r("98899"),nO=r("50232"),nB=r("83024"),nL=r("96913"),n$=r("50278");let{useToken:nG}=nR.Z,nF=e=>{let{isDark:t}=tK(),{token:r}=nG(),n=t?r.colorWhite:r.colorText,s={fontSize:r.fontSize};return(0,y.jsx)(n$.Z,{checkable:!1,selectable:!0,switcherIcon:({data:e,expanded:t})=>e?.children?(0,y.jsxs)(B.Z,{style:{color:n},children:[(0,y.jsx)(nh.Z,{twoToneColor:n,className:`file-tree-switcher-arrow ${t?"file-tree-switcher-arrow-expand":""}`,style:s}),t?(0,y.jsx)(nO.Z,{twoToneColor:n,style:s}):(0,y.jsx)(nB.Z,{twoToneColor:n,style:s})]}):(0,y.jsx)(nL.Z,{style:{marginLeft:I.BasePadding-6,color:n}}),expandAction:"click",...e})};var nW="root_17e15",nK={card:"card_3bba1"},nH="errorNumber_3c2f5",nU="warningNumber_3c2f5",nY="successNumber_3c2f5",nV="errorText_3c2f5",nJ="warningText_3c2f5",nq="successText_3c2f5",nQ="errorButton_3c2f5",nX="warningButton_3c2f5",n0="successButton_3c2f5",n1="container_3c2f5";let n2=({theme:e,number:t,onClick:r,description:n,numberFontSize:s})=>{let i={success:{number:nY,button:n0,description:nq},error:{number:nH,button:nQ,description:nV},warning:{number:nU,button:nX,description:nJ}};return(0,y.jsxs)($.ZP,{type:"text",className:i[e].button,onClick:r,children:[(0,y.jsx)(L.Z.Text,{className:i[e].number,style:{fontSize:s},children:t}),(0,y.jsx)("div",{className:i[e].description,children:n})]})},n4=e=>{let t=(0,W.useMemo)(()=>e.files.length?to({files:e.files.map(e=>e.path),fileTitle(t,r){let{size:n,initial:s}=e.files.find(e=>e.path===t);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:r}),(0,y.jsx)(rc.Z,{color:"success",style:{marginRight:0},children:t0(n)}),s?(0,y.jsx)(rc.Z,{color:"cyan",children:"Initial"}):null]})}}):[],[e.files]);return(0,y.jsx)(y.Fragment,{children:e.files.length?(0,y.jsx)(rk,{buttonProps:{size:"small"},buttonStyle:{fontSize:"inherit"},text:(0,y.jsxs)(y.Fragment,{children:[e.count," ",(0,y.jsx)(rm.Z,{})]}),children:(0,y.jsx)(nF,{treeData:t,defaultExpandAll:!0})}):e.count})},n3=({res:e})=>{let t=[{key:"total-files-count",label:"Total files",children:e.all.total.count},{key:"total-files-size",label:"",children:""},{key:"js-files-count",label:"JS files",children:n4(e.js.total)},{key:"js-files-size",label:"JS size",children:t0(e.js.total.size)},{key:"css-files-count",label:"CSS files",children:n4(e.css.total)},{key:"css-files-size",label:"CSS size",children:t0(e.css.total.size)},{key:"font-files-count",label:"Font files",children:n4(e.fonts.total)},{key:"font-files-size",label:"Font size",children:t0(e.fonts.total.size)},{key:"html-files-count",label:"HTML files",children:n4(e.html.total)},{key:"html-files-size",label:"HTML size",children:t0(e.html.total.size)},{key:"image-files-count",label:"Image files",children:n4(e.imgs.total)},{key:"image-files-size",label:"Image size",children:t0(e.imgs.total.size)},{key:"media-files-count",label:"Media files",children:n4(e.media.total)},{key:"media-files-size",label:"Media size",children:t0(e.media.total.size)}];return(0,y.jsx)(nz.Z,{className:nW,size:"small",column:2,items:t})},n5=({errors:e,cwd:t})=>{let{t:r}=tg(),n=(0,tm.s0)(),s=tS(e);return(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetAssetsSummary,body:{withFileContent:!1},children:e=>{let i=t0(e.all.total.size);return(0,y.jsxs)(nr,{title:r("Bundle Overall"),className:nK.card,children:[(0,y.jsxs)(rt.Z,{gutter:16,children:[(0,y.jsx)(rr.Z,{span:12,className:n1,children:(0,y.jsx)(n2,{theme:"success",number:i,description:"Total Size",numberFontSize:"30px",onClick:()=>{n(F.Client.RsdoctorClientRoutes.BundleSize)}})}),(0,y.jsx)(rr.Z,{span:12,className:n1,children:(0,y.jsx)(rI,{cwd:t,duplicatePackages:s,button:(0,y.jsx)(n2,{theme:0===s.length?"success":"warning",number:s.length,description:"Duplicate Packages"})})})]}),(0,y.jsx)(n3,{res:e})]})}})};var n9=r("64258"),n6=r("23907"),n8=r("89687"),n7=r("30448"),se=r("78114"),st=r("80579"),sr=r("35597"),sn=r("24546"),ss=r("10479"),si=r("23876"),sl=r("28977"),sa=r.n(sl);let so=["#a8071a","#ad6800","#237804","#006d75","#ad8b00","#ad4e00","#5b8c00","#003eb3"],sd=["#4096ff","#69b1ff","#9e1068","#722ed1","#bae0ff","#d3adf7","#597ef7","#ffadd2","#c41d7f","#391085","#ffa940","#5c060b","#a81414","#ff7875","#ffd591","#ffe58f","#d3f261","#d4b106","#7cb305","#f4ffb8","#fa8c16","#0958d9","#fff3f0","#82090d","#ffbfb3","#f44336","#ff998a","#ff7161","#ffe2db","#cf2923"],sc=(0,W.memo)(({loaderData:e,pluginsData:t,formatterFn:r,chartType:n="normal"})=>{let s=[],i=[],[l,a]=(0,W.useState)({});return n8.D([st.N,sr.N,sn.N,ss.N,si.N]),(0,W.useEffect)(()=>{if(!e)return;let t=[];e.forEach(e=>{t.unshift(e.n+" total"),t.unshift(e.n)}),e.forEach(function(e,r){if(s.push({name:e.n+" total",value:[t.indexOf(e.n+" total"),e.s,e.e,e.e-e.s],itemStyle:{normal:{color:so[r%8]}}}),e?.c)for(let n=0;n<e?.c?.length;n++)s.push({name:e.n,value:[t.indexOf(e.n),e.c[n].s,e.c[n].e,e.c[n].e-e.c[n].s],itemStyle:{normal:{color:sd[(n+r)%30]}},ext:e.c[n].ext})}),i=t.map((e,t)=>t%2!=0?e.replace(" total",""):"")},[e]),(0,W.useEffect)(()=>{if(!t)return;let e=(0,r2.Z)(t,e=>e.pid);Object.keys(e).reverse().forEach(function(t,r){e[t].forEach((e,t)=>{s.push({name:String(e.pid),value:[r,e.args.s,e.args.e,e.args.e-e.args.s],itemStyle:{normal:{color:sd[(t+r)%30]}},ext:e})}),i.push(String(t.charAt(0).toUpperCase()+t.slice(1)))})},[t]),(0,W.useEffect)(()=>{a({tooltip:{formatter:e=>r(e)},dataZoom:[{type:"slider",filterMode:"weakFilter",showDataShadow:!1,top:-10,labelFormatter:""},{type:"inside",filterMode:"weakFilter"}],grid:{top:10,left:0,bottom:10,right:0,height:i.length>("loader"===n?6:3)?"auto":60*i.length,containLabel:!0},xAxis:{position:"top",splitLine:{show:!1},scale:!0,axisLine:{show:!1},axisLabel:{formatter:e=>sa()(e).format("HH:mm:ss")}},yAxis:{type:"category",splitLine:{interval:"loader"===n?1:0,show:!0},axisLabel:{inside:!0,lineHeight:20,width:100,fontSize:12,color:"#000",verticalAlign:"bottom"},axisLine:{show:!0},axisTick:{show:!1},data:i},series:[{type:"custom",renderItem:function(e,t){let r=t.value(0),s=t.coord([t.value(1),r]),i=t.coord([t.value(2),r]),l=.3*t.size([0,1])[1],a=n7.clipRectByRect({x:s[0],y:"loader"===n?s[1]-(r%2!=0?0:2*l):s[1],width:i[0]-s[0]||5,height:l},{x:e.coordSys.x,y:e.coordSys.y,width:e.coordSys.width,height:e.coordSys.height});return a&&{type:"rect",transition:["shape"],shape:a,style:t.style(),enterFrom:{style:{opacity:0},x:0}}},itemStyle:{opacity:.8},encode:{x:[1,2],y:0},data:s}]})},[e,t]),(0,y.jsx)(n6.default,{option:l,echarts:se,style:{width:"100%",minHeight:"400px"}})});var su=r("39481"),sh=r("12533");var sp=((p=sp||{}).BEGIN="B",p.END="E",p.COMPLETE="X",p.INSTANT="I",p.MARK="R",p);function sx(e){return function e(t){return t.reduce((t,r)=>{if(r.c){let n=e(r.c);t.push({name:r.n,ph:sp.BEGIN,pid:r.p,ts:r.s,args:r},...n,{name:r.n,ph:sp.END,pid:r.p,ts:r.e,args:r})}else t.push({name:r.n,ph:sp.BEGIN,pid:r.p,ts:r.s,args:r}),t.push({name:r.n,ph:sp.END,pid:r.p,ts:r.e,args:r});return t},[])}(Object.entries(e.sort((e,t)=>e.s-t.s).reduce((e,t)=>{let r=e[t.p];return r?function(e,t){let r=[e];for(;r.length>0;){let e;let n=r.shift()||[];if(0===n.length)return;let s=n[n.length-1];if(s.e<=t.s)return n.push(t);for(let t=n.length-1;t>=0;t--){let{c:r}=n[t];r&&(e=r)}e?r.push(e):s.c=[t]}}(r,t):e[t.p]=[t],e},{})).reduce((e,[t,r])=>(e.push(...r),e),[]))}function sm(e){let{ext:t}=e.data;return`
|
|
74
|
+
<div class="loader-tooltip-container">
|
|
75
|
+
<div class="loader-tooltip-title">[${t.args.p}] ${t.args.n}</div>
|
|
76
|
+
<li class="loader-tooltip-item">
|
|
77
|
+
<span>hook</span>
|
|
78
|
+
<span>${t.args.p}</span>
|
|
79
|
+
</li>
|
|
80
|
+
<li class="loader-tooltip-item">
|
|
81
|
+
<span>tap name</span>
|
|
82
|
+
<span>${t.args.n}</span>
|
|
83
|
+
</li>
|
|
84
|
+
<li class="loader-tooltip-item">
|
|
85
|
+
<span>start</span>
|
|
86
|
+
<span>${sa()(t.args.s).format("YYYY/MM/DD HH:mm:ss")}</span>
|
|
87
|
+
</li>
|
|
88
|
+
<li class="loader-tooltip-item">
|
|
89
|
+
<span>end</span>
|
|
90
|
+
<span>${sa()(t.args.e).format("YYYY/MM/DD HH:mm:ss")}</span>
|
|
91
|
+
</li>
|
|
92
|
+
<li class="loader-tooltip-item">
|
|
93
|
+
<span>duration</span>
|
|
94
|
+
<span>${t3(t.args.e-t.args.s)}</span>
|
|
95
|
+
</li>
|
|
96
|
+
</div>
|
|
97
|
+
`.trim()}let sf=({plugins:e,defaultDatas:t=[]})=>{let{isDark:r}=tK(),n=(0,W.useRef)(null),[s,i]=(0,W.useState)([]);return(0,W.useEffect)(()=>{let r=[];e.forEach(e=>{e.data.forEach(t=>{r.push({p:e.hook,n:`${e.tapName}`,s:t.startAt,e:t.endAt})})}),i([...sx(t),...sx(r)])},[]),(0,y.jsx)("div",{className:["loader-chart-container",r?"loader-chart-container_dark":""].join(" ").trim(),ref:n,style:{width:"100%",height:"600px"},children:(0,y.jsx)(sc,{pluginsData:s,formatterFn:sm})})},sg=()=>(0,y.jsx)(O.Z,{message:(0,y.jsxs)(L.Z.Text,{children:[(0,y.jsx)(L.Z.Text,{children:"make sure that you have turn on "}),(0,y.jsx)(L.Z.Text,{children:" in configuration for the Rsdoctor plugin."})]}),type:"info",showIcon:!0}),sj=({summary:e})=>{let{costs:t=[]}=e||{},r=t.find(e=>e.name===K.Bootstrap);return r?(0,y.jsx)(rk,{drawerProps:{title:'Chart of the "Bootstrap -> BeforeCompile" stage'},text:(0,y.jsxs)(B.Z,{children:["detail",(0,y.jsx)(nP.Z,{})]}),children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetPluginData,body:{hooks:["environment","afterEnvironment","entryOption","afterPlugins","afterResolvers","initialize","beforeRun","run","watchRun","normalModuleFactory","contextModuleFactory","beforeCompile"]},children:e=>e&&e.length?(0,y.jsx)(sf,{plugins:e}):(0,y.jsx)(sg,{})})}):null};var sy=r("13609");let sZ=({dataSource:e})=>(0,y.jsx)(sy.Z,{dataSource:e,rowKey:e=>`${e.tapName}_${e.hook}`,columns:[{title:"Plugin Tap Name",render:(e,t)=>t.tapName},{title:"Hook",render:(e,t)=>t.hook},{title:"calls",render:(e,t)=>(0,y.jsx)(rx.Z,{title:`"${t.hook}" has been called ${t.data.length} times by "${t.tapName}"`,children:t.data.length}),sorter:(e,t)=>e.data.length-t.data.length},{title:"duration(total)",render:(e,t)=>t3((0,ru.Z)(t.data,e=>e.costs)),sorter:(e,t)=>(0,ru.Z)(e.data,e=>e.costs)-(0,ru.Z)(t.data,e=>e.costs),defaultSortOrder:"descend"}]}),sb=({summary:e})=>{let{costs:t=[]}=e||{},r=t.find(e=>e.name===K.Done),n='of the "AfterCompile -> Done" stage';return r?(0,y.jsx)(rk,{drawerProps:{title:`Details ${n}`},text:(0,y.jsxs)(B.Z,{children:["detail",(0,y.jsx)(nP.Z,{})]}),children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetPluginData,body:{hooks:["afterCompile","shouldEmit","emit","afterEmit","assetEmitted","done"]},children:e=>e&&e.length?(0,y.jsxs)(B.Z,{direction:"vertical",style:{width:"100%"},children:[(0,y.jsx)(nr,{title:`Plugin DataSource of ${n}`,collapsable:!0,children:(0,y.jsx)(sZ,{dataSource:e})}),(0,y.jsx)(ro.Z,{}),(0,y.jsx)(nr,{title:`Chart ${n}`,children:(0,y.jsx)(sf,{plugins:e})})]}):(0,y.jsx)(sg,{})})}):null},sv=({summary:e})=>{let{costs:t=[]}=e||{};return t.find(e=>e.name===K.Minify)?(0,y.jsx)(rk,{drawerProps:{title:'Details of the "Minify" stage'},text:(0,y.jsxs)(B.Z,{children:["detail",(0,y.jsx)(nP.Z,{})]}),children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetPluginData,body:{hooks:["processAssets","optimizeChunkAssets"]},children:e=>e&&e.length?(0,y.jsxs)(B.Z,{direction:"vertical",style:{width:"100%"},children:[(0,y.jsx)(nr,{title:'Plugin DataSource of the "Minify"',collapsable:!0,children:(0,y.jsx)(sZ,{dataSource:e})}),(0,y.jsx)(ro.Z,{}),(0,y.jsx)(nr,{title:'Chart of the "Minify"',children:(0,y.jsx)(sf,{plugins:e})})]}):(0,y.jsx)(sg,{})})}):null};var sS={progress:"progress_61324"};let sM=({children:e,name:t,showDivider:r=!0})=>(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:[(0,y.jsx)(L.Z.Text,{style:{color:"inherit"},children:t}),r?(0,y.jsx)(ro.Z,{type:"vertical"}):null,e]}),sC=e=>e<33.3?{"0%":"#95de64","100%":"#5cdbd3"}:{"0%":"#ff9c6e","100%":"#ff7875"},sw=({summary:e})=>{let{t}=tg();if(!e?.costs?.length)return null;let r=Math.max(...e.costs.map(e=>e.costs));return(0,y.jsx)(nr,{title:t("Compile Overall"),className:nK.card,children:(0,y.jsx)(B.Z,{style:{wordBreak:"break-all",width:"100%"},size:20,direction:"vertical",children:e.costs.map(t=>{let{name:n,costs:s}=t,i=100*s/r,l=(0,y.jsx)(n9.Z,{className:sS.progress,percent:i,status:"normal",strokeColor:sC(i),format:()=>t3(s)});switch(n){case K.Bootstrap:return(0,y.jsxs)(sM,{name:"Bootstrap ~ BeforeCompile",children:[(0,y.jsx)(sj,{summary:e}),l]},n);case K.Compile:return(0,y.jsx)(sM,{name:"Compile",showDivider:!1,children:l},n);case K.Done:return(0,y.jsxs)(sM,{name:"AfterCompile ~ Done",children:[(0,y.jsx)(sb,{summary:e}),l]},n);case K.Minify:return(0,y.jsxs)(sM,{name:"Minify",children:[(0,y.jsx)(sv,{summary:e}),l]},n);default:return null}})})})};var sP=r("4775"),sI=r("15778"),sk=r("99369"),sD=r.n(sk);let sT=rC({Component:({defaultKeys:e,configs:t})=>{let r=function(e=[]){return(0,tu.Z)(e)?e.find(e=>"webpack"===e.name||"rspack"===e.name):null}(t||[]);if(!r)return null;let{config:n,version:s,name:i}=r,l=Object.keys(n),[a,o]=(0,W.useState)(e||l);return(0,y.jsx)(rk,{text:"View Bundler Config",children:(0,y.jsxs)(rt.Z,{children:[(0,y.jsx)(rT,{text:"Bundler Config Viewer"}),(0,y.jsx)(ro.Z,{}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:"Properties: "}),(0,y.jsx)(nC.Z,{dropdownStyle:{zIndex:999},mode:"multiple",allowClear:!0,value:a.length===l.length?[]:a,style:{width:350},dropdownMatchSelectWidth:!0,placeholder:"Show Selected Properties Only.",onChange:e=>{o(e)},children:l.map(e=>(0,y.jsx)(nC.Z.Option,{label:e,value:e,children:e},e))})]}),(0,y.jsx)(ro.Z,{}),(0,y.jsx)(sD(),{name:s&&"unknown"!==s?`${i}@${s}`:"webpack.config",theme:"monokai",src:0===a.length?n:(0,sI.Z)(n,a),displayDataTypes:!1,displayObjectSize:!1})]})})},api:F.SDK.ServerAPI.API.LoadDataByKey,responsePropName:"configs",body:{key:"configs"},showSkeleton:!1}),sA=({configs:e=[],cwd:t,envinfo:r,alerts:n=[]})=>{let{t:s}=tg(),i=(0,sP.Z)(n,e=>"warn"===e.level).length,l=n.length-i,a=[...Object.keys(r).map(e=>{let t=/Version$/,n=t.test(e);return{key:e,label:n?e.replace(t,""):e,children:r?r[e]:void 0}}),...e.filter(e=>!!e.version).map(e=>{let{name:t,version:r}=e;return{key:t,label:t,children:r}}),{key:"cwd",label:"cwd",children:t}];return(0,y.jsxs)(nr,{title:s("Project Overall"),extra:(0,y.jsx)(sT,{}),className:nK.card,children:[(0,y.jsxs)(rt.Z,{gutter:16,children:[(0,y.jsx)(rr.Z,{span:12,className:n1,children:(0,y.jsx)(rk,{button:(0,y.jsx)(n2,{theme:0===l?"success":"error",number:l,description:"Errors"}),drawerProps:{title:"Errors List"},children:(0,y.jsxs)(B.Z,{direction:"vertical",style:{width:"100%"},children:[(0,y.jsx)(nZ,{defaultOpen:!1}),(0,y.jsx)(no,{filter:e=>"error"===e.level}),(0,y.jsx)(nd,{filter:e=>"error"===e.level})]})})}),(0,y.jsx)(rr.Z,{span:12,className:n1,children:(0,y.jsx)(rk,{button:(0,y.jsx)(n2,{theme:0===i?"success":"warning",number:i,description:"Warnings"}),drawerProps:{title:"Warnings List"},children:(0,y.jsxs)(B.Z,{direction:"vertical",style:{width:"100%"},children:[(0,y.jsx)(nZ,{defaultOpen:!1}),(0,y.jsx)(no,{filter:e=>"warn"===e.level}),(0,y.jsx)(nd,{filter:e=>"warn"===e.level})]})})})]}),(0,y.jsx)(nz.Z,{className:nW,items:a,size:"small",column:1})]})},sE=({children:e})=>{let{sm:t,xxl:r}=ra.ZP.useBreakpoint(),n=(0,W.useMemo)(()=>r?[2*I.BasePadding,I.BasePadding]:[I.BasePadding,I.BasePadding],[t,r]);return(0,y.jsx)(rt.Z,{gutter:n,wrap:!0,style:{marginBottom:I.BasePadding},children:e.map((e,t)=>(0,y.jsx)(rr.Z,{xs:24,sm:24,md:12,lg:8,children:e},t))})},sN=rC({api:F.SDK.ServerAPI.API.GetProjectInfo,responsePropName:"project",Component:({project:e})=>{let{summary:t,configs:r,root:n,envinfo:s,errors:i}=e;return(0,y.jsxs)("div",{children:[(0,y.jsxs)(sE,{children:[(0,y.jsx)(sA,{configs:r,cwd:n,envinfo:s,alerts:i}),(0,y.jsx)(n5,{errors:i,cwd:n}),(0,y.jsx)(sw,{summary:t})]}),(0,y.jsx)(nd,{}),(0,y.jsx)(no,{})]})}});var s_=r("80101"),sz=r("91015"),sR=r("76729"),sO=r("62035");let sB=({icon:e,label:t,labelStyle:r={},placeholder:n,onChange:s,style:i,className:l,width:a,delay:o=300})=>{let d;let[c,u]=(0,W.useState)(""),h={width:120,...r},p=(0,W.useRef)(null);return(0,W.useEffect)(()=>{s(c)},[c]),(0,y.jsxs)(sO.Z.Group,{compact:!0,style:i,className:l,children:[t||e?(0,y.jsxs)($.ZP,{style:h,onClick:()=>{p&&p.current&&p.current.focus()},children:[e||null,(0,y.jsx)(L.Z.Text,{children:t})]}):null,(0,y.jsx)(sO.Z,{ref:p,allowClear:!0,defaultValue:c,style:{width:a?a-120:250},placeholder:n,onChange:e=>{clearTimeout(d);let t=e.target.value.trim();setTimeout(()=>{u(t)},o)}})]})},sL=({text:e,keyword:t,...r})=>{if(!t||-1===e.indexOf(t))return(0,y.jsx)(L.Z.Text,{...r,children:e});let n=[],s=e;for(;s.length>0;){let e=s.indexOf(t);if(e>-1)0!==e&&n.push((0,y.jsx)(L.Z.Text,{style:{fontSize:"inherit"},children:s.slice(0,e)},n.length)),n.push((0,y.jsx)(L.Z.Text,{mark:!0,style:{fontSize:"inherit"},children:t},n.length)),s=s.slice(e+t.length);else{n.push((0,y.jsx)(L.Z.Text,{style:{fontSize:"inherit"},children:s},n.length));break}}return(0,y.jsx)(L.Z.Text,{...r,children:n})},{useToken:s$}=nR.Z,sG=({files:e,total:t,showProgress:r=!1,tagBgColor:n})=>{let{token:s}=s$(),i=(0,W.useMemo)(()=>(0,ru.Z)(e,e=>e.size),[e]),l=(0,W.useMemo)(()=>to({files:e.map(e=>e.path),fileTitle(t,r){let{size:n}=e.find(e=>e.path===t);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:r}),(0,y.jsx)(rc.Z,{color:"success",children:t0(n)})]})}}),[e]);return 0===l.length?(0,y.jsx)(B.Z,{style:{height:100,fontSize:24},align:"center",children:(0,y.jsx)(rc.Z,{bordered:!1,color:n,children:(0,y.jsxs)(L.Z.Text,{style:{fontSize:14,color:s.colorWhite},children:[(0,y.jsxs)(L.Z.Text,{style:{color:s.colorWhite},children:[" ",0]})," Files"]})})}):(0,y.jsxs)(B.Z,{style:{height:100},align:"center",children:[r?0===i?(0,y.jsx)(rl.Z,{}):(0,y.jsx)(n9.Z,{type:"dashboard",percent:+(i/t*100).toFixed(2),strokeColor:{"0%":"#108ee9","100%":"#87d068"},width:80}):null,(0,y.jsx)(rk,{text:(0,y.jsx)(rx.Z,{title:"Click to show the total files",children:(0,y.jsxs)(B.Z,{style:{textAlign:r?"left":"center"},align:"end",children:[(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsx)(rc.Z,{bordered:!1,color:n,children:(0,y.jsxs)(L.Z.Text,{style:{fontSize:14,color:s.colorWhite},children:[(0,y.jsxs)(L.Z.Text,{style:{color:s.colorWhite},children:[" ",e.length]})," Files"]})}),(0,y.jsx)(L.Z.Text,{style:{fontSize:20},children:t0(i)})]}),(0,y.jsx)(rm.Z,{style:{transform:"translateY(-3.5px)"}})]})}),buttonStyle:{height:"100%"},buttonProps:{type:"text"},children:(0,y.jsx)(nF,{treeData:l,defaultExpandAll:!0,titleRender:e=>(0,y.jsx)(L.Z.Text,{children:e.title})})})]})},{useToken:sF}=nR.Z,sW=({showProgress:e=!1,data:t,total:r,tagBgColor:n})=>{let{token:s}=sF(),i=n||s.colorPrimaryBorderHover;return(0,y.jsx)(sG,{files:t.files,total:r,showProgress:e,tagBgColor:i})},sK=({titles:e,datas:t,bgColor:r})=>{let[n,s]=(0,W.useState)(0);return(0,y.jsx)(r6,{title:e.length>1?(0,y.jsx)(r5.Z,{defaultValue:e[n],options:e,onChange:t=>{s(e.indexOf(t))},size:"small",style:{transition:"transform 0.3s ease"},value:e[n]||e[0]}):e[n],value:t.map((e,t)=>(0,W.createElement)(sW,{...e,key:t,tagBgColor:r?.tagBgColor}))[n],boxProps:{style:{background:r?.bgColor}}})},sH=({cwd:e,errors:t,summary:r})=>{let n=function(){let[e,t]=(0,W.useState)(window.innerWidth);return(0,W.useEffect)(()=>{let e=()=>t(window.innerWidth);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),e}(),s=tS(t),i=[(0,y.jsx)(sK,{titles:["Total Files"],datas:[{data:r.all.total,total:r.all.total.size,showProgress:!0}]}),(0,y.jsx)(sK,{titles:["Total JS","Initial JS"],datas:[{data:r.js.total,total:r.all.total.size,showProgress:!0},{data:r.js.initial,total:r.all.total.size,showProgress:!0}]}),(0,y.jsx)(sK,{titles:["Total CSS","Initial CSS"],datas:[{data:r.css.total,total:r.all.total.size,showProgress:!0},{data:r.css.initial,total:r.all.total.size,showProgress:!0}]}),(0,y.jsx)(sK,{titles:["Images","Fonts","Media"],datas:[{data:r.imgs.total,total:r.all.total.size,showProgress:!0},{data:r.fonts.total,total:r.all.total.size,showProgress:!0},{data:r.media.total,total:r.all.total.size,showProgress:!0}]}),(0,y.jsx)(sK,{titles:["HTML Files"],datas:[{data:r.html.total,total:r.all.total.size,showProgress:!0}]}),(0,y.jsx)(r6,{title:"Duplicate Packages",value:(0,y.jsx)(rI,{buttonStyle:{height:100},duplicatePackages:s,cwd:e})})];return(0,y.jsx)(rt.Z,{gutter:n>1200&&n<1400?[2*I.BasePadding,I.BasePadding]:[I.BasePadding,I.BasePadding],wrap:!0,style:{marginBottom:I.BasePadding},children:i.map((e,t)=>(0,y.jsx)(rr.Z,{span:n>1500?4:8,children:e},t))})};var sU=r("47241"),sY=r("12228");let sV=(0,W.createContext)({setModuleJumpList(e){},moduleJumpList:[]});var sJ=r("1944"),sq=r("93471"),sQ=r("59453"),sX=r("13326"),s0=r("69358"),s1=r("34270"),s2=r("86938");let s4=[{title:"Chunk Name",dataIndex:"name",key:"name"},{title:"size | 大小",dataIndex:"size",key:"size"},{title:"assets | 资源",dataIndex:"assets",key:"assets"},{title:"Entry or Not | 是否是入口",dataIndex:"entry",key:"entry"}],s3=({chunks:e})=>{let t=(0,W.useMemo)(()=>{let t=e.map(e=>{if(e)return{key:e.id,name:(0,y.jsx)(rc.Z,{children:e.name}),size:(0,y.jsx)(rc.Z,{children:t0(e.parsedSize)}),entry:(0,y.jsx)(rc.Z,{children:e.entry?"是 | Yes":"否 | No"}),assets:e.assets.map(e=>(0,y.jsx)("p",{children:(0,y.jsx)(rc.Z,{children:e},e)},e))}});return(0,s1.Z)((0,s2.Z)(t),["size"],["desc"])},[e]);return(0,y.jsx)(y.Fragment,{children:t?.length?(0,y.jsx)(sy.Z,{bordered:!0,pagination:!1,dataSource:t,columns:s4}):(0,y.jsx)(rl.Z,{})})};var s5=r("52795"),s9=r("29021"),s6=r("38958");let s8="file-tree-com",s7=e=>{let{treeData:t,needJumpto:r=!1,defaultOpened:n=!1,defaultOpenFather:s=0}=e,{required:i,handlers:l}=(0,s6.Du)({id:`${s8}-tree`,data:t||[],defaultOpened:n,multipleSelect:!1,refreshAsyncNodes:!0}),a=(0,W.useCallback)(({node:e,onToggle:t})=>(s&&e.data.level<s&&e.setOpened(!0),(0,y.jsx)("div",{className:`${s8}-titles-box`,children:(0,y.jsx)("div",{className:`${s8}-titles`,children:(0,y.jsx)(B.Z,{direction:"vertical",children:(0,y.jsx)("div",{className:`${s8}-node-title`,children:(0,y.jsxs)(B.Z,{children:[(0,y.jsxs)("div",{onClick:t,children:[!e.options.opened&&e.data.children?.length?(0,y.jsx)(s5.Z,{style:{color:"lightblue"}}):(0,y.jsx)(s9.Z,{style:{color:"lightblue"}}),(0,y.jsxs)(L.Z.Text,{code:!0,children:[e.data.name,(0,y.jsx)(rs.Z,{content:(0,y.jsx)(y.Fragment,{children:e.data.__RESOURCEPATH__?(0,y.jsx)(L.Z.Text,{code:!0,children:e.data.__RESOURCEPATH__},`${e.data.name}-popover-path`):(0,y.jsx)(y.Fragment,{})}),title:"INFO",trigger:"hover",children:(0,y.jsx)(G.Z,{style:{marginLeft:4}})},`${e.data.name}popover`)]})]}),(0,y.jsxs)(B.Z,{children:[e.data.concatModules?.length?(0,y.jsx)(rs.Z,{content:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetModulesByModuleIds,body:{moduleIds:e.data.concatModules||[]},children:e=>(0,y.jsx)("div",{children:e.map(({path:e},t)=>(0,y.jsx)("p",{children:e},`${e}-${t}`))})}),title:"Concatenated Module Name",trigger:"hover",children:(0,y.jsx)(rc.Z,{className:`${s8}-node-title-tag`,color:T.DARK_BLUE,children:"Concatenated"},`${e.data.name}-size-tag`)}):e.data.size&&"0 bytes"!==e.data.size?(0,y.jsx)(rc.Z,{className:`${s8}-node-title-tag`,color:T.COLOR_B,children:`Bundled: ${e.data.size}`},`${e.data.name}-size-tag`):(0,y.jsx)(y.Fragment,{}),r&&(0,y.jsx)(sV.Consumer,{children:({moduleJumpList:t,setModuleJumpList:r})=>(0,y.jsx)(sq.Z,{onClick:()=>{let n=[...t];n.push(+e.id),r(n)}})})]})]})})})})},e.data.name)),[]);return(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(s6.ZP,{...i,...l,horizontalLineStyles:{stroke:"#c4c4c4",strokeWidth:2,strokeDasharray:"1 1"},verticalLineStyles:{stroke:"#c4c4c4",strokeWidth:2,strokeDasharray:"1 1"},draggable:!1,depthGap:14,gapMode:"padding",disableLines:!1,disableTransitions:!0,disableHorizontalLines:!1,disableVerticalLines:!1,verticalLineTopOffset:0,verticalLineOffset:5,renderNode:a})})};F.Client.RsdoctorClientRoutes.ModuleAnalyze;let ie="module-analyze";var it=r("95698"),ir=(0,W.memo)(({dependencies:e,cwd:t,module:r})=>{let n=(0,W.useMemo)(()=>{let t=r.dependencies.map(t=>{let r=(0,it.Z)(e,e=>e.id===t);if(r)return{__RESOURCEPATH__:r.resolvedRequest||"",id:r.dependency,key:r.resolvedRequest,name:e4(r.resolvedRequest)||"",level:1,kind:r.kind,concatModules:void 0}});return(0,s2.Z)(t)},[r]);return(0,y.jsx)(rt.Z,{justify:"start",align:"middle",children:(0,y.jsx)(rr.Z,{span:24,children:n.length?(0,y.jsx)(s7,{treeData:n,needJumpto:!0,cwd:t}):(0,y.jsx)(rl.Z,{})})})});let is=(e,t)=>{if(e?.imported?.length){let r=e.imported.map(e=>(0,it.Z)(t,t=>t.id===Number(e)));return(0,s2.Z)(r)}return[]},ii=(e,t,r,n)=>{if(n.has(e.id)){if(n.get(e.id))return}else n.set(e.id,!0);let s=is(e,t);if(!!s.length)s.forEach(e=>{e?.chunks?.forEach(e=>{0>r.indexOf(e)&&r.push(e)}),ii(e,t,r,n)})},il=e=>{var t,r,n;let{curModule:s,modules:i,dependencies:l,cwd:a,selectedChunk:o=""}=e,{t:d}=tg(),[c,u]=(0,W.useState)([]),[h,p]=(0,W.useState)(0),[x,m]=(0,W.useState)(!0);let{data:f}=(t=i,r=c,n=s,(0,W.useMemo)(()=>r&&r?.length?{data:(0,s2.Z)(r?.map((e,r)=>({key:`0-${r}`,name:e4(e.path),__RESOURCEPATH__:e.path,id:e.id,level:1,chunks:e.chunks,size:t0(e.size.parsedSize),kind:e.kind,concatModules:e.concatenationModules,fatherPath:e4(n.path),dependencies:e.dependencies,getChildren:()=>(function e(t,r,n){let s=is(t,r);return s?.map((s,i)=>({key:`0-${i}`,name:e4(s.path),__RESOURCEPATH__:s.path,id:s.id,level:1,size:t0(s.size.parsedSize),kind:s.kind,chunks:s.chunks,concatModules:s.concatenationModules,fatherPath:e4(n.path),dependencies:s.dependencies,getChildren:()=>e(s,r,t),children:s.imported}))})(e,t,n),children:e.imported})))}:{filterData:[],data:[]},[r,n])),[g,j]=(0,W.useState)({});return(0,W.useEffect)(()=>{u(is(s,i))},[s,i]),(0,W.useEffect)(()=>{let e={};c.forEach(t=>{let r=[];ii(t,i,r,new Map),e[t.id]=r}),j(e)},[c]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(rt.Z,{children:(0,y.jsx)(rs.Z,{content:(0,y.jsxs)("div",{children:[(0,y.jsxs)("div",{children:[(0,y.jsx)(s0.Z,{status:"success",text:" "}),(0,y.jsxs)(L.Z.Text,{code:!0,children:[(0,y.jsx)(sJ.Z,{})," Expand the node_modules's modules that was omitted... "]})," ",(0,y.jsx)(L.Z.Text,{children:`: ${d("Expand Omitted")}`})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)(s0.Z,{status:"success",text:" "}),(0,y.jsx)(rs.Z,{content:"*",title:"Concatenated Module Name",trigger:"hover",children:(0,y.jsx)(rc.Z,{color:T.DARK_BLUE,children:"Concatenated"})}),(0,y.jsx)(L.Z.Text,{children:`: ${d("Concatenated Tag")}`})]}),(0,y.jsxs)("div",{children:[(0,y.jsx)(s0.Z,{status:"success",text:" "}),(0,y.jsx)(sq.Z,{}),(0,y.jsx)(L.Z.Text,{children:": Jump button, click to jump to the Module dependency analysis page of this module."})]})]}),title:"Usage",children:(0,y.jsx)($.ZP,{type:"primary",icon:(0,y.jsx)(G.Z,{}),children:"Usage"})})}),(0,y.jsxs)(rt.Z,{gutter:4,style:{marginTop:I.BasePadding},children:[(0,y.jsx)(rr.Z,{span:x?18:12,children:(0,y.jsx)(rt.Z,{className:`${ie}-file-tree`,justify:"center",children:(0,y.jsxs)(rr.Z,{span:24,style:{padding:I.BasePadding/2},children:[(0,y.jsx)(rT,{text:"Current Module Imported Reasons Tree:"}),c?(0,y.jsx)(s7,{cwd:a,treeData:o?f.filter(e=>g[e.id].indexOf(o)>=0):f,needCode:!0,needShowAllTree:!0,needJumpto:!0,selectedChunk:o}):(0,y.jsx)(rl.Z,{className:`${ie}-empty`})]})})}),(0,y.jsx)(rr.Z,{span:x?6:12,children:(0,y.jsxs)("div",{className:`${ie}-file-tree`,style:{padding:I.BasePadding/2},children:[x?(0,y.jsx)(rs.Z,{content:"Unfold [Dependencies & Chunks] Box.",children:(0,y.jsx)(sQ.Z,{onClick:()=>m(!x),style:{marginRight:8}})}):(0,y.jsx)(rs.Z,{content:"Fold [Dependencies & Chunks] Box.",children:(0,y.jsx)(sX.Z,{onClick:()=>m(!x),style:{marginRight:8}})}),(0,y.jsx)(rX.ZP.Group,{options:[{label:"Dependencies",value:0},{label:"Chunks",value:1}],onChange:e=>p(e.target.value),value:h,optionType:"button",buttonStyle:"solid",size:"middle"}),x?(0,y.jsx)(y.Fragment,{}):(0,y.jsxs)(y.Fragment,{children:[0===h&&(0,y.jsx)(rr.Z,{span:24,style:{marginTop:I.BasePadding/2},children:s?(0,y.jsx)(ir,{module:s,dependencies:l,cwd:a}):(0,y.jsx)(rl.Z,{className:`${ie}-empty`})}),1===h&&(0,y.jsx)(rr.Z,{span:18,style:{marginTop:I.BasePadding/2},children:s?(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetChunksByModuleId,body:{moduleId:s.id},children:e=>(0,y.jsx)(s3,{chunks:e})}):(0,y.jsx)(rl.Z,{className:`${ie}-empty`})})]})]})})]})]})},ia=({modules:e,cwd:t,moduleId:r})=>{let[n,s]=(0,W.useState)("");return(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetModuleDetails,body:{moduleId:+r},children:({module:r,dependencies:i})=>(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetAllChunkGraph,body:{},children:l=>(0,y.jsx)(sV.Consumer,{children:({moduleJumpList:a,setModuleJumpList:o})=>(0,y.jsxs)(rn.Z,{title:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(sY.Z,{onClick:()=>{o([...a.slice(0,-1)])}}),(0,y.jsx)(L.Z.Title,{code:!0,level:5,style:{marginBottom:"revert"},children:`Current Module: ${e4(r.path)}`})]}),style:{height:"100%"},children:[(0,y.jsx)(rt.Z,{justify:"start",style:{marginBottom:20},children:(0,y.jsx)(rr.Z,{children:(0,y.jsx)(nC.Z,{allowClear:!0,placeholder:"Select Chunk To Filter Modules Links",showSearch:!0,style:{width:300},options:(0,rS.Z)(l).map(e=>({label:e.name,value:e.id})),onChange:e=>s(e)})})}),(0,y.jsx)(rt.Z,{justify:"start",align:"middle",children:(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(il,{curModule:r,modules:e,dependencies:i,cwd:t,selectedChunk:n})})})]})})})})},io=[],id={source:"source code",transformed:"Transformed Code (After compile)",parsedSource:"Bundled Code (After bundle and tree-shaking)"},ic={margin:"none",marginInlineEnd:0},iu=()=>(0,y.jsx)(rl.Z,{description:`Do not have the module code.
|
|
98
|
+
(1) If you use the brief mode, there will not have any codes to show.
|
|
99
|
+
(2) If you use lite mode, there will not have source codes.`}),ih=({data:e})=>{let[t,r]=(0,W.useState)(""),{t:n}=tg(),s={source:"Source Code",transformed:`Transformed Code(${n("After Compile")})`,parsedSource:`Bundled Code(${n("After Bundled")})`};if(!e)return null;let{path:i}=e;return(0,y.jsx)(rk,{text:"",buttonProps:{size:"small",icon:(0,y.jsx)(rs.Z,{content:"Open the Codes Box",children:(0,y.jsx)(rF.Z,{})}),type:"default"},buttonStyle:{padding:"0 4px"},drawerProps:{destroyOnClose:!0,title:`Code of "${i}"`},children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetModuleCodeByModuleId,body:{moduleId:e.id},children:e=>(0,y.jsx)(y.Fragment,{children:e.source||e.parsedSource||e.transformed?(0,y.jsx)(rn.Z,{className:"code-size-card",style:{width:"100%"},tabList:Object.keys((0,sU.Z)(e,e=>!e)).map(e=>({tab:e})).map(e=>({...e,tab:s[e.tab],key:e.tab})),defaultActiveTabKey:e.parsedSource?"parsedSource":"source",onTabChange:e=>r(e),tabBarExtraContent:(0,y.jsx)(rs.Z,{placement:"bottom",title:(0,y.jsx)(L.Z.Title,{level:5,children:"Explain"}),content:(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)("div",{style:{display:"flex",flexDirection:"column",marginBottom:30},children:[(0,y.jsxs)("div",{children:[(0,y.jsx)(L.Z.Text,{strong:!0,children:"Source: "}),(0,y.jsx)(L.Z.Text,{children:id.source})]}),(0,y.jsxs)("div",{children:[(0,y.jsxs)(L.Z.Text,{strong:!0,children:["Transformed:"," "]}),(0,y.jsx)(L.Z.Text,{children:id.transformed})]}),(0,y.jsxs)("div",{children:[(0,y.jsxs)(L.Z.Text,{strong:!0,children:["Bundled Source:"," "]}),(0,y.jsx)(L.Z.Text,{children:id.parsedSource})]}),(0,y.jsx)("br",{}),(0,y.jsx)(L.Z.Text,{strong:!0,children:"More"}),(0,y.jsx)(L.Z.Text,{children:n("CodeModeExplain")})]})}),trigger:"hover",children:(0,y.jsx)("a",{href:"#",children:"Explain"})}),children:e.parsedSource||e.source||e.transformed?(0,y.jsx)(tU.ZP,{theme:"vs-dark",language:tV(i),height:window.innerHeight/1.5,value:t?e[t]:e.parsedSource?e.parsedSource:e.source,options:{readOnly:!0,domReadOnly:!0,fontSize:14,wordWrap:"bounded",minimap:{enabled:!1}}}):(0,y.jsx)(iu,{})}):(0,y.jsx)(iu,{})})})})},ip=({id:e,show:t,setShow:r,cwd:n})=>e?(0,y.jsx)(rp.Z,{open:t,maskClosable:!0,width:D,onClose:()=>r(!1),children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetAllModuleGraph,body:{},children:t=>(0,y.jsx)(ia,{cwd:n,moduleId:e,modules:t})})}):null,ix="__RESOURCEPATH__",im=({modules:e,chunks:t,filteredModules:r})=>{let{sourceSize:n,parsedSize:s,filteredParsedSize:i,filteredSourceSize:l}=(0,W.useMemo)(()=>({sourceSize:(0,ru.Z)(e,e=>e.size.sourceSize),parsedSize:(0,ru.Z)(e,e=>e.size.parsedSize),filteredSourceSize:(0,ru.Z)(r,e=>e.size.sourceSize),filteredParsedSize:(0,ru.Z)(r,e=>e.size.parsedSize)}),[e,r]);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rx.Z,{title:`total modules count is ${e.length}, the filtered modules count is ${r.length}`,children:(0,y.jsxs)(B.Z,{children:[(0,y.jsxs)(L.Z.Text,{type:"secondary",style:{fontSize:12,fontWeight:400},children:["Modules: ",r.length," / ",e.length]}),(0,y.jsx)(G.Z,{})]})}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(rx.Z,{title:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["Total modules bundled size: ",t0(s)]}),(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["Total modules source size: ",t0(n)]}),(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["Filtered modules bundled size: ",t0(i)]}),(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["Filtered modules source size: ",t0(l)]})]}),children:(0,y.jsxs)(B.Z,{children:[(0,y.jsxs)(L.Z.Text,{type:"secondary",style:{fontSize:12,fontWeight:400},children:["Modules Size:"," ",i===s?t0(s):`${t0(i)} / ${t0(s)}`]}),(0,y.jsx)(G.Z,{})]})}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(rx.Z,{title:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["this asset includes ",t.length," chunks:"," "]}),t.map(e=>(0,y.jsx)(rE,{label:"chunk",value:e.name},e.name))]}),children:(0,y.jsxs)(B.Z,{children:[(0,y.jsxs)(L.Z.Text,{type:"secondary",style:{fontSize:12,fontWeight:400},children:["Chunks: ",t.length]}),(0,y.jsx)(G.Z,{})]})})]})},ig=({asset:e,chunks:t,modules:r,moduleSizeLimit:n,height:s,root:i})=>{let[l,a]=(0,W.useState)(""),[o,d]=(0,W.useState)(!1),[c,u]=(0,W.useState)([]),[h,p]=(0,W.useState)(!1),x=(0,W.useMemo)(()=>{let e=r.slice();if(l){let t=RegExp(l,"i");e=e.filter(e=>t.test(e.path))}return n&&(e=e.filter(e=>e.size.parsedSize>=n)),e},[r,l,n]),m=(0,W.useMemo)(()=>to({files:x.map(e=>e.path).filter(Boolean),inlinedResourcePathKey:ix,fileTitle(e,t){let n=x.find(t=>t.path===e);if(!n)return t;let{parsedSize:s=0,sourceSize:i=0}=n.size,a=n.kind===F.SDK.ModuleKind.Concatenation,o=!a&&0===s&&r.filter(e=>e!==n&&e.modules&&e.modules.indexOf(n.id)>-1);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(sL,{ellipsis:!0,style:{maxWidth:500},text:t,keyword:l}),0!==s?(0,y.jsx)(rx.Z,{title:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsx)(rc.Z,{color:"orange",children:"Bundled Size:"+t0(s)}),(0,y.jsx)(rc.Z,{color:"volcano",children:"Source Size:"+t0(i)})]}),color:"white",children:(0,y.jsx)(rc.Z,{color:"purple",style:ic,children:"Bundled: "+t0(s)})}):0!==i?(0,y.jsx)(rc.Z,{color:"geekblue",children:"Source Size:"+t0(i)}):null,a?(0,y.jsx)(rx.Z,{title:(0,y.jsx)(B.Z,{children:(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["this is a concatenated module, it contains"," ",n.modules?.length," modules"]})}),children:(0,y.jsx)(rc.Z,{color:"green",style:ic,children:"concatenated"})}):null,o&&o.length?(0,y.jsx)(rx.Z,{title:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsx)(L.Z.Text,{style:{color:"inherit"},children:"this is a concatenated module, it is be contained in these modules below:"}),o.map(({id:e,path:t})=>{if(e2(t))return(0,y.jsx)(L.Z.Paragraph,{ellipsis:{rows:4},style:{color:"inherit",maxWidth:"100%"},code:!0,children:t},e);let r=(0,J.relative)((0,J.dirname)(n.path),t);return r.startsWith("javascript;charset=utf-8;base64,")?(0,y.jsx)(L.Z.Text,{style:{color:"inherit",maxWidth:"100%"},code:!0,children:"."===r[0]?r:`./${r}`},e):(0,y.jsx)(L.Z.Text,{style:{color:"inherit"},code:!0,children:"."===r[0]?r:`./${r}`},e)})]}),children:(0,y.jsx)(rc.Z,{color:"green",children:"concatenated"})}):null,(0,y.jsx)(rs.Z,{content:"Open the Module Graph Box",children:(0,y.jsx)($.ZP,{size:"small",icon:(0,y.jsx)(s_.Z,{}),onClick:()=>{u([n.id]),p(!0)}})}),(0,y.jsx)(ih,{data:n})]})},dirTitle(e,t){let n=function e(t){let r=[];return t.children&&t.children.forEach(t=>{t.isLeaf?r.push(t[ix]):e(t)}),r}(e);if(n.length){let e=n.map(e=>r.find(t=>t.path===e)),s=(0,ru.Z)(e,e=>e.size?.parsedSize||0),i=(0,ru.Z)(e,e=>e.size?.sourceSize||0);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:t}),s>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(rc.Z,{style:ic,color:"orange",children:"Bundled:"+t0(s)}),(0,y.jsx)(rc.Z,{style:ic,color:"lime",children:"Source:"+t0(i)})]}):(0,y.jsx)(rc.Z,{style:ic,color:"lime",children:"Source:"+t0(i)})]})}return t}}),[x]);return(0,W.useEffect)(()=>{a(""),d(!1)},[e]),(0,W.useEffect)(()=>{d(!1)},[l]),(0,y.jsx)(sV.Provider,{value:{moduleJumpList:c,setModuleJumpList:u},children:(0,y.jsxs)(rn.Z,{title:`Modules of "${e.path}"`,bodyStyle:{overflow:"scroll",height:s},size:"small",children:[r.length?(0,y.jsxs)(rt.Z,{children:[(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(im,{modules:r,chunks:t,filteredModules:x})}),(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(sB,{placeholder:"search module by keyword",onChange:e=>a(e)},e.path),(0,y.jsx)($.ZP,{onClick:()=>d(!0),size:"small",icon:(0,y.jsx)(r4.Z,{}),children:"expand all"})]})}),(0,y.jsx)(rr.Z,{span:24,style:{marginTop:I.BasePadding},children:x.length?(0,y.jsx)(nF,{onExpand:e=>{io=e},treeData:m,autoExpandParent:!0,defaultExpandParent:!0,defaultExpandedKeys:io?.length?io:1===m.length?[m[0].key]:[],defaultExpandAll:o||x.length<=20},`tree_${l}_${o}_${e.path}`):(0,y.jsx)(rl.Z,{description:(0,y.jsx)(L.Z.Text,{strong:!0,children:`"${l}" can't match any modules`})})})]}):(0,y.jsx)(rl.Z,{description:(0,y.jsx)(L.Z.Text,{strong:!0,children:`"${e.path}" doesn't have any modules`})}),(0,y.jsx)(ip,{id:c?.length?c[c.length-1]:"",show:h,setShow:p,cwd:i})]})})},{Option:ij}=nC.Z,iy=({errors:e,cwd:t,summary:r,entryPoints:n})=>{let[s,i]=(0,W.useState)([]),[l,a]=(0,W.useState)(0),[o,d]=(0,W.useState)(""),[c,u]=(0,W.useState)(0),[h,p]=(0,W.useState)(!1),[x,m]=(0,W.useState)(""),[f,g]=(0,W.useState)(""),[j,Z]=(0,W.useState)(null),[b,v]=(0,W.useState)(!1),[S,M]=(0,W.useState)("tree"),{t:C}=tg(),w=r.all.total.files,P=(0,W.useCallback)(e=>t=>{"module"===e?m(t):"chunk"===e&&g(t)},[]),k=e=>(0,y.jsxs)(nC.Z,{defaultValue:"kb",onChange:P(e),children:[(0,y.jsx)(ij,{value:"kb",children:"KB"}),(0,y.jsx)(ij,{value:"mb",children:"MB"})]}),D=(0,W.useCallback)((0,sR.Z)(e=>{a("mb"===x?1048576*e:1024*e)},300),[]),T=(0,W.useCallback)((0,sR.Z)(e=>{u("mb"===f?1048576*e:1024*e)},300),[]),A=(0,W.useMemo)(()=>{let e=w.slice();return o&&(e=e.filter(e=>e.path.indexOf(o)>-1)),c>0&&(e=e.filter(e=>e.size>=c)),s.length&&(e=e.filter(e=>!!s.some(t=>(0,tX.Z)(t.assets,e.path))||!1)),e.sort((e,t)=>{let r=e.path.indexOf("/")>-1?1:0;return(t.path.indexOf("/")>-1?1:0)-r})},[w,s,o,c]),E=(0,W.useMemo)(()=>to({files:A.map(e=>e.path).filter(Boolean),fileTitle(e,t){let{size:r,initial:n,path:s,content:i}=A.find(t=>t.path===e);return(0,y.jsxs)(B.Z,{onClick:()=>{Z(s)},children:[(0,y.jsx)(sL,{text:t,keyword:o}),(0,y.jsx)(rc.Z,{color:"success",style:{margin:0},children:t0(r)}),n?(0,y.jsx)(rc.Z,{color:"cyan",style:{margin:0},children:"initial"}):null,(0,y.jsx)(rH,{path:s,content:i,editorConfig:{readOnly:!1,domReadOnly:!1},emptyReason:"Do not have the codes of assets. If you use the lite or brief mode, there will have codes."})]})}}),[A]);return(0,y.jsxs)(W.Fragment,{children:[(0,y.jsx)(sH,{cwd:t,errors:e,summary:r}),(0,y.jsxs)(rX.ZP.Group,{value:S,onChange:e=>M(e.target.value),style:{marginBottom:I.BasePadding},buttonStyle:"solid",optionType:"button",children:[(0,y.jsx)(rX.ZP.Button,{value:"tree",children:"Tree Graph"}),(0,y.jsx)(rX.ZP.Button,{value:"tile",children:"Bundle Analyzer Graph"})]}),(0,y.jsx)(rn.Z,{hidden:"tree"===S,title:(0,y.jsx)(B.Z,{children:(0,y.jsx)(rT,{text:"From: Webpack Bundle Analyzer"})}),children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetTileReportHtml,body:{},children:e=>e&&"tile"===S?(0,y.jsx)("iframe",{srcDoc:e,width:"100%",height:800,style:{border:"none"}}):(0,y.jsx)(rl.Z,{description:(0,y.jsxs)("div",{children:["Tile graph is disabled,"," ",(0,y.jsx)("a",{href:"https://rsdoctor.dev/config/options/options#generatetilegraph",children:"see the documentation to learn how to enable."})]})})})}),(0,y.jsx)(rn.Z,{hidden:"tile"===S,title:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rT,{text:"Bundle Analysis"}),(0,y.jsx)(rx.Z,{color:"white",title:(0,y.jsxs)(B.Z,{direction:"vertical",color:"white",children:[(0,y.jsx)(rt.Z,{children:(0,y.jsxs)(rr.Z,{children:[(0,y.jsx)(rc.Z,{color:"cyan",style:{margin:0},children:"initial"}),(0,y.jsx)(L.Z.Text,{children:": Indignify whether the chunk is the initial chunk."})]})}),(0,y.jsx)(rt.Z,{children:(0,y.jsxs)(rr.Z,{children:[(0,y.jsx)(rc.Z,{color:"green",children:"concatenated"}),(0,y.jsxs)(L.Z.Text,{children:[": Indignify whether the module is the concatenated module."," "]}),(0,y.jsx)("br",{}),(0,y.jsx)(L.Z.Text,{strong:!0,children:"Concatenated Module:"}),(0,y.jsxs)(L.Z.Text,{children:["A series module is to lift or series multiple modules into a closure when packaging."," "]})]})}),(0,y.jsx)(rt.Z,{children:(0,y.jsxs)(rr.Z,{children:[(0,y.jsx)($.ZP,{size:"small",icon:(0,y.jsx)(rF.Z,{})}),(0,y.jsx)(L.Z.Text,{children:": Open the code."})]})}),(0,y.jsx)(rt.Z,{children:(0,y.jsxs)(rr.Z,{children:[(0,y.jsx)($.ZP,{size:"small",icon:(0,y.jsx)(s_.Z,{})}),(0,y.jsx)(L.Z.Text,{children:": View the module dependency, that is, module reasons in stats.json."})]})}),(0,y.jsx)(rt.Z,{children:(0,y.jsxs)(rr.Z,{children:[(0,y.jsx)(rc.Z,{color:"purple",children:"Bundled: 15.77 KB"}),(0,y.jsx)(L.Z.Text,{strong:!0,children:"Bundled Size"}),(0,y.jsx)(L.Z.Text,{children:"The size of the code which bundled. That is, after bundle and tree-shaking."})]})}),(0,y.jsx)(rt.Z,{children:(0,y.jsxs)(rr.Z,{children:[(0,y.jsx)(rc.Z,{color:"orange",children:"Source: 15.77 KB"}),(0,y.jsx)(L.Z.Text,{strong:!0,children:"Source Size"}),(0,y.jsx)(L.Z.Text,{children:"The size of the code which before bundle and transform."})]})})]}),style:{marginLeft:3},children:(0,y.jsx)(G.Z,{style:{color:"rgba(0,0,0,.45)"}})})]}),extra:b?(0,y.jsx)($.ZP,{onClick:()=>v(!1),children:(0,y.jsxs)(L.Z.Text,{children:["Expand ",(0,y.jsx)(r4.Z,{})]})}):(0,y.jsx)($.ZP,{onClick:()=>v(!0),children:(0,y.jsxs)(L.Z.Text,{children:["Fold",(0,y.jsx)(r3.Z,{})]})}),children:(0,y.jsxs)(rt.Z,{align:"middle",gutter:[I.BasePadding,I.BasePadding],children:[n&&n.length?(0,y.jsx)(rr.Z,{children:(0,y.jsx)(nC.Z,{mode:"multiple",value:s.map(e=>e.name),style:{minWidth:230,width:"auto",maxWidth:300},placeholder:"filter assets by entry point",onChange:e=>{i(e.map(e=>n.find(t=>t.name===e)).filter(Boolean))},allowClear:!0,onClear:()=>{i([])},children:n.map(e=>(0,y.jsx)(nC.Z.Option,{value:e.name,children:(0,y.jsx)(B.Z,{children:(0,y.jsx)(rE,{label:e.name,value:t0(e.size),tooltip:e.name})})},e.name))})}):null,(0,y.jsx)(rr.Z,{children:(0,y.jsx)(sB,{placeholder:"search asset by keyword",onChange:e=>{d(e),p(!1)}})}),(0,y.jsx)(rr.Z,{span:7,children:(0,y.jsx)(sz.Z,{min:0,style:{width:"95%"},addonBefore:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{style:{fontSize:14,color:"inherit"},children:"Asset Size"}),(0,y.jsx)(rx.Z,{title:C("filter the output assets which size is greater than the input value"),style:{marginLeft:3},children:(0,y.jsx)(G.Z,{style:{color:"rgba(0,0,0,.45)"}})})]}),onChange:e=>T(Number(e)),addonAfter:k("chunk")})}),(0,y.jsx)(rr.Z,{span:7,children:(0,y.jsx)(sz.Z,{min:0,style:{width:"95%"},addonBefore:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{style:{fontSize:14,color:"inherit"},children:"Module Size"}),(0,y.jsx)(rx.Z,{title:C("filter the modules which size is greater than the input value"),style:{marginLeft:3},children:(0,y.jsx)(G.Z,{style:{color:"rgba(0,0,0,.45)"}})})]}),onChange:e=>{D(Number(e))},addonAfter:k("module")})}),(0,y.jsx)(rr.Z,{span:24,children:A.length?(0,y.jsxs)(rt.Z,{gutter:I.BasePadding,children:[(0,y.jsx)(rr.Z,{span:8,children:(0,y.jsx)(rn.Z,{title:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:C("Output Assets List")}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(rx.Z,{title:`total assets count is ${w.length}, the filtered assets count is ${A.length}`,children:(0,y.jsxs)(L.Z.Text,{type:"secondary",style:{fontSize:12,fontWeight:400},children:[A.length," / ",w.length]})}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(L.Z.Text,{type:"secondary",style:{fontSize:12,fontWeight:400},children:t0((0,ru.Z)(A,e=>e.size))})]}),size:"small",bodyStyle:{overflow:"scroll",height:b?410:800},extra:(0,y.jsx)($.ZP,{size:"small",icon:(0,y.jsx)(r4.Z,{}),onClick:()=>p(!0),children:"expand all"}),children:(0,y.jsx)(nF,{treeData:E,autoExpandParent:!0,defaultExpandAll:h||A.length<=20},`tree_${o}_${h}`)})}),(0,y.jsx)(rr.Z,{span:16,children:j?(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetAssetDetails,body:{assetPath:j},children:e=>(0,y.jsx)(ig,{asset:e.asset,chunks:e.chunks,modules:e.modules,height:b?410:800,moduleSizeLimit:l,root:t})}):(0,y.jsx)(rn.Z,{bodyStyle:{height:b?450:800},children:(0,y.jsx)(rl.Z,{description:(0,y.jsx)(L.Z.Text,{strong:!0,children:"Click the file path on the left to show the modules of the asset"})})})})]}):(0,y.jsx)(rl.Z,{})})]})})]})},iZ=rC({api:F.SDK.ServerAPI.API.GetProjectInfo,responsePropName:"project",Component:e=>{let{root:t,errors:r}=e.project;return(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetAssetsSummary,body:{withFileContent:!0},children:e=>(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetEntryPoints,children:n=>(0,y.jsx)(iy,{cwd:t,errors:r,summary:e,entryPoints:n})})})}}),ib="BundleSize",iv=F.Client.RsdoctorClientRoutes.BundleSize,iS=()=>(0,y.jsx)(rt.Z,{children:(0,y.jsx)(rr.Z,{span:24,style:{marginBottom:I.BasePadding},children:(0,y.jsx)(iZ,{})})});var iM=r("10611"),iC=r("67253");let iw=({style:e,onChange:t,loaderNames:r})=>{let[n,s]=(0,W.useState)([]);return(0,y.jsxs)(sO.Z.Group,{compact:!0,style:e,children:[(0,y.jsxs)($.ZP,{style:{width:120},children:[(0,y.jsx)(iM.Z,{}),(0,y.jsx)(L.Z.Text,{children:"Loaders"})]}),(0,y.jsx)(nC.Z,{mode:"multiple",allowClear:!0,defaultValue:n,style:{width:300},dropdownMatchSelectWidth:!0,placeholder:"select loaders",onChange:e=>{s(e),t(e)},children:r.map(e=>(0,y.jsx)(nC.Z.Option,{label:e,value:e,children:e},e))})]})},iP=({onChange:e,layers:t})=>{let[r,n]=(0,W.useState)("");return(0,y.jsxs)(sO.Z.Group,{compact:!0,children:[(0,y.jsxs)($.ZP,{style:{width:120},children:[(0,y.jsx)(iM.Z,{}),(0,y.jsx)(L.Z.Text,{children:"Layers"})]}),(0,y.jsx)(nC.Z,{allowClear:!0,style:{width:150},defaultValue:r,placeholder:"select layer",onChange:t=>{n(t),e(t)},children:t?.length?t?.map(e=>y.jsx(nC.Z.Option,{label:e,value:e,children:e},e)):(0,y.jsx)(y.Fragment,{})})]})},iI=({onChange:e,loaderNames:t})=>{let[r,n]=(0,W.useState)([]),[s,i]=(0,W.useState)(""),[l,a]=(0,W.useState)("");return(0,W.useEffect)(()=>{e({loaders:r,filename:s,layer:l})},[r,s,l]),(0,y.jsxs)(rt.Z,{style:{marginBottom:I.BasePadding},children:[(0,y.jsx)(rr.Z,{children:(0,y.jsx)(iw,{loaderNames:t,style:{marginRight:I.BasePadding/2},onChange:e=>{n(e)}})}),(0,y.jsx)(rr.Z,{children:(0,y.jsx)(sB,{icon:(0,y.jsx)(iC.Z,{}),style:{marginRight:I.BasePadding/2},label:"Filename",placeholder:"search filename by keyword",onChange:e=>{i(e)}})}),(0,y.jsx)(rr.Z,{children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetLayers,children:e=>e.length?(0,y.jsx)(iP,{layers:e,onChange:e=>{a(e)}}):(0,y.jsx)(y.Fragment,{})})})]})},ik=({loaders:e,cwd:t})=>{let{isDark:r}=tK(),n=(0,W.useRef)(null),[s,i]=(0,W.useState)([]),l=function(e,t){let[r,n]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let t=setTimeout(()=>n(e),200);return()=>clearTimeout(t)},[e,t]),r}(s,200),a=(0,W.useMemo)(()=>(0,r2.Z)(e,e=>e.loader),[e]),o=(0,W.useCallback)(r=>{let{name:n,data:s}=r,i=n.replace(" total","");if(s?.ext){var l;return l=s.ext,`
|
|
100
|
+
<div class="loader-tooltip-container">
|
|
101
|
+
<div class="loader-tooltip-title">${l.loader}</div>
|
|
102
|
+
<li class="loader-tooltip-item">
|
|
103
|
+
<span>isPitch</span>
|
|
104
|
+
<span>${l.isPitch}</span>
|
|
105
|
+
</li>
|
|
106
|
+
${l.layer&&`<li class="loader-tooltip-item">
|
|
107
|
+
<span>layer</span>
|
|
108
|
+
<span>${l.layer}</span>
|
|
109
|
+
</li>`}
|
|
110
|
+
<li class="loader-tooltip-item">
|
|
111
|
+
<span>duration</span>
|
|
112
|
+
<span class="loader-tooltip-text-bold">${t3(l.costs)}</span>
|
|
113
|
+
</li>
|
|
114
|
+
<li class="loader-tooltip-item">
|
|
115
|
+
<span>filepath</span>
|
|
116
|
+
<span>${l.resource}</span>
|
|
117
|
+
</li>
|
|
118
|
+
<li class="loader-tooltip-item">
|
|
119
|
+
<span>start</span>
|
|
120
|
+
<span class="loader-tooltip-text-bold">${sa()(l.startAt).format("YYYY/MM/DD HH:mm:ss")}</span>
|
|
121
|
+
</li>
|
|
122
|
+
<li class="loader-tooltip-item">
|
|
123
|
+
<span>end</span>
|
|
124
|
+
<span class="loader-tooltip-text-bold">${sa()(l.endAt).format("YYYY/MM/DD HH:mm:ss")}</span>
|
|
125
|
+
</li>
|
|
126
|
+
</div>
|
|
127
|
+
`.trim()}return function(e,t,r){let n=t=>t.loader===e,s=t.filter(n),i=s.map(e=>e.resource),l=i.filter(e=>e.includes("/node_modules/")),a=i.filter(e=>!e.startsWith(r)),o=(0,su.Z)(s,e=>e.startAt).startAt,d=(0,sh.Z)(s,e=>e.endAt).endAt,c=er(n,t);return`
|
|
128
|
+
<div class="loader-tooltip-container">
|
|
129
|
+
<div class="loader-tooltip-title">${e}</div>
|
|
130
|
+
<li class="loader-tooltip-item">
|
|
131
|
+
<span>files</span>
|
|
132
|
+
<span class="loader-tooltip-text-bold">${i.length}</span>
|
|
133
|
+
</li>
|
|
134
|
+
<li class="loader-tooltip-item">
|
|
135
|
+
<span>files(node_modules)</span>
|
|
136
|
+
<span class="loader-tooltip-text-bold">${l.length}</span>
|
|
137
|
+
</li>
|
|
138
|
+
<li class="loader-tooltip-item">
|
|
139
|
+
<span>files(outside the cwd)</span>
|
|
140
|
+
<span class="loader-tooltip-text-bold">${a.length}</span>
|
|
141
|
+
</li>
|
|
142
|
+
<li class="loader-tooltip-item">
|
|
143
|
+
<span>duration(estimated)</span>
|
|
144
|
+
<span class="loader-tooltip-text-bold">${t3(c)}</span>
|
|
145
|
+
</li>
|
|
146
|
+
<li class="loader-tooltip-item">
|
|
147
|
+
<span>start(min)</span>
|
|
148
|
+
<span>${sa()(o).format("YYYY/MM/DD HH:mm:ss")}</span>
|
|
149
|
+
</li>
|
|
150
|
+
<li class="loader-tooltip-item">
|
|
151
|
+
<span>end(max)</span>
|
|
152
|
+
<span>${sa()(d).format("YYYY/MM/DD HH:mm:ss")}</span>
|
|
153
|
+
</li>
|
|
154
|
+
</div>
|
|
155
|
+
`.trim()}(i,e,t)},[]);return(0,W.useEffect)(()=>{i(Object.keys(a).map(e=>{let r=a[e]||[],{start:n,end:s}=t9(r);return{p:e,n:e,s:n,e:s,c:r.map(r=>({p:e,n:td(r.resource,t),s:r.startAt,e:r.endAt,ext:r}))}}))},[a]),(0,y.jsx)(y.Fragment,{children:s?.length?(0,y.jsx)("div",{className:["loader-chart-container",r?"loader-chart-container_dark":""].join(" ").trim(),ref:n,style:{width:"100%",height:"600px"},children:(0,y.jsx)(sc,{loaderData:l,formatterFn:o,chartType:"loader"})}):(0,y.jsx)(rl.Z,{})})},iD=rC({api:F.SDK.ServerAPI.API.GetProjectInfo,responsePropName:"project",Component:({project:e})=>{let{root:t}=e,[r,n]=(0,W.useState)({filename:"",loaders:[],layer:""}),[s,i]=(0,W.useState)(0);return(0,y.jsxs)(B.Z,{direction:"vertical",style:{width:"100%"},children:[(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetLoaderNames,children:e=>(0,y.jsx)(iI,{onChange:n,loaderNames:e})}),(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetLoaderChartData,children:e=>{let n=e.filter(e=>t8(e.resource,e.loader,r.filename,r.loaders,e.layer,r?.layer));return 0===s?(0,y.jsx)(ik,{loaders:n,cwd:t}):(0,y.jsx)(y.Fragment,{})}})]})}}),iT=F.Client.RsdoctorClientRoutes.WebpackLoaderOverall,iA=()=>(0,y.jsx)(nr,{title:"Loader Timeline",extra:(0,y.jsx)(sT,{defaultKeys:["module"]}),collapsable:!0,children:(0,y.jsx)(iD,{})});var iE=r("34781");let iN=({label:e,value:t,ellipsis:r=!1,...n})=>(0,y.jsxs)(rt.Z,{children:[(0,y.jsx)(rr.Z,{span:6,children:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(s0.Z,{status:"processing"}),(0,y.jsx)("div",{style:{width:180},children:(0,y.jsx)(L.Z.Text,{strong:!0,code:!0,children:e})}),(0,y.jsx)(ro.Z,{type:"vertical"})]})}),(0,y.jsx)(rr.Z,{span:18,children:(0,y.jsx)(L.Z.Paragraph,{ellipsis:r,strong:!0,...n,children:t})})]}),i_=({loader:e,resource:t,cwd:r})=>(0,y.jsxs)(nr,{title:"Loader Details",style:{border:"none"},extra:(0,y.jsx)(rc.Z,{icon:(0,y.jsx)(iE.Z,{}),color:"default",children:sa()(e.startAt).format("YYYY-MM-DD HH:mm:ss")}),children:[e.isPitch?(0,y.jsx)(L.Z.Text,{code:!0,children:"pitch"}):null,(0,y.jsxs)(B.Z,{direction:"vertical",style:{padding:I.BasePadding,wordBreak:"break-all"},children:[(0,y.jsx)(iN,{label:"file path",value:td(t.path,r),code:!0}),(0,y.jsx)(iN,{label:"resource path",value:(0,y.jsx)(rL,{cwd:r,url:t.path,loc:"",disabled:!0})}),(0,y.jsx)(iN,{label:"resource query",value:t.queryRaw||"-"}),(0,y.jsx)(iN,{label:"duration",value:t3(e.costs),mark:!0}),(0,y.jsx)(iN,{label:"loader name",value:e.loader,code:!0}),(0,y.jsx)(iN,{label:"loader index",value:`${e.loaderIndex}`}),(0,y.jsx)(iN,{label:"loader path",value:(0,y.jsx)(rL,{cwd:r,url:e.path,loc:"",disabled:!0})}),(0,y.jsx)(iN,{label:"options",value:JSON.stringify(e.options||"-"),copyable:!0,ellipsis:{rows:2,expandable:!0,symbol:"more"}})]})]}),iz=({data:e,cwd:t,index:r})=>{let{loaders:n,resource:s}=e,[i,l]=(0,W.useState)(r||0),{theme:a}=tK(),o="light"===a,d=n[i],c=d.input||"",u=d.errors&&d.errors.length,[h,p]=(0,W.useState)("loaderDetails"),x=(0,W.useCallback)(e=>{p(e)},[]);return(0,y.jsxs)(rt.Z,{style:{height:"100%"},children:[(0,y.jsx)(rr.Z,{span:5,style:{borderRight:o?"1px solid #f0f0f0":void 0,padding:I.BasePadding},children:(0,y.jsxs)(B.Z,{direction:"vertical",style:{width:"100%"},children:[(0,y.jsx)(rT,{text:"Executions"}),(0,y.jsx)(ri.Z,{mode:"left",style:{marginTop:I.BasePadding},children:n.map((e,t,r)=>{let{loader:n,isPitch:s}=e;return(0,y.jsxs)(ri.Z.Item,{dot:s?(0,y.jsx)(rc.Z,{style:{marginLeft:1,fontWeight:500},children:"pitch"}):(0,y.jsx)(iE.Z,{}),style:{paddingBottom:10,textAlign:"center"},children:[(0,y.jsx)(rt.Z,{align:"middle",justify:"space-between",gutter:[0,10],children:(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(rx.Z,{title:n,trigger:"hover",children:(0,y.jsx)($.ZP,{type:t===i?"primary":"default",block:!0,onClick:()=>{l(t)},style:{textAlign:"left"},children:(0,y.jsxs)(L.Z.Text,{ellipsis:!0,style:{color:"inherit"},children:[(0,y.jsx)(L.Z.Text,{strong:!0,style:{color:"inherit"},children:t3(e.costs)}),(0,y.jsx)(ro.Z,{type:"vertical"}),n]})})})})}),t===r.length-1?null:(0,y.jsx)("div",{style:{paddingTop:10},children:(0,y.jsx)(L.Z.Text,{children:"⬇️"})})]},t)})})]})}),(0,y.jsx)(rr.Z,{span:19,style:{height:"100%"},children:(0,y.jsx)(rd.Z,{type:"card",defaultActiveKey:"loaderDetails",activeKey:h,items:[{label:"Loader Props",key:"loaderProps",children:(0,y.jsx)(i_,{loader:d,resource:s,cwd:t})},{label:"Loader Details",key:"loaderDetails",children:(0,y.jsx)("div",{style:{height:"100%"},children:u?(0,y.jsxs)(rr.Z,{span:24,style:{height:"53%",minHeight:400},children:[(0,y.jsx)("div",{style:{padding:I.BasePadding,borderTop:`1px solid ${o?"#f0f0f0":"rgba(253, 253, 253, 0.12)"}`,borderBottom:`1px solid ${o?"#f0f0f0":"rgba(253, 253, 253, 0.12)"}`},children:(0,y.jsx)(rT,{text:`the error stack of [${d.loader}] ${d.isPitch?"pitch":""}`})}),(0,y.jsx)("div",{style:{height:"90%"},children:(0,y.jsx)(tU.ZP,{theme:"vs-dark",options:{readOnly:!0,domReadOnly:!0,fontSize:14,minimap:{enabled:!1},lineNumbers:"off"},value:d.errors[0].message,language:"javascript"})})]}):(0,y.jsxs)(rr.Z,{span:24,style:{height:"53%",minHeight:400},children:[(0,y.jsx)("div",{style:{padding:I.BasePadding,borderTop:`1px solid ${o?"#f0f0f0":"rgba(253, 253, 253, 0.12)"}`,borderBottom:`1px solid ${o?"#f0f0f0":"rgba(253, 253, 253, 0.12)"}`},children:(0,y.jsx)(rT,{text:`the result of [${d.loader}] ${d.isPitch?"pitch":""}`})}),d.isPitch?d.result?(0,y.jsx)("div",{style:{height:"90%"},children:(0,y.jsx)(tU.ZP,{theme:"vs-dark",options:{readOnly:!0,domReadOnly:!0,fontSize:14,formatOnType:!0,formatOnPaste:!0},value:d.result,language:tJ(s.path)})}):(0,y.jsx)(rl.Z,{description:"No loader result. If you use the Brief Mode, there will not have loader results."}):(0,y.jsxs)("div",{style:{minHeight:"700px"},children:[(0,y.jsxs)(rt.Z,{children:[(0,y.jsx)(rr.Z,{span:12,style:{padding:`${I.BasePadding/2}px ${I.BasePadding}px`},children:(0,y.jsx)(L.Z.Text,{strong:!0,children:"Input"})}),(0,y.jsx)(rr.Z,{span:12,style:{padding:`${I.BasePadding/2}px ${I.BasePadding}px`},children:(0,y.jsx)(L.Z.Text,{strong:!0,children:"Output"})})]}),(0,y.jsx)("div",{style:{height:"40rem"},children:d.result||c?(0,y.jsx)(r$,{filepath:s.path,before:c,after:d.result||""}):(0,y.jsx)(rl.Z,{description:"No loader result. If you use the Brief Mode, there will not have loader results."})})]})]})})}],onChange:x})})]})},iR=e=>{let{cwd:t,filetree:r}=e,[n,s]=(0,W.useState)(!1),[i,l]=(0,W.useState)(""),[a,o]=(0,W.useState)(0),[d,c]=(0,W.useState)(null),u=(0,W.useRef)(null),{initMonaco:h}={initMonaco:tQ},p=(0,W.useCallback)(async()=>{await h(u)},[]),x=(0,W.useMemo)(()=>r.filter(t=>t.loaders.some(r=>t8(t.path,r.loader,e.filename,e.loaders,t.layer,e?.layer))),[e.filename,e.loaders,e.layer]),m="__RESOURCEPATH__",f=(0,W.useMemo)(()=>to({files:x.map(e=>e.path),cwd:t,fileTitle(t,n){let{loaders:i,layer:a}=r.find(e=>e.path===t);return(0,y.jsxs)(B.Z,{style:{wordBreak:"break-all"},onClick:()=>{o(0),l(t),s(!0)},children:[(0,y.jsx)(sL,{text:n.replace(/\[.*?\]/g,""),keyword:e.filename}),a?(0,y.jsx)(rc.Z,{color:"cyan",bordered:!1,children:a}):(0,y.jsx)(y.Fragment,{}),i.map((e,r)=>{let n=e.errors&&e.errors.length,i=`${t}_${e.loader}_${r}`;return(0,y.jsx)(rx.Z,{title:e.path,children:(0,y.jsxs)(L.Z.Text,{code:!0,style:{color:n?"#f50":"inherit"},onClick:e=>{e.stopPropagation(),l(t),o(r),s(!0)},children:[(0,y.jsx)(L.Z.Text,{style:{maxWidth:135,color:"inherit"},ellipsis:!0,children:e.loader}),(0,y.jsx)(ro.Z,{type:"vertical"}),n?(0,y.jsx)(nc.Z,{}):(0,y.jsx)(L.Z.Text,{strong:!0,children:t3(e.costs)})]})},i)})]})},dirTitle:(t,r)=>(0,y.jsx)(sL,{text:r,keyword:e.filename})}),[x]);return(0,y.jsxs)(rt.Z,{style:{width:"100%"},gutter:I.BasePadding,children:[(0,y.jsx)(rr.Z,{span:14,children:(0,y.jsxs)(rn.Z,{title:(0,y.jsxs)(L.Z.Text,{strong:!0,children:["Total Files: ",x.length]}),bodyStyle:{overflow:"scroll",maxHeight:800,height:"40rem"},children:[(0,y.jsx)(nF,{defaultExpandedKeys:tl(f,x.length>=100?3:4,e=>!((0,eW.Z)(e,m).indexOf("/node_modules/")>-1)),treeData:f,onSelect:(e,t)=>{p(),!t.node.isLeaf&&c(t.node)},selectedKeys:d?[d.key]:void 0,expandAction:"click"},`${e.loaders.join("|")}_${e.filename}`),(0,y.jsx)(rp.Z,{open:n,onClose:()=>s(!1),maskClosable:!0,width:D,zIndex:999,bodyStyle:{padding:0},children:n?(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetLoaderFileDetails,body:{path:i},children:e=>(0,y.jsx)(iz,{data:e,cwd:t,index:a})}):null})]})}),d?(0,y.jsx)(rr.Z,{span:10,children:(0,y.jsx)(rn.Z,{title:(0,y.jsx)(rx.Z,{title:W.cloneElement(d.title,{style:{color:"#fff"}}),children:(0,y.jsxs)(L.Z.Text,{children:['Statistics of "',d.title,'"']})}),children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetLoaderFolderStatistics,body:{folder:d[m]},children:e=>(0,y.jsx)(sy.Z,{style:{width:"100%",maxHeight:800,height:"40rem",overflowY:"scroll",wordBreak:"break-all"},pagination:!1,bordered:!0,rowKey:e=>e.loader,columns:[{title:"Loader Name",dataIndex:"loader"},{title:"Files",dataIndex:"files"},{title:"Total Duration",dataIndex:"costs",render:e=>(0,y.jsx)(L.Z.Text,{strong:!0,children:t3(e)}),sorter:(e,t)=>e.costs-t.costs,defaultSortOrder:"descend",sortDirections:["descend","ascend"]}],dataSource:e,footer:()=>(0,y.jsxs)(nz.Z,{title:"Total",bordered:!0,layout:"vertical",size:"small",children:[(0,y.jsx)(nz.Z.Item,{label:"loaders",children:e.length}),(0,y.jsx)(nz.Z.Item,{label:"files",children:(0,ru.Z)(e,e=>e.files)}),(0,y.jsx)(nz.Z.Item,{label:"duration",children:(0,y.jsx)(L.Z.Text,{strong:!0,children:t3((0,ru.Z)(e,e=>e.costs))})})]})})})})}):null]})},iO=rC({api:F.SDK.ServerAPI.API.LoadDataByKey,body:{key:"root"},responsePropName:"cwd",Component:({cwd:e})=>{let[t,r]=(0,W.useState)({filename:"",loaders:[],layer:""});return(0,y.jsxs)("div",{children:[(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetLoaderNames,children:e=>(0,y.jsx)(iI,{onChange:e=>r(e),loaderNames:e})}),(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetLoaderFileTree,children:r=>(0,y.jsx)(iR,{filename:t.filename,filetree:r,loaders:t.loaders,layer:t.layer,cwd:e})})]})}}),iB="Loaders Analysis",iL=F.Client.RsdoctorClientRoutes.WebpackLoaderAnalysis,i$=()=>(0,y.jsx)(nr,{title:"Loader Analysis",extra:(0,y.jsx)(sT,{defaultKeys:["module","resolve"]}),bodyStyle:{paddingTop:0,height:800},children:(0,y.jsx)(iO,{})});var iG=r("26356");let iF=F.Client.RsdoctorClientRoutes.WebpackPlugins,iW=()=>{let[e,t]=(0,W.useState)([]),[r,n]=(0,W.useState)([]);return(0,y.jsx)("div",{children:(0,y.jsx)(rn.Z,{title:"Webpack Plugins Overall",bodyStyle:{paddingTop:I.BasePadding/3},extra:(0,y.jsx)(sT,{defaultKeys:["plugins"]}),children:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetPluginSummary,children:({hooks:e,tapNames:r})=>(0,y.jsxs)(B.Z,{style:{marginBottom:I.BasePadding/2},children:[(0,y.jsxs)(sO.Z.Group,{compact:!0,children:[(0,y.jsxs)($.ZP,{children:[(0,y.jsx)(nT.Z,{}),(0,y.jsx)(L.Z.Text,{children:"Plugin Tap Names"})]}),(0,y.jsx)(nC.Z,{mode:"multiple",allowClear:!0,style:{width:350},dropdownMatchSelectWidth:!0,onChange:e=>{t(e)},children:r.map(e=>(0,y.jsx)(nC.Z.Option,{label:e,value:e,children:e},e))})]}),(0,y.jsxs)(sO.Z.Group,{compact:!0,children:[(0,y.jsxs)($.ZP,{children:[(0,y.jsx)(iG.Z,{}),(0,y.jsx)(L.Z.Text,{children:"Hooks"})]}),(0,y.jsx)(nC.Z,{mode:"multiple",allowClear:!0,style:{width:350},dropdownMatchSelectWidth:!0,onChange:e=>{n(e)},children:e.map(e=>(0,y.jsx)(nC.Z.Option,{label:e,value:e,children:e},e))})]})]})}),(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetPluginData,body:{hooks:r,tapNames:e},children:e=>(0,y.jsx)(sZ,{dataSource:e})})]})})})};var iK=r("73934");let iH=({filepath:e,before:t,after:r,resolvers:n})=>{let[s,i]=(0,W.useState)(!1);return(0,y.jsxs)(W.Fragment,{children:[(0,y.jsx)(rr.Z,{flex:1,children:(0,y.jsx)(rn.Z,{title:"Resolve Diff Viewer",children:(0,y.jsx)(r$,{filepath:e,before:t,after:r,editorProps:{height:735}})})}),(0,y.jsx)(rr.Z,{span:s?2:7,children:(0,y.jsx)(rn.Z,{title:s?"...":"Resolve Details",extra:(0,y.jsx)($.ZP,{onClick:()=>i(!s),size:"small",icon:s?(0,y.jsx)(sQ.Z,{}):(0,y.jsx)(sX.Z,{})}),style:s?{width:80}:void 0,children:s?null:(0,y.jsx)(sy.Z,{style:{width:"100%",height:735,overflowY:"scroll",wordBreak:"break-all"},size:"small",pagination:!1,bordered:!0,rowKey:e=>e.request,columns:[{title:"Source Code",width:200,render:(e,t)=>(0,y.jsx)(L.Z.Text,{copyable:!0,children:(0,y.jsx)(L.Z.Text,{code:!0,strong:!0,children:t.request})})},{title:"Duration",width:80,render:(e,t)=>(0,y.jsx)(L.Z.Text,{strong:!0,children:t3(t.costs)}),sorter:(e,t)=>e.costs-t.costs,sortDirections:["descend","ascend"]},{title:"Resolve Result",render:(e,t)=>t.result?(0,y.jsx)(L.Z.Text,{copyable:!0,children:t.result}):(0,y.jsx)(nc.Z,{style:{color:"#f50"}})}],dataSource:n})})})]})},iU=e=>{let{resolver:t,cwd:r}=e,[n,s]=(0,W.useState)(""),i="/node_modules/",l=(0,W.useMemo)(()=>(0,iK.Z)(t,e=>e.issuerPath).filter(Boolean),[t]),a=(0,W.useMemo)(()=>l.filter(t=>!e.filename||t.indexOf(e.filename)>-1),[e.filename,l]),o=a.length&&a.every(e=>e.indexOf(i)>-1),d=(0,W.useMemo)(()=>to({files:a.length?a:l,cwd:r,fileTitle:(e,t)=>(0,y.jsx)("div",{onClick:()=>s(e),children:t})}),[e.filename]);return(0,y.jsxs)(rt.Z,{justify:"start",align:"top",wrap:!1,gutter:I.BasePadding,children:[(0,y.jsx)(rr.Z,{span:7,children:(0,y.jsx)(rn.Z,{title:"Files",children:(0,y.jsx)(nF,{style:{width:"100%",height:735,overflow:"scroll"},treeData:d,defaultExpandedKeys:tl(d,o?1:4,o?void 0:e=>{let t=(0,eW.Z)(e,"__RESOURCEPATH__").indexOf(i)>-1;return!!(a.length&&a.every(e=>e.indexOf(i)>-1))||!t})},`tree_${e.filename}`)})}),n&&(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetResolverFileDetails,body:{filepath:n},children:e=>(0,y.jsx)(iH,{...e})})]})},iY=rC({api:F.SDK.ServerAPI.API.GetProjectInfo,responsePropName:"project",Component:({project:e})=>{let{root:t}=e,[r,n]=(0,W.useState)("");return(0,y.jsxs)("div",{style:{width:"100%"},children:[(0,y.jsx)(B.Z,{style:{marginTop:I.BasePadding,marginBottom:I.BasePadding},children:(0,y.jsx)(sB,{icon:(0,y.jsx)(iC.Z,{}),label:"Filename",placeholder:"search filename by keyword",onChange:e=>n(e)})}),(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetResolverFileTree,children:e=>(0,y.jsx)(iU,{filename:r,resolver:e,cwd:t})})]})}}),iV=F.Client.RsdoctorClientRoutes.ModuleResolve,iJ=()=>(0,y.jsx)("div",{children:(0,y.jsx)(rn.Z,{title:"Webpack Resolver Analysis",extra:(0,y.jsx)(sT,{defaultKeys:["resolve","resolveLoader"]}),bodyStyle:{paddingTop:0},children:(0,y.jsx)(iY,{})})});var iq=r("17377");let iQ=F.Client.RsdoctorClientRoutes.RuleIndex,iX=()=>{let e=ty()[F.Rule.RsdoctorRuleClientConstant.UrlQueryForErrorCode]||"",[t,r]=(0,W.useState)(F.Rule.RuleErrorMap[e]),n=(0,rS.Z)(F.Rule.RuleErrorMap);return(0,W.useEffect)(()=>{window.scrollTo({top:0})},[]),(0,y.jsxs)(rt.Z,{gutter:I.BasePadding/2,children:[(0,y.jsx)(rr.Z,{span:8,children:(0,y.jsx)(rn.Z,{title:(0,y.jsx)(rT,{text:"list of the error codes."}),bordered:!0,children:(0,y.jsx)(B.Z,{direction:"vertical",children:n.map((e,n)=>(0,y.jsxs)(B.Z,{style:{marginTop:0===n?0:I.BasePadding/2,cursor:"pointer"},onClick:()=>r(e),align:"center",children:[(0,y.jsx)(s0.Z,{status:"default"}),(0,y.jsx)(L.Z.Text,{code:!0,children:(0,y.jsx)("a",{children:e.code})}),(0,y.jsx)(L.Z.Text,{style:{color:t&&t.code===e.code?"#1890ff":void 0},children:e.title})]},e.code))})})}),(0,y.jsx)(rr.Z,{span:16,children:t?(0,y.jsx)(rn.Z,{title:(0,y.jsxs)(rt.Z,{justify:"space-between",children:[(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{code:!0,children:t.code}),(0,y.jsx)(L.Z.Text,{children:t.title})]}),(0,y.jsx)("div",{children:(0,y.jsx)(rc.Z,{children:t.category})})]}),bodyStyle:{paddingTop:0},bordered:!0,children:(0,y.jsx)(L.Z.Paragraph,{children:"markdown"===t.type?(0,y.jsx)(iq.U,{children:t.description}):(0,y.jsx)(L.Z.Text,{children:t.description})})}):(0,y.jsx)(rn.Z,{title:"This page lists all the error codes emitted by the Rsdoctor.",bordered:!0,children:(0,y.jsx)(L.Z.Text,{children:"click the error code in left bar to show more details."})})})]})};var i0=r("25516");class i1{constructor(e,t,r,n){e>r||e===r&&t>n?(this.startLineNumber=r,this.startColumn=n,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=r,this.endColumn=n)}isEmpty(){return i1.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return i1.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber)&&!(t.lineNumber>e.endLineNumber)&&(t.lineNumber!==e.startLineNumber||!(t.column<e.startColumn))&&(t.lineNumber!==e.endLineNumber||!(t.column>e.endColumn))&&!0}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber)&&!(t.lineNumber>e.endLineNumber)&&(t.lineNumber!==e.startLineNumber||!(t.column<=e.startColumn))&&(t.lineNumber!==e.endLineNumber||!(t.column>=e.endColumn))&&!0}containsRange(e){return i1.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber)&&!(t.endLineNumber<e.startLineNumber)&&!(t.startLineNumber>e.endLineNumber)&&!(t.endLineNumber>e.endLineNumber)&&(t.startLineNumber!==e.startLineNumber||!(t.startColumn<e.startColumn))&&(t.endLineNumber!==e.endLineNumber||!(t.endColumn>e.endColumn))&&!0}strictContainsRange(e){return i1.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber)&&!(t.endLineNumber<e.startLineNumber)&&!(t.startLineNumber>e.endLineNumber)&&!(t.endLineNumber>e.endLineNumber)&&(t.startLineNumber!==e.startLineNumber||!(t.startColumn<=e.startColumn))&&(t.endLineNumber!==e.endLineNumber||!(t.endColumn>=e.endColumn))&&!0}plusRange(e){return i1.plusRange(this,e)}static plusRange(e,t){let r,n,s,i;return t.startLineNumber<e.startLineNumber?(r=t.startLineNumber,n=t.startColumn):t.startLineNumber===e.startLineNumber?(r=t.startLineNumber,n=Math.min(t.startColumn,e.startColumn)):(r=e.startLineNumber,n=e.startColumn),t.endLineNumber>e.endLineNumber?(s=t.endLineNumber,i=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,i=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,i=e.endColumn),new i1(r,n,s,i)}intersectRanges(e){return i1.intersectRanges(this,e)}static intersectRanges(e,t){let r=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,i=e.endColumn,l=t.startLineNumber,a=t.startColumn,o=t.endLineNumber,d=t.endColumn;return(r<l?(r=l,n=a):r===l&&(n=Math.max(n,a)),s>o?(s=o,i=d):s===o&&(i=Math.min(i,d)),r>s||r===s&&n>i)?null:new i1(r,n,s,i)}equalsRange(e){return i1.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return i1.getEndPosition(this)}static getEndPosition(e){return new i2(e.endLineNumber,e.endColumn)}getStartPosition(){return i1.getStartPosition(this)}static getStartPosition(e){return new i2(e.startLineNumber,e.startColumn)}toString(){return`[${this.startLineNumber},${this.startColumn} -> ${this.endLineNumber},${this.endColumn}]`}setEndPosition(e,t){return new i1(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new i1(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return i1.collapseToStart(this)}static collapseToStart(e){return new i1(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return i1.collapseToEnd(this)}static collapseToEnd(e){return new i1(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new i1(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new i1(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new i1(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber)&&(e.endLineNumber!==t.startLineNumber||!(e.endColumn<t.startColumn))&&!(t.endLineNumber<e.startLineNumber)&&(t.endLineNumber!==e.startLineNumber||!(t.endColumn<e.startColumn))&&!0}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber)&&(e.endLineNumber!==t.startLineNumber||!(e.endColumn<=t.startColumn))&&!(t.endLineNumber<e.startLineNumber)&&(t.endLineNumber!==e.startLineNumber||!(t.endColumn<=e.startColumn))&&!0}static compareRangesUsingStarts(e,t){if(e&&t){let r=0|e.startLineNumber,n=0|t.startLineNumber;if(r===n){let r=0|e.startColumn,n=0|t.startColumn;if(r===n){let r=0|e.endLineNumber,n=0|t.endLineNumber;if(r===n){let r=0|e.endColumn;return r-(0|t.endColumn)}return r-n}return r-n}return r-n}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){if(e.endLineNumber===t.endLineNumber){if(e.endColumn===t.endColumn)return e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber;return e.endColumn-t.endColumn}return e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}}class i2{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new i2(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return i2.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return i2.isBefore(this,e)}static isBefore(e,t){return!!(e.lineNumber<t.lineNumber)||!(t.lineNumber<e.lineNumber)&&e.column<t.column}isBeforeOrEqual(e){return i2.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return!!(e.lineNumber<t.lineNumber)||!(t.lineNumber<e.lineNumber)&&e.column<=t.column}static compare(e,t){let r=0|e.lineNumber,n=0|t.lineNumber;if(r===n){let r=0|e.column;return r-(0|t.column)}return r-n}clone(){return new i2(this.lineNumber,this.column)}toString(){return`(${this.lineNumber},${this.column})`}static lift(e){return new i2(e.lineNumber,e.column)}static isIPosition(e){return e&&"number"==typeof e.lineNumber&&"number"==typeof e.column}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}}var i4=r("98843");function i3(e){let{module:t,moduleGraph:r,ranges:n,toLine:s,setEditorData:i,source:l}=e,a=(0,W.useRef)(),o=(0,W.useRef)([]),d=(0,W.useRef)([]),c=(0,W.useRef)(),u=(0,W.useRef)(!1),[h,p]=(0,W.useState)("");return((0,W.useEffect)(()=>{let{isPreferSource:e}=t;u.current=!0,p(l.source||e?l.source:l.transformed),setTimeout(()=>{d.current=a.current?.getModel()?.deltaDecorations(d.current,function(e,t){let r=t.getModuleGraphModule(e).getOwnExports(),n=r.map(e=>e.variable).filter(e=>!!e);if(0===r.length&&0===n.length)return[];let{isPreferSource:s}=e;return n.map(e=>{let t=s?e.identifier.position.source:e.identifier.position.transformed,r=t&&tq(t,i1);if(!!t&&!!r)return{range:r,options:{stickiness:1,inlineClassName:"tree-shaking-statement-declaration-identifier",isWholeLine:!1,showIfCollapsed:!0,hoverMessage:{supportHtml:!0,supportThemeIcons:!0,isTrusted:!0,value:function(e){let t=e.getExportInfo();if(!t)return"Can not find SideEffect info.";let r=t.getSideEffects();if(0===r.length)return"Have no sideEffect.";let n=`Used **${r.length}** times:
|
|
156
|
+
|
|
157
|
+
<div data-code="tree-shaking-hover">
|
|
158
|
+
<li>`;for(let e of r){var s,i,l;if(!e)continue;let{identifier:t,module:r}=e;if(!r)continue;let{id:a,isPreferSource:o}=r,d=t.getLineCode();n+=`
|
|
159
|
+
<ol>
|
|
160
|
+
${s=a,i=o?t.position.source:t.position.transformed,l=function(e,t){let{path:r,isPreferSource:n}=t,s=n?e.position.source.start:e.position.transformed.start,i=`:${s.line??1}:${s.column??0}`;return r.length<=30?`${r}${i}`:`...${r.substring(r.length-30)}${i}`}(t,r),`<a data-href="data-module=${s}&data-range=${encodeURIComponent(JSON.stringify(i))}">${l}</a>`}
|
|
161
|
+
${d?`<pre>${(0,i0.Z)(d)}</pre>`:""}
|
|
162
|
+
</ol>`}return n+="\n</li></div>"}(e)}}}}).filter(e=>!!e)}(t,r))??[]},200)},[t,l]),(0,W.useEffect)(()=>{function e(){let e=a.current?.getModel();if(!!e)o.current=e.deltaDecorations(o.current,n.map(e=>({range:tq(e,i1),options:{stickiness:1,inlineClassName:"tree-shaking-statement-side-effect",isWholeLine:!1,showIfCollapsed:!0}}))),a.current&&"number"==typeof s&&c.current!==s&&(c.current=s,a.current.revealLine(s,0))}u?setTimeout(e,300):e(),u.current=!1},[n,s]),(0,W.useEffect)(()=>{let e=e=>{let t=function(e){if("a"!==e.tagName.toLocaleLowerCase())return;let t=e.getAttribute("data-href")??"",r={module:-1,range:{start:{line:1,column:0},end:{line:1,column:0}}};for(let e of t.split("&")){let[t,n]=e.split("=");if("data-module"===t){r.module=Number.parseInt(n,10);continue}"data-range"===t&&(r.range=JSON.parse(decodeURIComponent(n)))}return r}(e.target);if(t){let e=r.getModuleById(t.module);e&&i(e,[t.range],t.range.start.line)}};return document.body.addEventListener("click",e),()=>{document.body.removeEventListener("click",e)}},[]),t)?(0,y.jsx)(rn.Z,{title:(0,y.jsx)(rx.Z,{title:t.path,children:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:q().basename(t.path)}),(0,y.jsx)(G.Z,{})]})}),className:"tree-shaking-editor",children:(0,y.jsx)(tU.ZP,{theme:"vs-dark",language:tV(t.path),value:h,loading:(0,y.jsx)(i4.Z,{style:{fontSize:30}}),options:rW,onMount:e=>{a.current=e}})}):(0,y.jsx)("div",{children:"请选择要查看的模块"})}function i5(){return(0,y.jsx)(rn.Z,{title:"Tree Shaking Analysis",bodyStyle:{paddingTop:0},className:"tree-shaking-page",children:(0,y.jsx)(rl.Z,{style:{marginTop:30}})})}var i9=r("53386"),i6=r("60342"),i8=r.n(i6);function i7(e,t){if(!e)return(0,y.jsx)("div",{children:"Can not find declaration."});let{module:r}=e,n=r.isPreferSource?e.position.source:e.position.transformed;return(0,y.jsx)(rx.Z,{title:`${r.path}, line ${n.start.line}`,children:(0,y.jsx)($.ZP,{type:"link",onClick:()=>t(r,[n],n.start.line),children:"Move To"})})}function le(e){let[t,r]=(0,W.useState)(""),[n,s]=(0,W.useState)(""),i=(0,W.useRef)(null),l=(e,t,n)=>{t(),r(e[0]),s(n)},a=e=>{e(),r("")};return{filterDropdown:({setSelectedKeys:t,selectedKeys:r,confirm:n,clearFilters:s,close:o})=>(0,y.jsxs)("div",{style:{padding:8},onKeyDown:e=>e.stopPropagation(),children:[(0,y.jsx)(sO.Z,{ref:i,placeholder:`Search ${e}`,value:r[0],onChange:e=>t(e.target.value?[e.target.value]:[]),onPressEnter:()=>l(r,n,e),style:{marginBottom:8,display:"block"}}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)($.ZP,{type:"primary",onClick:()=>l(r,n,e),icon:(0,y.jsx)(i9.Z,{}),size:"small",style:{width:90},children:"Search"}),(0,y.jsx)($.ZP,{onClick:()=>s&&a(s),size:"small",style:{width:90},children:"Reset"}),(0,y.jsx)($.ZP,{type:"link",size:"small",onClick:o,children:"close"})]})]}),filterIcon:e=>(0,y.jsx)(i9.Z,{style:{color:e?"#1890ff":void 0}}),onFilter:(t,r)=>r[e].toString().toLowerCase().includes(t.toLowerCase()),render:r=>n===e?(0,y.jsx)(i8(),{highlightStyle:{backgroundColor:"#ffc069",padding:0},searchWords:[t],autoEscape:!0,textToHighlight:r?r.toString():""}):r}}let lt=({module:e,moduleGraph:t,setEditorData:r})=>{let n=(0,W.useMemo)(()=>t.getModuleGraphModule(e).getSideEffects(),[e]),s=n.map(({variable:t,name:r,identifier:n},s)=>({key:s,name:r,identifier:e.isPreferSource?n.position.source:n.position.transformed,declaration:t?.identifier})).sort((e,t)=>e.name===t.name?e.identifier.start.line>t.identifier.start.line?1:-1:e.name>t.name?1:-1).reduce((e,t)=>{let r=e[e.length-1];return r&&r.name===t.name?(!r.children&&(r.children=[]),r.children.push(t),e):(e.push(t),e)},[]),i=[{title:"Name",dataIndex:"name",key:"name",align:"center",...le("name")},{title:"SideEffect",dataIndex:"identifier",key:"identifier",align:"center",render:t=>(0,y.jsx)(rx.Z,{title:`Current File line ${t.start.line}`,children:(0,y.jsx)($.ZP,{type:"link",onClick:()=>r(e,[t],t.start.line),children:"Move To"})})},{title:"Declaration",dataIndex:"declaration",key:"declaration",align:"center",render:e=>i7(e,r)}],l=(0,y.jsx)(W.Fragment,{children:(0,y.jsxs)(B.Z,{style:{fontWeight:400},children:["Import",(0,y.jsx)(L.Z.Text,{strong:!0,children:s.length}),"variables",(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(L.Z.Text,{strong:!0,children:n.length}),"sideEffects"]})});return(0,y.jsx)(nr,{style:{marginBottom:10},title:l,className:"tree-shaking-export-table",children:(0,y.jsx)(sy.Z,{size:"small",dataSource:s,columns:i,pagination:!1,scroll:{y:600}})})},lr=({module:e,moduleGraph:t,setEditorData:r})=>{let n=(0,W.useMemo)(()=>t.getModuleGraphModule(e).getExports(),[e]),s=n.filter(e=>0===e.getSideEffects().length),i=(0,y.jsxs)(W.Fragment,{children:[(0,y.jsxs)(B.Z,{style:{fontWeight:400},children:["Export",(0,y.jsx)(L.Z.Text,{strong:!0,children:n.length})]}),n.length>0?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsxs)(L.Z.Text,{style:{fontWeight:400},code:!0,children:[(0,y.jsx)(L.Z.Text,{children:"Unused"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(L.Z.Text,{strong:!0,children:s.length})]}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsxs)(L.Z.Text,{style:{fontWeight:400},code:!0,children:[(0,y.jsx)(L.Z.Text,{children:"Used"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(L.Z.Text,{strong:!0,children:n.length-s.length})]})]}):""]}),l=n.map((e,t)=>{let{variable:r}=e;return{key:t,name:e.name,declaration:r?.identifier,used:e.getSideEffects().map(({module:e,identifier:t})=>{let r=e?.isPreferSource?t.position.source:t.position.transformed;if(!!e&&!!r)return{module:e,range:r}}).filter(e3)}}),a=[{title:"Name",dataIndex:"name",key:"name",align:"center",...le("name")},{title:"Declaration",dataIndex:"declaration",key:"declaration",align:"center",render:e=>i7(e,r)},{title:"Info",dataIndex:"used",key:"used",align:"center",sorter:(e,t)=>e.used.length-t.used.length,sortDirections:["descend","ascend"],render:e=>(0,y.jsxs)("span",{children:["Used ",e.length," times"]})}];return(0,y.jsx)(nr,{title:i,className:"tree-shaking-export-table",children:(0,y.jsx)(sy.Z,{size:"small",dataSource:l,columns:a,pagination:!1,scroll:{y:600},expandable:{expandedRowRender:e=>(0,y.jsxs)("div",{className:"tree-shaking-side-effect-list",children:[(0,y.jsx)(L.Z.Text,{children:"List of SideEffect:"}),e.used.map(({module:e,range:t})=>(0,y.jsx)(rx.Z,{title:`${e.path}:${t.start.line}`,children:(0,y.jsx)($.ZP,{className:"tree-shaking-side-effect-list-item",type:"link",onClick:()=>{r(e,[t],t.start.line)},children:`${function(e){let t="",r=e;for(let e=0;e<3;e++)t=t?`${q().basename(r)}/${t}`:q().basename(r),r=q().dirname(r);return`...${t}`}(e.path)}:${t.start.line}`})},e.id))]}),rowExpandable:e=>e.used.length>0}})})},ln=e=>"side-effect"===e.kind?(0,y.jsx)(lt,{...e}):(0,y.jsx)(lr,{...e}),ls=F.Client.RsdoctorClientRoutes.TreeShaking,li=function(e,t,r){let n=e();return function(){let[s,i]=(0,W.useState)(),[l,a]=(0,W.useState)(S.Pending),[o,d]=(0,W.useState)({}),{loader:c}=tn(s);function u(e){return e.then(e=>{i(e)}).catch(()=>{a(S.Fail)})}function h(e){e&&Promise.all(t.map(([t])=>e.loadData(t))).then(e=>{d(e.reduce((e,r,n)=>{let[s,i]=t[n];return e[i]=r,e},{})),a(S.Success)}).catch(e=>{console.error(e),a(S.Fail)})}return((0,W.useEffect)(()=>{u(n).then(()=>{h(c)})},[c]),l===S.Pending)?(0,y.jsx)(rf.Z,{active:!0}):l===S.Fail?(0,y.jsx)(ry,{retry:()=>{a(S.Pending),n.then(()=>{h(c)}).catch(()=>{u(e())})}}):(0,y.jsx)(r,{...o})}}(e8,[["moduleGraph","data"],["root","cwd"]],({data:e,cwd:t})=>{var r,n,s,i,l,a,o;let d=(r=e,(0,W.useMemo)(()=>tG.fromData(r),[r]));if(0===d.size())return(0,y.jsx)(i5,{});let[c,u]=(0,W.useState)(""),[h,p]=(0,W.useState)(1),[x,m]=(0,W.useState)([]),[f,g]=(0,W.useState)("side-effect"),j=(0,W.useMemo)(()=>d.getModules().filter(e=>e.kind===F.SDK.ModuleKind.Normal&&q().basename(e.path).includes(c)),[c]),Z=(0,W.useMemo)(()=>j.find(e=>e.isEntry),[]),[b,v]=(0,W.useState)(Z||j?.length&&j?.[0]);let S=(n=j,s=d,i=c,l=b,a=e=>{M(j.find(t=>t.path===e),[])},o=t,(0,W.useMemo)(()=>to({files:n.map(e=>e.path),cwd:o,fileTitle(e,t){let r=s.getModules().find(t=>t.path===e&&t.kind===tN.kind.Normal),n=s.getModuleGraphModule(r),i=n.getExports().filter(e=>0===e.getSideEffects().length);return(0,y.jsxs)(B.Z,{style:{wordBreak:"break-all"},children:[(0,y.jsx)(sL,{text:t,keyword:e,onClick:()=>a(e)}),n.dynamic?(0,y.jsx)(rc.Z,{color:"cyan",children:"dynamic"}):"",i.length>0?(0,y.jsxs)(rc.Z,{color:"green",children:[i.length," Unused"]}):""]})}}),[i,l])),M=(e,t,r)=>{v(e),m(t.slice()),(0,rG.Z)(r)&&p(r)};return(0,y.jsxs)(rn.Z,{title:"Tree Shaking Analysis",bodyStyle:{paddingTop:0},className:"tree-shaking-page",children:[(0,y.jsxs)(rt.Z,{justify:"space-between",align:"middle",style:{marginBottom:I.BasePadding,marginTop:I.BasePadding},children:[(0,y.jsx)(sB,{icon:(0,y.jsx)(iC.Z,{}),width:400,label:"FileName",placeholder:"search filename by keyword",style:{width:"auto"},onChange:e=>u(e)}),(0,y.jsxs)(rX.ZP.Group,{value:f,onChange:({target:e})=>g(e.value),children:[(0,y.jsx)(rX.ZP.Button,{value:"side-effect",children:"SideEffects"}),(0,y.jsx)(rX.ZP.Button,{value:"export",children:"Export Variables"})]})]}),(0,y.jsxs)(rt.Z,{justify:"space-between",align:"top",wrap:!1,gutter:[I.BasePadding,I.BasePadding],children:[(0,y.jsx)(rr.Z,{span:7,children:(0,y.jsx)(rn.Z,{title:`Total Files: ${j.length}`,className:"tree-shaking-files-box",children:(0,y.jsx)(nF,{style:{height:"80%"},className:"tree-shaking-files",selectedKeys:b?[b.path]:[],defaultExpandedKeys:tl(S,3,e=>!((0,eW.Z)(e,"__RESOURCEPATH__").indexOf("/node_modules/")>-1)),treeData:S,expandAction:"click"})})}),(0,y.jsx)(rr.Z,{span:9,children:(0,y.jsx)(rM,{api:F.SDK.ServerAPI.API.GetModuleCodeByModuleId,body:{moduleId:b.id},children:e=>(0,y.jsx)(i3,{module:b,moduleGraph:d,ranges:x,toLine:h,setEditorData:M,source:e})})}),(0,y.jsx)(rr.Z,{flex:1,children:(0,y.jsx)(ln,{kind:f,setEditorData:M,module:b,moduleGraph:d})})]})]})});var ll=r("87380"),la=r("23813"),lo=r("19071");let ld=({file:e,data:t})=>{let[r,n]=(0,W.useState)(t[0].group),s=t.find(e=>e.group===r);return(0,y.jsxs)(rt.Z,{wrap:!0,gutter:[I.BasePadding,I.BasePadding],style:{height:"100%"},children:[t.length>1?(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(r5.Z,{style:{marginTop:I.BasePadding},value:r,options:t.map(e=>e.group),onChange:e=>n(e)})}):null,s?(0,y.jsxs)(W.Fragment,{children:[(0,y.jsx)(rr.Z,{span:12,children:(0,y.jsx)(L.Z.Text,{strong:!0,children:s.baselineTitle||"Baseline"})}),(0,y.jsx)(rr.Z,{span:12,children:(0,y.jsx)(L.Z.Text,{strong:!0,children:s.currentTitle||"Current"})}),(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(r$,{filepath:e,before:s.baseline||"",after:s.current||"",editorProps:{height:Math.floor(window.innerHeight/1.25)}})})]},r):null]})},lc=({text:e="View Changes",...t})=>(0,y.jsx)(rk,{text:e,buttonProps:{size:"small",icon:(0,y.jsx)(lo.Z,{})},drawerProps:{destroyOnClose:!0,title:`Content diff for "${t.file}"`},children:(0,y.jsx)(ld,{...t})});var lu=((x=lu||{}).New="New",x.Changed="Changed",x.Deleted="Deleted",x.NotChanged="Not Changed",x);var lh=((m=lh||{}).Name="Sorted by Name",m.Size="Sorted by Size",m.Delta="Sorted by Delta",m);let lp=(e,t,r,n)=>(0,y.jsx)(y.Fragment,{children:t-e==0?(0,y.jsx)(y.Fragment,{}):(0,y.jsxs)(L.Z.Text,{strong:!0,style:{color:r===F.Client.RsdoctorClientDiffState.Up?k.Red:k.Green,...n},children:[r===F.Client.RsdoctorClientDiffState.Up?"+":"-",t0(Math.abs(t-e))]})}),lx=/[a-fA-F0-9]{20,}/,lm=(e,t,r)=>{let n=(e,r)=>(e.current?.size[t]||0)-(e.baseline?.size[t]||0)-(r.current?.size[t]||0)+(r.baseline?.size[t]||0),s=r?(e,t)=>n(e,t):(r,n)=>(r[e]?.size[t]||0)-(n[e]?.size[t]||0);return{width:200,sorter:(e,t)=>s(e,t),render:(r,n)=>{if(!n[e])return"-";let s=n[e].size[t];return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:t0(s)}),"current"===e?lp(n.baseline?.size[t]||0,s,(n.baseline?.size[t]||0)>s?F.Client.RsdoctorClientDiffState.Down:F.Client.RsdoctorClientDiffState.Up):null]})}}},lf=(e,t,r)=>{let[n,s]=(0,W.useState)(!1),i="baseline"===e;return{title:()=>{let n=i?t:r,s=(0,rD.Z)(e),l=eN(t,r);return(0,y.jsxs)("div",{children:[(0,y.jsx)(L.Z.Text,{children:s}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(rx.Z,{title:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:[s," modules is ",n]}),i?null:(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["Percent is ",t1(l.percent)]})]}),children:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{type:"secondary",style:{fontSize:10,fontWeight:400},children:n}),(0,y.jsx)(G.Z,{})]})})]})},children:[{title:"Source Size",...lm(e,"sourceSize",n)},{title:"Parsed Size",defaultSortOrder:i?void 0:"descend",...lm(e,"parsedSize",n)}],filterSearch:!0,filters:[{text:"Show Changed",value:lu.NotChanged},{text:"Show All",value:"All"}],onFilter:(e,t)=>(e===lu.NotChanged?s(!0):s(!1),e!==lu.NotChanged||lj(t)!==e)}},lg=({data:e,baseline:t,current:r})=>{let{modules:n}=t.moduleGraph,{modules:s}=r.moduleGraph,{chunks:i}=t.chunkGraph,{chunks:l}=r.chunkGraph,a=t.root,o=r.root,[d,c]=(0,W.useState)(""),u=(0,W.useRef)(null),h=(e,t)=>{t(),c(e[0])},p=e=>{e(),c("")},x="__is_baseline__",m=(0,W.useMemo)(()=>e.baseline?eC(e.baseline,i,n).map(e=>({...e,[x]:!0})).filter(e=>!e.concatenationModules?.length):[],[e,t]),f=(0,W.useMemo)(()=>e.current?eC(e.current,l,s).map(e=>({...e,[x]:!1})).filter(e=>!e.concatenationModules?.length):[],[e,r]),g=e=>tc(e.path,e.__is_baseline__?a:o),j=(0,W.useMemo)(()=>{let e=[...m,...f],t=new Map;return e.forEach(e=>{let r=e.webpackId?.replace(lx,"")||e.path?.replace(lx,""),n=t.get(r);!n&&(n={path:r}),e[x]?n.baseline=e:n.current=e,t.set(r,n)}),[...t.values()]},[m,f,d]),{bModulesCount:Z,cModulesCount:b,totalCount:v}=(0,W.useMemo)(()=>{let e=e=>g(e).alias.indexOf(d)>-1,t=j.filter(e=>e.baseline),r=j.filter(e=>e.current),n=j.length;return d&&(t=t.filter(e),r=r.filter(e),n=j.filter(e).length),{bModulesCount:t.length,cModulesCount:r.length,totalCount:n}},[j,d]);return(0,y.jsx)(sy.Z,{dataSource:j,rowKey:e=>e.path,size:"small",pagination:{size:"small"},bordered:!0,scroll:{x:1500},columns:[{fixed:"left",title:()=>(0,y.jsxs)("div",{children:[(0,y.jsxs)(L.Z.Text,{children:["Modules of ",`"${e.alias}"`]}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsxs)(rx.Z,{title:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["filtered modules: ",v]}),(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["total modules: ",j.length]})]}),children:[(0,y.jsxs)(L.Z.Text,{type:"secondary",style:{fontSize:10,fontWeight:400,marginRight:4},children:[v,"/",j.length]}),(0,y.jsx)(G.Z,{})]})]}),filterDropdown:({setSelectedKeys:e,selectedKeys:t,confirm:r,clearFilters:n})=>(0,y.jsxs)("div",{style:{padding:8},onKeyDown:e=>e.stopPropagation(),children:[(0,y.jsx)(sO.Z,{ref:u,placeholder:"Search by file name",value:t[0],onChange:t=>e(t.target.value?[t.target.value]:[]),onPressEnter:()=>h(t,r),style:{marginBottom:8,display:"block"}}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)($.ZP,{type:"primary",onClick:()=>h(t,r),icon:(0,y.jsx)(i9.Z,{}),size:"small",style:{width:90},children:"Search"}),(0,y.jsx)($.ZP,{onClick:()=>{n&&p(n),e([]),h([],r)},size:"small",style:{width:90},children:"Reset"})]})]}),filterSearch:!0,filterIcon:e=>(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{type:d?void 0:"secondary",style:{fontWeight:400},children:d||"Search by file name"}),(0,y.jsx)(i9.Z,{style:{color:e?k.Blue:void 0}})]}),onFilterDropdownOpenChange:e=>{e&&setTimeout(()=>u.current?.focus(),100)},onFilter:(e,t)=>g(t).alias.indexOf(e)>-1,render:(e,t)=>{let{alias:r,inNodeModules:n}=g(t);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rx.Z,{title:t.path,children:(0,y.jsx)(L.Z.Text,{copyable:{text:t.path},children:r})}),n?(0,y.jsx)(rc.Z,{color:"warning",children:"node_modules"}):null,(0,y.jsx)(ly,{type:lj(t)})]})}},lf("current",Z,b),lf("baseline",Z,b),{title:"Actions",width:200,render:(e,n)=>(0,y.jsx)(B.Z,{direction:"vertical",style:{maxWidth:170},children:(0,y.jsx)(lc,{text:"View Changes",file:n.path,data:[{baseline:t.moduleCodeMap[n.baseline?.id]?.source,current:r.moduleCodeMap[n.current?.id]?.source,group:"Source"},{baseline:t.moduleCodeMap[n.baseline?.id]?.transformed,current:r.moduleCodeMap[n.current?.id]?.transformed,group:"Transformed Source"},{baseline:t.moduleCodeMap[n.baseline?.id]?.parsedSource,current:r.moduleCodeMap[n.current?.id]?.parsedSource,group:"Parsed Source"}]})})}]})};function lj(e){if(e.baseline&&!e.current)return lu.Deleted;if(!e.baseline&&e.current)return lu.New;if(e.baseline&&e.current)return e.baseline.size.sourceSize===e.current.size.sourceSize&&e.baseline.size.parsedSize===e.current.size.parsedSize?lu.NotChanged:lu.Changed;throw Error("Update Type not match")}let ly=({type:e})=>e===lu.NotChanged?(0,y.jsx)(rx.Z,{title:"It hasn't changed between Baseline and Current",children:(0,y.jsx)(rc.Z,{color:"success",children:"Not Changed"})}):e===lu.Changed?(0,y.jsx)(rx.Z,{title:"It has been changed between Baseline and Current",children:(0,y.jsx)(rc.Z,{color:"warning",children:"Changed"})}):e===lu.New?(0,y.jsx)(rx.Z,{title:"It is created in Current",children:(0,y.jsx)(rc.Z,{color:"error",children:"New"})}):e===lu.Deleted?(0,y.jsx)(rx.Z,{title:"It has been deleted in Current",children:(0,y.jsx)(rc.Z,{color:"error",children:"Deleted"})}):null,lZ=({baseline:e,current:t})=>{let r=(0,W.useMemo)(()=>tb(e.moduleGraph.modules),[e]),n=(0,W.useMemo)(()=>tb(t.moduleGraph.modules),[t]),s=e.chunkGraph.chunks,i=t.chunkGraph.chunks,l=e.root,a=t.root,[o,d]=(0,W.useState)(),[c,u]=(0,W.useState)([]),h=(0,W.useMemo)(()=>{let e={};return r.forEach(t=>{let r=t.webpackId?.replace(lx,"")||t.path?.replace(lx,"");e[r]?console.warn("[Baseline Module Exists]: ",t,e):e[r]={path:r,baseline:t}}),n.forEach(t=>{let r=t.webpackId?.replace(lx,"")||t.path?.replace(lx,"");!e[r]&&(e[r]={path:r}),e[r].current=t}),(0,rS.Z)(e)},[r,n]),p=(0,W.useMemo)(()=>{let e=h.slice();return o&&(e=e.filter(e=>e.path.indexOf(o)>-1)),c.length&&(e=e.filter(e=>(0,tX.Z)(c,lj(e)))),e},[h,o,c]),{bFilteredModulesLength:x,cFilteredModulesLength:m}=(0,W.useMemo)(()=>({bFilteredModulesLength:p.filter(e=>e.baseline).length,cFilteredModulesLength:p.filter(e=>e.current).length}),[p]);return(0,y.jsxs)(rt.Z,{gutter:[I.BasePadding,I.BasePadding],children:[(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsxs)(B.Z,{wrap:!0,children:[(0,y.jsx)(sB,{icon:(0,y.jsx)(iC.Z,{}),label:"",labelStyle:{width:45},placeholder:"Search by name",onChange:e=>{d(e)}}),(0,y.jsx)(nC.Z,{mode:"multiple",placeholder:"Filter by changed type",style:{width:200},options:(0,rS.Z)(lu).map(e=>({label:e,value:e})),allowClear:!0,onChange:e=>{u(e)}})]})}),(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(sy.Z,{bordered:!0,sticky:{offsetHeader:54},pagination:{pageSize:20,size:"small"},scroll:{x:1700},dataSource:p,rowKey:e=>e.path,columns:[{fixed:"left",title:(0,y.jsxs)(rx.Z,{title:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["filtered modules is ",p.length," (Current & Baseline)"]}),(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["total modules is ",h.length," (Current & Baseline)"]})]}),children:[(0,y.jsx)(L.Z.Text,{strong:!0,children:"Modules"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsxs)(L.Z.Text,{type:"secondary",style:{fontSize:10,fontWeight:400,marginRight:4},children:[p.length,"/",h.length]}),(0,y.jsx)(G.Z,{})]}),render:(e,t)=>{let{alias:r,inNodeModules:n}=tc(t.path,t.baseline?l:a);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rx.Z,{title:t.path,children:(0,y.jsx)(L.Z.Text,{copyable:{text:t.path},children:r})}),(0,y.jsx)(ly,{type:lj(t)}),n?(0,y.jsx)(rc.Z,{color:"warning",children:"node_modules"}):null]})}},lf("current",x,m),lf("baseline",x,m),{title:"in Assets",render:(e,t)=>{let r=[],n=[];return(t.current&&ev(t.current,i).forEach(e=>e.assets.forEach(e=>n.push(e))),t.baseline&&ev(t.baseline,s).forEach(e=>e.assets.forEach(e=>r.push(e))),r.length||n.length)?(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,la.Z)(n).filter(Boolean).map(e=>(0,y.jsx)(rE,{label:"Current",value:e},`c_${e}`)),(0,la.Z)(r).filter(Boolean).map(e=>(0,y.jsx)(rE,{label:"Baseline",value:e},`b_${e}`))]}):null}},{title:"Actions",width:200,render:(r,n)=>{let s=lj(n)===lu.Changed;return(0,y.jsxs)(B.Z,{direction:"vertical",style:{maxWidth:170},children:[s?(0,y.jsx)(lc,{text:"View Changes",file:n.path,data:[{baseline:e.moduleCodeMap[n.baseline?.id]?.source,current:t.moduleCodeMap[n.current?.id]?.source,group:"Source"},{baseline:e.moduleCodeMap[n.baseline?.id]?.transformed,current:t.moduleCodeMap[n.current?.id]?.transformed,group:"Transformed Source"},{baseline:e.moduleCodeMap[n.baseline?.id]?.parsedSource,current:t.moduleCodeMap[n.current?.id]?.parsedSource,group:"Parsed Source"}]}):null,(0,y.jsx)(lc,{text:"Current Result Viewer",file:n.path,data:[{baseline:t.moduleCodeMap[n.current?.id]?.source,current:t.moduleCodeMap[n.current?.id]?.transformed,baselineTitle:"Current Source",currentTitle:"Current Transformed Source",group:"Transformed Source"},{baseline:t.moduleCodeMap[n.current?.id]?.source,current:t.moduleCodeMap[n.current?.id]?.parsedSource,baselineTitle:"Current Source",currentTitle:"Current Parsed Source",group:"Parsed Source"}]})]})}}]})})]})},lb=e=>{if(e.baseline&&e.current){let t=e.baseline.map(e=>e.version).sort().join();return t===e.current.map(e=>e.version).sort().join()?lu.NotChanged:lu.Changed}return e.baseline||e.current?e.baseline&&!e.current?lu.Deleted:lu.New:lu.NotChanged},lv=e=>lb(e)!==lu.NotChanged,lS=({dataSource:e})=>{let{newCount:t,deleteCount:r,changedCount:n}=(0,W.useMemo)(()=>({newCount:e.filter(e=>e.updateType===lu.New).length,deleteCount:e.filter(e=>e.updateType===lu.Deleted).length,changedCount:e.filter(e=>e.updateType===lu.Changed).length}),[e]);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rE,{label:"New",value:t,type:t>0?"error":"default",tooltip:`Current has ${t} packages which not found in Baseline`}),(0,y.jsx)(rE,{label:"Deleted",value:r,type:r>0?"error":"default",tooltip:`Current delete ${r} packages than Baseline`}),(0,y.jsx)(rE,{label:"Changed",value:n,type:n>0?"error":"default",tooltip:`Current has ${n} changed packages than Baseline`})]})},lM=({baseline:e,current:t})=>{let{packages:r=[]}=e||{},{packages:n=[]}=t||{},s={},i=(e,t)=>{!s[e.name]&&(s[e.name]={name:e.name,updateType:lu.NotChanged}),!s[e.name][t]&&(s[e.name][t]=[]),s[e.name][t].push(e)};r.forEach(e=>i(e,"baseline")),n.forEach(e=>i(e,"current"));let l=[],a=[];return(0,rS.Z)(s).forEach(e=>{lv(e)?l.push(e):a.push(e)}),l.concat(a).map(e=>({...e,updateType:lb(e)}))},lC=({baseline:e,current:t})=>{let{packages:r=[]}=e||{},{packages:n=[]}=t||{};if(!r.length&&!n.length)return(0,y.jsx)(rl.Z,{});let s=(0,W.useMemo)(()=>(0,la.Z)(r.concat(n).map(e=>e.name)),[r,n]),[i,l]=(0,W.useState)([]),[a,o]=(0,W.useState)([]),d=(0,W.useMemo)(()=>lM({baseline:e,current:t}),[e,t]),c=(0,W.useMemo)(()=>d.filter(e=>a.length?a.indexOf(e.updateType)>-1:!i.length||i.indexOf(e.name)>-1),[d,i,a]);return(0,y.jsxs)(rt.Z,{gutter:[I.BasePadding,I.BasePadding],children:[(0,y.jsx)(rr.Z,{span:24,style:{marginTop:16},children:(0,y.jsxs)(B.Z,{wrap:!0,children:[(0,y.jsx)(nC.Z,{mode:"multiple",placeholder:"Filter by package names",style:{width:400},options:s.map(e=>{let t=d.find(t=>t.name===e);return t&&lv(t)?{label:(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:e}),(0,y.jsx)(ly,{type:lb(t)})]}),value:e}:{label:e,value:e}}),allowClear:!0,onChange:e=>{l(e)}}),(0,y.jsx)(nC.Z,{mode:"multiple",placeholder:"Filter by changed type",style:{width:200},options:(0,rS.Z)(lu).map(e=>({label:e,value:e})),allowClear:!0,onChange:e=>{o(e)}})]})}),(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(sy.Z,{bordered:!0,sticky:{offsetHeader:54},pagination:{pageSize:20,size:"small"},dataSource:c,rowKey:e=>e.name,columns:[{title:()=>(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:"Package Name"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(rx.Z,{title:`Filtered Package Count is ${c.length}, Total Package Count is ${d.length}`,children:(0,y.jsxs)(L.Z.Text,{type:"secondary",style:{fontSize:10,fontWeight:400},children:[c.length," / ",d.length]})})]}),render:(e,t)=>t.updateType!==lu.NotChanged?(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:t.name}),(0,y.jsx)(ly,{type:t.updateType})]}):t.name},{title:()=>(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:"Current"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(lS,{dataSource:d})]}),children:[{title:"Version",render:(e,t)=>t.current?(0,y.jsx)(B.Z,{direction:"vertical",children:t.current.map(e=>(0,y.jsx)(rE,{label:"version",value:e.version,tooltip:e.root,type:t.updateType===lu.Deleted?"error":t.updateType===lu.Changed?"warn":"default"},e.version))}):null},{title:"Parsed Size",render:(e,t)=>{let r=(0,ru.Z)(t.current,e=>e.size.parsedSize),n=()=>(0,y.jsx)(r8,{baseline:(0,ru.Z)(t.baseline,e=>e.size.parsedSize),current:r});return t.current?(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{strong:t.updateType!==lu.NotChanged,children:t0(r)}),(0,y.jsx)(n,{})]}):(0,y.jsx)(n,{})}}]},{title:"Baseline",children:[{title:"Version",render:(e,t)=>t.baseline?(0,y.jsx)(B.Z,{direction:"vertical",children:t.baseline.map(e=>(0,y.jsx)(rE,{label:"version",value:e.version,tooltip:e.root,type:t.updateType===lu.Deleted?"error":t.updateType===lu.Changed?"warn":"default"},e.version))}):null},{title:"Parsed Size",render:(e,t)=>{if(t.baseline){let e=(0,ru.Z)(t.baseline,e=>e.size.parsedSize);return(0,y.jsx)(L.Z.Text,{children:t0(e)})}return null}}]}]})})]})},lw=({baseline:e,current:t,assetsDiffResult:r})=>{let n=tb(e.moduleGraph.modules),s=tb(t.moduleGraph.modules),i=tS(e.errors),l=tS(t.errors),a=tZ(e.moduleGraph),o=tZ(t.moduleGraph),d=e.root,c=t.root,u=lM({baseline:e.packageGraph,current:t.packageGraph}),h=[{title:["Bundle Size"],value:[r.all.total]},{title:["Total JS","Initial JS"],value:[r.js.total,r.js.initial]},{title:["Total CSS","Initial CSS"],value:[r.css.total,r.css.initial]},{title:["Images","Fonts","Media"],value:[r.imgs.total,r.fonts.total,r.media.total]},{title:["HTML"],value:[r.html.total]},{title:["Others"],value:[r.others.total]}];return(0,y.jsxs)(rt.Z,{gutter:[I.BasePadding,I.BasePadding],wrap:!0,style:{marginBottom:I.BasePadding},children:[h.map(e=>(0,y.jsx)(rr.Z,{style:{minWidth:335},children:(0,y.jsx)(nt,{titles:e.title,datas:e.value,showPercentInTitle:!0})},e.title.join(","))),(0,y.jsx)(rr.Z,{style:{minWidth:335},children:(0,y.jsx)(nt,{titles:["Duplicate Packages"],datas:[{size:{baseline:i.length,current:l.length},count:{baseline:i.length,current:l.length},percent:0,state:F.Client.RsdoctorClientDiffState.Equal}],formatter:(r,n)=>(0,y.jsx)(rP,{duplicatePackages:"baseline"===n?i:l,moduleGraph:"baseline"===n?a:o,cwd:"baseline"===n?d:c,buttonProps:{size:"small"},moduleCodeMap:"baseline"===n?e.moduleCodeMap:t.moduleCodeMap})})}),(0,y.jsx)(rr.Z,{style:{minWidth:335},children:(0,y.jsx)(nt,{titles:["Modules"],datas:[{size:{baseline:n.length,current:s.length},count:{baseline:n.length,current:s.length},percent:0,state:F.Client.RsdoctorClientDiffState.Equal}],formatter:(e,t)=>{if("baseline"===t)return e;let r=eN(n.length,s.length);return(0,y.jsxs)(B.Z,{style:{fontSize:"inherit"},children:[(0,y.jsx)(L.Z.Text,{style:{fontSize:"inherit"},children:e}),(0,y.jsx)(r7,{...r})]})}})}),(0,y.jsx)(rr.Z,{style:{minWidth:335},children:(0,y.jsx)(nt,{titles:[(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{style:{color:"inherit"},children:"Packages"}),(0,y.jsx)(lS,{dataSource:u})]},"0")],datas:[{size:{baseline:u.filter(e=>e.baseline).length,current:u.filter(e=>e.current).length},count:{baseline:u.filter(e=>e.baseline).length,current:u.filter(e=>e.current).length},percent:0,state:F.Client.RsdoctorClientDiffState.Equal}],formatter:(e,t)=>"baseline"===t?e:(0,y.jsx)(B.Z,{children:e})})})]})},lP=({assetsDiffResult:e})=>{let t=[{type:"JS",data:e.js},{type:"CSS",data:e.css},{type:"Imgs",data:e.imgs},{type:"Fonts",data:e.fonts},{type:"Media",data:e.media},{type:"HTML",data:e.html},{type:"Others",data:e.others}];return(0,y.jsx)(sy.Z,{bordered:!0,pagination:!1,dataSource:t,rowKey:e=>e.type,style:{marginTop:I.BasePadding-I.BasePadding/4},columns:[{title:"File Type",dataIndex:"type",key:"type",render:e=>(0,y.jsx)(L.Z.Text,{strong:!0,children:e})},{title:"Size",dataIndex:"data",key:"size",children:[{title:"Current",dataIndex:"data",key:"csize",render:e=>{let t=(0,y.jsxs)(W.Fragment,{children:[(0,y.jsx)(L.Z.Text,{strong:!0,children:t0(e.total.size.current)}),(0,y.jsx)(r7,{percent:e.total.percent,state:e.total.state}),lp(e.total.size.baseline,e.total.size.current,e.total.state)]});return e.initial?(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rc.Z,{color:k.Blue,children:"Total"}),t]}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rc.Z,{color:k.Blue,children:"Initial"}),(0,y.jsx)(L.Z.Text,{strong:!0,children:t0(e.initial.size.current)}),(0,y.jsx)(r7,{percent:e.initial.percent,state:e.initial.state}),lp(e.initial.size.baseline,e.initial.size.current,e.initial.state)]})]}):(0,y.jsx)(B.Z,{children:t})}},{title:"Baseline",dataIndex:"data",key:"bsize",render:e=>{let t=(0,y.jsx)(L.Z.Text,{children:t0(e.total.size.baseline)});return e.initial?(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rc.Z,{color:k.Blue,children:"Total"}),t]}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rc.Z,{color:k.Blue,children:"Initial"}),(0,y.jsx)(L.Z.Text,{children:t0(e.initial.size.baseline)})]})]}):t}}]},{title:"Count",dataIndex:"data",key:"count",children:[{title:"Current",dataIndex:"data",key:"ccount",render:e=>{let t=(0,y.jsx)(L.Z.Text,{strong:!0,children:e.total.count.current});return e.initial?(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rc.Z,{color:k.Blue,children:"Total"}),t]}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rc.Z,{color:k.Blue,children:"Initial"}),(0,y.jsx)(L.Z.Text,{strong:!0,children:e.initial.count.current})]})]}):(0,y.jsx)(B.Z,{children:t})}},{title:"Baseline",dataIndex:"data",key:"bcount",render:e=>{let t=(0,y.jsx)(L.Z.Text,{children:e.total.count.baseline});return e.initial?(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rc.Z,{color:k.Blue,children:"Total"}),t]}),(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(rc.Z,{color:k.Blue,children:"Initial"}),(0,y.jsx)(L.Z.Text,{children:e.initial.count.baseline})]})]}):(0,y.jsx)(B.Z,{children:t})}}]}]})};var lI=r("74814"),lk=r("81654"),lD=r("47888"),lT=r("63611"),lA=r("96185"),lE=r("91253"),lN=r("82596");let l_={JS:[F.Constants.JSExtension],CSS:[F.Constants.CSSExtension],HTML:[F.Constants.HtmlExtension],Imgs:F.Constants.ImgExtensions,Fonts:F.Constants.FontExtensions,Media:F.Constants.MediaExtensions,Others:[]},lz=(0,lI.Z)((0,rS.Z)(l_)),lR=({data:e})=>{let t=(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{strong:!0,children:e.alias}),(0,y.jsx)(rx.Z,{title:(0,y.jsxs)(B.Z,{style:{color:"inherit"},direction:"vertical",children:[e.current?(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["Current realpath: ",e.current.path]}):null,e.baseline?(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["Baseline realpath: ",e.baseline.path]}):null]}),children:(0,y.jsx)(G.Z,{})})]});return e.baseline&&!e.current?(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(lD.Z,{style:{color:k.Red}}),t]}):!e.baseline&&e.current?(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(lT.Z,{style:{color:k.Green}}),t]}):e.baseline&&e.current?(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(lA.Z,{style:{color:k.Yellow}}),t]}):t},lO=({baseline:e,current:t,outputFilename:r})=>{let[n,s]=(0,W.useState)(),[i,l]=(0,W.useState)([]),[a,o]=(0,W.useState)([]),[d,c]=(0,W.useState)(lh.Size),[u,h]=(0,W.useState)(null),[p,x]=(0,W.useState)(null),{assets:m}=e.chunkGraph,{assets:f}=t.chunkGraph,g=(0,W.useMemo)(()=>{let e={};return u&&p?(e.choose={alias:`${u}
|
|
163
|
+
${p}`,current:f.find(e=>e.path===p),baseline:m.find(e=>e.path===u)},(0,rS.Z)(e)):(m.forEach(t=>{let n=eP(t.path,r);e[n]?console.warn("[Baseline Asset Exists]: ",t,e):e[n]={alias:n,baseline:t}}),f.forEach(t=>{let n=eP(t.path,r);!e[n]&&(e[n]={alias:n}),e[n].current=t}),(0,rS.Z)(e))},[m,f,u,p]),j=(0,W.useMemo)(()=>{let s=g.slice();if(n&&(s=s.filter(e=>e.alias.indexOf(n)>-1)),i.length){let e=(0,lI.Z)(i.map(e=>l_[e])),t=i.indexOf("Others")>-1;s=s.filter(r=>{let n=r.baseline||r.current;return!!ek(n,e)||!!t&&!ek(n,lz)})}if(a.length&&(s=s.filter(e=>{if(e.baseline&&!e.current)return(0,tX.Z)(a,lu.Deleted);if(!e.baseline&&e.current)return(0,tX.Z)(a,lu.New);if(e.baseline&&e.current)return e.baseline.size===e.current.size?(0,tX.Z)(a,lu.NotChanged):(0,tX.Z)(a,lu.Changed);return!1})),d){if(d===lh.Name)s.sort((e,t)=>e.alias.localeCompare(t.alias));else{let{prev:n,others:i}=s.reduce((e,t)=>(t.current?t.baseline?e.prev.unshift(t):e.prev.push(t):e.others.push(t),e),{prev:[],others:[]});s=[...n.sort((n,s)=>{if(s.current&&n.current){if(d===lh.Delta){let{percent:i}=e_(e.chunkGraph,t.chunkGraph,e=>eP(e.path,r)===n.alias),{percent:l}=e_(e.chunkGraph,t.chunkGraph,e=>eP(e.path,r)===s.alias);return l-i}return s.current.size-n.current.size}return -1}),...i]}}return s},[g,n,i,a,d]),Z=(0,W.useMemo)(()=>(0,ru.Z)(j,e=>e.current?e.current.size:0)||0,[j]),b=(0,W.useMemo)(()=>(0,ru.Z)(j,e=>e.baseline?e.baseline.size:0)||0,[j]);return(0,y.jsxs)(rt.Z,{gutter:[I.BasePadding,I.BasePadding],children:[(0,y.jsxs)(rr.Z,{span:24,children:[(0,y.jsxs)(B.Z,{wrap:!0,children:[(0,y.jsx)(sB,{icon:(0,y.jsx)(iC.Z,{}),label:"",labelStyle:{width:45},placeholder:"Search by file name",onChange:e=>{s(e)}}),(0,y.jsx)(nC.Z,{mode:"multiple",placeholder:"Filter by file type",style:{width:250},options:(0,lk.Z)(l_).map(e=>({label:e,value:e})),allowClear:!0,onChange:e=>{l(e)}}),(0,y.jsx)(nC.Z,{mode:"multiple",placeholder:"Filter by file changed type",style:{width:200},options:(0,rS.Z)(lu).map(e=>({label:e,value:e})),allowClear:!0,onChange:e=>{o(e)}}),(0,y.jsx)(nC.Z,{suffixIcon:(0,y.jsx)(lE.Z,{}),options:(0,rS.Z)(lh).map(e=>({label:e,value:e})),value:d,onChange:e=>{c(e)}})]}),(0,y.jsxs)(rt.Z,{style:{marginTop:10},gutter:[6,6],children:[(0,y.jsx)(rr.Z,{children:(0,y.jsx)($.ZP,{children:"Select Baseline Asset and Current Asset to Diff "})}),(0,y.jsx)(rr.Z,{children:(0,y.jsx)(nC.Z,{allowClear:!0,placeholder:"select baseline assets",showSearch:!0,style:{width:300},options:(0,rS.Z)(e.chunkGraph.assets).map(e=>({label:e.path,value:e.path})),onChange:e=>h(e)})}),(0,y.jsx)(rr.Z,{children:(0,y.jsx)(nC.Z,{allowClear:!0,placeholder:"select current assets",showSearch:!0,style:{width:300},options:(0,rS.Z)(t.chunkGraph.assets).map(e=>({label:e.path,value:e.path})),onChange:e=>x(e)})})]})]}),(0,y.jsx)(rr.Z,{span:24,children:(0,y.jsx)(sy.Z,{bordered:!0,sticky:{offsetHeader:54},pagination:{pageSize:20,size:"small"},dataSource:j,rowKey:e=>e.alias,expandable:{expandedRowRender:r=>(0,y.jsx)("div",{style:{margin:I.BasePadding/3},children:(0,y.jsx)(lg,{data:r,baseline:e,current:t})}),columnTitle:(0,y.jsx)(rx.Z,{title:"Click to expand row to see the modules which the chunk contains",placement:"left",children:(0,y.jsx)(lN.Z,{style:{cursor:"pointer"}})})},columns:[{title:(0,y.jsxs)(rx.Z,{title:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["filtered assets is ",j.length]}),(0,y.jsxs)(L.Z.Text,{style:{color:"inherit"},children:["total assets is ",g.length]})]}),children:[(0,y.jsx)(L.Z.Text,{strong:!0,children:"Assets"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsxs)(L.Z.Text,{type:"secondary",style:{fontSize:10,fontWeight:400,marginRight:4},children:[j.length,"/",g.length]}),(0,y.jsx)(G.Z,{})]}),render:(e,t)=>(0,y.jsx)(lR,{data:t})},{title:()=>{let e=t0(Z),t=eN(b,Z);return(0,y.jsxs)(rx.Z,{title:`Current size is ${e}, Delta is ${t1(t.percent)}`,children:[(0,y.jsx)(L.Z.Text,{strong:!0,children:"Current"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsxs)(L.Z.Text,{style:{fontSize:10,fontWeight:400,marginRight:4},children:[(0,y.jsx)(L.Z.Text,{style:{fontSize:"inherit",marginRight:8},children:e}),(0,y.jsx)(r8,{fontSize:"inherit",baseline:b,current:Z}),lp(b,Z,b>Z?F.Client.RsdoctorClientDiffState.Down:F.Client.RsdoctorClientDiffState.Up,{fontSize:10,fontWeight:400,marginLeft:4})]}),(0,y.jsx)(G.Z,{})]})},render:(n,s)=>{if(s.current){let{percent:n,state:i}=e_(e.chunkGraph,t.chunkGraph,e=>eP(e.path,r)===s.alias),l=eA(s.current,t.chunkGraph.chunks);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:t0(s.current.size)}),(0,y.jsx)(r7,{percent:n,state:i}),l?(0,y.jsx)(rc.Z,{color:k.Blue,children:"initial"}):null]})}return"-"}},{title:()=>{let e=t0(b);return(0,y.jsxs)(rx.Z,{title:`Baseline size is ${e}`,children:[(0,y.jsx)(L.Z.Text,{strong:!0,children:"Baseline"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(L.Z.Text,{style:{fontSize:10,fontWeight:400,marginRight:4},children:e}),(0,y.jsx)(G.Z,{})]})},render:(t,r)=>{if(r.baseline){let t=eA(r.baseline,e.chunkGraph.chunks);return(0,y.jsxs)(B.Z,{children:[(0,y.jsx)(L.Z.Text,{children:t0(r.baseline.size)}),t?(0,y.jsx)(rc.Z,{color:k.Blue,children:"initial"}):null]})}return"-"}},{title:"Actions",key:"actions",render:(e,t)=>(0,y.jsx)(lc,{file:t.alias,data:[{baseline:t.baseline?.content,current:t.current?.content,group:"assets"}]})}]})})]})},lB=e=>{let{api:t,body:r,children:n,manifests:s}=e,i=ty(),[l,a]=i[F.Client.RsdoctorClientUrlQuery.BundleDiffFiles]?.split(",")||[];return s?.length?(0,y.jsx)(y.Fragment,{children:n(s[0].data,s[1].data)}):(0,y.jsx)(rM,{api:t,body:r,manifestLoader:l?()=>e8(l):void 0,children:e=>(0,y.jsx)(rM,{api:t,body:r,manifestLoader:a?()=>e8(a):void 0,children:t=>n(e,t)})})},lL=({manifests:e})=>((0,W.useEffect)(()=>{console.log("BundleDiff Manifests: ",e)},[e]),(0,y.jsx)(lB,{api:F.SDK.ServerAPI.API.GetBundleDiffSummary,manifests:e,children:(e,t)=>{var r,n;let s=e.chunkGraph===t.chunkGraph,i=e.chunkGraph,l=s?i:t.chunkGraph;let a={all:{total:e_(r=i,n=l)},js:{total:e_(r,n,F.Constants.JSExtension),initial:e_(r,n,F.Constants.JSExtension,!0)},css:{total:e_(r,n,F.Constants.CSSExtension),initial:e_(r,n,F.Constants.CSSExtension,!0)},imgs:{total:e_(r,n,F.Constants.ImgExtensions)},html:{total:e_(r,n,F.Constants.HtmlExtension)},media:{total:e_(r,n,F.Constants.MediaExtensions)},fonts:{total:e_(r,n,F.Constants.FontExtensions)},others:{total:e_(r,n,e=>!ek(e,[F.Constants.JSExtension,F.Constants.CSSExtension,F.Constants.HtmlExtension].concat(F.Constants.ImgExtensions,F.Constants.MediaExtensions,F.Constants.FontExtensions,F.Constants.MapExtensions)))}};return(0,y.jsxs)("div",{children:[(0,y.jsxs)(nv.Z.Group,{children:[(0,y.jsx)(rx.Z,{placement:"leftBottom",title:(0,y.jsx)(B.Z,{direction:"vertical",children:[{title:"Baseline",data:e},{title:"Current",data:t}].map(({title:e,data:t})=>(0,y.jsx)(rn.Z,{size:"small",children:(0,y.jsxs)(B.Z,{direction:"vertical",children:[(0,y.jsx)(L.Z.Text,{strong:!0,children:e}),(0,y.jsxs)(B.Z,{style:{fontSize:10},children:[(0,y.jsx)(L.Z.Text,{style:{fontSize:"inherit",width:30,display:"inline-block"},children:"Hash"}),(0,y.jsx)(ro.Z,{type:"vertical"}),(0,y.jsx)(L.Z.Text,{type:"secondary",style:{fontSize:"inherit"},children:t.hash||"-"})]}),t.cloudManifestUrl?(0,y.jsx)($.ZP,{type:"link",size:"small",style:{padding:0,fontSize:10},onClick:()=>window.open(t.cloudManifestUrl),children:"Open File"}):null]})},e))}),children:(0,y.jsx)(nv.Z,{icon:(0,y.jsx)(G.Z,{})})}),(0,y.jsx)(rR.Z,{title:(0,y.jsxs)(L.Z.Text,{children:["Are you sure to",(0,y.jsx)(L.Z.Text,{strong:!0,children:" re-upload "}),"json files for bundle diff?"]}),onConfirm:()=>{},okText:"Yes",cancelText:"Cancel",placement:"topLeft",trigger:"hover",children:(0,y.jsx)(nv.Z,{icon:(0,y.jsx)(ll.Z,{})})}),(0,y.jsx)(nv.Z.BackTop,{})]}),(0,y.jsx)(lw,{baseline:e,current:t,onlyBaseline:s,assetsDiffResult:a}),(0,y.jsx)(rd.Z,{defaultActiveKey:"Overview",tabBarStyle:{marginBottom:I.BasePadding/3},items:[{label:"Overview",key:"Overview",children:(0,y.jsx)(lP,{assetsDiffResult:a})},{label:"Assets",key:"Assets",children:(0,y.jsx)(lO,{outputFilename:e.outputFilename,baseline:e,current:t})},{label:"Modules",key:"Modules",children:(0,y.jsx)(lZ,{baseline:e,current:t,onlyBaseline:s,assetsDiffResult:a})},{label:"Packages",key:"Packages",children:(0,y.jsx)(lC,{baseline:e.packageGraph,current:t.packageGraph})}].map(e=>({...e,label:(0,y.jsx)(L.Z.Text,{strong:!0,children:e.label})}))})]})}})),l$=F.Client.RsdoctorClientRoutes.BundleDiff;W.createContext({manifests:[],setManifests(e){},loading:!1,setLoading(e){},async withLoading(e){}});let lG=()=>(0,y.jsx)(lL,{manifests:[]}),lF="Compile Analysis",lW=rC({api:F.SDK.ServerAPI.API.GetClientRoutes,responsePropName:"routes",Component:e=>{var t,r;let{t:n}=tg(),{pathname:s}=(0,tm.TH)(),i=(0,tm.s0)(),{routes:l}=e,a={fontSize:16},o={...a,transform:"translateY(-2px)"},d=[];if(console.log("enableRoutes: ",l),(0,tX.Z)(l,F.Manifest.RsdoctorManifestClientRoutes.Overall)&&d.push({label:n("Overall"),key:n_,icon:(0,y.jsx)(nP.Z,{style:a}),children:[],onTitleClick(e){i(e.key)}}),t=l,(0,tX.Z)(t,F.Manifest.RsdoctorManifestClientRoutes.WebpackLoaders)||(0,tX.Z)(t,F.Manifest.RsdoctorManifestClientRoutes.ModuleResolve)||(0,tX.Z)(t,F.Manifest.RsdoctorManifestClientRoutes.WebpackPlugins))d.push({label:n(lF),key:lF,icon:(0,y.jsx)(nI.Z,{style:a}),children:[(0,tX.Z)(l,F.Manifest.RsdoctorManifestClientRoutes.WebpackLoaders)&&{label:(0,y.jsx)(L.Z.Text,{style:{marginRight:8},children:n(iB)}),key:iL,icon:(0,y.jsx)("img",{src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMTIwMCAxMjAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Im02MDAgMCA1MzAuMyAzMDB2NjAwbC01MzAuMyAzMDAtNTMwLjMtMzAwdi02MDB6IiBmaWxsPSIjZmZmIi8+PHBhdGggZD0ibTEwMzUuNiA4NzkuMy00MTguMSAyMzYuNXYtMTg0LjJsMjYwLjUtMTQzLjN6bTI4LjYtMjUuOXYtNDk0LjZsLTE1MyA4OC4zdjMxNy45em0tOTAxLjUgMjUuOSA0MTguMSAyMzYuNXYtMTg0LjJsLTI2MC41LTE0My4zem0tMjguNi0yNS45di00OTQuNmwxNTMgODguM3YzMTcuOXptMTcuOS01MjYuNiA0MjguOC0yNDIuNnYxNzguMWwtMjc0LjcgMTUxLjEtMi4xIDEuMnptODk0LjMgMC00MjguOC0yNDIuNnYxNzguMWwyNzQuNyAxNTEuMSAyLjEgMS4yeiIgZmlsbD0iIzhlZDZmYiIvPjxwYXRoIGQ9Im01ODAuOCA4ODkuNy0yNTctMTQxLjN2LTI4MGwyNTcgMTQ4LjR6bTM2LjcgMCAyNTctMTQxLjN2LTI4MGwtMjU3IDE0OC40em0tMjc2LjMtNDUzLjcgMjU4LTE0MS45IDI1OCAxNDEuOS0yNTggMTQ5eiIgZmlsbD0iIzFjNzhjMCIvPjwvc3ZnPg==",alt:"",style:{...a,width:16}}),children:[{label:n("Loaders Timeline"),key:iT,icon:(0,y.jsx)(nP.Z,{style:a})},{label:n(iB),key:iL,icon:(0,y.jsx)(nk.Z,{style:a})}]},(0,tX.Z)(l,F.Manifest.RsdoctorManifestClientRoutes.ModuleResolve)&&{label:n("ModuleResolve"),key:iV,icon:(0,y.jsx)(nD.Z,{style:a})},(0,tX.Z)(l,F.Manifest.RsdoctorManifestClientRoutes.WebpackPlugins)&&{label:n("Plugins Analysis"),key:iF,icon:(0,y.jsx)(nT.Z,{style:a})}].filter(e=>!!e)});if(r=l,(0,tX.Z)(r,F.Manifest.RsdoctorManifestClientRoutes.BundleSize)||(0,tX.Z)(r,F.Manifest.RsdoctorManifestClientRoutes.ModuleGraph)||(0,tX.Z)(r,F.Manifest.RsdoctorManifestClientRoutes.TreeShaking))d.push({label:n(ib),key:ib,icon:(0,y.jsx)("span",{style:o,children:"\uD83D\uDCE6"}),children:[(0,tX.Z)(l,F.Manifest.RsdoctorManifestClientRoutes.BundleSize)&&{label:n(ib),key:iv,icon:(0,y.jsx)(nA.Z,{style:a})},(0,tX.Z)(l,F.Manifest.RsdoctorManifestClientRoutes.TreeShaking)&&{label:n("TreeShaking"),key:ls,icon:(0,y.jsx)(nA.Z,{style:a})}].filter(e=>!!e)});let c=(0,y.jsx)(nN.Z,{items:d,mode:"horizontal",onClick:e=>{!e.keyPath.includes("builder-switcher")&&i(e.key)},overflowedIndicator:(0,y.jsx)(nE.Z,{}),style:{height:I.NavBarHeight,lineHeight:`${I.NavBarHeight}px`,minWidth:0,justifyContent:"flex-end",...e.style},selectedKeys:["/"===s?n_:s]},l.join(""));return(0,y.jsx)(rr.Z,{xs:{span:3},md:{span:6},lg:{span:10},xl:{span:11},xxl:{span:12},children:c})},fallbackComponent:()=>null}),lK=()=>{let{i18n:e}=tg(),{isLight:t}=tK(),r=[{value:w.Cn,label:"中文"},{value:w.En,label:"English"}];return(0,y.jsx)(nb.Z.Header,{style:{height:I.NavBarHeight,padding:0,paddingLeft:I.BasePadding,paddingRight:I.BasePadding,position:"fixed",zIndex:999,width:"100%",backgroundColor:t?"#fff":"#141414",transition:"none"},children:(0,y.jsxs)(rt.Z,{justify:"space-between",align:"middle",style:{height:I.NavBarHeight},wrap:!1,children:[(0,y.jsx)(rr.Z,{style:{height:I.NavBarHeight,lineHeight:`${I.NavBarHeight+2}px`},children:(0,y.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"100%"},children:[(0,y.jsx)("img",{style:{height:30},src:"https://assets.rspack.dev/rsdoctor/rsdoctor-logo-960x960.png",className:"rsdoctor-logo",alt:"logo"}),(0,y.jsx)(L.Z.Text,{style:{color:"inherit",fontSize:18,marginLeft:4,marginTop:8},children:"Rsdoctor"}),(0,y.jsx)(nw,{})]})}),(0,y.jsx)(rr.Z,{flex:1,children:(0,y.jsxs)(rt.Z,{align:"middle",justify:"end",style:{height:I.NavBarHeight},wrap:!1,gutter:[I.BasePadding/3,0],children:[(0,y.jsx)(rr.Z,{children:(0,y.jsx)(ny,{})}),(0,y.jsx)(lW,{style:{transition:"none"}}),(0,y.jsx)(rr.Z,{children:(0,y.jsx)(nM.Z,{overlayStyle:{zIndex:1e3},menu:{items:r.map(t=>({label:t.label,key:t.value,onClick(){e.changeLanguage(t.value)}})),selectedKeys:[e.language]},children:(0,y.jsx)(nS.Z,{className:"header-icon",style:{display:"inline-block",fontSize:20,textAlign:"center",verticalAlign:"middle",cursor:"pointer",width:30,transition:"all 0.3s ease"}})})})]})})]})})},lH=rC({api:F.SDK.ServerAPI.APIExtends.GetCompileProgress,responsePropName:"progress",Component:({progress:e})=>{if(!e)return null;let{percentage:t=1,message:r}=e;if(t>=1)return null;let n=+(100*t).toFixed(1);return(0,y.jsx)(rt.Z,{wrap:!0,style:{width:"100%",position:"fixed",top:I.NavBarHeight,left:1,zIndex:99},children:(0,y.jsx)(rr.Z,{span:Math.min(Math.floor(24*t),24),children:(0,y.jsx)(n9.Z,{percent:100,status:"active",size:"small",format:()=>(0,y.jsx)(L.Z.Text,{style:{fontSize:12},type:"secondary",children:`${n}% ${r}`})})})})},fallbackComponent:()=>null}),lU=e=>{let t=(0,W.useContext)(tW).locale,{i18n:r}=tg(),{children:n}=e;(0,W.useEffect)(()=>{let e=t;if(!N("FIRST_VISIT")){var n,s;n="1",_("FIRST_VISIT","1");let t="cn"===(s=window.navigator.language.split("-")[0])||"zh"===s?w.Cn:w.En;Object.values(w).includes(t)&&(e=t)}r.language!==e&&r.changeLanguage(e)},[t]);let s=(0,W.useContext)(tW);return(0,y.jsxs)(nb.Z,{children:[s.embedded?null:(0,y.jsx)(lK,{}),(0,y.jsx)(lH,{}),(0,y.jsxs)(nb.Z.Content,{style:{height:"100%",minHeight:"100vh",padding:I.BasePadding,marginTop:s.embedded?0:I.NavBarHeight,background:A},children:[n,(0,y.jsx)(nv.Z.BackTop,{})]})]})},lY={JS:[F.Constants.JSExtension],CSS:[F.Constants.CSSExtension],HTML:[F.Constants.HtmlExtension],Imgs:F.Constants.ImgExtensions,Fonts:F.Constants.FontExtensions,Media:F.Constants.MediaExtensions,Others:[]};(0,lI.Z)((0,rS.Z)(lY));var lV=r("16897"),lJ=r("66428"),lq=r("9253");function lQ(){let e=[{path:iv,element:(0,y.jsx)(iS,{})},{path:iL,element:(0,y.jsx)(i$,{})},{path:iF,element:(0,y.jsx)(iW,{})},{path:iV,element:(0,y.jsx)(iJ,{})},{path:iT,element:(0,y.jsx)(iA,{})},{path:iQ,element:(0,y.jsx)(iX,{})},{path:ls,element:(0,y.jsx)(li,{})}].filter(e=>!!e);return(0,y.jsxs)(tm.Z5,{children:[(0,y.jsx)(tm.AW,{path:"/",element:(0,y.jsx)(sN,{})}),(0,y.jsx)(tm.AW,{path:n_,element:(0,y.jsx)(sN,{})}),e.map(e=>(0,y.jsx)(tm.AW,{path:e.path,element:e.element},e.path)),(0,y.jsx)(tm.AW,{path:l$,element:(0,y.jsx)(lG,{})})]})}let{PageState:lX,Theme:l0}=f;var l1=r("8082");let l2=document.getElementById("root");l1.createRoot(l2).render((0,y.jsx)(()=>{let e=!!("https:"===window.location.protocol&&window.location.href.indexOf("ide-proxy")>0)||!1,[t,r]=(0,W.useState)(lX.Success),[n,s]=(0,W.useState)({...tF.viewMode}),[i,l]=(0,W.useState)(),[a,o]=(0,W.useState)(tF.theme);return t===S.Fail?(0,y.jsxs)(B.Z,{direction:"vertical",style:{padding:14},children:[(0,y.jsx)(L.Z.Text,{strong:!0,style:{fontSize:16},children:"load json file of Rsdoctor failed."}),(0,y.jsxs)(L.Z.Text,{children:["try to use ",(0,y.jsx)(L.Z.Text,{keyboard:!0,children:"command + r"})," to refresh page."]}),null,(0,y.jsx)(ro.Z,{}),(0,y.jsx)(B.Z,{direction:"vertical",style:{width:"100%"},children:(0,y.jsxs)(L.Z.Text,{style:{fontSize:16},children:["you can",(0,y.jsxs)(L.Z.Text,{strong:!0,style:{fontSize:"inherit"},children:[" ","upload a file"," "]}),"in the area below to analyze your project."]})}),(0,y.jsx)(ro.Z,{}),null]}):(0,y.jsx)(lq.UT,{children:(0,y.jsx)(tW.Provider,{value:{...tF,theme:a,setTheme:e=>{o(e),_("THEME",e)},pageState:t,json:i,viewMode:n,setManifest:l,setPageState:r,setViewMode(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],r={...n,...e};s(r),t&&_("VIEWMODE",JSON.stringify(r))}},children:(0,y.jsx)(tW.Consumer,{children:r=>{var n;return(0,y.jsx)(na.ZP,{locale:"cn"===(n=r.locale)||"zh-CN"===n?tM.Z:tC.Z,theme:{algorithm:a===l0.Dark?nR.Z.darkAlgorithm:nR.Z.defaultAlgorithm},children:(0,y.jsx)(lU,{children:(0,y.jsxs)(y.Fragment,{children:[e&&(0,y.jsx)(O.Z,{message:"Warning",description:(0,y.jsx)("a",{href:window.location.href.replace(/https/,"http"),children:`Please jump to:${window.location.href.replace(/https/,"http")}`}),type:"warning",showIcon:!0,closable:!0}),(0,y.jsx)(lJ.SV,{FallbackComponent:e=>{let{error:r,resetErrorBoundary:n}=e;return(0,y.jsx)(lV.ZP,{status:"error",title:"Sorry, something went wrong.",extra:(0,y.jsx)($.ZP,{type:"primary",onClick:n,loading:t===lX.Pending,children:"Reload"}),children:(0,y.jsxs)(L.Z.Paragraph,{children:[(0,y.jsx)(L.Z.Title,{level:3,children:"Error Stack"}),(0,y.jsx)("pre",{children:r.stack||r.message})]})})},onReset:()=>{window.location.reload()},children:(0,y.jsx)(lQ,{})})]})})})}})})})},{}));let l4=document.createElement("link");l4.setAttribute("type","image/x-icon"),l4.setAttribute("rel","icon"),l4.setAttribute("href","https://assets.rspack.dev/rsdoctor/rsdoctor-logo-960x960.png"),document.head.appendChild(l4)},6156:function(){},41037:function(){}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.m=e,r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};r.t=function(n,s){if(1&s&&(n=this(n)),8&s||"object"==typeof n&&n&&(4&s&&n.__esModule||16&s&&"function"==typeof n.then))return n;var i=Object.create(null);r.r(i);var l={};e=e||[null,t({}),t([]),t(t)];for(var a=2&s&&n;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach(function(e){l[e]=function(){return n[e]}});return l.default=function(){return n},r.d(i,l),i}})(),r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],!e.children&&(e.children=[]),e},(()=>{var e=[];r.O=function(t,n,s,i){if(n){i=i||0;for(var l=e.length;l>0&&e[l-1][2]>i;l--)e[l]=e[l-1];e[l]=[n,s,i];return}for(var a=1/0,l=0;l<e.length;l++){for(var n=e[l][0],s=e[l][1],i=e[l][2],o=!0,d=0;d<n.length;d++)(!1&i||a>=i)&&Object.keys(r.O).every(function(e){return r.O[e](n[d])})?n.splice(d--,1):(o=!1,i<a&&(a=i));if(o){e.splice(l--,1);var c=s();void 0!==c&&(t=c)}}return t}})(),r.rv=function(){return"1.1.8"},(()=>{var e={980:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var s=n[0],i=n[1],l=n[2],a,o,d=0;if(s.some(function(t){return 0!==e[t]})){for(a in i)r.o(i,a)&&(r.m[a]=i[a]);if(l)var c=l(r)}for(t&&t(n);d<s.length;d++)o=s[d],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(c)},n=self.webpackChunk_rsdoctor_client=self.webpackChunk_rsdoctor_client||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),r.ruid="bundler=rspack@1.1.8";var n=r.O(void 0,["82","150","741","208","301","21","966","773"],function(){return r("79266")});n=r.O(n)})();
|