/*! For license information please see critical-css-gen.js.LICENSE.txt */ var CriticalCSSGenerator=function(e){"use strict";class t{constructor(){this.urlErrors={}}trackUrlError(e,t){this.urlErrors[e]=t}filterValidUrls(e){return e.filter((e=>!this.urlErrors[e]))}async runInPage(e,t,n,...r){throw new Error("Undefined interface method: BrowserInterface.runInPage()")}async fetch(e,t,n){throw new Error("Undefined interface method: BrowserInterface.fetch()")}async cleanup(){}async getCssIncludes(e){return await this.runInPage(e,null,t.innerGetCssIncludes)}static innerGetCssIncludes({innerWindow:e}){return[...(e=null===e?window:e).document.getElementsByTagName("link")].filter((e=>"stylesheet"===e.rel)).reduce(((e,t)=>(e[t.href]={media:t.media||null},e)),{})}async getInternalStyles(e){return await this.runInPage(e,null,t.innerGetInternalStyles)}static innerGetInternalStyles({innerWindow:e}){return e=null===e?window:e,Array.from(e.document.getElementsByTagName("style")).reduce(((e,t)=>e+t.innerText),"")}static innerFindMatchingSelectors({innerWindow:e,args:[t]}){return e=null===e?window:e,Object.keys(t).filter((n=>{try{return!!e.document.querySelector(t[n])}catch(e){return!1}}))}static innerFindAboveFoldSelectors({innerWindow:e,args:[t,n]}){e=null===e?window:e;const r=t=>{const n=t.style.clear||"";t.style.clear="none";const r=t.getBoundingClientRect();return t.style.clear=n,r.top{if("*"===t[n])return!0;const o=e.document.querySelectorAll(t[n]);for(const e of o)if(r(e))return!0;return!1}))}}class n extends Error{constructor(e){super("Insufficient pages loaded to meet success target. Errors:\n"+Object.values(e).map((e=>e.message)).join("\n")),this.isSuccessTargetError=!0,this.urlErrors={};for(const[t,n]of Object.entries(e))this.urlErrors[t]={message:n.message,type:n.type||"UnknownError",meta:n.meta||{}}}}class r extends Error{constructor(e,t,n){super(n),this.type=e,this.meta=t}}class o extends r{constructor({url:e,code:t}){super("HttpError",{url:e,code:t},`HTTP error ${t} on URL ${e}`)}}class i extends r{constructor({url:e,message:t}){super("UnknownError",{url:e,message:t},`Error while loading ${e}: ${t}`)}}class a extends r{constructor({url:e}){super("CrossDomainError",{url:e},`Failed to fetch cross-domain content at ${e}`)}}class s extends r{constructor({url:e}){super("LoadTimeoutError",{url:e},`Timeout while reading ${e}`)}}class l extends r{constructor({url:e,redirectUrl:t}){super("RedirectError",{url:e,redirectUrl:t},`Failed to process ${e} because it redirects to ${t} which cannot be verified`)}}class u extends r{constructor({url:e}){super("UrlVerifyError",{url:e},`Failed to verify page at ${e}`)}}class c extends r{constructor({url:e}){super("EmptyCSSError",{url:e},`The ${e} does not have any CSS in its external style sheet(s).`)}}class h extends r{constructor({url:e}){super("XFrameDenyError",{url:e},`Failed to load ${e} due to the "X-Frame-Options: DENY" header`)}}const p=10,f=11,d=12,g=13,m=15,b=16,y=17,v=18,w=19,k=20,x=21,O=22,S=23,C=24,E=25;function _(e){return e>=48&&e<=57}function A(e){return _(e)||e>=65&&e<=70||e>=97&&e<=102}function R(e){return e>=65&&e<=90}function T(e){return function(e){return R(e)||function(e){return e>=97&&e<=122}(e)}(e)||function(e){return e>=128}(e)||95===e}function L(e){return T(e)||_(e)||45===e}function P(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e}function z(e){return 10===e||13===e||12===e}function M(e){return z(e)||32===e||9===e}function U(e,t){return 92===e&&!z(t)&&0!==t}function B(e,t,n){return 45===e?T(t)||45===t||U(t,n):!!T(e)||92===e&&U(e,t)}function N(e,t,n){return 43===e||45===e?_(t)?2:46===t&&_(n)?3:0:46===e?_(t)?2:0:_(e)?1:0}function I(e){return 65279===e||65534===e?1:0}const j=new Array(128),D=130;for(let e=0;ee.length)return!1;for(let o=t;o=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var J=["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"];function ee(e=null,t){return null===e||e.length0?I(t.charCodeAt(0)):0,o=ee(e.lines,n),i=ee(e.columns,n);let a=e.startLine,s=e.startColumn;for(let e=r;e{})){const n=(e=String(e||"")).length,r=ee(this.offsetAndType,e.length+1),o=ee(this.balance,e.length+1);let i=0,a=0,s=0,l=-1;for(this.offsetAndType=null,this.balance=null,t(e,((e,t,u)=>{switch(e){default:o[i]=n;break;case a:{let e=s&re;for(s=o[e],a=s>>oe,o[i]=e,o[e++]=i;e>oe:0}lookupOffset(e){return(e+=this.tokenIndex)0?e>oe,this.tokenEnd=t&re):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e>oe,this.tokenEnd=e&re):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===g||this.tokenType===E;)this.next()}skipUntilBalanced(e,t){let n,r,o=e;e:for(;o0?this.offsetAndType[o-1]&re:this.firstCharOffset,t(this.source.charCodeAt(r))){case 1:break e;case 2:o++;break e;default:this.balance[n]===o&&(o=n)}this.skip(o-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t>oe,r,i,t)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken(((t,n,r,o)=>{e[o]={idx:o,type:J[t],chunk:this.source.substring(n,r),balance:this.balance[o]}})),e}}function se(e,t){function n(t){return t=e.length?void(uString(e+n+1).padStart(l)+" |"+t)).join("\n")}const i=e.split(/\r\n?|\n|\f/),a=Math.max(1,t-r)-1,s=Math.min(t+r,i.length+1),l=Math.max(4,String(s).length)+1;let u=0;(n+=(he.length-1)*(i[t-1].substr(0,n-1).match(/\t/g)||[]).length)>100&&(u=n-60+3,n=58);for(let e=a;e<=s;e++)e>=0&&e0&&i[e].length>u?"…":"")+i[e].substr(u,98)+(i[e].length>u+100-1?"…":""));return[o(a,t),new Array(n+l+2).join("-")+"^",o(t,s)].filter(Boolean).join("\n")}function fe(e,t,n,r,o){return Object.assign(ce("SyntaxError",e),{source:t,offset:n,line:r,column:o,sourceFragment:e=>pe({source:t,line:r,column:o},isNaN(e)?0:e),get formattedMessage(){return`Parse error: ${e}\n`+pe({source:t,line:r,column:o},2)}})}function de(e){const t=this.createList();let n=!1;const r={recognizer:e};for(;!this.eof;){switch(this.tokenType){case E:this.next();continue;case g:n=!0,this.next();continue}let o=e.getNode.call(this,r);if(void 0===o)break;n&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,r),n=!1),t.push(o)}return n&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,r),t}const ge=()=>{};function me(e){return function(){return this[e]()}}function be(e){const t=Object.create(null);for(const n in e){const r=e[n],o=r.parse||r;o&&(t[n]=o)}return t}var ye="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function ve(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var we={},ke={},xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");ke.encode=function(e){if(0<=e&&e>>=5)>0&&(t|=32),n+=Oe.encode(t)}while(r>0);return n},we.decode=function(e,t,n){var r,o,i,a,s=e.length,l=0,u=0;do{if(t>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=Oe.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(32&o),l+=(o&=31)<>1,1&~i?a:-a),n.rest=t};var Se={};!function(e){e.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var t=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function r(e){var n=e.match(t);return n?{scheme:n[1],auth:n[2],host:n[3],port:n[4],path:n[5]}:null}function o(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}e.urlParse=r,e.urlGenerate=o;var i,a,s=(i=function(t){var n=t,i=r(t);if(i){if(!i.path)return t;n=i.path}for(var a=e.isAbsolute(n),s=[],l=0,u=0;;){if(l=u,-1===(u=n.indexOf("/",l))){s.push(n.slice(l));break}for(s.push(n.slice(l,u));u=0;u--)"."===(c=s[u])?s.splice(u,1):".."===c?h++:h>0&&(""===c?(s.splice(u+1,h),h=0):(s.splice(u,2),h--));return""===(n=s.join("/"))&&(n=a?"/":"."),i?(i.path=n,o(i)):n},a=[],function(e){for(var t=0;t32&&a.pop(),r});function l(e,t){""===e&&(e="."),""===t&&(t=".");var i=r(t),a=r(e);if(a&&(e=a.path||"/"),i&&!i.scheme)return a&&(i.scheme=a.scheme),o(i);if(i||t.match(n))return t;if(a&&!a.host&&!a.path)return a.host=t,o(a);var l="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=l,o(a)):l}e.normalize=s,e.join=l,e.isAbsolute=function(e){return"/"===e.charAt(0)||t.test(e)},e.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function c(e){return e}function h(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function p(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}e.toSetString=u?c:function(e){return h(e)?"$"+e:e},e.fromSetString=u?c:function(e){return h(e)?e.slice(1):e},e.compareByOriginalPositions=function(e,t,n){var r=p(e.source,t.source);return 0!==r||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)||n||0!=(r=e.generatedColumn-t.generatedColumn)||0!=(r=e.generatedLine-t.generatedLine)?r:p(e.name,t.name)},e.compareByOriginalPositionsNoSource=function(e,t,n){var r;return 0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)||n||0!=(r=e.generatedColumn-t.generatedColumn)||0!=(r=e.generatedLine-t.generatedLine)?r:p(e.name,t.name)},e.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r||0!=(r=e.generatedColumn-t.generatedColumn)||n||0!==(r=p(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},e.compareByGeneratedPositionsDeflatedNoLine=function(e,t,n){var r=e.generatedColumn-t.generatedColumn;return 0!==r||n||0!==(r=p(e.source,t.source))||0!=(r=e.originalLine-t.originalLine)||0!=(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},e.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n||0!=(n=e.generatedColumn-t.generatedColumn)||0!==(n=p(e.source,t.source))||0!=(n=e.originalLine-t.originalLine)||0!=(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},e.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},e.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var i=r(n);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var a=i.path.lastIndexOf("/");a>=0&&(i.path=i.path.substring(0,a+1))}t=l(o(i),t)}return s(t)}}(Se);var Ce={},Ee=Se,_e=Object.prototype.hasOwnProperty,Ae="undefined"!=typeof Map;function Re(){this._array=[],this._set=Ae?new Map:Object.create(null)}Re.fromArray=function(e,t){for(var n=new Re,r=0,o=e.length;r=0)return t}else{var n=Ee.toSetString(e);if(_e.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},Re.prototype.at=function(e){if(e>=0&&er||o==r&&a>=i||Le.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},Pe.prototype.toArray=function(){return this._sorted||(this._array.sort(Le.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},Te.MappingList=Pe;var ze=we,Me=Se,Ue=Ce.ArraySet,Be=Te.MappingList;function Ne(e){e||(e={}),this._file=Me.getArg(e,"file",null),this._sourceRoot=Me.getArg(e,"sourceRoot",null),this._skipValidation=Me.getArg(e,"skipValidation",!1),this._sources=new Ue,this._names=new Ue,this._mappings=new Be,this._sourcesContents=null}Ne.prototype._version=3,Ne.fromSourceMap=function(e){var t=e.sourceRoot,n=new Ne({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=Me.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var o=r;null!==t&&(o=Me.relative(t,r)),n._sources.has(o)||n._sources.add(o);var i=e.sourceContentFor(r);null!=i&&n.setSourceContent(r,i)})),n},Ne.prototype.addMapping=function(e){var t=Me.getArg(e,"generated"),n=Me.getArg(e,"original",null),r=Me.getArg(e,"source",null),o=Me.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,o),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:o})},Ne.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=Me.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Me.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[Me.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},Ne.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var o=this._sourceRoot;null!=o&&(r=Me.relative(o,r));var i=new Ue,a=new Ue;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var s=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=s.source&&(t.source=s.source,null!=n&&(t.source=Me.join(n,t.source)),null!=o&&(t.source=Me.relative(o,t.source)),t.originalLine=s.line,t.originalColumn=s.column,null!=s.name&&(t.name=s.name))}var l=t.source;null==l||i.has(l)||i.add(l);var u=t.name;null==u||a.has(u)||a.add(u)}),this),this._sources=i,this._names=a,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=Me.join(n,t)),null!=o&&(t=Me.relative(o,t)),this.setSourceContent(t,r))}),this)},Ne.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)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((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},Ne.prototype._serializeMappings=function(){for(var e,t,n,r,o=0,i=1,a=0,s=0,l=0,u=0,c="",h=this._mappings.toArray(),p=0,f=h.length;p0){if(!Me.compareByGeneratedPositionsInflated(t,h[p-1]))continue;e+=","}e+=ze.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=ze.encode(r-u),u=r,e+=ze.encode(t.originalLine-1-s),s=t.originalLine-1,e+=ze.encode(t.originalColumn-a),a=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=ze.encode(n-l),l=n)),c+=e}return c},Ne.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=Me.relative(t,e));var n=Me.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},Ne.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},Ne.prototype.toString=function(){return JSON.stringify(this.toJSON())};var Ie=Ne;const je=new Set(["Atrule","Selector","Declaration"]),De=(e,t)=>{if(9===e&&(e=t),"string"==typeof e){const t=e.charCodeAt(0);return t>127?32768:t<<8}return e},Ve=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,p],[1,f],[1,d],[1,m],[1,x],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,p],[3,f],[3,d],[3,m],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,p],[4,f],[4,d],[4,m],[d,1],[d,2],[d,7],[d,8],[d,"-"],[d,p],[d,f],[d,d],[d,m],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",p],["#",f],["#",d],["#",m],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",p],["-",f],["-",d],["-",m],[p,1],[p,2],[p,7],[p,8],[p,p],[p,f],[p,d],[p,"%"],[p,m],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",m],[".",p],[".",f],[".",d],["+",p],["+",f],["+",d],["/","*"]],Fe=Ve.concat([[1,4],[d,4],[4,4],[3,x],[3,5],[3,b],[f,f],[f,d],[f,2],[f,"-"],[O,1],[O,2],[O,f],[O,d],[O,4],[O,"-"]]);function Ke(e){const t=new Set(e.map((([e,t])=>De(e)<<16|De(t))));return function(e,n,r){const o=De(n,r),i=r.charCodeAt(0);return(45===i&&1!==n&&2!==n&&n!==m||43===i?t.has(e<<16|i<<8):t.has(e<<16|o))&&this.emit(" ",g,!0),o}}const qe=Ke(Ve),We=Ke(Fe);var Ye=Object.freeze({__proto__:null,spec:qe,safe:We});function $e(e,t){if("function"!=typeof t)e.children.forEach(this.node,this);else{let n=null;e.children.forEach((e=>{null!==n&&t.call(this,n),this.node(e),n=e}))}}function He(e){se(e,((t,n,r)=>{this.token(t,e.slice(n,r))}))}const{hasOwnProperty:Ge}=Object.prototype,Qe=function(){};function Ze(e){return"function"==typeof e?e:Qe}function Xe(e,t){return function(n,r,o){n.type===t&&e.call(this,n,r,o)}}function Je(e,t){const n=t.structure,r=[];for(const e in n){if(!1===Ge.call(n,e))continue;let t=n[e];const o={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(const e of t)null===e?o.nullable=!0:"string"==typeof e?o.type="node":Array.isArray(e)&&(o.type="list");o.type&&r.push(o)}return r.length?{context:t.walkContext,fields:r}:null}function et(e,t){const n=e.fields.slice(),r=e.context,o="string"==typeof r;return t&&n.reverse(),function(e,i,a,s){let l;o&&(l=i[r],i[r]=e);for(const r of n){const n=e[r.name];if(!r.nullable||n)if("list"===r.type){if(t?n.reduceRight(s,!1):n.reduce(s,!1))return!0}else if(a(n))return!0}o&&(i[r]=l)}}function tt({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:o}}}function nt(e){return e}function rt(e,t,n,r){let o;switch(e.type){case"Group":o=function(e,t,n,r){const o=" "===e.combinator||r?e.combinator:" "+e.combinator+" ",i=e.terms.map((e=>rt(e,t,n,r))).join(o);return e.explicit||n?(r||","===i[0]?"[":"[ ")+i+(r?"]":" ]"):i}(e,t,n,r)+(e.disallowEmpty?"!":"");break;case"Multiplier":return rt(e.term,t,n,r)+t(function(e){const{min:t,max:n,comma:r}=e;return 0===t&&0===n?r?"#?":"*":0===t&&1===n?"?":1===t&&0===n?r?"#":"+":1===t&&1===n?"":(r?"#":"")+(t===n?"{"+t+"}":"{"+t+","+(0!==n?n:"")+"}")}(e),e);case"Type":o="<"+e.name+(e.opts?t(function(e){if("Range"===e.type)return" ["+(null===e.min?"-∞":e.min)+","+(null===e.max?"∞":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}(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 ot(e,t){let n=nt,r=!1,o=!1;return"function"==typeof t?n=t:t&&(r=Boolean(t.forceBraces),o=Boolean(t.compact),"function"==typeof t.decorate&&(n=t.decorate)),rt(e,n,r,o)}const it={offset:0,line:1,column:1};function at(e,t){const n=e&&e.loc&&e.loc[t];return n?"line"in n?st(n):n:null}function st({offset:e,line:t,column:n},r){const o={offset:e,line:t,column:n};if(r){const e=r.split(/\n|\r\n?|\f/);o.offset+=r.length,o.line+=e.length-1,o.column=1===e.length?o.column+r.length:e.pop().length+1}return o}const lt=function(e,t){const n=ce("SyntaxReferenceError",e+(t?" `"+t+"`":""));return n.reference=t,n},ut=function(e,t,n,r){const o=ce("SyntaxMatchError",e),{css:i,mismatchOffset:a,mismatchLength:s,start:l,end:u}=function(e,t){const n=e.tokens,r=e.longestMatch,o=r1?(a=at(i||t,"end")||st(it,h),s=st(a)):(a=at(i,"start")||st(at(t,"start")||it,h.slice(0,l)),s=at(i,"end")||st(a,h.substr(l,u))),{css:h,mismatchOffset:l,mismatchLength:u,start:a,end:s}}(r,n);return o.rawMessage=e,o.syntax=t?ot(t):"",o.css=i,o.mismatchOffset=a,o.mismatchLength=s,o.message=e+"\n syntax: "+o.syntax+"\n value: "+(i||"")+"\n --------"+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,l),o.loc={source:n&&n.loc&&n.loc.source||"",start:l,end:u},o},ct=new Map,ht=new Map,pt=function(e){if(ct.has(e))return ct.get(e);const t=e.toLowerCase();let n=ct.get(t);if(void 0===n){const e=dt(t,0),r=e?"":gt(t,0);n=Object.freeze({basename:t.substr(r.length),name:t,prefix:r,vendor:r,custom:e})}return ct.set(e,n),n},ft=function(e){if(ht.has(e))return ht.get(e);let t=e,n=e[0];"/"===n?n="/"===e[1]?"//":"/":"_"!==n&&"*"!==n&&"$"!==n&&"#"!==n&&"+"!==n&&"&"!==n&&(n="");const r=dt(t,n.length);if(!r&&(t=t.toLowerCase(),ht.has(t))){const n=ht.get(t);return ht.set(e,n),n}const o=r?"":gt(t,n.length),i=t.substr(0,n.length+o.length),a=Object.freeze({basename:t.substr(i.length),name:t.substr(n.length),hack:n,vendor:o,prefix:i,custom:r});return ht.set(e,a),a};function dt(e,t){return t=t||0,e.length-t>=2&&45===e.charCodeAt(t)&&45===e.charCodeAt(t+1)}function gt(e,t){if(t=t||0,e.length-t>=3&&45===e.charCodeAt(t)&&45!==e.charCodeAt(t+1)){const n=e.indexOf("-",t+2);if(-1!==n)return e.substring(t,n+1)}return""}const mt=["initial","inherit","unset","revert","revert-layer"],bt=45,yt=!0;function vt(e,t){return null!==e&&9===e.type&&e.value.charCodeAt(0)===t}function wt(e,t,n){for(;null!==e&&(e.type===g||e.type===E);)e=n(++t);return t}function kt(e,t,n,r){if(!e)return 0;const o=e.value.charCodeAt(t);if(43===o||o===bt){if(n)return 0;t++}for(;t6)return 0}return r}function Ct(e,t,n){if(!e)return 0;for(;Ot(n(t),63);){if(++e>6)return 0;t++}return t}const Et=["calc(","-moz-calc(","-webkit-calc("],_t=new Map([[2,O],[x,O],[w,k],[S,C]]);function At(e,t){return te.max&&"string"!=typeof e.max)return!0}return!1}function zt(e){return function(t,n,r){return null===t?0:2===t.type&&Tt(t.value,Et)?function(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case C:case O:case k:if(e.type!==n)break e;if(n=r.pop(),0===r.length){o++;break e}break;case 2:case x:case w:case S:r.push(n),n=_t.get(e.type)}o++}while(e=t(o));return o}(t,n):e(t,n,r)}}function Mt(e){return function(t){return null===t||t.type!==e?0:1}}function Ut(e){return e&&(e=new Set(e)),function(t,n,r){if(null===t||t.type!==d)return 0;const o=Q(t.value,0);if(null!==e){const n=t.value.indexOf("\\",o),r=-1!==n&&Lt(t.value,n)?t.value.substring(o,n):t.value.substr(o);if(!1===e.has(r.toLowerCase()))return 0}return Pt(r,t.value,o)?0:1}}function Bt(e){return"function"!=typeof e&&(e=function(){return 0}),function(t,n,r){return null!==t&&t.type===p&&0===Number(t.value)?1:e(t,n,r)}}const Nt={"ident-token":Mt(1),"function-token":Mt(2),"at-keyword-token":Mt(3),"hash-token":Mt(4),"string-token":Mt(5),"bad-string-token":Mt(6),"url-token":Mt(7),"bad-url-token":Mt(8),"delim-token":Mt(9),"number-token":Mt(p),"percentage-token":Mt(f),"dimension-token":Mt(d),"whitespace-token":Mt(g),"CDO-token":Mt(14),"CDC-token":Mt(m),"colon-token":Mt(b),"semicolon-token":Mt(y),"comma-token":Mt(v),"[-token":Mt(w),"]-token":Mt(k),"(-token":Mt(x),")-token":Mt(O),"{-token":Mt(S),"}-token":Mt(C)},It={string:Mt(5),ident:Mt(1),percentage:zt((function(e,t,n){return null===e||e.type!==f||Pt(n,e.value,e.value.length-1)?0:1})),zero:Bt(),number:zt((function(e,t,n){if(null===e)return 0;const r=Q(e.value,0);return r===e.value.length||Lt(e.value,r)?Pt(n,e.value,r)?0:1:0})),integer:zt((function(e,t,n){if(null===e||e.type!==p)return 0;let r=43===At(e.value,0)||45===At(e.value,0)?1:0;for(;r/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0)),Wt={" ":1,"&&":2,"||":3,"|":4};function Yt(e){return e.substringToPos(e.findWsEnd(e.pos))}function $t(e){let t=e.pos;for(;t=128||0===qt[n])break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Ht(e){let t=e.pos;for(;t57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function Gt(e){const t=e.str.indexOf("'",e.pos+1);return-1===t&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function Qt(e){let t=null,n=null;return e.eat(Kt),t=Ht(e),44===e.charCode()?(e.pos++,125!==e.charCode()&&(n=Ht(e))):n=t,e.eat(125),{min:Number(t),max:n?Number(n):0}}function Zt(e,t){const n=function(e){let t=null,n=!1;switch(e.charCode()){case 42:e.pos++,t={min:0,max:0};break;case 43:e.pos++,t={min:1,max:0};break;case 63:e.pos++,t={min:0,max:1};break;case 35:e.pos++,n=!0,e.charCode()===Kt?t=Qt(e):63===e.charCode()?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case Kt:t=Qt(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}(e);return null!==n?(n.term=t,35===e.charCode()&&43===e.charCodeAt(e.pos-1)?Zt(e,n):n):t}function Xt(e){const t=e.peek();return""===t?null:{type:"Token",value:t}}function Jt(e,t){function n(e,t){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort(((e,t)=>Wt[e]-Wt[t]));t.length>0;){r=t.shift();let o=0,i=0;for(;o1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}-1!==i&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function en(e){const t=[],n={};let r,o=null,i=e.pos;for(;r=tn(e);)"Spaces"!==r.type&&("Combinator"===r.type?(null!==o&&"Combinator"!==o.type||(e.pos=i,e.error("Unexpected combinator")),n[r.value]=!0):null!==o&&"Combinator"!==o.type&&(n[" "]=!0,t.push({type:"Combinator",value:" "})),t.push(r),o=r,i=e.pos);return null!==o&&"Combinator"===o.type&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:t,combinator:Jt(t,n)||" ",disallowEmpty:!1,explicit:!1}}function tn(e){let t=e.charCode();if(t<128&&1===qt[t])return function(e){const t=$t(e);return 40===e.charCode()?(e.pos++,{type:"Function",name:t}):Zt(e,{type:"Keyword",name:t})}(e);switch(t){case 93:break;case 91:return Zt(e,function(e){let t;return e.eat(91),t=en(e),e.eat(93),t.explicit=!0,33===e.charCode()&&(e.pos++,t.disallowEmpty=!0),t}(e));case 60:return 39===e.nextCharCode()?function(e){let t;return e.eat(60),e.eat(39),t=$t(e),e.eat(39),e.eat(62),Zt(e,{type:"Property",name:t})}(e):function(e){let t,n=null;return e.eat(60),t=$t(e),40===e.charCode()&&41===e.nextCharCode()&&(e.pos+=2,t+="()"),91===e.charCodeAt(e.findWsEnd(e.pos))&&(Yt(e),n=function(e){let t=null,n=null,r=1;return e.eat(91),45===e.charCode()&&(e.peek(),r=-1),-1==r&&8734===e.charCode()?e.peek():(t=r*Number(Ht(e)),0!==qt[e.charCode()]&&(t+=$t(e))),Yt(e),e.eat(44),Yt(e),8734===e.charCode()?e.peek():(r=1,45===e.charCode()&&(e.peek(),r=-1),n=r*Number(Ht(e)),0!==qt[e.charCode()]&&(n+=$t(e))),e.eat(93),{type:"Range",min:t,max:n}}(e)),e.eat(62),Zt(e,{type:"Type",name:t,opts:n})}(e);case 124:return{type:"Combinator",value:e.substringToPos(e.pos+(124===e.nextCharCode()?2:1))};case 38:return e.pos++,e.eat(38),{type:"Combinator",value:"&&"};case 44:return e.pos++,{type:"Comma"};case 39:return Zt(e,{type:"String",value:Gt(e)});case 32:case 9:case 10:case 13:case 12:return{type:"Spaces",value:Yt(e)};case 64:return t=e.nextCharCode(),t<128&&1===qt[t]?(e.pos++,{type:"AtKeyword",name:$t(e)}):Xt(e);case 42:case 43:case 63:case 35:case 33:break;case Kt:if(t=e.nextCharCode(),t<48||t>57)return Xt(e);break;default:return Xt(e)}}function nn(e){const t=new Ft(e),n=en(t);return t.pos!==e.length&&t.error("Unexpected input"),1===n.terms.length&&"Group"===n.terms[0].type?n.terms[0]:n}const rn=function(){};const on={decorator(e){const t=[];let n=null;return{...e,node(t){const r=n;n=t,e.node.call(this,t),n=r},emit(e,r,o){t.push({type:r,value:e,node:o?null:n})},result:()=>t}}};const an={type:"Match"},sn={type:"Mismatch"},ln={type:"DisallowEmpty"};function un(e,t,n){return t===an&&n===sn||e===an&&t===an&&n===an?e:("If"===e.type&&e.else===sn&&t===an&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function cn(e){return e.length>2&&40===e.charCodeAt(e.length-2)&&41===e.charCodeAt(e.length-1)}function hn(e){return"Keyword"===e.type||"AtKeyword"===e.type||"Function"===e.type||"Type"===e.type&&cn(e.name)}function pn(e,t,n){switch(e){case" ":{let e=an;for(let n=t.length-1;n>=0;n--)e=un(t[n],e,sn);return e}case"|":{let e=sn,n=null;for(let r=t.length-1;r>=0;r--){let o=t[r];if(hn(o)&&(null===n&&r>0&&hn(t[r-1])&&(n=Object.create(null),e=un({type:"Enum",map:n},an,e)),null!==n)){const e=(cn(o.name)?o.name.slice(0,-1):o.name).toLowerCase();if(e in n==0){n[e]=o;continue}}n=null,e=un(o,an,e)}return e}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let n=sn;for(let r=t.length-1;r>=0;r--){const o=t[r];let i;i=t.length>1?pn(e,t.filter((function(e){return e!==o})),!1):an,n=un(o,i,n)}return n}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?an:sn;for(let n=t.length-1;n>=0;n--){const o=t[n];let i;i=t.length>1?pn(e,t.filter((function(e){return e!==o})),!0):an,r=un(o,i,r)}return r}}}function fn(e){if("function"==typeof e)return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=pn(e.combinator,e.terms.map(fn),!1);return e.disallowEmpty&&(t=un(t,ln,sn)),t}case"Multiplier":return function(e){let t=an,n=fn(e.term);if(0===e.max)n=un(n,ln,sn),t=un(n,null,sn),t.then=un(an,an,t),e.comma&&(t.then.else=un({type:"Comma",syntax:e},t,sn));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==an&&(t=un({type:"Comma",syntax:e},t,sn)),t=un(n,un(an,an,t),sn);if(0===e.min)t=un(an,an,t);else for(let r=0;r=65&&o<=90&&(o|=32),o!==r)return!1}return!0}function yn(e){return null===e||e.type===v||2===e.type||e.type===x||e.type===w||e.type===S||function(e){return 9===e.type&&"?"!==e.value}(e)}function vn(e){return null===e||e.type===O||e.type===k||e.type===C||9===e.type&&"/"===e.value}function _n(e,t,n){const r=function(e,t,n){function r(){do{y++,b=yw&&(w=y)}function u(){k=2===k.type?k.prev:{type:3,syntax:c.syntax,token:k.token,prev:k},c=c.prev}let c=null,h=null,p=null,f=null,d=0,m=null,b=null,y=-1,w=0,k={type:0,syntax:null,token:null,prev:null};for(r();null===m&&++d<15e3;)switch(t.type){case"Match":if(null===h){if(null!==b&&(y!==e.length-1||"\\0"!==b.value&&"\\9"!==b.value)){t=sn;break}m=mn;break}if((t=h.nextState)===ln){if(h.matchStack===k){t=sn;break}t=an}for(;h.syntaxStack!==c;)u();h=h.prev;break;case"Mismatch":if(null!==f&&!1!==f)(null===p||y>p.tokenIndex)&&(p=f,f=!1);else if(null===p){m="Mismatch";break}t=p.nextState,h=p.thenStack,c=p.syntaxStack,k=p.matchStack,y=p.tokenIndex,b=yy){for(;y":"<'"+t.name+"'>"));if(!1!==f&&null!==b&&"Type"===t.type&&("custom-ident"===t.name&&1===b.type||"length"===t.name&&"0"===b.value)){null===f&&(f=i(t,p)),t=sn;break}c={syntax:t.syntax,opts:t.syntax.opts||null!==c&&c.opts||null,prev:c},k={type:2,syntax:t.syntax,token:k.token,prev:k},t=r.match;break}case"Keyword":{const e=t.name;if(null!==b){let n=b.value;if(-1!==n.indexOf("\\")&&(n=n.replace(/\\[09].*$/,"")),bn(n,e)){l(),t=an;break}}t=sn;break}case"AtKeyword":case"Function":if(null!==b&&bn(b.value,t.name)){l(),t=an;break}t=sn;break;case"Token":if(null!==b&&b.value===t.value){l(),t=an;break}t=sn;break;case"Comma":null!==b&&b.type===v?yn(k.token)?t=sn:(l(),t=vn(b)?sn:an):t=yn(k.token)||vn(b)?an:sn;break;case"String":let r="",d=y;for(;d"Type"===e.type&&e.name===t))},isProperty:function(e,t){return kn(this,e,(e=>"Property"===e.type&&e.name===t))},isKeyword:function(e){return kn(this,e,(e=>"Keyword"===e.type))}});function On(e){return"node"in e?e.node:On(e.match[0])}function Sn(e){return"node"in e?e.node:Sn(e.match[e.match.length-1])}function Cn(e,t,n,r,o){const i=[];return null!==n.matched&&function n(a){if(null!==a.syntax&&a.syntax.type===r&&a.syntax.name===o){const n=On(a),r=Sn(a);e.syntax.walk(t,(function(e,t,o){if(e===n){const e=new ue;do{if(e.appendData(t.data),t.data===r)break;t=t.next}while(null!==t);i.push({parent:o,nodes:e})}}))}Array.isArray(a.match)&&a.match.forEach(n)}(n.matched),i}const{hasOwnProperty:En}=Object.prototype;function An(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e&&e>=0}function Rn(e){return Boolean(e)&&An(e.offset)&&An(e.line)&&An(e.column)}function Tn(e,t){return function(n,r){if(!n||n.constructor!==Object)return r(n,"Type of node should be an Object");for(let o in n){let i=!0;if(!1!==En.call(n,o)){if("type"===o)n.type!==e&&r(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if("loc"===o){if(null===n.loc)continue;if(n.loc&&n.loc.constructor===Object)if("string"!=typeof n.loc.source)o+=".source";else if(Rn(n.loc.start)){if(Rn(n.loc.end))continue;o+=".end"}else o+=".start";i=!1}else if(t.hasOwnProperty(o)){i=!1;for(let e=0;!i&&e");else{if(!Array.isArray(r))throw new Error("Wrong value `"+r+"` in `"+e+"."+t+"` structure definition");i.push("List")}}o[t]=i.join(" | ")}return{docs:o,check:Tn(e,r)}}const Pn=dn(mt.join(" | "));function zn(e,t,n){const r={};for(const o in e)e[o].syntax&&(r[o]=n?e[o].syntax:ot(e[o].syntax,{compact:t}));return r}function Mn(e,t,n){const r={};for(const[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:ot(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&zn(i.descriptors,t,n)};return r}function Un(e,t,n){return{matched:e,iterations:n,error:t,...xn}}function Bn(e,t,n,r){const o=function(e,t){return"string"==typeof e?function(e){const t=[];return se(e,((n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null}))),t}(e):t.generate(e,on)}(n,e.syntax);let i;return function(e){for(let t=0;t(Object.defineProperty(i,"syntax",{value:nn(e)}),i.syntax)}):i.syntax=e,Object.defineProperty(i,"match",{get:()=>(Object.defineProperty(i,"match",{value:dn(i.syntax,o)}),i.match)})),i}addAtrule_(e,t){t&&(this.atrules[e]={type:"Atrule",name:e,prelude:t.prelude?this.createDescriptor(t.prelude,"AtrulePrelude",e):null,descriptors:t.descriptors?Object.keys(t.descriptors).reduce(((n,r)=>(n[r]=this.createDescriptor(t.descriptors[r],"AtruleDescriptor",r,e),n)),Object.create(null)):null})}addProperty_(e,t){t&&(this.properties[e]=this.createDescriptor(t,"Property",e))}addType_(e,t){t&&(this.types[e]=this.createDescriptor(t,"Type",e))}checkAtruleName(e){if(!this.getAtrule(e))return new lt("Unknown at-rule","@"+e)}checkAtrulePrelude(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e);return!r.prelude&&t?new SyntaxError("At-rule `@"+e+"` should not contain a prelude"):!r.prelude||t||Bn(this,r.prelude,"",!1).matched?void 0:new SyntaxError("At-rule `@"+e+"` should contain a prelude")}checkAtruleDescriptorName(e,t){const n=this.checkAtruleName(e);if(n)return n;const r=this.getAtrule(e),o=pt(t);return r.descriptors?r.descriptors[o.name]||r.descriptors[o.basename]?void 0:new lt("Unknown at-rule descriptor",t):new SyntaxError("At-rule `@"+e+"` has no known descriptors")}checkPropertyName(e){if(!this.getProperty(e))return new lt("Unknown property",e)}matchAtrulePrelude(e,t){const n=this.checkAtrulePrelude(e,t);if(n)return Un(null,n);const r=this.getAtrule(e);return r.prelude?Bn(this,r.prelude,t||"",!1):Un(null,null)}matchAtruleDescriptor(e,t,n){const r=this.checkAtruleDescriptorName(e,t);if(r)return Un(null,r);const o=this.getAtrule(e),i=pt(t);return Bn(this,o.descriptors[i.name]||o.descriptors[i.basename],n,!1)}matchDeclaration(e){return"Declaration"!==e.type?Un(null,new Error("Not a Declaration node")):this.matchProperty(e.property,e.value)}matchProperty(e,t){if(ft(e).custom)return Un(null,new Error("Lexer matching doesn't applicable for custom properties"));const n=this.checkPropertyName(e);return n?Un(null,n):Bn(this,this.getProperty(e),t,!0)}matchType(e,t){const n=this.getType(e);return n?Bn(this,n,t,!1):Un(null,new lt("Unknown type",e))}match(e,t){return"string"==typeof e||e&&e.type?("string"!=typeof e&&e.match||(e=this.createDescriptor(e,"Type","anonymous")),Bn(this,e,t,!1)):Un(null,new lt("Bad syntax"))}findValueFragments(e,t,n,r){return Cn(this,t,this.matchProperty(e,t),n,r)}findDeclarationValueFragments(e,t,n){return Cn(this,e.value,this.matchDeclaration(e),t,n)}findAllFragments(e,t,n){const r=[];return this.syntax.walk(e,{visit:"Declaration",enter:e=>{r.push.apply(r,this.findDeclarationValueFragments(e,t,n))}}),r}getAtrule(e,t=!0){const n=pt(e);return(n.vendor&&t?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(e,t=!0){const n=this.getAtrule(e,t);return n&&n.prelude||null}getAtruleDescriptor(e,t){return this.atrules.hasOwnProperty(e)&&this.atrules.declarators&&this.atrules[e].declarators[t]||null}getProperty(e,t=!0){const n=ft(e);return(n.vendor&&t?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(e){return hasOwnProperty.call(this.types,e)?this.types[e]:null}validate(){function e(r,o,i,a){if(i.has(o))return i.get(o);i.set(o,!1),null!==a.syntax&&function(e,t,n){let r=rn,o=rn;if(r=t,r===rn&&o===rn)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");!function e(t){switch(r.call(n,t),t.type){case"Group":t.terms.forEach(e);break;case"Multiplier":e(t.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+t.type)}o.call(n,t)}(e)}(a.syntax,(function(a){if("Type"!==a.type&&"Property"!==a.type)return;const s="Type"===a.type?r.types:r.properties,l="Type"===a.type?t:n;hasOwnProperty.call(s,a.name)&&!e(r,a.name,l,s[a.name])||i.set(o,!0)}),this)}let t=new Map,n=new Map;for(const n in this.types)e(this,n,t,this.types[n]);for(const t in this.properties)e(this,t,n,this.properties[t]);return t=[...t.keys()].filter((e=>t.get(e))),n=[...n.keys()].filter((e=>n.get(e))),t.length||n.length?{types:t,properties:n}:null}dump(e,t){return{generic:this.generic,units:this.units,types:zn(this.types,!t,e),properties:zn(this.properties,!t,e),atrules:Mn(this.atrules,!t,e)}}toString(){return JSON.stringify(this.dump())}}function In(e,t){return"string"==typeof t&&/^\s*\|/.test(t)?"string"==typeof e?e+t:t.replace(/^\s*\|\s*/,""):t||null}function jn(e,t){const n=Object.create(null);for(const[r,o]of Object.entries(e))if(o){n[r]={};for(const e of Object.keys(o))t.includes(e)&&(n[r][e]=o[e])}return n}function Dn(e,t){const n={...e};for(const[r,o]of Object.entries(t))switch(r){case"generic":n[r]=Boolean(o);break;case"units":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]=Array.isArray(t)?t:[];break;case"atrules":n[r]={...e[r]};for(const[e,t]of Object.entries(o)){const o=n[r][e]||{},i=n[r][e]={prelude:o.prelude||null,descriptors:{...o.descriptors}};if(t){i.prelude=t.prelude?In(i.prelude,t.prelude):i.prelude||null;for(const[e,n]of Object.entries(t.descriptors||{}))i.descriptors[e]=n?In(i.descriptors[e],n):null;Object.keys(i.descriptors).length||(i.descriptors=null)}}break;case"types":case"properties":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]=In(n[r][e],t);break;case"scope":n[r]={...e[r]};for(const[e,t]of Object.entries(o))n[r][e]={...n[r][e],...t};break;case"parseContext":n[r]={...e[r],...o};break;case"atrule":case"pseudo":n[r]={...e[r],...jn(o,["parse"])};break;case"node":n[r]={...e[r],...jn(o,["name","structure","parse","generate","walkContext"])}}return n}function Vn(e){const t=function(e){let t="",n="",r=!1,o=ge,i=!1;const a=new ne,s=Object.assign(new ae,function(e){const t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:be(e.atrule),pseudo:be(e.pseudo),node:be(e.node)};for(const n in e.parseContext)switch(typeof e.parseContext[n]){case"function":t.context[n]=e.parseContext[n];break;case"string":t.context[n]=me(e.parseContext[n])}return{config:t,...t,...t.node}}(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:de,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket:e=>123===e?1:0,consumeUntilLeftCurlyBracketOrSemicolon:e=>123===e||59===e?1:0,consumeUntilExclamationMarkOrSemicolon:e=>33===e||59===e?1:0,consumeUntilSemicolonIncluded:e=>59===e?2:0,createList:()=>new ue,createSingleNodeList:e=>(new ue).appendData(e),getFirstListNode:e=>e&&e.first,getLastListNode:e=>e&&e.last,parseWithFallback(e,t){const n=this.tokenIndex;try{return e.call(this)}catch(e){if(i)throw e;const r=t.call(this,n);return i=!0,o(e,r),i=!1,r}},lookupNonWSType(e){let t;do{if(t=this.lookupType(e++),t!==g)return t}while(0!==t);return 0},charCodeAt:e=>e>=0&&et.substring(e,n),substrToCursor(e){return this.source.substring(e,this.tokenStart)},cmpChar:(e,n)=>q(t,e,n),cmpStr:(e,n,r)=>W(t,e,n,r),consume(e){const t=this.tokenStart;return this.eat(e),this.substrToCursor(t)},consumeFunctionName(){const e=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),e},consumeNumber(e){const n=t.substring(this.tokenStart,Q(t,this.tokenStart));return this.eat(e),n},eat(e){if(this.tokenType!==e){const t=J[e].slice(0,-6).replace(/-/g," ").replace(/^./,(e=>e.toUpperCase()));let n=`${/[[\](){}]/.test(t)?`"${t}"`:t} is expected`,r=this.tokenStart;switch(e){case 1:2===this.tokenType||7===this.tokenType?(r=this.tokenEnd-1,n="Identifier is expected but function found"):n="Identifier is expected";break;case 4:this.isDelim(35)&&(this.next(),r++,n="Name is expected");break;case f:this.tokenType===p&&(r=this.tokenEnd,n="Percent sign is expected")}this.error(n,r)}this.next()},eatIdent(e){1===this.tokenType&&!1!==this.lookupValue(0,e)||this.error(`Identifier "${e}" is expected`),this.next()},eatDelim(e){this.isDelim(e)||this.error(`Delim "${String.fromCharCode(e)}" is expected`),this.next()},getLocation:(e,t)=>r?a.getLocationRange(e,t,n):null,getLocationFromList(e){if(r){const t=this.getFirstListNode(e),r=this.getLastListNode(e);return a.getLocationRange(null!==t?t.loc.start.offset-a.startOffset:this.tokenStart,null!==r?r.loc.end.offset-a.startOffset:this.tokenStart,n)}return null},error(e,n){const r=void 0!==n&&n=0&&M(e.charCodeAt(t));t--);return t+1}(t,t.length-1)):a.getLocation(this.tokenStart);throw new fe(e||"Unexpected input",t,r.offset,r.line,r.column)}});return Object.assign((function(e,l){t=e,l=l||{},s.setSource(t,se),a.setSource(t,l.offset,l.line,l.column),n=l.filename||"",r=Boolean(l.positions),o="function"==typeof l.onParseError?l.onParseError:ge,i=!1,s.parseAtrulePrelude=!("parseAtrulePrelude"in l)||Boolean(l.parseAtrulePrelude),s.parseRulePrelude=!("parseRulePrelude"in l)||Boolean(l.parseRulePrelude),s.parseValue=!("parseValue"in l)||Boolean(l.parseValue),s.parseCustomProperty="parseCustomProperty"in l&&Boolean(l.parseCustomProperty);const{context:u="default",onComment:c}=l;if(u in s.context==0)throw new Error("Unknown context `"+u+"`");"function"==typeof c&&s.forEachToken(((e,n,r)=>{if(e===E){const e=s.getLocation(n,r),o=W(t,r-2,r,"*/")?t.slice(n+2,r-2):t.slice(n+2,r);c(o,e)}}));const h=s.context[u].call(s,l);return s.eof||s.error(),h}),{SyntaxError:fe,config:s.config})}(e),n=function(e){const t=function(e){const t={};for(const n in e.node)if(Ge.call(e.node,n)){const r=e.node[n];if(!r.structure)throw new Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Je(0,r)}return t}(e),n={},r={},o=Symbol("break-walk"),i=Symbol("skip-node");for(const e in t)Ge.call(t,e)&&null!==t[e]&&(n[e]=et(t[e],!1),r[e]=et(t[e],!0));const a=tt(n),s=tt(r),l=function(e,l){function u(e,t,n){const r=c.call(d,e,t,n);return r===o||r!==i&&(!(!p.hasOwnProperty(e.type)||!p[e.type](e,d,u,f))||h.call(d,e,t,n)===o)}let c=Qe,h=Qe,p=n,f=(e,t,n,r)=>e||u(t,n,r);const d={break:o,skip:i,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if("function"==typeof l)c=l;else if(l&&(c=Ze(l.enter),h=Ze(l.leave),l.reverse&&(p=r),l.visit)){if(a.hasOwnProperty(l.visit))p=l.reverse?s[l.visit]:a[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(", ")+")");c=Xe(c,l.visit),h=Xe(h,l.visit)}if(c===Qe&&h===Qe)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");u(e)};return l.break=o,l.skip=i,l.find=function(e,t){let n=null;return l(e,(function(e,r,i){if(t.call(this,e,r,i))return n=e,o})),n},l.findLast=function(e,t){let n=null;return l(e,{reverse:!0,enter(e,r,i){if(t.call(this,e,r,i))return n=e,o}}),n},l.findAll=function(e,t){const n=[];return l(e,(function(e,r,o){t.call(this,e,r,o)&&n.push(e)})),n},l}(e),r=function(e){const t=new Map;for(let n in e.node){const r=e.node[n];"function"==typeof(r.generate||r)&&t.set(n,r.generate||r)}return function(e,n){let r="",o=0,i={node(e){if(!t.has(e.type))throw new Error("Unknown node type: "+e.type);t.get(e.type).call(a,e)},tokenBefore:We,token(e,t){o=this.tokenBefore(o,e,t),this.emit(t,e,!1),9===e&&92===t.charCodeAt(0)&&this.emit("\n",g,!0)},emit(e){r+=e},result:()=>r};n&&("function"==typeof n.decorator&&(i=n.decorator(i)),n.sourceMap&&(i=function(e){const t=new Ie,n={line:1,column:0},r={line:0,column:0},o={line:1,column:0},i={generated:o};let a=1,s=0,l=!1;const u=e.node;e.node=function(e){if(e.loc&&e.loc.start&&je.has(e.type)){const u=e.loc.start.line,c=e.loc.start.column-1;r.line===u&&r.column===c||(r.line=u,r.column=c,n.line=a,n.column=s,l&&(l=!1,n.line===o.line&&n.column===o.column||t.addMapping(i)),l=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}u.call(this,e),l&&je.has(e.type)&&(o.line=a,o.column=s)};const c=e.emit;e.emit=function(e,t,n){for(let t=0;ti.node(e),children:$e,token:(e,t)=>i.token(e,t),tokenize:He};return i.node(e),i.result()}}(e),{fromPlainObject:o,toPlainObject:i}=function(e){return{fromPlainObject:t=>(e(t,{enter(e){e.children&&e.children instanceof ue==0&&(e.children=(new ue).fromArray(e.children))}}),t),toPlainObject:t=>(e(t,{leave(e){e.children&&e.children instanceof ue&&(e.children=e.children.toArray())}}),t)}}(n),a={lexer:null,createLexer:e=>new Nn(e,a,a.lexer.structure),tokenize:se,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(t){const n=Dn({},e);return Vn("function"==typeof t?t(n,Object.assign):Dn(n,t))}};return a.lexer=new Nn({generic:!0,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},a),a}const Fn=43,Kn=45,qn=110,Wn=!0;function Yn(e,t){let n=this.tokenStart+e;const r=this.charCodeAt(n);for(r!==Fn&&r!==Kn||(t&&this.error("Number sign is not allowed"),n++);n0&&this.skip(e),0===t&&(n=this.charCodeAt(this.tokenStart),n!==Fn&&n!==Kn&&this.error("Number sign is expected")),$n.call(this,0!==t),t===Kn?"-"+this.consume(p):this.consume(p)}const Qn={a:[String,null],b:[String,null]};function Zn(){const e=this.tokenStart;let t=null,n=null;if(this.tokenType===p)$n.call(this,!1),n=this.consume(p);else if(1===this.tokenType&&this.cmpChar(this.tokenStart,Kn))switch(t="-1",Hn.call(this,1,qn),this.tokenEnd-this.tokenStart){case 2:this.next(),n=Gn.call(this);break;case 3:Hn.call(this,2,Kn),this.next(),this.skipSC(),$n.call(this,Wn),n="-"+this.consume(p);break;default:Hn.call(this,2,Kn),Yn.call(this,3,Wn),this.next(),n=this.substrToCursor(e+2)}else if(1===this.tokenType||this.isDelim(Fn)&&1===this.lookupType(1)){let r=0;switch(t="1",this.isDelim(Fn)&&(r=1,this.next()),Hn.call(this,0,qn),this.tokenEnd-this.tokenStart){case 1:this.next(),n=Gn.call(this);break;case 2:Hn.call(this,1,Kn),this.next(),this.skipSC(),$n.call(this,Wn),n="-"+this.consume(p);break;default:Hn.call(this,1,Kn),Yn.call(this,2,Wn),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===d){const r=this.charCodeAt(this.tokenStart),o=r===Fn||r===Kn;let i=this.tokenStart+o;for(;i{"Declaration"===e.type&&this.token(y,";")})),this.token(C,"}")}});function br(e,t){const n=this.tokenStart;let r=null;return this.eat(w),r=e.call(this,t),this.eof||this.eat(k),{type:"Brackets",loc:this.getLocation(n,this.tokenStart),children:r}}var yr=Object.freeze({__proto__:null,name:"Brackets",structure:{children:[[]]},parse:br,generate:function(e){this.token(9,"["),this.children(e),this.token(9,"]")}});function vr(){const e=this.tokenStart;return this.eat(m),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}var wr=Object.freeze({__proto__:null,name:"CDC",structure:[],parse:vr,generate:function(){this.token(m,"--\x3e")}});function kr(){const e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}var xr=Object.freeze({__proto__:null,name:"CDO",structure:[],parse:kr,generate:function(){this.token(14,"\x3c!--")}});const Or={name:String};function Sr(){return this.eatDelim(46),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}var Cr=Object.freeze({__proto__:null,name:"ClassSelector",structure:Or,parse:Sr,generate:function(e){this.token(9,"."),this.token(1,e.name)}});const Er={name:String};function _r(){const e=this.tokenStart;let t;switch(this.tokenType){case g:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case 62:case 43:case 126:this.next();break;case 47:this.next(),this.eatIdent("deep"),this.eatDelim(47);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e)}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}var Ar=Object.freeze({__proto__:null,name:"Combinator",structure:Er,parse:_r,generate:function(e){this.tokenize(e.name)}});const Rr={value:String};function Tr(){const e=this.tokenStart;let t=this.tokenEnd;return this.eat(E),t-e+2>=2&&42===this.charCodeAt(t-2)&&47===this.charCodeAt(t-1)&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}var Lr=Object.freeze({__proto__:null,name:"Comment",structure:Rr,parse:Tr,generate:function(e){this.token(E,"/*"+e.value+"*/")}});function Pr(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!0)}function zr(e){return this.Raw(e,this.consumeUntilExclamationMarkOrSemicolon,!1)}function Mr(){const e=this.tokenIndex,t=this.Value();return"Raw"!==t.type&&!1===this.eof&&this.tokenType!==y&&!1===this.isDelim(33)&&!1===this.isBalanceEdge(e)&&this.error(),t}const Ur={important:[Boolean,String],property:String,value:["Value","Raw"]};function Br(){const e=this.tokenStart,t=this.tokenIndex,n=Nr.call(this),r=dt(n),o=r?this.parseCustomProperty:this.parseValue,i=r?zr:Pr;let a,s=!1;this.skipSC(),this.eat(b);const l=this.tokenIndex;if(r||this.skipSC(),a=o?this.parseWithFallback(Mr,i):i.call(this,this.tokenIndex),r&&"Value"===a.type&&a.children.isEmpty)for(let e=l-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===g){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}return this.isDelim(33)&&(s=Ir.call(this),this.skipSC()),!1===this.eof&&this.tokenType!==y&&!1===this.isBalanceEdge(t)&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:s,property:n,value:a}}function Nr(){const e=this.tokenStart;if(9===this.tokenType)switch(this.charCodeAt(this.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.next();break;case 47:this.next(),this.isDelim(47)&&this.next()}return 4===this.tokenType?this.eat(4):this.eat(1),this.substrToCursor(e)}function Ir(){this.eat(9),this.skipSC();const e=this.consume(1);return"important"===e||e}var jr=Object.freeze({__proto__:null,name:"Declaration",walkContext:"declaration",structure:Ur,parse:Br,generate:function(e){this.token(1,e.property),this.token(b,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,!0===e.important?"important":e.important))}});function Dr(e){return this.Raw(e,this.consumeUntilSemicolonIncluded,!0)}function Vr(){const e=this.createList();for(;!this.eof;)switch(this.tokenType){case g:case E:case y:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),Dr));break;default:this.isDelim(38)?e.push(this.parseWithFallback(this.Rule,Dr)):e.push(this.parseWithFallback(this.Declaration,Dr))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}var Fr=Object.freeze({__proto__:null,name:"DeclarationList",structure:{children:[["Declaration","Atrule","Rule"]]},parse:Vr,generate:function(e){this.children(e,(e=>{"Declaration"===e.type&&this.token(y,";")}))}});const Kr={value:String,unit:String};function qr(){const e=this.tokenStart,t=this.consumeNumber(d);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}var Wr=Object.freeze({__proto__:null,name:"Dimension",structure:Kr,parse:qr,generate:function(e){this.token(d,e.value+e.unit)}});const Yr={name:String,children:[[]]};function $r(e,t){const n=this.tokenStart,r=this.consumeFunctionName(),o=r.toLowerCase();let i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(O),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}var Hr=Object.freeze({__proto__:null,name:"Function",walkContext:"function",structure:Yr,parse:$r,generate:function(e){this.token(2,e.name+"("),this.children(e),this.token(O,")")}});const Gr={value:String};function Qr(){const e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}var Zr=Object.freeze({__proto__:null,xxx:"XXX",name:"Hash",structure:Gr,parse:Qr,generate:function(e){this.token(4,"#"+e.value)}});const Xr={name:String};function Jr(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}var eo=Object.freeze({__proto__:null,name:"Identifier",structure:Xr,parse:Jr,generate:function(e){this.token(1,e.name)}});const to={name:String};function no(){const e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}var ro=Object.freeze({__proto__:null,name:"IdSelector",structure:to,parse:no,generate:function(e){this.token(9,"#"+e.name)}});const oo={name:String,value:["Identifier","Number","Dimension","Ratio",null]};function io(){const e=this.tokenStart;let t,n=null;if(this.eat(x),this.skipSC(),t=this.consume(1),this.skipSC(),this.tokenType!==O){switch(this.eat(b),this.skipSC(),this.tokenType){case p:n=9===this.lookupNonWSType(1)?this.Ratio():this.Number();break;case d:n=this.Dimension();break;case 1:n=this.Identifier();break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eat(O),{type:"MediaFeature",loc:this.getLocation(e,this.tokenStart),name:t,value:n}}var ao=Object.freeze({__proto__:null,name:"MediaFeature",structure:oo,parse:io,generate:function(e){this.token(x,"("),this.token(1,e.name),null!==e.value&&(this.token(b,":"),this.node(e.value)),this.token(O,")")}});function so(){const e=this.createList();let t=null;this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case E:case g:this.next();continue;case 1:t=this.Identifier();break;case x:t=this.MediaFeature();break;default:break e}e.push(t)}return null===t&&this.error("Identifier or parenthesis is expected"),{type:"MediaQuery",loc:this.getLocationFromList(e),children:e}}var lo=Object.freeze({__proto__:null,name:"MediaQuery",structure:{children:[["Identifier","MediaFeature","WhiteSpace"]]},parse:so,generate:function(e){this.children(e)}});function uo(){const e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===v);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}var co=Object.freeze({__proto__:null,name:"MediaQueryList",structure:{children:[["MediaQuery"]]},parse:uo,generate:function(e){this.children(e,(()=>this.token(v,",")))}});function ho(){const e=this.tokenStart;return this.eatDelim(38),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}var po=Object.freeze({__proto__:null,name:"NestingSelector",structure:{},parse:ho,generate:function(){this.token(9,"&")}});function fo(){this.skipSC();const e=this.tokenStart;let t,n=e,r=null;return t=this.lookupValue(0,"odd")||this.lookupValue(0,"even")?this.Identifier():this.AnPlusB(),n=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),n=this.tokenStart),{type:"Nth",loc:this.getLocation(e,n),nth:t,selector:r}}var go=Object.freeze({__proto__:null,name:"Nth",structure:{nth:["AnPlusB","Identifier"],selector:["SelectorList",null]},parse:fo,generate:function(e){this.node(e.nth),null!==e.selector&&(this.token(1,"of"),this.node(e.selector))}});const mo={value:String};function bo(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(p)}}var yo=Object.freeze({__proto__:null,name:"Number",structure:mo,parse:bo,generate:function(e){this.token(p,e.value)}});const vo={value:String};function wo(){const e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}var ko=Object.freeze({__proto__:null,name:"Operator",structure:vo,parse:wo,generate:function(e){this.tokenize(e.value)}});function xo(e,t){const n=this.tokenStart;let r=null;return this.eat(x),r=e.call(this,t),this.eof||this.eat(O),{type:"Parentheses",loc:this.getLocation(n,this.tokenStart),children:r}}var Oo=Object.freeze({__proto__:null,name:"Parentheses",structure:{children:[[]]},parse:xo,generate:function(e){this.token(x,"("),this.children(e),this.token(O,")")}});const So={value:String};function Co(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(f)}}var Eo=Object.freeze({__proto__:null,name:"Percentage",structure:So,parse:Co,generate:function(e){this.token(f,e.value+"%")}});const _o={name:String,children:[["Raw"],null]};function Ao(){const e=this.tokenStart;let t,n,r=null;return this.eat(b),2===this.tokenType?(t=this.consumeFunctionName(),n=t.toLowerCase(),hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(this.tokenIndex,null,!1))),this.eat(O)):t=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}var Ro=Object.freeze({__proto__:null,name:"PseudoClassSelector",walkContext:"function",structure:_o,parse:Ao,generate:function(e){this.token(b,":"),null===e.children?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(O,")"))}});const To={name:String,children:[["Raw"],null]};function Lo(){const e=this.tokenStart;let t,n,r=null;return this.eat(b),this.eat(b),2===this.tokenType?(t=this.consumeFunctionName(),n=t.toLowerCase(),hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),r=this.pseudo[n].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(this.tokenIndex,null,!1))),this.eat(O)):t=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:t,children:r}}var Po=Object.freeze({__proto__:null,name:"PseudoElementSelector",walkContext:"function",structure:To,parse:Lo,generate:function(e){this.token(b,":"),this.token(b,":"),null===e.children?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(O,")"))}});function zo(){this.skipSC();const e=this.consume(p);for(let t=0;t0&&this.lookupType(-1)===g?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Io={value:String};function jo(e,t,n){const r=this.getTokenStart(e);let o;return this.skipUntilBalanced(e,t||this.consumeUntilBalanceEnd),o=n&&this.tokenStart>r?No.call(this):this.tokenStart,{type:"Raw",loc:this.getLocation(r,o),value:this.substring(r,o)}}var Do=Object.freeze({__proto__:null,name:"Raw",structure:Io,parse:jo,generate:function(e){this.tokenize(e.value)}});function Vo(e){return this.Raw(e,this.consumeUntilLeftCurlyBracket,!0)}function Fo(){const e=this.SelectorList();return"Raw"!==e.type&&!1===this.eof&&this.tokenType!==S&&this.error(),e}function Ko(){const e=this.tokenIndex,t=this.tokenStart;let n,r;return n=this.parseRulePrelude?this.parseWithFallback(Fo,Vo):Vo.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}var qo=Object.freeze({__proto__:null,name:"Rule",walkContext:"rule",structure:{prelude:["SelectorList","Raw"],block:["Block"]},parse:Ko,generate:function(e){this.node(e.prelude),this.node(e.block)}});function Wo(){const e=this.readSequence(this.scope.Selector);return null===this.getFirstListNode(e)&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}var Yo=Object.freeze({__proto__:null,name:"Selector",structure:{children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator","WhiteSpace"]]},parse:Wo,generate:function(e){this.children(e)}});function $o(){const e=this.createList();for(;!this.eof&&(e.push(this.Selector()),this.tokenType===v);)this.next();return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}var Ho=Object.freeze({__proto__:null,name:"SelectorList",walkContext:"selector",structure:{children:[["Selector","Raw"]]},parse:$o,generate:function(e){this.children(e,(()=>this.token(v,",")))}});function Go(e){const t=e.length,n=e.charCodeAt(0),r=34===n||39===n?1:0,o=1===r&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1;let i="";for(let n=r;n<=o;n++){let r=e.charCodeAt(n);if(92===r){if(n===o){n!==t-1&&(i=e.substr(n+1));break}if(r=e.charCodeAt(++n),U(92,r)){const t=n-1,r=H(e,t);n=r-1,i+=X(e.substring(t+1,r))}else 13===r&&10===e.charCodeAt(n+1)&&n++}else i+=e[n]}return i}const Qo={value:String};function Zo(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Go(this.consume(5))}}var Xo=Object.freeze({__proto__:null,name:"String",structure:Qo,parse:Zo,generate:function(e){this.token(5,function(e,t){let n="",r=!1;for(let t=0;t6&&this.error("Too many hex digits",r)}return this.next(),n}function si(e){let t=0;for(;this.isDelim(63);)++t>e&&this.error("Too many question marks"),this.next()}function li(e){this.charCodeAt(this.tokenStart)!==e&&this.error((43===e?"Plus sign":"Hyphen minus")+" is expected")}function ui(){let e=0;switch(this.tokenType){case p:if(e=ai.call(this,1,!0),this.isDelim(63)){si.call(this,6-e);break}if(this.tokenType===d||this.tokenType===p){li.call(this,45),ai.call(this,1,!1);break}break;case d:e=ai.call(this,1,!0),e>0&&si.call(this,6-e);break;default:if(this.eatDelim(43),1===this.tokenType){e=ai.call(this,0,!0),e>0&&si.call(this,6-e);break}if(this.isDelim(63)){this.next(),si.call(this,5);break}this.error("Hex digit or question mark is expected")}}const ci={value:String};function hi(){const e=this.tokenStart;return this.eatIdent("u"),ui.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}var pi=Object.freeze({__proto__:null,name:"UnicodeRange",structure:ci,parse:hi,generate:function(e){this.tokenize(e.value)}});const fi={value:String};function di(){const e=this.tokenStart;let t;switch(this.tokenType){case 7:t=function(e){const t=e.length;let n=4,r=41===e.charCodeAt(t-1)?t-2:t-1,o="";for(;nVn(Dn({},e)))({generic:!0,generic:!0,units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["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"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( )","alpha-value":"|","angle-percentage":"|","angular-color-hint":"","angular-color-stop":"&&?","angular-color-stop-list":"[ [, ]?]# , ","animateable-feature":"scroll-position|contents|","asin()":"asin( )","atan()":"atan( )","atan2()":"atan2( , )",attachment:"scroll|fixed|local","attr()":"attr( ? [, ]? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attribute-selector":"'[' ']'|'[' [|] ? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [? ]+ ? )","auto-track-list":"[? [|]]* ? [? [|]]* ?",axis:"block|inline|vertical|horizontal","baseline-position":"[first|last]? baseline","basic-shape":"||||","bg-image":"none|","bg-layer":"|| [/ ]?||||||||","bg-position":"[[left|center|right|top|bottom|]|[left|center|right|] [top|center|bottom|]|[center|[left|right] ?]&&[center|[top|bottom] ?]]","bg-size":"[|auto]{1,2}|cover|contain","blur()":"blur( )","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",box:"border-box|padding-box|content-box","brightness()":"brightness( )","calc()":"calc( )","calc-sum":" [['+'|'-'] ]*","calc-product":" ['*' |'/' ]*","calc-value":"||||( )","calc-constant":"e|pi|infinity|-infinity|NaN","cf-final-image":"|","cf-mixing-image":"?&&","circle()":"circle( []? [at ]? )","clamp()":"clamp( #{3} )","class-selector":"'.' ","clip-source":"",color:"|||||||||currentcolor|","color-stop":"|","color-stop-angle":"{1,2}","color-stop-length":"{1,2}","color-stop-list":"[ [, ]?]# , ",combinator:"'>'|'+'|'~'|['||']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|push-button|slider-horizontal|checkbox|radio|square-button|menulist|listbox|meter|progress-bar|button","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[? * [ *]*]!","compound-selector-list":"#","complex-selector":" [? ]*","complex-selector-list":"#","conic-gradient()":"conic-gradient( [from ]? [at ]? , )","contextual-alt-values":"[contextual|no-contextual]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[|contents||||||]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"","contrast()":"contrast( [] )","cos()":"cos( )",counter:"|","counter()":"counter( , ? )","counter-name":"","counter-style":"|symbols( )","counter-style-name":"","counters()":"counters( , , ? )","cross-fade()":"cross-fade( , ? )","cubic-bezier-timing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( , , , )","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( {2,3} ? )","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( , [first|start|last|first-except]? )|element( )","ellipse()":"ellipse( [{2}]? [at ]? )","ending-shape":"circle|ellipse","env()":"env( , ? )","exp()":"exp( )","explicit-track-list":"[? ]+ ?","family-name":"|+","feature-tag-value":" [|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":" '{' '}'","feature-value-block-list":"+","feature-value-declaration":" : + ;","feature-value-declaration-list":"","feature-value-name":"","fill-rule":"nonzero|evenodd","filter-function":"|||||||||","filter-function-list":"[|]+","final-bg-layer":"<'background-color'>|||| [/ ]?||||||||","fixed-breadth":"","fixed-repeat":"repeat( [] , [? ]+ ? )","fixed-size":"|minmax( , )|minmax( , )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|","font-variant-css21":"[normal|small-caps]","font-weight-absolute":"normal|bold|","frequency-percentage":"|","general-enclosed":"[ )]|( )","generic-family":"serif|sans-serif|cursive|fantasy|monospace|-apple-system","generic-name":"serif|sans-serif|cursive|fantasy|monospace","geometry-box":"|fill-box|stroke-box|view-box",gradient:"||||||<-legacy-gradient>","grayscale()":"grayscale( )","grid-line":"auto||[&&?]|[span&&[||]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( [/ ]? )|hsl( , , , ? )","hsla()":"hsla( [/ ]? )|hsla( , , , ? )",hue:"|","hue-rotate()":"hue-rotate( )","hwb()":"hwb( [|none] [|none] [|none] [/ [|none]]? )","hypot()":"hypot( # )",image:"||||||","image()":"image( ? [? , ?]! )","image-set()":"image-set( # )","image-set-option":"[|] [||type( )]","image-src":"|","image-tags":"ltr|rtl","inflexible-breadth":"|min-content|max-content|auto","inset()":"inset( {1,4} [round <'border-radius'>]? )","invert()":"invert( )","keyframes-name":"|","keyframe-block":"# { }","keyframe-block-list":"+","keyframe-selector":"from|to|","lab()":"lab( [||none] [||none] [||none] [/ [|none]]? )","layer()":"layer( )","layer-name":" ['.' ]*","lch()":"lch( [||none] [||none] [|none] [/ [|none]]? )","leader()":"leader( )","leader-type":"dotted|solid|space|","length-percentage":"|","line-names":"'[' * ']'","line-name-list":"[|]+","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"|thin|medium|thick","linear-color-hint":"","linear-color-stop":" ?","linear-gradient()":"linear-gradient( [|to ]? , )","log()":"log( , ? )","mask-layer":"|| [/ ]?||||||[|no-clip]||||","mask-position":"[|left|center|right] [|top|center|bottom]?","mask-reference":"none||","mask-source":"","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( #{6} )","matrix3d()":"matrix3d( #{16} )","max()":"max( # )","media-and":" [and ]+","media-condition":"|||","media-condition-without-or":"||","media-feature":"( [||] )","media-in-parens":"( )||","media-not":"not ","media-or":" [or ]+","media-query":"|[not|only]? [and ]?","media-query-list":"#","media-type":"","mf-boolean":"","mf-name":"","mf-plain":" : ","mf-range":" ['<'|'>']? '='? | ['<'|'>']? '='? | '<' '='? '<' '='? | '>' '='? '>' '='? ","mf-value":"|||","min()":"min( # )","minmax()":"minmax( [|min-content|max-content|auto] , [||min-content|max-content|auto] )","mod()":"mod( , )","name-repeat":"repeat( [|auto-fill] , + )","named-color":"transparent|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|<-non-standard-color>","namespace-prefix":"","ns-prefix":"[|'*']? '|'","number-percentage":"|","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]",nth:"|even|odd","opacity()":"opacity( [] )","overflow-position":"unsafe|safe","outline-radius":"|","page-body":"? [; ]?| ","page-margin-box":" '{' '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector-list":"[#]?","page-selector":"+| *","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger","path()":"path( [ ,]? )","paint()":"paint( , ? )","perspective()":"perspective( [|none] )","polygon()":"polygon( ? , [ ]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|] [top|center|bottom|]?|[[left|right] ]&&[[top|bottom] ]]","pow()":"pow( , )","pseudo-class-selector":"':' |':' ')'","pseudo-element-selector":"':' ","pseudo-page":": [left|right|first|blank]",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-gradient()":"radial-gradient( [||]? [at ]? , )",ratio:" [/ ]?","relative-selector":"? ","relative-selector-list":"#","relative-size":"larger|smaller","rem()":"rem( , )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [from ]? [at ]? , )","repeating-linear-gradient()":"repeating-linear-gradient( [|to ]? , )","repeating-radial-gradient()":"repeating-radial-gradient( [||]? [at ]? , )","reversed-counter-name":"reversed( )","rgb()":"rgb( {3} [/ ]? )|rgb( {3} [/ ]? )|rgb( #{3} , ? )|rgb( #{3} , ? )","rgba()":"rgba( {3} [/ ]? )|rgba( {3} [/ ]? )|rgba( #{3} , ? )|rgba( #{3} , ? )","rotate()":"rotate( [|] )","rotate3d()":"rotate3d( , , , [|] )","rotateX()":"rotateX( [|] )","rotateY()":"rotateY( [|] )","rotateZ()":"rotateZ( [|] )","round()":"round( ? , , )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( )","scale()":"scale( [|]#{1,2} )","scale3d()":"scale3d( [|]#{3} )","scaleX()":"scaleX( [|] )","scaleY()":"scaleY( [|] )","scaleZ()":"scaleZ( [|] )",scroller:"root|nearest","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","shape-radius":"|closest-side|farthest-side","sign()":"sign( )","skew()":"skew( [|] , [|]? )","skewX()":"skewX( [|] )","skewY()":"skewY( [|] )","sepia()":"sepia( )",shadow:"inset?&&{2,4}&&?","shadow-t":"[{2,3}&&?]",shape:"rect( , , , )|rect( )","shape-box":"|margin-box","side-or-corner":"[left|right]||[top|bottom]","sin()":"sin( )","single-animation":"