import"../../../../postcss/lib/postcss.mjs";import{isString as e,isRegExp as s,assert as t}from"../../utils/validateTypes.mjs";import{systemFontKeywords as o,fontFamilyKeywords as r}from"../../reference/keywords.mjs";import{declarationValueIndex as i}from"../../utils/nodeFieldIndices.mjs";import m from"../../utils/findFontFamily.mjs";import{isAtRule as n}from"../../utils/typeGuards.mjs";import a from"../../utils/isStandardSyntaxValue.mjs";import l from"../../utils/isVariable.mjs";import u from"../../utils/optionsMatches.mjs";import f from"../../utils/report.mjs";import p from"../../utils/ruleMessages.mjs";import c from"../../utils/validateOptions.mjs";import d from"../../../../../_virtual/postcss2.mjs";const g="font-family-no-missing-generic-family-keyword",j=p(g,{rejected:"Unexpected missing generic font family"}),y=(p,y)=>(v,w)=>{if(!c(w,g,{actual:p},{actual:y,possible:{ignoreFontFamilies:[e,s]},optional:!0}))return;const h=new Set(["font-face","font-palette-values"]);v.walkDecls(/^font(-family)?$/i,e=>{const s=e.parent;if(s&&n(s)&&h.has(s.name.toLowerCase()))return;if("font"===e.prop&&o.has(e.value.toLowerCase()))return;if((e=>{const s=d.list.comma(e).pop();return null!=s&&(l(s)||!a(s))})(e.value))return;const p=m(e.value);if(0===p.length)return;if(p.some(e=>(e=>!("quote"in e)&&r.has(e.value.toLowerCase()))(e)))return;if(p.some(e=>u(y,"ignoreFontFamilies",e.value)))return;const c=p[p.length-1];t(c);const v=i(e),x=v+c.sourceIndex,F=v+c.sourceEndIndex;f({result:w,ruleName:g,message:j.rejected,messageArgs:[],node:e,index:x,endIndex:F})})};y.ruleName=g,y.messages=j,y.meta={url:"https://stylelint.io/user-guide/rules/font-family-no-missing-generic-family-keyword"};export{y as default};