@projectwallace/css-analyzer 5.14.0 → 6.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyze-css.js +3549 -0
- package/dist/analyze-css.umd.cjs +6 -0
- package/dist/index.d.ts +892 -881
- package/package.json +16 -15
- package/readme.md +24 -72
- package/dist/analyzer.cjs +0 -2
- package/dist/analyzer.cjs.map +0 -1
- package/dist/analyzer.modern.js +0 -2
- package/dist/analyzer.modern.js.map +0 -1
- package/dist/analyzer.module.js +0 -2
- package/dist/analyzer.module.js.map +0 -1
- package/dist/analyzer.umd.js +0 -2
- package/dist/analyzer.umd.js.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function(F,Re){typeof exports=="object"&&typeof module<"u"?Re(exports,require("css-tree/parser"),require("css-tree/walker")):typeof define=="function"&&define.amd?define(["exports","css-tree/parser","css-tree/walker"],Re):(F=typeof globalThis<"u"?globalThis:F||self,Re(F.analyzeCss={},F.parse$h,F.walk))})(this,function(F,Re,ue){"use strict";let Oe=null;class V{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(e){return V.createItem(e)}allocateCursor(e,n){let r;return Oe!==null?(r=Oe,Oe=Oe.cursor,r.prev=e,r.next=n,r.cursor=this.cursor):r={prev:e,next:n,cursor:this.cursor},this.cursor=r,r}releaseCursor(){const{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=Oe,Oe=e}updateCursors(e,n,r,i){let{cursor:o}=this;for(;o!==null;)o.prev===e&&(o.prev=n),o.next===r&&(o.next=i),o=o.cursor}*[Symbol.iterator](){for(let e=this.head;e!==null;e=e.next)yield e.data}get size(){let e=0;for(let n=this.head;n!==null;n=n.next)e++;return e}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(e){let n=null;this.head=null;for(let r of e){const i=V.createItem(r);n!==null?n.next=i:this.head=i,i.prev=n,n=i}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,n=this){const r=this.allocateCursor(null,this.head);for(;r.next!==null;){const i=r.next;r.next=i.next,e.call(n,i.data,i,this)}this.releaseCursor()}forEachRight(e,n=this){const r=this.allocateCursor(this.tail,null);for(;r.prev!==null;){const i=r.prev;r.prev=i.prev,e.call(n,i.data,i,this)}this.releaseCursor()}reduce(e,n,r=this){let i=this.allocateCursor(null,this.head),o=n,a;for(;i.next!==null;)a=i.next,i.next=a.next,o=e.call(r,o,a.data,a,this);return this.releaseCursor(),o}reduceRight(e,n,r=this){let i=this.allocateCursor(this.tail,null),o=n,a;for(;i.prev!==null;)a=i.prev,i.prev=a.prev,o=e.call(r,o,a.data,a,this);return this.releaseCursor(),o}some(e,n=this){for(let r=this.head;r!==null;r=r.next)if(e.call(n,r.data,r,this))return!0;return!1}map(e,n=this){const r=new V;for(let i=this.head;i!==null;i=i.next)r.appendData(e.call(n,i.data,i,this));return r}filter(e,n=this){const r=new V;for(let i=this.head;i!==null;i=i.next)e.call(n,i.data,i,this)&&r.appendData(i.data);return r}nextUntil(e,n,r=this){if(e===null)return;const i=this.allocateCursor(null,e);for(;i.next!==null;){const o=i.next;if(i.next=o.next,n.call(r,o.data,o,this))break}this.releaseCursor()}prevUntil(e,n,r=this){if(e===null)return;const i=this.allocateCursor(e,null);for(;i.prev!==null;){const o=i.prev;if(i.prev=o.prev,n.call(r,o.data,o,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){const e=new V;for(let n of this)e.appendData(n);return e}prepend(e){return this.updateCursors(null,e,this.head,e),this.head!==null?(this.head.prev=e,e.next=this.head):this.tail=e,this.head=e,this}prependData(e){return this.prepend(V.createItem(e))}append(e){return this.insert(e)}appendData(e){return this.insert(V.createItem(e))}insert(e,n=null){if(n!==null)if(this.updateCursors(n.prev,e,n,e),n.prev===null){if(this.head!==n)throw new Error("before doesn't belong to list");this.head=e,n.prev=e,e.next=n,this.updateCursors(null,e)}else n.prev.next=e,e.prev=n.prev,n.prev=e,e.next=n;else this.updateCursors(this.tail,e,null,e),this.tail!==null?(this.tail.next=e,e.prev=this.tail):this.head=e,this.tail=e;return this}insertData(e,n){return this.insert(V.createItem(e),n)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else{if(this.head!==e)throw new Error("item doesn't belong to list");this.head=e.next}if(e.next!==null)e.next.prev=e.prev;else{if(this.tail!==e)throw new Error("item doesn't belong to list");this.tail=e.prev}return e.prev=null,e.next=null,e}push(e){this.insert(V.createItem(e))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(e){this.prepend(V.createItem(e))}shift(){return this.head!==null?this.remove(this.head):null}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,n){return e.head===null?this:(n!=null?(this.updateCursors(n.prev,e.tail,n,e.head),n.prev!==null?(n.prev.next=e.head,e.head.prev=n.prev):this.head=e.head,n.prev=e.tail,e.tail.next=n):(this.updateCursors(this.tail,e.tail,null,e.head),this.tail!==null?(this.tail.next=e.head,e.head.prev=this.tail):this.head=e.head,this.tail=e.tail),e.head=null,e.tail=null,this)}replace(e,n){"head"in n?this.insertList(n,e):this.insert(n,e),this.remove(e)}}function ui(t,e){const n=Object.create(SyntaxError.prototype),r=new Error;return Object.assign(n,{name:t,message:e,get stack(){return(r.stack||"").replace(/^(.+\n){1,3}/,`${t}: ${e}
|
|
2
|
+
`)}})}const Et=100,In=60,Nn=" ";function $n({source:t,line:e,column:n},r){function i(l,m){return o.slice(l,m).map((S,b)=>String(l+b+1).padStart(c)+" |"+S).join(`
|
|
3
|
+
`)}const o=t.split(/\r\n?|\n|\f/),a=Math.max(1,e-r)-1,f=Math.min(e+r,o.length+1),c=Math.max(4,String(f).length)+1;let s=0;n+=(Nn.length-1)*(o[e-1].substr(0,n-1).match(/\t/g)||[]).length,n>Et&&(s=n-In+3,n=In-2);for(let l=a;l<=f;l++)l>=0&&l<o.length&&(o[l]=o[l].replace(/\t/g,Nn),o[l]=(s>0&&o[l].length>s?"…":"")+o[l].substr(s,Et-2)+(o[l].length>s+Et-1?"…":""));return[i(a,e),new Array(n+c+2).join("-")+"^",i(e,f)].filter(Boolean).join(`
|
|
4
|
+
`)}function Pn(t,e,n,r,i){return Object.assign(ui("SyntaxError",t),{source:e,offset:n,line:r,column:i,sourceFragment(a){return $n({source:e,line:r,column:i},isNaN(a)?0:a)},get formattedMessage(){return`Parse error: ${t}
|
|
5
|
+
`+$n({source:e,line:r,column:i},2)}})}const _t=0,k=1,I=2,B=3,D=4,qe=5,hi=6,ne=7,re=8,O=9,L=10,P=11,T=12,ie=13,Dn=14,se=15,Q=16,Ze=17,et=18,Be=19,tt=20,be=21,R=22,nt=23,Tt=24,we=25,fi=0;function G(t){return t>=48&&t<=57}function je(t){return G(t)||t>=65&&t<=70||t>=97&&t<=102}function Ot(t){return t>=65&&t<=90}function pi(t){return t>=97&&t<=122}function di(t){return Ot(t)||pi(t)}function mi(t){return t>=128}function rt(t){return di(t)||mi(t)||t===95}function Mn(t){return rt(t)||G(t)||t===45}function gi(t){return t>=0&&t<=8||t===11||t>=14&&t<=31||t===127}function it(t){return t===10||t===13||t===12}function Ue(t){return it(t)||t===32||t===9}function pe(t,e){return!(t!==92||it(e)||e===fi)}function It(t,e,n){return t===45?rt(e)||e===45||pe(e,n):rt(t)?!0:t===92?pe(t,e):!1}function Nt(t,e,n){return t===43||t===45?G(e)?2:e===46&&G(n)?3:0:t===46?G(e)?2:0:G(t)?1:0}function zn(t){return t===65279||t===65534?1:0}const $t=new Array(128),ki=128,st=130,Fn=131,Pt=132,Rn=133;for(let t=0;t<$t.length;t++)$t[t]=Ue(t)&&st||G(t)&&Fn||rt(t)&&Pt||gi(t)&&Rn||t||ki;function Dt(t){return t<128?$t[t]:Pt}function Ie(t,e){return e<t.length?t.charCodeAt(e):0}function Mt(t,e,n){return n===13&&Ie(t,e+1)===10?2:1}function qn(t,e,n){let r=t.charCodeAt(e);return Ot(r)&&(r=r|32),r===n}function ot(t,e,n,r){if(n-e!==r.length||e<0||n>t.length)return!1;for(let i=e;i<n;i++){const o=r.charCodeAt(i-e);let a=t.charCodeAt(i);if(Ot(a)&&(a=a|32),a!==o)return!1}return!0}function yi(t,e){for(;e>=0&&Ue(t.charCodeAt(e));e--);return e+1}function at(t,e){for(;e<t.length&&Ue(t.charCodeAt(e));e++);return e}function zt(t,e){for(;e<t.length&&G(t.charCodeAt(e));e++);return e}function Ve(t,e){if(e+=2,je(Ie(t,e-1))){for(const r=Math.min(t.length,e+5);e<r&&je(Ie(t,e));e++);const n=Ie(t,e);Ue(n)&&(e+=Mt(t,e,n))}return e}function lt(t,e){for(;e<t.length;e++){const n=t.charCodeAt(e);if(!Mn(n)){if(pe(n,Ie(t,e+1))){e=Ve(t,e)-1;continue}break}}return e}function Bn(t,e){let n=t.charCodeAt(e);if((n===43||n===45)&&(n=t.charCodeAt(e+=1)),G(n)&&(e=zt(t,e+1),n=t.charCodeAt(e)),n===46&&G(t.charCodeAt(e+1))&&(e+=2,e=zt(t,e)),qn(t,e,101)){let r=0;n=t.charCodeAt(e+1),(n===45||n===43)&&(r=1,n=t.charCodeAt(e+2)),G(n)&&(e=zt(t,e+1+r+1))}return e}function Ft(t,e){for(;e<t.length;e++){const n=t.charCodeAt(e);if(n===41){e++;break}pe(n,Ie(t,e+1))&&(e=Ve(t,e))}return e}function Si(t){if(t.length===1&&!je(t.charCodeAt(0)))return t[0];let e=parseInt(t,16);return(e===0||e>=55296&&e<=57343||e>1114111)&&(e=65533),String.fromCodePoint(e)}const jn=["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"],xi=16*1024;function ct(t=null,e){return t===null||t.length<e?new Uint32Array(Math.max(e+1024,xi)):t}const Un=10,Ci=12,Vn=13;function Gn(t){const e=t.source,n=e.length,r=e.length>0?zn(e.charCodeAt(0)):0,i=ct(t.lines,n),o=ct(t.columns,n);let a=t.startLine,f=t.startColumn;for(let c=r;c<n;c++){const s=e.charCodeAt(c);i[c]=a,o[c]=f++,(s===Un||s===Vn||s===Ci)&&(s===Vn&&c+1<n&&e.charCodeAt(c+1)===Un&&(c++,i[c]=a,o[c]=f),a++,f=1)}i[n]=a,o[n]=f,t.lines=i,t.columns=o,t.computed=!0}class bi{constructor(){this.lines=null,this.columns=null,this.computed=!1}setSource(e,n=0,r=1,i=1){this.source=e,this.startOffset=n,this.startLine=r,this.startColumn=i,this.computed=!1}getLocation(e,n){return this.computed||Gn(this),{source:n,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,n,r){return this.computed||Gn(this),{source:r,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+n,line:this.lines[n],column:this.columns[n]}}}}const Y=16777215,ye=24,wi=new Map([[I,R],[be,R],[Be,tt],[nt,Tt]]);class vi{constructor(e,n){this.setSource(e,n)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e="",n=()=>{}){e=String(e||"");const r=e.length,i=ct(this.offsetAndType,e.length+1),o=ct(this.balance,e.length+1);let a=0,f=0,c=0,s=-1;for(this.offsetAndType=null,this.balance=null,n(e,(l,m,S)=>{switch(l){default:o[a]=r;break;case f:{let b=c&Y;for(c=o[b],f=c>>ye,o[a]=b,o[b++]=a;b<a;b++)o[b]===r&&(o[b]=a);break}case be:case I:case Be:case nt:o[a]=c,f=wi.get(l),c=f<<ye|a;break}i[a++]=l<<ye|S,s===-1&&(s=m)}),i[a]=_t<<ye|r,o[a]=r,o[r]=r;c!==0;){const l=c&Y;c=o[l],o[l]=r}this.source=e,this.firstCharOffset=s===-1?0:s,this.tokenCount=a,this.offsetAndType=i,this.balance=o,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>ye:_t}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&Y:this.source.length}lookupValue(e,n){return e+=this.tokenIndex,e<this.tokenCount?ot(this.source,this.offsetAndType[e-1]&Y,this.offsetAndType[e]&Y,n):!1}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&Y:this.offsetAndType[this.tokenCount]&Y:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,n){return n?this.lookupType(n)===O&&this.source.charCodeAt(this.lookupOffset(n))===e:this.tokenType===O&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let n=this.tokenIndex+e;n<this.tokenCount?(this.tokenIndex=n,this.tokenStart=this.offsetAndType[n-1]&Y,n=this.offsetAndType[n],this.tokenType=n>>ye,this.tokenEnd=n&Y):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>ye,this.tokenEnd=e&Y):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=_t,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===ie||this.tokenType===we;)this.next()}skipUntilBalanced(e,n){let r=e,i,o;e:for(;r<this.tokenCount;r++){if(i=this.balance[r],i<e)break e;switch(o=r>0?this.offsetAndType[r-1]&Y:this.firstCharOffset,n(this.source.charCodeAt(o))){case 1:break e;case 2:r++;break e;default:this.balance[i]===r&&(r=i)}}this.skip(r-this.tokenIndex)}forEachToken(e){for(let n=0,r=this.firstCharOffset;n<this.tokenCount;n++){const i=r,o=this.offsetAndType[n],a=o&Y,f=o>>ye;r=a,e(f,i,a,n)}}dump(){const e=new Array(this.tokenCount);return this.forEachToken((n,r,i,o)=>{e[o]={idx:o,type:jn[n],chunk:this.source.substring(r,i),balance:this.balance[o]}}),e}}function Hn(t,e){function n(m){return m<f?t.charCodeAt(m):0}function r(){if(s=Bn(t,s),It(n(s),n(s+1),n(s+2))){l=T,s=lt(t,s);return}if(n(s)===37){l=P,s++;return}l=L}function i(){const m=s;if(s=lt(t,s),ot(t,m,s,"url")&&n(s)===40){if(s=at(t,s+1),n(s)===34||n(s)===39){l=I,s=m+4;return}a();return}if(n(s)===40){l=I,s++;return}l=k}function o(m){for(m||(m=n(s++)),l=qe;s<t.length;s++){const S=t.charCodeAt(s);switch(Dt(S)){case m:s++;return;case st:if(it(S)){s+=Mt(t,s,S),l=hi;return}break;case 92:if(s===t.length-1)break;const b=n(s+1);it(b)?s+=Mt(t,s+1,b):pe(S,b)&&(s=Ve(t,s)-1);break}}}function a(){for(l=ne,s=at(t,s);s<t.length;s++){const m=t.charCodeAt(s);switch(Dt(m)){case 41:s++;return;case st:if(s=at(t,s),n(s)===41||s>=t.length){s<t.length&&s++;return}s=Ft(t,s),l=re;return;case 34:case 39:case 40:case Rn:s=Ft(t,s),l=re;return;case 92:if(pe(m,n(s+1))){s=Ve(t,s)-1;break}s=Ft(t,s),l=re;return}}}t=String(t||"");const f=t.length;let c=zn(n(0)),s=c,l;for(;s<f;){const m=t.charCodeAt(s);switch(Dt(m)){case st:l=ie,s=at(t,s+1);break;case 34:o();break;case 35:Mn(n(s+1))||pe(n(s+1),n(s+2))?(l=D,s=lt(t,s+1)):(l=O,s++);break;case 39:o();break;case 40:l=be,s++;break;case 41:l=R,s++;break;case 43:Nt(m,n(s+1),n(s+2))?r():(l=O,s++);break;case 44:l=et,s++;break;case 45:Nt(m,n(s+1),n(s+2))?r():n(s+1)===45&&n(s+2)===62?(l=se,s=s+3):It(m,n(s+1),n(s+2))?i():(l=O,s++);break;case 46:Nt(m,n(s+1),n(s+2))?r():(l=O,s++);break;case 47:n(s+1)===42?(l=we,s=t.indexOf("*/",s+2),s=s===-1?t.length:s+2):(l=O,s++);break;case 58:l=Q,s++;break;case 59:l=Ze,s++;break;case 60:n(s+1)===33&&n(s+2)===45&&n(s+3)===45?(l=Dn,s=s+4):(l=O,s++);break;case 64:It(n(s+1),n(s+2),n(s+3))?(l=B,s=lt(t,s+1)):(l=O,s++);break;case 91:l=Be,s++;break;case 92:pe(m,n(s+1))?i():(l=O,s++);break;case 93:l=tt,s++;break;case 123:l=nt,s++;break;case 125:l=Tt,s++;break;case Fn:r();break;case Pt:i();break;default:l=O,s++}e(l,c,c=s)}}function Ai(t){const e=this.createList();let n=!1;const r={recognizer:t};for(;!this.eof;){switch(this.tokenType){case we:this.next();continue;case ie:n=!0,this.next();continue}let i=t.getNode.call(this,r);if(i===void 0)break;n&&(t.onWhiteSpace&&t.onWhiteSpace.call(this,i,e,r),n=!1),e.push(i)}return n&&t.onWhiteSpace&&t.onWhiteSpace.call(this,null,e,r),e}const Wn=()=>{},Li=33,Ei=35,Rt=59,Kn=123,Qn=0;function _i(t){return function(){return this[t]()}}function qt(t){const e=Object.create(null);for(const n in t){const r=t[n],i=r.parse||r;i&&(e[n]=i)}return e}function Ti(t){const e={context:Object.create(null),scope:Object.assign(Object.create(null),t.scope),atrule:qt(t.atrule),pseudo:qt(t.pseudo),node:qt(t.node)};for(const n in t.parseContext)switch(typeof t.parseContext[n]){case"function":e.context[n]=t.parseContext[n];break;case"string":e.context[n]=_i(t.parseContext[n]);break}return{config:e,...e,...e.node}}function Oi(t){let e="",n="<unknown>",r=!1,i=Wn,o=!1;const a=new bi,f=Object.assign(new vi,Ti(t||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Ai,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(s){return s===Kn?1:0},consumeUntilLeftCurlyBracketOrSemicolon(s){return s===Kn||s===Rt?1:0},consumeUntilExclamationMarkOrSemicolon(s){return s===Li||s===Rt?1:0},consumeUntilSemicolonIncluded(s){return s===Rt?2:0},createList(){return new V},createSingleNodeList(s){return new V().appendData(s)},getFirstListNode(s){return s&&s.first},getLastListNode(s){return s&&s.last},parseWithFallback(s,l){const m=this.tokenIndex;try{return s.call(this)}catch(S){if(o)throw S;const b=l.call(this,m);return o=!0,i(S,b),o=!1,b}},lookupNonWSType(s){let l;do if(l=this.lookupType(s++),l!==ie)return l;while(l!==Qn);return Qn},charCodeAt(s){return s>=0&&s<e.length?e.charCodeAt(s):0},substring(s,l){return e.substring(s,l)},substrToCursor(s){return this.source.substring(s,this.tokenStart)},cmpChar(s,l){return qn(e,s,l)},cmpStr(s,l,m){return ot(e,s,l,m)},consume(s){const l=this.tokenStart;return this.eat(s),this.substrToCursor(l)},consumeFunctionName(){const s=e.substring(this.tokenStart,this.tokenEnd-1);return this.eat(I),s},consumeNumber(s){const l=e.substring(this.tokenStart,Bn(e,this.tokenStart));return this.eat(s),l},eat(s){if(this.tokenType!==s){const l=jn[s].slice(0,-6).replace(/-/g," ").replace(/^./,b=>b.toUpperCase());let m=`${/[[\](){}]/.test(l)?`"${l}"`:l} is expected`,S=this.tokenStart;switch(s){case k:this.tokenType===I||this.tokenType===ne?(S=this.tokenEnd-1,m="Identifier is expected but function found"):m="Identifier is expected";break;case D:this.isDelim(Ei)&&(this.next(),S++,m="Name is expected");break;case P:this.tokenType===L&&(S=this.tokenEnd,m="Percent sign is expected");break}this.error(m,S)}this.next()},eatIdent(s){(this.tokenType!==k||this.lookupValue(0,s)===!1)&&this.error(`Identifier "${s}" is expected`),this.next()},eatDelim(s){this.isDelim(s)||this.error(`Delim "${String.fromCharCode(s)}" is expected`),this.next()},getLocation(s,l){return r?a.getLocationRange(s,l,n):null},getLocationFromList(s){if(r){const l=this.getFirstListNode(s),m=this.getLastListNode(s);return a.getLocationRange(l!==null?l.loc.start.offset-a.startOffset:this.tokenStart,m!==null?m.loc.end.offset-a.startOffset:this.tokenStart,n)}return null},error(s,l){const m=typeof l<"u"&&l<e.length?a.getLocation(l):this.eof?a.getLocation(yi(e,e.length-1)):a.getLocation(this.tokenStart);throw new Pn(s||"Unexpected input",e,m.offset,m.line,m.column)}});return Object.assign(function(s,l){e=s,l=l||{},f.setSource(e,Hn),a.setSource(e,l.offset,l.line,l.column),n=l.filename||"<unknown>",r=!!l.positions,i=typeof l.onParseError=="function"?l.onParseError:Wn,o=!1,f.parseAtrulePrelude="parseAtrulePrelude"in l?!!l.parseAtrulePrelude:!0,f.parseRulePrelude="parseRulePrelude"in l?!!l.parseRulePrelude:!0,f.parseValue="parseValue"in l?!!l.parseValue:!0,f.parseCustomProperty="parseCustomProperty"in l?!!l.parseCustomProperty:!1;const{context:m="default",onComment:S}=l;if(!(m in f.context))throw new Error("Unknown context `"+m+"`");typeof S=="function"&&f.forEachToken((X,j,le)=>{if(X===we){const Ee=f.getLocation(j,le),De=ot(e,le-2,le,"*/")?e.slice(j+2,le-2):e.slice(j+2,le);S(De,Ee)}});const b=f.context[m].call(f,l);return f.eof||f.error(),b},{SyntaxError:Pn,config:f.config})}const Ii=35,Ni=38,$i=42,Pi=43,Di=47,Yn=46,Mi=62,zi=124,Fi=126;function Ri(t,e){e.last!==null&&e.last.type!=="Combinator"&&t!==null&&t.type!=="Combinator"&&e.push({type:"Combinator",loc:null,name:" "})}function qi(){switch(this.tokenType){case Be:return this.AttributeSelector();case D:return this.IdSelector();case Q:return this.lookupType(1)===Q?this.PseudoElementSelector():this.PseudoClassSelector();case k:return this.TypeSelector();case L:case P:return this.Percentage();case T:this.charCodeAt(this.tokenStart)===Yn&&this.error("Identifier is expected",this.tokenStart+1);break;case O:{switch(this.charCodeAt(this.tokenStart)){case Pi:case Mi:case Fi:case Di:return this.Combinator();case Yn:return this.ClassSelector();case $i:case zi:return this.TypeSelector();case Ii:return this.IdSelector();case Ni:return this.NestingSelector()}break}}}const Bi={onWhiteSpace:Ri,getNode:qi},ve={parse(){return this.createSingleNodeList(this.SelectorList())}},Bt={parse(){return this.createSingleNodeList(this.Selector())}},Jn={parse(){return this.createSingleNodeList(this.Identifier())}},ut={parse(){return this.createSingleNodeList(this.Nth())}},ji={dir:Jn,has:ve,lang:Jn,matches:ve,is:ve,"-moz-any":ve,"-webkit-any":ve,where:ve,not:ve,"nth-child":ut,"nth-last-child":ut,"nth-last-of-type":ut,"nth-of-type":ut,slotted:Bt,host:Bt,"host-context":Bt},he=43,H=45,ht=110,Ae=!0,Ui=!1;function ft(t,e){let n=this.tokenStart+t;const r=this.charCodeAt(n);for((r===he||r===H)&&(e&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)G(this.charCodeAt(n))||this.error("Integer is expected",n)}function Ne(t){return ft.call(this,0,t)}function Se(t,e){if(!this.cmpChar(this.tokenStart+t,e)){let n="";switch(e){case ht:n="N is expected";break;case H:n="HyphenMinus is expected";break}this.error(n,this.tokenStart+t)}}function jt(){let t=0,e=0,n=this.tokenType;for(;n===ie||n===we;)n=this.lookupType(++t);if(n!==L)if(this.isDelim(he,t)||this.isDelim(H,t)){e=this.isDelim(he,t)?he:H;do n=this.lookupType(++t);while(n===ie||n===we);n!==L&&(this.skip(t),Ne.call(this,Ae))}else return null;return t>0&&this.skip(t),e===0&&(n=this.charCodeAt(this.tokenStart),n!==he&&n!==H&&this.error("Number sign is expected")),Ne.call(this,e!==0),e===H?"-"+this.consume(L):this.consume(L)}function Vi(){const t=this.tokenStart;let e=null,n=null;if(this.tokenType===L)Ne.call(this,Ui),n=this.consume(L);else if(this.tokenType===k&&this.cmpChar(this.tokenStart,H))switch(e="-1",Se.call(this,1,ht),this.tokenEnd-this.tokenStart){case 2:this.next(),n=jt.call(this);break;case 3:Se.call(this,2,H),this.next(),this.skipSC(),Ne.call(this,Ae),n="-"+this.consume(L);break;default:Se.call(this,2,H),ft.call(this,3,Ae),this.next(),n=this.substrToCursor(t+2)}else if(this.tokenType===k||this.isDelim(he)&&this.lookupType(1)===k){let r=0;switch(e="1",this.isDelim(he)&&(r=1,this.next()),Se.call(this,0,ht),this.tokenEnd-this.tokenStart){case 1:this.next(),n=jt.call(this);break;case 2:Se.call(this,1,H),this.next(),this.skipSC(),Ne.call(this,Ae),n="-"+this.consume(L);break;default:Se.call(this,1,H),ft.call(this,2,Ae),this.next(),n=this.substrToCursor(t+r+1)}}else if(this.tokenType===T){const r=this.charCodeAt(this.tokenStart),i=r===he||r===H;let o=this.tokenStart+i;for(;o<this.tokenEnd&&G(this.charCodeAt(o));o++);o===this.tokenStart+i&&this.error("Integer is expected",this.tokenStart+i),Se.call(this,o-this.tokenStart,ht),e=this.substring(t,o),o+1===this.tokenEnd?(this.next(),n=jt.call(this)):(Se.call(this,o-this.tokenStart+1,H),o+2===this.tokenEnd?(this.next(),this.skipSC(),Ne.call(this,Ae),n="-"+this.consume(L)):(ft.call(this,o-this.tokenStart+2,Ae),this.next(),n=this.substrToCursor(o+1)))}else this.error();return e!==null&&e.charCodeAt(0)===he&&(e=e.substr(1)),n!==null&&n.charCodeAt(0)===he&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(t,this.tokenStart),a:e,b:n}}function Gi(t){if(t.a){const e=t.a==="+1"&&"n"||t.a==="1"&&"n"||t.a==="-1"&&"-n"||t.a+"n";if(t.b){const n=t.b[0]==="-"||t.b[0]==="+"?t.b:"+"+t.b;this.tokenize(e+n)}else this.tokenize(e)}else this.tokenize(t.b)}const Hi=36,Xn=42,pt=61,Wi=94,Ut=124,Ki=126;function Qi(){this.eof&&this.error("Unexpected end of input");const t=this.tokenStart;let e=!1;return this.isDelim(Xn)?(e=!0,this.next()):this.isDelim(Ut)||this.eat(k),this.isDelim(Ut)?this.charCodeAt(this.tokenStart+1)!==pt?(this.next(),this.eat(k)):e&&this.error("Identifier is expected",this.tokenEnd):e&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function Yi(){const t=this.tokenStart,e=this.charCodeAt(t);return e!==pt&&e!==Ki&&e!==Wi&&e!==Hi&&e!==Xn&&e!==Ut&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),e!==pt&&(this.isDelim(pt)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(t)}function Ji(){const t=this.tokenStart;let e,n=null,r=null,i=null;return this.eat(Be),this.skipSC(),e=Qi.call(this),this.skipSC(),this.tokenType!==tt&&(this.tokenType!==k&&(n=Yi.call(this),this.skipSC(),r=this.tokenType===qe?this.String():this.Identifier(),this.skipSC()),this.tokenType===k&&(i=this.consume(k),this.skipSC())),this.eat(tt),{type:"AttributeSelector",loc:this.getLocation(t,this.tokenStart),name:e,matcher:n,value:r,flags:i}}function Xi(t){this.token(O,"["),this.node(t.name),t.matcher!==null&&(this.tokenize(t.matcher),this.node(t.value)),t.flags!==null&&this.token(k,t.flags),this.token(O,"]")}const Zi=46;function es(){return this.eatDelim(Zi),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(k)}}function ts(t){this.token(O,"."),this.token(k,t.name)}const ns=43,Zn=47,rs=62,is=126;function ss(){const t=this.tokenStart;let e;switch(this.tokenType){case ie:e=" ";break;case O:switch(this.charCodeAt(this.tokenStart)){case rs:case ns:case is:this.next();break;case Zn:this.next(),this.eatIdent("deep"),this.eatDelim(Zn);break;default:this.error("Combinator is expected")}e=this.substrToCursor(t);break}return{type:"Combinator",loc:this.getLocation(t,this.tokenStart),name:e}}function os(t){this.tokenize(t.name)}function as(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(k)}}function ls(t){this.token(k,t.name)}function cs(){const t=this.tokenStart;return this.eat(D),{type:"IdSelector",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t+1)}}function us(t){this.token(O,"#"+t.name)}const hs=38;function fs(){const t=this.tokenStart;return this.eatDelim(hs),{type:"NestingSelector",loc:this.getLocation(t,this.tokenStart)}}function ps(){this.token(O,"&")}function ds(){this.skipSC();const t=this.tokenStart;let e=t,n=null,r;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?r=this.Identifier():r=this.AnPlusB(),e=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),n=this.SelectorList(),e=this.tokenStart),{type:"Nth",loc:this.getLocation(t,e),nth:r,selector:n}}function ms(t){this.node(t.nth),t.selector!==null&&(this.token(k,"of"),this.node(t.selector))}function gs(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(P)}}function ks(t){this.token(P,t.value+"%")}function ys(){const t=this.tokenStart;let e=null,n,r;return this.eat(Q),this.tokenType===I?(n=this.consumeFunctionName(),r=n.toLowerCase(),hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),e=this.pseudo[r].call(this),this.skipSC()):(e=this.createList(),e.push(this.Raw(this.tokenIndex,null,!1))),this.eat(R)):n=this.consume(k),{type:"PseudoClassSelector",loc:this.getLocation(t,this.tokenStart),name:n,children:e}}function Ss(t){this.token(Q,":"),t.children===null?this.token(k,t.name):(this.token(I,t.name+"("),this.children(t),this.token(R,")"))}function xs(){const t=this.tokenStart;let e=null,n,r;return this.eat(Q),this.eat(Q),this.tokenType===I?(n=this.consumeFunctionName(),r=n.toLowerCase(),hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),e=this.pseudo[r].call(this),this.skipSC()):(e=this.createList(),e.push(this.Raw(this.tokenIndex,null,!1))),this.eat(R)):n=this.consume(k),{type:"PseudoElementSelector",loc:this.getLocation(t,this.tokenStart),name:n,children:e}}function Cs(t){this.token(Q,":"),this.token(Q,":"),t.children===null?this.token(k,t.name):(this.token(I,t.name+"("),this.children(t),this.token(R,")"))}function bs(){return this.tokenIndex>0&&this.lookupType(-1)===ie?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}function ws(t,e,n){const r=this.getTokenStart(t);let i;return this.skipUntilBalanced(t,e||this.consumeUntilBalanceEnd),n&&this.tokenStart>r?i=bs.call(this):i=this.tokenStart,{type:"Raw",loc:this.getLocation(r,i),value:this.substring(r,i)}}function vs(t){this.tokenize(t.value)}function As(){const t=this.readSequence(this.scope.Selector);return this.getFirstListNode(t)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(t),children:t}}function Ls(t){this.children(t)}function Es(){const t=this.createList();for(;!this.eof;){if(t.push(this.Selector()),this.tokenType===et){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(t),children:t}}function _s(t){this.children(t,()=>this.token(et,","))}const Vt=92,er=34,Ts=39;function Os(t){const e=t.length,n=t.charCodeAt(0),r=n===er||n===Ts?1:0,i=r===1&&e>1&&t.charCodeAt(e-1)===n?e-2:e-1;let o="";for(let a=r;a<=i;a++){let f=t.charCodeAt(a);if(f===Vt){if(a===i){a!==e-1&&(o=t.substr(a+1));break}if(f=t.charCodeAt(++a),pe(Vt,f)){const c=a-1,s=Ve(t,c);a=s-1,o+=Si(t.substring(c+1,s))}else f===13&&t.charCodeAt(a+1)===10&&a++}else o+=t[a]}return o}function Is(t,e){const n='"',r=er;let i="",o=!1;for(let a=0;a<t.length;a++){const f=t.charCodeAt(a);if(f===0){i+="�";continue}if(f<=31||f===127){i+="\\"+f.toString(16),o=!0;continue}f===r||f===Vt?(i+="\\"+t.charAt(a),o=!1):(o&&(je(f)||Ue(f))&&(i+=" "),i+=t.charAt(a),o=!1)}return n+i+n}function Ns(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Os(this.consume(qe))}}function $s(t){this.token(qe,Is(t.value))}const Ps=42,tr=124;function Gt(){this.tokenType!==k&&this.isDelim(Ps)===!1&&this.error("Identifier or asterisk is expected"),this.next()}function Ds(){const t=this.tokenStart;return this.isDelim(tr)?(this.next(),Gt.call(this)):(Gt.call(this),this.isDelim(tr)&&(this.next(),Gt.call(this))),{type:"TypeSelector",loc:this.getLocation(t,this.tokenStart),name:this.substrToCursor(t)}}function Ms(t){this.tokenize(t.name)}const nr=Oi({parseContext:{default:"SelectorList",selectorList:"SelectorList",selector:"Selector"},scope:{Selector:Bi},atrule:{},pseudo:ji,node:Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:Vi,AttributeSelector:Ji,ClassSelector:es,Combinator:ss,IdSelector:cs,Identifier:as,NestingSelector:fs,Nth:ds,Percentage:gs,PseudoClassSelector:ys,PseudoElementSelector:xs,Raw:ws,Selector:As,SelectorList:Es,String:Ns,TypeSelector:Ds},Symbol.toStringTag,{value:"Module"}))});var Ht={},Wt={},rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Wt.encode=function(t){if(0<=t&&t<rr.length)return rr[t];throw new TypeError("Must be between 0 and 63: "+t)},Wt.decode=function(t){var e=65,n=90,r=97,i=122,o=48,a=57,f=43,c=47,s=26,l=52;return e<=t&&t<=n?t-e:r<=t&&t<=i?t-r+s:o<=t&&t<=a?t-o+l:t==f?62:t==c?63:-1};var ir=Wt,Kt=5,sr=1<<Kt,or=sr-1,ar=sr;function zs(t){return t<0?(-t<<1)+1:(t<<1)+0}function Fs(t){var e=(t&1)===1,n=t>>1;return e?-n:n}Ht.encode=function(e){var n="",r,i=zs(e);do r=i&or,i>>>=Kt,i>0&&(r|=ar),n+=ir.encode(r);while(i>0);return n},Ht.decode=function(e,n,r){var i=e.length,o=0,a=0,f,c;do{if(n>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(c=ir.decode(e.charCodeAt(n++)),c===-1)throw new Error("Invalid base64 digit: "+e.charAt(n-1));f=!!(c&ar),c&=or,o=o+(c<<a),a+=Kt}while(f);r.value=Fs(o),r.rest=n};var dt={};(function(t){function e(u,h,g){if(h in u)return u[h];if(arguments.length===3)return g;throw new Error('"'+h+'" is a required argument.')}t.getArg=e;var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function i(u){var h=u.match(n);return h?{scheme:h[1],auth:h[2],host:h[3],port:h[4],path:h[5]}:null}t.urlParse=i;function o(u){var h="";return u.scheme&&(h+=u.scheme+":"),h+="//",u.auth&&(h+=u.auth+"@"),u.host&&(h+=u.host),u.port&&(h+=":"+u.port),u.path&&(h+=u.path),h}t.urlGenerate=o;var a=32;function f(u){var h=[];return function(g){for(var p=0;p<h.length;p++)if(h[p].input===g){var ee=h[0];return h[0]=h[p],h[p]=ee,h[0].result}var U=u(g);return h.unshift({input:g,result:U}),h.length>a&&h.pop(),U}}var c=f(function(h){var g=h,p=i(h);if(p){if(!p.path)return h;g=p.path}for(var ee=t.isAbsolute(g),U=[],xe=0,z=0;;)if(xe=z,z=g.indexOf("/",xe),z===-1){U.push(g.slice(xe));break}else for(U.push(g.slice(xe,z));z<g.length&&g[z]==="/";)z++;for(var Ce,ke=0,z=U.length-1;z>=0;z--)Ce=U[z],Ce==="."?U.splice(z,1):Ce===".."?ke++:ke>0&&(Ce===""?(U.splice(z+1,ke),ke=0):(U.splice(z,2),ke--));return g=U.join("/"),g===""&&(g=ee?"/":"."),p?(p.path=g,o(p)):g});t.normalize=c;function s(u,h){u===""&&(u="."),h===""&&(h=".");var g=i(h),p=i(u);if(p&&(u=p.path||"/"),g&&!g.scheme)return p&&(g.scheme=p.scheme),o(g);if(g||h.match(r))return h;if(p&&!p.host&&!p.path)return p.host=h,o(p);var ee=h.charAt(0)==="/"?h:c(u.replace(/\/+$/,"")+"/"+h);return p?(p.path=ee,o(p)):ee}t.join=s,t.isAbsolute=function(u){return u.charAt(0)==="/"||n.test(u)};function l(u,h){u===""&&(u="."),u=u.replace(/\/$/,"");for(var g=0;h.indexOf(u+"/")!==0;){var p=u.lastIndexOf("/");if(p<0||(u=u.slice(0,p),u.match(/^([^\/]+:\/)?\/*$/)))return h;++g}return Array(g+1).join("../")+h.substr(u.length+1)}t.relative=l;var m=function(){var u=Object.create(null);return!("__proto__"in u)}();function S(u){return u}function b(u){return j(u)?"$"+u:u}t.toSetString=m?S:b;function X(u){return j(u)?u.slice(1):u}t.fromSetString=m?S:X;function j(u){if(!u)return!1;var h=u.length;if(h<9||u.charCodeAt(h-1)!==95||u.charCodeAt(h-2)!==95||u.charCodeAt(h-3)!==111||u.charCodeAt(h-4)!==116||u.charCodeAt(h-5)!==111||u.charCodeAt(h-6)!==114||u.charCodeAt(h-7)!==112||u.charCodeAt(h-8)!==95||u.charCodeAt(h-9)!==95)return!1;for(var g=h-10;g>=0;g--)if(u.charCodeAt(g)!==36)return!1;return!0}function le(u,h,g){var p=Z(u.source,h.source);return p!==0||(p=u.originalLine-h.originalLine,p!==0)||(p=u.originalColumn-h.originalColumn,p!==0||g)||(p=u.generatedColumn-h.generatedColumn,p!==0)||(p=u.generatedLine-h.generatedLine,p!==0)?p:Z(u.name,h.name)}t.compareByOriginalPositions=le;function Ee(u,h,g){var p;return p=u.originalLine-h.originalLine,p!==0||(p=u.originalColumn-h.originalColumn,p!==0||g)||(p=u.generatedColumn-h.generatedColumn,p!==0)||(p=u.generatedLine-h.generatedLine,p!==0)?p:Z(u.name,h.name)}t.compareByOriginalPositionsNoSource=Ee;function De(u,h,g){var p=u.generatedLine-h.generatedLine;return p!==0||(p=u.generatedColumn-h.generatedColumn,p!==0||g)||(p=Z(u.source,h.source),p!==0)||(p=u.originalLine-h.originalLine,p!==0)||(p=u.originalColumn-h.originalColumn,p!==0)?p:Z(u.name,h.name)}t.compareByGeneratedPositionsDeflated=De;function Ke(u,h,g){var p=u.generatedColumn-h.generatedColumn;return p!==0||g||(p=Z(u.source,h.source),p!==0)||(p=u.originalLine-h.originalLine,p!==0)||(p=u.originalColumn-h.originalColumn,p!==0)?p:Z(u.name,h.name)}t.compareByGeneratedPositionsDeflatedNoLine=Ke;function Z(u,h){return u===h?0:u===null?1:h===null?-1:u>h?1:-1}function St(u,h){var g=u.generatedLine-h.generatedLine;return g!==0||(g=u.generatedColumn-h.generatedColumn,g!==0)||(g=Z(u.source,h.source),g!==0)||(g=u.originalLine-h.originalLine,g!==0)||(g=u.originalColumn-h.originalColumn,g!==0)?g:Z(u.name,h.name)}t.compareByGeneratedPositionsInflated=St;function xt(u){return JSON.parse(u.replace(/^\)]}'[^\n]*\n/,""))}t.parseSourceMapInput=xt;function Ct(u,h,g){if(h=h||"",u&&(u[u.length-1]!=="/"&&h[0]!=="/"&&(u+="/"),h=u+h),g){var p=i(g);if(!p)throw new Error("sourceMapURL could not be parsed");if(p.path){var ee=p.path.lastIndexOf("/");ee>=0&&(p.path=p.path.substring(0,ee+1))}h=s(o(p),h)}return c(h)}t.computeSourceURL=Ct})(dt);var lr={},Qt=dt,Yt=Object.prototype.hasOwnProperty,Le=typeof Map<"u";function de(){this._array=[],this._set=Le?new Map:Object.create(null)}de.fromArray=function(e,n){for(var r=new de,i=0,o=e.length;i<o;i++)r.add(e[i],n);return r},de.prototype.size=function(){return Le?this._set.size:Object.getOwnPropertyNames(this._set).length},de.prototype.add=function(e,n){var r=Le?e:Qt.toSetString(e),i=Le?this.has(e):Yt.call(this._set,r),o=this._array.length;(!i||n)&&this._array.push(e),i||(Le?this._set.set(e,o):this._set[r]=o)},de.prototype.has=function(e){if(Le)return this._set.has(e);var n=Qt.toSetString(e);return Yt.call(this._set,n)},de.prototype.indexOf=function(e){if(Le){var n=this._set.get(e);if(n>=0)return n}else{var r=Qt.toSetString(e);if(Yt.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},de.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},de.prototype.toArray=function(){return this._array.slice()},lr.ArraySet=de;var cr={},ur=dt;function Rs(t,e){var n=t.generatedLine,r=e.generatedLine,i=t.generatedColumn,o=e.generatedColumn;return r>n||r==n&&o>=i||ur.compareByGeneratedPositionsInflated(t,e)<=0}function mt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}mt.prototype.unsortedForEach=function(e,n){this._array.forEach(e,n)},mt.prototype.add=function(e){Rs(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},mt.prototype.toArray=function(){return this._sorted||(this._array.sort(ur.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},cr.MappingList=mt;var Ge=Ht,$=dt,gt=lr.ArraySet,qs=cr.MappingList;function J(t){t||(t={}),this._file=$.getArg(t,"file",null),this._sourceRoot=$.getArg(t,"sourceRoot",null),this._skipValidation=$.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=$.getArg(t,"ignoreInvalidMapping",!1),this._sources=new gt,this._names=new gt,this._mappings=new qs,this._sourcesContents=null}J.prototype._version=3,J.fromSourceMap=function(e,n){var r=e.sourceRoot,i=new J(Object.assign(n||{},{file:e.file,sourceRoot:r}));return e.eachMapping(function(o){var a={generated:{line:o.generatedLine,column:o.generatedColumn}};o.source!=null&&(a.source=o.source,r!=null&&(a.source=$.relative(r,a.source)),a.original={line:o.originalLine,column:o.originalColumn},o.name!=null&&(a.name=o.name)),i.addMapping(a)}),e.sources.forEach(function(o){var a=o;r!==null&&(a=$.relative(r,o)),i._sources.has(a)||i._sources.add(a);var f=e.sourceContentFor(o);f!=null&&i.setSourceContent(o,f)}),i},J.prototype.addMapping=function(e){var n=$.getArg(e,"generated"),r=$.getArg(e,"original",null),i=$.getArg(e,"source",null),o=$.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(n,r,i,o)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:n.line,generatedColumn:n.column,originalLine:r!=null&&r.line,originalColumn:r!=null&&r.column,source:i,name:o}))},J.prototype.setSourceContent=function(e,n){var r=e;this._sourceRoot!=null&&(r=$.relative(this._sourceRoot,r)),n!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[$.toSetString(r)]=n):this._sourcesContents&&(delete this._sourcesContents[$.toSetString(r)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))},J.prototype.applySourceMap=function(e,n,r){var i=n;if(n==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var o=this._sourceRoot;o!=null&&(i=$.relative(o,i));var a=new gt,f=new gt;this._mappings.unsortedForEach(function(c){if(c.source===i&&c.originalLine!=null){var s=e.originalPositionFor({line:c.originalLine,column:c.originalColumn});s.source!=null&&(c.source=s.source,r!=null&&(c.source=$.join(r,c.source)),o!=null&&(c.source=$.relative(o,c.source)),c.originalLine=s.line,c.originalColumn=s.column,s.name!=null&&(c.name=s.name))}var l=c.source;l!=null&&!a.has(l)&&a.add(l);var m=c.name;m!=null&&!f.has(m)&&f.add(m)},this),this._sources=a,this._names=f,e.sources.forEach(function(c){var s=e.sourceContentFor(c);s!=null&&(r!=null&&(c=$.join(r,c)),o!=null&&(c=$.relative(o,c)),this.setSourceContent(c,s))},this)},J.prototype._validateMapping=function(e,n,r,i){if(n&&typeof n.line!="number"&&typeof n.column!="number"){var o="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(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(o),!1;throw new Error(o)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!n&&!r&&!i)){if(e&&"line"in e&&"column"in e&&n&&"line"in n&&"column"in n&&e.line>0&&e.column>=0&&n.line>0&&n.column>=0&&r)return;var o="Invalid mapping: "+JSON.stringify({generated:e,source:r,original:n,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(o),!1;throw new Error(o)}},J.prototype._serializeMappings=function(){for(var e=0,n=1,r=0,i=0,o=0,a=0,f="",c,s,l,m,S=this._mappings.toArray(),b=0,X=S.length;b<X;b++){if(s=S[b],c="",s.generatedLine!==n)for(e=0;s.generatedLine!==n;)c+=";",n++;else if(b>0){if(!$.compareByGeneratedPositionsInflated(s,S[b-1]))continue;c+=","}c+=Ge.encode(s.generatedColumn-e),e=s.generatedColumn,s.source!=null&&(m=this._sources.indexOf(s.source),c+=Ge.encode(m-a),a=m,c+=Ge.encode(s.originalLine-1-i),i=s.originalLine-1,c+=Ge.encode(s.originalColumn-r),r=s.originalColumn,s.name!=null&&(l=this._names.indexOf(s.name),c+=Ge.encode(l-o),o=l)),f+=c}return f},J.prototype._generateSourcesContent=function(e,n){return e.map(function(r){if(!this._sourcesContents)return null;n!=null&&(r=$.relative(n,r));var i=$.toSetString(r);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)},J.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},J.prototype.toString=function(){return JSON.stringify(this.toJSON())};var Bs=J;const hr=new Set(["Atrule","Selector","Declaration"]);function js(t){const e=new Bs,n={line:1,column:0},r={line:0,column:0},i={line:1,column:0},o={generated:i};let a=1,f=0,c=!1;const s=t.node;t.node=function(S){if(S.loc&&S.loc.start&&hr.has(S.type)){const b=S.loc.start.line,X=S.loc.start.column-1;(r.line!==b||r.column!==X)&&(r.line=b,r.column=X,n.line=a,n.column=f,c&&(c=!1,(n.line!==i.line||n.column!==i.column)&&e.addMapping(o)),c=!0,e.addMapping({source:S.loc.source,original:r,generated:n}))}s.call(this,S),c&&hr.has(S.type)&&(i.line=a,i.column=f)};const l=t.emit;t.emit=function(S,b,X){for(let j=0;j<S.length;j++)S.charCodeAt(j)===10?(a++,f=0):f++;l(S,b,X)};const m=t.result;return t.result=function(){return c&&e.addMapping(o),{css:m(),map:e}},t}const Us=43,Vs=45,Jt=(t,e)=>{if(t===O&&(t=e),typeof t=="string"){const n=t.charCodeAt(0);return n>127?32768:n<<8}return t},fr=[[k,k],[k,I],[k,ne],[k,re],[k,"-"],[k,L],[k,P],[k,T],[k,se],[k,be],[B,k],[B,I],[B,ne],[B,re],[B,"-"],[B,L],[B,P],[B,T],[B,se],[D,k],[D,I],[D,ne],[D,re],[D,"-"],[D,L],[D,P],[D,T],[D,se],[T,k],[T,I],[T,ne],[T,re],[T,"-"],[T,L],[T,P],[T,T],[T,se],["#",k],["#",I],["#",ne],["#",re],["#","-"],["#",L],["#",P],["#",T],["#",se],["-",k],["-",I],["-",ne],["-",re],["-","-"],["-",L],["-",P],["-",T],["-",se],[L,k],[L,I],[L,ne],[L,re],[L,L],[L,P],[L,T],[L,"%"],[L,se],["@",k],["@",I],["@",ne],["@",re],["@","-"],["@",se],[".",L],[".",P],[".",T],["+",L],["+",P],["+",T],["/","*"]],Gs=fr.concat([[k,D],[T,D],[D,D],[B,be],[B,qe],[B,Q],[P,P],[P,T],[P,I],[P,"-"],[R,k],[R,I],[R,P],[R,T],[R,D],[R,"-"]]);function pr(t){const e=new Set(t.map(([n,r])=>Jt(n)<<16|Jt(r)));return function(n,r,i){const o=Jt(r,i),a=i.charCodeAt(0);return(a===Vs&&r!==k&&r!==I&&r!==se||a===Us?e.has(n<<16|a<<8):e.has(n<<16|o))&&this.emit(" ",ie,!0),o}}const Hs=pr(fr),dr=pr(Gs),mr=Object.freeze(Object.defineProperty({__proto__:null,safe:dr,spec:Hs},Symbol.toStringTag,{value:"Module"})),Ws=92;function Ks(t,e){if(typeof e=="function"){let n=null;t.children.forEach(r=>{n!==null&&e.call(this,n),this.node(r),n=r});return}t.children.forEach(this.node,this)}function Qs(t){Hn(t,(e,n,r)=>{this.token(e,t.slice(n,r))})}function Ys(t){const e=new Map;for(let n in t.node){const r=t.node[n];typeof(r.generate||r)=="function"&&e.set(n,r.generate||r)}return function(n,r){let i="",o=0,a={node(c){if(e.has(c.type))e.get(c.type).call(f,c);else throw new Error("Unknown node type: "+c.type)},tokenBefore:dr,token(c,s){o=this.tokenBefore(o,c,s),this.emit(s,c,!1),c===O&&s.charCodeAt(0)===Ws&&this.emit(`
|
|
6
|
+
`,ie,!0)},emit(c){i+=c},result(){return i}};r&&(typeof r.decorator=="function"&&(a=r.decorator(a)),r.sourceMap&&(a=js(a)),r.mode in mr&&(a.tokenBefore=mr[r.mode]));const f={node:c=>a.node(c),children:Ks,token:(c,s)=>a.token(c,s),tokenize:Qs};return a.node(n),a.result()}}function Js(t){this.token(B,"@"+t.name),t.prelude!==null&&this.node(t.prelude),t.block?this.node(t.block):this.token(Ze,";")}function Xs(t){this.children(t)}function Zs(t){this.token(nt,"{"),this.children(t,e=>{e.type==="Declaration"&&this.token(Ze,";")}),this.token(Tt,"}")}function eo(t){this.token(O,"["),this.children(t),this.token(O,"]")}function to(){this.token(se,"-->")}function no(){this.token(Dn,"<!--")}function ro(t){this.token(we,"/*"+t.value+"*/")}function io(t){this.token(k,t.property),this.token(Q,":"),this.node(t.value),t.important&&(this.token(O,"!"),this.token(k,t.important===!0?"important":t.important))}function so(t){this.children(t,e=>{e.type==="Declaration"&&this.token(Ze,";")})}function oo(t){this.token(T,t.value+t.unit)}function ao(t){this.token(I,t.name+"("),this.children(t),this.token(R,")")}function lo(t){this.token(D,"#"+t.value)}function co(t){this.token(be,"("),this.token(k,t.name),t.value!==null&&(this.token(Q,":"),this.node(t.value)),this.token(R,")")}function uo(t){this.children(t)}function ho(t){this.children(t,()=>this.token(et,","))}function fo(t){this.token(L,t.value)}function po(t){this.tokenize(t.value)}function mo(t){this.token(be,"("),this.children(t),this.token(R,")")}function go(t){this.token(L,t.left),this.token(O,"/"),this.token(L,t.right)}function ko(t){this.node(t.prelude),this.node(t.block)}function yo(t){this.children(t)}function So(t){this.tokenize(t.value)}const xo=32,Co=92,bo=34,wo=39,vo=40,Ao=41;function Lo(t){let e="",n=!1;for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);if(i===0){e+="�";continue}if(i<=31||i===127){e+="\\"+i.toString(16),n=!0;continue}i===xo||i===Co||i===bo||i===wo||i===vo||i===Ao?(e+="\\"+t.charAt(r),n=!1):(n&&je(i)&&(e+=" "),e+=t.charAt(r),n=!1)}return"url("+e+")"}function Eo(t){this.token(ne,Lo(t.value))}function _o(t){this.children(t)}function To(t){this.token(ie,t.value)}const Oo=Ys({node:Object.freeze(Object.defineProperty({__proto__:null,AnPlusB:Gi,Atrule:Js,AtrulePrelude:Xs,AttributeSelector:Xi,Block:Zs,Brackets:eo,CDC:to,CDO:no,ClassSelector:ts,Combinator:os,Comment:ro,Declaration:io,DeclarationList:so,Dimension:oo,Function:ao,Hash:lo,IdSelector:us,Identifier:ls,MediaFeature:co,MediaQuery:uo,MediaQueryList:ho,NestingSelector:ps,Nth:ms,Number:fo,Operator:po,Parentheses:mo,Percentage:ks,PseudoClassSelector:Ss,PseudoElementSelector:Cs,Ratio:go,Raw:vs,Rule:ko,Selector:Ls,SelectorList:_s,String:$s,StyleSheet:yo,TypeSelector:Ms,UnicodeRange:So,Url:Eo,Value:_o,WhiteSpace:To},Symbol.toStringTag,{value:"Module"}))}),He=(t,e)=>t.a===e.a?t.b===e.b?t.c-e.c:t.b-e.b:t.a-e.a,gr=(t,e)=>He(t,e)===0,kr=(t,e)=>He(t,e)>0,yr=(t,e)=>He(t,e)<0,Sr=(t,e="ASC")=>{const n=t.sort(He);return e==="DESC"?n.reverse():n},xr=(...t)=>Sr(t,"ASC"),Cr=(...t)=>Sr(t,"DESC"),Xt=(...t)=>Cr(...t)[0],Io=(...t)=>xr(...t)[0];class No{constructor(e,n=null){this.value=e,this.selector=n}get a(){return this.value.a}set a(e){throw new Error("Manipulating the port of the specificity directly is not allowed. Instead, directly set a new value")}get b(){return this.value.b}set b(e){throw new Error("Manipulating the port of the specificity directly is not allowed. Instead, directly set a new value")}get c(){return this.value.c}set c(e){throw new Error("Manipulating the port of the specificity directly is not allowed. Instead, directly set a new value")}selectorString(){return typeof this.selector=="string"||this.selector instanceof String?this.selector:this.selector instanceof Object&&this.selector.type==="Selector"?Oo(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(e){return gr(this,e)}isGreaterThan(e){return kr(this,e)}isLessThan(e){return yr(this,e)}static calculate(e){return $e(e)}static compare(e,n){return He(e,n)}static equals(e,n){return gr(e,n)}static lessThan(e,n){return yr(e,n)}static greaterThan(e,n){return kr(e,n)}static min(...e){return Io(...e)}static max(...e){return Xt(...e)}static sortAsc(...e){return xr(...e)}static sortDesc(...e){return Cr(...e)}}const br=t=>{const e={a:0,b:0,c:0};return t.children.forEach(n=>{switch(n.type){case"IdSelector":e.a+=1;break;case"AttributeSelector":case"ClassSelector":e.b+=1;break;case"PseudoClassSelector":switch(n.name.toLowerCase()){case"where":break;case"is":case"matches":case"-webkit-any":case"-moz-any":case"any":case"not":case"has":if(n.children){const i=Xt(...$e(n.children.first));e.a+=i.a,e.b+=i.b,e.c+=i.c}break;case"nth-child":case"nth-last-child":if(e.b+=1,n.children.first.selector){const i=Xt(...$e(n.children.first.selector));e.a+=i.a,e.b+=i.b,e.c+=i.c}break;case"host-context":case"host":if(e.b+=1,n.children){const i={type:"Selector",children:[]};let o=!1;n.children.first.children.forEach(f=>{if(o)return!1;if(f.type==="Combinator")return o=!0,!1;i.children.push(f)});const a=$e(i)[0];e.a+=a.a,e.b+=a.b,e.c+=a.c}break;case"after":case"before":case"first-letter":case"first-line":e.c+=1;break;default:e.b+=1;break}break;case"PseudoElementSelector":switch(n.name){case"slotted":if(e.c+=1,n.children){const i={type:"Selector",children:[]};let o=!1;n.children.first.children.forEach(f=>{if(o)return!1;if(f.type==="Combinator")return o=!0,!1;i.children.push(f)});const a=$e(i)[0];e.a+=a.a,e.b+=a.b,e.c+=a.c}break;case"view-transition-group":case"view-transition-image-pair":case"view-transition-old":case"view-transition-new":if(n.children&&n.children.first.value==="*")break;e.c+=1;break;default:e.c+=1;break}break;case"TypeSelector":let r=n.name;r.includes("|")&&(r=r.split("|")[1]),r!=="*"&&(e.c+=1);break}}),new No(e,t)},$o=t=>{if(typeof t=="string"||t instanceof String)try{return nr(t,{context:"selectorList"})}catch(e){throw new TypeError(`Could not convert passed in source '${t}' to SelectorList: ${e.message}`)}if(t instanceof Object){if(t.type&&["Selector","SelectorList"].includes(t.type))return t;if(t.type&&t.type==="Raw")try{return nr(t.value,{context:"selectorList"})}catch(e){throw new TypeError(`Could not convert passed in source to SelectorList: ${e.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.")},$e=t=>{if(!t)return[];const e=$o(t);if(e.type==="Selector")return[br(t)];if(e.type==="SelectorList"){const n=[];return e.children.forEach(r=>{const i=br(r);n.push(i)}),n}};function Zt(t,e){return e>=65&&e<=90&&(e=e|32),t===e}function W(t,e){if(t===e)return!0;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(Zt(t.charCodeAt(r),e.charCodeAt(r))===!1)return!1;return!0}function me(t,e){if(t===e)return!0;let n=e.length,r=n-t.length;if(r<0)return!1;for(let i=n-1;i>=r;i--)if(Zt(t.charCodeAt(i-r),e.charCodeAt(i))===!1)return!1;return!0}function en(t,e){if(t===e)return!0;let n=t.length;if(e.length<n)return!1;for(let r=0;r<n;r++)if(Zt(t.charCodeAt(r),e.charCodeAt(r))===!1)return!1;return!0}const Po="Atrule",Do="MediaQuery",Mo="MediaFeature",zo="Rule",tn="Selector",wr="TypeSelector",We="PseudoClassSelector",vr="AttributeSelector",Ar="PseudoElementSelector",nn="Declaration",Fo="Value",fe="Identifier",Ro="Nth",qo="Combinator",Bo="Number",Lr="Dimension",Pe="Operator",jo="Hash",Uo="Url",rn="Function";function Er(t,e,n){let r=t.value.children.first;return W(e,t.property)&&r.type===fe&&W(n,r.name)}function _r(t){let e=!1;return ue(t,function(n){if(n.type===nn&&(Er(n,"-webkit-appearance","none")||Er(n,"-moz-appearance","meterbar")))return e=!0,this.break}),e}function Tr(t){let e=!1;return ue(t,function(n){let r=n.children,i=n.name,o=n.value;if(n.type===Do&&r.size===1&&r.first.type===fe){let a=r.first.name;if(en("\\0",a)||me("\\9 ",a))return e=!0,this.break}else if(n.type===Mo){if(o!==null&&o.unit==="\\0")return e=!0,this.break;if(W("-moz-images-in-menus",i)||W("min--moz-device-pixel-ratio",i)||W("-ms-high-contrast",i))return e=!0,this.break;if(W("min-resolution",i)&&W(".001",o.value)&&W("dpcm",o.unit))return e=!0,this.break;if(W("-webkit-min-device-pixel-ratio",i)){let a=o.value;if(W("0",a)||W("10000",a))return e=!0,this.break}}}),e}const Or=45;function ge(t){return t.charCodeAt(0)===Or&&t.charCodeAt(1)!==Or&&t.indexOf("-",2)!==-1}class oe{constructor(e){this.set=new Set(e)}has(e){return this.set.has(e.toLowerCase())}}function Ir(t,e){let n=[];return ue(t,{visit:tn,enter:function(r){n.push(e(r))}}),n}const Nr=new oe(["nth-child","where","not","is","has","nth-last-child","matches","-webkit-any","-moz-any"]);function sn(t){let e=!1;return ue(t,function(n){if(n.type===vr){let r=n.name.name;if(W("role",r)||en("aria-",r))return e=!0,this.break}else if(n.type===We&&Nr.has(n.name)){let r=Ir(n,sn);for(let i of r)if(i===!0){e=!0;break}return this.skip}}),e}function $r(t){let e=!1;return ue(t,function(n){let r=n.type;if((r===Ar||r===wr||r===We)&&ge(n.name))return e=!0,this.break}),e}function Vo(t){let e=[];return ue(t,function(n){n.type===We&&e.push(n.name)}),e.length===0?!1:e}function on(t){let e=0;return ue(t,function(n){let r=n.type;if(!(r===tn||r===Ro)){if(e++,(r===Ar||r===wr||r===We)&&ge(n.name)&&e++,r===vr)return n.value&&e++,this.skip;if(r===We&&Nr.has(n.name)){let i=Ir(n,on);if(i.length===0)return;for(let o of i)e+=o;return this.skip}}}),e}function Go(t,e){ue(t,function(n,r){if(n.type===qo){let i=n.loc,o=n.name;if(i===null){let a=r.prev.data.loc.end,f={offset:a.offset,line:a.line,column:a.column};e({name:o,loc:{start:f,end:{offset:f.offset+1,line:f.line,column:f.column+1}}})}else e({name:o,loc:i})}})}const Ho=new oe(["white","black","red","gray","silver","grey","green","orange","blue","dimgray","whitesmoke","lightgray","lightgrey","yellow","gold","pink","gainsboro","magenta","purple","darkgray","navy","darkred","teal","maroon","darkgrey","tomato","darkorange","brown","crimson","lightyellow","slategray","salmon","lightgreen","lightblue","orangered","aliceblue","dodgerblue","lime","darkblue","darkgoldenrod","skyblue","royalblue","darkgreen","ivory","olive","aqua","turquoise","cyan","khaki","beige","snow","ghostwhite","limegreen","coral","dimgrey","hotpink","midnightblue","firebrick","indigo","wheat","mediumblue","lightpink","plum","azure","violet","lavender","deepskyblue","darkslategrey","goldenrod","cornflowerblue","lightskyblue","indianred","yellowgreen","saddlebrown","palegreen","bisque","tan","antiquewhite","steelblue","forestgreen","fuchsia","mediumaquamarine","seagreen","sienna","deeppink","mediumseagreen","peru","greenyellow","lightgoldenrodyellow","orchid","cadetblue","navajowhite","lightsteelblue","slategrey","linen","lightseagreen","darkcyan","lightcoral","aquamarine","blueviolet","cornsilk","lightsalmon","chocolate","lightslategray","floralwhite","darkturquoise","darkslategray","rebeccapurple","burlywood","chartreuse","lightcyan","lemonchiffon","palevioletred","darkslateblue","mediumpurple","lawngreen","slateblue","darkseagreen","blanchedalmond","mistyrose","darkolivegreen","seashell","olivedrab","peachpuff","darkviolet","powderblue","darkmagenta","lightslategrey","honeydew","palegoldenrod","darkkhaki","oldlace","mintcream","sandybrown","mediumturquoise","papayawhip","paleturquoise","mediumvioletred","thistle","springgreen","moccasin","rosybrown","lavenderblush","mediumslateblue","darkorchid","mediumorchid","darksalmon","mediumspringgreen"]),Wo=new oe(["accentcolor","accentcolortext","activetext","buttonborder","buttonface","buttontext","canvas","canvastext","field","fieldtext","graytext","highlight","highlighttext","linktext","mark","marktext","selecteditem","selecteditemtext","visitedtext"]),Ko=new oe(["rgba","rgb","hsla","hsl","oklch","color","hwb","lch","lab","oklab"]),Qo=new oe(["transparent","currentcolor"]),kt=new oe(["auto","none","inherit","initial","unset","revert","revert-layer"]);function yt(t){let e=t.children,n=e.size;if(!e||n>1||n===0)return!1;let r=e.first;return r.type===fe&&kt.has(r.name)}const Yo=new oe(["caption","icon","menu","message-box","small-caption","status-bar"]),Jo=new oe(["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","smaller","larger"]),Xo=44,Pr=47;function an(t){let e=t.children.first;return e===null?!1:e.type===fe&&Yo.has(e.name)}function Zo(t,e,n){let r=Array.from({length:2}),i,o;t.children.forEach(function(f,c){let s=c.prev?c.prev.data:void 0,l=c.next?c.next.data:void 0;if(f.type===fe&&kt.has(f.name)&&n({type:"keyword",value:f.name}),l&&l.type===Pe&&l.value.charCodeAt(0)===Pr){i=e(f);return}if(s&&s.type===Pe&&s.value.charCodeAt(0)===Pr){o=e(f);return}if(l&&l.type===Pe&&l.value.charCodeAt(0)===Xo&&!r[0]){r[0]=f,!i&&s&&(i=e(s));return}if(f.type!==Bo){if(c.next===null){r[1]=f,!i&&!r[0]&&s&&(i=e(s));return}if(f.type===fe){let m=f.name;if(Jo.has(m)){i=m;return}}}});let a=r[0]||r[1]?e({loc:{start:{offset:(r[0]||r[1]).loc.start.offset},end:{offset:r[1].loc.end.offset}}}):null;return{font_size:i,line_height:o,font_family:a}}const ea=new oe(["linear","ease","ease-in","ease-out","ease-in-out","step-start","step-end"]),ta=new oe(["cubic-bezier","steps"]);function na(t,e){let n=!1;for(let r of t){let i=r.type,o=r.name;i===Pe?n=!1:i===Lr&&n===!1?(n=!0,e({type:"duration",value:r})):i===fe?ea.has(o)?e({type:"fn",value:r}):kt.has(o)&&e({type:"keyword",value:r}):i===rn&&ta.has(o)&&e({type:"fn",value:r})}}function ln(t){let e=t.children;if(!e)return!1;for(let n of e){let{type:r,name:i}=n;if(r===fe&&ge(i)||r===rn&&(ge(i)||ln(n)))return!0}return!1}class x{constructor(e=!1){this._items=new Map,this._total=0,e&&(this._nodes=[]),this._useLocations=e}p(e,n){let r=this._total;if(this._useLocations){let i=n.start,o=i.offset,a=r*4;this._nodes[a]=i.line,this._nodes[a+1]=i.column,this._nodes[a+2]=o,this._nodes[a+3]=n.end.offset-o}if(this._items.has(e)){this._items.get(e).push(r),this._total++;return}this._items.set(e,[r]),this._total++}size(){return this._total}c(){let e=new Map,n={},r=this._useLocations,i=this._items,o=this._nodes,a=i.size;i.forEach((s,l)=>{if(r){let m=s.map(function(S){let b=S*4;return{line:o[b],column:o[b+1],offset:o[b+2],length:o[b+3]}});e.set(l,m)}else n[l]=s.length});let f=this._total,c={total:f,totalUnique:a,unique:n,uniquenessRatio:f===0?0:a/f};return r&&(c.uniqueWithLocations=Object.fromEntries(e)),c}}class cn{constructor(e){this._list=new x(e),this._contexts=new Map,this._useLocations=e}push(e,n,r){this._list.p(e,r),this._contexts.has(n)||this._contexts.set(n,new x(this._useLocations)),this._contexts.get(n).p(e,r)}count(){let e=new Map;for(let[n,r]of this._contexts.entries())e.set(n,r.c());return Object.assign(this._list.c(),{itemsPerContext:Object.fromEntries(e)})}}function ra(t){let e=new Map,n=-1,r=0,i=0,o=t.length;for(let a=0;a<o;a++){let f=t[a],c=(e.get(f)||0)+1;e.set(f,c),c>n&&(n=c,r=0,i=0),c>=n&&(r++,i+=f)}return i/r}class ae{constructor(){this._items=[],this._sum=0}push(e){this._items.push(e),this._sum+=e}size(){return this._items.length}aggregate(){let e=this._items.length;if(e===0)return{min:0,max:0,mean:0,mode:0,range:0,sum:0};let n=this._items.slice().sort((f,c)=>f-c),r=n[0],i=n[e-1],o=ra(n),a=this._sum;return{min:r,max:i,mean:a/e,mode:o,range:i-r,sum:a}}toArray(){return this._items}}function Dr(t){if(un(t)||ge(t))return!1;let e=t.charCodeAt(0);return e===47||e===42||e===95||e===43||e===38||e===36||e===35}function un(t){return t.length<3?!1:t.charCodeAt(0)===45&&t.charCodeAt(1)===45}function K(t,e){return un(e)?!1:me(t,e)}function ia(t){return ge(t)?t.slice(t.indexOf("-",2)+1):t}function sa(t){let e=5,n=t.indexOf(";"),r=t.indexOf(",");return n===-1||r!==-1&&r<n?t.substring(e,r):t.substring(e,n)}function oa(t){let e=t.children;if(e){let n=e.last;return n&&n.type===fe&&me("\\9",n.name)}return!1}let aa=new oe(["border-radius","border-top-left-radius","border-top-right-radius","border-bottom-right-radius","border-bottom-left-radius","border-start-start-radius","border-start-end-radius","border-end-end-radius","border-end-start-radius"]);function q(t,e){return e===0?0:t/e}let la={useLocations:!1};function ca(t,e={}){let r=Object.assign({},la,e).useLocations===!0,i=Date.now();function o(d){return a(d).trim()}function a(d){let w=d.loc;return t.substring(w.start.offset,w.end.offset)}let f=0,c=0,s=0,l={total:0,unique:new Map},m=Date.now(),S=Re(t,{parseCustomProperty:!0,positions:!0,onComment:function(d){f++,c+=d.length}}),b=Date.now(),X=S.loc.end.line-S.loc.start.line+1,j=0,le=new ae,Ee=[],De=new x(r),Ke=new x(r),Z=new x(r),St=new x(r),xt=new x(r),Ct=new x(r),u=new x(r),h=new x(r),g=new x(r),p=new x(r),ee=new x(r),U=new x(r),xe=0,z=0,Ce=new ae,ke=new ae,fn=new ae,Mr=new x(r),zr=new x(r),Fr=new x(r),pn=new x(r),Rr=new Set,dn=new x(r),_e,Te,qr=new ae,Br=new ae,jr=new ae,Ur=new x(r),bt=new ae,Vr=new x(r),Gr=[],mn=new x(r),gn=new x(r),Hr=new x(r),Wr=new x(r),Kr=new Set,Qe=0,Qr=new ae,wt=0,kn=0,yn=new x(r),Ye=new x(r),Sn=new x(r),xn=new x(r),vt=new x(r),Je=new ae,Cn=new ae,Yr=new x(r),bn=new x(r),Jr=new x(r),Xr=new x(r),Zr=new x(r),wn=new x(r),vn=new x(r),An=new x(r),At=new x(r),Lt=new x(r),Me=new cn(r),ze=new x(r),Ln=new cn(r),ei=new x(r),Xe=new x(r),ti=new cn(r);ue(S,function(d){switch(d.type){case Po:{j++;let w=d.name;if(w==="font-face"){let _={};r&&De.p(d.loc.start.offset,d.loc),d.block.children.forEach(A=>{A.type===nn&&(_[A.property]=o(A.value))}),Ee.push(_),le.push(1);break}let y=1;if(d.prelude!==null){let _=d.prelude,A=_&&o(d.prelude),v=_.loc;if(w==="media")St.p(A,v),Tr(_)&&(xt.p(A,v),y++);else if(w==="supports")u.p(A,v),_r(_)&&(h.p(A,v),y++);else if(me("keyframes",w)){let C="@"+w+" "+A;ge(w)&&(p.p(C,v),y++),g.p(C,v)}else w==="import"?Z.p(A,v):w==="charset"?Ct.p(A,v):w==="container"?ee.p(A,v):w==="layer"?A.split(",").forEach(C=>Ke.p(C.trim(),v)):w==="property"&&U.p(A,v)}else w==="layer"&&(Ke.p("<anonymous>",d.loc),y++);le.push(y);break}case zo:{let w=d.prelude,y=d.block,_=w.children,A=y.children,v=_?_.size:0,C=A?A.size:0;Ce.push(v+C),Mr.p(v+C,d.loc),ke.push(v),zr.p(v,w.loc),fn.push(C),Fr.p(C,y.loc),xe++,C===0&&z++;break}case tn:{let w=o(d);if(this.atrule&&me("keyframes",this.atrule.name))return pn.p(w,d.loc),this.skip;sn(d)&&gn.p(w,d.loc);let y=Vo(d);if(y!==!1)for(let te of y)Hr.p(te,d.loc);let _=on(d);$r(d)&&dn.p(w,d.loc),Rr.add(w),bt.push(_),Vr.p(_,d.loc);let[{value:A}]=$e(d),v=A.a,C=A.b,E=A.c,N=[v,C,E];return Ur.p(v+","+C+","+E,d.loc),qr.push(v),Br.push(C),jr.push(E),_e===void 0&&(_e=N),Te===void 0&&(Te=N),Te!==void 0&&hn(Te,N)<0&&(Te=N),_e!==void 0&&hn(_e,N)>0&&(_e=N),Gr.push(N),v>0&&mn.p(w,d.loc),Go(d,function(ce){Wr.p(ce.name,ce.loc)}),this.skip}case Lr:{if(!this.declaration)break;let w=d.unit;return me("\\9",w)?Ln.push(w.substring(0,w.length-2),this.declaration.property,d.loc):Ln.push(w,this.declaration.property,d.loc),this.skip}case Uo:{if(en("data:",d.value)){let w=d.value,y=w.length,_=sa(w);l.total++,s+=y;let A={line:d.loc.start.line,column:d.loc.start.column,offset:d.loc.start.offset,length:d.loc.end.offset-d.loc.start.offset};if(l.unique.has(_)){let v=l.unique.get(_);v.count++,v.size+=y,l.unique.set(_,v),r&&v.uniqueWithLocations.push(A)}else{let v={count:1,size:y};r&&(v.uniqueWithLocations=[A]),l.unique.set(_,v)}}break}case Fo:{if(yt(d)){Cn.push(1),Xe.p(o(d),d.loc);break}let w=this.declaration,{property:y,important:_}=w,A=1;ln(d)&&(Yr.p(o(d),d.loc),A++),typeof _=="string"&&(bn.p(a(d)+"!"+_,d.loc),A++),oa(d)&&(bn.p(o(d),d.loc),A++);let v=d.children,C=d.loc;if(Cn.push(A),K("z-index",y))return Jr.p(o(d),C),this.skip;if(K("font",y)){if(an(d))return;let{font_size:E,line_height:N,font_family:te}=Zo(d,o,function(ce){ce.type==="keyword"&&Xe.p(ce.value,C)});te&&wn.p(te,C),E&&vn.p(E,C),N&&An.p(N,C);break}else if(K("font-size",y)){an(d)||vn.p(o(d),C);break}else if(K("font-family",y)){an(d)||wn.p(o(d),C);break}else if(K("line-height",y))An.p(o(d),C);else if(K("transition",y)||K("animation",y)){na(v,function(E){E.type==="fn"?At.p(o(E.value),C):E.type==="duration"?Lt.p(o(E.value),C):E.type==="keyword"&&Xe.p(o(E.value),C)});break}else if(K("animation-duration",y)||K("transition-duration",y)){v&&v.size>1?v.forEach(E=>{E.type!==Pe&&Lt.p(o(E),C)}):Lt.p(o(d),C);break}else if(K("transition-timing-function",y)||K("animation-timing-function",y)){v&&v.size>1?v.forEach(E=>{E.type!==Pe&&At.p(o(E),C)}):At.p(o(d),C);break}else if(aa.has(ia(y))){yt(d)||ti.push(o(d),y,C);break}else K("text-shadow",y)?yt(d)||Xr.p(o(d),C):K("box-shadow",y)&&(yt(d)||Zr.p(o(d),C));ue(d,function(E){let N=E.name;switch(E.type){case jo:{let te=E.value.length;return me("\\9",E.value)&&(te=te-2),Me.push("#"+E.value,y,C),ze.p("hex"+te,C),this.skip}case fe:{kt.has(N)&&Xe.p(N,C);let te=N.length;if(te>20||te<3)return this.skip;if(Qo.has(N)){let ce=o(E);Me.push(ce,y,C),ze.p(N.toLowerCase(),C);return}if(Ho.has(N)){let ce=o(E);Me.push(ce,y,C),ze.p("named",C);return}if(Wo.has(N)){let ce=o(E);Me.push(ce,y,C),ze.p("system",C);return}return this.skip}case rn:{if(W("var",N))return this.skip;if(Ko.has(N)){Me.push(o(E),y,E.loc),ze.p(N.toLowerCase(),E.loc);return}if(me("gradient",N)){ei.p(o(E),E.loc);return}}}});break}case nn:{if(this.atrulePrelude!==null)return this.skip;Qe++;let w=1;Kr.add(o(d)),d.important===!0&&(wt++,w++,this.atrule&&me("keyframes",this.atrule.name)&&(kn++,w++)),Qr.push(w);let{property:y,loc:{start:_}}=d,A={start:{line:_.line,column:_.column,offset:_.offset},end:{offset:_.offset+y.length}};Ye.p(y,A),ge(y)?(xn.p(y,A),Je.push(2)):Dr(y)?(Sn.p(y,A),Je.push(2)):un(y)?(vt.p(y,A),Je.push(d.important?3:2),d.important===!0&&yn.p(y,A)):Je.push(1);break}}});let ni=Kr.size,Fe=bt.size(),En=qr.aggregate(),_n=Br.aggregate(),Tn=jr.aggregate(),ri=Rr.size,M=Object.assign,ii=t.length,On=Ee.length,si=le.aggregate(),oi=bt.aggregate(),ai=Qr.aggregate(),li=Je.aggregate(),ci=Cn.aggregate();return{stylesheet:{sourceLinesOfCode:j+Fe+Qe+pn.size(),linesOfCode:X,size:ii,complexity:si.sum+oi.sum+ai.sum+li.sum+ci.sum,comments:{total:f,size:c},embeddedContent:{size:{total:s,ratio:q(s,ii)},types:{total:l.total,totalUnique:l.unique.size,uniquenessRatio:q(l.unique.size,l.total),unique:Object.fromEntries(l.unique)}}},atrules:{fontface:M({total:On,totalUnique:On,unique:Ee,uniquenessRatio:On===0?0:1},r?{uniqueWithLocations:De.c().uniqueWithLocations}:{}),import:Z.c(),media:M(St.c(),{browserhacks:xt.c()}),charset:Ct.c(),supports:M(u.c(),{browserhacks:h.c()}),keyframes:M(g.c(),{prefixed:M(p.c(),{ratio:q(p.size(),g.size())})}),container:ee.c(),layer:Ke.c(),property:U.c(),total:j,complexity:si},rules:{total:xe,empty:{total:z,ratio:q(z,xe)},sizes:M(Ce.aggregate(),{items:Ce.toArray()},Mr.c()),selectors:M(ke.aggregate(),{items:ke.toArray()},zr.c()),declarations:M(fn.aggregate(),{items:fn.toArray()},Fr.c())},selectors:{total:Fe,totalUnique:ri,uniquenessRatio:q(ri,Fe),specificity:M({min:Te===void 0?[0,0,0]:Te,max:_e===void 0?[0,0,0]:_e,sum:[En.sum,_n.sum,Tn.sum],mean:[En.mean,_n.mean,Tn.mean],mode:[En.mode,_n.mode,Tn.mode],items:Gr},Ur.c()),complexity:M(oi,Vr.c(),{items:bt.toArray()}),id:M(mn.c(),{ratio:q(mn.size(),Fe)}),pseudoClasses:Hr.c(),accessibility:M(gn.c(),{ratio:q(gn.size(),Fe)}),keyframes:pn.c(),prefixed:M(dn.c(),{ratio:q(dn.size(),Fe)}),combinators:Wr.c()},declarations:{total:Qe,totalUnique:ni,uniquenessRatio:q(ni,Qe),importants:{total:wt,ratio:q(wt,Qe),inKeyframes:{total:kn,ratio:q(kn,wt)}},complexity:ai},properties:M(Ye.c(),{prefixed:M(xn.c(),{ratio:q(xn.size(),Ye.size())}),custom:M(vt.c(),{ratio:q(vt.size(),Ye.size()),importants:M(yn.c(),{ratio:q(yn.size(),vt.size())})}),browserhacks:M(Sn.c(),{ratio:q(Sn.size(),Ye.size())}),complexity:li}),values:{colors:M(Me.count(),{formats:ze.c()}),gradients:ei.c(),fontFamilies:wn.c(),fontSizes:vn.c(),lineHeights:An.c(),zindexes:Jr.c(),textShadows:Xr.c(),boxShadows:Zr.c(),borderRadiuses:ti.count(),animations:{durations:Lt.c(),timingFunctions:At.c()},prefixes:Yr.c(),browserhacks:bn.c(),units:Ln.count(),complexity:ci,keywords:Xe.c()},__meta__:{parseTime:b-m,analyzeTime:Date.now()-b,total:Date.now()-i}}}function hn(t,e){return t[0]===e[0]?t[1]===e[1]?e[2]-t[2]:e[1]-t[1]:e[0]-t[0]}F.analyze=ca,F.compareSpecificity=hn,F.hasVendorPrefix=ge,F.isAccessibilitySelector=sn,F.isMediaBrowserhack=Tr,F.isPropertyHack=Dr,F.isSelectorPrefixed=$r,F.isSupportsBrowserhack=_r,F.isValuePrefixed=ln,F.selectorComplexity=on,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})});
|