import { Component, HostListener, Input } from '@angular/core';
import BaseSection from '../../BaseSection';
import { SimpoComponentModule } from '../../../components/index';
import { SimpoElementsModule } from '../../../elements/index';
import { CommonModule } from '@angular/common';
import { TextEditorComponent } from '../../../elements/text-editor/text-editor.component';
import { BackgroundDirective } from '../../../directive/background-directive';
import { HoverDirective } from '../../../directive/hover-element-directive';
import { CornerDirective } from '../../../directive/corner-directive';
import { ContentFitDirective } from '../../../directive/content-fit-directive';
import { SpacingHorizontalDirective } from '../../../directive/spacing-horizontal.directive';
import { ImageEditorDirective } from '../../../directive/image-editor.directive';
import { AnimationDirective } from '../../../directive/animation-directive';
import * as i0 from "@angular/core";
import * as i1 from "../../../components/hover-elements/hover-elements.component";
import * as i2 from "../../../components/delete-hover-element/delete-hover-element.component";
import * as i3 from "@angular/common";
import * as i4 from "../../../elements/simpo-button/simpo-button.component";
import * as i5 from "../../../elements/svg-divider/svg-divider.component";
export class ImageBackgroundComponent extends BaseSection {
    constructor() {
        super();
        this.getScreenSize();
    }
    ngOnInit() {
        this.styles = this.data?.styles;
        this.content = this.data?.content;
    }
    getScreenSize() {
        this.screenWidth = window.innerWidth;
    }
    get stylesLayout() {
        return { ...this.styles?.layout };
    }
    get headingSpace() {
        return this.styles?.layout?.headingSpacing;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ImageBackgroundComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ImageBackgroundComponent, isStandalone: true, selector: "simpo-image-background", inputs: { nextComponentColor: "nextComponentColor", data: "data", edit: "edit", index: "index", customClass: "customClass", delete: "delete" }, host: { listeners: { "window: resize": "getScreenSize($event)" } }, usesInheritance: true, ngImport: i0, template: "<section class=\"total-container\" [id]=\"data?.id\" [simpoBackground]=\"styles?.background\" simpoHover\r\n    (hovering)=\"showEditTabs($event)\" [attr.style]=\"customClass\" [ngClass]=\"{'p-2rem':!styles?.fullWidth}\">\r\n    <div class=\"cta-container w-100\" [id]=\"data?.id\" #mainContainer\r\n        [simpoCorner]=\"!styles?.fullWidth ? styles?.corners : undefined\" [spacingHorizontal]=\"stylesLayout\"\r\n        [simpoLayout]=\"styles?.layout\"\r\n        [ngClass]=\"{'justify-content-start' : styles?.layout?.setContentPosition === 'Left' , 'justify-content-end' : styles?.layout?.setContentPosition === 'Right' }\"\r\n        [ngStyle]=\"{\r\n    'background-image': (screenWidth > 1200 ? 'url(' + content?.image?.url + ')' : 'unset !important'),\r\n    'background-size': 'cover',\r\n    'background-position': 'center',\r\n    'background-repeat': 'no-repeat'\r\n  }\" [appImageEditor]=\"edit || false\" [imageData]=\"content?.image\" [simpoAnimation]=\"styles?.animation\">\r\n        <!-- <div class=\"cta-image\">\r\n            <img src=\"\" alt=\"Abstract Design\">\r\n        </div> -->\r\n        <div class=\"cta-content d-flex flex-column gap-3\" (click)=\"$event.stopPropagation()\">\r\n            <simpo-text-editor [(value)]=\"content.inputText[0].value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [isRTE]=\"content?.inputText[0]?.isRTE\"></simpo-text-editor>\r\n            <simpo-text-editor [(value)]=\"content.inputText[1].value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [isRTE]=\"content?.inputText[1]?.isRTE\"></simpo-text-editor>\r\n            <ng-container *ngIf=\"data?.action?.display\">\r\n                <ng-container *ngIf=\"data?.action?.buttons?.length == 1;else mutipleButtons\">\r\n                    <app-button-element [buttonContent]=\"data.action.buttons[0].content\"\r\n                        [buttonStyle]=\"data.action.buttons[0].styles\" [buttonId]=\"data.action.buttons[0].id\"\r\n                        [sectionId]=\"data?.id\" [color]=\"data?.styles?.background?.accentColor\" [edit]=\"edit\"\r\n                        [backgroundInfo]=\"data?.styles?.background\"></app-button-element>\r\n                </ng-container>\r\n            </ng-container>\r\n            <ng-template #mutipleButtons>\r\n                <div class=\"d-flex align-items-center justify-content-center gap-2\">\r\n                    <ng-container *ngFor=\"let button of data?.action?.buttons\">\r\n                        <app-button-element [buttonContent]=\"button.content\" [buttonStyle]=\"button.styles\"\r\n                            [buttonId]=\"button.id\" [sectionId]=\"data?.id\"\r\n                            [color]=\"data?.styles?.background?.accentColor\" [edit]=\"edit\"\r\n                            [backgroundInfo]=\"data?.styles?.background\"></app-button-element>\r\n                    </ng-container>\r\n                </div>\r\n            </ng-template>\r\n        </div>\r\n    </div>\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 [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</section>", styles: [".cta-content{color:#fff}.total-container{height:auto;position:relative}.cta-container{display:flex;align-items:center;justify-content:space-between;overflow:hidden;background-image:url(https://d2z9497xp8xb12.cloudfront.net/prod-images/284345c1770816953360Artboard_18-1.webp);background-size:cover;background-position:center;background-repeat:no-repeat}.p-2rem{padding:2rem}.cta-image{flex:1}.cta-image img{width:100%;height:100%;object-fit:cover;display:block}.cta-content h1{font-size:40px;line-height:1.3;margin-bottom:20px}.cta-content p{font-size:16px;color:#cbd5e1;margin-bottom:30px;max-width:500px}.cta-button{display:inline-block;padding:12px 24px;background:#000;color:#fff;text-decoration:none;border-radius:8px;font-weight:600;transition:.3s ease}.cta-button:hover{background:#1e293b}@media (max-width: 992px){.cta-content{padding:40px}.cta-content h1{font-size:32px}}@media (min-width:1200px){.cta-content{max-width:50%}}@media (max-width: 768px){.cta-container{flex-direction:column}.cta-image{width:100%;height:300px}.cta-content{padding:30px;text-align:center}.cta-content p{margin:0 auto 25px}}@media (max-width: 480px){.cta-content h1{font-size:24px}.cta-content p{font-size:14px}.cta-button{padding:10px 20px;font-size:14px}}\n"], dependencies: [{ kind: "ngmodule", type: SimpoComponentModule }, { kind: "component", type: i1.HoverElementsComponent, selector: "simpo-hover-elements", inputs: ["data", "index", "editOptions", "isMerged", "isEcommerce"], outputs: ["edit"] }, { kind: "component", type: i2.DeleteHoverElementComponent, selector: "simpo-delete-hover-element", inputs: ["index", "data"], outputs: ["edit"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: SimpoElementsModule }, { kind: "component", type: i4.SimpoButtonComponent, selector: "app-button-element", inputs: ["buttonContent", "buttonStyle", "buttonId", "color", "sectionId", "edit", "backgroundInfo", "disabled", "loading", "isFullWidth"] }, { kind: "component", type: i5.SvgDividerComponent, selector: "simpo-svg-divider", inputs: ["dividerType", "color"] }, { kind: "component", type: TextEditorComponent, selector: "simpo-text-editor", inputs: ["value", "editable", "isRTE", "sectionId", "label", "type", "inputTextIndex", "itemIndex"], outputs: ["valueChange"] }, { kind: "directive", type: 
                //Directives
                BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: ContentFitDirective, selector: "[simpoLayout]", inputs: ["simpoLayout"] }, { kind: "directive", type: SpacingHorizontalDirective, selector: "[spacingHorizontal]", inputs: ["spacingHorizontal", "isHeader"] }, { kind: "directive", type: CornerDirective, selector: "[simpoCorner]", inputs: ["simpoCorner"] }, { kind: "directive", type: ImageEditorDirective, selector: "[appImageEditor]", inputs: ["appImageEditor", "imageData", "sectionId", "showIcon", "iconData", "itemIndex"] }, { kind: "directive", type: AnimationDirective, selector: "[simpoAnimation]", inputs: ["simpoAnimation"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ImageBackgroundComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-image-background', standalone: true, imports: [
                        SimpoComponentModule,
                        CommonModule,
                        SimpoElementsModule,
                        TextEditorComponent,
                        //Directives
                        BackgroundDirective,
                        HoverDirective,
                        ContentFitDirective,
                        SpacingHorizontalDirective,
                        CornerDirective,
                        ImageEditorDirective,
                        AnimationDirective
                    ], template: "<section class=\"total-container\" [id]=\"data?.id\" [simpoBackground]=\"styles?.background\" simpoHover\r\n    (hovering)=\"showEditTabs($event)\" [attr.style]=\"customClass\" [ngClass]=\"{'p-2rem':!styles?.fullWidth}\">\r\n    <div class=\"cta-container w-100\" [id]=\"data?.id\" #mainContainer\r\n        [simpoCorner]=\"!styles?.fullWidth ? styles?.corners : undefined\" [spacingHorizontal]=\"stylesLayout\"\r\n        [simpoLayout]=\"styles?.layout\"\r\n        [ngClass]=\"{'justify-content-start' : styles?.layout?.setContentPosition === 'Left' , 'justify-content-end' : styles?.layout?.setContentPosition === 'Right' }\"\r\n        [ngStyle]=\"{\r\n    'background-image': (screenWidth > 1200 ? 'url(' + content?.image?.url + ')' : 'unset !important'),\r\n    'background-size': 'cover',\r\n    'background-position': 'center',\r\n    'background-repeat': 'no-repeat'\r\n  }\" [appImageEditor]=\"edit || false\" [imageData]=\"content?.image\" [simpoAnimation]=\"styles?.animation\">\r\n        <!-- <div class=\"cta-image\">\r\n            <img src=\"\" alt=\"Abstract Design\">\r\n        </div> -->\r\n        <div class=\"cta-content d-flex flex-column gap-3\" (click)=\"$event.stopPropagation()\">\r\n            <simpo-text-editor [(value)]=\"content.inputText[0].value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [isRTE]=\"content?.inputText[0]?.isRTE\"></simpo-text-editor>\r\n            <simpo-text-editor [(value)]=\"content.inputText[1].value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [isRTE]=\"content?.inputText[1]?.isRTE\"></simpo-text-editor>\r\n            <ng-container *ngIf=\"data?.action?.display\">\r\n                <ng-container *ngIf=\"data?.action?.buttons?.length == 1;else mutipleButtons\">\r\n                    <app-button-element [buttonContent]=\"data.action.buttons[0].content\"\r\n                        [buttonStyle]=\"data.action.buttons[0].styles\" [buttonId]=\"data.action.buttons[0].id\"\r\n                        [sectionId]=\"data?.id\" [color]=\"data?.styles?.background?.accentColor\" [edit]=\"edit\"\r\n                        [backgroundInfo]=\"data?.styles?.background\"></app-button-element>\r\n                </ng-container>\r\n            </ng-container>\r\n            <ng-template #mutipleButtons>\r\n                <div class=\"d-flex align-items-center justify-content-center gap-2\">\r\n                    <ng-container *ngFor=\"let button of data?.action?.buttons\">\r\n                        <app-button-element [buttonContent]=\"button.content\" [buttonStyle]=\"button.styles\"\r\n                            [buttonId]=\"button.id\" [sectionId]=\"data?.id\"\r\n                            [color]=\"data?.styles?.background?.accentColor\" [edit]=\"edit\"\r\n                            [backgroundInfo]=\"data?.styles?.background\"></app-button-element>\r\n                    </ng-container>\r\n                </div>\r\n            </ng-template>\r\n        </div>\r\n    </div>\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 [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</section>", styles: [".cta-content{color:#fff}.total-container{height:auto;position:relative}.cta-container{display:flex;align-items:center;justify-content:space-between;overflow:hidden;background-image:url(https://d2z9497xp8xb12.cloudfront.net/prod-images/284345c1770816953360Artboard_18-1.webp);background-size:cover;background-position:center;background-repeat:no-repeat}.p-2rem{padding:2rem}.cta-image{flex:1}.cta-image img{width:100%;height:100%;object-fit:cover;display:block}.cta-content h1{font-size:40px;line-height:1.3;margin-bottom:20px}.cta-content p{font-size:16px;color:#cbd5e1;margin-bottom:30px;max-width:500px}.cta-button{display:inline-block;padding:12px 24px;background:#000;color:#fff;text-decoration:none;border-radius:8px;font-weight:600;transition:.3s ease}.cta-button:hover{background:#1e293b}@media (max-width: 992px){.cta-content{padding:40px}.cta-content h1{font-size:32px}}@media (min-width:1200px){.cta-content{max-width:50%}}@media (max-width: 768px){.cta-container{flex-direction:column}.cta-image{width:100%;height:300px}.cta-content{padding:30px;text-align:center}.cta-content p{margin:0 auto 25px}}@media (max-width: 480px){.cta-content h1{font-size:24px}.cta-content p{font-size:14px}.cta-button{padding:10px 20px;font-size:14px}}\n"] }]
        }], ctorParameters: () => [], propDecorators: { nextComponentColor: [{
                type: Input
            }], data: [{
                type: Input
            }], edit: [{
                type: Input
            }], index: [{
                type: Input
            }], customClass: [{
                type: Input
            }], delete: [{
                type: Input
            }], getScreenSize: [{
                type: HostListener,
                args: ["window: resize", ["$event"]]
            }] } });
//# sourceMappingURL=data:application/json;base64, 