"use strict";exports.id=769,exports.ids=[769],exports.modules={3815:(e,t,n)=>{var i;n.r(t),n.d(t,{ClientCapabilities:()=>Dt,CodeAction:()=>Mt.gY,CodeActionContext:()=>Mt.nb,CodeActionKind:()=>Mt.gB,Color:()=>Mt.Q1,ColorInformation:()=>Mt.Ox,ColorPresentation:()=>Mt.U$,Command:()=>Mt.uB,CompletionItem:()=>Mt.EB,CompletionItemKind:()=>Mt.Io,CompletionItemTag:()=>Mt.QP,CompletionList:()=>Mt.$e,Diagnostic:()=>Mt.oQ,DiagnosticSeverity:()=>Mt.h_,DocumentHighlight:()=>Mt.kp,DocumentHighlightKind:()=>Mt.Kb,DocumentLink:()=>Mt.dc,DocumentSymbol:()=>Mt.Az,DocumentUri:()=>Mt.Uc,FileType:()=>Ft,FoldingRange:()=>Mt.LM,FoldingRangeKind:()=>Mt.lO,Hover:()=>Mt.tU,InsertTextFormat:()=>Mt.q8,Location:()=>Mt.aZ,MarkedString:()=>Mt.aM,MarkupContent:()=>Mt.sQ,MarkupKind:()=>Mt.nw,Position:()=>Mt.yX,Range:()=>Mt.Q6,SelectionRange:()=>Mt.yn,SymbolInformation:()=>Mt.NI,SymbolKind:()=>Mt.v0,TextDocument:()=>It.TextDocument,TextDocumentEdit:()=>Mt.d3,TextEdit:()=>Mt.mF,VersionedTextDocumentIdentifier:()=>Mt.Fr,WorkspaceEdit:()=>Mt.Q2,getCSSLanguageService:()=>jr,getDefaultCSSDataProvider:()=>Wr,getLESSLanguageService:()=>Vr,getSCSSLanguageService:()=>$r,newCSSDataProvider:()=>qr}),function(e){e[e.Ident=0]="Ident",e[e.AtKeyword=1]="AtKeyword",e[e.String=2]="String",e[e.BadString=3]="BadString",e[e.UnquotedString=4]="UnquotedString",e[e.Hash=5]="Hash",e[e.Num=6]="Num",e[e.Percentage=7]="Percentage",e[e.Dimension=8]="Dimension",e[e.UnicodeRange=9]="UnicodeRange",e[e.CDO=10]="CDO",e[e.CDC=11]="CDC",e[e.Colon=12]="Colon",e[e.SemiColon=13]="SemiColon",e[e.CurlyL=14]="CurlyL",e[e.CurlyR=15]="CurlyR",e[e.ParenthesisL=16]="ParenthesisL",e[e.ParenthesisR=17]="ParenthesisR",e[e.BracketL=18]="BracketL",e[e.BracketR=19]="BracketR",e[e.Whitespace=20]="Whitespace",e[e.Includes=21]="Includes",e[e.Dashmatch=22]="Dashmatch",e[e.SubstringOperator=23]="SubstringOperator",e[e.PrefixOperator=24]="PrefixOperator",e[e.SuffixOperator=25]="SuffixOperator",e[e.Delim=26]="Delim",e[e.EMS=27]="EMS",e[e.EXS=28]="EXS",e[e.Length=29]="Length",e[e.Angle=30]="Angle",e[e.Time=31]="Time",e[e.Freq=32]="Freq",e[e.Exclamation=33]="Exclamation",e[e.Resolution=34]="Resolution",e[e.Comma=35]="Comma",e[e.Charset=36]="Charset",e[e.EscapedJavaScript=37]="EscapedJavaScript",e[e.BadEscapedJavaScript=38]="BadEscapedJavaScript",e[e.Comment=39]="Comment",e[e.SingleLineComment=40]="SingleLineComment",e[e.EOF=41]="EOF",e[e.ContainerQueryLength=42]="ContainerQueryLength",e[e.CustomToken=43]="CustomToken"}(i||(i={}));class r{constructor(e){this.source=e,this.len=e.length,this.position=0}substring(e,t=this.position){return this.source.substring(e,t)}eos(){return this.len<=this.position}pos(){return this.position}goBackTo(e){this.position=e}goBack(e){this.position-=e}advance(e){this.position+=e}nextChar(){return this.source.charCodeAt(this.position++)||0}peekChar(e=0){return this.source.charCodeAt(this.position+e)||0}lookbackChar(e=0){return this.source.charCodeAt(this.position-e)||0}advanceIfChar(e){return e===this.source.charCodeAt(this.position)&&(this.position++,!0)}advanceIfChars(e){if(this.position+e.length>this.source.length)return!1;let t=0;for(;t".charCodeAt(0),C="@".charCodeAt(0),T="#".charCodeAt(0),E="$".charCodeAt(0),R="\\".charCodeAt(0),D="/".charCodeAt(0),F="\n".charCodeAt(0),M="\r".charCodeAt(0),I="\f".charCodeAt(0),z='"'.charCodeAt(0),O="'".charCodeAt(0),P=" ".charCodeAt(0),A="\t".charCodeAt(0),N=";".charCodeAt(0),L=":".charCodeAt(0),W="{".charCodeAt(0),q="}".charCodeAt(0),U="[".charCodeAt(0),H="]".charCodeAt(0),j=",".charCodeAt(0),$=".".charCodeAt(0),V="!".charCodeAt(0),B="?".charCodeAt(0),G="+".charCodeAt(0),K={};K[N]=i.SemiColon,K[L]=i.Colon,K[W]=i.CurlyL,K[q]=i.CurlyR,K[H]=i.BracketR,K[U]=i.BracketL,K[_]=i.ParenthesisL,K[S]=i.ParenthesisR,K[j]=i.Comma;const J={};J.em=i.EMS,J.ex=i.EXS,J.px=i.Length,J.cm=i.Length,J.mm=i.Length,J.in=i.Length,J.pt=i.Length,J.pc=i.Length,J.deg=i.Angle,J.rad=i.Angle,J.grad=i.Angle,J.ms=i.Time,J.s=i.Time,J.hz=i.Freq,J.khz=i.Freq,J["%"]=i.Percentage,J.fr=i.Percentage,J.dpi=i.Resolution,J.dpcm=i.Resolution,J.cqw=i.ContainerQueryLength,J.cqh=i.ContainerQueryLength,J.cqi=i.ContainerQueryLength,J.cqb=i.ContainerQueryLength,J.cqmin=i.ContainerQueryLength,J.cqmax=i.ContainerQueryLength;class X{constructor(){this.stream=new r(""),this.ignoreComment=!0,this.ignoreWhitespace=!0,this.inURL=!1}setSource(e){this.stream=new r(e)}finishToken(e,t,n){return{offset:e,len:this.stream.pos()-e,type:t,text:n||this.stream.substring(e)}}substring(e,t){return this.stream.substring(e,e+t)}pos(){return this.stream.pos()}goBackTo(e){this.stream.goBackTo(e)}scanUnquotedString(){const e=this.stream.pos(),t=[];return this._unquotedString(t)?this.finishToken(e,i.UnquotedString,t.join("")):null}scan(){const e=this.trivia();if(null!==e)return e;const t=this.stream.pos();return this.stream.eos()?this.finishToken(t,i.EOF):this.scanNext(t)}tryScanUnicode(){const e=this.stream.pos();if(!this.stream.eos()&&this._unicodeRange())return this.finishToken(e,i.UnicodeRange);this.stream.goBackTo(e)}scanNext(e){if(this.stream.advanceIfChars([x,V,b,b]))return this.finishToken(e,i.CDO);if(this.stream.advanceIfChars([b,b,k]))return this.finishToken(e,i.CDC);let t=[];if(this.ident(t))return this.finishToken(e,i.Ident,t.join(""));if(this.stream.advanceIfChar(C)){if(t=["@"],this._name(t)){const n=t.join("");return"@charset"===n?this.finishToken(e,i.Charset,n):this.finishToken(e,i.AtKeyword,n)}return this.finishToken(e,i.Delim)}if(this.stream.advanceIfChar(T))return t=["#"],this._name(t)?this.finishToken(e,i.Hash,t.join("")):this.finishToken(e,i.Delim);if(this.stream.advanceIfChar(V))return this.finishToken(e,i.Exclamation);if(this._number()){const n=this.stream.pos();if(t=[this.stream.substring(e,n)],this.stream.advanceIfChar(w))return this.finishToken(e,i.Percentage);if(this.ident(t)){const r=this.stream.substring(n).toLowerCase(),o=J[r];return void 0!==o?this.finishToken(e,o,t.join("")):this.finishToken(e,i.Dimension,t.join(""))}return this.finishToken(e,i.Num)}t=[];let n=this._string(t);return null!==n?this.finishToken(e,n,t.join("")):(n=K[this.stream.peekChar()],void 0!==n?(this.stream.advance(1),this.finishToken(e,n)):this.stream.peekChar(0)===u&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,i.Includes)):this.stream.peekChar(0)===g&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,i.Dashmatch)):this.stream.peekChar(0)===y&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,i.SubstringOperator)):this.stream.peekChar(0)===m&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,i.PrefixOperator)):this.stream.peekChar(0)===E&&this.stream.peekChar(1)===f?(this.stream.advance(2),this.finishToken(e,i.SuffixOperator)):(this.stream.nextChar(),this.finishToken(e,i.Delim)))}trivia(){for(;;){const e=this.stream.pos();if(this._whitespace()){if(!this.ignoreWhitespace)return this.finishToken(e,i.Whitespace)}else{if(!this.comment())return null;if(!this.ignoreComment)return this.finishToken(e,i.Comment)}}}comment(){if(this.stream.advanceIfChars([D,y])){let e=!1,t=!1;return this.stream.advanceWhileChar((n=>t&&n===D?(e=!0,!1):(t=n===y,!0))),e&&this.stream.advance(1),!0}return!1}_number(){let e,t=0;return this.stream.peekChar()===$&&(t=1),e=this.stream.peekChar(t),e>=h&&e<=p&&(this.stream.advance(t+1),this.stream.advanceWhileChar((e=>e>=h&&e<=p||0===t&&e===$)),!0)}_newline(e){const t=this.stream.peekChar();switch(t){case M:case I:case F:return this.stream.advance(1),e.push(String.fromCharCode(t)),t===M&&this.stream.advanceIfChar(F)&&e.push("\n"),!0}return!1}_escape(e,t){let n=this.stream.peekChar();if(n===R){this.stream.advance(1),n=this.stream.peekChar();let i=0;for(;i<6&&(n>=h&&n<=p||n>=o&&n<=s||n>=l&&n<=c);)this.stream.advance(1),n=this.stream.peekChar(),i++;if(i>0){try{const t=parseInt(this.stream.substring(this.stream.pos()-i),16);t&&e.push(String.fromCharCode(t))}catch(e){}return n===P||n===A?this.stream.advance(1):this._newline([]),!0}if(n!==M&&n!==I&&n!==F)return this.stream.advance(1),e.push(String.fromCharCode(n)),!0;if(t)return this._newline(e)}return!1}_stringChar(e,t){const n=this.stream.peekChar();return 0!==n&&n!==e&&n!==R&&n!==M&&n!==I&&n!==F&&(this.stream.advance(1),t.push(String.fromCharCode(n)),!0)}_string(e){if(this.stream.peekChar()===O||this.stream.peekChar()===z){const t=this.stream.nextChar();for(e.push(String.fromCharCode(t));this._stringChar(t,e)||this._escape(e,!0););return this.stream.peekChar()===t?(this.stream.nextChar(),e.push(String.fromCharCode(t)),i.String):i.BadString}return null}_unquotedChar(e){const t=this.stream.peekChar();return 0!==t&&t!==R&&t!==O&&t!==z&&t!==_&&t!==S&&t!==P&&t!==A&&t!==F&&t!==I&&t!==M&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_unquotedString(e){let t=!1;for(;this._unquotedChar(e)||this._escape(e);)t=!0;return t}_whitespace(){return this.stream.advanceWhileChar((e=>e===P||e===A||e===F||e===I||e===M))>0}_name(e){let t=!1;for(;this._identChar(e)||this._escape(e);)t=!0;return t}ident(e){const t=this.stream.pos();if(this._minus(e)){if(this._minus(e)||this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}}else if(this._identFirstChar(e)||this._escape(e)){for(;this._identChar(e)||this._escape(e););return!0}return this.stream.goBackTo(t),!1}_identFirstChar(e){const t=this.stream.peekChar();return(t===v||t>=o&&t<=a||t>=l&&t<=d||t>=128&&t<=65535)&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_minus(e){const t=this.stream.peekChar();return t===b&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_identChar(e){const t=this.stream.peekChar();return(t===v||t===b||t>=o&&t<=a||t>=l&&t<=d||t>=h&&t<=p||t>=128&&t<=65535)&&(this.stream.advance(1),e.push(String.fromCharCode(t)),!0)}_unicodeRange(){if(this.stream.advanceIfChar(G)){const e=e=>e>=h&&e<=p||e>=o&&e<=s||e>=l&&e<=c,t=this.stream.advanceWhileChar(e)+this.stream.advanceWhileChar((e=>e===B));if(t>=1&&t<=6){if(!this.stream.advanceIfChar(b))return!0;{const t=this.stream.advanceWhileChar(e);if(t>=1&&t<=6)return!0}}}return!1}}function Q(e,t){if(e.length0?e.lastIndexOf(t)===n:0===n&&e===t}function Z(e,t=!0){return e?e.length<140?e:e.slice(0,140)+(t?"…":""):""}function ee(e,t){let n="";for(;t>0;)1&~t||(n+=e),e+=e,t>>>=1;return n}var te,ne;function ie(e,t){let n=null;return!e||te.end?null:(e.accept((e=>-1===e.offset&&-1===e.length||e.offset<=t&&e.end>=t&&(n?e.length<=n.length&&(n=e):n=e,!0))),n)}function re(e,t){let n=ie(e,t);const i=[];for(;n;)i.unshift(n),n=n.parent;return i}!function(e){e[e.Undefined=0]="Undefined",e[e.Identifier=1]="Identifier",e[e.Stylesheet=2]="Stylesheet",e[e.Ruleset=3]="Ruleset",e[e.Selector=4]="Selector",e[e.SimpleSelector=5]="SimpleSelector",e[e.SelectorInterpolation=6]="SelectorInterpolation",e[e.SelectorCombinator=7]="SelectorCombinator",e[e.SelectorCombinatorParent=8]="SelectorCombinatorParent",e[e.SelectorCombinatorSibling=9]="SelectorCombinatorSibling",e[e.SelectorCombinatorAllSiblings=10]="SelectorCombinatorAllSiblings",e[e.SelectorCombinatorShadowPiercingDescendant=11]="SelectorCombinatorShadowPiercingDescendant",e[e.Page=12]="Page",e[e.PageBoxMarginBox=13]="PageBoxMarginBox",e[e.ClassSelector=14]="ClassSelector",e[e.IdentifierSelector=15]="IdentifierSelector",e[e.ElementNameSelector=16]="ElementNameSelector",e[e.PseudoSelector=17]="PseudoSelector",e[e.AttributeSelector=18]="AttributeSelector",e[e.Declaration=19]="Declaration",e[e.Declarations=20]="Declarations",e[e.Property=21]="Property",e[e.Expression=22]="Expression",e[e.BinaryExpression=23]="BinaryExpression",e[e.Term=24]="Term",e[e.Operator=25]="Operator",e[e.Value=26]="Value",e[e.StringLiteral=27]="StringLiteral",e[e.URILiteral=28]="URILiteral",e[e.EscapedValue=29]="EscapedValue",e[e.Function=30]="Function",e[e.NumericValue=31]="NumericValue",e[e.HexColorValue=32]="HexColorValue",e[e.RatioValue=33]="RatioValue",e[e.MixinDeclaration=34]="MixinDeclaration",e[e.MixinReference=35]="MixinReference",e[e.VariableName=36]="VariableName",e[e.VariableDeclaration=37]="VariableDeclaration",e[e.Prio=38]="Prio",e[e.Interpolation=39]="Interpolation",e[e.NestedProperties=40]="NestedProperties",e[e.ExtendsReference=41]="ExtendsReference",e[e.SelectorPlaceholder=42]="SelectorPlaceholder",e[e.Debug=43]="Debug",e[e.If=44]="If",e[e.Else=45]="Else",e[e.For=46]="For",e[e.Each=47]="Each",e[e.While=48]="While",e[e.MixinContentReference=49]="MixinContentReference",e[e.MixinContentDeclaration=50]="MixinContentDeclaration",e[e.Media=51]="Media",e[e.Keyframe=52]="Keyframe",e[e.FontFace=53]="FontFace",e[e.Import=54]="Import",e[e.Namespace=55]="Namespace",e[e.Invocation=56]="Invocation",e[e.FunctionDeclaration=57]="FunctionDeclaration",e[e.ReturnStatement=58]="ReturnStatement",e[e.MediaQuery=59]="MediaQuery",e[e.MediaCondition=60]="MediaCondition",e[e.MediaFeature=61]="MediaFeature",e[e.FunctionParameter=62]="FunctionParameter",e[e.FunctionArgument=63]="FunctionArgument",e[e.KeyframeSelector=64]="KeyframeSelector",e[e.ViewPort=65]="ViewPort",e[e.Document=66]="Document",e[e.AtApplyRule=67]="AtApplyRule",e[e.CustomPropertyDeclaration=68]="CustomPropertyDeclaration",e[e.CustomPropertySet=69]="CustomPropertySet",e[e.ListEntry=70]="ListEntry",e[e.Supports=71]="Supports",e[e.SupportsCondition=72]="SupportsCondition",e[e.NamespacePrefix=73]="NamespacePrefix",e[e.GridLine=74]="GridLine",e[e.Plugin=75]="Plugin",e[e.UnknownAtRule=76]="UnknownAtRule",e[e.Use=77]="Use",e[e.ModuleConfiguration=78]="ModuleConfiguration",e[e.Forward=79]="Forward",e[e.ForwardVisibility=80]="ForwardVisibility",e[e.Module=81]="Module",e[e.UnicodeRange=82]="UnicodeRange",e[e.Layer=83]="Layer",e[e.LayerNameList=84]="LayerNameList",e[e.LayerName=85]="LayerName",e[e.PropertyAtRule=86]="PropertyAtRule",e[e.Container=87]="Container",e[e.ModuleConfig=88]="ModuleConfig"}(te||(te={})),function(e){e[e.Mixin=0]="Mixin",e[e.Rule=1]="Rule",e[e.Variable=2]="Variable",e[e.Function=3]="Function",e[e.Keyframe=4]="Keyframe",e[e.Unknown=5]="Unknown",e[e.Module=6]="Module",e[e.Forward=7]="Forward",e[e.ForwardVisibility=8]="ForwardVisibility",e[e.Property=9]="Property"}(ne||(ne={}));class oe{get end(){return this.offset+this.length}constructor(e=-1,t=-1,n){this.parent=null,this.offset=e,this.length=t,n&&(this.nodeType=n)}set type(e){this.nodeType=e}get type(){return this.nodeType||te.Undefined}getTextProvider(){let e=this;for(;e&&!e.textProvider;)e=e.parent;return e?e.textProvider:()=>"unknown"}getText(){return this.getTextProvider()(this.offset,this.length)}matches(e){return this.length===e.length&&this.getTextProvider()(this.offset,this.length)===e}startsWith(e){return this.length>=e.length&&this.getTextProvider()(this.offset,e.length)===e}endsWith(e){return this.length>=e.length&&this.getTextProvider()(this.end-e.length,e.length)===e}accept(e){if(e(this)&&this.children)for(const t of this.children)t.accept(e)}acceptVisitor(e){this.accept(e.visitNode.bind(e))}adoptChild(e,t=-1){if(e.parent&&e.parent.children){const t=e.parent.children.indexOf(e);t>=0&&e.parent.children.splice(t,1)}e.parent=this;let n=this.children;return n||(n=this.children=[]),-1!==t?n.splice(t,0,e):n.push(e),e}attachTo(e,t=-1){return e&&e.adoptChild(this,t),this}collectIssues(e){this.issues&&e.push.apply(e,this.issues)}addIssue(e){this.issues||(this.issues=[]),this.issues.push(e)}hasIssue(e){return Array.isArray(this.issues)&&this.issues.some((t=>t.getRule()===e))}isErroneous(e=!1){return!!(this.issues&&this.issues.length>0)||e&&Array.isArray(this.children)&&this.children.some((e=>e.isErroneous(!0)))}setNode(e,t,n=-1){return!!t&&(t.attachTo(this,n),this[e]=t,!0)}addChild(e){return!!e&&(this.children||(this.children=[]),e.attachTo(this),this.updateOffsetAndLength(e),!0)}updateOffsetAndLength(e){(e.offsetthis.end||-1===this.length)&&(this.length=t-this.offset)}hasChildren(){return!!this.children&&this.children.length>0}getChildren(){return this.children?this.children.slice(0):[]}getChild(e){return this.children&&e=0;n--)if(t=this.children[n],t.offset<=e)return t}return null}findChildAtOffset(e,t){const n=this.findFirstChildBeforeOffset(e);return n&&n.end>=e?t&&n.findChildAtOffset(e,!0)||n:null}encloses(e){return this.offset<=e.offset&&this.offset+this.length>=e.offset+e.length}getParent(){let e=this.parent;for(;e instanceof se;)e=e.parent;return e}findParent(e){let t=this;for(;t&&t.type!==e;)t=t.parent;return t}findAParent(...e){let t=this;for(;t&&!e.some((e=>t.type===e));)t=t.parent;return t}setData(e,t){this.options||(this.options={}),this.options[e]=t}getData(e){return this.options&&this.options.hasOwnProperty(e)?this.options[e]:null}}class se extends oe{constructor(e,t=-1){super(-1,-1),this.attachTo(e,t),this.offset=-1,this.length=-1}}class ae extends oe{constructor(e,t){super(e,t)}get type(){return te.UnicodeRange}setRangeStart(e){return this.setNode("rangeStart",e)}getRangeStart(){return this.rangeStart}setRangeEnd(e){return this.setNode("rangeEnd",e)}getRangeEnd(){return this.rangeEnd}}class le extends oe{constructor(e,t){super(e,t),this.isCustomProperty=!1}get type(){return te.Identifier}containsInterpolation(){return this.hasChildren()}}class ce extends oe{constructor(e,t){super(e,t)}get type(){return te.Stylesheet}}class de extends oe{constructor(e,t){super(e,t)}get type(){return te.Declarations}}class he extends oe{constructor(e,t){super(e,t)}getDeclarations(){return this.declarations}setDeclarations(e){return this.setNode("declarations",e)}}class pe extends he{constructor(e,t){super(e,t)}get type(){return te.Ruleset}getSelectors(){return this.selectors||(this.selectors=new se(this)),this.selectors}isNested(){return!!this.parent&&null!==this.parent.findParent(te.Declarations)}}class ue extends oe{constructor(e,t){super(e,t)}get type(){return te.Selector}}class me extends oe{constructor(e,t){super(e,t)}get type(){return te.SimpleSelector}}class fe extends oe{constructor(e,t){super(e,t)}}class ge extends he{constructor(e,t){super(e,t)}get type(){return te.CustomPropertySet}}class be extends fe{constructor(e,t){super(e,t),this.property=null}get type(){return te.Declaration}setProperty(e){return this.setNode("property",e)}getProperty(){return this.property}getFullPropertyName(){const e=this.property?this.property.getName():"unknown";if(this.parent instanceof de&&this.parent.getParent()instanceof Ie){const t=this.parent.getParent().getParent();if(t instanceof be)return t.getFullPropertyName()+e}return e}getNonPrefixedPropertyName(){const e=this.getFullPropertyName();if(e&&"-"===e.charAt(0)){const t=e.indexOf("-",1);if(-1!==t)return e.substring(t+1)}return e}setValue(e){return this.setNode("value",e)}getValue(){return this.value}setNestedProperties(e){return this.setNode("nestedProperties",e)}getNestedProperties(){return this.nestedProperties}}class ve extends be{constructor(e,t){super(e,t)}get type(){return te.CustomPropertyDeclaration}setPropertySet(e){return this.setNode("propertySet",e)}getPropertySet(){return this.propertySet}}class we extends oe{constructor(e,t){super(e,t)}get type(){return te.Property}setIdentifier(e){return this.setNode("identifier",e)}getIdentifier(){return this.identifier}getName(){return function(e,t){const n=/[_\+]+$/.exec(e);return n&&n[0].length?e.substr(0,e.length-n[0].length):e}(this.getText())}isCustomProperty(){return!!this.identifier&&this.identifier.isCustomProperty}}class ye extends oe{constructor(e,t){super(e,t)}get type(){return te.Invocation}getArguments(){return this.arguments||(this.arguments=new se(this)),this.arguments}}class _e extends ye{constructor(e,t){super(e,t)}get type(){return te.Function}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}}class Se extends oe{constructor(e,t){super(e,t)}get type(){return te.FunctionParameter}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setDefaultValue(e){return this.setNode("defaultValue",e,0)}getDefaultValue(){return this.defaultValue}}class xe extends oe{constructor(e,t){super(e,t)}get type(){return te.FunctionArgument}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setValue(e){return this.setNode("value",e,0)}getValue(){return this.value}}class ke extends he{constructor(e,t){super(e,t)}get type(){return te.If}setExpression(e){return this.setNode("expression",e,0)}setElseClause(e){return this.setNode("elseClause",e)}}class Ce extends he{constructor(e,t){super(e,t)}get type(){return te.For}setVariable(e){return this.setNode("variable",e,0)}}class Te extends he{constructor(e,t){super(e,t)}get type(){return te.Each}getVariables(){return this.variables||(this.variables=new se(this)),this.variables}}class Ee extends he{constructor(e,t){super(e,t)}get type(){return te.While}}class Re extends he{constructor(e,t){super(e,t)}get type(){return te.Else}}class De extends he{constructor(e,t){super(e,t)}get type(){return te.FunctionDeclaration}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}getParameters(){return this.parameters||(this.parameters=new se(this)),this.parameters}}class Fe extends he{constructor(e,t){super(e,t)}get type(){return te.ViewPort}}class Me extends he{constructor(e,t){super(e,t)}get type(){return te.FontFace}}class Ie extends he{constructor(e,t){super(e,t)}get type(){return te.NestedProperties}}class ze extends he{constructor(e,t){super(e,t)}get type(){return te.Keyframe}setKeyword(e){return this.setNode("keyword",e,0)}getKeyword(){return this.keyword}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}}class Oe extends he{constructor(e,t){super(e,t)}get type(){return te.KeyframeSelector}}class Pe extends oe{constructor(e,t){super(e,t)}get type(){return te.Import}setMedialist(e){return!!e&&(e.attachTo(this),!0)}}class Ae extends oe{get type(){return te.Use}setParameters(e){return this.setNode("parameters",e)}getParameters(){return this.parameters}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}}class Ne extends oe{get type(){return te.ModuleConfiguration}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}getName(){return this.identifier?this.identifier.getText():""}setValue(e){return this.setNode("value",e,0)}getValue(){return this.value}}class Le extends oe{get type(){return te.Forward}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}setParameters(e){return this.setNode("parameters",e)}getParameters(){return this.parameters}}class We extends oe{get type(){return te.ForwardVisibility}setIdentifier(e){return this.setNode("identifier",e,0)}getIdentifier(){return this.identifier}}class qe extends oe{constructor(e,t){super(e,t)}get type(){return te.Namespace}}class Ue extends he{constructor(e,t){super(e,t)}get type(){return te.Media}}class He extends he{constructor(e,t){super(e,t)}get type(){return te.Supports}}class je extends he{constructor(e,t){super(e,t)}get type(){return te.Layer}setNames(e){return this.setNode("names",e)}getNames(){return this.names}}class $e extends he{constructor(e,t){super(e,t)}get type(){return te.PropertyAtRule}setName(e){return!!e&&(e.attachTo(this),this.name=e,!0)}getName(){return this.name}}class Ve extends he{constructor(e,t){super(e,t)}get type(){return te.Document}}class Be extends he{constructor(e,t){super(e,t)}get type(){return te.Container}}class Ge extends oe{constructor(e,t){super(e,t)}}class Ke extends oe{constructor(e,t){super(e,t)}get type(){return te.MediaQuery}}class Je extends oe{constructor(e,t){super(e,t)}get type(){return te.MediaCondition}}class Xe extends oe{constructor(e,t){super(e,t)}get type(){return te.MediaFeature}}class Qe extends oe{constructor(e,t){super(e,t)}get type(){return te.SupportsCondition}}class Ye extends he{constructor(e,t){super(e,t)}get type(){return te.Page}}class Ze extends he{constructor(e,t){super(e,t)}get type(){return te.PageBoxMarginBox}}class et extends oe{constructor(e,t){super(e,t)}get type(){return te.Expression}}class tt extends oe{constructor(e,t){super(e,t)}get type(){return te.BinaryExpression}setLeft(e){return this.setNode("left",e)}getLeft(){return this.left}setRight(e){return this.setNode("right",e)}getRight(){return this.right}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}}class nt extends oe{constructor(e,t){super(e,t)}get type(){return te.Term}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}setExpression(e){return this.setNode("expression",e)}getExpression(){return this.expression}}class it extends oe{constructor(e,t){super(e,t)}get type(){return te.AttributeSelector}setNamespacePrefix(e){return this.setNode("namespacePrefix",e)}getNamespacePrefix(){return this.namespacePrefix}setIdentifier(e){return this.setNode("identifier",e)}getIdentifier(){return this.identifier}setOperator(e){return this.setNode("operator",e)}getOperator(){return this.operator}setValue(e){return this.setNode("value",e)}getValue(){return this.value}}class rt extends oe{constructor(e,t){super(e,t)}get type(){return te.HexColorValue}}class ot extends oe{constructor(e,t){super(e,t)}get type(){return te.RatioValue}}const st=".".charCodeAt(0),at="0".charCodeAt(0),lt="9".charCodeAt(0);class ct extends oe{constructor(e,t){super(e,t)}get type(){return te.NumericValue}getValue(){const e=this.getText();let t,n=0;for(let i=0,r=e.length;i/g,">")}function Nt(e,t){if(!e.description||""===e.description)return"";if("string"!=typeof e.description)return e.description.value;let n="";if(!1!==t?.documentation){e.status&&(n+=Ot(e.status)),n+=e.description;const t=Wt(e.browsers);t&&(n+="\n("+t+")"),"syntax"in e&&(n+=`\n\nSyntax: ${e.syntax}`)}return e.references&&e.references.length>0&&!1!==t?.references&&(n.length>0&&(n+="\n\n"),n+=e.references.map((e=>`${e.name}: ${e.url}`)).join(" | ")),n}function Lt(e,t){if(!e.description||""===e.description)return"";let n="";if(!1!==t?.documentation){e.status&&(n+=Ot(e.status)),"string"==typeof e.description?n+=At(e.description):n+=e.description.kind===Mt.nw.Markdown?e.description.value:At(e.description.value);const t=Wt(e.browsers);t&&(n+="\n\n("+At(t)+")"),"syntax"in e&&e.syntax&&(n+=`\n\nSyntax: ${At(e.syntax)}`)}return e.references&&e.references.length>0&&!1!==t?.references&&(n.length>0&&(n+="\n\n"),n+=e.references.map((e=>`[${e.name}](${e.url})`)).join(" | ")),n}function Wt(e=[]){return 0===e.length?null:e.map((e=>{let t="";const n=e.match(/([A-Z]+)(\d+)?/),i=n[1],r=n[2];return i in zt&&(t+=zt[i]),r&&(t+=" "+r),t})).join(", ")}const qt=/(^#([0-9A-F]{3}){1,2}$)|(^#([0-9A-F]{4}){1,2}$)/i,Ut=[{label:"rgb",func:"rgb($red, $green, $blue)",insertText:"rgb(${1:red}, ${2:green}, ${3:blue})",desc:Tt.t("Creates a Color from red, green, and blue values.")},{label:"rgba",func:"rgba($red, $green, $blue, $alpha)",insertText:"rgba(${1:red}, ${2:green}, ${3:blue}, ${4:alpha})",desc:Tt.t("Creates a Color from red, green, blue, and alpha values.")},{label:"rgb relative",func:"rgb(from $color $red $green $blue)",insertText:"rgb(from ${1:color} ${2:r} ${3:g} ${4:b})",desc:Tt.t("Creates a Color from the red, green, and blue values of another Color.")},{label:"hsl",func:"hsl($hue, $saturation, $lightness)",insertText:"hsl(${1:hue}, ${2:saturation}, ${3:lightness})",desc:Tt.t("Creates a Color from hue, saturation, and lightness values.")},{label:"hsla",func:"hsla($hue, $saturation, $lightness, $alpha)",insertText:"hsla(${1:hue}, ${2:saturation}, ${3:lightness}, ${4:alpha})",desc:Tt.t("Creates a Color from hue, saturation, lightness, and alpha values.")},{label:"hsl relative",func:"hsl(from $color $hue $saturation $lightness)",insertText:"hsl(from ${1:color} ${2:h} ${3:s} ${4:l})",desc:Tt.t("Creates a Color from the hue, saturation, and lightness values of another Color.")},{label:"hwb",func:"hwb($hue $white $black)",insertText:"hwb(${1:hue} ${2:white} ${3:black})",desc:Tt.t("Creates a Color from hue, white, and black values.")},{label:"hwb relative",func:"hwb(from $color $hue $white $black)",insertText:"hwb(from ${1:color} ${2:h} ${3:w} ${4:b})",desc:Tt.t("Creates a Color from the hue, white, and black values of another Color.")},{label:"lab",func:"lab($lightness $a $b)",insertText:"lab(${1:lightness} ${2:a} ${3:b})",desc:Tt.t("Creates a Color from lightness, a, and b values.")},{label:"lab relative",func:"lab(from $color $lightness $a $b)",insertText:"lab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:Tt.t("Creates a Color from the lightness, a, and b values of another Color.")},{label:"oklab",func:"oklab($lightness $a $b)",insertText:"oklab(${1:lightness} ${2:a} ${3:b})",desc:Tt.t("Creates a Color from lightness, a, and b values.")},{label:"oklab relative",func:"oklab(from $color $lightness $a $b)",insertText:"oklab(from ${1:color} ${2:l} ${3:a} ${4:b})",desc:Tt.t("Creates a Color from the lightness, a, and b values of another Color.")},{label:"lch",func:"lch($lightness $chroma $hue)",insertText:"lch(${1:lightness} ${2:chroma} ${3:hue})",desc:Tt.t("Creates a Color from lightness, chroma, and hue values.")},{label:"lch relative",func:"lch(from $color $lightness $chroma $hue)",insertText:"lch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:Tt.t("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"oklch",func:"oklch($lightness $chroma $hue)",insertText:"oklch(${1:lightness} ${2:chroma} ${3:hue})",desc:Tt.t("Creates a Color from lightness, chroma, and hue values.")},{label:"oklch relative",func:"oklch(from $color $lightness $chroma $hue)",insertText:"oklch(from ${1:color} ${2:l} ${3:c} ${4:h})",desc:Tt.t("Creates a Color from the lightness, chroma, and hue values of another Color.")},{label:"color",func:"color($color-space $red $green $blue)",insertText:"color(${1|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${2:red} ${3:green} ${4:blue})",desc:Tt.t("Creates a Color in a specific color space from red, green, and blue values.")},{label:"color relative",func:"color(from $color $color-space $red $green $blue)",insertText:"color(from ${1:color} ${2|srgb,srgb-linear,display-p3,a98-rgb,prophoto-rgb,rec2020,xyx,xyz-d50,xyz-d65|} ${3:r} ${4:g} ${5:b})",desc:Tt.t("Creates a Color in a specific color space from the red, green, and blue values of another Color.")},{label:"color-mix",func:"color-mix(in $color-space, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|srgb,srgb-linear,lab,oklab,xyz,xyz-d50,xyz-d65|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:Tt.t("Mix two colors together in a rectangular color space.")},{label:"color-mix hue",func:"color-mix(in $color-space $interpolation-method hue, $color $percentage, $color $percentage)",insertText:"color-mix(in ${1|hsl,hwb,lch,oklch|} ${2|shorter hue,longer hue,increasing hue,decreasing hue|}, ${3:color} ${4:percentage}, ${5:color} ${6:percentage})",desc:Tt.t("Mix two colors together in a polar color space.")}],Ht=/^(rgb|rgba|hsl|hsla|hwb)$/i,jt={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rebeccapurple:"#663399",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},$t=new RegExp(`^(${Object.keys(jt).join("|")})$`,"i"),Vt={currentColor:"The value of the 'color' property. The computed value of the 'currentColor' keyword is the computed value of the 'color' property. If the 'currentColor' keyword is set on the 'color' property itself, it is treated as 'color:inherit' at parse time.",transparent:"Fully transparent. This keyword can be considered a shorthand for rgba(0,0,0,0) which is its computed value."},Bt=new RegExp(`^(${Object.keys(Vt).join("|")})$`,"i");function Gt(e,t){const n=e.getText().match(/^([-+]?[0-9]*\.?[0-9]+)(%?)$/);if(n){n[2]&&(t=100);const e=parseFloat(n[1])/t;if(e>=0&&e<=1)return e}throw new Error}function Kt(e){const t=e.getText(),n=t.match(/^([-+]?[0-9]*\.?[0-9]+)(deg|rad|grad|turn)?$/);if(n)switch(n[2]){case"deg":return parseFloat(t)%360;case"rad":return 180*parseFloat(t)/Math.PI%360;case"grad":return.9*parseFloat(t)%360;case"turn":return 360*parseFloat(t)%360;default:if(void 0===n[2])return parseFloat(t)%360}throw new Error}function Jt(e){return qt.test(e)||$t.test(e)||Bt.test(e)}const Xt=48,Qt=57,Yt=65,Zt=97,en=102;function tn(e){return e=Zt&&e<=en?e-Zt+10:0)}function nn(e){if("#"!==e[0])return null;switch(e.length){case 4:return{red:17*tn(e.charCodeAt(1))/255,green:17*tn(e.charCodeAt(2))/255,blue:17*tn(e.charCodeAt(3))/255,alpha:1};case 5:return{red:17*tn(e.charCodeAt(1))/255,green:17*tn(e.charCodeAt(2))/255,blue:17*tn(e.charCodeAt(3))/255,alpha:17*tn(e.charCodeAt(4))/255};case 7:return{red:(16*tn(e.charCodeAt(1))+tn(e.charCodeAt(2)))/255,green:(16*tn(e.charCodeAt(3))+tn(e.charCodeAt(4)))/255,blue:(16*tn(e.charCodeAt(5))+tn(e.charCodeAt(6)))/255,alpha:1};case 9:return{red:(16*tn(e.charCodeAt(1))+tn(e.charCodeAt(2)))/255,green:(16*tn(e.charCodeAt(3))+tn(e.charCodeAt(4)))/255,blue:(16*tn(e.charCodeAt(5))+tn(e.charCodeAt(6)))/255,alpha:(16*tn(e.charCodeAt(7))+tn(e.charCodeAt(8)))/255}}return null}function rn(e,t,n,i=1){if(0===t)return{red:n,green:n,blue:n,alpha:i};{const r=(e,t,n)=>{for(;n<0;)n+=6;for(;n>=6;)n-=6;return n<1?(t-e)*n+e:n<3?t:n<4?(t-e)*(4-n)+e:e},o=n<=.5?n*(t+1):n+t-n*t,s=2*n-o;return{red:r(s,o,2+(e/=60)),green:r(s,o,e),blue:r(s,o,e-2),alpha:i}}}function on(e){const t=e.red,n=e.green,i=e.blue,r=e.alpha,o=Math.max(t,n,i),s=Math.min(t,n,i);let a=0,l=0;const c=(s+o)/2,d=o-s;if(d>0){switch(l=Math.min(c<=.5?d/(2*c):d/(2-2*c),1),o){case t:a=(n-i)/d+(ne[t]))}function Sn(e){return void 0!==e}class xn{constructor(e=new X){this.keyframeRegex=/^@(\-(webkit|ms|moz|o)\-)?keyframes$/i,this.scanner=e,this.token={type:i.EOF,offset:-1,len:0,text:""},this.prevToken=void 0}peekIdent(e){return i.Ident===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekKeyword(e){return i.AtKeyword===this.token.type&&e.length===this.token.text.length&&e===this.token.text.toLowerCase()}peekDelim(e){return i.Delim===this.token.type&&e===this.token.text}peek(e){return e===this.token.type}peekOne(...e){return-1!==e.indexOf(this.token.type)}peekRegExp(e,t){return e===this.token.type&&t.test(this.token.text)}hasWhitespace(){return!!this.prevToken&&this.prevToken.offset+this.prevToken.len!==this.token.offset}consumeToken(){this.prevToken=this.token,this.token=this.scanner.scan()}acceptUnicodeRange(){const e=this.scanner.tryScanUnicode();return!!e&&(this.prevToken=e,this.token=this.scanner.scan(),!0)}mark(){return{prev:this.prevToken,curr:this.token,pos:this.scanner.pos()}}restoreAtMark(e){this.prevToken=e.prev,this.token=e.curr,this.scanner.goBackTo(e.pos)}try(e){const t=this.mark();return e()||(this.restoreAtMark(t),null)}acceptOneKeyword(e){if(i.AtKeyword===this.token.type)for(const t of e)if(t.length===this.token.text.length&&t===this.token.text.toLowerCase())return this.consumeToken(),!0;return!1}accept(e){return e===this.token.type&&(this.consumeToken(),!0)}acceptIdent(e){return!!this.peekIdent(e)&&(this.consumeToken(),!0)}acceptKeyword(e){return!!this.peekKeyword(e)&&(this.consumeToken(),!0)}acceptDelim(e){return!!this.peekDelim(e)&&(this.consumeToken(),!0)}acceptRegexp(e){return!!e.test(this.token.text)&&(this.consumeToken(),!0)}_parseRegexp(e){let t=this.createNode(te.Identifier);do{}while(this.acceptRegexp(e));return this.finish(t)}acceptUnquotedString(){const e=this.scanner.pos();this.scanner.goBackTo(this.token.offset);const t=this.scanner.scanUnquotedString();return t?(this.token=t,this.consumeToken(),!0):(this.scanner.goBackTo(e),!1)}resync(e,t){for(;;){if(e&&-1!==e.indexOf(this.token.type))return this.consumeToken(),!0;if(t&&-1!==t.indexOf(this.token.type))return!0;if(this.token.type===i.EOF)return!1;this.token=this.scanner.scan()}}createNode(e){return new oe(this.token.offset,this.token.len,e)}create(e){return new e(this.token.offset,this.token.len)}finish(e,t,n,i){if(!(e instanceof se)&&(t&&this.markError(e,t,n,i),this.prevToken)){const t=this.prevToken.offset+this.prevToken.len;e.length=t>e.offset?t-e.offset:0}return e}markError(e,t,n,i){this.token!==this.lastErrorToken&&(e.addIssue(new kt(e,t,xt.Error,void 0,this.token.offset,this.token.len)),this.lastErrorToken=this.token),(n||i)&&this.resync(n,i)}parseStylesheet(e){const t=e.version,n=e.getText();return this.internalParse(n,this._parseStylesheet,((i,r)=>{if(e.version!==t)throw new Error("Underlying model has changed, AST is no longer valid");return n.substr(i,r)}))}internalParse(e,t,n){this.scanner.setSource(e),this.token=this.scanner.scan();const i=t.bind(this)();return i&&(i.textProvider=n||((t,n)=>e.substr(t,n))),i}_parseStylesheet(){const e=this.create(ce);for(;e.addChild(this._parseStylesheetStart()););let t=!1;do{let n=!1;do{n=!1;const r=this._parseStylesheetStatement();for(r&&(e.addChild(r),n=!0,t=!1,this.peek(i.EOF)||!this._needsSemicolonAfter(r)||this.accept(i.SemiColon)||this.markError(e,Rt.SemiColonExpected));this.accept(i.SemiColon)||this.accept(i.CDO)||this.accept(i.CDC);)n=!0,t=!1}while(n);if(this.peek(i.EOF))break;t||(this.peek(i.AtKeyword)?this.markError(e,Rt.UnknownAtRule):this.markError(e,Rt.RuleOrSelectorExpected),t=!0),this.consumeToken()}while(!this.peek(i.EOF));return this.finish(e)}_parseStylesheetStart(){return this._parseCharset()}_parseStylesheetStatement(e=!1){return this.peek(i.AtKeyword)?this._parseStylesheetAtStatement(e):this._parseRuleset(e)}_parseStylesheetAtStatement(e=!1){return this._parseImport()||this._parseMedia(e)||this._parsePage()||this._parseFontFace()||this._parseKeyframe()||this._parseSupports(e)||this._parseLayer(e)||this._parsePropertyAtRule()||this._parseViewPort()||this._parseNamespace()||this._parseDocument()||this._parseContainer(e)||this._parseUnknownAtRule()}_tryParseRuleset(e){const t=this.mark();if(this._parseSelector(e)){for(;this.accept(i.Comma)&&this._parseSelector(e););if(this.accept(i.CurlyL))return this.restoreAtMark(t),this._parseRuleset(e)}return this.restoreAtMark(t),null}_parseRuleset(e=!1){const t=this.create(pe),n=t.getSelectors();if(!n.addChild(this._parseSelector(e)))return null;for(;this.accept(i.Comma);)if(!n.addChild(this._parseSelector(e)))return this.finish(t,Rt.SelectorExpected);return this._parseBody(t,this._parseRuleSetDeclaration.bind(this))}_parseRuleSetDeclarationAtStatement(){return this._parseMedia(!0)||this._parseSupports(!0)||this._parseLayer(!0)||this._parseContainer(!0)||this._parseUnknownAtRule()}_parseRuleSetDeclaration(){return this.peek(i.AtKeyword)?this._parseRuleSetDeclarationAtStatement():this.peek(i.Ident)?this._tryParseRuleset(!0)||this._parseDeclaration():this._parseRuleset(!0)}_needsSemicolonAfter(e){switch(e.type){case te.Keyframe:case te.ViewPort:case te.Media:case te.Ruleset:case te.Namespace:case te.If:case te.For:case te.Each:case te.While:case te.MixinDeclaration:case te.FunctionDeclaration:case te.MixinContentDeclaration:return!1;case te.ExtendsReference:case te.MixinContentReference:case te.ReturnStatement:case te.MediaQuery:case te.Debug:case te.Import:case te.AtApplyRule:case te.CustomPropertyDeclaration:return!0;case te.VariableDeclaration:return e.needsSemicolon;case te.MixinReference:return!e.getContent();case te.Declaration:return!e.getNestedProperties()}return!1}_parseDeclarations(e){const t=this.create(de);if(!this.accept(i.CurlyL))return null;let n=e();for(;t.addChild(n)&&!this.peek(i.CurlyR);){if(this._needsSemicolonAfter(n)&&!this.accept(i.SemiColon))return this.finish(t,Rt.SemiColonExpected,[i.SemiColon,i.CurlyR]);for(n&&this.prevToken&&this.prevToken.type===i.SemiColon&&(n.semicolonPosition=this.prevToken.offset);this.accept(i.SemiColon););n=e()}return this.accept(i.CurlyR)?this.finish(t):this.finish(t,Rt.RightCurlyExpected,[i.CurlyR,i.SemiColon])}_parseBody(e,t){return e.setDeclarations(this._parseDeclarations(t))?this.finish(e):this.finish(e,Rt.LeftCurlyExpected,[i.CurlyR,i.SemiColon])}_parseSelector(e){const t=this.create(ue);let n=!1;for(e&&(n=t.addChild(this._parseCombinator()));t.addChild(this._parseSimpleSelector());)n=!0,t.addChild(this._parseCombinator());return n?this.finish(t):null}_parseDeclaration(e){const t=this._tryParseCustomPropertyDeclaration(e);if(t)return t;const n=this.create(be);return n.setProperty(this._parseProperty())?this.accept(i.Colon)?(this.prevToken&&(n.colonPosition=this.prevToken.offset),n.setValue(this._parseExpr())?(n.addChild(this._parsePrio()),this.peek(i.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)):this.finish(n,Rt.PropertyValueExpected)):this.finish(n,Rt.ColonExpected,[i.Colon],e||[i.SemiColon]):null}_tryParseCustomPropertyDeclaration(e){if(!this.peekRegExp(i.Ident,/^--/))return null;const t=this.create(ve);if(!t.setProperty(this._parseProperty()))return null;if(!this.accept(i.Colon))return this.finish(t,Rt.ColonExpected,[i.Colon]);this.prevToken&&(t.colonPosition=this.prevToken.offset);const n=this.mark();if(this.peek(i.CurlyL)){const e=this.create(ge),r=this._parseDeclarations(this._parseRuleSetDeclaration.bind(this));if(e.setDeclarations(r)&&!r.isErroneous(!0)&&(e.addChild(this._parsePrio()),this.peek(i.SemiColon)))return this.finish(e),t.setPropertySet(e),t.semicolonPosition=this.token.offset,this.finish(t);this.restoreAtMark(n)}const r=this._parseExpr();return r&&!r.isErroneous(!0)&&(this._parsePrio(),this.peekOne(...e||[],i.SemiColon,i.EOF))?(t.setValue(r),this.peek(i.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)):(this.restoreAtMark(n),t.addChild(this._parseCustomPropertyValue(e)),t.addChild(this._parsePrio()),Sn(t.colonPosition)&&this.token.offset===t.colonPosition+1?this.finish(t,Rt.PropertyValueExpected):this.finish(t))}_parseCustomPropertyValue(e=[i.CurlyR]){const t=this.create(oe),n=()=>-1!==e.indexOf(this.token.type);let r=0,o=0,s=0;e:for(;;){switch(this.token.type){case i.SemiColon:case i.Exclamation:if(0===r&&0===o&&0===s)break e;break;case i.CurlyL:r++;break;case i.CurlyR:if(r--,r<0){if(n()&&0===o&&0===s)break e;return this.finish(t,Rt.LeftCurlyExpected)}break;case i.ParenthesisL:o++;break;case i.ParenthesisR:if(o--,o<0){if(n()&&0===s&&0===r)break e;return this.finish(t,Rt.LeftParenthesisExpected)}break;case i.BracketL:s++;break;case i.BracketR:if(s--,s<0)return this.finish(t,Rt.LeftSquareBracketExpected);break;case i.BadString:break e;case i.EOF:let e=Rt.RightCurlyExpected;return s>0?e=Rt.RightSquareBracketExpected:o>0&&(e=Rt.RightParenthesisExpected),this.finish(t,e)}this.consumeToken()}return this.finish(t)}_tryToParseDeclaration(e){const t=this.mark();return this._parseProperty()&&this.accept(i.Colon)?(this.restoreAtMark(t),this._parseDeclaration(e)):(this.restoreAtMark(t),null)}_parseProperty(){const e=this.create(we),t=this.mark();return(this.acceptDelim("*")||this.acceptDelim("_"))&&this.hasWhitespace()?(this.restoreAtMark(t),null):e.setIdentifier(this._parsePropertyIdentifier())?this.finish(e):null}_parsePropertyIdentifier(){return this._parseIdent()}_parseCharset(){if(!this.peek(i.Charset))return null;const e=this.create(oe);return this.consumeToken(),this.accept(i.String)?this.accept(i.SemiColon)?this.finish(e):this.finish(e,Rt.SemiColonExpected):this.finish(e,Rt.IdentifierExpected)}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(Pe);return this.consumeToken(),e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral())?this._completeParseImport(e):this.finish(e,Rt.URIOrStringExpected)}_completeParseImport(e){if(this.acceptIdent("layer")&&this.accept(i.ParenthesisL)){if(!e.addChild(this._parseLayerName()))return this.finish(e,Rt.IdentifierExpected,[i.SemiColon]);if(!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[i.ParenthesisR],[])}return this.acceptIdent("supports")&&this.accept(i.ParenthesisL)&&(e.addChild(this._tryToParseDeclaration()||this._parseSupportsCondition()),!this.accept(i.ParenthesisR))?this.finish(e,Rt.RightParenthesisExpected,[i.ParenthesisR],[]):(this.peek(i.SemiColon)||this.peek(i.EOF)||e.setMedialist(this._parseMediaQueryList()),this.finish(e))}_parseNamespace(){if(!this.peekKeyword("@namespace"))return null;const e=this.create(qe);return this.consumeToken(),e.addChild(this._parseURILiteral())||(e.addChild(this._parseIdent()),e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral()))?this.accept(i.SemiColon)?this.finish(e):this.finish(e,Rt.SemiColonExpected):this.finish(e,Rt.URIExpected,[i.SemiColon])}_parseFontFace(){if(!this.peekKeyword("@font-face"))return null;const e=this.create(Me);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseViewPort(){if(!this.peekKeyword("@-ms-viewport")&&!this.peekKeyword("@-o-viewport")&&!this.peekKeyword("@viewport"))return null;const e=this.create(Fe);return this.consumeToken(),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseKeyframe(){if(!this.peekRegExp(i.AtKeyword,this.keyframeRegex))return null;const e=this.create(ze),t=this.create(oe);return this.consumeToken(),e.setKeyword(this.finish(t)),t.matches("@-ms-keyframes")&&this.markError(t,Rt.UnknownKeyword),e.setIdentifier(this._parseKeyframeIdent())?this._parseBody(e,this._parseKeyframeSelector.bind(this)):this.finish(e,Rt.IdentifierExpected,[i.CurlyR])}_parseKeyframeIdent(){return this._parseIdent([ne.Keyframe])}_parseKeyframeSelector(){const e=this.create(Oe);let t=!1;if(e.addChild(this._parseIdent())&&(t=!0),this.accept(i.Percentage)&&(t=!0),!t)return null;for(;this.accept(i.Comma);)if(t=!1,e.addChild(this._parseIdent())&&(t=!0),this.accept(i.Percentage)&&(t=!0),!t)return this.finish(e,Rt.PercentageExpected);return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_tryParseKeyframeSelector(){const e=this.create(Oe),t=this.mark();let n=!1;if(e.addChild(this._parseIdent())&&(n=!0),this.accept(i.Percentage)&&(n=!0),!n)return null;for(;this.accept(i.Comma);)if(n=!1,e.addChild(this._parseIdent())&&(n=!0),this.accept(i.Percentage)&&(n=!0),!n)return this.restoreAtMark(t),null;return this.peek(i.CurlyL)?this._parseBody(e,this._parseRuleSetDeclaration.bind(this)):(this.restoreAtMark(t),null)}_parsePropertyAtRule(){if(!this.peekKeyword("@property"))return null;const e=this.create($e);return this.consumeToken(),this.peekRegExp(i.Ident,/^--/)&&e.setName(this._parseIdent([ne.Property]))?this._parseBody(e,this._parseDeclaration.bind(this)):this.finish(e,Rt.IdentifierExpected)}_parseLayer(e=!1){if(!this.peekKeyword("@layer"))return null;const t=this.create(je);this.consumeToken();const n=this._parseLayerNameList();return n&&t.setNames(n),n&&1!==n.getChildren().length||!this.peek(i.CurlyL)?this.accept(i.SemiColon)?this.finish(t):this.finish(t,Rt.SemiColonExpected):this._parseBody(t,this._parseLayerDeclaration.bind(this,e))}_parseLayerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseLayerNameList(){const e=this.createNode(te.LayerNameList);if(!e.addChild(this._parseLayerName()))return null;for(;this.accept(i.Comma);)if(!e.addChild(this._parseLayerName()))return this.finish(e,Rt.IdentifierExpected);return this.finish(e)}_parseLayerName(){const e=this.createNode(te.LayerName);if(!e.addChild(this._parseIdent()))return null;for(;!this.hasWhitespace()&&this.acceptDelim(".");)if(this.hasWhitespace()||!e.addChild(this._parseIdent()))return this.finish(e,Rt.IdentifierExpected);return this.finish(e)}_parseSupports(e=!1){if(!this.peekKeyword("@supports"))return null;const t=this.create(He);return this.consumeToken(),t.addChild(this._parseSupportsCondition()),this._parseBody(t,this._parseSupportsDeclaration.bind(this,e))}_parseSupportsDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseSupportsCondition(){const e=this.create(Qe);if(this.acceptIdent("not"))e.addChild(this._parseSupportsConditionInParens());else if(e.addChild(this._parseSupportsConditionInParens()),this.peekRegExp(i.Ident,/^(and|or)$/i)){const t=this.token.text.toLowerCase();for(;this.acceptIdent(t);)e.addChild(this._parseSupportsConditionInParens())}return this.finish(e)}_parseSupportsConditionInParens(){const e=this.create(Qe);if(this.accept(i.ParenthesisL))return this.prevToken&&(e.lParent=this.prevToken.offset),e.addChild(this._tryToParseDeclaration([i.ParenthesisR]))||this._parseSupportsCondition()?this.accept(i.ParenthesisR)?(this.prevToken&&(e.rParent=this.prevToken.offset),this.finish(e)):this.finish(e,Rt.RightParenthesisExpected,[i.ParenthesisR],[]):this.finish(e,Rt.ConditionExpected);if(this.peek(i.Ident)){const t=this.mark();if(this.consumeToken(),!this.hasWhitespace()&&this.accept(i.ParenthesisL)){let t=1;for(;this.token.type!==i.EOF&&0!==t;)this.token.type===i.ParenthesisL?t++:this.token.type===i.ParenthesisR&&t--,this.consumeToken();return this.finish(e)}this.restoreAtMark(t)}return this.finish(e,Rt.LeftParenthesisExpected,[],[i.ParenthesisL])}_parseMediaDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseMedia(e=!1){if(!this.peekKeyword("@media"))return null;const t=this.create(Ue);return this.consumeToken(),t.addChild(this._parseMediaQueryList())?this._parseBody(t,this._parseMediaDeclaration.bind(this,e)):this.finish(t,Rt.MediaQueryExpected)}_parseMediaQueryList(){const e=this.create(Ge);if(!e.addChild(this._parseMediaQuery()))return this.finish(e,Rt.MediaQueryExpected);for(;this.accept(i.Comma);)if(!e.addChild(this._parseMediaQuery()))return this.finish(e,Rt.MediaQueryExpected);return this.finish(e)}_parseMediaQuery(){const e=this.create(Ke),t=this.mark();if(this.acceptIdent("not"),this.peek(i.ParenthesisL))this.restoreAtMark(t),e.addChild(this._parseMediaCondition());else{if(this.acceptIdent("only"),!e.addChild(this._parseIdent()))return null;this.acceptIdent("and")&&e.addChild(this._parseMediaCondition())}return this.finish(e)}_parseRatio(){const e=this.mark(),t=this.create(ot);return this._parseNumeric()?this.acceptDelim("/")?this._parseNumeric()?this.finish(t):this.finish(t,Rt.NumberExpected):(this.restoreAtMark(e),null):null}_parseMediaCondition(){const e=this.create(Je);this.acceptIdent("not");let t=!0;for(;t;){if(!this.accept(i.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected,[],[i.CurlyL]);if(this.peek(i.ParenthesisL)||this.peekIdent("not")?e.addChild(this._parseMediaCondition()):e.addChild(this._parseMediaFeature()),!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[],[i.CurlyL]);t=this.acceptIdent("and")||this.acceptIdent("or")}return this.finish(e)}_parseMediaFeature(){const e=[i.ParenthesisR],t=this.create(Xe);if(t.addChild(this._parseMediaFeatureName())){if(this.accept(i.Colon)){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.TermExpected,[],e)}else if(this._parseMediaFeatureRangeOperator()){if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.TermExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.TermExpected,[],e)}}else{if(!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.IdentifierExpected,[],e);if(!this._parseMediaFeatureRangeOperator())return this.finish(t,Rt.OperatorExpected,[],e);if(!t.addChild(this._parseMediaFeatureName()))return this.finish(t,Rt.IdentifierExpected,[],e);if(this._parseMediaFeatureRangeOperator()&&!t.addChild(this._parseMediaFeatureValue()))return this.finish(t,Rt.TermExpected,[],e)}return this.finish(t)}_parseMediaFeatureRangeOperator(){return this.acceptDelim("<")||this.acceptDelim(">")?(this.hasWhitespace()||this.acceptDelim("="),!0):!!this.acceptDelim("=")}_parseMediaFeatureName(){return this._parseIdent()}_parseMediaFeatureValue(){return this._parseRatio()||this._parseTermExpression()}_parseMedium(){const e=this.create(oe);return e.addChild(this._parseIdent())?this.finish(e):null}_parsePageDeclaration(){return this._parsePageMarginBox()||this._parseRuleSetDeclaration()}_parsePage(){if(!this.peekKeyword("@page"))return null;const e=this.create(Ye);if(this.consumeToken(),e.addChild(this._parsePageSelector()))for(;this.accept(i.Comma);)if(!e.addChild(this._parsePageSelector()))return this.finish(e,Rt.IdentifierExpected);return this._parseBody(e,this._parsePageDeclaration.bind(this))}_parsePageMarginBox(){if(!this.peek(i.AtKeyword))return null;const e=this.create(Ze);return this.acceptOneKeyword(yn)||this.markError(e,Rt.UnknownAtRule,[],[i.CurlyL]),this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parsePageSelector(){if(!this.peek(i.Ident)&&!this.peek(i.Colon))return null;const e=this.create(oe);return e.addChild(this._parseIdent()),this.accept(i.Colon)&&!e.addChild(this._parseIdent())?this.finish(e,Rt.IdentifierExpected):this.finish(e)}_parseDocument(){if(!this.peekKeyword("@-moz-document"))return null;const e=this.create(Ve);return this.consumeToken(),this.resync([],[i.CurlyL]),this._parseBody(e,this._parseStylesheetStatement.bind(this))}_parseContainerDeclaration(e=!1){return e?this._tryParseRuleset(!0)||this._tryToParseDeclaration()||this._parseStylesheetStatement(!0):this._parseStylesheetStatement(!1)}_parseContainer(e=!1){if(!this.peekKeyword("@container"))return null;const t=this.create(Be);return this.consumeToken(),t.addChild(this._parseIdent()),t.addChild(this._parseContainerQuery()),this._parseBody(t,this._parseContainerDeclaration.bind(this,e))}_parseContainerQuery(){const e=this.create(oe);if(this.acceptIdent("not"))e.addChild(this._parseContainerQueryInParens());else if(e.addChild(this._parseContainerQueryInParens()),this.peekIdent("and"))for(;this.acceptIdent("and");)e.addChild(this._parseContainerQueryInParens());else if(this.peekIdent("or"))for(;this.acceptIdent("or");)e.addChild(this._parseContainerQueryInParens());return this.finish(e)}_parseContainerQueryInParens(){const e=this.create(oe);if(this.accept(i.ParenthesisL)){if(this.peekIdent("not")||this.peek(i.ParenthesisL)?e.addChild(this._parseContainerQuery()):e.addChild(this._parseMediaFeature()),!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[],[i.CurlyL])}else{if(!this.acceptIdent("style"))return this.finish(e,Rt.LeftParenthesisExpected,[],[i.CurlyL]);if(this.hasWhitespace()||!this.accept(i.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected,[],[i.CurlyL]);if(e.addChild(this._parseStyleQuery()),!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[],[i.CurlyL])}return this.finish(e)}_parseStyleQuery(){const e=this.create(oe);if(this.acceptIdent("not"))e.addChild(this._parseStyleInParens());else if(this.peek(i.ParenthesisL)){if(e.addChild(this._parseStyleInParens()),this.peekIdent("and"))for(;this.acceptIdent("and");)e.addChild(this._parseStyleInParens());else if(this.peekIdent("or"))for(;this.acceptIdent("or");)e.addChild(this._parseStyleInParens())}else e.addChild(this._parseDeclaration([i.ParenthesisR]));return this.finish(e)}_parseStyleInParens(){const e=this.create(oe);return this.accept(i.ParenthesisL)?(e.addChild(this._parseStyleQuery()),this.accept(i.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected,[],[i.CurlyL])):this.finish(e,Rt.LeftParenthesisExpected,[],[i.CurlyL])}_parseUnknownAtRule(){if(!this.peek(i.AtKeyword))return null;const e=this.create(vt);e.addChild(this._parseUnknownAtRuleName());let t=0,n=0,r=0,o=0;e:for(;;){switch(this.token.type){case i.SemiColon:if(0===n&&0===r&&0===o)break e;break;case i.EOF:return n>0?this.finish(e,Rt.RightCurlyExpected):o>0?this.finish(e,Rt.RightSquareBracketExpected):r>0?this.finish(e,Rt.RightParenthesisExpected):this.finish(e);case i.CurlyL:t++,n++;break;case i.CurlyR:if(n--,t>0&&0===n){if(this.consumeToken(),o>0)return this.finish(e,Rt.RightSquareBracketExpected);if(r>0)return this.finish(e,Rt.RightParenthesisExpected);break e}if(n<0){if(0===r&&0===o)break e;return this.finish(e,Rt.LeftCurlyExpected)}break;case i.ParenthesisL:r++;break;case i.ParenthesisR:if(r--,r<0)return this.finish(e,Rt.LeftParenthesisExpected);break;case i.BracketL:o++;break;case i.BracketR:if(o--,o<0)return this.finish(e,Rt.LeftSquareBracketExpected)}this.consumeToken()}return e}_parseUnknownAtRuleName(){const e=this.create(oe);return this.accept(i.AtKeyword)?this.finish(e):e}_parseOperator(){if(this.peekDelim("/")||this.peekDelim("*")||this.peekDelim("+")||this.peekDelim("-")||this.peek(i.Dashmatch)||this.peek(i.Includes)||this.peek(i.SubstringOperator)||this.peek(i.PrefixOperator)||this.peek(i.SuffixOperator)||this.peekDelim("=")){const e=this.createNode(te.Operator);return this.consumeToken(),this.finish(e)}return null}_parseUnaryOperator(){if(!this.peekDelim("+")&&!this.peekDelim("-"))return null;const e=this.create(oe);return this.consumeToken(),this.finish(e)}_parseCombinator(){if(this.peekDelim(">")){const e=this.create(oe);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptDelim(">")){if(!this.hasWhitespace()&&this.acceptDelim(">"))return e.type=te.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return e.type=te.SelectorCombinatorParent,this.finish(e)}if(this.peekDelim("+")){const e=this.create(oe);return this.consumeToken(),e.type=te.SelectorCombinatorSibling,this.finish(e)}if(this.peekDelim("~")){const e=this.create(oe);return this.consumeToken(),e.type=te.SelectorCombinatorAllSiblings,this.finish(e)}if(this.peekDelim("/")){const e=this.create(oe);this.consumeToken();const t=this.mark();if(!this.hasWhitespace()&&this.acceptIdent("deep")&&!this.hasWhitespace()&&this.acceptDelim("/"))return e.type=te.SelectorCombinatorShadowPiercingDescendant,this.finish(e);this.restoreAtMark(t)}return null}_parseSimpleSelector(){const e=this.create(me);let t=0;for(e.addChild(this._parseElementName()||this._parseNestingSelector())&&t++;(0===t||!this.hasWhitespace())&&e.addChild(this._parseSimpleSelectorBody());)t++;return t>0?this.finish(e):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);return this.consumeToken(),this.finish(e)}return null}_parseSimpleSelectorBody(){return this._parsePseudo()||this._parseHash()||this._parseClass()||this._parseAttrib()}_parseSelectorIdent(){return this._parseIdent()}_parseHash(){if(!this.peek(i.Hash)&&!this.peekDelim("#"))return null;const e=this.createNode(te.IdentifierSelector);if(this.acceptDelim("#")){if(this.hasWhitespace()||!e.addChild(this._parseSelectorIdent()))return this.finish(e,Rt.IdentifierExpected)}else this.consumeToken();return this.finish(e)}_parseClass(){if(!this.peekDelim("."))return null;const e=this.createNode(te.ClassSelector);return this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseSelectorIdent())?this.finish(e,Rt.IdentifierExpected):this.finish(e)}_parseElementName(){const e=this.mark(),t=this.createNode(te.ElementNameSelector);return t.addChild(this._parseNamespacePrefix()),t.addChild(this._parseSelectorIdent())||this.acceptDelim("*")?this.finish(t):(this.restoreAtMark(e),null)}_parseNamespacePrefix(){const e=this.mark(),t=this.createNode(te.NamespacePrefix);return!t.addChild(this._parseIdent())&&this.acceptDelim("*"),this.acceptDelim("|")?this.finish(t):(this.restoreAtMark(e),null)}_parseAttrib(){if(!this.peek(i.BracketL))return null;const e=this.create(it);return this.consumeToken(),e.setNamespacePrefix(this._parseNamespacePrefix()),e.setIdentifier(this._parseIdent())?(e.setOperator(this._parseOperator())&&(e.setValue(this._parseBinaryExpr()),this.acceptIdent("i"),this.acceptIdent("s")),this.accept(i.BracketR)?this.finish(e):this.finish(e,Rt.RightSquareBracketExpected)):this.finish(e,Rt.IdentifierExpected)}_parsePseudo(){const e=this._tryParsePseudoIdentifier();if(e){if(!this.hasWhitespace()&&this.accept(i.ParenthesisL)){const t=()=>{const e=this.create(oe);if(!e.addChild(this._parseSelector(!0)))return null;for(;this.accept(i.Comma)&&e.addChild(this._parseSelector(!0)););return this.peek(i.ParenthesisR)?this.finish(e):null};if(!e.addChild(this.try(t))&&e.addChild(this._parseBinaryExpr())&&this.acceptIdent("of")&&!e.addChild(this.try(t)))return this.finish(e,Rt.SelectorExpected);if(!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected)}return this.finish(e)}return null}_tryParsePseudoIdentifier(){if(!this.peek(i.Colon))return null;const e=this.mark(),t=this.createNode(te.PseudoSelector);return this.consumeToken(),this.hasWhitespace()?(this.restoreAtMark(e),null):(this.accept(i.Colon),this.hasWhitespace()||!t.addChild(this._parseIdent())?this.finish(t,Rt.IdentifierExpected):this.finish(t))}_tryParsePrio(){const e=this.mark();return this._parsePrio()||(this.restoreAtMark(e),null)}_parsePrio(){if(!this.peek(i.Exclamation))return null;const e=this.createNode(te.Prio);return this.accept(i.Exclamation)&&this.acceptIdent("important")?this.finish(e):null}_parseExpr(e=!1){const t=this.create(et);if(!t.addChild(this._parseBinaryExpr()))return null;for(;;){if(this.peek(i.Comma)){if(e)return this.finish(t);this.consumeToken()}if(!t.addChild(this._parseBinaryExpr()))break}return this.finish(t)}_parseUnicodeRange(){if(!this.peekIdent("u"))return null;const e=this.create(ae);return this.acceptUnicodeRange()?this.finish(e):null}_parseNamedLine(){if(!this.peek(i.BracketL))return null;const e=this.createNode(te.GridLine);for(this.consumeToken();e.addChild(this._parseIdent()););return this.accept(i.BracketR)?this.finish(e):this.finish(e,Rt.RightSquareBracketExpected)}_parseBinaryExpr(e,t){let n=this.create(tt);if(!n.setLeft(e||this._parseTerm()))return null;if(!n.setOperator(t||this._parseOperator()))return this.finish(n);if(!n.setRight(this._parseTerm()))return this.finish(n,Rt.TermExpected);n=this.finish(n);const i=this._parseOperator();return i&&(n=this._parseBinaryExpr(n,i)),this.finish(n)}_parseTerm(){let e=this.create(nt);return e.setOperator(this._parseUnaryOperator()),e.setExpression(this._parseTermExpression())?this.finish(e):null}_parseTermExpression(){return this._parseURILiteral()||this._parseUnicodeRange()||this._parseFunction()||this._parseIdent()||this._parseStringLiteral()||this._parseNumeric()||this._parseHexColor()||this._parseOperation()||this._parseNamedLine()}_parseOperation(){if(!this.peek(i.ParenthesisL))return null;const e=this.create(oe);return this.consumeToken(),e.addChild(this._parseExpr()),this.accept(i.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)}_parseNumeric(){if(this.peek(i.Num)||this.peek(i.Percentage)||this.peek(i.Resolution)||this.peek(i.Length)||this.peek(i.EMS)||this.peek(i.EXS)||this.peek(i.Angle)||this.peek(i.Time)||this.peek(i.Dimension)||this.peek(i.ContainerQueryLength)||this.peek(i.Freq)){const e=this.create(ct);return this.consumeToken(),this.finish(e)}return null}_parseStringLiteral(){if(!this.peek(i.String)&&!this.peek(i.BadString))return null;const e=this.createNode(te.StringLiteral);return this.consumeToken(),this.finish(e)}_parseURILiteral(){if(!this.peekRegExp(i.Ident,/^url(-prefix)?$/i))return null;const e=this.mark(),t=this.createNode(te.URILiteral);return this.accept(i.Ident),this.hasWhitespace()||!this.peek(i.ParenthesisL)?(this.restoreAtMark(e),null):(this.scanner.inURL=!0,this.consumeToken(),t.addChild(this._parseURLArgument()),this.scanner.inURL=!1,this.accept(i.ParenthesisR)?this.finish(t):this.finish(t,Rt.RightParenthesisExpected))}_parseURLArgument(){const e=this.create(oe);return this.accept(i.String)||this.accept(i.BadString)||this.acceptUnquotedString()?this.finish(e):null}_parseIdent(e){if(!this.peek(i.Ident))return null;const t=this.create(le);return e&&(t.referenceTypes=e),t.isCustomProperty=this.peekRegExp(i.Ident,/^--/),this.consumeToken(),this.finish(t)}_parseFunction(){const e=this.mark(),t=this.create(_e);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(i.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(i.Comma)&&!this.peek(i.ParenthesisR);)t.getArguments().addChild(this._parseFunctionArgument())||this.markError(t,Rt.ExpressionExpected);return this.accept(i.ParenthesisR)?this.finish(t):this.finish(t,Rt.RightParenthesisExpected)}_parseFunctionIdentifier(){if(!this.peek(i.Ident))return null;const e=this.create(le);if(e.referenceTypes=[ne.Function],this.acceptIdent("progid")){if(this.accept(i.Colon))for(;this.accept(i.Ident)&&this.acceptDelim("."););return this.finish(e)}return this.consumeToken(),this.finish(e)}_parseFunctionArgument(){const e=this.create(xe);return e.setValue(this._parseExpr(!0))?this.finish(e):null}_parseHexColor(){if(this.peekRegExp(i.Hash,/^#([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$/g)){const e=this.create(rt);return this.consumeToken(),this.finish(e)}return null}}function kn(e,t){return-1!==e.indexOf(t)}function Cn(...e){const t=[];for(const n of e)for(const e of n)kn(t,e)||t.push(e);return t}class Tn{constructor(e,t){this.offset=e,this.length=t,this.symbols=[],this.parent=null,this.children=[]}addChild(e){this.children.push(e),e.setParent(this)}setParent(e){this.parent=e}findScope(e,t=0){return this.offset<=e&&this.offset+this.length>e+t||this.offset===e&&this.length===t?this.findInScope(e,t):null}findInScope(e,t=0){const n=e+t,i=function(e,t){let i=0,r=e.length;if(0===r)return 0;for(;in?r=t:i=t+1}return i}(this.children);if(0===i)return this;const r=this.children[i-1];return r.offset<=e&&r.offset+r.length>=e+t?r.findInScope(e,t):this}addSymbol(e){this.symbols.push(e)}getSymbol(e,t){for(let n=0;n{Q(e.label,"_")&&Y(e.label,".scss")&&(e.textEdit?e.textEdit.newText=e.label.slice(1,-5):e.label=e.label.slice(1,-5))}));for(let e of o)n.items.push(e)}}return n}async providePathSuggestions(e,t,n,i,r){const o=An(e),s=Q(e,"'")||Q(e,'"'),a=s?o.slice(0,t.character-(n.start.character+1)):o.slice(0,t.character-n.start.character),l=i.uri,c=function(e,t,n){let i;const r=e.lastIndexOf("/");if(-1===r)i=n;else{const e=t.slice(r+1),o=Wn(n.end,-e.length),s=e.indexOf(" ");let a;a=-1!==s?Wn(o,s):n.end,i=Mt.Q6.create(o,a)}return i}(a,o,s?function(e,t,n){const i=Wn(e.start,1),r=Wn(e.end,-1);return Mt.Q6.create(i,r)}(n):n),d=a.substring(0,a.lastIndexOf("/")+1);let h=r.resolveReference(d||".",l);if(h)try{const e=[],t=await this.readDirectory(h);for(const[n,i]of t)n.charCodeAt(0)===Pn||i!==Ft.Directory&&zn(h,n)===l||e.push(Nn(n,i===Ft.Directory,c));return e}catch(e){}return[]}}const Pn=".".charCodeAt(0);function An(e){return Q(e,"'")||Q(e,'"')?e.slice(1,-1):e}function Nn(e,t,n){return t?{label:Ln(e+="/"),kind:Mt.Io.Folder,textEdit:Mt.mF.replace(n,Ln(e)),command:{title:"Suggest",command:"editor.action.triggerSuggest"}}:{label:Ln(e),kind:Mt.Io.File,textEdit:Mt.mF.replace(n,Ln(e))}}function Ln(e){return e.replace(/(\s|\(|\)|,|"|')/g,"\\$1")}function Wn(e,t){return Mt.yX.create(e.line,e.character+t)}const qn=Mt.q8.Snippet,Un={title:"Suggest",command:"editor.action.triggerSuggest"};var Hn,jn;!function(e){e.Enums=" ",e.Normal="d",e.VendorPrefixed="x",e.Term="y",e.Variable="z"}(Hn||(Hn={}));class $n{constructor(e=null,t,n){this.variablePrefix=e,this.lsOptions=t,this.cssDataManager=n,this.completionParticipants=[]}configure(e){this.defaultSettings=e}getSymbolContext(){return this.symbolContext||(this.symbolContext=new Fn(this.styleSheet)),this.symbolContext}setCompletionParticipants(e){this.completionParticipants=e||[]}async doComplete2(e,t,n,i,r=this.defaultSettings){if(!this.lsOptions.fileSystemProvider||!this.lsOptions.fileSystemProvider.readDirectory)return this.doComplete(e,t,n,r);const o=new On(this.lsOptions.fileSystemProvider.readDirectory),s=this.completionParticipants;this.completionParticipants=[o].concat(s);const a=this.doComplete(e,t,n,r);try{const t=await o.computeCompletions(e,i);return{isIncomplete:a.isIncomplete||t.isIncomplete,itemDefaults:a.itemDefaults,items:t.items.concat(a.items)}}finally{this.completionParticipants=s}}doComplete(e,t,n,i){this.offset=e.offsetAt(t),this.position=t,this.currentWord=function(e,t){let n=t-1;const i=e.getText();for(;n>=0&&-1===' \t\n\r":{[()]},*>+'.indexOf(i.charAt(n));)n--;return i.substring(n+1,t)}(e,this.offset),this.defaultReplaceRange=Mt.Q6.create(Mt.yX.create(this.position.line,this.position.character-this.currentWord.length),this.position),this.textDocument=e,this.styleSheet=n,this.documentSettings=i;try{const e={isIncomplete:!1,itemDefaults:{editRange:{start:{line:t.line,character:t.character-this.currentWord.length},end:t}},items:[]};this.nodePath=re(this.styleSheet,this.offset);for(let t=this.nodePath.length-1;t>=0;t--){const n=this.nodePath[t];if(n instanceof we)this.getCompletionsForDeclarationProperty(n.getParent(),e);else if(n instanceof et)n.parent instanceof ht?this.getVariableProposals(null,e):this.getCompletionsForExpression(n,e);else if(n instanceof me){const t=n.findAParent(te.ExtendsReference,te.Ruleset);if(t)if(t.type===te.ExtendsReference)this.getCompletionsForExtendsReference(t,n,e);else{const n=t;this.getCompletionsForSelector(n,n&&n.isNested(),e)}}else if(n instanceof xe)this.getCompletionsForFunctionArgument(n,n.getParent(),e);else if(n instanceof de)this.getCompletionsForDeclarations(n,e);else if(n instanceof dt)this.getCompletionsForVariableDeclaration(n,e);else if(n instanceof pe)this.getCompletionsForRuleSet(n,e);else if(n instanceof ht)this.getCompletionsForInterpolation(n,e);else if(n instanceof De)this.getCompletionsForFunctionDeclaration(n,e);else if(n instanceof gt)this.getCompletionsForMixinReference(n,e);else if(n instanceof _e)this.getCompletionsForFunctionArgument(null,n,e);else if(n instanceof He)this.getCompletionsForSupports(n,e);else if(n instanceof Qe)this.getCompletionsForSupportsCondition(n,e);else if(n instanceof ut)this.getCompletionsForExtendsReference(n,null,e);else if(n.type===te.URILiteral)this.getCompletionForUriLiteralValue(n,e);else if(null===n.parent)this.getCompletionForTopLevel(e);else{if(n.type!==te.StringLiteral||!this.isImportPathParent(n.parent.type))continue;this.getCompletionForImportPath(n,e)}if(e.items.length>0||this.offset>n.offset)return this.finalize(e)}return this.getCompletionsForStylesheet(e),0===e.items.length&&this.variablePrefix&&0===this.currentWord.indexOf(this.variablePrefix)&&this.getVariableProposals(null,e),this.finalize(e)}finally{this.position=null,this.currentWord=null,this.textDocument=null,this.styleSheet=null,this.symbolContext=null,this.defaultReplaceRange=null,this.nodePath=null}}isImportPathParent(e){return e===te.Import}finalize(e){return e}findInNodePath(...e){for(let t=this.nodePath.length-1;t>=0;t--){const n=this.nodePath[t];if(-1!==e.indexOf(n.type))return n}return null}getCompletionsForDeclarationProperty(e,t){return this.getPropertyProposals(e,t)}getPropertyProposals(e,t){const n=this.isTriggerPropertyValueCompletionEnabled,i=this.isCompletePropertyWithSemicolonEnabled;return this.cssDataManager.getProperties().forEach((r=>{let o,s,a=!1;e?(o=this.getCompletionRange(e.getProperty()),s=r.name,Sn(e.colonPosition)||(s+=": ",a=!0)):(o=this.getCompletionRange(null),s=r.name+": ",a=!0),!e&&i&&(s+="$0;"),e&&!e.semicolonPosition&&i&&this.offset>=this.textDocument.offsetAt(o.end)&&(s+="$0;");const l={label:r.name,documentation:Pt(r,this.doesSupportMarkdown()),tags:Vn(r)?[Mt.QP.Deprecated]:[],textEdit:Mt.mF.replace(o,s),insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Property};r.restrictions||(a=!1),n&&a&&(l.command=Un);const c=(255-("number"==typeof r.relevance?Math.min(Math.max(r.relevance,0),99):50)).toString(16),d=Q(r.name,"-")?Hn.VendorPrefixed:Hn.Normal;l.sortText=d+"_"+c,t.items.push(l)})),this.completionParticipants.forEach((e=>{e.onCssProperty&&e.onCssProperty({propertyName:this.currentWord,range:this.defaultReplaceRange})})),t}get isTriggerPropertyValueCompletionEnabled(){return this.documentSettings?.triggerPropertyValueCompletion??!0}get isCompletePropertyWithSemicolonEnabled(){return this.documentSettings?.completePropertyWithSemicolon??!0}getCompletionsForDeclarationValue(e,t){const n=e.getFullPropertyName(),i=this.cssDataManager.getProperty(n);let r=e.getValue()||null;for(;r&&r.hasChildren();)r=r.findChildAtOffset(this.offset,!1);if(this.completionParticipants.forEach((e=>{e.onCssPropertyValue&&e.onCssPropertyValue({propertyName:n,propertyValue:this.currentWord,range:this.getCompletionRange(r)})})),i){if(i.restrictions)for(const e of i.restrictions)switch(e){case"color":this.getColorProposals(i,r,t);break;case"position":this.getPositionProposals(i,r,t);break;case"repeat":this.getRepeatStyleProposals(i,r,t);break;case"line-style":this.getLineStyleProposals(i,r,t);break;case"line-width":this.getLineWidthProposals(i,r,t);break;case"geometry-box":this.getGeometryBoxProposals(i,r,t);break;case"box":this.getBoxProposals(i,r,t);break;case"image":this.getImageProposals(i,r,t);break;case"timing-function":this.getTimingFunctionProposals(i,r,t);break;case"shape":this.getBasicShapeProposals(i,r,t)}this.getValueEnumProposals(i,r,t),this.getCSSWideKeywordProposals(i,r,t),this.getUnitProposals(i,r,t)}else{const n=function(e,t){const n=t.getFullPropertyName(),i=new Bn;function r(e){return(e instanceof le||e instanceof ct||e instanceof rt)&&i.add(e.getText()),!0}return e.accept((function(e){if(e instanceof be&&e!==t&&function(e){const t=e.getFullPropertyName();return n===t}(e)){const t=e.getValue();t&&t.accept(r)}return!0})),i}(this.styleSheet,e);for(const e of n.getEntries())t.items.push({label:e,textEdit:Mt.mF.replace(this.getCompletionRange(r),e),kind:Mt.Io.Value})}return this.getVariableProposals(r,t),this.getTermProposals(i,r,t),t}getValueEnumProposals(e,t,n){if(e.values)for(const i of e.values){let r,o=i.name;if(Y(o,")")){const e=o.lastIndexOf("(");-1!==e&&(o=o.substring(0,e+1)+"$1"+o.substring(e+1),r=qn)}let s=Hn.Enums;Q(i.name,"-")&&(s+=Hn.VendorPrefixed);const a={label:i.name,documentation:Pt(i,this.doesSupportMarkdown()),tags:Vn(e)?[Mt.QP.Deprecated]:[],textEdit:Mt.mF.replace(this.getCompletionRange(t),o),sortText:s,kind:Mt.Io.Value,insertTextFormat:r};n.items.push(a)}return n}getCSSWideKeywordProposals(e,t,n){for(const e in pn)n.items.push({label:e,documentation:pn[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Value});for(const e in un){const i=Gn(e);n.items.push({label:e,documentation:un[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),i),kind:Mt.Io.Function,insertTextFormat:qn,command:Q(e,"var")?Un:void 0})}return n}getCompletionsForInterpolation(e,t){return this.offset>=e.offset+2&&this.getVariableProposals(null,t),t}getVariableProposals(e,t){const n=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Variable);for(const i of n){const n=Q(i.name,"--")?`var(${i.name})`:i.name,r={label:i.name,documentation:i.value?Z(i.value):i.value,textEdit:Mt.mF.replace(this.getCompletionRange(e),n),kind:Mt.Io.Variable,sortText:Hn.Variable};if("string"==typeof r.documentation&&Jt(r.documentation)&&(r.kind=Mt.Io.Color),i.node.type===te.FunctionParameter){const e=i.node.getParent();e.type===te.MixinDeclaration&&(r.detail=Tt.t("argument from '{0}'",e.getName()))}t.items.push(r)}return t}getVariableProposalsForCSSVarFunction(e){const t=new Bn;this.styleSheet.acceptVisitor(new Jn(t,this.offset));let n=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Variable);for(const i of n){if(Q(i.name,"--")){const t={label:i.name,documentation:i.value?Z(i.value):i.value,textEdit:Mt.mF.replace(this.getCompletionRange(null),i.name),kind:Mt.Io.Variable};"string"==typeof t.documentation&&Jt(t.documentation)&&(t.kind=Mt.Io.Color),e.items.push(t)}t.remove(i.name)}for(const n of t.getEntries())if(Q(n,"--")){const t={label:n,textEdit:Mt.mF.replace(this.getCompletionRange(null),n),kind:Mt.Io.Variable};e.items.push(t)}return e}getUnitProposals(e,t,n){let i="0";if(this.currentWord.length>0){const e=this.currentWord.match(/^-?\d[\.\d+]*/);e&&(i=e[0],n.isIncomplete=i.length===this.currentWord.length)}else 0===this.currentWord.length&&(n.isIncomplete=!0);if(t&&t.parent&&t.parent.type===te.Term&&(t=t.getParent()),e.restrictions)for(const r of e.restrictions){const e=bn[r];if(e)for(const r of e){const e=i+r;n.items.push({label:e,textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Unit})}}return n}getCompletionRange(e){if(e&&e.offset<=this.offset&&this.offset<=e.end){const t=-1!==e.end?this.textDocument.positionAt(e.end):this.position,n=this.textDocument.positionAt(e.offset);if(n.line===t.line)return Mt.Q6.create(n,t)}return this.defaultReplaceRange}getColorProposals(e,t,n){for(const e in jt)n.items.push({label:e,documentation:jt[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Color});for(const e in Vt)n.items.push({label:e,documentation:Vt[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Value});const i=new Bn;this.styleSheet.acceptVisitor(new Kn(i,this.offset));for(const e of i.getEntries())n.items.push({label:e,textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Color});for(const e of Ut)n.items.push({label:e.label,detail:e.func,documentation:e.desc,textEdit:Mt.mF.replace(this.getCompletionRange(t),e.insertText),insertTextFormat:qn,kind:Mt.Io.Function});return n}getPositionProposals(e,t,n){for(const e in sn)n.items.push({label:e,documentation:sn[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Value});return n}getRepeatStyleProposals(e,t,n){for(const e in an)n.items.push({label:e,documentation:an[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Value});return n}getLineStyleProposals(e,t,n){for(const e in ln)n.items.push({label:e,documentation:ln[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Value});return n}getLineWidthProposals(e,t,n){for(const e of cn)n.items.push({label:e,textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Value});return n}getGeometryBoxProposals(e,t,n){for(const e in hn)n.items.push({label:e,documentation:hn[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Value});return n}getBoxProposals(e,t,n){for(const e in dn)n.items.push({label:e,documentation:dn[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),e),kind:Mt.Io.Value});return n}getImageProposals(e,t,n){for(const e in mn){const i=Gn(e);n.items.push({label:e,documentation:mn[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),i),kind:Mt.Io.Function,insertTextFormat:e!==i?qn:void 0})}return n}getTimingFunctionProposals(e,t,n){for(const e in fn){const i=Gn(e);n.items.push({label:e,documentation:fn[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),i),kind:Mt.Io.Function,insertTextFormat:e!==i?qn:void 0})}return n}getBasicShapeProposals(e,t,n){for(const e in gn){const i=Gn(e);n.items.push({label:e,documentation:gn[e],textEdit:Mt.mF.replace(this.getCompletionRange(t),i),kind:Mt.Io.Function,insertTextFormat:e!==i?qn:void 0})}return n}getCompletionsForStylesheet(e){const t=this.styleSheet.findFirstChildBeforeOffset(this.offset);return t?t instanceof pe?this.getCompletionsForRuleSet(t,e):t instanceof He?this.getCompletionsForSupports(t,e):e:this.getCompletionForTopLevel(e)}getCompletionForTopLevel(e){return this.cssDataManager.getAtDirectives().forEach((t=>{e.items.push({label:t.name,textEdit:Mt.mF.replace(this.getCompletionRange(null),t.name),documentation:Pt(t,this.doesSupportMarkdown()),tags:Vn(t)?[Mt.QP.Deprecated]:[],kind:Mt.Io.Keyword})})),this.getCompletionsForSelector(null,!1,e),e}getCompletionsForRuleSet(e,t){const n=e.getDeclarations();return n&&n.endsWith("}")&&this.offset>=n.end?this.getCompletionForTopLevel(t):!n||this.offset<=n.offset?this.getCompletionsForSelector(e,e.isNested(),t):this.getCompletionsForDeclarations(e.getDeclarations(),t)}getCompletionsForSelector(e,t,n){const i=this.findInNodePath(te.PseudoSelector,te.IdentifierSelector,te.ClassSelector,te.ElementNameSelector);if(!i&&this.hasCharacterAtPosition(this.offset-this.currentWord.length-1,":")&&(this.currentWord=":"+this.currentWord,this.hasCharacterAtPosition(this.offset-this.currentWord.length-1,":")&&(this.currentWord=":"+this.currentWord),this.defaultReplaceRange=Mt.Q6.create(Mt.yX.create(this.position.line,this.position.character-this.currentWord.length),this.position)),this.cssDataManager.getPseudoClasses().forEach((e=>{const t=Gn(e.name),r={label:e.name,textEdit:Mt.mF.replace(this.getCompletionRange(i),t),documentation:Pt(e,this.doesSupportMarkdown()),tags:Vn(e)?[Mt.QP.Deprecated]:[],kind:Mt.Io.Function,insertTextFormat:e.name!==t?qn:void 0};Q(e.name,":-")&&(r.sortText=Hn.VendorPrefixed),n.items.push(r)})),this.cssDataManager.getPseudoElements().forEach((e=>{const t=Gn(e.name),r={label:e.name,textEdit:Mt.mF.replace(this.getCompletionRange(i),t),documentation:Pt(e,this.doesSupportMarkdown()),tags:Vn(e)?[Mt.QP.Deprecated]:[],kind:Mt.Io.Function,insertTextFormat:e.name!==t?qn:void 0};Q(e.name,"::-")&&(r.sortText=Hn.VendorPrefixed),n.items.push(r)})),!t){for(const e of vn)n.items.push({label:e,textEdit:Mt.mF.replace(this.getCompletionRange(i),e),kind:Mt.Io.Keyword});for(const e of wn)n.items.push({label:e,textEdit:Mt.mF.replace(this.getCompletionRange(i),e),kind:Mt.Io.Keyword})}const r={};r[this.currentWord]=!0;const o=this.textDocument.getText();if(this.styleSheet.accept((e=>{if(e.type===te.SimpleSelector&&e.length>0){const t=o.substr(e.offset,e.length);return"."!==t.charAt(0)||r[t]||(r[t]=!0,n.items.push({label:t,textEdit:Mt.mF.replace(this.getCompletionRange(i),t),kind:Mt.Io.Keyword})),!1}return!0})),e&&e.isNested()){const t=e.getSelectors().findFirstChildBeforeOffset(this.offset);t&&0===e.getSelectors().getChildren().indexOf(t)&&this.getPropertyProposals(null,n)}return n}getCompletionsForDeclarations(e,t){if(!e||this.offset===e.offset)return t;const n=e.findFirstChildBeforeOffset(this.offset);if(!n)return this.getCompletionsForDeclarationProperty(null,t);if(n instanceof fe){const e=n;if(!Sn(e.colonPosition)||this.offset<=e.colonPosition)return this.getCompletionsForDeclarationProperty(e,t);if(Sn(e.semicolonPosition)&&e.semicolonPositione.colonPosition&&this.getVariableProposals(e.getValue()||null,t),t}getCompletionsForExpression(e,t){const n=e.getParent();if(n instanceof xe)return this.getCompletionsForFunctionArgument(n,n.getParent(),t),t;const i=e.findParent(te.Declaration);if(!i)return this.getTermProposals(void 0,null,t),t;const r=e.findChildAtOffset(this.offset,!0);return r?r instanceof ct||r instanceof le?this.getCompletionsForDeclarationValue(i,t):t:this.getCompletionsForDeclarationValue(i,t)}getCompletionsForFunctionArgument(e,t,n){const i=t.getIdentifier();return i&&i.matches("var")&&(t.getArguments().hasChildren()&&t.getArguments().getChild(0)!==e||this.getVariableProposalsForCSSVarFunction(n)),n}getCompletionsForFunctionDeclaration(e,t){const n=e.getDeclarations();return n&&this.offset>n.offset&&this.offset{e.onCssMixinReference&&e.onCssMixinReference({mixinName:this.currentWord,range:this.getCompletionRange(i)})})),t}getTermProposals(e,t,n){const i=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Function);for(const e of i)e.node instanceof De&&n.items.push(this.makeTermProposal(e,e.node.getParameters(),t));return n}makeTermProposal(e,t,n){e.node;const i=t.getChildren().map((e=>e instanceof Se?e.getName():e.getText())),r=e.name+"("+i.map(((e,t)=>"${"+(t+1)+":"+e+"}")).join(", ")+")";return{label:e.name,detail:e.name+"("+i.join(", ")+")",textEdit:Mt.mF.replace(this.getCompletionRange(n),r),insertTextFormat:qn,kind:Mt.Io.Function,sortText:Hn.Term}}getCompletionsForSupportsCondition(e,t){const n=e.findFirstChildBeforeOffset(this.offset);if(n){if(n instanceof be)return!Sn(n.colonPosition)||this.offset<=n.colonPosition?this.getCompletionsForDeclarationProperty(n,t):this.getCompletionsForDeclarationValue(n,t);if(n instanceof Qe)return this.getCompletionsForSupportsCondition(n,t)}return Sn(e.lParent)&&this.offset>e.lParent&&(!Sn(e.rParent)||this.offset<=e.rParent)?this.getCompletionsForDeclarationProperty(null,t):t}getCompletionsForSupports(e,t){const n=e.getDeclarations();if(!n||this.offset<=n.offset){const n=e.findFirstChildBeforeOffset(this.offset);return n instanceof Qe?this.getCompletionsForSupportsCondition(n,t):t}return this.getCompletionForTopLevel(t)}getCompletionsForExtendsReference(e,t,n){return n}getCompletionForUriLiteralValue(e,t){let n,i,r;if(e.hasChildren()){const t=e.getChild(0);n=t.getText(),i=this.position,r=this.getCompletionRange(t)}else{n="",i=this.position;const t=this.textDocument.positionAt(e.offset+4);r=Mt.Q6.create(t,t)}return this.completionParticipants.forEach((e=>{e.onCssURILiteralValue&&e.onCssURILiteralValue({uriValue:n,position:i,range:r})})),t}getCompletionForImportPath(e,t){return this.completionParticipants.forEach((t=>{t.onCssImportPath&&t.onCssImportPath({pathValue:e.getText(),position:this.position,range:this.getCompletionRange(e)})})),t}hasCharacterAtPosition(e,t){const n=this.textDocument.getText();return e>=0&&e"),this.writeLine(t,i.join(""))}}!function(e){function t(e){const t=e.match(/^['"](.*)["']$/);return t?t[1]:e}e.ensure=function(e,n){return n+t(e)+n},e.remove=t}(jn||(jn={}));class ei{constructor(){this.id=0,this.attr=0,this.tag=0}}function ti(e,t){let n=new Xn;for(const i of e.getChildren())switch(i.type){case te.SelectorCombinator:if(t){const e=i.getText().split("&");if(1===e.length){n.addAttr("name",e[0]);break}n=t.cloneWithParent(),e[0]&&n.findRoot().prepend(e[0]);for(let i=1;i1){const e=t.cloneWithParent();n.addChild(e.findRoot()),n=e}n.append(e[i])}}break;case te.SelectorPlaceholder:if(i.matches("@at-root"))return n;case te.ElementNameSelector:const e=i.getText();n.addAttr("name","*"===e?"element":ni(e));break;case te.ClassSelector:n.addAttr("class",ni(i.getText().substring(1)));break;case te.IdentifierSelector:n.addAttr("id",ni(i.getText().substring(1)));break;case te.MixinDeclaration:n.addAttr("class",i.getName());break;case te.PseudoSelector:n.addAttr(ni(i.getText()),"");break;case te.AttributeSelector:const r=i,o=r.getIdentifier();if(o){const e=r.getValue(),t=r.getOperator();let i;if(e&&t)switch(ni(t.getText())){case"|=":i=`${jn.remove(ni(e.getText()))}-…`;break;case"^=":i=`${jn.remove(ni(e.getText()))}…`;break;case"$=":i=`…${jn.remove(ni(e.getText()))}`;break;case"~=":i=` … ${jn.remove(ni(e.getText()))} … `;break;case"*=":i=`…${jn.remove(ni(e.getText()))}…`;break;default:i=jn.remove(ni(e.getText()))}n.addAttr(ni(o.getText()),i)}}return n}function ni(e){const t=new X;t.setSource(e);const n=t.scanUnquotedString();return n?n.text:e}class ii{constructor(e){this.cssDataManager=e}selectorToMarkedString(e,t){const n=function(e){if(e.matches("@at-root"))return null;const t=new Qn,n=[],i=e.getParent();if(i instanceof pe){let e=i.getParent();for(;e&&!oi(e);){if(e instanceof pe){if(e.getSelectors().matches("@at-root"))break;n.push(e)}e=e.getParent()}}const r=new ri(t);for(let e=n.length-1;e>=0;e--){const t=n[e].getSelectors().getChild(0);t&&r.processSelector(t)}return r.processSelector(e),t}(e);if(n){const i=new Zn('"').print(n,t);return i.push(this.selectorToSpecificityMarkedString(e)),i}return[]}simpleSelectorToMarkedString(e){const t=ti(e),n=new Zn('"').print(t);return n.push(this.selectorToSpecificityMarkedString(e)),n}isPseudoElementIdentifier(e){const t=e.match(/^::?([\w-]+)/);return!!t&&!!this.cssDataManager.getPseudoElement("::"+t[1])}selectorToSpecificityMarkedString(e){const t=e=>{const t=new ei;let i=new ei;for(const t of e)for(const e of t.getChildren()){const t=n(e);t.id>i.id?i=t:t.idi.attr?i=t:t.attri.tag&&(i=t))}return t.id+=i.id,t.attr+=i.attr,t.tag+=i.tag,t},n=e=>{const i=new ei;e:for(const r of e.getChildren()){switch(r.type){case te.IdentifierSelector:i.id++;break;case te.ClassSelector:case te.AttributeSelector:i.attr++;break;case te.ElementNameSelector:if(r.matches("*"))break;i.tag++;break;case te.PseudoSelector:const e=r.getText(),n=r.getChildren();if(this.isPseudoElementIdentifier(e)){if(e.match(/^::slotted/i)&&n.length>0){i.tag++;let e=t(n);i.id+=e.id,i.attr+=e.attr,i.tag+=e.tag;continue e}i.tag++;continue e}if(e.match(/^:where/i))continue e;if(e.match(/^:(?:not|has|is)/i)&&n.length>0){let e=t(n);i.id+=e.id,i.attr+=e.attr,i.tag+=e.tag;continue e}if(e.match(/^:(?:host|host-context)/i)&&n.length>0){i.attr++;let e=t(n);i.id+=e.id,i.attr+=e.attr,i.tag+=e.tag;continue e}if(e.match(/^:(?:nth-child|nth-last-child)/i)&&n.length>0){if(i.attr++,3===n.length&&23===n[1].type){let e=t(n[2].getChildren());i.id+=e.id,i.attr+=e.attr,i.tag+=e.tag;continue e}const e=new xn,r=n[1].getText();e.scanner.setSource(r);const o=e.scanner.scan(),s=e.scanner.scan();if("n"===o.text||"-n"===o.text&&"of"===s.text){const n=[],o=r.slice(s.offset+2).split(",");for(const t of o){const i=e.internalParse(t,e._parseSelector);i&&n.push(i)}let a=t(n);i.id+=a.id,i.attr+=a.attr,i.tag+=a.tag;continue e}continue e}i.attr++;continue e}if(r.getChildren().length>0){const e=n(r);i.id+=e.id,i.attr+=e.attr,i.tag+=e.tag}}return i},i=n(e);return`[${Tt.t("Selector Specificity")}](https://developer.mozilla.org/docs/Web/CSS/Specificity): (${i.id}, ${i.attr}, ${i.tag})`}}class ri{constructor(e){this.prev=null,this.element=e}processSelector(e){let t=null;if(!(this.element instanceof Qn)&&e.getChildren().some((e=>e.hasChildren()&&e.getChild(0).type===te.SelectorCombinator))){const e=this.element.findRoot();e.parent instanceof Qn&&(t=this.element,this.element=e.parent,this.element.removeChild(e),this.prev=null)}for(const n of e.getChildren()){if(n instanceof me){if(this.prev instanceof me){const e=new Yn("…");this.element.addChild(e),this.element=e}else this.prev&&(this.prev.matches("+")||this.prev.matches("~"))&&this.element.parent&&(this.element=this.element.parent);this.prev&&this.prev.matches("~")&&this.element.addChild(new Yn("⋮"));const e=ti(n,t),i=e.findRoot();this.element.addChild(i),this.element=e}(n instanceof me||n.type===te.SelectorCombinatorParent||n.type===te.SelectorCombinatorShadowPiercingDescendant||n.type===te.SelectorCombinatorSibling||n.type===te.SelectorCombinatorAllSiblings)&&(this.prev=n)}}}function oi(e){switch(e.type){case te.MixinDeclaration:case te.Stylesheet:return!0}return!1}class si{constructor(e,t){this.clientCapabilities=e,this.cssDataManager=t,this.selectorPrinting=new ii(t)}configure(e){this.defaultSettings=e}doHover(e,t,n,i=this.defaultSettings){function r(t){return Mt.Q6.create(e.positionAt(t.offset),e.positionAt(t.end))}const o=re(n,e.offsetAt(t));let s,a=null;for(let e=0;e"string"==typeof e?e:e.value)):e.value}doesSupportMarkdown(){if(!Sn(this.supportsMarkdown)){if(!Sn(this.clientCapabilities))return this.supportsMarkdown=!0,this.supportsMarkdown;const e=this.clientCapabilities.textDocument&&this.clientCapabilities.textDocument.hover;this.supportsMarkdown=e&&e.contentFormat&&Array.isArray(e.contentFormat)&&-1!==e.contentFormat.indexOf(Mt.nw.Markdown)}return this.supportsMarkdown}}const ai=/^\w+:\/\//,li=/^data:/;class ci{constructor(e,t){this.fileSystemProvider=e,this.resolveModuleReferences=t}configure(e){this.defaultSettings=e}findDefinition(e,t,n){const i=new Fn(n),r=ie(n,e.offsetAt(t));if(!r)return null;const o=i.findSymbolFromNode(r);return o?{uri:e.uri,range:di(o.node,e)}:null}findReferences(e,t,n){return this.findDocumentHighlights(e,t,n).map((t=>({uri:e.uri,range:t.range})))}getHighlightNode(e,t,n){let i=ie(n,e.offsetAt(t));if(i&&i.type!==te.Stylesheet&&i.type!==te.Declarations&&i.type!==te.ModuleConfig)return i.type===te.Identifier&&i.parent&&i.parent.type===te.ClassSelector&&(i=i.parent),i}findDocumentHighlights(e,t,n){const i=[],r=this.getHighlightNode(e,t,n);if(!r)return i;const o=new Fn(n),s=o.findSymbolFromNode(r),a=r.getText();return n.accept((t=>{if(s){if(o.matchesSymbol(t,s))return i.push({kind:pi(t),range:di(t,e)}),!1}else r&&r.type===t.type&&t.matches(a)&&i.push({kind:pi(t),range:di(t,e)});return!0})),i}isRawStringDocumentLinkNode(e){return e.type===te.Import}findDocumentLinks(e,t,n){const i=this.findUnresolvedLinks(e,t),r=[];for(let t of i){const i=t.link,o=i.target;if(!o||li.test(o));else if(ai.test(o))r.push(i);else{const t=n.resolveReference(o,e.uri);t&&(i.target=t),r.push(i)}}return r}async findDocumentLinks2(e,t,n){const i=this.findUnresolvedLinks(e,t),r=[];for(let t of i){const i=t.link,o=i.target;if(!o||li.test(o));else if(ai.test(o))r.push(i);else{const s=await this.resolveReference(o,e.uri,n,t.isRawLink);void 0!==s&&(i.target=s,r.push(i))}}return r}findUnresolvedLinks(e,t){const n=[],i=t=>{let i=t.getText();const r=di(t,e);if(r.start.line===r.end.line&&r.start.character===r.end.character)return;(Q(i,"'")||Q(i,'"'))&&(i=i.slice(1,-1));const o=!!t.parent&&this.isRawStringDocumentLinkNode(t.parent);n.push({link:{target:i,range:r},isRawLink:o})};return t.accept((e=>{if(e.type===te.URILiteral){const t=e.getChild(0);return t&&i(t),!1}if(e.parent&&this.isRawStringDocumentLinkNode(e.parent)){const t=e.getText();return(Q(t,"'")||Q(t,'"'))&&i(e),!1}return!0})),n}findSymbolInformations(e,t){const n=[];return this.collectDocumentSymbols(e,t,((t,i,r)=>{const o=r instanceof oe?di(r,e):r,s={name:t||Tt.t(""),kind:i,location:Mt.aZ.create(e.uri,o)};n.push(s)})),n}findDocumentSymbols(e,t){const n=[],i=[];return this.collectDocumentSymbols(e,t,((t,r,o,s,a)=>{const l=o instanceof oe?di(o,e):o;let c=s instanceof oe?di(s,e):s;c&&hi(l,c)||(c=Mt.Q6.create(l.start,l.start));const d={name:t||Tt.t(""),kind:r,range:l,selectionRange:c};let h=i.pop();for(;h&&!hi(h[1],l);)h=i.pop();if(h){const e=h[0];e.children||(e.children=[]),e.children.push(d),i.push(h)}else n.push(d);a&&i.push([d,di(a,e)])})),n}collectDocumentSymbols(e,t,n){t.accept((t=>{if(t instanceof pe){for(const i of t.getSelectors().getChildren())if(i instanceof ue){const r=Mt.Q6.create(e.positionAt(i.offset),e.positionAt(t.end));n(i.getText(),Mt.v0.Class,r,i,t.getDeclarations())}}else if(t instanceof dt)n(t.getName(),Mt.v0.Variable,t,t.getVariable(),void 0);else if(t instanceof bt)n(t.getName(),Mt.v0.Method,t,t.getIdentifier(),t.getDeclarations());else if(t instanceof De)n(t.getName(),Mt.v0.Function,t,t.getIdentifier(),t.getDeclarations());else if(t instanceof ze){const e=Tt.t("@keyframes {0}",t.getName());n(e,Mt.v0.Class,t,t.getIdentifier(),t.getDeclarations())}else if(t instanceof Me){const e=Tt.t("@font-face");n(e,Mt.v0.Class,t,void 0,t.getDeclarations())}else if(t instanceof Ue){const e=t.getChild(0);if(e instanceof Ge){const i="@media "+e.getText();n(i,Mt.v0.Module,t,e,t.getDeclarations())}}return!0}))}findDocumentColors(e,t){const n=[];return t.accept((t=>{const i=function(e,t){const n=function(e){if(e.type===te.HexColorValue)return nn(e.getText());if(e.type===te.Function){const t=e,n=t.getName();let i=t.getArguments().getChildren();if(1===i.length){const e=i[0].getChildren();if(1===e.length&&e[0].type===te.Expression&&(i=e[0].getChildren(),3===i.length)){const e=i[2];if(e instanceof tt){const t=e.getLeft(),n=e.getRight(),r=e.getOperator();t&&n&&r&&r.matches("/")&&(i=[i[0],i[1],t,n])}}}if(!n||i.length<3||i.length>4)return null;try{const e=4===i.length?Gt(i[3],1):1;if("rgb"===n||"rgba"===n)return{red:Gt(i[0],255),green:Gt(i[1],255),blue:Gt(i[2],255),alpha:e};if("hsl"===n||"hsla"===n){return rn(Kt(i[0]),Gt(i[1],100),Gt(i[2],100),e)}if("hwb"===n){return function(e,t,n,i=1){if(t+n>=1){const e=t/(t+n);return{red:e,green:e,blue:e,alpha:i}}const r=rn(e,1,.5,i);let o=r.red;o*=1-t-n,o+=t;let s=r.green;s*=1-t-n,s+=t;let a=r.blue;return a*=1-t-n,a+=t,{red:o,green:s,blue:a,alpha:i}}(Kt(i[0]),Gt(i[1],100),Gt(i[2],100),e)}}catch(e){return null}}else if(e.type===te.Identifier){if(e.parent&&e.parent.type!==te.Term)return null;const t=e.parent;if(t&&t.parent&&t.parent.type===te.BinaryExpression){const e=t.parent;if(e.parent&&e.parent.type===te.ListEntry&&e.parent.key===e)return null}const n=e.getText().toLowerCase();if("none"===n)return null;const i=jt[n];if(i)return nn(i)}return null}(e);return n?{color:n,range:di(e,t)}:null}(t,e);return i&&n.push(i),!0})),n}getColorPresentations(e,t,n,i){const r=[],o=Math.round(255*n.red),s=Math.round(255*n.green),a=Math.round(255*n.blue);let l;l=1===n.alpha?`rgb(${o}, ${s}, ${a})`:`rgba(${o}, ${s}, ${a}, ${n.alpha})`,r.push({label:l,textEdit:Mt.mF.replace(i,l)}),l=1===n.alpha?`#${ui(o)}${ui(s)}${ui(a)}`:`#${ui(o)}${ui(s)}${ui(a)}${ui(Math.round(255*n.alpha))}`,r.push({label:l,textEdit:Mt.mF.replace(i,l)});const c=on(n);l=1===c.a?`hsl(${c.h}, ${Math.round(100*c.s)}%, ${Math.round(100*c.l)}%)`:`hsla(${c.h}, ${Math.round(100*c.s)}%, ${Math.round(100*c.l)}%, ${c.a})`,r.push({label:l,textEdit:Mt.mF.replace(i,l)});const d=function(e){const t=on(e),n=Math.min(e.red,e.green,e.blue),i=1-Math.max(e.red,e.green,e.blue);return{h:t.h,w:n,b:i,a:t.a}}(n);return l=1===d.a?`hwb(${d.h} ${Math.round(100*d.w)}% ${Math.round(100*d.b)}%)`:`hwb(${d.h} ${Math.round(100*d.w)}% ${Math.round(100*d.b)}% / ${d.a})`,r.push({label:l,textEdit:Mt.mF.replace(i,l)}),r}prepareRename(e,t,n){const i=this.getHighlightNode(e,t,n);if(i)return Mt.Q6.create(e.positionAt(i.offset),e.positionAt(i.end))}doRename(e,t,n,i){const r=this.findDocumentHighlights(e,t,i).map((e=>Mt.mF.replace(e.range,n)));return{changes:{[e.uri]:r}}}async resolveModuleReference(e,t,n){if(Q(t,"file://")){const i=mi(e);if(i&&"."!==i&&".."!==i){const r=n.resolveReference("/",t),o=In(t),s=await this.resolvePathToModule(i,o,r);if(s)return zn(s,e.substring(i.length+1))}}}async mapReference(e,t){return e}async resolveReference(e,t,n,i=!1,r=this.defaultSettings){if("~"===e[0]&&"/"!==e[1]&&this.fileSystemProvider)return e=e.substring(1),this.mapReference(await this.resolveModuleReference(e,t,n),i);const o=await this.mapReference(n.resolveReference(e,t),i);if(this.resolveModuleReferences){if(o&&await this.fileExists(o))return o;const r=await this.mapReference(await this.resolveModuleReference(e,t,n),i);if(r)return r}if(o&&!await this.fileExists(o)){const o=n.resolveReference("/",t);if(r&&o){if(e in r)return this.mapReference(zn(o,r[e]),i);const t=e.indexOf("/"),n=`${e.substring(0,t)}/`;if(n in r){let t=zn(o,r[n].slice(0,-1));return this.mapReference(t=zn(t,e.substring(n.length-1)),i)}}}return o}async resolvePathToModule(e,t,n){const i=zn(t,"node_modules",e,"package.json");return await this.fileExists(i)?In(i):n&&t.startsWith(n)&&t.length!==n.length?this.resolvePathToModule(e,In(t),n):void 0}async fileExists(e){if(!this.fileSystemProvider)return!1;try{const t=await this.fileSystemProvider.stat(e);return t.type!==Ft.Unknown||-1!==t.size}catch(e){return!1}}async getContent(e){if(!this.fileSystemProvider||!this.fileSystemProvider.getContent)return null;try{return await this.fileSystemProvider.getContent(e)}catch(e){return null}}}function di(e,t){return Mt.Q6.create(t.positionAt(e.offset),t.positionAt(e.end))}function hi(e,t){const n=t.start.line,i=t.end.line,r=e.start.line,o=e.end.line;return!(no||i>o||n===r&&t.start.charactere.end.character)}function pi(e){if(e.type===te.Selector)return Mt.Kb.Write;if(e instanceof le&&e.parent&&e.parent instanceof we&&e.isCustomProperty)return Mt.Kb.Write;if(e.parent)switch(e.parent.type){case te.FunctionDeclaration:case te.MixinDeclaration:case te.Keyframe:case te.VariableDeclaration:case te.FunctionParameter:return Mt.Kb.Write}return Mt.Kb.Read}function ui(e){const t=e.toString(16);return 2!==t.length?"0"+t:t}function mi(e){const t=e.indexOf("/");if(-1===t)return"";if("@"===e[0]){const n=e.indexOf("/",t+1);return-1===n?e:e.substring(0,n)}return e.substring(0,t)}const fi=xt.Warning,gi=xt.Error,bi=xt.Ignore;class vi{constructor(e,t,n){this.id=e,this.message=t,this.defaultValue=n}}const wi={AllVendorPrefixes:new vi("compatibleVendorPrefixes",Tt.t("When using a vendor-specific prefix make sure to also include all other vendor-specific properties"),bi),IncludeStandardPropertyWhenUsingVendorPrefix:new vi("vendorPrefix",Tt.t("When using a vendor-specific prefix also include the standard property"),fi),DuplicateDeclarations:new vi("duplicateProperties",Tt.t("Do not use duplicate style definitions"),bi),EmptyRuleSet:new vi("emptyRules",Tt.t("Do not use empty rulesets"),fi),ImportStatemement:new vi("importStatement",Tt.t("Import statements do not load in parallel"),bi),BewareOfBoxModelSize:new vi("boxModel",Tt.t("Do not use width or height when using padding or border"),bi),UniversalSelector:new vi("universalSelector",Tt.t("The universal selector (*) is known to be slow"),bi),ZeroWithUnit:new vi("zeroUnits",Tt.t("No unit for zero needed"),bi),RequiredPropertiesForFontFace:new vi("fontFaceProperties",Tt.t("@font-face rule must define 'src' and 'font-family' properties"),fi),HexColorLength:new vi("hexColorLength",Tt.t("Hex colors must consist of three, four, six or eight hex numbers"),gi),ArgsInColorFunction:new vi("argumentsInColorFunction",Tt.t("Invalid number of parameters"),gi),UnknownProperty:new vi("unknownProperties",Tt.t("Unknown property."),fi),UnknownAtRules:new vi("unknownAtRules",Tt.t("Unknown at-rule."),fi),IEStarHack:new vi("ieHack",Tt.t("IE hacks are only necessary when supporting IE7 and older"),bi),UnknownVendorSpecificProperty:new vi("unknownVendorSpecificProperties",Tt.t("Unknown vendor specific property."),bi),PropertyIgnoredDueToDisplay:new vi("propertyIgnoredDueToDisplay",Tt.t("Property is ignored due to the display."),fi),AvoidImportant:new vi("important",Tt.t("Avoid using !important. It is an indication that the specificity of the entire CSS has gotten out of control and needs to be refactored."),bi),AvoidFloat:new vi("float",Tt.t("Avoid using 'float'. Floats lead to fragile CSS that is easy to break if one aspect of the layout changes."),bi),AvoidIdSelector:new vi("idSelector",Tt.t("Selectors should not contain IDs because these rules are too tightly coupled with the HTML."),bi)},yi={ValidProperties:new class{constructor(e,t,n){this.id=e,this.message=t,this.defaultValue=n}}("validProperties",Tt.t("A list of properties that are not validated against the `unknownProperties` rule."),[])};class _i{constructor(e={}){this.conf=e}getRule(e){if(this.conf.hasOwnProperty(e.id)){const t=function(e){switch(e){case"ignore":return xt.Ignore;case"warning":return xt.Warning;case"error":return xt.Error}return null}(this.conf[e.id]);if(t)return t}return e.defaultValue}getSetting(e){return this.conf[e.id]}}class Si{constructor(e){this.cssDataManager=e}doCodeActions(e,t,n,i){return this.doCodeActions2(e,t,n,i).map((t=>{const n=t.edit&&t.edit.documentChanges&&t.edit.documentChanges[0];return Mt.uB.create(t.title,"_css.applyCodeAction",e.uri,e.version,n&&n.edits)}))}doCodeActions2(e,t,n,i){const r=[];if(n.diagnostics)for(const t of n.diagnostics)this.appendFixesForMarker(e,i,t,r);return r}getFixesForUnknownProperty(e,t,n,i){const r=t.getName(),o=[];this.cssDataManager.getProperties().forEach((e=>{const t=function(e,t,n=4){let i=Math.abs(e.length-t.length);if(i>n)return 0;let r,o,s=[],a=[];for(r=0;r=r.length/2&&o.push({property:e.name,score:t})})),o.sort(((e,t)=>t.score-e.score||e.property.localeCompare(t.property)));let s=3;for(const t of o){const r=t.property,o=Tt.t("Rename to '{0}'",r),a=Mt.mF.replace(n.range,r),l=Mt.Fr.create(e.uri,e.version),c={documentChanges:[Mt.d3.create(l,[a])]},d=Mt.gY.create(o,c,Mt.gB.QuickFix);if(d.diagnostics=[n],i.push(d),--s<=0)return}}appendFixesForMarker(e,t,n,i){if(n.code!==wi.UnknownProperty.id)return;const r=e.offsetAt(n.range.start),o=e.offsetAt(n.range.end),s=re(t,r);for(let t=s.length-1;t>=0;t--){const a=s[t];if(a instanceof be){const t=a.getProperty();if(t&&t.offset===r&&t.end===o)return void this.getFixesForUnknownProperty(e,t,n,i)}}}}class xi{constructor(e){this.fullPropertyName=e.getFullPropertyName().toLowerCase(),this.node=e}}function ki(e,t,n,i){const r=e[t];r.value=n,n&&(kn(r.properties,i)||r.properties.push(i))}function Ci(e,t,n,i){"top"===t||"right"===t||"bottom"===t||"left"===t?ki(e,t,n,i):function(e,t,n){ki(e,"top",t,n),ki(e,"right",t,n),ki(e,"bottom",t,n),ki(e,"left",t,n)}(e,n,i)}function Ti(e,t,n){switch(t.length){case 1:Ci(e,void 0,t[0],n);break;case 2:Ci(e,"top",t[0],n),Ci(e,"bottom",t[0],n),Ci(e,"right",t[1],n),Ci(e,"left",t[1],n);break;case 3:Ci(e,"top",t[0],n),Ci(e,"right",t[1],n),Ci(e,"left",t[1],n),Ci(e,"bottom",t[2],n);break;case 4:Ci(e,"top",t[0],n),Ci(e,"right",t[1],n),Ci(e,"bottom",t[2],n),Ci(e,"left",t[3],n)}}function Ei(e,t){for(let n of t)if(e.matches(n))return!0;return!1}function Ri(e,t=!0){return!(t&&Ei(e,["initial","unset"])||0===parseFloat(e.getText()))}function Di(e,t=!0){return e.map((e=>Ri(e,t)))}function Fi(e,t=!0){return!(Ei(e,["none","hidden"])||t&&Ei(e,["initial","unset"]))}function Mi(e,t=!0){return e.map((e=>Fi(e,t)))}function Ii(e){const t=e.getChildren();if(1===t.length){const e=t[0];return Ri(e)&&Fi(e)}for(const e of t){const t=e;if(!Ri(t,!1)||!Fi(t,!1))return!1}return!0}class zi{constructor(){this.data={}}add(e,t,n){let i=this.data[e];i||(i={nodes:[],names:[]},this.data[e]=i),i.names.push(t),n&&i.nodes.push(n)}}class Oi{static entries(e,t,n,i,r){const o=new Oi(t,n,i);return e.acceptVisitor(o),o.completeValidations(),o.getEntries(r)}constructor(e,t,n){this.cssDataManager=n,this.warnings=[],this.settings=t,this.documentText=e.getText(),this.keyframes=new zi,this.validProperties={};const i=t.getSetting(yi.ValidProperties);Array.isArray(i)&&i.forEach((e=>{if("string"==typeof e){const t=e.trim().toLowerCase();t.length&&(this.validProperties[t]=!0)}}))}isValidPropertyDeclaration(e){const t=e.fullPropertyName;return this.validProperties[t]}fetch(e,t){const n=[];for(const i of e)i.fullPropertyName===t&&n.push(i);return n}fetchWithValue(e,t,n){const i=[];for(const r of e)if(r.fullPropertyName===t){const e=r.node.getValue();e&&this.findValueInExpression(e,n)&&i.push(r)}return i}findValueInExpression(e,t){let n=!1;return e.accept((e=>(e.type===te.Identifier&&e.matches(t)&&(n=!0),!n))),n}getEntries(e=xt.Warning|xt.Error){return this.warnings.filter((t=>!!(t.getLevel()&e)))}addEntry(e,t,n){const i=new kt(e,t,this.settings.getRule(t),n);this.warnings.push(i)}getMissingNames(e,t){const n=e.slice(0);for(let e=0;e0){const e=this.fetch(n,"float");for(let t=0;t0){const e=this.fetch(n,"vertical-align");for(let t=0;t1)for(let n=0;ne.startsWith(r)))&&s.delete(e)}}const a=[];for(let e=0,t=Oi.prefixes.length;e!(e instanceof tt&&(i+=1,1)))),i!==n&&this.addEntry(e,wi.ArgsInColorFunction)),!0}}Oi.prefixes=["-ms-","-moz-","-o-","-webkit-"];class Pi{constructor(e){this.cssDataManager=e}configure(e){this.settings=e}doValidation(e,t,n=this.settings){if(n&&!1===n.validate)return[];const i=[];i.push.apply(i,Ct.entries(t)),i.push.apply(i,Oi.entries(t,e,new _i(n&&n.lint),this.cssDataManager));const r=[];for(const e in wi)r.push(wi[e].id);return i.filter((e=>e.getLevel()!==xt.Ignore)).map((function(t){const n=Mt.Q6.create(e.positionAt(t.getOffset()),e.positionAt(t.getOffset()+t.getLength())),i=e.languageId;return{code:t.getRule().id,source:i,message:t.getMessage(),severity:t.getLevel()===xt.Warning?Mt.h_.Warning:Mt.h_.Error,range:n}}))}}const Ai="/".charCodeAt(0),Ni="\n".charCodeAt(0),Li="\r".charCodeAt(0),Wi="\f".charCodeAt(0),qi="$".charCodeAt(0),Ui="#".charCodeAt(0),Hi="{".charCodeAt(0),ji="=".charCodeAt(0),$i="!".charCodeAt(0),Vi="<".charCodeAt(0),Bi=">".charCodeAt(0),Gi=".".charCodeAt(0);"@".charCodeAt(0);let Ki=i.CustomToken;const Ji=Ki++,Xi=Ki++,Qi=(Ki++,Ki++),Yi=Ki++,Zi=Ki++,er=Ki++,tr=Ki++;Ki++;class nr extends X{scanNext(e){if(this.stream.advanceIfChar(qi)){const t=["$"];if(this.ident(t))return this.finishToken(e,Ji,t.join(""));this.stream.goBackTo(e)}return this.stream.advanceIfChars([Ui,Hi])?this.finishToken(e,Xi):this.stream.advanceIfChars([ji,ji])?this.finishToken(e,Qi):this.stream.advanceIfChars([$i,ji])?this.finishToken(e,Yi):this.stream.advanceIfChar(Vi)?this.stream.advanceIfChar(ji)?this.finishToken(e,er):this.finishToken(e,i.Delim):this.stream.advanceIfChar(Bi)?this.stream.advanceIfChar(ji)?this.finishToken(e,Zi):this.finishToken(e,i.Delim):this.stream.advanceIfChars([Gi,Gi,Gi])?this.finishToken(e,tr):super.scanNext(e)}comment(){return!!super.comment()||!(this.inURL||!this.stream.advanceIfChars([Ai,Ai]))&&(this.stream.advanceWhileChar((e=>{switch(e){case Ni:case Li:case Wi:return!1;default:return!0}})),!0)}}class ir{constructor(e,t){this.id=e,this.message=t}}const rr={FromExpected:new ir("scss-fromexpected",Tt.t("'from' expected")),ThroughOrToExpected:new ir("scss-throughexpected",Tt.t("'through' or 'to' expected")),InExpected:new ir("scss-fromexpected",Tt.t("'in' expected"))};class or extends xn{constructor(){super(new nr)}_parseStylesheetStatement(e=!1){return this.peek(i.AtKeyword)?this._parseWarnAndDebug()||this._parseControlStatement()||this._parseMixinDeclaration()||this._parseMixinContent()||this._parseMixinReference()||this._parseFunctionDeclaration()||this._parseForward()||this._parseUse()||this._parseRuleset(e)||super._parseStylesheetAtStatement(e):this._parseRuleset(!0)||this._parseVariableDeclaration()}_parseImport(){if(!this.peekKeyword("@import"))return null;const e=this.create(Pe);if(this.consumeToken(),!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,Rt.URIOrStringExpected);for(;this.accept(i.Comma);)if(!e.addChild(this._parseURILiteral())&&!e.addChild(this._parseStringLiteral()))return this.finish(e,Rt.URIOrStringExpected);return this._completeParseImport(e)}_parseVariableDeclaration(e=[]){if(!this.peek(Ji))return null;const t=this.create(dt);if(!t.setVariable(this._parseVariable()))return null;if(!this.accept(i.Colon))return this.finish(t,Rt.ColonExpected);if(this.prevToken&&(t.colonPosition=this.prevToken.offset),!t.setValue(this._parseExpr()))return this.finish(t,Rt.VariableValueExpected,[],e);for(;this.peek(i.Exclamation);)if(t.addChild(this._tryParsePrio()));else{if(this.consumeToken(),!this.peekRegExp(i.Ident,/^(default|global)$/))return this.finish(t,Rt.UnknownKeyword);this.consumeToken()}return this.peek(i.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)}_parseMediaCondition(){return this._parseInterpolation()||super._parseMediaCondition()}_parseMediaFeatureRangeOperator(){return this.accept(er)||this.accept(Zi)||super._parseMediaFeatureRangeOperator()}_parseMediaFeatureName(){return this._parseModuleMember()||this._parseFunction()||this._parseIdent()||this._parseVariable()}_parseKeyframeSelector(){return this._tryParseKeyframeSelector()||this._parseControlStatement(this._parseKeyframeSelector.bind(this))||this._parseWarnAndDebug()||this._parseMixinReference()||this._parseFunctionDeclaration()||this._parseVariableDeclaration()||this._parseMixinContent()}_parseVariable(){if(!this.peek(Ji))return null;const e=this.create(pt);return this.consumeToken(),e}_parseModuleMember(){const e=this.mark(),t=this.create(St);return t.setIdentifier(this._parseIdent([ne.Module]))?this.hasWhitespace()||!this.acceptDelim(".")||this.hasWhitespace()?(this.restoreAtMark(e),null):t.addChild(this._parseVariable()||this._parseFunction())?t:this.finish(t,Rt.IdentifierOrVariableExpected):null}_parseIdent(e){if(!this.peek(i.Ident)&&!this.peek(Xi)&&!this.peekDelim("-"))return null;const t=this.create(le);t.referenceTypes=e,t.isCustomProperty=this.peekRegExp(i.Ident,/^--/);let n=!1;const r=()=>{const e=this.mark();return this.acceptDelim("-")&&(this.hasWhitespace()||this.acceptDelim("-"),this.hasWhitespace())?(this.restoreAtMark(e),null):this._parseInterpolation()};for(;(this.accept(i.Ident)||t.addChild(r())||n&&this.acceptRegexp(/^[\w-]/))&&(n=!0,!this.hasWhitespace()););return n?this.finish(t):null}_parseTermExpression(){return this._parseModuleMember()||this._parseVariable()||this._parseNestingSelector()||super._parseTermExpression()}_parseInterpolation(){if(this.peek(Xi)){const e=this.create(ht);return this.consumeToken(),e.addChild(this._parseExpr())||this._parseNestingSelector()?this.accept(i.CurlyR)?this.finish(e):this.finish(e,Rt.RightCurlyExpected):this.accept(i.CurlyR)?this.finish(e):this.finish(e,Rt.ExpressionExpected)}return null}_parseOperator(){if(this.peek(Qi)||this.peek(Yi)||this.peek(Zi)||this.peek(er)||this.peekDelim(">")||this.peekDelim("<")||this.peekIdent("and")||this.peekIdent("or")||this.peekDelim("%")){const e=this.createNode(te.Operator);return this.consumeToken(),this.finish(e)}return super._parseOperator()}_parseUnaryOperator(){if(this.peekIdent("not")){const e=this.create(oe);return this.consumeToken(),this.finish(e)}return super._parseUnaryOperator()}_parseRuleSetDeclaration(){return this.peek(i.AtKeyword)?this._parseKeyframe()||this._parseImport()||this._parseMedia(!0)||this._parseFontFace()||this._parseWarnAndDebug()||this._parseControlStatement()||this._parseFunctionDeclaration()||this._parseExtends()||this._parseMixinReference()||this._parseMixinContent()||this._parseMixinDeclaration()||this._parseRuleset(!0)||this._parseSupports(!0)||this._parseLayer()||this._parsePropertyAtRule()||this._parseContainer(!0)||this._parseRuleSetDeclarationAtStatement():this._parseVariableDeclaration()||this._tryParseRuleset(!0)||this._parseDeclaration()}_parseDeclaration(e){const t=this._tryParseCustomPropertyDeclaration(e);if(t)return t;const n=this.create(be);if(!n.setProperty(this._parseProperty()))return null;if(!this.accept(i.Colon))return this.finish(n,Rt.ColonExpected,[i.Colon],e||[i.SemiColon]);this.prevToken&&(n.colonPosition=this.prevToken.offset);let r=!1;if(n.setValue(this._parseExpr())&&(r=!0,n.addChild(this._parsePrio())),this.peek(i.CurlyL))n.setNestedProperties(this._parseNestedProperties());else if(!r)return this.finish(n,Rt.PropertyValueExpected);return this.peek(i.SemiColon)&&(n.semicolonPosition=this.token.offset),this.finish(n)}_parseNestedProperties(){const e=this.create(Ie);return this._parseBody(e,this._parseDeclaration.bind(this))}_parseExtends(){if(this.peekKeyword("@extend")){const e=this.create(ut);if(this.consumeToken(),!e.getSelectors().addChild(this._parseSimpleSelector()))return this.finish(e,Rt.SelectorExpected);for(;this.accept(i.Comma);)e.getSelectors().addChild(this._parseSimpleSelector());return this.accept(i.Exclamation)&&!this.acceptIdent("optional")?this.finish(e,Rt.UnknownKeyword):this.finish(e)}return null}_parseSimpleSelectorBody(){return this._parseSelectorPlaceholder()||super._parseSimpleSelectorBody()}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(i.Num)||this.accept(i.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null}_parseSelectorPlaceholder(){if(this.peekDelim("%")){const e=this.createNode(te.SelectorPlaceholder);return this.consumeToken(),this._parseIdent(),this.finish(e)}if(this.peekKeyword("@at-root")){const e=this.createNode(te.SelectorPlaceholder);if(this.consumeToken(),this.accept(i.ParenthesisL)){if(!this.acceptIdent("with")&&!this.acceptIdent("without"))return this.finish(e,Rt.IdentifierExpected);if(!this.accept(i.Colon))return this.finish(e,Rt.ColonExpected);if(!e.addChild(this._parseIdent()))return this.finish(e,Rt.IdentifierExpected);if(!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[i.CurlyR])}return this.finish(e)}return null}_parseElementName(){const e=this.mark(),t=super._parseElementName();return t&&!this.hasWhitespace()&&this.peek(i.ParenthesisL)?(this.restoreAtMark(e),null):t}_tryParsePseudoIdentifier(){return this._parseInterpolation()||super._tryParsePseudoIdentifier()}_parseWarnAndDebug(){if(!this.peekKeyword("@debug")&&!this.peekKeyword("@warn")&&!this.peekKeyword("@error"))return null;const e=this.createNode(te.Debug);return this.consumeToken(),e.addChild(this._parseExpr()),this.finish(e)}_parseControlStatement(e=this._parseRuleSetDeclaration.bind(this)){return this.peek(i.AtKeyword)?this._parseIfStatement(e)||this._parseForStatement(e)||this._parseEachStatement(e)||this._parseWhileStatement(e):null}_parseIfStatement(e){return this.peekKeyword("@if")?this._internalParseIfStatement(e):null}_internalParseIfStatement(e){const t=this.create(ke);if(this.consumeToken(),!t.setExpression(this._parseExpr(!0)))return this.finish(t,Rt.ExpressionExpected);if(this._parseBody(t,e),this.acceptKeyword("@else"))if(this.peekIdent("if"))t.setElseClause(this._internalParseIfStatement(e));else if(this.peek(i.CurlyL)){const n=this.create(Re);this._parseBody(n,e),t.setElseClause(n)}return this.finish(t)}_parseForStatement(e){if(!this.peekKeyword("@for"))return null;const t=this.create(Ce);return this.consumeToken(),t.setVariable(this._parseVariable())?this.acceptIdent("from")?t.addChild(this._parseBinaryExpr())?this.acceptIdent("to")||this.acceptIdent("through")?t.addChild(this._parseBinaryExpr())?this._parseBody(t,e):this.finish(t,Rt.ExpressionExpected,[i.CurlyR]):this.finish(t,rr.ThroughOrToExpected,[i.CurlyR]):this.finish(t,Rt.ExpressionExpected,[i.CurlyR]):this.finish(t,rr.FromExpected,[i.CurlyR]):this.finish(t,Rt.VariableNameExpected,[i.CurlyR])}_parseEachStatement(e){if(!this.peekKeyword("@each"))return null;const t=this.create(Te);this.consumeToken();const n=t.getVariables();if(!n.addChild(this._parseVariable()))return this.finish(t,Rt.VariableNameExpected,[i.CurlyR]);for(;this.accept(i.Comma);)if(!n.addChild(this._parseVariable()))return this.finish(t,Rt.VariableNameExpected,[i.CurlyR]);return this.finish(n),this.acceptIdent("in")?t.addChild(this._parseExpr())?this._parseBody(t,e):this.finish(t,Rt.ExpressionExpected,[i.CurlyR]):this.finish(t,rr.InExpected,[i.CurlyR])}_parseWhileStatement(e){if(!this.peekKeyword("@while"))return null;const t=this.create(Ee);return this.consumeToken(),t.addChild(this._parseBinaryExpr())?this._parseBody(t,e):this.finish(t,Rt.ExpressionExpected,[i.CurlyR])}_parseFunctionBodyDeclaration(){return this._parseVariableDeclaration()||this._parseReturnStatement()||this._parseWarnAndDebug()||this._parseControlStatement(this._parseFunctionBodyDeclaration.bind(this))}_parseFunctionDeclaration(){if(!this.peekKeyword("@function"))return null;const e=this.create(De);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([ne.Function])))return this.finish(e,Rt.IdentifierExpected,[i.CurlyR]);if(!this.accept(i.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected,[i.CurlyR]);if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(i.Comma)&&!this.peek(i.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Rt.VariableNameExpected);return this.accept(i.ParenthesisR)?this._parseBody(e,this._parseFunctionBodyDeclaration.bind(this)):this.finish(e,Rt.RightParenthesisExpected,[i.CurlyR])}_parseReturnStatement(){if(!this.peekKeyword("@return"))return null;const e=this.createNode(te.ReturnStatement);return this.consumeToken(),e.addChild(this._parseExpr())?this.finish(e):this.finish(e,Rt.ExpressionExpected)}_parseMixinDeclaration(){if(!this.peekKeyword("@mixin"))return null;const e=this.create(bt);if(this.consumeToken(),!e.setIdentifier(this._parseIdent([ne.Mixin])))return this.finish(e,Rt.IdentifierExpected,[i.CurlyR]);if(this.accept(i.ParenthesisL)){if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(i.Comma)&&!this.peek(i.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Rt.VariableNameExpected);if(!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[i.CurlyR])}return this._parseBody(e,this._parseRuleSetDeclaration.bind(this))}_parseParameterDeclaration(){const e=this.create(Se);return e.setIdentifier(this._parseVariable())?(this.accept(tr),this.accept(i.Colon)&&!e.setDefaultValue(this._parseExpr(!0))?this.finish(e,Rt.VariableValueExpected,[],[i.Comma,i.ParenthesisR]):this.finish(e)):null}_parseMixinContent(){if(!this.peekKeyword("@content"))return null;const e=this.create(mt);if(this.consumeToken(),this.accept(i.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(i.Comma)&&!this.peek(i.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,Rt.ExpressionExpected);if(!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected)}return this.finish(e)}_parseMixinReference(){if(!this.peekKeyword("@include"))return null;const e=this.create(gt);this.consumeToken();const t=this._parseIdent([ne.Mixin]);if(!e.setIdentifier(t))return this.finish(e,Rt.IdentifierExpected,[i.CurlyR]);if(!this.hasWhitespace()&&this.acceptDelim(".")&&!this.hasWhitespace()){const n=this._parseIdent([ne.Mixin]);if(!n)return this.finish(e,Rt.IdentifierExpected,[i.CurlyR]);const r=this.create(St);t.referenceTypes=[ne.Module],r.setIdentifier(t),e.setIdentifier(n),e.addChild(r)}if(this.accept(i.ParenthesisL)){if(e.getArguments().addChild(this._parseFunctionArgument()))for(;this.accept(i.Comma)&&!this.peek(i.ParenthesisR);)if(!e.getArguments().addChild(this._parseFunctionArgument()))return this.finish(e,Rt.ExpressionExpected);if(!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected)}return(this.peekIdent("using")||this.peek(i.CurlyL))&&e.setContent(this._parseMixinContentDeclaration()),this.finish(e)}_parseMixinContentDeclaration(){const e=this.create(ft);if(this.acceptIdent("using")){if(!this.accept(i.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected,[i.CurlyL]);if(e.getParameters().addChild(this._parseParameterDeclaration()))for(;this.accept(i.Comma)&&!this.peek(i.ParenthesisR);)if(!e.getParameters().addChild(this._parseParameterDeclaration()))return this.finish(e,Rt.VariableNameExpected);if(!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[i.CurlyL])}return this.peek(i.CurlyL)&&this._parseBody(e,this._parseMixinReferenceBodyStatement.bind(this)),this.finish(e)}_parseMixinReferenceBodyStatement(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_parseFunctionArgument(){const e=this.create(xe),t=this.mark(),n=this._parseVariable();if(n)if(this.accept(i.Colon))e.setIdentifier(n);else{if(this.accept(tr))return e.setValue(n),this.finish(e);this.restoreAtMark(t)}return e.setValue(this._parseExpr(!0))?(this.accept(tr),e.addChild(this._parsePrio()),this.finish(e)):e.setValue(this._tryParsePrio())?this.finish(e):null}_parseURLArgument(){const e=this.mark(),t=super._parseURLArgument();if(!t||!this.peek(i.ParenthesisR)){this.restoreAtMark(e);const t=this.create(oe);return t.addChild(this._parseBinaryExpr()),this.finish(t)}return t}_parseOperation(){if(!this.peek(i.ParenthesisL))return null;const e=this.create(oe);for(this.consumeToken();e.addChild(this._parseListElement());)this.accept(i.Comma);return this.accept(i.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)}_parseListElement(){const e=this.create(wt),t=this._parseBinaryExpr();if(!t)return null;if(this.accept(i.Colon)){if(e.setKey(t),!e.setValue(this._parseBinaryExpr()))return this.finish(e,Rt.ExpressionExpected)}else e.setValue(t);return this.finish(e)}_parseUse(){if(!this.peekKeyword("@use"))return null;const e=this.create(Ae);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,Rt.StringLiteralExpected);if(!this.peek(i.SemiColon)&&!this.peek(i.EOF)){if(!this.peekRegExp(i.Ident,/as|with/))return this.finish(e,Rt.UnknownKeyword);if(this.acceptIdent("as")&&!e.setIdentifier(this._parseIdent([ne.Module]))&&!this.acceptDelim("*"))return this.finish(e,Rt.IdentifierOrWildcardExpected);if(this.acceptIdent("with")&&!e.setParameters(this._parseModuleConfig()))return this.finish(e,Rt.LeftParenthesisExpected,[i.ParenthesisR])}return this.accept(i.SemiColon)||this.accept(i.EOF)?this.finish(e):this.finish(e,Rt.SemiColonExpected)}_parseModuleConfig(){const e=this.createNode(te.ModuleConfig);if(!this.accept(i.ParenthesisL))return null;if(!e.addChild(this._parseModuleConfigDeclaration()))return this.finish(e,Rt.VariableNameExpected);for(;this.accept(i.Comma)&&!this.peek(i.ParenthesisR);)if(!e.addChild(this._parseModuleConfigDeclaration()))return this.finish(e,Rt.VariableNameExpected);return this.accept(i.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)}_parseModuleConfigDeclaration(){const e=this.create(Ne);return e.setIdentifier(this._parseVariable())?this.accept(i.Colon)&&e.setValue(this._parseExpr(!0))?!this.accept(i.Exclamation)||!this.hasWhitespace()&&this.acceptIdent("default")?this.finish(e):this.finish(e,Rt.UnknownKeyword):this.finish(e,Rt.VariableValueExpected,[],[i.Comma,i.ParenthesisR]):null}_parseForward(){if(!this.peekKeyword("@forward"))return null;const e=this.create(Le);if(this.consumeToken(),!e.addChild(this._parseStringLiteral()))return this.finish(e,Rt.StringLiteralExpected);if(this.acceptIdent("as")){const t=this._parseIdent([ne.Forward]);if(!e.setIdentifier(t))return this.finish(e,Rt.IdentifierExpected);if(this.hasWhitespace()||!this.acceptDelim("*"))return this.finish(e,Rt.WildcardExpected)}if(this.acceptIdent("with")){if(!e.setParameters(this._parseModuleConfig()))return this.finish(e,Rt.LeftParenthesisExpected,[i.ParenthesisR])}else if((this.peekIdent("hide")||this.peekIdent("show"))&&!e.addChild(this._parseForwardVisibility()))return this.finish(e,Rt.IdentifierOrVariableExpected);return this.accept(i.SemiColon)||this.accept(i.EOF)?this.finish(e):this.finish(e,Rt.SemiColonExpected)}_parseForwardVisibility(){const e=this.create(We);for(e.setIdentifier(this._parseIdent());e.addChild(this._parseVariable()||this._parseIdent());)this.accept(i.Comma);return e.getChildren().length>1?e:null}_parseSupportsCondition(){return this._parseInterpolation()||super._parseSupportsCondition()}}const sr=Tt.t("Sass documentation");class ar extends $n{constructor(e,t){super("$",e,t),lr(ar.scssModuleLoaders),lr(ar.scssModuleBuiltIns)}isImportPathParent(e){return e===te.Forward||e===te.Use||super.isImportPathParent(e)}getCompletionForImportPath(e,t){const n=e.getParent().type;if(n===te.Forward||n===te.Use)for(let n of ar.scssModuleBuiltIns){const i={label:n.label,documentation:n.documentation,textEdit:Mt.mF.replace(this.getCompletionRange(e),`'${n.label}'`),kind:Mt.Io.Module};t.items.push(i)}return super.getCompletionForImportPath(e,t)}createReplaceFunction(){let e=1;return(t,n)=>"\\"+n+": ${"+e+++":"+(ar.variableDefaults[n]||"")+"}"}createFunctionProposals(e,t,n,i){for(const r of e){const e=r.func.replace(/\[?(\$\w+)\]?/g,this.createReplaceFunction()),o={label:r.func.substr(0,r.func.indexOf("(")),detail:r.func,documentation:r.desc,textEdit:Mt.mF.replace(this.getCompletionRange(t),e),insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Function};n&&(o.sortText="z"),i.items.push(o)}return i}getCompletionsForSelector(e,t,n){return this.createFunctionProposals(ar.selectorFuncs,null,!0,n),super.getCompletionsForSelector(e,t,n)}getTermProposals(e,t,n){let i=ar.builtInFuncs;return e&&(i=i.filter((t=>!t.type||!e.restrictions||-1!==e.restrictions.indexOf(t.type)))),this.createFunctionProposals(i,t,!0,n),super.getTermProposals(e,t,n)}getColorProposals(e,t,n){return this.createFunctionProposals(ar.colorProposals,t,!1,n),super.getColorProposals(e,t,n)}getCompletionsForDeclarationProperty(e,t){return this.getCompletionForAtDirectives(t),this.getCompletionsForSelector(null,!0,t),super.getCompletionsForDeclarationProperty(e,t)}getCompletionsForExtendsReference(e,t,n){const i=this.getSymbolContext().findSymbolsAtOffset(this.offset,ne.Rule);for(const e of i){const i={label:e.name,textEdit:Mt.mF.replace(this.getCompletionRange(t),e.name),kind:Mt.Io.Function};n.items.push(i)}return n}getCompletionForAtDirectives(e){return e.items.push(...ar.scssAtDirectives),e}getCompletionForTopLevel(e){return this.getCompletionForAtDirectives(e),this.getCompletionForModuleLoaders(e),super.getCompletionForTopLevel(e),e}getCompletionForModuleLoaders(e){return e.items.push(...ar.scssModuleLoaders),e}}function lr(e){e.forEach((e=>{if(e.documentation&&e.references&&e.references.length>0){const t="string"==typeof e.documentation?{kind:"markdown",value:e.documentation}:{kind:"markdown",value:e.documentation.value};t.value+="\n\n",t.value+=e.references.map((e=>`[${e.name}](${e.url})`)).join(" | "),e.documentation=t}}))}ar.variableDefaults={$red:"1",$green:"2",$blue:"3",$alpha:"1.0",$color:"#000000",$weight:"0.5",$hue:"0",$saturation:"0%",$lightness:"0%",$degrees:"0",$amount:"0",$string:'""',$substring:'"s"',$number:"0",$limit:"1"},ar.colorProposals=[{func:"red($color)",desc:Tt.t("Gets the red component of a color.")},{func:"green($color)",desc:Tt.t("Gets the green component of a color.")},{func:"blue($color)",desc:Tt.t("Gets the blue component of a color.")},{func:"mix($color, $color, [$weight])",desc:Tt.t("Mixes two colors together.")},{func:"hue($color)",desc:Tt.t("Gets the hue component of a color.")},{func:"saturation($color)",desc:Tt.t("Gets the saturation component of a color.")},{func:"lightness($color)",desc:Tt.t("Gets the lightness component of a color.")},{func:"adjust-hue($color, $degrees)",desc:Tt.t("Changes the hue of a color.")},{func:"lighten($color, $amount)",desc:Tt.t("Makes a color lighter.")},{func:"darken($color, $amount)",desc:Tt.t("Makes a color darker.")},{func:"saturate($color, $amount)",desc:Tt.t("Makes a color more saturated.")},{func:"desaturate($color, $amount)",desc:Tt.t("Makes a color less saturated.")},{func:"grayscale($color)",desc:Tt.t("Converts a color to grayscale.")},{func:"complement($color)",desc:Tt.t("Returns the complement of a color.")},{func:"invert($color)",desc:Tt.t("Returns the inverse of a color.")},{func:"alpha($color)",desc:Tt.t("Gets the opacity component of a color.")},{func:"opacity($color)",desc:"Gets the alpha component (opacity) of a color."},{func:"rgba($color, $alpha)",desc:Tt.t("Changes the alpha component for a color.")},{func:"opacify($color, $amount)",desc:Tt.t("Makes a color more opaque.")},{func:"fade-in($color, $amount)",desc:Tt.t("Makes a color more opaque.")},{func:"transparentize($color, $amount)",desc:Tt.t("Makes a color more transparent.")},{func:"fade-out($color, $amount)",desc:Tt.t("Makes a color more transparent.")},{func:"adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])",desc:Tt.t("Increases or decreases one or more components of a color.")},{func:"scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha])",desc:Tt.t("Fluidly scales one or more properties of a color.")},{func:"change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha])",desc:Tt.t("Changes one or more properties of a color.")},{func:"ie-hex-str($color)",desc:Tt.t("Converts a color into the format understood by IE filters.")}],ar.selectorFuncs=[{func:"selector-nest($selectors…)",desc:Tt.t("Nests selector beneath one another like they would be nested in the stylesheet.")},{func:"selector-append($selectors…)",desc:Tt.t("Appends selectors to one another without spaces in between.")},{func:"selector-extend($selector, $extendee, $extender)",desc:Tt.t("Extends $extendee with $extender within $selector.")},{func:"selector-replace($selector, $original, $replacement)",desc:Tt.t("Replaces $original with $replacement within $selector.")},{func:"selector-unify($selector1, $selector2)",desc:Tt.t("Unifies two selectors to produce a selector that matches elements matched by both.")},{func:"is-superselector($super, $sub)",desc:Tt.t("Returns whether $super matches all the elements $sub does, and possibly more.")},{func:"simple-selectors($selector)",desc:Tt.t("Returns the simple selectors that comprise a compound selector.")},{func:"selector-parse($selector)",desc:Tt.t("Parses a selector into the format returned by &.")}],ar.builtInFuncs=[{func:"unquote($string)",desc:Tt.t("Removes quotes from a string.")},{func:"quote($string)",desc:Tt.t("Adds quotes to a string.")},{func:"str-length($string)",desc:Tt.t("Returns the number of characters in a string.")},{func:"str-insert($string, $insert, $index)",desc:Tt.t("Inserts $insert into $string at $index.")},{func:"str-index($string, $substring)",desc:Tt.t("Returns the index of the first occurance of $substring in $string.")},{func:"str-slice($string, $start-at, [$end-at])",desc:Tt.t("Extracts a substring from $string.")},{func:"to-upper-case($string)",desc:Tt.t("Converts a string to upper case.")},{func:"to-lower-case($string)",desc:Tt.t("Converts a string to lower case.")},{func:"percentage($number)",desc:Tt.t("Converts a unitless number to a percentage."),type:"percentage"},{func:"round($number)",desc:Tt.t("Rounds a number to the nearest whole number.")},{func:"ceil($number)",desc:Tt.t("Rounds a number up to the next whole number.")},{func:"floor($number)",desc:Tt.t("Rounds a number down to the previous whole number.")},{func:"abs($number)",desc:Tt.t("Returns the absolute value of a number.")},{func:"min($numbers)",desc:Tt.t("Finds the minimum of several numbers.")},{func:"max($numbers)",desc:Tt.t("Finds the maximum of several numbers.")},{func:"random([$limit])",desc:Tt.t("Returns a random number.")},{func:"length($list)",desc:Tt.t("Returns the length of a list.")},{func:"nth($list, $n)",desc:Tt.t("Returns a specific item in a list.")},{func:"set-nth($list, $n, $value)",desc:Tt.t("Replaces the nth item in a list.")},{func:"join($list1, $list2, [$separator])",desc:Tt.t("Joins together two lists into one.")},{func:"append($list1, $val, [$separator])",desc:Tt.t("Appends a single value onto the end of a list.")},{func:"zip($lists)",desc:Tt.t("Combines several lists into a single multidimensional list.")},{func:"index($list, $value)",desc:Tt.t("Returns the position of a value within a list.")},{func:"list-separator(#list)",desc:Tt.t("Returns the separator of a list.")},{func:"map-get($map, $key)",desc:Tt.t("Returns the value in a map associated with a given key.")},{func:"map-merge($map1, $map2)",desc:Tt.t("Merges two maps together into a new map.")},{func:"map-remove($map, $keys)",desc:Tt.t("Returns a new map with keys removed.")},{func:"map-keys($map)",desc:Tt.t("Returns a list of all keys in a map.")},{func:"map-values($map)",desc:Tt.t("Returns a list of all values in a map.")},{func:"map-has-key($map, $key)",desc:Tt.t("Returns whether a map has a value associated with a given key.")},{func:"keywords($args)",desc:Tt.t("Returns the keywords passed to a function that takes variable arguments.")},{func:"feature-exists($feature)",desc:Tt.t("Returns whether a feature exists in the current Sass runtime.")},{func:"variable-exists($name)",desc:Tt.t("Returns whether a variable with the given name exists in the current scope.")},{func:"global-variable-exists($name)",desc:Tt.t("Returns whether a variable with the given name exists in the global scope.")},{func:"function-exists($name)",desc:Tt.t("Returns whether a function with the given name exists.")},{func:"mixin-exists($name)",desc:Tt.t("Returns whether a mixin with the given name exists.")},{func:"inspect($value)",desc:Tt.t("Returns the string representation of a value as it would be represented in Sass.")},{func:"type-of($value)",desc:Tt.t("Returns the type of a value.")},{func:"unit($number)",desc:Tt.t("Returns the unit(s) associated with a number.")},{func:"unitless($number)",desc:Tt.t("Returns whether a number has units.")},{func:"comparable($number1, $number2)",desc:Tt.t("Returns whether two numbers can be added, subtracted, or compared.")},{func:"call($name, $args…)",desc:Tt.t("Dynamically calls a Sass function.")}],ar.scssAtDirectives=[{label:"@extend",documentation:Tt.t("Inherits the styles of another selector."),kind:Mt.Io.Keyword},{label:"@at-root",documentation:Tt.t("Causes one or more rules to be emitted at the root of the document."),kind:Mt.Io.Keyword},{label:"@debug",documentation:Tt.t("Prints the value of an expression to the standard error output stream. Useful for debugging complicated Sass files."),kind:Mt.Io.Keyword},{label:"@warn",documentation:Tt.t("Prints the value of an expression to the standard error output stream. Useful for libraries that need to warn users of deprecations or recovering from minor mixin usage mistakes. Warnings can be turned off with the `--quiet` command-line option or the `:quiet` Sass option."),kind:Mt.Io.Keyword},{label:"@error",documentation:Tt.t("Throws the value of an expression as a fatal error with stack trace. Useful for validating arguments to mixins and functions."),kind:Mt.Io.Keyword},{label:"@if",documentation:Tt.t("Includes the body if the expression does not evaluate to `false` or `null`."),insertText:"@if ${1:expr} {\n\t$0\n}",insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Keyword},{label:"@for",documentation:Tt.t("For loop that repeatedly outputs a set of styles for each `$var` in the `from/through` or `from/to` clause."),insertText:"@for \\$${1:var} from ${2:start} ${3|to,through|} ${4:end} {\n\t$0\n}",insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Keyword},{label:"@each",documentation:Tt.t("Each loop that sets `$var` to each item in the list or map, then outputs the styles it contains using that value of `$var`."),insertText:"@each \\$${1:var} in ${2:list} {\n\t$0\n}",insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Keyword},{label:"@while",documentation:Tt.t("While loop that takes an expression and repeatedly outputs the nested styles until the statement evaluates to `false`."),insertText:"@while ${1:condition} {\n\t$0\n}",insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Keyword},{label:"@mixin",documentation:Tt.t("Defines styles that can be re-used throughout the stylesheet with `@include`."),insertText:"@mixin ${1:name} {\n\t$0\n}",insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Keyword},{label:"@include",documentation:Tt.t("Includes the styles defined by another mixin into the current rule."),kind:Mt.Io.Keyword},{label:"@function",documentation:Tt.t("Defines complex operations that can be re-used throughout stylesheets."),kind:Mt.Io.Keyword}],ar.scssModuleLoaders=[{label:"@use",documentation:Tt.t("Loads mixins, functions, and variables from other Sass stylesheets as 'modules', and combines CSS from multiple stylesheets together."),references:[{name:sr,url:"https://sass-lang.com/documentation/at-rules/use"}],insertText:"@use $0;",insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Keyword},{label:"@forward",documentation:Tt.t("Loads a Sass stylesheet and makes its mixins, functions, and variables available when this stylesheet is loaded with the @use rule."),references:[{name:sr,url:"https://sass-lang.com/documentation/at-rules/forward"}],insertText:"@forward $0;",insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Keyword}],ar.scssModuleBuiltIns=[{label:"sass:math",documentation:Tt.t("Provides functions that operate on numbers."),references:[{name:sr,url:"https://sass-lang.com/documentation/modules/math"}]},{label:"sass:string",documentation:Tt.t("Makes it easy to combine, search, or split apart strings."),references:[{name:sr,url:"https://sass-lang.com/documentation/modules/string"}]},{label:"sass:color",documentation:Tt.t("Generates new colors based on existing ones, making it easy to build color themes."),references:[{name:sr,url:"https://sass-lang.com/documentation/modules/color"}]},{label:"sass:list",documentation:Tt.t("Lets you access and modify values in lists."),references:[{name:sr,url:"https://sass-lang.com/documentation/modules/list"}]},{label:"sass:map",documentation:Tt.t("Makes it possible to look up the value associated with a key in a map, and much more."),references:[{name:sr,url:"https://sass-lang.com/documentation/modules/map"}]},{label:"sass:selector",documentation:Tt.t("Provides access to Sass’s powerful selector engine."),references:[{name:sr,url:"https://sass-lang.com/documentation/modules/selector"}]},{label:"sass:meta",documentation:Tt.t("Exposes the details of Sass’s inner workings."),references:[{name:sr,url:"https://sass-lang.com/documentation/modules/meta"}]}];const cr="/".charCodeAt(0),dr="\n".charCodeAt(0),hr="\r".charCodeAt(0),pr="\f".charCodeAt(0),ur="`".charCodeAt(0),mr=".".charCodeAt(0);let fr=i.CustomToken;const gr=fr++;class br extends X{scanNext(e){const t=this.escapedJavaScript();return null!==t?this.finishToken(e,t):this.stream.advanceIfChars([mr,mr,mr])?this.finishToken(e,gr):super.scanNext(e)}comment(){return!!super.comment()||!(this.inURL||!this.stream.advanceIfChars([cr,cr]))&&(this.stream.advanceWhileChar((e=>{switch(e){case dr:case hr:case pr:return!1;default:return!0}})),!0)}escapedJavaScript(){return this.stream.peekChar()===ur?(this.stream.advance(1),this.stream.advanceWhileChar((e=>e!==ur)),this.stream.advanceIfChar(ur)?i.EscapedJavaScript:i.BadEscapedJavaScript):null}}class vr extends xn{constructor(){super(new br)}_parseStylesheetStatement(e=!1){return this.peek(i.AtKeyword)?this._parseVariableDeclaration()||this._parsePlugin()||super._parseStylesheetAtStatement(e):this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseFunction()||this._parseRuleset(!0)}_parseImport(){if(!this.peekKeyword("@import")&&!this.peekKeyword("@import-once"))return null;const e=this.create(Pe);if(this.consumeToken(),this.accept(i.ParenthesisL)){if(!this.accept(i.Ident))return this.finish(e,Rt.IdentifierExpected,[i.SemiColon]);do{if(!this.accept(i.Comma))break}while(this.accept(i.Ident));if(!this.accept(i.ParenthesisR))return this.finish(e,Rt.RightParenthesisExpected,[i.SemiColon])}return e.addChild(this._parseURILiteral())||e.addChild(this._parseStringLiteral())?(this.peek(i.SemiColon)||this.peek(i.EOF)||e.setMedialist(this._parseMediaQueryList()),this._completeParseImport(e)):this.finish(e,Rt.URIOrStringExpected,[i.SemiColon])}_parsePlugin(){if(!this.peekKeyword("@plugin"))return null;const e=this.createNode(te.Plugin);return this.consumeToken(),e.addChild(this._parseStringLiteral())?this.accept(i.SemiColon)?this.finish(e):this.finish(e,Rt.SemiColonExpected):this.finish(e,Rt.StringLiteralExpected)}_parseMediaQuery(){const e=super._parseMediaQuery();if(!e){const e=this.create(Ke);return e.addChild(this._parseVariable())?this.finish(e):null}return e}_parseMediaDeclaration(e=!1){return this._tryParseRuleset(e)||this._tryToParseDeclaration()||this._tryParseMixinDeclaration()||this._tryParseMixinReference()||this._parseDetachedRuleSetMixin()||this._parseStylesheetStatement(e)}_parseMediaFeatureName(){return this._parseIdent()||this._parseVariable()}_parseVariableDeclaration(e=[]){const t=this.create(dt),n=this.mark();if(!t.setVariable(this._parseVariable(!0)))return null;if(!this.accept(i.Colon))return this.restoreAtMark(n),null;if(this.prevToken&&(t.colonPosition=this.prevToken.offset),t.setValue(this._parseDetachedRuleSet()))t.needsSemicolon=!1;else if(!t.setValue(this._parseExpr()))return this.finish(t,Rt.VariableValueExpected,[],e);return t.addChild(this._parsePrio()),this.peek(i.SemiColon)&&(t.semicolonPosition=this.token.offset),this.finish(t)}_parseDetachedRuleSet(){let e=this.mark();if(this.peekDelim("#")||this.peekDelim(".")){if(this.consumeToken(),this.hasWhitespace()||!this.accept(i.ParenthesisL))return this.restoreAtMark(e),null;{let t=this.create(bt);if(t.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(i.Comma)||this.accept(i.SemiColon))&&!this.peek(i.ParenthesisR);)t.getParameters().addChild(this._parseMixinParameter())||this.markError(t,Rt.IdentifierExpected,[],[i.ParenthesisR]);if(!this.accept(i.ParenthesisR))return this.restoreAtMark(e),null}}if(!this.peek(i.CurlyL))return null;const t=this.create(he);return this._parseBody(t,this._parseDetachedRuleSetBody.bind(this)),this.finish(t)}_parseDetachedRuleSetBody(){return this._tryParseKeyframeSelector()||this._parseRuleSetDeclaration()}_addLookupChildren(e){if(!e.addChild(this._parseLookupValue()))return!1;let t=!1;for(;this.peek(i.BracketL)&&(t=!0),e.addChild(this._parseLookupValue());)t=!1;return!t}_parseLookupValue(){const e=this.create(oe),t=this.mark();return this.accept(i.BracketL)&&((e.addChild(this._parseVariable(!1,!0))||e.addChild(this._parsePropertyIdentifier()))&&this.accept(i.BracketR)||this.accept(i.BracketR))?e:(this.restoreAtMark(t),null)}_parseVariable(e=!1,t=!1){const n=!e&&this.peekDelim("$");if(!this.peekDelim("@")&&!n&&!this.peek(i.AtKeyword))return null;const r=this.create(pt),o=this.mark();for(;this.acceptDelim("@")||!e&&this.acceptDelim("$");)if(this.hasWhitespace())return this.restoreAtMark(o),null;return!this.accept(i.AtKeyword)&&!this.accept(i.Ident)||!t&&this.peek(i.BracketL)&&!this._addLookupChildren(r)?(this.restoreAtMark(o),null):r}_parseTermExpression(){return this._parseVariable()||this._parseEscaped()||super._parseTermExpression()||this._tryParseMixinReference(!1)}_parseEscaped(){if(this.peek(i.EscapedJavaScript)||this.peek(i.BadEscapedJavaScript)){const e=this.createNode(te.EscapedValue);return this.consumeToken(),this.finish(e)}if(this.peekDelim("~")){const e=this.createNode(te.EscapedValue);return this.consumeToken(),this.accept(i.String)||this.accept(i.EscapedJavaScript)?this.finish(e):this.finish(e,Rt.TermExpected)}return null}_parseOperator(){return this._parseGuardOperator()||super._parseOperator()}_parseGuardOperator(){if(this.peekDelim(">")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("="),e}if(this.peekDelim("=")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("<"),e}if(this.peekDelim("<")){const e=this.createNode(te.Operator);return this.consumeToken(),this.acceptDelim("="),e}return null}_parseRuleSetDeclaration(){return this.peek(i.AtKeyword)?this._parseKeyframe()||this._parseMedia(!0)||this._parseImport()||this._parseSupports(!0)||this._parseLayer()||this._parsePropertyAtRule()||this._parseContainer(!0)||this._parseDetachedRuleSetMixin()||this._parseVariableDeclaration()||this._parseRuleSetDeclarationAtStatement():this._tryParseMixinDeclaration()||this._tryParseRuleset(!0)||this._tryParseMixinReference()||this._parseFunction()||this._parseExtend()||this._parseDeclaration()}_parseKeyframeIdent(){return this._parseIdent([ne.Keyframe])||this._parseVariable()}_parseKeyframeSelector(){return this._parseDetachedRuleSetMixin()||super._parseKeyframeSelector()}_parseSelector(e){const t=this.create(ue);let n=!1;for(e&&(n=t.addChild(this._parseCombinator()));t.addChild(this._parseSimpleSelector());){n=!0;const e=this.mark();if(t.addChild(this._parseGuard())&&this.peek(i.CurlyL))break;this.restoreAtMark(e),t.addChild(this._parseCombinator())}return n?this.finish(t):null}_parseNestingSelector(){if(this.peekDelim("&")){const e=this.createNode(te.SelectorCombinator);for(this.consumeToken();!this.hasWhitespace()&&(this.acceptDelim("-")||this.accept(i.Num)||this.accept(i.Dimension)||e.addChild(this._parseIdent())||this.acceptDelim("&")););return this.finish(e)}return null}_parseSelectorIdent(){if(!this.peekInterpolatedIdent())return null;const e=this.createNode(te.SelectorInterpolation);return this._acceptInterpolatedIdent(e)?this.finish(e):null}_parsePropertyIdentifier(e=!1){const t=/^[\w-]+/;if(!this.peekInterpolatedIdent()&&!this.peekRegExp(this.token.type,t))return null;const n=this.mark(),i=this.create(le);i.isCustomProperty=this.acceptDelim("-")&&this.acceptDelim("-");let r=!1;return r=e?i.isCustomProperty?i.addChild(this._parseIdent()):i.addChild(this._parseRegexp(t)):i.isCustomProperty?this._acceptInterpolatedIdent(i):this._acceptInterpolatedIdent(i,t),r?(e||this.hasWhitespace()||(this.acceptDelim("+"),this.hasWhitespace()||this.acceptIdent("_")),this.finish(i)):(this.restoreAtMark(n),null)}peekInterpolatedIdent(){return this.peek(i.Ident)||this.peekDelim("@")||this.peekDelim("$")||this.peekDelim("-")}_acceptInterpolatedIdent(e,t){let n=!1;const r=()=>{const e=this.mark();return this.acceptDelim("-")&&(this.hasWhitespace()||this.acceptDelim("-"),this.hasWhitespace())?(this.restoreAtMark(e),null):this._parseInterpolation()},o=t?()=>this.acceptRegexp(t):()=>this.accept(i.Ident);for(;(o()||e.addChild(this._parseInterpolation()||this.try(r)))&&(n=!0,!this.hasWhitespace()););return n}_parseInterpolation(){const e=this.mark();if(this.peekDelim("@")||this.peekDelim("$")){const t=this.createNode(te.Interpolation);return this.consumeToken(),this.hasWhitespace()||!this.accept(i.CurlyL)?(this.restoreAtMark(e),null):t.addChild(this._parseIdent())?this.accept(i.CurlyR)?this.finish(t):this.finish(t,Rt.RightCurlyExpected):this.finish(t,Rt.IdentifierExpected)}return null}_tryParseMixinDeclaration(){const e=this.mark(),t=this.create(bt);if(!t.setIdentifier(this._parseMixinDeclarationIdentifier())||!this.accept(i.ParenthesisL))return this.restoreAtMark(e),null;if(t.getParameters().addChild(this._parseMixinParameter()))for(;(this.accept(i.Comma)||this.accept(i.SemiColon))&&!this.peek(i.ParenthesisR);)t.getParameters().addChild(this._parseMixinParameter())||this.markError(t,Rt.IdentifierExpected,[],[i.ParenthesisR]);return this.accept(i.ParenthesisR)?(t.setGuard(this._parseGuard()),this.peek(i.CurlyL)?this._parseBody(t,this._parseMixInBodyDeclaration.bind(this)):(this.restoreAtMark(e),null)):(this.restoreAtMark(e),null)}_parseMixInBodyDeclaration(){return this._parseFontFace()||this._parseRuleSetDeclaration()}_parseMixinDeclarationIdentifier(){let e;if(this.peekDelim("#")||this.peekDelim(".")){if(e=this.create(le),this.consumeToken(),this.hasWhitespace()||!e.addChild(this._parseIdent()))return null}else{if(!this.peek(i.Hash))return null;e=this.create(le),this.consumeToken()}return e.referenceTypes=[ne.Mixin],this.finish(e)}_parsePseudo(){if(!this.peek(i.Colon))return null;const e=this.mark(),t=this.create(ut);return this.consumeToken(),this.acceptIdent("extend")?this._completeExtends(t):(this.restoreAtMark(e),super._parsePseudo())}_parseExtend(){if(!this.peekDelim("&"))return null;const e=this.mark(),t=this.create(ut);return this.consumeToken(),!this.hasWhitespace()&&this.accept(i.Colon)&&this.acceptIdent("extend")?this._completeExtends(t):(this.restoreAtMark(e),null)}_completeExtends(e){if(!this.accept(i.ParenthesisL))return this.finish(e,Rt.LeftParenthesisExpected);const t=e.getSelectors();if(!t.addChild(this._parseSelector(!0)))return this.finish(e,Rt.SelectorExpected);for(;this.accept(i.Comma);)if(!t.addChild(this._parseSelector(!0)))return this.finish(e,Rt.SelectorExpected);return this.accept(i.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)}_parseDetachedRuleSetMixin(){if(!this.peek(i.AtKeyword))return null;const e=this.mark(),t=this.create(gt);return!t.addChild(this._parseVariable(!0))||!this.hasWhitespace()&&this.accept(i.ParenthesisL)?this.accept(i.ParenthesisR)?this.finish(t):this.finish(t,Rt.RightParenthesisExpected):(this.restoreAtMark(e),null)}_tryParseMixinReference(e=!0){const t=this.mark(),n=this.create(gt);let r=this._parseMixinDeclarationIdentifier();for(;r;){this.acceptDelim(">");const e=this._parseMixinDeclarationIdentifier();if(!e)break;n.getNamespaces().addChild(r),r=e}if(!n.setIdentifier(r))return this.restoreAtMark(t),null;let o=!1;if(this.accept(i.ParenthesisL)){if(o=!0,n.getArguments().addChild(this._parseMixinArgument()))for(;(this.accept(i.Comma)||this.accept(i.SemiColon))&&!this.peek(i.ParenthesisR);)if(!n.getArguments().addChild(this._parseMixinArgument()))return this.finish(n,Rt.ExpressionExpected);if(!this.accept(i.ParenthesisR))return this.finish(n,Rt.RightParenthesisExpected);r.referenceTypes=[ne.Mixin]}else r.referenceTypes=[ne.Mixin,ne.Rule];return this.peek(i.BracketL)?e||this._addLookupChildren(n):n.addChild(this._parsePrio()),o||this.peek(i.SemiColon)||this.peek(i.CurlyR)||this.peek(i.EOF)?this.finish(n):(this.restoreAtMark(t),null)}_parseMixinArgument(){const e=this.create(xe),t=this.mark(),n=this._parseVariable();return n&&(this.accept(i.Colon)?e.setIdentifier(n):this.restoreAtMark(t)),e.setValue(this._parseDetachedRuleSet()||this._parseExpr(!0))?this.finish(e):(this.restoreAtMark(t),null)}_parseMixinParameter(){const e=this.create(Se);if(this.peekKeyword("@rest")){const t=this.create(oe);return this.consumeToken(),this.accept(gr)?(e.setIdentifier(this.finish(t)),this.finish(e)):this.finish(e,Rt.DotExpected,[],[i.Comma,i.ParenthesisR])}if(this.peek(gr)){const t=this.create(oe);return this.consumeToken(),e.setIdentifier(this.finish(t)),this.finish(e)}let t=!1;return e.setIdentifier(this._parseVariable())&&(this.accept(i.Colon),t=!0),e.setDefaultValue(this._parseDetachedRuleSet()||this._parseExpr(!0))||t?this.finish(e):null}_parseGuard(){if(!this.peekIdent("when"))return null;const e=this.create(yt);if(this.consumeToken(),!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,Rt.ConditionExpected);for(;this.acceptIdent("and")||this.accept(i.Comma);)if(!e.getConditions().addChild(this._parseGuardCondition()))return this.finish(e,Rt.ConditionExpected);return this.finish(e)}_parseGuardCondition(){const e=this.create(_t);return e.isNegated=this.acceptIdent("not"),this.accept(i.ParenthesisL)?(e.addChild(this._parseExpr()),this.accept(i.ParenthesisR)?this.finish(e):this.finish(e,Rt.RightParenthesisExpected)):e.isNegated?this.finish(e,Rt.LeftParenthesisExpected):null}_parseFunction(){const e=this.mark(),t=this.create(_e);if(!t.setIdentifier(this._parseFunctionIdentifier()))return null;if(this.hasWhitespace()||!this.accept(i.ParenthesisL))return this.restoreAtMark(e),null;if(t.getArguments().addChild(this._parseMixinArgument()))for(;(this.accept(i.Comma)||this.accept(i.SemiColon))&&!this.peek(i.ParenthesisR);)if(!t.getArguments().addChild(this._parseMixinArgument()))return this.finish(t,Rt.ExpressionExpected);return this.accept(i.ParenthesisR)?this.finish(t):this.finish(t,Rt.RightParenthesisExpected)}_parseFunctionIdentifier(){if(this.peekDelim("%")){const e=this.create(le);return e.referenceTypes=[ne.Function],this.consumeToken(),this.finish(e)}return super._parseFunctionIdentifier()}_parseURLArgument(){const e=this.mark(),t=super._parseURLArgument();if(!t||!this.peek(i.ParenthesisR)){this.restoreAtMark(e);const t=this.create(oe);return t.addChild(this._parseBinaryExpr()),this.finish(t)}return t}}class wr extends $n{constructor(e,t){super("@",e,t)}createFunctionProposals(e,t,n,i){for(const r of e){const e={label:r.name,detail:r.example,documentation:r.description,textEdit:Mt.mF.replace(this.getCompletionRange(t),r.name+"($0)"),insertTextFormat:Mt.q8.Snippet,kind:Mt.Io.Function};n&&(e.sortText="z"),i.items.push(e)}return i}getTermProposals(e,t,n){let i=wr.builtInProposals;return e&&(i=i.filter((t=>!t.type||!e.restrictions||-1!==e.restrictions.indexOf(t.type)))),this.createFunctionProposals(i,t,!0,n),super.getTermProposals(e,t,n)}getColorProposals(e,t,n){return this.createFunctionProposals(wr.colorProposals,t,!1,n),super.getColorProposals(e,t,n)}getCompletionsForDeclarationProperty(e,t){return this.getCompletionsForSelector(null,!0,t),super.getCompletionsForDeclarationProperty(e,t)}}function yr(e,t){const n=function(e){function t(t){return e.positionAt(t.offset).line}function n(t){return e.positionAt(t.offset+t.len).line}function r(e,i){const r=t(e),o=n(e);return r!==o?{startLine:r,endLine:o,kind:i}:null}const o=[],s=[],a=function(){switch(e.languageId){case"scss":return new nr;case"less":return new br;default:return new X}}();a.ignoreComment=!1,a.setSource(e.getText());let l=a.scan(),c=null;for(;l.type!==i.EOF;){switch(l.type){case i.CurlyL:case Xi:s.push({line:t(l),type:"brace",isStart:!0});break;case i.CurlyR:if(0!==s.length){const e=_r(s,"brace");if(!e)break;let t=n(l);"brace"===e.type&&(c&&n(c)!==t&&t--,e.line!==t&&o.push({startLine:e.line,endLine:t,kind:void 0}))}break;case i.Comment:{const i=e=>"#region"===e?{line:t(l),type:"comment",isStart:!0}:{line:n(l),type:"comment",isStart:!1},a=t=>{const n=t.text.match(/^\s*\/\*\s*(#region|#endregion)\b\s*(.*?)\s*\*\//);if(n)return i(n[1]);if("scss"===e.languageId||"less"===e.languageId){const e=t.text.match(/^\s*\/\/\s*(#region|#endregion)\b\s*(.*?)\s*/);if(e)return i(e[1])}return null},c=a(l);if(c)if(c.isStart)s.push(c);else{const e=_r(s,"comment");if(!e)break;"comment"===e.type&&e.line!==c.line&&o.push({startLine:e.line,endLine:c.line,kind:"region"})}else{const e=r(l,"comment");e&&o.push(e)}break}}c=l,l=a.scan()}return o}(e);return function(e,t){const n=t&&t.rangeLimit||Number.MAX_VALUE,i=e.sort(((e,t)=>{let n=e.startLine-t.startLine;return 0===n&&(n=e.endLine-t.endLine),n})),r=[];let o=-1;return i.forEach((e=>{e.startLine=0;n--)if(e[n].type===t&&e[n].isStart)return e.splice(n,1)[0];return null}var Sr,xr;wr.builtInProposals=[{name:"if",example:"if(condition, trueValue [, falseValue]);",description:Tt.t("returns one of two values depending on a condition.")},{name:"boolean",example:"boolean(condition);",description:Tt.t('"store" a boolean test for later evaluation in a guard or if().')},{name:"length",example:"length(@list);",description:Tt.t("returns the number of elements in a value list")},{name:"extract",example:"extract(@list, index);",description:Tt.t("returns a value at the specified position in the list")},{name:"range",example:"range([start, ] end [, step]);",description:Tt.t("generate a list spanning a range of values")},{name:"each",example:"each(@list, ruleset);",description:Tt.t("bind the evaluation of a ruleset to each member of a list.")},{name:"escape",example:"escape(@string);",description:Tt.t("URL encodes a string")},{name:"e",example:"e(@string);",description:Tt.t("escape string content")},{name:"replace",example:"replace(@string, @pattern, @replacement[, @flags]);",description:Tt.t("string replace")},{name:"unit",example:"unit(@dimension, [@unit: '']);",description:Tt.t("remove or change the unit of a dimension")},{name:"color",example:"color(@string);",description:Tt.t("parses a string to a color"),type:"color"},{name:"convert",example:"convert(@value, unit);",description:Tt.t("converts numbers from one type into another")},{name:"data-uri",example:"data-uri([mimetype,] url);",description:Tt.t("inlines a resource and falls back to `url()`"),type:"url"},{name:"abs",description:Tt.t("absolute value of a number"),example:"abs(number);"},{name:"acos",description:Tt.t("arccosine - inverse of cosine function"),example:"acos(number);"},{name:"asin",description:Tt.t("arcsine - inverse of sine function"),example:"asin(number);"},{name:"ceil",example:"ceil(@number);",description:Tt.t("rounds up to an integer")},{name:"cos",description:Tt.t("cosine function"),example:"cos(number);"},{name:"floor",description:Tt.t("rounds down to an integer"),example:"floor(@number);"},{name:"percentage",description:Tt.t("converts to a %, e.g. 0.5 > 50%"),example:"percentage(@number);",type:"percentage"},{name:"round",description:Tt.t("rounds a number to a number of places"),example:"round(number, [places: 0]);"},{name:"sqrt",description:Tt.t("calculates square root of a number"),example:"sqrt(number);"},{name:"sin",description:Tt.t("sine function"),example:"sin(number);"},{name:"tan",description:Tt.t("tangent function"),example:"tan(number);"},{name:"atan",description:Tt.t("arctangent - inverse of tangent function"),example:"atan(number);"},{name:"pi",description:Tt.t("returns pi"),example:"pi();"},{name:"pow",description:Tt.t("first argument raised to the power of the second argument"),example:"pow(@base, @exponent);"},{name:"mod",description:Tt.t("first argument modulus second argument"),example:"mod(number, number);"},{name:"min",description:Tt.t("returns the lowest of one or more values"),example:"min(@x, @y);"},{name:"max",description:Tt.t("returns the lowest of one or more values"),example:"max(@x, @y);"}],wr.colorProposals=[{name:"argb",example:"argb(@color);",description:Tt.t("creates a #AARRGGBB")},{name:"hsl",example:"hsl(@hue, @saturation, @lightness);",description:Tt.t("creates a color")},{name:"hsla",example:"hsla(@hue, @saturation, @lightness, @alpha);",description:Tt.t("creates a color")},{name:"hsv",example:"hsv(@hue, @saturation, @value);",description:Tt.t("creates a color")},{name:"hsva",example:"hsva(@hue, @saturation, @value, @alpha);",description:Tt.t("creates a color")},{name:"hue",example:"hue(@color);",description:Tt.t("returns the `hue` channel of `@color` in the HSL space")},{name:"saturation",example:"saturation(@color);",description:Tt.t("returns the `saturation` channel of `@color` in the HSL space")},{name:"lightness",example:"lightness(@color);",description:Tt.t("returns the `lightness` channel of `@color` in the HSL space")},{name:"hsvhue",example:"hsvhue(@color);",description:Tt.t("returns the `hue` channel of `@color` in the HSV space")},{name:"hsvsaturation",example:"hsvsaturation(@color);",description:Tt.t("returns the `saturation` channel of `@color` in the HSV space")},{name:"hsvvalue",example:"hsvvalue(@color);",description:Tt.t("returns the `value` channel of `@color` in the HSV space")},{name:"red",example:"red(@color);",description:Tt.t("returns the `red` channel of `@color`")},{name:"green",example:"green(@color);",description:Tt.t("returns the `green` channel of `@color`")},{name:"blue",example:"blue(@color);",description:Tt.t("returns the `blue` channel of `@color`")},{name:"alpha",example:"alpha(@color);",description:Tt.t("returns the `alpha` channel of `@color`")},{name:"luma",example:"luma(@color);",description:Tt.t("returns the `luma` value (perceptual brightness) of `@color`")},{name:"saturate",example:"saturate(@color, 10%);",description:Tt.t("return `@color` 10% points more saturated")},{name:"desaturate",example:"desaturate(@color, 10%);",description:Tt.t("return `@color` 10% points less saturated")},{name:"lighten",example:"lighten(@color, 10%);",description:Tt.t("return `@color` 10% points lighter")},{name:"darken",example:"darken(@color, 10%);",description:Tt.t("return `@color` 10% points darker")},{name:"fadein",example:"fadein(@color, 10%);",description:Tt.t("return `@color` 10% points less transparent")},{name:"fadeout",example:"fadeout(@color, 10%);",description:Tt.t("return `@color` 10% points more transparent")},{name:"fade",example:"fade(@color, 50%);",description:Tt.t("return `@color` with 50% transparency")},{name:"spin",example:"spin(@color, 10);",description:Tt.t("return `@color` with a 10 degree larger in hue")},{name:"mix",example:"mix(@color1, @color2, [@weight: 50%]);",description:Tt.t("return a mix of `@color1` and `@color2`")},{name:"greyscale",example:"greyscale(@color);",description:Tt.t("returns a grey, 100% desaturated color")},{name:"contrast",example:"contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]);",description:Tt.t("return `@darkcolor` if `@color1 is> 43% luma` otherwise return `@lightcolor`, see notes")},{name:"multiply",example:"multiply(@color1, @color2);"},{name:"screen",example:"screen(@color1, @color2);"},{name:"overlay",example:"overlay(@color1, @color2);"},{name:"softlight",example:"softlight(@color1, @color2);"},{name:"hardlight",example:"hardlight(@color1, @color2);"},{name:"difference",example:"difference(@color1, @color2);"},{name:"exclusion",example:"exclusion(@color1, @color2);"},{name:"average",example:"average(@color1, @color2);"},{name:"negation",example:"negation(@color1, @color2);"}],Sr=[,,function(e){function t(e){this.__parent=e,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}function n(e,t){this.__cache=[""],this.__indent_size=e.indent_size,this.__indent_string=e.indent_char,e.indent_with_tabs||(this.__indent_string=new Array(e.indent_size+1).join(e.indent_char)),t=t||"",e.indent_level>0&&(t=new Array(e.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}function i(e,i){this.__indent_cache=new n(e,i),this.raw=!1,this._end_with_newline=e.end_with_newline,this.indent_size=e.indent_size,this.wrap_line_length=e.wrap_line_length,this.indent_empty_lines=e.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new t(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}t.prototype.clone_empty=function(){var e=new t(this.__parent);return e.set_indent(this.__indent_count,this.__alignment_count),e},t.prototype.item=function(e){return e<0?this.__items[this.__items.length+e]:this.__items[e]},t.prototype.has_match=function(e){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(e))return!0;return!1},t.prototype.set_indent=function(e,t){this.is_empty()&&(this.__indent_count=e||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},t.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},t.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},t.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var e=this.__parent.current_line;return e.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),e.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),e.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count," "===e.__items[0]&&(e.__items.splice(0,1),e.__character_count-=1),!0}return!1},t.prototype.is_empty=function(){return 0===this.__items.length},t.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},t.prototype.push=function(e){this.__items.push(e);var t=e.lastIndexOf("\n");-1!==t?this.__character_count=e.length-t:this.__character_count+=e.length},t.prototype.pop=function(){var e=null;return this.is_empty()||(e=this.__items.pop(),this.__character_count-=e.length),e},t.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},t.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},t.prototype.trim=function(){for(;" "===this.last();)this.__items.pop(),this.__character_count-=1},t.prototype.toString=function(){var e="";return this.is_empty()?this.__parent.indent_empty_lines&&(e=this.__parent.get_indent_string(this.__indent_count)):(e=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),e+=this.__items.join("")),e},n.prototype.get_indent_size=function(e,t){var n=this.__base_string_length;return t=t||0,e<0&&(n=0),(n+=e*this.__indent_size)+t},n.prototype.get_indent_string=function(e,t){var n=this.__base_string;return t=t||0,e<0&&(e=0,n=""),t+=e*this.__indent_size,this.__ensure_cache(t),n+this.__cache[t]},n.prototype.__ensure_cache=function(e){for(;e>=this.__cache.length;)this.__add_column()},n.prototype.__add_column=function(){var e=this.__cache.length,t=0,n="";this.__indent_size&&e>=this.__indent_size&&(e-=(t=Math.floor(e/this.__indent_size))*this.__indent_size,n=new Array(t+1).join(this.__indent_string)),e&&(n+=new Array(e+1).join(" ")),this.__cache.push(n)},i.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},i.prototype.get_line_number=function(){return this.__lines.length},i.prototype.get_indent_string=function(e,t){return this.__indent_cache.get_indent_string(e,t)},i.prototype.get_indent_size=function(e,t){return this.__indent_cache.get_indent_size(e,t)},i.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},i.prototype.add_new_line=function(e){return!(this.is_empty()||!e&&this.just_added_newline()||(this.raw||this.__add_outputline(),0))},i.prototype.get_code=function(e){this.trim(!0);var t=this.current_line.pop();t&&("\n"===t[t.length-1]&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join("\n");return"\n"!==e&&(n=n.replace(/[\n]/g,e)),n},i.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},i.prototype.set_indent=function(e,t){return e=e||0,t=t||0,this.next_line.set_indent(e,t),this.__lines.length>1?(this.current_line.set_indent(e,t),!0):(this.current_line.set_indent(),!1)},i.prototype.add_raw_token=function(e){for(var t=0;t1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},i.prototype.just_added_newline=function(){return this.current_line.is_empty()},i.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},i.prototype.ensure_empty_line_above=function(e,n){for(var i=this.__lines.length-2;i>=0;){var r=this.__lines[i];if(r.is_empty())break;if(0!==r.item(0).indexOf(e)&&r.item(-1)!==n){this.__lines.splice(i+1,0,new t(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},e.exports.Output=i},,,,function(e){function t(e,t){this.raw_options=n(e,t),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs","\t"===this.indent_char),this.indent_with_tabs&&(this.indent_char="\t",1===this.indent_size&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","angular","django","erb","handlebars","php","smarty"],["auto"])}function n(e,t){var n,r={};for(n in e=i(e))n!==t&&(r[n]=e[n]);if(t&&e[t])for(n in e[t])r[n]=e[t][n];return r}function i(e){var t,n={};for(t in e)n[t.replace(/-/g,"_")]=e[t];return n}t.prototype._get_array=function(e,t){var n=this.raw_options[e],i=t||[];return"object"==typeof n?null!==n&&"function"==typeof n.concat&&(i=n.concat()):"string"==typeof n&&(i=n.split(/[^a-zA-Z0-9_\/\-]+/)),i},t.prototype._get_boolean=function(e,t){var n=this.raw_options[e];return void 0===n?!!t:!!n},t.prototype._get_characters=function(e,t){var n=this.raw_options[e],i=t||"";return"string"==typeof n&&(i=n.replace(/\\r/,"\r").replace(/\\n/,"\n").replace(/\\t/,"\t")),i},t.prototype._get_number=function(e,t){var n=this.raw_options[e];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(n,10);return isNaN(i)&&(i=t),i},t.prototype._get_selection=function(e,t,n){var i=this._get_selection_list(e,t,n);if(1!==i.length)throw new Error("Invalid Option Value: The option '"+e+"' can only be one of the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i[0]},t.prototype._get_selection_list=function(e,t,n){if(!t||0===t.length)throw new Error("Selection list cannot be empty.");if(n=n||[t[0]],!this._is_valid_selection(n,t))throw new Error("Invalid Default Value!");var i=this._get_array(e,n);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+e+"' can contain only the following values:\n"+t+"\nYou passed in: '"+this.raw_options[e]+"'");return i},t.prototype._is_valid_selection=function(e,t){return e.length&&t.length&&!e.some((function(e){return-1===t.indexOf(e)}))},e.exports.Options=t,e.exports.normalizeOpts=i,e.exports.mergeOpts=n},,function(e){var t=RegExp.prototype.hasOwnProperty("sticky");function n(e){this.__input=e||"",this.__input_length=this.__input.length,this.__position=0}n.prototype.restart=function(){this.__position=0},n.prototype.back=function(){this.__position>0&&(this.__position-=1)},n.prototype.hasNext=function(){return this.__position=0&&e=0&&t=e.length&&this.__input.substring(t-e.length,t).toLowerCase()===e},e.exports.InputScanner=n},,,,,function(e){function t(e,t){e="string"==typeof e?e:e.source,t="string"==typeof t?t:t.source,this.__directives_block_pattern=new RegExp(e+/ beautify( \w+[:]\w+)+ /.source+t,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(e+/\sbeautify\signore:end\s/.source+t,"g")}t.prototype.get_directives=function(e){if(!e.match(this.__directives_block_pattern))return null;var t={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(e);n;)t[n[1]]=n[2],n=this.__directive_pattern.exec(e);return t},t.prototype.readIgnored=function(e){return e.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=t},,function(e,t,n){var i=n(16).Beautifier,r=n(17).Options;e.exports=function(e,t){return new i(e,t).beautify()},e.exports.defaultOptions=function(){return new r}},function(e,t,n){var i=n(17).Options,r=n(2).Output,o=n(8).InputScanner,s=new(0,n(13).Directives)(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,c=/\s/,d=/(?:\s|\n)+/g,h=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,p=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function u(e,t){this._source_text=e||"",this._options=new i(t),this._ch=null,this._input=null,this.NESTED_AT_RULE={page:!0,"font-face":!0,keyframes:!0,media:!0,supports:!0,document:!0},this.CONDITIONAL_GROUP_RULE={media:!0,supports:!0,document:!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}u.prototype.eatString=function(e){var t="";for(this._ch=this._input.next();this._ch;){if(t+=this._ch,"\\"===this._ch)t+=this._input.next();else if(-1!==e.indexOf(this._ch)||"\n"===this._ch)break;this._ch=this._input.next()}return t},u.prototype.eatWhitespace=function(e){for(var t=c.test(this._input.peek()),n=0;c.test(this._input.peek());)this._ch=this._input.next(),e&&"\n"===this._ch&&(0===n||n0&&this._indentLevel--},u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var e=this._source_text,t=this._options.eol;"auto"===t&&(t="\n",e&&a.test(e||"")&&(t=e.match(a)[0]));var n=(e=e.replace(l,"\n")).match(/^[\t ]*/)[0];this._output=new r(this._options,n),this._input=new o(e),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var i,u,m=0,f=!1,g=!1,b=!1,v=!1,w=!1,y=this._ch,_=!1;i=""!==this._input.read(d),u=y,this._ch=this._input.next(),"\\"===this._ch&&this._input.hasNext()&&(this._ch+=this._input.next()),y=this._ch,this._ch;)if("/"===this._ch&&"*"===this._input.peek()){this._output.add_new_line(),this._input.back();var S=this._input.read(h),x=s.get_directives(S);x&&"start"===x.ignore&&(S+=s.readIgnored(this._input)),this.print_string(S),this.eatWhitespace(!0),this._output.add_new_line()}else if("/"===this._ch&&"/"===this._input.peek())this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(p)),this.eatWhitespace(!0);else if("$"===this._ch){this.preserveSingleSpace(i),this.print_string(this._ch);var k=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);k.match(/[ :]$/)&&(k=this.eatString(": ").replace(/\s+$/,""),this.print_string(k),this._output.space_before_token=!0),0===m&&-1!==k.indexOf(":")&&(g=!0,this.indent())}else if("@"===this._ch)if(this.preserveSingleSpace(i),"{"===this._input.peek())this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var C=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);C.match(/[ :]$/)&&(C=this.eatString(": ").replace(/\s+$/,""),this.print_string(C),this._output.space_before_token=!0),0===m&&-1!==C.indexOf(":")?(g=!0,this.indent()):C in this.NESTED_AT_RULE?(this._nestedLevel+=1,C in this.CONDITIONAL_GROUP_RULE&&(b=!0)):0!==m||g||(v=!0)}else if("#"===this._ch&&"{"===this._input.peek())this.preserveSingleSpace(i),this.print_string(this._ch+this.eatString("}"));else if("{"===this._ch)g&&(g=!1,this.outdent()),v=!1,b?(b=!1,f=this._indentLevel>=this._nestedLevel):f=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&f&&this._output.previous_line&&"{"!==this._output.previous_line.item(-1)&&this._output.ensure_empty_line_above("/",","),this._output.space_before_token=!0,"expand"===this._options.brace_style?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):("("===u?this._output.space_before_token=!1:","!==u&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if("}"===this._ch)this.outdent(),this._output.add_new_line(),"{"===u&&this._output.trim(!0),g&&(this.outdent(),g=!1),this.print_string(this._ch),f=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&"}"!==this._input.peek()&&this._output.add_new_line(!0),")"===this._input.peek()&&(this._output.trim(!0),"expand"===this._options.brace_style&&this._output.add_new_line(!0));else if(":"===this._ch){for(var T=0;T"!==this._ch&&"+"!==this._ch&&"~"!==this._ch||g||0!==m)if("]"===this._ch)this.print_string(this._ch);else if("["===this._ch)this.preserveSingleSpace(i),this.print_string(this._ch);else if("="===this._ch)this.eatWhitespace(),this.print_string("="),c.test(this._ch)&&(this._ch="");else if("!"!==this._ch||this._input.lookBack("\\")){var D='"'===u||"'"===u;this.preserveSingleSpace(D||i),this.print_string(this._ch),!this._output.just_added_newline()&&"\n"===this._input.peek()&&_&&this._output.add_new_line()}else this._output.space_before_token=!0,this.print_string(this._ch);else this._options.space_around_combinator?(this._output.space_before_token=!0,this.print_string(this._ch),this._output.space_before_token=!0):(this.print_string(this._ch),this.eatWhitespace(),this._ch&&c.test(this._ch)&&(this._ch=""));return this._output.get_code(t)},e.exports.Beautifier=u},function(e,t,n){var i=n(6).Options;function r(e){i.call(this,e,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var t=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||t;var n=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r0&&Mr(i,l-1);)l--;0===l||Fr(i,l-1)?a=l:l=0;){const n=e.charCodeAt(t);if(n===Er)return!0;if(n===Rr)return!1;t--}return!1}(i,a),r=c===i.length,i=i.substring(a,c),0!==a){const i=e.offsetAt(Mt.yX.create(t.start.line,0));o=function(e,t,n){let i=t,r=0;const o=n.tabSize||4;for(;i0){const e=n.insertSpaces?ee(" ",a*o):ee("\t",o);c=c.split("\n").join("\n"+e),0===t.start.character&&(c=e+c)}return[{range:t,newText:c}]}function Tr(e){return e.replace(/^\s+/,"")}const Er="{".charCodeAt(0),Rr="}".charCodeAt(0);function Dr(e,t,n){if(e&&e.hasOwnProperty(t)){const n=e[t];if(null!==n)return n}return n}function Fr(e,t){return-1!=="\r\n".indexOf(e.charAt(t))}function Mr(e,t){return-1!==" \t".indexOf(e.charAt(t))}const Ir={version:1.1,properties:[{name:"additive-symbols",browsers:["FF33"],atRule:"@counter-style",syntax:"[ && ]#",relevance:50,description:"@counter-style descriptor. Specifies the symbols used by the marker-construction algorithm specified by the system descriptor. Needs to be specified if the counter system is 'additive'.",restrictions:["integer","string","image","identifier"]},{name:"align-content",browsers:["E12","FF28","S9","C29","IE11","O16"],values:[{name:"center",description:"Lines are packed toward the center of the flex container."},{name:"flex-end",description:"Lines are packed toward the end of the flex container."},{name:"flex-start",description:"Lines are packed toward the start of the flex container."},{name:"space-around",description:"Lines are evenly distributed in the flex container, with half-size spaces on either end."},{name:"space-between",description:"Lines are evenly distributed in the flex container."},{name:"stretch",description:"Lines stretch to take up the remaining space."},{name:"start"},{name:"end"},{name:"normal"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"space-around"},{name:"space-between"},{name:"space-evenly"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | | | ? ",relevance:66,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-content"}],description:"Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how 'justify-content' aligns individual items within the main-axis.",restrictions:["enum"]},{name:"align-items",browsers:["E12","FF20","S9","C29","IE11","O16"],values:[{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"normal"},{name:"start"},{name:"end"},{name:"self-start"},{name:"self-end"},{name:"first baseline"},{name:"last baseline"},{name:"stretch"},{name:"safe"},{name:"unsafe"}],syntax:"normal | stretch | | [ ? ]",relevance:87,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-items"}],description:"Aligns flex items along the cross axis of the current line of the flex container.",restrictions:["enum"]},{name:"justify-items",browsers:["E12","FF20","S9","C52","IE11","O12.1"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"safe"},{name:"unsafe"},{name:"legacy"}],syntax:"normal | stretch | | ? [ | left | right ] | legacy | legacy && [ left | right | center ]",relevance:56,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-items"}],description:"Defines the default justify-self for all items of the box, giving them the default way of justifying each box along the appropriate axis",restrictions:["enum"]},{name:"justify-self",browsers:["E16","FF45","S10.1","C57","IE10","O44"],values:[{name:"auto"},{name:"normal"},{name:"end"},{name:"start"},{name:"flex-end",description:'"Flex items are packed toward the end of the line."'},{name:"flex-start",description:'"Flex items are packed toward the start of the line."'},{name:"self-end",description:"The item is packed flush to the edge of the alignment container of the end side of the item, in the appropriate axis."},{name:"self-start",description:"The item is packed flush to the edge of the alignment container of the start side of the item, in the appropriate axis.."},{name:"center",description:"The items are packed flush to each other toward the center of the of the alignment container."},{name:"left"},{name:"right"},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"save"},{name:"unsave"}],syntax:"auto | normal | stretch | | ? [ | left | right ]",relevance:55,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/justify-self"}],description:"Defines the way of justifying a box inside its container along the appropriate axis.",restrictions:["enum"]},{name:"align-self",browsers:["E12","FF20","S9","C29","IE10","O12.1"],values:[{name:"auto",description:"Computes to the value of 'align-items' on the element's parent, or 'stretch' if the element has no parent. On absolutely positioned elements, it computes to itself."},{name:"normal"},{name:"self-end"},{name:"self-start"},{name:"baseline",description:"If the flex item's inline axis is the same as the cross axis, this value is identical to 'flex-start'. Otherwise, it participates in baseline alignment."},{name:"center",description:"The flex item's margin box is centered in the cross axis within the line."},{name:"flex-end",description:"The cross-end margin edge of the flex item is placed flush with the cross-end edge of the line."},{name:"flex-start",description:"The cross-start margin edge of the flex item is placed flush with the cross-start edge of the line."},{name:"stretch",description:"If the cross size property of the flex item computes to auto, and neither of the cross-axis margins are auto, the flex item is stretched."},{name:"baseline"},{name:"first baseline"},{name:"last baseline"},{name:"safe"},{name:"unsafe"}],syntax:"auto | normal | stretch | | ? ",relevance:74,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/align-self"}],description:"Allows the default alignment along the cross axis to be overridden for individual flex items.",restrictions:["enum"]},{name:"all",browsers:["E79","FF27","S9.1","C37","O24"],values:[],syntax:"initial | inherit | unset | revert | revert-layer",relevance:54,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/all"}],description:"Shorthand that resets all properties except 'direction' and 'unicode-bidi'.",restrictions:["enum"]},{name:"alt",browsers:["S9"],values:[],relevance:50,description:"Provides alternative text for assistive technology to replace the generated content of a ::before or ::after element.",restrictions:["string","enum"]},{name:"animation",browsers:["E12","FF16","S9","C43","IE10","O30"],values:[{name:"alternate",description:"The animation cycle iterations that are odd counts are played in the normal direction, and the animation cycle iterations that are even counts are played in a reverse direction."},{name:"alternate-reverse",description:"The animation cycle iterations that are odd counts are played in the reverse direction, and the animation cycle iterations that are even counts are played in a normal direction."},{name:"backwards",description:"The beginning property value (as defined in the first @keyframes at-rule) is applied before the animation is displayed, during the period defined by 'animation-delay'."},{name:"both",description:"Both forwards and backwards fill modes are applied."},{name:"forwards",description:"The final property value (as defined in the last @keyframes at-rule) is maintained after the animation completes."},{name:"infinite",description:"Causes the animation to repeat forever."},{name:"none",description:"No animation is performed"},{name:"normal",description:"Normal playback."},{name:"reverse",description:"All iterations of the animation are played in the reverse direction from the way they were specified."}],syntax:"#",relevance:82,references:[{name:"MDN Reference",url:"https://developer.mozilla.org/docs/Web/CSS/animation"}],description:"Shorthand property combines six of the animation properties into a single property.",restrictions:["time","timing-function","enum","identifier","number"]},{name:"animation-delay",browsers:["E12","FF16","S9","C43","IE10","O30"],syntax:"