var W="comm",X="rule",Z="decl",y="@import",rr="@namespace",er="@keyframes",ar="@layer",cr=Math.abs,P=String.fromCharCode;function _(r){return r.trim()}function B(r,a,n){return r.replace(a,n)}function T(r,a){return r.charCodeAt(a)|0}function L(r,a,n){return r.slice(a,n)}function d(r){return r.length}function nr(r){return r.length}function D(r,a){return a.push(r),r}var U=1,N=1,$=0,o=0,i=0,O="";function H(r,a,n,c,t,w,R,v){return{value:r,root:a,parent:n,type:c,props:t,children:w,line:U,column:N,length:R,return:"",siblings:v}}function ir(){return i}function sr(){return i=o>0?T(O,--o):0,N--,i===10&&(N=1,U--),i}function h(){return i=o<$?T(O,o++):0,N++,i===10&&(N=1,U++),i}function M(){return T(O,o)}function F(){return o}function j(r,a){return L(O,r,a)}function Y(r){switch(r){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function tr(r){return U=N=1,$=d(O=r),o=0,[]}function ur(r){return O="",r}function q(r){return _(j(o-1,G(r===91?r+2:r===40?r+1:r)))}function fr(r){for(;(i=M())&&i<33;)h();return Y(r)>2||Y(i)>3?"":" "}function or(r,a){for(;--a&&h()&&!(i<48||i>102||i>57&&i<65||i>70&&i<97););return j(r,F()+(a<6&&M()==32&&h()==32))}function G(r){for(;h();)switch(i){case r:return o;case 34:case 39:r!==34&&r!==39&&G(i);break;case 40:r===41&&G(r);break;case 92:h();break}return o}function vr(r,a){for(;h()&&r+i!==57;)if(r+i===84&&M()===47)break;return"/*"+j(a,o-1)+"*"+P(r===47?r:h())}function hr(r){for(;!Y(M());)h();return j(r,o)}function kr(r){return ur(K("",null,null,null,[""],r=tr(r),0,[0],r))}function K(r,a,n,c,t,w,R,v,g){for(var S=0,b=0,u=R,z=0,p=0,E=0,f=1,I=1,m=1,k=0,s=0,A="",x=t,C=w,l=c,e=A;I;)switch(E=s,s=h()){case 40:E!=108&&T(e,u-1)==58?(k++,e+="("):e+=q(s);break;case 41:k--,e+=")";break;case 34:case 39:case 91:e+=q(s);break;case 9:case 10:case 13:case 32:if(k>0){e+=P(s);break}e+=fr(E);break;case 92:e+=or(F()-1,7);continue;case 47:switch(M()){case 42:case 47:D(br(vr(h(),F()),a,n,g),g),(Y(E||1)==5||Y(M()||1)==5)&&d(e)&&L(e,-1,void 0)!==" "&&(e+=" ");break;default:e+="/"}break;case 123*f:v[S++]=d(e)*m;case 125*f:case 59:case 0:if(k>0&&s){e+=P(s);break}switch(s){case 0:case 125:I=0;case 59+b:m==-1&&(e=B(e,/\f/g,"")),p>0&&(d(e)-u||f===0)&&D(p>32?Q(e+";",c,n,u-1,g):Q(B(e," ","")+";",c,n,u-2,g),g);break;case 59:e+=";";default:if(D(l=J(e,a,n,S,b,t,v,A,x=[],C=[],u,w),w),s===123)if(b===0)K(e,a,l,l,x,w,u,v,C);else{switch(z){case 99:if(T(e,3)===110)break;case 108:if(T(e,2)===97)break;default:b=0;case 100:case 109:case 115:}b?K(r,l,l,c&&D(J(r,l,l,0,0,t,v,A,t,x=[],u,C),C),t,C,u,v,c?x:C):K(e,l,l,l,[""],C,0,v,C)}}S=b=p=0,f=m=1,A=e="",u=R;break;case 58:u=1+d(e),p=E;default:if(f<1){if(s==123)--f;else if(s==125&&f++==0&&sr()==125)continue}switch(e+=P(s),s*f){case 38:m=b>0?1:(e+="\f",-1);break;case 44:if(k>0)break;v[S++]=(d(e)-1)*m,m=1;break;case 64:M()===45&&(e+=q(h())),z=M(),b=u=d(A=e+=hr(F())),s++;break;case 45:E===45&&d(e)==2&&(f=0)}}return w}function J(r,a,n,c,t,w,R,v,g,S,b,u){for(var z=t-1,p=t===0?w:[""],E=nr(p),f=0,I=0,m=0;f<c;++f)for(var k=0,s=L(r,z+1,z=cr(I=R[f])),A=r;k<E;++k)(A=_(I>0?p[k]+" "+s:B(s,/&\f/g,p[k])))&&(g[m++]=A);return H(r,a,n,t===0?X:v,g,S,b,u)}function br(r,a,n,c){return H(r,a,n,W,P(ir()),L(r,2,-2),0,c)}function Q(r,a,n,c,t){return H(r,a,n,Z,L(r,0,c),L(r,c+1,-1),c,t)}function V(r,a){for(var n="",c=0;c<r.length;c++)n+=a(r[c],c,r,a)||"";return n}function lr(r,a,n,c){switch(r.type){case ar:if(r.children.length)break;case y:case rr:case Z:return r.return=r.return||r.value;case W:return"";case er:return r.return=r.value+"{"+V(r.children,c)+"}";case X:if(!d(r.value=r.props.join(",")))return""}return d(n=V(r.children,c))?r.return=r.value+"{"+n+"}":""}export{lr as a,kr as c,V as s};
