import{a as X}from"./chunk-MSDH4RMV.js";import{a as O}from"./chunk-WYJGBYF6.js";import{a as Q,b as Z,c as W}from"./chunk-UZB7YFT6.js";import{X as E,a as Se,bb as I,eb as U,fb as z,gb as V,rb as T}from"./chunk-YSQLW2JA.js";import"./chunk-NVJ2ZZFT.js";import{Ec as B,He as s,Nc as p,Pd as L,Qf as g,Rd as $,Rf as F,Se as h,Sf as C,Te as v,Tf as c,Ue as x,Wb as y,_a as f,ab as N,af as b,bb as u,dd as d,eh as H,fd as q,g as be,gb as S,jb as j,kg as J,ma as P,ng as K,vc as G,wa as _,ya as m}from"./chunk-SKPDQO4E.js";var Y=`<div class="row justify-content-center">
    <div class="col-xl-8 col-lg-12 col-md-12">
        <div class="row">
            <div class="col-xl-12 ps-4 pt-2 pb-2">
                <span class="organization-name">{{organizationName}}</span>
            </div>
        </div>
        <div class="row">
            <div class="col-xl-12">
                <div class="section-title color-primary">
                    <cds-icon shape="certificate" class="me-2 color-primary"
                        size="lg"></cds-icon>{{'LICENSE.ORGANIZATION_TITLE'|translate}}
                </div>
                <div class="col-xl-12 pt-3 pb-3">
                    <armon-management-organization-files />
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xl-12">
                <div class="section-title color-primary">
                    <cds-icon shape="envelope" class="me-2"
                        size="lg"></cds-icon>{{'LICENSE.SMTP_SETTNGS_TITLE'|translate}}
                </div>
                <div class="col-xl-12 pt-3 pb-3">
                    <armon-management-smtp />
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xl-12">
                <div class="section-title color-primary">
                    <cds-icon shape="mobile" class="me-2" size="lg"></cds-icon>{{'LICENSE.SMS_SETTNGS_TITLE'|translate}}
                </div>
                <div class="col-xl-12 pt-3 pb-3">
                    <armon-management-sms />
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xl-12">
                <div class="section-title color-primary">
                    <cds-icon shape="shield" class="me-2"
                        size="lg"></cds-icon>{{'LICENSE.MULTI_FACTOR_SETTNGS_TITLE'|translate}}
                </div>
                <div class="col-xl-12 pt-3 pb-3">
                    <armon-management-multi-factor />
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xl-12">
                <div class="section-title color-primary">
                    <cds-icon shape="certificate" class="me-2"
                        size="lg"></cds-icon>{{'LICENSE.MANAGEMENT_TITLE'|translate}}
                </div>
                <div class="col-xl-12 pt-3 pb-3">
                    <armon-management-license-files />
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-xl-12">
                <div class="section-title color-primary">
                    <cds-icon shape="help-info" class="me-2" size="lg"></cds-icon>{{'LICENSE.SUMMARY_TITLE'|translate}}
                </div>
                <div class="col-xl-12 pt-3 pb-3">
                    <armon-management-license-summary />
                </div>
            </div>
        </div>
    </div>
</div>`;var ee=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}:host .organization-name{font-size:1.05rem}:host .section-title{width:100%;padding:6px;border-bottom:solid 1px rgba(102,102,102,.2);color:#666;border-bottom:1px solid #6c7f9c}
`;var te=`<div *ngIf="visibleComponent">
    <div class="bg-white p-4 rounded-3 mb-4">
        <div class="row">
            <div class="col-12">
                <span
                    class="text-primary text-md">{{'LICENSE.USERS_TITLE'|translate:languageService.userTranslate}}</span>
            </div>
        </div>
        <div class="row">
            <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-xs-12 my-3">
                <label class="text-sm">{{'LANGUAGE.USER_EXPRESSION_LABEL'|translate}}</label>
                <div class="input-group input-group-sm">
                    <select [(ngModel)]="selectedUserExpression" class="form-select form-select-sm">
                        <option *ngFor="let userExpression of languageUserExpressionList"
                            [ngValue]="userExpression.enum">
                            {{userExpression.i18n |
                            translate}}</option>
                    </select>
                    <button class="btn btn-sm btn-primary"
                        (click)="saveUserExpression($event)">{{'BUTTON.SAVE'|translate}}</button>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-xs-12">
            <div class="count-item">
                <span class="count">{{summary.activeCredentialCount}}</span>
                <span class="title">{{'LICENSE.COUNT_ACTIVE_CREDENTIALS'|translate}}</span>
            </div>
        </div>
        <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-xs-12">
            <div class="count-item">
                <span class="count">{{summary.activeUserCount}}</span>
                <span class="title">{{'LICENSE.COUNT_ACTIVE_USERS'|translate:languageService.userTranslate}}</span>
            </div>
        </div>
        <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-xs-12">
            <div class="count-item">
                <span class="count">{{summary.passiveUserCount}}</span>
                <span class="title">{{'LICENSE.COUNT_PASSIVE_USERS'|translate:languageService.userTranslate}}</span>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xl-12 text-sm text-primary mt-4">
            {{'LICENSE.UNITES_TITLE'|translate}}
        </div>
        <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-xs-12">
            <div class="count-item">
                <span class="count">{{summary.devices.mainControlPanelCount}}</span>
                <span class="title">{{'LICENSE.COUNT_MAIN_CONTROL'|translate}}</span>
            </div>
        </div>
        <div class="col-xl-4 col-lg-4 col-md-6 col-sm-6 col-xs-12">
            <div class="count-item">
                <span class="count">{{summary.devices.extensionControlPanelCount}}</span>
                <span class="title">{{'LICENSE.COUNT_EXTENSION'|translate}}</span>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-xl-12 text-sm text-primary mt-4">
            {{'LICENSE.MODULES_TITLE'|translate}}
        </div>
        <div class="col-xl-6 col-lg-6 col-md-12" *ngFor="let module of summary.modules">
            <div class="d-flex flex-column rounded-3 pos-relative p-3 my-2 mhs-15 bg-white"
                [ngClass]="{'bg-color-gray-tint': !module.enabledOnce}">
                <div class="d-flex align-items-center mb-3">
                    <span class="text-md me-2">{{'LICENSE.MODULE_NAME_'+ module.module | translate}}</span>
                    <armon-icon-label [colorCode]="6" *ngIf="module.enabled">
                        <ng-template icon-label-icon>
                            <cds-icon shape="check-circle" solid></cds-icon>
                        </ng-template>
                        <ng-template icon-label-content>
                            <span>{{'LICENSE.OPEN_MODULE'|translate}}</span>
                        </ng-template>
                    </armon-icon-label>
                </div>
                <span class="text-xs fw-normal" *ngIf="module.enableUtc">{{'LICENSE.DATE_ACTIVE_MODULE'|translate}} :
                    {{module.enableUtc | date:'fullDate'}} </span>
                <span class="text-xs fw-normal" *ngIf="module.disableUtc">{{'LICENSE.DATE_PASSIVE_MODULE'|translate}} :
                    {{module.disableUtc | date:'fullDate'}}</span>
                <div class="d-flex justify-content-end mt-auto" *ngIf="module.currentUsage">
                    <div class="d-flex flex-column align-items-end">
                        <div class="d-flex align-items-end">
                            <!-- <span class="text-sm b-r-1 me-1 pe-1">{{module.maxCount}}</span> -->
                            <span class="text-xxxl line-height-xxxl fw-light">
                                <span class="color-secondary fw-normal">{{module.currentUsage}}</span>
                                <span class="color-gray" *ngIf="module.maxCount">/{{module.maxCount}}</span>
                            </span>
                        </div>
                        <span class="text-sm">
                            {{'LICENSE.MODULE_COUNT_'+ module.module | translate:languageService.userTranslate}}
                        </span>
                    </div>
                </div>
                <!-- ABSOLUTE POSITION -->
                <div [title]="'BUTTON.CONFIGURATION'|translate" class="config-button" *ngIf="module.module==1"
                    (click)="onModuleSettingsClicked(module)">
                    <cds-icon solid shape="file-settings" style="width: 20px; height: 20px;"></cds-icon>
                </div>
            </div>
        </div>
    </div>
</div>`;var oe=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}:host .count-item{padding:12px;margin:6px 0;min-height:90px;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end;-webkit-border-radius:.56rem;-moz-border-radius:.56rem;border-radius:.56rem;color:#0a2a5a;background-color:#fff;border:1px solid #eee}:host .count-item .count{color:#aaa;font-size:1.5rem;line-height:1.7rem}:host .count-item .title{font-size:.714rem;line-height:.65rem}:host .sub-title{width:100%;padding:12px 12px 0;font-size:.714rem;line-height:.65rem;color:#0a2a5a99}:host .config-button{position:absolute;padding:6px;right:3px;top:3px;cursor:pointer;color:#0369a1}:host .config-button:hover{color:#0a2a5a}:host .module-item[enabledonce=false]{color:#999;background-color:#9999991a}
`;var Te=function(l,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,n);else for(var a=l.length-1;a>=0;a--)(r=l[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},A=class{sessionService;licenseService;modalService;languageService;summary;visibleComponent=!1;subscriptionLoginState;languageUserExpressionList=q;selectedUserExpression;constructor(e,t,n,i){this.sessionService=e,this.licenseService=t,this.modalService=n,this.languageService=i}ngOnInit(){this.selectedUserExpression=this.sessionService.currentOrganizationOptions.userExpression,this.initializeSubscriptions(),this.getSummary()}ngOnDestroy(){this.subscriptionLoginState.unsubscribe()}initializeSubscriptions(){this.subscriptionLoginState=this.sessionService.onLoginStatusChanged.subscribe(e=>{this.getSummary()})}getSummary(){this.visibleComponent=!1,this.licenseService.getSummary().subscribe(e=>{this.summary=e,this.visibleComponent=!0})}onModuleSettingsClicked(e){this.modalService.open(X,{settings:{size:"md"},props:{licenseModule:e}}).result.then(t=>{}).catch(t=>{})}saveUserExpression(e){this.licenseService.upsertUserExpression(this.selectedUserExpression).subscribe(t=>{this.sessionService.currentOrganizationOptions.userExpression=this.selectedUserExpression;let n=this.sessionService.currentUserOrganization;n.organization.options.userExpression=this.selectedUserExpression,localStorage.setItem(B.ORGANIZATION,JSON.stringify(n))})}static ctorParameters=()=>[{type:L},{type:O},{type:$},{type:b}]};A=Te([m({selector:"armon-management-license-summary",template:te,standalone:!0,imports:[u,v,N,f,W,Q,Z,j,d],styles:[oe]})],A);var ne=`<div class="row">
    <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12">
        <div class="file-item p-4 rounded-3 bg-white">
            <span>
                <cds-icon shape="file-settings" class="me-2"></cds-icon>{{'LICENSE.FILE_ORGANIZATION_DEFINITION'|translate}}</span>
            <button class="btn btn-primary btn-sm" (click)="onDownloadDefinitionFile($event)"><cds-icon shape="download" class="me-2"></cds-icon>{{'BUTTON.DOWNLOAD'|translate}}</button>
        </div>
    </div>
    <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12">
        <div class="file-item p-4 rounded-3 bg-white">
                <input #licenseFileInput type="file" style="display:none" (change)="onChangedLicenseFile($event)" accept=".lic"/>
            <span>
                <cds-icon shape="certificate" class="me-2"></cds-icon>{{'LICENSE.FILE_LICENSE_DEFINITION'|translate}}</span>
            <button class="btn btn-primary btn-sm" (click)="onUploadLicenseFile($event)"><cds-icon shape="upload" class="me-2"></cds-icon>{{'BUTTON.UPLOAD'|translate}}</button>
        </div>
    </div>
</div>`;var ie=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}:host .file-item{margin:6px 0;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .file-item button{margin:0;-ms-flex-item-align:end;-webkit-align-self:flex-end;-moz-align-self:flex-end;align-self:flex-end}
`;var se=be(Se());var _e=function(l,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,n);else for(var a=l.length-1;a>=0;a--)(r=l[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},w=class{interactionService;licenseService;licenseFileInput;constructor(e,t){this.interactionService=e,this.licenseService=t}ngOnInit(){}onDownloadDefinitionFile(e){this.licenseService.downloadDefinitonFile().subscribe(t=>{se.default.saveAs(t,"license.def"),this.interactionService.showMessage("LICENSE.FILE_ORGANIZATION_DEF_DOWNLOADED",null,p.Success)})}onUploadLicenseFile(e){this.licenseFileInput.nativeElement.click()}onChangedLicenseFile(e){if(e.target.files&&e.target.files.length>0){let t=e.target.files[0],n=t.size,i=new FormData;i.append("upfile",t),i.append("fileName",t.name),n/1e6>1?this.interactionService.showDialog("LICENSE.FILE_LICENSE_DEFINITION","COMMON.UPLOAD_FILE_EXCEED_LIMIT",null,{maxFileSize:1},!1,"BUTTON.OK","",!1,()=>{}):this.licenseService.uploadLicenseFile(i).subscribe(o=>{this.interactionService.showMessage("LICENSE.FILE_LICENSE_DEF_UPLOADED",null,p.Success),e.target.files=null})}}static ctorParameters=()=>[{type:g},{type:O}];static propDecorators={licenseFileInput:[{type:_,args:["licenseFileInput",{static:!0}]}]}};w=_e([m({selector:"armon-management-license-files",template:ne,standalone:!0,imports:[d],styles:[ie]})],w);var le=`<ng-container *ngIf="visible">
    <div class="bg-white p-4 rounded-3">
        <div class="row">
            <div class="col-12 col-lg-6 mb-2">
                <div class="form-check">
                    <input class="form-check-input cursor-pointer" type="checkbox" id="enabledSettingsSMTPCheckbox"
                        [(ngModel)]="enabledSettings" (ngModelChange)="onEnabledSettingsChanged($event)">
                    <label class="form-check-label cursor-pointer" for="enabledSettingsSMTPCheckbox">
                        {{'LICENSE.SMTP_SETTNGS_ENABLED'|translate}}
                    </label>
                </div>
            </div>
        </div>
        <ng-container *ngIf="enabledSettings">
            <form [formGroup]="serverForm">
                <div class="row">
                    <div class="col-12 col-lg-6">
                        <div class="form-group">
                            <label class="report-form-label">{{'LICENSE.SMTP_DEFAULT_FROM_ADDRESS' | translate}}</label>
                            <div class="input-group">
                                <input type="email" id="defaultFromAddressInput" maxlength="255"
                                    name="defaultFromAddressInput" emailvalidator
                                    [formControl]="serverForm.get('defaultFromAddress')"
                                    [ngClass]="{'is-invalid': serverForm.get('defaultFromAddress').invalid}"
                                    class="form-control form-control-sm">
                                <ng-template
                                    *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: serverForm, control:serverForm.get('defaultFromAddress')}">
                                </ng-template>
                            </div>
                        </div>
                    </div>
                    <div class="col-12 col-lg-6 col-xl-3">
                        <label class="report-form-label">{{'LICENSE.SMTP_HOST'|translate}}</label>
                        <input [formControl]="serverForm.get('config.host')" type="text" id="smtphost" name="smtphost"
                            [ngClass]="{'is-invalid': serverForm.get('config.host').invalid}"
                            class="form-control form-control-sm">
                        <ng-template
                            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: serverForm, control:serverForm.get('config.host')}">
                        </ng-template>
                    </div>
                    <div class="col-12 col-lg-6 col-xl-3">
                        <label class="report-form-label">{{'LICENSE.SMTP_PORT'|translate}}</label>
                        <input [formControl]="serverForm.get('config.port')" type="number" id="smtpport" name="smtpport"
                            [ngClass]="{'is-invalid': serverForm.get('config.port').invalid}"
                            onkeypress="return event.charCode >= 48 && event.charCode <= 57"
                            class="form-control form-control-sm">
                        <ng-template
                            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: serverForm, control:serverForm.get('config.port')}">
                        </ng-template>
                    </div>
                    <div class="col-12 col-lg-6 col-xl-3">
                        <label class="report-form-label">{{'CAMERA.USERNAME'|translate}}</label>
                        <input [formControl]="serverForm.get('config.auth.user')" type="text" id="smtpuser"
                            name="smtpuser" [ngClass]="{'is-invalid': serverForm.get('config.auth.user').invalid}"
                            autocomplete="new-password" class="form-control form-control-sm">
                        <ng-template
                            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: serverForm, control:serverForm.get('config.auth.user')}">
                        </ng-template>
                    </div>
                    <div class="col-12 col-lg-6 col-xl-3">
                        <label class="report-form-label">{{'CAMERA.PASSWORD'|translate}}</label>
                        <input [formControl]="serverForm.get('config.auth.pass')" type="password" id="smtppass"
                            name="smtppass" [ngClass]="{'is-invalid': serverForm.get('config.auth.pass').invalid}"
                            placeholder="{{(hiddenPassword?'COMMON.PASSWORD_HIDDEN_PLACEHOLDER':undefined) | translate}}"
                            autocomplete="new-password" class="form-control form-control-sm">
                        <ng-template
                            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: serverForm, control:serverForm.get('config.auth.pass')}">
                        </ng-template>
                    </div>
                    <div class="col-12 col-lg-6 col-xl-3 align-self-end mb-1">
                        <div class="form-check form-switch">
                            <input class="form-check-input cursor-pointer" type="checkbox" role="switch"
                                id="secureSwitch" [formControl]="serverForm.get('config.secure')">
                            <label class="form-check-label cursor-pointer"
                                for="secureSwitch">{{'LICENSE.SMTP_SECURE'|translate}}</label>
                        </div>
                        <ng-template
                            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: serverForm, control:serverForm.get('config.secure')}">
                        </ng-template>
                    </div>
                    <div class="col-12 col-lg-6 col-xl-3 align-self-end mb-1">
                        <div class="form-check form-switch">
                            <input class="form-check-input cursor-pointer" type="checkbox" role="switch"
                                id="requireTLSSwitch" [formControl]="serverForm.get('config.requireTLS')">
                            <label class="form-check-label cursor-pointer"
                                for="requireTLSSwitch">{{'LICENSE.SMTP_REQUIRE_TLS'|translate}}</label>
                        </div>
                        <ng-template
                            *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: serverForm, control:serverForm.get('config.requireTLS')}">
                        </ng-template>
                    </div>
                </div>
            </form>
        </ng-container>
        <div class="row mt-3">
            <div class="col-12 d-flex justify-content-end">
                <button class="btn btn-sm btn-primary" [disabled]="enabledSettings && serverForm.invalid"
                    (click)="onSaveClicked($event)">{{'BUTTON.SAVE_SETTINGS'|translate}}</button>
            </div>
        </div>
    </div>
</ng-container>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control" let-isArray="isArray">
    <ng-container *ngIf="control.errors">
        <div class="invalid-feedback" style="display: initial;">
            <span
                *ngIf="control.errors.required">{{(isArray?'VALIDATION.MIN_ONE_SELECTED':'VALIDATION.REQUIRED')|translate}}</span>
            <span *ngIf="control.errors.ip">{{'VALIDATION.IP_V4_OR_V6'|translate}}</span>
            <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
            <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
            <span *ngIf="control.errors.unique">{{'VALIDATION.UNIQUE'|translate}}</span>
            <span *ngIf="control.errors.domain">{{'VALIDATION.DOMAIN'|translate}}</span>
        </div>
    </ng-container>
</ng-template>`;var re=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}
`;function ae(l){return G(l.value)?null:{domain:!0}}var Le=function(l,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,n);else for(var a=l.length-1;a>=0;a--)(r=l[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},M=class{notificationJobService;interactionService;languageService;settingsService;formBuilder;visible=!1;serverForm;smtpPreferences;enabledSettings;hiddenPassword=!1;selectedFormState;defaultFromAddress;constructor(e,t,n,i,o){this.notificationJobService=e,this.interactionService=t,this.languageService=n,this.settingsService=i,this.formBuilder=o}ngOnInit(){this.getSettings()}ngOnDestroy(){}getSettings(){this.settingsService.getOrganizationSettings().subscribe(e=>{this.smtpPreferences=e.notification.smtpSettings,this.smtpPreferences||(this.smtpPreferences=U.getEmptyModel()),this.createForms()})}updateSettings(){let e=I.getEmptyModel(),t=U.getEmptyModel();this.enabledSettings?Object.assign(t,this.serverForm.value,{enabled:!0}):Object.assign(t,{enabled:!1}),e.notification={},e.notification.smtpSettings=t,this.settingsService.updateOrganizationSettings(e).subscribe(n=>{this.interactionService.showMessage("NOTIFICATIONJOBS.SETTINGS_ORGANIZATION_UPDATED",null,p.Success)})}createForms(){this.serverForm=this.formBuilder.group({defaultFromAddress:[null,[s.required,s.email]],config:this.formBuilder.group({auth:this.formBuilder.group({pass:[null],user:[null]}),host:[null,[ae]],port:[null,[s.required,K.numeric({acceptValue:J.PositiveNumber,allowDecimal:!1})]],secure:[!1,s.required],requireTLS:[!0,s.required]})}),this.enabledSettings=!y(this.smtpPreferences.enabled)&&this.smtpPreferences.enabled,this.enabledSettings&&(this.hiddenPassword=!0,this.serverForm.patchValue(this.smtpPreferences)),this.defaultFromAddress=this.smtpPreferences.defaultFromAddress,this.visible=!0}onEnabledSettingsChanged(e){this.enabledSettings==!1&&this.serverForm&&this.serverForm.get("config.auth.pass").setValue(null)}onSaveClicked(e){this.updateSettings()}getFormValidationState(){return this.selectedFormState==="server"?this.serverForm.valid:!1}static ctorParameters=()=>[{type:E},{type:g},{type:b},{type:T},{type:h}]};M=Le([m({selector:"armon-management-smtp",template:le,standalone:!0,imports:[u,v,x,f,S,d],styles:[re]})],M);var ce=`<ng-container *ngIf="visible">
    <div class="bg-white p-4 rounded-3">
        <div class="row">
            <div class="col-12 col-lg-6 mb-2">
                <div class="form-check">
                    <input class="form-check-input cursor-pointer" type="checkbox" id="enabledSettingsSMSCheckbox"
                        [(ngModel)]="enabledSettings" (ngModelChange)="onEnabledSettingsChanged($event)">
                    <label class="form-check-label cursor-pointer" for="enabledSettingsSMSCheckbox">
                        {{'LICENSE.SMS_SETTNGS_ENABLED'|translate}}
                    </label>
                </div>
            </div>
        </div>
        <ng-container *ngIf="enabledSettings">
            <form [formGroup]="baseForm">
                <div class="row mb-3">
                    <div class="col-12 col-lg-6 col-xl-4 col-xxl-3">
                        <label class="report-form-label">{{'LICENSE.SMS_SETTNGS_PROVIDER' | translate}}</label>
                        <nz-select class="w-100" [formControl]="baseForm.get('type')" nzSize="small">
                            <nz-option *ngFor="let option of smsConfigTypes" [nzValue]="option.type" [nzLabel]="option.description |
                          translate"></nz-option>
                        </nz-select>
                    </div>
                </div>
            </form>
            <ng-container *ngIf="this.configForm">
                <form [formGroup]="configForm">
                    @switch (baseForm.get('type').value) {
                    @case (1) {
                    <div class="row">
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'LICENSE.SMS_HEADER'|translate}}</label>
                            <input [formControl]="configForm.get('header')" type="text" name="sms-1-header"
                                [ngClass]="{'is-invalid': configForm.get('header').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('header')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'LICENSE.SMS_API_KEY'|translate}}</label>
                            <input [formControl]="configForm.get('apiKey')" type="text" name="sms-1-apikey"
                                [ngClass]="{'is-invalid': configForm.get('apiKey').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('apiKey')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'LICENSE.SMS_API_SECRET'|translate}}</label>
                            <input [formControl]="configForm.get('privateKey')" type="text" name="sms-1-privatekey"
                                [ngClass]="{'is-invalid': configForm.get('privateKey').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('privateKey')}">
                            </ng-template>
                        </div>
                    </div>
                    }
                    @case (2) {
                    <div class="row">
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'LICENSE.SMS_HEADER'|translate}}</label>
                            <input [formControl]="configForm.get('header')" type="text" name="sms-2-header"
                                [ngClass]="{'is-invalid': configForm.get('header').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('header')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'LICENSE.SMS_USERCODE'|translate}}</label>
                            <input [formControl]="configForm.get('usercode')" type="text" name="sms-2-usercode"
                                [ngClass]="{'is-invalid': configForm.get('usercode').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('usercode')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'CAMERA.PASSWORD'|translate}}</label>
                            <input [formControl]="configForm.get('password')" type="text" name="sms-2-password"
                                [ngClass]="{'is-invalid': configForm.get('password').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('password')}">
                            </ng-template>
                        </div>
                    </div>
                    }
                    @case (3) {
                    <div class="row">
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'LICENSE.SMS_HEADER'|translate}}</label>
                            <input [formControl]="configForm.get('header')" type="text" name="sms-3-header"
                                [ngClass]="{'is-invalid': configForm.get('header').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('header')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'CAMERA.USERNAME'|translate}}</label>
                            <input [formControl]="configForm.get('login.username')" type="text" name="sms-3-username"
                                [ngClass]="{'is-invalid': configForm.get('login.username').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('login.username')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'CAMERA.PASSWORD'|translate}}</label>
                            <input [formControl]="configForm.get('login.password')" type="text" name="sms-3-password"
                                [ngClass]="{'is-invalid': configForm.get('login.password').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('login.password')}">
                            </ng-template>
                        </div>
                    </div>
                    }
                    @case (4) {
                    <div class="row">
                        <div class="col-12 col-lg-4">
                            <label class="report-form-label">{{'LICENSE.SMS_USERCODE'|translate}}</label>
                            <input [formControl]="configForm.get('usercode')" type="text" name="sms-4-usercode"
                                [ngClass]="{'is-invalid': configForm.get('usercode').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('usercode')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-4">
                            <label class="report-form-label">{{'CAMERA.USERNAME'|translate}}</label>
                            <input [formControl]="configForm.get('username')" type="text" name="sms-4-username"
                                [ngClass]="{'is-invalid': configForm.get('username').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('username')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-4">
                            <label class="report-form-label">{{'CAMERA.PASSWORD'|translate}}</label>
                            <input [formControl]="configForm.get('password')" type="text" name="sms-4-password"
                                [ngClass]="{'is-invalid': configForm.get('password').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('password')}">
                            </ng-template>
                        </div>

                        <div class="col-12 col-lg-4">
                            <label class="report-form-label">{{'LICENSE.SMS_ACCOUNT_ID'|translate}}</label>
                            <input [formControl]="configForm.get('accountId')" type="text" name="sms-4-accountId"
                                [ngClass]="{'is-invalid': configForm.get('accountId').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('accountId')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-4">
                            <label class="report-form-label">{{'LICENSE.SMS_ORIGINATOR'|translate}}</label>
                            <input [formControl]="configForm.get('originator')" type="text" name="sms-4-originator"
                                [ngClass]="{'is-invalid': configForm.get('originator').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('originator')}">
                            </ng-template>
                        </div>
                    </div>
                    }
                    @case (5) {
                    <div class="row">
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'CAMERA.USERNAME'|translate}}</label>
                            <input [formControl]="configForm.get('username')" type="text" name="sms-5-username"
                                [ngClass]="{'is-invalid': configForm.get('username').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('username')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'CAMERA.PASSWORD'|translate}}</label>
                            <input [formControl]="configForm.get('password')" type="text" name="sms-5-password"
                                [ngClass]="{'is-invalid': configForm.get('password').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('password')}">
                            </ng-template>
                        </div>
                        <div class="col-12 col-lg-6 col-xl-4">
                            <label class="report-form-label">{{'LICENSE.SMS_HEADER'|translate}}</label>
                            <input [formControl]="configForm.get('from')" type="text" name="sms-5-from"
                                [ngClass]="{'is-invalid': configForm.get('from').invalid}"
                                class="form-control form-control-sm">
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: configForm, control:configForm.get('from')}">
                            </ng-template>
                        </div>
                    </div>
                    }
                    @case (6) {

                    <!-- EMPTY -->

                    }
                    @default {
                    <span class="text-danger">Unsupported config type!</span>
                    }
                    }
                </form>
            </ng-container>
        </ng-container>
        <div class="row mt-3">
            <div class="col-12 d-flex justify-content-end">
                <button class="btn btn-sm btn-primary"
                    [disabled]="enabledSettings && (configForm?configForm.invalid:false)"
                    (click)="onSaveClicked($event)">{{'BUTTON.SAVE_SETTINGS'|translate}}</button>
            </div>
        </div>
    </div>
</ng-container>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control" let-isArray="isArray">
    <ng-container *ngIf="control.errors">
        <div class="invalid-feedback" style="display: initial;">
            <span
                *ngIf="control.errors.required">{{(isArray?'VALIDATION.MIN_ONE_SELECTED':'VALIDATION.REQUIRED')|translate}}</span>
            <span *ngIf="control.errors.ip">{{'VALIDATION.IP_V4_OR_V6'|translate}}</span>
            <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
            <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
            <span *ngIf="control.errors.unique">{{'VALIDATION.UNIQUE'|translate}}</span>
            <span *ngIf="control.errors.domain">{{'VALIDATION.DOMAIN'|translate}}</span>
            <span *ngIf="control.errors.maxlength">{{'VALIDATION.MAX_LENGTH'|translate: {
                max:control.errors.maxlength.requiredLength} }}</span>
            <span *ngIf="control.errors.minlength">{{'VALIDATION.MIN_LENGTH'|translate: {
                min:control.errors.minlength.requiredLength} }}</span>
        </div>
    </ng-container>
</ng-template>`;var me=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}
`;var de=[{type:c.Armon,description:"LICENSE.SMS_SETTNGS_PROVIDER_ARMON"},{type:c.IletiMerkezi,description:"LICENSE.SMS_SETTNGS_PROVIDER_ILETIMERKEZI"},{type:c.NetGsm,description:"LICENSE.SMS_SETTNGS_PROVIDER_NETGSM"},{type:c.MesajUssu,description:"LICENSE.SMS_SETTNGS_PROVIDER_MESAJUSSU"},{type:c.TurkTelekom,description:"LICENSE.SMS_SETTNGS_PROVIDER_TURKTELEKOM"},{type:c.Balaban,description:"LICENSE.SMS_SETTNGS_PROVIDER_BALABAN"}];var we=function(l,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,n);else for(var a=l.length-1;a>=0;a--)(r=l[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},k=class{notificationJobService;interactionService;languageService;settingsService;formBuilder;visible=!1;smsConfigTypes=de;baseForm;configForm;smsPreferences;enabledSettings;constructor(e,t,n,i,o){this.notificationJobService=e,this.interactionService=t,this.languageService=n,this.settingsService=i,this.formBuilder=o}ngOnInit(){this.getSettings()}ngOnDestroy(){}getSettings(){this.settingsService.getOrganizationSettings().subscribe(e=>{this.smsPreferences=e.notification.smsSettings,this.smsPreferences||(this.smsPreferences=z.getEmptyModel()),this.createBaseForm(),this.createConfigForms(this.baseForm.get("type").value),this.baseForm.get("type").valueChanges.subscribe(t=>{this.createConfigForms(t)}),this.visible=!0})}updateSettings(){let e=I.getEmptyModel(),t=z.getEmptyModel();this.enabledSettings?Object.assign(t,this.baseForm.value,{config:this.configForm.value},{enabled:!0}):Object.assign(t,{enabled:!1}),e.notification={},e.notification.smsSettings=t,this.settingsService.updateOrganizationSettings(e).subscribe(n=>{this.interactionService.showMessage("NOTIFICATIONJOBS.SETTINGS_ORGANIZATION_UPDATED",null,p.Success)})}createBaseForm(){this.enabledSettings=!y(this.smsPreferences.enabled)&&this.smsPreferences.enabled,this.baseForm=this.formBuilder.group({type:[this.smsPreferences.type||c.Armon,[s.required]]})}createConfigForms(e){switch(this.configForm&&(this.configForm.reset(),this.configForm=null),e){case c.IletiMerkezi:this.configForm=this.formBuilder.group({apiKey:[null,[s.required,s.maxLength(128)]],privateKey:[null,[s.required,s.maxLength(128)]],header:[null,[s.required,s.maxLength(11)]]});break;case c.NetGsm:this.configForm=this.formBuilder.group({usercode:[null,[s.required,s.maxLength(128)]],password:[null,[s.required,s.maxLength(128)]],header:[null,[s.required,s.maxLength(11)]]});break;case c.MesajUssu:this.configForm=this.formBuilder.group({header:[null,[s.required,s.maxLength(11)]],login:this.formBuilder.group({username:[null,[s.required,s.maxLength(128)]],password:[null,[s.required,s.maxLength(128)]]})});break;case c.TurkTelekom:this.configForm=this.formBuilder.group({usercode:[null,[s.required,s.maxLength(128)]],username:[null,[s.required,s.maxLength(128)]],password:[null,[s.required,s.maxLength(128)]],accountId:[null,[s.required,s.maxLength(128)]],originator:[null,[s.required,s.maxLength(128)]]});break;case c.Balaban:this.configForm=this.formBuilder.group({username:[null,[s.required,s.maxLength(128)]],password:[null,[s.required,s.maxLength(128)]],from:[null,[s.required,s.maxLength(11)]]});break;case c.Armon:this.configForm=this.formBuilder.group({});break;default:console.log("SMS Config Type not found",e);break}this.enabledSettings&&this.smsPreferences.type==e&&this.configForm.patchValue(this.smsPreferences.config)}onEnabledSettingsChanged(e){this.enabledSettings?this.createConfigForms(this.baseForm.get("type").value):this.configForm&&(this.configForm=null)}onSaveClicked(e){this.updateSettings()}static ctorParameters=()=>[{type:E},{type:g},{type:b},{type:T},{type:h}]};k=we([m({selector:"armon-management-sms",template:ce,standalone:!0,imports:[u,N,v,x,H,f,S,d],styles:[me]})],k);var pe=`<div class="row">
    <div class="col-xl-12">
        <div class="file-item p-4 rounded-3 bg-white">
            <input #logoFileInput type="file" style="display:none" (change)="onChangedLogoFile($event)" accept=".svg" />
            <span>
                <cds-icon shape="image" class="me-2"></cds-icon>{{'LICENSE.FILE_ORGANIZATION_LOGO'|translate}}
            </span>
            <span class="detail-text">
                {{'LICENSE.FILE_ORGANIZATION_LOGO_DETAIL'|translate}}
            </span>
            <div class="button-container">
                <button class="btn btn-outline-danger btn-sm me-2" (click)="onRemoveLogoFile($event)" [disabled]="disableRemoveButton">
                    <cds-icon shape="trash" class="me-2"></cds-icon>{{'BUTTON.REMOVE'|translate}}
                </button>
                <button class="btn btn-primary btn-sm" (click)="onUploadLogoFile($event)">
                    <cds-icon shape="upload" class="me-2"></cds-icon>{{'BUTTON.UPLOAD'|translate}}
                </button>
            </div>
        </div>
    </div>
</div>`;var ge=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}:host .file-item{margin:6px 0;display:-webkit-box;display:-moz-box;display:-webkit-flexbox;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-box-orient:vertical;-moz-box-orient:vertical;-webkit-flex-direction:column;-moz-flex-direction:column;-ms-flex-direction:column;flex-direction:column}:host .file-item .button-container{margin:0;-ms-flex-item-align:end;-webkit-align-self:flex-end;-moz-align-self:flex-end;align-self:flex-end}:host .detail-text{font-size:.588rem}
`;var De=function(l,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,n);else for(var a=l.length-1;a>=0;a--)(r=l[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},D=class{interactionService;licenseService;logoFileInput;subscriptioOrganizationLogoStateUpdated;disableRemoveButton=!0;constructor(e,t){this.interactionService=e,this.licenseService=t}ngOnInit(){this.logoUpdated(),this.subscriptioOrganizationLogoStateUpdated=this.licenseService.onOrganizationLogoStateUpdated.subscribe(()=>{this.logoUpdated()})}ngOnDestroy(){this.subscriptioOrganizationLogoStateUpdated&&this.subscriptioOrganizationLogoStateUpdated.unsubscribe()}logoUpdated(){this.disableRemoveButton=this.licenseService.isDefaultOrganizationLogo}onUploadLogoFile(e){this.logoFileInput.nativeElement.click()}onChangedLogoFile(e){if(e.target.files&&e.target.files.length>0){let t=e.target.files[0],n=t.size,i=new FormData;i.append("upfile",t),n/1e6>1?this.interactionService.showDialog("LICENSE.FILE_LOGO_DEFINITION","COMMON.UPLOAD_FILE_EXCEED_LIMIT",null,{maxFileSize:1},!1,"BUTTON.OK","",!1,()=>{}):this.licenseService.uploadOrganizationLogo(i).subscribe(o=>{this.interactionService.showMessage("LICENSE.FILE_LOGO_DEF_UPLOADED",null,p.Success),e.target.files=null})}}onRemoveLogoFile(e){this.licenseService.removeOrganizationLogo().subscribe(t=>{this.interactionService.showMessage("LICENSE.FILE_LOGO_DEF_REMOVED",null,p.Success)})}static ctorParameters=()=>[{type:g},{type:O}];static propDecorators={logoFileInput:[{type:_,args:["logoFileInput",{static:!0}]}]}};D=De([m({selector:"armon-management-organization-files",template:pe,standalone:!0,imports:[d],styles:[ge]})],D);var fe=`<ng-container *ngIf="visible">
    <ng-container *ngIf="visibleNoMedium">
        <div class="bg-white p-4 shadow-sm rounded-3">
            <cds-icon shape="exclamation-triangle" class="me-1" size="md"></cds-icon><span
                class="text-italic text-sm">{{"LICENSE.MULTI_FACTOR_NO_MEDIUM" |translate}}</span>
        </div>
    </ng-container>

    <ng-container *ngIf="!visibleNoMedium">
        <div class="bg-white p-4 rounded-3">
            <form [formGroup]="form">
                <div class="row">
                    <div class="col-12 col-md-4">
                        <div class="form-group">
                            <label> {{'LICENSE.MULTI_FACTOR_SETTNGS_LABEL' | translate}}</label>
                            <select id="optionInput" class="form-select form-select-sm" formControlName="option"
                                [ngClass]="{'is-invalid': form.get('option').touched && form.get('option').invalid}">
                                <option [ngValue]="optionEnum.DISABLE">{{"LICENSE.MULTI_FACTOR_SETTNGS_DISABLE" |
                                    translate}}</option>
                                <option [ngValue]="optionEnum.OPTIONAL">{{"LICENSE.MULTI_FACTOR_SETTNGS_OPTIONAL" |
                                    translate}}
                                </option>
                                <option [ngValue]="optionEnum.REQUIRED">{{"LICENSE.MULTI_FACTOR_SETTNGS_REQUIRED" |
                                    translate}}
                                </option>
                            </select>
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('option')}">
                            </ng-template>
                        </div>
                    </div>
                    <div class="col-12 col-md-4">
                        <div class="form-group">
                            <label> {{'NOTIFICATIONJOBS.MEDIUM' | translate}}</label>
                            <select id="methodInput" class="form-select form-select-sm" formControlName="method"
                                [ngClass]="{'is-invalid': form.get('method').touched && form.get('method').invalid}">
                                <option [ngValue]="methodEnum.SMS" *ngIf="availableSMS">{{"NOTIFICATIONJOBS.MEDIUM_SMS"
                                    |
                                    translate}}</option>
                                <option [ngValue]="methodEnum.EMAIL" *ngIf="availableEmail">
                                    {{"NOTIFICATIONJOBS.MEDIUM_MAIL"
                                    |
                                    translate}}
                                </option>
                            </select>
                            <ng-template
                                *ngTemplateOutlet="controlValidationTemplate; context: {$implicit: form, control:form.get('method')}">
                            </ng-template>
                        </div>
                    </div>
                </div>
            </form>
            <div class="row mt-3">
                <div class="col-12 d-flex justify-content-end">
                    <button class="btn btn-sm btn-primary" [disabled]="enabledSettings && serverForm.invalid"
                        (click)="onSaveClicked($event)">{{'BUTTON.SAVE_SETTINGS'|translate}}</button>
                </div>
            </div>
        </div>
    </ng-container>
</ng-container>

<!-- FORM FIELD VALIDATION -->
<ng-template #controlValidationTemplate let-form let-control="control" let-isArray="isArray">
    <ng-container *ngIf="control.errors">
        <div class="invalid-feedback" style="display: initial;">
            <span
                *ngIf="control.errors.required">{{(isArray?'VALIDATION.MIN_ONE_SELECTED':'VALIDATION.REQUIRED')|translate}}</span>
            <span *ngIf="control.errors.ip">{{'VALIDATION.IP_V4_OR_V6'|translate}}</span>
            <span *ngIf="control.errors.numeric">{{'VALIDATION.POSITIVE_NUMBER'|translate}}</span>
            <span *ngIf="control.errors.max">{{'VALIDATION.MAX_VALUE'|translate:control.errors.max}}</span>
            <span *ngIf="control.errors.unique">{{'VALIDATION.UNIQUE'|translate}}</span>
            <span *ngIf="control.errors.domain">{{'VALIDATION.DOMAIN'|translate}}</span>
        </div>
    </ng-container>
</ng-template>`;var ue=`.justify-content-center{-webkit-box-pack:center;-moz-box-pack:center;-webkit-flex-pack:center;-ms-flex-pack:center;-moz-justify-content:center;-webkit-justify-content:center;justify-content:center}.justify-content-flex-end{-webkit-box-pack:end;-moz-box-pack:end;-webkit-flex-pack:end;-ms-flex-pack:end;-moz-justify-content:flex-end;-webkit-justify-content:flex-end;justify-content:flex-end}.card-footer{padding:.28rem .7rem}.alert{font-size:.756rem}@media screen and (min-width: 992px){.modal-xxl{max-width:1640px}}@media screen and (min-width: 1200px){.modal-xxxl{max-width:1860px}}.modal-fs{max-width:none;position:absolute;margin:auto;inset:16px;height:100vh;display:flex}.btn-link{text-decoration:none}.btn-link:hover{text-decoration:underline}.invalid-feedback{margin-top:0!important;font-size:.672rem!important}
`;var ze=function(l,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,n);else for(var a=l.length-1;a>=0;a--)(r=l[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},R=class{notificationJobService;interactionService;languageService;settingsService;formBuilder;visible=!1;visibleNoMedium=!1;form;settings;availableSMS=!1;availableEmail=!1;optionEnum=C;methodEnum=F;constructor(e,t,n,i,o){this.notificationJobService=e,this.interactionService=t,this.languageService=n,this.settingsService=i,this.formBuilder=o}ngOnInit(){this.getSettings()}ngOnDestroy(){}getSettings(){this.settingsService.getOrganizationSettings().subscribe(e=>{console.log(e.notification.availableMediums),this.availableSMS=e.notification.availableMediums.sms,this.availableEmail=e.notification.availableMediums.email,this.settings=e.multiFactorAuthenticationSettings,this.settings||(this.settings=V.getEmptyModel()),this.availableEmail||this.availableSMS?this.createForms():(this.visibleNoMedium=!0,this.visible=!0)})}updateSettings(){let e=I.getEmptyModel(),t=V.getEmptyModel();Object.assign(t,this.form.value),t.option===C.DISABLE&&delete t.method,e.multiFactorAuthenticationSettings=t,this.settingsService.updateOrganizationSettings(e).subscribe(n=>{this.interactionService.showMessage("LICENSE.MULTI_FACTOR_SETTNGS_UPDATED",null,p.Success)})}createForms(){this.form=this.formBuilder.group({option:[this.settings.option,[s.required]],method:[{value:this.settings.method||this.availableEmail&&F.EMAIL||this.availableSMS&&F.SMS,disabled:this.settings.option===C.DISABLE},[s.required]]}),this.form.get("option").valueChanges.subscribe(e=>{e===C.DISABLE?this.form.get("method").disable():this.form.get("method").enable()}),this.visible=!0}onSaveClicked(e){this.updateSettings()}static ctorParameters=()=>[{type:E},{type:g},{type:b},{type:T},{type:h}]};R=ze([m({selector:"armon-management-multi-factor",template:fe,standalone:!0,imports:[v,x,u,f,S,d],styles:[ue]})],R);var Ve=function(l,e,t,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(l,e,t,n);else for(var a=l.length-1;a>=0;a--)(r=l[a])&&(o=(i<3?r(o):i>3?r(e,t,o):r(e,t))||o);return i>3&&o&&Object.defineProperty(e,t,o),o},ve=class{sessionService;organizationName;subscriptionLoginState;constructor(e){this.sessionService=e}ngOnInit(){this.initializeSubscriptions(),this.organizationName=this.sessionService.currentOrganizationName}ngOnDestroy(){this.subscriptionLoginState.unsubscribe()}initializeSubscriptions(){this.subscriptionLoginState=this.sessionService.onLoginStatusChanged.subscribe(e=>{this.updateOrganizationData()})}updateOrganizationData(){this.organizationName=this.sessionService.currentOrganizationName}static ctorParameters=()=>[{type:L}]};ve=Ve([m({selector:"armon-management-license",template:Y,schemas:[P],standalone:!0,imports:[D,M,k,w,A,R,d],styles:[ee]})],ve);export{ve as ManageLicenseComponent};
