import * as i0 from '@angular/core';
import { EventEmitter, Directive, HostBinding, Output, NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

class BsUserAgentDirective {
    constructor() {
        this.detected = new EventEmitter();
    }
    get isAndroid() {
        return !!navigator.userAgent.match(/Android/i);
    }
    get isIos() {
        return !!navigator.userAgent.match(/iPhone|iPad|iPod/i);
    }
    get isWindows() {
        return !!navigator.userAgent.match(/Windows/i);
    }
    ngAfterViewInit() {
        setTimeout(() => {
            if (this.isAndroid) {
                this.detected.emit('Android');
            }
            else if (this.isIos) {
                this.detected.emit('iOS');
            }
            else if (this.isWindows) {
                this.detected.emit('Windows');
            }
            else {
                this.detected.emit(undefined);
            }
        });
    }
}
BsUserAgentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsUserAgentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
BsUserAgentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: BsUserAgentDirective, selector: "[bsUserAgent]", outputs: { detected: "detected" }, host: { properties: { "class.os-android": "this.isAndroid", "class.os-ios": "this.isIos", "class.os-windows": "this.isWindows" } }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsUserAgentDirective, decorators: [{
            type: Directive,
            args: [{
                    selector: '[bsUserAgent]'
                }]
        }], propDecorators: { isAndroid: [{
                type: HostBinding,
                args: ['class.os-android']
            }], isIos: [{
                type: HostBinding,
                args: ['class.os-ios']
            }], isWindows: [{
                type: HostBinding,
                args: ['class.os-windows']
            }], detected: [{
                type: Output
            }] } });

class BsUserAgentModule {
}
BsUserAgentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsUserAgentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
BsUserAgentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.4", ngImport: i0, type: BsUserAgentModule, declarations: [BsUserAgentDirective], imports: [CommonModule], exports: [BsUserAgentDirective] });
BsUserAgentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsUserAgentModule, imports: [CommonModule] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: BsUserAgentModule, decorators: [{
            type: NgModule,
            args: [{
                    declarations: [
                        BsUserAgentDirective
                    ],
                    imports: [
                        CommonModule
                    ],
                    exports: [
                        BsUserAgentDirective
                    ]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { BsUserAgentDirective, BsUserAgentModule };
//# sourceMappingURL=mintplayer-ng-bootstrap-user-agent.mjs.map
