import e from"../../../../../_virtual/index19.mjs";import{systemColorsKeywords as r,animationShorthandKeywords as t,animationNameKeywords as s,fontShorthandKeywords as o,fontFamilyKeywords as i,gridRowKeywords as n,gridColumnKeywords as a,gridAreaKeywords as u,listStyleShorthandKeywords as l,listStyleTypeKeywords as m,camelCaseKeywords as f}from"../../reference/keywords.mjs";import{isBoolean as p,isString as c,isRegExp as d}from"../../utils/validateTypes.mjs";import{declarationValueIndex as g}from"../../utils/nodeFieldIndices.mjs";import w from"../../utils/getDeclarationValue.mjs";import h from"../../utils/getDimension.mjs";import y from"../../utils/isCounterIncrementCustomIdentValue.mjs";import j from"../../utils/isCounterResetCustomIdentValue.mjs";import v from"../../utils/isStandardSyntaxValue.mjs";import C from"../../utils/optionsMatches.mjs";import x from"../../utils/report.mjs";import S from"../../utils/ruleMessages.mjs";import I from"../../utils/validateOptions.mjs";const L="value-keyword-case",k=S(L,{expected:(e,r)=>`Expected "${e}" to be "${r}"`}),b=new Set(["+","-","/","*","%"]),K=new Set(["grid-row","grid-row-start","grid-row-end"]),V=new Set(["grid-column","grid-column-start","grid-column-end"]),D=new Map;for(const e of f)D.set(e.toLowerCase(),e);const F=(f,S)=>(F,M)=>{I(M,L,{actual:f,possible:["lower","upper"]},{actual:S,possible:{ignoreProperties:[c,d],ignoreKeywords:[c,d],ignoreFunctions:[c,d],camelCaseSvgKeywords:[p]},optional:!0})&&F.walkDecls(p=>{const c=p.prop,d=p.prop.toLowerCase(),I=p.value;if(!v(I))return;const F=e(w(p));F.walk(e=>{const w=e.value,N=w.toLowerCase();if(r.has(N))return;if("function"===e.type&&("url"===N||"var"===N||"counter"===N||"counters"===N||"attr"===N))return!1;if("function"===e.type&&C(S,"ignoreFunctions",w))return!1;const{unit:P}=h(e);if("word"!==e.type||!v(w)||I.includes("#")||b.has(w)||P)return;if("animation"===d&&!t.has(N)&&!s.has(N))return;if("animation-name"===d&&!s.has(N))return;if("font"===d&&!o.has(N)&&!i.has(N))return;if("font-family"===d&&!i.has(N))return;if("counter-increment"===d&&y(N))return;if("counter-reset"===d&&j(N))return;if(K.has(d)&&!n.has(N))return;if(V.has(d)&&!a.has(N))return;if("grid-area"===d&&!u.has(N))return;if("list-style"===d&&!l.has(N)&&!m.has(N))return;if("list-style-type"===d&&!m.has(N))return;if(C(S,"ignoreKeywords",w))return;if(C(S,"ignoreProperties",c))return;const $=w.toLocaleLowerCase();let A;const E=S&&S.camelCaseSvgKeywords||!1;if(A="lower"===f&&D.has($)&&E?D.get($):"lower"===f?w.toLowerCase():w.toUpperCase(),w===A)return;const O=g(p)+e.sourceIndex,R=O+w.length;x({message:k.expected,messageArgs:[w,A],node:p,index:O,endIndex:R,result:M,ruleName:L,fix:{apply:()=>{e.value=A,p.value=F.toString()},node:p}})})})};F.ruleName=L,F.messages=k,F.meta={url:"https://stylelint.io/user-guide/rules/value-keyword-case",fixable:!0};export{F as default};