'use strict';
import { createEslintRule } from '@flint/infra/create-eslint-rule';
import { nodeTypes, isJSXNode } from '@flint/infra/analysis';
import { anyJSXElement } from '@flint/infra/constants/ast-selectors';

var __defProp=Object['defineProperty'],__name=(_0xc93fe8,_0x1f089d)=>__defProp(_0xc93fe8,'name',{'value':_0x1f089d,'configurable':!![]});const ruleName='must-not-use-empty-lines-in-html';const ruleContent='\x0a###\x20**Must**\x20not\x20use\x20empty\x20lines\x20in\x20Html.\x0a\x0a####\x20Wrong\x0a\x0a<div>\x0a\x20\x20\x20\x20<p>Foo</p>\x0a\x0a\x20\x20\x20\x20<p>Bar</p>\x0a</div>\x0a\x0a####\x20Correct\x0a\x0a<div>\x0a\x20\x20\x20\x20<p>Foo</p>\x0a\x20\x20\x20\x20<p>Bar</p>\x0a</div>\x0a\x0a####\x20Why\x0a\x0aEmpty\x20lines\x20in\x20Html\x20must\x20not\x20be\x20used\x20to\x20maintain\x20a\x20clean\x20and\x20consistent\x20code\x20structure,\x20improve\x20readability,\x20and\x20prevent\x20unnecessary\x20visual\x20clutter',constants={'emptyLineRegexp':/\r?\n\s*\r?\n/,'whitespaceRegexp':/[^\s]/};var mustNotUseEmptyLinesInHtml = createEslintRule(ruleName,ruleContent,_0x113fa2=>{return {[anyJSXElement]:_0x3563a9=>{const _0x3c6e68=_0x3563a9['children'];_0x3c6e68['forEach']((_0x40f131,_0x49b372)=>processChild(_0x113fa2,_0x3c6e68,_0x40f131,_0x49b372));}};});function processChild(_0x3bd380,_0x5c4f2b,_0x566212,_0x35150d){if(_0x566212['type']!==nodeTypes['JSXText'])return;const _0x4e24f2=_0x566212['value'];if(!constants['emptyLineRegexp']['test'](_0x4e24f2))return;const _0xa121ce=getPreviousMeaningful(_0x5c4f2b,_0x35150d),_0x477fd9=getNextMeaningful(_0x5c4f2b,_0x35150d);if(!(isJSXNode(_0xa121ce)||isJSXNode(_0x477fd9)))return;const _0xff4c69=_0x4e24f2['split']('\x0a')['slice'](0x438+-0xd26+0x8ef,-(0x138*0x4+0xde0+0x12bf*-0x1));for(let [_0x5e11d0,_0x3b4bf0]of _0xff4c69['entries']()){if(!constants['whitespaceRegexp']['test'](_0x3b4bf0)){const _0x1c7520=_0x566212['loc']['start']['line']+_0x5e11d0+(0x191*-0x4+0xd06*-0x1+0xb*0x1c1);_0x3bd380['report']({'messageId':ruleName,'loc':{'start':{'column':0x0,'line':_0x1c7520},'end':{'column':_0x3b4bf0['length'],'line':_0x1c7520}}});}}}__name(processChild,'processChild');function isJSXText(_0x2b86bb){return !!_0x2b86bb&&_0x2b86bb['type']===nodeTypes['JSXText'];}__name(isJSXText,'isJSXText');function isWhitespaceText(_0x5da18){return isJSXText(_0x5da18)&&!constants['whitespaceRegexp']['test'](_0x5da18['value']);}__name(isWhitespaceText,'isWhitespaceText');function getPreviousMeaningful(_0x338649,_0x394260){for(let _0x11d46c=_0x394260-(0x7*0x2e7+-0x116*0x1+-0x133a);_0x11d46c>=-0x7f*0x31+0x4ef+0x1360;_0x11d46c--){const _0x2a628d=_0x338649[_0x11d46c];if(!isWhitespaceText(_0x2a628d))return _0x2a628d;}return void(-0x5*-0x36b+0x841*0x1+0x656*-0x4);}__name(getPreviousMeaningful,'getPreviousMeaningful');function getNextMeaningful(_0x119cd6,_0x51c1be){for(let _0x55182b=_0x51c1be+(-0x15d*0x16+-0x1569+-0x524*-0xa);_0x55182b<_0x119cd6['length'];_0x55182b++){const _0x3ae4cd=_0x119cd6[_0x55182b];if(!isWhitespaceText(_0x3ae4cd))return _0x3ae4cd;}return void(-0x107*0x1+0x929+-0x822);}__name(getNextMeaningful,'getNextMeaningful');

export { mustNotUseEmptyLinesInHtml as default, ruleName };
