You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
164 KiB

var ts=Object.create;var nr=Object.defineProperty;var rs=Object.getOwnPropertyDescriptor;var ns=Object.getOwnPropertyNames;var os=Object.getPrototypeOf,is=Object.prototype.hasOwnProperty;var Oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),b=(e,t)=>{for(var r in t)nr(e,r,{get:t[r],enumerable:!0})},as=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ns(t))!is.call(e,o)&&o!==r&&nr(e,o,{get:()=>t[o],enumerable:!(n=rs(t,o))||n.enumerable});return e};var ss=(e,t,r)=>(r=e!=null?ts(os(e)):{},as(t||!e||!e.__esModule?nr(r,"default",{value:e,enumerable:!0}):r,e));var Zo=Oe(hr=>{var $o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");hr.encode=function(e){if(0<=e&&e<$o.length)return $o[e];throw new TypeError("Must be between 0 and 63: "+e)};hr.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 ni=Oe(fr=>{var Jo=Zo(),mr=5,ei=1<<mr,ti=ei-1,ri=ei;function ys(e){return e<0?(-e<<1)+1:(e<<1)+0}function ks(e){var t=(e&1)===1,r=e>>1;return t?-r:r}fr.encode=function(t){var r="",n,o=ys(t);do n=o&ti,o>>>=mr,o>0&&(n|=ri),r+=Jo.encode(n);while(o>0);return r};fr.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=Jo.decode(t.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));u=!!(c&ri),c&=ti,i=i+(c<<s),s+=mr}while(u);n.value=ks(i),n.rest=r}});var Lt=Oe(K=>{function ws(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}K.getArg=ws;var oi=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,vs=/^data:.+\,.+$/;function ot(e){var t=e.match(oi);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}K.urlParse=ot;function Ue(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}K.urlGenerate=Ue;var Ss=32;function Cs(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>Ss&&t.pop(),i}}var dr=Cs(function(t){var r=t,n=ot(t);if(n){if(!n.path)return t;r=n.path}for(var o=K.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,Ue(n)):r});K.normalize=dr;function ii(e,t){e===""&&(e="."),t===""&&(t=".");var r=ot(t),n=ot(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Ue(r);if(r||t.match(vs))return t;if(n&&!n.host&&!n.path)return n.host=t,Ue(n);var o=t.charAt(0)==="/"?t:dr(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Ue(n)):o}K.join=ii;K.isAbsolute=function(e){return e.charAt(0)==="/"||oi.test(e)};function As(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)}K.relative=As;var ai=function(){var e=Object.create(null);return!("__proto__"in e)}();function si(e){return e}function Ts(e){return li(e)?"$"+e:e}K.toSetString=ai?si:Ts;function Es(e){return li(e)?e.slice(1):e}K.fromSetString=ai?si:Es;function li(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 Ls(e,t,r){var n=be(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.gen
`)}})}var lr=100,qo=60,Wo=" ";function Yo({source:e,line:t,column:r},n){function o(l,p){return i.slice(l,p).map((m,f)=>String(l+f+1).padStart(c)+" |"+m).join(`
`)}let i=e.split(/\r\n?|\n|\f/),s=Math.max(1,t-n)-1,u=Math.min(t+n,i.length+1),c=Math.max(4,String(u).length)+1,a=0;r+=(Wo.length-1)*(i[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>lr&&(a=r-qo+3,r=qo-2);for(let l=s;l<=u;l++)l>=0&&l<i.length&&(i[l]=i[l].replace(/\t/g,Wo),i[l]=(a>0&&i[l].length>a?"\u2026":"")+i[l].substr(a,lr-2)+(i[l].length>a+lr-1?"\u2026":""));return[o(s,t),new Array(r+c+2).join("-")+"^",o(t,u)].filter(Boolean).join(`
`)}function cr(e,t,r,n,o){return Object.assign(Ee("SyntaxError",e),{source:t,offset:r,line:n,column:o,sourceFragment(s){return Yo({source:t,line:n,column:o},isNaN(s)?0:s)},get formattedMessage(){return`Parse error: ${e}
`+Yo({source:t,line:n,column:o},2)}})}function Go(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 Vo=()=>{},ds=33,gs=35,ur=59,Ko=123,Qo=0;function bs(e){return function(){return this[e]()}}function pr(e){let t=Object.create(null);for(let r in e){let n=e[r],o=n.parse||n;o&&(t[r]=o)}return t}function xs(e){let t={context:Object.create(null),scope:Object.assign(Object.create(null),e.scope),atrule:pr(e.atrule),pseudo:pr(e.pseudo),node:pr(e.node)};for(let r in e.parseContext)switch(typeof e.parseContext[r]){case"function":t.context[r]=e.parseContext[r];break;case"string":t.context[r]=bs(e.parseContext[r]);break}return{config:t,...t,...t.node}}function Xo(e){let t="",r="<unknown>",n=!1,o=Vo,i=!1,s=new Et,u=Object.assign(new nt,xs(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Go,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(a){return a===Ko?1:0},consumeUntilLeftCurlyBracketOrSemicolon(a){return a===Ko||a===ur?1:0},consumeUntilExclamationMarkOrSemicolon(a){return a===ds||a===ur?1:0},consumeUntilSemicolonIncluded(a){return a===ur?2:0},createList(){return new I},createSingleNodeList(a){return new I().appendData(a)},getFirstListNode(a){return a&&a.first},getLastListNode(a){return a&&a.last},parseWithFallback(a,l){let p=this.tokenIndex;try{return a.call(this)}catch(m){if(i)throw m;let f=l.call(this,p);return i=!0,o(m,f),i=!1,f}},lookupNonWSType(a){let l;do if(l=this.lookupType(a++),l!==13)return l;while(l!==Qo);return Qo},charCodeAt(a){return a>=0&&a<t.length?t.charCodeAt(a):0},substring(a,l){return t.substring(a,l)},substrToCursor(a){return this.source.substring(a,this.tokenStart)},cmpChar(a,l){return de(t,a,l)},cmpStr(a,l,p){return ge(t,a,l,p)},consume(a){let l=this.tokenStart;return this.eat(a),this.substrToCursor(l)},consumeFunctionName(){let a=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),a},consumeNumber(a){let l=t.substring(this.tokenStart,Te(t,this.tokenStart));return this.eat(a),l},eat(a){if(this.tokenType!==a){let l=Fe[a].slice(0,-6).replace(/-/g," ").replace(/^./,f=>f.toUpperCase()),p=`${/[[\](){}]/.test(l)?`"${l}"`:l} is expected`,m=this.tokenStart;switch(a){case 1:this.tokenType===2||this.tokenType===7?(m=this.tokenEnd-1,p="Identifier is expected but function found"):p="Identifier is expected";break;case 4:this.isDelim(gs)&&(this.next(),m++,p="Name is expected");break;case 11:this.tokenType===10&&(m=this.tokenEnd,p="Percent sign is expected");break}this.error(p,m)}this.next()},eatIdent(a){(this.tokenType!==1||this.lookupValue(0,a)===!1)&&this.error(`Identifier "${a}" is expected`),this.next()},eatDelim(a){this.isDelim(a)||this.error(`Delim "${String.fromCharCode(a)}" is expected`),this.next()},getLocation(a,l){return n?s.getLocationRange(a,l,r):null},getLocationFromList(a){if(n){let l=this.getFirstListNode(a),p=this.getLastListNode(a);return s.getLocationRange(l!==null?l.loc.start.offset-s.startOffset:this.tokenStart,p!==null?p.loc.end.offset-s.startOffset:this.tokenStart,r)}return null},error(a,l){let p=typeof l<"u"&&l<t.length?s.getLocation(l):this.eof?s.getLocation(_o(t,t.length-1)):s.getLocation(this.tokenStart);throw new cr(a||"Unexpected input",t,p.offset,p.line,p.column)}});return Object.assign(function(a,l){t=a,l=l||{},u.setSource(t,ve),s.setSource(t,l.offset,l.line,l.column),r=l.filename||"<unknown>",n=Boolean(l.positions),o=typeof l.onParseError=="function"?l.onParseError:Vo,i=!1,u.parseAtrulePrelude="parseAtrulePrelude"in l?Boolean(l.parseAtrulePrelude):!0,u.parseRulePrelude="parseRulePrelude"in l?Boolean(l.parseRulePrelude):!0,u.parseValue="parseValue"in l?Boolean(l.parseValue):!0,u.parseCustomProperty="parseCustomProperty"in l?Boolean(l.parseCustomProperty):!1;let{context:p="default",onComment:m}=l;if(!(p in u.context))throw new Error("Unkno
`,13,!0)},emit(c){o+=c},result(){return o}};n&&(typeof n.decorator=="function"&&(s=n.decorator(s)),n.sourceMap&&(s=xi(s)),n.mode in Dt&&(s.tokenBefore=Dt[n.mode]));let u={node:c=>s.node(c),children:Hs,token:(c,a)=>s.token(c,a),tokenize:qs};return s.node(r),s.result()}}function vi(e){return{fromPlainObject(t){return e(t,{enter(r){r.children&&!(r.children instanceof I)&&(r.children=new I().fromArray(r.children))}}),t},toPlainObject(t){return e(t,{leave(r){r.children&&r.children instanceof I&&(r.children=r.children.toArray())}}),t}}}var{hasOwnProperty:kr}=Object.prototype,at=function(){};function Si(e){return typeof e=="function"?e:at}function Ci(e,t){return function(r,n,o){r.type===t&&e.call(this,r,n,o)}}function Ws(e,t){let r=t.structure,n=[];for(let o in r){if(kr.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 Ys(e){let t={};for(let r in e.node)if(kr.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]=Ws(r,n)}return t}function Ai(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 Ti({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 Ei(e){let t=Ys(e),r={},n={},o=Symbol("break-walk"),i=Symbol("skip-node");for(let a in t)kr.call(t,a)&&t[a]!==null&&(r[a]=Ai(t[a],!1),n[a]=Ai(t[a],!0));let s=Ti(r),u=Ti(n),c=function(a,l){function p(S,R,ke){let z=m.call(X,S,R,ke);return z===o?!0:z===i?!1:!!(P.hasOwnProperty(S.type)&&P[S.type](S,X,p,te)||f.call(X,S,R,ke)===o)}let m=at,f=at,P=r,te=(S,R,ke,z)=>S||p(R,ke,z),X={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")m=l;else if(l&&(m=Si(l.enter),f=Si(l.leave),l.reverse&&(P=n),l.visit)){if(s.hasOwnProperty(l.visit))P=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(", ")+")");m=Ci(m,l.visit),f=Ci(f,l.visit)}if(m===at&&f===at)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(m,f,P){if(l.call(this,m,f,P))return p=m,o}),p},c.findLast=function(a,l){let p=null;return c(a,{reverse:!0,enter(m,f,P){if(l.call(this,m,f,P))return p=m,o}}),p},c.findAll=function(a,l){let p=[];return c(a,function(m,f,P){l.call(this,m,f,P)&&p.push(m)}),p},c}function Gs(e){return e}function Vs(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 Ks(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 Qs(e,t,r,n){let o=e.combinator===" "||n?e.combinator:" "+e.combinator+" ",i=e.terms.map(s=>wr(s,t,r,n)).join(o);return e.explicit||r?(n||i[0]===","?"[":"[ ")+i+(n?"]":" ]"):i}function wr(e,t,r,n){let o;switch(e.type){case"Group":o=Qs(e,t,r,n)+(e.disallowEmpty?"!":"");break;case"Multiplier":return wr(e.term,t,r,n)+t(Vs(e),e);case"Type":o="<"+e.name+(e.opts?t(Ks(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 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 Nt=new Map,He=new Map,zt=45,Mt=$s,vr=Zs,_m=Sr;function Rt(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===zt&&e.charCodeAt(t+1)===zt}function Sr(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===zt&&e.charCodeAt(t+1)!==zt){let r=e.indexOf("-",t+2);if(r!==-1)return e.substring(t,r+1)}return""}function $s(e){if(Nt.has(e))return Nt.get(e);let t=e.toLowerCase(),r=Nt.get(t);if(r===void 0){let n=Rt(t,0),o=n?"":Sr(t,0);r=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:n})}return Nt.set(e,r),r}function Zs(e){if(He.has(e))return He.get(e);let t=e,r=e[0];r==="/"?r=e[1]==="/"?"//":"/":r!=="_"&&r!=="*"&&r!=="$"&&r!=="#"&&r!=="+"&&r!=="&"&&(r="");let n=Rt(t,r.length);if(!n&&(t=t.toLowerCase(),He.has(t))){let u=He.get(t);return He.set(e,u),u}let o=n?"":Sr(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 He.set(e,s),s}var Ft=["initial","inherit","unset","revert","revert-layer"];var ct=43,he=45,Cr=110,qe=!0,el=!1;function Tr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function lt(e,t,r){for(;e!==null&&(e.type===13||e.type===25);)e=r(++t);return t}function Se(e,t,r,n){if(!e)return 0;let o=e.value.charCodeAt(t);if(o===ct||o===he){if(r)return 0;t++}for(;t<e.value.length;t++)if(!B(e.value.charCodeAt(t)))return 0;return n+1}function Ar(e,t,r){let n=!1,o=lt(e,t,r);if(e=r(o),e===null)return t;if(e.type!==10)if(Tr(e,ct)||Tr(e,he)){if(n=!0,o=lt(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!==ct&&i!==he)return 0}return Se(e,n?0:1,n,o)}function Er(e,t){let r=0;if(!e)return 0;if(e.type===10)return Se(e,0,el,r);if(e.type===1&&e.value.charCodeAt(0)===he){if(!de(e.value,1,Cr))return 0;switch(e.value.length){case 2:return Ar(t(++r),r,t);case 3:return e.value.charCodeAt(2)!==he?0:(r=lt(t(++r),r,t),e=t(r),Se(e,0,qe,r));default:return e.value.charCodeAt(2)!==he?0:Se(e,3,qe,r)}}else if(e.type===1||Tr(e,ct)&&t(r+1).type===1){if(e.type!==1&&(e=t(++r)),e===null||!de(e.value,0,Cr))return 0;switch(e.value.length){case 1:return Ar(t(++r),r,t);case 2:return e.value.charCodeAt(1)!==he?0:(r=lt(t(++r),r,t),e=t(r),Se(e,0,qe,r));default:return e.value.charCodeAt(1)!==he?0:Se(e,2,qe,r)}}else if(e.type===12){let n=e.value.charCodeAt(0),o=n===ct||n===he?1:0,i=o;for(;i<e.value.length&&B(e.value.charCodeAt(i));i++);return i===o||!de(e.value,i,Cr)?0:i+1===e.value.length?Ar(t(++r),r,t):e.value.charCodeAt(i+1)!==he?0:i+2===e.value.length?(r=lt(t(++r),r,t),e=t(r),Se(e,0,qe,r)):Se(e,i+2,qe,r)}return 0}var tl=43,Ii=45,Di=63,rl=117;function Lr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function nl(e,t){return e.value.charCodeAt(0)===t}function ut(e,t,r){let n=0;for(let o=t;o<e.value.length;o++){let i=e.value.charCodeAt(o);if(i===Ii&&r&&n!==0)return ut(e,t+n+1,!1),6;if(!ee(i)||++n>6)return 0}return n}function Bt(e,t,r){if(!e)return 0;for(;Lr(r(t),Di);){if(++e>6)return 0;t++}return t}function Pr(e,t){let r=0;if(e===null||e.type!==1||!de(e.value,0,rl)||(e=t(++r),e===null))return 0;if(Lr(e,tl))return e=t(++r),e===null?0:e.type===1?Bt(ut(e,0,!0),++r,t):Lr(e,Di)?Bt(1,++r,t):0;if(e.type===10){let n=ut(e,1,!0);return n===0?0:(e=t(++r),e===null?r:e.type===12||e.type===10?!nl(e,Ii)||!ut(e,1,!1)?0:r+1:Bt(n,r,t))}return e.type===12?Bt(ut(e,1,!0),++r,t):0}var ol=["calc(","-moz-calc(","-webkit-calc("],Ir=new Map([[2,22],[21,22],[19,20],[23,24]]),il=["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"],al=["deg","grad","rad","turn"],sl=["s","ms"],ll=["hz","khz"],cl=["dpi","dpcm","dppx","x"],ul=["fr"],pl=["db"],hl=["st"];function le(e,t){return t<e.length?e.charCodeAt(t):0}function Ni(e,t
`+t+`
--`+new Array((r||t.length)+1).join("-")+"^"})}var Sl=9,Cl=10,Al=12,Tl=13,El=32,jt=class{constructor(t){this.str=t,this.pos=0}charCodeAt(t){return t<this.str.length?this.str.charCodeAt(t):0}charCode(){return this.charCodeAt(this.pos)}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(t){return this.charCodeAt(this.findWsEnd(t))}findWsEnd(t){for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r!==Tl&&r!==Cl&&r!==Al&&r!==El&&r!==Sl)break}return t}substringToPos(t){return this.str.substring(this.pos,this.pos=t)}eat(t){this.charCode()!==t&&this.error("Expect `"+String.fromCharCode(t)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(t){throw new Ut(t,this.str,this.pos)}};var Ll=9,Pl=10,Il=12,Dl=13,Ol=32,qi=33,zr=35,Ri=38,Ht=39,Wi=40,Nl=41,Yi=42,Mr=43,Rr=44,Fi=45,Fr=60,Gi=62,Nr=63,zl=64,Gt=91,Br=93,qt=123,Bi=124,_i=125,Ui=8734,pt=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),ji={" ":1,"&&":2,"||":3,"|":4};function Wt(e){return e.substringToPos(e.findWsEnd(e.pos))}function We(e){let t=e.pos;for(;t<e.str.length;t++){let r=e.str.charCodeAt(t);if(r>=128||pt[r]===0)break}return e.pos===t&&e.error("Expect a keyword"),e.substringToPos(t)}function Yt(e){let t=e.pos;for(;t<e.str.length;t++){let r=e.str.charCodeAt(t);if(r<48||r>57)break}return e.pos===t&&e.error("Expect a number"),e.substringToPos(t)}function Ml(e){let t=e.str.indexOf("'",e.pos+1);return t===-1&&(e.pos=e.str.length,e.error("Expect an apostrophe")),e.substringToPos(t+1)}function Hi(e){let t=null,r=null;return e.eat(qt),t=Yt(e),e.charCode()===Rr?(e.pos++,e.charCode()!==_i&&(r=Yt(e))):r=t,e.eat(_i),{min:Number(t),max:r?Number(r):0}}function Rl(e){let t=null,r=!1;switch(e.charCode()){case Yi:e.pos++,t={min:0,max:0};break;case Mr:e.pos++,t={min:1,max:0};break;case Nr:e.pos++,t={min:0,max:1};break;case zr:e.pos++,r=!0,e.charCode()===qt?t=Hi(e):e.charCode()===Nr?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case qt:t=Hi(e);break;default:return null}return{type:"Multiplier",comma:r,min:t.min,max:t.max,term:null}}function Ye(e,t){let r=Rl(e);return r!==null?(r.term=t,e.charCode()===zr&&e.charCodeAt(e.pos-1)===Mr?Ye(e,r):r):t}function Or(e){let t=e.peek();return t===""?null:{type:"Token",value:t}}function Fl(e){let t;return e.eat(Fr),e.eat(Ht),t=We(e),e.eat(Ht),e.eat(Gi),Ye(e,{type:"Property",name:t})}function Bl(e){let t=null,r=null,n=1;return e.eat(Gt),e.charCode()===Fi&&(e.peek(),n=-1),n==-1&&e.charCode()===Ui?e.peek():(t=n*Number(Yt(e)),pt[e.charCode()]!==0&&(t+=We(e))),Wt(e),e.eat(Rr),Wt(e),e.charCode()===Ui?e.peek():(n=1,e.charCode()===Fi&&(e.peek(),n=-1),r=n*Number(Yt(e)),pt[e.charCode()]!==0&&(r+=We(e))),e.eat(Br),{type:"Range",min:t,max:r}}function _l(e){let t,r=null;return e.eat(Fr),t=We(e),e.charCode()===Wi&&e.nextCharCode()===Nl&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Gt&&(Wt(e),r=Bl(e)),e.eat(Gi),Ye(e,{type:"Type",name:t,opts:r})}function Ul(e){let t=We(e);return e.charCode()===Wi?(e.pos++,{type:"Function",name:t}):Ye(e,{type:"Keyword",name:t})}function jl(e,t){function r(o,i){return{type:"Group",terms:o,combinator:i,disallowEmpty:!1,explicit:!1}}let n;for(t=Object.keys(t).sort((o,i)=>ji[o]-ji[i]);t.length>0;){n=t.shift();let o=0,i=0;for(;o<e.length;o++){let s=e[o];s.type==="Combinator"&&(s.value===n?(i===-1&&(i=o-1),e.splice(o,1),o--):(i!==-1&&o-i>1&&(e.splice(i,o-i,r(e.slice(i,o),n)),o=i+1),i=-1))}i!==-1&&t.length&&e.splice(i,o-i,r(e.slice(i,o),n))}return n}function Vi(e){let t=[],r={},n,o=null,i=e.pos;for(;n=ql(e);)n.type!=="Spaces"&&(n.type==="Combinator"?((o===null||o.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),r[n.value]=!0):o!==null&&o.type!=="Combinator"&&(r[" "]=!0,t.push({type:"Combinator",value:" "})),t.push(n),o=n,i=e.pos);return o!==null&&o.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:t,combinator:jl(t,r)||" ",disallowEmpty:!1,explicit:!1}}function Hl(e){let t;return e.eat(Gt),t=Vi(e),e.eat(Br),t.explicit=!0,e.charCode()===qi&&(e.pos++,t.disallowEmpty=!0),t}function ql(e){let t=e