import { Injectable } from '@angular/core'; import * as i0 from "@angular/core"; export class FaIconLibrary { constructor() { this.definitions = {}; } addIcons(...icons) { for (const icon of icons) { if (!(icon.prefix in this.definitions)) { this.definitions[icon.prefix] = {}; } this.definitions[icon.prefix][icon.iconName] = icon; for (const alias of icon.icon[2]) { if (typeof alias === 'string') { this.definitions[icon.prefix][alias] = icon; } } } } addIconPacks(...packs) { for (const pack of packs) { const icons = Object.keys(pack).map((key) => pack[key]); this.addIcons(...icons); } } getIconDefinition(prefix, name) { if (prefix in this.definitions && name in this.definitions[prefix]) { return this.definitions[prefix][name]; } return null; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: FaIconLibrary, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); } static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: FaIconLibrary, providedIn: 'root' }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.0", ngImport: i0, type: FaIconLibrary, decorators: [{ type: Injectable, args: [{ providedIn: 'root' }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWNvbi1saWJyYXJ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2xpYi9pY29uLWxpYnJhcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFVM0MsTUFBTSxPQUFPLGFBQWE7SUFEMUI7UUFFVSxnQkFBVyxHQUE2RCxFQUFFLENBQUM7S0E2QnBGO0lBM0JDLFFBQVEsQ0FBQyxHQUFHLEtBQXVCO1FBQ2pDLEtBQUssTUFBTSxJQUFJLElBQUksS0FBSyxFQUFFO1lBQ3hCLElBQUksQ0FBQyxDQUFDLElBQUksQ0FBQyxN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