Files
railtrack-pro/node_modules/@bramus/specificity/dist/index.cjs
T

9 lines
52 KiB
JavaScript
Raw Normal View History

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
`,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&
`)}})}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="parseCustomPropert
//# sourceMappingURL=index.cjs.map