import { Component, HostListener, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SimpoElementsModule } from '../../elements/index';
import { SimpoComponentModule } from '../../components/index';
import { AnimationDirective } from '../../directive/animation-directive';
import { BackgroundDirective } from '../../directive/background-directive';
import { ContentFitDirective } from '../../directive/content-fit-directive';
import { BannerContentFitDirective } from '../../directive/banner-content-fit-directive';
import { BorderDirective } from '../../directive/border-directive';
import { ButtonDirectiveDirective } from '../../directive/button-directive.directive';
import { ColumnDirectiveDirective } from '../../directive/column-directive.directive';
import { ContainerFitDirective } from '../../directive/container-fir.directive';
import { simpoConetenAlignmentDirective } from '../../directive/content-alignment-directive';
import { CornerDirective } from '../../directive/corner-directive';
import { SimpoFooterLayoutDirective } from '../../directive/footer-layout-directive';
import { HoverDirective } from '../../directive/hover-element-directive';
import { ImageDirectiveDirective } from '../../directive/image-directive.directive';
import { OverlayDirective } from '../../directive/overlay-directive';
import { PositionLayoutDirectiveDirective } from '../../directive/position-layout-directive.directive';
import { TextBackgroundDirectiveDirective } from '../../directive/text-background-directive.directive';
import { ObjectPositionDirective } from '../../directive/image-position.directive';
import { ContentTitleDirective } from '../../directive/content-title-spacing.directive';
import BaseSection from '../BaseSection';
import { ImageEditorDirective } from '../../directive/image-editor.directive';
import { TextEditorComponent } from '../../elements/text-editor/text-editor.component';
import { SpacingHorizontalDirective } from '../../directive/spacing-horizontal.directive';
import { TranslateOnhoverDirective } from '../../directive/translate-onhover.directive';
import * as i0 from "@angular/core";
import * as i1 from "./../../services/events.service";
import * as i2 from "../../elements/svg-divider/svg-divider.component";
import * as i3 from "@angular/common";
import * as i4 from "../../components/hover-elements/hover-elements.component";
import * as i5 from "../../components/delete-hover-element/delete-hover-element.component";
export class LogoGalleryComponent extends BaseSection {
    constructor(_eventService) {
        super();
        this._eventService = _eventService;
        this.screenWidth = "";
    }
    getScreenSize() {
        this.screenWidth = window.innerWidth;
    }
    ngOnInit() {
        this.content = this.data?.content;
        this.style = this.data?.styles;
        this.getScreenSize();
    }
    get headingSpace() {
        return this.style?.layout?.headingSpacing;
    }
    get stylesLayout() {
        return { ...this.style?.layout };
    }
    isEvenRow(index) {
        const itemsBefore = index + 1; // 1-based index for easier calculation.
        let rowSize = 7;
        let itemsInRow = 0;
        while (itemsBefore > itemsInRow) {
            itemsInRow += rowSize;
            rowSize = rowSize === 7 ? 8 : 7; // Alternate between 7 and 8 items per row.
        }
        // Return true if even row size was used for this image.
        return rowSize === 8;
    }
    editSection() {
        this._eventService.toggleEditorEvent.emit(false);
        setTimeout(() => {
            this._eventService.editSection.emit({ data: this.data });
        }, 100);
    }
    stopPropagation(event) {
        event.stopPropagation();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LogoGalleryComponent, deps: [{ token: i1.EventsService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: LogoGalleryComponent, isStandalone: true, selector: "simpo-logo-gallery", inputs: { data: "data", index: "index", edit: "edit", customClass: "customClass", nextComponentColor: "nextComponentColor", delete: "delete" }, host: { listeners: { "window: resize": "getScreenSize($event)" } }, usesInheritance: true, ngImport: i0, template: "<section [id]=\"data?.id\" [simpoBackground]=\"style?.background\" simpoHover (hovering)=\"showEditTabs($event)\"\r\n    class=\"total-container\" [attr.style]=\"customClass\">\r\n    <div #mainContainer [id]=\"data?.id\" [simpoOverlay]=\"style?.background\">\r\n        <div class=\"container-fluid padding-sm-2\" [id]=\"data?.id\" [simpoBorder]=\"style?.border\" [simpoLayout]=\"style?.layout\"\r\n            [spacingHorizontal]=\"stylesLayout\">\r\n            <div class=\"row\" [id]=\"data?.id\" [simpoAnimation]=\"style?.animation\"\r\n                [ngStyle]=\"style?.fullWidth ? {'padding': '0px'} : {}\">\r\n                <div *ngFor=\"let text of data?.content?.inputText;let i = index\"\r\n                    [simpoContentTitleSpace]=\"i == 0 ? style?.layout?.headingSpacing : undefined\">\r\n                    <simpo-text-editor [(value)]=\"text.value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"i\" [isRTE]=\"text.isRTE\"></simpo-text-editor>\r\n                </div>\r\n                <div class=\"main-image-section mb-2 d-flex flex-wrap mt-5\" [ngClass]=\"{'px-0': style?.fullWidth}\"\r\n                    [id]=\"data?.id\" *ngIf=\"screenWidth > 475\">\r\n                    <ng-container *ngFor=\"let img of content?.listItem?.data; let i = index\">\r\n                        <div class=\"image-section\" [ngClass]=\"{'even-row': isEvenRow(i), 'odd-row': !isEvenRow(i)}\"\r\n                            [simpoTranslateOnhover]=\"content?.display?.showHoverEffect\">\r\n                            <img [id]=\"data?.id\" [class]=\"data?.id + img.image.id + ' h-100'\" [src]=\"img.image.url\"\r\n                                [appImageEditor]=\"edit || false\" [imageData]=\"img?.image\" [sectionId]=\"data?.id\" [itemIndex]=\"i\"\r\n                                [alt]=\"img.image.altText\" loading=\"lazy\" [simpoCorner]=\"style?.corners\" />\r\n                        </div>\r\n                    </ng-container>\r\n                </div>\r\n                <div class=\"mob-container\" *ngIf=\"screenWidth <= 475\"\r\n                [ngStyle]=\"(style?.devider?.display && screenWidth <= 475) ? {'margin-bottom': '45px'} : {}\">\r\n                    <ng-container *ngFor=\"let img of content?.listItem?.data; let i = index\">\r\n                        <div class=\"d-flex logo-box justify-content-center\">\r\n                            <img [id]=\"data?.id\" [class]=\"data?.id + img.image.id\" [src]=\"img.image.url\"\r\n                                [appImageEditor]=\"edit || false\" [imageData]=\"img?.image\" [sectionId]=\"data?.id\" [itemIndex]=\"i\"\r\n                                [alt]=\"img.image.altText\" loading=\"lazy\" [simpoCorner]=\"style?.corners\" />\r\n                        </div>\r\n                    </ng-container>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\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\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    <ng-container *ngIf=\"style?.devider?.display\">\r\n        <simpo-svg-divider [dividerType]=\"style?.devider?.deviderType\"\r\n            [color]=\"nextComponentColor?.color\"></simpo-svg-divider>\r\n    </ng-container>\r\n</section>", styles: [".text-alignment{text-align:center;margin-bottom:10px}.total-container{height:auto;position:relative}.main-image-section{padding:0px 5rem}.image-section{padding:5px}.image-section img{width:100%;object-fit:cover}.even-row{flex-basis:calc(100% / 7);max-width:calc(100% / 7)}.odd-row{flex-basis:12.5%;max-width:12.5%}.mb-1{margin-bottom:1.5rem!important}.hover_effect{position:unset!important;width:100%;top:0;left:0;height:100%}@media screen and (min-width: 760px){.cards{padding-bottom:24px}}@media screen and (max-width: 475px){.padding-sm-2{padding:1.5rem .8rem!important}}.left-arrow,.right-arrow{position:relative;top:10px}.static-text{font-size:16px;font-weight:900}.mob-container{display:grid;grid-template-columns:50% 50%;justify-content:center;margin-top:8px}.logo-box{padding-top:.25rem;width:100%;height:8rem}.hover_effect{position:absolute;width:100%;top:0;left:0;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: SimpoElementsModule }, { kind: "component", type: i2.SvgDividerComponent, selector: "simpo-svg-divider", inputs: ["dividerType", "color"] }, { 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: "directive", type: ContentFitDirective, selector: "[simpoLayout]", inputs: ["simpoLayout"] }, { kind: "ngmodule", type: SimpoComponentModule }, { kind: "component", type: i4.HoverElementsComponent, selector: "simpo-hover-elements", inputs: ["data", "index", "editOptions", "isMerged", "isEcommerce"], outputs: ["edit"] }, { kind: "component", type: i5.DeleteHoverElementComponent, selector: "simpo-delete-hover-element", inputs: ["index", "data"], outputs: ["edit"] }, { kind: "directive", type: 
                //directive
                AnimationDirective, selector: "[simpoAnimation]", inputs: ["simpoAnimation"] }, { kind: "directive", type: BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: BorderDirective, selector: "[simpoBorder]", inputs: ["simpoBorder"] }, { kind: "directive", type: CornerDirective, selector: "[simpoCorner]", inputs: ["simpoCorner"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: OverlayDirective, selector: "[simpoOverlay]", inputs: ["simpoOverlay"] }, { kind: "directive", type: ContentTitleDirective, selector: "[simpoContentTitleSpace]", inputs: ["simpoContentTitleSpace"] }, { kind: "directive", type: ImageEditorDirective, selector: "[appImageEditor]", inputs: ["appImageEditor", "imageData", "sectionId", "showIcon", "iconData", "itemIndex"] }, { 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"] }, { kind: "directive", type: TranslateOnhoverDirective, selector: "[simpoTranslateOnhover]", inputs: ["simpoTranslateOnhover"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: LogoGalleryComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-logo-gallery', standalone: true, imports: [
                        SimpoElementsModule,
                        CommonModule,
                        ColumnDirectiveDirective,
                        ImageDirectiveDirective,
                        ContentFitDirective,
                        SimpoComponentModule,
                        //directive
                        AnimationDirective,
                        BackgroundDirective,
                        BannerContentFitDirective,
                        BorderDirective,
                        ButtonDirectiveDirective,
                        ColumnDirectiveDirective,
                        ContainerFitDirective,
                        simpoConetenAlignmentDirective,
                        ContentFitDirective,
                        CornerDirective,
                        SimpoFooterLayoutDirective,
                        HoverDirective,
                        ImageDirectiveDirective,
                        OverlayDirective,
                        PositionLayoutDirectiveDirective,
                        TextBackgroundDirectiveDirective,
                        ObjectPositionDirective,
                        ContentTitleDirective,
                        ImageEditorDirective,
                        TextEditorComponent,
                        SpacingHorizontalDirective,
                        TranslateOnhoverDirective
                    ], template: "<section [id]=\"data?.id\" [simpoBackground]=\"style?.background\" simpoHover (hovering)=\"showEditTabs($event)\"\r\n    class=\"total-container\" [attr.style]=\"customClass\">\r\n    <div #mainContainer [id]=\"data?.id\" [simpoOverlay]=\"style?.background\">\r\n        <div class=\"container-fluid padding-sm-2\" [id]=\"data?.id\" [simpoBorder]=\"style?.border\" [simpoLayout]=\"style?.layout\"\r\n            [spacingHorizontal]=\"stylesLayout\">\r\n            <div class=\"row\" [id]=\"data?.id\" [simpoAnimation]=\"style?.animation\"\r\n                [ngStyle]=\"style?.fullWidth ? {'padding': '0px'} : {}\">\r\n                <div *ngFor=\"let text of data?.content?.inputText;let i = index\"\r\n                    [simpoContentTitleSpace]=\"i == 0 ? style?.layout?.headingSpacing : undefined\">\r\n                    <simpo-text-editor [(value)]=\"text.value\" [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"i\" [isRTE]=\"text.isRTE\"></simpo-text-editor>\r\n                </div>\r\n                <div class=\"main-image-section mb-2 d-flex flex-wrap mt-5\" [ngClass]=\"{'px-0': style?.fullWidth}\"\r\n                    [id]=\"data?.id\" *ngIf=\"screenWidth > 475\">\r\n                    <ng-container *ngFor=\"let img of content?.listItem?.data; let i = index\">\r\n                        <div class=\"image-section\" [ngClass]=\"{'even-row': isEvenRow(i), 'odd-row': !isEvenRow(i)}\"\r\n                            [simpoTranslateOnhover]=\"content?.display?.showHoverEffect\">\r\n                            <img [id]=\"data?.id\" [class]=\"data?.id + img.image.id + ' h-100'\" [src]=\"img.image.url\"\r\n                                [appImageEditor]=\"edit || false\" [imageData]=\"img?.image\" [sectionId]=\"data?.id\" [itemIndex]=\"i\"\r\n                                [alt]=\"img.image.altText\" loading=\"lazy\" [simpoCorner]=\"style?.corners\" />\r\n                        </div>\r\n                    </ng-container>\r\n                </div>\r\n                <div class=\"mob-container\" *ngIf=\"screenWidth <= 475\"\r\n                [ngStyle]=\"(style?.devider?.display && screenWidth <= 475) ? {'margin-bottom': '45px'} : {}\">\r\n                    <ng-container *ngFor=\"let img of content?.listItem?.data; let i = index\">\r\n                        <div class=\"d-flex logo-box justify-content-center\">\r\n                            <img [id]=\"data?.id\" [class]=\"data?.id + img.image.id\" [src]=\"img.image.url\"\r\n                                [appImageEditor]=\"edit || false\" [imageData]=\"img?.image\" [sectionId]=\"data?.id\" [itemIndex]=\"i\"\r\n                                [alt]=\"img.image.altText\" loading=\"lazy\" [simpoCorner]=\"style?.corners\" />\r\n                        </div>\r\n                    </ng-container>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n\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\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    <ng-container *ngIf=\"style?.devider?.display\">\r\n        <simpo-svg-divider [dividerType]=\"style?.devider?.deviderType\"\r\n            [color]=\"nextComponentColor?.color\"></simpo-svg-divider>\r\n    </ng-container>\r\n</section>", styles: [".text-alignment{text-align:center;margin-bottom:10px}.total-container{height:auto;position:relative}.main-image-section{padding:0px 5rem}.image-section{padding:5px}.image-section img{width:100%;object-fit:cover}.even-row{flex-basis:calc(100% / 7);max-width:calc(100% / 7)}.odd-row{flex-basis:12.5%;max-width:12.5%}.mb-1{margin-bottom:1.5rem!important}.hover_effect{position:unset!important;width:100%;top:0;left:0;height:100%}@media screen and (min-width: 760px){.cards{padding-bottom:24px}}@media screen and (max-width: 475px){.padding-sm-2{padding:1.5rem .8rem!important}}.left-arrow,.right-arrow{position:relative;top:10px}.static-text{font-size:16px;font-weight:900}.mob-container{display:grid;grid-template-columns:50% 50%;justify-content:center;margin-top:8px}.logo-box{padding-top:.25rem;width:100%;height:8rem}.hover_effect{position:absolute;width:100%;top:0;left:0;height:100%}\n"] }]
        }], ctorParameters: () => [{ type: i1.EventsService }], propDecorators: { data: [{
                type: Input
            }], index: [{
                type: Input
            }], edit: [{
                type: Input
            }], customClass: [{
                type: Input
            }], nextComponentColor: [{
                type: Input
            }], delete: [{
                type: Input
            }], getScreenSize: [{
                type: HostListener,
                args: ["window: resize", ["$event"]]
            }] } });
//# sourceMappingURL=data:application/json;base64, 