@eslint/css-tree
Version:
A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations
12 lines • 201 kB
JavaScript
var csstree=(()=>{var Va=Object.create;var zt=Object.defineProperty;var Qa=Object.getOwnPropertyDescriptor;var Xa=Object.getOwnPropertyNames;var $a=Object.getPrototypeOf,Za=Object.prototype.hasOwnProperty;var _e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=(e,t)=>{for(var r in t)zt(e,r,{get:t[r],enumerable:!0})},yi=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Xa(t))!Za.call(e,o)&&o!==r&&zt(e,o,{get:()=>t[o],enumerable:!(n=Qa(t,o))||n.enumerable});return e};var Ja=(e,t,r)=>(r=e!=null?Va($a(e)):{},yi(t||!e||!e.__esModule?zt(r,"default",{value:e,enumerable:!0}):r,e)),el=e=>yi(zt({},"__esModule",{value:!0}),e);var Di=_e(vr=>{var Ni="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");vr.encode=function(e){if(0<=e&&e<Ni.length)return Ni[e];throw new TypeError("Must be between 0 and 63: "+e)};vr.decode=function(e){var t=65,r=90,n=97,o=122,i=48,s=57,u=43,c=47,a=26,l=52;return t<=e&&e<=r?e-t:n<=e&&e<=o?e-n+a:i<=e&&e<=s?e-i+l:e==u?62:e==c?63:-1}});var Bi=_e(Cr=>{var Oi=Di(),Sr=5,Fi=1<<Sr,Ri=Fi-1,Mi=Fi;function hl(e){return e<0?(-e<<1)+1:(e<<1)+0}function ml(e){var t=(e&1)===1,r=e>>1;return t?-r:r}Cr.encode=function(t){var r="",n,o=hl(t);do n=o&Ri,o>>>=Sr,o>0&&(n|=Mi),r+=Oi.encode(n);while(o>0);return r};Cr.decode=function(t,r,n){var o=t.length,i=0,s=0,u,c;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(c=Oi.decode(t.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));u=!!(c&Mi),c&=Ri,i=i+(c<<s),s+=Sr}while(u);n.value=ml(i),n.rest=r}});var qt=_e(W=>{function dl(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}W.getArg=dl;var _i=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,fl=/^data:.+\,.+$/;function ct(e){var t=e.match(_i);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}W.urlParse=ct;function Qe(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}W.urlGenerate=Qe;var gl=32;function bl(e){var t=[];return function(r){for(var n=0;n<t.length;n++)if(t[n].input===r){var o=t[0];return t[0]=t[n],t[n]=o,t[0].result}var i=e(r);return t.unshift({input:r,result:i}),t.length>gl&&t.pop(),i}}var Tr=bl(function(t){var r=t,n=ct(t);if(n){if(!n.path)return t;r=n.path}for(var o=W.isAbsolute(r),i=[],s=0,u=0;;)if(s=u,u=r.indexOf("/",s),u===-1){i.push(r.slice(s));break}else for(i.push(r.slice(s,u));u<r.length&&r[u]==="/";)u++;for(var c,a=0,u=i.length-1;u>=0;u--)c=i[u],c==="."?i.splice(u,1):c===".."?a++:a>0&&(c===""?(i.splice(u+1,a),a=0):(i.splice(u,2),a--));return r=i.join("/"),r===""&&(r=o?"/":"."),n?(n.path=r,Qe(n)):r});W.normalize=Tr;function Wi(e,t){e===""&&(e="."),t===""&&(t=".");var r=ct(t),n=ct(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Qe(r);if(r||t.match(fl))return t;if(n&&!n.host&&!n.path)return n.host=t,Qe(n);var o=t.charAt(0)==="/"?t:Tr(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Qe(n)):o}W.join=Wi;W.isAbsolute=function(e){return e.charAt(0)==="/"||_i.test(e)};function yl(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}W.relative=yl;var qi=function(){var e=Object.create(null);return!("__proto__"in e)}();function ji(e){return e}function xl(e){return Ui(e)?"$"+e:e}W.toSetString=qi?ji:xl;function kl(e){return Ui(e)?e.slice(1):e}W.fromSetString=qi?ji:kl;function Ui(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function wl(e,t,r){var n=ke(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:ke(e.name,t.name)}W.compareByOriginalPositions=wl;function vl(e,t,r){var n;return n=e.originalLine-t.originalLine,n!==0||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:ke(e.name,t.name)}W.compareByOriginalPositionsNoSource=vl;function Sl(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=ke(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:ke(e.name,t.name)}W.compareByGeneratedPositionsDeflated=Sl;function Cl(e,t,r){var n=e.generatedColumn-t.generatedColumn;return n!==0||r||(n=ke(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:ke(e.name,t.name)}W.compareByGeneratedPositionsDeflatedNoLine=Cl;function ke(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function Tl(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=ke(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:ke(e.name,t.name)}W.compareByGeneratedPositionsInflated=Tl;function Al(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}W.parseSourceMapInput=Al;function El(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=ct(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}t=Wi(Qe(n),t)}return Tr(t)}W.computeSourceURL=El});var Gi=_e(Hi=>{var Ar=qt(),Er=Object.prototype.hasOwnProperty,Oe=typeof Map<"u";function we(){this._array=[],this._set=Oe?new Map:Object.create(null)}we.fromArray=function(t,r){for(var n=new we,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};we.prototype.size=function(){return Oe?this._set.size:Object.getOwnPropertyNames(this._set).length};we.prototype.add=function(t,r){var n=Oe?t:Ar.toSetString(t),o=Oe?this.has(t):Er.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(Oe?this._set.set(t,i):this._set[n]=i)};we.prototype.has=function(t){if(Oe)return this._set.has(t);var r=Ar.toSetString(t);return Er.call(this._set,r)};we.prototype.indexOf=function(t){if(Oe){var r=this._set.get(t);if(r>=0)return r}else{var n=Ar.toSetString(t);if(Er.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};we.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};we.prototype.toArray=function(){return this._array.slice()};Hi.ArraySet=we});var Vi=_e(Ki=>{var Yi=qt();function Ll(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||Yi.compareByGeneratedPositionsInflated(e,t)<=0}function jt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}jt.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};jt.prototype.add=function(t){Ll(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};jt.prototype.toArray=function(){return this._sorted||(this._array.sort(Yi.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Ki.MappingList=jt});var Xi=_e(Qi=>{var ut=Bi(),B=qt(),Ut=Gi().ArraySet,zl=Vi().MappingList;function ne(e){e||(e={}),this._file=B.getArg(e,"file",null),this._sourceRoot=B.getArg(e,"sourceRoot",null),this._skipValidation=B.getArg(e,"skipValidation",!1),this._sources=new Ut,this._names=new Ut,this._mappings=new zl,this._sourcesContents=null}ne.prototype._version=3;ne.fromSourceMap=function(t){var r=t.sourceRoot,n=new ne({file:t.file,sourceRoot:r});return t.eachMapping(function(o){var i={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(i.source=o.source,r!=null&&(i.source=B.relative(r,i.source)),i.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(i.name=o.name)),n.addMapping(i)}),t.sources.forEach(function(o){var i=o;r!==null&&(i=B.relative(r,o)),n._sources.has(i)||n._sources.add(i);var s=t.sourceContentFor(o);s!=null&&n.setSourceContent(o,s)}),n};ne.prototype.addMapping=function(t){var r=B.getArg(t,"generated"),n=B.getArg(t,"original",null),o=B.getArg(t,"source",null),i=B.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,o,i),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i})};ne.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=B.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[B.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[B.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};ne.prototype.applySourceMap=function(t,r,n){var o=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var i=this._sourceRoot;i!=null&&(o=B.relative(i,o));var s=new Ut,u=new Ut;this._mappings.unsortedForEach(function(c){if(c.source===o&&c.originalLine!=null){var a=t.originalPositionFor({line:c.originalLine,column:c.originalColumn});a.source!=null&&(c.source=a.source,n!=null&&(c.source=B.join(n,c.source)),i!=null&&(c.source=B.relative(i,c.source)),c.originalLine=a.line,c.originalColumn=a.column,a.name!=null&&(c.name=a.name))}var l=c.source;l!=null&&!s.has(l)&&s.add(l);var p=c.name;p!=null&&!u.has(p)&&u.add(p)},this),this._sources=s,this._names=u,t.sources.forEach(function(c){var a=t.sourceContentFor(c);a!=null&&(n!=null&&(c=B.join(n,c)),i!=null&&(c=B.relative(i,c)),this.setSourceContent(c,a))},this)};ne.prototype._validateMapping=function(t,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!o)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:o}))}};ne.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,o=0,i=0,s=0,u="",c,a,l,p,h=this._mappings.toArray(),d=0,g=h.length;d<g;d++){if(a=h[d],c="",a.generatedLine!==r)for(t=0;a.generatedLine!==r;)c+=";",r++;else if(d>0){if(!B.compareByGeneratedPositionsInflated(a,h[d-1]))continue;c+=","}c+=ut.encode(a.generatedColumn-t),t=a.generatedColumn,a.source!=null&&(p=this._sources.indexOf(a.source),c+=ut.encode(p-s),s=p,c+=ut.encode(a.originalLine-1-o),o=a.originalLine-1,c+=ut.encode(a.originalColumn-n),n=a.originalColumn,a.name!=null&&(l=this._names.indexOf(a.name),c+=ut.encode(l-i),i=l)),u+=c}return u};ne.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=B.relative(r,n));var o=B.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};ne.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};ne.prototype.toString=function(){return JSON.stringify(this.toJSON())};Qi.SourceMapGenerator=ne});var Ud={};f(Ud,{Lexer:()=>Re,List:()=>j,OffsetToLocation:()=>Ke,TokenStream:()=>Ve,clone:()=>mr,createLexer:()=>Fd,createSyntax:()=>ir,definitionSyntax:()=>Zr,find:()=>Md,findAll:()=>_d,findLast:()=>Bd,fork:()=>jd,fromPlainObject:()=>qd,generate:()=>Dd,ident:()=>bi,isCustomProperty:()=>dt,keyword:()=>mt,lexer:()=>Od,parse:()=>Nd,property:()=>Qt,string:()=>cr,toPlainObject:()=>Wd,tokenNames:()=>Ce,tokenTypes:()=>Pt,tokenize:()=>Id,url:()=>pr,vendorPrefix:()=>Ul,version:()=>Ld,walk:()=>Rd});var We=null,j=class e{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return e.createItem(t)}allocateCursor(t,r){let n;return We!==null?(n=We,We=We.cursor,n.prev=t,n.next=r,n.cursor=this.cursor):n={prev:t,next:r,cursor:this.cursor},this.cursor=n,n}releaseCursor(){let{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=We,We=t}updateCursors(t,r,n,o){let{cursor:i}=this;for(;i!==null;)i.prev===t&&(i.prev=r),i.next===n&&(i.next=o),i=i.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let r=this.head;r!==null;r=r.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let r=null;this.head=null;for(let n of t){let o=e.createItem(n);r!==null?r.next=o:this.head=o,o.prev=r,r=o}return this.tail=r,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,r=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let o=n.next;n.next=o.next,t.call(r,o.data,o,this)}this.releaseCursor()}forEachRight(t,r=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let o=n.prev;n.prev=o.prev,t.call(r,o.data,o,this)}this.releaseCursor()}reduce(t,r,n=this){let o=this.allocateCursor(null,this.head),i=r,s;for(;o.next!==null;)s=o.next,o.next=s.next,i=t.call(n,i,s.data,s,this);return this.releaseCursor(),i}reduceRight(t,r,n=this){let o=this.allocateCursor(this.tail,null),i=r,s;for(;o.prev!==null;)s=o.prev,o.prev=s.prev,i=t.call(n,i,s.data,s,this);return this.releaseCursor(),i}some(t,r=this){for(let n=this.head;n!==null;n=n.next)if(t.call(r,n.data,n,this))return!0;return!1}map(t,r=this){let n=new e;for(let o=this.head;o!==null;o=o.next)n.appendData(t.call(r,o.data,o,this));return n}filter(t,r=this){let n=new e;for(let o=this.head;o!==null;o=o.next)t.call(r,o.data,o,this)&&n.appendData(o.data);return n}nextUntil(t,r,n=this){if(t===null)return;let o=this.allocateCursor(null,t);for(;o.next!==null;){let i=o.next;if(o.next=i.next,r.call(n,i.data,i,this))break}this.releaseCursor()}prevUntil(t,r,n=this){if(t===null)return;let o=this.allocateCursor(t,null);for(;o.prev!==null;){let i=o.prev;if(o.prev=i.prev,r.call(n,i.data,i,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new e;for(let r of this)t.appendData(r);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(e.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(e.createItem(t))}insert(t,r=null){if(r!==null)if(this.updateCursors(r.prev,t,r,t),r.prev===null){if(this.head!==r)throw new Error("before doesn't belong to list");this.head=t,r.prev=t,t.next=r,this.updateCursors(null,t)}else r.prev.next=t,t.prev=r.prev,r.prev=t,t.next=r;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,r){return this.insert(e.createItem(t),r)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(e.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(e.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,r){return t.head===null?this:(r!=null?(this.updateCursors(r.prev,t.tail,r,t.head),r.prev!==null?(r.prev.next=t.head,t.head.prev=r.prev):this.head=t.head,r.prev=t.tail,t.tail.next=r):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,r){"head"in r?this.insertList(r,t):this.insert(r,t),this.remove(t)}};function Ie(e,t){let r=Object.create(SyntaxError.prototype),n=new Error;return Object.assign(r,{name:e,message:t,get stack(){return(n.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
`)}})}var dr=100,xi=60,ki=" ";function wi({source:e,line:t,column:r,baseLine:n,baseColumn:o},i){function s(g,ee){return a.slice(g,ee).map((Y,w)=>String(g+w+1).padStart(h)+" |"+Y).join(`
`)}let u=`
`.repeat(Math.max(n-1,0)),c=" ".repeat(Math.max(o-1,0)),a=(u+c+e).split(/\r\n?|\n|\f/),l=Math.max(1,t-i)-1,p=Math.min(t+i,a.length+1),h=Math.max(4,String(p).length)+1,d=0;r+=(ki.length-1)*(a[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>dr&&(d=r-xi+3,r=xi-2);for(let g=l;g<=p;g++)g>=0&&g<a.length&&(a[g]=a[g].replace(/\t/g,ki),a[g]=(d>0&&a[g].length>d?"\u2026":"")+a[g].substr(d,dr-2)+(a[g].length>d+dr-1?"\u2026":""));return[s(l,t),new Array(r+h+2).join("-")+"^",s(t,p)].filter(Boolean).join(`
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function fr(e,t,r,n,o,i=1,s=1){return Object.assign(Ie("SyntaxError",e),{source:t,offset:r,line:n,column:o,sourceFragment(c){return wi({source:t,line:n,column:o,baseLine:i,baseColumn:s},isNaN(c)?0:c)},get formattedMessage(){return`Parse error: ${e}
`+wi({source:t,line:n,column:o,baseLine:i,baseColumn:s},2)}})}var Pt={};f(Pt,{AtKeyword:()=>N,BadString:()=>qe,BadUrl:()=>V,CDC:()=>Q,CDO:()=>Ne,Colon:()=>D,Comma:()=>U,Comment:()=>F,Delim:()=>v,Dimension:()=>k,EOF:()=>be,Function:()=>x,Hash:()=>T,Ident:()=>m,LeftCurlyBracket:()=>O,LeftParenthesis:()=>S,LeftSquareBracket:()=>H,Number:()=>b,Percentage:()=>P,RightCurlyBracket:()=>G,RightParenthesis:()=>y,RightSquareBracket:()=>Z,Semicolon:()=>M,String:()=>te,Url:()=>_,WhiteSpace:()=>L});var be=0,m=1,x=2,N=3,T=4,te=5,qe=6,_=7,V=8,v=9,b=10,P=11,k=12,L=13,Ne=14,Q=15,D=16,M=17,U=18,H=19,Z=20,S=21,y=22,O=23,G=24,F=25;function R(e){return e>=48&&e<=57}function J(e){return R(e)||e>=65&&e<=70||e>=97&&e<=102}function Nt(e){return e>=65&&e<=90}function tl(e){return e>=97&&e<=122}function rl(e){return Nt(e)||tl(e)}function nl(e){return e>=128}function It(e){return rl(e)||nl(e)||e===95}function je(e){return It(e)||R(e)||e===45}function ol(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function ot(e){return e===10||e===13||e===12}function me(e){return ot(e)||e===32||e===9}function X(e,t){return!(e!==92||ot(t)||t===0)}function Ue(e,t,r){return e===45?It(t)||t===45||X(t,r):It(e)?!0:e===92?X(e,t):!1}function Dt(e,t,r){return e===43||e===45?R(t)?2:t===46&&R(r)?3:0:e===46?R(t)?2:0:R(e)?1:0}function Ot(e){return e===65279||e===65534?1:0}var gr=new Array(128),il=128,it=130,br=131,Ft=132,yr=133;for(let e=0;e<gr.length;e++)gr[e]=me(e)&&it||R(e)&&br||It(e)&&Ft||ol(e)&&yr||e||il;function Rt(e){return e<128?gr[e]:Ft}function He(e,t){return t<e.length?e.charCodeAt(t):0}function Mt(e,t,r){return r===13&&He(e,t+1)===10?2:1}function ye(e,t,r){let n=e.charCodeAt(t);return Nt(n)&&(n=n|32),n===r}function xe(e,t,r,n){if(r-t!==n.length||t<0||r>e.length)return!1;for(let o=t;o<r;o++){let i=n.charCodeAt(o-t),s=e.charCodeAt(o);if(Nt(s)&&(s=s|32),s!==i)return!1}return!0}function vi(e,t){for(;t>=0&&me(e.charCodeAt(t));t--);return t+1}function st(e,t){for(;t<e.length&&me(e.charCodeAt(t));t++);return t}function xr(e,t){for(;t<e.length&&R(e.charCodeAt(t));t++);return t}function ae(e,t){if(t+=2,J(He(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&J(He(e,t));t++);let r=He(e,t);me(r)&&(t+=Mt(e,t,r))}return t}function at(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(!je(r)){if(X(r,He(e,t+1))){t=ae(e,t)-1;continue}break}}return t}function De(e,t){let r=e.charCodeAt(t);if((r===43||r===45)&&(r=e.charCodeAt(t+=1)),R(r)&&(t=xr(e,t+1),r=e.charCodeAt(t)),r===46&&R(e.charCodeAt(t+1))&&(t+=2,t=xr(e,t)),ye(e,t,101)){let n=0;r=e.charCodeAt(t+1),(r===45||r===43)&&(n=1,r=e.charCodeAt(t+2)),R(r)&&(t=xr(e,t+1+n+1))}return t}function Bt(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r===41){t++;break}X(r,He(e,t+1))&&(t=ae(e,t))}return t}function Ge(e){if(e.length===1&&!J(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var Ce=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function Ye(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}var Si=10,sl=12,Ci=13;function Ti(e){let t=e.source,r=t.length,n=t.length>0?Ot(t.charCodeAt(0)):0,o=Ye(e.lines,r),i=Ye(e.columns,r),s=e.startLine,u=e.startColumn;for(let c=n;c<r;c++){let a=t.charCodeAt(c);o[c]=s,i[c]=u++,(a===Si||a===Ci||a===sl)&&(a===Ci&&c+1<r&&t.charCodeAt(c+1)===Si&&(c++,o[c]=s,i[c]=u),s++,u=1)}o[r]=s,i[r]=u,e.lines=o,e.columns=i,e.computed=!0}var Ke=class{constructor(t,r,n,o){this.setSource(t,r,n,o),this.lines=null,this.columns=null}setSource(t="",r=0,n=1,o=1){this.source=t,this.startOffset=r,this.startLine=n,this.startColumn=o,this.computed=!1}getLocation(t,r){return this.computed||Ti(this),{source:r,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,r,n){return this.computed||Ti(this),{source:n,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+r,line:this.lines[r],column:this.columns[r]}}}};var le=16777215,ce=24,lt=1,_t=2,Te=new Uint8Array(32);Te[2]=22;Te[21]=22;Te[19]=20;Te[23]=24;var ue=new Uint8Array(32);ue[2]=lt;ue[21]=lt;ue[19]=lt;ue[23]=lt;ue[22]=_t;ue[20]=_t;ue[24]=_t;function Ai(e,t,r){return e<t?t:e>r?r:e}var Ve=class{constructor(t,r){this.setSource(t,r)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",r=()=>{}){t=String(t||"");let n=t.length,o=Ye(this.offsetAndType,t.length+1),i=Ye(this.balance,t.length+1),s=0,u=-1,c=0,a=t.length;this.offsetAndType=null,this.balance=null,i.fill(0),r(t,(l,p,h)=>{let d=s++;if(o[d]=l<<ce|h,u===-1&&(u=p),i[d]=a,l===c){let g=i[a];i[a]=d,a=g,c=Te[o[g]>>ce]}else this.isBlockOpenerTokenType(l)&&(a=d,c=Te[l])}),o[s]=0<<ce|n,i[s]=s;for(let l=0;l<s;l++){let p=i[l];if(p<=l){let h=i[p];h!==l&&(i[l]=h)}else p>s&&(i[l]=s)}this.source=t,this.firstCharOffset=u===-1?0:u,this.tokenCount=s,this.offsetAndType=o,this.balance=i,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>ce:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>ce;if(n!==13&&n!==25&&t--===0)return n}return 0}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&le:this.source.length}lookupOffsetNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>ce;if(n!==13&&n!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t<this.tokenCount?xe(this.source,this.offsetAndType[t-1]&le,this.offsetAndType[t]&le,r):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&le:this.offsetAndType[this.tokenCount]&le:this.firstCharOffset}getTokenEnd(t){return t===this.tokenIndex?this.tokenEnd:this.offsetAndType[Ai(t,0,this.tokenCount)]&le}getTokenType(t){return t===this.tokenIndex?this.tokenType:this.offsetAndType[Ai(t,0,this.tokenCount)]>>ce}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBlockOpenerTokenType(t){return ue[t]===lt}isBlockCloserTokenType(t){return ue[t]===_t}getBlockTokenPairIndex(t){let r=this.getTokenType(t);if(ue[r]===1){let n=this.balance[t],o=this.getTokenType(n);return Te[r]===o?n:-1}else if(ue[r]===2){let n=this.balance[t],o=this.getTokenType(n);return Te[o]===r?n:-1}return-1}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,r){return r?this.lookupType(r)===9&&this.source.charCodeAt(this.lookupOffset(r))===t:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let r=this.tokenIndex+t;r<this.tokenCount?(this.tokenIndex=r,this.tokenStart=this.offsetAndType[r-1]&le,r=this.offsetAndType[r],this.tokenType=r>>ce,this.tokenEnd=r&le):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>ce,this.tokenEnd=t&le):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(t,r){let n=t,o=0,i=0;e:for(;n<this.tokenCount;n++){if(o=this.balance[n],o<t)break e;switch(i=n>0?this.offsetAndType[n-1]&le:this.firstCharOffset,r(this.source.charCodeAt(i))){case 1:break e;case 2:n++;break e;default:this.isBlockOpenerTokenType(this.offsetAndType[n]>>ce)&&(n=o)}}this.skip(n-this.tokenIndex)}forEachToken(t){for(let r=0,n=this.firstCharOffset;r<this.tokenCount;r++){let o=n,i=this.offsetAndType[r],s=i&le,u=i>>ce;n=s,t(u,o,s,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,n,o,i)=>{t[i]={idx:i,type:Ce[r],chunk:this.source.substring(n,o),balance:this.balance[i]}}),t}};function Wt(e,t){function r(p){return p<u?e.charCodeAt(p):0}function n(){if(a=De(e,a),Ue(r(a),r(a+1),r(a+2))){l=12,a=at(e,a);return}if(r(a)===37){l=11,a++;return}l=10}function o(){let p=a;if(a=at(e,a),xe(e,p,a,"url")&&r(a)===40){if(a=st(e,a+1),r(a)===34||r(a)===39){l=2,a=p+4;return}s();return}if(r(a)===40){l=2,a++;return}l=1}function i(p){for(p||(p=r(a++)),l=5;a<e.length;a++){let h=e.charCodeAt(a);switch(Rt(h)){case p:a++;return;case it:if(ot(h)){a+=Mt(e,a,h),l=6;return}break;case 92:if(a===e.length-1)break;let d=r(a+1);ot(d)?a+=Mt(e,a+1,d):X(h,d)&&(a=ae(e,a)-1);break}}}function s(){for(l=7,a=st(e,a);a<e.length;a++){let p=e.charCodeAt(a);switch(Rt(p)){case 41:a++;return;case it:if(a=st(e,a),r(a)===41||a>=e.length){a<e.length&&a++;return}a=Bt(e,a),l=8;return;case 34:case 39:case 40:case yr:a=Bt(e,a),l=8;return;case 92:if(X(p,r(a+1))){a=ae(e,a)-1;break}a=Bt(e,a),l=8;return}}}e=String(e||"");let u=e.length,c=Ot(r(0)),a=c,l;for(;a<u;){let p=e.charCodeAt(a);switch(Rt(p)){case it:l=13,a=st(e,a+1);break;case 34:i();break;case 35:je(r(a+1))||X(r(a+1),r(a+2))?(l=4,a=at(e,a+1)):(l=9,a++);break;case 39:i();break;case 40:l=21,a++;break;case 41:l=22,a++;break;case 43:Dt(p,r(a+1),r(a+2))?n():(l=9,a++);break;case 44:l=18,a++;break;case 45:Dt(p,r(a+1),r(a+2))?n():r(a+1)===45&&r(a+2)===62?(l=15,a=a+3):Ue(p,r(a+1),r(a+2))?o():(l=9,a++);break;case 46:Dt(p,r(a+1),r(a+2))?n():(l=9,a++);break;case 47:r(a+1)===42?(l=25,a=e.indexOf("*/",a+2),a=a===-1?e.length:a+2):(l=9,a++);break;case 58:l=16,a++;break;case 59:l=17,a++;break;case 60:r(a+1)===33&&r(a+2)===45&&r(a+3)===45?(l=14,a=a+4):(l=9,a++);break;case 64:Ue(r(a+1),r(a+2),r(a+3))?(l=3,a=at(e,a+1)):(l=9,a++);break;case 91:l=19,a++;break;case 92:X(p,r(a+1))?o():(l=9,a++);break;case 93:l=20,a++;break;case 123:l=23,a++;break;case 125:l=24,a++;break;case br:n();break;case Ft:o();break;default:l=9,a++}t(l,c,c=a)}}function Ei(e){let t=this.createList(),r=!1,n={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:r=!0,this.next();continue}let o=e.getNode.call(this,n);if(o===void 0)break;r&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,n),r=!1),t.push(o)}return r&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,n),t}var al="function";function Ae(e){return e&&typeof e.tokenize===al?e.tokenize:Wt}var Li=()=>{},ll=33,cl=35,kr=59,zi=123,Pi=0;function ul(e){return function(){return this[e]()}}function wr(e){let t=Object.create(null);for(let r of Object.keys(e)){let n=e[r],o=n.parse||n;o&&(t[r]=o)}return t}function pl(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:wr(e.atrule),pseudo:wr(e.pseudo),node:wr(e.node),tokenize:Ae(e)};for(let[r,n]of Object.entries(e.parseContext))switch(typeof n){case"function":t.context[r]=n;break;case"string":t.context[r]=ul(n);break}return{config:t,...t,...t.node}}function Ii(e){let t="",r="<unknown>",n=!1,o=Li,i=!1,s=new Ke,u=Object.assign(new Ve,pl(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Ei,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(l){return l===zi?1:0},consumeUntilLeftCurlyBracketOrSemicolon(l){return l===zi||l===kr?1:0},consumeUntilExclamationMarkOrSemicolon(l){return l===ll||l===kr?1:0},consumeUntilSemicolonIncluded(l){return l===kr?2:0},createList(){return new j},createSingleNodeList(l){return new j().appendData(l)},getFirstListNode(l){return l&&l.first},getLastListNode(l){return l&&l.last},parseWithFallback(l,p){let h=this.tokenIndex;try{return l.call(this)}catch(d){if(i)throw d;this.skip(h-this.tokenIndex);let g=p.call(this);return i=!0,o(d,g),i=!1,g}},lookupNonWSType(l){let p;do if(p=this.lookupType(l++),p!==13&&p!==25)return p;while(p!==Pi);return Pi},charCodeAt(l){return l>=0&&l<t.length?t.charCodeAt(l):0},substring(l,p){return t.substring(l,p)},substrToCursor(l){return this.source.substring(l,this.tokenStart)},cmpChar(l,p){return ye(t,l,p)},cmpStr(l,p,h){return xe(t,l,p,h)},consume(l){let p=this.tokenStart;return this.eat(l),this.substrToCursor(p)},consumeFunctionName(){let l=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),l},consumeNumber(l){let p=t.substring(this.tokenStart,De(t,this.tokenStart));return this.eat(l),p},eat(l){if(this.tokenType!==l){let p=Ce[l].slice(0,-6).replace(/-/g," ").replace(/^./,g=>g.toUpperCase()),h=`${/[[\](){}]/.test(p)?`"${p}"`:p} is expected`,d=this.tokenStart;switch(l){case 1:this.tokenType===2||this.tokenType===7?(d=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case 4:this.isDelim(cl)&&(this.next(),d++,h="Name is expected");break;case 11:this.tokenType===10&&(d=this.tokenEnd,h="Percent sign is expected");break}this.error(h,d)}this.next()},eatIdent(l){(this.tokenType!==1||this.lookupValue(0,l)===!1)&&this.error(`Identifier "${l}" is expected`),this.next()},eatDelim(l){this.isDelim(l)||this.error(`Delim "${String.fromCharCode(l)}" is expected`),this.next()},getLocation(l,p){return n?s.getLocationRange(l,p,r):null},getLocationFromList(l){if(n){let p=this.getFirstListNode(l),h=this.getLastListNode(l);return s.getLocationRange(p!==null?p.loc.start.offset-s.startOffset:this.tokenStart,h!==null?h.loc.end.offset-s.startOffset:this.tokenStart,r)}return null},error(l,p){let h=typeof p<"u"&&p<t.length?s.getLocation(p):this.eof?s.getLocation(vi(t,t.length-1)):s.getLocation(this.tokenStart);throw new fr(l||"Unexpected input",t,h.offset,h.line,h.column,s.startLine,s.startColumn)}}),c=()=>({filename:r,source:t,tokenCount:u.tokenCount,getTokenType:l=>u.getTokenType(l),getTokenTypeName:l=>Ce[u.getTokenType(l)],getTokenStart:l=>u.getTokenStart(l),getTokenEnd:l=>u.getTokenEnd(l),getTokenValue:l=>u.source.substring(u.getTokenStart(l),u.getTokenEnd(l)),substring:(l,p)=>u.source.substring(l,p),balance:u.balance.subarray(0,u.tokenCount+1),isBlockOpenerTokenType:u.isBlockOpenerTokenType,isBlockCloserTokenType:u.isBlockCloserTokenType,getBlockTokenPairIndex:l=>u.getBlockTokenPairIndex(l),getLocation:l=>s.getLocation(l,r),getRangeLocation:(l,p)=>s.getLocationRange(l,p,r)});return Object.assign(function(l,p){t=l,p=p||{},u.setSource(t,u.tokenize),s.setSource(t,p.offset,p.line,p.column),r=p.filename||"<unknown>",n=!!p.positions,o=typeof p.onParseError=="function"?p.onParseError:Li,i=!1,u.parseAtrulePrelude="parseAtrulePrelude"in p?!!p.parseAtrulePrelude:!0,u.parseRulePrelude="parseRulePrelude"in p?!!p.parseRulePrelude:!0,u.parseValue="parseValue"in p?!!p.parseValue:!0,u.parseCustomProperty="parseCustomProperty"in p?!!p.parseCustomProperty:!1;let{context:h="default",onComment:d,onToken:g}=p;if(!(h in u.context))throw new Error("Unknown context `"+h+"`");Array.isArray(g)?u.forEachToken((Y,w,A)=>{g.push({type:Y,start:w,end:A})}):typeof g=="function"&&u.forEachToken(g.bind(c())),typeof d=="function"&&u.forEachToken((Y,w,A)=>{if(Y===25){let he=u.getLocation(w,A),z=xe(t,A-2,A,"*/")?t.slice(w+2,A-2):t.slice(w+2,A);d(z,he)}});let ee=u.context[h].call(u,p);return u.eof||u.error(),ee},{SyntaxError:fr,config:u.config})}var Zi=Ja(Xi(),1),$i=new Set(["Atrule","Selector","Declaration"]);function Ji(e){let t=new Zi.SourceMapGenerator,r={line:1,column:0},n={line:0,column:0},o={line:1,column:0},i={generated:o},s=1,u=0,c=!1,a=e.node;e.node=function(h){if(h.loc&&h.loc.start&&$i.has(h.type)){let d=h.loc.start.line,g=h.loc.start.column-1;(n.line!==d||n.column!==g)&&(n.line=d,n.column=g,r.line=s,r.column=u,c&&(c=!1,(r.line!==o.line||r.column!==o.column)&&t.addMapping(i)),c=!0,t.addMapping({source:h.loc.source,original:n,generated:r}))}a.call(this,h),c&&$i.has(h.type)&&(o.line=s,o.column=u)};let l=e.emit;e.emit=function(h,d,g){for(let ee=0;ee<h.length;ee++)h.charCodeAt(ee)===10?(s++,u=0):u++;l(h,d,g)};let p=e.result;return e.result=function(){return c&&t.addMapping(i),{css:p(),map:t}},e}var Ht={};f(Ht,{safe:()=>zr,spec:()=>Dl});var Pl=43,Il=45,Lr=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){let r=e.charCodeAt(0);return r>127?32768:r<<8}return e},es=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],Nl=es.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function ts(e){let t=new Set(e.map(([r,n])=>Lr(r)<<16|Lr(n)));return function(r,n,o){let i=Lr(n,o),s=o.charCodeAt(0);return(s===Il&&n!==1&&n!==2&&n!==15||s===Pl?t.has(r<<16|s<<8):t.has(r<<16|i))&&this.emit(" ",13,!0),i}}var Dl=ts(es),zr=ts(Nl);var Ol=92;function Fl(e,t){if(typeof t=="function"){let r=null;e.children.forEach(n=>{r!==null&&t.call(this,r),this.node(n),r=n});return}e.children.forEach(this.node,this)}function rs(e){let t=new Map;for(let[r,n]of Object.entries(e.node))typeof(n.generate||n)=="function"&&t.set(r,n.generate||n);return function(r,n){let o="",i=0,s={node(c){if(t.has(c.type))t.get(c.type).call(u,c);else throw new Error("Unknown node type: "+c.type)},tokenBefore:zr,token(c,a){i=this.tokenBefore(i,c,a),this.emit(a,c,!1),c===9&&a.charCodeAt(0)===Ol&&this.emit(`
`,13,!0)},emit(c){o+=c},result(){return o}};n&&(typeof n.decorator=="function"&&(s=n.decorator(s)),n.sourceMap&&(s=Ji(s)),n.mode in Ht&&(s.tokenBefore=Ht[n.mode]));let u={node:c=>s.node(c),children:Fl,token:(c,a)=>s.token(c,a),tokenize:function(c){return Ae(e)(c,(l,p,h)=>{this.token(l,c.slice(p,h))})}};return s.node(r),s.result()}}function ns(e){return{fromPlainObject(t){return e(t,{enter(r){r.children&&!(r.children instanceof j)&&(r.children=new j().fromArray(r.children))}}),t},toPlainObject(t){return e(t,{leave(r){r.children&&r.children instanceof j&&(r.children=r.children.toArray())}}),t}}}var{hasOwnProperty:Pr}=Object.prototype,pt=function(){};function os(e){return typeof e=="function"?e:pt}function is(e,t){return function(r,n,o){r.type===t&&e.call(this,r,n,o)}}function Rl(e,t){let r=t.structure,n=[];for(let o in r){if(Pr.call(r,o)===!1)continue;let i=r[o],s={name:o,type:!1,nullable:!1};Array.isArray(i)||(i=[i]);for(let u of i)u===null?s.nullable=!0:typeof u=="string"?s.type="node":Array.isArray(u)&&(s.type="list");s.type&&n.push(s)}return n.length?{context:t.walkContext,fields:n}:null}function Ml(e){let t={};for(let r in e.node)if(Pr.call(e.node,r)){let n=e.node[r];if(!n.structure)throw new Error("Missed `structure` field in `"+r+"` node type definition");t[r]=Rl(r,n)}return t}function ss(e,t){let r=e.fields.slice(),n=e.context,o=typeof n=="string";return t&&r.reverse(),function(i,s,u,c){let a;o&&(a=s[n],s[n]=i);for(let l of r){let p=i[l.name];if(!l.nullable||p){if(l.type==="list"){if(t?p.reduceRight(c,!1):p.reduce(c,!1))return!0}else if(u(p))return!0}}o&&(s[n]=a)}}function as({StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Rule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Declaration:{StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:o}}}function ls(e){let t=Ml(e),r={},n={},o=Symbol("break-walk"),i=Symbol("skip-node");for(let a in t)Pr.call(t,a)&&t[a]!==null&&(r[a]=ss(t[a],!1),n[a]=ss(t[a],!0));let s=as(r),u=as(n),c=function(a,l){function p(w,A,he){let z=h.call(Y,w,A,he);return z===o?!0:z===i?!1:!!(g.hasOwnProperty(w.type)&&g[w.type](w,Y,p,ee)||d.call(Y,w,A,he)===o)}let h=pt,d=pt,g=r,ee=(w,A,he,z)=>w||p(A,he,z),Y={break:o,skip:i,root:a,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof l=="function")h=l;else if(l&&(h=os(l.enter),d=os(l.leave),l.reverse&&(g=n),l.visit)){if(s.hasOwnProperty(l.visit))g=l.reverse?u[l.visit]:s[l.visit];else if(!t.hasOwnProperty(l.visit))throw new Error("Bad value `"+l.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=is(h,l.visit),d=is(d,l.visit)}if(h===pt&&d===pt)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");p(a)};return c.break=o,c.skip=i,c.find=function(a,l){let p=null;return c(a,function(h,d,g){if(l.call(this,h,d,g))return p=h,o}),p},c.findLast=function(a,l){let p=null;return c(a,{reverse:!0,enter(h,d,g){if(l.call(this,h,d,g))return p=h,o}}),p},c.findAll=function(a,l){let p=[];return c(a,function(h,d,g){l.call(this,h,d,g)&&p.push(h)}),p},c}function Bl(e){return e}function _l(e){let{min:t,max:r,comma:n}=e;return t===0&&r===0?n?"#?":"*":t===0&&r===1?"?":t===1&&r===0?n?"#":"+":t===1&&r===1?"":(n?"#":"")+(t===r?"{"+t+"}":"{"+t+","+(r!==0?r:"")+"}")}function Wl(e){switch(e.type){case"Range":return" ["+(e.min===null?"-\u221E":e.min)+","+(e.max===null?"\u221E":e.max)+"]";default:throw new Error("Unknown node type `"+e.type+"`")}}function ql(e,t,r,n){let o=e.combinator===" "||n?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>Gt(s,t,r,n)).join(o);return e.explicit||r?(n||i[0]===","?"[":"[ ")+i+(n?"]":" ]"):i}function Gt(e,t,r,n){let o;switch(e.type){case"Group":o=ql(e,t,r,n)+(e.disallowEmpty?"!":"");break;case"Multiplier":return Gt(e.term,t,r,n)+t(_l(e),e);case"Boolean":o="<boolean-expr["+Gt(e.term,t,r,n)+"]>";break;case"Type":o="<"+e.name+(e.opts?t(Wl(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function Fe(e,t){let r=Bl,n=!1,o=!1;return typeof t=="function"?r=t:t&&(n=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(r=t.decorate)),Gt(e,r,n,o)}var cs={offset:0,line:1,column:1};function jl(e,t){let r=e.tokens,n=e.longestMatch,o=n<r.length&&r[n].node||null,i=o!==t?o:null,s=0,u=0,c=0,a="",l,p;for(let h=0;h<r.length;h++){let d=r[h].value;h===n&&(u=d.length,s=a.length),i!==null&&r[h].node===i&&(h<=n?c++:c=0),a+=d}return n===r.length||c>1?(l=Yt(i||t,"end")||ht(cs,a),p=ht(l)):(l=Yt(i,"start")||ht(Yt(t,"start")||cs,a.slice(0,s)),p=Yt(i,"end")||ht(l,a.substr(s,u))),{css:a,mismatchOffset:s,mismatchLength:u,start:l,end:p}}function Yt(e,t){let r=e&&e.loc&&e.loc[t];return r?"line"in r?ht(r):r:null}function ht({offset:e,line:t,column:r},n){let o={offset:e,line:t,column:r};if(n){let i=n.split(/\n|\r\n?|\f/);o.offset+=n.length,o.line+=i.length-1,o.column=i.length===1?o.column+n.length:i.pop().length+1}return o}var Xe=function(e,t){let r=Ie("SyntaxReferenceError",e+(t?" `"+t+"`":""));return r.reference=t,r},us=function(e,t,r,n){let o=Ie("SyntaxMatchError",e),{css:i,mismatchOffset:s,mismatchLength:u,start:c,end:a}=jl(n,r);return o.rawMessage=e,o.syntax=t?Fe(t):"<generic>",o.css=i,o.mismatchOffset=s,o.mismatchLength=u,o.message=e+`
syntax: `+o.syntax+`
value: `+(i||"<empty string>")+`
--------`+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,c),o.loc={source:r&&r.loc&&r.loc.source||"<unknown>",start:c,end:a},o};var Kt=new Map,$e=new Map,Vt=45,mt=Hl,Qt=Gl,Ul=Ir;function dt(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Vt&&e.charCodeAt(t+1)===Vt}function Ir(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Vt&&e.charCodeAt(t+1)!==Vt){let r=e.indexOf("-",t+2);if(r!==-1)return e.substring(t,r+1)}return""}function Hl(e){if(Kt.has(e))return Kt.get(e);let t=e.toLowerCase(),r=Kt.get(t);if(r===void 0){let n=dt(t,0),o=n?"":Ir(t,0);r=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:n})}return Kt.set(e,r),r}function Gl(e){if($e.has(e))return $e.get(e);let t=e,r=e[0];r==="/"?r=e[1]==="/"?"//":"/":r!=="_"&&r!=="*"&&r!=="$"&&r!=="#"&&r!=="+"&&r!=="&"&&(r="");let n=dt(t,r.length);if(!n&&(t=t.toLowerCase(),$e.has(t))){let u=$e.get(t);return $e.set(e,u),u}let o=n?"":Ir(t,r.length),i=t.substr(0,r.length+o.length),s=Object.freeze({basename:t.substr(i.length),name:t.substr(r.length),hack:r,vendor:o,prefix:i,custom:n});return $e.set(e,s),s}var Ze=["initial","inherit","unset","revert","revert-layer"];var gt=43,de=45,Nr=110,Je=!0,Kl=!1;function Or(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function ft(e,t,r){for(;e!==null&&(e.type===13||e.type===25);)e=r(++t);return t}function Ee(e,t,r,n){if(!e)return 0;let o=e.value.charCodeAt(t);if(o===gt||o===de){if(r)return 0;t++}for(;t<e.value.length;t++)if(!R(e.value.charCodeAt(t)))return 0;return n+1}function Dr(e,t,r){let n=!1,o=ft(e,t,r);if(e=r(o),e===null)return t;if(e.type!==10)if(Or(e,gt)||Or(e,de)){if(n=!0,o=ft(r(++o),o,r),e=r(o),e===null||e.type!==10)return 0}else return t;if(!n){let i=e.value.charCodeAt(0);if(i!==gt&&i!==de)return 0}return Ee(e,n?0:1,n,o)}function Fr(e,t){let r=0;if(!e)return 0;if(e.type===10)return Ee(e,0,Kl,r);if(e.type===1&&e.value.charCodeAt(0)===de){if(!ye(e.value,1,Nr))return 0;switch(e.value.length){case 2:return Dr(t(++r),r,t);case 3:return e.value.charCodeAt(2)!==de?0:(r=ft(t(++r),r,t),e=t(r),Ee(e,0,Je,r));default:return e.value.charCodeAt(2)!==de?0:Ee(e,3,Je,r)}}else if(e.type===1||Or(e,gt)&&t(r+1).type===1){if(e.type!==1&&(e=t(++r)),e===null||!ye(e.value,0,Nr))return 0;switch(e.value.length){case 1:return Dr(t(++r),r,t);case 2:return e.value.charCodeAt(1)!==de?0:(r=ft(t(++r),r,t),e=t(r),Ee(e,0,Je,r));default:return e.value.charCodeAt(1)!==de?0:Ee(e,2,Je,r)}}else if(e.type===12){let n=e.value.charCodeAt(0),o=n===gt||n===de?1:0,i=o;for(;i<e.value.length&&R(e.value.charCodeAt(i));i++);return i===o||!ye(e.value,i,Nr)?0:i+1===e.value.length?Dr(t(++r),r,t):e.value.charCodeAt(i+1)!==de?0:i+2===e.value.length?(r=ft(t(++r),r,t),e=t(r),Ee(e,0,Je,r)):Ee(e,i+2,Je,r)}return 0}var Vl=43,ps=45,hs=63,Ql=117;function Rr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Xl(e,t){return e.value.charCodeAt(0)===t}function bt(e,t,r){let n=0;for(let o=t;o<e.value.length;o++){let i=e.value.charCodeAt(o);if(i===ps&&r&&n!==0)return bt(e,t+n+1,!1),6;if(!J(i)||++n>6)return 0}return n}function Xt(e,t,r){if(!e)return 0;for(;Rr(r(t),hs);){if(++e>6)return 0;t++}return t}function Mr(e,t){let r=0;if(e===null||e.type!==1||!ye(e.value,0,Ql)||(e=t(++r),e===null))return 0;if(Rr(e,Vl))return e=t(++r),e===null?0:e.type===1?Xt(bt(e,0,!0),++r,t):Rr(e,hs)?Xt(1,++r,t):0;if(e.type===10){let n=bt(e,1,!0);return n===0?0:(e=t(++r),e===null?r:e.type===12||e.type===10?!Xl(e,ps)||!bt(e,1,!1)?0:r+1:Xt(n,r,t))}return e.type===12?Xt(bt(e,1,!0),++r,t):0}var Br=["calc(","-moz-calc(","-webkit-calc("],_r=["min(","max(","clamp("],Wr=["round(","mod(","rem("],$l=["sin(","cos(","tan("],Zl=["asin(","acos(","atan(","atan2("],Jl=["pow(","sqrt(","log(","exp(","sign("],qr=["hypot("],jr=["abs("],ms=[...Br,..._r,...Wr,...$l,...Jl,...qr,...jr],ec=[...Br,..._r,...Wr,...qr,...jr],ve=[...Br,..._r,...Wr,...Zl,...qr,...jr],Ur=new Map([[2,22],[21,22],[19,20],[23,24]]);function pe(e,t){return t<e.length?e.charCodeAt(t):0}function ds(e,t){return xe(e,0,e.length,t)}function fs(e,t){for(let r=0;r<t.length;r++)if(ds(e,t[r]))return!0;return!1}function gs(e,t){return t!==e.length-2?!1:pe(e,t)===92&&R(pe(e,t+1))}function $t(e,t,r){if(e&&e.type==="Range"){let n=Number(r!==void 0&&r!==t.length?t.substr(0,r):t);if(isNaN(n)||e.min!==null&&n<e.min&&typeof e.min!="string"||e.max!==null&&n>e.max&&typeof e.max!="string")return!0}return!1}function tc(e,t){let r=0,n=[],o=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==r)break e;if(r=n.pop(),n.length===0){o++;break e}break;case 2:case 21:case 19:case 23:n.push(r),r=Ur.get(e.type);break}o++}while(e=t(o));return o}function oe(e,t){return function(r,n,o){return r===null?0:r.type===2&&fs(r.value,t)?tc(r,n):e(r,n,o)}}function I(e){return function(t){return t===null||t.type!==e?0:1}}function rc(e){if(e===null||e.type!==1)return 0;let t=e.value.toLowerCase();return fs(t,Ze)||ds(t,"default")?0:1}function bs(e){return e===null||e.type!==1||pe(e.value,0)!==45||pe(e.value,1)!==45?0:1}function nc(e){return!bs(e)||e.value==="--"?0:1}function oc(e){if(e===null||e.type!==4)return 0;let t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let r=1;r<t;r++)if(!J(pe(e.value,r)))return 0;return 1}function ic(e){return e===null||e.type!==4||!Ue(pe(e.value,1),pe(e.value,2),pe(e.value,3))?0:1}function sc(e,t){if(!e)return 0;let r=0,n=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==r)break e;r=n.pop();break;case 17:if(r===0)break e;break;case 9:if(r===0&&e.value==="!")break e;break;case 2:case 21:case 19:case 23:n.push(r),r=Ur.get(e.type);break}o++}while(e=t(o));return o}function ac(e,t){if(!e)return 0;let r=0,n=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==r)break e;r=n.pop();break;case 2:case 21:case 19:case 23:n.push(r),r=Ur.get(e.type);break}o++}while(e=t(o));return o}function Se(e){return e&&(e=new Set(e)),function(t,r,n){if(t===null||t.type!==12)return 0;let o=De(t.value,0);if(e!==null){let i=t.value.indexOf("\\",o),s=i===-1||!gs(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return $t(n,t.value,o)?0:1}}function lc(e,t,r){return e===null||e.type!==11||$t(r,e.value,e.value.length-1)?0:1}function ys(e){return typeof e!="function"&&(e=function(){return 0}),function(t,r,n){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,r,n)}}function cc(e,t,r){if(e===null)return 0;let n=De(e.value,0);return!(n===e.value.length)&&!gs(e.value,n)||$t(r,e.value,n)?0:1}function uc(e,t,r){if(e===null||e.type!==10)return 0;let n=pe(e.value,0)===43||pe(e.value,0)===45?1:0;for(;n<e.value.length;n++)if(!R(pe(e.value,n)))return 0;return $t(r,e.value,n)?0:1}var pc={"ident-token":I(1),"function-token":I(2),"at-keyword-token":I(3),"hash-token":I(4),"string-token":I(5),"bad-string-token":I(6),"url-token":I(7),"bad-url-token":I(8),"delim-token":I(9),"number-token":I(10),"percentage-token":I(11),"dimension-token":I(12),"whitespace-token":I(13),"CDO-token":I(14),"CDC-token":I(15),"colon-token":I(16),"semicolon-token":I(17),"comma-token":I(18),"[-token":I(19),"]-token":I(20),"(-token":I(21),")-token":I(22),"{-token":I(23),"}-token":I(24)},hc={string:I(5),ident:I(1),percentage:oe(lc,ec),zero:ys(),number:oe(cc,ms),integer:oe(uc,ms),"custom-ident":rc,"dashed-ident":bs,"custom-property-name":nc,"hex-color":oc,"id-selector":ic,"an-plus-b":Fr,urange:Mr,"declaration-value":sc,"any-value":ac};function mc(e){let{angle:t,decibel:r,frequency:n,flex:o,length:i,resolution:s,semitones:u,time:c}=e||{};return{dimension:oe(Se(null),ve),angle:oe(Se(t),ve),decibel:oe(Se(r),ve),frequency:oe(Se(n),ve),flex:oe(Se(o),ve),length:oe(ys(Se(i)),ve),resolution:oe(Se(s),ve),semitones:oe(Se(u),ve),time:oe(Se(c),ve)}}function xs(e){return{...pc,...hc,...mc(e)}}var Zt={};f(Zt,{angle:()=>fc,decibel:()=>kc,flex:()=>xc,frequency:()=>bc,length:()=>dc,resolution:()=>yc,semitones:()=>wc,time:()=>gc});var dc=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],fc=["deg","grad","rad","turn"],gc=["s","ms"],bc=["hz","khz"],yc=["dpi","dpcm","dppx","x"],xc=["fr"],kc=["db"],wc=["st"];var Zr={};f(Zr,{SyntaxError:()=>Jt,generate:()=>Fe,parse:()=>et,walk:()=>nr});function Jt(e,t,r){return Object.assign(Ie("SyntaxError",e),{input:t,offset:r,rawMessage:e,message:e+`
`+t+`
--`+new Array((r||t.length)+1).join("-")+"^"})}var vc=9,Sc=10,Cc=12,Tc=13,Ac=32,ks=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),er=class{constructor(t){this.str=t,th