import { Component, HostListener, Input } from '@angular/core';
import BaseSection from '../BaseSection';
import { CommonModule } from '@angular/common';
import { BackgroundDirective } from '../../directive/background-directive';
import { HoverDirective } from '../../directive/hover-element-directive';
import { OverlayDirective } from '../../directive/overlay-directive';
import { HoverElementsComponent } from "../../components/hover-elements/hover-elements.component";
import { DeleteHoverElementComponent } from "../../components/delete-hover-element/delete-hover-element.component";
import { PositionLayoutDirectiveDirective } from '../../directive/position-layout-directive.directive';
import { ContentFitDirective } from '../../directive/content-fit-directive';
import { AnimationDirective } from '../../directive/animation-directive';
import { BorderDirective } from '../../directive/border-directive';
import { ObjectPositionDirective } from '../../directive/image-position.directive';
import { CornerDirective } from '../../directive/corner-directive';
import { simpoConetenAlignmentDirective } from '../../directive/content-alignment-directive';
import { SanitizeHtmlPipe } from '../../services/sanitizeHtml';
import { SvgDividerComponent } from '../../elements/svg-divider/svg-divider.component';
import { SpacingHorizontalDirective } from '../../directive/spacing-horizontal.directive';
import { TextEditorComponent } from '../../elements/text-editor/text-editor.component';
import { SpacingAroundDirective } from '../../directive/spacing-around.directive';
import * as i0 from "@angular/core";
import * as i1 from "./../../services/events.service";
import * as i2 from "@angular/common";
export class ChooseUsSectionComponent extends BaseSection {
    constructor(_eventService) {
        super();
        this._eventService = _eventService;
        this.screenWidth = "";
    }
    ngOnInit() {
        this.deleteSelected = this.delete;
        this.content = this.data?.content;
        this.styles = this.data?.styles;
        this.getScreenSize();
    }
    get stylesLayout() {
        return { ...this.styles?.layout };
    }
    getScreenSize() {
        this.screenWidth = window.innerWidth;
    }
    editSection() {
        if (window.innerWidth <= 475)
            return;
        this._eventService.toggleEditorEvent.emit(false);
        setTimeout(() => {
            this._eventService.editSection.emit({ data: this.data });
        }, 100);
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ChooseUsSectionComponent, deps: [{ token: i1.EventsService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ChooseUsSectionComponent, isStandalone: true, selector: "simpo-choose-us-section", 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  <div [spacingAround]=\"stylesLayout\" [id]=\"data?.id\">\r\n    <div class=\"col-xxl-8 py-5 w-100\" [id]=\"data?.id\" #mainContainer [spacingHorizontal]=\"stylesLayout\"\r\n      [simpoOverlay]=\"styles?.background\" [simpoBorder]=\"styles?.border\" [simpoBackground]=\"styles?.background\"\r\n      [simpoCorner]=\"styles?.corners\">\r\n      <div class=\"row g-5\" [id]=\"data?.id\" [simpoLayout]=\"styles?.layout\" [simpoAnimation]=\"styles?.animation\">\r\n        <div class=\"d-flex flex-column mt-0\" [id]=\"data?.id\" [simpoPositionLayoutDirective]=\"styles?.positionLayout\"\r\n          [class.flex-sm-column]=\"screenWidth < 475\">\r\n          <div class=\"d-flex flex-column gap-15 content-side\" [id]=\"data?.id\"\r\n            [simpoContentAlignment]=\"styles?.contentAlignment\"\r\n            [class.max-width]=\"styles?.positionLayout?.value === 'right' || styles?.positionLayout?.value === 'left'\">\r\n            <div *ngFor=\" let item of content?.inputText; let i = index\">\r\n              <!-- <div [innerHTML]=\"item.value | sanitizeHtml\" [ngClass]=\"item.label === 'Heading' ? 'heading-large heading' : 'body-large description'\">\r\n              </div> -->\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\r\n          <div class=\"card-section\"\r\n            [ngClass]=\"{'position-left': styles?.positionLayout?.value === 'left',\r\n            'position-right': styles?.positionLayout?.value === 'right', 'justify-content-start': styles?.layout?.align === 'left', 'justify-content-end': styles?.layout?.align === 'right','d-flex':screenWidth > 475,'d-grid grid-columns-50':screenWidth < 475}\"\r\n            [id]=\"data?.id\">\r\n            <div class=\"cards\" *ngFor=\"let cards of content?.listItem?.data; let i = index\">\r\n              <div class=\"individual-cards\" [simpoCorner]=\"styles?.corners\"\r\n                [ngClass]=\"{'box': content?.display?.showCard }\">\r\n                <div class=\"heading-large lh-2 mb-3\">\r\n                  <!-- <div [innerHtml]=\"cards.inputText[0].value | sanitizeHtml\"></div> -->\r\n                  <simpo-text-editor [(value)]=\"cards.inputText[0].value\"\r\n                    [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [itemIndex]=\"i\" [isRTE]=\"cards.inputText[0]?.isRTE\"></simpo-text-editor>\r\n\r\n                  <div class=\"body-large\">\r\n                    <!-- <div [innerHtml]=\"cards.inputText[1].value | sanitizeHtml\"></div> -->\r\n                    <simpo-text-editor [(value)]=\"cards.inputText[1].value\"\r\n                      [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [itemIndex]=\"i\" [isRTE]=\"cards.inputText[1]?.isRTE\"></simpo-text-editor>\r\n                  </div>\r\n                </div>\r\n              </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\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 *ngIf=\"showEditors\" [ngClass]=\"{'hover_effect': edit}\">\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</div>", styles: [".hover_effect{position:unset;width:100%;top:0;left:0;height:100%}.total-container{position:relative;height:auto}.individual-cards{color:#000;border-radius:1rem;display:flex;justify-content:center;align-items:center;text-align:center;height:100%}.box{background:#fff}.card-section{gap:22px;margin-top:5rem;flex-wrap:wrap;width:100%;justify-content:space-between!important;margin-top:0}.cards{width:20%}.position-left,.position-right{width:50%;flex-wrap:wrap;margin-top:1rem!important}:is(.position-left,.position-right) .cards{width:43%}.gap-15{gap:15px}@media screen and (min-width: 475px){.max-width{max-width:50%}}.flex-sm-column{flex-direction:column!important}@media only screen and (max-width: 475px){.card-section{flex-direction:column}.grid-columns-50{grid-template-columns:repeat(2,1fr)}.cards{width:92%}.position-left,.position-right{width:100%;margin-top:2rem!important}:is(.position-left,.position-right) .cards{width:92%}}.mt-0{margin-top:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: OverlayDirective, selector: "[simpoOverlay]", inputs: ["simpoOverlay"] }, { kind: "component", type: HoverElementsComponent, selector: "simpo-hover-elements", inputs: ["data", "index", "editOptions", "isMerged", "isEcommerce"], outputs: ["edit"] }, { kind: "component", type: DeleteHoverElementComponent, selector: "simpo-delete-hover-element", inputs: ["index", "data"], outputs: ["edit"] }, { kind: "directive", type: PositionLayoutDirectiveDirective, selector: "[simpoPositionLayoutDirective]", inputs: ["simpoPositionLayoutDirective"] }, { kind: "directive", type: ContentFitDirective, selector: "[simpoLayout]", inputs: ["simpoLayout"] }, { kind: "directive", type: AnimationDirective, selector: "[simpoAnimation]", inputs: ["simpoAnimation"] }, { kind: "directive", type: BorderDirective, selector: "[simpoBorder]", inputs: ["simpoBorder"] }, { kind: "directive", type: CornerDirective, selector: "[simpoCorner]", inputs: ["simpoCorner"] }, { kind: "directive", type: simpoConetenAlignmentDirective, selector: "[simpoContentAlignment]", inputs: ["simpoContentAlignment"] }, { kind: "component", type: SvgDividerComponent, selector: "simpo-svg-divider", inputs: ["dividerType", "color"] }, { kind: "directive", type: SpacingHorizontalDirective, selector: "[spacingHorizontal]", inputs: ["spacingHorizontal", "isHeader"] }, { kind: "component", type: TextEditorComponent, selector: "simpo-text-editor", inputs: ["value", "editable", "isRTE", "sectionId", "label", "type", "inputTextIndex", "itemIndex"], outputs: ["valueChange"] }, { kind: "directive", type: SpacingAroundDirective, selector: "[spacingAround]", inputs: ["spacingAround", "backgroundInfo"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ChooseUsSectionComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-choose-us-section', standalone: true, imports: [CommonModule,
                        BackgroundDirective,
                        HoverDirective,
                        OverlayDirective,
                        HoverElementsComponent,
                        DeleteHoverElementComponent,
                        PositionLayoutDirectiveDirective,
                        ContentFitDirective,
                        AnimationDirective,
                        BorderDirective,
                        ObjectPositionDirective,
                        CornerDirective,
                        simpoConetenAlignmentDirective,
                        SanitizeHtmlPipe, SvgDividerComponent,
                        SpacingHorizontalDirective,
                        TextEditorComponent,
                        SpacingAroundDirective
                    ], template: "<div [id]=\"data?.id\" simpoHover (hovering)=\"showEditTabs($event)\" class=\"total-container\" [attr.style]=\"customClass\">\r\n  <div [spacingAround]=\"stylesLayout\" [id]=\"data?.id\">\r\n    <div class=\"col-xxl-8 py-5 w-100\" [id]=\"data?.id\" #mainContainer [spacingHorizontal]=\"stylesLayout\"\r\n      [simpoOverlay]=\"styles?.background\" [simpoBorder]=\"styles?.border\" [simpoBackground]=\"styles?.background\"\r\n      [simpoCorner]=\"styles?.corners\">\r\n      <div class=\"row g-5\" [id]=\"data?.id\" [simpoLayout]=\"styles?.layout\" [simpoAnimation]=\"styles?.animation\">\r\n        <div class=\"d-flex flex-column mt-0\" [id]=\"data?.id\" [simpoPositionLayoutDirective]=\"styles?.positionLayout\"\r\n          [class.flex-sm-column]=\"screenWidth < 475\">\r\n          <div class=\"d-flex flex-column gap-15 content-side\" [id]=\"data?.id\"\r\n            [simpoContentAlignment]=\"styles?.contentAlignment\"\r\n            [class.max-width]=\"styles?.positionLayout?.value === 'right' || styles?.positionLayout?.value === 'left'\">\r\n            <div *ngFor=\" let item of content?.inputText; let i = index\">\r\n              <!-- <div [innerHTML]=\"item.value | sanitizeHtml\" [ngClass]=\"item.label === 'Heading' ? 'heading-large heading' : 'body-large description'\">\r\n              </div> -->\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\r\n          <div class=\"card-section\"\r\n            [ngClass]=\"{'position-left': styles?.positionLayout?.value === 'left',\r\n            'position-right': styles?.positionLayout?.value === 'right', 'justify-content-start': styles?.layout?.align === 'left', 'justify-content-end': styles?.layout?.align === 'right','d-flex':screenWidth > 475,'d-grid grid-columns-50':screenWidth < 475}\"\r\n            [id]=\"data?.id\">\r\n            <div class=\"cards\" *ngFor=\"let cards of content?.listItem?.data; let i = index\">\r\n              <div class=\"individual-cards\" [simpoCorner]=\"styles?.corners\"\r\n                [ngClass]=\"{'box': content?.display?.showCard }\">\r\n                <div class=\"heading-large lh-2 mb-3\">\r\n                  <!-- <div [innerHtml]=\"cards.inputText[0].value | sanitizeHtml\"></div> -->\r\n                  <simpo-text-editor [(value)]=\"cards.inputText[0].value\"\r\n                    [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [itemIndex]=\"i\" [isRTE]=\"cards.inputText[0]?.isRTE\"></simpo-text-editor>\r\n\r\n                  <div class=\"body-large\">\r\n                    <!-- <div [innerHtml]=\"cards.inputText[1].value | sanitizeHtml\"></div> -->\r\n                    <simpo-text-editor [(value)]=\"cards.inputText[1].value\"\r\n                      [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [itemIndex]=\"i\" [isRTE]=\"cards.inputText[1]?.isRTE\"></simpo-text-editor>\r\n                  </div>\r\n                </div>\r\n              </div>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\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 *ngIf=\"showEditors\" [ngClass]=\"{'hover_effect': edit}\">\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</div>", styles: [".hover_effect{position:unset;width:100%;top:0;left:0;height:100%}.total-container{position:relative;height:auto}.individual-cards{color:#000;border-radius:1rem;display:flex;justify-content:center;align-items:center;text-align:center;height:100%}.box{background:#fff}.card-section{gap:22px;margin-top:5rem;flex-wrap:wrap;width:100%;justify-content:space-between!important;margin-top:0}.cards{width:20%}.position-left,.position-right{width:50%;flex-wrap:wrap;margin-top:1rem!important}:is(.position-left,.position-right) .cards{width:43%}.gap-15{gap:15px}@media screen and (min-width: 475px){.max-width{max-width:50%}}.flex-sm-column{flex-direction:column!important}@media only screen and (max-width: 475px){.card-section{flex-direction:column}.grid-columns-50{grid-template-columns:repeat(2,1fr)}.cards{width:92%}.position-left,.position-right{width:100%;margin-top:2rem!important}:is(.position-left,.position-right) .cards{width:92%}}.mt-0{margin-top:0}\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, 