'use strict';
import { isIdentifier, isMemberExpression, isExportDefaultDeclaration } from '@flint/infra/analysis/node-type-type-guards';
import { nodeTypes } from '@flint/infra/analysis/function-analysis';
import { variableDeclarationKinds } from '@flint/infra/analysis/module-analysis';
import { firstOrUndefined } from '../../../fd-toolbox/server/collections/single-funcs.js';

var __defProp=Object['defineProperty'],__name=(_0x550c9d,_0x2ea0b8)=>__defProp(_0x550c9d,'name',{'value':_0x2ea0b8,'configurable':!![]});function isAsConstVariable(_0x50cf98){return !!_0x50cf98['init']&&(_0x50cf98['init']['type']===nodeTypes['TSAsExpression']||_0x50cf98['init']['type']===nodeTypes['TSSatisfiesExpression'])&&_0x50cf98['init']['typeAnnotation']['type']===nodeTypes['TSTypeReference']&&isIdentifier(_0x50cf98['init']['typeAnnotation']['typeName'])&&_0x50cf98['init']['typeAnnotation']['typeName']['name']===variableDeclarationKinds['const'];}__name(isAsConstVariable,'isAsConstVariable');function isExplicitlyTypedVariable(_0x486445){if(_0x486445&&(_0x486445['type']===nodeTypes['variable']||_0x486445['type']===nodeTypes['parameter']))return isIdentifier(_0x486445['name'])&&_0x486445['name']['typeAnnotation']!==void(-0x1956+0x1*-0xbe1+0x2537);return ![];}__name(isExplicitlyTypedVariable,'isExplicitlyTypedVariable');function getPatternIdentifier(_0x8e91ee){if(_0x8e91ee['type']===nodeTypes['identifier'])return _0x8e91ee;if(_0x8e91ee['type']===nodeTypes['assignmentPattern']&&_0x8e91ee['left']['type']===nodeTypes['identifier'])return _0x8e91ee['left'];return void(-0xf4+-0x24d0+-0x12e2*-0x2);}__name(getPatternIdentifier,'getPatternIdentifier');function isVariableUsedWithoutPropertyAccess(_0x1aacb7){return _0x1aacb7['references']['filter'](_0x17cbbe=>!_0x17cbbe['init'])['some'](_0x58a014=>!isMemberExpression(_0x58a014['identifier']['parent']));}__name(isVariableUsedWithoutPropertyAccess,'isVariableUsedWithoutPropertyAccess');function isDestructuringBinding(_0x572baf){let _0x348a53=![];if(_0x572baf['type']===nodeTypes['objectPattern']||_0x572baf['type']===nodeTypes['arrayPattern'])_0x348a53=!![];else {if(_0x572baf['type']===nodeTypes['assignmentPattern'])_0x348a53=isDestructuringBinding(_0x572baf['left']);else {if(_0x572baf['type']===nodeTypes['restElement'])_0x348a53=isDestructuringBinding(_0x572baf['argument']);else _0x572baf['type']===nodeTypes['TSParameterProperty']&&(_0x348a53=isDestructuringBinding(_0x572baf['parameter']));}}return _0x348a53;}__name(isDestructuringBinding,'isDestructuringBinding');function isObjectDestructuringBinding(_0x588797){let _0x136943=![];if(_0x588797['type']===nodeTypes['objectPattern'])_0x136943=!![];else {if(_0x588797['type']===nodeTypes['assignmentPattern'])_0x136943=isObjectDestructuringBinding(_0x588797['left']);else {if(_0x588797['type']===nodeTypes['restElement'])_0x136943=isObjectDestructuringBinding(_0x588797['argument']);else _0x588797['type']===nodeTypes['TSParameterProperty']&&(_0x136943=isObjectDestructuringBinding(_0x588797['parameter']));}}return _0x136943;}__name(isObjectDestructuringBinding,'isObjectDestructuringBinding');function isDeclarationExportedAsDefault(_0x347a1c,_0x4786b4){let _0x5c05db=![],_0x231e6b=firstOrUndefined([..._0x4786b4['getDeclaredVariables'](_0x347a1c)]);return _0x231e6b&&(_0x5c05db=_0x231e6b['references']['filter'](_0x330ba0=>!_0x330ba0['init'])['some'](_0x31a513=>isExportDefaultDeclaration(_0x31a513['identifier']['parent']))),_0x5c05db;}__name(isDeclarationExportedAsDefault,'isDeclarationExportedAsDefault');

export { getPatternIdentifier, isAsConstVariable, isDeclarationExportedAsDefault, isDestructuringBinding, isExplicitlyTypedVariable, isObjectDestructuringBinding, isVariableUsedWithoutPropertyAccess };
