9 lines
52 KiB
JavaScript
9 lines
52 KiB
JavaScript
var Kn=Object.create;var Tt=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var $n=Object.getOwnPropertyNames;var Xn=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty;var De=e=>Tt(e,"__esModule",{value:!0});var lt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),vt=(e,t)=>{for(var r in t)Tt(e,r,{get:t[r],enumerable:!0})},Pe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $n(t))!Jn.call(e,s)&&(r||s!=="default")&&Tt(e,s,{get:()=>t[s],enumerable:!(n=Qn(t,s))||n.enumerable});return e},Zn=(e,t)=>Pe(De(Tt(e!=null?Kn(Xn(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),ti=(e=>(t,r)=>e&&e.get(t)||(r=Pe(De({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Ue=lt(se=>{var Be="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");se.encode=function(e){if(0<=e&&e<Be.length)return Be[e];throw new TypeError("Must be between 0 and 63: "+e)};se.decode=function(e){var t=65,r=90,n=97,s=122,o=48,a=57,h=43,l=47,i=26,c=52;return t<=e&&e<=r?e-t:n<=e&&e<=s?e-n+i:o<=e&&e<=a?e-o+c:e==h?62:e==l?63:-1}});var qe=lt(ae=>{var We=Ue(),oe=5,Ve=1<<oe,He=Ve-1,Ge=Ve;function li(e){return e<0?(-e<<1)+1:(e<<1)+0}function hi(e){var t=(e&1)===1,r=e>>1;return t?-r:r}ae.encode=function(t){var r="",n,s=li(t);do n=s&He,s>>>=oe,s>0&&(n|=Ge),r+=We.encode(n);while(s>0);return r};ae.decode=function(t,r,n){var s=t.length,o=0,a=0,h,l;do{if(r>=s)throw new Error("Expected more digits in base 64 VLQ value.");if(l=We.decode(t.charCodeAt(r++)),l===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));h=!!(l&Ge),l&=He,o=o+(l<<a),a+=oe}while(h);n.value=hi(o),n.rest=r}});var Ut=lt(N=>{function ui(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}N.getArg=ui;var Ye=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,fi=/^data:.+\,.+$/;function Ct(e){var t=e.match(Ye);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}N.urlParse=Ct;function ft(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}N.urlGenerate=ft;var pi=32;function mi(e){var t=[];return function(r){for(var n=0;n<t.length;n++)if(t[n].input===r){var s=t[0];return t[0]=t[n],t[n]=s,t[0].result}var o=e(r);return t.unshift({input:r,result:o}),t.length>pi&&t.pop(),o}}var ce=mi(function(t){var r=t,n=Ct(t);if(n){if(!n.path)return t;r=n.path}for(var s=N.isAbsolute(r),o=[],a=0,h=0;;)if(a=h,h=r.indexOf("/",a),h===-1){o.push(r.slice(a));break}else for(o.push(r.slice(a,h));h<r.length&&r[h]==="/";)h++;for(var l,i=0,h=o.length-1;h>=0;h--)l=o[h],l==="."?o.splice(h,1):l===".."?i++:i>0&&(l===""?(o.splice(h+1,i),i=0):(o.splice(h,2),i--));return r=o.join("/"),r===""&&(r=s?"/":"."),n?(n.path=r,ft(n)):r});N.normalize=ce;function je(e,t){e===""&&(e="."),t===""&&(t=".");var r=Ct(t),n=Ct(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),ft(r);if(r||t.match(fi))return t;if(n&&!n.host&&!n.path)return n.host=t,ft(n);var s=t.charAt(0)==="/"?t:ce(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=s,ft(n)):s}N.join=je;N.isAbsolute=function(e){return e.charAt(0)==="/"||Ye.test(e)};function di(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)}N.relative=di;var ze=function(){var e=Object.create(null);return!("__proto__"in e)}();function Ke(e){return e}function xi(e){return Qe(e)?"$"+e:e}N.toSetString=ze?Ke:xi;function ki(e){return Qe(e)?e.slice(1):e}N.fromSetString=ze?Ke:ki;function Qe(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 Si(e,t,r){var n=K(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:K(e.name,t.name)}N.compareByOriginalPositions=Si;function gi(e,t,r){var n;return n=e.originalLine-t.originalLine,n!==0||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:K(e.name,t.name)}N.compareByOriginalPositionsNoSource=gi;function Ci(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=K(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:K(e.name,t.name)}N.compareByGeneratedPositionsDeflated=Ci;function yi(e,t,r){var n=e.generatedColumn-t.generatedColumn;return n!==0||r||(n=K(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:K(e.name,t.name)}N.compareByGeneratedPositionsDeflatedNoLine=yi;function K(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function bi(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=K(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:K(e.name,t.name)}N.compareByGeneratedPositionsInflated=bi;function Li(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}N.parseSourceMapInput=Li;function Ti(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=Ct(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var s=n.path.lastIndexOf("/");s>=0&&(n.path=n.path.substring(0,s+1))}t=je(ft(n),t)}return ce(t)}N.computeSourceURL=Ti});var Xe=lt($e=>{var le=Ut(),he=Object.prototype.hasOwnProperty,it=typeof Map<"u";function Q(){this._array=[],this._set=it?new Map:Object.create(null)}Q.fromArray=function(t,r){for(var n=new Q,s=0,o=t.length;s<o;s++)n.add(t[s],r);return n};Q.prototype.size=function(){return it?this._set.size:Object.getOwnPropertyNames(this._set).length};Q.prototype.add=function(t,r){var n=it?t:le.toSetString(t),s=it?this.has(t):he.call(this._set,n),o=this._array.length;(!s||r)&&this._array.push(t),s||(it?this._set.set(t,o):this._set[n]=o)};Q.prototype.has=function(t){if(it)return this._set.has(t);var r=le.toSetString(t);return he.call(this._set,r)};Q.prototype.indexOf=function(t){if(it){var r=this._set.get(t);if(r>=0)return r}else{var n=le.toSetString(t);if(he.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};Q.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};Q.prototype.toArray=function(){return this._array.slice()};$e.ArraySet=Q});var tr=lt(Ze=>{var Je=Ut();function vi(e,t){var r=e.generatedLine,n=t.generatedLine,s=e.generatedColumn,o=t.generatedColumn;return n>r||n==r&&o>=s||Je.compareByGeneratedPositionsInflated(e,t)<=0}function Wt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Wt.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Wt.prototype.add=function(t){vi(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Wt.prototype.toArray=function(){return this._sorted||(this._array.sort(Je.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Ze.MappingList=Wt});var rr=lt(er=>{var yt=qe(),v=Ut(),Vt=Xe().ArraySet,Ei=tr().MappingList;function W(e){e||(e={}),this._file=v.getArg(e,"file",null),this._sourceRoot=v.getArg(e,"sourceRoot",null),this._skipValidation=v.getArg(e,"skipValidation",!1),this._sources=new Vt,this._names=new Vt,this._mappings=new Ei,this._sourcesContents=null}W.prototype._version=3;W.fromSourceMap=function(t){var r=t.sourceRoot,n=new W({file:t.file,sourceRoot:r});return t.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,r!=null&&(o.source=v.relative(r,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),n.addMapping(o)}),t.sources.forEach(function(s){var o=s;r!==null&&(o=v.relative(r,s)),n._sources.has(o)||n._sources.add(o);var a=t.sourceContentFor(s);a!=null&&n.setSourceContent(s,a)}),n};W.prototype.addMapping=function(t){var r=v.getArg(t,"generated"),n=v.getArg(t,"original",null),s=v.getArg(t,"source",null),o=v.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,s,o),s!=null&&(s=String(s),this._sources.has(s)||this._sources.add(s)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:s,name:o})};W.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=v.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[v.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[v.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};W.prototype.applySourceMap=function(t,r,n){var s=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);s=t.file}var o=this._sourceRoot;o!=null&&(s=v.relative(o,s));var a=new Vt,h=new Vt;this._mappings.unsortedForEach(function(l){if(l.source===s&&l.originalLine!=null){var i=t.originalPositionFor({line:l.originalLine,column:l.originalColumn});i.source!=null&&(l.source=i.source,n!=null&&(l.source=v.join(n,l.source)),o!=null&&(l.source=v.relative(o,l.source)),l.originalLine=i.line,l.originalColumn=i.column,i.name!=null&&(l.name=i.name))}var c=l.source;c!=null&&!a.has(c)&&a.add(c);var f=l.name;f!=null&&!h.has(f)&&h.add(f)},this),this._sources=a,this._names=h,t.sources.forEach(function(l){var i=t.sourceContentFor(l);i!=null&&(n!=null&&(l=v.join(n,l)),o!=null&&(l=v.relative(o,l)),this.setSourceContent(l,i))},this)};W.prototype._validateMapping=function(t,r,n,s){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!s)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:s}))}};W.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,s=0,o=0,a=0,h="",l,i,c,f,k=this._mappings.toArray(),S=0,T=k.length;S<T;S++){if(i=k[S],l="",i.generatedLine!==r)for(t=0;i.generatedLine!==r;)l+=";",r++;else if(S>0){if(!v.compareByGeneratedPositionsInflated(i,k[S-1]))continue;l+=","}l+=yt.encode(i.generatedColumn-t),t=i.generatedColumn,i.source!=null&&(f=this._sources.indexOf(i.source),l+=yt.encode(f-a),a=f,l+=yt.encode(i.originalLine-1-s),s=i.originalLine-1,l+=yt.encode(i.originalColumn-n),n=i.originalColumn,i.name!=null&&(c=this._names.indexOf(i.name),l+=yt.encode(c-o),o=c)),h+=l}return h};W.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=v.relative(r,n));var s=v.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null},this)};W.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};W.prototype.toString=function(){return JSON.stringify(this.toJSON())};er.SourceMapGenerator=W});var gs={};vt(gs,{default:()=>Ie});function I(e){return e>=48&&e<=57}function z(e){return I(e)||e>=65&&e<=70||e>=97&&e<=102}function wt(e){return e>=65&&e<=90}function ei(e){return e>=97&&e<=122}function ri(e){return wt(e)||ei(e)}function ni(e){return e>=128}function Et(e){return ri(e)||ni(e)||e===95}function At(e){return Et(e)||I(e)||e===45}function ii(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function dt(e){return e===10||e===13||e===12}function $(e){return dt(e)||e===32||e===9}function R(e,t){return!(e!==92||dt(t)||t===0)}function Nt(e,t,r){return e===45?Et(t)||t===45||R(t,r):Et(e)?!0:e===92?R(e,t):!1}function It(e,t,r){return e===43||e===45?I(t)?2:t===46&&I(r)?3:0:e===46?I(t)?2:0:I(e)?1:0}function Dt(e){return e===65279||e===65534?1:0}var Xt=new Array(128),si=128,xt=130,Jt=131,Pt=132,Zt=133;for(let e=0;e<Xt.length;e++)Xt[e]=$(e)&&xt||I(e)&&Jt||Et(e)&&Pt||ii(e)&&Zt||e||si;function Ft(e){return e<128?Xt[e]:Pt}function ht(e,t){return t<e.length?e.charCodeAt(t):0}function Rt(e,t,r){return r===13&&ht(e,t+1)===10?2:1}function ee(e,t,r){let n=e.charCodeAt(t);return wt(n)&&(n=n|32),n===r}function et(e,t,r,n){if(r-t!==n.length||t<0||r>e.length)return!1;for(let s=t;s<r;s++){let o=n.charCodeAt(s-t),a=e.charCodeAt(s);if(wt(a)&&(a=a|32),a!==o)return!1}return!0}function Re(e,t){for(;t>=0&&$(e.charCodeAt(t));t--);return t+1}function kt(e,t){for(;t<e.length&&$(e.charCodeAt(t));t++);return t}function te(e,t){for(;t<e.length&&I(e.charCodeAt(t));t++);return t}function X(e,t){if(t+=2,z(ht(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&z(ht(e,t));t++);let r=ht(e,t);$(r)&&(t+=Rt(e,t,r))}return t}function St(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(!At(r)){if(R(r,ht(e,t+1))){t=X(e,t)-1;continue}break}}return t}function Ot(e,t){let r=e.charCodeAt(t);if((r===43||r===45)&&(r=e.charCodeAt(t+=1)),I(r)&&(t=te(e,t+1),r=e.charCodeAt(t)),r===46&&I(e.charCodeAt(t+1))&&(t+=2,t=te(e,t)),ee(e,t,101)){let n=0;r=e.charCodeAt(t+1),(r===45||r===43)&&(n=1,r=e.charCodeAt(t+2)),I(r)&&(t=te(e,t+1+n+1))}return t}function _t(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r===41){t++;break}R(r,ht(e,t+1))&&(t=X(e,t))}return t}function re(e){if(e.length===1&&!z(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var gt=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function ut(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}var Oe=10,oi=12,_e=13;function Me(e){let t=e.source,r=t.length,n=t.length>0?Dt(t.charCodeAt(0)):0,s=ut(e.lines,r),o=ut(e.columns,r),a=e.startLine,h=e.startColumn;for(let l=n;l<r;l++){let i=t.charCodeAt(l);s[l]=a,o[l]=h++,(i===Oe||i===_e||i===oi)&&(i===_e&&l+1<r&&t.charCodeAt(l+1)===Oe&&(l++,s[l]=a,o[l]=h),a++,h=1)}s[r]=a,o[r]=h,e.lines=s,e.columns=o,e.computed=!0}var ne=class{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(t,r=0,n=1,s=1){this.source=t,this.startOffset=r,this.startLine=n,this.startColumn=s,this.computed=!1}getLocation(t,r){return this.computed||Me(this),{source:r,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,r,n){return this.computed||Me(this),{source:n,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+r,line:this.lines[r],column:this.columns[r]}}}};var M=16777215,V=24,ai=new Map([[2,22],[21,22],[19,20],[23,24]]),ie=class{constructor(t,r){this.setSource(t,r)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",r=()=>{}){t=String(t||"");let n=t.length,s=ut(this.offsetAndType,t.length+1),o=ut(this.balance,t.length+1),a=0,h=0,l=0,i=-1;for(this.offsetAndType=null,this.balance=null,r(t,(c,f,k)=>{switch(c){default:o[a]=n;break;case h:{let S=l&M;for(l=o[S],h=l>>V,o[a]=S,o[S++]=a;S<a;S++)o[S]===n&&(o[S]=a);break}case 21:case 2:case 19:case 23:o[a]=l,h=ai.get(c),l=h<<V|a;break}s[a++]=c<<V|k,i===-1&&(i=f)}),s[a]=0<<V|n,o[a]=n,o[n]=n;l!==0;){let c=l&M;l=o[c],o[c]=n}this.source=t,this.firstCharOffset=i===-1?0:i,this.tokenCount=a,this.offsetAndType=s,this.balance=o,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>V:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>V;if(n!==13&&n!==25&&t--===0)return n}return 0}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&M:this.source.length}lookupOffsetNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>V;if(n!==13&&n!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t<this.tokenCount?et(this.source,this.offsetAndType[t-1]&M,this.offsetAndType[t]&M,r):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&M:this.offsetAndType[this.tokenCount]&M:this.firstCharOffset}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,r){return r?this.lookupType(r)===9&&this.source.charCodeAt(this.lookupOffset(r))===t:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let r=this.tokenIndex+t;r<this.tokenCount?(this.tokenIndex=r,this.tokenStart=this.offsetAndType[r-1]&M,r=this.offsetAndType[r],this.tokenType=r>>V,this.tokenEnd=r&M):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>V,this.tokenEnd=t&M):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(t,r){let n=t,s,o;t:for(;n<this.tokenCount;n++){if(s=this.balance[n],s<t)break t;switch(o=n>0?this.offsetAndType[n-1]&M:this.firstCharOffset,r(this.source.charCodeAt(o))){case 1:break t;case 2:n++;break t;default:this.balance[s]===n&&(n=s)}}this.skip(n-this.tokenIndex)}forEachToken(t){for(let r=0,n=this.firstCharOffset;r<this.tokenCount;r++){let s=n,o=this.offsetAndType[r],a=o&M,h=o>>V;n=a,t(h,s,a,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,n,s,o)=>{t[o]={idx:o,type:gt[r],chunk:this.source.substring(n,s),balance:this.balance[o]}}),t}};function Bt(e,t){function r(f){return f<h?e.charCodeAt(f):0}function n(){if(i=Ot(e,i),Nt(r(i),r(i+1),r(i+2))){c=12,i=St(e,i);return}if(r(i)===37){c=11,i++;return}c=10}function s(){let f=i;if(i=St(e,i),et(e,f,i,"url")&&r(i)===40){if(i=kt(e,i+1),r(i)===34||r(i)===39){c=2,i=f+4;return}a();return}if(r(i)===40){c=2,i++;return}c=1}function o(f){for(f||(f=r(i++)),c=5;i<e.length;i++){let k=e.charCodeAt(i);switch(Ft(k)){case f:i++;return;case xt:if(dt(k)){i+=Rt(e,i,k),c=6;return}break;case 92:if(i===e.length-1)break;let S=r(i+1);dt(S)?i+=Rt(e,i+1,S):R(k,S)&&(i=X(e,i)-1);break}}}function a(){for(c=7,i=kt(e,i);i<e.length;i++){let f=e.charCodeAt(i);switch(Ft(f)){case 41:i++;return;case xt:if(i=kt(e,i),r(i)===41||i>=e.length){i<e.length&&i++;return}i=_t(e,i),c=8;return;case 34:case 39:case 40:case Zt:i=_t(e,i),c=8;return;case 92:if(R(f,r(i+1))){i=X(e,i)-1;break}i=_t(e,i),c=8;return}}}e=String(e||"");let h=e.length,l=Dt(r(0)),i=l,c;for(;i<h;){let f=e.charCodeAt(i);switch(Ft(f)){case xt:c=13,i=kt(e,i+1);break;case 34:o();break;case 35:At(r(i+1))||R(r(i+1),r(i+2))?(c=4,i=St(e,i+1)):(c=9,i++);break;case 39:o();break;case 40:c=21,i++;break;case 41:c=22,i++;break;case 43:It(f,r(i+1),r(i+2))?n():(c=9,i++);break;case 44:c=18,i++;break;case 45:It(f,r(i+1),r(i+2))?n():r(i+1)===45&&r(i+2)===62?(c=15,i=i+3):Nt(f,r(i+1),r(i+2))?s():(c=9,i++);break;case 46:It(f,r(i+1),r(i+2))?n():(c=9,i++);break;case 47:r(i+1)===42?(c=25,i=e.indexOf("*/",i+2),i=i===-1?e.length:i+2):(c=9,i++);break;case 58:c=16,i++;break;case 59:c=17,i++;break;case 60:r(i+1)===33&&r(i+2)===45&&r(i+3)===45?(c=14,i=i+4):(c=9,i++);break;case 64:Nt(r(i+1),r(i+2),r(i+3))?(c=3,i=St(e,i+1)):(c=9,i++);break;case 91:c=19,i++;break;case 92:R(f,r(i+1))?s():(c=9,i++);break;case 93:c=20,i++;break;case 123:c=23,i++;break;case 125:c=24,i++;break;case Jt:n();break;case Pt:s();break;default:c=9,i++}t(c,l,l=i)}}var ir=Zn(rr(),1),nr=new Set(["Atrule","Selector","Declaration"]);function sr(e){let t=new ir.SourceMapGenerator,r={line:1,column:0},n={line:0,column:0},s={line:1,column:0},o={generated:s},a=1,h=0,l=!1,i=e.node;e.node=function(k){if(k.loc&&k.loc.start&&nr.has(k.type)){let S=k.loc.start.line,T=k.loc.start.column-1;(n.line!==S||n.column!==T)&&(n.line=S,n.column=T,r.line=a,r.column=h,l&&(l=!1,(r.line!==s.line||r.column!==s.column)&&t.addMapping(o)),l=!0,t.addMapping({source:k.loc.source,original:n,generated:r}))}i.call(this,k),l&&nr.has(k.type)&&(s.line=a,s.column=h)};let c=e.emit;e.emit=function(k,S,T){for(let j=0;j<k.length;j++)k.charCodeAt(j)===10?(a++,h=0):h++;c(k,S,T)};let f=e.result;return e.result=function(){return l&&t.addMapping(o),{css:f(),map:t}},e}var Ht={};vt(Ht,{safe:()=>fe,spec:()=>Ii});var wi=43,Ai=45,ue=(e,t)=>{if(e===9&&(e=t),typeof e=="string"){let r=e.charCodeAt(0);return r>127?32768:r<<8}return e},or=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],Ni=or.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function ar(e){let t=new Set(e.map(([r,n])=>ue(r)<<16|ue(n)));return function(r,n,s){let o=ue(n,s),a=s.charCodeAt(0);return(a===Ai&&n!==1&&n!==2&&n!==15||a===wi?t.has(r<<16|a<<8):t.has(r<<16|o))&&this.emit(" ",13,!0),o}}var Ii=ar(or),fe=ar(Ni);var Di=92;function Pi(e,t){if(typeof t=="function"){let r=null;e.children.forEach(n=>{r!==null&&t.call(this,r),this.node(n),r=n});return}e.children.forEach(this.node,this)}function Fi(e){Bt(e,(t,r,n)=>{this.token(t,e.slice(r,n))})}function cr(e){let t=new Map;for(let[r,n]of Object.entries(e.node))typeof(n.generate||n)=="function"&&t.set(r,n.generate||n);return function(r,n){let s="",o=0,a={node(l){if(t.has(l.type))t.get(l.type).call(h,l);else throw new Error("Unknown node type: "+l.type)},tokenBefore:fe,token(l,i){o=this.tokenBefore(o,l,i),this.emit(i,l,!1),l===9&&i.charCodeAt(0)===Di&&this.emit(`
|
|
`,13,!0)},emit(l){s+=l},result(){return s}};n&&(typeof n.decorator=="function"&&(a=n.decorator(a)),n.sourceMap&&(a=sr(a)),n.mode in Ht&&(a.tokenBefore=Ht[n.mode]));let h={node:l=>a.node(l),children:Pi,token:(l,i)=>a.token(l,i),tokenize:Fi};return a.node(r),a.result()}}var Se={};vt(Se,{AnPlusB:()=>hr,Atrule:()=>ur,AtrulePrelude:()=>fr,AttributeSelector:()=>dr,Block:()=>xr,Brackets:()=>kr,CDC:()=>Sr,CDO:()=>gr,ClassSelector:()=>yr,Combinator:()=>Tr,Comment:()=>vr,Condition:()=>Er,Declaration:()=>wr,DeclarationList:()=>Ar,Dimension:()=>Nr,Feature:()=>Ir,FeatureFunction:()=>Dr,FeatureRange:()=>Pr,Function:()=>Fr,GeneralEnclosed:()=>Rr,Hash:()=>Or,IdSelector:()=>Ur,Identifier:()=>Mr,Layer:()=>Wr,LayerList:()=>Vr,MediaQuery:()=>Hr,MediaQueryList:()=>Gr,NestingSelector:()=>Yr,Nth:()=>zr,Number:()=>Kr,Operator:()=>$r,Parentheses:()=>Xr,Percentage:()=>Zr,PseudoClassSelector:()=>en,PseudoElementSelector:()=>nn,Ratio:()=>sn,Raw:()=>an,Rule:()=>cn,Scope:()=>ln,Selector:()=>un,SelectorList:()=>pn,String:()=>Sn,StyleSheet:()=>gn,SupportsDeclaration:()=>Cn,TypeSelector:()=>Ln,UnicodeRange:()=>Tn,Url:()=>En,Value:()=>wn,WhiteSpace:()=>An});var Y=43,_=45,Gt=110,st=!0,Ri=!1;function qt(e,t){let r=this.tokenStart+e,n=this.charCodeAt(r);for((n===Y||n===_)&&(t&&this.error("Number sign is not allowed"),r++);r<this.tokenEnd;r++)I(this.charCodeAt(r))||this.error("Integer is expected",r)}function pt(e){return qt.call(this,0,e)}function Z(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let r="";switch(t){case Gt:r="N is expected";break;case _:r="HyphenMinus is expected";break}this.error(r,this.tokenStart+e)}}function pe(){let e=0,t=0,r=this.tokenType;for(;r===13||r===25;)r=this.lookupType(++e);if(r!==10)if(this.isDelim(Y,e)||this.isDelim(_,e)){t=this.isDelim(Y,e)?Y:_;do r=this.lookupType(++e);while(r===13||r===25);r!==10&&(this.skip(e),pt.call(this,st))}else return null;return e>0&&this.skip(e),t===0&&(r=this.charCodeAt(this.tokenStart),r!==Y&&r!==_&&this.error("Number sign is expected")),pt.call(this,t!==0),t===_?"-"+this.consume(10):this.consume(10)}function lr(){let e=this.tokenStart,t=null,r=null;if(this.tokenType===10)pt.call(this,Ri),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,_))switch(t="-1",Z.call(this,1,Gt),this.tokenEnd-this.tokenStart){case 2:this.next(),r=pe.call(this);break;case 3:Z.call(this,2,_),this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10);break;default:Z.call(this,2,_),qt.call(this,3,st),this.next(),r=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Y)&&this.lookupType(1)===1){let n=0;switch(t="1",this.isDelim(Y)&&(n=1,this.next()),Z.call(this,0,Gt),this.tokenEnd-this.tokenStart){case 1:this.next(),r=pe.call(this);break;case 2:Z.call(this,1,_),this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10);break;default:Z.call(this,1,_),qt.call(this,2,st),this.next(),r=this.substrToCursor(e+n+1)}}else if(this.tokenType===12){let n=this.charCodeAt(this.tokenStart),s=n===Y||n===_,o=this.tokenStart+s;for(;o<this.tokenEnd&&I(this.charCodeAt(o));o++);o===this.tokenStart+s&&this.error("Integer is expected",this.tokenStart+s),Z.call(this,o-this.tokenStart,Gt),t=this.substring(e,o),o+1===this.tokenEnd?(this.next(),r=pe.call(this)):(Z.call(this,o-this.tokenStart+1,_),o+2===this.tokenEnd?(this.next(),this.skipSC(),pt.call(this,st),r="-"+this.consume(10)):(qt.call(this,o-this.tokenStart+2,st),this.next(),r=this.substrToCursor(o+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Y&&(t=t.substr(1)),r!==null&&r.charCodeAt(0)===Y&&(r=r.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:r}}function hr(e){if(e.a){let t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){let r=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+r)}else this.tokenize(t)}else this.tokenize(e.b)}function ur(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?(this.token(23,"{"),this.node(e.block),this.token(24,"}")):this.token(17,";")}function fr(e){this.children(e)}var Oi=36,pr=42,Yt=61,_i=94,me=124,Mi=126;function Bi(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim(pr)?(t=!0,this.next()):this.isDelim(me)||this.eat(1),this.isDelim(me)?this.charCodeAt(this.tokenStart+1)!==Yt?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Ui(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==Yt&&t!==Mi&&t!==_i&&t!==Oi&&t!==pr&&t!==me&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Yt&&(this.isDelim(Yt)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}function mr(){let e=this.tokenStart,t,r=null,n=null,s=null;return this.eat(19),this.skipSC(),t=Bi.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(r=Ui.call(this),this.skipSC(),n=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(s=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:r,value:n,flags:s}}function dr(e){this.token(9,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,"]")}function xr(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}function kr(e){this.token(9,"["),this.children(e),this.token(9,"]")}function Sr(){this.token(15,"-->")}function gr(){this.token(14,"<!--")}var Wi=46;function Cr(){return this.eatDelim(Wi),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function yr(e){this.token(9,"."),this.token(1,e.name)}var Vi=43,br=47,Hi=62,Gi=126;function Lr(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case Hi:case Vi:case Gi:this.next();break;case br:this.next(),this.eatIdent("deep"),this.eatDelim(br);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function Tr(e){this.tokenize(e.name)}function vr(e){this.token(25,"/*"+e.value+"*/")}function Er(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(21,"("),this.node(t),this.token(22,")")):this.node(t)})}function wr(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,e.important===!0?"important":e.important))}function Ar(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}function Nr(e){this.token(12,e.value+e.unit)}function Ir(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}function Dr(e){this.token(2,e.feature+"("),this.node(e.value),this.token(22,")")}function Pr(e){this.token(21,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(22,")")}function Fr(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}function Rr(e){e.function?this.token(2,e.function+"("):this.token(21,"("),this.children(e),this.token(22,")")}function Or(e){this.token(4,"#"+e.value)}function _r(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function Mr(e){this.token(1,e.name)}function Br(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Ur(e){this.token(9,"#"+e.name)}function Wr(e){this.tokenize(e.name)}function Vr(e){this.children(e,()=>this.token(18,","))}function Hr(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}function Gr(e){this.children(e,()=>this.token(18,","))}var qi=38;function qr(){let e=this.tokenStart;return this.eatDelim(qi),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Yr(){this.token(9,"&")}function jr(){this.skipSC();let e=this.tokenStart,t=e,r=null,n;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?n=this.Identifier():n=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:n,selector:r}}function zr(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}function Kr(e){this.token(10,e.value)}function Qr(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function $r(e){this.tokenize(e.value)}function Xr(e){this.token(21,"("),this.children(e),this.token(22,")")}function Jr(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function Zr(e){this.token(11,e.value+"%")}function tn(){let e=this.tokenStart,t=null,r,n;return this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),n=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),t=this.pseudo[n].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function en(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}function rn(){let e=this.tokenStart,t=null,r,n;return this.eat(16),this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),n=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),t=this.pseudo[n].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function nn(e){this.token(16,":"),this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}function sn(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(10,1)}function Yi(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}function on(e,t){let r=this.getTokenStart(this.tokenIndex),n;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>r?n=Yi.call(this):n=this.tokenStart,{type:"Raw",loc:this.getLocation(r,n),value:this.substring(r,n)}}function an(e){this.tokenize(e.value)}function cn(e){this.node(e.prelude),this.token(23,"{"),this.node(e.block),this.token(24,"}")}function ln(e){e.root&&(this.token(21,"("),this.node(e.root),this.token(22,")")),e.limit&&(this.token(1,"to"),this.token(21,"("),this.node(e.limit),this.token(22,")"))}function hn(){let e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function un(e){this.children(e)}function fn(){let e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function pn(e){this.children(e,()=>this.token(18,","))}var de=92,mn=34,dn=39;function xe(e){let t=e.length,r=e.charCodeAt(0),n=r===mn||r===dn?1:0,s=n===1&&t>1&&e.charCodeAt(t-1)===r?t-2:t-1,o="";for(let a=n;a<=s;a++){let h=e.charCodeAt(a);if(h===de){if(a===s){a!==t-1&&(o=e.substr(a+1));break}if(h=e.charCodeAt(++a),R(de,h)){let l=a-1,i=X(e,l);a=i-1,o+=re(e.substring(l+1,i))}else h===13&&e.charCodeAt(a+1)===10&&a++}else o+=e[a]}return o}function xn(e,t){let r=t?"'":'"',n=t?dn:mn,s="",o=!1;for(let a=0;a<e.length;a++){let h=e.charCodeAt(a);if(h===0){s+="\uFFFD";continue}if(h<=31||h===127){s+="\\"+h.toString(16),o=!0;continue}h===n||h===de?(s+="\\"+e.charAt(a),o=!1):(o&&(z(h)||$(h))&&(s+=" "),s+=e.charAt(a),o=!1)}return r+s+r}function kn(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:xe(this.consume(5))}}function Sn(e){this.token(5,xn(e.value))}function gn(e){this.children(e)}function Cn(e){this.token(21,"("),this.node(e.declaration),this.token(22,")")}var zi=42,yn=124;function ke(){this.tokenType!==1&&this.isDelim(zi)===!1&&this.error("Identifier or asterisk is expected"),this.next()}function bn(){let e=this.tokenStart;return this.isDelim(yn)?(this.next(),ke.call(this)):(ke.call(this),this.isDelim(yn)&&(this.next(),ke.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Ln(e){this.tokenize(e.name)}function Tn(e){this.tokenize(e.value)}var Ki=32,Qi=92,$i=34,Xi=39,Ji=40,Zi=41;function vn(e){let t="",r=!1;for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);if(s===0){t+="\uFFFD";continue}if(s<=31||s===127){t+="\\"+s.toString(16),r=!0;continue}s===Ki||s===Qi||s===$i||s===Xi||s===Ji||s===Zi?(t+="\\"+e.charAt(n),r=!1):(r&&z(s)&&(t+=" "),t+=e.charAt(n),r=!1)}return"url("+t+")"}function En(e){this.token(7,vn(e.value))}function wn(e){this.children(e)}var Ka=Object.freeze({type:"WhiteSpace",loc:null,value:" "});function An(e){this.token(13,e.value)}var Nn={node:Se};var In=cr(Nn);var mt=null,P=class{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return P.createItem(t)}allocateCursor(t,r){let n;return mt!==null?(n=mt,mt=mt.cursor,n.prev=t,n.next=r,n.cursor=this.cursor):n={prev:t,next:r,cursor:this.cursor},this.cursor=n,n}releaseCursor(){let{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=mt,mt=t}updateCursors(t,r,n,s){let{cursor:o}=this;for(;o!==null;)o.prev===t&&(o.prev=r),o.next===n&&(o.next=s),o=o.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let r=this.head;r!==null;r=r.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let r=null;this.head=null;for(let n of t){let s=P.createItem(n);r!==null?r.next=s:this.head=s,s.prev=r,r=s}return this.tail=r,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,r=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let s=n.next;n.next=s.next,t.call(r,s.data,s,this)}this.releaseCursor()}forEachRight(t,r=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let s=n.prev;n.prev=s.prev,t.call(r,s.data,s,this)}this.releaseCursor()}reduce(t,r,n=this){let s=this.allocateCursor(null,this.head),o=r,a;for(;s.next!==null;)a=s.next,s.next=a.next,o=t.call(n,o,a.data,a,this);return this.releaseCursor(),o}reduceRight(t,r,n=this){let s=this.allocateCursor(this.tail,null),o=r,a;for(;s.prev!==null;)a=s.prev,s.prev=a.prev,o=t.call(n,o,a.data,a,this);return this.releaseCursor(),o}some(t,r=this){for(let n=this.head;n!==null;n=n.next)if(t.call(r,n.data,n,this))return!0;return!1}map(t,r=this){let n=new P;for(let s=this.head;s!==null;s=s.next)n.appendData(t.call(r,s.data,s,this));return n}filter(t,r=this){let n=new P;for(let s=this.head;s!==null;s=s.next)t.call(r,s.data,s,this)&&n.appendData(s.data);return n}nextUntil(t,r,n=this){if(t===null)return;let s=this.allocateCursor(null,t);for(;s.next!==null;){let o=s.next;if(s.next=o.next,r.call(n,o.data,o,this))break}this.releaseCursor()}prevUntil(t,r,n=this){if(t===null)return;let s=this.allocateCursor(t,null);for(;s.prev!==null;){let o=s.prev;if(s.prev=o.prev,r.call(n,o.data,o,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new P;for(let r of this)t.appendData(r);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(P.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(P.createItem(t))}insert(t,r=null){if(r!==null)if(this.updateCursors(r.prev,t,r,t),r.prev===null){if(this.head!==r)throw new Error("before doesn't belong to list");this.head=t,r.prev=t,t.next=r,this.updateCursors(null,t)}else r.prev.next=t,t.prev=r.prev,r.prev=t,t.next=r;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,r){return this.insert(P.createItem(t),r)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(P.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(P.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,r){return t.head===null?this:(r!=null?(this.updateCursors(r.prev,t.tail,r,t.head),r.prev!==null?(r.prev.next=t.head,t.head.prev=r.prev):this.head=t.head,r.prev=t.tail,t.tail.next=r):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,r){"head"in r?this.insertList(r,t):this.insert(r,t),this.remove(t)}};function Dn(e,t){let r=Object.create(SyntaxError.prototype),n=new Error;return Object.assign(r,{name:e,message:t,get stack(){return(n.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
|
|
`)}})}var ge=100,Pn=60,Fn=" ";function Rn({source:e,line:t,column:r,baseLine:n,baseColumn:s},o){function a(T,j){return i.slice(T,j).map((tt,$t)=>String(T+$t+1).padStart(k)+" |"+tt).join(`
|
|
`)}let h=`
|
|
`.repeat(Math.max(n-1,0)),l=" ".repeat(Math.max(s-1,0)),i=(h+l+e).split(/\r\n?|\n|\f/),c=Math.max(1,t-o)-1,f=Math.min(t+o,i.length+1),k=Math.max(4,String(f).length)+1,S=0;r+=(Fn.length-1)*(i[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>ge&&(S=r-Pn+3,r=Pn-2);for(let T=c;T<=f;T++)T>=0&&T<i.length&&(i[T]=i[T].replace(/\t/g,Fn),i[T]=(S>0&&i[T].length>S?"\u2026":"")+i[T].substr(S,ge-2)+(i[T].length>S+ge-1?"\u2026":""));return[a(c,t),new Array(r+k+2).join("-")+"^",a(t,f)].filter(Boolean).join(`
|
|
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function Ce(e,t,r,n,s,o=1,a=1){return Object.assign(Dn("SyntaxError",e),{source:t,offset:r,line:n,column:s,sourceFragment(l){return Rn({source:t,line:n,column:s,baseLine:o,baseColumn:a},isNaN(l)?0:l)},get formattedMessage(){return`Parse error: ${e}
|
|
`+Rn({source:t,line:n,column:s,baseLine:o,baseColumn:a},2)}})}function On(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 s=e.getNode.call(this,n);if(s===void 0)break;r&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,s,t,n),r=!1),t.push(s)}return r&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,n),t}var _n=()=>{},es=33,rs=35,ye=59,Mn=123,Bn=0;function ns(e){return function(){return this[e]()}}function be(e){let t=Object.create(null);for(let r of Object.keys(e)){let n=e[r],s=n.parse||n;s&&(t[r]=s)}return t}function is(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:be(e.atrule),pseudo:be(e.pseudo),node:be(e.node)};for(let[r,n]of Object.entries(e.parseContext))switch(typeof n){case"function":t.context[r]=n;break;case"string":t.context[r]=ns(n);break}return{config:t,...t,...t.node}}function Un(e){let t="",r="<unknown>",n=!1,s=_n,o=!1,a=new ne,h=Object.assign(new ie,is(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:On,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(i){return i===Mn?1:0},consumeUntilLeftCurlyBracketOrSemicolon(i){return i===Mn||i===ye?1:0},consumeUntilExclamationMarkOrSemicolon(i){return i===es||i===ye?1:0},consumeUntilSemicolonIncluded(i){return i===ye?2:0},createList(){return new P},createSingleNodeList(i){return new P().appendData(i)},getFirstListNode(i){return i&&i.first},getLastListNode(i){return i&&i.last},parseWithFallback(i,c){let f=this.tokenIndex;try{return i.call(this)}catch(k){if(o)throw k;this.skip(f-this.tokenIndex);let S=c.call(this);return o=!0,s(k,S),o=!1,S}},lookupNonWSType(i){let c;do if(c=this.lookupType(i++),c!==13&&c!==25)return c;while(c!==Bn);return Bn},charCodeAt(i){return i>=0&&i<t.length?t.charCodeAt(i):0},substring(i,c){return t.substring(i,c)},substrToCursor(i){return this.source.substring(i,this.tokenStart)},cmpChar(i,c){return ee(t,i,c)},cmpStr(i,c,f){return et(t,i,c,f)},consume(i){let c=this.tokenStart;return this.eat(i),this.substrToCursor(c)},consumeFunctionName(){let i=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),i},consumeNumber(i){let c=t.substring(this.tokenStart,Ot(t,this.tokenStart));return this.eat(i),c},eat(i){if(this.tokenType!==i){let c=gt[i].slice(0,-6).replace(/-/g," ").replace(/^./,S=>S.toUpperCase()),f=`${/[[\](){}]/.test(c)?`"${c}"`:c} is expected`,k=this.tokenStart;switch(i){case 1:this.tokenType===2||this.tokenType===7?(k=this.tokenEnd-1,f="Identifier is expected but function found"):f="Identifier is expected";break;case 4:this.isDelim(rs)&&(this.next(),k++,f="Name is expected");break;case 11:this.tokenType===10&&(k=this.tokenEnd,f="Percent sign is expected");break}this.error(f,k)}this.next()},eatIdent(i){(this.tokenType!==1||this.lookupValue(0,i)===!1)&&this.error(`Identifier "${i}" is expected`),this.next()},eatDelim(i){this.isDelim(i)||this.error(`Delim "${String.fromCharCode(i)}" is expected`),this.next()},getLocation(i,c){return n?a.getLocationRange(i,c,r):null},getLocationFromList(i){if(n){let c=this.getFirstListNode(i),f=this.getLastListNode(i);return a.getLocationRange(c!==null?c.loc.start.offset-a.startOffset:this.tokenStart,f!==null?f.loc.end.offset-a.startOffset:this.tokenStart,r)}return null},error(i,c){let f=typeof c<"u"&&c<t.length?a.getLocation(c):this.eof?a.getLocation(Re(t,t.length-1)):a.getLocation(this.tokenStart);throw new Ce(i||"Unexpected input",t,f.offset,f.line,f.column,a.startLine,a.startColumn)}});return Object.assign(function(i,c){t=i,c=c||{},h.setSource(t,Bt),a.setSource(t,c.offset,c.line,c.column),r=c.filename||"<unknown>",n=Boolean(c.positions),s=typeof c.onParseError=="function"?c.onParseError:_n,o=!1,h.parseAtrulePrelude="parseAtrulePrelude"in c?Boolean(c.parseAtrulePrelude):!0,h.parseRulePrelude="parseRulePrelude"in c?Boolean(c.parseRulePrelude):!0,h.parseValue="parseValue"in c?Boolean(c.parseValue):!0,h.parseCustomProperty="parseCustomProperty"in c?Boolean(c.parseCustomProperty):!1;let{context:f="default",onComment:k}=c;if(!(f in h.context))throw new Error("Unknown context `"+f+"`");typeof k=="function"&&h.forEachToken((T,j,tt)=>{if(T===25){let $t=h.getLocation(j,tt),zn=et(t,tt-2,tt,"*/")?t.slice(j+2,tt-2):t.slice(j+2,tt);k(zn,$t)}});let S=h.context[f].call(h,c);return h.eof||h.error(),S},{SyntaxError:Ce,config:h.config})}var os=35,as=38,cs=42,ls=43,hs=47,Wn=46,us=62,fs=124,ps=126;function ms(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function ds(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===Wn&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case ls:case us:case ps:case hs:return this.Combinator();case Wn:return this.ClassSelector();case cs:case fs:return this.TypeSelector();case os:return this.IdSelector();case as:return this.NestingSelector()}break}}}var Le={onWhiteSpace:ms,getNode:ds};function Vn(){let e=this.createList();this.skipSC();t:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case 18:e.push(this.Operator());break;case 22:break t;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}var ot={parse(){return this.createSingleNodeList(this.SelectorList())}},Te={parse(){return this.createSingleNodeList(this.Selector())}},xs={parse(){return this.createSingleNodeList(this.Identifier())}},ks={parse:Vn},jt={parse(){return this.createSingleNodeList(this.Nth())}},Hn={dir:xs,has:ot,lang:ks,matches:ot,is:ot,"-moz-any":ot,"-webkit-any":ot,where:ot,not:ot,"nth-child":jt,"nth-last-child":jt,"nth-last-of-type":jt,"nth-of-type":jt,slotted:Te,host:Te,"host-context":Te};var ve={};vt(ve,{AnPlusB:()=>lr,AttributeSelector:()=>mr,ClassSelector:()=>Cr,Combinator:()=>Lr,IdSelector:()=>Br,Identifier:()=>_r,NestingSelector:()=>qr,Nth:()=>jr,Operator:()=>Qr,Percentage:()=>Jr,PseudoClassSelector:()=>tn,PseudoElementSelector:()=>rn,Raw:()=>on,Selector:()=>hn,SelectorList:()=>fn,String:()=>kn,TypeSelector:()=>bn});var Gn={parseContext:{default:"SelectorList",selectorList:"SelectorList",selector:"Selector"},scope:{Selector:Le},atrule:{},pseudo:Hn,node:ve};var Ee=Un(Gn);var at=(e,t)=>e.a===t.a?e.b===t.b?e.c-t.c:e.b-t.b:e.a-t.a,we=(e,t)=>at(e,t)===0,Ae=(e,t)=>at(e,t)>0,Ne=(e,t)=>at(e,t)<0;var qn=(e,t="ASC")=>{let r=e.sort(at);return t==="DESC"?r.reverse():r},zt=(...e)=>qn(e,"ASC"),Kt=(...e)=>qn(e,"DESC");var bt=(...e)=>Kt(...e)[0],Yn=(...e)=>zt(...e)[0];var Lt=e=>{if(!e||e.type!=="Selector")throw new TypeError("Passed in source is not a Selector AST");let t=0,r=0,n=0;return e.children.forEach(s=>{switch(s.type){case"IdSelector":t+=1;break;case"AttributeSelector":case"ClassSelector":r+=1;break;case"PseudoClassSelector":switch(s.name.toLowerCase()){case"where":break;case"-webkit-any":case"any":s.children?.first&&(r+=1);break;case"-moz-any":case"is":case"matches":case"not":case"has":if(s.children?.first){let a=bt(...ct(s.children.first));t+=a.a,r+=a.b,n+=a.c}break;case"nth-child":case"nth-last-child":if(r+=1,s.children?.first?.selector){let a=bt(...ct(s.children.first.selector));t+=a.a,r+=a.b,n+=a.c}break;case"host-context":case"host":if(r+=1,s.children?.first?.children){let a={type:"Selector",children:[]},h=!1;s.children.first.children.forEach(i=>{if(h)return!1;if(i.type==="Combinator")return h=!0,!1;a.children.push(i)});let l=ct(a)[0];t+=l.a,r+=l.b,n+=l.c}break;case"after":case"before":case"first-letter":case"first-line":n+=1;break;default:r+=1;break}break;case"PseudoElementSelector":switch(s.name){case"slotted":if(n+=1,s.children?.first?.children){let a={type:"Selector",children:[]},h=!1;s.children.first.children.forEach(i=>{if(h)return!1;if(i.type==="Combinator")return h=!0,!1;a.children.push(i)});let l=ct(a)[0];t+=l.a,r+=l.b,n+=l.c}break;case"view-transition-group":case"view-transition-image-pair":case"view-transition-old":case"view-transition-new":if(s.children?.first?.value==="*")break;n+=1;break;default:n+=1;break}break;case"TypeSelector":let o=s.name;o.includes("|")&&(o=o.split("|")[1]),o!=="*"&&(n+=1);break;default:break}}),new Ie({a:t,b:r,c:n},e)},Ss=e=>{if(typeof e=="string"||e instanceof String)try{return Ee(e,{context:"selectorList"})}catch(t){throw new TypeError(`Could not convert passed in source '${e}' to SelectorList: ${t.message}`)}if(e instanceof Object){if(e.type&&["Selector","SelectorList"].includes(e.type))return e;if(e.type&&e.type==="Raw")try{return Ee(e.value,{context:"selectorList"})}catch(t){throw new TypeError(`Could not convert passed in source to SelectorList: ${t.message}`)}throw new TypeError("Passed in source is an Object but no AST / AST of the type Selector or SelectorList")}throw new TypeError("Passed in source is not a String nor an Object. I don't know what to do with it.")},ct=e=>{if(!e)return[];let t=Ss(e);if(t.type==="Selector")return[Lt(e)];if(t.type==="SelectorList"){let r=[];return t.children.forEach(n=>{let s=Lt(n);r.push(s)}),r}};var Qt=class extends Error{constructor(){super("Manipulating a Specificity instance is not allowed. Instead, create a new Specificity()")}},jn=class{constructor(t,r=null){this.value=t,this.selector=r}get a(){return this.value.a}set a(t){throw new Qt}get b(){return this.value.b}set b(t){throw new Qt}get c(){return this.value.c}set c(t){throw new Qt}selectorString(){return typeof this.selector=="string"||this.selector instanceof String?this.selector:this.selector instanceof Object&&this.selector.type==="Selector"?In(this.selector):""}toObject(){return this.value}toArray(){return[this.value.a,this.value.b,this.value.c]}toString(){return`(${this.value.a},${this.value.b},${this.value.c})`}toJSON(){return{selector:this.selectorString(),asObject:this.toObject(),asArray:this.toArray(),asString:this.toString()}}isEqualTo(t){return we(this,t)}isGreaterThan(t){return Ae(this,t)}isLessThan(t){return Ne(this,t)}static calculate(t){return ct(t)}static calculateForAST(t){return Lt(t)}static compare(t,r){return at(t,r)}static equals(t,r){return we(t,r)}static lessThan(t,r){return Ne(t,r)}static greaterThan(t,r){return Ae(t,r)}static min(...t){return Yn(...t)}static max(...t){return bt(...t)}static sortAsc(...t){return zt(...t)}static sortDesc(...t){return Kt(...t)}},Ie=jn;module.exports=ti(gs);
|
|
//# sourceMappingURL=index.cjs.map
|