import e from"../../../../../_virtual/index13.mjs";import{__require as r}from"../../utils/atRuleParamIndex.mjs";import{__require as s}from"../../utils/namespace.mjs";import{__require as t}from"../../utils/ruleUrl.mjs";var a,n;function i(){if(n)return a;n=1;const{utils:i}=e,u=r(),l=s(),m=t(),o=l("at-use-no-redundant-alias"),c=i.ruleMessages(o,{rejected:"Unexpected redundant namespace."}),p={url:m(o),fixable:!0};function d(e){return(r,s)=>{i.validateOptions(s,o,{actual:e})&&r.walkAtRules("use",e=>{const r=function(e){const r=e.replace(/"|'/g,"").split(/\s+as\s+|\s+with\s+/);if(!(r.length<2))return r}(e.params);if(r&&function(e){const r=e.match(/([^/:]+)$/)?.[1];return r?r.replace(/\.[^.]|["]+$/,""):""}(r[0])===r[1]){const r=()=>{e.after(e.toString().replace(/\s*as\s* [^\s*]+\s*/," ")),e.next().raws=e.raws,e.remove()},t=e.params.match(/as\s+\S+/);if(!t)return;const a=u(e)+t.index;i.report({message:c.rejected,node:e,result:s,ruleName:o,index:a,endIndex:a+t[0].length,fix:r})}})}}return d.ruleName=o,d.messages=c,d.meta=p,a=d}export{i as __require};