import e from"../../../../../_virtual/index19.mjs";import{isString as t,isRegExp as s}from"../../utils/validateTypes.mjs";import{camelCaseFunctions as o}from"../../reference/functions.mjs";import{declarationValueIndex as r}from"../../utils/nodeFieldIndices.mjs";import i from"../../utils/getDeclarationValue.mjs";import n from"../../utils/isStandardSyntaxFunction.mjs";import a from"../../utils/isStandardSyntaxValue.mjs";import l from"../../utils/optionsMatches.mjs";import m from"../../utils/report.mjs";import u from"../../utils/ruleMessages.mjs";import p from"../../utils/setDeclarationValue.mjs";import c from"../../utils/validateOptions.mjs";const f="function-name-case",d=u(f,{expected:(e,t)=>`Expected "${e}" to be "${t}"`}),g=new Map;for(const e of o)g.set(e.toLowerCase(),e);const j=(o,u)=>(j,x)=>{c(x,f,{actual:o,possible:["lower","upper"]},{actual:u,possible:{ignoreFunctions:[t,s]},optional:!0})&&j.walkDecls(t=>{if(!t.value.includes("("))return;if(!a(t.value))return;const s=e(i(t));s.walk(e=>{if("function"!==e.type||!n(e))return;const i=e.value,a=i.toLowerCase();if(l(u,"ignoreFunctions",i))return;let c;if(c="lower"===o&&g.has(a)?g.get(a):"lower"===o?a:i.toUpperCase(),i===c)return;const j=r(t)+e.sourceIndex,w=j+i.length;m({message:d.expected,messageArgs:[i,c],node:t,index:j,endIndex:w,result:x,ruleName:f,fix:{apply:()=>{e.value=c,p(t,s.toString())},node:t}})})})};j.ruleName=f,j.messages=d,j.meta={url:"https://stylelint.io/user-guide/rules/function-name-case",fixable:!0};export{j as default};