Socket
Socket
Sign inDemoInstall

jss

Package Overview
Dependencies
Maintainers
1
Versions
186
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jss - npm Package Compare versions

Comparing version 10.0.0-alpha.9 to 10.0.0-alpha.10

144

dist/jss.bundle.js

@@ -41,78 +41,11 @@ function _extends() {

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
function symbolObservablePonyfill(root) {
var result;
var Symbol = root.Symbol;
if (typeof Symbol === 'function') {
if (Symbol.observable) {
result = Symbol.observable;
} else {
result = Symbol('observable');
Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
}
var root;
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof global$1 !== 'undefined') {
root = global$1;
} else if (typeof module !== 'undefined') {
root = module;
} else {
root = Function('return this')();
}
var result = symbolObservablePonyfill(root);
var isArray = Array.isArray; // TODO: This should propably not be here, need to find a better place
var isObservable = function isObservable(value) {
return value && value[result] && value === value[result]();
};
var plainObjectConstrurctor = {}.constructor;
function cloneStyle(style) {
// Support empty values in case user ends up with them by accident.
if (style == null) return style; // Support string value for SimpleRule.
var typeOfStyle = typeof style;
if (typeOfStyle === 'string' || typeOfStyle === 'number' || typeOfStyle === 'function') {
return style;
} // It is a CSSTOM value.
// TODO will not work if instance comes from a different window.
if (global$1.CSSStyleValue && style instanceof global$1.CSSStyleValue) {
return style;
} // Support array for FontFaceRule.
if (isArray(style)) return style.map(cloneStyle); // Support Observable styles. Observables are immutable, so we don't need to
// copy them.
if (isObservable(style)) return style;
if (style == null || typeof style !== 'object') return style;
if (Array.isArray(style)) return style.map(cloneStyle);
if (style.constructor !== plainObjectConstrurctor) return style;
var newStyle = {};
for (var name in style) {
var value = style[name];
if (typeof value === 'object') {
newStyle[name] = cloneStyle(value);
continue;
}
newStyle[name] = value;
newStyle[name] = cloneStyle(style[name]);
}

@@ -1481,2 +1414,6 @@

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
var ns = '2f1acc6c3a606b082e5eef5e54414ffb';

@@ -2006,3 +1943,3 @@ if (global$1[ns] == null) global$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify

this.id = instanceCounter++;
this.version = "10.0.0-alpha.9";
this.version = "10.0.0-alpha.10";
this.plugins = new PluginsRegistry();

@@ -2179,5 +2116,4 @@ this.options = {

function SheetsManager() {
this.sheets = [];
this.refs = [];
this.keys = [];
this.length = 0;
this.sheets = new WeakMap();
}

@@ -2188,40 +2124,42 @@

_proto.get = function get(key) {
var index = this.keys.indexOf(key);
return this.sheets[index];
var entry = this.sheets.get(key);
return entry && entry.sheet;
};
_proto.add = function add(key, sheet) {
var sheets = this.sheets,
refs = this.refs,
keys = this.keys;
var index = sheets.indexOf(sheet);
if (index !== -1) return index;
sheets.push(sheet);
refs.push(0);
keys.push(key);
return sheets.length - 1;
if (this.sheets.has(key)) return;
this.length++;
this.sheets.set(key, {
sheet: sheet,
refs: 0
});
};
_proto.manage = function manage(key) {
var index = this.keys.indexOf(key);
var sheet = this.sheets[index];
if (this.refs[index] === 0) sheet.attach();
this.refs[index]++;
if (!this.keys[index]) this.keys.splice(index, 0, key);
return sheet;
var entry = this.sheets.get(key);
if (entry) {
if (entry.refs === 0) {
entry.sheet.attach();
}
entry.refs++;
return entry.sheet;
}
warning(false, "[JSS] SheetsManager: can't find sheet to manage");
return undefined;
};
_proto.unmanage = function unmanage(key) {
var index = this.keys.indexOf(key);
var entry = this.sheets.get(key);
if (index === -1) {
// eslint-ignore-next-line no-console
if (entry) {
if (entry.refs > 0) {
entry.refs--;
if (entry.refs === 0) entry.sheet.detach();
}
} else {
warning(false, "SheetsManager: can't find sheet to unmanage");
return;
}
if (this.refs[index] > 0) {
this.refs[index]--;
if (this.refs[index] === 0) this.sheets[index].detach();
}
};

@@ -2232,3 +2170,3 @@

get: function get() {
return this.keys.length;
return this.length;
}

@@ -2235,0 +2173,0 @@ }]);

@@ -7,3 +7,2 @@ 'use strict';

var $$observable = _interopDefault(require('symbol-observable'));
var warning = _interopDefault(require('tiny-warning'));

@@ -16,44 +15,11 @@ var _extends = _interopDefault(require('@babel/runtime/helpers/extends'));

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
var isArray = Array.isArray; // TODO: This should propably not be here, need to find a better place
var isObservable = function isObservable(value) {
return value && value[$$observable] && value === value[$$observable]();
};
var plainObjectConstrurctor = {}.constructor;
function cloneStyle(style) {
// Support empty values in case user ends up with them by accident.
if (style == null) return style; // Support string value for SimpleRule.
var typeOfStyle = typeof style;
if (typeOfStyle === 'string' || typeOfStyle === 'number' || typeOfStyle === 'function') {
return style;
} // It is a CSSTOM value.
// TODO will not work if instance comes from a different window.
if (global$1.CSSStyleValue && style instanceof global$1.CSSStyleValue) {
return style;
} // Support array for FontFaceRule.
if (isArray(style)) return style.map(cloneStyle); // Support Observable styles. Observables are immutable, so we don't need to
// copy them.
if (isObservable(style)) return style;
if (style == null || typeof style !== 'object') return style;
if (Array.isArray(style)) return style.map(cloneStyle);
if (style.constructor !== plainObjectConstrurctor) return style;
var newStyle = {};
for (var name in style) {
var value = style[name];
if (typeof value === 'object') {
newStyle[name] = cloneStyle(value);
continue;
}
newStyle[name] = value;
newStyle[name] = cloneStyle(style[name]);
}

@@ -1395,2 +1361,6 @@

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
var ns = '2f1acc6c3a606b082e5eef5e54414ffb';

@@ -1925,3 +1895,3 @@ if (global$1[ns] == null) global$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify

this.id = instanceCounter++;
this.version = "10.0.0-alpha.9";
this.version = "10.0.0-alpha.10";
this.plugins = new PluginsRegistry();

@@ -2098,5 +2068,4 @@ this.options = {

function SheetsManager() {
this.sheets = [];
this.refs = [];
this.keys = [];
this.length = 0;
this.sheets = new WeakMap();
}

@@ -2107,40 +2076,42 @@

_proto.get = function get(key) {
var index = this.keys.indexOf(key);
return this.sheets[index];
var entry = this.sheets.get(key);
return entry && entry.sheet;
};
_proto.add = function add(key, sheet) {
var sheets = this.sheets,
refs = this.refs,
keys = this.keys;
var index = sheets.indexOf(sheet);
if (index !== -1) return index;
sheets.push(sheet);
refs.push(0);
keys.push(key);
return sheets.length - 1;
if (this.sheets.has(key)) return;
this.length++;
this.sheets.set(key, {
sheet: sheet,
refs: 0
});
};
_proto.manage = function manage(key) {
var index = this.keys.indexOf(key);
var sheet = this.sheets[index];
if (this.refs[index] === 0) sheet.attach();
this.refs[index]++;
if (!this.keys[index]) this.keys.splice(index, 0, key);
return sheet;
var entry = this.sheets.get(key);
if (entry) {
if (entry.refs === 0) {
entry.sheet.attach();
}
entry.refs++;
return entry.sheet;
}
warning(false, "[JSS] SheetsManager: can't find sheet to manage");
return undefined;
};
_proto.unmanage = function unmanage(key) {
var index = this.keys.indexOf(key);
var entry = this.sheets.get(key);
if (index === -1) {
// eslint-ignore-next-line no-console
if (entry) {
if (entry.refs > 0) {
entry.refs--;
if (entry.refs === 0) entry.sheet.detach();
}
} else {
warning(false, "SheetsManager: can't find sheet to unmanage");
return;
}
if (this.refs[index] > 0) {
this.refs[index]--;
if (this.refs[index] === 0) this.sheets[index].detach();
}
};

@@ -2151,3 +2122,3 @@

get: function get() {
return this.keys.length;
return this.length;
}

@@ -2154,0 +2125,0 @@ }]);

@@ -1,2 +0,1 @@

import $$observable from 'symbol-observable';
import warning from 'tiny-warning';

@@ -9,44 +8,11 @@ import _extends from '@babel/runtime/helpers/esm/extends';

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
var isArray = Array.isArray; // TODO: This should propably not be here, need to find a better place
var isObservable = function isObservable(value) {
return value && value[$$observable] && value === value[$$observable]();
};
var plainObjectConstrurctor = {}.constructor;
function cloneStyle(style) {
// Support empty values in case user ends up with them by accident.
if (style == null) return style; // Support string value for SimpleRule.
var typeOfStyle = typeof style;
if (typeOfStyle === 'string' || typeOfStyle === 'number' || typeOfStyle === 'function') {
return style;
} // It is a CSSTOM value.
// TODO will not work if instance comes from a different window.
if (global$1.CSSStyleValue && style instanceof global$1.CSSStyleValue) {
return style;
} // Support array for FontFaceRule.
if (isArray(style)) return style.map(cloneStyle); // Support Observable styles. Observables are immutable, so we don't need to
// copy them.
if (isObservable(style)) return style;
if (style == null || typeof style !== 'object') return style;
if (Array.isArray(style)) return style.map(cloneStyle);
if (style.constructor !== plainObjectConstrurctor) return style;
var newStyle = {};
for (var name in style) {
var value = style[name];
if (typeof value === 'object') {
newStyle[name] = cloneStyle(value);
continue;
}
newStyle[name] = value;
newStyle[name] = cloneStyle(style[name]);
}

@@ -1388,2 +1354,6 @@

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
var ns = '2f1acc6c3a606b082e5eef5e54414ffb';

@@ -1918,3 +1888,3 @@ if (global$1[ns] == null) global$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify

this.id = instanceCounter++;
this.version = "10.0.0-alpha.9";
this.version = "10.0.0-alpha.10";
this.plugins = new PluginsRegistry();

@@ -2091,5 +2061,4 @@ this.options = {

function SheetsManager() {
this.sheets = [];
this.refs = [];
this.keys = [];
this.length = 0;
this.sheets = new WeakMap();
}

@@ -2100,40 +2069,42 @@

_proto.get = function get(key) {
var index = this.keys.indexOf(key);
return this.sheets[index];
var entry = this.sheets.get(key);
return entry && entry.sheet;
};
_proto.add = function add(key, sheet) {
var sheets = this.sheets,
refs = this.refs,
keys = this.keys;
var index = sheets.indexOf(sheet);
if (index !== -1) return index;
sheets.push(sheet);
refs.push(0);
keys.push(key);
return sheets.length - 1;
if (this.sheets.has(key)) return;
this.length++;
this.sheets.set(key, {
sheet: sheet,
refs: 0
});
};
_proto.manage = function manage(key) {
var index = this.keys.indexOf(key);
var sheet = this.sheets[index];
if (this.refs[index] === 0) sheet.attach();
this.refs[index]++;
if (!this.keys[index]) this.keys.splice(index, 0, key);
return sheet;
var entry = this.sheets.get(key);
if (entry) {
if (entry.refs === 0) {
entry.sheet.attach();
}
entry.refs++;
return entry.sheet;
}
warning(false, "[JSS] SheetsManager: can't find sheet to manage");
return undefined;
};
_proto.unmanage = function unmanage(key) {
var index = this.keys.indexOf(key);
var entry = this.sheets.get(key);
if (index === -1) {
// eslint-ignore-next-line no-console
if (entry) {
if (entry.refs > 0) {
entry.refs--;
if (entry.refs === 0) entry.sheet.detach();
}
} else {
warning(false, "SheetsManager: can't find sheet to unmanage");
return;
}
if (this.refs[index] > 0) {
this.refs[index]--;
if (this.refs[index] === 0) this.sheets[index].detach();
}
};

@@ -2144,3 +2115,3 @@

get: function get() {
return this.keys.length;
return this.length;
}

@@ -2147,0 +2118,0 @@ }]);

@@ -47,78 +47,11 @@ (function (global, factory) {

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
function symbolObservablePonyfill(root) {
var result;
var Symbol = root.Symbol;
if (typeof Symbol === 'function') {
if (Symbol.observable) {
result = Symbol.observable;
} else {
result = Symbol('observable');
Symbol.observable = result;
}
} else {
result = '@@observable';
}
return result;
}
var root;
if (typeof self !== 'undefined') {
root = self;
} else if (typeof window !== 'undefined') {
root = window;
} else if (typeof global$1 !== 'undefined') {
root = global$1;
} else if (typeof module !== 'undefined') {
root = module;
} else {
root = Function('return this')();
}
var result = symbolObservablePonyfill(root);
var isArray = Array.isArray; // TODO: This should propably not be here, need to find a better place
var isObservable = function isObservable(value) {
return value && value[result] && value === value[result]();
};
var plainObjectConstrurctor = {}.constructor;
function cloneStyle(style) {
// Support empty values in case user ends up with them by accident.
if (style == null) return style; // Support string value for SimpleRule.
var typeOfStyle = typeof style;
if (typeOfStyle === 'string' || typeOfStyle === 'number' || typeOfStyle === 'function') {
return style;
} // It is a CSSTOM value.
// TODO will not work if instance comes from a different window.
if (global$1.CSSStyleValue && style instanceof global$1.CSSStyleValue) {
return style;
} // Support array for FontFaceRule.
if (isArray(style)) return style.map(cloneStyle); // Support Observable styles. Observables are immutable, so we don't need to
// copy them.
if (isObservable(style)) return style;
if (style == null || typeof style !== 'object') return style;
if (Array.isArray(style)) return style.map(cloneStyle);
if (style.constructor !== plainObjectConstrurctor) return style;
var newStyle = {};
for (var name in style) {
var value = style[name];
if (typeof value === 'object') {
newStyle[name] = cloneStyle(value);
continue;
}
newStyle[name] = value;
newStyle[name] = cloneStyle(style[name]);
}

@@ -1487,2 +1420,6 @@

var global$1 = (typeof global !== "undefined" ? global :
typeof self !== "undefined" ? self :
typeof window !== "undefined" ? window : {});
var ns = '2f1acc6c3a606b082e5eef5e54414ffb';

@@ -2012,3 +1949,3 @@ if (global$1[ns] == null) global$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify

this.id = instanceCounter++;
this.version = "10.0.0-alpha.9";
this.version = "10.0.0-alpha.10";
this.plugins = new PluginsRegistry();

@@ -2185,5 +2122,4 @@ this.options = {

function SheetsManager() {
this.sheets = [];
this.refs = [];
this.keys = [];
this.length = 0;
this.sheets = new WeakMap();
}

@@ -2194,40 +2130,42 @@

_proto.get = function get(key) {
var index = this.keys.indexOf(key);
return this.sheets[index];
var entry = this.sheets.get(key);
return entry && entry.sheet;
};
_proto.add = function add(key, sheet) {
var sheets = this.sheets,
refs = this.refs,
keys = this.keys;
var index = sheets.indexOf(sheet);
if (index !== -1) return index;
sheets.push(sheet);
refs.push(0);
keys.push(key);
return sheets.length - 1;
if (this.sheets.has(key)) return;
this.length++;
this.sheets.set(key, {
sheet: sheet,
refs: 0
});
};
_proto.manage = function manage(key) {
var index = this.keys.indexOf(key);
var sheet = this.sheets[index];
if (this.refs[index] === 0) sheet.attach();
this.refs[index]++;
if (!this.keys[index]) this.keys.splice(index, 0, key);
return sheet;
var entry = this.sheets.get(key);
if (entry) {
if (entry.refs === 0) {
entry.sheet.attach();
}
entry.refs++;
return entry.sheet;
}
warning(false, "[JSS] SheetsManager: can't find sheet to manage");
return undefined;
};
_proto.unmanage = function unmanage(key) {
var index = this.keys.indexOf(key);
var entry = this.sheets.get(key);
if (index === -1) {
// eslint-ignore-next-line no-console
if (entry) {
if (entry.refs > 0) {
entry.refs--;
if (entry.refs === 0) entry.sheet.detach();
}
} else {
warning(false, "SheetsManager: can't find sheet to unmanage");
return;
}
if (this.refs[index] > 0) {
this.refs[index]--;
if (this.refs[index] === 0) this.sheets[index].detach();
}
};

@@ -2238,3 +2176,3 @@

get: function get() {
return this.keys.length;
return this.length;
}

@@ -2241,0 +2179,0 @@ }]);

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.jss={})}(this,function(e){"use strict";function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var t,n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r="object"===("undefined"==typeof window?"undefined":n(window))&&"object"===("undefined"==typeof document?"undefined":n(document))&&9===document.nodeType,s="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};t="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==s?s:"undefined"!=typeof module?module:Function("return this")();var i,o,u=("function"==typeof(o=t.Symbol)?o.observable?i=o.observable:(i=o("observable"),o.observable=i):i="@@observable",i),a=Array.isArray,h=function(e){return e&&e[u]&&e===e[u]()};function l(e){if(null==e)return e;var t=typeof e;if("string"===t||"number"===t||"function"===t)return e;if(s.CSSStyleValue&&e instanceof s.CSSStyleValue)return e;if(a(e))return e.map(l);if(h(e))return e;var n={};for(var r in e){var i=e[r];"object"!=typeof i?n[r]=i:n[r]=l(i)}return n}function p(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=l(t),s=r.plugins.onCreateRule(e,i,n);return s||(e[0],null)}function d(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),e}function y(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function v(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var g=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n};function m(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=", "),n+=g(e[r]," ");else n=g(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n}function b(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function R(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var i=n.indent,s=void 0===i?0:i,o=t.fallbacks;if(e&&s++,o)if(Array.isArray(o))for(var u=0;u<o.length;u++){var a=o[u];for(var h in a){var l=a[h];null!=l&&(r&&(r+="\n"),r+=""+b(h+": "+m(l)+";",s))}}else for(var d in o){var f=o[d];null!=f&&(r&&(r+="\n"),r+=""+b(d+": "+m(f)+";",s))}for(var c in t){var p=t[c];null!=p&&"fallbacks"!==c&&(r&&(r+="\n"),r+=""+b(c+": "+m(p)+";",s))}return(r||n.allowEmpty)&&e?(r&&(r="\n"+r+"\n"),b(e+" {"+r,--s)+b("}",s)):r}var S=function(e){return e},k=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,this.renderer=r?r.renderer:new i}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];if(!(!!n&&n.force)&&this.style[e]===t)return this;var r=t;n&&!1===n.process||(r=this.options.jss.plugins.onChangeValue(t,e,this));var i=null==r||!1===r,s=e in this.style;if(i&&!s)return this;var o=i&&s;if(o?delete this.style[e]:this.style[e]=r,this.renderable)return o?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,r),this;var u=this.options.sheet;return u&&u.attached,this},e}(),x=function(a){function e(e,t,n){var r;(r=a.call(this,e,t,n)||this).selectorText=void 0,r.id=void 0,r.renderable=void 0;var i=n.selector,s=n.scoped,o=n.sheet,u=n.generateId;return i?r.selectorText=i:!1!==s&&(r.id=u(v(v(r)),o),r.selectorText="."+S(r.id)),r}y(e,a);var t=e.prototype;return t.applyTo=function(e){var t=this.toJSON();for(var n in t)this.renderer.setProperty(e,n,t[n]);return this},t.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=m(n))}return e},t.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?c({},e,{allowEmpty:!0}):e;return R(this.selectorText,this.style,n)},f(e,[{key:"selector",set:function(e){e!==this.selectorText&&(this.selectorText=e,this.renderable&&(this.renderer.setSelector(this.renderable,e)||this.renderer.replaceRule(this.renderable,this)))},get:function(){return this.selectorText}}]),e}(k),P={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new x(e,t,n)}},w={indent:1,children:!0},C=/@([\w-]+)/,j=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var r=(this.key=e).match(C);for(var i in this.at=r?r[1]:"unknown",this.options=n,this.rules=new K(c({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=w),!1===e.children)return this.key+" {}";var t=this.rules.toString(e);return t?this.key+" {\n"+t+"\n}":""},e}(),O=/@media|@supports\s+/,A={onCreateRule:function(e,t,n){return O.test(e)?new j(e,t,n):null}},I={indent:1,children:!0},T=/@keyframes\s+([\w-]+)/,V=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var r=e.match(T);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name;var i=(this.options=n).scoped,s=n.sheet,o=n.generateId;for(var u in this.id=!1===i?this.name:o(this,s),this.rules=new K(c({},n,{parent:this})),t)this.rules.add(u,t[u],c({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=I),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),q=/@keyframes\s+/,N=/\$([\w-]+)/,E=function(e,t,n){var r=e[t];if("string"==typeof r){var i=N.exec(r);if(!i)return;i[1]in n&&(e[t]=r.replace(i[0],n[i[1]]))}},M={onCreateRule:function(e,t,n){return q.test(e)?new V(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n&&("animation-name"in e&&E(e,"animation-name",n.keyframes),"animation"in e&&E(e,"animation",n.keyframes)),e}},U=function(i){function e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=i.call.apply(i,[this].concat(n))||this).renderable=void 0,e}return y(e,i),e.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?c({},e,{allowEmpty:!0}):e;return R(this.key,this.style,n)},e}(k),G={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new U(e,t,n):null}},_=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.style)){for(var t="",n=0;n<this.style.length;n++)t+=R(this.key,this.style[n]),this.style[n+1]&&(t+="\n");return t}return R(this.key,this.style,e)},e}(),B={onCreateRule:function(e,t,n){return"@font-face"===e?new _(e,t,n):null}},J=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return R(this.key,this.style,e)},e}(),z={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-viewport"===e?new J(e,t,n):null}},D=function(){function e(e,t,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.value=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),F={"@charset":!0,"@import":!0,"@namespace":!0},L=[P,A,M,G,B,z,{onCreateRule:function(e,t,n){return e in F?new D(e,t,n):null}}],$={process:!0},H={force:!0,process:!0},K=function(){function l(e){this.map={},this.raw={},this.index=[],this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var e=l.prototype;return e.add=function(e,t,n){var r=this.options,i=r.parent,s=r.sheet,o=r.jss,u=r.Renderer,a=r.generateId,h=r.scoped,l=c({classes:this.classes,parent:i,sheet:s,jss:o,Renderer:u,generateId:a,scoped:h},n);this.raw[e]=t,e in this.classes&&(l.selector="."+S(this.classes[e]));var d=p(e,t,l);if(!d)return null;this.register(d);var f=void 0===l.index?this.index.length:l.index;return this.index.splice(f,0,d),d},e.get=function(e){return this.map[e]},e.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.indexOf(e),1)},e.indexOf=function(e){return this.index.indexOf(e)},e.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},e.register=function(e){(this.map[e.key]=e)instanceof x?(this.map[e.selector]=e).id&&(this.classes[e.key]=e.id):e instanceof V&&this.keyframes&&(this.keyframes[e.name]=e.id)},e.unregister=function(e){delete this.map[e.key],e instanceof x?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof V&&delete this.keyframes[e.name]},e.update=function(){var e,t,n;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.onUpdate(t,this.get(e),n);else for(var r=0;r<this.index.length;r++)this.onUpdate(t,this.index[r],n)},e.onUpdate=function(e,t,n){void 0===n&&(n=$);var r=this.options,i=r.jss.plugins,s=r.sheet;if(t.rules instanceof l)t.rules.update(e,n);else{var o=t,u=o.style;if(i.onUpdate(e,t,s,n),n.process&&u&&u!==o.style)for(var a in i.onProcessStyle(o.style,o,s),o.style){var h=o.style[a];h!==u[a]&&o.prop(a,h,H)}}},e.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,i=0;i<this.index.length;i++){var s=this.index[i].toString(e);(s||r)&&(t&&(t+="\n"),t+=s)}return t},l}(),Q=function(){function e(e,t){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=c({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),this.renderer=new t.Renderer(this),this.rules=new K(this.options),e)this.rules.add(n,e[n]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached&&(this.renderer.detach(),this.attached=!1),this},t.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var i=this.rules.add(e,t,n);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed&&(r?r.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0))):this.deployed=!1,i):null},t.insertRule=function(e){this.renderer.insertRule(e)},t.addRules=function(e,t){var n=[];for(var r in e){var i=this.addRule(r,e[r],t);i&&n.push(i)}return n},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t=this.rules.get(e);return!!t&&(this.rules.remove(t),!this.attached||!t.renderable||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.toString=function(e){return this.rules.toString(e)},e}(),W=function(){function e(){this.plugins={internal:[],external:[]},this.registry=void 0}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var i=this.registry.onCreateRule[r](e,t,n);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,i=0;i<this.registry.onChangeValue.length;i++)r=this.registry.onChangeValue[i](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=this.plugins.external.concat(this.plugins.internal).reduce(function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),X=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(t){return this.registry.filter(function(e){return e.attached}).map(function(e){return e.toString(t)}).join("\n")},f(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),Y=new X,Z="2f1acc6c3a606b082e5eef5e54414ffb";null==s[Z]&&(s[Z]=0);var ee=s[Z]++,te=function(){var i=0;return function(e,t){i+=1;var n="c",r="";return t&&(n=t.options.classNamePrefix||"c",null!=t.options.jss.id&&(r+=t.options.jss.id)),""+n+ee+r+i}},ne=function(e){var t;return function(){return t||(t=e()),t}};function re(e,t){try{return"attributeStyleMap"in e?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(e){return""}}function ie(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=m(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;"attributeStyleMap"in e?e.attributeStyleMap.set(t,r):e.style.setProperty(t,r)}catch(e){return!1}return!0}function se(e,t){try{"attributeStyleMap"in e?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(e){}}function oe(e,t){return e.selectorText=t,e.selectorText===t}var ue=ne(function(){return document.querySelector("head")});function ae(e){var t=Y.registry;if(0<t.length){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(e,t){for(var n=e.length-1;0<=n;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=ue(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}var he=ne(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),le=function(e,t,n){void 0===n&&(n=e.cssRules.length);try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(e){return!1}return e.cssRules[n]},de=function(){function e(e){this.getPropertyValue=re,this.setProperty=ie,this.removeProperty=se,this.setSelector=oe,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&Y.add(e),this.sheet=e;var t,n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,s=n.element;this.element=s||((t=document.createElement("style")).textContent="\n",t),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var o=he();o&&this.element.setAttribute("nonce",o)}var t=e.prototype;return t.attach=function(){!this.element.parentNode&&this.sheet&&(!function(e,t){var n=t.insertionPoint,r=ae(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,s=i.parentNode;s&&s.insertBefore(e,i.nextSibling)}else ue().appendChild(e)}(this.element,this.sheet.options),this.hasInsertedRules&&(this.hasInsertedRules=!1,this.deploy()))},t.detach=function(){this.element.parentNode.removeChild(this.element)},t.deploy=function(){var e=this.sheet;e&&(e.options.link?e.rules.index.forEach(this.insertRule,this):this.element.textContent="\n"+e.toString()+"\n")},t.insertRule=function(e,t){var n=this.element.sheet;if("conditional"===e.type||"keyframes"===e.type){var r=e,i=le(n,r.toString({children:!1}),t);return!1!==i&&(r.rules.index.forEach(function(e,t){var n=le(i,e.toString(),t);!1!==n&&(e.renderable=n)}),i)}var s=e.toString();if(!s)return!1;var o=le(n,s,t);return!1!==o&&(this.hasInsertedRules=!0,e.renderable=o)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),!0)},t.indexOf=function(e){for(var t=this.element.sheet.cssRules,n=0;n<t.length;n++)if(e===t[n])return n;return-1},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),fe=function(){function e(){}var t=e.prototype;return t.setProperty=function(){return!0},t.getPropertyValue=function(){return""},t.removeProperty=function(){},t.setSelector=function(){return!0},t.attach=function(){},t.detach=function(){},t.deploy=function(){},t.insertRule=function(){return!1},t.deleteRule=function(){return!0},t.replaceRule=function(){return!1},t.getRules=function(){},t.indexOf=function(){return-1},e}(),ce=0,pe=function(){function e(e){this.id=ce++,this.version="10.0.0-alpha.9",this.plugins=new W,this.options={createGenerateId:te,Renderer:r?de:fe,plugins:[]},this.generateId=te();for(var t=0;t<L.length;t++)this.plugins.use(L[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId,this.generateId=e.createGenerateId()),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),(e.virtual||e.Renderer)&&(this.options.Renderer=e.Renderer||(e.virtual?fe:de)),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var n=t.index;"number"!=typeof n&&(n=0===Y.index?0:Y.index+1);var r=new Q(e,c({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r},t.removeStyleSheet=function(e){return e.detach(),Y.remove(e),this},t.createRule=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"object"==typeof e)return this.createRule(void 0,e,t);var r=c({},n,{jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var i=p(e,t,r);return i&&this.plugins.onProcessRule(i),i},t.use=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.plugins.use(e)}),this},e}();var ye=function(){function e(){this.sheets=[],this.refs=[],this.keys=[]}var t=e.prototype;return t.get=function(e){var t=this.keys.indexOf(e);return this.sheets[t]},t.add=function(e,t){var n=this.sheets,r=this.refs,i=this.keys,s=n.indexOf(t);return-1!==s?s:(n.push(t),r.push(0),i.push(e),n.length-1)},t.manage=function(e){var t=this.keys.indexOf(e),n=this.sheets[t];return 0===this.refs[t]&&n.attach(),this.refs[t]++,this.keys[t]||this.keys.splice(t,0,e),n},t.unmanage=function(e){var t=this.keys.indexOf(e);-1!==t&&0<this.refs[t]&&(this.refs[t]--,0===this.refs[t]&&this.sheets[t].detach())},f(e,[{key:"size",get:function(){return this.keys.length}}]),e}(),ve="undefined"!=typeof CSS&&CSS&&"number"in CSS,ge=function(e){return new pe(e)},me=ge();e.hasCSSTOMSupport=ve,e.create=ge,e.default=me,e.getDynamicStyles=function e(t){var n=null;for(var r in t){var i=t[r],s=typeof i;if("function"===s)n||(n={}),n[r]=i;else if("object"===s&&null!==i&&!Array.isArray(i)){var o=e(i);o&&(n||(n={}),n[r]=o)}}return n},e.toCssValue=m,e.createRule=p,e.SheetsRegistry=X,e.SheetsManager=ye,e.RuleList=K,e.sheets=Y,e.createGenerateId=te,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.jss={})}(this,function(e){"use strict";function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n="object"===("undefined"==typeof window?"undefined":t(window))&&"object"===("undefined"==typeof document?"undefined":t(document))&&9===document.nodeType,r={}.constructor;function o(e){if(null==e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(o);if(e.constructor!==r)return e;var t={};for(var n in e)t[n]=o(e[n]);return t}function p(e,t,n){void 0===e&&(e="unnamed");var r=n.jss,i=o(t),s=r.plugins.onCreateRule(e,i,n);return s||(e[0],null)}function i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function u(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var a=function(e,t){for(var n="",r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=t),n+=e[r];return n};function y(e,t){if(void 0===t&&(t=!1),!Array.isArray(e))return e;var n="";if(Array.isArray(e[0]))for(var r=0;r<e.length&&"!important"!==e[r];r++)n&&(n+=", "),n+=a(e[r]," ");else n=a(e,", ");return t||"!important"!==e[e.length-1]||(n+=" !important"),n}function v(e,t){for(var n="",r=0;r<t;r++)n+=" ";return n+e}function l(e,t,n){void 0===n&&(n={});var r="";if(!t)return r;var i=n.indent,s=void 0===i?0:i,o=t.fallbacks;if(e&&s++,o)if(Array.isArray(o))for(var u=0;u<o.length;u++){var a=o[u];for(var h in a){var l=a[h];null!=l&&(r&&(r+="\n"),r+=""+v(h+": "+y(l)+";",s))}}else for(var c in o){var d=o[c];null!=d&&(r&&(r+="\n"),r+=""+v(c+": "+y(d)+";",s))}for(var f in t){var p=t[f];null!=p&&"fallbacks"!==f&&(r&&(r+="\n"),r+=""+v(f+": "+y(p)+";",s))}return(r||n.allowEmpty)&&e?(r&&(r="\n"+r+"\n"),v(e+" {"+r,--s)+v("}",s)):r}var g=function(e){return e},c=function(){function e(e,t,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,this.renderer=r?r.renderer:new i}return e.prototype.prop=function(e,t,n){if(void 0===t)return this.style[e];if(!(!!n&&n.force)&&this.style[e]===t)return this;var r=t;n&&!1===n.process||(r=this.options.jss.plugins.onChangeValue(t,e,this));var i=null==r||!1===r,s=e in this.style;if(i&&!s)return this;var o=i&&s;if(o?delete this.style[e]:this.style[e]=r,this.renderable)return o?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,r),this;var u=this.options.sheet;return u&&u.attached,this},e}(),d=function(a){function e(e,t,n){var r;(r=a.call(this,e,t,n)||this).selectorText=void 0,r.id=void 0,r.renderable=void 0;var i=n.selector,s=n.scoped,o=n.sheet,u=n.generateId;return i?r.selectorText=i:!1!==s&&(r.id=u(h(h(r)),o),r.selectorText="."+g(r.id)),r}u(e,a);var t=e.prototype;return t.applyTo=function(e){var t=this.toJSON();for(var n in t)this.renderer.setProperty(e,n,t[n]);return this},t.toJSON=function(){var e={};for(var t in this.style){var n=this.style[t];"object"!=typeof n?e[t]=n:Array.isArray(n)&&(e[t]=y(n))}return e},t.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?f({},e,{allowEmpty:!0}):e;return l(this.selectorText,this.style,n)},s(e,[{key:"selector",set:function(e){e!==this.selectorText&&(this.selectorText=e,this.renderable&&(this.renderer.setSelector(this.renderable,e)||this.renderer.replaceRule(this.renderable,this)))},get:function(){return this.selectorText}}]),e}(c),m={onCreateRule:function(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new d(e,t,n)}},R={indent:1,children:!0},S=/@([\w-]+)/,b=function(){function e(e,t,n){this.type="conditional",this.at=void 0,this.key=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var r=(this.key=e).match(S);for(var i in this.at=r?r[1]:"unknown",this.options=n,this.rules=new z(f({},n,{parent:this})),t)this.rules.add(i,t[i]);this.rules.process()}var t=e.prototype;return t.getRule=function(e){return this.rules.get(e)},t.indexOf=function(e){return this.rules.indexOf(e)},t.addRule=function(e,t,n){var r=this.rules.add(e,t,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},t.toString=function(e){if(void 0===e&&(e=R),!1===e.children)return this.key+" {}";var t=this.rules.toString(e);return t?this.key+" {\n"+t+"\n}":""},e}(),x=/@media|@supports\s+/,k={onCreateRule:function(e,t,n){return x.test(e)?new b(e,t,n):null}},P={indent:1,children:!0},w=/@keyframes\s+([\w-]+)/,j=function(){function e(e,t,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var r=e.match(w);r&&r[1]?this.name=r[1]:this.name="noname",this.key=this.type+"-"+this.name;var i=(this.options=n).scoped,s=n.sheet,o=n.generateId;for(var u in this.id=!1===i?this.name:o(this,s),this.rules=new z(f({},n,{parent:this})),t)this.rules.add(u,t[u],f({},n,{parent:this}));this.rules.process()}return e.prototype.toString=function(e){if(void 0===e&&(e=P),!1===e.children)return this.at+" "+this.id+" {}";var t=this.rules.toString(e);return t&&(t="\n"+t+"\n"),this.at+" "+this.id+" {"+t+"}"},e}(),C=/@keyframes\s+/,A=/\$([\w-]+)/,O=function(e,t,n){var r=e[t];if("string"==typeof r){var i=A.exec(r);if(!i)return;i[1]in n&&(e[t]=r.replace(i[0],n[i[1]]))}},I={onCreateRule:function(e,t,n){return C.test(e)?new j(e,t,n):null},onProcessStyle:function(e,t,n){return"style"===t.type&&n&&("animation-name"in e&&O(e,"animation-name",n.keyframes),"animation"in e&&O(e,"animation",n.keyframes)),e}},T=function(i){function e(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=i.call.apply(i,[this].concat(n))||this).renderable=void 0,e}return u(e,i),e.prototype.toString=function(e){var t=this.options.sheet,n=!!t&&t.options.link?f({},e,{allowEmpty:!0}):e;return l(this.key,this.style,n)},e}(c),q={onCreateRule:function(e,t,n){return n.parent&&"keyframes"===n.parent.type?new T(e,t,n):null}},N=function(){function e(e,t,n){this.type="font-face",this.at="@font-face",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.style)){for(var t="",n=0;n<this.style.length;n++)t+=l(this.key,this.style[n]),this.style[n+1]&&(t+="\n");return t}return l(this.key,this.style,e)},e}(),E={onCreateRule:function(e,t,n){return"@font-face"===e?new N(e,t,n):null}},M=function(){function e(e,t,n){this.type="viewport",this.at="@viewport",this.key=void 0,this.style=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.style=t,this.options=n}return e.prototype.toString=function(e){return l(this.key,this.style,e)},e}(),V={onCreateRule:function(e,t,n){return"@viewport"===e||"@-ms-viewport"===e?new M(e,t,n):null}},U=function(){function e(e,t,n){this.type="simple",this.key=void 0,this.value=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=e,this.value=t,this.options=n}return e.prototype.toString=function(e){if(Array.isArray(this.value)){for(var t="",n=0;n<this.value.length;n++)t+=this.key+" "+this.value[n]+";",this.value[n+1]&&(t+="\n");return t}return this.key+" "+this.value+";"},e}(),G={"@charset":!0,"@import":!0,"@namespace":!0},_=[m,k,I,q,E,V,{onCreateRule:function(e,t,n){return e in G?new U(e,t,n):null}}],B={process:!0},J={force:!0,process:!0},z=function(){function l(e){this.map={},this.raw={},this.index=[],this.options=void 0,this.classes=void 0,this.keyframes=void 0,this.options=e,this.classes=e.classes,this.keyframes=e.keyframes}var e=l.prototype;return e.add=function(e,t,n){var r=this.options,i=r.parent,s=r.sheet,o=r.jss,u=r.Renderer,a=r.generateId,h=r.scoped,l=f({classes:this.classes,parent:i,sheet:s,jss:o,Renderer:u,generateId:a,scoped:h},n);this.raw[e]=t,e in this.classes&&(l.selector="."+g(this.classes[e]));var c=p(e,t,l);if(!c)return null;this.register(c);var d=void 0===l.index?this.index.length:l.index;return this.index.splice(d,0,c),c},e.get=function(e){return this.map[e]},e.remove=function(e){this.unregister(e),delete this.raw[e.key],this.index.splice(this.indexOf(e),1)},e.indexOf=function(e){return this.index.indexOf(e)},e.process=function(){var e=this.options.jss.plugins;this.index.slice(0).forEach(e.onProcessRule,e)},e.register=function(e){(this.map[e.key]=e)instanceof d?(this.map[e.selector]=e).id&&(this.classes[e.key]=e.id):e instanceof j&&this.keyframes&&(this.keyframes[e.name]=e.id)},e.unregister=function(e){delete this.map[e.key],e instanceof d?(delete this.map[e.selector],delete this.classes[e.key]):e instanceof j&&delete this.keyframes[e.name]},e.update=function(){var e,t,n;if("string"==typeof(arguments.length<=0?void 0:arguments[0])?(e=arguments.length<=0?void 0:arguments[0],t=arguments.length<=1?void 0:arguments[1],n=arguments.length<=2?void 0:arguments[2]):(t=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],e=null),e)this.onUpdate(t,this.get(e),n);else for(var r=0;r<this.index.length;r++)this.onUpdate(t,this.index[r],n)},e.onUpdate=function(e,t,n){void 0===n&&(n=B);var r=this.options,i=r.jss.plugins,s=r.sheet;if(t.rules instanceof l)t.rules.update(e,n);else{var o=t,u=o.style;if(i.onUpdate(e,t,s,n),n.process&&u&&u!==o.style)for(var a in i.onProcessStyle(o.style,o,s),o.style){var h=o.style[a];h!==u[a]&&o.prop(a,h,J)}}},e.toString=function(e){for(var t="",n=this.options.sheet,r=!!n&&n.options.link,i=0;i<this.index.length;i++){var s=this.index[i].toString(e);(s||r)&&(t&&(t+="\n"),t+=s)}return t},l}(),D=function(){function e(e,t){for(var n in this.options=void 0,this.deployed=void 0,this.attached=void 0,this.rules=void 0,this.renderer=void 0,this.classes=void 0,this.keyframes=void 0,this.queue=void 0,this.attached=!1,this.deployed=!1,this.classes={},this.keyframes={},this.options=f({},t,{sheet:this,parent:this,classes:this.classes,keyframes:this.keyframes}),this.renderer=new t.Renderer(this),this.rules=new z(this.options),e)this.rules.add(n,e[n]);this.rules.process()}var t=e.prototype;return t.attach=function(){return this.attached||(this.renderer.attach(),this.attached=!0,this.deployed||this.deploy()),this},t.detach=function(){return this.attached&&(this.renderer.detach(),this.attached=!1),this},t.addRule=function(e,t,n){var r=this.queue;this.attached&&!r&&(this.queue=[]);var i=this.rules.add(e,t,n);return i?(this.options.jss.plugins.onProcessRule(i),this.attached?this.deployed&&(r?r.push(i):(this.insertRule(i),this.queue&&(this.queue.forEach(this.insertRule,this),this.queue=void 0))):this.deployed=!1,i):null},t.insertRule=function(e){this.renderer.insertRule(e)},t.addRules=function(e,t){var n=[];for(var r in e){var i=this.addRule(r,e[r],t);i&&n.push(i)}return n},t.getRule=function(e){return this.rules.get(e)},t.deleteRule=function(e){var t=this.rules.get(e);return!!t&&(this.rules.remove(t),!this.attached||!t.renderable||this.renderer.deleteRule(t.renderable))},t.indexOf=function(e){return this.rules.indexOf(e)},t.deploy=function(){return this.renderer.deploy(),this.deployed=!0,this},t.update=function(){var e;return(e=this.rules).update.apply(e,arguments),this},t.toString=function(e){return this.rules.toString(e)},e}(),L=function(){function e(){this.plugins={internal:[],external:[]},this.registry=void 0}var t=e.prototype;return t.onCreateRule=function(e,t,n){for(var r=0;r<this.registry.onCreateRule.length;r++){var i=this.registry.onCreateRule[r](e,t,n);if(i)return i}return null},t.onProcessRule=function(e){if(!e.isProcessed){for(var t=e.options.sheet,n=0;n<this.registry.onProcessRule.length;n++)this.registry.onProcessRule[n](e,t);e.style&&this.onProcessStyle(e.style,e,t),e.isProcessed=!0}},t.onProcessStyle=function(e,t,n){for(var r=0;r<this.registry.onProcessStyle.length;r++)t.style=this.registry.onProcessStyle[r](t.style,t,n)},t.onProcessSheet=function(e){for(var t=0;t<this.registry.onProcessSheet.length;t++)this.registry.onProcessSheet[t](e)},t.onUpdate=function(e,t,n,r){for(var i=0;i<this.registry.onUpdate.length;i++)this.registry.onUpdate[i](e,t,n,r)},t.onChangeValue=function(e,t,n){for(var r=e,i=0;i<this.registry.onChangeValue.length;i++)r=this.registry.onChangeValue[i](r,t,n);return r},t.use=function(e,t){void 0===t&&(t={queue:"external"});var n=this.plugins[t.queue];-1===n.indexOf(e)&&(n.push(e),this.registry=this.plugins.external.concat(this.plugins.internal).reduce(function(e,t){for(var n in t)n in e&&e[n].push(t[n]);return e},{onCreateRule:[],onProcessRule:[],onProcessStyle:[],onProcessSheet:[],onChangeValue:[],onUpdate:[]}))},e}(),W=function(){function e(){this.registry=[]}var t=e.prototype;return t.add=function(e){var t=this.registry,n=e.options.index;if(-1===t.indexOf(e))if(0===t.length||n>=this.index)t.push(e);else for(var r=0;r<t.length;r++)if(t[r].options.index>n)return void t.splice(r,0,e)},t.reset=function(){this.registry=[]},t.remove=function(e){var t=this.registry.indexOf(e);this.registry.splice(t,1)},t.toString=function(t){return this.registry.filter(function(e){return e.attached}).map(function(e){return e.toString(t)}).join("\n")},s(e,[{key:"index",get:function(){return 0===this.registry.length?0:this.registry[this.registry.length-1].options.index}}]),e}(),$=new W,F="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},H="2f1acc6c3a606b082e5eef5e54414ffb";null==F[H]&&(F[H]=0);var K=F[H]++,Q=function(){var i=0;return function(e,t){i+=1;var n="c",r="";return t&&(n=t.options.classNamePrefix||"c",null!=t.options.jss.id&&(r+=t.options.jss.id)),""+n+K+r+i}},X=function(e){var t;return function(){return t||(t=e()),t}};function Y(e,t){try{return"attributeStyleMap"in e?e.attributeStyleMap.get(t):e.style.getPropertyValue(t)}catch(e){return""}}function Z(e,t,n){try{var r=n;if(Array.isArray(n)&&(r=y(n,!0),"!important"===n[n.length-1]))return e.style.setProperty(t,r,"important"),!0;"attributeStyleMap"in e?e.attributeStyleMap.set(t,r):e.style.setProperty(t,r)}catch(e){return!1}return!0}function ee(e,t){try{"attributeStyleMap"in e?e.attributeStyleMap.delete(t):e.style.removeProperty(t)}catch(e){}}function te(e,t){return e.selectorText=t,e.selectorText===t}var ne=X(function(){return document.querySelector("head")});function re(e){var t=$.registry;if(0<t.length){var n=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(r.attached&&r.options.index>t.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if(n=function(e,t){for(var n=e.length-1;0<=n;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=e.insertionPoint;if(r&&"string"==typeof r){var i=function(e){for(var t=ne(),n=0;n<t.childNodes.length;n++){var r=t.childNodes[n];if(8===r.nodeType&&r.nodeValue.trim()===e)return r}return null}(r);if(i)return{parent:i.parentNode,node:i.nextSibling}}return!1}var ie=X(function(){var e=document.querySelector('meta[property="csp-nonce"]');return e?e.getAttribute("content"):null}),se=function(e,t,n){void 0===n&&(n=e.cssRules.length);try{if("insertRule"in e)e.insertRule(t,n);else if("appendRule"in e){e.appendRule(t)}}catch(e){return!1}return e.cssRules[n]},oe=function(){function e(e){this.getPropertyValue=Y,this.setProperty=Z,this.removeProperty=ee,this.setSelector=te,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,e&&$.add(e),this.sheet=e;var t,n=this.sheet?this.sheet.options:{},r=n.media,i=n.meta,s=n.element;this.element=s||((t=document.createElement("style")).textContent="\n",t),this.element.setAttribute("data-jss",""),r&&this.element.setAttribute("media",r),i&&this.element.setAttribute("data-meta",i);var o=ie();o&&this.element.setAttribute("nonce",o)}var t=e.prototype;return t.attach=function(){!this.element.parentNode&&this.sheet&&(!function(e,t){var n=t.insertionPoint,r=re(t);if(!1!==r&&r.parent)r.parent.insertBefore(e,r.node);else if(n&&"number"==typeof n.nodeType){var i=n,s=i.parentNode;s&&s.insertBefore(e,i.nextSibling)}else ne().appendChild(e)}(this.element,this.sheet.options),this.hasInsertedRules&&(this.hasInsertedRules=!1,this.deploy()))},t.detach=function(){this.element.parentNode.removeChild(this.element)},t.deploy=function(){var e=this.sheet;e&&(e.options.link?e.rules.index.forEach(this.insertRule,this):this.element.textContent="\n"+e.toString()+"\n")},t.insertRule=function(e,t){var n=this.element.sheet;if("conditional"===e.type||"keyframes"===e.type){var r=e,i=se(n,r.toString({children:!1}),t);return!1!==i&&(r.rules.index.forEach(function(e,t){var n=se(i,e.toString(),t);!1!==n&&(e.renderable=n)}),i)}var s=e.toString();if(!s)return!1;var o=se(n,s,t);return!1!==o&&(this.hasInsertedRules=!0,e.renderable=o)},t.deleteRule=function(e){var t=this.element.sheet,n=this.indexOf(e);return-1!==n&&(t.deleteRule(n),!0)},t.indexOf=function(e){for(var t=this.element.sheet.cssRules,n=0;n<t.length;n++)if(e===t[n])return n;return-1},t.replaceRule=function(e,t){var n=this.indexOf(e);return-1!==n&&(this.element.sheet.deleteRule(n),this.insertRule(t,n))},t.getRules=function(){return this.element.sheet.cssRules},e}(),ue=function(){function e(){}var t=e.prototype;return t.setProperty=function(){return!0},t.getPropertyValue=function(){return""},t.removeProperty=function(){},t.setSelector=function(){return!0},t.attach=function(){},t.detach=function(){},t.deploy=function(){},t.insertRule=function(){return!1},t.deleteRule=function(){return!0},t.replaceRule=function(){return!1},t.getRules=function(){},t.indexOf=function(){return-1},e}(),ae=0,he=function(){function e(e){this.id=ae++,this.version="10.0.0-alpha.10",this.plugins=new L,this.options={createGenerateId:Q,Renderer:n?oe:ue,plugins:[]},this.generateId=Q();for(var t=0;t<_.length;t++)this.plugins.use(_[t],{queue:"internal"});this.setup(e)}var t=e.prototype;return t.setup=function(e){return void 0===e&&(e={}),e.createGenerateId&&(this.options.createGenerateId=e.createGenerateId,this.generateId=e.createGenerateId()),null!=e.insertionPoint&&(this.options.insertionPoint=e.insertionPoint),(e.virtual||e.Renderer)&&(this.options.Renderer=e.Renderer||(e.virtual?ue:oe)),e.plugins&&this.use.apply(this,e.plugins),this},t.createStyleSheet=function(e,t){void 0===t&&(t={});var n=t.index;"number"!=typeof n&&(n=0===$.index?0:$.index+1);var r=new D(e,f({},t,{jss:this,generateId:t.generateId||this.generateId,insertionPoint:this.options.insertionPoint,Renderer:this.options.Renderer,index:n}));return this.plugins.onProcessSheet(r),r},t.removeStyleSheet=function(e){return e.detach(),$.remove(e),this},t.createRule=function(e,t,n){if(void 0===t&&(t={}),void 0===n&&(n={}),"object"==typeof e)return this.createRule(void 0,e,t);var r=f({},n,{jss:this,Renderer:this.options.Renderer});r.generateId||(r.generateId=this.generateId),r.classes||(r.classes={}),r.keyframes||(r.keyframes={});var i=p(e,t,r);return i&&this.plugins.onProcessRule(i),i},t.use=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.forEach(function(e){t.plugins.use(e)}),this},e}();var le=function(){function e(){this.length=0,this.sheets=new WeakMap}var t=e.prototype;return t.get=function(e){var t=this.sheets.get(e);return t&&t.sheet},t.add=function(e,t){this.sheets.has(e)||(this.length++,this.sheets.set(e,{sheet:t,refs:0}))},t.manage=function(e){var t=this.sheets.get(e);if(t)return 0===t.refs&&t.sheet.attach(),t.refs++,t.sheet},t.unmanage=function(e){var t=this.sheets.get(e);t&&0<t.refs&&(t.refs--,0===t.refs&&t.sheet.detach())},s(e,[{key:"size",get:function(){return this.length}}]),e}(),ce="undefined"!=typeof CSS&&CSS&&"number"in CSS,de=function(e){return new he(e)},fe=de();e.hasCSSTOMSupport=ce,e.create=de,e.default=fe,e.getDynamicStyles=function e(t){var n=null;for(var r in t){var i=t[r],s=typeof i;if("function"===s)n||(n={}),n[r]=i;else if("object"===s&&null!==i&&!Array.isArray(i)){var o=e(i);o&&(n||(n={}),n[r]=o)}}return n},e.toCssValue=y,e.createRule=p,e.SheetsRegistry=W,e.SheetsManager=le,e.RuleList=z,e.sheets=$,e.createGenerateId=Q,Object.defineProperty(e,"__esModule",{value:!0})});
{
"name": "jss",
"description": "A lib for generating Style Sheets with JavaScript.",
"version": "10.0.0-alpha.9",
"version": "10.0.0-alpha.10",
"license": "MIT",

@@ -45,6 +45,5 @@ "homepage": "https://cssinjs.org/",

"is-in-browser": "^1.1.3",
"symbol-observable": "^1.2.0",
"tiny-warning": "^1.0.2"
},
"gitHead": "c552e8e8c23d2c326a7861e6562e541bf0ced981"
"gitHead": "953234ad4e69b2f3d00fb9d683fba24865d2c4dd"
}
# jss
[![Version](https://img.shields.io/npm/v/jss.svg?style=flat)](https://npmjs.org/package/jss)
[![License](https://img.shields.io/npm/l/jss.svg?style=flat)](https://github.com/cssinjs/jss/blob/master/LICENSE)
[![Downlodas](https://img.shields.io/npm/dm/jss.svg?style=flat)](https://npmjs.org/package/jss)
[![Size](https://img.shields.io/bundlephobia/minzip/jss.svg?style=flat)](https://npmjs.org/package/jss)
[![Dependencies](https://img.shields.io/david/cssinjs/jss.svg?path=packages%2Fjss&style=flat)](https://npmjs.org/package/jss)
[![Gitter](https://badges.gitter.im/JoinChat.svg)](https://gitter.im/cssinjs/lobby)
> A lib for generating Style Sheets with JavaScript.
See our website [jss](https://cssinjs.org/setup?v=v10.0.0-alpha.9) for more information.
See our website [jss](https://cssinjs.org/setup?v=v10.0.0-alpha.10) for more information.

@@ -7,0 +14,0 @@ ## Install

@@ -136,5 +136,5 @@ type GenerateId = (rule: Rule, sheet?: StyleSheet) => string

readonly size: number
get(key: object): StyleSheet
add(key: object, sheet: StyleSheet): number
manage(key: object): StyleSheet
get(key: object): StyleSheet | null
add(key: object, sheet: StyleSheet): void
manage(key: object): StyleSheet | null
unmanage(key: object): void

@@ -141,0 +141,0 @@ }

@@ -10,51 +10,63 @@ /* @flow */

export default class SheetsManager {
sheets: Array<StyleSheet> = []
length = 0
refs: Array<number> = []
sheets = new WeakMap<
Object,
{
refs: number,
sheet: StyleSheet
}
>()
keys: Array<Object> = []
get size(): number {
return this.keys.length
return this.length
}
get(key: Object): StyleSheet {
const index = this.keys.indexOf(key)
return this.sheets[index]
get(key: Object): ?StyleSheet {
const entry = this.sheets.get(key)
return entry && entry.sheet
}
add(key: Object, sheet: StyleSheet): number {
const {sheets, refs, keys} = this
const index = sheets.indexOf(sheet)
add(key: Object, sheet: StyleSheet) {
if (this.sheets.has(key)) return
if (index !== -1) return index
this.length++
sheets.push(sheet)
refs.push(0)
keys.push(key)
return sheets.length - 1
this.sheets.set(key, {
sheet,
refs: 0
})
}
manage(key: Object): StyleSheet {
const index = this.keys.indexOf(key)
const sheet = this.sheets[index]
if (this.refs[index] === 0) sheet.attach()
this.refs[index]++
if (!this.keys[index]) this.keys.splice(index, 0, key)
return sheet
manage(key: Object): ?StyleSheet {
const entry = this.sheets.get(key)
if (entry) {
if (entry.refs === 0) {
entry.sheet.attach()
}
entry.refs++
return entry.sheet
}
warn(false, "[JSS] SheetsManager: can't find sheet to manage")
return undefined
}
unmanage(key: Object): void {
const index = this.keys.indexOf(key)
if (index === -1) {
// eslint-ignore-next-line no-console
unmanage(key: Object) {
const entry = this.sheets.get(key)
if (entry) {
if (entry.refs > 0) {
entry.refs--
if (entry.refs === 0) entry.sheet.detach()
}
} else {
warn(false, "SheetsManager: can't find sheet to unmanage")
return
}
if (this.refs[index] > 0) {
this.refs[index]--
if (this.refs[index] === 0) this.sheets[index].detach()
}
}
}

@@ -1,44 +0,15 @@

import $$observable from 'symbol-observable'
import type {JssStyle} from '../types'
const {isArray} = Array
const plainObjectConstrurctor = {}.constructor
// TODO: This should propably not be here, need to find a better place
const isObservable = value => value && value[$$observable] && value === value[$$observable]()
export default function cloneStyle(style: JssStyle): JssStyle {
// Support empty values in case user ends up with them by accident.
if (style == null) return style
if (style == null || typeof style !== 'object') return style
if (Array.isArray(style)) return style.map(cloneStyle)
if (style.constructor !== plainObjectConstrurctor) return style
// Support string value for SimpleRule.
const typeOfStyle = typeof style
if (typeOfStyle === 'string' || typeOfStyle === 'number' || typeOfStyle === 'function') {
return style
}
// It is a CSSTOM value.
// TODO will not work if instance comes from a different window.
if (global.CSSStyleValue && style instanceof global.CSSStyleValue) {
return style
}
// Support array for FontFaceRule.
if (isArray(style)) return style.map(cloneStyle)
// Support Observable styles. Observables are immutable, so we don't need to
// copy them.
if (isObservable(style)) return style
const newStyle = {}
for (const name in style) {
const value = style[name]
if (typeof value === 'object') {
newStyle[name] = cloneStyle(value)
continue
}
newStyle[name] = value
newStyle[name] = cloneStyle(style[name])
}
return newStyle
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc