/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable prefer-template */ /** @internal */ export const createMappedError: CreateError = __DEV__ ? (code: ErrorNames, ...details: unknown[]) => { const paddedCode = String(code).padStart(4, '0'); const message = getMessageByCode(code, ...details); const link = `https://docs.aurelia.io/developer-guides/error-messages/0088-to-0723/aur${paddedCode}`; return new Error(`AUR${paddedCode}: ${message}\n\nFor more information, see: ${link}`); } : (code: ErrorNames, ...details: unknown[]) => { const paddedCode = String(code).padStart(4, '0'); return new Error(`AUR${paddedCode}:${details.map(String)}`); }; _START_CONST_ENUM(); /** @internal */ export const enum ErrorNames { attribute_pattern_already_initialized = 88, attribute_pattern_duplicate = 89, method_not_implemented = 99, binding_command_existed = 157, compiler_root_is_local = 701, compiler_invalid_surrogate_attr = 702, compiler_no_tc_on_surrogate = 703, compiler_invalid_let_command = 704, compiler_au_slot_on_non_element = 706, compiler_binding_to_non_bindable = 707, compiler_template_only_local_template = 708, compiler_local_el_not_under_root = 709, compiler_local_el_bindable_not_under_root = 710, compiler_local_el_bindable_name_missing = 711, compiler_local_el_bindable_duplicate = 712, compiler_unknown_binding_command = 713, compiler_local_name_empty = 715, compiler_duplicate_local_name = 716, compiler_slot_without_shadowdom = 717, compiler_no_spread_tc = 718, compiler_attr_mapper_duplicate_mapping = 719, compiler_no_reserved_spread_syntax = 720, compiler_no_reserved_$bindable = 721, compiler_no_dom_api = 722, compiler_invalid_class_binding_syntax = 723, no_spread_template_controller = 9998, } _END_CONST_ENUM(); const errorsMap: Record = { [ErrorNames.attribute_pattern_already_initialized]: 'AttributeParser is already initialized; cannot add patterns after initialization.', [ErrorNames.attribute_pattern_duplicate]: 'Attribute pattern "{{0}}" has already been registered.', [ErrorNames.method_not_implemented]: 'Method {{0}} not implemented', [ErrorNames.binding_command_existed]: `Binding command {{0}} has already been registered.`, [ErrorNames.compiler_root_is_local]: `Template compilation error in element "{{0:name}}": the root