import{isString as e,isRegExp as s}from"../../utils/validateTypes.mjs";import{atRuleParamIndex as t}from"../../utils/nodeFieldIndices.mjs";import r from"../../utils/getAtRuleParams.mjs";import l from"../../utils/getRuleSelector.mjs";import i from"../../utils/isStandardSyntaxAtRule.mjs";import o from"../../utils/isStandardSyntaxRule.mjs";import m from"../../utils/matchesStringOrRegExp.mjs";import u from"../../utils/parseSelector.mjs";import a from"../../utils/report.mjs";import n from"../../utils/ruleMessages.mjs";import d from"../../utils/validateOptions.mjs";import p from"../../utils/vendor.mjs";const c="selector-pseudo-class-allowed-list",f=n(c,{rejected:e=>`Unexpected pseudo-class "${e}"`}),j=n=>(j,g)=>{function x(e,s,t=0){u(e,g,s)?.walkPseudos(({value:e,sourceIndex:r})=>{if("::"===e.slice(0,2))return;const l=e.slice(1);if(m(l,n))return;if(m(p.unprefixed(l),n))return;const i=t+r;a({message:f.rejected,messageArgs:[e],node:s,result:g,ruleName:c,index:i,endIndex:i+e.length})})}d(g,c,{actual:n,possible:[e,s]})&&(j.walkRules(e=>{if(!o(e))return;const s=l(e);s.includes(":")&&x(s,e)}),j.walkAtRules("page",e=>{if(!i(e))return;const s=r(e);s.includes(":")&&x(s,e,t(e))}))};j.primaryOptionArray=!0,j.ruleName=c,j.messages=f,j.meta={url:"https://stylelint.io/user-guide/rules/selector-pseudo-class-allowed-list"};export{j as default};