import{pageContextProperties as e,marginContextProperties as r}from"../../reference/properties.mjs";import{atRuleRegexes as t}from"../../utils/regexes.mjs";import s from"../../utils/getLexer.mjs";import{isAtRule as n}from"../../utils/typeGuards.mjs";import o from"../../utils/isStandardSyntaxAtRule.mjs";import a from"../../utils/isStandardSyntaxDeclaration.mjs";import{pageMarginAtKeywords as m}from"../../reference/atKeywords.mjs";import i from"../../utils/report.mjs";import u from"../../utils/ruleMessages.mjs";import l from"../../utils/validateOptions.mjs";const p="at-rule-descriptor-no-unknown",f=u(p,{rejected:(e,r)=>`Unexpected unknown descriptor "${r}" for at-rule "${e}"`}),c=(u,c,d)=>(c,g)=>{l(g,p,{actual:u})&&c.walkAtRules(t.unsupportedNestingNames,t=>{o(t)&&t.walkDecls(o=>{if(!a(o))return;const{prop:u,value:l,parent:c}=o;if(function(r,t){return"page"===r.name.toLowerCase()&&e.has(t)}(t,u))return;if(c&&n(c)&&function(e,t,s){return"page"===e.name.toLowerCase()&&m.has(s.name.toLowerCase())&&r.has(t)}(t,u,c))return;const j=s(d),{error:w}=j.matchAtruleDescriptor(t.name,u,l);if(!w)return;if("SyntaxReferenceError"!==w.name)return;if(!w.message.startsWith("Unknown at-rule descriptor"))return;const x=`@${t.name}`;i({message:f.rejected,messageArgs:[x,u],node:o,index:0,endIndex:u.length,ruleName:p,result:g})})})};c.ruleName=p,c.messages=f,c.meta={url:"https://stylelint.io/user-guide/rules/at-rule-descriptor-no-unknown"};export{c as default};