import{tokenize as e,isTokenString as t}from"../../../../@csstools/css-tokenizer/dist/index.mjs";import{fork as s}from"../../../../css-tree/lib/index.mjs";import{atRuleRegexes as n,descriptorRegexes as r}from"../../utils/regexes.mjs";import{declarationValueIndex as i}from"../../utils/nodeFieldIndices.mjs";import a from"../../utils/report.mjs";import o from"../../utils/ruleMessages.mjs";import m from"../../utils/validateOptions.mjs";const l="syntax-string-no-invalid",c=o(l,{rejected:e=>`Unexpected invalid syntax string "${e}"`}),u=o=>(u,p)=>{if(!m(p,l,{actual:o}))return;const x=s({properties:{"-stylelint-syntax":"'*' | <syntax-component> [ <syntax-combinator> <syntax-component> ]*"},types:{"syntax-component":"<syntax-single-component> <syntax-multiplier>? | '<' transform-list '>'","syntax-single-component":"'<' <syntax-type-name> '>' | <ident>","syntax-type-name":"angle | color | custom-ident | image | integer | length | length-percentage | number | percentage | resolution | string | time | url | transform-function","syntax-combinator":"'|'","syntax-multiplier":"[ '#' | '+' ]"}}).lexer;u.walkAtRules(n.propertyName,s=>{s.walkDecls(r.syntaxName,s=>{e({css:s.value}).filter(e=>t(e)).forEach(e=>{const{error:t}=x.matchProperty("-stylelint-syntax",e[4].value);if(!t)return;if(!("mismatchLength"in t))return;const{name:n,rawMessage:r}=t;if("SyntaxMatchError"!==n)return;if("Mismatch"!==r)return;const o=i(s);a({message:c.rejected,messageArgs:[e[1]],node:s,index:o+e[2],endIndex:o+e[3]+1,result:p,ruleName:l})})})})};u.ruleName=l,u.messages=c,u.meta={url:"https://stylelint.io/user-guide/rules/syntax-string-no-invalid"};export{u as default};