import { Component, Input } from '@angular/core';
import { AxoUtils } from '../../../../axo-utils/axo-utils';
import { AxAudio } from '../../../../forms/page/widgets/ax-audio';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/icon";
function AudioWidgetViewComponent_ng_container_1_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 9);
    i0.ɵɵtext(3, ":");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r3.widget.prompt);
} }
function AudioWidgetViewComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 3);
    i0.ɵɵelement(2, "mat-icon", 4);
    i0.ɵɵtemplate(3, AudioWidgetViewComponent_ng_container_1_span_3_Template, 4, 1, "span", 5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(4, "div", 6);
    i0.ɵɵelementStart(5, "audio", 7);
    i0.ɵɵelement(6, "source", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", ctx_r0.section.showPrompt);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("src", ctx_r0.baseUrl + "/images/media/app_data/" + ctx_r0.widgetValue, i0.ɵɵsanitizeUrl);
} }
function AudioWidgetViewComponent_ng_template_2_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementStart(2, "span", 9);
    i0.ɵɵtext(3, ":");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r4.widget.prompt);
} }
function AudioWidgetViewComponent_ng_template_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵelement(1, "mat-icon", 4);
    i0.ɵɵtemplate(2, AudioWidgetViewComponent_ng_template_2_span_2_Template, 4, 1, "span", 5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "span", 10);
    i0.ɵɵtext(4, "-");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r2.section.showPrompt);
} }
export class AudioWidgetViewComponent {
    constructor() {
        this.widgetValue = '';
    }
    ngOnInit() {
        if (this.widget.value) {
            this.widgetValue = AxoUtils.removeSlashFromImageUrl(this.widget.value);
        }
    }
}
AudioWidgetViewComponent.ɵfac = function AudioWidgetViewComponent_Factory(t) { return new (t || AudioWidgetViewComponent)(); };
AudioWidgetViewComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AudioWidgetViewComponent, selectors: [["lib-audio-widget-view"]], inputs: { widget: "widget", baseUrl: "baseUrl" }, decls: 4, vars: 2, consts: [[1, "data-detail-info", "items-center", "audio-data-detail"], [4, "ngIf", "ngIfElse"], ["isWidgetValueEmpty", ""], [1, "data-detail-title", "flex", "text-sm"], ["svgIcon", "axo_audio", 1, "add-text"], [4, "ngIf"], [1, "audio-container", "text-center"], ["controls", "", "controlsList", "nodownload noplaybackrate"], ["type", "audio/ogg", 3, "src"], [1, "colon"], [1, "flex", "justify-start"]], template: function AudioWidgetViewComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div", 0);
        i0.ɵɵtemplate(1, AudioWidgetViewComponent_ng_container_1_Template, 7, 2, "ng-container", 1);
        i0.ɵɵtemplate(2, AudioWidgetViewComponent_ng_template_2_Template, 5, 1, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        const _r1 = i0.ɵɵreference(3);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.widget.value)("ngIfElse", _r1);
    } }, directives: [i1.NgIf, i2.MatIcon], styles: [""] });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AudioWidgetViewComponent, [{
        type: Component,
        args: [{ selector: 'lib-audio-widget-view', template: "\n<!-- <div class=\"audio-data-detail\" *ngIf=\"widget.value\">\n  <div class=\"data-detail-title flex text-sm\" >\n    <span  *ngIf=\"section.showPrompt\">{{widget.prompt}}<span class=\"colon\">:</span></span>\n  </div>  \n  <div class=\"audio-container text-center\"> \n    <audio controls controlsList=\"nodownload noplaybackrate\">\n      <source [src]=\"baseUrl + widgetValue\" type=\"audio/ogg\">\n  </audio>       \n  </div>\n</div>\n<ng-container *ngIf=\"!widget.value\" >\n  <span class=\"flex justify-start\">-</span>\n</ng-container> -->\n\n<div class=\"data-detail-info items-center audio-data-detail\">\n  <ng-container *ngIf=\"widget.value else isWidgetValueEmpty\" >\n    <div class=\"data-detail-title flex text-sm\" >\n      <mat-icon class=\"add-text\" svgIcon=\"axo_audio\"></mat-icon> \n      <span  *ngIf=\"section.showPrompt\">{{widget.prompt}}<span class=\"colon\">:</span></span>\n    </div>  \n    <div class=\"audio-container text-center\"> \n      <audio controls controlsList=\"nodownload noplaybackrate\">\n        <source [src]=\"baseUrl + '/images/media/app_data/' + widgetValue\" type=\"audio/ogg\">\n    </audio>       \n    </div>\n  </ng-container>\n  <ng-template #isWidgetValueEmpty>\n      <div class=\"data-detail-title flex text-sm\">\n          <mat-icon class=\"add-text\" svgIcon=\"axo_audio\"></mat-icon> \n          <span *ngIf=\"section.showPrompt\">{{widget.prompt}}<span class=\"colon\">:</span></span>\n      </div>\n      <span class=\"flex justify-start\">-</span>\n\n  </ng-template>\n</div>\n\n", styles: [""] }]
    }], function () { return []; }, { widget: [{
            type: Input
        }], baseUrl: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 