import e from"../../utils/getRuleSelector.mjs";import t from"../../utils/isStandardSyntaxCombinator.mjs";import r from"../../utils/isStandardSyntaxRule.mjs";import{isString as s}from"../../utils/validateTypes.mjs";import o from"../../utils/parseSelector.mjs";import l from"../../utils/report.mjs";import i from"../../utils/ruleMessages.mjs";import a from"../../utils/validateOptions.mjs";const m="selector-combinator-allowed-list",u=i(m,{rejected:e=>`Unexpected combinator "${e}"`}),n=i=>(n,d)=>{a(d,m,{actual:i,possible:[s]})&&n.walkRules(s=>{r(s)&&o(e(s),d,s)?.walkCombinators(e=>{if(!t(e))return;const{value:r}=e,o=function(e){return e.replace(/\s+/g," ")}(r);if(i.includes(o))return;const{sourceIndex:a,raws:n}=e,p=a+(n&&n.value||r).length;l({result:d,ruleName:m,message:u.rejected,messageArgs:[o],node:s,index:a,endIndex:p})})})};n.primaryOptionArray=!0,n.ruleName=m,n.messages=u,n.meta={url:"https://stylelint.io/user-guide/rules/selector-combinator-allowed-list"};export{n as default};