import"../../../../postcss/lib/postcss.mjs";import{isString as e,isRegExp as t}from"../../utils/validateTypes.mjs";import{deprecatedAtKeywords as s}from"../../reference/atKeywords.mjs";import r from"../../utils/isStandardSyntaxAtRule.mjs";import o from"../../utils/optionsMatches.mjs";import a from"../../utils/report.mjs";import i from"../../utils/ruleMessages.mjs";import l from"../../utils/validateOptions.mjs";import m from"../../../../../_virtual/postcss2.mjs";const p="at-rule-no-deprecated",u=i(p,{rejected:e=>`Unexpected deprecated at-rule "${e}"`}),n=(i,n)=>(d,c)=>{l(c,p,{actual:i},{actual:n,possible:{ignoreAtRules:[e,t]},optional:!0})&&d.walkAtRules(e=>{if(!r(e))return;const{name:t}=e,i=t.toLowerCase();if(o(n,"ignoreAtRules",t))return;if(!s.has(i))return;const l="nest"===i?()=>{const t=m.rule({selector:e.params,source:e.source});t.append(e.nodes),e.replaceWith(t)}:void 0,d=`@${t}`;a({message:u.rejected,messageArgs:[d],node:e,ruleName:p,result:c,index:0,endIndex:d.length,fix:{apply:l,node:e.parent}})})};n.ruleName=p,n.messages=u,n.meta={url:"https://stylelint.io/user-guide/rules/at-rule-no-deprecated",fixable:!0};export{n as default};