interface TypeParameter extends BaseNode {
    type: "TypeParameter";
    bound?: TypeAnnotation | null;
    default?: FlowType | null;
    variance?: Variance | null;
    name: string;
}


interface TypeParameterDeclaration extends BaseNode {
    type: "TypeParameterDeclaration";
    params: Array<TypeParameter>;
}


interface TypeParameterInstantiation extends BaseNode {
    type: "TypeParameterInstantiation";
    params: Array<FlowType>;
}


interface UnionTypeAnnotation extends BaseNode {
    type: "UnionTypeAnnotation";
    types: Array<FlowType>;
}


interface Variance extends BaseNode {
    type: "Variance";
    kind: "minus" | "plus";
}


interface VoidTypeAnnotation extends BaseNode {
    type: "VoidTypeAnnotation";
}


interface EnumDeclaration extends BaseNode {
    type: "EnumDeclaration";
    id: Identifier;
    body: EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody;
}


interface EnumBooleanBody extends BaseNode {
    type: "EnumBooleanBody";
    members: Array<EnumBooleanMember>;
    explicitType: boolean;
    hasUnknownMembers: boolean;
}


interface EnumNumberBody extends BaseNode {
    type: "EnumNumberBody";
    members: Array<EnumNumberMember>;
    explicitType: boolean;
    hasUnknownMembers: boolean;
}


interface EnumStringBody extends BaseNode {
    type: "EnumStringBody";
    members: Array<EnumStringMember | EnumDefaultedMember>;
    explicitType: boolean;
    hasUnknownMembers: boolean;
}


interface EnumSymbolBody extends BaseNode {
    type: "EnumSymbolBody";
    members: Array<EnumDefaultedMember>;
    hasUnknownMembers: boolean;
}


interface EnumBooleanMember extends BaseNode {
    type: "EnumBooleanMember";
    id: Identifier;
    init: BooleanLiteral;
}


interface EnumNumberMember extends BaseNode {
    type: "EnumNumberMember";
    id: Identifier;
    init: NumericLiteral;
}


interface EnumStringMember extends BaseNode {
    type: "EnumStringMember";
    id: Identifier;
    init: StringLiteral;
}


interface EnumDefaultedMember extends BaseNode {
    type: "EnumDefaultedMember";
    id: Identifier;
}


interface IndexedAccessType extends BaseNode {
    type: "IndexedAccessType";
    objectType: FlowType;
    indexType: FlowType;
}


interface OptionalIndexedAccessType extends BaseNode {
    type: "OptionalIndexedAccessType";
    objectType: FlowType;
    indexType: FlowType;
    optional: boolean;
}


interface JSXAttribute extends BaseNode {
    type: "JSXAttribute";
    name: JSXIdentifier | JSXNamespacedName;
    value?: JSXElement | JSXFragment | StringLiteral | JSXExpressionContainer | null;
}


interface JSXClosingElement extends BaseNode {
    type: "JSXClosingElement";
    name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
}


interface JSXElement extends BaseNode {
    type: "JSXElement";
    openingElement: JSXOpeningElement;
    closingElement?: JSXClosingElement | null;
    children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>;
    selfClosing?: boolean | null;
}


interface JSXEmptyExpression extends BaseNode {
    type: "JSXEmptyExpression";
}


interface JSXExpressionContainer extends BaseNode {
    type: "JSXExpressionContainer";
    expression: Expression | JSXEmptyExpression;
}


interface JSXSpreadChild extends BaseNode {
    type: "JSXSpreadChild";
    expression: Expression;
}


interface JSXIdentifier extends BaseNode {
    type: "JSXIdentifier";
    name: string;
}


interface JSXMemberExpression extends BaseNode {
    type: "JSXMemberExpression";
    object: JSXMemberExpression | JSXIdentifier;
    property: JSXIdentifier;
}


interface JSXNamespacedName extends BaseNode {
    type: "JSXNamespacedName";
    namespace: JSXIdentifier;
    name: JSXIdentifier;
}


interface JSXOpeningElement extends BaseNode {
    type: "JSXOpeningElement";
    name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
    attributes: Array<JSXAttribute | JSXSpreadAttribute>;
    selfClosing: boolean;
    typeParameters?: TypeParameterInstantiation | TSTypeParameterInstantiation | null;
}


interface JSXSpreadAttribute extends BaseNode {
    type: "JSXSpreadAttribute";
    argument: Expression;
}


interface JSXText extends BaseNode {
    type: "JSXText";
    value: string;
}


interface JSXFragment extends BaseNode {
    type: "JSXFragment";
    openingFragment: JSXOpeningFragment;
    closingFragment: JSXClosingFragment;
    children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>;
}


interface JSXOpeningFragment extends BaseNode {
    type: "JSXOpeningFragment";
}


interface JSXClosingFragment extends BaseNode {
    type: "JSXClosingFragment";
}


interface Noop extends BaseNode {
    type: "Noop";
}


interface Placeholder extends BaseNode {
    type: "Placeholder";
    expectedNode: "Identifier" | "StringLiteral" | "Expression" | "Statement" | "Declaration" | "BlockStatement" | "ClassBody" | "Pattern";
    name: Identifier;
}


interface V8IntrinsicIdentifier extends BaseNode {
    type: "V8IntrinsicIdentifier";
    name: string;
}


interface ArgumentPlaceholder extends BaseNode {
    type: "ArgumentPlaceholder";
}


interface BindExpression extends BaseNode {
    type: "BindExpression";
    object: Expression;
    callee: Expression;
}


interface ImportAttribute extends BaseNode {
    type: "ImportAttribute";
    key: Identifier | StringLiteral;
    value: StringLiteral;
}


interface Decorator extends BaseNode {
    type: "Decorator";
    expression: Expression;
}


interface DoExpression extends BaseNode {
    type: "DoExpression";
    body: BlockStatement;
    async: boolean;
}


interface ExportDefaultSpecifier extends BaseNode {
    type: "ExportDefaultSpecifier";
    exported: Identifier;
}


interface RecordExpression extends BaseNode {
    type: "RecordExpression";
    properties: Array<ObjectProperty | SpreadElement>;
}


interface TupleExpression extends BaseNode {
    type: "TupleExpression";
    elements: Array<Expression | SpreadElement>;
}


interface DecimalLiteral extends BaseNode {
    type: "DecimalLiteral";
    value: string;
}


interface ModuleExpression extends BaseNode {
    type: "ModuleExpression";
    body: Program;
}


interface TopicReference extends BaseNode {
    type: "TopicReference";
}


interface PipelineTopicExpression extends BaseNode {
    type: "PipelineTopicExpression";
    expression: Expression;
}


interface PipelineBareFunction extends BaseNode {
    type: "PipelineBareFunction";
    callee: Expression;
}


interface PipelinePrimaryTopicReference extends BaseNode {
    type: "PipelinePrimaryTopicReference";
}


interface TSParameterProperty extends BaseNode {
    type: "TSParameterProperty";
    parameter: Identifier | AssignmentPattern;
    accessibility?: "public" | "private" | "protected" | null;
    decorators?: Array<Decorator> | null;
    override?: boolean | null;
    readonly?: boolean | null;
}


interface TSDeclareFunction extends BaseNode {
    type: "TSDeclareFunction";
    id?: Identifier | null;
    typeParameters?: TSTypeParameterDeclaration | Noop | null;
    params: Array<Identifier | Pattern | RestElement>;
    returnType?: TSTypeAnnotation | Noop | null;
    async?: boolean;
    declare?: boolean | null;
    generator?: boolean;
}


interface TSDeclareMethod extends BaseNode {
    type: "TSDeclareMethod";
    decorators?: Array<Decorator> | null;
    key: Identifier | StringLiteral | NumericLiteral | Expression;
    typeParameters?: TSTypeParameterDeclaration | Noop | null;
    params: Array<Identifier | Pattern | RestElement | TSParameterProperty>;
    returnType?: TSTypeAnnotation | Noop | null;
    abstract?: boolean | null;
    access?: "public" | "private" | "protected" | null;
    accessibility?: "public" | "private" | "protected" | null;
    async?: boolean;
    computed?: boolean;
    generator?: boolean;
    kind?: "get" | "set" | "method" | "constructor";
    optional?: boolean | null;
    override?: boolean;
    static?: boolean;
}


interface TSQualifiedName extends BaseNode {
    type: "TSQualifiedName";
    left: TSEntityName;
    right: Identifier;
}


interface TSCallSignatureDeclaration extends BaseNode {
    type: "TSCallSignatureDeclaration";
    typeParameters?: TSTypeParameterDeclaration | null;
    parameters: Array<Identifier | RestElement>;
    typeAnnotation?: TSTypeAnnotation | null;
}


interface TSConstructSignatureDeclaration extends BaseNode {
    type: "TSConstructSignatureDeclaration";
    typeParameters?: TSTypeParameterDeclaration | null;
    parameters: Array<Identifier | RestElement>;
    typeAnnotation?: TSTypeAnnotation | null;
}


interface TSPropertySignature extends BaseNode {
    type: "TSPropertySignature";
    key: Expression;
    typeAnnotation?: TSTypeAnnotation | null;
    initializer?: Expression | null;
    computed?: boolean | null;
    kind: "get" | "set";
    optional?: boolean | null;
    readonly?: boolean | null;
}


interface TSMethodSignature extends BaseNode {
    type: "TSMethodSignature";
    key: Expression;
    typeParameters?: TSTypeParameterDeclaration | null;
    parameters: Array<Identifier | RestElement>;
    typeAnnotation?: TSTypeAnnotation | null;
    computed?: boolean | null;
    kind: "method" | "get" | "set";
    optional?: boolean | null;
}


interface TSIndexSignature extends BaseNode {
    type: "TSIndexSignature";
    parameters: Array<Identifier>;
    typeAnnotation?: TSTypeAnnotation | null;
    readonly?: boolean | null;
    static?: boolean | null;
}


interface TSAnyKeyword extends BaseNode {
    type: "TSAnyKeyword";
}


interface TSBooleanKeyword extends BaseNode {
    type: "TSBooleanKeyword";
}


interface TSBigIntKeyword extends BaseNode {
    type: "TSBigIntKeyword";
}


interface TSIntrinsicKeyword extends BaseNode {
    type: "TSIntrinsicKeyword";
}


interface TSNeverKeyword extends BaseNode {
    type: "TSNeverKeyword";
}


interface TSNullKeyword extends BaseNode {
    type: "TSNullKeyword";
}


interface TSNumberKeyword extends BaseNode {
    type: "TSNumberKeyword";
}


interface TSObjectKeyword extends BaseNode {
    type: "TSObjectKeyword";
}


interface TSStringKeyword extends BaseNode {
    type: "TSStringKeyword";
}


interface TSSymbolKeyword extends BaseNode {
    type: "TSSymbolKeyword";
}


interface TSUndefinedKeyword extends BaseNode {
    type: "TSUndefinedKeyword";
}


interface TSUnknownKeyword extends BaseNode {
    type: "TSUnknownKeyword";
}


interface TSVoidKeyword extends BaseNode {
    type: "TSVoidKeyword";
}


interface TSThisType extends BaseNode {
    type: "TSThisType";
}


interface TSFunctionType extends BaseNode {
    type: "TSFunctionType";
    typeParameters?: TSTypeParameterDeclaration | null;
    parameters: Array<Identifier | RestElement>;
    typeAnnotation?: TSTypeAnnotation | null;
}


interface TSConstructorType extends BaseNode {
    type: "TSConstructorType";
    typeParameters?: TSTypeParameterDeclaration | null;
    parameters: Array<Identifier | RestElement>;
    typeAnnotation?: TSTypeAnnotation | null;
    abstract?: boolean | null;
}


interface TSTypeReference extends BaseNode {
    type: "TSTypeReference";
    typeName: TSEntityName;
    typeParameters?: TSTypeParameterInstantiation | null;
}


interface TSTypePredicate extends BaseNode {
    type: "TSTypePredicate";
    parameterName: Identifier | TSThisType;
    typeAnnotation?: TSTypeAnnotation | null;
    asserts?: boolean | null;
}


interface TSTypeQuery extends BaseNode {
    type: "TSTypeQuery";
    exprName: TSEntityName | TSImportType;
}


interface TSTypeLiteral extends BaseNode {
    type: "TSTypeLiteral";
    members: Array<TSTypeElement>;
}


interface TSArrayType extends BaseNode {
    type: "TSArrayType";
    elementType: TSType;
}


interface TSTupleType extends BaseNode {
    type: "TSTupleType";
    elementTypes: Array<TSType | TSNamedTupleMember>;
}


interface TSOptionalType extends BaseNode {
    type: "TSOptionalType";
    typeAnnotation: TSType;
}


interface TSRestType extends BaseNode {
    type: "TSRestType";
    typeAnnotation: TSType;
}


interface TSNamedTupleMember extends BaseNode {
    type: "TSNamedTupleMember";
    label: Identifier;
    elementType: TSType;
    optional: boolean;
}


interface TSUnionType extends BaseNode {
    type: "TSUnionType";
    types: Array<TSType>;
}


interface TSIntersectionType extends BaseNode {
    type: "TSIntersectionType";
    types: Array<TSType>;
}


interface TSConditionalType extends BaseNode {
    type: "TSConditionalType";
    checkType: TSType;
    extendsType: TSType;
    trueType: TSType;
    falseType: TSType;
}


interface TSInferType extends BaseNode {
    type: "TSInferType";
    typeParameter: TSTypeParameter;
}


interface TSParenthesizedType extends BaseNode {
    type: "TSParenthesizedType";
    typeAnnotation: TSType;
}


interface TSTypeOperator extends BaseNode {
    type: "TSTypeOperator";
    typeAnnotation: TSType;
    operator: string;
}


interface TSIndexedAccessType extends BaseNode {
    type: "TSIndexedAccessType";
    objectType: TSType;
    indexType: TSType;
}


interface TSMappedType extends BaseNode {
    type: "TSMappedType";
    typeParameter: TSTypeParameter;
    typeAnnotation?: TSType | null;
    nameType?: TSType | null;
    optional?: boolean | null;
    readonly?: boolean | null;
}


interface TSLiteralType extends BaseNode {
    type: "TSLiteralType";
    literal: NumericLiteral | StringLiteral | BooleanLiteral | BigIntLiteral | UnaryExpression;
}


interface TSExpressionWithTypeArguments extends BaseNode {
    type: "TSExpressionWithTypeArguments";
    expression: TSEntityName;
    typeParameters?: TSTypeParameterInstantiation | null;
}


interface TSInterfaceDeclaration extends BaseNode {
    type: "TSInterfaceDeclaration";
    id: Identifier;
    typeParameters?: TSTypeParameterDeclaration | null;
    extends?: Array<TSExpressionWithTypeArguments> | null;
    body: TSInterfaceBody;
    declare?: boolean | null;
}


interface TSInterfaceBody extends BaseNode {
    type: "TSInterfaceBody";
    body: Array<TSTypeElement>;
}


interface TSTypeAliasDeclaration extends BaseNode {
    type: "TSTypeAliasDeclaration";
    id: Identifier;
    typeParameters?: TSTypeParameterDeclaration | null;
    typeAnnotation: TSType;
    declare?: boolean | null;
}


interface TSAsExpression extends BaseNode {
    type: "TSAsExpression";
    expression: Expression;
    typeAnnotation: TSType;
}


interface TSTypeAssertion extends BaseNode {
    type: "TSTypeAssertion";
    typeAnnotation: TSType;
    expression: Expression;
}


interface TSEnumDeclaration extends BaseNode {
    type: "TSEnumDeclaration";
    id: Identifier;
    members: Array<TSEnumMember>;
    const?: boolean | null;
    declare?: boolean | null;
    initializer?: Expression | null;
}


interface TSEnumMember extends BaseNode {
    type: "TSEnumMember";
    id: Identifier | StringLiteral;
    initializer?: Expression | null;
}


interface TSModuleDeclaration extends BaseNode {
    type: "TSModuleDeclaration";
    id: Identifier | StringLiteral;
    body: TSModuleBlock | TSModuleDeclaration;
    declare?: boolean | null;
    global?: boolean | null;
}


interface TSModuleBlock extends BaseNode {
    type: "TSModuleBlock";
    body: Array<Statement>;
}


interface TSImportType extends BaseNode {
    type: "TSImportType";
    argument: StringLiteral;
    qualifier?: TSEntityName | null;
    typeParameters?: TSTypeParameterInstantiation | null;
}


interface TSImportEqualsDeclaration extends BaseNode {
    type: "TSImportEqualsDeclaration";
    id: Identifier;
    moduleReference: TSEntityName | TSExternalModuleReference;
    importKind?: "type" | "value" | null;
    isExport: boolean;
}


interface TSExternalModuleReference extends BaseNode {
    type: "TSExternalModuleReference";
    expression: StringLiteral;
}


interface TSNonNullExpression extends BaseNode {
    type: "TSNonNullExpression";
    expression: Expression;
}


interface TSExportAssignment extends BaseNode {
    type: "TSExportAssignment";
    expression: Expression;
}


interface TSNamespaceExportDeclaration extends BaseNode {
    type: "TSNamespaceExportDeclaration";
    id: Identifier;
}


interface TSTypeAnnotation extends BaseNode {
    type: "TSTypeAnnotation";
    typeAnnotation: TSType;
}


interface TSTypeParameterInstantiation extends BaseNode {
    type: "TSTypeParameterInstantiation";
    params: Array<TSType>;
}


interface TSTypeParameterDeclaration extends BaseNode {
    type: "TSTypeParameterDeclaration";
    params: Array<TSTypeParameter>;
}


interface TSTypeParameter extends BaseNode {
    type: "TSTypeParameter";
    constraint?: TSType | null;
    default?: TSType | null;
    name: string;
}


interface Aliases {
    Standardized: Standardized;
    Expression: Expression;
    Binary: Binary;
    Scopable: Scopable;
    BlockParent: BlockParent;
    Block: Block;
    Statement: Statement;
    Terminatorless: Terminatorless;
    CompletionStatement: CompletionStatement;
    Conditional: Conditional;
    Loop: Loop;
    While: While;
    ExpressionWrapper: ExpressionWrapper;
    For: For;
    ForXStatement: ForXStatement;
    Function: Function;
    FunctionParent: FunctionParent;
    Pureish: Pureish;
    Declaration: Declaration;
    PatternLike: PatternLike;
    LVal: LVal;
    TSEntityName: TSEntityName;
    Literal: Literal;
    Immutable: Immutable;
    UserWhitespacable: UserWhitespacable;
    Method: Method;
    ObjectMember: ObjectMember;
    Property: Property;
    UnaryLike: UnaryLike;
    Pattern: Pattern;
    Class: Class;
    ModuleDeclaration: ModuleDeclaration;
    ExportDeclaration: ExportDeclaration;
    ModuleSpecifier: ModuleSpecifier;
    Accessor: Accessor;
    Private: Private;
    Flow: Flow;
    FlowType: FlowType;
    FlowBaseAnnotation: FlowBaseAnnotation;
    FlowDeclaration: FlowDeclaration;
    FlowPredicate: FlowPredicate;
    EnumBody: EnumBody;
    EnumMember: EnumMember;
    JSX: JSX;
    Miscellaneous: Miscellaneous;
    TypeScript: TypeScript;
    TSTypeElement: TSTypeElement;
    TSType: TSType;
    TSBaseType: TSBaseType;
}


declare type Comment = CommentBlock | CommentLine;


declare type CommentTypeShorthand = "leading" | "inner" | "trailing";


declare type Node = AnyTypeAnnotation | ArgumentPlaceholder | ArrayExpression | ArrayPattern | ArrayTypeAnnotation | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BigIntLiteral | BinaryExpression | BindExpression | BlockStatement | BooleanLiteral | BooleanLiteralTypeAnnotation | BooleanTypeAnnotation | BreakStatement | CallExpression | CatchClause | ClassAccessorProperty | ClassBody | ClassDeclaration | ClassExpression | ClassImplements | ClassMethod | ClassPrivateMethod | ClassPrivateProperty | ClassProperty | ConditionalExpression | ContinueStatement | DebuggerStatement | DecimalLiteral | DeclareClass | DeclareExportAllDeclaration | DeclareExportDeclaration | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareOpaqueType | DeclareTypeAlias | DeclareVariable | DeclaredPredicate | Decorator | Directive | DirectiveLiteral | DoExpression | DoWhileStatement | EmptyStatement | EmptyTypeAnnotation | EnumBooleanBody | EnumBooleanMember | EnumDeclaration | EnumDefaultedMember | EnumNumberBody | EnumNumberMember | EnumStringBody | EnumStringMember | EnumSymbolBody | ExistsTypeAnnotation | ExportAllDeclaration | ExportDefaultDeclaration | ExportDefaultSpecifier | ExportNamedDeclaration | ExportNamespaceSpecifier | ExportSpecifier | ExpressionStatement | File | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | Identifier | IfStatement | Import | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | IndexedAccessType | InferredPredicate | InterfaceDeclaration | InterfaceExtends | InterfaceTypeAnnotation | InterpreterDirective | IntersectionTypeAnnotation | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | LogicalExpression | MemberExpression | MetaProperty | MixedTypeAnnotation | ModuleExpression | NewExpression | Noop | NullLiteral | NullLiteralTypeAnnotation | NullableTypeAnnotation | NumberLiteral$1 | NumberLiteralTypeAnnotation | NumberTypeAnnotation | NumericLiteral | ObjectExpression | ObjectMethod | ObjectPattern | ObjectProperty | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeInternalSlot | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | OptionalCallExpression | OptionalIndexedAccessType | OptionalMemberExpression | ParenthesizedExpression | PipelineBareFunction | PipelinePrimaryTopicReference | PipelineTopicExpression | Placeholder | PrivateName | Program | QualifiedTypeIdentifier | RecordExpression | RegExpLiteral | RegexLiteral$1 | RestElement | RestProperty$1 | ReturnStatement | SequenceExpression | SpreadElement | SpreadProperty$1 | StaticBlock | StringLiteral | StringLiteralTypeAnnotation | StringTypeAnnotation | Super | SwitchCase | SwitchStatement | SymbolTypeAnnotation | TSAnyKeyword | TSArrayType | TSAsExpression | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSConditionalType | TSConstructSignatureDeclaration | TSConstructorType | TSDeclareFunction | TSDeclareMethod | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExpressionWithTypeArguments | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexSignature | TSIndexedAccessType | TSInferType | TSInterfaceBody | TSInterfaceDeclaration | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSParenthesizedType | TSPropertySignature | TSQualifiedName | TSRestType | TSStringKeyword | TSSymbolKeyword | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThisTypeAnnotation | ThrowStatement | TopicReference | TryStatement | TupleExpression | TupleTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | TypeofTypeAnnotation | UnaryExpression | UnionTypeAnnotation | UpdateExpression | V8IntrinsicIdentifier | VariableDeclaration | VariableDeclarator | Variance | VoidTypeAnnotation | WhileStatement | WithStatement | YieldExpression;


declare type Standardized = ArrayExpression | AssignmentExpression | BinaryExpression | InterpreterDirective | Directive | DirectiveLiteral | BlockStatement | BreakStatement | CallExpression | CatchClause | ConditionalExpression | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | File | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | LabeledStatement | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | Program | ObjectExpression | ObjectMethod | ObjectProperty | RestElement | ReturnStatement | SequenceExpression | ParenthesizedExpression | SwitchCase | SwitchStatement | ThisExpression | ThrowStatement | TryStatement | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | AssignmentPattern | ArrayPattern | ArrowFunctionExpression | ClassBody | ClassExpression | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ForOfStatement | ImportDeclaration | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | MetaProperty | ClassMethod | ObjectPattern | SpreadElement | Super | TaggedTemplateExpression | TemplateElement | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | ExportNamespaceSpecifier | OptionalMemberExpression | OptionalCallExpression | ClassProperty | ClassAccessorProperty | ClassPrivateProperty | ClassPrivateMethod | PrivateName | StaticBlock;


declare type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ParenthesizedExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | AwaitExpression | Import | BigIntLiteral | OptionalMemberExpression | OptionalCallExpression | TypeCastExpression | JSXElement | JSXFragment | BindExpression | DoExpression | RecordExpression | TupleExpression | DecimalLiteral | ModuleExpression | TopicReference | PipelineTopicExpression | PipelineBareFunction | PipelinePrimaryTopicReference | TSAsExpression | TSTypeAssertion | TSNonNullExpression;


declare type Binary = BinaryExpression | LogicalExpression;


declare type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassExpression | ClassDeclaration | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;


declare type BlockParent = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod | ClassPrivateMethod | StaticBlock | TSModuleBlock;


declare type Block = BlockStatement | Program | TSModuleBlock;


declare type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration | TSImportEqualsDeclaration | TSExportAssignment | TSNamespaceExportDeclaration;


declare type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression;


declare type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement;


declare type Conditional = ConditionalExpression | IfStatement;


declare type Loop = DoWhileStatement | ForInStatement | ForStatement | WhileStatement | ForOfStatement;


declare type While = DoWhileStatement | WhileStatement;


declare type ExpressionWrapper = ExpressionStatement | ParenthesizedExpression | TypeCastExpression;


declare type For = ForInStatement | ForStatement | ForOfStatement;


declare type ForXStatement = ForInStatement | ForOfStatement;


declare type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod;


declare type FunctionParent = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod | ClassPrivateMethod | StaticBlock;


declare type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | ArrowFunctionExpression | BigIntLiteral | DecimalLiteral;


declare type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias | EnumDeclaration | TSDeclareFunction | TSInterfaceDeclaration | TSTypeAliasDeclaration | TSEnumDeclaration | TSModuleDeclaration;


declare type PatternLike = Identifier | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern;


declare type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern | TSParameterProperty;


declare type TSEntityName = Identifier | TSQualifiedName;


declare type Literal = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | RegExpLiteral | TemplateLiteral | BigIntLiteral | DecimalLiteral;


declare type Immutable = StringLiteral | NumericLiteral | NullLiteral | BooleanLiteral | BigIntLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXSpreadChild | JSXOpeningElement | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment | DecimalLiteral;


declare type UserWhitespacable = ObjectMethod | ObjectProperty | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty;


declare type Method = ObjectMethod | ClassMethod | ClassPrivateMethod;


declare type ObjectMember = ObjectMethod | ObjectProperty;


declare type Property = ObjectProperty | ClassProperty | ClassAccessorProperty | ClassPrivateProperty;


declare type UnaryLike = UnaryExpression | SpreadElement;


declare type Pattern = AssignmentPattern | ArrayPattern | ObjectPattern;


declare type Class = ClassExpression | ClassDeclaration;


declare type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration;


declare type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration;


declare type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportNamespaceSpecifier | ExportDefaultSpecifier;


declare type Accessor = ClassAccessorProperty;


declare type Private = ClassPrivateProperty | ClassPrivateMethod | PrivateName;


declare type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ClassImplements | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | DeclaredPredicate | ExistsTypeAnnotation | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InferredPredicate | InterfaceExtends | InterfaceDeclaration | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | ObjectTypeInternalSlot | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | ObjectTypeSpreadProperty | OpaqueType | QualifiedTypeIdentifier | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameter | TypeParameterDeclaration | TypeParameterInstantiation | UnionTypeAnnotation | Variance | VoidTypeAnnotation | EnumDeclaration | EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody | EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember | IndexedAccessType | OptionalIndexedAccessType;


declare type FlowType = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | NullLiteralTypeAnnotation | ExistsTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | InterfaceTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NullableTypeAnnotation | NumberLiteralTypeAnnotation | NumberTypeAnnotation | ObjectTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation | IndexedAccessType | OptionalIndexedAccessType;


declare type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | NullLiteralTypeAnnotation | MixedTypeAnnotation | EmptyTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | SymbolTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation;


declare type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareModuleExports | DeclareTypeAlias | DeclareOpaqueType | DeclareVariable | DeclareExportDeclaration | DeclareExportAllDeclaration | InterfaceDeclaration | OpaqueType | TypeAlias;


declare type FlowPredicate = DeclaredPredicate | InferredPredicate;


declare type EnumBody = EnumBooleanBody | EnumNumberBody | EnumStringBody | EnumSymbolBody;


declare type EnumMember = EnumBooleanMember | EnumNumberMember | EnumStringMember | EnumDefaultedMember;


declare type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXSpreadChild | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText | JSXFragment | JSXOpeningFragment | JSXClosingFragment;


declare type Miscellaneous = Noop | Placeholder | V8IntrinsicIdentifier;


declare type TypeScript = TSParameterProperty | TSDeclareFunction | TSDeclareMethod | TSQualifiedName | TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature | TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSNamedTupleMember | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSInterfaceDeclaration | TSInterfaceBody | TSTypeAliasDeclaration | TSAsExpression | TSTypeAssertion | TSEnumDeclaration | TSEnumMember | TSModuleDeclaration | TSModuleBlock | TSImportType | TSImportEqualsDeclaration | TSExternalModuleReference | TSNonNullExpression | TSExportAssignment | TSNamespaceExportDeclaration | TSTypeAnnotation | TSTypeParameterInstantiation | TSTypeParameterDeclaration | TSTypeParameter;


declare type TSTypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSPropertySignature | TSMethodSignature | TSIndexSignature;


declare type TSType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSFunctionType | TSConstructorType | TSTypeReference | TSTypePredicate | TSTypeQuery | TSTypeLiteral | TSArrayType | TSTupleType | TSOptionalType | TSRestType | TSUnionType | TSIntersectionType | TSConditionalType | TSInferType | TSParenthesizedType | TSTypeOperator | TSIndexedAccessType | TSMappedType | TSLiteralType | TSExpressionWithTypeArguments | TSImportType;


declare type TSBaseType = TSAnyKeyword | TSBooleanKeyword | TSBigIntKeyword | TSIntrinsicKeyword | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSStringKeyword | TSSymbolKeyword | TSUndefinedKeyword | TSUnknownKeyword | TSVoidKeyword | TSThisType | TSLiteralType;


declare type DeprecatedAliases = NumberLiteral$1 | RegexLiteral$1 | RestProperty$1 | SpreadProperty$1;


declare type ReturnedChild = JSXSpreadChild | JSXElement | JSXFragment | Expression;


//# sourceMappingURL=toKeyAlias.d.ts.map
declare type Scope = {
    push(value: {
        id: LVal;
        kind: "var";
        init?: Expression;
    }): void;
    buildUndefinedNode(): Node;
};


//# sourceMappingURL=getOuterBindingIdentifiers.d.ts.map
declare type TraversalAncestors = Array<{
    node: Node;
    key: string;
    index?: number;
}>;


declare type TraversalHandler<T> = (this: undefined, node: Node, parent: TraversalAncestors, state: T) => void;


declare type TraversalHandlers<T> = {
    enter?: TraversalHandler<T>;
    exit?: TraversalHandler<T>;
};


/*
Copyright 2018 Renzhi Li (aka. Belleve Invis)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
function quadSolve(a: number, b: number, c: number) {
	// a*x^2 + b*x + c = 0
	if (a === 0) {
		return b === 0 ? [] : [-c / b];
	}
	let D = b * b - 4 * a * c;
	if (D < 0) {
		return [];
	} else if (D === 0) {
		return [-b / (2 * a)];
	}
	let DSqrt = Math.sqrt(D);
	return [(-b - DSqrt) / (2 * a), (-b + DSqrt) / (2 * a)];
}


function cubicRoot(x: number) {
	return x < 0 ? -Math.pow(-x, 1 / 3) : Math.pow(x, 1 / 3);
}


function cubicSolve(a: number, b: number, c: number, d: number) {
	// a*x^3 + b*x^2 + c*x + d = 0
	if (a === 0) {
		return quadSolve(b, c, d);
	}
	// solve using Cardan's method, which is described in paper of R.W.D. Nickals
	// http://www.nickalls.org/dick/papers/maths/cubic1993.pdf (doi:10.2307/3619777)
	let xn = -b / (3 * a); // point of symmetry x coordinate
	let yn = ((a * xn + b) * xn + c) * xn + d; // point of symmetry y coordinate
	let deltaSq = (b * b - 3 * a * c) / (9 * a * a); // delta^2
	let hSq = 4 * a * a * Math.pow(deltaSq, 3); // h^2
	let D3 = yn * yn - hSq;
	if (D3 > 0) {
		// 1 real root
		let D3Sqrt = Math.sqrt(D3);
		return [xn + cubicRoot((-yn + D3Sqrt) / (2 * a)) + cubicRoot((-yn - D3Sqrt) / (2 * a))];
	} else if (D3 === 0) {
		// 2 real roots
		let delta1 = cubicRoot(yn / (2 * a));
		return [xn - 2 * delta1, xn + delta1];
	}
	// 3 real roots
	let theta = Math.acos(-yn / Math.sqrt(hSq)) / 3;
	let delta = Math.sqrt(deltaSq);
	return [
		xn + 2 * delta * Math.cos(theta),
		xn + 2 * delta * Math.cos(theta + (Math.PI * 2) / 3),
		xn + 2 * delta * Math.cos(theta + (Math.PI * 4) / 3)
	];
}


function cubicSolveT(e3: number, e2: number, e1: number, e0: number) {
	const as = cubicSolve(e3, e2, e1, e0);
	const r = [0, 1];
	for (const x of as) if (x > 0 && x < 1) r.push(x);
	return r;
}


function bez2(a: number, b: number, c: number, t: number) {
	return mix(mix(a, b, t), mix(b, c, t), t);
}


export function minDistanceToQuad(
	zx: number,
	zy: number,
	ax: number,
	ay: number,
	bx: number,
	by: number,
	cx: number,
	cy: number
): number {
	const aax = ax + cx - 2 * bx;
	const aay = ay + cy - 2 * by;
	const bbx = 2 * (bx - ax);
	const bby = 2 * (by - ay);
	const e3 = 2 * (aax * aax + aay * aay);
	const e2 = 3 * (aax * bbx + aay * bby);
	const e1 = bbx * bbx + bby * bby + 2 * (aax * (ax - zx) + aay * (ay - zy));
	const e0 = (ax - zx) * bbx + (ay - zy) * bby;

	let candidates = cubicSolveT(e3, e2, e1, e0);

	let minDistance = 1e9;
	for (const t of candidates) {
		const tx = bez2(ax, bx, cx, t);
		const ty = bez2(ay, by, cy, t);
		const distance = (tx - zx) * (tx - zx) + (ty - zy) * (ty - zy);
		if (distance < minDistance) minDistance = distance;
	}
	return minDistance;
}


@NgModule({
	declarations: [
	],
	imports: [
	],
	providers: [
		DocumentRef,
		BigScreenService
	],
	exports: [
	]
})
export class BigScreenModule {
}


value => {
            loadTx.setText(`${Math.floor(value * 100)}%`);
        }


() => this.onLoadComplete()


export default class Preloader extends Phaser.Scene {

    constructor() {
        super(PRELOADER_KEY);
    }

    create() {
        this.load.multiatlas('anims', 'assets/chars/multiatlas.json', 'assets/chars/');
        const loadTx = this.add.text(this.scale.width / 2, this.scale.height / 2, '0%', {
            fontSize: '45px',
        }).setOrigin(0.5);
        this.load.animation('animsData', 'assets/chars/anims.json');
        this.load.on('progress', value => {
            loadTx.setText(`${Math.floor(value * 100)}%`);
        });
        this.load.once('complete', () => this.onLoadComplete());
        this.load.start();
    }

    onLoadComplete() {
        this.scene.start(MENU_KEY);
    }

}


create() {
        this.load.multiatlas('anims', 'assets/chars/multiatlas.json', 'assets/chars/');
        const loadTx = this.add.text(this.scale.width / 2, this.scale.height / 2, '0%', {
            fontSize: '45px',
        }).setOrigin(0.5);
        this.load.animation('animsData', 'assets/chars/anims.json');
        this.load.on('progress', value => {
            loadTx.setText(`${Math.floor(value * 100)}%`);
        });
        this.load.once('complete', () => this.onLoadComplete());
        this.load.start();
    }


onLoadComplete() {
        this.scene.start(MENU_KEY);
    }


function randomString(len: number) {
      let text = "";
      const charset = "abcdefghijklmnopqrstuvwxyz";
      for (let charIndex = 0; charIndex < len; charIndex++) {
        text += charset.charAt(Math.floor(Math.random() * charset.length));
      }
      return text;
    }


function replaceAt(str: string, index: number, character: string) {
      return (
        str.substr(0, index) + character + str.substr(index + character.length)
      );
    }


function solveTest(
  singleSelectionName: keyof typeof Genetic.Select1,
  pairWiseSelectionName: keyof typeof Genetic.Select2,
  config: Partial<Configuration>
) {
  const singleSelection: SingleSelection<Entity> =
    Genetic.Select1[singleSelectionName];
  const pairWiseSelection: PairWiseSelection<Entity> =
    Genetic.Select2[pairWiseSelectionName];
  const title = singleSelectionName + ", " + pairWiseSelectionName;
  it(title, done => {
    jest.setTimeout(10000);
    expect.assertions(1);
    const userData: UserData = {
      solution: "thisisthesolution",
    };
    class CustomPhraseGenetic extends PhraseGenetic {
      public select1: SingleSelection<Entity> = singleSelection;
      public select2: PairWiseSelection<Entity> = pairWiseSelection;
      public notification({
        population: pop,
        generation,
        isFinished,
      }: {
        population: Population<Entity>;
        generation: number;
        stats: Stats;
        isFinished: boolean;
      }) {
        if (isFinished) {
          expect(pop[0].entity).toBe(this.userData.solution);
          done();
        }
      }
    }
    const genetic = new CustomPhraseGenetic(config, userData);
    return genetic.evolve();
  });
}


done => {
    jest.setTimeout(10000);
    expect.assertions(1);
    const userData: UserData = {
      solution: "thisisthesolution",
    };
    class CustomPhraseGenetic extends PhraseGenetic {
      public select1: SingleSelection<Entity> = singleSelection;
      public select2: PairWiseSelection<Entity> = pairWiseSelection;
      public notification({
        population: pop,
        generation,
        isFinished,
      }: {
        population: Population<Entity>;
        generation: number;
        stats: Stats;
        isFinished: boolean;
      }) {
        if (isFinished) {
          expect(pop[0].entity).toBe(this.userData.solution);
          done();
        }
      }
    }
    const genetic = new CustomPhraseGenetic(config, userData);
    return genetic.evolve();
  }


() => {
  const config: Partial<Configuration> = {
    crossover: 0.4,
    iterations: 2000,
    mutation: 0.3,
    size: 20,
  };
  const singleSelectionName = "Tournament3";
  const pairWiseSelectionName = "Tournament3";
  solveTest(singleSelectionName as any, pairWiseSelectionName as any, config);
  // Object.keys(Genetic.Select1).forEach(singleSelectionName => {
  //   Object.keys(Genetic.Select2).forEach(pairWiseSelectionName => {
  //     solveTest(
  //       singleSelectionName as any,
  //       pairWiseSelectionName as any,
  //       config
  //     );
  //   });
  // });
}


abstract class PhraseGenetic extends Genetic.Genetic<Entity, UserData> {
  public optimize: Optimize.OptimizeFun = Genetic.Optimize.Maximize;
  public seed() {
    function randomString(len: number) {
      let text = "";
      const charset = "abcdefghijklmnopqrstuvwxyz";
      for (let charIndex = 0; charIndex < len; charIndex++) {
        text += charset.charAt(Math.floor(Math.random() * charset.length));
      }
      return text;
    }

    // create random strings that are equal in length to solution
    return randomString(this.userData.solution.length);
  }
  public mutate(entity: Entity) {
    function replaceAt(str: string, index: number, character: string) {
      return (
        str.substr(0, index) + character + str.substr(index + character.length)
      );
    }

    // chromosomal drift
    const replaceIndex = Math.floor(Math.random() * entity.length);
    return replaceAt(
      entity,
      replaceIndex,
      String.fromCharCode(
        entity.charCodeAt(replaceIndex) +
          (Math.floor(Math.random() * 2) ? 1 : -1)
      )
    );
  }
  public crossover(mother: Entity, father: Entity): [Entity, Entity] {
    // two-point crossover
    const len = mother.length;
    let ca = Math.floor(Math.random() * len);
    let cb = Math.floor(Math.random() * len);
    if (ca > cb) {
      const tmp = cb;
      cb = ca;
      ca = tmp;
    }

    const son =
      father.substr(0, ca) + mother.substr(ca, cb - ca) + father.substr(cb);
    const daughter =
      mother.substr(0, ca) + father.substr(ca, cb - ca) + mother.substr(cb);

    return [son, daughter];
  }
  public fitness(entity: Entity) {
    let fitness = 0;
    for (let entityIndex = 0; entityIndex < entity.length; ++entityIndex) {
      // increase fitness for each character that matches
      if (entity[entityIndex] === this.userData.solution[entityIndex]) {
        fitness += 1;
      }

      // award fractions of a point as we get warmer
      fitness +=
        (127 -
          Math.abs(
            entity.charCodeAt(entityIndex) -
              this.userData.solution.charCodeAt(entityIndex)
          )) /
        50;
    }

    return fitness;
  }

  public shouldContinue({
    population: pop,
    generation,
    stats,
  }: GeneticState<Entity>): boolean {
    // stop running once we've reached the solution
    return pop[0].entity !== this.userData.solution;
  }
}


class CustomPhraseGenetic extends PhraseGenetic {
      public select1: SingleSelection<Entity> = singleSelection;
      public select2: PairWiseSelection<Entity> = pairWiseSelection;
      public notification({
        population: pop,
        generation,
        isFinished,
      }: {
        population: Population<Entity>;
        generation: number;
        stats: Stats;
        isFinished: boolean;
      }) {
        if (isFinished) {
          expect(pop[0].entity).toBe(this.userData.solution);
          done();
        }
      }
    }


type Entity = string;


type UserData = {
  solution: string;
};


public seed() {
    function randomString(len: number) {
      let text = "";
      const charset = "abcdefghijklmnopqrstuvwxyz";
      for (let charIndex = 0; charIndex < len; charIndex++) {
        text += charset.charAt(Math.floor(Math.random() * charset.length));
      }
      return text;
    }

    // create random strings that are equal in length to solution
    return randomString(this.userData.solution.length);
  }


public mutate(entity: Entity) {
    function replaceAt(str: string, index: number, character: string) {
      return (
        str.substr(0, index) + character + str.substr(index + character.length)
      );
    }

    // chromosomal drift
    const replaceIndex = Math.floor(Math.random() * entity.length);
    return replaceAt(
      entity,
      replaceIndex,
      String.fromCharCode(
        entity.charCodeAt(replaceIndex) +
          (Math.floor(Math.random() * 2) ? 1 : -1)
      )
    );
  }


public crossover(mother: Entity, father: Entity): [Entity, Entity] {
    // two-point crossover
    const len = mother.length;
    let ca = Math.floor(Math.random() * len);
    let cb = Math.floor(Math.random() * len);
    if (ca > cb) {
      const tmp = cb;
      cb = ca;
      ca = tmp;
    }

    const son =
      father.substr(0, ca) + mother.substr(ca, cb - ca) + father.substr(cb);
    const daughter =
      mother.substr(0, ca) + father.substr(ca, cb - ca) + mother.substr(cb);

    return [son, daughter];
  }


public fitness(entity: Entity) {
    let fitness = 0;
    for (let entityIndex = 0; entityIndex < entity.length; ++entityIndex) {
      // increase fitness for each character that matches
      if (entity[entityIndex] === this.userData.solution[entityIndex]) {
        fitness += 1;
      }

      // award fractions of a point as we get warmer
      fitness +=
        (127 -
          Math.abs(
            entity.charCodeAt(entityIndex) -
              this.userData.solution.charCodeAt(entityIndex)
          )) /
        50;
    }

    return fitness;
  }


public shouldContinue({
    population: pop,
    generation,
    stats,
  }: GeneticState<Entity>): boolean {
    // stop running once we've reached the solution
    return pop[0].entity !== this.userData.solution;
  }


public notification({
        population: pop,
        generation,
        isFinished,
      }: {
        population: Population<Entity>;
        generation: number;
        stats: Stats;
        isFinished: boolean;
      }) {
        if (isFinished) {
          expect(pop[0].entity).toBe(this.userData.solution);
          done();
        }
      }


(
  environment: Environment,
  input: DisableSecondFactorInput
) => {
  return new Promise<DisableSecondFactorMutationResponse>(
    async (resolve, reject) => {
      commitMutation<DisableSecondFactorMutation>(environment, {
        onCompleted: data => {
          const response = data.disableSecondFactor.secondFactorOrErrors

          switch (response.__typename) {
            case "AppSecondFactor":
              resolve(data)
              break
            case "SmsSecondFactor":
              resolve(data)
              break
            case "Errors":
              reject(response.errors)
          }
        },
        onError: error => {
          reject(error)
        },
        mutation: graphql`
          mutation DisableSecondFactorMutation(
            $input: DisableSecondFactorInput!
          ) @raw_response_type {
            disableSecondFactor(input: $input) {
              secondFactorOrErrors {
                ... on AppSecondFactor {
                  __typename
                }

                ... on SmsSecondFactor {
                  __typename
                }

                ... on Errors {
                  __typename
                  errors {
                    message
                    code
                  }
                }
              }
            }
          }
        `,
        variables: {
          input,
        },
      })
    }
  )
}


async (resolve, reject) => {
      commitMutation<DisableSecondFactorMutation>(environment, {
        onCompleted: data => {
          const response = data.disableSecondFactor.secondFactorOrErrors

          switch (response.__typename) {
            case "AppSecondFactor":
              resolve(data)
              break
            case "SmsSecondFactor":
              resolve(data)
              break
            case "Errors":
              reject(response.errors)
          }
        },
        onError: error => {
          reject(error)
        },
        mutation: graphql`
          mutation DisableSecondFactorMutation(
            $input: DisableSecondFactorInput!
          ) @raw_response_type {
            disableSecondFactor(input: $input) {
              secondFactorOrErrors {
                ... on AppSecondFactor {
                  __typename
                }

                ... on SmsSecondFactor {
                  __typename
                }

                ... on Errors {
                  __typename
                  errors {
                    message
                    code
                  }
                }
              }
            }
          }
        `,
        variables: {
          input,
        },
      })
    }


data => {
          const response = data.disableSecondFactor.secondFactorOrErrors

          switch (response.__typename) {
            case "AppSecondFactor":
              resolve(data)
              break
            case "SmsSecondFactor":
              resolve(data)
              break
            case "Errors":
              reject(response.errors)
          }
        }


error => {
          reject(error)
        }


props => props.menuBoundingBox.height


props => props.menuBoundingBox.width


props =>
    props.menuFixed &&
    css`
      position: fixed;
      width: ${props.menuBoundingBox.width}px;
      top: ${props.menuFixedTopOffset};
    `


p =>
    p.active ? 'rgba(53, 50, 50, 0.05)' : 'transparent'


p =>
    p.active ? 'var(--tina-color-primary)' : 'var(--tina-color-grey-8)'


props =>
    props.active &&
    css`
      color: var(--tina-color-primary);
      fill: var(--tina-color-primary);
      background-color: rgba(53, 50, 50, 0.05);
    `


props =>
    props.disabled &&
    css`
      pointer-events: none;
      color: #d1d1d1;
      fill: #d1d1d1;
    `


({ children, open, triggerRef, ...styleProps }) => {
    const MenuPortal = useMenuPortal()
    const menuPortalRef = React.useRef<HTMLDivElement | null>(null)

    const menuOffset = useMemo(() => {
      if (!triggerRef.current || !menuPortalRef.current) return 0
      const menuDropdownBoundingBox = triggerRef.current.getBoundingClientRect()
      const menuPortalBoundingBox = menuPortalRef.current.getBoundingClientRect()
      return menuDropdownBoundingBox.x - menuPortalBoundingBox.x
    }, [triggerRef.current, menuPortalRef.current])

    return (
      <MenuPortal>
        <Offset offset={menuOffset}>
          <div ref={menuPortalRef} {


() => {
      if (!triggerRef.current || !menuPortalRef.current) return 0
      const menuDropdownBoundingBox = triggerRef.current.getBoundingClientRect()
      const menuPortalBoundingBox = menuPortalRef.current.getBoundingClientRect()
      return menuDropdownBoundingBox.x - menuPortalBoundingBox.x
    }


props =>
    props.open &&
    css`
      opacity: 1;
      pointer-events: all;
      transform: translate3d(0, 100%, 0) scale3d(1, 1, 1);
    `


props => props.offset


type MenuPlaceholderProps = {
  menuBoundingBox: any
}


type MenuWrapperProps = {
  menuFixed: boolean
  menuBoundingBox: any
  menuFixedTopOffset: string
}


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    assert.deepEqual(color.rgba(), [0.5, 0.5, 0.5, 0.5], 'RGBA array was not set correctly');
    assert.strictEqual(color.asString(), 'testColor', 'original text was not set correctly');
    assert.strictEqual(color.format(), 'testFormat', 'format was not set correctly');
  }


() => {
    const color = new Color.Color([-0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    assert.deepEqual(color.rgba(), [0, 0.5, 0.5, 0.5], 'RGBA array was not set correctly');
    assert.strictEqual(color.asString(), 'testColor', 'original text was not set correctly');
    assert.strictEqual(color.format(), 'testFormat', 'format was not set correctly');
  }


() => {
    const color = new Color.Color([1.1, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    assert.deepEqual(color.rgba(), [1, 0.5, 0.5, 0.5], 'RGBA array was not set correctly');
    assert.strictEqual(color.asString(), 'testColor', 'original text was not set correctly');
    assert.strictEqual(color.format(), 'testFormat', 'format was not set correctly');
  }


() => {
    const color = Color.Color.fromHSVA([0.5, 0.5, 0.5, 100]);
    assert.deepEqual(color.rgba(), [0.25, 0.49999999999999994, 0.5, 1], 'RGBA array was not set correctly');
    assert.strictEqual(color.asString(), 'hsl(180 33% 38% / 1)', 'original text was not set correctly');
    assert.strictEqual(color.format(), 'hsla', 'format was not set correctly');
  }


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    const hsva = color.hsva();
    assert.deepEqual(hsva, [0, 0, 0.5, 0.5], 'HSVA was not calculated correctly');
  }


() => {
    const lum = Color.Color.luminance([0.5, 0.5, 0.5, 0.5]);
    assert.strictEqual(lum, 0.21404114048223255, 'luminance was not calculated correctly');
  }


() => {
    const lum = Color.Color.luminance([0.03927, 0.03927, 0.03927, 0.5]);
    assert.strictEqual(lum, 0.003039473684210526, 'luminance was not calculated correctly');
  }


() => {
    const result = Color.Color.desiredLuminance(0.2, 2, true);
    assert.strictEqual(result, 0.45, 'luminance was not calculated correctly');
  }


() => {
    const result = Color.Color.desiredLuminance(0.2, 2, false);
    assert.strictEqual(result, 0.075, 'luminance was not calculated correctly');
  }


() => {
    const result = Color.Color.desiredLuminance(0.2, 5, true);
    assert.strictEqual(result, 0, 'luminance was not calculated correctly');
  }


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    const result = color.canonicalHSLA();
    assert.deepEqual(result, [0, 0, 50, 0.5], 'canonical HSLA was not calculated correctly');
  }


() => {
    const firstColor = [1, 0, 0, 1];
    const secondColor = [0, 0, 1, 1];
    const contrastRatio = Color.Color.calculateContrastRatio(firstColor, secondColor);
    assert.strictEqual(contrastRatio, 2.148936170212766, 'contrast ratio was not calculated correctly');
  }


() => {
    const firstColor = [1, 0, 0, 1];
    const secondColor = [0, 0, 1, 1];
    const result: number[] = [];
    Color.Color.blendColors(firstColor, secondColor, result);
    assert.deepEqual(result, [1, 0, 0, 1], 'colors were not blended successfully');
  }


() => {
    assert.deepEqual(Color.Color.parse('#FF00FF')!.rgba(), [1, 0, 1, 1]);
    assert.deepEqual(Color.Color.parse('#F0F')!.rgba(), [1, 0, 1, 1]);
    assert.deepEqual(Color.Color.parse('#F0F0')!.rgba(), [1, 0, 1, 0]);
    assert.deepEqual(Color.Color.parse('#FF00FF00')!.rgba(), [1, 0, 1, 0]);
  }


() => {
    assert.deepEqual(Color.Color.parse('red')!.rgba(), [1, 0, 0, 1]);
  }


() => {
    const colorOne = Color.Color.parse('rgb(255, 255, 0)')!;
    assert.deepEqual(colorOne.rgba(), [1, 1, 0, 1]);

    const colorTwo = Color.Color.parse('rgba(0, 255, 255, 0.5)')!;
    assert.deepEqual(colorTwo.rgba(), [0, 1, 1, 0.5]);

    const colorThree = Color.Color.parse('rgb(255 255 255)')!;
    assert.deepEqual(colorThree.rgba(), [1, 1, 1, 1]);

    const colorFour = Color.Color.parse('rgb(10% 10% 10%)')!;
    assert.deepEqual(colorFour.rgba(), [0.1, 0.1, 0.1, 1]);

    const colorFive = Color.Color.parse('rgb(10% 10% 10% / 0.4)')!;
    assert.deepEqual(colorFive.rgba(), [0.1, 0.1, 0.1, 0.4]);
  }


() => {
    const colorOne = Color.Color.parse('hsl(0, 100%, 50%)')!;
    assert.deepEqual(colorOne.rgba(), [1, 0, 0, 1]);

    const colorTwo = Color.Color.parse('hsla(0, 100%, 50%, 0.5)')!;
    assert.deepEqual(colorTwo.rgba(), [1, 0, 0, 0.5]);

    const colorThree = Color.Color.parse('hsla(50deg 100% 100% / 50%)')!;
    assert.deepEqual(colorThree.rgba(), [1, 1, 1, 0.5]);

    const colorFour = Color.Color.parse('hsl(0 100% 50% / 0.5)')!;
    assert.deepEqual(colorFour.rgba(), [1, 0, 0, 0.5]);
  }


() => {
    assert.isNull(Color.Color.parse('#FAFAFA       Trailing'));
    assert.isNull(Color.Color.parse('#FAFAFG'));
    assert.isNull(Color.Color.parse('gooseberry'));
    assert.isNull(Color.Color.parse('rgb(10% 10% 10% /)'));
    assert.isNull(Color.Color.parse('rgb(10% 10% 10% 0.4 40)'));
    assert.isNull(Color.Color.parse('hsl(0, carrot, 30%)'));
    assert.isNull(Color.Color.parse('hsl(0)'));
    assert.isNull(Color.Color.parse('rgb(255)'));
    assert.isNull(Color.Color.parse('rgba(1 golf 30)'));
  }


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    assert.isTrue(color.hasAlpha(), 'the color should be considered to have an alpha value');
  }


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    const result = color.detectHEXFormat();
    assert.strictEqual(result, 'hexa', 'format was not detected correctly');
  }


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 1], 'testFormat', 'testColor');
    const result = color.detectHEXFormat();
    assert.strictEqual(result, 'hex', 'format was not detected correctly');
  }


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    const result = color.canonicalRGBA();
    assert.deepEqual(result, [128, 128, 128, 0.5], 'canonical RGBA was not returned correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'testFormat', 'testColor');
    const result = color.nickname();
    assert.strictEqual(result, 'red', 'nickname was not returned correctly');
  }


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    const result = color.nickname();
    assert.isNull(result, 'nickname should be returned as Null');
  }


() => {
    const color = new Color.Color([0.5, 0.5, 0.5, 0.5], 'testFormat', 'testColor');
    const result = color.toProtocolRGBA();
    assert.deepEqual(result, {r: 128, g: 128, b: 128, a: 0.5}, 'conversion to protocol RGBA was not correct');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'testFormat', 'testColor');
    const result = color.invert().rgba();
    assert.deepEqual(result, [0, 1, 1, 1], 'inversion was not successful');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'testFormat', 'testColor');
    const result = color.setAlpha(0.5).rgba();
    assert.deepEqual(result, [1, 0, 0, 0.5], 'alpha value was not set correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 0.5], 'testFormat', 'testColor');
    const otherColor = new Color.Color([0, 0, 1, 0.5], 'testFormat', 'testColor');
    const result = color.blendWith(otherColor).rgba();
    assert.deepEqual(result, [0.5, 0, 0.5, 0.75], 'color was not blended correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'original', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, 'testColor', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'nickname', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, 'red', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'hex', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, '#ff0000', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'shorthex', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, '#f00', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'hexa', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, '#ff0000ff', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'shorthexa', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, '#f00f', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'rgb', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, 'rgb(255 0 0)', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'rgba', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, 'rgb(255 0 0 / 1)', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'hsl', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, 'hsl(0 100% 50%)', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'hsla', 'testColor');
    const result = color.asString();
    assert.strictEqual(result, 'hsl(0 100% 50% / 1)', 'color was not converted to a string correctly');
  }


() => {
    const color = new Color.Color([1, 0, 0, 1], 'rgb', 'testColor');
    const result = color.asString('nickname');
    assert.strictEqual(result, 'red', 'color was not converted to a string correctly');
  }


() => {
  it('able to return the color for an ID if the ID was already set', () => {
    const generator = new Color.Generator();
    generator.setColorForID('r', 'Red');
    assert.strictEqual(generator.colorForID('r'), 'Red', 'color was not retrieved correctly');
  });

  it('able to return the color for an ID that was not set', () => {
    const generator = new Color.Generator();
    assert.strictEqual(generator.colorForID('r'), 'hsl(133 67% 80% / 1)', 'color was not generated correctly');
  });
}


() => {
    const generator = new Color.Generator();
    generator.setColorForID('r', 'Red');
    assert.strictEqual(generator.colorForID('r'), 'Red', 'color was not retrieved correctly');
  }


() => {
    const generator = new Color.Generator();
    assert.strictEqual(generator.colorForID('r'), 'hsl(133 67% 80% / 1)', 'color was not generated correctly');
  }


@Component({
  selector: 'app-menu-panel',
  templateUrl: './menu-panel.component.html',
  styleUrls: ['./menu-panel.component.scss']
})
export class MenuPanelComponent implements OnInit {

  constructor() { }

  ngOnInit(): void {
  }
  public dados = [{ label: 'PO HTML Framework', link: '/MenuPanel', icon: 'po-icon-home' }];
}


<K extends keyof WindowEventMap, T>(
	event: K,
	listener: (this: Window, ev: WindowEventMap[K]) => T
): void => useEffect(
	(): () => void => {
		window.addEventListener(event, listener);

		return (): void => {
			window.removeEventListener(event, listener);
		};
	},
	[]
)


(): () => void => {
		window.addEventListener(event, listener);

		return (): void => {
			window.removeEventListener(event, listener);
		};
	}


(): void => {
			window.removeEventListener(event, listener);
		}


export type DirectoryOptions = {
  isDirectoryExplorer: true;
  defaultPath?: string;
  title?: string;
};


export type FileOptions = {
  isDirectoryExplorer?: false;
  allowMultiple?: boolean;
  acceptedFileExtensions?: string[];
  defaultPath?: string;
  title?: string;
  action?: 'save' | 'open';
};


export type FileExplorerOptions = DirectoryOptions | FileOptions;


export class ButtonizeCustomResource extends CfnResource {
	constructor(
		scope: Construct,
		id: string,
		{ target, widget, apiKey }: ButtonizeCustomResourceProps
	) {
		super(scope, id, {
			type: 'Custom::Buttonize',
			properties: {
				ServiceToken:
					ButtonizeCustomResourceProvider.getOrCreateProvider(scope)
						.serviceToken,
				props: JSON.stringify({
					target,
					widget
				}),
				...(typeof apiKey === 'undefined' ? {} : { apiKey })
			}
		})
	}
}


export interface ButtonizeCustomResourceProps {
	readonly target: LambdaTarget | CustomTarget
	readonly widget: Widget
	readonly apiKey?: string
}


(data:string) => {
      this.connectedClientID = data
    }


@Component({
  selector: 'app-question',
  templateUrl: './question.component.html',
  styleUrls: ['./question.component.css']
})
export class QuestionComponent implements OnInit, OnDestroy {

  constructor(private websocket: WebsocketService, private eventBus: EventbusService) { }

  connectedClientID:string
  subscription: Subscription

  ngOnInit(): void {
    this.connectedClientID = ""
    this.subscription = this.eventBus.getConnectedClientValue().subscribe((data:string) => {
      this.connectedClientID = data
    })
  }

  submitSelection(value: string) :void{
    this.websocket.sendMessage('_sendMessageToRecipent', {recipentClientID:this.connectedClientID, value:`Connected User Selected : ${value}`})
  }

  ngOnDestroy(): void{
    this.subscription.unsubscribe()
  }
}


ngOnInit(): void {
    this.connectedClientID = ""
    this.subscription = this.eventBus.getConnectedClientValue().subscribe((data:string) => {
      this.connectedClientID = data
    })
  }


submitSelection(value: string) :void{
    this.websocket.sendMessage('_sendMessageToRecipent', {recipentClientID:this.connectedClientID, value:`Connected User Selected : ${value}`})
  }


ngOnDestroy(): void{
    this.subscription.unsubscribe()
  }


export class Book extends Publication
{
  private _isbn: string;

  private _titleBook: string;

  private _editorial: string;

  private _county: string;

  private _city: string;

  private _bookPDF: File;

  private _certificateEditorial: File;

  public getIsbn(): string {
    return this._isbn;
  }
  public setIsbn(value: string) {
    this._isbn = value;
  }

  public getTitleBook(): string {
    return this._titleBook;
  }
  public setTitleBook(value: string) {
    this._titleBook = value;
  }
  public getEditorial(): string {
    return this._editorial;
  }
  public setEditorial(value: string) {
    this._editorial = value;
  }
  public getCounty(): string {
    return this._county;
  }
  public setCounty(value: string) {
    this._county = value;
  }
  public getCity(): string {
    return this._city;
  }
  public setCity(value: string) {
    this._city = value;
  }
  public getBookPDF(): File {
    return this._bookPDF;
  }
  public setBookPDF(value: File) {
    this._bookPDF = value;
  }
  public getCertificateEditorial(): File {
    return this._certificateEditorial;
  }
  public setCertificateEditorial(value: File) {
    this._certificateEditorial = value;
  }

}


public getIsbn(): string {
    return this._isbn;
  }


public setIsbn(value: string) {
    this._isbn = value;
  }


public getTitleBook(): string {
    return this._titleBook;
  }


public setTitleBook(value: string) {
    this._titleBook = value;
  }


public getEditorial(): string {
    return this._editorial;
  }


public setEditorial(value: string) {
    this._editorial = value;
  }


public getCounty(): string {
    return this._county;
  }


public setCounty(value: string) {
    this._county = value;
  }


public getCity(): string {
    return this._city;
  }


public setCity(value: string) {
    this._city = value;
  }


public getBookPDF(): File {
    return this._bookPDF;
  }


public setBookPDF(value: File) {
    this._bookPDF = value;
  }


public getCertificateEditorial(): File {
    return this._certificateEditorial;
  }


public setCertificateEditorial(value: File) {
    this._certificateEditorial = value;
  }


type IStore = {
    items: {
        id: string
        images: string[]
        selectedImage: number
    }[]
}


({ Component, pageProps }) => {
    // Can be set to 'devnet', 'testnet', or 'mainnet-beta'
    const network = WalletAdapterNetwork.Devnet;

    // You can also provide a custom RPC endpoint
    const endpoint = useMemo(() => clusterApiUrl(network), [network]);

    // @solana/wallet-adapter-wallets includes all the adapters but supports tree shaking and lazy loading --
    // Only the wallets you configure here will be compiled into your application, and only the dependencies
    // of wallets that your users connect to will be loaded
    const wallets = useMemo(
        () => [
            new PhantomWalletAdapter(),
            new GlowWalletAdapter(),
            new SlopeWalletAdapter(),
            new SolflareWalletAdapter({ network }),
            new TorusWalletAdapter(),
        ],
        [network]
    );

    return (
        <ConnectionProvider endpoint={endpoint}>
            <WalletProvider wallets={wallets} autoConnect>
                <WalletModalProvider>
                    <Component {...pageProps} />
                </WalletModalProvider>
            </WalletProvider>
        </ConnectionProvider>


() => clusterApiUrl(network)


() => [
            new PhantomWalletAdapter(),
            new GlowWalletAdapter(),
            new SlopeWalletAdapter(),
            new SolflareWalletAdapter({ network }),
            new TorusWalletAdapter(),
        ]


(state: State) => state.subApp.financialPositions.financialPositions


(state: State) => state.subApp.financialPositions.financialPositionsError


(state: State) =>
  state.subApp.financialPositions.isFinancialPositionsPending


(state: State) => state.subApp.financialPositions.selectedFinancialPosition


(state: State) =>
  state.subApp.financialPositions.financialPositionUpdateAmount


(state: State) =>
  state.subApp.financialPositions.isFinancialPositionUpdateSubmitPending


(state: State) =>
  state.subApp.financialPositions.isFinancialPositionUpdateCancelEnabled


(state: State) =>
  state.subApp.financialPositions.selectedFinancialPositionUpdateAction


(state: State) =>
  state.subApp.financialPositions.isShowUpdateFinancialPositionConfirmModal


(state: State) =>
  state.subApp.financialPositions.isUpdateFinancialPositionNDCAfterConfirmModal


export default function semiOmitCssLoader(source: string) {
    return source
        .replace(/(import\s+['"][^'"]+\.css['"])/g, '// $1')
        .replace(/(require\(['"][^'"]+\.css['"]\))/g, '// $1');
}


export class UserOutputDTO{
    readonly id: string;

    readonly role: string;

    readonly login: string;

    readonly createdAt: string;

    readonly updatedAt: string;

    constructor(data) {
        this.id = data.id;
        this.role = data.role;
        this.login = data.login;
        this.createdAt = data.createdAt;
        this.updatedAt = data.updatedAt;
    }
}


() => ({
  root: {
    overflow: 'initial',
    maxWidth: 304,
    backgroundColor: 'transparent',
  },
  title: {
    marginBottom: 0,
  },
  rateValue: {
    fontWeight: 'bold',
    marginTop: 2,
  },
  content: {
    position: 'relative',
    padding: 24,
    margin: '-24% 16px 0',
    backgroundColor: '#fff',
    borderRadius: 4,
  },
  favorite: {
    position: 'absolute',
    top: 12,
    right: 12,
  },
  locationIcon: {
    marginRight: 4,
    fontSize: 18,
  },
})


(props: ShowcaseProps) => (
  <Showcase
    {...props}


(timestamps: number[]) =>
  timestamps.map((timestamp) => {
    return `t${timestamp}:blocks(first: 1, orderBy: timestamp, orderDirection: desc, where: { timestamp_gt: ${timestamp}, timestamp_lt: ${
      timestamp + 600
    } }) {
      number
    }`
  })


(timestamp) => {
    return `t${timestamp}:blocks(first: 1, orderBy: timestamp, orderDirection: desc, where: { timestamp_gt: ${timestamp}, timestamp_lt: ${
      timestamp + 600
    } }) {
      number
    }`
  }


(subqueries: string[]) => {
  return gql`query blocks {
    ${subqueries}
  }`
}


async (
  timestamps: number[],
  sortDirection: 'asc' | 'desc' = 'desc',
  skipCount = 500,
): Promise<Block[]> => {
  if (timestamps?.length === 0) {
    return []
  }

  const fetchedData: any = await multiQuery(
    blocksQueryConstructor,
    getBlockSubqueries(timestamps),
    BLOCKS_CLIENT,
    skipCount,
  )

  const blocks: Block[] = []
  if (fetchedData) {
    // eslint-disable-next-line no-restricted-syntax
    for (const key of Object.keys(fetchedData)) {
      if (fetchedData[key].length > 0) {
        blocks.push({
          timestamp: key.split('t')[1],
          number: parseInt(fetchedData[key][0].number, 10),
        })
      }
    }
    // graphql-request does not guarantee same ordering of batched requests subqueries, hence manual sorting
    return orderBy(blocks, (block) => block.number, sortDirection)
  }
  return blocks
}


(block) => block.number


(
  timestamps: number[],
  sortDirection: 'asc' | 'desc' = 'desc',
  skipCount = 1000,
): {
  blocks?: Block[]
  error: boolean
} => {
  const [blocks, setBlocks] = useState<Block[]>()
  const [error, setError] = useState(false)

  const timestampsString = JSON.stringify(timestamps)
  const blocksString = blocks ? JSON.stringify(blocks) : undefined

  useEffect(() => {
    const fetchData = async () => {
      const timestampsArray = JSON.parse(timestampsString)
      const result = await getBlocksFromTimestamps(timestampsArray, sortDirection, skipCount)
      if (result.length === 0) {
        setError(true)
      } else {
        setBlocks(result)
      }
    }
    const blocksArray = blocksString ? JSON.parse(blocksString) : undefined
    if (!blocksArray && !error) {
      fetchData()
    }
  }, [blocksString, error, skipCount, sortDirection, timestampsString])

  return {
    blocks,
    error,
  }
}


() => {
    const fetchData = async () => {
      const timestampsArray = JSON.parse(timestampsString)
      const result = await getBlocksFromTimestamps(timestampsArray, sortDirection, skipCount)
      if (result.length === 0) {
        setError(true)
      } else {
        setBlocks(result)
      }
    }
    const blocksArray = blocksString ? JSON.parse(blocksString) : undefined
    if (!blocksArray && !error) {
      fetchData()
    }
  }


async () => {
      const timestampsArray = JSON.parse(timestampsString)
      const result = await getBlocksFromTimestamps(timestampsArray, sortDirection, skipCount)
      if (result.length === 0) {
        setError(true)
      } else {
        setBlocks(result)
      }
    }


(resolve, reject) => {
            resolve(true);
        }


(resolve, reject) => {
            resolve(new BusinessNetworkDefinition('org-acme-biznet@0.0.1', 'Acme Business Network'));
        }


() => {

        mockClientService = sinon.createStubInstance(ClientService);

        TestBed.configureTestingModule({
            declarations: [
                FileImporterComponent,
                AddFileComponent,
                FileDragDropDirective
            ],
            imports: [
                FormsModule
            ],
            providers: [
                {provide: AdminService, useClass: MockAdminService},
                {provide: AlertService, useClass: MockAlertService},
                {provide: ClientService, useValue: mockClientService},
                NgbActiveModal
            ]
        });

        sandbox = sinon.sandbox.create();

        fixture = TestBed.createComponent(AddFileComponent);
        component = fixture.componentInstance;

        mockScriptManager = sinon.createStubInstance(ScriptManager);
        mockBusinessNetwork = sinon.createStubInstance(BusinessNetworkDefinition);
        mockBusinessNetwork.getModelManager.returns(mockModelManager);
        mockBusinessNetwork.getScriptManager.returns(mockScriptManager);
        mockBusinessNetwork.getAclManager.returns(mockAclManager);

        mockSystemModelFile = sinon.createStubInstance(ModelFile);
        mockSystemModelFile.isLocalType.withArgs('Asset').returns(true);
        mockSystemModelFile.getNamespace.returns('org.hyperledger.composer.system');
        mockModelManager = sinon.createStubInstance(ModelManager);
        mockModelManager.getModelFile.withArgs('org.hyperledger.composer.system').returns(mockSystemModelFile);
        mockSystemAsset = sinon.createStubInstance(AssetDeclaration);
        mockSystemAsset.getFullyQualifiedName.returns('org.hyperledger.composer.system.Asset');
        mockModelManager.getSystemTypes.returns([mockSystemAsset]);

        mockAclFile = sinon.createStubInstance(AclFile);
        mockAclManager = sinon.createStubInstance(AclManager);
        mockAclManager.getAclFile.returns(mockAclFile);

        mockQueryFile = sinon.createStubInstance(QueryFile);
        mockQueryManager = sinon.createStubInstance(QueryManager);
        mockQueryManager.getQueryFile.returns(mockQueryFile);

    }


() => {
        it('should change this.expandInput to true', () => {
            component.fileDetected();
            component.expandInput.should.equal(true);
        });
    }


() => {
            component.fileDetected();
            component.expandInput.should.equal(true);
        }


() => {
        it('should change this.expectedInput to false', () => {
            component.fileLeft();
            component.expandInput.should.equal(false);
        });
    }


() => {
            component.fileLeft();
            component.expandInput.should.equal(false);
        }


() => {
        it('should call this.createModel if model file detected', fakeAsync(() => {
            let b = new Blob(['/**CTO File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.cto');

            let createMock = sandbox.stub(component, 'createModel');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }));

        it('should call this.createScript if script file detected', fakeAsync(() => {

            let b = new Blob(['/**JS File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.js');

            let createMock = sandbox.stub(component, 'createScript');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }));

        it('should call this.createRules if ACL file detected', fakeAsync(() => {

            let b = new Blob(['/**ACL File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.acl');

            let createMock = sandbox.stub(component, 'createRules');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }));

        it('should call this.createReadme if readme file detected', fakeAsync(() => {

            let b = new Blob(['/**README File*/'], {type: 'text/plain'});
            let file = new File([b], 'README.md');

            let createMock = sandbox.stub(component, 'createReadme');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }));

        it('should call this.createQuery if query file detected', fakeAsync(() => {

            let b = new Blob(['/**QUERY File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.qry');

            let createMock = sandbox.stub(component, 'createQuery');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }));

        it('should call this.fileRejected when there is an error reading the file', fakeAsync(() => {

            let b = new Blob(['/**CTO File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.cto');

            let createMock = sandbox.stub(component, 'fileRejected');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.reject('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.called;
        }));

        it('should throw when given incorrect file type', fakeAsync(() => {

            let b = new Blob(['/**PNG File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.png');

            let createMock = sandbox.stub(component, 'fileRejected');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.calledWith('Unexpected File Type: png');
        }));
    }


() => {
            let b = new Blob(['/**CTO File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.cto');

            let createMock = sandbox.stub(component, 'createModel');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }


() => {

            let b = new Blob(['/**JS File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.js');

            let createMock = sandbox.stub(component, 'createScript');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }


() => {

            let b = new Blob(['/**ACL File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.acl');

            let createMock = sandbox.stub(component, 'createRules');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }


() => {

            let b = new Blob(['/**README File*/'], {type: 'text/plain'});
            let file = new File([b], 'README.md');

            let createMock = sandbox.stub(component, 'createReadme');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }


() => {

            let b = new Blob(['/**QUERY File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.qry');

            let createMock = sandbox.stub(component, 'createQuery');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.should.have.been.called;
        }


() => {

            let b = new Blob(['/**CTO File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.cto');

            let createMock = sandbox.stub(component, 'fileRejected');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.reject('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.called;
        }


() => {

            let b = new Blob(['/**PNG File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.png');

            let createMock = sandbox.stub(component, 'fileRejected');
            let dataBufferMock = sandbox.stub(component, 'getDataBuffer')
            .returns(Promise.resolve('some data'));

            // Run method
            component.fileAccepted(file);
            tick();

            // Assertions
            createMock.calledWith('Unexpected File Type: png');
        }


() => {
        it('should return an error status', async(() => {
            component.fileRejected('long reason to reject file');

            component['alertService'].errorStatus$.subscribe(
                (message) => {
                    expect(message).to.be.equal('long reason to reject file');
                }
            );
        }));
    }


() => {
            component.fileRejected('long reason to reject file');

            component['alertService'].errorStatus$.subscribe(
                (message) => {
                    expect(message).to.be.equal('long reason to reject file');
                }
            );
        }


(message) => {
                    expect(message).to.be.equal('long reason to reject file');
                }


() => {
        it('should create a new script file', async(() => {
            let mockScript = sinon.createStubInstance(Script);
            mockScript.getIdentifier.returns('newfile.js');
            mockClientService.createScriptFile.returns(mockScript);

            let b = new Blob(['/**JS File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.js');

            // Run method
            component.createScript(file, file);

            // Assertions
            component.fileType.should.equal('js');
            mockClientService.createScriptFile.calledWith(file.name, 'JS', file.toString());
            component.currentFile.should.deep.equal(mockScript);
            component.currentFileName.should.equal(mockScript.getIdentifier());
        }));

        it('should use the addScriptFileName variable as the file name if none passed in', () => {
            let fileName = 'testFileName.js';
            component.addScriptFileName = fileName;
            let mockScript = sinon.createStubInstance(Script);
            mockScript.getIdentifier.returns(fileName);
            mockClientService.createScriptFile.returns(mockScript);

            let b = new Blob(['/**JS File*/'], {type: 'text/plain'});
            let file = new File([b], '');

            // Run method
            component.createScript(null, file);

            // Assertions
            component.fileType.should.equal('js');
            mockClientService.createScriptFile.calledWith(fileName, 'JS', file.toString());
            component.currentFile.should.deep.equal(mockScript);
            component.currentFileName.should.equal(mockScript.getIdentifier());
            component.currentFileName.should.equal(fileName);
        });
    }


() => {
            let mockScript = sinon.createStubInstance(Script);
            mockScript.getIdentifier.returns('newfile.js');
            mockClientService.createScriptFile.returns(mockScript);

            let b = new Blob(['/**JS File*/'], {type: 'text/plain'});
            let file = new File([b], 'newfile.js');

            // Run method
            component.createScript(file, file);

            // Assertions
            component.fileType.should.equal('js');
            mockClientService.createScriptFile.calledWith(file.name, 'JS', file.toString());
            component.currentFile.should.deep.equal(mockScript);
            component.currentFileName.should.equal(mockScript.getIdentifier());
        }


() => {
            let fileName = 'testFileName.js';
            component.addScriptFileName = fileName;
            let mockScript = sinon.createStubInstance(Script);
            mockScript.getIdentifier.returns(fileName);
            mockClientService.createScriptFile.returns(mockScript);

            let b = new Blob(['/**JS File*/'], {type: 'text/plain'});
            let file = new File([b], '');

            // Run method
            component.createScript(null, file);

            // Assertions
            component.fileType.should.equal('js');
            mockClientService.createScriptFile.calledWith(fileName, 'JS', file.toString());
            component.currentFile.should.deep.equal(mockScript);
            component.currentFileName.should.equal(mockScript.getIdentifier());
            component.currentFileName.should.equal(fileName);
        }


() => {
        it('should create a new model file', async(() => {
            let b = new Blob(
                [`/**CTO File**/ namespace test`],
                {type: 'text/plain'}
            );
            let file = new File([b], 'newfile.cto');
            let dataBuffer = new Buffer('/**CTO File**/ namespace test');
            let mockModel = new ModelFile(mockModelManager, dataBuffer.toString(), 'models/' + file.name);
            mockClientService.createModelFile.returns(mockModel);

            // Run method
            component.createModel(file, dataBuffer);

            // Assertions
            component.fileType.should.equal('cto');
            mockClientService.createModelFile.should.have.been.calledWith(dataBuffer.toString(), 'models/' + file.name);
            component.currentFile.should.deep.equal(mockModel);
            component.currentFileName.should.equal(mockModel.getName());
        }));

        it('should use the addModelFileName variable as the file name if none passed in', async(() => {
            let fileName = 'models/testFileName.cto';
            component.addModelFileName = fileName;
            let b = new Blob(
                [`/**CTO File**/ namespace test`],
                {type: 'text/plain'}
            );
            let file = new File([b], '');
            let dataBuffer = new Buffer('/**CTO File**/ namespace test');
            let mockModel = new ModelFile(mockModelManager, dataBuffer.toString(), fileName);
            mockClientService.createModelFile.returns(mockModel);

            // Run method
            component.createModel(null, dataBuffer);

            // Assertions
            component.fileType.should.equal('cto');
            mockClientService.createModelFile.should.have.been.calledWith(dataBuffer.toString(), fileName);
            component.currentFile.should.deep.equal(mockModel);
            component.currentFileName.should.equal(mockModel.getName());
            component.currentFileName.should.equal(fileName);
        }));
    }


() => {
            let b = new Blob(
                [`/**CTO File**/ namespace test`],
                {type: 'text/plain'}
            );
            let file = new File([b], 'newfile.cto');
            let dataBuffer = new Buffer('/**CTO File**/ namespace test');
            let mockModel = new ModelFile(mockModelManager, dataBuffer.toString(), 'models/' + file.name);
            mockClientService.createModelFile.returns(mockModel);

            // Run method
            component.createModel(file, dataBuffer);

            // Assertions
            component.fileType.should.equal('cto');
            mockClientService.createModelFile.should.have.been.calledWith(dataBuffer.toString(), 'models/' + file.name);
            component.currentFile.should.deep.equal(mockModel);
            component.currentFileName.should.equal(mockModel.getName());
        }


() => {
            let fileName = 'models/testFileName.cto';
            component.addModelFileName = fileName;
            let b = new Blob(
                [`/**CTO File**/ namespace test`],
                {type: 'text/plain'}
            );
            let file = new File([b], '');
            let dataBuffer = new Buffer('/**CTO File**/ namespace test');
            let mockModel = new ModelFile(mockModelManager, dataBuffer.toString(), fileName);
            mockClientService.createModelFile.returns(mockModel);

            // Run method
            component.createModel(null, dataBuffer);

            // Assertions
            component.fileType.should.equal('cto');
            mockClientService.createModelFile.should.have.been.calledWith(dataBuffer.toString(), fileName);
            component.currentFile.should.deep.equal(mockModel);
            component.currentFileName.should.equal(mockModel.getName());
            component.currentFileName.should.equal(fileName);
        }


() => {
        it('should create a new ACL file named permissions.acl', async(() => {
            let dataBuffer = new Buffer('/**RULE File**/ all the rules');
            let filename = 'permissions.acl';
            let mockRuleFile = sinon.createStubInstance(AclFile);
            mockClientService.createAclFile.returns(mockRuleFile);

            // Run method
            component.createRules(dataBuffer);

            // Assertions
            component.fileType.should.equal('acl');
            mockClientService.createAclFile.should.have.been.calledWith(filename, dataBuffer.toString());
            component.currentFile.should.deep.equal(mockRuleFile);
            component.currentFileName.should.equal(filename);
        }));
    }


() => {
            let dataBuffer = new Buffer('/**RULE File**/ all the rules');
            let filename = 'permissions.acl';
            let mockRuleFile = sinon.createStubInstance(AclFile);
            mockClientService.createAclFile.returns(mockRuleFile);

            // Run method
            component.createRules(dataBuffer);

            // Assertions
            component.fileType.should.equal('acl');
            mockClientService.createAclFile.should.have.been.calledWith(filename, dataBuffer.toString());
            component.currentFile.should.deep.equal(mockRuleFile);
            component.currentFileName.should.equal(filename);
        }


() => {
        it('should create a new query file named queries.qry', async(() => {
            let dataBuffer = new Buffer('/**QUERY File**/ query things');
            let filename = 'queries.qry';
            mockClientService.createQueryFile.returns(mockQueryFile);

            // Run method
            component.createQuery(dataBuffer);

            // Assertions
            component.fileType.should.equal('qry');
            mockClientService.createQueryFile.should.have.been.calledWith(filename, dataBuffer.toString());
            component.currentFile.should.deep.equal(mockQueryFile);
            component.currentFileName.should.equal(filename);
        }));
    }