'use strict';
import { ESLintUtils } from '@typescript-eslint/utils';
import { isStringLiteral } from '@flint/infra/analysis';
import { ruleTypes, url } from '@flint/infra/constants/rules-meta';

var __defProp=Object['defineProperty'],__name=(_0x538585,_0x11afd5)=>__defProp(_0x538585,'name',{'value':_0x11afd5,'configurable':!![]});const ruleName='use-of-only-english-in-repository';const englishOnlyMessageId='useOfOnlyEnglishInRepository',constants={'messageIds':{'useOfOnlyEnglishInRepository':englishOnlyMessageId},'meta':{'type':ruleTypes['problem'],'docs':{'description':'Use\x20only\x20English\x20in\x20comments\x20and\x20string\x20literals.'},'messages':{[englishOnlyMessageId]:ruleName+'\x0a###\x20**Must**\x20use\x20only\x20English\x20in\x20the\x20repository.\x0a\x0a####\x20Wrong\x0a\x0a//\x20Задайте\x20путь\x20к\x20директории\x0aconst\x20foo\x20=\x20\x22Добро\x20пожаловать\x22;\x0a\x0a####\x20Correct\x0a\x0a//\x20Set\x20directory\x20path\x0aconst\x20foo\x20=\x20\x22Welcome\x22;\x0a\x0a####\x20Why\x0a\x0aCode\x20should\x20be\x20consistent\x20and\x20understandable\x20for\x20all\x20team\x20members.\x20English\x20is\x20a\x20standard\x20language\x20for\x20documentation\x20and\x20codebases.'},'schema':[]}},createRule=ESLintUtils['RuleCreator'](_0x3e33cd=>''+url+_0x3e33cd),useOfOnlyEnglishInRepository=createRule({'name':ruleName,'meta':constants['meta'],'defaultOptions':[],'create'(_0x2b24b0){const _0x5b7c42=_0x2b24b0['sourceCode'];return {'Literal'(_0x274df9){typeof _0x274df9['value']==='string'&&checkText(_0x2b24b0,_0x274df9['value'],_0x274df9),'regex'in _0x274df9&&_0x274df9['regex']&&containsNonEnglish(_0x274df9['regex']['pattern'])&&_0x2b24b0['report']({'node':_0x274df9,'messageId':englishOnlyMessageId});},'TemplateLiteral'(_0x5ec9a1){for(const _0x18f09c of _0x5ec9a1['quasis']){const _0x4fcedc=_0x18f09c['value']['cooked']??_0x18f09c['value']['raw']??'';checkText(_0x2b24b0,_0x4fcedc,_0x18f09c);}for(const _0x53e9bb of _0x5ec9a1['expressions']){if(!isStringLiteral(_0x53e9bb)){const _0xdf1f00=_0x5b7c42['getText'](_0x53e9bb);checkText(_0x2b24b0,_0xdf1f00,_0x53e9bb);}}},'JSXText'(_0x249cef){checkText(_0x2b24b0,_0x249cef['value'],_0x249cef);},'Program'(){const _0x246215=_0x5b7c42['getAllComments']();for(const _0xc21daa of _0x246215){containsNonEnglish(_0xc21daa['value'])&&_0x2b24b0['report']({'loc':_0xc21daa['loc'],'messageId':englishOnlyMessageId});}}};}});function containsNonEnglish(_0x187abd){if(!_0x187abd)return ![];const _0x79ee21=/[\u0400-\u04FF\u0500-\u052F\uA640-\uA69F\u2DE0-\u2DFF]/,_0x39779f=_0x187abd['replace'](/\\u([\dA-Fa-f]{4})/g,(_0x5ef9ad,_0x331623)=>String['fromCharCode'](parseInt(_0x331623,-0x1edb+-0x1*0x6bf+0x25aa)));return _0x79ee21['test'](_0x39779f);}__name(containsNonEnglish,'containsNonEnglish');function checkText(_0x2545e4,_0x4f5b68,_0x3056b3){containsNonEnglish(_0x4f5b68)&&_0x3056b3&&_0x2545e4['report']({'node':_0x3056b3,'messageId':englishOnlyMessageId});}__name(checkText,'checkText');

export { useOfOnlyEnglishInRepository as default, ruleName };
