import { CommonModule } from '@angular/common';
import { Component, Input, ViewChild } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatIcon } from '@angular/material/icon';
import { SpacingHorizontalDirective } from '../../../directive/spacing-horizontal.directive';
import { AnimationDirective } from '../../../directive/animation-directive';
import { BackgroundDirective } from '../../../directive/background-directive';
import { CornerDirective } from '../../../directive/corner-directive';
import { SimpoComponentModule } from '../../../components/index';
import { HoverDirective } from '../../../directive/hover-element-directive';
import { ButtonDirectiveDirective } from '../../../directive/button-directive.directive';
import { ContentFitDirective } from '../../../directive/content-fit-directive';
import BaseSection from '../../../sections/BaseSection';
import { TextEditorComponent } from '../../../elements/text-editor/text-editor.component';
import { ButtonEditorDirective } from '../../../directive/button-editor.directive';
import { MatProgressSpinner } from "@angular/material/progress-spinner";
import { MessageService } from 'primeng/api';
import { ToastModule } from 'primeng/toast';
import { MatSlider } from "@angular/material/slider";
import { MatSliderModule } from '@angular/material/slider';
import * as i0 from "@angular/core";
import * as i1 from ".././../../services/events.service";
import * as i2 from "../../../services/rest.service";
import * as i3 from "@angular/material/dialog";
import * as i4 from "../../../services/storage.service";
import * as i5 from "@angular/router";
import * as i6 from "primeng/api";
import * as i7 from "@angular/common";
import * as i8 from "@angular/forms";
import * as i9 from "../../../components/hover-elements/hover-elements.component";
import * as i10 from "../../../components/delete-hover-element/delete-hover-element.component";
import * as i11 from "primeng/toast";
import * as i12 from "@angular/material/slider";
export class ReturnsCalculatorComponent extends BaseSection {
    constructor(_eventService, restService, matDialog, storageService, router, messageService) {
        super();
        this._eventService = _eventService;
        this.restService = restService;
        this.matDialog = matDialog;
        this.storageService = storageService;
        this.router = router;
        this.messageService = messageService;
        this.selectedScheme = 'individual';
        this.monthlyAmount = 0;
        this.maxAmount = 0;
        this.minAmount = 0;
        this.purchasedGram = 0;
        this.currentGoldRate = 0;
        this.termsAndCondition = false;
        this.maturityCount = 10;
        this.stores = [];
        this.staffMembers = [];
        this.benefitAmount = 0;
        this.enrollButtonLoader = false;
        this.allSchemes = [];
        this.installmentOptions = [];
    }
    ngOnInit() {
        this.styles = this.data?.styles;
        this.getEnrolledSchemes();
    }
    onSchemeChange(scheme) {
        if (this.enrolledScheme) {
            this.enrolledScheme.selected = false;
        }
        scheme.selected = !scheme?.selected;
        this.minAmount = scheme?.minInstallmentValue ? scheme.minInstallmentValue : this.minAmount;
        this.maxAmount = scheme?.maxInstallmentValue ? scheme.maxInstallmentValue : this.maxAmount;
        this.maturityCount = scheme?.maturityCount ? scheme.maturityCount : this.maturityCount;
        this.monthlyAmount = this.minAmount;
        // this.installmentOptions = scheme?.suggestedValues;
        this.stores = scheme?.storeList ? scheme.storeList : [];
        this.selectedStaff = "";
        this.selectedStore = {};
        // console.log(scheme);
        this.enrolledScheme = scheme;
        this.enrolledScheme?.suggestedValues?.forEach((scheme) => this.installmentOptions.push({ status: false, value: scheme }));
        this.benefitAmount = 0;
        this.getMetalPrice();
        this.onAmountChange();
        this.getStaffList();
    }
    onAmountChange() {
        if (Object.keys(this.enrolledScheme.jewellerBenefit).length > 0) {
            const values = Object.values(this.enrolledScheme.jewellerBenefit);
            const highestValue = Math.max(...Object.values(values));
            if (this.enrolledScheme.benefitType === "PERCENT_ON_MONTH") {
                this.benefitAmount = (this.monthlyAmount * highestValue) / 100;
            }
            else if (this.enrolledScheme.benefitType === "SCHEME") {
                this.benefitAmount = ((this.monthlyAmount * this.maturityCount) * highestValue) / 100;
            }
            else if (this.enrolledScheme.benefitType === "DISCOUNT") {
                this.benefitAmount = ((this.monthlyAmount * this.maturityCount) * highestValue) / 100;
            }
        }
        this.purchasedGram = Number((this.monthlyAmount / this.currentGoldRate).toFixed(2));
    }
    getStaffList() {
        this.restService.getAllStaffList().subscribe({
            next: (res) => {
                this.staffMembers = res?.data?.data ? res?.data?.data : [];
            },
            error: (err) => {
                console.log(err);
            }
        });
    }
    setMonthlyAmount(amount) {
        this.installmentOptions.forEach((option) => {
            if (option.value == amount?.value) {
                option.status = true;
                this.monthlyAmount = amount?.value;
            }
            else {
                option.status = false;
            }
        });
        this.monthlyAmount = amount.value;
        this.onAmountChange();
    }
    get individualContribution() {
        return this.monthlyAmount * 10;
    }
    get orraBonus() {
        return this.monthlyAmount;
    }
    get totalRedemptionValue() {
        return this.monthlyAmount * 11;
    }
    get groupContribution() {
        return this.monthlyAmount * 11;
    }
    get luckyDrawAmount() {
        return this.monthlyAmount * 11;
    }
    get stylesLayout() {
        return { ...this.styles?.layout };
    }
    getButtonId(index) {
        return this.data?.action?.buttons[index]?.id ?? "";
    }
    getButtonStyle(index) {
        return this.data?.action?.buttons[index]?.styles;
    }
    getButtonData(index) {
        return this.data?.action?.buttons[index]?.content;
    }
    redirectTo(scheme) {
        // if (!data?.pageId && data?.redirectionUrl)
        //   return;
        // this._eventService.buttonRedirection.emit({ data: data });
    }
    closeDialog(action) {
        this.dialogRef.close(action);
    }
    enrollScheme(scheme) {
        if (!this.termsAndCondition) {
            this.messageService.add({ severity: 'error', summary: 'Terms & Condition', detail: 'Please accept terms & condition' });
            return;
        }
        this.enrollButtonLoader = true;
        const userDetails = this.storageService.getUser();
        // console.log(userDetails)
        let payload = {
            userBasicDetails: {
                customer_id: userDetails?.userId,
                customer_name: userDetails?.contact?.name,
                customer_phone: userDetails?.contact?.mobile,
                customer_email: userDetails?.contact?.email,
            },
            schemeId: scheme?.id,
            schemeName: scheme?.schemeName,
            earlyRedemptionCharge: scheme?.enrollmentFees,
            installmentAmount: this.monthlyAmount,
            storeRefId: scheme?.schemeRepresentativeId,
            storeId: this.stores.length < 2 ? this.stores[0].id : this.selectedStore?.id,
            staffId: this.staffMembers.length < 2 ? this.staffMembers[0].id : this.selectedStaff?.id,
            staffName: this.staffMembers.length < 2 ? this.staffMembers[0].name : this.selectedStaff?.name,
            storeName: this.stores.length < 2 ? this.stores[0].name : this.selectedStore?.name,
            maturityCount: scheme?.maturityCount,
            jewellerBenefit: scheme?.jewellerBenefit,
            dueMonths: scheme?.maturityCount,
            businessId: scheme?.businessId,
            businessName: scheme?.businessName,
            enableEarlyRedemption: scheme?.enableEarlyRedemption,
            redemptionSlabList: scheme?.redemptionSlabList,
            schemeType: scheme?.schemeType,
            metalType: scheme?.metalType,
            karatType: scheme?.karatType,
            customerAccount: ""
        };
        if (userDetails != null) {
            this.restService.enrollScheme(payload, true).subscribe({
                next: (response) => {
                    this.enrollButtonLoader = false;
                    if (response.data.cashfreeResponse != null) {
                        this.continuePayment(payload);
                    }
                    else {
                        this.storeCharges = response.data.cart;
                        this.dialogRef = this.matDialog.open(this.showChargesTemplate, {
                            panelClass: 'show-charges-class'
                        });
                        this.dialogRef.afterClosed().subscribe((res) => {
                            if (res === 'SUCCESS')
                                this.continuePayment(payload);
                        });
                    }
                },
                error: (err) => {
                    if (err?.error === 'Forbidden' && err?.status === 403) {
                        this.restService.generateToken(localStorage.getItem('businessId'), userDetails.userId).subscribe({
                            next: (res) => {
                                this.enrollButtonLoader = false;
                                this.storageService.setToken(res.data.refreshToken);
                                this.continuePayment(payload);
                            },
                            error: (error) => {
                                this.enrollButtonLoader = false;
                            }
                        });
                    }
                    this.enrollButtonLoader = false;
                }
            });
        }
        else {
            this.router.navigate(['/login']);
        }
    }
    continuePayment(payload) {
        this.restService.enrollScheme(payload, false).subscribe({
            next: (response) => {
                localStorage.setItem('passbookOrderId', response.data.orderId);
                this.openCashfreeSdk(response.data.sessionId);
            },
            error: (error) => { }
        });
    }
    getEnrolledSchemes() {
        const payload = {
            businessIds: [
                localStorage.getItem('businessId')
            ],
            status: true
        };
        this.restService.getAllEnrolledSchemes(payload).subscribe({
            next: (res) => {
                this.allSchemes = res.data?.data;
                this.allSchemes = this.allSchemes.map(item => ({
                    ...item,
                    selected: false
                }));
                this.onSchemeChange(this.allSchemes[0]);
                this.allSchemes[0].selected = true;
                // console.log(this.allSchemes)
            },
            error: (err) => {
                console.log(err);
            }
        });
    }
    openCashfreeSdk(sessionId) {
        this._eventService.cashFreeEvent.emit({ data: { orderSignature: sessionId } });
    }
    getMetalPrice() {
        let storeId = this.stores.length < 2 ? this.stores[0].id : this.selectedStore?.id;
        if (!storeId)
            return;
        this.restService.getMetalPrice(storeId).subscribe((res) => {
            this.metalPrice = res.data;
            for (let gold of this.metalPrice?.priceData ?? []) {
                if (gold.karats === this.enrolledScheme.karatType) {
                    this.currentGoldRate = gold.price;
                    this.purchasedGram = Number((this.monthlyAmount / this.currentGoldRate).toFixed(2));
                    return;
                }
            }
        });
    }
    get isMobile() {
        return window.innerWidth <= 475;
    }
    goToTermsAndCondition() {
        this.router.navigate(['/scheme-detail'], { queryParams: { schemeId: this.enrolledScheme?.id, termsAndCondition: true } });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReturnsCalculatorComponent, deps: [{ token: i1.EventsService }, { token: i2.RestService }, { token: i3.MatDialog }, { token: i4.StorageServiceService }, { token: i5.Router }, { token: i6.MessageService }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: ReturnsCalculatorComponent, isStandalone: true, selector: "simpo-returns-calculator", inputs: { data: "data", edit: "edit", customClass: "customClass", delete: "delete", index: "index" }, providers: [MessageService], viewQueries: [{ propertyName: "showChargesTemplate", first: true, predicate: ["showCharges"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<p-toast position=\"bottom-right\" [baseZIndex]=\"10000000000\" [autoZIndex]=\"true\"\r\n    [showTransformOptions]=\"isMobile ? 'translateY(-100%)' : ''\"></p-toast>\r\n<div class=\"total-container position-relative\" simpoHover (hovering)=\"showEditTabs($event)\" [id]=\"data?.id\">\r\n    <div class=\"main-section\" [id]=\"data?.id\" [simpoBackground]=\"styles?.background\" [spacingHorizontal]=\"stylesLayout\"\r\n        [simpoLayout]=\"stylesLayout\">\r\n        <div class=\"headers w-100\" [simpoAnimation]=\"styles?.animation\" [id]=\"data?.id\">\r\n            <ng-container *ngFor=\"let item of data?.content?.inputText\">\r\n                <simpo-text-editor [(value)]=\"item.value\" [editable]=\"edit || false\" [isRTE]=\"item.isRTE\"></simpo-text-editor>\r\n            </ng-container>\r\n        </div>\r\n        <div class=\"main-container\" [simpoAnimation]=\"styles?.animation\" [id]=\"data?.id\">\r\n            <div class=\"calculator bx-shd w-75 mx-auto my-3\">\r\n                <div class=\"calculator-header text-center mb-4  w-100\">\r\n                    <h3 class=\"mb-0 calculator-title\">Interactive Returns Calculator</h3>\r\n                </div>\r\n                <div class=\"sub-header mb-3 p-3\">\r\n                    <h6 class=\"mb-0 sub-header-text\">Select Your Preferred Scheme</h6>\r\n                </div>\r\n                <div class=\"calculator-body-top d-flex mb-4 px-3\">\r\n                    <ng-container *ngFor=\"let scheme of allSchemes\">\r\n                        <div class=\"form-check scheme-option  p-3 border rounded border-primary ind-border\"\r\n                            (click)=\"onSchemeChange(scheme)\">\r\n                            <input class=\"form-check-input cursor-pointer\" type=\"radio\" name=\"scheme\" id=\"individual\"\r\n                                (change)=\"onSchemeChange(scheme)\" [checked]=\"scheme.selected\">\r\n                            <div class=\"form-check-label ms-2\">\r\n                                <div class=\"d-flex align-items-center mb-2\">\r\n                                    \uD83D\uDC64\r\n                                    <div class=\"scheme-header fw-bold\">{{scheme?.schemeName ? scheme.schemeName :\r\n                                        'N/A'}}</div>\r\n                                </div>\r\n                                <div class=\"scheme-description text-muted small\">Pay 10 months, get 11th month FREE\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </ng-container>\r\n                </div>\r\n                <div class=\"gold-purity\"\r\n                    *ngIf=\"enrolledScheme?.schemeType === 'GOLD_PROTECTION' && (stores.length == 1 || selectedStore?.id)\">\r\n                    <div class=\"purity\" *ngFor=\"let gold of metalPrice?.priceData ?? [0,0,0]\">\r\n                        <img src=\"https://jewellers.stage.passbookapp.in/assets/images/gold-scheme/18k_gold_pic.svg\"\r\n                            alt=\"\" *ngIf=\"gold?.karats === '_18k'\">\r\n                        <img src=\"https://jewellers.stage.passbookapp.in/assets/images/gold-scheme/24k_gold_pic.svg\"\r\n                            alt=\"\" *ngIf=\"gold?.karats === '_24k'\">\r\n                        <img src=\"https://jewellers.stage.passbookapp.in/assets/images/gold-scheme/22k_gold_pic.svg\"\r\n                            alt=\"\" *ngIf=\"gold?.karats === '_22k'\">\r\n                        <div>\r\n                            <div>{{gold?.karats?.replaceAll('_', \"\")}} Gold Purity</div>\r\n                            <div class=\"gold-price\">\u20B9{{gold.price}}</div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"sub-header mb-3 px-3 monthly-scheme\" *ngIf=\"minAmount && maxAmount\">\r\n                    <h6 class=\"mb-0 sub-header-text\">Select Your Monthly Investment Amount</h6>\r\n                    <p class=\"enrolled-gram\"\r\n                        *ngIf=\"enrolledScheme?.schemeType === 'GOLD_PROTECTION' && (stores.length == 1 || selectedStore?.id)\">\r\n                        {{purchasedGram}} gms</p>\r\n                </div>\r\n\r\n                <div class=\"calculate-slider mb-4 px-3\" *ngIf=\"minAmount && maxAmount\">\r\n                    <div class=\"slider-container position-relative\">\r\n                        <mat-slider [min]=\"minAmount\" [max]=\"maxAmount\" [step]=\"enrolledScheme?.valueStep\"\r\n                            class=\"w-100 pale-slider\"\r\n                            [style.--mdc-slider-handle-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mdc-slider-focus-handle-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mdc-slider-hover-handle-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mdc-slider-active-track-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mdc-slider-with-tick-marks-active-container-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mat-slider-ripple-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mat-slider-value-indicator-color]=\"styles?.background?.accentColor\">\r\n                            <input matSliderThumb [(ngModel)]=\"monthlyAmount\" (ngModelChange)=\"onAmountChange()\">\r\n                        </mat-slider>\r\n                        <!-- <input type=\"range\" class=\"form-range custom-range\" [min]=\"minAmount\" [max]=\"maxAmount\"\r\n                            [step]=\"enrolledScheme?.valueStep\" [(ngModel)]=\"monthlyAmount\"\r\n                            (ngModelChange)=\"onAmountChange()\"> -->\r\n                        <div class=\"slider-labels d-flex justify-content-between mt-2\">\r\n                            <span class=\"text-muted\">\u20B9{{minAmount | number}}</span>\r\n                            <span class=\"text-center fw-bold fs-4 monthly-amount\">\u20B9{{monthlyAmount | number}}</span>\r\n                            <span class=\"text-muted\">\u20B9{{maxAmount | number}}</span>\r\n                        </div>\r\n                        <div class=\"text-center text-muted small mt-1\">Monthly Investment</div>\r\n                    </div>\r\n                    <div class=\"random_opitons d-flex justify-content-center gap-3 align-items-center flex-wrap\"\r\n                        *ngIf=\"installmentOptions && installmentOptions.length > 0\">\r\n                        <div class=\"option cursor-pointer\" *ngFor=\"let option of installmentOptions\"\r\n                            [ngStyle]=\"option.status ? {'border': '2px solid grey','font-weight':'bold'} : {}\"\r\n                            (click)=\"setMonthlyAmount(option)\">\r\n                            \u20B9 {{option?.value ? option?.value : 'N/A'}}\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div class=\"calculator-bottom px-3 mb-5\">\r\n                    <div class=\"scheme-results\">\r\n                        <!-- <div class=\"d-flex align-items-center mb-3\">\r\n                            \u2B50 <h6 class=\"mb-0 individual-results-title\">Individual Scheme Results</h6>\r\n                        </div> -->\r\n\r\n                        <div class=\"row mb-3\">\r\n                            <div [class]=\"enrolledScheme?.schemeType === 'GOLD_PROTECTION' ? 'col-6' : 'col-4'\">\r\n                                <div class=\"result-card text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">\u20B9{{(monthlyAmount * maturityCount) |\r\n                                        number}}</div>\r\n                                    <div class=\"result-label text-muted small\">Your {{maturityCount}}-Month Contribution\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-4\" *ngIf=\"enrolledScheme?.schemeType !== 'GOLD_PROTECTION'\">\r\n                                <div class=\"result-card text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">\u20B9{{benefitAmount | number}}</div>\r\n                                    <div class=\"result-label text-muted small\">Scheme Benefit</div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-4\" *ngIf=\"enrolledScheme?.schemeType !== 'GOLD_PROTECTION'\">\r\n                                <div class=\"result-card result-card-highlight text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\"\r\n                                        *ngIf=\"enrolledScheme?.benefitType != 'DISCOUNT'\">\u20B9{{((monthlyAmount *\r\n                                        maturityCount)+benefitAmount) | number}}</div>\r\n                                    <div class=\"result-amount fw-bold fs-5\"\r\n                                        *ngIf=\"enrolledScheme?.benefitType === 'DISCOUNT'\">\u20B9{{((monthlyAmount *\r\n                                        maturityCount)) | number}}</div>\r\n                                    <div class=\"result-label small opacity-75\">Total Redemption Value</div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-6\" *ngIf=\"enrolledScheme?.schemeType === 'GOLD_PROTECTION'\">\r\n                                <div class=\"result-card text-center p-3 border rounded result-card-highlight\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">{{purchasedGram}} gms</div>\r\n                                    <div class=\"result-label  small color-white\">Gold Allocation Today\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n\r\n                        <div class=\"bonus-message text-center mb-3 d-flex justify-content-between align-items-center\"\r\n                            *ngIf=\"enrolledScheme && (stores.length >= 2 || staffMembers.length >= 2) \">\r\n                            <div class=\"store_selection  w-50 align-items-center gap-1\" *ngIf=\"stores.length >= 2\">\r\n                                <div class=\"w-100 h-100 d-flex justify-content-start align-items-center\"> <span>Select\r\n                                        Store : </span></div>\r\n                                <div class=\"store-selector\">\r\n                                    <select id=\"storeDropdown\" [(ngModel)]=\"selectedStore\" class=\"form-select\"\r\n                                        (ngModelChange)=\"getMetalPrice()\">\r\n                                        <option [ngValue]=\"null\" disabled>Choose a store...</option>\r\n                                        <option *ngFor=\"let store of stores;\" [ngValue]=\"store\">\r\n                                            {{store.name}} - {{store.storeRefId}}\r\n                                        </option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"staff-selector w-50  align-items-center gap-1\" *ngIf=\"staffMembers.length >= 2\">\r\n                                <div class=\"w-100 h-100 d-flex justify-content-start align-items-center\"><span>Select\r\n                                        Staff Member : </span></div>\r\n                                <select id=\"staffDropdown\" [(ngModel)]=\"selectedStaff\" class=\"form-select\">\r\n                                    <option value=\"\" disabled>Choose a staff member...</option>\r\n                                    <option *ngFor=\"let staff of staffMembers;\" [ngValue]=\"staff\">\r\n                                        {{staff.name}} - {{staff.role ? staff.role : 'staff' }}\r\n                                    </option>\r\n                                </select>\r\n                            </div>\r\n                        </div>\r\n\r\n                        <div class=\"terms-and-condition\" *ngIf=\"enrolledScheme\">\r\n                            <input type=\"checkbox\" [(ngModel)]=\"termsAndCondition\">I agree to <a\r\n                                (click)=\"goToTermsAndCondition()\">Terms & Conditions</a>\r\n                        </div>\r\n                        <button class=\"enroll-btn w-100 py-3 fw-bold mb-2\" [appButtonEditor]=\"edit ?? false\"\r\n                            simpoButtonDirective [buttonStyle]=\"getButtonStyle(0)\" [buttonId]=\"getButtonId(0)\"\r\n                            [sectionId]=\"data?.id\" [id]=\"data?.id+getButtonId(0)\" [buttonData]=\"getButtonData(0)\"\r\n                            (click)=\"enrollScheme(enrolledScheme)\"\r\n                            [style.borderColor]=\"styles?.background?.accentColor\">\r\n                            <span *ngIf=\"!enrollButtonLoader\">Enroll in Scheme</span>\r\n                            <ng-container *ngIf=\"enrollButtonLoader\">\r\n                                <div class=\"d-flex align-items-center justify-content-center\">\r\n                                    <div class=\"spinner\"><mat-spinner class=\"w-100 h-100\"></mat-spinner></div>\r\n                                    Loading...\r\n                                </div>\r\n                            </ng-container>\r\n                        </button>\r\n                    </div>\r\n                    <!-- <div *ngIf=\"selectedScheme === 'group'\" class=\"scheme-results\">\r\n                        <div class=\"d-flex align-items-center mb-3\">\r\n                            \u2B50 <h6 class=\"mb-0 group-results-title\">Group Scheme Results</h6>\r\n                        </div>\r\n\r\n                        <div class=\"row mb-3\">\r\n                            <div class=\"col-6\">\r\n                                <div class=\"result-card text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">\u20B9{{(monthlyAmount * 11) | number}}</div>\r\n                                    <div class=\"result-label text-muted small\">Your Total 11-Month Contribution</div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-6\">\r\n                                <div class=\"result-card result-card-group text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">\u20B9{{(monthlyAmount * 11) | number}}</div>\r\n                                    <div class=\"result-label small opacity-75\">Monthly Lucky Draw Amount</div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n\r\n                        <button class=\"enroll-btn w-100 py-3 fw-bold mb-2\" [appButtonEditor]=\"edit ?? false\"\r\n                            simpoButtonDirective [buttonStyle]=\"getButtonStyle(0)\" [buttonId]=\"getButtonId(0)\"\r\n                            [sectionId]=\"data?.id\" [id]=\"data?.id+getButtonId(0)\" [buttonData]=\"getButtonData(0)\">\r\n                            Enroll in Scheme\r\n                        </button>\r\n                    </div> -->\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <ng-template #showCharges>\r\n        <div class=\"payment-dialog\">\r\n            <div class=\"dialog-header\">\r\n                <h2>Payment Details</h2>\r\n                <button class=\"close-btn\" mat-icon-button (click)=\"closeDialog('FAIL')\">\r\n                    <mat-icon>close</mat-icon>\r\n                </button>\r\n            </div>\r\n\r\n            <div class=\"payment-content\">\r\n                <div class=\"payment-row\">\r\n                    <span class=\"label\">Installment Amount:</span>\r\n                    <span class=\"amount\">\u20B9{{storeCharges?.breakdown?.installmentAmount ?\r\n                        (storeCharges?.breakdown?.installmentAmount | number) : 0 }}</span>\r\n                </div>\r\n\r\n                <div class=\"payment-row\">\r\n                    <span class=\"label\">Convenience Fee:</span>\r\n                    <span class=\"amount\">\u20B9{{storeCharges?.breakdown?.convenienceFee?.value ?\r\n                        (storeCharges?.breakdown?.convenienceFee?.value | number) : 0 }}</span>\r\n                </div>\r\n\r\n                <div class=\"payment-row\">\r\n                    <span class=\"label\">Payment Service Charges:</span>\r\n                    <span class=\"amount\">\u20B9{{storeCharges?.breakdown?.paymentServiceCharges?.value ?\r\n                        (storeCharges?.breakdown?.paymentServiceCharges?.value | number) : 0 }}</span>\r\n                </div>\r\n\r\n                <div class=\"payment-row total-row\">\r\n                    <span class=\"label total-label\">Total Amount:</span>\r\n                    <span class=\"amount total-amount\">\u20B9{{storeCharges?.breakdown?.totalAmount ?\r\n                        (storeCharges?.breakdown?.totalAmount | number) : 0 }}</span>\r\n                </div>\r\n            </div>\r\n\r\n            <div class=\"dialog-actions\">\r\n                <button class=\"continue-btn\" (click)=\"closeDialog('SUCCESS')\">Continue</button>\r\n            </div>\r\n        </div>\r\n    </ng-template>\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</div>", styles: [".hover_effect{position:unset;width:100%;top:0;left:0;height:100%}.bx-shd{box-shadow:#ffffff1a 0 1px 1px inset,#32325d40 0 50px 100px -20px,#0000004d 0 30px 60px -30px}*{font-family:var(--website-font-family)}mat-icon{font-family:Material Icons!important}.calculator{border-radius:12px;box-shadow:0 4px 6px #0000001a}.calculator-header{background:linear-gradient(145deg,#f2e8cb,#d1c29e);color:#fff;padding:15px;border-radius:8px 8px 0 0}.calculator-title{color:#000;font-weight:600}.sub-header-text{color:#666;font-weight:500}.w-48{width:48%!important}.payment-dialog{background:#fff;border-radius:12px;padding:0;max-width:400px;width:25vw;box-shadow:0 8px 32px #0000001a}.dialog-header{display:flex;justify-content:space-between;align-items:center;padding:20px 24px 16px;border-bottom:1px solid #f0f0f0}.dialog-header h2{margin:0;font-size:20px;font-weight:500;color:#333;white-space:nowrap}.close-btn{background:none;border:none;padding:4px;cursor:pointer;color:#666;display:flex;align-items:center;width:fit-content!important;justify-content:center}.close-btn:hover{background-color:#f5f5f5;border-radius:50%}.payment-content{padding:24px}.payment-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.random_opitons{padding:1%}.option{padding:1% 2%;border:1px solid lightgrey;border-radius:50px}.payment-row:last-child{margin-bottom:0}.label{color:#666;font-size:14px;font-weight:400}.amount{color:#333;font-size:14px;font-weight:500}.total-row{border-top:1px solid #f0f0f0;padding-top:16px;margin-top:8px}.total-label,.total-amount{color:#333;font-weight:600;font-size:16px}.dialog-actions{padding:0 24px 24px}.continue-btn{width:100%;background-color:#dc3545;color:#fff;border:none;border-radius:8px;padding:12px 24px;font-size:16px;font-weight:500;cursor:pointer;transition:background-color .2s ease}.continue-btn:hover{background-color:#c82333}.continue-btn:active{background-color:#bd2130}.mat-dialog-container{padding:0!important;border-radius:12px!important}.scheme-option{cursor:pointer;transition:all .3s ease;min-width:22vw}.form-check-input:checked{background-color:#d63384;border-color:#d63384}.form-check-input:focus{box-shadow:0 0 0 .25rem #d6338440}.scheme-header{font-size:16px;margin-bottom:5px;color:#333}.scheme-description{font-size:13px;line-height:1.4}.custom-range{height:8px;border-radius:5px;outline:none}.custom-range::-webkit-slider-thumb{appearance:none;width:24px;height:24px;background:#d63384;border-radius:50%;cursor:pointer;box-shadow:0 2px 6px #0003}.custom-range::-moz-range-thumb{width:24px;height:24px;background:#d63384;border-radius:50%;cursor:pointer;border:none;box-shadow:0 2px 6px #0003}.slider-container{padding:0 12px}.slider-labels{margin-top:10px;font-size:14px}.monthly-amount{color:#d4a574}.result-card{background:#fff;transition:all .3s ease;border:1px solid #e9ecef!important}.result-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px #0000001a}.result-card-highlight{background:#d4a574;color:#fff}.result-card-group{background:#d63384;color:#fff}.ind-border{border:2px solid rgb(201,176,130)!important}.grp-border{border:2px solid rgb(214,51,132)!important}.result-amount{color:#333;font-size:18px;margin-bottom:8px}.result-card-highlight .result-amount,.result-card-group .result-amount{color:#fff}.result-label{font-size:12px;font-weight:500}.bonus-message{border:1px solid #ffeaa7;border-radius:8px;padding:12px;margin:15px 0;gap:25px}.spinner{width:30px;height:30px}.store_selection span{color:#d4a574;font-weight:700}.store-selector{width:100%;margin:5px 0}.store-selector label{display:block;font-weight:600;margin-bottom:8px}.store-selector .form-select{width:100%;padding:10px 12px;border:2px solid #ddd;border-radius:6px;font-size:14px;background-color:#fff;cursor:pointer;transition:border-color .3s ease;min-width:315px}.store-selector .form-select:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 3px #007bff1a}.store-selector .form-select:hover{border-color:#bbb}.store-selector .selected-info{padding:10px;background-color:#f8f9fa;border-radius:4px;border-left:4px solid #007bff}.store-selector .selected-info p{margin:0;font-size:14px;color:#495057}.staff-selector label{display:block;color:#333;white-space:nowrap}.staff-selector span{color:#d4a574;font-weight:700}.staff-selector .form-select{margin:5px 0;width:100%;padding:10px 12px;border:2px solid #ddd;border-radius:6px;font-size:14px;background-color:#fff;cursor:pointer;transition:border-color .3s ease}.staff-selector .form-select:focus{outline:none;border-color:#28a745;box-shadow:0 0 0 3px #28a7451a}.staff-selector .form-select:hover{border-color:#bbb}.staff-selector .selected-info{padding:10px;background-color:#f8f9fa;border-radius:4px;border-left:4px solid #28a745}.staff-selector .selected-info p{margin:0;font-size:14px;color:#495057}.bonus-text{color:#d4a574;font-weight:500}.scheme-results{background:#fff;border-radius:8px;padding:20px}.individual-results-title{color:#d4a574;font-weight:600}.group-results-title{color:#d63384;font-weight:600}.enroll-btn{font-size:16px;border:1px solid}.calculator-body-top{overflow-y:scroll;gap:2rem}@media (max-width: 768px){.calculator{width:95%!important}.scheme-results .row{flex-direction:column}.scheme-results :is(.col-4,.col-6){width:100%!important}.calculator-body-top{flex-direction:column!important}.w-48{width:100%!important;margin-bottom:15px}.row .col-4,.row .col-6,.scheme-option{margin-bottom:15px}}@media (max-width:475px){.gold-purity{flex-wrap:wrap;gap:.5rem!important;padding:.5rem}.enrolled-gram{font-size:1rem;white-space:nowrap}.bonus-message{flex-direction:column}.staff-selector,.store_selection{width:100%!important}.scheme-results{padding:20px 0}}.gold-purity{padding-left:1rem;padding-bottom:15px;display:flex;gap:15px}.gold-purity .purity{display:flex;gap:10px;background:#fff7d0;width:max-content;padding:5px 8px;border-radius:11px;align-items:center}.gold-purity .purity img{height:40px}.gold-purity .purity div{font-size:12px}.gold-purity .purity .gold-price{font-weight:700}.enrolled-gram{margin-bottom:0;font-size:17px;font-weight:600}.monthly-scheme{display:flex;justify-content:space-between}.color-white{color:#fff}.terms-and-condition{display:flex;align-items:center;gap:10px;margin-bottom:10px}.terms-and-condition input{cursor:pointer}a{color:#0d6efd!important;text-decoration:underline!important;cursor:pointer}a:hover{color:#0a58ca!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i7.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i7.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i7.DecimalPipe, name: "number" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i8.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i8.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i8.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i8.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: SimpoComponentModule }, { kind: "component", type: i9.HoverElementsComponent, selector: "simpo-hover-elements", inputs: ["data", "index", "editOptions", "isMerged", "isEcommerce"], outputs: ["edit"] }, { kind: "component", type: i10.DeleteHoverElementComponent, selector: "simpo-delete-hover-element", inputs: ["index", "data"], outputs: ["edit"] }, { kind: "directive", type: AnimationDirective, selector: "[simpoAnimation]", inputs: ["simpoAnimation"] }, { kind: "directive", type: BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: ButtonDirectiveDirective, selector: "[simpoButtonDirective]", inputs: ["buttonStyle", "color", "scrollValue", "backgroundInfo"] }, { kind: "directive", type: ContentFitDirective, selector: "[simpoLayout]", inputs: ["simpoLayout"] }, { 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: ButtonEditorDirective, selector: "button[appButtonEditor]", inputs: ["appButtonEditor", "buttonData", "buttonStyle", "backgroundInfo", "sectionId", "buttonId", "itemIndex"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: ToastModule }, { kind: "component", type: i11.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "ngmodule", type: MatSliderModule }, { kind: "directive", type: i12.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ReturnsCalculatorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-returns-calculator', standalone: true, imports: [
                        CommonModule,
                        FormsModule,
                        ReactiveFormsModule,
                        MatIcon,
                        SimpoComponentModule,
                        AnimationDirective,
                        BackgroundDirective,
                        CornerDirective,
                        HoverDirective,
                        ButtonDirectiveDirective,
                        ContentFitDirective,
                        SpacingHorizontalDirective,
                        TextEditorComponent,
                        ButtonEditorDirective,
                        MatProgressSpinner,
                        ToastModule,
                        MatSlider,
                        MatSliderModule
                    ], providers: [MessageService], template: "<p-toast position=\"bottom-right\" [baseZIndex]=\"10000000000\" [autoZIndex]=\"true\"\r\n    [showTransformOptions]=\"isMobile ? 'translateY(-100%)' : ''\"></p-toast>\r\n<div class=\"total-container position-relative\" simpoHover (hovering)=\"showEditTabs($event)\" [id]=\"data?.id\">\r\n    <div class=\"main-section\" [id]=\"data?.id\" [simpoBackground]=\"styles?.background\" [spacingHorizontal]=\"stylesLayout\"\r\n        [simpoLayout]=\"stylesLayout\">\r\n        <div class=\"headers w-100\" [simpoAnimation]=\"styles?.animation\" [id]=\"data?.id\">\r\n            <ng-container *ngFor=\"let item of data?.content?.inputText\">\r\n                <simpo-text-editor [(value)]=\"item.value\" [editable]=\"edit || false\" [isRTE]=\"item.isRTE\"></simpo-text-editor>\r\n            </ng-container>\r\n        </div>\r\n        <div class=\"main-container\" [simpoAnimation]=\"styles?.animation\" [id]=\"data?.id\">\r\n            <div class=\"calculator bx-shd w-75 mx-auto my-3\">\r\n                <div class=\"calculator-header text-center mb-4  w-100\">\r\n                    <h3 class=\"mb-0 calculator-title\">Interactive Returns Calculator</h3>\r\n                </div>\r\n                <div class=\"sub-header mb-3 p-3\">\r\n                    <h6 class=\"mb-0 sub-header-text\">Select Your Preferred Scheme</h6>\r\n                </div>\r\n                <div class=\"calculator-body-top d-flex mb-4 px-3\">\r\n                    <ng-container *ngFor=\"let scheme of allSchemes\">\r\n                        <div class=\"form-check scheme-option  p-3 border rounded border-primary ind-border\"\r\n                            (click)=\"onSchemeChange(scheme)\">\r\n                            <input class=\"form-check-input cursor-pointer\" type=\"radio\" name=\"scheme\" id=\"individual\"\r\n                                (change)=\"onSchemeChange(scheme)\" [checked]=\"scheme.selected\">\r\n                            <div class=\"form-check-label ms-2\">\r\n                                <div class=\"d-flex align-items-center mb-2\">\r\n                                    \uD83D\uDC64\r\n                                    <div class=\"scheme-header fw-bold\">{{scheme?.schemeName ? scheme.schemeName :\r\n                                        'N/A'}}</div>\r\n                                </div>\r\n                                <div class=\"scheme-description text-muted small\">Pay 10 months, get 11th month FREE\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </ng-container>\r\n                </div>\r\n                <div class=\"gold-purity\"\r\n                    *ngIf=\"enrolledScheme?.schemeType === 'GOLD_PROTECTION' && (stores.length == 1 || selectedStore?.id)\">\r\n                    <div class=\"purity\" *ngFor=\"let gold of metalPrice?.priceData ?? [0,0,0]\">\r\n                        <img src=\"https://jewellers.stage.passbookapp.in/assets/images/gold-scheme/18k_gold_pic.svg\"\r\n                            alt=\"\" *ngIf=\"gold?.karats === '_18k'\">\r\n                        <img src=\"https://jewellers.stage.passbookapp.in/assets/images/gold-scheme/24k_gold_pic.svg\"\r\n                            alt=\"\" *ngIf=\"gold?.karats === '_24k'\">\r\n                        <img src=\"https://jewellers.stage.passbookapp.in/assets/images/gold-scheme/22k_gold_pic.svg\"\r\n                            alt=\"\" *ngIf=\"gold?.karats === '_22k'\">\r\n                        <div>\r\n                            <div>{{gold?.karats?.replaceAll('_', \"\")}} Gold Purity</div>\r\n                            <div class=\"gold-price\">\u20B9{{gold.price}}</div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"sub-header mb-3 px-3 monthly-scheme\" *ngIf=\"minAmount && maxAmount\">\r\n                    <h6 class=\"mb-0 sub-header-text\">Select Your Monthly Investment Amount</h6>\r\n                    <p class=\"enrolled-gram\"\r\n                        *ngIf=\"enrolledScheme?.schemeType === 'GOLD_PROTECTION' && (stores.length == 1 || selectedStore?.id)\">\r\n                        {{purchasedGram}} gms</p>\r\n                </div>\r\n\r\n                <div class=\"calculate-slider mb-4 px-3\" *ngIf=\"minAmount && maxAmount\">\r\n                    <div class=\"slider-container position-relative\">\r\n                        <mat-slider [min]=\"minAmount\" [max]=\"maxAmount\" [step]=\"enrolledScheme?.valueStep\"\r\n                            class=\"w-100 pale-slider\"\r\n                            [style.--mdc-slider-handle-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mdc-slider-focus-handle-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mdc-slider-hover-handle-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mdc-slider-active-track-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mdc-slider-with-tick-marks-active-container-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mat-slider-ripple-color]=\"styles?.background?.accentColor\"\r\n                            [style.--mat-slider-value-indicator-color]=\"styles?.background?.accentColor\">\r\n                            <input matSliderThumb [(ngModel)]=\"monthlyAmount\" (ngModelChange)=\"onAmountChange()\">\r\n                        </mat-slider>\r\n                        <!-- <input type=\"range\" class=\"form-range custom-range\" [min]=\"minAmount\" [max]=\"maxAmount\"\r\n                            [step]=\"enrolledScheme?.valueStep\" [(ngModel)]=\"monthlyAmount\"\r\n                            (ngModelChange)=\"onAmountChange()\"> -->\r\n                        <div class=\"slider-labels d-flex justify-content-between mt-2\">\r\n                            <span class=\"text-muted\">\u20B9{{minAmount | number}}</span>\r\n                            <span class=\"text-center fw-bold fs-4 monthly-amount\">\u20B9{{monthlyAmount | number}}</span>\r\n                            <span class=\"text-muted\">\u20B9{{maxAmount | number}}</span>\r\n                        </div>\r\n                        <div class=\"text-center text-muted small mt-1\">Monthly Investment</div>\r\n                    </div>\r\n                    <div class=\"random_opitons d-flex justify-content-center gap-3 align-items-center flex-wrap\"\r\n                        *ngIf=\"installmentOptions && installmentOptions.length > 0\">\r\n                        <div class=\"option cursor-pointer\" *ngFor=\"let option of installmentOptions\"\r\n                            [ngStyle]=\"option.status ? {'border': '2px solid grey','font-weight':'bold'} : {}\"\r\n                            (click)=\"setMonthlyAmount(option)\">\r\n                            \u20B9 {{option?.value ? option?.value : 'N/A'}}\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n\r\n                <div class=\"calculator-bottom px-3 mb-5\">\r\n                    <div class=\"scheme-results\">\r\n                        <!-- <div class=\"d-flex align-items-center mb-3\">\r\n                            \u2B50 <h6 class=\"mb-0 individual-results-title\">Individual Scheme Results</h6>\r\n                        </div> -->\r\n\r\n                        <div class=\"row mb-3\">\r\n                            <div [class]=\"enrolledScheme?.schemeType === 'GOLD_PROTECTION' ? 'col-6' : 'col-4'\">\r\n                                <div class=\"result-card text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">\u20B9{{(monthlyAmount * maturityCount) |\r\n                                        number}}</div>\r\n                                    <div class=\"result-label text-muted small\">Your {{maturityCount}}-Month Contribution\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-4\" *ngIf=\"enrolledScheme?.schemeType !== 'GOLD_PROTECTION'\">\r\n                                <div class=\"result-card text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">\u20B9{{benefitAmount | number}}</div>\r\n                                    <div class=\"result-label text-muted small\">Scheme Benefit</div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-4\" *ngIf=\"enrolledScheme?.schemeType !== 'GOLD_PROTECTION'\">\r\n                                <div class=\"result-card result-card-highlight text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\"\r\n                                        *ngIf=\"enrolledScheme?.benefitType != 'DISCOUNT'\">\u20B9{{((monthlyAmount *\r\n                                        maturityCount)+benefitAmount) | number}}</div>\r\n                                    <div class=\"result-amount fw-bold fs-5\"\r\n                                        *ngIf=\"enrolledScheme?.benefitType === 'DISCOUNT'\">\u20B9{{((monthlyAmount *\r\n                                        maturityCount)) | number}}</div>\r\n                                    <div class=\"result-label small opacity-75\">Total Redemption Value</div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-6\" *ngIf=\"enrolledScheme?.schemeType === 'GOLD_PROTECTION'\">\r\n                                <div class=\"result-card text-center p-3 border rounded result-card-highlight\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">{{purchasedGram}} gms</div>\r\n                                    <div class=\"result-label  small color-white\">Gold Allocation Today\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n\r\n                        <div class=\"bonus-message text-center mb-3 d-flex justify-content-between align-items-center\"\r\n                            *ngIf=\"enrolledScheme && (stores.length >= 2 || staffMembers.length >= 2) \">\r\n                            <div class=\"store_selection  w-50 align-items-center gap-1\" *ngIf=\"stores.length >= 2\">\r\n                                <div class=\"w-100 h-100 d-flex justify-content-start align-items-center\"> <span>Select\r\n                                        Store : </span></div>\r\n                                <div class=\"store-selector\">\r\n                                    <select id=\"storeDropdown\" [(ngModel)]=\"selectedStore\" class=\"form-select\"\r\n                                        (ngModelChange)=\"getMetalPrice()\">\r\n                                        <option [ngValue]=\"null\" disabled>Choose a store...</option>\r\n                                        <option *ngFor=\"let store of stores;\" [ngValue]=\"store\">\r\n                                            {{store.name}} - {{store.storeRefId}}\r\n                                        </option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"staff-selector w-50  align-items-center gap-1\" *ngIf=\"staffMembers.length >= 2\">\r\n                                <div class=\"w-100 h-100 d-flex justify-content-start align-items-center\"><span>Select\r\n                                        Staff Member : </span></div>\r\n                                <select id=\"staffDropdown\" [(ngModel)]=\"selectedStaff\" class=\"form-select\">\r\n                                    <option value=\"\" disabled>Choose a staff member...</option>\r\n                                    <option *ngFor=\"let staff of staffMembers;\" [ngValue]=\"staff\">\r\n                                        {{staff.name}} - {{staff.role ? staff.role : 'staff' }}\r\n                                    </option>\r\n                                </select>\r\n                            </div>\r\n                        </div>\r\n\r\n                        <div class=\"terms-and-condition\" *ngIf=\"enrolledScheme\">\r\n                            <input type=\"checkbox\" [(ngModel)]=\"termsAndCondition\">I agree to <a\r\n                                (click)=\"goToTermsAndCondition()\">Terms & Conditions</a>\r\n                        </div>\r\n                        <button class=\"enroll-btn w-100 py-3 fw-bold mb-2\" [appButtonEditor]=\"edit ?? false\"\r\n                            simpoButtonDirective [buttonStyle]=\"getButtonStyle(0)\" [buttonId]=\"getButtonId(0)\"\r\n                            [sectionId]=\"data?.id\" [id]=\"data?.id+getButtonId(0)\" [buttonData]=\"getButtonData(0)\"\r\n                            (click)=\"enrollScheme(enrolledScheme)\"\r\n                            [style.borderColor]=\"styles?.background?.accentColor\">\r\n                            <span *ngIf=\"!enrollButtonLoader\">Enroll in Scheme</span>\r\n                            <ng-container *ngIf=\"enrollButtonLoader\">\r\n                                <div class=\"d-flex align-items-center justify-content-center\">\r\n                                    <div class=\"spinner\"><mat-spinner class=\"w-100 h-100\"></mat-spinner></div>\r\n                                    Loading...\r\n                                </div>\r\n                            </ng-container>\r\n                        </button>\r\n                    </div>\r\n                    <!-- <div *ngIf=\"selectedScheme === 'group'\" class=\"scheme-results\">\r\n                        <div class=\"d-flex align-items-center mb-3\">\r\n                            \u2B50 <h6 class=\"mb-0 group-results-title\">Group Scheme Results</h6>\r\n                        </div>\r\n\r\n                        <div class=\"row mb-3\">\r\n                            <div class=\"col-6\">\r\n                                <div class=\"result-card text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">\u20B9{{(monthlyAmount * 11) | number}}</div>\r\n                                    <div class=\"result-label text-muted small\">Your Total 11-Month Contribution</div>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-6\">\r\n                                <div class=\"result-card result-card-group text-center p-3 border rounded\">\r\n                                    <div class=\"result-amount fw-bold fs-5\">\u20B9{{(monthlyAmount * 11) | number}}</div>\r\n                                    <div class=\"result-label small opacity-75\">Monthly Lucky Draw Amount</div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n\r\n                        <button class=\"enroll-btn w-100 py-3 fw-bold mb-2\" [appButtonEditor]=\"edit ?? false\"\r\n                            simpoButtonDirective [buttonStyle]=\"getButtonStyle(0)\" [buttonId]=\"getButtonId(0)\"\r\n                            [sectionId]=\"data?.id\" [id]=\"data?.id+getButtonId(0)\" [buttonData]=\"getButtonData(0)\">\r\n                            Enroll in Scheme\r\n                        </button>\r\n                    </div> -->\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <ng-template #showCharges>\r\n        <div class=\"payment-dialog\">\r\n            <div class=\"dialog-header\">\r\n                <h2>Payment Details</h2>\r\n                <button class=\"close-btn\" mat-icon-button (click)=\"closeDialog('FAIL')\">\r\n                    <mat-icon>close</mat-icon>\r\n                </button>\r\n            </div>\r\n\r\n            <div class=\"payment-content\">\r\n                <div class=\"payment-row\">\r\n                    <span class=\"label\">Installment Amount:</span>\r\n                    <span class=\"amount\">\u20B9{{storeCharges?.breakdown?.installmentAmount ?\r\n                        (storeCharges?.breakdown?.installmentAmount | number) : 0 }}</span>\r\n                </div>\r\n\r\n                <div class=\"payment-row\">\r\n                    <span class=\"label\">Convenience Fee:</span>\r\n                    <span class=\"amount\">\u20B9{{storeCharges?.breakdown?.convenienceFee?.value ?\r\n                        (storeCharges?.breakdown?.convenienceFee?.value | number) : 0 }}</span>\r\n                </div>\r\n\r\n                <div class=\"payment-row\">\r\n                    <span class=\"label\">Payment Service Charges:</span>\r\n                    <span class=\"amount\">\u20B9{{storeCharges?.breakdown?.paymentServiceCharges?.value ?\r\n                        (storeCharges?.breakdown?.paymentServiceCharges?.value | number) : 0 }}</span>\r\n                </div>\r\n\r\n                <div class=\"payment-row total-row\">\r\n                    <span class=\"label total-label\">Total Amount:</span>\r\n                    <span class=\"amount total-amount\">\u20B9{{storeCharges?.breakdown?.totalAmount ?\r\n                        (storeCharges?.breakdown?.totalAmount | number) : 0 }}</span>\r\n                </div>\r\n            </div>\r\n\r\n            <div class=\"dialog-actions\">\r\n                <button class=\"continue-btn\" (click)=\"closeDialog('SUCCESS')\">Continue</button>\r\n            </div>\r\n        </div>\r\n    </ng-template>\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</div>", styles: [".hover_effect{position:unset;width:100%;top:0;left:0;height:100%}.bx-shd{box-shadow:#ffffff1a 0 1px 1px inset,#32325d40 0 50px 100px -20px,#0000004d 0 30px 60px -30px}*{font-family:var(--website-font-family)}mat-icon{font-family:Material Icons!important}.calculator{border-radius:12px;box-shadow:0 4px 6px #0000001a}.calculator-header{background:linear-gradient(145deg,#f2e8cb,#d1c29e);color:#fff;padding:15px;border-radius:8px 8px 0 0}.calculator-title{color:#000;font-weight:600}.sub-header-text{color:#666;font-weight:500}.w-48{width:48%!important}.payment-dialog{background:#fff;border-radius:12px;padding:0;max-width:400px;width:25vw;box-shadow:0 8px 32px #0000001a}.dialog-header{display:flex;justify-content:space-between;align-items:center;padding:20px 24px 16px;border-bottom:1px solid #f0f0f0}.dialog-header h2{margin:0;font-size:20px;font-weight:500;color:#333;white-space:nowrap}.close-btn{background:none;border:none;padding:4px;cursor:pointer;color:#666;display:flex;align-items:center;width:fit-content!important;justify-content:center}.close-btn:hover{background-color:#f5f5f5;border-radius:50%}.payment-content{padding:24px}.payment-row{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.random_opitons{padding:1%}.option{padding:1% 2%;border:1px solid lightgrey;border-radius:50px}.payment-row:last-child{margin-bottom:0}.label{color:#666;font-size:14px;font-weight:400}.amount{color:#333;font-size:14px;font-weight:500}.total-row{border-top:1px solid #f0f0f0;padding-top:16px;margin-top:8px}.total-label,.total-amount{color:#333;font-weight:600;font-size:16px}.dialog-actions{padding:0 24px 24px}.continue-btn{width:100%;background-color:#dc3545;color:#fff;border:none;border-radius:8px;padding:12px 24px;font-size:16px;font-weight:500;cursor:pointer;transition:background-color .2s ease}.continue-btn:hover{background-color:#c82333}.continue-btn:active{background-color:#bd2130}.mat-dialog-container{padding:0!important;border-radius:12px!important}.scheme-option{cursor:pointer;transition:all .3s ease;min-width:22vw}.form-check-input:checked{background-color:#d63384;border-color:#d63384}.form-check-input:focus{box-shadow:0 0 0 .25rem #d6338440}.scheme-header{font-size:16px;margin-bottom:5px;color:#333}.scheme-description{font-size:13px;line-height:1.4}.custom-range{height:8px;border-radius:5px;outline:none}.custom-range::-webkit-slider-thumb{appearance:none;width:24px;height:24px;background:#d63384;border-radius:50%;cursor:pointer;box-shadow:0 2px 6px #0003}.custom-range::-moz-range-thumb{width:24px;height:24px;background:#d63384;border-radius:50%;cursor:pointer;border:none;box-shadow:0 2px 6px #0003}.slider-container{padding:0 12px}.slider-labels{margin-top:10px;font-size:14px}.monthly-amount{color:#d4a574}.result-card{background:#fff;transition:all .3s ease;border:1px solid #e9ecef!important}.result-card:hover{transform:translateY(-2px);box-shadow:0 4px 12px #0000001a}.result-card-highlight{background:#d4a574;color:#fff}.result-card-group{background:#d63384;color:#fff}.ind-border{border:2px solid rgb(201,176,130)!important}.grp-border{border:2px solid rgb(214,51,132)!important}.result-amount{color:#333;font-size:18px;margin-bottom:8px}.result-card-highlight .result-amount,.result-card-group .result-amount{color:#fff}.result-label{font-size:12px;font-weight:500}.bonus-message{border:1px solid #ffeaa7;border-radius:8px;padding:12px;margin:15px 0;gap:25px}.spinner{width:30px;height:30px}.store_selection span{color:#d4a574;font-weight:700}.store-selector{width:100%;margin:5px 0}.store-selector label{display:block;font-weight:600;margin-bottom:8px}.store-selector .form-select{width:100%;padding:10px 12px;border:2px solid #ddd;border-radius:6px;font-size:14px;background-color:#fff;cursor:pointer;transition:border-color .3s ease;min-width:315px}.store-selector .form-select:focus{outline:none;border-color:#007bff;box-shadow:0 0 0 3px #007bff1a}.store-selector .form-select:hover{border-color:#bbb}.store-selector .selected-info{padding:10px;background-color:#f8f9fa;border-radius:4px;border-left:4px solid #007bff}.store-selector .selected-info p{margin:0;font-size:14px;color:#495057}.staff-selector label{display:block;color:#333;white-space:nowrap}.staff-selector span{color:#d4a574;font-weight:700}.staff-selector .form-select{margin:5px 0;width:100%;padding:10px 12px;border:2px solid #ddd;border-radius:6px;font-size:14px;background-color:#fff;cursor:pointer;transition:border-color .3s ease}.staff-selector .form-select:focus{outline:none;border-color:#28a745;box-shadow:0 0 0 3px #28a7451a}.staff-selector .form-select:hover{border-color:#bbb}.staff-selector .selected-info{padding:10px;background-color:#f8f9fa;border-radius:4px;border-left:4px solid #28a745}.staff-selector .selected-info p{margin:0;font-size:14px;color:#495057}.bonus-text{color:#d4a574;font-weight:500}.scheme-results{background:#fff;border-radius:8px;padding:20px}.individual-results-title{color:#d4a574;font-weight:600}.group-results-title{color:#d63384;font-weight:600}.enroll-btn{font-size:16px;border:1px solid}.calculator-body-top{overflow-y:scroll;gap:2rem}@media (max-width: 768px){.calculator{width:95%!important}.scheme-results .row{flex-direction:column}.scheme-results :is(.col-4,.col-6){width:100%!important}.calculator-body-top{flex-direction:column!important}.w-48{width:100%!important;margin-bottom:15px}.row .col-4,.row .col-6,.scheme-option{margin-bottom:15px}}@media (max-width:475px){.gold-purity{flex-wrap:wrap;gap:.5rem!important;padding:.5rem}.enrolled-gram{font-size:1rem;white-space:nowrap}.bonus-message{flex-direction:column}.staff-selector,.store_selection{width:100%!important}.scheme-results{padding:20px 0}}.gold-purity{padding-left:1rem;padding-bottom:15px;display:flex;gap:15px}.gold-purity .purity{display:flex;gap:10px;background:#fff7d0;width:max-content;padding:5px 8px;border-radius:11px;align-items:center}.gold-purity .purity img{height:40px}.gold-purity .purity div{font-size:12px}.gold-purity .purity .gold-price{font-weight:700}.enrolled-gram{margin-bottom:0;font-size:17px;font-weight:600}.monthly-scheme{display:flex;justify-content:space-between}.color-white{color:#fff}.terms-and-condition{display:flex;align-items:center;gap:10px;margin-bottom:10px}.terms-and-condition input{cursor:pointer}a{color:#0d6efd!important;text-decoration:underline!important;cursor:pointer}a:hover{color:#0a58ca!important}\n"] }]
        }], ctorParameters: () => [{ type: i1.EventsService }, { type: i2.RestService }, { type: i3.MatDialog }, { type: i4.StorageServiceService }, { type: i5.Router }, { type: i6.MessageService }], propDecorators: { showChargesTemplate: [{
                type: ViewChild,
                args: ['showCharges', { static: true }]
            }], data: [{
                type: Input
            }], edit: [{
                type: Input
            }], customClass: [{
                type: Input
            }], delete: [{
                type: Input
            }], index: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 