import { Component, Input, Output, EventEmitter } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@ionic/angular";
import * as i2 from "@angular/common";
import * as i3 from "../../tap-scanner-common/ble-rssi-signal/ble-rssi-signal.component";
import * as i4 from "../../tap-scanner-common/rssi-to-signal-strenght.pipe";
function TapScanResultsComponent_ion_item_1_br_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "br");
} }
function TapScanResultsComponent_ion_item_1_span_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 6);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const device_r1 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(device_r1.address);
} }
function TapScanResultsComponent_ion_item_1_tap_ble_rssi_signal_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "tap-ble-rssi-signal", 7);
    i0.ɵɵpipe(1, "rssiToSignalStrenght");
} if (rf & 2) {
    const device_r1 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("bars", i0.ɵɵpipeBind1(1, 1, device_r1.rssi));
} }
function TapScanResultsComponent_ion_item_1_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "ion-item", 2);
    i0.ɵɵlistener("click", function TapScanResultsComponent_ion_item_1_Template_ion_item_click_0_listener() { i0.ɵɵrestoreView(_r8); const device_r1 = ctx.$implicit; const ctx_r7 = i0.ɵɵnextContext(); return ctx_r7._onItemClicked(device_r1); });
    i0.ɵɵelementStart(1, "ion-label");
    i0.ɵɵtext(2);
    i0.ɵɵtemplate(3, TapScanResultsComponent_ion_item_1_br_3_Template, 1, 0, "br", 3);
    i0.ɵɵtemplate(4, TapScanResultsComponent_ion_item_1_span_4_Template, 2, 1, "span", 4);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(5, TapScanResultsComponent_ion_item_1_tap_ble_rssi_signal_5_Template, 2, 3, "tap-ble-rssi-signal", 5);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const device_r1 = ctx.$implicit;
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", device_r1.name, " ");
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.showMacAddress);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.showMacAddress);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.showSignalStrenght);
} }
export class TapScanResultsComponent {
    constructor() {
        this.onItemClicked = new EventEmitter();
        this.lines = 'full';
        this.showMacAddress = false;
        this.showSignalStrenght = true;
        this.devices = [];
    }
    _onItemClicked(device) {
        this.onItemClicked.emit(device);
    }
    /**
     * @ignore
     */
    trackByFn(index, item) {
        return `${item.address}-${item.rssi}`;
    }
}
/** @nocollapse */ TapScanResultsComponent.ɵfac = function TapScanResultsComponent_Factory(t) { return new (t || TapScanResultsComponent)(); };
/** @nocollapse */ TapScanResultsComponent.ɵcmp = i0.ɵɵdefineComponent({ type: TapScanResultsComponent, selectors: [["tap-ble-scan-result"]], inputs: { lines: "lines", showMacAddress: "showMacAddress", showSignalStrenght: "showSignalStrenght", devices: "devices" }, outputs: { onItemClicked: "onItemClicked" }, decls: 2, vars: 3, consts: [[3, "lines"], ["button", "", "class", "hover", 3, "click", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["button", "", 1, "hover", 3, "click"], [4, "ngIf"], ["class", "mac-address", 4, "ngIf"], ["slot", "end", 3, "bars", 4, "ngIf"], [1, "mac-address"], ["slot", "end", 3, "bars"]], template: function TapScanResultsComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "ion-list", 0);
        i0.ɵɵtemplate(1, TapScanResultsComponent_ion_item_1_Template, 6, 4, "ion-item", 1);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵproperty("lines", ctx.lines);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngForOf", ctx.devices)("ngForTrackBy", ctx.trackByFn);
    } }, directives: [i1.IonList, i2.NgForOf, i1.IonItem, i1.IonLabel, i2.NgIf, i3.BleRssiSignalComponent], pipes: [i4.RssiToSignalStrenghtPipe], styles: [""] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TapScanResultsComponent, [{
        type: Component,
        args: [{
                selector: 'tap-ble-scan-result',
                templateUrl: './tap-scan-results.component.html',
                styleUrls: ['./tap-scan-results.component.scss'],
            }]
    }], function () { return []; }, { onItemClicked: [{
            type: Output
        }], lines: [{
            type: Input
        }], showMacAddress: [{
            type: Input
        }], showSignalStrenght: [{
            type: Input
        }], devices: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFwLXNjYW4tcmVzdWx0cy5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9pb3RpemUtaW9uaWMvc3JjL2xpYi90YXAtc2Nhbm5lci90YXAtc2Nhbm5lci1ibGUvdGFwLXNjYW4tcmVzdWx0cy90YXAtc2Nhbi1yZXN1bHRzLmNvbXBvbmVudC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2lvdGl6ZS1pb25pYy9zcmMvbGliL3RhcC1zY2FubmVyL3RhcC1zY2FubmVyLWJsZS90YXAtc2Nhbi1yZXN1bHRzL3RhcC1zY2FuLXJlc3VsdHMuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxNQUFNLGVBQWUsQ0FBQzs7Ozs7OztJQ1NqRSxxQkFBNkI7O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