@skaldapp/monaco-sfc 1.1.43 → 1.1.44

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.
Files changed (2) hide show
  1. package/dist/vue.worker.js +647 -1763
  2. package/package.json +8 -8
@@ -1950,7 +1950,7 @@ var require_types$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
1950
1950
  }));
1951
1951
  //#endregion
1952
1952
  //#region node_modules/@volar/language-core/lib/utils.js
1953
- var require_utils$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
1953
+ var require_utils$7 = /* @__PURE__ */ __commonJSMin(((exports) => {
1954
1954
  Object.defineProperty(exports, "__esModule", { value: true });
1955
1955
  exports.FileMap = void 0;
1956
1956
  var FileMap = class extends Map {
@@ -2020,7 +2020,7 @@ var require_language_core$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
2020
2020
  __exportStar(require_editor(), exports);
2021
2021
  __exportStar(require_linkedCodeMap(), exports);
2022
2022
  __exportStar(require_types$3(), exports);
2023
- __exportStar(require_utils$6(), exports);
2023
+ __exportStar(require_utils$7(), exports);
2024
2024
  var source_map_2 = require_source_map();
2025
2025
  var linkedCodeMap_1 = require_linkedCodeMap();
2026
2026
  var defaultMapperFactory = (mappings) => new source_map_2.SourceMap(mappings);
@@ -6049,7 +6049,7 @@ var require_resolveModuleName$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
6049
6049
  }));
6050
6050
  //#endregion
6051
6051
  //#region node_modules/@volar/typescript/lib/node/utils.js
6052
- var require_utils$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
6052
+ var require_utils$6 = /* @__PURE__ */ __commonJSMin(((exports) => {
6053
6053
  Object.defineProperty(exports, "__esModule", { value: true });
6054
6054
  exports.getServiceScript = getServiceScript;
6055
6055
  exports.fixupImpliedNodeFormatForFile = fixupImpliedNodeFormatForFile;
@@ -6108,7 +6108,7 @@ var require_decorateLanguageServiceHost = /* @__PURE__ */ __commonJSMin(((export
6108
6108
  exports.decorateLanguageServiceHost = decorateLanguageServiceHost;
6109
6109
  exports.searchExternalFiles = searchExternalFiles;
6110
6110
  var resolveModuleName_1 = require_resolveModuleName$1();
6111
- var utils_1 = require_utils$5();
6111
+ var utils_1 = require_utils$6();
6112
6112
  function decorateLanguageServiceHost(ts, language, languageServiceHost) {
6113
6113
  const pluginExtensions = language.plugins.map((plugin) => plugin.typescript?.extraFileExtensions.map((ext) => "." + ext.extension) ?? []).flat();
6114
6114
  const scripts = /* @__PURE__ */ new Map();
@@ -6228,7 +6228,7 @@ var require_transform$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
6228
6228
  exports.toGeneratedOffsets = toGeneratedOffsets;
6229
6229
  exports.getMappingOffset = getMappingOffset;
6230
6230
  var language_core_1 = require_language_core$1();
6231
- var utils_1 = require_utils$5();
6231
+ var utils_1 = require_utils$6();
6232
6232
  var transformedDiagnostics = /* @__PURE__ */ new WeakMap();
6233
6233
  var transformedSourceFile = /* @__PURE__ */ new WeakSet();
6234
6234
  /**
@@ -6417,7 +6417,7 @@ var require_decorateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
6417
6417
  Object.defineProperty(exports, "__esModule", { value: true });
6418
6418
  exports.decorateProgram = decorateProgram;
6419
6419
  var transform_1 = require_transform$1();
6420
- var utils_1 = require_utils$5();
6420
+ var utils_1 = require_utils$6();
6421
6421
  function decorateProgram(language, program) {
6422
6422
  const emit = program.emit;
6423
6423
  const getSyntacticDiagnostics = program.getSyntacticDiagnostics;
@@ -6472,7 +6472,7 @@ var require_proxyCreateProgram = /* @__PURE__ */ __commonJSMin(((exports) => {
6472
6472
  var common_1 = require_common$3();
6473
6473
  var resolveModuleName_1 = require_resolveModuleName$1();
6474
6474
  var decorateProgram_1 = require_decorateProgram();
6475
- var utils_1 = require_utils$5();
6475
+ var utils_1 = require_utils$6();
6476
6476
  var arrayEqual = (a, b) => {
6477
6477
  if (a.length !== b.length) return false;
6478
6478
  for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
@@ -6620,7 +6620,7 @@ var require_proxyLanguageService = /* @__PURE__ */ __commonJSMin(((exports) => {
6620
6620
  var language_core_1 = require_language_core$1();
6621
6621
  var dedupe_1 = require_dedupe();
6622
6622
  var transform_1 = require_transform$1();
6623
- var utils_1 = require_utils$5();
6623
+ var utils_1 = require_utils$6();
6624
6624
  var windowsPathReg = /\\/g;
6625
6625
  /**
6626
6626
  * Creates and returns a Proxy around the base TypeScript LanguageService.
@@ -7586,7 +7586,7 @@ var require_createProject = /* @__PURE__ */ __commonJSMin(((exports) => {
7586
7586
  exports.createLanguageServiceHost = createLanguageServiceHost;
7587
7587
  var language_core_1 = require_language_core$1();
7588
7588
  var path = require_path_browserify();
7589
- var utils_1 = require_utils$5();
7589
+ var utils_1 = require_utils$6();
7590
7590
  var resolveModuleName_1 = require_resolveModuleName$1();
7591
7591
  function createLanguageServiceHost(ts, sys, language, asScriptId, projectHost) {
7592
7592
  const pluginExtensions = language.plugins.map((plugin) => plugin.typescript?.extraFileExtensions.map((ext) => "." + ext.extension) ?? []).flat();
@@ -9647,7 +9647,7 @@ var require_names = /* @__PURE__ */ __commonJSMin(((exports) => {
9647
9647
  }));
9648
9648
  //#endregion
9649
9649
  //#region node_modules/@vue/language-core/lib/codegen/utils/index.js
9650
- var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
9650
+ var require_utils$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
9651
9651
  Object.defineProperty(exports, "__esModule", { value: true });
9652
9652
  exports.identifierRegex = exports.endOfLine = exports.newLine = void 0;
9653
9653
  exports.getTypeScriptAST = getTypeScriptAST;
@@ -15072,7 +15072,7 @@ var require_context$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
15072
15072
  exports.createTemplateCodegenContext = createTemplateCodegenContext;
15073
15073
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
15074
15074
  var codeFeatures_1 = require_codeFeatures();
15075
- var utils_1 = require_utils$4();
15075
+ var utils_1 = require_utils$5();
15076
15076
  var boundary_1 = require_boundary();
15077
15077
  var commentDirectiveRegex = /^<!--\s*@vue-(?<name>[-\w]+)\b(?<content>[\s\S]*)-->$/;
15078
15078
  /**
@@ -15392,7 +15392,7 @@ var require_stringLiteralKey = /* @__PURE__ */ __commonJSMin(((exports) => {
15392
15392
  }));
15393
15393
  //#endregion
15394
15394
  //#region node_modules/@vue/language-core/lib/utils/shared.js
15395
- var require_shared$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
15395
+ var require_shared$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
15396
15396
  Object.defineProperty(exports, "__esModule", { value: true });
15397
15397
  exports.hyphenateTag = void 0;
15398
15398
  exports.hyphenateAttr = hyphenateAttr;
@@ -15445,7 +15445,7 @@ var require_collectBindings = /* @__PURE__ */ __commonJSMin(((exports) => {
15445
15445
  exports.collectBindingNames = collectBindingNames;
15446
15446
  exports.collectBindingRanges = collectBindingRanges;
15447
15447
  exports.collectBindingIdentifiers = collectBindingIdentifiers;
15448
- var shared_1 = require_shared$3();
15448
+ var shared_1 = require_shared$2();
15449
15449
  function collectBindingNames(ts, node, ast) {
15450
15450
  return collectBindingIdentifiers(ts, node).map(({ id }) => (0, shared_1.getNodeText)(ts, id, ast));
15451
15451
  }
@@ -15471,10 +15471,10 @@ var require_interpolation = /* @__PURE__ */ __commonJSMin(((exports) => {
15471
15471
  exports.generateInterpolation = generateInterpolation;
15472
15472
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
15473
15473
  var collectBindings_1 = require_collectBindings();
15474
- var shared_2 = require_shared$3();
15474
+ var shared_2 = require_shared$2();
15475
15475
  var codeFeatures_1 = require_codeFeatures();
15476
15476
  var names_1 = require_names();
15477
- var utils_1 = require_utils$4();
15477
+ var utils_1 = require_utils$5();
15478
15478
  var isLiteralWhitelisted = /* @__PURE__ */ (0, shared_1.makeMap)("true,false,null,this");
15479
15479
  function* generateInterpolation({ typescript, setupRefs }, ctx, block, data, code, start, prefix = "", suffix = "") {
15480
15480
  for (const segment of forEachInterpolationSegment(typescript, setupRefs, ctx, block, code, start, prefix, suffix)) {
@@ -15626,7 +15626,7 @@ var require_objectProperty = /* @__PURE__ */ __commonJSMin(((exports) => {
15626
15626
  exports.generateObjectProperty = generateObjectProperty;
15627
15627
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
15628
15628
  var names_1 = require_names();
15629
- var utils_1 = require_utils$4();
15629
+ var utils_1 = require_utils$5();
15630
15630
  var boundary_1 = require_boundary();
15631
15631
  var camelized_1 = require_camelized();
15632
15632
  var stringLiteralKey_1 = require_stringLiteralKey();
@@ -16135,7 +16135,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16135
16135
  }));
16136
16136
  //#endregion
16137
16137
  //#region node_modules/picomatch/lib/utils.js
16138
- var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
16138
+ var require_utils$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
16139
16139
  var { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
16140
16140
  exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
16141
16141
  exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
@@ -16184,7 +16184,7 @@ var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
16184
16184
  //#endregion
16185
16185
  //#region node_modules/picomatch/lib/scan.js
16186
16186
  var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16187
- var utils = require_utils$3();
16187
+ var utils = require_utils$4();
16188
16188
  var { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants$1();
16189
16189
  var isPathSeparator = (code) => {
16190
16190
  return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
@@ -16472,7 +16472,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16472
16472
  //#region node_modules/picomatch/lib/parse.js
16473
16473
  var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16474
16474
  var constants = require_constants$1();
16475
- var utils = require_utils$3();
16475
+ var utils = require_utils$4();
16476
16476
  /**
16477
16477
  * Constants
16478
16478
  */
@@ -17528,7 +17528,7 @@ var require_parse$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17528
17528
  var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17529
17529
  var scan = require_scan();
17530
17530
  var parse = require_parse$1();
17531
- var utils = require_utils$3();
17531
+ var utils = require_utils$4();
17532
17532
  var constants = require_constants$1();
17533
17533
  var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
17534
17534
  /**
@@ -17827,7 +17827,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17827
17827
  //#region node_modules/picomatch/index.js
17828
17828
  var require_picomatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
17829
17829
  var pico = require_picomatch$1();
17830
- var utils = require_utils$3();
17830
+ var utils = require_utils$4();
17831
17831
  function picomatch(glob, options, returnState = false) {
17832
17832
  if (options && (options.windows === null || options.windows === void 0)) options = {
17833
17833
  ...options,
@@ -17921,7 +17921,7 @@ var require_elementEvents = /* @__PURE__ */ __commonJSMin(((exports) => {
17921
17921
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
17922
17922
  var codeFeatures_1 = require_codeFeatures();
17923
17923
  var names_1 = require_names();
17924
- var utils_1 = require_utils$4();
17924
+ var utils_1 = require_utils$5();
17925
17925
  var boundary_1 = require_boundary();
17926
17926
  var camelized_1 = require_camelized();
17927
17927
  var interpolation_1 = require_interpolation();
@@ -18092,11 +18092,11 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports) => {
18092
18092
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
18093
18093
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
18094
18094
  var picomatch_1 = require_picomatch();
18095
- var shared_2 = require_shared$3();
18095
+ var shared_2 = require_shared$2();
18096
18096
  var codeFeatures_1 = require_codeFeatures();
18097
18097
  var inlayHints_1 = require_inlayHints();
18098
18098
  var names_1 = require_names();
18099
- var utils_1 = require_utils$4();
18099
+ var utils_1 = require_utils$5();
18100
18100
  var boundary_1 = require_boundary();
18101
18101
  var camelized_1 = require_camelized();
18102
18102
  var unicode_1 = require_unicode();
@@ -18147,7 +18147,7 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports) => {
18147
18147
  }
18148
18148
  if (prop.name === "bind" && prop.modifiers.some((m) => m.content === "prop" || m.content === "attr")) propName = propName.slice(1);
18149
18149
  const shouldSpread = propName === "style" || propName === "class";
18150
- const shouldCamelize = isComponent && getShouldCamelize(options, prop, propName);
18150
+ const shouldCamelize = getShouldCamelize(options, node, prop, propName);
18151
18151
  const features = getPropsCodeFeatures(strictPropsCheck);
18152
18152
  if (shouldSpread) yield `...{ `;
18153
18153
  const token = yield* (0, boundary_1.startBoundary)("template", prop.loc.start.offset, codeFeatures_1.codeFeatures.verification);
@@ -18173,7 +18173,7 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports) => {
18173
18173
  } else if (prop.type === CompilerDOM.NodeTypes.ATTRIBUTE) {
18174
18174
  if (options.vueCompilerOptions.dataAttributes.some((pattern) => (0, picomatch_1.isMatch)(prop.name, pattern))) continue;
18175
18175
  const shouldSpread = prop.name === "style" || prop.name === "class";
18176
- const shouldCamelize = isComponent && getShouldCamelize(options, prop, prop.name);
18176
+ const shouldCamelize = getShouldCamelize(options, node, prop, prop.name);
18177
18177
  const features = getPropsCodeFeatures(strictPropsCheck);
18178
18178
  if (shouldSpread) yield `...{ `;
18179
18179
  const token = yield* (0, boundary_1.startBoundary)("template", prop.loc.start.offset, codeFeatures_1.codeFeatures.verification);
@@ -18236,8 +18236,8 @@ var require_elementProps = /* @__PURE__ */ __commonJSMin(((exports) => {
18236
18236
  yield* (0, unicode_1.generateUnicode)(content, offset, features);
18237
18237
  yield quote;
18238
18238
  }
18239
- function getShouldCamelize(options, prop, propName) {
18240
- return (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE || !prop.arg || prop.arg.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic) && (0, shared_2.hyphenateAttr)(propName) === propName && !options.vueCompilerOptions.htmlAttributes.some((pattern) => (0, picomatch_1.isMatch)(propName, pattern));
18239
+ function getShouldCamelize(options, node, prop, propName) {
18240
+ return (node.tagType === CompilerDOM.ElementTypes.COMPONENT || node.tagType === CompilerDOM.ElementTypes.SLOT) && (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE || prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic) && (0, shared_2.hyphenateAttr)(propName) === propName && !options.vueCompilerOptions.htmlAttributes.some((pattern) => (0, picomatch_1.isMatch)(propName, pattern));
18241
18241
  }
18242
18242
  function getPropsCodeFeatures(strictPropsCheck) {
18243
18243
  return {
@@ -18326,7 +18326,7 @@ var require_elementDirectives = /* @__PURE__ */ __commonJSMin(((exports) => {
18326
18326
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
18327
18327
  var codeFeatures_1 = require_codeFeatures();
18328
18328
  var names_1 = require_names();
18329
- var utils_1 = require_utils$4();
18329
+ var utils_1 = require_utils$5();
18330
18330
  var boundary_1 = require_boundary();
18331
18331
  var camelized_1 = require_camelized();
18332
18332
  var stringLiteralKey_1 = require_stringLiteralKey();
@@ -18403,7 +18403,7 @@ var require_elementDirectives = /* @__PURE__ */ __commonJSMin(((exports) => {
18403
18403
  var require_propertyAccess = /* @__PURE__ */ __commonJSMin(((exports) => {
18404
18404
  Object.defineProperty(exports, "__esModule", { value: true });
18405
18405
  exports.generatePropertyAccess = generatePropertyAccess;
18406
- var utils_1 = require_utils$4();
18406
+ var utils_1 = require_utils$5();
18407
18407
  var stringLiteralKey_1 = require_stringLiteralKey();
18408
18408
  var interpolation_1 = require_interpolation();
18409
18409
  function* generatePropertyAccess(options, ctx, code, offset, features) {
@@ -18457,7 +18457,7 @@ var require_styleScopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
18457
18457
  exports.generateStyleScopedClassReference = generateStyleScopedClassReference;
18458
18458
  var codeFeatures_1 = require_codeFeatures();
18459
18459
  var names_1 = require_names();
18460
- var utils_1 = require_utils$4();
18460
+ var utils_1 = require_utils$5();
18461
18461
  var boundary_1 = require_boundary();
18462
18462
  var escaped_1 = require_escaped();
18463
18463
  var classNameEscapeRegex = /([\\'])/;
@@ -18540,7 +18540,7 @@ var require_vSlot = /* @__PURE__ */ __commonJSMin(((exports) => {
18540
18540
  var collectBindings_1 = require_collectBindings();
18541
18541
  var codeFeatures_1 = require_codeFeatures();
18542
18542
  var names_1 = require_names();
18543
- var utils_1 = require_utils$4();
18543
+ var utils_1 = require_utils$5();
18544
18544
  var boundary_1 = require_boundary();
18545
18545
  var interpolation_1 = require_interpolation();
18546
18546
  var objectProperty_1 = require_objectProperty();
@@ -18671,14 +18671,15 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
18671
18671
  Object.defineProperty(exports, "__esModule", { value: true });
18672
18672
  exports.generateComponent = generateComponent;
18673
18673
  exports.generateElement = generateElement;
18674
+ exports.generateFragment = generateFragment;
18674
18675
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
18675
18676
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
18676
18677
  var muggle_string_1 = require_out$1();
18677
- var shared_2 = require_shared$3();
18678
+ var shared_2 = require_shared$2();
18678
18679
  var codeFeatures_1 = require_codeFeatures();
18679
18680
  var inlayHints_1 = require_inlayHints();
18680
18681
  var names_1 = require_names();
18681
- var utils_1 = require_utils$4();
18682
+ var utils_1 = require_utils$5();
18682
18683
  var boundary_1 = require_boundary();
18683
18684
  var camelized_1 = require_camelized();
18684
18685
  var stringLiteralKey_1 = require_stringLiteralKey();
@@ -18864,6 +18865,19 @@ var require_element = /* @__PURE__ */ __commonJSMin(((exports) => {
18864
18865
  yield* generateStyleScopedClassReferences(options, node);
18865
18866
  for (const child of node.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child);
18866
18867
  }
18868
+ function* generateFragment(options, ctx, node) {
18869
+ const [startTagOffset] = (0, shared_2.getElementTagOffsets)(node, options.template);
18870
+ if (node.props.length) {
18871
+ yield `__VLS_asFunctionalElement(__VLS_intrinsics.template)(`;
18872
+ const token = yield* (0, boundary_1.startBoundary)("template", startTagOffset, codeFeatures_1.codeFeatures.verification);
18873
+ yield `{${utils_1.newLine}`;
18874
+ yield* (0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.checkUnknownProps);
18875
+ yield `}`;
18876
+ yield (0, boundary_1.endBoundary)(token, startTagOffset + node.tag.length);
18877
+ yield `)${utils_1.endOfLine}`;
18878
+ }
18879
+ for (const child of node.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child);
18880
+ }
18867
18881
  function* generateStyleScopedClassReferences({ template, typescript: ts }, node) {
18868
18882
  for (const prop of node.props) if (prop.type === CompilerDOM.NodeTypes.ATTRIBUTE && prop.name === "class" && prop.value) {
18869
18883
  const [text, start] = (0, shared_2.normalizeAttributeValue)(prop.value);
@@ -18975,11 +18989,11 @@ var require_slotOutlet = /* @__PURE__ */ __commonJSMin(((exports) => {
18975
18989
  Object.defineProperty(exports, "__esModule", { value: true });
18976
18990
  exports.generateSlotOutlet = generateSlotOutlet;
18977
18991
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
18978
- var shared_1 = require_shared$3();
18992
+ var shared_1 = require_shared$2();
18979
18993
  var codeFeatures_1 = require_codeFeatures();
18980
18994
  var inlayHints_1 = require_inlayHints();
18981
18995
  var names_1 = require_names();
18982
- var utils_1 = require_utils$4();
18996
+ var utils_1 = require_utils$5();
18983
18997
  var boundary_1 = require_boundary();
18984
18998
  var elementProps_1 = require_elementProps();
18985
18999
  var interpolation_1 = require_interpolation();
@@ -19060,7 +19074,7 @@ var require_slotOutlet = /* @__PURE__ */ __commonJSMin(((exports) => {
19060
19074
  }));
19061
19075
  //#endregion
19062
19076
  //#region node_modules/@vue/language-core/lib/codegen/template/vFor.js
19063
- var require_vFor = /* @__PURE__ */ __commonJSMin(((exports) => {
19077
+ var require_vFor$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
19064
19078
  var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
19065
19079
  if (k2 === void 0) k2 = k;
19066
19080
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -19109,7 +19123,7 @@ var require_vFor = /* @__PURE__ */ __commonJSMin(((exports) => {
19109
19123
  var collectBindings_1 = require_collectBindings();
19110
19124
  var codeFeatures_1 = require_codeFeatures();
19111
19125
  var names_1 = require_names();
19112
- var utils_1 = require_utils$4();
19126
+ var utils_1 = require_utils$5();
19113
19127
  var interpolation_1 = require_interpolation();
19114
19128
  var templateChild_1 = require_templateChild();
19115
19129
  function* generateVFor(options, ctx, node) {
@@ -19134,20 +19148,9 @@ var require_vFor = /* @__PURE__ */ __commonJSMin(((exports) => {
19134
19148
  yield `!)`;
19135
19149
  } else yield `{} as any`;
19136
19150
  yield `) {${utils_1.newLine}`;
19137
- let isFragment = true;
19138
- for (const argument of node.codegenNode?.children.arguments ?? []) if (argument.type === CompilerDOM.NodeTypes.JS_FUNCTION_EXPRESSION && argument.returns?.type === CompilerDOM.NodeTypes.VNODE_CALL && argument.returns.props?.type === CompilerDOM.NodeTypes.JS_OBJECT_EXPRESSION) {
19139
- if (argument.returns.tag !== CompilerDOM.FRAGMENT) {
19140
- isFragment = false;
19141
- continue;
19142
- }
19143
- for (const prop of argument.returns.props.properties) if (prop.value.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && !prop.value.isStatic) {
19144
- yield* (0, interpolation_1.generateInterpolation)(options, ctx, options.template, codeFeatures_1.codeFeatures.all, prop.value.content, prop.value.loc.start.offset, `(`, `)`);
19145
- yield utils_1.endOfLine;
19146
- }
19147
- }
19148
19151
  const { inVFor } = ctx;
19149
19152
  ctx.inVFor = true;
19150
- for (const child of node.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child, isFragment);
19153
+ for (const child of node.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child, false, true);
19151
19154
  ctx.inVFor = inVFor;
19152
19155
  yield* endScope();
19153
19156
  yield `}${utils_1.newLine}`;
@@ -19166,7 +19169,7 @@ var require_vFor = /* @__PURE__ */ __commonJSMin(((exports) => {
19166
19169
  }));
19167
19170
  //#endregion
19168
19171
  //#region node_modules/@vue/language-core/lib/codegen/template/vIf.js
19169
- var require_vIf = /* @__PURE__ */ __commonJSMin(((exports) => {
19172
+ var require_vIf$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
19170
19173
  var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
19171
19174
  if (k2 === void 0) k2 = k;
19172
19175
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -19213,12 +19216,11 @@ var require_vIf = /* @__PURE__ */ __commonJSMin(((exports) => {
19213
19216
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
19214
19217
  var muggle_string_1 = require_out$1();
19215
19218
  var codeFeatures_1 = require_codeFeatures();
19216
- var utils_1 = require_utils$4();
19219
+ var utils_1 = require_utils$5();
19217
19220
  var interpolation_1 = require_interpolation();
19218
19221
  var templateChild_1 = require_templateChild();
19219
19222
  function* generateVIf(options, ctx, node) {
19220
19223
  const originalBlockConditionsLength = ctx.blockConditions.length;
19221
- const isFragment = node.codegenNode && "consequent" in node.codegenNode && "tag" in node.codegenNode.consequent && node.codegenNode.consequent.tag === CompilerDOM.FRAGMENT;
19222
19224
  for (let i = 0; i < node.branches.length; i++) {
19223
19225
  const branch = node.branches[i];
19224
19226
  if (i === 0) yield `if `;
@@ -19233,7 +19235,7 @@ var require_vIf = /* @__PURE__ */ __commonJSMin(((exports) => {
19233
19235
  yield ` `;
19234
19236
  }
19235
19237
  yield `{${utils_1.newLine}`;
19236
- for (const child of branch.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child, i !== 0 || isFragment);
19238
+ for (const child of branch.children) yield* (0, templateChild_1.generateTemplateChild)(options, ctx, child, i !== 0, true);
19237
19239
  yield `}${utils_1.newLine}`;
19238
19240
  if (addedBlockCondition) ctx.blockConditions[ctx.blockConditions.length - 1] = `!${ctx.blockConditions[ctx.blockConditions.length - 1]}`;
19239
19241
  }
@@ -19288,29 +19290,28 @@ var require_templateChild = /* @__PURE__ */ __commonJSMin(((exports) => {
19288
19290
  exports.generateTemplateChild = generateTemplateChild;
19289
19291
  exports.parseInterpolationNode = parseInterpolationNode;
19290
19292
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
19291
- var shared_1 = require_shared$3();
19293
+ var shared_1 = require_shared$2();
19292
19294
  var codeFeatures_1 = require_codeFeatures();
19293
- var utils_1 = require_utils$4();
19295
+ var utils_1 = require_utils$5();
19294
19296
  var element_1 = require_element();
19295
19297
  var interpolation_1 = require_interpolation();
19296
19298
  var slotOutlet_1 = require_slotOutlet();
19297
- var vFor_1 = require_vFor();
19298
- var vIf_1 = require_vIf();
19299
+ var vFor_1 = require_vFor$1();
19300
+ var vIf_1 = require_vIf$1();
19299
19301
  var vSlot_1 = require_vSlot();
19300
- function* generateTemplateChild(options, ctx, node, enterNode = true) {
19302
+ function* generateTemplateChild(options, ctx, node, enterNode = true, isVForChild = false) {
19301
19303
  if (enterNode && !ctx.enter(node)) return;
19302
- const cur = node;
19303
- if (cur.codegenNode?.type === CompilerDOM.NodeTypes.JS_CACHE_EXPRESSION) cur.codegenNode = cur.codegenNode.value;
19304
19304
  if (node.type === CompilerDOM.NodeTypes.ROOT) {
19305
19305
  for (const item of collectSingleRootNodes(options, node.children)) ctx.singleRootNodes.add(item);
19306
19306
  for (const child of node.children) yield* generateTemplateChild(options, ctx, child);
19307
- } else if (node.type === CompilerDOM.NodeTypes.ELEMENT) {
19308
- let slotDir;
19309
- if (node.tagType === CompilerDOM.ElementTypes.SLOT) yield* (0, slotOutlet_1.generateSlotOutlet)(options, ctx, node);
19310
- else if (node.tagType === CompilerDOM.ElementTypes.TEMPLATE && ctx.components.length && (slotDir = node.props.find((p) => p.type === CompilerDOM.NodeTypes.DIRECTIVE && p.name === "slot"))) yield* (0, vSlot_1.generateVSlot)(options, ctx, node, slotDir, ctx.components[ctx.components.length - 1]());
19311
- else if (node.tagType === CompilerDOM.ElementTypes.ELEMENT || node.tagType === CompilerDOM.ElementTypes.TEMPLATE) yield* (0, element_1.generateElement)(options, ctx, node);
19312
- else yield* (0, element_1.generateComponent)(options, ctx, node);
19313
- } else if (node.type === CompilerDOM.NodeTypes.TEXT_CALL) yield* generateTemplateChild(options, ctx, node.content, false);
19307
+ } else if (node.type === CompilerDOM.NodeTypes.ELEMENT) if (node.tagType === CompilerDOM.ElementTypes.SLOT) yield* (0, slotOutlet_1.generateSlotOutlet)(options, ctx, node);
19308
+ else {
19309
+ const slotDir = node.props.find(CompilerDOM.isVSlot);
19310
+ if (node.tagType === CompilerDOM.ElementTypes.TEMPLATE && ctx.components.length && slotDir) yield* (0, vSlot_1.generateVSlot)(options, ctx, node, slotDir, ctx.components.at(-1)());
19311
+ else if (node.tagType === CompilerDOM.ElementTypes.TEMPLATE && isVForChild) yield* (0, element_1.generateFragment)(options, ctx, node);
19312
+ else if (node.tagType === CompilerDOM.ElementTypes.COMPONENT) yield* (0, element_1.generateComponent)(options, ctx, node);
19313
+ else yield* (0, element_1.generateElement)(options, ctx, node);
19314
+ }
19314
19315
  else if (node.type === CompilerDOM.NodeTypes.COMPOUND_EXPRESSION) for (const child of node.children) {
19315
19316
  if (typeof child !== "object") continue;
19316
19317
  yield* generateTemplateChild(options, ctx, child, false);
@@ -19320,7 +19321,6 @@ var require_templateChild = /* @__PURE__ */ __commonJSMin(((exports) => {
19320
19321
  yield* (0, interpolation_1.generateInterpolation)(options, ctx, options.template, codeFeatures_1.codeFeatures.all, content, start, `(`, `)${utils_1.endOfLine}`);
19321
19322
  } else if (node.type === CompilerDOM.NodeTypes.IF) yield* (0, vIf_1.generateVIf)(options, ctx, node);
19322
19323
  else if (node.type === CompilerDOM.NodeTypes.FOR) yield* (0, vFor_1.generateVFor)(options, ctx, node);
19323
- else if (node.type === CompilerDOM.NodeTypes.TEXT) {}
19324
19324
  if (enterNode) yield* ctx.exit();
19325
19325
  }
19326
19326
  function* collectSingleRootNodes(options, children) {
@@ -19353,7 +19353,7 @@ var require_template$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
19353
19353
  exports.generateTemplate = generate;
19354
19354
  var codeFeatures_1 = require_codeFeatures();
19355
19355
  var names_1 = require_names();
19356
- var utils_1 = require_utils$4();
19356
+ var utils_1 = require_utils$5();
19357
19357
  var boundary_1 = require_boundary();
19358
19358
  var context_1 = require_context$1();
19359
19359
  var objectProperty_1 = require_objectProperty();
@@ -19464,7 +19464,7 @@ var require_compilerOptions = /* @__PURE__ */ __commonJSMin(((exports) => {
19464
19464
  exports.getDefaultCompilerOptions = getDefaultCompilerOptions;
19465
19465
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
19466
19466
  var path_browserify_1 = require_path_browserify();
19467
- var shared_2 = require_shared$3();
19467
+ var shared_2 = require_shared$2();
19468
19468
  function createParsedCommandLineByJson(ts, host, rootDir, json, configFileName) {
19469
19469
  const extendedPaths = /* @__PURE__ */ new Set();
19470
19470
  const proxyHost = {
@@ -19838,7 +19838,7 @@ var require_parseSfc = /* @__PURE__ */ __commonJSMin(((exports) => {
19838
19838
  Object.defineProperty(exports, "__esModule", { value: true });
19839
19839
  exports.parse = parse;
19840
19840
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
19841
- var shared_1 = require_shared$3();
19841
+ var shared_1 = require_shared$2();
19842
19842
  function parse(source) {
19843
19843
  const errors = [];
19844
19844
  const ast = CompilerDOM.parse(source, {
@@ -19971,14 +19971,13 @@ var require_file_md = /* @__PURE__ */ __commonJSMin(((exports) => {
19971
19971
  var buildMappings_1 = require_buildMappings();
19972
19972
  var parseSfc_1 = require_parseSfc();
19973
19973
  var frontmatterReg = /^---[\s\S]*?\n---(?:\r?\n|$)/;
19974
- var codeblockReg = /(`{3,})[\s\S]+?\1/g;
19975
- var inlineCodeblockReg = /`[^\n`]+?`/g;
19976
- var latexBlockReg = /(\${2,})[\s\S]+?\1/g;
19977
- var scriptSetupReg = /\\<[\s\S]+?>\n?/g;
19974
+ var codeblockReg = /(`{3}|\${2})[\s\S]+?\1/g;
19978
19975
  var codeSnippetImportReg = /^\s*<<<\s*.+/gm;
19979
- var sfcBlockReg = /<(script|style)\b[\s\S]*?>([\s\S]*?)<\/\1>/g;
19980
- var angleBracketReg = /<\S*:\S*>/g;
19981
- var linkReg = /\[[\s\S]*?\]\([\s\S]*?\)/g;
19976
+ var sfcBlockReg = /<(script|style)\b[^>]*>([\s\S]*?)<\/\1>/g;
19977
+ var htmlTagReg = /(?<=<\/?)([a-z][a-z0-9-]*)\b[^>]*(?=>)/gi;
19978
+ var interpolationReg = /(?<=\{\{)[\s\S]*?(?=\}\})/g;
19979
+ var inlineCodeReg = /(`{1,2})[^`]+\1/g;
19980
+ var angleBracketReg = /<[^\s:]*:\S*>/g;
19982
19981
  var plugin = ({ vueCompilerOptions }) => {
19983
19982
  return {
19984
19983
  version: 2.2,
@@ -19990,19 +19989,27 @@ var require_file_md = /* @__PURE__ */ __commonJSMin(((exports) => {
19990
19989
  },
19991
19990
  parseSFC2(_fileName, languageId, content) {
19992
19991
  if (languageId !== "markdown") return;
19993
- content = content.replace(frontmatterReg, (match) => " ".repeat(match.length)).replace(codeblockReg, (match, quotes) => quotes + " ".repeat(match.length - quotes.length * 2) + quotes).replace(latexBlockReg, (match, quotes) => quotes + " ".repeat(match.length - quotes.length * 2) + quotes).replace(scriptSetupReg, (match) => " ".repeat(match.length)).replace(codeSnippetImportReg, (match) => " ".repeat(match.length));
19992
+ for (const reg of [
19993
+ frontmatterReg,
19994
+ codeblockReg,
19995
+ codeSnippetImportReg
19996
+ ]) content = content.replace(reg, (match) => " ".repeat(match.length));
19994
19997
  const codes = [];
19995
- for (const match of content.matchAll(sfcBlockReg)) {
19996
- const matchText = match[0];
19998
+ for (const { 0: text, index } of content.matchAll(sfcBlockReg)) {
19997
19999
  codes.push([
19998
- matchText,
20000
+ text,
19999
20001
  void 0,
20000
- match.index
20002
+ index
20001
20003
  ]);
20002
20004
  codes.push("\n\n");
20003
- content = content.slice(0, match.index) + " ".repeat(matchText.length) + content.slice(match.index + matchText.length);
20005
+ content = content.slice(0, index) + " ".repeat(text.length) + content.slice(index + text.length);
20006
+ }
20007
+ const ranges = [];
20008
+ for (const reg of [htmlTagReg, interpolationReg]) for (const { 0: text, index } of content.matchAll(reg)) ranges.push([index, index + text.length]);
20009
+ for (const reg of [inlineCodeReg, angleBracketReg]) for (const { 0: text, index } of content.matchAll(reg)) {
20010
+ if (ranges.some(([start, end]) => index >= start && index < end)) continue;
20011
+ content = content.slice(0, index) + " ".repeat(text.length) + content.slice(index + text.length);
20004
20012
  }
20005
- content = content.replace(inlineCodeblockReg, (match) => `\`${" ".repeat(match.length - 2)}\``).replace(angleBracketReg, (match) => " ".repeat(match.length)).replace(linkReg, (match) => " ".repeat(match.length));
20006
20013
  codes.push("<template>\n");
20007
20014
  codes.push([
20008
20015
  content,
@@ -20097,7 +20104,7 @@ var require_file_vue = /* @__PURE__ */ __commonJSMin(((exports) => {
20097
20104
  }));
20098
20105
  //#endregion
20099
20106
  //#region node_modules/@vue/language-core/lib/plugins/shared.js
20100
- var require_shared$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
20107
+ var require_shared$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
20101
20108
  Object.defineProperty(exports, "__esModule", { value: true });
20102
20109
  exports.allCodeFeatures = void 0;
20103
20110
  exports.allCodeFeatures = {
@@ -20114,7 +20121,7 @@ var require_shared$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
20114
20121
  var require_vue_root_tags = /* @__PURE__ */ __commonJSMin(((exports) => {
20115
20122
  Object.defineProperty(exports, "__esModule", { value: true });
20116
20123
  var muggle_string_1 = require_out$1();
20117
- var shared_1 = require_shared$2();
20124
+ var shared_1 = require_shared$1();
20118
20125
  var plugin = () => {
20119
20126
  return {
20120
20127
  version: 2.2,
@@ -20172,7 +20179,7 @@ var require_vue_script_js = /* @__PURE__ */ __commonJSMin(((exports) => {
20172
20179
  //#region node_modules/@vue/language-core/lib/plugins/vue-sfc-customblocks.js
20173
20180
  var require_vue_sfc_customblocks = /* @__PURE__ */ __commonJSMin(((exports) => {
20174
20181
  Object.defineProperty(exports, "__esModule", { value: true });
20175
- var shared_1 = require_shared$2();
20182
+ var shared_1 = require_shared$1();
20176
20183
  var plugin = () => {
20177
20184
  return {
20178
20185
  version: 2.2,
@@ -20237,7 +20244,7 @@ var require_vue_sfc_scripts = /* @__PURE__ */ __commonJSMin(((exports) => {
20237
20244
  //#region node_modules/@vue/language-core/lib/plugins/vue-sfc-styles.js
20238
20245
  var require_vue_sfc_styles = /* @__PURE__ */ __commonJSMin(((exports) => {
20239
20246
  Object.defineProperty(exports, "__esModule", { value: true });
20240
- var shared_1 = require_shared$2();
20247
+ var shared_1 = require_shared$1();
20241
20248
  var plugin = () => {
20242
20249
  return {
20243
20250
  version: 2.2,
@@ -20286,7 +20293,7 @@ var require_vue_sfc_styles = /* @__PURE__ */ __commonJSMin(((exports) => {
20286
20293
  //#region node_modules/@vue/language-core/lib/plugins/vue-sfc-template.js
20287
20294
  var require_vue_sfc_template = /* @__PURE__ */ __commonJSMin(((exports) => {
20288
20295
  Object.defineProperty(exports, "__esModule", { value: true });
20289
- var shared_1 = require_shared$2();
20296
+ var shared_1 = require_shared$1();
20290
20297
  var plugin = () => {
20291
20298
  return {
20292
20299
  version: 2.2,
@@ -20374,136 +20381,445 @@ var require_vue_style_css = /* @__PURE__ */ __commonJSMin(((exports) => {
20374
20381
  }
20375
20382
  }));
20376
20383
  //#endregion
20377
- //#region node_modules/@vue/language-core/lib/plugins/vue-template-html.js
20378
- var require_vue_template_html = /* @__PURE__ */ __commonJSMin(((exports) => {
20384
+ //#region node_modules/@vue/language-core/lib/template/transforms/transformElement.js
20385
+ var require_transformElement = /* @__PURE__ */ __commonJSMin(((exports) => {
20379
20386
  Object.defineProperty(exports, "__esModule", { value: true });
20380
- var shouldAddSuffix = /(?<=<[^>/]+)$/;
20381
- var plugin = ({ modules }) => {
20382
- const CompilerDOM = modules["@vue/compiler-dom"];
20383
- return {
20384
- version: 2.2,
20385
- compileSFCTemplate(lang, template, options) {
20386
- if (lang === "html" || lang === "md") {
20387
- let addedSuffix = false;
20388
- if (shouldAddSuffix.test(template)) {
20389
- template += ">";
20390
- addedSuffix = true;
20387
+ exports.transformElement = void 0;
20388
+ var compiler_dom_1 = (init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports));
20389
+ var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
20390
+ var transformElement = (node, context) => {
20391
+ return () => {
20392
+ if (node.type !== compiler_dom_1.NodeTypes.ELEMENT || node.tagType === compiler_dom_1.ElementTypes.TEMPLATE) return;
20393
+ const isComponent = node.tagType === compiler_dom_1.ElementTypes.COMPONENT;
20394
+ const isSlotOutlet = node.tagType === compiler_dom_1.ElementTypes.SLOT;
20395
+ for (const prop of node.props) {
20396
+ if (prop.type !== compiler_dom_1.NodeTypes.DIRECTIVE) continue;
20397
+ if (prop.name === "slot") {
20398
+ if (!isComponent) context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_SLOT_MISPLACED, prop.loc));
20399
+ continue;
20400
+ }
20401
+ const isVBind = prop.name === "bind";
20402
+ const isVOn = prop.name === "on";
20403
+ if (!prop.arg && (isVBind || isVOn)) {
20404
+ if (!prop.exp) context.onError((0, compiler_dom_1.createCompilerError)(isVBind ? compiler_dom_1.ErrorCodes.X_V_BIND_NO_EXPRESSION : compiler_dom_1.ErrorCodes.X_V_ON_NO_EXPRESSION, prop.loc));
20405
+ continue;
20406
+ }
20407
+ const runtimeDirectives = [];
20408
+ const directiveTransform = context.directiveTransforms[prop.name];
20409
+ if (directiveTransform) {
20410
+ const { needRuntime } = directiveTransform(prop, node, context);
20411
+ if (needRuntime) runtimeDirectives.push(prop);
20412
+ } else if (!(0, shared_1.isBuiltInDirective)(prop.name)) runtimeDirectives.push(prop);
20413
+ if (isSlotOutlet && runtimeDirectives.length) context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET, prop.loc));
20414
+ }
20415
+ if (isComponent) {
20416
+ let hasTemplateSlots = false;
20417
+ let hasNamedDefaultSlot = false;
20418
+ const implicitDefaultChildren = [];
20419
+ const seenSlotNames = /* @__PURE__ */ new Set();
20420
+ const onComponentSlot = (0, compiler_dom_1.findDir)(node, "slot", true);
20421
+ for (const child of node.children) {
20422
+ let slotDir;
20423
+ if (!(0, compiler_dom_1.isTemplateNode)(child) || !(slotDir = (0, compiler_dom_1.findDir)(child, "slot", true))) {
20424
+ if (child.type !== compiler_dom_1.NodeTypes.COMMENT) implicitDefaultChildren.push(child);
20425
+ continue;
20426
+ }
20427
+ if (onComponentSlot) {
20428
+ context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_SLOT_MIXED_SLOT_USAGE, slotDir.loc));
20429
+ break;
20430
+ }
20431
+ if ((0, compiler_dom_1.findDir)(child, /^(?:if|else-if|else|for)$/, true)) continue;
20432
+ hasTemplateSlots = true;
20433
+ const staticSlotName = slotDir.arg ? (0, compiler_dom_1.isStaticExp)(slotDir.arg) ? slotDir.arg.content : void 0 : "default";
20434
+ if (staticSlotName) {
20435
+ if (seenSlotNames.has(staticSlotName)) {
20436
+ context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_SLOT_DUPLICATE_SLOT_NAMES, slotDir.loc));
20437
+ continue;
20438
+ }
20439
+ seenSlotNames.add(staticSlotName);
20440
+ if (staticSlotName === "default") hasNamedDefaultSlot = true;
20391
20441
  }
20392
- const ast = CompilerDOM.parse(template, {
20393
- ...options,
20394
- comments: true
20395
- });
20396
- CompilerDOM.transform(ast, options);
20397
- return {
20398
- ast,
20399
- code: "",
20400
- preamble: "",
20401
- __addedSuffix: addedSuffix
20402
- };
20403
20442
  }
20404
- },
20405
- updateSFCTemplate(oldResult, change) {
20406
- const newSource = oldResult.ast.source.slice(0, change.start) + change.newText + oldResult.ast.source.slice(change.end);
20407
- if (oldResult.__addedSuffix) {
20408
- const originalTemplate = newSource.slice(0, -1);
20409
- if (!shouldAddSuffix.test(originalTemplate)) return;
20443
+ if (hasTemplateSlots && hasNamedDefaultSlot && implicitDefaultChildren.some((node) => node.type !== compiler_dom_1.NodeTypes.TEXT || !!node.content.trim())) context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN, implicitDefaultChildren[0].loc));
20444
+ context.components.add(node.tag);
20445
+ }
20446
+ };
20447
+ };
20448
+ exports.transformElement = transformElement;
20449
+ }));
20450
+ //#endregion
20451
+ //#region node_modules/@vue/language-core/lib/template/transforms/transformText.js
20452
+ var require_transformText = /* @__PURE__ */ __commonJSMin(((exports) => {
20453
+ Object.defineProperty(exports, "__esModule", { value: true });
20454
+ exports.transformText = void 0;
20455
+ var compiler_dom_1 = (init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports));
20456
+ var transformText = (node) => {
20457
+ if (node.type === compiler_dom_1.NodeTypes.ROOT || node.type === compiler_dom_1.NodeTypes.ELEMENT || node.type === compiler_dom_1.NodeTypes.FOR || node.type === compiler_dom_1.NodeTypes.IF_BRANCH) return () => {
20458
+ const children = node.children;
20459
+ let currentContainer = void 0;
20460
+ for (let i = 0; i < children.length; i++) {
20461
+ const child = children[i];
20462
+ if ((0, compiler_dom_1.isText)(child)) for (let j = i + 1; j < children.length; j++) {
20463
+ const next = children[j];
20464
+ if ((0, compiler_dom_1.isText)(next)) {
20465
+ currentContainer ??= children[i] = (0, compiler_dom_1.createCompoundExpression)([child], child.loc);
20466
+ currentContainer.children.push(` + `, next);
20467
+ children.splice(j, 1);
20468
+ j--;
20469
+ } else {
20470
+ currentContainer = void 0;
20471
+ break;
20472
+ }
20410
20473
  }
20411
- const lengthDiff = change.newText.length - (change.end - change.start);
20412
- let hitNodes = [];
20413
- if (tryUpdateNode(oldResult.ast) && hitNodes.length) {
20414
- hitNodes = hitNodes.sort((a, b) => a.loc.source.length - b.loc.source.length);
20415
- if (hitNodes[0].type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) return oldResult;
20474
+ }
20475
+ };
20476
+ };
20477
+ exports.transformText = transformText;
20478
+ }));
20479
+ //#endregion
20480
+ //#region node_modules/@vue/language-core/lib/template/utils.js
20481
+ var require_utils$3 = /* @__PURE__ */ __commonJSMin(((exports) => {
20482
+ Object.defineProperty(exports, "__esModule", { value: true });
20483
+ exports.createStructuralDirectiveTransform = createStructuralDirectiveTransform;
20484
+ exports.cloneLoc = cloneLoc;
20485
+ var compiler_dom_1 = (init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports));
20486
+ var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
20487
+ function createStructuralDirectiveTransform(name, fn) {
20488
+ const matches = (0, shared_1.isString)(name) ? (n) => n === name : (n) => name.test(n);
20489
+ return (node, context) => {
20490
+ if (node.type === compiler_dom_1.NodeTypes.ELEMENT) {
20491
+ const { props } = node;
20492
+ const exitFns = [];
20493
+ for (let i = 0; i < props.length; i++) {
20494
+ const prop = props[i];
20495
+ if (prop.type === compiler_dom_1.NodeTypes.DIRECTIVE && matches(prop.name)) {
20496
+ props.splice(i, 1);
20497
+ i--;
20498
+ const onExit = fn(node, prop, context);
20499
+ if (onExit) exitFns.push(onExit);
20500
+ }
20416
20501
  }
20417
- function tryUpdateNode(node) {
20418
- if (withinChangeRange(node.loc)) hitNodes.push(node);
20419
- if (tryUpdateNodeLoc(node.loc)) {
20420
- if (node.type === CompilerDOM.NodeTypes.ROOT) {
20421
- for (const child of node.children) if (!tryUpdateNode(child)) return false;
20422
- } else if (node.type === CompilerDOM.NodeTypes.ELEMENT) {
20423
- if (withinChangeRange(node.loc)) {
20424
- const start = node.loc.start.offset + 2;
20425
- const end = node.loc.start.offset + node.loc.source.lastIndexOf("</");
20426
- if (!withinChangeRange({
20427
- start: { offset: start },
20428
- end: { offset: end },
20429
- source: ""
20430
- })) return false;
20431
- }
20432
- for (const prop of node.props) if (!tryUpdateNode(prop)) return false;
20433
- for (const child of node.children) if (!tryUpdateNode(child)) return false;
20434
- } else if (node.type === CompilerDOM.NodeTypes.ATTRIBUTE) {
20435
- if (node.value && !tryUpdateNode(node.value)) return false;
20436
- } else if (node.type === CompilerDOM.NodeTypes.DIRECTIVE) {
20437
- if (node.arg && withinChangeRange(node.arg.loc) && node.name === "slot") return false;
20438
- if (node.exp && withinChangeRange(node.exp.loc) && node.name === "for") return false;
20439
- if (node.arg && !tryUpdateNode(node.arg)) return false;
20440
- if (node.exp && !tryUpdateNode(node.exp)) return false;
20441
- } else if (node.type === CompilerDOM.NodeTypes.TEXT_CALL) {
20442
- if (!tryUpdateNode(node.content)) return false;
20443
- } else if (node.type === CompilerDOM.NodeTypes.COMPOUND_EXPRESSION) {
20444
- for (const childNode of node.children) if (typeof childNode === "object") {
20445
- if (!tryUpdateNode(childNode)) return false;
20446
- }
20447
- } else if (node.type === CompilerDOM.NodeTypes.IF) for (const branch of node.branches) {
20448
- if (branch.condition && !tryUpdateNode(branch.condition)) return false;
20449
- for (const child of branch.children) if (!tryUpdateNode(child)) return false;
20450
- }
20451
- else if (node.type === CompilerDOM.NodeTypes.FOR) {
20452
- for (const child of [
20453
- node.parseResult.source,
20454
- node.parseResult.value,
20455
- node.parseResult.key,
20456
- node.parseResult.index
20457
- ]) if (child) {
20458
- if (!tryUpdateNode(child)) return false;
20459
- if (child.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
20460
- const content = child.content.trim();
20461
- if (content.startsWith("(") || content.endsWith(")")) return false;
20462
- }
20463
- }
20464
- for (const child of node.children) if (!tryUpdateNode(child)) return false;
20465
- } else if (node.type === CompilerDOM.NodeTypes.INTERPOLATION) {
20466
- if (!tryUpdateNode(node.content)) return false;
20467
- if (node.content.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
20468
- const { content } = node.content;
20469
- if (content.includes("{{") || content.includes("}}")) return false;
20470
- }
20471
- } else if (node.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
20472
- if (withinChangeRange(node.loc)) if (node.isStatic) return false;
20473
- else if (!node.loc.source) return false;
20474
- else node.content = node.loc.source;
20475
- }
20476
- return true;
20502
+ return exitFns;
20503
+ }
20504
+ };
20505
+ }
20506
+ function cloneLoc(loc) {
20507
+ return {
20508
+ start: { ...loc.start },
20509
+ end: { ...loc.end },
20510
+ source: loc.source
20511
+ };
20512
+ }
20513
+ }));
20514
+ //#endregion
20515
+ //#region node_modules/@vue/language-core/lib/template/transforms/vFor.js
20516
+ var require_vFor = /* @__PURE__ */ __commonJSMin(((exports) => {
20517
+ Object.defineProperty(exports, "__esModule", { value: true });
20518
+ exports.transformFor = void 0;
20519
+ var compiler_dom_1 = (init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports));
20520
+ exports.transformFor = (0, require_utils$3().createStructuralDirectiveTransform)("for", (node, dir, context) => {
20521
+ if (!dir.exp) {
20522
+ context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_FOR_NO_EXPRESSION, dir.loc));
20523
+ return;
20524
+ }
20525
+ const parseResult = dir.forParseResult;
20526
+ if (!parseResult) {
20527
+ context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_FOR_MALFORMED_EXPRESSION, dir.loc));
20528
+ return;
20529
+ }
20530
+ const { source, value, key, index } = parseResult;
20531
+ const forNode = {
20532
+ type: compiler_dom_1.NodeTypes.FOR,
20533
+ loc: dir.loc,
20534
+ source,
20535
+ valueAlias: value,
20536
+ keyAlias: key,
20537
+ objectIndexAlias: index,
20538
+ parseResult,
20539
+ children: [node]
20540
+ };
20541
+ context.replaceNode(forNode);
20542
+ return () => {
20543
+ if ((0, compiler_dom_1.isTemplateNode)(node)) {
20544
+ for (const child of node.children) if (child.type === compiler_dom_1.NodeTypes.ELEMENT) {
20545
+ const key = (0, compiler_dom_1.findProp)(child, "key");
20546
+ if (key) {
20547
+ context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_FOR_TEMPLATE_KEY_PLACEMENT, key.loc));
20548
+ break;
20477
20549
  }
20478
- return false;
20479
20550
  }
20480
- function tryUpdateNodeLoc(loc) {
20481
- delete loc.__endOffset;
20482
- if (withinChangeRange(loc)) {
20483
- loc.source = loc.source.slice(0, change.start - loc.start.offset) + change.newText + loc.source.slice(change.end - loc.start.offset);
20484
- loc.__endOffset = loc.end.offset;
20485
- loc.end.offset += lengthDiff;
20486
- return true;
20487
- } else if (change.end <= loc.start.offset) {
20488
- loc.__endOffset = loc.end.offset;
20489
- loc.start.offset += lengthDiff;
20490
- loc.end.offset += lengthDiff;
20491
- return true;
20492
- } else if (change.start >= loc.end.offset) return true;
20493
- return false;
20551
+ }
20552
+ };
20553
+ });
20554
+ }));
20555
+ //#endregion
20556
+ //#region node_modules/@vue/language-core/lib/template/transforms/vIf.js
20557
+ var require_vIf = /* @__PURE__ */ __commonJSMin(((exports) => {
20558
+ Object.defineProperty(exports, "__esModule", { value: true });
20559
+ exports.transformIf = void 0;
20560
+ var compiler_dom_1 = (init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports));
20561
+ var utils_1 = require_utils$3();
20562
+ exports.transformIf = (0, utils_1.createStructuralDirectiveTransform)(/^(?:if|else-if|else)$/, (node, dir, context) => {
20563
+ if (dir.name !== "else" && (!dir.exp || !dir.exp.content.trim())) context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_IF_NO_EXPRESSION, dir.loc));
20564
+ if (dir.name === "if") {
20565
+ const branch = createIfBranch(node, dir);
20566
+ const ifNode = {
20567
+ type: compiler_dom_1.NodeTypes.IF,
20568
+ loc: (0, utils_1.cloneLoc)(node.loc),
20569
+ branches: [branch]
20570
+ };
20571
+ context.replaceNode(ifNode);
20572
+ } else {
20573
+ const siblings = context.parent.children;
20574
+ const comments = [];
20575
+ let i = siblings.indexOf(node);
20576
+ while (i-- >= -1) {
20577
+ const sibling = siblings[i];
20578
+ if (sibling?.type === compiler_dom_1.NodeTypes.COMMENT) {
20579
+ context.removeNode(sibling);
20580
+ comments.unshift(sibling);
20581
+ continue;
20494
20582
  }
20495
- function withinChangeRange(loc) {
20496
- const originalLocEnd = loc.__endOffset ?? loc.end.offset;
20497
- return change.start >= loc.start.offset && change.end <= originalLocEnd;
20583
+ if (sibling?.type === compiler_dom_1.NodeTypes.TEXT && !sibling.content.trim().length) {
20584
+ context.removeNode(sibling);
20585
+ continue;
20498
20586
  }
20587
+ if (sibling?.type === compiler_dom_1.NodeTypes.IF) {
20588
+ if (!sibling.branches.at(-1).condition) context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_ELSE_NO_ADJACENT_IF, node.loc));
20589
+ context.removeNode();
20590
+ const branch = createIfBranch(node, dir);
20591
+ if (comments.length) branch.children.unshift(...comments);
20592
+ if (branch.userKey) {
20593
+ for (const { userKey } of sibling.branches) if (isSameKey(userKey, branch.userKey)) context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_IF_SAME_KEY, branch.userKey.loc));
20594
+ }
20595
+ sibling.branches.push(branch);
20596
+ (0, compiler_dom_1.traverseNode)(branch, context);
20597
+ context.currentNode = null;
20598
+ } else context.onError((0, compiler_dom_1.createCompilerError)(compiler_dom_1.ErrorCodes.X_V_ELSE_NO_ADJACENT_IF, node.loc));
20599
+ break;
20499
20600
  }
20601
+ }
20602
+ });
20603
+ function createIfBranch(node, dir) {
20604
+ return {
20605
+ type: compiler_dom_1.NodeTypes.IF_BRANCH,
20606
+ loc: node.loc,
20607
+ condition: dir.name === "else" ? void 0 : dir.exp,
20608
+ children: [node],
20609
+ userKey: (0, compiler_dom_1.findProp)(node, "key")
20500
20610
  };
20501
- };
20502
- exports.default = plugin;
20611
+ }
20612
+ function isSameKey(a, b) {
20613
+ if (!a || a.type !== b.type) return false;
20614
+ if (a.type === compiler_dom_1.NodeTypes.ATTRIBUTE) {
20615
+ if (a.value.content !== b.value.content) return false;
20616
+ } else {
20617
+ const exp = a.exp;
20618
+ const branchExp = b.exp;
20619
+ if (exp.type !== branchExp.type || exp.type !== compiler_dom_1.NodeTypes.SIMPLE_EXPRESSION || exp.isStatic !== branchExp.isStatic || exp.content !== branchExp.content) return false;
20620
+ }
20621
+ return true;
20622
+ }
20503
20623
  }));
20504
20624
  //#endregion
20505
- //#region node_modules/@vue/language-core/lib/utils/forEachTemplateNode.js
20506
- var require_forEachTemplateNode = /* @__PURE__ */ __commonJSMin(((exports) => {
20625
+ //#region node_modules/@vue/language-core/lib/template/compile.js
20626
+ var require_compile = /* @__PURE__ */ __commonJSMin(((exports) => {
20627
+ Object.defineProperty(exports, "__esModule", { value: true });
20628
+ exports.compileTemplate = compileTemplate;
20629
+ var compiler_dom_1 = (init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports));
20630
+ var transformElement_1 = require_transformElement();
20631
+ var transformText_1 = require_transformText();
20632
+ var vFor_1 = require_vFor();
20633
+ var vIf_1 = require_vIf();
20634
+ function compileTemplate(source, options) {
20635
+ const [nodeTransforms, directiveTransforms] = (0, compiler_dom_1.getBaseTransformPreset)();
20636
+ const resolvedOptions = {
20637
+ ...options,
20638
+ comments: true,
20639
+ nodeTransforms: [
20640
+ nodeTransforms[0],
20641
+ vIf_1.transformIf,
20642
+ vFor_1.transformFor,
20643
+ transformElement_1.transformElement,
20644
+ transformText_1.transformText,
20645
+ ...options.nodeTransforms || []
20646
+ ],
20647
+ directiveTransforms: {
20648
+ ...directiveTransforms,
20649
+ ...options.directiveTransforms
20650
+ }
20651
+ };
20652
+ const ast = (0, compiler_dom_1.parse)(source, resolvedOptions);
20653
+ (0, compiler_dom_1.transform)(ast, resolvedOptions);
20654
+ return ast;
20655
+ }
20656
+ }));
20657
+ //#endregion
20658
+ //#region node_modules/@vue/language-core/lib/plugins/vue-template-html.js
20659
+ var require_vue_template_html = /* @__PURE__ */ __commonJSMin(((exports) => {
20660
+ var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
20661
+ if (k2 === void 0) k2 = k;
20662
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20663
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
20664
+ enumerable: true,
20665
+ get: function() {
20666
+ return m[k];
20667
+ }
20668
+ };
20669
+ Object.defineProperty(o, k2, desc);
20670
+ }) : (function(o, m, k, k2) {
20671
+ if (k2 === void 0) k2 = k;
20672
+ o[k2] = m[k];
20673
+ }));
20674
+ var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
20675
+ Object.defineProperty(o, "default", {
20676
+ enumerable: true,
20677
+ value: v
20678
+ });
20679
+ }) : function(o, v) {
20680
+ o["default"] = v;
20681
+ });
20682
+ var __importStar = exports && exports.__importStar || (function() {
20683
+ var ownKeys = function(o) {
20684
+ ownKeys = Object.getOwnPropertyNames || function(o) {
20685
+ var ar = [];
20686
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
20687
+ return ar;
20688
+ };
20689
+ return ownKeys(o);
20690
+ };
20691
+ return function(mod) {
20692
+ if (mod && mod.__esModule) return mod;
20693
+ var result = {};
20694
+ if (mod != null) {
20695
+ for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
20696
+ }
20697
+ __setModuleDefault(result, mod);
20698
+ return result;
20699
+ };
20700
+ })();
20701
+ Object.defineProperty(exports, "__esModule", { value: true });
20702
+ var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
20703
+ var compile_1 = require_compile();
20704
+ var shouldAddSuffix = /(?<=<[^>/]+)$/;
20705
+ var plugin = () => {
20706
+ return {
20707
+ version: 2.2,
20708
+ compileSFCTemplate(lang, template, options) {
20709
+ if (lang === "html" || lang === "md") {
20710
+ let addedSuffix = false;
20711
+ if (shouldAddSuffix.test(template)) {
20712
+ template += ">";
20713
+ addedSuffix = true;
20714
+ }
20715
+ return {
20716
+ ast: (0, compile_1.compileTemplate)(template, options),
20717
+ code: "",
20718
+ preamble: "",
20719
+ __addedSuffix: addedSuffix
20720
+ };
20721
+ }
20722
+ },
20723
+ updateSFCTemplate(oldResult, change) {
20724
+ const newSource = oldResult.ast.source.slice(0, change.start) + change.newText + oldResult.ast.source.slice(change.end);
20725
+ if (oldResult.__addedSuffix) {
20726
+ const originalTemplate = newSource.slice(0, -1);
20727
+ if (!shouldAddSuffix.test(originalTemplate)) return;
20728
+ }
20729
+ const lengthDiff = change.newText.length - (change.end - change.start);
20730
+ let hitNodes = [];
20731
+ if (tryUpdateNode(oldResult.ast) && hitNodes.length) {
20732
+ hitNodes = hitNodes.sort((a, b) => a.loc.source.length - b.loc.source.length);
20733
+ if (hitNodes[0].type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) return oldResult;
20734
+ }
20735
+ function tryUpdateNode(node) {
20736
+ if (withinChangeRange(node.loc)) hitNodes.push(node);
20737
+ if (tryUpdateNodeLoc(node.loc)) {
20738
+ if (node.type === CompilerDOM.NodeTypes.ROOT) {
20739
+ for (const child of node.children) if (!tryUpdateNode(child)) return false;
20740
+ } else if (node.type === CompilerDOM.NodeTypes.ELEMENT) {
20741
+ if (withinChangeRange(node.loc)) {
20742
+ const start = node.loc.start.offset + 2;
20743
+ const end = node.loc.start.offset + node.loc.source.lastIndexOf("</");
20744
+ if (!withinChangeRange({
20745
+ start: { offset: start },
20746
+ end: { offset: end },
20747
+ source: ""
20748
+ })) return false;
20749
+ }
20750
+ for (const prop of node.props) if (!tryUpdateNode(prop)) return false;
20751
+ for (const child of node.children) if (!tryUpdateNode(child)) return false;
20752
+ } else if (node.type === CompilerDOM.NodeTypes.ATTRIBUTE) {
20753
+ if (node.value && !tryUpdateNode(node.value)) return false;
20754
+ } else if (node.type === CompilerDOM.NodeTypes.DIRECTIVE) {
20755
+ if (node.arg && withinChangeRange(node.arg.loc) && node.name === "slot") return false;
20756
+ if (node.exp && withinChangeRange(node.exp.loc) && node.name === "for") return false;
20757
+ if (node.arg && !tryUpdateNode(node.arg)) return false;
20758
+ if (node.exp && !tryUpdateNode(node.exp)) return false;
20759
+ } else if (node.type === CompilerDOM.NodeTypes.COMPOUND_EXPRESSION) {
20760
+ for (const childNode of node.children) if (typeof childNode === "object") {
20761
+ if (!tryUpdateNode(childNode)) return false;
20762
+ }
20763
+ } else if (node.type === CompilerDOM.NodeTypes.IF) for (const branch of node.branches) {
20764
+ if (branch.condition && !tryUpdateNode(branch.condition)) return false;
20765
+ for (const child of branch.children) if (!tryUpdateNode(child)) return false;
20766
+ }
20767
+ else if (node.type === CompilerDOM.NodeTypes.FOR) {
20768
+ for (const child of [
20769
+ node.parseResult.source,
20770
+ node.parseResult.value,
20771
+ node.parseResult.key,
20772
+ node.parseResult.index
20773
+ ]) if (child) {
20774
+ if (!tryUpdateNode(child)) return false;
20775
+ if (child.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
20776
+ const content = child.content.trim();
20777
+ if (content.startsWith("(") || content.endsWith(")")) return false;
20778
+ }
20779
+ }
20780
+ for (const child of node.children) if (!tryUpdateNode(child)) return false;
20781
+ } else if (node.type === CompilerDOM.NodeTypes.INTERPOLATION) {
20782
+ if (!tryUpdateNode(node.content)) return false;
20783
+ if (node.content.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
20784
+ const { content } = node.content;
20785
+ if (content.includes("{{") || content.includes("}}")) return false;
20786
+ }
20787
+ } else if (node.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
20788
+ if (withinChangeRange(node.loc)) if (node.isStatic) return false;
20789
+ else if (!node.loc.source) return false;
20790
+ else node.content = node.loc.source;
20791
+ }
20792
+ return true;
20793
+ }
20794
+ return false;
20795
+ }
20796
+ function tryUpdateNodeLoc(loc) {
20797
+ delete loc.__endOffset;
20798
+ if (withinChangeRange(loc)) {
20799
+ loc.source = loc.source.slice(0, change.start - loc.start.offset) + change.newText + loc.source.slice(change.end - loc.start.offset);
20800
+ loc.__endOffset = loc.end.offset;
20801
+ loc.end.offset += lengthDiff;
20802
+ return true;
20803
+ } else if (change.end <= loc.start.offset) {
20804
+ loc.__endOffset = loc.end.offset;
20805
+ loc.start.offset += lengthDiff;
20806
+ loc.end.offset += lengthDiff;
20807
+ return true;
20808
+ } else if (change.start >= loc.end.offset) return true;
20809
+ return false;
20810
+ }
20811
+ function withinChangeRange(loc) {
20812
+ const originalLocEnd = loc.__endOffset ?? loc.end.offset;
20813
+ return change.start >= loc.start.offset && change.end <= originalLocEnd;
20814
+ }
20815
+ }
20816
+ };
20817
+ };
20818
+ exports.default = plugin;
20819
+ }));
20820
+ //#endregion
20821
+ //#region node_modules/@vue/language-core/lib/utils/forEachTemplateNode.js
20822
+ var require_forEachTemplateNode = /* @__PURE__ */ __commonJSMin(((exports) => {
20507
20823
  var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
20508
20824
  if (k2 === void 0) k2 = k;
20509
20825
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -20560,7 +20876,6 @@ var require_forEachTemplateNode = /* @__PURE__ */ __commonJSMin(((exports) => {
20560
20876
  function* forEachInterpolationNode(node) {
20561
20877
  if (node.type === CompilerDOM.NodeTypes.ROOT) for (const child of node.children) yield* forEachInterpolationNode(child);
20562
20878
  else if (node.type === CompilerDOM.NodeTypes.ELEMENT) for (const child of node.children) yield* forEachInterpolationNode(child);
20563
- else if (node.type === CompilerDOM.NodeTypes.TEXT_CALL) yield* forEachInterpolationNode(node.content);
20564
20879
  else if (node.type === CompilerDOM.NodeTypes.COMPOUND_EXPRESSION) {
20565
20880
  for (const child of node.children) if (typeof child === "object") yield* forEachInterpolationNode(child);
20566
20881
  } else if (node.type === CompilerDOM.NodeTypes.INTERPOLATION) yield node;
@@ -20615,9 +20930,9 @@ var require_vue_template_inline_css = /* @__PURE__ */ __commonJSMin(((exports) =
20615
20930
  Object.defineProperty(exports, "__esModule", { value: true });
20616
20931
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
20617
20932
  var forEachTemplateNode_1 = require_forEachTemplateNode();
20618
- var shared_1 = require_shared$3();
20933
+ var shared_1 = require_shared$2();
20619
20934
  var codeFeatures = {
20620
- ...require_shared$2().allCodeFeatures,
20935
+ ...require_shared$1().allCodeFeatures,
20621
20936
  format: false,
20622
20937
  structure: false
20623
20938
  };
@@ -20701,8 +21016,8 @@ var require_vue_template_inline_ts = /* @__PURE__ */ __commonJSMin(((exports) =>
20701
21016
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
20702
21017
  var elementEvents_1 = require_elementEvents();
20703
21018
  var templateChild_1 = require_templateChild();
20704
- var vFor_1 = require_vFor();
20705
- var utils_1 = require_utils$4();
21019
+ var vFor_1 = require_vFor$1();
21020
+ var utils_1 = require_utils$5();
20706
21021
  var codeFeatures = { format: true };
20707
21022
  var formatBrackets = {
20708
21023
  normal: ["`${", "}`;"],
@@ -20790,8 +21105,7 @@ var require_vue_template_inline_ts = /* @__PURE__ */ __commonJSMin(((exports) =>
20790
21105
  addFormatCodes(template.content.slice(start, end), start, formatBrackets.for);
20791
21106
  }
20792
21107
  for (const child of node.children) visit(child);
20793
- } else if (node.type === CompilerDOM.NodeTypes.TEXT_CALL) visit(node.content);
20794
- else if (node.type === CompilerDOM.NodeTypes.COMPOUND_EXPRESSION) {
21108
+ } else if (node.type === CompilerDOM.NodeTypes.COMPOUND_EXPRESSION) {
20795
21109
  for (const childNode of node.children) if (typeof childNode === "object") visit(childNode);
20796
21110
  } else if (node.type === CompilerDOM.NodeTypes.INTERPOLATION) {
20797
21111
  const [content, start] = (0, templateChild_1.parseInterpolationNode)(node, template.content);
@@ -21019,6 +21333,7 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21019
21333
  exports.effectScope = effectScope;
21020
21334
  exports.trigger = trigger;
21021
21335
  var system_js_1 = require_system();
21336
+ var HasChildEffect = 64;
21022
21337
  var cycle = 0;
21023
21338
  var runDepth = 0;
21024
21339
  var batchDepth = 0;
@@ -21050,12 +21365,13 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21050
21365
  }
21051
21366
  },
21052
21367
  unwatched(node) {
21053
- if (!(node.flags & 1)) effectScopeOper.call(node);
21054
- else if (node.depsTail !== void 0) {
21055
- node.depsTail = void 0;
21056
- node.flags = 17;
21057
- purgeDeps(node);
21058
- }
21368
+ if ("getter" in node) {
21369
+ if (node.depsTail !== void 0) {
21370
+ node.flags = 17;
21371
+ disposeAllDepsInReverse(node);
21372
+ }
21373
+ } else if ("currentValue" in node) {} else if ("fn" in node) effectOper.call(node);
21374
+ else effectScopeOper.call(node);
21059
21375
  }
21060
21376
  });
21061
21377
  function getActiveSub() {
@@ -21118,7 +21434,10 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21118
21434
  flags: 6
21119
21435
  };
21120
21436
  const prevSub = setActiveSub(e);
21121
- if (prevSub !== void 0) link(e, prevSub, 0);
21437
+ if (prevSub !== void 0) {
21438
+ link(e, prevSub, 0);
21439
+ prevSub.flags |= HasChildEffect;
21440
+ }
21122
21441
  try {
21123
21442
  ++runDepth;
21124
21443
  e.cleanup = e.fn();
@@ -21138,7 +21457,10 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21138
21457
  flags: 1
21139
21458
  };
21140
21459
  const prevSub = setActiveSub(e);
21141
- if (prevSub !== void 0) link(e, prevSub, 0);
21460
+ if (prevSub !== void 0) {
21461
+ link(e, prevSub, 0);
21462
+ prevSub.flags |= HasChildEffect;
21463
+ }
21142
21464
  try {
21143
21465
  fn();
21144
21466
  } finally {
@@ -21172,16 +21494,23 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21172
21494
  }
21173
21495
  }
21174
21496
  function updateComputed(c) {
21497
+ if (c.flags & HasChildEffect) {
21498
+ let link = c.depsTail;
21499
+ while (link !== void 0) {
21500
+ const prev = link.prevDep;
21501
+ const dep = link.dep;
21502
+ if (!("getter" in dep) && !("currentValue" in dep)) unlink(link, c);
21503
+ link = prev;
21504
+ }
21505
+ }
21175
21506
  c.depsTail = void 0;
21176
21507
  c.flags = 5;
21177
21508
  const prevSub = setActiveSub(c);
21178
21509
  try {
21179
21510
  ++cycle;
21180
- ++runDepth;
21181
21511
  const oldValue = c.value;
21182
21512
  return oldValue !== (c.value = c.getter(oldValue));
21183
21513
  } finally {
21184
- --runDepth;
21185
21514
  activeSub = prevSub;
21186
21515
  c.flags &= -5;
21187
21516
  purgeDeps(c);
@@ -21194,6 +21523,15 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21194
21523
  function run(e) {
21195
21524
  const flags = e.flags;
21196
21525
  if (flags & 16 || flags & 32 && checkDirty(e.deps, e)) {
21526
+ if (flags & HasChildEffect) {
21527
+ let link = e.depsTail;
21528
+ while (link !== void 0) {
21529
+ const prev = link.prevDep;
21530
+ const dep = link.dep;
21531
+ if (!("getter" in dep) && !("currentValue" in dep)) unlink(link, e);
21532
+ link = prev;
21533
+ }
21534
+ }
21197
21535
  if (e.cleanup) {
21198
21536
  runCleanup(e);
21199
21537
  if (!e.flags) return;
@@ -21211,7 +21549,7 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21211
21549
  e.flags &= -5;
21212
21550
  purgeDeps(e);
21213
21551
  }
21214
- } else if (e.flags) e.flags = 2;
21552
+ } else if (e.deps !== void 0) e.flags = 2 | flags & HasChildEffect;
21215
21553
  }
21216
21554
  function flush() {
21217
21555
  try {
@@ -21241,10 +21579,8 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21241
21579
  this.flags = 5;
21242
21580
  const prevSub = setActiveSub(this);
21243
21581
  try {
21244
- ++runDepth;
21245
21582
  this.value = this.getter();
21246
21583
  } finally {
21247
- --runDepth;
21248
21584
  activeSub = prevSub;
21249
21585
  this.flags &= -5;
21250
21586
  }
@@ -21287,16 +21623,23 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21287
21623
  }
21288
21624
  }
21289
21625
  function effectOper() {
21290
- if (this.cleanup) runCleanup(this);
21291
21626
  effectScopeOper.call(this);
21627
+ if (this.cleanup) runCleanup(this);
21292
21628
  }
21293
21629
  function effectScopeOper() {
21294
- this.depsTail = void 0;
21295
21630
  this.flags = 0;
21296
- purgeDeps(this);
21631
+ disposeAllDepsInReverse(this);
21297
21632
  const sub = this.subs;
21298
21633
  if (sub !== void 0) unlink(sub);
21299
21634
  }
21635
+ function disposeAllDepsInReverse(sub) {
21636
+ let link = sub.depsTail;
21637
+ while (link !== void 0) {
21638
+ const prev = link.prevDep;
21639
+ unlink(link, sub);
21640
+ link = prev;
21641
+ }
21642
+ }
21300
21643
  function purgeDeps(sub) {
21301
21644
  const depsTail = sub.depsTail;
21302
21645
  let dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps;
@@ -21308,7 +21651,7 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports) => {
21308
21651
  var require_localTypes = /* @__PURE__ */ __commonJSMin(((exports) => {
21309
21652
  Object.defineProperty(exports, "__esModule", { value: true });
21310
21653
  exports.getLocalTypesGenerator = getLocalTypesGenerator;
21311
- var utils_1 = require_utils$4();
21654
+ var utils_1 = require_utils$5();
21312
21655
  function getLocalTypesGenerator(vueCompilerOptions) {
21313
21656
  const used = /* @__PURE__ */ new Set();
21314
21657
  const WithDefaults = defineHelper(`__VLS_WithDefaults`, () => `
@@ -21444,7 +21787,7 @@ var require_merge = /* @__PURE__ */ __commonJSMin(((exports) => {
21444
21787
  Object.defineProperty(exports, "__esModule", { value: true });
21445
21788
  exports.generateIntersectMerge = generateIntersectMerge;
21446
21789
  exports.generateSpreadMerge = generateSpreadMerge;
21447
- var index_1 = require_utils$4();
21790
+ var index_1 = require_utils$5();
21448
21791
  function* generateIntersectMerge(generates) {
21449
21792
  yield* generates[0];
21450
21793
  for (let i = 1; i < generates.length; i++) {
@@ -21472,7 +21815,7 @@ var require_component = /* @__PURE__ */ __commonJSMin(((exports) => {
21472
21815
  exports.generateComponent = generateComponent;
21473
21816
  var codeFeatures_1 = require_codeFeatures();
21474
21817
  var names_1 = require_names();
21475
- var utils_1 = require_utils$4();
21818
+ var utils_1 = require_utils$5();
21476
21819
  var merge_1 = require_merge();
21477
21820
  function* generateComponent(options, ctx, scriptSetup, scriptSetupRanges) {
21478
21821
  yield `(await import('${options.vueCompilerOptions.lib}')).defineComponent({${utils_1.newLine}`;
@@ -21560,7 +21903,7 @@ var require_scriptSetup$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
21560
21903
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
21561
21904
  var codeFeatures_1 = require_codeFeatures();
21562
21905
  var names_1 = require_names();
21563
- var utils_1 = require_utils$4();
21906
+ var utils_1 = require_utils$5();
21564
21907
  var boundary_1 = require_boundary();
21565
21908
  var camelized_1 = require_camelized();
21566
21909
  var transform_1 = require_transform();
@@ -21845,7 +22188,7 @@ var require_template = /* @__PURE__ */ __commonJSMin(((exports) => {
21845
22188
  exports.generateTemplate = generateTemplate;
21846
22189
  var codeFeatures_1 = require_codeFeatures();
21847
22190
  var names_1 = require_names();
21848
- var utils_1 = require_utils$4();
22191
+ var utils_1 = require_utils$5();
21849
22192
  var merge_1 = require_merge();
21850
22193
  function* generateTemplate(options, ctx, selfType) {
21851
22194
  yield* generateSetupExposed(options, ctx);
@@ -21982,7 +22325,7 @@ var require_script = /* @__PURE__ */ __commonJSMin(((exports) => {
21982
22325
  var path = __importStar(require_path_browserify());
21983
22326
  var codeFeatures_1 = require_codeFeatures();
21984
22327
  var names_1 = require_names();
21985
- var utils_1 = require_utils$4();
22328
+ var utils_1 = require_utils$5();
21986
22329
  var boundary_1 = require_boundary();
21987
22330
  var context_1 = require_context();
21988
22331
  var scriptSetup_1 = require_scriptSetup$1();
@@ -22116,7 +22459,7 @@ var require_common$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
22116
22459
  exports.generateClassProperty = generateClassProperty;
22117
22460
  exports.generateStyleImports = generateStyleImports;
22118
22461
  var codeFeatures_1 = require_codeFeatures();
22119
- var utils_1 = require_utils$4();
22462
+ var utils_1 = require_utils$5();
22120
22463
  var boundary_1 = require_boundary();
22121
22464
  function* generateClassProperty(source, classNameWithDot, offset, propertyType) {
22122
22465
  yield `${utils_1.newLine} & { `;
@@ -22171,7 +22514,7 @@ var require_modules = /* @__PURE__ */ __commonJSMin(((exports) => {
22171
22514
  exports.generateStyleModules = generateStyleModules;
22172
22515
  var codeFeatures_1 = require_codeFeatures();
22173
22516
  var names_1 = require_names();
22174
- var utils_1 = require_utils$4();
22517
+ var utils_1 = require_utils$5();
22175
22518
  var common_1 = require_common$2();
22176
22519
  function* generateStyleModules({ styles, vueCompilerOptions }, ctx) {
22177
22520
  const styleModules = styles.filter((style) => style.module);
@@ -22206,7 +22549,7 @@ var require_scopedClasses = /* @__PURE__ */ __commonJSMin(((exports) => {
22206
22549
  exports.generateStyleScopedClasses = generateStyleScopedClasses;
22207
22550
  var names_1 = require_names();
22208
22551
  var styleScopedClasses_1 = require_styleScopedClasses();
22209
- var utils_1 = require_utils$4();
22552
+ var utils_1 = require_utils$5();
22210
22553
  var common_1 = require_common$2();
22211
22554
  function* generateStyleScopedClasses({ vueCompilerOptions, styles }) {
22212
22555
  const { resolveStyleClassNames, resolveStyleImports } = vueCompilerOptions;
@@ -22237,7 +22580,7 @@ var require_style = /* @__PURE__ */ __commonJSMin(((exports) => {
22237
22580
  var scopedClasses_1 = require_scopedClasses();
22238
22581
  var context_1 = require_context$1();
22239
22582
  var interpolation_1 = require_interpolation();
22240
- var utils_1 = require_utils$4();
22583
+ var utils_1 = require_utils$5();
22241
22584
  function generate(options) {
22242
22585
  const ctx = (0, context_1.createTemplateCodegenContext)();
22243
22586
  const codeGenerator = generateWorker(options, ctx);
@@ -22273,7 +22616,7 @@ var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
22273
22616
  exports.parseBindingRanges = parseBindingRanges;
22274
22617
  exports.getClosestMultiLineCommentRange = getClosestMultiLineCommentRange;
22275
22618
  var collectBindings_1 = require_collectBindings();
22276
- var shared_1 = require_shared$3();
22619
+ var shared_1 = require_shared$2();
22277
22620
  function parseBindingRanges(ts, ast, componentExtsensions) {
22278
22621
  const bindings = [];
22279
22622
  const components = [];
@@ -22332,7 +22675,7 @@ var require_scriptRanges = /* @__PURE__ */ __commonJSMin(((exports) => {
22332
22675
  Object.defineProperty(exports, "__esModule", { value: true });
22333
22676
  exports.parseScriptRanges = parseScriptRanges;
22334
22677
  exports.parseOptionsFromExtression = parseOptionsFromExtression;
22335
- var shared_1 = require_shared$3();
22678
+ var shared_1 = require_shared$2();
22336
22679
  var utils_1 = require_utils$2();
22337
22680
  function parseScriptRanges(ts, sourceFile, vueCompilerOptions) {
22338
22681
  let exportDefault;
@@ -22407,7 +22750,7 @@ var require_scriptSetupRanges = /* @__PURE__ */ __commonJSMin(((exports) => {
22407
22750
  Object.defineProperty(exports, "__esModule", { value: true });
22408
22751
  exports.parseScriptSetupRanges = parseScriptSetupRanges;
22409
22752
  var collectBindings_1 = require_collectBindings();
22410
- var shared_1 = require_shared$3();
22753
+ var shared_1 = require_shared$2();
22411
22754
  var utils_1 = require_utils$2();
22412
22755
  var tsCheckReg = /^\/\/\s*@ts-(?:no)?check(?:$|\s)/;
22413
22756
  function parseScriptSetupRanges(ts, sourceFile, vueCompilerOptions) {
@@ -22939,7 +23282,7 @@ var require_plugins = /* @__PURE__ */ __commonJSMin(((exports) => {
22939
23282
  var vue_template_inline_ts_1 = __importDefault(require_vue_template_inline_ts());
22940
23283
  var vue_tsx_1 = __importDefault(require_vue_tsx());
22941
23284
  var types_1 = require_types();
22942
- __exportStar(require_shared$2(), exports);
23285
+ __exportStar(require_shared$1(), exports);
22943
23286
  function createPlugins(pluginContext) {
22944
23287
  return [
22945
23288
  file_vue_1.default,
@@ -23182,246 +23525,12 @@ var require_embeddedCodes = /* @__PURE__ */ __commonJSMin(((exports) => {
23182
23525
  }
23183
23526
  }));
23184
23527
  //#endregion
23185
- //#region node_modules/@vue/language-core/lib/virtualCode/normalize.js
23186
- var require_normalize = /* @__PURE__ */ __commonJSMin(((exports) => {
23187
- var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
23188
- if (k2 === void 0) k2 = k;
23189
- var desc = Object.getOwnPropertyDescriptor(m, k);
23190
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
23191
- enumerable: true,
23192
- get: function() {
23193
- return m[k];
23194
- }
23195
- };
23196
- Object.defineProperty(o, k2, desc);
23197
- }) : (function(o, m, k, k2) {
23198
- if (k2 === void 0) k2 = k;
23199
- o[k2] = m[k];
23200
- }));
23201
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
23202
- Object.defineProperty(o, "default", {
23203
- enumerable: true,
23204
- value: v
23205
- });
23206
- }) : function(o, v) {
23207
- o["default"] = v;
23208
- });
23209
- var __importStar = exports && exports.__importStar || (function() {
23210
- var ownKeys = function(o) {
23211
- ownKeys = Object.getOwnPropertyNames || function(o) {
23212
- var ar = [];
23213
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23214
- return ar;
23215
- };
23216
- return ownKeys(o);
23217
- };
23218
- return function(mod) {
23219
- if (mod && mod.__esModule) return mod;
23220
- var result = {};
23221
- if (mod != null) {
23222
- for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
23223
- }
23224
- __setModuleDefault(result, mod);
23225
- return result;
23226
- };
23227
- })();
23228
- Object.defineProperty(exports, "__esModule", { value: true });
23229
- exports.normalizeTemplateAST = normalizeTemplateAST;
23230
- var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
23231
- var forEachTemplateNode_1 = require_forEachTemplateNode();
23232
- function normalizeTemplateAST(root) {
23233
- const transformContext = {
23234
- onError: () => {},
23235
- helperString: (str) => str.toString(),
23236
- replaceNode: () => {},
23237
- cacheHandlers: false,
23238
- prefixIdentifiers: false,
23239
- scopes: {
23240
- vFor: 0,
23241
- vOnce: 0,
23242
- vPre: 0,
23243
- vSlot: 0
23244
- },
23245
- expressionPlugins: ["typescript"]
23246
- };
23247
- for (const { children, codegenNode, props } of (0, forEachTemplateNode_1.forEachElementNode)(root)) {
23248
- for (let i = 0; i < children.length; i++) {
23249
- const child = children[i];
23250
- if (child.type !== CompilerDOM.NodeTypes.ELEMENT) continue;
23251
- const forNode = getVForNode(child, transformContext);
23252
- if (forNode) {
23253
- children[i] = forNode;
23254
- continue;
23255
- }
23256
- const ifNode = getVIfNode(child, transformContext);
23257
- if (ifNode) {
23258
- const normalized = normalizeIfBranch(ifNode, children, i);
23259
- children.splice(i, normalized.end - i + 1, normalized.node);
23260
- continue;
23261
- }
23262
- }
23263
- if (codegenNode && "props" in codegenNode && codegenNode.props && "properties" in codegenNode.props) {
23264
- for (const p of codegenNode.props.properties) if (p.key.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && p.key.content === "key" && !p.key.isHandlerKey && !p.key.loc.source && p.value.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && p.value.constType === CompilerDOM.ConstantTypes.NOT_CONSTANT) {
23265
- const argOffset = root.loc.source.slice(0, p.value.loc.start.offset).lastIndexOf("key");
23266
- props.push({
23267
- type: CompilerDOM.NodeTypes.DIRECTIVE,
23268
- name: "bind",
23269
- exp: p.value,
23270
- loc: p.loc,
23271
- arg: {
23272
- ...p.key,
23273
- loc: {
23274
- start: {
23275
- line: -1,
23276
- column: -1,
23277
- offset: argOffset
23278
- },
23279
- end: {
23280
- line: -1,
23281
- column: -1,
23282
- offset: argOffset + 3
23283
- },
23284
- source: "key"
23285
- }
23286
- },
23287
- modifiers: []
23288
- });
23289
- break;
23290
- }
23291
- }
23292
- }
23293
- }
23294
- function normalizeIfBranch(ifNode, children, start) {
23295
- let end = start;
23296
- let comments = [];
23297
- for (let i = start + 1; i < children.length; i++) {
23298
- const sibling = children[i];
23299
- if (sibling.type === CompilerDOM.NodeTypes.COMMENT) {
23300
- comments.push(sibling);
23301
- continue;
23302
- }
23303
- if (sibling.type === CompilerDOM.NodeTypes.TEXT && !sibling.content.trim()) continue;
23304
- const elseBranch = getVElseDirective(sibling);
23305
- if (elseBranch) {
23306
- const branch = createIfBranch({
23307
- ...elseBranch.element,
23308
- props: elseBranch.element.props.filter((prop) => prop !== elseBranch.directive)
23309
- }, elseBranch.directive);
23310
- if (comments.length) branch.children = [...comments, ...branch.children];
23311
- ifNode.branches.push(branch);
23312
- comments = [];
23313
- end = i;
23314
- continue;
23315
- }
23316
- break;
23317
- }
23318
- return {
23319
- node: ifNode,
23320
- end
23321
- };
23322
- }
23323
- function createIfBranch(node, dir) {
23324
- const isTemplateIf = node.tagType === CompilerDOM.ElementTypes.TEMPLATE;
23325
- return {
23326
- type: CompilerDOM.NodeTypes.IF_BRANCH,
23327
- loc: node.loc,
23328
- condition: dir.name === "else" ? void 0 : dir.exp,
23329
- children: isTemplateIf && !CompilerDOM.findDir(node, "for") && !CompilerDOM.findDir(node, "slot") ? node.children : [node],
23330
- userKey: CompilerDOM.findProp(node, "key"),
23331
- isTemplateIf
23332
- };
23333
- }
23334
- function getVElseDirective(node) {
23335
- if (node.type !== CompilerDOM.NodeTypes.ELEMENT) return;
23336
- const directive = node.props.find((prop) => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && (prop.name === "else-if" || prop.name === "else"));
23337
- if (directive) return {
23338
- element: node,
23339
- directive
23340
- };
23341
- }
23342
- function getVForNode(node, transformContext) {
23343
- const forDirective = node.props.find((prop) => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === "for");
23344
- if (forDirective) {
23345
- let forNode;
23346
- CompilerDOM.processFor(node, forDirective, transformContext, (_forNode) => {
23347
- forNode = { ..._forNode };
23348
- });
23349
- if (forNode) {
23350
- forNode.children = [{
23351
- ...node,
23352
- props: node.props.filter((prop) => prop !== forDirective)
23353
- }];
23354
- return forNode;
23355
- }
23356
- }
23357
- }
23358
- function getVIfNode(node, transformContext) {
23359
- const ifDirective = node.props.find((prop) => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === "if");
23360
- if (ifDirective) {
23361
- let ifNode;
23362
- CompilerDOM.processIf(node, ifDirective, transformContext, (_ifNode) => {
23363
- ifNode = { ..._ifNode };
23364
- });
23365
- if (ifNode) {
23366
- for (const branch of ifNode.branches) branch.children = [{
23367
- ...node,
23368
- props: node.props.filter((prop) => prop !== ifDirective)
23369
- }];
23370
- return ifNode;
23371
- }
23372
- }
23373
- }
23374
- }));
23375
- //#endregion
23376
23528
  //#region node_modules/@vue/language-core/lib/virtualCode/ir.js
23377
23529
  var require_ir = /* @__PURE__ */ __commonJSMin(((exports) => {
23378
- var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
23379
- if (k2 === void 0) k2 = k;
23380
- var desc = Object.getOwnPropertyDescriptor(m, k);
23381
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
23382
- enumerable: true,
23383
- get: function() {
23384
- return m[k];
23385
- }
23386
- };
23387
- Object.defineProperty(o, k2, desc);
23388
- }) : (function(o, m, k, k2) {
23389
- if (k2 === void 0) k2 = k;
23390
- o[k2] = m[k];
23391
- }));
23392
- var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
23393
- Object.defineProperty(o, "default", {
23394
- enumerable: true,
23395
- value: v
23396
- });
23397
- }) : function(o, v) {
23398
- o["default"] = v;
23399
- });
23400
- var __importStar = exports && exports.__importStar || (function() {
23401
- var ownKeys = function(o) {
23402
- ownKeys = Object.getOwnPropertyNames || function(o) {
23403
- var ar = [];
23404
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23405
- return ar;
23406
- };
23407
- return ownKeys(o);
23408
- };
23409
- return function(mod) {
23410
- if (mod && mod.__esModule) return mod;
23411
- var result = {};
23412
- if (mod != null) {
23413
- for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
23414
- }
23415
- __setModuleDefault(result, mod);
23416
- return result;
23417
- };
23418
- })();
23419
23530
  Object.defineProperty(exports, "__esModule", { value: true });
23420
23531
  exports.useIR = useIR;
23421
- var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
23422
23532
  var alien_signals_1 = require_cjs();
23423
23533
  var signals_1 = require_signals();
23424
- var normalize_1 = require_normalize();
23425
23534
  function useIR(ts, plugins, fileName, getSnapshot, getParseSfcResult) {
23426
23535
  const getUntrackedSnapshot = () => {
23427
23536
  const pausedSub = (0, alien_signals_1.setActiveSub)(void 0);
@@ -23595,28 +23704,22 @@ var require_ir = /* @__PURE__ */ __commonJSMin(((exports) => {
23595
23704
  }
23596
23705
  const errors = [];
23597
23706
  const warnings = [];
23598
- const [nodeTransforms, directiveTransforms] = CompilerDOM.getBaseTransformPreset();
23599
23707
  let options = {
23600
23708
  onError: (err) => errors.push(err),
23601
23709
  onWarn: (err) => warnings.push(err),
23602
- expressionPlugins: ["typescript"],
23603
- nodeTransforms,
23604
- directiveTransforms
23710
+ expressionPlugins: ["typescript"]
23605
23711
  };
23606
23712
  for (const plugin of plugins) if (plugin.resolveTemplateCompilerOptions) options = plugin.resolveTemplateCompilerOptions(options);
23607
23713
  for (const plugin of plugins) try {
23608
23714
  const result = plugin.compileSFCTemplate?.(base.lang, base.content, options);
23609
- if (result) {
23610
- (0, normalize_1.normalizeTemplateAST)(result.ast);
23611
- return {
23612
- snapshot: getUntrackedSnapshot(),
23613
- template: base.content,
23614
- result,
23615
- plugin,
23616
- errors,
23617
- warnings
23618
- };
23619
- }
23715
+ if (result) return {
23716
+ snapshot: getUntrackedSnapshot(),
23717
+ template: base.content,
23718
+ result,
23719
+ plugin,
23720
+ errors,
23721
+ warnings
23722
+ };
23620
23723
  } catch (e) {
23621
23724
  return {
23622
23725
  snapshot: getUntrackedSnapshot(),
@@ -23818,6 +23921,7 @@ var require_languagePlugin = /* @__PURE__ */ __commonJSMin(((exports) => {
23818
23921
  exports.getAllExtensions = getAllExtensions;
23819
23922
  var language_core_1 = require_language_core$1();
23820
23923
  var CompilerDOM = __importStar((init_compiler_dom_esm_bundler(), __toCommonJS(compiler_dom_esm_bundler_exports)));
23924
+ var LanguageCore = __importStar(require_language_core());
23821
23925
  var plugins_1 = require_plugins();
23822
23926
  var virtualCode_1 = require_virtualCode();
23823
23927
  var fileRegistries = {};
@@ -23833,6 +23937,7 @@ var require_languagePlugin = /* @__PURE__ */ __commonJSMin(((exports) => {
23833
23937
  const pluginContext = {
23834
23938
  modules: {
23835
23939
  "@vue/compiler-dom": CompilerDOM,
23940
+ "@vue/language-core": LanguageCore,
23836
23941
  typescript: ts
23837
23942
  },
23838
23943
  compilerOptions,
@@ -23925,11 +24030,12 @@ var require_language_core = /* @__PURE__ */ __commonJSMin(((exports) => {
23925
24030
  __exportStar(require_scriptRanges(), exports);
23926
24031
  __exportStar(require_scriptSetupRanges(), exports);
23927
24032
  __exportStar(require_plugins(), exports);
24033
+ __exportStar(require_compile(), exports);
23928
24034
  __exportStar(require_types(), exports);
23929
24035
  __exportStar(require_collectBindings(), exports);
23930
24036
  __exportStar(require_forEachTemplateNode(), exports);
23931
24037
  __exportStar(require_parseSfc(), exports);
23932
- __exportStar(require_shared$3(), exports);
24038
+ __exportStar(require_shared$2(), exports);
23933
24039
  __exportStar(require_virtualCode(), exports);
23934
24040
  var names_1 = require_names();
23935
24041
  Object.defineProperty(exports, "names", {
@@ -31721,8 +31827,8 @@ var require_main$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
31721
31827
  }));
31722
31828
  }));
31723
31829
  //#endregion
31724
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/shared.js
31725
- var require_shared$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
31830
+ //#region node_modules/volar-service-typescript/lib/shared.js
31831
+ var require_shared = /* @__PURE__ */ __commonJSMin(((exports) => {
31726
31832
  Object.defineProperty(exports, "__esModule", { value: true });
31727
31833
  exports.getConfigTitle = getConfigTitle;
31728
31834
  exports.isTsDocument = isTsDocument;
@@ -33118,8 +33224,8 @@ var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
33118
33224
  };
33119
33225
  }));
33120
33226
  //#endregion
33121
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/protocol.const.js
33122
- var require_protocol_const$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33227
+ //#region node_modules/volar-service-typescript/lib/protocol.const.js
33228
+ var require_protocol_const = /* @__PURE__ */ __commonJSMin(((exports) => {
33123
33229
  Object.defineProperty(exports, "__esModule", { value: true });
33124
33230
  exports.EventName = exports.DisplayPartKind = exports.KindModifiers = exports.DiagnosticCategory = exports.Kind = void 0;
33125
33231
  var Kind = class {};
@@ -33204,8 +33310,8 @@ var require_protocol_const$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33204
33310
  })(EventName || (exports.EventName = EventName = {}));
33205
33311
  }));
33206
33312
  //#endregion
33207
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/utils/modifiers.js
33208
- var require_modifiers$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33313
+ //#region node_modules/volar-service-typescript/lib/utils/modifiers.js
33314
+ var require_modifiers = /* @__PURE__ */ __commonJSMin(((exports) => {
33209
33315
  Object.defineProperty(exports, "__esModule", { value: true });
33210
33316
  exports.parseKindModifier = parseKindModifier;
33211
33317
  function parseKindModifier(kindModifiers) {
@@ -33213,8 +33319,8 @@ var require_modifiers$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33213
33319
  }
33214
33320
  }));
33215
33321
  //#endregion
33216
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/utils/previewer.js
33217
- var require_previewer$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33322
+ //#region node_modules/volar-service-typescript/lib/utils/previewer.js
33323
+ var require_previewer = /* @__PURE__ */ __commonJSMin(((exports) => {
33218
33324
  Object.defineProperty(exports, "__esModule", { value: true });
33219
33325
  exports.plainWithLinks = plainWithLinks;
33220
33326
  exports.tagsMarkdownPreview = tagsMarkdownPreview;
@@ -33354,11 +33460,11 @@ var require_previewer$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33354
33460
  }
33355
33461
  }));
33356
33462
  //#endregion
33357
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/utils/typeConverters.js
33358
- var require_typeConverters$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33463
+ //#region node_modules/volar-service-typescript/lib/utils/typeConverters.js
33464
+ var require_typeConverters = /* @__PURE__ */ __commonJSMin(((exports) => {
33359
33465
  Object.defineProperty(exports, "__esModule", { value: true });
33360
33466
  exports.SymbolKind = void 0;
33361
- var PConst = require_protocol_const$1();
33467
+ var PConst = require_protocol_const();
33362
33468
  var SymbolKind;
33363
33469
  (function(SymbolKind) {
33364
33470
  function fromProtocolScriptElementKind(kind) {
@@ -33392,8 +33498,8 @@ var require_typeConverters$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33392
33498
  })(SymbolKind || (exports.SymbolKind = SymbolKind = {}));
33393
33499
  }));
33394
33500
  //#endregion
33395
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/utils/lspConverters.js
33396
- var require_lspConverters$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33501
+ //#region node_modules/volar-service-typescript/lib/utils/lspConverters.js
33502
+ var require_lspConverters = /* @__PURE__ */ __commonJSMin(((exports) => {
33397
33503
  Object.defineProperty(exports, "__esModule", { value: true });
33398
33504
  exports.convertDiagnostic = convertDiagnostic;
33399
33505
  exports.applyCompletionEntryDetails = applyCompletionEntryDetails;
@@ -33419,10 +33525,10 @@ var require_lspConverters$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
33419
33525
  exports.convertTextSpan = convertTextSpan;
33420
33526
  var path = require_path_browserify();
33421
33527
  var semver = require_semver();
33422
- var PConst = require_protocol_const$1();
33423
- var modifiers_1 = require_modifiers$1();
33424
- var previewer = require_previewer$1();
33425
- var typeConverters = require_typeConverters$1();
33528
+ var PConst = require_protocol_const();
33529
+ var modifiers_1 = require_modifiers();
33530
+ var previewer = require_previewer();
33531
+ var typeConverters = require_typeConverters();
33426
33532
  function convertDiagnostic(diag, document, fileNameToUri, getTextDocument) {
33427
33533
  if (diag.start === void 0) return;
33428
33534
  if (diag.length === void 0) return;
@@ -34067,11 +34173,11 @@ var require_lspConverters$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
34067
34173
  }
34068
34174
  }));
34069
34175
  //#endregion
34070
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/configs/getFormatCodeSettings.js
34071
- var require_getFormatCodeSettings$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
34176
+ //#region node_modules/volar-service-typescript/lib/configs/getFormatCodeSettings.js
34177
+ var require_getFormatCodeSettings = /* @__PURE__ */ __commonJSMin(((exports) => {
34072
34178
  Object.defineProperty(exports, "__esModule", { value: true });
34073
34179
  exports.getFormatCodeSettings = getFormatCodeSettings;
34074
- var shared_1 = require_shared$1();
34180
+ var shared_1 = require_shared();
34075
34181
  async function getFormatCodeSettings(ctx, document, options) {
34076
34182
  const config = await ctx.env.getConfiguration?.((0, shared_1.getConfigTitle)(document) + ".format") ?? {};
34077
34183
  return {
@@ -34101,7 +34207,7 @@ var require_getFormatCodeSettings$1 = /* @__PURE__ */ __commonJSMin(((exports) =
34101
34207
  }
34102
34208
  }));
34103
34209
  //#endregion
34104
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/syntaxOnlyService.js
34210
+ //#region node_modules/volar-service-typescript/lib/syntaxOnlyService.js
34105
34211
  var require_syntaxOnlyService = /* @__PURE__ */ __commonJSMin(((exports) => {
34106
34212
  Object.defineProperty(exports, "__esModule", { value: true });
34107
34213
  exports.createSyntaxOnlyService = createSyntaxOnlyService;
@@ -34141,15 +34247,15 @@ var require_syntaxOnlyService = /* @__PURE__ */ __commonJSMin(((exports) => {
34141
34247
  }
34142
34248
  }));
34143
34249
  //#endregion
34144
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/plugins/syntactic.js
34250
+ //#region node_modules/volar-service-typescript/lib/plugins/syntactic.js
34145
34251
  var require_syntactic = /* @__PURE__ */ __commonJSMin(((exports) => {
34146
34252
  Object.defineProperty(exports, "__esModule", { value: true });
34147
34253
  exports.getLanguageServiceByDocument = getLanguageServiceByDocument;
34148
34254
  exports.create = create;
34149
- var getFormatCodeSettings_1 = require_getFormatCodeSettings$1();
34150
- var shared_1 = require_shared$1();
34255
+ var getFormatCodeSettings_1 = require_getFormatCodeSettings();
34256
+ var shared_1 = require_shared();
34151
34257
  var syntaxOnlyService_1 = require_syntaxOnlyService();
34152
- var lspConverters_1 = require_lspConverters$1();
34258
+ var lspConverters_1 = require_lspConverters();
34153
34259
  var snapshots = /* @__PURE__ */ new WeakMap();
34154
34260
  var created;
34155
34261
  function getLanguageServiceByDocument(ts, document) {
@@ -34247,13 +34353,13 @@ var require_syntactic = /* @__PURE__ */ __commonJSMin(((exports) => {
34247
34353
  }
34248
34354
  }));
34249
34355
  //#endregion
34250
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/plugins/docCommentTemplate.js
34356
+ //#region node_modules/volar-service-typescript/lib/plugins/docCommentTemplate.js
34251
34357
  var require_docCommentTemplate = /* @__PURE__ */ __commonJSMin(((exports) => {
34252
34358
  Object.defineProperty(exports, "__esModule", { value: true });
34253
34359
  exports.create = create;
34254
34360
  var nls = require_main$2();
34255
- var shared_1 = require_shared$1();
34256
- var lspConverters_1 = require_lspConverters$1();
34361
+ var shared_1 = require_shared();
34362
+ var lspConverters_1 = require_lspConverters();
34257
34363
  var syntactic_1 = require_syntactic();
34258
34364
  var localize = nls.loadMessageBundle();
34259
34365
  var defaultJsDoc = `/**\n * $0\n */`;
@@ -84420,7 +84526,7 @@ var require_volar_service_css = /* @__PURE__ */ __commonJSMin(((exports) => {
84420
84526
  type: css.FileType.Unknown,
84421
84527
  ctime: 0,
84422
84528
  mtime: 0,
84423
- size: 0
84529
+ size: -1
84424
84530
  },
84425
84531
  readDirectory: async (uri) => await context.env.fs?.readDirectory(vscode_uri_1.URI.parse(uri)) ?? []
84426
84532
  };
@@ -84530,14 +84636,16 @@ var require_volar_service_css = /* @__PURE__ */ __commonJSMin(((exports) => {
84530
84636
  let prefixes = [];
84531
84637
  let suffixes = [];
84532
84638
  if (codeOptions?.initialIndentLevel) {
84639
+ const documentText = document.getText();
84640
+ const lastSuffix = endWithNewLine(documentText) ? "}" : "\n}";
84533
84641
  for (let i = 0; i < codeOptions.initialIndentLevel; i++) if (i === codeOptions.initialIndentLevel - 1) {
84534
84642
  prefixes.push("_", "{");
84535
- suffixes.unshift("}");
84643
+ suffixes.unshift(lastSuffix);
84536
84644
  } else {
84537
84645
  prefixes.push("_", "{\n");
84538
84646
  suffixes.unshift("\n}");
84539
84647
  }
84540
- formatDocument = vscode_languageserver_textdocument_1.TextDocument.create(document.uri, document.languageId, document.version, prefixes.join("") + document.getText() + suffixes.join(""));
84648
+ formatDocument = vscode_languageserver_textdocument_1.TextDocument.create(document.uri, document.languageId, document.version, prefixes.join("") + documentText + suffixes.join(""));
84541
84649
  formatRange = {
84542
84650
  start: formatDocument.positionAt(0),
84543
84651
  end: formatDocument.positionAt(formatDocument.getText().length)
@@ -84559,7 +84667,8 @@ var require_volar_service_css = /* @__PURE__ */ __commonJSMin(((exports) => {
84559
84667
  }
84560
84668
  return edits;
84561
84669
  function ensureNewLines(newText) {
84562
- const verifyDocument = vscode_languageserver_textdocument_1.TextDocument.create(document.uri, document.languageId, document.version, "_ {" + newText + "}");
84670
+ const verifySuffix = endWithNewLine(newText) ? "}" : "\n}";
84671
+ const verifyDocument = vscode_languageserver_textdocument_1.TextDocument.create(document.uri, document.languageId, document.version, "_ {" + newText + verifySuffix);
84563
84672
  const verifyEdits = cssLs.format(verifyDocument, void 0, formatOptions);
84564
84673
  let verifyText = vscode_languageserver_textdocument_1.TextDocument.applyEdits(verifyDocument, verifyEdits);
84565
84674
  verifyText = verifyText.trimStart().slice(1);
@@ -84772,12 +84881,12 @@ var require_css = /* @__PURE__ */ __commonJSMin(((exports) => {
84772
84881
  }
84773
84882
  }));
84774
84883
  //#endregion
84775
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/semanticFeatures/semanticTokens.js
84776
- var require_semanticTokens$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
84884
+ //#region node_modules/volar-service-typescript/lib/semanticFeatures/semanticTokens.js
84885
+ var require_semanticTokens = /* @__PURE__ */ __commonJSMin(((exports) => {
84777
84886
  Object.defineProperty(exports, "__esModule", { value: true });
84778
84887
  exports.register = register;
84779
84888
  exports.convertClassificationsToSemanticTokens = convertClassificationsToSemanticTokens;
84780
- var shared_1 = require_shared$1();
84889
+ var shared_1 = require_shared();
84781
84890
  function register(ts, ctx) {
84782
84891
  return (uri, document, range, legend) => {
84783
84892
  const fileName = ctx.uriToFileName(uri);
@@ -84898,7 +85007,7 @@ var require_semanticTokens$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
84898
85007
  var require_typescript_semantic_tokens = /* @__PURE__ */ __commonJSMin(((exports) => {
84899
85008
  Object.defineProperty(exports, "__esModule", { value: true });
84900
85009
  exports.create = create;
84901
- var semanticTokens_1 = require_semanticTokens$1();
85010
+ var semanticTokens_1 = require_semanticTokens();
84902
85011
  var utils_1 = require_utils$1();
84903
85012
  function create({ getEncodedSemanticClassifications }) {
84904
85013
  return {
@@ -85208,13 +85317,13 @@ var require_vue_directive_comments = /* @__PURE__ */ __commonJSMin(((exports) =>
85208
85317
  }
85209
85318
  }));
85210
85319
  //#endregion
85211
- //#region node_modules/@vue/language-service/node_modules/volar-service-typescript/lib/configs/getUserPreferences.js
85212
- var require_getUserPreferences$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
85320
+ //#region node_modules/volar-service-typescript/lib/configs/getUserPreferences.js
85321
+ var require_getUserPreferences = /* @__PURE__ */ __commonJSMin(((exports) => {
85213
85322
  Object.defineProperty(exports, "__esModule", { value: true });
85214
85323
  exports.getUserPreferences = getUserPreferences;
85215
85324
  var path = require_path_browserify();
85216
85325
  var vscode_uri_1 = require_umd();
85217
- var shared_1 = require_shared$1();
85326
+ var shared_1 = require_shared();
85218
85327
  async function getUserPreferences(ctx, document) {
85219
85328
  let currentDirectory = "";
85220
85329
  if (ctx.project.typescript) currentDirectory = ctx.project.typescript.languageServiceHost.getCurrentDirectory();
@@ -85600,7 +85709,7 @@ var require_vue_document_drop = /* @__PURE__ */ __commonJSMin(((exports) => {
85600
85709
  var language_core_1 = require_language_core();
85601
85710
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
85602
85711
  var path_browserify_1 = require_path_browserify();
85603
- var getUserPreferences_1 = require_getUserPreferences$1();
85712
+ var getUserPreferences_1 = require_getUserPreferences();
85604
85713
  var vscode_uri_1 = require_umd();
85605
85714
  var nameCasing_1 = require_nameCasing();
85606
85715
  var vue_extract_file_1 = require_vue_extract_file();
@@ -104299,7 +104408,7 @@ var require_volar_service_html = /* @__PURE__ */ __commonJSMin(((exports) => {
104299
104408
  type: html.FileType.Unknown,
104300
104409
  ctime: 0,
104301
104410
  mtime: 0,
104302
- size: 0
104411
+ size: -1
104303
104412
  },
104304
104413
  readDirectory: async (uri) => await context.env.fs?.readDirectory(vscode_uri_1.URI.parse(uri)) ?? []
104305
104414
  };
@@ -112674,7 +112783,7 @@ var require_vue_template = /* @__PURE__ */ __commonJSMin(((exports) => {
112674
112783
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
112675
112784
  var volar_service_html_1 = require_volar_service_html();
112676
112785
  var volar_service_pug_1 = require_empty();
112677
- var lspConverters_js_1 = require_lspConverters$1();
112786
+ var lspConverters_js_1 = require_lspConverters();
112678
112787
  var html = __importStar((init_htmlLanguageService(), __toCommonJS(htmlLanguageService_exports)));
112679
112788
  var vscode_uri_1 = require_umd();
112680
112789
  var data_1 = require_data();
@@ -113477,7 +113586,7 @@ var require_common = /* @__PURE__ */ __commonJSMin(((exports) => {
113477
113586
  Object.defineProperty(exports, "__esModule", { value: true });
113478
113587
  exports.postprocessLanguageService = postprocessLanguageService;
113479
113588
  require_transform$1();
113480
- require_utils$5();
113589
+ require_utils$6();
113481
113590
  var language_core_1 = require_language_core();
113482
113591
  var shared_1 = (init_shared_esm_bundler(), __toCommonJS(shared_esm_bundler_exports));
113483
113592
  var windowsPathReg = /\\/g;
@@ -262245,31 +262354,6 @@ Additional information: BADCLIENT: Bad error code, ${badCode} not found in range
262245
262354
  });
262246
262355
  }));
262247
262356
  //#endregion
262248
- //#region node_modules/volar-service-typescript/lib/shared.js
262249
- var require_shared = /* @__PURE__ */ __commonJSMin(((exports) => {
262250
- Object.defineProperty(exports, "__esModule", { value: true });
262251
- exports.getConfigTitle = getConfigTitle;
262252
- exports.isTsDocument = isTsDocument;
262253
- exports.isJsonDocument = isJsonDocument;
262254
- exports.safeCall = safeCall;
262255
- function getConfigTitle(document) {
262256
- if (document.languageId === "javascriptreact") return "javascript";
262257
- if (document.languageId === "typescriptreact") return "typescript";
262258
- return document.languageId;
262259
- }
262260
- function isTsDocument(document) {
262261
- return document.languageId === "javascript" || document.languageId === "typescript" || document.languageId === "javascriptreact" || document.languageId === "typescriptreact";
262262
- }
262263
- function isJsonDocument(document) {
262264
- return document.languageId === "json" || document.languageId === "jsonc";
262265
- }
262266
- function safeCall(cb) {
262267
- try {
262268
- return cb();
262269
- } catch {}
262270
- }
262271
- }));
262272
- //#endregion
262273
262357
  //#region node_modules/volar-service-typescript/lib/plugins/directiveComment.js
262274
262358
  var require_directiveComment = /* @__PURE__ */ __commonJSMin(((exports) => {
262275
262359
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -263452,135 +263536,6 @@ var require_out = /* @__PURE__ */ __commonJSMin(((exports) => {
263452
263536
  exports.createLanguageService = createLanguageService;
263453
263537
  }));
263454
263538
  //#endregion
263455
- //#region node_modules/volar-service-typescript/lib/configs/getFormatCodeSettings.js
263456
- var require_getFormatCodeSettings = /* @__PURE__ */ __commonJSMin(((exports) => {
263457
- Object.defineProperty(exports, "__esModule", { value: true });
263458
- exports.getFormatCodeSettings = getFormatCodeSettings;
263459
- var shared_1 = require_shared();
263460
- async function getFormatCodeSettings(ctx, document, options) {
263461
- const config = await ctx.env.getConfiguration?.((0, shared_1.getConfigTitle)(document) + ".format") ?? {};
263462
- return {
263463
- convertTabsToSpaces: options?.insertSpaces,
263464
- tabSize: options?.tabSize,
263465
- indentSize: options?.tabSize,
263466
- indentStyle: 2,
263467
- newLineCharacter: "\n",
263468
- insertSpaceAfterCommaDelimiter: config.insertSpaceAfterCommaDelimiter ?? true,
263469
- insertSpaceAfterConstructor: config.insertSpaceAfterConstructor ?? false,
263470
- insertSpaceAfterSemicolonInForStatements: config.insertSpaceAfterSemicolonInForStatements ?? true,
263471
- insertSpaceBeforeAndAfterBinaryOperators: config.insertSpaceBeforeAndAfterBinaryOperators ?? true,
263472
- insertSpaceAfterKeywordsInControlFlowStatements: config.insertSpaceAfterKeywordsInControlFlowStatements ?? true,
263473
- insertSpaceAfterFunctionKeywordForAnonymousFunctions: config.insertSpaceAfterFunctionKeywordForAnonymousFunctions ?? true,
263474
- insertSpaceBeforeFunctionParenthesis: config.insertSpaceBeforeFunctionParenthesis ?? false,
263475
- insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: config.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis ?? false,
263476
- insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets: config.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets ?? false,
263477
- insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces: config.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces ?? true,
263478
- insertSpaceAfterOpeningAndBeforeClosingEmptyBraces: config.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces ?? true,
263479
- insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces: config.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces ?? false,
263480
- insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces: config.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces ?? false,
263481
- insertSpaceAfterTypeAssertion: config.insertSpaceAfterTypeAssertion ?? false,
263482
- placeOpenBraceOnNewLineForFunctions: config.placeOpenBraceOnNewLineForFunctions ?? false,
263483
- placeOpenBraceOnNewLineForControlBlocks: config.placeOpenBraceOnNewLineForControlBlocks ?? false,
263484
- semicolons: config.semicolons ?? "ignore"
263485
- };
263486
- }
263487
- }));
263488
- //#endregion
263489
- //#region node_modules/volar-service-typescript/lib/configs/getUserPreferences.js
263490
- var require_getUserPreferences = /* @__PURE__ */ __commonJSMin(((exports) => {
263491
- Object.defineProperty(exports, "__esModule", { value: true });
263492
- exports.getUserPreferences = getUserPreferences;
263493
- var path = require_path_browserify();
263494
- var vscode_uri_1 = require_umd();
263495
- var shared_1 = require_shared();
263496
- async function getUserPreferences(ctx, document) {
263497
- let currentDirectory = "";
263498
- if (ctx.project.typescript) currentDirectory = ctx.project.typescript.languageServiceHost.getCurrentDirectory();
263499
- const uri = vscode_uri_1.URI.parse(document.uri);
263500
- const documentUri = ctx.decodeEmbeddedDocumentUri(uri)?.[0] ?? uri;
263501
- const config = await ctx.env.getConfiguration?.((0, shared_1.getConfigTitle)(document)) ?? {};
263502
- const preferencesConfig = config?.preferences ?? {};
263503
- return {
263504
- ...config.unstable ?? {},
263505
- quotePreference: getQuoteStylePreference(preferencesConfig),
263506
- importModuleSpecifierPreference: getImportModuleSpecifierPreference(preferencesConfig),
263507
- importModuleSpecifierEnding: getImportModuleSpecifierEndingPreference(preferencesConfig),
263508
- jsxAttributeCompletionStyle: getJsxAttributeCompletionStyle(preferencesConfig),
263509
- allowTextChangesInNewFiles: documentUri.scheme === "file",
263510
- providePrefixAndSuffixTextForRename: (preferencesConfig.renameShorthandProperties ?? true) === false ? false : preferencesConfig.useAliasesForRenames ?? true,
263511
- allowRenameOfImportPath: true,
263512
- includeAutomaticOptionalChainCompletions: config.suggest?.includeAutomaticOptionalChainCompletions ?? true,
263513
- provideRefactorNotApplicableReason: true,
263514
- generateReturnInDocTemplate: config.suggest?.jsdoc?.generateReturns ?? true,
263515
- includeCompletionsForImportStatements: config.suggest?.includeCompletionsForImportStatements ?? true,
263516
- includeCompletionsWithSnippetText: config.suggest?.includeCompletionsWithSnippetText ?? true,
263517
- includeCompletionsWithClassMemberSnippets: config.suggest?.classMemberSnippets?.enabled ?? true,
263518
- includeCompletionsWithObjectLiteralMethodSnippets: config.suggest?.objectLiteralMethodSnippets?.enabled ?? true,
263519
- autoImportFileExcludePatterns: getAutoImportFileExcludePatternsPreference(preferencesConfig, currentDirectory),
263520
- autoImportSpecifierExcludeRegexes: preferencesConfig.autoImportSpecifierExcludeRegexes,
263521
- useLabelDetailsInCompletionEntries: true,
263522
- allowIncompleteCompletions: true,
263523
- displayPartsForJSDoc: true,
263524
- includeInlayParameterNameHints: getInlayParameterNameHintsPreference(config),
263525
- includeInlayParameterNameHintsWhenArgumentMatchesName: !(config.inlayHints?.parameterNames?.suppressWhenArgumentMatchesName ?? true),
263526
- includeInlayFunctionParameterTypeHints: config.inlayHints?.parameterTypes?.enabled ?? false,
263527
- includeInlayVariableTypeHints: config.inlayHints?.variableTypes?.enabled ?? false,
263528
- includeInlayVariableTypeHintsWhenTypeMatchesName: !(config.inlayHints?.variableTypes?.suppressWhenTypeMatchesName ?? true),
263529
- includeInlayPropertyDeclarationTypeHints: config.inlayHints?.propertyDeclarationTypes?.enabled ?? false,
263530
- includeInlayFunctionLikeReturnTypeHints: config.inlayHints?.functionLikeReturnTypes?.enabled ?? false,
263531
- includeInlayEnumMemberValueHints: config.inlayHints?.enumMemberValues?.enabled ?? false,
263532
- includeCompletionsForModuleExports: config.suggest?.autoImports ?? true,
263533
- includeCompletionsWithInsertText: true,
263534
- includePackageJsonAutoImports: preferencesConfig.includePackageJsonAutoImports ?? "auto"
263535
- };
263536
- }
263537
- function getQuoteStylePreference(config) {
263538
- switch (config.quoteStyle) {
263539
- case "single": return "single";
263540
- case "double": return "double";
263541
- default: return "auto";
263542
- }
263543
- }
263544
- function getAutoImportFileExcludePatternsPreference(config, workspacePath) {
263545
- if (workspacePath) return config.autoImportFileExcludePatterns?.map((p) => {
263546
- const slashNormalized = p.replace(/\\/g, "/");
263547
- const isRelative = /^\.\.?($|\/)/.test(slashNormalized);
263548
- return path.isAbsolute(p) ? p : p.startsWith("*") ? "/" + slashNormalized : isRelative ? path.join(workspacePath, p) : "/**/" + slashNormalized;
263549
- });
263550
- }
263551
- function getImportModuleSpecifierPreference(config) {
263552
- switch (config.importModuleSpecifier) {
263553
- case "project-relative": return "project-relative";
263554
- case "relative": return "relative";
263555
- case "non-relative": return "non-relative";
263556
- default: return;
263557
- }
263558
- }
263559
- function getImportModuleSpecifierEndingPreference(config) {
263560
- switch (config.importModuleSpecifierEnding) {
263561
- case "minimal": return "minimal";
263562
- case "index": return "index";
263563
- case "js": return "js";
263564
- default: return "minimal";
263565
- }
263566
- }
263567
- function getJsxAttributeCompletionStyle(config) {
263568
- switch (config.jsxAttributeCompletionStyle) {
263569
- case "braces": return "braces";
263570
- case "none": return "none";
263571
- default: return "auto";
263572
- }
263573
- }
263574
- function getInlayParameterNameHintsPreference(config) {
263575
- switch (config.inlayHints?.parameterNames?.enabled) {
263576
- case "none": return "none";
263577
- case "literals": return "literals";
263578
- case "all": return "all";
263579
- default: return;
263580
- }
263581
- }
263582
- }));
263583
- //#endregion
263584
263539
  //#region node_modules/volar-service-typescript/lib/utils/fixNames.js
263585
263540
  var require_fixNames = /* @__PURE__ */ __commonJSMin(((exports) => {
263586
263541
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -263600,955 +263555,6 @@ var require_fixNames = /* @__PURE__ */ __commonJSMin(((exports) => {
263600
263555
  exports.addMissingOverride = "fixOverrideModifier";
263601
263556
  }));
263602
263557
  //#endregion
263603
- //#region node_modules/volar-service-typescript/lib/protocol.const.js
263604
- var require_protocol_const = /* @__PURE__ */ __commonJSMin(((exports) => {
263605
- Object.defineProperty(exports, "__esModule", { value: true });
263606
- exports.EventName = exports.DisplayPartKind = exports.KindModifiers = exports.DiagnosticCategory = exports.Kind = void 0;
263607
- var Kind = class {};
263608
- exports.Kind = Kind;
263609
- Kind.alias = "alias";
263610
- Kind.callSignature = "call";
263611
- Kind.class = "class";
263612
- Kind.const = "const";
263613
- Kind.constructorImplementation = "constructor";
263614
- Kind.constructSignature = "construct";
263615
- Kind.directory = "directory";
263616
- Kind.enum = "enum";
263617
- Kind.enumMember = "enum member";
263618
- Kind.externalModuleName = "external module name";
263619
- Kind.function = "function";
263620
- Kind.indexSignature = "index";
263621
- Kind.interface = "interface";
263622
- Kind.keyword = "keyword";
263623
- Kind.let = "let";
263624
- Kind.localFunction = "local function";
263625
- Kind.localVariable = "local var";
263626
- Kind.method = "method";
263627
- Kind.memberGetAccessor = "getter";
263628
- Kind.memberSetAccessor = "setter";
263629
- Kind.memberVariable = "property";
263630
- Kind.module = "module";
263631
- Kind.primitiveType = "primitive type";
263632
- Kind.script = "script";
263633
- Kind.type = "type";
263634
- Kind.variable = "var";
263635
- Kind.warning = "warning";
263636
- Kind.string = "string";
263637
- Kind.parameter = "parameter";
263638
- Kind.typeParameter = "type parameter";
263639
- var DiagnosticCategory = class {};
263640
- exports.DiagnosticCategory = DiagnosticCategory;
263641
- DiagnosticCategory.error = "error";
263642
- DiagnosticCategory.warning = "warning";
263643
- DiagnosticCategory.suggestion = "suggestion";
263644
- var KindModifiers = class {};
263645
- exports.KindModifiers = KindModifiers;
263646
- KindModifiers.optional = "optional";
263647
- KindModifiers.deprecated = "deprecated";
263648
- KindModifiers.color = "color";
263649
- KindModifiers.dtsFile = ".d.ts";
263650
- KindModifiers.tsFile = ".ts";
263651
- KindModifiers.tsxFile = ".tsx";
263652
- KindModifiers.jsFile = ".js";
263653
- KindModifiers.jsxFile = ".jsx";
263654
- KindModifiers.jsonFile = ".json";
263655
- KindModifiers.fileExtensionKindModifiers = [
263656
- KindModifiers.dtsFile,
263657
- KindModifiers.tsFile,
263658
- KindModifiers.tsxFile,
263659
- KindModifiers.jsFile,
263660
- KindModifiers.jsxFile,
263661
- KindModifiers.jsonFile
263662
- ];
263663
- var DisplayPartKind = class {};
263664
- exports.DisplayPartKind = DisplayPartKind;
263665
- DisplayPartKind.functionName = "functionName";
263666
- DisplayPartKind.methodName = "methodName";
263667
- DisplayPartKind.parameterName = "parameterName";
263668
- DisplayPartKind.propertyName = "propertyName";
263669
- DisplayPartKind.punctuation = "punctuation";
263670
- DisplayPartKind.text = "text";
263671
- var EventName;
263672
- (function(EventName) {
263673
- EventName["syntaxDiag"] = "syntaxDiag";
263674
- EventName["semanticDiag"] = "semanticDiag";
263675
- EventName["suggestionDiag"] = "suggestionDiag";
263676
- EventName["configFileDiag"] = "configFileDiag";
263677
- EventName["telemetry"] = "telemetry";
263678
- EventName["projectLanguageServiceState"] = "projectLanguageServiceState";
263679
- EventName["projectsUpdatedInBackground"] = "projectsUpdatedInBackground";
263680
- EventName["beginInstallTypes"] = "beginInstallTypes";
263681
- EventName["endInstallTypes"] = "endInstallTypes";
263682
- EventName["typesInstallerInitializationFailed"] = "typesInstallerInitializationFailed";
263683
- EventName["surveyReady"] = "surveyReady";
263684
- EventName["projectLoadingStart"] = "projectLoadingStart";
263685
- EventName["projectLoadingFinish"] = "projectLoadingFinish";
263686
- })(EventName || (exports.EventName = EventName = {}));
263687
- }));
263688
- //#endregion
263689
- //#region node_modules/volar-service-typescript/lib/utils/modifiers.js
263690
- var require_modifiers = /* @__PURE__ */ __commonJSMin(((exports) => {
263691
- Object.defineProperty(exports, "__esModule", { value: true });
263692
- exports.parseKindModifier = parseKindModifier;
263693
- function parseKindModifier(kindModifiers) {
263694
- return new Set(kindModifiers.split(/,|\s+/g));
263695
- }
263696
- }));
263697
- //#endregion
263698
- //#region node_modules/volar-service-typescript/lib/utils/previewer.js
263699
- var require_previewer = /* @__PURE__ */ __commonJSMin(((exports) => {
263700
- Object.defineProperty(exports, "__esModule", { value: true });
263701
- exports.plainWithLinks = plainWithLinks;
263702
- exports.tagsMarkdownPreview = tagsMarkdownPreview;
263703
- exports.markdownDocumentation = markdownDocumentation;
263704
- exports.addMarkdownDocumentation = addMarkdownDocumentation;
263705
- function replaceLinks(text) {
263706
- return text.replace(/\{@(link|linkplain|linkcode) (https?:\/\/[^ |}]+?)(?:[| ]([^{}\n]+?))?\}/gi, (_, tag, link, text) => {
263707
- switch (tag) {
263708
- case "linkcode": return `[\`${text ? text.trim() : link}\`](${link})`;
263709
- default: return `[${text ? text.trim() : link}](${link})`;
263710
- }
263711
- });
263712
- }
263713
- function processInlineTags(text) {
263714
- return replaceLinks(text);
263715
- }
263716
- function getTagBodyText(tag, fileNameToUri, getTextDocument) {
263717
- if (!tag.text) return;
263718
- function makeCodeblock(text) {
263719
- if (text.match(/^\s*[~`]{3}/g)) return text;
263720
- return "```\n" + text + "\n```";
263721
- }
263722
- const text = convertLinkTags(tag.text, fileNameToUri, getTextDocument);
263723
- switch (tag.name) {
263724
- case "example":
263725
- const captionTagMatches = text.match(/<caption>(.*?)<\/caption>\s*(\r\n|\n)/);
263726
- if (captionTagMatches && captionTagMatches.index === 0) return captionTagMatches[1] + "\n\n" + makeCodeblock(text.slice(captionTagMatches[0].length));
263727
- else return makeCodeblock(text);
263728
- case "author":
263729
- const emailMatch = text.match(/(.+)\s<([-.\w]+@[-.\w]+)>/);
263730
- if (emailMatch === null) return text;
263731
- else return `${emailMatch[1]} ${emailMatch[2]}`;
263732
- case "default": return makeCodeblock(text);
263733
- }
263734
- return processInlineTags(text);
263735
- }
263736
- function getTagDocumentation(tag, fileNameToUri, getTextDocument) {
263737
- switch (tag.name) {
263738
- case "augments":
263739
- case "extends":
263740
- case "param":
263741
- case "template":
263742
- const body = convertLinkTags(tag.text, fileNameToUri, getTextDocument).split(/^(\S+)\s*-?\s*/);
263743
- if (body?.length === 3) {
263744
- const param = body[1];
263745
- const doc = body[2];
263746
- const label = `*@${tag.name}* \`${param}\``;
263747
- if (!doc) return label;
263748
- return label + (doc.match(/\r\n|\n/g) ? " \n" + processInlineTags(doc) : ` — ${processInlineTags(doc)}`);
263749
- }
263750
- }
263751
- const label = `*@${tag.name}*`;
263752
- const text = getTagBodyText(tag, fileNameToUri, getTextDocument);
263753
- if (!text) return label;
263754
- return label + (text.match(/\r\n|\n/g) ? " \n" + text : ` — ${text}`);
263755
- }
263756
- function plainWithLinks(parts, fileNameToUri, getTextDocument) {
263757
- return processInlineTags(convertLinkTags(parts, fileNameToUri, getTextDocument));
263758
- }
263759
- /**
263760
- * Convert `@link` inline tags to markdown links
263761
- */
263762
- function convertLinkTags(parts, fileNameToUri, getTextDocument) {
263763
- if (!parts) return "";
263764
- if (typeof parts === "string") return parts;
263765
- const out = [];
263766
- let currentLink;
263767
- for (const part of parts) switch (part.kind) {
263768
- case "link":
263769
- if (currentLink) {
263770
- const text = currentLink.text ?? currentLink.name;
263771
- let target = currentLink.target;
263772
- if (typeof currentLink.target === "object" && "fileName" in currentLink.target) {
263773
- const _target = currentLink.target;
263774
- const fileDoc = getTextDocument(fileNameToUri(_target.fileName));
263775
- if (fileDoc) {
263776
- const start = fileDoc.positionAt(_target.textSpan.start);
263777
- const end = fileDoc.positionAt(_target.textSpan.start + _target.textSpan.length);
263778
- target = {
263779
- file: _target.fileName,
263780
- start: {
263781
- line: start.line + 1,
263782
- offset: start.character + 1
263783
- },
263784
- end: {
263785
- line: end.line + 1,
263786
- offset: end.character + 1
263787
- }
263788
- };
263789
- } else target = {
263790
- file: _target.fileName,
263791
- start: {
263792
- line: 1,
263793
- offset: 1
263794
- },
263795
- end: {
263796
- line: 1,
263797
- offset: 1
263798
- }
263799
- };
263800
- }
263801
- if (target) {
263802
- const link = fileNameToUri(target.file) + `#L${target.start.line},${target.start.offset}`;
263803
- out.push(`[${text}](${link})`);
263804
- } else if (text) out.push(text);
263805
- currentLink = void 0;
263806
- } else currentLink = {};
263807
- break;
263808
- case "linkName":
263809
- if (currentLink) {
263810
- currentLink.name = part.text;
263811
- currentLink.target = part.target;
263812
- }
263813
- break;
263814
- case "linkText":
263815
- if (currentLink) currentLink.text = part.text;
263816
- break;
263817
- default:
263818
- out.push(part.text);
263819
- break;
263820
- }
263821
- return processInlineTags(out.join(""));
263822
- }
263823
- function tagsMarkdownPreview(tags, fileNameToUri, getTextDocument) {
263824
- return tags.map((tag) => getTagDocumentation(tag, fileNameToUri, getTextDocument)).join(" \n\n");
263825
- }
263826
- function markdownDocumentation(documentation, tags, fileNameToUri, getTextDocument) {
263827
- return addMarkdownDocumentation("", documentation, tags, fileNameToUri, getTextDocument);
263828
- }
263829
- function addMarkdownDocumentation(out, documentation, tags, fileNameToUri, getTextDocument) {
263830
- if (documentation) out += plainWithLinks(documentation, fileNameToUri, getTextDocument);
263831
- if (tags) {
263832
- const tagsPreview = tagsMarkdownPreview(tags, fileNameToUri, getTextDocument);
263833
- if (tagsPreview) out += "\n\n" + tagsPreview;
263834
- }
263835
- return out;
263836
- }
263837
- }));
263838
- //#endregion
263839
- //#region node_modules/volar-service-typescript/lib/utils/typeConverters.js
263840
- var require_typeConverters = /* @__PURE__ */ __commonJSMin(((exports) => {
263841
- Object.defineProperty(exports, "__esModule", { value: true });
263842
- exports.SymbolKind = void 0;
263843
- var PConst = require_protocol_const();
263844
- var SymbolKind;
263845
- (function(SymbolKind) {
263846
- function fromProtocolScriptElementKind(kind) {
263847
- switch (kind) {
263848
- case PConst.Kind.module: return 2;
263849
- case PConst.Kind.class: return 5;
263850
- case PConst.Kind.enum: return 10;
263851
- case PConst.Kind.enumMember: return 22;
263852
- case PConst.Kind.interface: return 11;
263853
- case PConst.Kind.indexSignature: return 6;
263854
- case PConst.Kind.callSignature: return 6;
263855
- case PConst.Kind.method: return 6;
263856
- case PConst.Kind.memberVariable: return 7;
263857
- case PConst.Kind.memberGetAccessor: return 7;
263858
- case PConst.Kind.memberSetAccessor: return 7;
263859
- case PConst.Kind.variable: return 13;
263860
- case PConst.Kind.let: return 13;
263861
- case PConst.Kind.const: return 13;
263862
- case PConst.Kind.localVariable: return 13;
263863
- case PConst.Kind.alias: return 13;
263864
- case PConst.Kind.function: return 12;
263865
- case PConst.Kind.localFunction: return 12;
263866
- case PConst.Kind.constructSignature: return 9;
263867
- case PConst.Kind.constructorImplementation: return 9;
263868
- case PConst.Kind.typeParameter: return 26;
263869
- case PConst.Kind.string: return 15;
263870
- default: return 13;
263871
- }
263872
- }
263873
- SymbolKind.fromProtocolScriptElementKind = fromProtocolScriptElementKind;
263874
- })(SymbolKind || (exports.SymbolKind = SymbolKind = {}));
263875
- }));
263876
- //#endregion
263877
- //#region node_modules/volar-service-typescript/lib/utils/lspConverters.js
263878
- var require_lspConverters = /* @__PURE__ */ __commonJSMin(((exports) => {
263879
- Object.defineProperty(exports, "__esModule", { value: true });
263880
- exports.convertDiagnostic = convertDiagnostic;
263881
- exports.applyCompletionEntryDetails = applyCompletionEntryDetails;
263882
- exports.convertCompletionInfo = convertCompletionInfo;
263883
- exports.getLineText = getLineText;
263884
- exports.convertNavigateToItem = convertNavigateToItem;
263885
- exports.convertInlayHint = convertInlayHint;
263886
- exports.convertHighlightSpan = convertHighlightSpan;
263887
- exports.convertSelectionRange = convertSelectionRange;
263888
- exports.convertFileTextChanges = convertFileTextChanges;
263889
- exports.convertRenameLocations = convertRenameLocations;
263890
- exports.convertQuickInfo = convertQuickInfo;
263891
- exports.convertNavTree = convertNavTree;
263892
- exports.convertOutliningSpan = convertOutliningSpan;
263893
- exports.convertOutliningSpanKind = convertOutliningSpanKind;
263894
- exports.convertTextChange = convertTextChange;
263895
- exports.convertCallHierarchyIncomingCall = convertCallHierarchyIncomingCall;
263896
- exports.convertCallHierarchyOutgoingCall = convertCallHierarchyOutgoingCall;
263897
- exports.convertCallHierarchyItem = convertCallHierarchyItem;
263898
- exports.convertDocumentSpanToLocation = convertDocumentSpanToLocation;
263899
- exports.convertDefinitionInfoAndBoundSpan = convertDefinitionInfoAndBoundSpan;
263900
- exports.convertDocumentSpantoLocationLink = convertDocumentSpantoLocationLink;
263901
- exports.convertTextSpan = convertTextSpan;
263902
- var path = require_path_browserify();
263903
- var semver = require_semver();
263904
- var PConst = require_protocol_const();
263905
- var modifiers_1 = require_modifiers();
263906
- var previewer = require_previewer();
263907
- var typeConverters = require_typeConverters();
263908
- function convertDiagnostic(diag, document, fileNameToUri, getTextDocument) {
263909
- if (diag.start === void 0) return;
263910
- if (diag.length === void 0) return;
263911
- const diagnostic = {
263912
- range: {
263913
- start: document.positionAt(diag.start),
263914
- end: document.positionAt(diag.start + diag.length)
263915
- },
263916
- severity: convertDiagnosticCategory(diag.category),
263917
- source: "ts",
263918
- code: diag.code,
263919
- message: getMessageText(diag)
263920
- };
263921
- if (diag.relatedInformation) diagnostic.relatedInformation = diag.relatedInformation.map((rErr) => convertDiagnosticRelatedInformation(rErr, fileNameToUri, getTextDocument)).filter((v) => !!v);
263922
- if (diag.reportsUnnecessary) {
263923
- if (diagnostic.tags === void 0) diagnostic.tags = [];
263924
- diagnostic.tags.push(1);
263925
- }
263926
- if (diag.reportsDeprecated) {
263927
- if (diagnostic.tags === void 0) diagnostic.tags = [];
263928
- diagnostic.tags.push(2);
263929
- }
263930
- return diagnostic;
263931
- }
263932
- function convertDiagnosticRelatedInformation(diag, fileNameToUri, getTextDocument) {
263933
- if (diag.start === void 0) return;
263934
- if (diag.length === void 0) return;
263935
- let document;
263936
- if (diag.file) document = getTextDocument(fileNameToUri(diag.file.fileName));
263937
- if (!document) return;
263938
- return {
263939
- location: {
263940
- uri: document.uri,
263941
- range: {
263942
- start: document.positionAt(diag.start),
263943
- end: document.positionAt(diag.start + diag.length)
263944
- }
263945
- },
263946
- message: getMessageText(diag)
263947
- };
263948
- }
263949
- function convertDiagnosticCategory(input) {
263950
- switch (input) {
263951
- case 0: return 2;
263952
- case 1: return 1;
263953
- case 2: return 4;
263954
- case 3: return 3;
263955
- }
263956
- return 1;
263957
- }
263958
- function getMessageText(diag) {
263959
- let messageText = "";
263960
- if (typeof diag.messageText === "string") messageText += diag.messageText;
263961
- else {
263962
- messageText += diag.messageText.messageText;
263963
- if (diag.messageText.next) for (const info of diag.messageText.next) messageText += "\n" + getNextMessageText(info, 1);
263964
- }
263965
- return messageText;
263966
- }
263967
- function getNextMessageText(diag, level = 0) {
263968
- let messageText = " ".repeat(level);
263969
- messageText += diag.messageText;
263970
- if (diag.next) for (const info of diag.next) messageText += "\n" + getNextMessageText(info, level + 1);
263971
- return messageText;
263972
- }
263973
- function applyCompletionEntryDetails(ts, item, data, document, fileNameToUri, getTextDocument) {
263974
- const { sourceDisplay } = data;
263975
- if (sourceDisplay) {
263976
- item.labelDetails ??= {};
263977
- item.labelDetails.description = ts.displayPartsToString(sourceDisplay);
263978
- }
263979
- const detailTexts = [];
263980
- if (data.codeActions) {
263981
- item.additionalTextEdits ??= [];
263982
- for (const action of data.codeActions) {
263983
- detailTexts.push(action.description);
263984
- for (const changes of action.changes) changes.textChanges.map((change) => convertTextSpan(change.span, document)).forEach((range, index) => {
263985
- item.additionalTextEdits?.push({
263986
- range,
263987
- newText: changes.textChanges[index].newText
263988
- });
263989
- });
263990
- }
263991
- }
263992
- if (data.displayParts) detailTexts.push(previewer.plainWithLinks(data.displayParts, fileNameToUri, getTextDocument));
263993
- if (detailTexts.length) item.detail = detailTexts.join("\n");
263994
- item.documentation = {
263995
- kind: "markdown",
263996
- value: previewer.markdownDocumentation(data.documentation, data.tags, fileNameToUri, getTextDocument)
263997
- };
263998
- if (data) handleKindModifiers(item, data);
263999
- }
264000
- function convertCompletionInfo(ts, completionContext, document, position, createData) {
264001
- const lt_320 = semver.lt(ts.version, "3.2.0");
264002
- const gte_300 = semver.gte(ts.version, "3.0.0");
264003
- const wordRange = completionContext.optionalReplacementSpan ? convertTextSpan(completionContext.optionalReplacementSpan, document) : void 0;
264004
- const line = getLineText(document, position.line);
264005
- const dotAccessorContext = getDotAccessorContext(document);
264006
- const entries = completionContext.entries.map((tsEntry) => ({
264007
- ...convertCompletionEntry(tsEntry, document),
264008
- data: createData(tsEntry)
264009
- }));
264010
- return {
264011
- isIncomplete: !!completionContext.isIncomplete,
264012
- items: entries
264013
- };
264014
- function convertCompletionEntry(tsEntry, document) {
264015
- const item = { label: tsEntry.name };
264016
- item.kind = convertCompletionItemKind(tsEntry.kind);
264017
- if (tsEntry.source && tsEntry.hasAction) item.sortText = "￿" + tsEntry.sortText;
264018
- else item.sortText = tsEntry.sortText;
264019
- const { sourceDisplay, isSnippet, labelDetails } = tsEntry;
264020
- if (sourceDisplay) {
264021
- item.labelDetails ??= {};
264022
- item.labelDetails.description = ts.displayPartsToString(sourceDisplay);
264023
- }
264024
- if (labelDetails) {
264025
- item.labelDetails ??= {};
264026
- Object.assign(item.labelDetails, labelDetails);
264027
- }
264028
- item.preselect = tsEntry.isRecommended;
264029
- let range = getRangeFromReplacementSpan(tsEntry, document);
264030
- item.commitCharacters = getCommitCharacters(tsEntry, {
264031
- isNewIdentifierLocation: completionContext.isNewIdentifierLocation,
264032
- isInValidCommitCharacterContext: isInValidCommitCharacterContext(document, position),
264033
- enableCallCompletions: true
264034
- });
264035
- item.insertText = tsEntry.insertText;
264036
- item.insertTextFormat = isSnippet ? 2 : 1;
264037
- item.filterText = getFilterText(tsEntry, wordRange, line, tsEntry.insertText);
264038
- if (completionContext?.isMemberCompletion && dotAccessorContext && !isSnippet) {
264039
- item.filterText = dotAccessorContext.text + (item.insertText || item.label);
264040
- if (!range) {
264041
- const replacementRange = wordRange;
264042
- if (replacementRange) range = {
264043
- inserting: dotAccessorContext.range,
264044
- replacing: rangeUnion(dotAccessorContext.range, replacementRange)
264045
- };
264046
- else range = dotAccessorContext.range;
264047
- item.insertText = item.filterText;
264048
- }
264049
- }
264050
- handleKindModifiers(item, tsEntry);
264051
- if (!range && wordRange) range = {
264052
- inserting: {
264053
- start: wordRange.start,
264054
- end: position
264055
- },
264056
- replacing: wordRange
264057
- };
264058
- if (range) if ("start" in range) item.textEdit = {
264059
- range,
264060
- newText: item.insertText || item.label
264061
- };
264062
- else item.textEdit = {
264063
- insert: range.inserting,
264064
- replace: range.replacing,
264065
- newText: item.insertText || item.label
264066
- };
264067
- return item;
264068
- }
264069
- function getDotAccessorContext(document) {
264070
- let dotAccessorContext;
264071
- if (gte_300) {
264072
- if (!completionContext) return;
264073
- if (completionContext.isMemberCompletion) {
264074
- const dotMatch = line.slice(0, position.character).match(/\??\.\s*$/) || void 0;
264075
- if (dotMatch) {
264076
- const range = {
264077
- start: {
264078
- line: position.line,
264079
- character: position.character - dotMatch[0].length
264080
- },
264081
- end: position
264082
- };
264083
- dotAccessorContext = {
264084
- range,
264085
- text: document.getText(range)
264086
- };
264087
- }
264088
- }
264089
- }
264090
- return dotAccessorContext;
264091
- }
264092
- function getRangeFromReplacementSpan(tsEntry, document) {
264093
- if (!tsEntry.replacementSpan) return;
264094
- let replaceRange = {
264095
- start: document.positionAt(tsEntry.replacementSpan.start),
264096
- end: document.positionAt(tsEntry.replacementSpan.start + tsEntry.replacementSpan.length)
264097
- };
264098
- if (replaceRange.start.line !== replaceRange.end.line) replaceRange = {
264099
- start: {
264100
- line: replaceRange.start.line,
264101
- character: replaceRange.start.character
264102
- },
264103
- end: {
264104
- line: replaceRange.start.line,
264105
- character: document.positionAt(document.offsetAt({
264106
- line: replaceRange.start.line + 1,
264107
- character: 0
264108
- }) - 1).character
264109
- }
264110
- };
264111
- return {
264112
- inserting: replaceRange,
264113
- replacing: replaceRange
264114
- };
264115
- }
264116
- function getFilterText(tsEntry, wordRange, line, insertText) {
264117
- if (tsEntry.name.startsWith("#")) {
264118
- const wordStart = wordRange ? line.charAt(wordRange.start.character) : void 0;
264119
- if (insertText) if (insertText.startsWith("this.#")) return wordStart === "#" ? insertText : insertText.replace(/^this\.#/, "");
264120
- else return insertText;
264121
- else return wordStart === "#" ? void 0 : tsEntry.name.replace(/^#/, "");
264122
- }
264123
- if (insertText?.startsWith("this.")) return;
264124
- else if (insertText?.startsWith("[")) return insertText.replace(/^\[['"](.+)[['"]\]$/, ".$1");
264125
- return insertText;
264126
- }
264127
- function getCommitCharacters(entry, context) {
264128
- if (entry.kind === PConst.Kind.warning) return;
264129
- if (context.isNewIdentifierLocation || !context.isInValidCommitCharacterContext) return;
264130
- const commitCharacters = [
264131
- ".",
264132
- ",",
264133
- ";"
264134
- ];
264135
- if (context.enableCallCompletions) commitCharacters.push("(");
264136
- return commitCharacters;
264137
- }
264138
- function isInValidCommitCharacterContext(document, position) {
264139
- if (lt_320) {
264140
- if (position.character > 1) return document.getText({
264141
- start: {
264142
- line: position.line,
264143
- character: 0
264144
- },
264145
- end: position
264146
- }).match(/(\s|^)\.$/gi) === null;
264147
- }
264148
- return true;
264149
- }
264150
- }
264151
- function convertCompletionItemKind(kind) {
264152
- switch (kind) {
264153
- case PConst.Kind.primitiveType:
264154
- case PConst.Kind.keyword: return 14;
264155
- case PConst.Kind.const:
264156
- case PConst.Kind.let:
264157
- case PConst.Kind.variable:
264158
- case PConst.Kind.localVariable:
264159
- case PConst.Kind.alias:
264160
- case PConst.Kind.parameter: return 6;
264161
- case PConst.Kind.memberVariable:
264162
- case PConst.Kind.memberGetAccessor:
264163
- case PConst.Kind.memberSetAccessor: return 5;
264164
- case PConst.Kind.function:
264165
- case PConst.Kind.localFunction: return 3;
264166
- case PConst.Kind.method:
264167
- case PConst.Kind.constructSignature:
264168
- case PConst.Kind.callSignature:
264169
- case PConst.Kind.indexSignature: return 2;
264170
- case PConst.Kind.enum: return 13;
264171
- case PConst.Kind.enumMember: return 20;
264172
- case PConst.Kind.module:
264173
- case PConst.Kind.externalModuleName: return 9;
264174
- case PConst.Kind.class:
264175
- case PConst.Kind.type: return 7;
264176
- case PConst.Kind.interface: return 8;
264177
- case PConst.Kind.warning: return 1;
264178
- case PConst.Kind.script: return 17;
264179
- case PConst.Kind.directory: return 19;
264180
- case PConst.Kind.string: return 21;
264181
- default: return 10;
264182
- }
264183
- }
264184
- function handleKindModifiers(item, tsEntry) {
264185
- if (tsEntry.kindModifiers) {
264186
- const kindModifiers = (0, modifiers_1.parseKindModifier)(tsEntry.kindModifiers);
264187
- if (kindModifiers.has(PConst.KindModifiers.optional)) {
264188
- if (!item.insertText) item.insertText = item.label;
264189
- if (!item.filterText) item.filterText = item.label;
264190
- item.label += "?";
264191
- }
264192
- if (kindModifiers.has(PConst.KindModifiers.deprecated)) item.tags = [1];
264193
- if (kindModifiers.has(PConst.KindModifiers.color)) item.kind = 16;
264194
- if (tsEntry.kind === PConst.Kind.script) {
264195
- for (const extModifier of PConst.KindModifiers.fileExtensionKindModifiers) if (kindModifiers.has(extModifier)) {
264196
- if (tsEntry.name.toLowerCase().endsWith(extModifier)) item.detail = tsEntry.name;
264197
- else item.detail = tsEntry.name + extModifier;
264198
- break;
264199
- }
264200
- }
264201
- }
264202
- }
264203
- function rangeUnion(a, b) {
264204
- return {
264205
- start: a.start.line < b.start.line || a.start.line === b.start.line && a.start.character < b.start.character ? a.start : b.start,
264206
- end: a.end.line > b.end.line || a.end.line === b.end.line && a.end.character > b.end.character ? a.end : b.end
264207
- };
264208
- }
264209
- function getLineText(document, line) {
264210
- const endOffset = document.offsetAt({
264211
- line: line + 1,
264212
- character: 0
264213
- });
264214
- const end = document.positionAt(endOffset);
264215
- return document.getText({
264216
- start: {
264217
- line,
264218
- character: 0
264219
- },
264220
- end: end.line === line ? end : document.positionAt(endOffset - 1)
264221
- });
264222
- }
264223
- function convertNavigateToItem(item, document) {
264224
- const info = {
264225
- name: getLabel(item),
264226
- kind: convertScriptElementKind(item.kind),
264227
- location: {
264228
- uri: document.uri,
264229
- range: convertTextSpan(item.textSpan, document)
264230
- }
264231
- };
264232
- if ((item.kindModifiers ? (0, modifiers_1.parseKindModifier)(item.kindModifiers) : void 0)?.has(PConst.KindModifiers.deprecated)) info.tags = [1];
264233
- return info;
264234
- }
264235
- function getLabel(item) {
264236
- const label = item.name;
264237
- if (item.kind === "method" || item.kind === "function") return label + "()";
264238
- return label;
264239
- }
264240
- function convertScriptElementKind(kind) {
264241
- switch (kind) {
264242
- case PConst.Kind.method: return 6;
264243
- case PConst.Kind.enum: return 10;
264244
- case PConst.Kind.enumMember: return 22;
264245
- case PConst.Kind.function: return 12;
264246
- case PConst.Kind.class: return 5;
264247
- case PConst.Kind.interface: return 11;
264248
- case PConst.Kind.type: return 5;
264249
- case PConst.Kind.memberVariable: return 8;
264250
- case PConst.Kind.memberGetAccessor: return 8;
264251
- case PConst.Kind.memberSetAccessor: return 8;
264252
- case PConst.Kind.variable: return 13;
264253
- default: return 13;
264254
- }
264255
- }
264256
- function convertInlayHint(hint, document) {
264257
- const result = {
264258
- position: document.positionAt(hint.position),
264259
- label: hint.text,
264260
- kind: hint.kind === "Type" ? 1 : hint.kind === "Parameter" ? 2 : void 0
264261
- };
264262
- result.paddingLeft = hint.whitespaceBefore;
264263
- result.paddingRight = hint.whitespaceAfter;
264264
- return result;
264265
- }
264266
- function convertHighlightSpan(span, document) {
264267
- return {
264268
- kind: span.kind === "writtenReference" ? 3 : 2,
264269
- range: convertTextSpan(span.textSpan, document)
264270
- };
264271
- }
264272
- function convertSelectionRange(range, document) {
264273
- return {
264274
- parent: range.parent ? convertSelectionRange(range.parent, document) : void 0,
264275
- range: convertTextSpan(range.textSpan, document)
264276
- };
264277
- }
264278
- function convertFileTextChanges(changes, fileNameToUri, getTextDocument) {
264279
- const workspaceEdit = {};
264280
- for (const change of changes) {
264281
- if (!workspaceEdit.documentChanges) workspaceEdit.documentChanges = [];
264282
- const uri = fileNameToUri(change.fileName);
264283
- if (change.isNewFile) {
264284
- workspaceEdit.documentChanges.push({
264285
- kind: "create",
264286
- uri: uri.toString()
264287
- });
264288
- workspaceEdit.documentChanges.push({
264289
- textDocument: {
264290
- uri: uri.toString(),
264291
- version: null
264292
- },
264293
- edits: change.textChanges.map((edit) => ({
264294
- newText: edit.newText,
264295
- range: {
264296
- start: {
264297
- line: 0,
264298
- character: edit.span.start
264299
- },
264300
- end: {
264301
- line: 0,
264302
- character: edit.span.start + edit.span.length
264303
- }
264304
- }
264305
- }))
264306
- });
264307
- } else {
264308
- const doc = getTextDocument(uri);
264309
- workspaceEdit.documentChanges.push({
264310
- textDocument: {
264311
- uri: uri.toString(),
264312
- version: null
264313
- },
264314
- edits: change.textChanges.map((edit) => convertTextChange(edit, doc))
264315
- });
264316
- }
264317
- }
264318
- return workspaceEdit;
264319
- }
264320
- function convertRenameLocations(newText, locations, fileNameToUri, getTextDocument) {
264321
- const workspaceEdit = {};
264322
- for (const location of locations) {
264323
- if (!workspaceEdit.changes) workspaceEdit.changes = {};
264324
- const uri = fileNameToUri(location.fileName);
264325
- const doc = getTextDocument(uri);
264326
- if (!workspaceEdit.changes[uri.toString()]) workspaceEdit.changes[uri.toString()] = [];
264327
- let _newText = newText;
264328
- if (location.prefixText) _newText = location.prefixText + _newText;
264329
- if (location.suffixText) _newText = _newText + location.suffixText;
264330
- workspaceEdit.changes[uri.toString()].push({
264331
- newText: _newText,
264332
- range: convertTextSpan(location.textSpan, doc)
264333
- });
264334
- }
264335
- return workspaceEdit;
264336
- }
264337
- function convertQuickInfo(ts, info, document, fileNameToUri, getTextDocument) {
264338
- const parts = [];
264339
- const displayString = ts.displayPartsToString(info.displayParts);
264340
- const documentation = previewer.markdownDocumentation(info.documentation ?? [], info.tags, fileNameToUri, getTextDocument);
264341
- if (displayString) parts.push([
264342
- "```typescript",
264343
- displayString,
264344
- "```"
264345
- ].join("\n"));
264346
- if (documentation) parts.push(documentation);
264347
- return {
264348
- contents: {
264349
- kind: "markdown",
264350
- value: parts.join("\n\n")
264351
- },
264352
- range: convertTextSpan(info.textSpan, document)
264353
- };
264354
- }
264355
- function convertNavTree(item, document) {
264356
- if (!shouldIncludeEntry(item)) return [];
264357
- let remain = item.childItems ?? [];
264358
- return item.spans.map((span) => {
264359
- const childItems = [];
264360
- remain = remain.filter((child) => {
264361
- const childStart = child.spans[0].start;
264362
- const childEnd = child.spans[child.spans.length - 1].start + child.spans[child.spans.length - 1].length;
264363
- if (childStart >= span.start && childEnd <= span.start + span.length) {
264364
- childItems.push(child);
264365
- return false;
264366
- }
264367
- return true;
264368
- });
264369
- const nameSpan = item.spans.length === 1 ? item.nameSpan ?? span : span;
264370
- const fullRange = {
264371
- start: Math.min(span.start, nameSpan.start),
264372
- end: Math.max(span.start + span.length, nameSpan.start + nameSpan.length)
264373
- };
264374
- const symbol = {
264375
- name: item.text,
264376
- kind: getSymbolKind(item.kind),
264377
- range: convertTextSpan({
264378
- start: fullRange.start,
264379
- length: fullRange.end - fullRange.start
264380
- }, document),
264381
- selectionRange: convertTextSpan(nameSpan, document),
264382
- children: childItems.map((item) => convertNavTree(item, document)).flat()
264383
- };
264384
- if ((0, modifiers_1.parseKindModifier)(item.kindModifiers).has(PConst.KindModifiers.deprecated)) {
264385
- symbol.deprecated = true;
264386
- symbol.tags ??= [];
264387
- symbol.tags.push(1);
264388
- }
264389
- return symbol;
264390
- });
264391
- }
264392
- var getSymbolKind = (kind) => {
264393
- switch (kind) {
264394
- case PConst.Kind.module: return 2;
264395
- case PConst.Kind.class: return 5;
264396
- case PConst.Kind.enum: return 10;
264397
- case PConst.Kind.interface: return 11;
264398
- case PConst.Kind.method: return 6;
264399
- case PConst.Kind.memberVariable: return 7;
264400
- case PConst.Kind.memberGetAccessor: return 7;
264401
- case PConst.Kind.memberSetAccessor: return 7;
264402
- case PConst.Kind.variable: return 13;
264403
- case PConst.Kind.const: return 13;
264404
- case PConst.Kind.localVariable: return 13;
264405
- case PConst.Kind.function: return 12;
264406
- case PConst.Kind.localFunction: return 12;
264407
- case PConst.Kind.constructSignature: return 9;
264408
- case PConst.Kind.constructorImplementation: return 9;
264409
- }
264410
- return 13;
264411
- };
264412
- function shouldIncludeEntry(item) {
264413
- if (item.kind === PConst.Kind.alias) return false;
264414
- return !!(item.text && item.text !== "<function>" && item.text !== "<class>");
264415
- }
264416
- function convertOutliningSpan(outliningSpan, document) {
264417
- const start = document.positionAt(outliningSpan.textSpan.start);
264418
- const end = adjustFoldingEnd(start, document.positionAt(outliningSpan.textSpan.start + outliningSpan.textSpan.length), document);
264419
- return {
264420
- startLine: start.line,
264421
- endLine: end.line,
264422
- startCharacter: start.character,
264423
- endCharacter: end.character,
264424
- kind: convertOutliningSpanKind(outliningSpan.kind)
264425
- };
264426
- }
264427
- function convertOutliningSpanKind(kind) {
264428
- switch (kind) {
264429
- case "comment": return "comment";
264430
- case "region": return "region";
264431
- case "imports": return "imports";
264432
- default: return;
264433
- }
264434
- }
264435
- var foldEndPairCharacters = [
264436
- "}",
264437
- "]",
264438
- ")",
264439
- "`"
264440
- ];
264441
- function adjustFoldingEnd(start, end, document) {
264442
- if (end.character > 0) {
264443
- const foldEndCharacter = document.getText({
264444
- start: {
264445
- line: end.line,
264446
- character: end.character - 1
264447
- },
264448
- end
264449
- });
264450
- if (foldEndPairCharacters.includes(foldEndCharacter)) {
264451
- const endOffset = Math.max(document.offsetAt({
264452
- line: end.line,
264453
- character: 0
264454
- }) - 1, document.offsetAt(start));
264455
- return document.positionAt(endOffset);
264456
- }
264457
- }
264458
- return end;
264459
- }
264460
- function convertTextChange(edit, document) {
264461
- return {
264462
- range: convertTextSpan(edit.span, document),
264463
- newText: edit.newText
264464
- };
264465
- }
264466
- function convertCallHierarchyIncomingCall(item, ctx) {
264467
- const uri = ctx.fileNameToUri(item.from.file);
264468
- const document = ctx.getTextDocument(uri);
264469
- return {
264470
- from: convertCallHierarchyItem(item.from, ctx),
264471
- fromRanges: item.fromSpans.map((span) => convertTextSpan(span, document)).filter((span) => !!span)
264472
- };
264473
- }
264474
- function convertCallHierarchyOutgoingCall(item, fromDocument, ctx) {
264475
- return {
264476
- to: convertCallHierarchyItem(item.to, ctx),
264477
- fromRanges: item.fromSpans.map((span) => convertTextSpan(span, fromDocument)).filter((span) => !!span)
264478
- };
264479
- }
264480
- function convertCallHierarchyItem(item, ctx) {
264481
- const rootPath = ctx.languageService.getProgram()?.getCompilerOptions().rootDir ?? "";
264482
- const uri = ctx.fileNameToUri(item.file);
264483
- const document = ctx.getTextDocument(uri);
264484
- const useFileName = isSourceFileItem(item);
264485
- const name = useFileName ? path.basename(item.file) : item.name;
264486
- const detail = useFileName ? path.relative(rootPath, path.dirname(item.file)) : item.containerName ?? "";
264487
- const result = {
264488
- kind: typeConverters.SymbolKind.fromProtocolScriptElementKind(item.kind),
264489
- name,
264490
- detail,
264491
- uri: uri.toString(),
264492
- range: convertTextSpan(item.span, document),
264493
- selectionRange: convertTextSpan(item.selectionSpan, document)
264494
- };
264495
- if ((item.kindModifiers ? (0, modifiers_1.parseKindModifier)(item.kindModifiers) : void 0)?.has(PConst.KindModifiers.deprecated)) result.tags = [1];
264496
- return result;
264497
- }
264498
- function isSourceFileItem(item) {
264499
- return item.kind === PConst.Kind.script || item.kind === PConst.Kind.module && item.selectionSpan.start === 0;
264500
- }
264501
- function convertDocumentSpanToLocation(documentSpan, ctx) {
264502
- const uri = ctx.fileNameToUri(documentSpan.fileName);
264503
- const document = ctx.getTextDocument(uri);
264504
- const range = convertTextSpan(documentSpan.textSpan, document);
264505
- return {
264506
- uri: uri.toString(),
264507
- range
264508
- };
264509
- }
264510
- function convertDefinitionInfoAndBoundSpan(info, document, ctx) {
264511
- if (!info.definitions) return [];
264512
- const originSelectionRange = convertTextSpan(info.textSpan, document);
264513
- return info.definitions.map((entry) => {
264514
- const link = convertDocumentSpantoLocationLink(entry, ctx);
264515
- if (link) {
264516
- link.originSelectionRange ??= originSelectionRange;
264517
- return link;
264518
- }
264519
- }).filter((entry) => !!entry);
264520
- }
264521
- function convertDocumentSpantoLocationLink(documentSpan, ctx) {
264522
- const targetUri = ctx.fileNameToUri(documentSpan.fileName);
264523
- const document = ctx.getTextDocument(targetUri);
264524
- const targetSelectionRange = convertTextSpan(documentSpan.textSpan, document);
264525
- const targetRange = documentSpan.contextSpan ? convertTextSpan(documentSpan.contextSpan, document) : targetSelectionRange;
264526
- const originSelectionRange = documentSpan.originalTextSpan ? convertTextSpan(documentSpan.originalTextSpan, document) : void 0;
264527
- return {
264528
- targetUri: targetUri.toString(),
264529
- targetRange,
264530
- targetSelectionRange,
264531
- originSelectionRange
264532
- };
264533
- }
264534
- function convertTextSpan(textSpan, document) {
264535
- if (!document) return {
264536
- start: {
264537
- line: 0,
264538
- character: 0
264539
- },
264540
- end: {
264541
- line: 0,
264542
- character: 0
264543
- }
264544
- };
264545
- return {
264546
- start: document.positionAt(textSpan.start),
264547
- end: document.positionAt(textSpan.start + textSpan.length)
264548
- };
264549
- }
264550
- }));
264551
- //#endregion
264552
263558
  //#region node_modules/volar-service-typescript/lib/semanticFeatures/codeActionResolve.js
264553
263559
  var require_codeActionResolve = /* @__PURE__ */ __commonJSMin(((exports) => {
264554
263560
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -264815,128 +263821,6 @@ var require_codeAction = /* @__PURE__ */ __commonJSMin(((exports) => {
264815
263821
  }
264816
263822
  }));
264817
263823
  //#endregion
264818
- //#region node_modules/volar-service-typescript/lib/semanticFeatures/semanticTokens.js
264819
- var require_semanticTokens = /* @__PURE__ */ __commonJSMin(((exports) => {
264820
- Object.defineProperty(exports, "__esModule", { value: true });
264821
- exports.register = register;
264822
- exports.convertClassificationsToSemanticTokens = convertClassificationsToSemanticTokens;
264823
- var shared_1 = require_shared();
264824
- function register(ts, ctx) {
264825
- return (uri, document, range, legend) => {
264826
- const fileName = ctx.uriToFileName(uri);
264827
- const start = range ? document.offsetAt(range.start) : 0;
264828
- const length = range ? document.offsetAt(range.end) - start : document.getText().length;
264829
- if (ctx.project.typescript?.languageServiceHost.getCancellationToken?.().isCancellationRequested()) return;
264830
- const response = (0, shared_1.safeCall)(() => ctx.languageService.getEncodedSemanticClassifications(fileName, {
264831
- start,
264832
- length
264833
- }, ts.SemanticClassificationFormat.TwentyTwenty));
264834
- if (!response) return;
264835
- return convertClassificationsToSemanticTokens(document, {
264836
- start,
264837
- length
264838
- }, legend, response);
264839
- };
264840
- }
264841
- function convertClassificationsToSemanticTokens(document, { start, length }, legend, response) {
264842
- let tokenModifiersTable = [];
264843
- tokenModifiersTable[2] = 1 << legend.tokenModifiers.indexOf("async");
264844
- tokenModifiersTable[0] = 1 << legend.tokenModifiers.indexOf("declaration");
264845
- tokenModifiersTable[3] = 1 << legend.tokenModifiers.indexOf("readonly");
264846
- tokenModifiersTable[1] = 1 << legend.tokenModifiers.indexOf("static");
264847
- tokenModifiersTable[5] = 1 << legend.tokenModifiers.indexOf("local");
264848
- tokenModifiersTable[4] = 1 << legend.tokenModifiers.indexOf("defaultLibrary");
264849
- tokenModifiersTable = tokenModifiersTable.map((mod) => Math.max(mod, 0));
264850
- const end = start + length;
264851
- const tokenSpan = response.spans;
264852
- const tokens = [];
264853
- let i = 0;
264854
- while (i < tokenSpan.length) {
264855
- const offset = tokenSpan[i++];
264856
- if (offset >= end) break;
264857
- const length = tokenSpan[i++];
264858
- const tsClassification = tokenSpan[i++];
264859
- const tokenType = getTokenTypeFromClassification(tsClassification);
264860
- if (tokenType === void 0) continue;
264861
- const tokenModifiers = getTokenModifierFromClassification(tsClassification);
264862
- const startPos = document.positionAt(offset);
264863
- const endPos = document.positionAt(offset + length);
264864
- const serverToken = tsTokenTypeToServerTokenType(tokenType);
264865
- if (serverToken === void 0) continue;
264866
- const serverTokenModifiers = tsTokenModifierToServerTokenModifier(tokenModifiers);
264867
- for (let line = startPos.line; line <= endPos.line; line++) {
264868
- const startCharacter = line === startPos.line ? startPos.character : 0;
264869
- const endCharacter = line === endPos.line ? endPos.character : docLineLength(document, line);
264870
- tokens.push([
264871
- line,
264872
- startCharacter,
264873
- endCharacter - startCharacter,
264874
- serverToken,
264875
- serverTokenModifiers
264876
- ]);
264877
- }
264878
- }
264879
- return tokens;
264880
- function tsTokenTypeToServerTokenType(tokenType) {
264881
- return legend.tokenTypes.indexOf(tokenTypes[tokenType]);
264882
- }
264883
- function tsTokenModifierToServerTokenModifier(input) {
264884
- let m = 0;
264885
- let i = 0;
264886
- while (input) {
264887
- if (input & 1) m |= tokenModifiersTable[i];
264888
- input = input >> 1;
264889
- i++;
264890
- }
264891
- return m;
264892
- }
264893
- }
264894
- function docLineLength(document, line) {
264895
- const currentLineOffset = document.offsetAt({
264896
- line,
264897
- character: 0
264898
- });
264899
- return document.offsetAt({
264900
- line: line + 1,
264901
- character: 0
264902
- }) - currentLineOffset;
264903
- }
264904
- function getTokenTypeFromClassification(tsClassification) {
264905
- if (tsClassification > 255) return (tsClassification >> 8) - 1;
264906
- }
264907
- function getTokenModifierFromClassification(tsClassification) {
264908
- return tsClassification & 255;
264909
- }
264910
- var tokenTypes = [];
264911
- tokenTypes[0] = "class";
264912
- tokenTypes[1] = "enum";
264913
- tokenTypes[2] = "interface";
264914
- tokenTypes[3] = "namespace";
264915
- tokenTypes[4] = "typeParameter";
264916
- tokenTypes[5] = "type";
264917
- tokenTypes[6] = "parameter";
264918
- tokenTypes[7] = "variable";
264919
- tokenTypes[8] = "enumMember";
264920
- tokenTypes[9] = "property";
264921
- tokenTypes[10] = "function";
264922
- tokenTypes[11] = "method";
264923
- var tokenModifiers = [];
264924
- tokenModifiers[2] = "async";
264925
- tokenModifiers[0] = "declaration";
264926
- tokenModifiers[3] = "readonly";
264927
- tokenModifiers[1] = "static";
264928
- tokenModifiers[5] = "local";
264929
- tokenModifiers[4] = "defaultLibrary";
264930
- var tokenTypeMap = [];
264931
- tokenTypeMap[11] = 0;
264932
- tokenTypeMap[12] = 1;
264933
- tokenTypeMap[13] = 2;
264934
- tokenTypeMap[14] = 3;
264935
- tokenTypeMap[15] = 4;
264936
- tokenTypeMap[16] = 5;
264937
- tokenTypeMap[17] = 6;
264938
- }));
264939
- //#endregion
264940
263824
  //#region node_modules/volar-service-typescript/lib/utils/snippetForFunctionCall.js
264941
263825
  var require_snippetForFunctionCall = /* @__PURE__ */ __commonJSMin(((exports) => {
264942
263826
  Object.defineProperty(exports, "__esModule", { value: true });