New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

stylis

Package Overview
Dependencies
Maintainers
1
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylis - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

5

CHANGELOG.md

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

## 1.0.5 (February 06, 2016)
- patch block comments inlined with selectors
- patch attribute selectors
## 1.0.4 (February 02, 2016)

@@ -2,0 +7,0 @@

2

package.json

@@ -5,3 +5,3 @@ {

"description": "stylis is a feature-rich css preprocessor",
"version": "1.0.4",
"version": "1.0.5",
"homepage": "https://github.com/thysultan/stylis.js",

@@ -8,0 +8,0 @@ "license": "MIT",

@@ -30,3 +30,3 @@ # Stylis

```html
<script src=https://unpkg.com/stylis@1.0.4/stylis.min.js></script>
<script src=https://unpkg.com/stylis@1.0.5/stylis.min.js></script>
```

@@ -33,0 +33,0 @@

@@ -48,2 +48,8 @@ /*

var type = selector.charCodeAt(0) || 0;
var char;
var attr;
var animns;
var plugins;
var uses;

@@ -53,4 +59,4 @@ // [ attr selector

// `[data-id=namespace]` -> ['data-id', 'namespace']
var attr = selector.substring(1, selector.length-1).split('=');
var char = (namespace = attr[1]).charCodeAt(0);
attr = selector.substring(1, selector.length-1).split('=');
char = (namespace = attr[1]).charCodeAt(0);

@@ -77,4 +83,2 @@ // [data-id="namespace"]/[data-id='namespace']

var animns;
// animation and keyframe namespace

@@ -92,7 +96,6 @@ if (animations == void 0 || animations === true) {

var use = middleware != null;
var plugins;
// middleware
if (use) {
var uses = (typeof middleware).charCodeAt(0);
uses = (typeof middleware).charCodeAt(0);

@@ -133,2 +136,5 @@ // o, object of middlewares

var indexOf;
var first;
var second;
var third;

@@ -148,2 +154,3 @@ // variables

var flat = '';
var code = 0;

@@ -155,2 +162,3 @@ // context signatures

var comment = 0;
var comments = 0;
var strings = 0;

@@ -189,3 +197,3 @@ var nested = 0;

while (caret < eof) {
var code = styles.charCodeAt(caret);
code = styles.charCodeAt(caret);

@@ -196,3 +204,3 @@ // {, }, ; characters, parse line by line

var first = buff.charCodeAt(0);
first = buff.charCodeAt(0);

@@ -205,4 +213,4 @@ // only trim when the first character is a space ` `

// default to 0 instead of NaN if there is no second/third character
var second = buff.charCodeAt(1) || 0;
var third = buff.charCodeAt(2) || 0;
second = buff.charCodeAt(1) || 0;
third = buff.charCodeAt(2) || 0;

@@ -227,3 +235,5 @@ // middleware, selector/property context, }

if (comment === 2) {
code === 125 && (comment = 0);
if (code === 125) {
comment = 0;
}
buff = '';

@@ -303,3 +313,8 @@ }

// {, }, nested blocks may have nested blocks
char === 123 ? closed++ : char === 125 && closed--;
if (char === 123) {
closed++;
}
else if (char === 125) {
closed--;
}

@@ -352,3 +367,3 @@ // break when the nested block has ended

// function mixins
if (indexOf > -1) {
if (indexOf !== -1) {
// mixin name

@@ -428,3 +443,5 @@ var name = buff.substring(0, indexOf);

// first match create variables store
variables === void 0 && (variables = []);
if (variables === void 0) {
variables = [];
}

@@ -464,3 +481,3 @@ // push key value pair

var frst = prop.charCodeAt(0);
var third = prop.charCodeAt(2);
var thrd = prop.charCodeAt(2);
var len = prop.length;

@@ -475,37 +492,37 @@ var last = prop.charCodeAt(len - 1);

// infinite, i, f, e
!(frst === 105 && third === 102 && last === 101 && len === 8) &&
!(frst === 105 && thrd === 102 && last === 101 && len === 8) &&
// linear, l, n, r
!(frst === 108 && third === 110 && last === 114 && len === 6) &&
!(frst === 108 && thrd === 110 && last === 114 && len === 6) &&
// alternate/alternate-reverse, a, t, e
!(frst === 97 && third === 116 && last === 101 && (len === 9 || len === 17)) &&
!(frst === 97 && thrd === 116 && last === 101 && (len === 9 || len === 17)) &&
// normal, n, r, l
!(frst === 110 && third === 114 && last === 108 && len === 6) &&
!(frst === 110 && thrd === 114 && last === 108 && len === 6) &&
// backwards, b, c, s
!(frst === 98 && third === 99 && last === 115 && len === 9) &&
!(frst === 98 && thrd === 99 && last === 115 && len === 9) &&
// forwards, f, r, s
!(frst === 102 && third === 114 && last === 115 && len === 8) &&
!(frst === 102 && thrd === 114 && last === 115 && len === 8) &&
// both, b, t, h
!(frst === 98 && third === 116 && last === 104 && len === 4) &&
!(frst === 98 && thrd === 116 && last === 104 && len === 4) &&
// none, n, n, e
!(frst === 110 && third === 110 && last === 101 && len === 4)&&
!(frst === 110 && thrd === 110 && last === 101 && len === 4)&&
// running, r, n, g
!(frst === 114 && third === 110 && last === 103 && len === 7) &&
!(frst === 114 && thrd === 110 && last === 103 && len === 7) &&
// paused, p, u, d
!(frst === 112 && third === 117 && last === 100 && len === 6) &&
!(frst === 112 && thrd === 117 && last === 100 && len === 6) &&
// reversed, r, v, d
!(frst === 114 && third === 118 && last === 100 && len === 8) &&
!(frst === 114 && thrd === 118 && last === 100 && len === 8) &&
// step-start/step-end, s, e, (t/d)
!(
frst === 115 && third === 101 &&
frst === 115 && thrd === 101 &&
((last === 116 && len === 10) || (last === 100 && len === 8))

@@ -516,3 +533,3 @@ ) &&

!(
frst === 101 && third === 115 &&
frst === 101 && thrd === 115 &&
(

@@ -558,3 +575,3 @@ (last === 101 && len === 4) ||

// flex/inline-flex
if ((indexOf = buff.indexOf('flex')) > -1) {
if ((indexOf = buff.indexOf('flex')) !== -1) {
// e, inline-flex

@@ -681,3 +698,8 @@ temp = buff.charCodeAt(indexOf-2) === 101 ? 'inline-' : '';

// {, }, nested blocks may have nested blocks
char === 123 ? closed++ : char === 125 && closed--;
if (char === 123) {
closed++;
}
else if (char === 125) {
closed--;
}

@@ -746,3 +768,3 @@ // break when the nested block has ended

// [, [title="a,b,..."]
if (firstChar === 91) {
if (firstChar === 91 && selector.charCodeAt(selector.length-1) !== 93) {
for (var k = j+1, l = length-j; k < l; k++) {

@@ -976,3 +998,17 @@ var broken = (selector += ',' + selectors[k]).trim();

if (comment === 2) {
buff = '';
// * character, block comment
if (buff.charCodeAt(buff.length - 2) === 42) {
buff = buff.substring(0, buff.indexOf('/*')).trim();
}
else {
// / character, does not start with `/`
if (buff.charCodeAt(0) !== 47 && (indexOf = buff.indexOf('//')) !== -1) {
buff = buff.substring(0, indexOf).trim();
}
else {
buff = '';
}
}
comments = 0;
comment = 0;

@@ -1001,3 +1037,5 @@ }

case 40: {
strings === 0 && (func = 1);
if (strings === 0) {
func = 1;
}
break;

@@ -1007,3 +1045,5 @@ }

case 41: {
strings === 0 && (func = 0);
if (strings === 0) {
func = 0;
}
break;

@@ -1013,4 +1053,12 @@ }

case 47: {
if (strings === 0 && func !== 1) {
code === 47 && comment < 2 && comment++;
if (strings === 0 && func !== 1 && comment < 2) {
// * character
if (comments === 0 || styles.charCodeAt(caret - 1) === 42) {
comment++;
}
// * character, allow line comments in block comments
if (comments === 0 && styles.charCodeAt(caret + 1) === 42) {
comments = 1;
}
}

@@ -1017,0 +1065,0 @@ break;

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

!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(global):"function"==typeof define&&define.amd?define(e(window)):window.stylis=e(window)}(function(e){"use strict";function r(e,t,i,l,n){e+="";var s="",a="",f=e.charCodeAt(0)||0;if(91===f){var o=e.substring(1,e.length-1).split("="),g=(a=o[1]).charCodeAt(0);34!==g&&39!==g||(a=a.substring(1,a.length-1)),s="["+o[0]+'="'+a+'"]'}else a=35===f||46===f||62===f?(s=e).substring(1):s=e;f=0;var c;void 0==i||i===!0?(i=!0,c=a):(c="",i=!1);var u,h=null!=n;if(h){var d=(typeof n).charCodeAt(0);111===d?r.use(n,null):102!==d&&(h=!1)}0!==(u=r.plugins).length&&(n=function(e,r,t,i){for(var l=r,n=0,s=u.length;n<s;n++)l=u[n](e,l,t,i)||l;return l!==r?l:void 0},h=!0);var b,p,v,A,m,x,C,y,w,k,O,j="",E="",R="",N="",z="",F=0,q=0,B=0,D=0,G=0,H=0,I=0,J=0,K=0,L="-moz-",M="-ms-",P="-webkit-";h&&(x=n(0,t,U,T),null!=x&&(t=x));for(var Q=0,S=0,T=0,U=1,V=t.length,W="";Q<V;){var X=t.charCodeAt(Q);if(0!==G||0!==I||123!==X&&125!==X&&59!==X){if(13===X||10===X)2===D&&(j="",D=0),T=0,U++;else if(9!==X){switch(X){case 34:G=34===G?0:39===G?39:34;break;case 39:G=39===G?0:34===G?34:39;break;case 40:0===G&&(I=1);break;case 41:0===G&&(I=0);break;case 47:0===G&&1!==I&&47===X&&D<2&&D++}j+=t.charAt(Q)}}else{j+=t.charAt(Q);var Y=j.charCodeAt(0);32===Y&&(Y=(j=j.trim()).charCodeAt(0));var Z=j.charCodeAt(1)||0,$=j.charCodeAt(2)||0;if(h&&125!==X&&(x=123===X?n(1,j.substring(0,j.length-1).trim(),U,T):n(2,j,U,T),null!=x&&(j=123===X?x+"{":x)),2===D)125===X&&(D=0),j="";else if(64===Y){if(1===J&&0!==z.length&&(J=0,z=s+" {"+z+"}",h&&(x=n(4,z,U,T),null!=x&&(z=x)),W+=z,z=""),107===Z||103===Z)107===Z?(E=j.substring(1,11)+c+j.substring(11),j="@"+P+E,f=1):j="";else if(109===Z)if(l===!0&&105===$)void 0===k&&(k={}),E=(O=j.substring(7,j.indexOf("{"))+" ").trim(),O=O.substring(0,O.indexOf(" ")).trim(),k[O]={key:E.trim(),body:""},f=3,j="",E="";else if(101===$)if(0!==S){for(Q++,m="",p="",v=C.split(","),B=1;Q<V&&(g=t.charCodeAt(Q),123===g?B++:125===g&&B--,0!==B);)p+=t.charAt(Q++);for(var _=0,ee=v.length;_<ee;_++)e=v[_],m+=r((_===ee-1?e.substring(0,e.length-1):e).trim(),p,i,l,n);m=j+m+"}",j="",f=4}else f=2;else f=6;if(105===Z){if(l===!0&&110===$)if(j=j.substring(9,j.length-1),y=j.indexOf("("),y>-1){var re=j.substring(0,y),te=k[re],ie=j.substring(re.length+1,j.length-1).split(","),le=te.key.replace(re,"").replace(/\(|\)/g,"").trim().split(",");j=te.body;for(var _=0,ee=ie.length;_<ee;_++){var ne=le[_].trim();void 0!==ne&&(j=j.replace(new RegExp("var\\(~~"+ne+"\\)","g"),ie[_].trim()))}t+=j,V+=j.length,j=""}else j=k[j].body,0===S&&(t+=j,V+=j.length,j="");else if(109===$&&h){var se=/@import.*?(["'`][^\.\n\r]*?["'`];|["'`][^:\r\n]*?\.[^c].*?["'`])/g.exec(j);null!==se&&(j=n(5,se[1].replace(/['"; ]/g,""),U,T)||"",j&&(t=t.substring(0,Q+1)+j+t.substring(Q+1),V+=j.length),j="")}}else 4!==f&&(q=-1,F++)}else if(l===!0&&59===X&&126===Y&&126===Z)b=j.indexOf(":"),void 0===w&&(w=[]),w[w.length]=[j.substring(0,b),j.substring(b+1,j.length-1).trim()],j="";else{if(97===Y&&110===Z&&105===$){j=j.substring(0,j.length-1),b=j.indexOf(":")+1,A=j.substring(0,b);var ae=j.substring(b).trim().split(",");if(i===!0&&45!==(j.charCodeAt(9)||0))for(var fe=0,ee=ae.length;fe<ee;fe++){for(var oe=ae[fe],ge=oe.split(" "),ce=0,ue=ge.length;ce<ue;ce++){var he=ge[ce].trim(),de=he.charCodeAt(0),$=he.charCodeAt(2),be=he.length,pe=he.charCodeAt(be-1);41===pe||0===be||105===de&&102===$&&101===pe&&8===be||108===de&&110===$&&114===pe&&6===be||97===de&&116===$&&101===pe&&(9===be||17===be)||110===de&&114===$&&108===pe&&6===be||98===de&&99===$&&115===pe&&9===be||102===de&&114===$&&115===pe&&8===be||98===de&&116===$&&104===pe&&4===be||110===de&&110===$&&101===pe&&4===be||114===de&&110===$&&103===pe&&7===be||112===de&&117===$&&100===pe&&6===be||114===de&&118===$&&100===pe&&8===be||115===de&&101===$&&(116===pe&&10===be||100===pe&&8===be)||101===de&&115===$&&(101===pe&&4===be||(11===be||7===be||8===be)&&45===he.charCodeAt(4))||!isNaN(parseFloat(he))||he.indexOf("(")!==-1||(ge[ce]=c+he)}A+=(0===fe?"":",")+ge.join(" ").trim()}else A+=(110!==(j.charCodeAt(10)||0)?"":c)+ae[0].trim();j=P+A+";"+A+";"}else if(97===Y&&112===Z&&112===$)j=P+j+L+j+j;else if(100===Y&&105===Z&&115===$)(y=j.indexOf("flex"))>-1&&(x=101===j.charCodeAt(y-2)?"inline-":"",j="display:"+P+x+"box;display:"+P+x+"flex;"+M+"flexbox;display:"+x+"flex;");else if(116===Y&&114===Z&&97===$)j=P+j+(102===j.charCodeAt(5)?M+j:"")+j;else if(104===Y&&121===Z&&112===$||117===Y&&115===Z&&101===$)j=P+j+L+j+M+j+j;else if(102===Y&&108===Z&&101===$)j=P+j+M+j+j;else if(111===Y&&114===Z&&100===$)j=P+j+M+"flex-"+j+j;else if(97===Y&&108===Z&&105===$&&45===(j.charCodeAt(5)||0))switch(j.charCodeAt(6)||0){case 105:x=j.replace("-items",""),j=P+"box-"+x+M+"flex-"+x+j;break;case 115:j=M+"flex-item-"+j.replace("-self","")+j;break;default:j=M+"flex-line-pack"+j.replace("align-content","")+j}else if(123===X){if(S++,1===J&&0!==z.length&&(J=0,z=s+" {"+z+"}",h&&(x=n(4,z,U,T),null!=x&&(z=x)),W+=z,z=""),0===F||2===f)if(2===S){Q++,p="";var ve=j.substring(0,j.length-1).split(","),Ae=C.substring(0,C.length-1).split(",");for(B=1;Q<V&&(g=t.charCodeAt(Q),123===g?B++:125===g&&B--,0!==B);)p+=t.charAt(Q++);for(var fe=0,ee=Ae.length;fe<ee;fe++){x=Ae[fe],Ae[fe]="";for(var ce=0,ue=ve.length;ce<ue;ce++)e=x.replace(s,"&").trim(),e=ve[ce].indexOf(" &")>0?ve[ce].replace("&","").trim()+" "+e:e+" "+ve[ce].trim(),Ae[fe]+=e.trim()+(ce===ue-1?"":",")}j="\n"+Ae.join(",")+" {"+p+"}",N+=j.replace(/ +&/g,""),H=1,j="",S--}else{v=j.split(","),A="";for(var fe=0,ee=v.length;fe<ee;fe++){var me=(e=v[fe]).charCodeAt(0);if(32===me&&(me=(e=e.trim()).charCodeAt(0)),91===me)for(var ce=fe+1,ue=ee-fe;ce<ue;ce++){var xe=(e+=","+v[ce]).trim();if(93===xe.charCodeAt(xe.length-1)){ee-=ce,v.splice(fe,ce);break}}if(38===me)e=s+e.substring(1);else if((y=e.indexOf(" &"))>0&&(me=58,e=":global("+e.substring(0,y)+")"+e.substring(y)),58===me){var Ce=e.charCodeAt(1);if(104===Ce&&116===e.charCodeAt(4)){var ye=(e=e.substring(5)).charCodeAt(0);40===ye?e=s+e.substring(1).replace(")",""):45===ye?(y=e.indexOf(")"),e=e.substring(9,y)+" "+s+e.substring(y+1)):e=s+e}else e=103===Ce?e.substring(8).replace(")","").replace("&",s):s+e}else e=s+" "+e;A+=0===fe?e:","+e}C=j=A}}else 125===X&&(0!==S&&S--,0===S&&1===H&&(t=t.substring(0,Q+1)+N+t.substring(Q+1),V+=N.length,N="",H=0,q++));0!==F?(125===X?q++:123===X&&0!==q&&q--,1!==K||123!==X&&0!==q||0===z.length||(K=0,j=s+" {"+z+"}"+j,z=""),0===q?(0===f?j="":1===f?(j="}@"+E+"}",E=""):3===f&&(k[O].body=E,O="",j="",E=""),f=0,q--,F--):1===f||3===f?(E+=j,3===f&&(j="")):2===f&&0===S&&(125!==X&&(0===K&&(z=""),z+=j,j=""),K=1)):0===S&&125!==X&&(J=1,z=void 0===z?j:z+j,j="")}R+=j,j="",125!==X||0!==D||0!==f&&4!==f||(123!==R.charCodeAt(R.length-2)&&(h&&0!==R.length&&(x=n(3,R,U,T),null!=x&&(R=x)),W+=R.trim()),4===f&&(h&&(x=n(3,m,U,T),null!=x&&(m=x)),f=0,W+=m),R="")}Q++,T++}if(void 0!==z&&0!==z.length&&(z=s+" {"+z+"}",h&&(x=n(4,z,U,T),null!=x&&(z=x)),W+=z),l&&void 0!==w)for(var _=0,ee=w.length;_<ee;_++)W=W.replace(new RegExp("var\\("+w[_][0]+"\\)","g"),w[_][1]);return h&&(x=n(6,W,U,T),null!=x&&(W=x)),W}return r.use=function(e,t){var i=r.plugins,l=i.length;if(null==t&&(t=e,e=void 0),null!=t)if(t.constructor===Object)for(var n in t)r.use(n,t[n]);else if(t.constructor===Array)for(var s=0,l=t.length;s<l;s++)i[l++]=t[s];else if(null==e)i[l]=t;else{var a=e instanceof RegExp?e:new RegExp(e+"\\([ \\t\\r\\n]*([^\\0]*?)[ \\t\\r\\n]*\\)","g"),f=/[ \t\r\n]*,[ \t\r\n]*/g;i[l]=function(e,r,i,l){if(6===e)return r=r.replace(a,function(e,r){var i=r.replace(f,",").split(","),l=t.apply(null,i);return null!=l?l:e})}}return r},r.plugins=[],r});
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(global):"function"==typeof define&&define.amd?define(e(window)):window.stylis=e(window)}(function(e){"use strict";function r(e,t,i,n,l){e+="";var s,a,o,f,g,c="",h="",u=e.charCodeAt(0)||0;91===u?(a=e.substring(1,e.length-1).split("="),s=(h=a[1]).charCodeAt(0),34!==s&&39!==s||(h=h.substring(1,h.length-1)),c="["+a[0]+'="'+h+'"]'):h=35===u||46===u||62===u?(c=e).substring(1):c=e,u=0,void 0==i||i===!0?(i=!0,o=h):(o="",i=!1);var d=null!=l;d&&(g=(typeof l).charCodeAt(0),111===g?r.use(l,null):102!==g&&(d=!1)),0!==(f=r.plugins).length&&(l=function(e,r,t,i){for(var n=r,l=0,s=f.length;l<s;l++)n=f[l](e,n,t,i)||n;return n!==r?n:void 0},d=!0);var b,p,v,A,C,m,x,y,O,w,k,j,E,R,N="",z="",F="",q="",B="",D=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,P=0,Q=0,S=0,T="-moz-",U="-ms-",V="-webkit-";d&&(m=l(0,t,Z,Y),null!=m&&(t=m));for(var W=0,X=0,Y=0,Z=1,$=t.length,_="";W<$;){if(D=t.charCodeAt(W),0!==L||0!==P||123!==D&&125!==D&&59!==D){if(13===D||10===D)2===J&&(N=42===N.charCodeAt(N.length-2)?N.substring(0,N.indexOf("/*")).trim():47!==N.charCodeAt(0)&&(y=N.indexOf("//"))!==-1?N.substring(0,y).trim():"",K=0,J=0),Y=0,Z++;else if(9!==D){switch(D){case 34:L=34===L?0:39===L?39:34;break;case 39:L=39===L?0:34===L?34:39;break;case 40:0===L&&(P=1);break;case 41:0===L&&(P=0);break;case 47:0===L&&1!==P&&J<2&&(0!==K&&42!==t.charCodeAt(W-1)||J++,0===K&&42===t.charCodeAt(W+1)&&(K=1))}N+=t.charAt(W)}}else{if(N+=t.charAt(W),O=N.charCodeAt(0),32===O&&(O=(N=N.trim()).charCodeAt(0)),w=N.charCodeAt(1)||0,k=N.charCodeAt(2)||0,d&&125!==D&&(m=123===D?l(1,N.substring(0,N.length-1).trim(),Z,Y):l(2,N,Z,Y),null!=m&&(N=123===D?m+"{":m)),2===J)125===D&&(J=0),N="";else if(64===O){if(1===Q&&0!==B.length&&(Q=0,B=c+" {"+B+"}",d&&(m=l(4,B,Z,Y),null!=m&&(B=m)),_+=B,B=""),107===w||103===w)107===w?(z=N.substring(1,11)+o+N.substring(11),N="@"+V+z,u=1):N="";else if(109===w)if(n===!0&&105===k)void 0===E&&(E={}),z=(R=N.substring(7,N.indexOf("{"))+" ").trim(),R=R.substring(0,R.indexOf(" ")).trim(),E[R]={key:z.trim(),body:""},u=3,N="",z="";else if(101===k)if(0!==X){for(W++,C="",p="",v=x.split(","),I=1;W<$&&(s=t.charCodeAt(W),123===s?I++:125===s&&I--,0!==I);)p+=t.charAt(W++);for(var ee=0,re=v.length;ee<re;ee++)e=v[ee],C+=r((ee===re-1?e.substring(0,e.length-1):e).trim(),p,i,n,l);C=N+C+"}",N="",u=4}else u=2;else u=6;if(105===w){if(n===!0&&110===k)if(N=N.substring(9,N.length-1),y=N.indexOf("("),y!==-1){var te=N.substring(0,y),ie=E[te],ne=N.substring(te.length+1,N.length-1).split(","),le=ie.key.replace(te,"").replace(/\(|\)/g,"").trim().split(",");N=ie.body;for(var ee=0,re=ne.length;ee<re;ee++){var se=le[ee].trim();void 0!==se&&(N=N.replace(new RegExp("var\\(~~"+se+"\\)","g"),ne[ee].trim()))}t+=N,$+=N.length,N=""}else N=E[N].body,0===X&&(t+=N,$+=N.length,N="");else if(109===k&&d){var ae=/@import.*?(["'`][^\.\n\r]*?["'`];|["'`][^:\r\n]*?\.[^c].*?["'`])/g.exec(N);null!==ae&&(N=l(5,ae[1].replace(/['"; ]/g,""),Z,Y)||"",N&&(t=t.substring(0,W+1)+N+t.substring(W+1),$+=N.length),N="")}}else 4!==u&&(H=-1,G++)}else if(n===!0&&59===D&&126===O&&126===w)b=N.indexOf(":"),void 0===j&&(j=[]),j[j.length]=[N.substring(0,b),N.substring(b+1,N.length-1).trim()],N="";else{if(97===O&&110===w&&105===k){N=N.substring(0,N.length-1),b=N.indexOf(":")+1,A=N.substring(0,b);var oe=N.substring(b).trim().split(",");if(i===!0&&45!==(N.charCodeAt(9)||0))for(var fe=0,re=oe.length;fe<re;fe++){for(var ge=oe[fe],ce=ge.split(" "),he=0,ue=ce.length;he<ue;he++){var de=ce[he].trim(),be=de.charCodeAt(0),pe=de.charCodeAt(2),ve=de.length,Ae=de.charCodeAt(ve-1);41===Ae||0===ve||105===be&&102===pe&&101===Ae&&8===ve||108===be&&110===pe&&114===Ae&&6===ve||97===be&&116===pe&&101===Ae&&(9===ve||17===ve)||110===be&&114===pe&&108===Ae&&6===ve||98===be&&99===pe&&115===Ae&&9===ve||102===be&&114===pe&&115===Ae&&8===ve||98===be&&116===pe&&104===Ae&&4===ve||110===be&&110===pe&&101===Ae&&4===ve||114===be&&110===pe&&103===Ae&&7===ve||112===be&&117===pe&&100===Ae&&6===ve||114===be&&118===pe&&100===Ae&&8===ve||115===be&&101===pe&&(116===Ae&&10===ve||100===Ae&&8===ve)||101===be&&115===pe&&(101===Ae&&4===ve||(11===ve||7===ve||8===ve)&&45===de.charCodeAt(4))||!isNaN(parseFloat(de))||de.indexOf("(")!==-1||(ce[he]=o+de)}A+=(0===fe?"":",")+ce.join(" ").trim()}else A+=(110!==(N.charCodeAt(10)||0)?"":o)+oe[0].trim();N=V+A+";"+A+";"}else if(97===O&&112===w&&112===k)N=V+N+T+N+N;else if(100===O&&105===w&&115===k)(y=N.indexOf("flex"))!==-1&&(m=101===N.charCodeAt(y-2)?"inline-":"",N="display:"+V+m+"box;display:"+V+m+"flex;"+U+"flexbox;display:"+m+"flex;");else if(116===O&&114===w&&97===k)N=V+N+(102===N.charCodeAt(5)?U+N:"")+N;else if(104===O&&121===w&&112===k||117===O&&115===w&&101===k)N=V+N+T+N+U+N+N;else if(102===O&&108===w&&101===k)N=V+N+U+N+N;else if(111===O&&114===w&&100===k)N=V+N+U+"flex-"+N+N;else if(97===O&&108===w&&105===k&&45===(N.charCodeAt(5)||0))switch(N.charCodeAt(6)||0){case 105:m=N.replace("-items",""),N=V+"box-"+m+U+"flex-"+m+N;break;case 115:N=U+"flex-item-"+N.replace("-self","")+N;break;default:N=U+"flex-line-pack"+N.replace("align-content","")+N}else if(123===D){if(X++,1===Q&&0!==B.length&&(Q=0,B=c+" {"+B+"}",d&&(m=l(4,B,Z,Y),null!=m&&(B=m)),_+=B,B=""),0===G||2===u)if(2===X){W++,p="";var Ce=N.substring(0,N.length-1).split(","),me=x.substring(0,x.length-1).split(",");for(I=1;W<$&&(s=t.charCodeAt(W),123===s?I++:125===s&&I--,0!==I);)p+=t.charAt(W++);for(var fe=0,re=me.length;fe<re;fe++){m=me[fe],me[fe]="";for(var he=0,ue=Ce.length;he<ue;he++)e=m.replace(c,"&").trim(),e=Ce[he].indexOf(" &")>0?Ce[he].replace("&","").trim()+" "+e:e+" "+Ce[he].trim(),me[fe]+=e.trim()+(he===ue-1?"":",")}N="\n"+me.join(",")+" {"+p+"}",q+=N.replace(/ +&/g,""),M=1,N="",X--}else{v=N.split(","),A="";for(var fe=0,re=v.length;fe<re;fe++){var xe=(e=v[fe]).charCodeAt(0);if(32===xe&&(xe=(e=e.trim()).charCodeAt(0)),91===xe&&93!==e.charCodeAt(e.length-1))for(var he=fe+1,ue=re-fe;he<ue;he++){var ye=(e+=","+v[he]).trim();if(93===ye.charCodeAt(ye.length-1)){re-=he,v.splice(fe,he);break}}if(38===xe)e=c+e.substring(1);else if((y=e.indexOf(" &"))>0&&(xe=58,e=":global("+e.substring(0,y)+")"+e.substring(y)),58===xe){var Oe=e.charCodeAt(1);if(104===Oe&&116===e.charCodeAt(4)){var we=(e=e.substring(5)).charCodeAt(0);40===we?e=c+e.substring(1).replace(")",""):45===we?(y=e.indexOf(")"),e=e.substring(9,y)+" "+c+e.substring(y+1)):e=c+e}else e=103===Oe?e.substring(8).replace(")","").replace("&",c):c+e}else e=c+" "+e;A+=0===fe?e:","+e}x=N=A}}else 125===D&&(0!==X&&X--,0===X&&1===M&&(t=t.substring(0,W+1)+q+t.substring(W+1),$+=q.length,q="",M=0,H++));0!==G?(125===D?H++:123===D&&0!==H&&H--,1!==S||123!==D&&0!==H||0===B.length||(S=0,N=c+" {"+B+"}"+N,B=""),0===H?(0===u?N="":1===u?(N="}@"+z+"}",z=""):3===u&&(E[R].body=z,R="",N="",z=""),u=0,H--,G--):1===u||3===u?(z+=N,3===u&&(N="")):2===u&&0===X&&(125!==D&&(0===S&&(B=""),B+=N,N=""),S=1)):0===X&&125!==D&&(Q=1,B=void 0===B?N:B+N,N="")}F+=N,N="",125!==D||0!==J||0!==u&&4!==u||(123!==F.charCodeAt(F.length-2)&&(d&&0!==F.length&&(m=l(3,F,Z,Y),null!=m&&(F=m)),_+=F.trim()),4===u&&(d&&(m=l(3,C,Z,Y),null!=m&&(C=m)),u=0,_+=C),F="")}W++,Y++}if(void 0!==B&&0!==B.length&&(B=c+" {"+B+"}",d&&(m=l(4,B,Z,Y),null!=m&&(B=m)),_+=B),n&&void 0!==j)for(var ee=0,re=j.length;ee<re;ee++)_=_.replace(new RegExp("var\\("+j[ee][0]+"\\)","g"),j[ee][1]);return d&&(m=l(6,_,Z,Y),null!=m&&(_=m)),_}return r.use=function(e,t){var i=r.plugins,n=i.length;if(null==t&&(t=e,e=void 0),null!=t)if(t.constructor===Object)for(var l in t)r.use(l,t[l]);else if(t.constructor===Array)for(var s=0,n=t.length;s<n;s++)i[n++]=t[s];else if(null==e)i[n]=t;else{var a=e instanceof RegExp?e:new RegExp(e+"\\([ \\t\\r\\n]*([^\\0]*?)[ \\t\\r\\n]*\\)","g"),o=/[ \t\r\n]*,[ \t\r\n]*/g;i[n]=function(e,r,i,n){if(6===e)return r=r.replace(a,function(e,r){var i=r.replace(o,",").split(","),n=t.apply(null,i);return null!=n?n:e})}}return r},r.plugins=[],r});
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