import { NgStyle } from '@angular/common';
import { Component, Input, Self } from '@angular/core';
import { SmzDocumentFeatureDefinitions } from '../../models/smz-document-features';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../../components/content/content.component";
import * as i3 from "../document-viewer/document-viewer.component";
import * as i4 from "../../components/page-break/page-break.component";
export class SmzDocumentComponent {
    constructor(ngStyle, cdr) {
        this.ngStyle = ngStyle;
        this.cdr = cdr;
        this.featureDefinitions = SmzDocumentFeatureDefinitions;
    }
    ngOnInit() {
        // console.log(this.state);
        this.updateHostClasses({ 'font-size': this.state.globals.font.scale });
    }
    updateHostClasses(data) {
        // Propaga a nova classe de estilos para o elemento html do component
        this.ngStyle.ngStyle = data;
        this.ngStyle.ngDoCheck();
    }
    onFileSent(file) {
        console.log('onFileSent', file);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SmzDocumentComponent, deps: [{ token: i1.NgStyle, self: true }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.5", type: SmzDocumentComponent, selector: "smz-ui-document", inputs: { state: "state" }, providers: [NgStyle], ngImport: i0, template: "<document-viewer #document [state]=\"state\">\r\n\r\n  <!-- HEADER -->\r\n  <header>\r\n    <smz-document-content [data]=\"state.header\" [config]=\"state.config\" [isDebug]=\"state.isDebug\" [state]=\"state\"></smz-document-content>\r\n  </header>\r\n\r\n  <!-- PRINTABLE HEADER -->\r\n  <section>\r\n    <smz-document-content [data]=\"state.header\" [config]=\"state.config\" [isDebug]=\"state.isDebug\" [state]=\"state\"></smz-document-content>\r\n  </section>\r\n\r\n  <!-- BODY -->\r\n  <content>\r\n    <ng-container *ngFor=\"let content of state.contents\">\r\n\r\n      <ng-container [ngSwitch]=\"content.type\">\r\n        <smz-document-content *ngSwitchCase=\"'content'\" [data]=\"content\" [config]=\"state.config\" [isDebug]=\"state.isDebug\" [state]=\"state\"></smz-document-content>\r\n        <smz-document-page-break *ngSwitchCase=\"'page-break'\"></smz-document-page-break>\r\n      </ng-container>\r\n\r\n    </ng-container>\r\n  </content>\r\n\r\n</document-viewer>", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i2.SmzDocumentContentComponent, selector: "smz-document-content", inputs: ["data", "config", "state", "isDebug"] }, { kind: "component", type: i3.SmzDocumentViewerComponent, selector: "document-viewer", inputs: ["state"] }, { kind: "component", type: i4.SmzDocumentPageBreakComponent, selector: "smz-document-page-break" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.5", ngImport: i0, type: SmzDocumentComponent, decorators: [{
            type: Component,
            args: [{ selector: 'smz-ui-document', providers: [NgStyle], template: "<document-viewer #document [state]=\"state\">\r\n\r\n  <!-- HEADER -->\r\n  <header>\r\n    <smz-document-content [data]=\"state.header\" [config]=\"state.config\" [isDebug]=\"state.isDebug\" [state]=\"state\"></smz-document-content>\r\n  </header>\r\n\r\n  <!-- PRINTABLE HEADER -->\r\n  <section>\r\n    <smz-document-content [data]=\"state.header\" [config]=\"state.config\" [isDebug]=\"state.isDebug\" [state]=\"state\"></smz-document-content>\r\n  </section>\r\n\r\n  <!-- BODY -->\r\n  <content>\r\n    <ng-container *ngFor=\"let content of state.contents\">\r\n\r\n      <ng-container [ngSwitch]=\"content.type\">\r\n        <smz-document-content *ngSwitchCase=\"'content'\" [data]=\"content\" [config]=\"state.config\" [isDebug]=\"state.isDebug\" [state]=\"state\"></smz-document-content>\r\n        <smz-document-page-break *ngSwitchCase=\"'page-break'\"></smz-document-page-break>\r\n      </ng-container>\r\n\r\n    </ng-container>\r\n  </content>\r\n\r\n</document-viewer>" }]
        }], ctorParameters: () => [{ type: i1.NgStyle, decorators: [{
                    type: Self
                }] }, { type: i0.ChangeDetectorRef }], propDecorators: { state: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 