vite 6.1.1 → 6.2.0-beta.0

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,4 +1,4 @@
1
- import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-Cg8OuIew.js';
1
+ import { Q as commonjsGlobal, P as getDefaultExportFromCjs } from './dep-C6SLLVWG.js';
2
2
  import require$$0$2 from 'fs';
3
3
  import require$$0 from 'postcss';
4
4
  import require$$0$1 from 'path';
@@ -276,7 +276,7 @@ var src$4 = {
276
276
  Object.defineProperty(Parser$1, "__esModule", {
277
277
  value: true
278
278
  });
279
- Parser$1.default = undefined;
279
+ Parser$1.default = void 0;
280
280
 
281
281
  var _icssUtils = src$4;
282
282
 
@@ -737,7 +737,7 @@ function baseToString(value) {
737
737
  function castSlice(array, start, end) {
738
738
  var length = array.length;
739
739
  end = end === undefined ? length : end;
740
- return (!start && end >= length) ? array : baseSlice(array, start, end);
740
+ return (false && end >= length) ? array : baseSlice(array, start, end);
741
741
  }
742
742
 
743
743
  /**
@@ -979,7 +979,7 @@ localsConvention.makeLocalsConventionReducer = makeLocalsConventionReducer;
979
979
 
980
980
  var _lodash = _interopRequireDefault$5(lodash_camelcase);
981
981
 
982
- function _interopRequireDefault$5(obj) { return obj.__esModule ? obj : { default: obj }; }
982
+ function _interopRequireDefault$5(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
983
983
 
984
984
  function dashesCamelCase(string) {
985
985
  return string.replace(/-+(\w)/g, (_, firstLetter) => firstLetter.toUpperCase());
@@ -1023,7 +1023,7 @@ var FileSystemLoader$1 = {};
1023
1023
  Object.defineProperty(FileSystemLoader$1, "__esModule", {
1024
1024
  value: true
1025
1025
  });
1026
- FileSystemLoader$1.default = undefined;
1026
+ FileSystemLoader$1.default = void 0;
1027
1027
 
1028
1028
  var _postcss$1 = _interopRequireDefault$4(require$$0);
1029
1029
 
@@ -2374,7 +2374,7 @@ var stripComments = {exports: {}};
2374
2374
  var stripCommentsExports = stripComments.exports;
2375
2375
 
2376
2376
  util.__esModule = true;
2377
- util.unesc = util.stripComments = util.getProp = util.ensureObject = undefined;
2377
+ util.unesc = util.stripComments = util.getProp = util.ensureObject = void 0;
2378
2378
  var _unesc = _interopRequireDefault$3(unescExports);
2379
2379
  util.unesc = _unesc["default"];
2380
2380
  var _getProp = _interopRequireDefault$3(getPropExports);
@@ -2388,10 +2388,10 @@ function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : {
2388
2388
  (function (module, exports) {
2389
2389
 
2390
2390
  exports.__esModule = true;
2391
- exports["default"] = undefined;
2391
+ exports["default"] = void 0;
2392
2392
  var _util = util;
2393
2393
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2394
- function _createClass(Constructor, protoProps, staticProps) { _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2394
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2395
2395
  var cloneNode = function cloneNode(obj, parent) {
2396
2396
  if (typeof obj !== 'object' || obj === null) {
2397
2397
  return obj;
@@ -2419,7 +2419,7 @@ function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : {
2419
2419
  };
2420
2420
  var Node = /*#__PURE__*/function () {
2421
2421
  function Node(opts) {
2422
- if (opts === undefined) {
2422
+ if (opts === void 0) {
2423
2423
  opts = {};
2424
2424
  }
2425
2425
  Object.assign(this, opts);
@@ -2451,7 +2451,7 @@ function _interopRequireDefault$3(obj) { return obj && obj.__esModule ? obj : {
2451
2451
  return this.parent.at(this.parent.index(this) - 1);
2452
2452
  };
2453
2453
  _proto.clone = function clone(overrides) {
2454
- if (overrides === undefined) {
2454
+ if (overrides === void 0) {
2455
2455
  overrides = {};
2456
2456
  }
2457
2457
  var cloned = cloneNode(this);
@@ -2584,7 +2584,7 @@ var nodeExports = node$1.exports;
2584
2584
  var types = {};
2585
2585
 
2586
2586
  types.__esModule = true;
2587
- types.UNIVERSAL = types.TAG = types.STRING = types.SELECTOR = types.ROOT = types.PSEUDO = types.NESTING = types.ID = types.COMMENT = types.COMBINATOR = types.CLASS = types.ATTRIBUTE = undefined;
2587
+ types.UNIVERSAL = types.TAG = types.STRING = types.SELECTOR = types.ROOT = types.PSEUDO = types.NESTING = types.ID = types.COMMENT = types.COMBINATOR = types.CLASS = types.ATTRIBUTE = void 0;
2588
2588
  var TAG = 'tag';
2589
2589
  types.TAG = TAG;
2590
2590
  var STRING = 'string';
@@ -2613,17 +2613,17 @@ types.UNIVERSAL = UNIVERSAL;
2613
2613
  (function (module, exports) {
2614
2614
 
2615
2615
  exports.__esModule = true;
2616
- exports["default"] = undefined;
2616
+ exports["default"] = void 0;
2617
2617
  var _node = _interopRequireDefault(nodeExports);
2618
2618
  var types$1 = _interopRequireWildcard(types);
2619
2619
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2620
- function _interopRequireWildcard(obj, nodeInterop) { if (obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2620
+ function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2621
2621
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2622
2622
  function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike) { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2623
2623
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
2624
2624
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
2625
2625
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2626
- function _createClass(Constructor, protoProps, staticProps) { _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2626
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2627
2627
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
2628
2628
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2629
2629
  var Container = /*#__PURE__*/function (_Node) {
@@ -2645,6 +2645,9 @@ types.UNIVERSAL = UNIVERSAL;
2645
2645
  _proto.prepend = function prepend(selector) {
2646
2646
  selector.parent = this;
2647
2647
  this.nodes.unshift(selector);
2648
+ for (var id in this.indexes) {
2649
+ this.indexes[id]++;
2650
+ }
2648
2651
  return this;
2649
2652
  };
2650
2653
  _proto.at = function at(index) {
@@ -2681,29 +2684,39 @@ types.UNIVERSAL = UNIVERSAL;
2681
2684
  return this.removeAll();
2682
2685
  };
2683
2686
  _proto.insertAfter = function insertAfter(oldNode, newNode) {
2687
+ var _this$nodes;
2684
2688
  newNode.parent = this;
2685
2689
  var oldIndex = this.index(oldNode);
2686
- this.nodes.splice(oldIndex + 1, 0, newNode);
2690
+ var resetNode = [];
2691
+ for (var i = 2; i < arguments.length; i++) {
2692
+ resetNode.push(arguments[i]);
2693
+ }
2694
+ (_this$nodes = this.nodes).splice.apply(_this$nodes, [oldIndex + 1, 0, newNode].concat(resetNode));
2687
2695
  newNode.parent = this;
2688
2696
  var index;
2689
2697
  for (var id in this.indexes) {
2690
2698
  index = this.indexes[id];
2691
- if (oldIndex <= index) {
2692
- this.indexes[id] = index + 1;
2699
+ if (oldIndex < index) {
2700
+ this.indexes[id] = index + arguments.length - 1;
2693
2701
  }
2694
2702
  }
2695
2703
  return this;
2696
2704
  };
2697
2705
  _proto.insertBefore = function insertBefore(oldNode, newNode) {
2706
+ var _this$nodes2;
2698
2707
  newNode.parent = this;
2699
2708
  var oldIndex = this.index(oldNode);
2700
- this.nodes.splice(oldIndex, 0, newNode);
2709
+ var resetNode = [];
2710
+ for (var i = 2; i < arguments.length; i++) {
2711
+ resetNode.push(arguments[i]);
2712
+ }
2713
+ (_this$nodes2 = this.nodes).splice.apply(_this$nodes2, [oldIndex, 0, newNode].concat(resetNode));
2701
2714
  newNode.parent = this;
2702
2715
  var index;
2703
2716
  for (var id in this.indexes) {
2704
2717
  index = this.indexes[id];
2705
- if (index <= oldIndex) {
2706
- this.indexes[id] = index + 1;
2718
+ if (index >= oldIndex) {
2719
+ this.indexes[id] = index + arguments.length - 1;
2707
2720
  }
2708
2721
  }
2709
2722
  return this;
@@ -2729,7 +2742,7 @@ types.UNIVERSAL = UNIVERSAL;
2729
2742
  * Return the most specific node at the line and column number given.
2730
2743
  * The source location is based on the original parsed location, locations aren't
2731
2744
  * updated as selector nodes are mutated.
2732
- *
2745
+ *
2733
2746
  * Note that this location is relative to the location of the first character
2734
2747
  * of the selector, and not the location of the selector in the overall document
2735
2748
  * when used in conjunction with postcss.
@@ -2925,12 +2938,12 @@ var containerExports = container.exports;
2925
2938
  (function (module, exports) {
2926
2939
 
2927
2940
  exports.__esModule = true;
2928
- exports["default"] = undefined;
2941
+ exports["default"] = void 0;
2929
2942
  var _container = _interopRequireDefault(containerExports);
2930
2943
  var _types = types;
2931
2944
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2932
2945
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
2933
- function _createClass(Constructor, protoProps, staticProps) { _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2946
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
2934
2947
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
2935
2948
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
2936
2949
  var Root = /*#__PURE__*/function (_Container) {
@@ -2975,7 +2988,7 @@ var selector$1 = {exports: {}};
2975
2988
  (function (module, exports) {
2976
2989
 
2977
2990
  exports.__esModule = true;
2978
- exports["default"] = undefined;
2991
+ exports["default"] = void 0;
2979
2992
  var _container = _interopRequireDefault(containerExports);
2980
2993
  var _types = types;
2981
2994
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3036,7 +3049,7 @@ var cssesc = function cssesc(string, options) {
3036
3049
  while (counter < length) {
3037
3050
  var character = string.charAt(counter++);
3038
3051
  var codePoint = character.charCodeAt();
3039
- var value = undefined;
3052
+ var value = void 0;
3040
3053
  // If it’s not a printable ASCII character…
3041
3054
  if (codePoint < 0x20 || codePoint > 0x7E) {
3042
3055
  if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {
@@ -3111,14 +3124,14 @@ var cssesc_1 = cssesc;
3111
3124
  (function (module, exports) {
3112
3125
 
3113
3126
  exports.__esModule = true;
3114
- exports["default"] = undefined;
3127
+ exports["default"] = void 0;
3115
3128
  var _cssesc = _interopRequireDefault(cssesc_1);
3116
3129
  var _util = util;
3117
3130
  var _node = _interopRequireDefault(nodeExports);
3118
3131
  var _types = types;
3119
3132
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3120
3133
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3121
- function _createClass(Constructor, protoProps, staticProps) { _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3134
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3122
3135
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
3123
3136
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3124
3137
  var ClassName = /*#__PURE__*/function (_Node) {
@@ -3167,7 +3180,7 @@ var comment$2 = {exports: {}};
3167
3180
  (function (module, exports) {
3168
3181
 
3169
3182
  exports.__esModule = true;
3170
- exports["default"] = undefined;
3183
+ exports["default"] = void 0;
3171
3184
  var _node = _interopRequireDefault(nodeExports);
3172
3185
  var _types = types;
3173
3186
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3194,7 +3207,7 @@ var id$1 = {exports: {}};
3194
3207
  (function (module, exports) {
3195
3208
 
3196
3209
  exports.__esModule = true;
3197
- exports["default"] = undefined;
3210
+ exports["default"] = void 0;
3198
3211
  var _node = _interopRequireDefault(nodeExports);
3199
3212
  var _types = types;
3200
3213
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3227,13 +3240,13 @@ var namespace = {exports: {}};
3227
3240
  (function (module, exports) {
3228
3241
 
3229
3242
  exports.__esModule = true;
3230
- exports["default"] = undefined;
3243
+ exports["default"] = void 0;
3231
3244
  var _cssesc = _interopRequireDefault(cssesc_1);
3232
3245
  var _util = util;
3233
3246
  var _node = _interopRequireDefault(nodeExports);
3234
3247
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3235
3248
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3236
- function _createClass(Constructor, protoProps, staticProps) { _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3249
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3237
3250
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
3238
3251
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3239
3252
  var Namespace = /*#__PURE__*/function (_Node) {
@@ -3310,7 +3323,7 @@ var namespaceExports = namespace.exports;
3310
3323
  (function (module, exports) {
3311
3324
 
3312
3325
  exports.__esModule = true;
3313
- exports["default"] = undefined;
3326
+ exports["default"] = void 0;
3314
3327
  var _namespace = _interopRequireDefault(namespaceExports);
3315
3328
  var _types = types;
3316
3329
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3337,7 +3350,7 @@ var string$1 = {exports: {}};
3337
3350
  (function (module, exports) {
3338
3351
 
3339
3352
  exports.__esModule = true;
3340
- exports["default"] = undefined;
3353
+ exports["default"] = void 0;
3341
3354
  var _node = _interopRequireDefault(nodeExports);
3342
3355
  var _types = types;
3343
3356
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3364,7 +3377,7 @@ var pseudo$1 = {exports: {}};
3364
3377
  (function (module, exports) {
3365
3378
 
3366
3379
  exports.__esModule = true;
3367
- exports["default"] = undefined;
3380
+ exports["default"] = void 0;
3368
3381
  var _container = _interopRequireDefault(containerExports);
3369
3382
  var _types = types;
3370
3383
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3402,7 +3415,7 @@ var node = require$$1.deprecate;
3402
3415
  (function (exports) {
3403
3416
 
3404
3417
  exports.__esModule = true;
3405
- exports["default"] = undefined;
3418
+ exports["default"] = void 0;
3406
3419
  exports.unescapeValue = unescapeValue;
3407
3420
  var _cssesc = _interopRequireDefault(cssesc_1);
3408
3421
  var _unesc = _interopRequireDefault(unescExports);
@@ -3411,7 +3424,7 @@ var node = require$$1.deprecate;
3411
3424
  var _CSSESC_QUOTE_OPTIONS;
3412
3425
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
3413
3426
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
3414
- function _createClass(Constructor, protoProps, staticProps) { _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3427
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3415
3428
  function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }
3416
3429
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
3417
3430
  var deprecate = node;
@@ -3463,7 +3476,7 @@ var node = require$$1.deprecate;
3463
3476
  _inheritsLoose(Attribute, _Namespace);
3464
3477
  function Attribute(opts) {
3465
3478
  var _this;
3466
- if (opts === undefined) {
3479
+ if (opts === void 0) {
3467
3480
  opts = {};
3468
3481
  }
3469
3482
  _this = _Namespace.call(this, handleDeprecatedContructorOpts(opts)) || this;
@@ -3504,7 +3517,7 @@ var node = require$$1.deprecate;
3504
3517
  **/
3505
3518
  var _proto = Attribute.prototype;
3506
3519
  _proto.getQuotedValue = function getQuotedValue(options) {
3507
- if (options === undefined) {
3520
+ if (options === void 0) {
3508
3521
  options = {};
3509
3522
  }
3510
3523
  var quoteMark = this._determineQuoteMark(options);
@@ -3522,7 +3535,7 @@ var node = require$$1.deprecate;
3522
3535
  * be interpreted as part of the value and escaped accordingly.
3523
3536
  */;
3524
3537
  _proto.setValue = function setValue(value, options) {
3525
- if (options === undefined) {
3538
+ if (options === void 0) {
3526
3539
  options = {};
3527
3540
  }
3528
3541
  this._value = value;
@@ -3621,10 +3634,10 @@ var node = require$$1.deprecate;
3621
3634
  return Object.assign(attrSpaces, spaces, rawSpaces);
3622
3635
  };
3623
3636
  _proto._stringFor = function _stringFor(name, spaceName, concat) {
3624
- if (spaceName === undefined) {
3637
+ if (spaceName === void 0) {
3625
3638
  spaceName = name;
3626
3639
  }
3627
- if (concat === undefined) {
3640
+ if (concat === void 0) {
3628
3641
  concat = defaultAttrConcat;
3629
3642
  }
3630
3643
  var attrSpaces = this._spacesFor(spaceName);
@@ -3854,7 +3867,7 @@ var universal$1 = {exports: {}};
3854
3867
  (function (module, exports) {
3855
3868
 
3856
3869
  exports.__esModule = true;
3857
- exports["default"] = undefined;
3870
+ exports["default"] = void 0;
3858
3871
  var _namespace = _interopRequireDefault(namespaceExports);
3859
3872
  var _types = types;
3860
3873
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3882,7 +3895,7 @@ var combinator$2 = {exports: {}};
3882
3895
  (function (module, exports) {
3883
3896
 
3884
3897
  exports.__esModule = true;
3885
- exports["default"] = undefined;
3898
+ exports["default"] = void 0;
3886
3899
  var _node = _interopRequireDefault(nodeExports);
3887
3900
  var _types = types;
3888
3901
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3909,7 +3922,7 @@ var nesting$1 = {exports: {}};
3909
3922
  (function (module, exports) {
3910
3923
 
3911
3924
  exports.__esModule = true;
3912
- exports["default"] = undefined;
3925
+ exports["default"] = void 0;
3913
3926
  var _node = _interopRequireDefault(nodeExports);
3914
3927
  var _types = types;
3915
3928
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -3953,7 +3966,7 @@ var tokenize = {};
3953
3966
  var tokenTypes = {};
3954
3967
 
3955
3968
  tokenTypes.__esModule = true;
3956
- tokenTypes.word = tokenTypes.tilde = tokenTypes.tab = tokenTypes.str = tokenTypes.space = tokenTypes.slash = tokenTypes.singleQuote = tokenTypes.semicolon = tokenTypes.plus = tokenTypes.pipe = tokenTypes.openSquare = tokenTypes.openParenthesis = tokenTypes.newline = tokenTypes.greaterThan = tokenTypes.feed = tokenTypes.equals = tokenTypes.doubleQuote = tokenTypes.dollar = tokenTypes.cr = tokenTypes.comment = tokenTypes.comma = tokenTypes.combinator = tokenTypes.colon = tokenTypes.closeSquare = tokenTypes.closeParenthesis = tokenTypes.caret = tokenTypes.bang = tokenTypes.backslash = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = undefined;
3969
+ tokenTypes.word = tokenTypes.tilde = tokenTypes.tab = tokenTypes.str = tokenTypes.space = tokenTypes.slash = tokenTypes.singleQuote = tokenTypes.semicolon = tokenTypes.plus = tokenTypes.pipe = tokenTypes.openSquare = tokenTypes.openParenthesis = tokenTypes.newline = tokenTypes.greaterThan = tokenTypes.feed = tokenTypes.equals = tokenTypes.doubleQuote = tokenTypes.dollar = tokenTypes.cr = tokenTypes.comment = tokenTypes.comma = tokenTypes.combinator = tokenTypes.colon = tokenTypes.closeSquare = tokenTypes.closeParenthesis = tokenTypes.caret = tokenTypes.bang = tokenTypes.backslash = tokenTypes.at = tokenTypes.asterisk = tokenTypes.ampersand = void 0;
3957
3970
  var ampersand = 38; // `&`.charCodeAt(0);
3958
3971
  tokenTypes.ampersand = ampersand;
3959
3972
  var asterisk = 42; // `*`.charCodeAt(0);
@@ -4024,12 +4037,12 @@ tokenTypes.combinator = combinator$1;
4024
4037
  (function (exports) {
4025
4038
 
4026
4039
  exports.__esModule = true;
4027
- exports.FIELDS = undefined;
4040
+ exports.FIELDS = void 0;
4028
4041
  exports["default"] = tokenize;
4029
4042
  var t = _interopRequireWildcard(tokenTypes);
4030
4043
  var _unescapable, _wordDelimiters;
4031
4044
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
4032
- function _interopRequireWildcard(obj, nodeInterop) { if (obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4045
+ function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4033
4046
  var unescapable = (_unescapable = {}, _unescapable[t.tab] = true, _unescapable[t.newline] = true, _unescapable[t.cr] = true, _unescapable[t.feed] = true, _unescapable);
4034
4047
  var wordDelimiters = (_wordDelimiters = {}, _wordDelimiters[t.space] = true, _wordDelimiters[t.tab] = true, _wordDelimiters[t.newline] = true, _wordDelimiters[t.cr] = true, _wordDelimiters[t.feed] = true, _wordDelimiters[t.ampersand] = true, _wordDelimiters[t.asterisk] = true, _wordDelimiters[t.bang] = true, _wordDelimiters[t.comma] = true, _wordDelimiters[t.colon] = true, _wordDelimiters[t.semicolon] = true, _wordDelimiters[t.openParenthesis] = true, _wordDelimiters[t.closeParenthesis] = true, _wordDelimiters[t.openSquare] = true, _wordDelimiters[t.closeSquare] = true, _wordDelimiters[t.singleQuote] = true, _wordDelimiters[t.doubleQuote] = true, _wordDelimiters[t.plus] = true, _wordDelimiters[t.pipe] = true, _wordDelimiters[t.tilde] = true, _wordDelimiters[t.greaterThan] = true, _wordDelimiters[t.equals] = true, _wordDelimiters[t.dollar] = true, _wordDelimiters[t.caret] = true, _wordDelimiters[t.slash] = true, _wordDelimiters);
4035
4048
  var hex = {};
@@ -4263,7 +4276,7 @@ tokenTypes.combinator = combinator$1;
4263
4276
  (function (module, exports) {
4264
4277
 
4265
4278
  exports.__esModule = true;
4266
- exports["default"] = undefined;
4279
+ exports["default"] = void 0;
4267
4280
  var _root = _interopRequireDefault(rootExports);
4268
4281
  var _selector = _interopRequireDefault(selectorExports);
4269
4282
  var _className = _interopRequireDefault(classNameExports);
@@ -4286,7 +4299,7 @@ tokenTypes.combinator = combinator$1;
4286
4299
  function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
4287
4300
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
4288
4301
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4289
- function _createClass(Constructor, protoProps, staticProps) { _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4302
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4290
4303
  var WHITESPACE_TOKENS = (_WHITESPACE_TOKENS = {}, _WHITESPACE_TOKENS[tokens.space] = true, _WHITESPACE_TOKENS[tokens.cr] = true, _WHITESPACE_TOKENS[tokens.feed] = true, _WHITESPACE_TOKENS[tokens.newline] = true, _WHITESPACE_TOKENS[tokens.tab] = true, _WHITESPACE_TOKENS);
4291
4304
  var WHITESPACE_EQUIV_TOKENS = Object.assign({}, WHITESPACE_TOKENS, (_Object$assign = {}, _Object$assign[tokens.comment] = true, _Object$assign));
4292
4305
  function tokenStart(token) {
@@ -4352,7 +4365,7 @@ tokenTypes.combinator = combinator$1;
4352
4365
  }
4353
4366
  var Parser = /*#__PURE__*/function () {
4354
4367
  function Parser(rule, options) {
4355
- if (options === undefined) {
4368
+ if (options === void 0) {
4356
4369
  options = {};
4357
4370
  }
4358
4371
  this.rule = rule;
@@ -4694,7 +4707,7 @@ tokenTypes.combinator = combinator$1;
4694
4707
  */;
4695
4708
  _proto.convertWhitespaceNodesToSpace = function convertWhitespaceNodesToSpace(nodes, requiredSpace) {
4696
4709
  var _this2 = this;
4697
- if (requiredSpace === undefined) {
4710
+ if (requiredSpace === void 0) {
4698
4711
  requiredSpace = false;
4699
4712
  }
4700
4713
  var space = "";
@@ -4715,7 +4728,7 @@ tokenTypes.combinator = combinator$1;
4715
4728
  return result;
4716
4729
  };
4717
4730
  _proto.isNamedCombinator = function isNamedCombinator(position) {
4718
- if (position === undefined) {
4731
+ if (position === void 0) {
4719
4732
  position = this.position;
4720
4733
  }
4721
4734
  return this.tokens[position + 0] && this.tokens[position + 0][_tokenize.FIELDS.TYPE] === tokens.slash && this.tokens[position + 1] && this.tokens[position + 1][_tokenize.FIELDS.TYPE] === tokens.word && this.tokens[position + 2] && this.tokens[position + 2][_tokenize.FIELDS.TYPE] === tokens.slash;
@@ -5229,7 +5242,7 @@ tokenTypes.combinator = combinator$1;
5229
5242
  return this.current.append(node);
5230
5243
  };
5231
5244
  _proto.content = function content(token) {
5232
- if (token === undefined) {
5245
+ if (token === void 0) {
5233
5246
  token = this.currToken;
5234
5247
  }
5235
5248
  return this.css.slice(token[_tokenize.FIELDS.START_POS], token[_tokenize.FIELDS.END_POS]);
@@ -5239,7 +5252,7 @@ tokenTypes.combinator = combinator$1;
5239
5252
  * returns -1 if no meaningful token is found.
5240
5253
  */
5241
5254
  _proto.locateNextMeaningfulToken = function locateNextMeaningfulToken(startPosition) {
5242
- if (startPosition === undefined) {
5255
+ if (startPosition === void 0) {
5243
5256
  startPosition = this.position + 1;
5244
5257
  }
5245
5258
  var searchPosition = startPosition;
@@ -5280,7 +5293,7 @@ var parserExports = parser.exports;
5280
5293
  (function (module, exports) {
5281
5294
 
5282
5295
  exports.__esModule = true;
5283
- exports["default"] = undefined;
5296
+ exports["default"] = void 0;
5284
5297
  var _parser = _interopRequireDefault(parserExports);
5285
5298
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5286
5299
  var Processor = /*#__PURE__*/function () {
@@ -5291,7 +5304,7 @@ var parserExports = parser.exports;
5291
5304
  }
5292
5305
  var _proto = Processor.prototype;
5293
5306
  _proto._shouldUpdateSelector = function _shouldUpdateSelector(rule, options) {
5294
- if (options === undefined) {
5307
+ if (options === void 0) {
5295
5308
  options = {};
5296
5309
  }
5297
5310
  var merged = Object.assign({}, this.options, options);
@@ -5302,7 +5315,7 @@ var parserExports = parser.exports;
5302
5315
  }
5303
5316
  };
5304
5317
  _proto._isLossy = function _isLossy(options) {
5305
- if (options === undefined) {
5318
+ if (options === void 0) {
5306
5319
  options = {};
5307
5320
  }
5308
5321
  var merged = Object.assign({}, this.options, options);
@@ -5313,7 +5326,7 @@ var parserExports = parser.exports;
5313
5326
  }
5314
5327
  };
5315
5328
  _proto._root = function _root(rule, options) {
5316
- if (options === undefined) {
5329
+ if (options === void 0) {
5317
5330
  options = {};
5318
5331
  }
5319
5332
  var parser = new _parser["default"](rule, this._parseOptions(options));
@@ -5326,7 +5339,7 @@ var parserExports = parser.exports;
5326
5339
  };
5327
5340
  _proto._run = function _run(rule, options) {
5328
5341
  var _this = this;
5329
- if (options === undefined) {
5342
+ if (options === void 0) {
5330
5343
  options = {};
5331
5344
  }
5332
5345
  return new Promise(function (resolve, reject) {
@@ -5351,7 +5364,7 @@ var parserExports = parser.exports;
5351
5364
  });
5352
5365
  };
5353
5366
  _proto._runSync = function _runSync(rule, options) {
5354
- if (options === undefined) {
5367
+ if (options === void 0) {
5355
5368
  options = {};
5356
5369
  }
5357
5370
  var root = this._root(rule, options);
@@ -5456,7 +5469,7 @@ var selectors = {};
5456
5469
  var constructors = {};
5457
5470
 
5458
5471
  constructors.__esModule = true;
5459
- constructors.universal = constructors.tag = constructors.string = constructors.selector = constructors.root = constructors.pseudo = constructors.nesting = constructors.id = constructors.comment = constructors.combinator = constructors.className = constructors.attribute = undefined;
5472
+ constructors.universal = constructors.tag = constructors.string = constructors.selector = constructors.root = constructors.pseudo = constructors.nesting = constructors.id = constructors.comment = constructors.combinator = constructors.className = constructors.attribute = void 0;
5460
5473
  var _attribute = _interopRequireDefault$2(attribute$1);
5461
5474
  var _className = _interopRequireDefault$2(classNameExports);
5462
5475
  var _combinator = _interopRequireDefault$2(combinatorExports);
@@ -5522,16 +5535,16 @@ constructors.universal = universal;
5522
5535
  var guards = {};
5523
5536
 
5524
5537
  guards.__esModule = true;
5525
- guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = undefined;
5538
+ guards.isComment = guards.isCombinator = guards.isClassName = guards.isAttribute = void 0;
5526
5539
  guards.isContainer = isContainer;
5527
- guards.isIdentifier = undefined;
5540
+ guards.isIdentifier = void 0;
5528
5541
  guards.isNamespace = isNamespace;
5529
- guards.isNesting = undefined;
5542
+ guards.isNesting = void 0;
5530
5543
  guards.isNode = isNode;
5531
- guards.isPseudo = undefined;
5544
+ guards.isPseudo = void 0;
5532
5545
  guards.isPseudoClass = isPseudoClass;
5533
5546
  guards.isPseudoElement = isPseudoElement;
5534
- guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = undefined;
5547
+ guards.isUniversal = guards.isTag = guards.isString = guards.isSelector = guards.isRoot = void 0;
5535
5548
  var _types = types;
5536
5549
  var _IS_TYPE;
5537
5550
  var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE);
@@ -5604,11 +5617,11 @@ function isNamespace(node) {
5604
5617
  (function (module, exports) {
5605
5618
 
5606
5619
  exports.__esModule = true;
5607
- exports["default"] = undefined;
5620
+ exports["default"] = void 0;
5608
5621
  var _processor = _interopRequireDefault(processorExports);
5609
5622
  var selectors$1 = _interopRequireWildcard(selectors);
5610
5623
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
5611
- function _interopRequireWildcard(obj, nodeInterop) { if (obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
5624
+ function _interopRequireWildcard(obj, nodeInterop) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
5612
5625
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5613
5626
  var parser = function parser(processor) {
5614
5627
  return new _processor["default"](processor);
@@ -5626,8 +5639,40 @@ const selectorParser$1 = distExports;
5626
5639
  const valueParser = lib;
5627
5640
  const { extractICSS } = src$4;
5628
5641
 
5642
+ const IGNORE_FILE_MARKER = "cssmodules-pure-no-check";
5643
+ const IGNORE_NEXT_LINE_MARKER = "cssmodules-pure-ignore";
5644
+
5629
5645
  const isSpacing = (node) => node.type === "combinator" && node.value === " ";
5630
5646
 
5647
+ const isPureCheckDisabled = (root) => {
5648
+ for (const node of root.nodes) {
5649
+ if (node.type !== "comment") {
5650
+ return false;
5651
+ }
5652
+ if (node.text.trim().startsWith(IGNORE_FILE_MARKER)) {
5653
+ return true;
5654
+ }
5655
+ }
5656
+ return false;
5657
+ };
5658
+
5659
+ function getIgnoreComment(node) {
5660
+ if (!node.parent) {
5661
+ return;
5662
+ }
5663
+ const indexInParent = node.parent.index(node);
5664
+ for (let i = indexInParent - 1; i >= 0; i--) {
5665
+ const prevNode = node.parent.nodes[i];
5666
+ if (prevNode.type === "comment") {
5667
+ if (prevNode.text.trimStart().startsWith(IGNORE_NEXT_LINE_MARKER)) {
5668
+ return prevNode;
5669
+ }
5670
+ } else {
5671
+ break;
5672
+ }
5673
+ }
5674
+ }
5675
+
5631
5676
  function normalizeNodeArray(nodes) {
5632
5677
  const array = [];
5633
5678
 
@@ -5647,6 +5692,8 @@ function normalizeNodeArray(nodes) {
5647
5692
  return array;
5648
5693
  }
5649
5694
 
5695
+ const isPureSelectorSymbol = Symbol("is-pure-selector");
5696
+
5650
5697
  function localizeNode(rule, mode, localAliasMap) {
5651
5698
  const transform = (node, context) => {
5652
5699
  if (context.ignoreNextSpacing && !isSpacing(node)) {
@@ -5854,7 +5901,7 @@ function localizeNode(rule, mode, localAliasMap) {
5854
5901
  }
5855
5902
  case "nesting": {
5856
5903
  if (node.value === "&") {
5857
- context.hasLocals = true;
5904
+ context.hasLocals = rule.parent[isPureSelectorSymbol];
5858
5905
  }
5859
5906
  }
5860
5907
  }
@@ -5960,7 +6007,7 @@ function localizeDeclarationValues(localize, declaration, context) {
5960
6007
  const subContext = {
5961
6008
  options: context.options,
5962
6009
  global: context.global,
5963
- localizeNextItem: localize && !context.global,
6010
+ localizeNextItem: localize,
5964
6011
  localAliasMap: context.localAliasMap,
5965
6012
  };
5966
6013
  nodes[index] = localizeDeclNode(node, subContext);
@@ -5969,24 +6016,20 @@ function localizeDeclarationValues(localize, declaration, context) {
5969
6016
  declaration.value = valueNodes.toString();
5970
6017
  }
5971
6018
 
5972
- function localizeDeclaration(declaration, context) {
5973
- const isAnimation = /animation$/i.test(declaration.prop);
6019
+ // letter
6020
+ // An uppercase letter or a lowercase letter.
6021
+ //
6022
+ // ident-start code point
6023
+ // A letter, a non-ASCII code point, or U+005F LOW LINE (_).
6024
+ //
6025
+ // ident code point
6026
+ // An ident-start code point, a digit, or U+002D HYPHEN-MINUS (-).
5974
6027
 
5975
- if (isAnimation) {
5976
- // letter
5977
- // An uppercase letter or a lowercase letter.
5978
- //
5979
- // ident-start code point
5980
- // A letter, a non-ASCII code point, or U+005F LOW LINE (_).
5981
- //
5982
- // ident code point
5983
- // An ident-start code point, a digit, or U+002D HYPHEN-MINUS (-).
5984
-
5985
- // We don't validate `hex digits`, because we don't need it, it is work of linters.
5986
- const validIdent =
5987
- /^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-(?![0-9]))((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i;
5988
-
5989
- /*
6028
+ // We don't validate `hex digits`, because we don't need it, it is work of linters.
6029
+ const validIdent =
6030
+ /^-?([a-z\u0080-\uFFFF_]|(\\[^\r\n\f])|-(?![0-9]))((\\[^\r\n\f])|[a-z\u0080-\uFFFF_0-9-])*$/i;
6031
+
6032
+ /*
5990
6033
  The spec defines some keywords that you can use to describe properties such as the timing
5991
6034
  function. These are still valid animation names, so as long as there is a property that accepts
5992
6035
  a keyword, it is given priority. Only when all the properties that can take a keyword are
@@ -5997,38 +6040,43 @@ function localizeDeclaration(declaration, context) {
5997
6040
  The animation will repeat an infinite number of times from the first argument, and will have an
5998
6041
  animation name of infinite from the second.
5999
6042
  */
6000
- const animationKeywords = {
6001
- // animation-direction
6002
- $normal: 1,
6003
- $reverse: 1,
6004
- $alternate: 1,
6005
- "$alternate-reverse": 1,
6006
- // animation-fill-mode
6007
- $forwards: 1,
6008
- $backwards: 1,
6009
- $both: 1,
6010
- // animation-iteration-count
6011
- $infinite: 1,
6012
- // animation-play-state
6013
- $paused: 1,
6014
- $running: 1,
6015
- // animation-timing-function
6016
- $ease: 1,
6017
- "$ease-in": 1,
6018
- "$ease-out": 1,
6019
- "$ease-in-out": 1,
6020
- $linear: 1,
6021
- "$step-end": 1,
6022
- "$step-start": 1,
6023
- // Special
6024
- $none: Infinity, // No matter how many times you write none, it will never be an animation name
6025
- // Global values
6026
- $initial: Infinity,
6027
- $inherit: Infinity,
6028
- $unset: Infinity,
6029
- $revert: Infinity,
6030
- "$revert-layer": Infinity,
6031
- };
6043
+ const animationKeywords = {
6044
+ // animation-direction
6045
+ $normal: 1,
6046
+ $reverse: 1,
6047
+ $alternate: 1,
6048
+ "$alternate-reverse": 1,
6049
+ // animation-fill-mode
6050
+ $forwards: 1,
6051
+ $backwards: 1,
6052
+ $both: 1,
6053
+ // animation-iteration-count
6054
+ $infinite: 1,
6055
+ // animation-play-state
6056
+ $paused: 1,
6057
+ $running: 1,
6058
+ // animation-timing-function
6059
+ $ease: 1,
6060
+ "$ease-in": 1,
6061
+ "$ease-out": 1,
6062
+ "$ease-in-out": 1,
6063
+ $linear: 1,
6064
+ "$step-end": 1,
6065
+ "$step-start": 1,
6066
+ // Special
6067
+ $none: Infinity, // No matter how many times you write none, it will never be an animation name
6068
+ // Global values
6069
+ $initial: Infinity,
6070
+ $inherit: Infinity,
6071
+ $unset: Infinity,
6072
+ $revert: Infinity,
6073
+ "$revert-layer": Infinity,
6074
+ };
6075
+
6076
+ function localizeDeclaration(declaration, context) {
6077
+ const isAnimation = /animation(-name)?$/i.test(declaration.prop);
6078
+
6079
+ if (isAnimation) {
6032
6080
  let parsedAnimationKeywords = {};
6033
6081
  const valueNodes = valueParser(declaration.value).walk((node) => {
6034
6082
  // If div-token appeared (represents as comma ','), a possibility of an animation-keywords should be reflesh.
@@ -6036,9 +6084,28 @@ function localizeDeclaration(declaration, context) {
6036
6084
  parsedAnimationKeywords = {};
6037
6085
 
6038
6086
  return;
6039
- }
6040
- // Do not handle nested functions
6041
- else if (node.type === "function") {
6087
+ } else if (
6088
+ node.type === "function" &&
6089
+ node.value.toLowerCase() === "local" &&
6090
+ node.nodes.length === 1
6091
+ ) {
6092
+ node.type = "word";
6093
+ node.value = node.nodes[0].value;
6094
+
6095
+ return localizeDeclNode(node, {
6096
+ options: context.options,
6097
+ global: context.global,
6098
+ localizeNextItem: true,
6099
+ localAliasMap: context.localAliasMap,
6100
+ });
6101
+ } else if (node.type === "function") {
6102
+ // replace `animation: global(example)` with `animation-name: example`
6103
+ if (node.value.toLowerCase() === "global" && node.nodes.length === 1) {
6104
+ node.type = "word";
6105
+ node.value = node.nodes[0].value;
6106
+ }
6107
+
6108
+ // Do not handle nested functions
6042
6109
  return false;
6043
6110
  }
6044
6111
  // Ignore all except word
@@ -6065,14 +6132,12 @@ function localizeDeclaration(declaration, context) {
6065
6132
  }
6066
6133
  }
6067
6134
 
6068
- const subContext = {
6135
+ return localizeDeclNode(node, {
6069
6136
  options: context.options,
6070
6137
  global: context.global,
6071
6138
  localizeNextItem: shouldParseAnimationName && !context.global,
6072
6139
  localAliasMap: context.localAliasMap,
6073
- };
6074
-
6075
- return localizeDeclNode(node, subContext);
6140
+ });
6076
6141
  });
6077
6142
 
6078
6143
  declaration.value = valueNodes.toString();
@@ -6080,18 +6145,34 @@ function localizeDeclaration(declaration, context) {
6080
6145
  return;
6081
6146
  }
6082
6147
 
6083
- const isAnimationName = /animation(-name)?$/i.test(declaration.prop);
6148
+ if (/url\(/i.test(declaration.value)) {
6149
+ return localizeDeclarationValues(false, declaration, context);
6150
+ }
6151
+ }
6084
6152
 
6085
- if (isAnimationName) {
6086
- return localizeDeclarationValues(true, declaration, context);
6153
+ const isPureSelector = (context, rule) => {
6154
+ if (!rule.parent || rule.type === "root") {
6155
+ return !context.hasPureGlobals;
6087
6156
  }
6088
6157
 
6089
- const hasUrl = /url\(/i.test(declaration.value);
6158
+ if (rule.type === "rule" && rule[isPureSelectorSymbol]) {
6159
+ return rule[isPureSelectorSymbol] || isPureSelector(context, rule.parent);
6160
+ }
6090
6161
 
6091
- if (hasUrl) {
6092
- return localizeDeclarationValues(false, declaration, context);
6162
+ return !context.hasPureGlobals || isPureSelector(context, rule.parent);
6163
+ };
6164
+
6165
+ const isNodeWithoutDeclarations = (rule) => {
6166
+ if (rule.nodes.length > 0) {
6167
+ return !rule.nodes.every(
6168
+ (item) =>
6169
+ item.type === "rule" ||
6170
+ (item.type === "atrule" && !isNodeWithoutDeclarations(item))
6171
+ );
6093
6172
  }
6094
- }
6173
+
6174
+ return true;
6175
+ };
6095
6176
 
6096
6177
  src$2.exports = (options = {}) => {
6097
6178
  if (
@@ -6117,6 +6198,7 @@ src$2.exports = (options = {}) => {
6117
6198
  return {
6118
6199
  Once(root) {
6119
6200
  const { icssImports } = extractICSS(root, false);
6201
+ const enforcePureMode = pureMode && !isPureCheckDisabled(root);
6120
6202
 
6121
6203
  Object.keys(icssImports).forEach((key) => {
6122
6204
  Object.keys(icssImports[key]).forEach((prop) => {
@@ -6136,10 +6218,15 @@ src$2.exports = (options = {}) => {
6136
6218
  let globalKeyframes = globalMode;
6137
6219
 
6138
6220
  if (globalMatch) {
6139
- if (pureMode) {
6140
- throw atRule.error(
6141
- "@keyframes :global(...) is not allowed in pure mode"
6142
- );
6221
+ if (enforcePureMode) {
6222
+ const ignoreComment = getIgnoreComment(atRule);
6223
+ if (!ignoreComment) {
6224
+ throw atRule.error(
6225
+ "@keyframes :global(...) is not allowed in pure mode"
6226
+ );
6227
+ } else {
6228
+ ignoreComment.remove();
6229
+ }
6143
6230
  }
6144
6231
  atRule.params = globalMatch[1];
6145
6232
  globalKeyframes = true;
@@ -6163,6 +6250,14 @@ src$2.exports = (options = {}) => {
6163
6250
  });
6164
6251
  } else if (/scope$/i.test(atRule.name)) {
6165
6252
  if (atRule.params) {
6253
+ const ignoreComment = pureMode
6254
+ ? getIgnoreComment(atRule)
6255
+ : undefined;
6256
+
6257
+ if (ignoreComment) {
6258
+ ignoreComment.remove();
6259
+ }
6260
+
6166
6261
  atRule.params = atRule.params
6167
6262
  .split("to")
6168
6263
  .map((item) => {
@@ -6176,7 +6271,11 @@ src$2.exports = (options = {}) => {
6176
6271
  context.options = options;
6177
6272
  context.localAliasMap = localAliasMap;
6178
6273
 
6179
- if (pureMode && context.hasPureGlobals) {
6274
+ if (
6275
+ enforcePureMode &&
6276
+ context.hasPureGlobals &&
6277
+ !ignoreComment
6278
+ ) {
6180
6279
  throw atRule.error(
6181
6280
  'Selector in at-rule"' +
6182
6281
  selector +
@@ -6227,13 +6326,28 @@ src$2.exports = (options = {}) => {
6227
6326
  context.options = options;
6228
6327
  context.localAliasMap = localAliasMap;
6229
6328
 
6230
- if (pureMode && context.hasPureGlobals) {
6329
+ const ignoreComment = enforcePureMode
6330
+ ? getIgnoreComment(rule)
6331
+ : undefined;
6332
+ const isNotPure = enforcePureMode && !isPureSelector(context, rule);
6333
+
6334
+ if (
6335
+ isNotPure &&
6336
+ isNodeWithoutDeclarations(rule) &&
6337
+ !ignoreComment
6338
+ ) {
6231
6339
  throw rule.error(
6232
6340
  'Selector "' +
6233
6341
  rule.selector +
6234
6342
  '" is not pure ' +
6235
6343
  "(pure selectors must contain at least one local class or id)"
6236
6344
  );
6345
+ } else if (ignoreComment) {
6346
+ ignoreComment.remove();
6347
+ }
6348
+
6349
+ if (pureMode) {
6350
+ rule[isPureSelectorSymbol] = !isNotPure;
6237
6351
  }
6238
6352
 
6239
6353
  rule.selector = context.selector;
@@ -6793,7 +6907,7 @@ var srcExports = src.exports;
6793
6907
  Object.defineProperty(scoping, "__esModule", {
6794
6908
  value: true
6795
6909
  });
6796
- scoping.behaviours = undefined;
6910
+ scoping.behaviours = void 0;
6797
6911
  scoping.getDefaultPlugins = getDefaultPlugins;
6798
6912
  scoping.getDefaultScopeBehaviour = getDefaultScopeBehaviour;
6799
6913
  scoping.getScopedNameGenerator = getScopedNameGenerator;