@vue/compiler-sfc 3.5.42 → 3.5.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-sfc v3.5.42
2
+ * @vue/compiler-sfc v3.5.44
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -160,10 +160,10 @@ function normalizeStyle(value) {
160
160
  }
161
161
  const listDelimiterRE = /;(?![^(]*\))/g;
162
162
  const propertyDelimiterRE = /:([^]+)/;
163
- const styleCommentRE = /\/\*[^]*?\*\//g;
163
+ const styleCommentRE = /"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;
164
164
  function parseStringStyle(cssText) {
165
165
  const ret = {};
166
- cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => {
166
+ cssText.replace(styleCommentRE, (match) => match.startsWith("/*") ? "" : match).split(listDelimiterRE).forEach((item) => {
167
167
  if (item) {
168
168
  const tmp = item.split(propertyDelimiterRE);
169
169
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -214,7 +214,7 @@ const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
214
214
  const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
215
215
  const isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);
216
216
 
217
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
217
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
218
218
  const isBooleanAttr = /* @__PURE__ */ makeMap(
219
219
  specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
220
220
  );
@@ -3347,11 +3347,11 @@ const defaultDelimitersClose = new Uint8Array([125, 125]);
3347
3347
  function isTagStartChar(c) {
3348
3348
  return c >= 97 && c <= 122 || c >= 65 && c <= 90;
3349
3349
  }
3350
- function isWhitespace(c) {
3350
+ function isWhitespace$1(c) {
3351
3351
  return c === 32 || c === 10 || c === 9 || c === 12 || c === 13;
3352
3352
  }
3353
3353
  function isEndOfTagSection(c) {
3354
- return c === 47 || c === 62 || isWhitespace(c);
3354
+ return c === 47 || c === 62 || isWhitespace$1(c);
3355
3355
  }
3356
3356
  function toCharCodes(str) {
3357
3357
  const ret = new Uint8Array(str.length);
@@ -3562,7 +3562,7 @@ class Tokenizer {
3562
3562
  /** Look for an end tag. For <title> and <textarea>, also decode entities. */
3563
3563
  stateInRCDATA(c) {
3564
3564
  if (this.sequenceIndex === this.currentSequence.length) {
3565
- if (c === 62 || isWhitespace(c)) {
3565
+ if (c === 62 || isWhitespace$1(c)) {
3566
3566
  const endOfText = this.index - this.currentSequence.length;
3567
3567
  if (this.sectionStart < endOfText) {
3568
3568
  const actualIndex = this.index;
@@ -3715,7 +3715,7 @@ class Tokenizer {
3715
3715
  this.stateBeforeAttrName(c);
3716
3716
  }
3717
3717
  stateBeforeClosingTagName(c) {
3718
- if (isWhitespace(c)) ; else if (c === 62) {
3718
+ if (isWhitespace$1(c)) ; else if (c === 62) {
3719
3719
  {
3720
3720
  this.cbs.onerr(14, this.index);
3721
3721
  }
@@ -3727,7 +3727,7 @@ class Tokenizer {
3727
3727
  }
3728
3728
  }
3729
3729
  stateInClosingTagName(c) {
3730
- if (c === 62 || isWhitespace(c)) {
3730
+ if (c === 62 || isWhitespace$1(c)) {
3731
3731
  this.cbs.onclosetag(this.sectionStart, this.index);
3732
3732
  this.sectionStart = -1;
3733
3733
  this.state = 10;
@@ -3758,7 +3758,7 @@ class Tokenizer {
3758
3758
  this.cbs.onopentagend(this.index);
3759
3759
  this.state = 5;
3760
3760
  this.sectionStart = this.index;
3761
- } else if (!isWhitespace(c)) {
3761
+ } else if (!isWhitespace$1(c)) {
3762
3762
  if (c === 61) {
3763
3763
  this.cbs.onerr(
3764
3764
  19,
@@ -3787,7 +3787,7 @@ class Tokenizer {
3787
3787
  this.state = 1;
3788
3788
  this.sectionStart = this.index + 1;
3789
3789
  this.inRCDATA = false;
3790
- } else if (!isWhitespace(c)) {
3790
+ } else if (!isWhitespace$1(c)) {
3791
3791
  this.state = 11;
3792
3792
  this.stateBeforeAttrName(c);
3793
3793
  }
@@ -3866,7 +3866,7 @@ class Tokenizer {
3866
3866
  this.sectionStart = -1;
3867
3867
  this.state = 11;
3868
3868
  this.stateBeforeAttrName(c);
3869
- } else if (!isWhitespace(c)) {
3869
+ } else if (!isWhitespace$1(c)) {
3870
3870
  this.cbs.onattribend(0, this.sectionStart);
3871
3871
  this.handleAttrStart(c);
3872
3872
  }
@@ -3878,7 +3878,7 @@ class Tokenizer {
3878
3878
  } else if (c === 39) {
3879
3879
  this.state = 20;
3880
3880
  this.sectionStart = this.index + 1;
3881
- } else if (!isWhitespace(c)) {
3881
+ } else if (!isWhitespace$1(c)) {
3882
3882
  this.sectionStart = this.index;
3883
3883
  this.state = 21;
3884
3884
  this.stateInAttrValueNoQuotes(c);
@@ -3904,7 +3904,7 @@ class Tokenizer {
3904
3904
  this.handleInAttrValue(c, 39);
3905
3905
  }
3906
3906
  stateInAttrValueNoQuotes(c) {
3907
- if (isWhitespace(c) || c === 62) {
3907
+ if (isWhitespace$1(c) || c === 62) {
3908
3908
  this.cbs.onattribdata(this.sectionStart, this.index);
3909
3909
  this.sectionStart = -1;
3910
3910
  this.cbs.onattribend(1, this.index);
@@ -4474,7 +4474,8 @@ const errorMessages$1 = {
4474
4474
  [42]: `v-model value must be a valid JavaScript member expression.`,
4475
4475
  [43]: `v-model cannot be used on v-for or v-slot scope variables because they are not writable.`,
4476
4476
  [44]: `v-model cannot be used on a prop, because local prop bindings are not writable.
4477
- Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
4477
+ Use a v-bind binding combined with a v-on listener that emits update:x event instead.
4478
+ For props declared with defineModel(), assign the returned ref to a variable and use v-model on that variable.`,
4478
4479
  [45]: `v-model cannot be used on a const binding because it is not writable.`,
4479
4480
  [46]: `Error parsing JavaScript expression: `,
4480
4481
  [47]: `<KeepAlive> expects exactly one child component.`,
@@ -7578,13 +7579,15 @@ function requireLib () {
7578
7579
  const arrows = [];
7579
7580
  while (stack.length !== 0) {
7580
7581
  const node = stack.pop();
7581
- if (node.type === "ArrowFunctionExpression" && node.body.type !== "BlockStatement") {
7582
+ if (node.type === "ArrowFunctionExpression") {
7582
7583
  if (node.typeParameters || !node.returnType) {
7583
7584
  this.finishArrowValidation(node);
7584
7585
  } else {
7585
7586
  arrows.push(node);
7586
7587
  }
7587
- stack.push(node.body);
7588
+ if (node.body.type !== "BlockStatement") {
7589
+ stack.push(node.body);
7590
+ }
7588
7591
  } else if (node.type === "ConditionalExpression") {
7589
7592
  stack.push(node.consequent);
7590
7593
  stack.push(node.alternate);
@@ -14754,8 +14757,11 @@ function requireLib () {
14754
14757
  }
14755
14758
  }
14756
14759
  fillOptionalPropertiesForTSESLint(node) {
14757
- var _node$directive, _node$decorators, _node$optional, _node$typeAnnotation, _node$accessibility, _node$decorators2, _node$override, _node$readonly, _node$static, _node$declare, _node$returnType, _node$typeParameters, _node$optional2, _node$optional3, _node$accessibility2, _node$readonly2, _node$static2, _node$declare2, _node$definite, _node$readonly3, _node$typeAnnotation2, _node$accessibility3, _node$decorators3, _node$override2, _node$optional4, _node$id, _node$abstract, _node$declare3, _node$decorators4, _node$implements, _node$superTypeArgume, _node$typeParameters2, _node$declare4, _node$definite2, _node$const, _node$declare5, _node$computed, _node$qualifier, _node$options, _node$declare6, _node$extends, _node$optional5, _node$readonly4, _node$declare7, _node$global, _node$const2, _node$in, _node$out;
14760
+ var _node$phase, _node$directive, _node$decorators, _node$optional, _node$typeAnnotation, _node$accessibility, _node$decorators2, _node$override, _node$readonly, _node$static, _node$declare, _node$returnType, _node$typeParameters, _node$optional2, _node$optional3, _node$accessibility2, _node$readonly2, _node$static2, _node$declare2, _node$definite, _node$readonly3, _node$typeAnnotation2, _node$accessibility3, _node$decorators3, _node$override2, _node$optional4, _node$id, _node$abstract, _node$declare3, _node$decorators4, _node$implements, _node$superTypeArgume, _node$typeParameters2, _node$declare4, _node$definite2, _node$const, _node$declare5, _node$computed, _node$qualifier, _node$options, _node$declare6, _node$extends, _node$optional5, _node$readonly4, _node$declare7, _node$global, _node$const2, _node$in, _node$out;
14758
14761
  switch (node.type) {
14762
+ case "ImportDeclaration":
14763
+ (_node$phase = node.phase) != null ? _node$phase : node.phase = null;
14764
+ return;
14759
14765
  case "ExpressionStatement":
14760
14766
  (_node$directive = node.directive) != null ? _node$directive : node.directive = undefined;
14761
14767
  return;
@@ -20089,7 +20095,7 @@ function getMemoedVNodeCall(node) {
20089
20095
  const forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/;
20090
20096
  function isAllWhitespace(str) {
20091
20097
  for (let i = 0; i < str.length; i++) {
20092
- if (!isWhitespace(str.charCodeAt(i))) {
20098
+ if (!isWhitespace$1(str.charCodeAt(i))) {
20093
20099
  return false;
20094
20100
  }
20095
20101
  }
@@ -20142,10 +20148,10 @@ const tokenizer = new Tokenizer(stack, {
20142
20148
  }
20143
20149
  let innerStart = start + tokenizer.delimiterOpen.length;
20144
20150
  let innerEnd = end - tokenizer.delimiterClose.length;
20145
- while (isWhitespace(currentInput.charCodeAt(innerStart))) {
20151
+ while (isWhitespace$1(currentInput.charCodeAt(innerStart))) {
20146
20152
  innerStart++;
20147
20153
  }
20148
- while (isWhitespace(currentInput.charCodeAt(innerEnd - 1))) {
20154
+ while (isWhitespace$1(currentInput.charCodeAt(innerEnd - 1))) {
20149
20155
  innerEnd--;
20150
20156
  }
20151
20157
  let exp = getSlice(innerStart, innerEnd);
@@ -20650,7 +20656,7 @@ function condense(str) {
20650
20656
  let ret = "";
20651
20657
  let prevCharIsWhitespace = false;
20652
20658
  for (let i = 0; i < str.length; i++) {
20653
- if (isWhitespace(str.charCodeAt(i))) {
20659
+ if (isWhitespace$1(str.charCodeAt(i))) {
20654
20660
  if (!prevCharIsWhitespace) {
20655
20661
  ret += " ";
20656
20662
  prevCharIsWhitespace = true;
@@ -22808,10 +22814,12 @@ function requireSourceMapGenerator$1 () {
22808
22814
 
22809
22815
  if (mapping.generatedLine !== previousGeneratedLine) {
22810
22816
  previousGeneratedColumn = 0;
22811
- while (mapping.generatedLine !== previousGeneratedLine) {
22812
- next += ';';
22813
- previousGeneratedLine++;
22814
- }
22817
+ // One ';' per skipped line. Build large gaps with a single flat
22818
+ // string: appending ';' one by one creates a rope node per line, which
22819
+ // can exhaust the heap for a big gap (CVE-2026-93749).
22820
+ var lineDelta = mapping.generatedLine - previousGeneratedLine;
22821
+ next += lineDelta === 1 ? ';' : ';'.repeat(lineDelta);
22822
+ previousGeneratedLine = mapping.generatedLine;
22815
22823
  }
22816
22824
  else {
22817
22825
  if (i > 0) {
@@ -23153,6 +23161,15 @@ function requireQuickSort$1 () {
23153
23161
  return templateFn(comparator);
23154
23162
  }
23155
23163
 
23164
+ let isEvalAllowed = (function () {
23165
+ try {
23166
+ new Function('return 0')();
23167
+ return true;
23168
+ } catch {
23169
+ return false;
23170
+ }
23171
+ })();
23172
+
23156
23173
  /**
23157
23174
  * Sort the given array in-place with the given comparator function.
23158
23175
  *
@@ -23164,7 +23181,7 @@ function requireQuickSort$1 () {
23164
23181
 
23165
23182
  let sortCache = new WeakMap();
23166
23183
  quickSort$1.quickSort = function (ary, comparator, start = 0) {
23167
- let doQuickSort = sortCache.get(comparator);
23184
+ let doQuickSort = isEvalAllowed ? sortCache.get(comparator) : SortTemplate();
23168
23185
  if (doQuickSort === void 0) {
23169
23186
  doQuickSort = cloneSort(comparator);
23170
23187
  sortCache.set(comparator, doQuickSort);
@@ -23193,6 +23210,14 @@ function requireSourceMapConsumer$1 () {
23193
23210
  var base64VLQ = /*@__PURE__*/ requireBase64Vlq$1();
23194
23211
  var quickSort = /*@__PURE__*/ requireQuickSort$1().quickSort;
23195
23212
 
23213
+ // Upper bound for a section's `offset.line` in an indexed source map. A flat
23214
+ // map spends one ';' per generated line, so a tiny indexed map with a huge
23215
+ // offset.line turns into a huge amount of work and memory once its mappings
23216
+ // are copied into a SourceMapGenerator (CVE-2026-93749). Ten million lines is
23217
+ // far beyond any real generated file. Columns are VLQ-encoded as deltas and
23218
+ // don't amplify, so they only need to be valid integers.
23219
+ var MAX_SECTION_OFFSET_LINE = 1e7;
23220
+
23196
23221
  function SourceMapConsumer(aSourceMap, aSourceMapURL) {
23197
23222
  var sourceMap = aSourceMap;
23198
23223
  if (typeof aSourceMap === 'string') {
@@ -24116,6 +24141,7 @@ function requireSourceMapConsumer$1 () {
24116
24141
  line: -1,
24117
24142
  column: 0
24118
24143
  };
24144
+ var maxOffsetLine = 0;
24119
24145
  this._sections = sections.map(function (s) {
24120
24146
  if (s.url) {
24121
24147
  // The url field will require support for asynchronicity.
@@ -24126,12 +24152,32 @@ function requireSourceMapConsumer$1 () {
24126
24152
  var offsetLine = util.getArg(offset, 'line');
24127
24153
  var offsetColumn = util.getArg(offset, 'column');
24128
24154
 
24155
+ if (!isValidOffset(offsetLine) || !isValidOffset(offsetColumn)) {
24156
+ throw new Error('Section offset line and column must be non-negative integers.');
24157
+ }
24158
+ if (offsetLine > MAX_SECTION_OFFSET_LINE) {
24159
+ throw new Error('Section offset line must not exceed ' + MAX_SECTION_OFFSET_LINE + '.');
24160
+ }
24161
+
24129
24162
  if (offsetLine < lastOffset.line ||
24130
24163
  (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
24131
24164
  throw new Error('Section offsets must be ordered and non-overlapping.');
24132
24165
  }
24133
24166
  lastOffset = offset;
24134
24167
 
24168
+ var consumer = new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL);
24169
+
24170
+ // Offsets of a nested indexed map add up with this one, so apply the
24171
+ // bound to the total.
24172
+ var totalOffsetLine = offsetLine + (consumer._maxOffsetLine || 0);
24173
+ if (totalOffsetLine > MAX_SECTION_OFFSET_LINE) {
24174
+ throw new Error('Section offset line must not exceed ' + MAX_SECTION_OFFSET_LINE +
24175
+ ', including offsets of nested sections.');
24176
+ }
24177
+ if (totalOffsetLine > maxOffsetLine) {
24178
+ maxOffsetLine = totalOffsetLine;
24179
+ }
24180
+
24135
24181
  return {
24136
24182
  generatedOffset: {
24137
24183
  // The offset fields are 0-based, but we use 1-based indices when
@@ -24139,9 +24185,24 @@ function requireSourceMapConsumer$1 () {
24139
24185
  generatedLine: offsetLine + 1,
24140
24186
  generatedColumn: offsetColumn + 1
24141
24187
  },
24142
- consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
24188
+ consumer: consumer
24143
24189
  }
24144
24190
  });
24191
+
24192
+ // The largest offset.line of any section, including nested sections.
24193
+ this._maxOffsetLine = maxOffsetLine;
24194
+ }
24195
+
24196
+ /**
24197
+ * Section offsets come from untrusted input and are used as line/column
24198
+ * numbers, so only accept non-negative safe integers (rejects NaN, Infinity,
24199
+ * strings, fractions, etc).
24200
+ */
24201
+ function isValidOffset(aValue) {
24202
+ return typeof aValue === 'number' &&
24203
+ aValue >= 0 &&
24204
+ aValue <= 9007199254740991 && // Number.MAX_SAFE_INTEGER
24205
+ Math.floor(aValue) === aValue;
24145
24206
  }
24146
24207
 
24147
24208
  IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
@@ -24159,8 +24220,12 @@ function requireSourceMapConsumer$1 () {
24159
24220
  get: function () {
24160
24221
  var sources = [];
24161
24222
  for (var i = 0; i < this._sections.length; i++) {
24162
- for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
24163
- sources.push(this._sections[i].consumer.sources[j]);
24223
+ // Read the getter once per section: for a nested indexed map it is
24224
+ // itself this getter, and re-reading it per item is exponential in the
24225
+ // nesting depth (CVE-2026-93749).
24226
+ var sectionSources = this._sections[i].consumer.sources;
24227
+ for (var j = 0; j < sectionSources.length; j++) {
24228
+ sources.push(sectionSources[j]);
24164
24229
  }
24165
24230
  }
24166
24231
  return sources;
@@ -24493,6 +24558,13 @@ function requireSourceNode$1 () {
24493
24558
  // to the SourceNode without any mapping.
24494
24559
  // Each line is added as separate string.
24495
24560
  while (lastGeneratedLine < mapping.generatedLine) {
24561
+ if (remainingLinesIndex >= remainingLines.length) {
24562
+ // The generated code is exhausted. Skip the rest instead of adding
24563
+ // empty lines one by one: a mapping may point far past the end of
24564
+ // the code (e.g. an indexed map section with a huge offset.line).
24565
+ lastGeneratedLine = mapping.generatedLine;
24566
+ break;
24567
+ }
24496
24568
  node.add(shiftNextLine());
24497
24569
  lastGeneratedLine++;
24498
24570
  }
@@ -26151,7 +26223,7 @@ const transformFor = createStructuralDirectiveTransform(
26151
26223
  createCompoundExpression([`const _memo = (`, memo.exp, `)`]),
26152
26224
  createCompoundExpression([
26153
26225
  `if (_cached && _cached.el`,
26154
- ...keyExp ? [` && _cached.key === `, keyExp] : [],
26226
+ ...keyExp ? [` && _cached.key === (`, keyExp, `)`] : [],
26155
26227
  ` && ${context.helperString(
26156
26228
  IS_MEMO_SAME
26157
26229
  )}(_cached, _memo)) return _cached`
@@ -28093,7 +28165,8 @@ const transformTransition = (node, context) => {
28093
28165
  if (!node.children.length) {
28094
28166
  return;
28095
28167
  }
28096
- if (hasMultipleChildren(node)) {
28168
+ const multipleChildren = hasMultipleChildren(node);
28169
+ if (multipleChildren) {
28097
28170
  context.onError(
28098
28171
  createDOMCompilerError(
28099
28172
  63,
@@ -28288,8 +28361,9 @@ function stringifyNode(node, context) {
28288
28361
  }
28289
28362
  }
28290
28363
  function stringifyElement(node, context) {
28364
+ var _a;
28291
28365
  let res = `<${node.tag}`;
28292
- let innerHTML = "";
28366
+ let innerHTML = void 0;
28293
28367
  for (let i = 0; i < node.props.length; i++) {
28294
28368
  const p = node.props[i];
28295
28369
  if (p.type === 6) {
@@ -28323,7 +28397,7 @@ function stringifyElement(node, context) {
28323
28397
  )}"`;
28324
28398
  }
28325
28399
  } else if (p.name === "html") {
28326
- innerHTML = evaluateConstant(p.exp);
28400
+ innerHTML = (_a = evaluateConstant(p.exp)) != null ? _a : "";
28327
28401
  } else if (p.name === "text") {
28328
28402
  innerHTML = escapeHtml(
28329
28403
  toDisplayString(evaluateConstant(p.exp))
@@ -28335,7 +28409,7 @@ function stringifyElement(node, context) {
28335
28409
  res += ` ${context.scopeId}`;
28336
28410
  }
28337
28411
  res += `>`;
28338
- if (innerHTML) {
28412
+ if (innerHTML !== void 0) {
28339
28413
  res += innerHTML;
28340
28414
  } else {
28341
28415
  for (let i = 0; i < node.children.length; i++) {
@@ -28557,7 +28631,8 @@ const validateHtmlNesting = (node, context) => {
28557
28631
 
28558
28632
  const DOMNodeTransforms = [
28559
28633
  transformStyle,
28560
- ...[transformTransition, validateHtmlNesting]
28634
+ transformTransition,
28635
+ ...[validateHtmlNesting]
28561
28636
  ];
28562
28637
  const DOMDirectiveTransforms = {
28563
28638
  cloak: noopDirectiveTransform,
@@ -28876,7 +28951,7 @@ function parseCssVars(sfc) {
28876
28951
  const vars = [];
28877
28952
  sfc.styles.forEach((style) => {
28878
28953
  let match;
28879
- const content = style.content.replace(/\/\*([\s\S]*?)\*\/|\/\/.*/g, "");
28954
+ const content = stripComments$1(style.content);
28880
28955
  while (match = vBindRE.exec(content)) {
28881
28956
  const start = match.index + match[0].length;
28882
28957
  const end = lexBinding(content, start);
@@ -28890,6 +28965,80 @@ function parseCssVars(sfc) {
28890
28965
  });
28891
28966
  return vars;
28892
28967
  }
28968
+ const cssSpecialRE = /[/"'\\(]/g;
28969
+ function stripComments$1(content) {
28970
+ const len = content.length;
28971
+ let out = "";
28972
+ let last = 0;
28973
+ let i = 0;
28974
+ cssSpecialRE.lastIndex = 0;
28975
+ while (cssSpecialRE.test(content)) {
28976
+ i = cssSpecialRE.lastIndex - 1;
28977
+ const c = content.charCodeAt(i);
28978
+ if (c === 47) {
28979
+ const next = content.charCodeAt(i + 1);
28980
+ if (next === 42 /* Asterisk */) {
28981
+ out += content.slice(last, i);
28982
+ const end = content.indexOf("*/", i + 2);
28983
+ i = last = end === -1 ? len : end + 2;
28984
+ } else if (next === 47) {
28985
+ out += content.slice(last, i);
28986
+ i += 2;
28987
+ while (i < len && !isNewline(content.charCodeAt(i))) i++;
28988
+ last = i;
28989
+ } else {
28990
+ i++;
28991
+ }
28992
+ } else if (c === 34 || c === 39) {
28993
+ i = skipString(content, i + 1, c);
28994
+ } else if (c === 92 /* Backslash */) {
28995
+ i += 2;
28996
+ } else if (isUrlFunction(content, i)) {
28997
+ i = skipUrl(content, i + 1);
28998
+ } else {
28999
+ i++;
29000
+ }
29001
+ cssSpecialRE.lastIndex = i;
29002
+ }
29003
+ return last === 0 ? content : out + content.slice(last);
29004
+ }
29005
+ function skipString(s, i, quote) {
29006
+ while (i < s.length) {
29007
+ const c = s.charCodeAt(i);
29008
+ if (c === quote) return i + 1;
29009
+ if (isNewline(c)) return i;
29010
+ if (c === 92 /* Backslash */) {
29011
+ i += s.charCodeAt(i + 1) === 13 && s.charCodeAt(i + 2) === 10 ? 3 : 2;
29012
+ } else {
29013
+ i++;
29014
+ }
29015
+ }
29016
+ return i;
29017
+ }
29018
+ function isUrlFunction(s, i) {
29019
+ const prev = s.charCodeAt(i - 4);
29020
+ return (s.charCodeAt(i - 3) | 32) === 117 /* LowerU */ && (s.charCodeAt(i - 2) | 32) === 114 /* LowerR */ && (s.charCodeAt(i - 1) | 32) === 108 /* LowerL */ && prev !== 92 /* Backslash */ && !isIdentChar(prev);
29021
+ }
29022
+ function skipUrl(s, i) {
29023
+ while (isWhitespace(s.charCodeAt(i))) i++;
29024
+ const c = s.charCodeAt(i);
29025
+ if (c === 34 || c === 39) return i;
29026
+ while (i < s.length) {
29027
+ const c2 = s.charCodeAt(i);
29028
+ if (c2 === 41 /* RightParen */) return i + 1;
29029
+ i += c2 === 92 /* Backslash */ ? 2 : 1;
29030
+ }
29031
+ return i;
29032
+ }
29033
+ function isIdentChar(c) {
29034
+ return c >= 97 && c <= 122 || c >= 65 && c <= 90 || c >= 48 && c <= 57 || c === 45 || c === 95 /* Underscore */ || c >= 128;
29035
+ }
29036
+ function isNewline(c) {
29037
+ return c === 10 || c === 13;
29038
+ }
29039
+ function isWhitespace(c) {
29040
+ return c === 32 || c === 9 || c === 12 || isNewline(c);
29041
+ }
28893
29042
  function lexBinding(content, start) {
28894
29043
  let state = 0 /* inParens */;
28895
29044
  let parenDepth = 0;
@@ -28969,12 +29118,7 @@ function genNormalScriptCssVarsCode(cssVars, bindings, id, isProd, defaultVar) {
28969
29118
  return `
28970
29119
  import { ${CSS_VARS_HELPER} as _${CSS_VARS_HELPER} } from 'vue'
28971
29120
  const __injectCSSVars__ = () => {
28972
- ${genCssVarsCode(
28973
- cssVars,
28974
- bindings,
28975
- id,
28976
- isProd
28977
- )}}
29121
+ ${genCssVarsCode(cssVars, bindings, id, isProd)}}
28978
29122
  const __setup__ = ${defaultVar}.setup
28979
29123
  ${defaultVar}.setup = __setup__
28980
29124
  ? (props, ctx) => { __injectCSSVars__();return __setup__(props, ctx) }
@@ -34393,22 +34537,10 @@ function requireStringifier () {
34393
34537
  if (hasRequiredStringifier) return stringifier;
34394
34538
  hasRequiredStringifier = 1;
34395
34539
 
34396
- // Escapes sequences that could break out of an HTML <style> context.
34397
- // Uses CSS unicode escaping (\3c = '<') which is valid CSS and parsed
34398
- // correctly by all compliant CSS consumers.
34399
- const STYLE_TAG = /(<)(\/?style\b)/gi;
34400
- const COMMENT_OPEN = /(<)(!--)/g;
34401
-
34402
34540
  // Characters that end an at-rule name, mirroring RE_AT_END in the tokenizer.
34403
34541
  // Params starting with anything else need a space to stay separate tokens.
34404
34542
  const AT_NAME_END = /[\t\n\f\r "#'()/;[\\\]{}]/;
34405
34543
 
34406
- function escapeHTMLInCSS(str) {
34407
- if (typeof str !== 'string') return str
34408
- if (!str.includes('<')) return str
34409
- return str.replace(STYLE_TAG, '\\3c $2').replace(COMMENT_OPEN, '\\3c $2')
34410
- }
34411
-
34412
34544
  const DEFAULT_RAW = {
34413
34545
  after: '\n',
34414
34546
  beforeClose: '\n',
@@ -34442,6 +34574,15 @@ function requireStringifier () {
34442
34574
  return name + afterName + params
34443
34575
  }
34444
34576
 
34577
+ // `*--x` is not a custom property: the parser checks the first token, and the
34578
+ // `*`/`_` hack prefix moves from `prop` into `before` only after that. A free
34579
+ // semicolon in front of the declaration also ends up in `before`.
34580
+ function isCustomProperty(node) {
34581
+ if (!node.prop.startsWith('--')) return false
34582
+ let before = node.raws.before;
34583
+ return typeof before === 'undefined' || !/[^\s;]$/.test(before)
34584
+ }
34585
+
34445
34586
  function pushBody(str, stack, node) {
34446
34587
  let nodes = node.nodes;
34447
34588
  let last = nodes.length - 1;
@@ -34463,7 +34604,7 @@ function requireStringifier () {
34463
34604
  !childSemicolon &&
34464
34605
  i < nodes.length - 1 &&
34465
34606
  ((child.type === 'atrule' && !child.nodes) ||
34466
- (child.type === 'decl' && child.prop.startsWith('--')))
34607
+ (child.type === 'decl' && isCustomProperty(child)))
34467
34608
  ) {
34468
34609
  childSemicolon = true;
34469
34610
  }
@@ -34477,17 +34618,17 @@ function requireStringifier () {
34477
34618
 
34478
34619
  function pushBlock(str, stack, node, start) {
34479
34620
  let between = str.raw(node, 'between', 'beforeOpen');
34480
- str.builder(escapeHTMLInCSS(start + between) + '{', node, 'start');
34621
+ str.builder(start + between + '{', node, 'start');
34481
34622
 
34482
34623
  let hasNodes = node.nodes && node.nodes.length;
34483
34624
  let close = () => {
34484
34625
  let after = hasNodes
34485
34626
  ? str.raw(node, 'after')
34486
34627
  : str.raw(node, 'after', 'emptyBody');
34487
- if (after) str.builder(escapeHTMLInCSS(after));
34628
+ if (after) str.builder(after);
34488
34629
  str.builder('}', node, 'end');
34489
34630
  if (node.type === 'rule' && node.raws.ownSemicolon) {
34490
- str.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, 'end');
34631
+ str.builder(node.raws.ownSemicolon, node, 'end');
34491
34632
  }
34492
34633
  };
34493
34634
 
@@ -34510,7 +34651,7 @@ function requireStringifier () {
34510
34651
  this.block(node, start);
34511
34652
  } else {
34512
34653
  let end = (node.raws.between || '') + (semicolon ? ';' : '');
34513
- this.builder(escapeHTMLInCSS(start + end), node);
34654
+ this.builder(start + end, node);
34514
34655
  }
34515
34656
  }
34516
34657
 
@@ -34545,7 +34686,7 @@ function requireStringifier () {
34545
34686
 
34546
34687
  block(node, start) {
34547
34688
  let between = this.raw(node, 'between', 'beforeOpen');
34548
- this.builder(escapeHTMLInCSS(start + between) + '{', node, 'start');
34689
+ this.builder(start + between + '{', node, 'start');
34549
34690
 
34550
34691
  let after;
34551
34692
  if (node.nodes && node.nodes.length) {
@@ -34555,7 +34696,7 @@ function requireStringifier () {
34555
34696
  after = this.raw(node, 'after', 'emptyBody');
34556
34697
  }
34557
34698
 
34558
- if (after) this.builder(escapeHTMLInCSS(after));
34699
+ if (after) this.builder(after);
34559
34700
  this.builder('}', node, 'end');
34560
34701
  }
34561
34702
 
@@ -34582,7 +34723,7 @@ function requireStringifier () {
34582
34723
  let child = entry.node;
34583
34724
  let before = this.raw(child, 'before');
34584
34725
  if (before) {
34585
- this.builder(entry.document ? before : escapeHTMLInCSS(before));
34726
+ this.builder(before);
34586
34727
  }
34587
34728
 
34588
34729
  if (expandable && child.type === 'rule') {
@@ -34598,7 +34739,7 @@ function requireStringifier () {
34598
34739
  comment(node) {
34599
34740
  let left = this.raw(node, 'left', 'commentLeft');
34600
34741
  let right = this.raw(node, 'right', 'commentRight');
34601
- this.builder(escapeHTMLInCSS('/*' + left + node.text + right + '*/'), node);
34742
+ this.builder('/*' + left + node.text + right + '*/', node);
34602
34743
  }
34603
34744
 
34604
34745
  decl(node, semicolon) {
@@ -34612,7 +34753,7 @@ function requireStringifier () {
34612
34753
  }
34613
34754
 
34614
34755
  if (semicolon) string += ';';
34615
- this.builder(escapeHTMLInCSS(string), node);
34756
+ this.builder(string, node);
34616
34757
  }
34617
34758
 
34618
34759
  document(node) {
@@ -34817,18 +34958,20 @@ function requireStringifier () {
34817
34958
  }
34818
34959
 
34819
34960
  root(node) {
34961
+ let inDocument = node.parent && node.parent.type === 'document';
34962
+ if (!inDocument && node.source && node.source.input.hasBOM) {
34963
+ this.builder('\uFEFF', node, 'start');
34964
+ }
34820
34965
  this.body(node);
34821
34966
  if (node.raws.after) {
34822
- let after = node.raws.after;
34823
- let isDocument = node.parent && node.parent.type === 'document';
34824
- this.builder(isDocument ? after : escapeHTMLInCSS(after));
34967
+ this.builder(node.raws.after);
34825
34968
  }
34826
34969
  }
34827
34970
 
34828
34971
  rule(node) {
34829
34972
  this.block(node, this.rawValue(node, 'selector'));
34830
34973
  if (node.raws.ownSemicolon) {
34831
- this.builder(escapeHTMLInCSS(node.raws.ownSemicolon), node, 'end');
34974
+ this.builder(node.raws.ownSemicolon, node, 'end');
34832
34975
  }
34833
34976
  }
34834
34977
 
@@ -34861,9 +35004,67 @@ function requireStringify () {
34861
35004
 
34862
35005
  let Stringifier = /*@__PURE__*/ requireStringifier();
34863
35006
 
35007
+ const STYLE_TAG = /(<)(\/?style\b)/gi;
35008
+ const COMMENT_OPEN = /(<)(!--)/g;
35009
+
35010
+ function escapeHTMLInCSS(str) {
35011
+ if (!str.includes('<')) return str
35012
+ return str.replace(STYLE_TAG, '\\3c $2').replace(COMMENT_OPEN, '\\3c $2')
35013
+ }
35014
+
35015
+ class SafeStringifier extends Stringifier {
35016
+ escapeHTML(node, print) {
35017
+ let builder = this.builder;
35018
+ let chunks, css;
35019
+ this.builder = (str, child, type) => {
35020
+ if (chunks) {
35021
+ css += str;
35022
+ chunks.push(str, child, type);
35023
+ } else if (str.includes('<')) {
35024
+ // Dangerous sequences start with `<`, so everything before
35025
+ // the first `<` is safe to pass through. The rest is buffered
35026
+ // to escape it as a whole.
35027
+ css = str;
35028
+ chunks = [str, child, type];
35029
+ } else {
35030
+ builder(str, child, type);
35031
+ }
35032
+ };
35033
+ print();
35034
+ this.builder = builder;
35035
+ if (!chunks) return
35036
+
35037
+ let escaped = escapeHTMLInCSS(css);
35038
+ if (escaped === css) {
35039
+ // Keep the chunks to get a precise source map
35040
+ for (let i = 0; i < chunks.length; i += 3) {
35041
+ builder(chunks[i], chunks[i + 1], chunks[i + 2]);
35042
+ }
35043
+ } else {
35044
+ // Escaping happens only on a hack attempt, source map is not important
35045
+ builder(escaped, node);
35046
+ }
35047
+ }
35048
+
35049
+ root(node) {
35050
+ if (node.parent && node.parent.type === 'document') {
35051
+ // Document raws around the Root hold markup and are kept as is since CSS in Document can be marked with <style>
35052
+ this.escapeHTML(node, () => this.body(node));
35053
+ if (node.raws.after) this.builder(node.raws.after);
35054
+ } else {
35055
+ this.escapeHTML(node, () => super.root(node));
35056
+ }
35057
+ }
35058
+ }
35059
+
34864
35060
  function stringify(node, builder) {
34865
- let str = new Stringifier(builder);
34866
- str.stringify(node);
35061
+ let str = new SafeStringifier(builder);
35062
+ // Root escapes its own output and keeps markup in Document raws
35063
+ if (node.type === 'root' || node.type === 'document') {
35064
+ str.stringify(node);
35065
+ } else {
35066
+ str.escapeHTML(node, () => str.stringify(node));
35067
+ }
34867
35068
  }
34868
35069
 
34869
35070
  stringify_1 = stringify;
@@ -36058,10 +36259,20 @@ function requirePreviousMap () {
36058
36259
  if (hasRequiredPreviousMap) return previousMap;
36059
36260
  hasRequiredPreviousMap = 1;
36060
36261
 
36061
- let { existsSync, readFileSync } = require$$0$1;
36262
+ let { existsSync, readFileSync, realpathSync } = require$$0$1;
36062
36263
  let { dirname, isAbsolute, join, relative, sep } = require$$1;
36063
36264
  let { SourceMapConsumer, SourceMapGenerator } = /*@__PURE__*/ requireSourceMap$1();
36064
36265
 
36266
+ function realPath(path) {
36267
+ try {
36268
+ return realpathSync(path)
36269
+ } catch {
36270
+ // Missing or dangling: keep the literal path. The existsSync() check below
36271
+ // still gates the read, and a path that does not exist cannot escape.
36272
+ return path
36273
+ }
36274
+ }
36275
+
36065
36276
  function fromBase64(str) {
36066
36277
  if (Buffer$1) {
36067
36278
  return Buffer$1.from(str, 'base64').toString()
@@ -36147,7 +36358,9 @@ function requirePreviousMap () {
36147
36358
  if (!/\.map$/i.test(path)) return undefined
36148
36359
  if (!cssFile) return undefined
36149
36360
 
36150
- let rel = relative(dirname(cssFile), path);
36361
+ // Compare *resolved* paths: relative() is textual, so without this a
36362
+ // symlink at or below the CSS file's directory points the map outside it.
36363
+ let rel = relative(realPath(dirname(cssFile)), realPath(path));
36151
36364
  if (rel === '..' || rel.startsWith('..' + sep) || isAbsolute(rel)) {
36152
36365
  return undefined
36153
36366
  }
@@ -36615,6 +36828,7 @@ function requireList () {
36615
36828
  },
36616
36829
 
36617
36830
  split(string, separators, last) {
36831
+ if (typeof string !== 'string') return []
36618
36832
  let array = [];
36619
36833
  let current = '';
36620
36834
  let split = false;
@@ -36623,8 +36837,21 @@ function requireList () {
36623
36837
  let inQuote = false;
36624
36838
  let prevQuote = '';
36625
36839
  let escape = false;
36840
+ let inComment = false;
36841
+
36842
+ for (let i = 0; i < string.length; i++) {
36843
+ let letter = string[i];
36844
+
36845
+ if (inComment) {
36846
+ current += letter;
36847
+ if (letter === '*' && string[i + 1] === '/') {
36848
+ current += '/';
36849
+ i += 1;
36850
+ inComment = false;
36851
+ }
36852
+ continue
36853
+ }
36626
36854
 
36627
- for (let letter of string) {
36628
36855
  if (escape) {
36629
36856
  escape = false;
36630
36857
  } else if (letter === '\\') {
@@ -36636,6 +36863,11 @@ function requireList () {
36636
36863
  } else if (letter === '"' || letter === "'") {
36637
36864
  inQuote = true;
36638
36865
  prevQuote = letter;
36866
+ } else if (letter === '/' && string[i + 1] === '*') {
36867
+ current += '/*';
36868
+ i += 1;
36869
+ inComment = true;
36870
+ continue
36639
36871
  } else if (letter === '(') {
36640
36872
  func += 1;
36641
36873
  } else if (letter === ')') {
@@ -36645,7 +36877,8 @@ function requireList () {
36645
36877
  }
36646
36878
 
36647
36879
  if (split) {
36648
- if (current !== '') array.push(current.trim());
36880
+ let value = current.trim();
36881
+ if (last || value !== '') array.push(value);
36649
36882
  current = '';
36650
36883
  split = false;
36651
36884
  } else {
@@ -36653,7 +36886,8 @@ function requireList () {
36653
36886
  }
36654
36887
  }
36655
36888
 
36656
- if (last || current !== '') array.push(current.trim());
36889
+ let value = current.trim();
36890
+ if (last || value !== '') array.push(value);
36657
36891
  return array
36658
36892
  }
36659
36893
  };
@@ -36895,15 +37129,22 @@ function requireMapGenerator () {
36895
37129
  }
36896
37130
  }
36897
37131
  } else if (this.css) {
37132
+ // Single forward pass. Removing every annotation from the whole
37133
+ // string separately would be O(n^2) on many annotations.
37134
+ let annotation = '/*# sourceMappingURL=';
37135
+ let css = '';
37136
+ let cursor = 0;
36898
37137
  let startIndex;
36899
- while ((startIndex = this.css.lastIndexOf('/*#')) !== -1) {
36900
- let endIndex = this.css.indexOf('*/', startIndex + 3);
37138
+ while ((startIndex = this.css.indexOf(annotation, cursor)) !== -1) {
37139
+ let endIndex = this.css.indexOf('*/', startIndex + annotation.length);
36901
37140
  if (endIndex === -1) break
36902
- while (startIndex > 0 && this.css[startIndex - 1] === '\n') {
37141
+ while (startIndex > cursor && this.css[startIndex - 1] === '\n') {
36903
37142
  startIndex--;
36904
37143
  }
36905
- this.css = this.css.slice(0, startIndex) + this.css.slice(endIndex + 2);
37144
+ css += this.css.slice(cursor, startIndex);
37145
+ cursor = endIndex + 2;
36906
37146
  }
37147
+ if (cursor > 0) this.css = css + this.css.slice(cursor);
36907
37148
  }
36908
37149
  }
36909
37150
 
@@ -37558,8 +37799,11 @@ function requireParser$1 () {
37558
37799
  if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
37559
37800
  prev.raws.ownSemicolon = this.spaces;
37560
37801
  this.spaces = '';
37802
+ // `ownSemicolon` also holds the spaces before the semicolon, but
37803
+ // the position above is the semicolon itself, so the node ends
37804
+ // right after it.
37561
37805
  prev.source.end = this.getPosition(token[2]);
37562
- prev.source.end.offset += prev.raws.ownSemicolon.length;
37806
+ prev.source.end.offset++;
37563
37807
  }
37564
37808
  }
37565
37809
  }
@@ -37695,6 +37939,9 @@ function requireParser$1 () {
37695
37939
  let token, type;
37696
37940
  let length = tokens.length;
37697
37941
  let value = '';
37942
+ // Last character of `value`. Reading it from `value` would flatten
37943
+ // the string concatenation on every comment and make parsing O(n^2).
37944
+ let last = '';
37698
37945
  let clean = true;
37699
37946
  let next, prev;
37700
37947
 
@@ -37707,16 +37954,18 @@ function requireParser$1 () {
37707
37954
  prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty';
37708
37955
  next = tokens[i + 1] ? tokens[i + 1][0] : 'empty';
37709
37956
  if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
37710
- if (value.slice(-1) === ',') {
37957
+ if (last === ',') {
37711
37958
  clean = false;
37712
37959
  } else {
37713
37960
  value += token[1];
37961
+ last = token[1].slice(-1);
37714
37962
  }
37715
37963
  } else {
37716
37964
  clean = false;
37717
37965
  }
37718
37966
  } else {
37719
37967
  value += token[1];
37968
+ last = token[1].slice(-1);
37720
37969
  }
37721
37970
  }
37722
37971
  if (!clean) {
@@ -38510,14 +38759,24 @@ function requireLazyResult () {
38510
38759
 
38511
38760
  if (visit.iterator !== 0) {
38512
38761
  let iterator = visit.iterator;
38762
+ // Advance past the child we just finished visiting. Like
38763
+ // `Container#each`, the index is incremented only after a child has
38764
+ // been fully processed, so a node inserted right after the current
38765
+ // child is not skipped by the `existIndex < index` adjustment in
38766
+ // `Container#insertAfter()` (which would fire exit events too early).
38767
+ if (visit.descending) {
38768
+ visit.descending = false;
38769
+ node.indexes[iterator] += 1;
38770
+ }
38513
38771
  let child;
38514
38772
  while ((child = node.nodes[node.indexes[iterator]])) {
38515
- node.indexes[iterator] += 1;
38516
38773
  if (!child[isClean]) {
38517
38774
  child[isClean] = true;
38775
+ visit.descending = true;
38518
38776
  stack.push(toStack(child));
38519
38777
  return
38520
38778
  }
38779
+ node.indexes[iterator] += 1;
38521
38780
  }
38522
38781
  visit.iterator = 0;
38523
38782
  delete node.indexes[iterator];
@@ -38555,12 +38814,22 @@ function requireLazyResult () {
38555
38814
 
38556
38815
  if (visit.iterator !== 0) {
38557
38816
  let iterator = visit.iterator;
38817
+ // Advance past the child we just finished visiting. Like
38818
+ // `Container#each`, the index is incremented only after a child has
38819
+ // been fully processed. Incrementing before (as this loop used to)
38820
+ // makes a node inserted right after the current child get skipped by
38821
+ // the `existIndex < index` adjustment in `Container#insertAfter()`,
38822
+ // which fires exit events before those new siblings are visited.
38823
+ if (visit.descending) {
38824
+ visit.descending = false;
38825
+ visitNode.indexes[iterator] += 1;
38826
+ }
38558
38827
  let child;
38559
38828
  let descended = false;
38560
38829
  while ((child = visitNode.nodes[visitNode.indexes[iterator]])) {
38561
- visitNode.indexes[iterator] += 1;
38562
38830
  if (!child[isClean]) {
38563
38831
  child[isClean] = true;
38832
+ visit.descending = true;
38564
38833
  stack.push({
38565
38834
  eventIndex: 0,
38566
38835
  events: getEvents(child),
@@ -38570,6 +38839,7 @@ function requireLazyResult () {
38570
38839
  descended = true;
38571
38840
  break
38572
38841
  }
38842
+ visitNode.indexes[iterator] += 1;
38573
38843
  }
38574
38844
  if (descended) continue
38575
38845
  visit.iterator = 0;
@@ -38772,7 +39042,7 @@ function requireProcessor$1 () {
38772
39042
 
38773
39043
  class Processor {
38774
39044
  constructor(plugins = []) {
38775
- this.version = '8.5.23';
39045
+ this.version = '8.5.29';
38776
39046
  this.plugins = this.normalize(plugins);
38777
39047
  }
38778
39048
 
@@ -38878,7 +39148,7 @@ function requirePostcss () {
38878
39148
  ': postcss.plugin was deprecated. Migration guide:\n' +
38879
39149
  'https://evilmartians.com/chronicles/postcss-8-plugin-migration'
38880
39150
  );
38881
- if (browser$1.env.LANG && browser$1.env.LANG.startsWith('cn')) {
39151
+ if (browser$1.env.LANG && browser$1.env.LANG.startsWith('zh')) {
38882
39152
  /* c8 ignore next 7 */
38883
39153
  // eslint-disable-next-line no-console
38884
39154
  console.warn(
@@ -41636,8 +41906,9 @@ function requireParser () {
41636
41906
  return indexes;
41637
41907
  }
41638
41908
  function uniqs() {
41639
- var list = Array.prototype.concat.apply([], arguments);
41640
- return list.filter(function (item, i) { return i === list.indexOf(item); });
41909
+ // A Set keeps the first-occurrence order the previous filter/indexOf pass
41910
+ // produced, without its quadratic cost on long index lists.
41911
+ return Array.from(new Set(Array.prototype.concat.apply([], arguments)));
41641
41912
  }
41642
41913
  var Parser = /** @class */ (function () {
41643
41914
  function Parser(rule, options) {
@@ -41682,6 +41953,11 @@ function requireParser () {
41682
41953
  attr.push(this.currToken);
41683
41954
  this.position++;
41684
41955
  }
41956
+ if (!this.currToken) {
41957
+ // Ran off the end of the token stream: the attribute was never closed.
41958
+ // Point at the opening bracket, which is where the author needs to look.
41959
+ return this.expected("closing square bracket", startingToken[tokenize_1.FIELDS.START_POS]);
41960
+ }
41685
41961
  if (this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) {
41686
41962
  return this.expected("closing square bracket", this.currToken[tokenize_1.FIELDS.START_POS]);
41687
41963
  }
@@ -41742,7 +42018,7 @@ function requireParser () {
41742
42018
  }
41743
42019
  if (commentBefore) {
41744
42020
  (0, util_1.ensureObject)(node, "raws", "spaces", "attribute");
41745
- node.raws.spaces.attribute.before = spaceBefore;
42021
+ node.raws.spaces.attribute.before = commentBefore;
41746
42022
  commentBefore = "";
41747
42023
  }
41748
42024
  node.namespace = (node.namespace || "") + content;
@@ -42166,7 +42442,21 @@ function requireParser () {
42166
42442
  return this.error("Unexpected '|'.", this.currToken[tokenize_1.FIELDS.START_POS]);
42167
42443
  };
42168
42444
  Parser.prototype.namespace = function () {
42169
- var before = (this.prevToken && this.content(this.prevToken)) || true;
42445
+ var prev = this.prevToken;
42446
+ // Only treat the previous token as a namespace prefix when it can actually
42447
+ // be one (a type/word or the universal `*`). A comment, comma, combinator
42448
+ // or whitespace before `|` means an empty namespace, not a prefix.
42449
+ var before = prev &&
42450
+ (prev[tokenize_1.FIELDS.TYPE] === tokens.word ||
42451
+ prev[tokenize_1.FIELDS.TYPE] === tokens.asterisk ||
42452
+ prev[tokenize_1.FIELDS.TYPE] === tokens.ampersand)
42453
+ ? this.content(prev)
42454
+ : true;
42455
+ if (!this.nextToken) {
42456
+ // A trailing `|` with nothing after it. `unexpectedPipe` reports against
42457
+ // `currToken`, which is the pipe itself and always present here.
42458
+ return this.unexpectedPipe();
42459
+ }
42170
42460
  if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.word) {
42171
42461
  this.position++;
42172
42462
  return this.word(before);
@@ -42196,6 +42486,7 @@ function requireParser () {
42196
42486
  Parser.prototype.parentheses = function () {
42197
42487
  var last = this.current.last;
42198
42488
  var unbalanced = 1;
42489
+ var openingToken = this.currToken;
42199
42490
  this.position++;
42200
42491
  if (last && last.type === types.PSEUDO) {
42201
42492
  var selector = new selector_1.default({
@@ -42265,7 +42556,9 @@ function requireParser () {
42265
42556
  }
42266
42557
  }
42267
42558
  if (unbalanced) {
42268
- return this.expected("closing parenthesis", this.currToken[tokenize_1.FIELDS.START_POS]);
42559
+ // `currToken` is undefined when the token stream ran out before the
42560
+ // parenthesis was closed; fall back to the opening one.
42561
+ return this.expected("closing parenthesis", (this.currToken || openingToken)[tokenize_1.FIELDS.START_POS]);
42269
42562
  }
42270
42563
  };
42271
42564
  Parser.prototype.pseudo = function () {
@@ -42370,8 +42663,14 @@ function requireParser () {
42370
42663
  // Eliminate Sass interpolations from the list of id indexes
42371
42664
  var interpolations = indexesOf(word, "#{");
42372
42665
  if (interpolations.length) {
42373
- hasId = hasId.filter(function (hashIndex) { return !~interpolations.indexOf(hashIndex); });
42374
- }
42666
+ var interpolationIndexes_1 = new Set(interpolations);
42667
+ hasId = hasId.filter(function (hashIndex) { return !interpolationIndexes_1.has(hashIndex); });
42668
+ }
42669
+ // Membership tests are built once. Scanning the arrays per index would make
42670
+ // a flat selector such as `.a.a.a...` quadratic in its number of class/id
42671
+ // indexes, which is enough to pin a CPU core on attacker-supplied input.
42672
+ var classIndexes = new Set(hasClass);
42673
+ var idIndexes = new Set(hasId);
42375
42674
  var indices = (0, sortAscending_1.default)(uniqs(__spreadArray(__spreadArray([0], __read(hasClass), false), __read(hasId), false)));
42376
42675
  indices.forEach(function (ind, i) {
42377
42676
  var index = indices[i + 1] || word.length;
@@ -42383,7 +42682,7 @@ function requireParser () {
42383
42682
  var current = _this.currToken;
42384
42683
  var sourceIndex = current[tokenize_1.FIELDS.START_POS] + indices[i];
42385
42684
  var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1));
42386
- if (~hasClass.indexOf(ind)) {
42685
+ if (classIndexes.has(ind)) {
42387
42686
  var classNameOpts = {
42388
42687
  value: value.slice(1),
42389
42688
  source: source,
@@ -42391,7 +42690,7 @@ function requireParser () {
42391
42690
  };
42392
42691
  node = new className_1.default(unescapeProp(classNameOpts, "value"));
42393
42692
  }
42394
- else if (~hasId.indexOf(ind)) {
42693
+ else if (idIndexes.has(ind)) {
42395
42694
  var idOpts = {
42396
42695
  value: value.slice(1),
42397
42696
  source: source,
@@ -49337,6 +49636,7 @@ function resolveExt(filename, fs) {
49337
49636
  }
49338
49637
  const tsConfigCache = createCache();
49339
49638
  const tsConfigRefMap = /* @__PURE__ */ new Map();
49639
+ const extendedConfigCache = /* @__PURE__ */ new Map();
49340
49640
  function resolveWithTS(containingFile, source, ts2, fs) {
49341
49641
  return;
49342
49642
  }
@@ -49347,6 +49647,10 @@ function invalidateTypeCache(filename) {
49347
49647
  fileToScopeCache.delete(filename);
49348
49648
  fileToGlobalScopeCache.delete(filename);
49349
49649
  tsConfigCache.delete(filename);
49650
+ if (filename.endsWith(".json")) {
49651
+ extendedConfigCache.clear();
49652
+ tsConfigCache.clear();
49653
+ }
49350
49654
  const affectedConfig = tsConfigRefMap.get(filename);
49351
49655
  if (affectedConfig) tsConfigCache.delete(affectedConfig);
49352
49656
  }
@@ -50588,11 +50892,18 @@ function transformDestructuredProps(ctx, vueImportAliases) {
50588
50892
  const excludedIds = /* @__PURE__ */ new WeakSet();
50589
50893
  const parentStack = [];
50590
50894
  const propsLocalToPublicMap = /* @__PURE__ */ Object.create(null);
50895
+ const modelOptionNodes = /* @__PURE__ */ new Set();
50896
+ let currentModelOption = null;
50591
50897
  for (const key in ctx.propsDestructuredBindings) {
50592
50898
  const { local } = ctx.propsDestructuredBindings[key];
50593
50899
  rootScope[local] = true;
50594
50900
  propsLocalToPublicMap[local] = key;
50595
50901
  }
50902
+ for (const { runtimeOptionNodes } of Object.values(ctx.modelDecls)) {
50903
+ for (const node of runtimeOptionNodes) {
50904
+ modelOptionNodes.add(node);
50905
+ }
50906
+ }
50596
50907
  function pushScope(isFunctionScope = false) {
50597
50908
  const scope = currentScope = Object.create(currentScope);
50598
50909
  scopeStack.push(scope);
@@ -50664,6 +50975,18 @@ function transformDestructuredProps(ctx, vueImportAliases) {
50664
50975
  });
50665
50976
  }
50666
50977
  function rewriteId(id, parent, parentStack2) {
50978
+ if (currentModelOption) {
50979
+ const isDefault = (currentModelOption.type === "ObjectProperty" || currentModelOption.type === "ObjectMethod") && resolveObjectKey(
50980
+ currentModelOption.key,
50981
+ currentModelOption.computed
50982
+ ) === "default";
50983
+ ctx.error(
50984
+ `\`${DEFINE_MODEL}()\` prop options cannot reference destructured props because they are hoisted outside of the setup() function.` + (isDefault ? ` Use the props argument of the default factory instead, e.g. default: props => props${genPropsAccessExp(
50985
+ propsLocalToPublicMap[id.name]
50986
+ ).slice(`__props`.length)}` : ``),
50987
+ id
50988
+ );
50989
+ }
50667
50990
  if (parent.type === "AssignmentExpression" && id === parent.left || parent.type === "UpdateExpression") {
50668
50991
  ctx.error(`Cannot assign to destructured props as they are readonly.`, id);
50669
50992
  }
@@ -50702,6 +51025,9 @@ function transformDestructuredProps(ctx, vueImportAliases) {
50702
51025
  if (parent && parent.type.startsWith("TS") && !TS_NODE_TYPES.includes(parent.type)) {
50703
51026
  return this.skip();
50704
51027
  }
51028
+ if (modelOptionNodes.has(node)) {
51029
+ currentModelOption = node;
51030
+ }
50705
51031
  checkUsage(node, "watch", vueImportAliases.watch);
50706
51032
  checkUsage(node, "toRef", vueImportAliases.toRef);
50707
51033
  if (isFunctionType(node)) {
@@ -50747,6 +51073,9 @@ function transformDestructuredProps(ctx, vueImportAliases) {
50747
51073
  },
50748
51074
  leave(node, parent) {
50749
51075
  parent && parentStack.pop();
51076
+ if (node === currentModelOption) {
51077
+ currentModelOption = null;
51078
+ }
50750
51079
  if (isFunctionType(node)) {
50751
51080
  popScope(true);
50752
51081
  } else if (node.type === "BlockStatement" && !isFunctionType(parent)) {
@@ -51318,6 +51647,8 @@ const ${normalScriptDefaultVar} = ${defaultSpecifier.local.name}
51318
51647
  }
51319
51648
  if (child.type === "BlockStatement") {
51320
51649
  scope.push(child.body);
51650
+ } else if (child.type === "SwitchCase") {
51651
+ scope.push(child.consequent);
51321
51652
  }
51322
51653
  if (child.type === "AwaitExpression") {
51323
51654
  hasAwait = true;
@@ -51333,8 +51664,10 @@ const ${normalScriptDefaultVar} = ${defaultSpecifier.local.name}
51333
51664
  );
51334
51665
  }
51335
51666
  },
51336
- exit(node2) {
51337
- if (node2.type === "BlockStatement") scope.pop();
51667
+ leave(node2) {
51668
+ if (node2.type === "BlockStatement" || node2.type === "SwitchCase") {
51669
+ scope.pop();
51670
+ }
51338
51671
  }
51339
51672
  });
51340
51673
  }
@@ -51876,7 +52209,7 @@ var __spreadValues = (a, b) => {
51876
52209
  }
51877
52210
  return a;
51878
52211
  };
51879
- const version = "3.5.42";
52212
+ const version = "3.5.44";
51880
52213
  const parseCache = parseCache$1;
51881
52214
  const errorMessages = __spreadValues(__spreadValues({}, errorMessages$1), DOMErrorMessages);
51882
52215
  const walk = walk$2;