<div id="layout-wrapper">
    <div class="inner-pg-sp">
        <div class="container-fluid">
            <div class="row">
                <div class="col-12">
                    <div class="d-sm-flex align-items-center justify-content-between navbar-header p-0">

                    </div>
                </div>
            </div>
            <div class="container-fluid">
                <div class="col-xl-12 mt-4">
                    <div class="card border">
                        <div class="card-body">
                            <div class="table-section">
                                <div class="row">
                                    <div class="col-lg-12">
                                        <div class="card-body mt-2 p-0">
                                            <div class="card mb-0 mt-2">
                                                <div
                                                    class="card-header font-edit-13-child d-flex justify-content-between align-items-center">
                                                    {{'resetPassword' | translate}}
                                                </div>
                                                <div class="card-body">
                                                    <form [formGroup]="resetPasswordForm">
                                                         <div class="row g-3 mb-3">
                                                            <div class="col-md-6">
                                                                <div class="d-flex align-items-center gap-2">
                                                                    <label for="userID" class="text-nowrap" >
                                                                        {{ 'userID' | translate }}<span
                                                                            class="mandatory">*</span>
                                                                    </label>
                                                                    
                                                                    <div class="password-wrapper position-relative w-100">
                                                                    <ng-select formControlName="userId" [items]="allUsersDropdown" bindLabel="userFullname" bindValue="userId"
                                                                        placeholder="{{'SelectUser' | translate}}" [clearable]="false">
                                                                    </ng-select>
                                                                    
                                                                    </div>
                                                                </div>
                                                                
                                                            </div>
                                                            <div class="col-md-6">
                                                                <div class="d-flex align-items-start gap-2">
                                                                    <label for="enterNewPassword"
                                                                        class="text-nowrap mt-2">
                                                                        {{ 'enterNewPassword' | translate }}<span
                                                                            class="mandatory">*</span>
                                                                    </label>
                                                                    <div class="w-100">
                                                                        <div class="password-wrapper">
                                                                            <input id="enterNewPassword" formControlName="newPassword" class="form-control" autocomplete="new-password"
                                                                                type="{{passwordType1}}" maxlength="500" placeholder="{{ 'enterNewPassword' | translate }}" appNoWhitespaces
                                                                                rows="3" />
                                                                            <app-password-hide-show #psh1 class="password-eye align-items-stretch" [showPassword]="true"
                                                                                (onEyeClick)="togglePasswordType1()"></app-password-hide-show>
                                                                    
                                                                    
                                                                        </div>
                                                                        <div class="text-danger"
                                                                            *ngIf="resetPasswordForm.get('newPassword')?.touched && resetPasswordForm.get('newPassword')?.invalid">
                                                                            <div *ngIf="resetPasswordForm.get('newPassword')?.hasError('required')">
                                                                                {{ 'fieldRequired' | translate }}
                                                                            </div>
                                                                            <div
                                                                                *ngIf="!resetPasswordForm.get('newPassword')?.hasError('required') && resetPasswordForm.get('newPassword')?.hasError('pattern') ">
                                                                                {{ 'passwordPattern' | translate }}
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                            </div>
                                                            </div>
                                                        </div>
                                                         <div class="row g-3 mb-3">
                                                             <div class="col-md-6">
                                                                <div class="d-flex align-items-start gap-2">
                                                                    <label for="confirmPassword" class="text-nowrap">
                                                                        {{ 'confirmPassword' | translate }}<span
                                                                            class="mandatory">*</span>
                                                                    </label>
                                                                    <div class="w-100">
                                                                        <div class="password-wrapper">
                                                                       <input id="confirmPassword"
                                                                            class="form-control"
                                                                            type="{{passwordType2}}"
                                                                            formControlName="confirmPassword"
                                                                            placeholder="{{ 'confirmPassword' | translate }}" appNoWhitespaces/>
                                                                            <app-password-hide-show class="password-eye align-items-stretch" #psh2 [showPassword]="true" (onEyeClick)="togglePasswordType2()"></app-password-hide-show>
                                                                        
                                                                    </div>
                                                                    <div class="text-danger"
                                                                            *ngIf="resetPasswordForm.get('confirmPassword')?.touched ">
                                                                            <div *ngIf="resetPasswordForm.get('confirmPassword')?.hasError('required')">
                                                                                {{ 'fieldRequired' | translate }}
                                                                            </div>
                                                                            
                                                                            <div
                                                                                *ngIf="resetPasswordForm.get('confirmPassword')?.hasError('pattern')">
                                                                                {{ 'passwordPattern' | translate }}
                                                                            </div>

                                                                            <div *ngIf="resetPasswordForm.hasError('passwordMismatch')">
                                                                                 {{ 'passwordsDoNotMatch' | translate }}
                                                                            </div>
                                                                        </div>
                                                                </div>
                                                                </div>
                                                            </div>
                                                            <div class="col-md-6">
                                                                
                                                            </div>
                                                        </div>
                                                         <div class="row g-3 mb-3">
                                                            <div class="col-md-6 ms-auto text-end">
                                                                <button
                                                                    class="btn btn-primary waves-effect waves-light"
                                                                    (click)="onSubmit()"
                                                                    [disabled]="resetPasswordForm.invalid"
                                                                    >{{'save' | translate}}</button>
                                                               
                                                            </div>
                                                        </div>                                                      
                                                    </form>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
        </div>
    </div>
</div>