@swissquote/crafty-preset-lightningcss 1.22.0-alpha.2 → 1.22.0-alpha.3

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.
@@ -8423,7 +8423,6 @@ Warning.default = Warning
8423
8423
 
8424
8424
 
8425
8425
  const loader = __nccwpck_require__(9718);
8426
-
8427
8426
  module.exports = loader.default;
8428
8427
 
8429
8428
  /***/ }),
@@ -8438,34 +8437,24 @@ Object.defineProperty(exports, "__esModule", ({
8438
8437
  value: true
8439
8438
  }));
8440
8439
  exports["default"] = void 0;
8441
-
8442
8440
  var _path = _interopRequireDefault(__nccwpck_require__(1017));
8443
-
8444
8441
  var _utils = __nccwpck_require__(1911);
8445
-
8446
8442
  var _options = _interopRequireDefault(__nccwpck_require__(5814));
8447
-
8448
8443
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8449
-
8450
8444
  const loaderAPI = () => {};
8451
-
8452
8445
  loaderAPI.pitch = function loader(request) {
8453
8446
  const options = this.getOptions(_options.default);
8454
8447
  const injectType = options.injectType || "styleTag";
8455
8448
  const esModule = typeof options.esModule !== "undefined" ? options.esModule : true;
8456
8449
  const runtimeOptions = {};
8457
-
8458
8450
  if (options.attributes) {
8459
8451
  runtimeOptions.attributes = options.attributes;
8460
8452
  }
8461
-
8462
8453
  if (options.base) {
8463
8454
  runtimeOptions.base = options.base;
8464
8455
  }
8465
-
8466
8456
  const insertType = typeof options.insert === "function" ? "function" : options.insert && _path.default.isAbsolute(options.insert) ? "module-path" : "selector";
8467
8457
  const styleTagTransformType = typeof options.styleTagTransform === "function" ? "function" : options.styleTagTransform && _path.default.isAbsolute(options.styleTagTransform) ? "module-path" : "default";
8468
-
8469
8458
  switch (injectType) {
8470
8459
  case "linkTag":
8471
8460
  {
@@ -8486,7 +8475,6 @@ ${hmrCode}
8486
8475
 
8487
8476
  ${esModule ? "export default {}" : ""}`;
8488
8477
  }
8489
-
8490
8478
  case "lazyStyleTag":
8491
8479
  case "lazyAutoStyleTag":
8492
8480
  case "lazySingletonStyleTag":
@@ -8543,7 +8531,6 @@ ${hmrCode}
8543
8531
  ${(0, _utils.getExportLazyStyleCode)(esModule, this, request)}
8544
8532
  `;
8545
8533
  }
8546
-
8547
8534
  case "styleTag":
8548
8535
  case "autoStyleTag":
8549
8536
  case "singletonStyleTag":
@@ -8580,7 +8567,6 @@ ${(0, _utils.getExportStyleCode)(esModule, this, request)}
8580
8567
  }
8581
8568
  }
8582
8569
  };
8583
-
8584
8570
  var _default = loaderAPI;
8585
8571
  exports["default"] = _default;
8586
8572
 
@@ -8596,34 +8582,27 @@ function isEqualLocals(a, b, isNamedExport) {
8596
8582
  if (!a && b || a && !b) {
8597
8583
  return false;
8598
8584
  }
8599
-
8600
8585
  var p;
8601
-
8602
8586
  for (p in a) {
8603
8587
  if (isNamedExport && p === "default") {
8604
8588
  // eslint-disable-next-line no-continue
8605
8589
  continue;
8606
8590
  }
8607
-
8608
8591
  if (a[p] !== b[p]) {
8609
8592
  return false;
8610
8593
  }
8611
8594
  }
8612
-
8613
8595
  for (p in b) {
8614
8596
  if (isNamedExport && p === "default") {
8615
8597
  // eslint-disable-next-line no-continue
8616
8598
  continue;
8617
8599
  }
8618
-
8619
8600
  if (!a[p]) {
8620
8601
  return false;
8621
8602
  }
8622
8603
  }
8623
-
8624
8604
  return true;
8625
8605
  }
8626
-
8627
8606
  module.exports = isEqualLocals;
8628
8607
 
8629
8608
  /***/ }),
@@ -8655,29 +8634,22 @@ exports.getStyleTagTransformFn = getStyleTagTransformFn;
8655
8634
  exports.getStyleTagTransformFnCode = getStyleTagTransformFnCode;
8656
8635
  exports.getdomAPI = getdomAPI;
8657
8636
  exports.stringifyRequest = stringifyRequest;
8658
-
8659
8637
  var _path = _interopRequireDefault(__nccwpck_require__(1017));
8660
-
8661
8638
  var _isEqualLocals = _interopRequireDefault(__nccwpck_require__(7309));
8662
-
8663
8639
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8664
-
8665
8640
  const matchRelativePath = /^\.\.?[/\\]/;
8666
-
8667
8641
  function isAbsolutePath(str) {
8668
8642
  return _path.default.posix.isAbsolute(str) || _path.default.win32.isAbsolute(str);
8669
8643
  }
8670
-
8671
8644
  function isRelativePath(str) {
8672
8645
  return matchRelativePath.test(str);
8673
- } // TODO simplify for the next major release
8674
-
8646
+ }
8675
8647
 
8648
+ // TODO simplify for the next major release
8676
8649
  function stringifyRequest(loaderContext, request) {
8677
8650
  if (typeof loaderContext.utils !== "undefined" && typeof loaderContext.utils.contextify === "function") {
8678
8651
  return JSON.stringify(loaderContext.utils.contextify(loaderContext.context, request));
8679
8652
  }
8680
-
8681
8653
  const splitted = request.split("!");
8682
8654
  const {
8683
8655
  context
@@ -8687,75 +8659,60 @@ function stringifyRequest(loaderContext, request) {
8687
8659
  const splittedPart = part.match(/^(.*?)(\?.*)/);
8688
8660
  const query = splittedPart ? splittedPart[2] : "";
8689
8661
  let singlePath = splittedPart ? splittedPart[1] : part;
8690
-
8691
8662
  if (isAbsolutePath(singlePath) && context) {
8692
8663
  singlePath = _path.default.relative(context, singlePath);
8693
-
8694
8664
  if (isAbsolutePath(singlePath)) {
8695
8665
  // If singlePath still matches an absolute path, singlePath was on a different drive than context.
8696
8666
  // In this case, we leave the path platform-specific without replacing any separators.
8697
8667
  // @see https://github.com/webpack/loader-utils/pull/14
8698
8668
  return singlePath + query;
8699
8669
  }
8700
-
8701
8670
  if (isRelativePath(singlePath) === false) {
8702
8671
  // Ensure that the relative path starts at least with ./ otherwise it would be a request into the modules directory (like node_modules).
8703
8672
  singlePath = `./${singlePath}`;
8704
8673
  }
8705
8674
  }
8706
-
8707
8675
  return singlePath.replace(/\\/g, "/") + query;
8708
8676
  }).join("!"));
8709
8677
  }
8710
-
8711
8678
  function getImportLinkAPICode(esModule, loaderContext) {
8712
8679
  const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/injectStylesIntoLinkTag.js")}`);
8713
8680
  return esModule ? `import API from ${modulePath};` : `var API = require(${modulePath});`;
8714
8681
  }
8715
-
8716
8682
  function getImportLinkContentCode(esModule, loaderContext, request) {
8717
8683
  const modulePath = stringifyRequest(loaderContext, `!!${request}`);
8718
8684
  return esModule ? `import content from ${modulePath};` : `var content = require(${modulePath});`;
8719
8685
  }
8720
-
8721
8686
  function getImportStyleAPICode(esModule, loaderContext) {
8722
8687
  const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/injectStylesIntoStyleTag.js")}`);
8723
8688
  return esModule ? `import API from ${modulePath};` : `var API = require(${modulePath});`;
8724
8689
  }
8725
-
8726
8690
  function getImportStyleDomAPICode(esModule, loaderContext, isSingleton, isAuto) {
8727
8691
  const styleAPI = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/styleDomAPI.js")}`);
8728
8692
  const singletonAPI = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/singletonStyleDomAPI.js")}`);
8729
-
8730
8693
  if (isAuto) {
8731
8694
  return esModule ? `import domAPI from ${styleAPI};
8732
8695
  import domAPISingleton from ${singletonAPI};` : `var domAPI = require(${styleAPI});
8733
8696
  var domAPISingleton = require(${singletonAPI});`;
8734
8697
  }
8735
-
8736
8698
  return esModule ? `import domAPI from ${isSingleton ? singletonAPI : styleAPI};` : `var domAPI = require(${isSingleton ? singletonAPI : styleAPI});`;
8737
8699
  }
8738
-
8739
8700
  function getImportStyleContentCode(esModule, loaderContext, request) {
8740
8701
  const modulePath = stringifyRequest(loaderContext, `!!${request}`);
8741
8702
  return esModule ? `import content, * as namedExport from ${modulePath};` : `var content = require(${modulePath});`;
8742
8703
  }
8743
-
8744
8704
  function getImportInsertBySelectorCode(esModule, loaderContext, insertType, options) {
8745
8705
  if (insertType === "selector") {
8746
8706
  const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/insertBySelector.js")}`);
8747
8707
  return esModule ? `import insertFn from ${modulePath};` : `var insertFn = require(${modulePath});`;
8748
8708
  }
8749
-
8750
8709
  if (insertType === "module-path") {
8751
8710
  const modulePath = stringifyRequest(loaderContext, `${options.insert}`);
8752
8711
  loaderContext.addBuildDependency(options.insert);
8753
8712
  return esModule ? `import insertFn from ${modulePath};` : `var insertFn = require(${modulePath});`;
8754
8713
  }
8755
-
8756
8714
  return "";
8757
8715
  }
8758
-
8759
8716
  function getInsertOptionCode(insertType, options) {
8760
8717
  if (insertType === "selector") {
8761
8718
  const insert = options.insert ? JSON.stringify(options.insert) : '"head"';
@@ -8763,20 +8720,17 @@ function getInsertOptionCode(insertType, options) {
8763
8720
  options.insert = insertFn.bind(null, ${insert});
8764
8721
  `;
8765
8722
  }
8766
-
8767
8723
  if (insertType === "module-path") {
8768
8724
  return `options.insert = insertFn;`;
8769
- } // Todo remove "function" type for insert option in next major release, because code duplication occurs. Leave require.resolve()
8770
-
8725
+ }
8771
8726
 
8727
+ // Todo remove "function" type for insert option in next major release, because code duplication occurs. Leave require.resolve()
8772
8728
  return `options.insert = ${options.insert.toString()};`;
8773
8729
  }
8774
-
8775
8730
  function getImportInsertStyleElementCode(esModule, loaderContext) {
8776
8731
  const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/insertStyleElement.js")}`);
8777
8732
  return esModule ? `import insertStyleElement from ${modulePath};` : `var insertStyleElement = require(${modulePath});`;
8778
8733
  }
8779
-
8780
8734
  function getStyleHmrCode(esModule, loaderContext, request, lazy) {
8781
8735
  const modulePath = stringifyRequest(loaderContext, `!!${request}`);
8782
8736
  return `
@@ -8830,7 +8784,6 @@ if (module.hot) {
8830
8784
  }
8831
8785
  `;
8832
8786
  }
8833
-
8834
8787
  function getLinkHmrCode(esModule, loaderContext, request) {
8835
8788
  const modulePath = stringifyRequest(loaderContext, `!!${request}`);
8836
8789
  return `
@@ -8851,63 +8804,53 @@ if (module.hot) {
8851
8804
  });
8852
8805
  }`;
8853
8806
  }
8854
-
8855
8807
  function getdomAPI(isAuto) {
8856
8808
  return isAuto ? "isOldIE() ? domAPISingleton : domAPI" : "domAPI";
8857
8809
  }
8858
-
8859
8810
  function getImportIsOldIECode(esModule, loaderContext) {
8860
8811
  const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/isOldIE.js")}`);
8861
8812
  return esModule ? `import isOldIE from ${modulePath};` : `var isOldIE = require(${modulePath});`;
8862
8813
  }
8863
-
8864
8814
  function getStyleTagTransformFnCode(esModule, loaderContext, options, isSingleton, styleTagTransformType) {
8865
8815
  if (isSingleton) {
8866
8816
  return "";
8867
8817
  }
8868
-
8869
8818
  if (styleTagTransformType === "default") {
8870
8819
  const modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/styleTagTransform.js")}`);
8871
8820
  return esModule ? `import styleTagTransformFn from ${modulePath};` : `var styleTagTransformFn = require(${modulePath});`;
8872
8821
  }
8873
-
8874
8822
  if (styleTagTransformType === "module-path") {
8875
8823
  const modulePath = stringifyRequest(loaderContext, `${options.styleTagTransform}`);
8876
8824
  loaderContext.addBuildDependency(options.styleTagTransform);
8877
8825
  return esModule ? `import styleTagTransformFn from ${modulePath};` : `var styleTagTransformFn = require(${modulePath});`;
8878
8826
  }
8879
-
8880
8827
  return "";
8881
8828
  }
8882
-
8883
8829
  function getStyleTagTransformFn(options, isSingleton) {
8884
8830
  // Todo remove "function" type for styleTagTransform option in next major release, because code duplication occurs. Leave require.resolve()
8885
8831
  return isSingleton ? "" : typeof options.styleTagTransform === "function" ? `options.styleTagTransform = ${options.styleTagTransform.toString()}` : `options.styleTagTransform = styleTagTransformFn`;
8886
8832
  }
8887
-
8888
8833
  function getExportStyleCode(esModule, loaderContext, request) {
8889
8834
  const modulePath = stringifyRequest(loaderContext, `!!${request}`);
8890
8835
  return esModule ? `export * from ${modulePath};
8891
8836
  export default content && content.locals ? content.locals : undefined;` : "module.exports = content && content.locals || {};";
8892
8837
  }
8893
-
8894
8838
  function getExportLazyStyleCode(esModule, loaderContext, request) {
8895
8839
  const modulePath = stringifyRequest(loaderContext, `!!${request}`);
8896
8840
  return esModule ? `export * from ${modulePath};
8897
8841
  export default exported;` : "module.exports = exported;";
8898
8842
  }
8899
-
8900
8843
  function getSetAttributesCode(esModule, loaderContext, options) {
8901
8844
  let modulePath;
8902
-
8903
8845
  if (typeof options.attributes !== "undefined") {
8904
8846
  modulePath = options.attributes.nonce !== "undefined" ? stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/setAttributesWithAttributesAndNonce.js")}`) : stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/setAttributesWithAttributes.js")}`);
8905
8847
  } else {
8906
8848
  modulePath = stringifyRequest(loaderContext, `!${_path.default.join(__dirname, "runtime/setAttributesWithoutAttributes.js")}`);
8907
8849
  }
8908
-
8909
8850
  return esModule ? `import setAttributes from ${modulePath};` : `var setAttributes = require(${modulePath});`;
8910
- } // eslint-disable-next-line import/prefer-default-export
8851
+ }
8852
+
8853
+ // eslint-disable-next-line import/prefer-default-export
8911
8854
 
8912
8855
  /***/ }),
8913
8856
 
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  module.exports = function (url, options) {
4
+ if (typeof document === "undefined") {
5
+ return function () {};
6
+ }
4
7
  options = options || {};
5
8
  options.attributes = typeof options.attributes === "object" ? options.attributes : {};
6
-
7
9
  if (typeof options.attributes.nonce === "undefined") {
8
10
  var nonce = typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
9
-
10
11
  if (nonce) {
11
12
  options.attributes.nonce = nonce;
12
13
  }
13
14
  }
14
-
15
15
  var linkElement = document.createElement("link");
16
16
  linkElement.rel = "stylesheet";
17
17
  linkElement.href = url;
@@ -1,24 +1,19 @@
1
1
  "use strict";
2
2
 
3
3
  var stylesInDOM = [];
4
-
5
4
  function getIndexByIdentifier(identifier) {
6
5
  var result = -1;
7
-
8
6
  for (var i = 0; i < stylesInDOM.length; i++) {
9
7
  if (stylesInDOM[i].identifier === identifier) {
10
8
  result = i;
11
9
  break;
12
10
  }
13
11
  }
14
-
15
12
  return result;
16
13
  }
17
-
18
14
  function modulesToDom(list, options) {
19
15
  var idCountMap = {};
20
16
  var identifiers = [];
21
-
22
17
  for (var i = 0; i < list.length; i++) {
23
18
  var item = list[i];
24
19
  var id = options.base ? item[0] + options.base : item[0];
@@ -33,7 +28,6 @@ function modulesToDom(list, options) {
33
28
  supports: item[4],
34
29
  layer: item[5]
35
30
  };
36
-
37
31
  if (indexByIdentifier !== -1) {
38
32
  stylesInDOM[indexByIdentifier].references++;
39
33
  stylesInDOM[indexByIdentifier].updater(obj);
@@ -46,59 +40,45 @@ function modulesToDom(list, options) {
46
40
  references: 1
47
41
  });
48
42
  }
49
-
50
43
  identifiers.push(identifier);
51
44
  }
52
-
53
45
  return identifiers;
54
46
  }
55
-
56
47
  function addElementStyle(obj, options) {
57
48
  var api = options.domAPI(options);
58
49
  api.update(obj);
59
-
60
50
  var updater = function updater(newObj) {
61
51
  if (newObj) {
62
52
  if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
63
53
  return;
64
54
  }
65
-
66
55
  api.update(obj = newObj);
67
56
  } else {
68
57
  api.remove();
69
58
  }
70
59
  };
71
-
72
60
  return updater;
73
61
  }
74
-
75
62
  module.exports = function (list, options) {
76
63
  options = options || {};
77
64
  list = list || [];
78
65
  var lastIdentifiers = modulesToDom(list, options);
79
66
  return function update(newList) {
80
67
  newList = newList || [];
81
-
82
68
  for (var i = 0; i < lastIdentifiers.length; i++) {
83
69
  var identifier = lastIdentifiers[i];
84
70
  var index = getIndexByIdentifier(identifier);
85
71
  stylesInDOM[index].references--;
86
72
  }
87
-
88
73
  var newLastIdentifiers = modulesToDom(newList, options);
89
-
90
74
  for (var _i = 0; _i < lastIdentifiers.length; _i++) {
91
75
  var _identifier = lastIdentifiers[_i];
92
-
93
76
  var _index = getIndexByIdentifier(_identifier);
94
-
95
77
  if (stylesInDOM[_index].references === 0) {
96
78
  stylesInDOM[_index].updater();
97
-
98
79
  stylesInDOM.splice(_index, 1);
99
80
  }
100
81
  }
101
-
102
82
  lastIdentifiers = newLastIdentifiers;
103
83
  };
104
84
  };
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
 
3
3
  var memo = {};
4
- /* istanbul ignore next */
5
4
 
5
+ /* istanbul ignore next */
6
6
  function getTarget(target) {
7
7
  if (typeof memo[target] === "undefined") {
8
- var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself
8
+ var styleTarget = document.querySelector(target);
9
9
 
10
+ // Special case to return head of iframe instead of iframe itself
10
11
  if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
11
12
  try {
12
13
  // This will throw an exception if access to iframe is blocked
@@ -17,23 +18,17 @@ function getTarget(target) {
17
18
  styleTarget = null;
18
19
  }
19
20
  }
20
-
21
21
  memo[target] = styleTarget;
22
22
  }
23
-
24
23
  return memo[target];
25
24
  }
26
- /* istanbul ignore next */
27
-
28
25
 
26
+ /* istanbul ignore next */
29
27
  function insertBySelector(insert, style) {
30
28
  var target = getTarget(insert);
31
-
32
29
  if (!target) {
33
30
  throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
34
31
  }
35
-
36
32
  target.appendChild(style);
37
33
  }
38
-
39
34
  module.exports = insertBySelector;
@@ -7,5 +7,4 @@ function insertStyleElement(options) {
7
7
  options.insert(element, options.options);
8
8
  return element;
9
9
  }
10
-
11
10
  module.exports = insertStyleElement;
@@ -4,32 +4,25 @@ function isEqualLocals(a, b, isNamedExport) {
4
4
  if (!a && b || a && !b) {
5
5
  return false;
6
6
  }
7
-
8
7
  var p;
9
-
10
8
  for (p in a) {
11
9
  if (isNamedExport && p === "default") {
12
10
  // eslint-disable-next-line no-continue
13
11
  continue;
14
12
  }
15
-
16
13
  if (a[p] !== b[p]) {
17
14
  return false;
18
15
  }
19
16
  }
20
-
21
17
  for (p in b) {
22
18
  if (isNamedExport && p === "default") {
23
19
  // eslint-disable-next-line no-continue
24
20
  continue;
25
21
  }
26
-
27
22
  if (!a[p]) {
28
23
  return false;
29
24
  }
30
25
  }
31
-
32
26
  return true;
33
27
  }
34
-
35
28
  module.exports = isEqualLocals;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  var memo;
4
- /* istanbul ignore next */
5
4
 
5
+ /* istanbul ignore next */
6
6
  function isOldIE() {
7
7
  if (typeof memo === "undefined") {
8
8
  // Test for IE <= 9 as proposed by Browserhacks
@@ -10,10 +10,8 @@ function isOldIE() {
10
10
  // Tests for existence of standard globals is to allow style-loader
11
11
  // to operate correctly into non-standard environments
12
12
  // @see https://github.com/webpack-contrib/style-loader/issues/177
13
- memo = Boolean(window && document && document.all && !window.atob);
13
+ memo = Boolean(typeof window !== "undefined" && typeof document !== "undefined" && document.all && !window.atob);
14
14
  }
15
-
16
15
  return memo;
17
16
  }
18
-
19
17
  module.exports = isOldIE;
@@ -3,14 +3,11 @@
3
3
  /* istanbul ignore next */
4
4
  function setAttributesWithoutAttributes(styleElement, attributes) {
5
5
  var nonce = typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
6
-
7
6
  if (nonce) {
8
7
  attributes.nonce = nonce;
9
8
  }
10
-
11
9
  Object.keys(attributes).forEach(function (key) {
12
10
  styleElement.setAttribute(key, attributes[key]);
13
11
  });
14
12
  }
15
-
16
13
  module.exports = setAttributesWithoutAttributes;
@@ -6,5 +6,4 @@ function setAttributesWithoutAttributes(styleElement, attributes) {
6
6
  styleElement.setAttribute(key, attributes[key]);
7
7
  });
8
8
  }
9
-
10
9
  module.exports = setAttributesWithoutAttributes;
@@ -3,10 +3,8 @@
3
3
  /* istanbul ignore next */
4
4
  function setAttributesWithoutAttributes(styleElement) {
5
5
  var nonce = typeof __webpack_nonce__ !== "undefined" ? __webpack_nonce__ : null;
6
-
7
6
  if (nonce) {
8
7
  styleElement.setAttribute("nonce", nonce);
9
8
  }
10
9
  }
11
-
12
10
  module.exports = setAttributesWithoutAttributes;
@@ -8,59 +8,46 @@ var replaceText = function replaceText() {
8
8
  return textStore.filter(Boolean).join("\n");
9
9
  };
10
10
  }();
11
- /* istanbul ignore next */
12
-
13
11
 
12
+ /* istanbul ignore next */
14
13
  function apply(styleElement, index, remove, obj) {
15
14
  var css;
16
-
17
15
  if (remove) {
18
16
  css = "";
19
17
  } else {
20
18
  css = "";
21
-
22
19
  if (obj.supports) {
23
20
  css += "@supports (".concat(obj.supports, ") {");
24
21
  }
25
-
26
22
  if (obj.media) {
27
23
  css += "@media ".concat(obj.media, " {");
28
24
  }
29
-
30
25
  var needLayer = typeof obj.layer !== "undefined";
31
-
32
26
  if (needLayer) {
33
27
  css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
34
28
  }
35
-
36
29
  css += obj.css;
37
-
38
30
  if (needLayer) {
39
31
  css += "}";
40
32
  }
41
-
42
33
  if (obj.media) {
43
34
  css += "}";
44
35
  }
45
-
46
36
  if (obj.supports) {
47
37
  css += "}";
48
38
  }
49
- } // For old IE
39
+ }
50
40
 
41
+ // For old IE
51
42
  /* istanbul ignore if */
52
-
53
-
54
43
  if (styleElement.styleSheet) {
55
44
  styleElement.styleSheet.cssText = replaceText(index, css);
56
45
  } else {
57
46
  var cssNode = document.createTextNode(css);
58
47
  var childNodes = styleElement.childNodes;
59
-
60
48
  if (childNodes[index]) {
61
49
  styleElement.removeChild(childNodes[index]);
62
50
  }
63
-
64
51
  if (childNodes.length) {
65
52
  styleElement.insertBefore(cssNode, childNodes[index]);
66
53
  } else {
@@ -68,18 +55,24 @@ function apply(styleElement, index, remove, obj) {
68
55
  }
69
56
  }
70
57
  }
71
-
72
58
  var singletonData = {
73
59
  singleton: null,
74
60
  singletonCounter: 0
75
61
  };
76
- /* istanbul ignore next */
77
62
 
63
+ /* istanbul ignore next */
78
64
  function domAPI(options) {
65
+ if (typeof document === "undefined") return {
66
+ update: function update() {},
67
+ remove: function remove() {}
68
+ };
69
+
79
70
  // eslint-disable-next-line no-undef,no-use-before-define
80
71
  var styleIndex = singletonData.singletonCounter++;
81
- var styleElement = // eslint-disable-next-line no-undef,no-use-before-define
82
- singletonData.singleton || ( // eslint-disable-next-line no-undef,no-use-before-define
72
+ var styleElement =
73
+ // eslint-disable-next-line no-undef,no-use-before-define
74
+ singletonData.singleton || (
75
+ // eslint-disable-next-line no-undef,no-use-before-define
83
76
  singletonData.singleton = options.insertStyleElement(options));
84
77
  return {
85
78
  update: function update(obj) {
@@ -90,5 +83,4 @@ function domAPI(options) {
90
83
  }
91
84
  };
92
85
  }
93
-
94
86
  module.exports = domAPI;