import e from"../../../../../_virtual/index13.mjs";import{__require as r}from"../../utils/validateTypes.mjs";import{__require as t}from"../../utils/namespace.mjs";import{__require as n}from"../../utils/ruleUrl.mjs";var i,o;function u(){if(o)return i;o=1;const{utils:u}=e,{isBoolean:a}=r(),{isString:s}=r(),l=t(),p=n(),d=l("no-duplicate-dollar-variables"),f=u.ruleMessages(d,{rejected:e=>`Unexpected duplicate dollar variable ${e}`}),c={url:p(d)};function m(e,r){return(t,n)=>{if(!u.validateOptions(n,d,{actual:e},{actual:r,possible:{ignoreInside:["at-rule","nested-at-rule"],ignoreInsideAtRules:[s],ignoreDefaults:[a]},optional:!0}))return;const i={};const o=r&&void 0!==r.ignoreDefaults?r.ignoreDefaults:1;t.walkDecls(e=>{const t="$"===e.prop[0],a="atrule"===e.parent.type&&r&&r.ignoreInside&&"at-rule"===r.ignoreInside,s="atrule"===e.parent.type&&"root"!==e.parent.parent.type&&r&&r.ignoreInside&&"nested-at-rule"===r.ignoreInside,l="atrule"===e.parent.type&&r&&r.ignoreInsideAtRules&&r.ignoreInsideAtRules.includes(e.parent.name);if(!t||a||s||l)return;const p=[];let c=e.parent;for(;null!=c;){const e=c.toString();p.unshift(e),c=c.parent}const m=function(e){let r=i;for(const t of e)t in r||(r[t]={}),r=r[t];return r}(p),g=/!default/.test(e.value),_=function(e,r){let t=i;for(const n of e)if(t=t[n],t[r])return t[r];return{defaultCount:0,isDeclared:!1}}(p,e.prop);(function(e,r,t){if(r){if(Number.isFinite(t))return e.defaultCount>=t;if(t)return!1}return e.isDeclared})(_,g,o)&&u.report({message:f.rejected(e.prop),node:e,result:n,ruleName:d,word:e.prop}),m[e.prop]=function(e,r,t){return{defaultCount:r?++e.defaultCount:e.defaultCount,isDeclared:!r||!1===t||e.isDeclared}}(_,g,o)})}}return m.ruleName=d,m.messages=f,m.meta=c,i=m}export{u as __require};