import e from"../../../../../_virtual/index13.mjs";import{__require as r}from"../../utils/blockString.mjs";import{__require as n}from"../../utils/hasEmptyLine.mjs";import{__require as i}from"../../utils/isSingleLineString.mjs";import{__require as t}from"../../utils/namespace.mjs";import{__require as s}from"../../utils/optionsHaveException.mjs";import{__require as l}from"../../utils/optionsHaveIgnored.mjs";import{__require as a}from"../../utils/ruleUrl.mjs";import{__require as o}from"../../utils/validateTypes.mjs";var f,m;function p(){if(m)return f;m=1;const{utils:p}=e,u=r(),c=n(),w=i(),d=t(),b=s(),v=l(),_=a(),{isBoolean:x}=o(),g=d("dollar-variable-empty-line-after"),j=p.ruleMessages(g,{expected:"Expected an empty line after $-variable",rejected:"Unexpected empty line after $-variable"}),y={url:_(g),fixable:!0};function q(e,r,n){return(i,t)=>{if(!p.validateOptions(t,g,{actual:e,possible:["always","never"]},{actual:r,possible:{except:["last-nested","before-comment","before-dollar-variable"],ignore:["before-comment","inside-single-line-block"],disableFix:x},optional:!0}))return;const s=(e,r,n)=>{e.raws.before=e.raws.before.replace(new RegExp(`^${r}`),n)},l=(e,r,n)=>{e.parent.raws.after=e.parent.raws.after.replace(new RegExp(`^${r}`),n)},a=e=>e.prop&&"$"===e.prop[0];i.walkDecls(o=>{let f="always"===e;const m=b(r,"last-nested"),d=b(r,"before-comment"),_=b(r,"before-dollar-variable"),x=v(r,"inside-single-line-block"),y=v(r,"before-comment"),q=w(u(o.parent));if(!a(o))return;if(o===i.last)return;if(x&&"root"!==o.parent.type&&q)return;const E=o.next();if(E){const e=c(E.raws.before),r="comment"===E.type,n=a(E);if(r){if(y||f&&e&&!d||!f&&!e&&!d||f&&!e&&d||!f&&e&&d)return}else if(n){if(f&&e&&!_||!f&&!e&&!_||f&&!e&&_||!f&&e&&_||f&&e&&_)return}else if(f===e)return}else{const e=c(o.parent.raws.after);if(f&&e&&!m||!f&&!e&&!m||f&&!e&&m||!f&&e&&m)return}const $=r&&!0===r.disableFix;p.report({message:f?j.expected:j.rejected,node:o,result:t,ruleName:g,fix:$?void 0:()=>{if(E){const r=E.raws.before,i=c(r),t="comment"===E.type,l=a(E);if(f&&!i)return s(E,n.newline,n.newline+n.newline),void(!m||(e=r,e.indexOf(n.newline)>-1)||s(E,"\\s+",n.newline+n.newline));if(f&&d&&t&&i||f&&_&&l&&i||!f&&i)return s(o,"\\n\\r\\n","\r\n"),void s(E,n.newline+n.newline,n.newline);if(!f&&d&&t&&!i||!f&&_&&l&&!i)return void s(E,n.newline,n.newline+n.newline)}else{const e=c(o.parent.raws.after);if(f=m?!f:f,f&&!e)return void l(o,n.newline,n.newline+n.newline);if(!f&&e)return l(o,"\\n\\r\\n","\r\n"),void l(o,n.newline+n.newline,n.newline)}var e}})})}}return q.ruleName=g,q.messages=j,q.meta=y,f=q}export{p as __require};