export const IBMI_KNOWN_EXTENSIONS=new Set(['.rpgle','.sqlrpgle','.clle','.cl','.clp','.dspf','.pf','.lf','.prtf','.table.sql','.index.sql','.proc.sql','.bnd','.msgf','.bnddir']);const INELIGIBLE_EXTENSIONS=new Set(['.md','.yml','.yaml','.xml','.html','.htm','.css','.js','.ts','.json','.lock','.log','.sh','.bat','.cmd','.mk','.png','.jpg','.jpeg','.gif','.svg','.ico','.zip','.tar','.gz','.pdf']),INELIGIBLE_FILENAMES=new Set(['.gitignore','.gitattributes','.gitmodules','.editorconfig','.prettierrc','.eslintrc','.npmrc','.env','license','makefile','dockerfile','jenkinsfile','.dockerignore']);export function getIbmiExtension(_0x4da419){const _0x44789d=_0x4da419['split']('/')['pop']();for(const _0x248fff of IBMI_KNOWN_EXTENSIONS){if(_0x248fff['includes']('.')&&_0x248fff!=='.'+_0x44789d['split']('.')['pop']()){if(_0x44789d['toLowerCase']()['endsWith'](_0x248fff))return _0x248fff;}}const _0x25bbe8=_0x44789d['lastIndexOf']('.');return _0x25bbe8>=0x0?_0x44789d['substring'](_0x25bbe8)['toLowerCase']():'';}export function getMemberName(_0x5714d3){const _0x230fb7=_0x5714d3['split']('/')['pop'](),_0x2d0943=getIbmiExtension(_0x5714d3);return _0x2d0943?_0x230fb7['substring'](0x0,_0x230fb7['length']-_0x2d0943['length']):_0x230fb7;}export function getSourceFileName(_0x319de7){const _0xd1289c=_0x319de7['split']('/');return _0xd1289c['length']>=0x2?_0xd1289c[_0xd1289c['length']-0x2]:'';}export function validateIbmiFile(_0x2f3743){const _0x1e6ba4=_0x2f3743['split']('/')['pop'](),_0x2b3bd3=_0x1e6ba4['toLowerCase']();if(INELIGIBLE_FILENAMES['has'](_0x2b3bd3))return{'valid':![],'reason':'\x22'+_0x1e6ba4+'\x22\x20is\x20not\x20an\x20IBM\x20i\x20source\x20type'};const _0x1768b8=_0x2b3bd3['lastIndexOf']('.');if(_0x1768b8>=0x0){const _0x25fe4c=_0x2b3bd3['substring'](_0x1768b8);if(INELIGIBLE_EXTENSIONS['has'](_0x25fe4c))return{'valid':![],'reason':'\x22'+_0x25fe4c+'\x22\x20files\x20are\x20not\x20IBM\x20i\x20source\x20types'};}const _0x347828=getSourceFileName(_0x2f3743),_0x486c66=getMemberName(_0x2f3743);if(_0x347828['length']>0xa)return{'valid':![],'reason':'Directory\x20name\x20\x22'+_0x347828+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20source\x20file\x20name\x20limit)'};if(_0x486c66['length']>0xa)return{'valid':![],'reason':'File\x20name\x20\x22'+_0x486c66+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20member\x20name\x20limit)'};const _0x3f2a92=getIbmiExtension(_0x2f3743);if(_0x3f2a92){const _0x52a07c=_0x3f2a92['startsWith']('.')?_0x3f2a92['substring'](0x1):_0x3f2a92;if(_0x52a07c['length']>0xa)return{'valid':![],'reason':'Extension\x20\x22'+_0x3f2a92+'\x22\x20exceeds\x2010\x20characters\x20(IBM\x20i\x20member\x20type\x20limit)'};}return{'valid':!![]};}export function hasKnownIbmiExtension(_0x4cd152){const _0x832afc=getIbmiExtension(_0x4cd152);return IBMI_KNOWN_EXTENSIONS['has'](_0x832afc);}