import { Component, Input, HostListener } from '@angular/core';
import { SimpoElementsModule } from '../../elements';
import { CommonModule } from '@angular/common';
import { SimpoComponentModule } from '../../components';
import { MatGridListModule } from '@angular/material/grid-list';
import { SimpoButtonComponent } from '../../elements/simpo-button/simpo-button.component';
import { AnimationDirective } from '../../directive/animation-directive';
import { BackgroundDirective } from '../../directive/background-directive';
import { ContentFitDirective } from '../../directive/content-fit-directive';
import { BorderDirective } from '../../directive/border-directive';
import { HoverDirective } from '../../directive/hover-element-directive';
import { OverlayDirective } from '../../directive/overlay-directive';
import { PositionLayoutDirectiveDirective } from '../../directive/position-layout-directive.directive';
import BaseSection from '../BaseSection';
import { TextEditorComponent } from '../../elements/text-editor/text-editor.component';
import { SpacingHorizontalDirective } from '../../directive/spacing-horizontal.directive';
import * as i0 from "@angular/core";
import * as i1 from "./../../services/events.service";
import * as i2 from "../../elements/simpo-button/simpo-button.component";
import * as i3 from "../../elements/svg-divider/svg-divider.component";
import * as i4 from "@angular/common";
import * as i5 from "../../components/hover-elements/hover-elements.component";
import * as i6 from "../../components/delete-hover-element/delete-hover-element.component";
export class HeaderTextComponent extends BaseSection {
    constructor(_eventService) {
        super();
        this._eventService = _eventService;
        this.screenWidth = 475;
    }
    ngOnInit() {
        this.deleteSelected = this.delete;
        this.content = this.data?.content;
        this.styles = this.data?.styles;
        const id = this.data?.id;
        const action = this.data?.action;
        if (!this.styles || !this.content)
            return;
        // this.styles.layout.bannerImageDisplay = this.content.image.showImage;
    }
    get stylesLayout() {
        return { ...this.styles?.layout };
    }
    getScreenSize(event) {
        this.screenWidth = window.innerWidth;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HeaderTextComponent, deps: [{ token: i1.EventsService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: HeaderTextComponent, isStandalone: true, selector: "simpo-header-text", inputs: { data: "data", index: "index", edit: "edit", delete: "delete", customClass: "customClass", nextComponentColor: "nextComponentColor" }, host: { listeners: { "window:resize": "getScreenSize($event)" } }, usesInheritance: true, ngImport: i0, template: "<div [id]=\"data?.id\" simpoHover (hovering)=\"showEditTabs($event)\" class=\"total-container\" [attr.style]=\"customClass\"\r\n  [simpoBackground]=\"styles?.background\">\r\n  <div class=\"col-xxl-8  w-100 d-flex\" [id]=\"data?.id\" #mainContainer [simpoOverlay]=\"styles?.background\"\r\n    [simpoBorder]=\"styles?.border\" [spacingHorizontal]=\"stylesLayout\" [simpoLayout]=\"styles?.layout\" [ngClass]=\"{\r\n      'justify-content-center': styles?.layout?.align === 'center',\r\n      'justify-content-start': styles?.layout?.align === 'left',\r\n      'justify-content-end': styles?.layout?.align === 'right'\r\n    }\">\r\n    <div class=\"flex-column row g-2\" [id]=\"data?.id\" [simpoAnimation]=\"styles?.animation\"\r\n      [simpoPositionLayoutDirective]=\"styles?.positionLayout\"\r\n      [ngClass]=\"{ 'align-items-center': styles?.positionLayout?.value === 'left' || styles?.positionLayout?.value === 'right' }\"\r\n      [ngStyle]=\"(styles?.devider?.display && screenWidth <= 475) ? {'margin-bottom': '45px'} : {}\">\r\n      <div class=\"col px-5 content-side\" [id]=\"data?.id\">\r\n        <div *ngFor=\"let item of content?.inputText; let i = index\">\r\n          <!-- <div *ngIf=\"item.label === 'Tagline' || item.label === 'Heading'\" [innerHTML]=\"item.value | sanitizeHtml\"\r\n                        [ngClass]=\"item.label === 'Heading' ? 'heading-large lh-2 mb-3' : 'body-large'\"></div> -->\r\n          <div [ngClass]=\"item.label.includes('Heading') ? 'heading-large lh-2 mb-4' : 'body-large'\">\r\n            <simpo-text-editor [(value)]=\"item.value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"i\" [isRTE]=\"item.isRTE\"></simpo-text-editor>\r\n          </div>\r\n        </div>\r\n      </div>\r\n      <div class=\"col px-5\" [id]=\"data?.id\">\r\n        <!-- <div *ngFor=\"let item of content?.inputText\">\r\n                    <div *ngIf=\"item.label === 'Subtext'\" [innerHTML]=\"item.value | sanitizeHtml\" class=\"body-large\">\r\n                    </div>\r\n                </div> -->\r\n\r\n\r\n        <div *ngIf=\"data?.action && data?.action?.display\" class=\"d-flex gap-2 d-md-flex mt-15\" [ngClass]=\"[\r\n                styles?.layout?.align === 'left' ? 'justify-content-md-start' : '',\r\n                styles?.layout?.align === 'center' ? 'justify-content-md-center' : '',\r\n                styles?.layout?.align === 'right' ? 'justify-content-md-end' : ''\r\n              ]\">\r\n          <div *ngFor=\"let button of data?.action?.buttons\">\r\n            <app-button-element [buttonContent]=\"button.content\" [buttonStyle]=\"button.styles\" [buttonId]=\"button.id\"\r\n              [sectionId]=\"data?.id\" [edit]=\"edit\" [color]=\"data?.styles?.background?.accentColor\"\r\n              [backgroundInfo]=\"data?.styles?.background\"></app-button-element>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n\r\n    <ng-container *ngIf=\"styles?.devider?.display\">\r\n      <simpo-svg-divider [dividerType]=\"styles?.devider?.deviderType\"\r\n        [color]=\"nextComponentColor?.color\"></simpo-svg-divider>\r\n    </ng-container>\r\n  </div>\r\n  <div [ngClass]=\"{'hover_effect': edit}\" *ngIf=\"showEditors\">\r\n    <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\"></simpo-hover-elements>\r\n  </div>\r\n  <div *ngIf=\"showDelete\" [ngClass]=\"{'hover_effect': delete}\">\r\n    <simpo-delete-hover-element [data]=\"data\" [index]=\"index\"></simpo-delete-hover-element>\r\n  </div>\r\n\r\n</div>", styles: [".hover_effect{position:unset;width:100%;top:0;left:0;height:100%}.total-container{position:relative;height:auto}.button-display{display:flex;gap:10px;margin-top:15px}.gap-15{gap:15px}.btn-primary{border:none}@media only screen and (max-width: 475px){.col-10{width:100%;height:32vh;padding-right:13px;padding-left:13px}.flex-column{flex-direction:column!important}.d-flex{justify-content:center}}\n"], dependencies: [{ kind: "ngmodule", type: SimpoElementsModule }, { kind: "component", type: i2.SimpoButtonComponent, selector: "app-button-element", inputs: ["buttonContent", "buttonStyle", "buttonId", "color", "sectionId", "edit", "backgroundInfo", "disabled", "loading", "isFullWidth"] }, { kind: "component", type: i3.SvgDividerComponent, selector: "simpo-svg-divider", inputs: ["dividerType", "color"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i4.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: SimpoComponentModule }, { kind: "component", type: i5.HoverElementsComponent, selector: "simpo-hover-elements", inputs: ["data", "index", "editOptions", "isMerged", "isEcommerce"], outputs: ["edit"] }, { kind: "component", type: i6.DeleteHoverElementComponent, selector: "simpo-delete-hover-element", inputs: ["index", "data"], outputs: ["edit"] }, { kind: "ngmodule", type: MatGridListModule }, { kind: "directive", type: AnimationDirective, selector: "[simpoAnimation]", inputs: ["simpoAnimation"] }, { kind: "directive", type: BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: ContentFitDirective, selector: "[simpoLayout]", inputs: ["simpoLayout"] }, { kind: "directive", type: BorderDirective, selector: "[simpoBorder]", inputs: ["simpoBorder"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: OverlayDirective, selector: "[simpoOverlay]", inputs: ["simpoOverlay"] }, { kind: "directive", type: PositionLayoutDirectiveDirective, selector: "[simpoPositionLayoutDirective]", inputs: ["simpoPositionLayoutDirective"] }, { kind: "component", type: TextEditorComponent, selector: "simpo-text-editor", inputs: ["value", "editable", "isRTE", "sectionId", "label", "type", "inputTextIndex", "itemIndex"], outputs: ["valueChange"] }, { kind: "directive", type: SpacingHorizontalDirective, selector: "[spacingHorizontal]", inputs: ["spacingHorizontal", "isHeader"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: HeaderTextComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-header-text', standalone: true, imports: [
                        SimpoElementsModule,
                        CommonModule,
                        SimpoComponentModule,
                        MatGridListModule,
                        SimpoButtonComponent,
                        AnimationDirective,
                        BackgroundDirective,
                        ContentFitDirective,
                        BorderDirective,
                        HoverDirective,
                        OverlayDirective,
                        PositionLayoutDirectiveDirective,
                        TextEditorComponent,
                        SpacingHorizontalDirective
                    ], template: "<div [id]=\"data?.id\" simpoHover (hovering)=\"showEditTabs($event)\" class=\"total-container\" [attr.style]=\"customClass\"\r\n  [simpoBackground]=\"styles?.background\">\r\n  <div class=\"col-xxl-8  w-100 d-flex\" [id]=\"data?.id\" #mainContainer [simpoOverlay]=\"styles?.background\"\r\n    [simpoBorder]=\"styles?.border\" [spacingHorizontal]=\"stylesLayout\" [simpoLayout]=\"styles?.layout\" [ngClass]=\"{\r\n      'justify-content-center': styles?.layout?.align === 'center',\r\n      'justify-content-start': styles?.layout?.align === 'left',\r\n      'justify-content-end': styles?.layout?.align === 'right'\r\n    }\">\r\n    <div class=\"flex-column row g-2\" [id]=\"data?.id\" [simpoAnimation]=\"styles?.animation\"\r\n      [simpoPositionLayoutDirective]=\"styles?.positionLayout\"\r\n      [ngClass]=\"{ 'align-items-center': styles?.positionLayout?.value === 'left' || styles?.positionLayout?.value === 'right' }\"\r\n      [ngStyle]=\"(styles?.devider?.display && screenWidth <= 475) ? {'margin-bottom': '45px'} : {}\">\r\n      <div class=\"col px-5 content-side\" [id]=\"data?.id\">\r\n        <div *ngFor=\"let item of content?.inputText; let i = index\">\r\n          <!-- <div *ngIf=\"item.label === 'Tagline' || item.label === 'Heading'\" [innerHTML]=\"item.value | sanitizeHtml\"\r\n                        [ngClass]=\"item.label === 'Heading' ? 'heading-large lh-2 mb-3' : 'body-large'\"></div> -->\r\n          <div [ngClass]=\"item.label.includes('Heading') ? 'heading-large lh-2 mb-4' : 'body-large'\">\r\n            <simpo-text-editor [(value)]=\"item.value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"i\" [isRTE]=\"item.isRTE\"></simpo-text-editor>\r\n          </div>\r\n        </div>\r\n      </div>\r\n      <div class=\"col px-5\" [id]=\"data?.id\">\r\n        <!-- <div *ngFor=\"let item of content?.inputText\">\r\n                    <div *ngIf=\"item.label === 'Subtext'\" [innerHTML]=\"item.value | sanitizeHtml\" class=\"body-large\">\r\n                    </div>\r\n                </div> -->\r\n\r\n\r\n        <div *ngIf=\"data?.action && data?.action?.display\" class=\"d-flex gap-2 d-md-flex mt-15\" [ngClass]=\"[\r\n                styles?.layout?.align === 'left' ? 'justify-content-md-start' : '',\r\n                styles?.layout?.align === 'center' ? 'justify-content-md-center' : '',\r\n                styles?.layout?.align === 'right' ? 'justify-content-md-end' : ''\r\n              ]\">\r\n          <div *ngFor=\"let button of data?.action?.buttons\">\r\n            <app-button-element [buttonContent]=\"button.content\" [buttonStyle]=\"button.styles\" [buttonId]=\"button.id\"\r\n              [sectionId]=\"data?.id\" [edit]=\"edit\" [color]=\"data?.styles?.background?.accentColor\"\r\n              [backgroundInfo]=\"data?.styles?.background\"></app-button-element>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n\r\n    <ng-container *ngIf=\"styles?.devider?.display\">\r\n      <simpo-svg-divider [dividerType]=\"styles?.devider?.deviderType\"\r\n        [color]=\"nextComponentColor?.color\"></simpo-svg-divider>\r\n    </ng-container>\r\n  </div>\r\n  <div [ngClass]=\"{'hover_effect': edit}\" *ngIf=\"showEditors\">\r\n    <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\"></simpo-hover-elements>\r\n  </div>\r\n  <div *ngIf=\"showDelete\" [ngClass]=\"{'hover_effect': delete}\">\r\n    <simpo-delete-hover-element [data]=\"data\" [index]=\"index\"></simpo-delete-hover-element>\r\n  </div>\r\n\r\n</div>", styles: [".hover_effect{position:unset;width:100%;top:0;left:0;height:100%}.total-container{position:relative;height:auto}.button-display{display:flex;gap:10px;margin-top:15px}.gap-15{gap:15px}.btn-primary{border:none}@media only screen and (max-width: 475px){.col-10{width:100%;height:32vh;padding-right:13px;padding-left:13px}.flex-column{flex-direction:column!important}.d-flex{justify-content:center}}\n"] }]
        }], ctorParameters: () => [{ type: i1.EventsService }], propDecorators: { data: [{
                type: Input
            }], index: [{
                type: Input
            }], edit: [{
                type: Input
            }], delete: [{
                type: Input
            }], customClass: [{
                type: Input
            }], nextComponentColor: [{
                type: Input
            }], getScreenSize: [{
                type: HostListener,
                args: ['window:resize', ['$event']]
            }] } });
//# sourceMappingURL=data:application/json;base64, 