',\r\n lineBreak: ''\r\n};\r\n","export enum ConditionType {\r\n Hold = 'HOLD',\r\n Lock = 'LOCK',\r\n Notice = 'NOTICE',\r\n Required = 'REQUIRED'\r\n}\r\n\r\n","
\r\n
\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\tAddress \r\n\t\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\tName \r\n\t\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\tAddress \r\n\t\t\t\t\t \r\n\t\t\t\t \r\n\r\n\t\t\t\t\r\n\t\t\t\t\t{{col.header}}\r\n\t\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t \r\n\t\t \r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t
\r\n\t\t\t\t \r\n\t\t\t\t{{getRefAddressDescription(rowData)}} \r\n\t\t\t\t{{getOwnerNameDescription(rowData)}} \r\n\t\t\t\t{{this.getOwnerAddressDescription(rowData)}} \r\n\t\t\t\t{{rowData[col.field]}} \r\n\t\t\t \r\n\t\t \r\n\t\t\r\n\t\t\t\r\n\t\t\t\tSelected Items: {{selectedData?.length}}\r\n\t\t\t
\r\n\t\t \r\n\t\t\r\n\t\t\t\r\n\t\t\t \r\n\t\t\t\t No records found\r\n\t\t\t \r\n\t\t\t \r\n\t\t \r\n\t \r\n\t\r\n
\r\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\r\nimport { SortEvent } from 'primeng/api';\r\nimport { OwnerModel } from 'src/app/model/ownerModel.model';\r\nimport { ParcelModel } from 'src/app/model/parcelModel.model';\r\nimport { RefAddressModel } from 'src/app/model/refAddressModel.model';\r\nimport { ApoQueryable } from 'src/app/modules/apo/models/apoRecord.model';\r\n\r\nimport {\r\n getAddressDescription,\r\n getOwnerAddressDescription,\r\n getOwnerDescription,\r\n getOwnerNameDescription,\r\n getParcelDescription,\r\n getRefAddressStreetDescription\r\n} from 'src/app/modules/apo/util/apo.util';\r\nimport { AddressModel } from 'src/app/modules/shared/model/addressModel.model';\r\nimport { HTML_ELEMENT } from 'src/app/modules/shared/model/htmlElements.const';\r\nimport { isStringNullOrWhiteSpace } from 'src/app/util/StringUtil';\r\nimport { Column } from '../../../shared/model/column.model';\r\nimport { ConditionType } from '../../models/apo.const';\r\nimport { getConditionTooltip } from '../../util/condition.util';\r\n\r\n@Component({\r\n selector: 'apo-search-results-panel',\r\n templateUrl: './apo-search-results-panel.component.html',\r\n styleUrls: ['./apo-search-results-panel.component.css']\r\n})\r\nexport class SearchResultsPanelComponent implements OnInit {\r\n\r\n @Input() sectionTitle: string;\r\n\r\n @Input() searchResults: any[];\r\n\r\n @Input() columnData: Column[];\r\n\r\n @Input() addStreetDescriptionColumn = false;\r\n\r\n @Input() addOwnerNameColumn = false;\r\n\r\n @Input() addOwnerAddressColumn = false;\r\n\r\n @Input() alternateActionLabel = '';\r\n\r\n @Input() showAddButton = true;\r\n\r\n @Output() cancelAction: EventEmitter
= new EventEmitter();\r\n\r\n @Output() submitAction: EventEmitter = new EventEmitter();\r\n\r\n @Output() altAction: EventEmitter = new EventEmitter();\r\n\r\n selectedData: any[];\r\n\r\n conditionType = ConditionType;\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n getRefAddressDescription(rowData: RefAddressModel) {\r\n return getRefAddressStreetDescription(rowData);\r\n }\r\n\r\n getOwnerNameDescription(rowData: OwnerModel) {\r\n return getOwnerNameDescription(rowData);\r\n }\r\n\r\n getOwnerAddressDescription(rowData: OwnerModel){\r\n return getOwnerAddressDescription(rowData).split(HTML_ELEMENT.lineBreak).join(' ');\r\n }\r\n\r\n sortColumn(event: SortEvent) {\r\n event.data.sort((data1, data2) => {\r\n let result = 0; //by default, two null values will be equal\r\n\r\n if (event.field === 'description') { //special sort for the description column\r\n const val1 = getRefAddressStreetDescription(data1);\r\n const val2 = getRefAddressStreetDescription(data2);\r\n result = val1.localeCompare(val2);\r\n } else if (event.field === 'OwnerName') { //special sort for the description column\r\n const val1 = getOwnerNameDescription(data1);\r\n const val2 = getOwnerNameDescription(data2);\r\n result = val1.localeCompare(val2);\r\n } else if (event.field === 'OwnerAddress') { //special sort for the OwnerAddress column\r\n const val1 = getOwnerAddressDescription(data1);\r\n const val2 = getOwnerAddressDescription(data2);\r\n result = val1.localeCompare(val2);\r\n } else {\r\n\r\n const value1 = data1[event.field];\r\n const value2 = data2[event.field];\r\n\r\n if (value1 == null && value2 != null) {\r\n result = -1;\r\n } else if (value1 != null && value2 == null) {\r\n result = 1;\r\n } else if (value1 == null && value2 == null) {\r\n result = 0;\r\n } else if (typeof value1 === 'string' && typeof value2 === 'string') {\r\n result = value1.localeCompare(value2);\r\n } else {\r\n result = (value1 < value2) ? -1 : (value1 > value2) ? 1 : 0;\r\n }\r\n }\r\n return (event.order * result);\r\n });\r\n }\r\n\r\n hasCondition(col: ApoQueryable, condType: ConditionType): boolean {\r\n let flag = false;\r\n\r\n if (col && col.hasOwnProperty('hightestCondition')) {\r\n flag = col.hightestCondition?.impactCode.toUpperCase() === condType;\r\n }\r\n\r\n return flag;\r\n }\r\n\r\n cancelClick(event) {\r\n this.cancelAction.emit();\r\n }\r\n\r\n //special bindable click for navigation\r\n altClick(event: Event) {\r\n this.altAction.emit();\r\n }\r\n\r\n submitRows() {\r\n this.submitAction.emit(this.selectedData);\r\n this.selectedData = [];\r\n }\r\n\r\n getTooltip(apoRecord: ApoQueryable): string {\r\n if (apoRecord.hightestCondition) {\r\n return getConditionTooltip(apoRecord);\r\n } else if (Object.getPrototypeOf(apoRecord) === AddressModel.prototype){\r\n return getAddressDescription(apoRecord as AddressModel);\r\n } else if (Object.getPrototypeOf(apoRecord) === ParcelModel.prototype){\r\n return getParcelDescription(apoRecord as ParcelModel);\r\n } else if (Object.getPrototypeOf(apoRecord) === OwnerModel.prototype){\r\n return getOwnerDescription(apoRecord as OwnerModel);\r\n }\r\n return $localize`Select a Record Column`;\r\n }\r\n}\r\n","import { OwnerModel } from 'src/app/model/ownerModel.model';\r\nimport { ParcelModel } from 'src/app/model/parcelModel.model';\r\nimport { AddressModel } from '../../shared/model/addressModel.model';\r\nimport { ApoQueryable } from '../models/apoRecord.model';\r\nimport { APOSearchData } from '../models/APOSearchResult.model';\r\nimport { getApoDescriptor } from './apo.util';\r\n\r\nexport const getConditionTooltip = (data: ApoQueryable): string => `\r\n ${$localize`There is a `}${data.hightestCondition.impactCode} on ${getApoDescriptor(data)}\r\n as of ${data.hightestCondition.issuedDate} \r\n ${data.hightestCondition.conditionStatus} \r\n ${data.hightestCondition.conditionComment} \r\n
`;\r\n\r\nexport const getConditionTooltipFromSearchData = (data: APOSearchData): string => `\r\n ${$localize`There is a `}${data.HighestCondition.impactCode} on ${data.Name}\r\n as of ${data.HighestCondition.issuedDate} \r\n ${data.HighestCondition.conditionStatus} \r\n ${data.HighestCondition.conditionComment} \r\n
`;\r\n","import { HttpHeaders, HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { map, catchError } from 'rxjs/operators';\r\nimport { OwnerModel } from 'src/app/model/ownerModel.model';\r\nimport { ParcelModel } from 'src/app/model/parcelModel.model';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { AddressModel } from '../../shared/model/addressModel.model';\r\nimport { RefAddressModel } from '../../../model/refAddressModel.model';\r\nimport { ApoSearchResult, APOSearchOutputList, ResultsSelectionInput, SearchRecords } from '../models/APOSearchResult.model';\r\nimport { HttpErrorHandler } from '../../shared/services/error-handler.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class APOSearchService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService, private errorHandler: HttpErrorHandler) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/GlobalSearch/';\r\n }\r\n\r\n getGeneralAPOSearchResults(query: string, entityType: string, moduleName: string): Observable {\r\n return this.http.get(this.apiRef\r\n .getApiUrl(`${this.apiServer}APOSearch`,\r\n [\r\n {Key:'queryText', Value:query},\r\n {Key:'apoEntityType', Value:entityType},\r\n {Key:'sort', Value:''},\r\n {Key:'isAsc', Value:'true'},\r\n {Key:'isFilter', Value:'false'},\r\n {Key:'module', Value:moduleName},\r\n ]\r\n )).pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n getSelectedAddressAPOResults(searchData: ResultsSelectionInput, module: string): Observable {\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetAPOSuggestionsList`, [{Key:'moduleName', Value:module}]), searchData)\r\n .pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n getRelatedAPOfromAddresses(searchData: RefAddressModel[], module: string): Observable {\r\n const searchResults: APOSearchOutputList = {\r\n APOEntityType: '',\r\n AddressList: searchData,\r\n ParcelList: null,\r\n OwnerList: null\r\n };\r\n\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetAssociatedAPO`,[{Key:'moduleName', Value:module}]), searchResults)\r\n .pipe(map(result => (\r\n JSON.parse(result.toString()) as APOSearchOutputList )\r\n ))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n\r\n }\r\n\r\n getRefAddressModelByKey(addr: AddressModel): Observable {\r\n const params = [\r\n {Key:'refAddressId', Value:addr.refAddressId?.toString()},\r\n {Key:'sourceNumber', Value:addr.sourceNumber?.toString()},\r\n ];\r\n if(addr.UID){\r\n params.push({Key:'UID', Value:addr.UID});\r\n }\r\n return this.http.get(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetRefAddressByKey`,\r\n params\r\n )).pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n getLookupResultsFromAddressModel(addr: RefAddressModel): Observable{\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetLookupResultsFromAddressModel`), addr)\r\n .pipe(map(r => JSON.parse(JSON.stringify(r))),\r\n catchError(this.errorHandler.handleError));\r\n }\r\n\r\n getRelatedAPOfromParcels(searchData: ParcelModel[], module: string): Observable{\r\n const searchResults: APOSearchOutputList = {\r\n APOEntityType: '',\r\n AddressList: null,\r\n ParcelList: searchData,\r\n OwnerList: null\r\n };\r\n\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetAssociatedAPO`,[{Key:'moduleName', Value:module}]), searchResults)\r\n .pipe(map(result => (\r\n JSON.parse(result.toString()) as APOSearchOutputList )\r\n ))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n}\r\n\r\ngetLookupResultsFromParcelModel(prcl: ParcelModel): Observable{\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetLookupResultsFromParcelModel`), prcl)\r\n .pipe(catchError(this.errorHandler.handleError));\r\n}\r\n\r\n getRelatedAPOfromOwners(searchData: OwnerModel[], module: string): Observable{\r\n const searchResults: APOSearchOutputList = {\r\n APOEntityType: '',\r\n AddressList: null,\r\n ParcelList: null,\r\n OwnerList: searchData\r\n };\r\n\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetAssociatedAPO`,[{Key:'moduleName', Value:module}]), searchResults)\r\n .pipe(map(result => (\r\n JSON.parse(result.toString()) as APOSearchOutputList )\r\n ))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n}\r\n\r\ngetLookupResultsFromOwnerModel(own: OwnerModel): Observable{\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetLookupResultsFromOwnerModel`), own)\r\n .pipe(catchError(this.errorHandler.handleError));\r\n}\r\n\r\n}\r\n","\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { UntypedFormGroup, UntypedFormControl } from '@angular/forms';\r\nimport { AccelaControlType } from '../../model/accelaControl.model';\r\n\r\n///\r\n///Search Page Layout component\r\n///\r\n/// This is a stripped down version of the page-layout component that supports advancved search\r\n@Component({\r\n selector: 'search-page-layout',\r\n templateUrl: './search-page-layout.component.html',\r\n styleUrls: ['./search-page-layout.component.less']\r\n})\r\nexport class SearchPageLayoutComponent implements AfterViewInit {\r\n\r\n @Input() readonlyMode = false;\r\n @Input() controlGroup: UntypedFormGroup;\r\n @Output() controlOnBlur: EventEmitter = new EventEmitter();\r\n\r\n controlTypes = AccelaControlType;\r\n\r\n @ViewChild('input') set inputElRef(elRef: ElementRef){\r\n };\r\n\r\n ngAfterViewInit(): void {\r\n if(this.inputElRef){\r\n this.inputElRef.nativeElement.focus();\r\n }\r\n\r\n }\r\n\r\n //Unsort the elements by keyvalue in FormGroup\r\n unsorted() {\r\n return 0;\r\n }\r\n\r\n onFocusChange(formRef: UntypedFormControl){\r\n this.controlOnBlur.emit(formRef);\r\n }\r\n\r\n}\r\n"," \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Address Lookup 1\">s (Max {{addressMax}}) \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n","import { DatePipe } from '@angular/common';\r\nimport { Component, Input, OnInit, Output, EventEmitter, AfterViewInit, ViewChild } from '@angular/core';\r\nimport { AbstractControl, FormBuilder, FormControl, FormGroup } from '@angular/forms';\r\nimport { MessageService } from 'primeng/api';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { RefAddressModel } from 'src/app/model/refAddressModel.model';\r\nimport { TemplateAttributeModel } from 'src/app/model/templateattributemodel.model';\r\nimport { AccelaControl, AccelaControlType } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AddressModel } from 'src/app/modules/shared/model/addressModel.model';\r\nimport { Column } from 'src/app/modules/shared/model/column.model';\r\nimport { ExpressionResponse } from 'src/app/modules/shared/model/expressions.model';\r\nimport { AAExpressionService } from 'src/app/modules/shared/services/aaexpression-service.service';\r\nimport { PageLayoutService } from 'src/app/modules/shared/services/page-layout.service';\r\nimport { APOEntityType } from 'src/app/repo/contact-process-type.repo';\r\nimport { FlagEnum, PageLayoutMode } from 'src/app/repo/enum.repo';\r\nimport { GFilterViewIdRepo, GFilterViewPermissionLevel } from 'src/app/repo/GFilterViewIds.repo';\r\nimport { TemplateType } from 'src/app/repo/template-entity-type.repo';\r\nimport { isStringNullOrWhiteSpace } from 'src/app/util/StringUtil';\r\nimport { APOSearchService } from '../../services/aposearch-service.service';\r\nimport { convertAddressModeltoRefAddressModel } from '../../util/apo.util';\r\nimport { SearchResultsPanelComponent } from '../apo-search-results-panel/apo-search-results-panel.component';\r\n\r\n@Component({\r\n selector: 'edit-address-form',\r\n templateUrl: './edit-address-form.component.html',\r\n styleUrls: ['./edit-address-form.component.less']\r\n})\r\nexport class EditAddressFormComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() model: AddressModel;\r\n @Input() module: string;\r\n @Input() mode: PageLayoutMode;\r\n @Input() addressType = '';\r\n @Input() addressMax: number;\r\n\r\n @Output() saveChanges = new EventEmitter();\r\n @Output() closeDialog = new EventEmitter();\r\n @Output() uiBlock = new EventEmitter();\r\n\r\n @ViewChild('searchResultsPanel') searchResultsPanelComponent: SearchResultsPanelComponent;\r\n\r\n addressForm: FormGroup = this.formBuilder.group({});\r\n controlAddrModelMap: Map;\r\n\r\n onLoadExpression: ExpressionResponse;\r\n onSubmitExpression: ExpressionResponse;\r\n onExecuteExpressions: ExpressionResponse[];\r\n executeFields = new Array();\r\n\r\n originalAPOTemplatesdata: any;\r\n pageLayoutModes = PageLayoutMode;\r\n processing = false;\r\n\r\n searchResults: RefAddressModel[];\r\n editTermsText: string;\r\n showSearchResults: boolean;\r\n searchColumns: Array = [\r\n { field: 'city', header: $localize`City` },\r\n { field: 'state', header: $localize`State` },\r\n { field: 'zip', header: $localize`Zip` },\r\n ];\r\n\r\n readonly viewId = GFilterViewIdRepo.AddressEdit;\r\n readonly permissionLevel = GFilterViewPermissionLevel.APO;\r\n readonly permissionValue = APOEntityType.Address;\r\n\r\n protected destroyActions = new Subject();\r\n\r\n constructor(private formBuilder: FormBuilder, private messageService: MessageService, private datePipe: DatePipe,\r\n private expressionService: AAExpressionService, private pageLayoutService: PageLayoutService,\r\n private apoSearchService: APOSearchService) {\r\n this.populateControlAddrModelMap();\r\n this.createAddressFormInstance();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n\r\n this.fetchExpressions();\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n }\r\n\r\n /* Data Setup */\r\n populateControlAddrModelMap() {\r\n this.controlAddrModelMap = new Map();\r\n this.controlAddrModelMap.set('ddlCountry', 'country');\r\n this.controlAddrModelMap.set('txtStreetNo', 'houseNumberStart');\r\n this.controlAddrModelMap.set('txtStartFraction', 'houseFractionStart');\r\n this.controlAddrModelMap.set('txtStreetEnd', 'houseNumberEnd');\r\n this.controlAddrModelMap.set('txtEndFraction', 'houseFractionEnd');\r\n this.controlAddrModelMap.set('ddlStreetDirection', 'streetDirection');\r\n this.controlAddrModelMap.set('txtPrefix', 'streetPrefix');\r\n this.controlAddrModelMap.set('txtStreetName', 'streetName');\r\n this.controlAddrModelMap.set('ddlStreetSuffix', 'streetSuffix');\r\n this.controlAddrModelMap.set('ddlStreetSuffixDirection', 'streetSuffixDirection');\r\n this.controlAddrModelMap.set('ddlUnitType', 'unitType');\r\n this.controlAddrModelMap.set('txtUnitNo', 'unitStart');\r\n this.controlAddrModelMap.set('txtUnitEnd', 'unitEnd');\r\n this.controlAddrModelMap.set('txtSecondaryRoad', 'secondaryRoad');\r\n this.controlAddrModelMap.set('txtSecondaryRoadNo', 'secondaryRoadNumber');\r\n this.controlAddrModelMap.set('txtNeighborhoodP', 'neighborhoodPrefix');\r\n this.controlAddrModelMap.set('txtNeighborhood', 'neighborhood');\r\n this.controlAddrModelMap.set('txtDescription', 'addressDescription');\r\n this.controlAddrModelMap.set('txtDistance', 'distance');\r\n this.controlAddrModelMap.set('txtXCoordinator', 'XCoordinator');\r\n this.controlAddrModelMap.set('txtYCoordinator', 'YCoordinator');\r\n this.controlAddrModelMap.set('txtInspectionDP', 'inspectionDistrictPrefix');\r\n this.controlAddrModelMap.set('txtInspectionD', 'inspectionDistrict');\r\n this.controlAddrModelMap.set('txtCity', 'city');\r\n this.controlAddrModelMap.set('txtCounty', 'county');\r\n this.controlAddrModelMap.set('txtState', 'state');\r\n this.controlAddrModelMap.set('txtZip', 'zip');\r\n this.controlAddrModelMap.set('txtStreetAddress', 'fullAddress');\r\n this.controlAddrModelMap.set('txtAddressLine1', 'addressLine1');\r\n this.controlAddrModelMap.set('txtAddressLine2', 'addressLine2');\r\n this.controlAddrModelMap.set('ddlAddressTypeFlag', 'addressType');\r\n this.controlAddrModelMap.set('addressTypeFlag', 'addressTypeFlag');\r\n this.controlAddrModelMap.set('txtLevelPrefix', 'levelPrefix');\r\n this.controlAddrModelMap.set('txtLevelNbrStart', 'levelNumberStart');\r\n this.controlAddrModelMap.set('txtLevelNbrEnd', 'levelNumberEnd');\r\n this.controlAddrModelMap.set('txtHouseAlphaStart', 'houseNumberAlphaStart');\r\n this.controlAddrModelMap.set('txtHouseAlphaEnd', 'houseNumberAlphaEnd');\r\n this.controlAddrModelMap.set('txtStreetNameStart', 'streetNameStart');\r\n this.controlAddrModelMap.set('txtStreetNameEnd', 'streetNameEnd');\r\n this.controlAddrModelMap.set('txtCrossStreetNameStart', 'crossStreetNameStart');\r\n this.controlAddrModelMap.set('txtCrossStreetNameEnd', 'crossStreetNameEnd');\r\n this.controlAddrModelMap.set('txtAddressUID', 'UID');\r\n }\r\n\r\n createAddressFormInstance() {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n this.addressForm = this.formBuilder.group({});\r\n this.pageLayoutService.getDynamicFormData(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe((resp => {\r\n this.processing = true;\r\n resp.forEach(controlData => {\r\n if (this.mode === PageLayoutMode.ADMIN || controlData.display) {\r\n const abstractControl = new FormControl(controlData.value);\r\n this.pageLayoutService.processAccelaControl(controlData, abstractControl);\r\n if (this.model) {\r\n if (controlData.templateField || this.isTemplateField(controlData.name)) {\r\n abstractControl.patchValue(this.getTemplateAtrributeVal(controlData.name));\r\n } else {\r\n abstractControl.patchValue(this.model[this.controlAddrModelMap.get(controlData.name)]);\r\n }\r\n } else {\r\n abstractControl.patchValue(null);\r\n }\r\n\r\n if (controlData.display && (controlData.type !== AccelaControlType.Separator)) {\r\n this.addressForm.addControl(controlData.name, abstractControl);\r\n }\r\n\r\n }\r\n });\r\n this.handleOnLoadExpression();\r\n\r\n if (this.mode !== PageLayoutMode.ADMIN) {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n\r\n this.expressionService\r\n .getExpressionJsScriptForExecute(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n if (res && res.length > 0) {\r\n this.onExecuteExpressions = res;\r\n res.forEach(data => {\r\n Object.keys(data.inputFields).forEach(fieldSet => {\r\n data.inputFields[fieldSet].forEach(field => {\r\n const inputField = this.addressForm.get(field);\r\n if (inputField && !(this.executeFields.findIndex(str => str === field) >= 0)) {\r\n this.executeFields.push(field);\r\n }\r\n });\r\n });\r\n });\r\n }\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n }\r\n\r\n })\r\n , error => {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: error,\r\n closable: false\r\n });\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n });\r\n this.getOriginalAPOTemplatesdata();\r\n }\r\n\r\n updateAddressFormInstance(address: AddressModel) {\r\n this.model = address;\r\n\r\n Object.keys(this.addressForm.controls).forEach(key => {\r\n if (this.isTemplateField(key)) {\r\n this.addressForm.controls[key].patchValue(this.getTemplateAtrributeVal(key));\r\n } else {\r\n if (this.addressForm.controls[key]) {\r\n this.addressForm.controls[key].patchValue(this.model[this.controlAddrModelMap.get(key)]);\r\n }\r\n }\r\n\r\n });\r\n this.handleOnLoadExpression();\r\n\r\n }\r\n\r\n /* Expression Handling */\r\n fetchExpressions() {\r\n //Expression loading\r\n this.expressionService\r\n .getExpressionJsScriptOnLoad(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.onLoadExpression = res;\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n\r\n this.expressionService\r\n .getExpressionJsScriptOnSubmit(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.onSubmitExpression = res;\r\n });\r\n }\r\n\r\n invokeExpressionForExecute(event: AbstractControl) {\r\n if (this.executeFields.findIndex(str => str === event.controlData.name) >= 0) {\r\n this.onExecuteExpressions.forEach(data => {\r\n this.executeFields.forEach(field => {\r\n const inputField = this.addressForm.get(field);\r\n if (inputField) {\r\n const ctrlData = inputField.controlData;\r\n ctrlData.value = inputField.value;\r\n data.inputFieldProperties[ctrlData.name] = inputField.controlData;\r\n }\r\n });\r\n this.expressionService.invokeExpression(data, this.addressForm, null).subscribe();\r\n\r\n });\r\n }\r\n }\r\n\r\n handleOnLoadExpression() {\r\n if (this.onLoadExpression) {\r\n this.expressionService\r\n .invokeExpression(this.onLoadExpression, this.addressForm)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n } else {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }\r\n }\r\n\r\n /* Template Handling */\r\n getOriginalAPOTemplatesdata() {\r\n this.pageLayoutService.getAPOTemplateData(TemplateType.CAP_ADDRESS).then((res) => {\r\n if (res) {\r\n this.originalAPOTemplatesdata = JSON.parse(res.toString());\r\n }\r\n });\r\n }\r\n\r\n getTemplateAtrributeVal(fieldname: string): string | Date {\r\n let fieldval: string | Date;\r\n if (this.model?.templates != null) {\r\n this.model.templates.forEach((templateData) => {\r\n if (templateData.attributeName === fieldname) {\r\n if (templateData.attributeValueDataType === 'Date') {\r\n fieldval = new Date(templateData.attributeValue);\r\n } else {\r\n fieldval = templateData.attributeValue;\r\n }\r\n return fieldval;\r\n }\r\n });\r\n }\r\n return fieldval;\r\n }\r\n\r\n isTemplateField(templateName: string): boolean {\r\n let isTemplate = false;\r\n if (this.model?.templates != null) {\r\n this.model.templates.forEach((templateData) => {\r\n if (templateData.attributeName === templateName) {\r\n isTemplate = true;\r\n return isTemplate;\r\n }\r\n });\r\n }\r\n return isTemplate;\r\n }\r\n\r\n /* Cross Page Messaging */\r\n resize(event) {\r\n window.parent.postMessage('CommunityView:ResizeDialog', '*');\r\n }\r\n\r\n collapseSize(event){\r\n window.parent.postMessage('CommunityView:RemoveMin', '*');\r\n }\r\n\r\n /* Perform Search */\r\n performSearch() {\r\n if (this.processing || this.isSearchFormEmpty()) {\r\n return;\r\n }\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n\r\n const valid = this.validateForm();\r\n if (!valid) {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: $localize`Not all fields are filled out correctly. Please check again.`,\r\n closable: false\r\n });\r\n this.processing = false;\r\n return;\r\n }\r\n\r\n const addressModel = new AddressModel();\r\n this.mapUiFieldsToModel(addressModel);\r\n this.editTermsText = this.getEditTermText();\r\n const searchFormAddressModel = addressModel;\r\n const refModel = convertAddressModeltoRefAddressModel(addressModel);\r\n this.apoSearchService.getLookupResultsFromAddressModel(refModel).subscribe(res => {\r\n this.searchResults = res;\r\n //Clearing selected search results before showing the lookup search results dialog\r\n this.searchResultsPanelComponent.selectedData = [];\r\n this.showSearchResults = true;\r\n this.uiBlock.emit(false);\r\n this.processing = false;\r\n });\r\n\r\n }\r\n\r\n backToSearch(){\r\n this.showSearchResults = false;\r\n }\r\n\r\n validateForm(): boolean {\r\n let valid = true;\r\n for (const simpleElemName in this.addressForm.controls) {\r\n if (Object.prototype.hasOwnProperty.call(this.addressForm.controls, simpleElemName)) {\r\n const formControl = this.addressForm.controls[simpleElemName] as FormControl;\r\n if (formControl.validator) {\r\n formControl.markAsDirty();\r\n }\r\n if (formControl.errors && Object.keys(formControl.errors).length > 0) {\r\n valid = false;\r\n }\r\n }\r\n }\r\n return valid;\r\n }\r\n\r\n isSearchFormEmpty(): boolean {\r\n const isEmpty = Object.values(this.addressForm.value).every(x => x === null || x === '');\r\n return isEmpty;\r\n }\r\n\r\n mapUiFieldsToModel(addressModel: AddressModel) {\r\n this.mapUItoModel(addressModel, 'country', 'ddlCountry');\r\n this.mapUItoModel(addressModel, 'houseNumberStart', 'txtStreetNo');\r\n this.mapUItoModel(addressModel, 'houseFractionStart', 'txtStartFraction');\r\n this.mapUItoModel(addressModel, 'houseNumberEnd', 'txtStreetEnd');\r\n this.mapUItoModel(addressModel, 'houseFractionEnd', 'txtEndFraction');\r\n this.mapUItoModel(addressModel, 'streetDirection', 'ddlStreetDirection');\r\n this.mapUItoModel(addressModel, 'streetPrefix', 'txtPrefix');\r\n this.mapUItoModel(addressModel, 'streetName', 'txtStreetName');\r\n this.mapUItoModel(addressModel, 'streetSuffix', 'ddlStreetSuffix');\r\n this.mapUItoModel(addressModel, 'streetSuffixDirection', 'ddlStreetSuffixDirection');\r\n this.mapUItoModel(addressModel, 'unitType', 'ddlUnitType');\r\n this.mapUItoModel(addressModel, 'unitStart', 'txtUnitNo');\r\n this.mapUItoModel(addressModel, 'unitEnd', 'txtUnitEnd');\r\n this.mapUItoModel(addressModel, 'secondaryRoad', 'txtSecondaryRoad');\r\n this.mapUItoModel(addressModel, 'secondaryRoadNumber', 'txtSecondaryRoadNo');\r\n this.mapUItoModel(addressModel, 'neighborhoodPrefix', 'txtNeighborhoodP');\r\n this.mapUItoModel(addressModel, 'neighborhood', 'txtNeighborhood');\r\n this.mapUItoModel(addressModel, 'addressDescription', 'txtDescription');\r\n this.mapUItoModel(addressModel, 'distance', 'txtDistance');\r\n this.mapUItoModel(addressModel, 'XCoordinator', 'txtXCoordinator');\r\n this.mapUItoModel(addressModel, 'YCoordinator', 'txtYCoordinator');\r\n this.mapUItoModel(addressModel, 'inspectionDistrictPrefix', 'txtInspectionDP');\r\n this.mapUItoModel(addressModel, 'inspectionDistrict', 'txtInspectionD');\r\n this.mapUItoModel(addressModel, 'city', 'txtCity');\r\n this.mapUItoModel(addressModel, 'county', 'txtCounty');\r\n this.mapUItoModel(addressModel, 'state', 'txtState');\r\n this.mapUItoModel(addressModel, 'zip', 'txtZip');\r\n this.mapUItoModel(addressModel, 'fullAddress', 'txtStreetAddress');\r\n this.mapUItoModel(addressModel, 'addressLine1', 'txtAddressLine1');\r\n this.mapUItoModel(addressModel, 'addressLine2', 'txtAddressLine2');\r\n this.mapUItoModel(addressModel, 'addressType', 'ddlAddressTypeFlag');\r\n this.mapUItoModel(addressModel, 'addressTypeFlag', 'addressTypeFlag');\r\n this.mapUItoModel(addressModel, 'levelPrefix', 'txtLevelPrefix');\r\n this.mapUItoModel(addressModel, 'levelNumberStart', 'txtLevelNbrStart');\r\n this.mapUItoModel(addressModel, 'levelNumberEnd', 'txtLevelNbrEnd');\r\n this.mapUItoModel(addressModel, 'houseNumberAlphaStart', 'txtHouseAlphaStart');\r\n this.mapUItoModel(addressModel, 'houseNumberAlphaEnd', 'txtHouseAlphaEnd');\r\n this.mapUItoModel(addressModel, 'streetNameStart', 'txtStreetNameStart');\r\n this.mapUItoModel(addressModel, 'streetNameEnd', 'txtStreetNameEnd');\r\n this.mapUItoModel(addressModel, 'crossStreetNameStart', 'txtCrossStreetNameStart');\r\n this.mapUItoModel(addressModel, 'crossStreetNameEnd', 'txtCrossStreetNameEnd');\r\n this.mapUItoModel(addressModel, 'UID', 'txtAddressUID');\r\n\r\n //Add Address Mode\r\n if (this.originalAPOTemplatesdata !== null) {\r\n addressModel.templates = this.mapUItoTemplateAttributeModel(this.originalAPOTemplatesdata); //Bind templates Data\r\n }\r\n\r\n }\r\n\r\n mapUItoModel(addressModel: AddressModel, property: string, controlName: string) {\r\n if (this.addressForm.controls[controlName]) {\r\n addressModel[property] = this.addressForm.controls[controlName].value;\r\n }\r\n }\r\n\r\n mapUItoTemplateAttributeModel(templatesData: TemplateAttributeModel[]): TemplateAttributeModel[] {\r\n if (templatesData == null) {\r\n return null;\r\n }\r\n templatesData.forEach((templateData, index) => {\r\n if (this.addressForm.controls[templateData.attributeName] && templateData.vchFlag === FlagEnum.Y) {\r\n if (this.addressForm.controls[templateData.attributeName].controlData.type === AccelaControlType.Date) {\r\n const dateVal = this.addressForm.controls[templateData.attributeName].value;\r\n templatesData[index]['attributeValue'] = (dateVal === null) ? null : this.datePipe.transform(dateVal, 'MM/dd/yy');\r\n } else {\r\n templatesData[index]['attributeValue'] = this.addressForm.controls[templateData.attributeName].value;\r\n }\r\n }\r\n });\r\n return templatesData;\r\n }\r\n\r\n getEditTermText() {\r\n let editTermsText = '';\r\n let addressControlData: AccelaControl;\r\n let name: string;\r\n let value: string;\r\n for (const key in this.addressForm.value) {\r\n if (this.addressForm.value[key] != null) {\r\n addressControlData = this.addressForm.controls[key].controlData;\r\n name = addressControlData.label;\r\n value = this.addressForm.value[key];\r\n if (addressControlData.type === AccelaControlType.Dropdown) {\r\n const dIndex = addressControlData.options.findIndex(x => x.value === value);\r\n if (dIndex > -1) {\r\n value = addressControlData.options[dIndex].label;\r\n }\r\n }\r\n if (addressControlData.type === AccelaControlType.Date) {\r\n value = this.datePipe.transform(value, 'MM/dd/yy');\r\n }\r\n if (value !== '') {\r\n editTermsText += ` ${name.replace(':', '')} contains: ${value} |`;\r\n }\r\n }\r\n }\r\n if(!isStringNullOrWhiteSpace(editTermsText)){\r\n editTermsText.substring(0,editTermsText.length-2);\r\n }\r\n\r\n return editTermsText;\r\n }\r\n\r\n addResultsFromSearch(event: Event){\r\n this.showSearchResults = false;\r\n this.saveChanges.emit(this.searchResultsPanelComponent.selectedData);\r\n }\r\n\r\n /* UI Operations */\r\n close(){\r\n this.closeDialog.emit(false);\r\n }\r\n\r\n cancelSearch(event: Event){\r\n this.showSearchResults = false;\r\n }\r\n\r\n /* Save Changes */\r\n saveChangesToModel() {\r\n this.saveChanges.emit([this.model]);\r\n }\r\n}\r\n"," \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Address Lookup 1\">s (Max {{addressMax}}) \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n","import { DatePipe } from '@angular/common';\r\nimport { AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { FormBuilder, FormControl, AbstractControl, FormGroup } from '@angular/forms';\r\nimport { MessageService } from 'primeng/api';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { OwnerModel } from 'src/app/model/ownerModel.model';\r\nimport { Column } from 'src/app/modules/shared/model/column.model';\r\nimport { ExpressionResponse } from 'src/app/modules/shared/model/expressions.model';\r\nimport { AAExpressionService } from 'src/app/modules/shared/services/aaexpression-service.service';\r\nimport { PageLayoutService } from 'src/app/modules/shared/services/page-layout.service';\r\nimport { APOEntityType } from 'src/app/repo/contact-process-type.repo';\r\nimport { FlagEnum, PageLayoutMode } from 'src/app/repo/enum.repo';\r\nimport { GFilterViewIdRepo, GFilterViewPermissionLevel } from 'src/app/repo/GFilterViewIds.repo';\r\nimport { TemplateType } from 'src/app/repo/template-entity-type.repo';\r\nimport { APOSearchService } from '../../services/aposearch-service.service';\r\nimport { SearchResultsPanelComponent } from '../apo-search-results-panel/apo-search-results-panel.component';\r\nimport { TemplateAttributeModel } from 'src/app/model/templateattributemodel.model';\r\nimport { AccelaControlType, AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\n\r\n@Component({\r\n selector: 'edit-owner-form',\r\n templateUrl: './edit-owner-form.component.html',\r\n styleUrls: ['./edit-owner-form.component.less']\r\n})\r\nexport class EditOwnerFormComponent implements OnInit, AfterViewInit {\r\n @Input() model: OwnerModel;\r\n @Input() module: string;\r\n @Input() mode: PageLayoutMode;\r\n @Input() dataSourceType = '';\r\n @Input() ownerMax: number;\r\n\r\n @Output() saveChanges = new EventEmitter();\r\n @Output() closeDialog = new EventEmitter();\r\n @Output() uiBlock = new EventEmitter();\r\n\r\n @ViewChild('searchResultsPanel') searchResultsPanelComponent: SearchResultsPanelComponent;\r\n\r\n modelForm: FormGroup = this.formBuilder.group({});\r\n controlModelMap: Map;\r\n\r\n onLoadExpression: ExpressionResponse;\r\n onSubmitExpression: ExpressionResponse;\r\n onExecuteExpressions: ExpressionResponse[];\r\n executeFields = new Array();\r\n\r\n originalAPOTemplatesdata: any;\r\n pageLayoutModes = PageLayoutMode;\r\n processing = false;\r\n\r\n searchColumns: Array = [];\r\n searchResults: OwnerModel[];\r\n editTermsText: string;\r\n showSearchResults: boolean;\r\n\r\n readonly viewId = GFilterViewIdRepo.OwnerEdit;\r\n readonly permissionLevel = GFilterViewPermissionLevel.APO;\r\n readonly permissionValue = APOEntityType.Owner;\r\n\r\n protected destroyActions = new Subject();\r\n\r\n constructor(private formBuilder: FormBuilder, private messageService: MessageService, private datePipe: DatePipe,\r\n private expressionService: AAExpressionService, private pageLayoutService: PageLayoutService,\r\n private apoSearchService: APOSearchService) {\r\n this.populateControlModelMap();\r\n this.createFormInstance();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n\r\n this.fetchExpressions();\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n }\r\n\r\n /* Data Setup */\r\n populateControlModelMap() {\r\n this.controlModelMap = new Map();\r\n this.controlModelMap.set('txtTitle', 'ownerTitle');\r\n this.controlModelMap.set('txtName', 'ownerFullName');\r\n this.controlModelMap.set('txtAddress1', 'mailAddress1');\r\n this.controlModelMap.set('txtAddress2', 'mailAddress2');\r\n this.controlModelMap.set('txtAddress3', 'mailAddress3');\r\n this.controlModelMap.set('txtCity', 'mailCity');\r\n this.controlModelMap.set('txtZip', 'mailZip');\r\n this.controlModelMap.set('ddlAppState', 'mailState');\r\n this.controlModelMap.set('txtFax', 'fax');\r\n this.controlModelMap.set('txtPhone', 'phone');\r\n this.controlModelMap.set('txtEmail', 'email');\r\n this.controlModelMap.set('ddlCountry', 'mailCountry');\r\n }\r\n\r\n createFormInstance() {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n this.modelForm = this.formBuilder.group({});\r\n this.pageLayoutService.getDynamicFormData(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe((resp => {\r\n this.processing = true;\r\n resp.forEach(controlData => {\r\n if ((this.mode === PageLayoutMode.ADMIN) || controlData.display) {\r\n const abstractControl = new FormControl(controlData.value);\r\n this.pageLayoutService.processAccelaControl(controlData, abstractControl);\r\n if (this.model) {\r\n if (controlData.templateField || this.isTemplateField(controlData.name)) {\r\n abstractControl.patchValue(this.getTemplateAtrributeVal(controlData.name));\r\n } else {\r\n abstractControl.patchValue(this.model[this.controlModelMap.get(controlData.name)]);\r\n }\r\n } else {\r\n abstractControl.patchValue(null);\r\n }\r\n\r\n if (controlData.display && (controlData.type !== AccelaControlType.Separator)) {\r\n this.modelForm.addControl(controlData.name, abstractControl);\r\n }\r\n\r\n }\r\n });\r\n this.handleOnLoadExpression();\r\n\r\n if (this.mode !== PageLayoutMode.ADMIN) {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n\r\n this.expressionService\r\n .getExpressionJsScriptForExecute(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n if (res && res.length > 0) {\r\n this.onExecuteExpressions = res;\r\n res.forEach(data => {\r\n Object.keys(data.inputFields).forEach(fieldSet => {\r\n data.inputFields[fieldSet].forEach(field => {\r\n const inputField = this.modelForm.get(field);\r\n if(inputField && !(this.executeFields.findIndex(str => str === field) >= 0)){\r\n this.executeFields.push(field);\r\n }\r\n });\r\n });\r\n });\r\n }\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n }\r\n\r\n })\r\n , error => {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: error,\r\n closable: false\r\n });\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n });\r\n this.getOriginalAPOTemplatesdata();\r\n }\r\n\r\n updateFormInstance(owner: OwnerModel){\r\n this.model = owner;\r\n\r\n Object.keys(this.modelForm.controls).forEach(key => {\r\n if (this.isTemplateField(key)) {\r\n this.modelForm.controls[key].patchValue(this.getTemplateAtrributeVal(key));\r\n } else {\r\n this.modelForm.controls[key].patchValue(this.model[this.controlModelMap.get(key)]);\r\n }\r\n });\r\n this.handleOnLoadExpression();\r\n\r\n }\r\n\r\n /* Expression Handling */\r\n fetchExpressions() {\r\n //Expression loading\r\n this.expressionService\r\n .getExpressionJsScriptOnLoad(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.onLoadExpression = res;\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n\r\n this.expressionService\r\n .getExpressionJsScriptOnSubmit(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.onSubmitExpression = res;\r\n });\r\n }\r\n\r\n handleOnLoadExpression(){\r\n if (this.onLoadExpression) {\r\n this.expressionService\r\n .invokeExpression(this.onLoadExpression, this.modelForm)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n } else {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }\r\n }\r\n\r\n invokeExpressionForExecute(event: AbstractControl) {\r\n if (this.executeFields.findIndex(str => str === event.controlData.name) >= 0) {\r\n this.onExecuteExpressions.forEach(data => {\r\n this.executeFields.forEach(field =>{\r\n const inputField = this.modelForm.get(field);\r\n if (inputField) {\r\n const ctrlData = inputField.controlData;\r\n ctrlData.value = inputField.value;\r\n data.inputFieldProperties[ctrlData.name] = inputField.controlData;\r\n }\r\n });\r\n this.expressionService.invokeExpression(data, this.modelForm, null).subscribe();\r\n\r\n });\r\n }\r\n }\r\n\r\n /* Template Handling */\r\n getOriginalAPOTemplatesdata() {\r\n this.pageLayoutService.getAPOTemplateData(TemplateType.CAP_ADDRESS).then((res) => {\r\n if(res){\r\n this.originalAPOTemplatesdata = JSON.parse(res.toString());\r\n }\r\n });\r\n }\r\n\r\n getTemplateAtrributeVal(fieldname: string): string | Date {\r\n let fieldval: string | Date;\r\n if (this.model?.templates != null) {\r\n this.model.templates.forEach((templateData) => {\r\n if (templateData.attributeName === fieldname) {\r\n if (templateData.attributeValueDataType === 'Date') {\r\n fieldval = new Date(templateData.attributeValue);\r\n } else {\r\n fieldval = templateData.attributeValue;\r\n }\r\n return fieldval;\r\n }\r\n });\r\n }\r\n return fieldval;\r\n }\r\n\r\n isTemplateField(templateName: string): boolean {\r\n let isTemplate = false;\r\n if (this.model?.templates != null) {\r\n this.model.templates.forEach((templateData) => {\r\n if (templateData.attributeName === templateName) {\r\n isTemplate = true;\r\n return isTemplate;\r\n }\r\n });\r\n }\r\n return isTemplate;\r\n }\r\n\r\n /* Cross Page Messaging */\r\n resize(event) {\r\n window.parent.postMessage('CommunityView:ResizeDialog', '*');\r\n }\r\n\r\n collapseSize(event){\r\n window.parent.postMessage('CommunityView:RemoveMin', '*');\r\n }\r\n\r\n /* Perform Search */\r\n performSearch() {\r\n //this.displaySearchResults = true;\r\n if (this.processing || this.isSearchFormEmpty()) {\r\n return;\r\n }\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n const valid = this.validateForm();\r\n if (!valid) {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: $localize`Not all fields are filled out correctly. Please check again.`,\r\n closable: false\r\n });\r\n this.processing = false;\r\n return;\r\n }\r\n const ownerModel = new OwnerModel();\r\n this.mapUiFieldsToModel(ownerModel);\r\n this.editTermsText = this.getEditTermText();\r\n const searchFormOwnerModel = ownerModel;\r\n this.apoSearchService.getLookupResultsFromOwnerModel(ownerModel).subscribe(res => {\r\n this.searchResults = res;\r\n //Clearing selected search results before showing the lookup search results dialog\r\n this.searchResultsPanelComponent.selectedData = [];\r\n this.showSearchResults = true;\r\n this.uiBlock.emit(false);\r\n this.processing = false;\r\n });\r\n }\r\n\r\n backToSearch(){\r\n this.showSearchResults = false;\r\n }\r\n\r\n validateForm(): boolean {\r\n let valid = true;\r\n for (const simpleElemName in this.modelForm.controls) {\r\n if (Object.prototype.hasOwnProperty.call(this.modelForm.controls, simpleElemName)) {\r\n const formControl = this.modelForm.controls[simpleElemName] as FormControl;\r\n if (formControl.validator) {\r\n formControl.markAsDirty();\r\n }\r\n if (formControl.errors && Object.keys(formControl.errors).length > 0) {\r\n valid = false;\r\n }\r\n }\r\n }\r\n return valid;\r\n }\r\n\r\n isSearchFormEmpty(): boolean {\r\n const isEmpty = Object.values(this.modelForm.value).every(x => x === null || x === '');\r\n return isEmpty;\r\n }\r\n\r\n mapUiFieldsToModel(ownerModel: OwnerModel): void {\r\n this.mapUItoModel(ownerModel, 'ownerTitle', 'txtTitle');\r\n this.mapUItoModel(ownerModel, 'ownerFullName', 'txtName');\r\n this.mapUItoModel(ownerModel, 'mailAddress1', 'txtAddress1');\r\n this.mapUItoModel(ownerModel, 'mailAddress2', 'txtAddress2');\r\n this.mapUItoModel(ownerModel, 'mailAddress3', 'txtAddress3');\r\n this.mapUItoModel(ownerModel, 'mailCity', 'txtCity');\r\n this.mapUItoModel(ownerModel, 'mailZip', 'txtZip');\r\n this.mapUItoModel(ownerModel, 'mailState', 'ddlAppState');\r\n this.mapUItoModel(ownerModel, 'fax', 'txtFax');\r\n this.mapUItoModel(ownerModel, 'phone', 'txtPhone');\r\n this.mapUItoModel(ownerModel, 'email', 'txtEmail');\r\n this.mapUItoModel(ownerModel, 'mailCountry', 'ddlCountry');\r\n ownerModel.ownerStatus = 'A';\r\n ownerModel.auditStatus = 'A';\r\n\r\n }\r\n\r\n mapUItoModel(ownerModel: OwnerModel, property: string, controlName: string) {\r\n if (this.modelForm.controls[controlName]) {\r\n ownerModel[property] = this.modelForm.controls[controlName].value;\r\n }\r\n }\r\n mapUItoTemplateAttributeModel(templatesData: TemplateAttributeModel[]): TemplateAttributeModel[] {\r\n if (templatesData == null) {\r\n return null;\r\n }\r\n templatesData.forEach((templateData, index) => {\r\n if (this.modelForm.controls[templateData.attributeName] && templateData.vchFlag === FlagEnum.Y) {\r\n if (this.modelForm.controls[templateData.attributeName].controlData.type === AccelaControlType.Date) {\r\n const dateVal = this.modelForm.controls[templateData.attributeName].value;\r\n templatesData[index]['attributeValue'] = (dateVal === null) ? null : this.datePipe.transform(dateVal, 'MM/dd/yy');\r\n } else {\r\n templatesData[index]['attributeValue'] = this.modelForm.controls[templateData.attributeName].value;\r\n }\r\n }\r\n });\r\n return templatesData;\r\n }\r\n getEditTermText() {\r\n let editTermsText = '';\r\n let addressControlData: AccelaControl;\r\n let name: string;\r\n let value: string;\r\n for (const key in this.modelForm.value) {\r\n if (this.modelForm.value[key] != null) {\r\n addressControlData = this.modelForm.controls[key].controlData;\r\n name = addressControlData.label;\r\n value = this.modelForm.value[key];\r\n if (addressControlData.type === AccelaControlType.Dropdown) {\r\n const dIndex = addressControlData.options.findIndex(x => x.value === value);\r\n if (dIndex > -1) {\r\n value = addressControlData.options[dIndex].label;\r\n }\r\n }\r\n if (addressControlData.type === AccelaControlType.Date) {\r\n value = this.datePipe.transform(value, 'MM/dd/yy');\r\n }\r\n if (value !== '') {\r\n editTermsText += `${name.replace(':', '')} contains: ${value} | `;\r\n }\r\n }\r\n }\r\n return editTermsText;\r\n }\r\n\r\n addResultsFromSearch(event: Event){\r\n this.showSearchResults = false;\r\n this.saveChanges.emit(this.searchResultsPanelComponent.selectedData);\r\n }\r\n\r\n /* UI Operations */\r\n close(){\r\n this.closeDialog.emit(false);\r\n }\r\n\r\n cancelSearch(event: Event){\r\n this.showSearchResults = false;\r\n }\r\n\r\n /* Save Changes */\r\n saveChangesToModel(){\r\n this.saveChanges.emit([this.model]);\r\n }\r\n\r\n}\r\n"," \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n
Parcel Lookup 1\">s (Max {{parcelMax}}) \r\n
\r\n
\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n","import { DatePipe } from '@angular/common';\r\nimport { AfterViewInit, Component, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, FormBuilder, FormControl, FormGroup } from '@angular/forms';\r\nimport { MessageService } from 'primeng/api';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { OwnerModel } from 'src/app/model/ownerModel.model';\r\nimport { ParcelModel } from 'src/app/model/parcelModel.model';\r\nimport { TemplateAttributeModel } from 'src/app/model/templateattributemodel.model';\r\nimport { AccelaControlType, AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { Column } from 'src/app/modules/shared/model/column.model';\r\nimport { ExpressionResponse } from 'src/app/modules/shared/model/expressions.model';\r\nimport { AAExpressionService } from 'src/app/modules/shared/services/aaexpression-service.service';\r\nimport { PageLayoutService } from 'src/app/modules/shared/services/page-layout.service';\r\nimport { APOEntityType } from 'src/app/repo/contact-process-type.repo';\r\nimport { FlagEnum, PageLayoutMode } from 'src/app/repo/enum.repo';\r\nimport { GFilterViewIdRepo, GFilterViewPermissionLevel } from 'src/app/repo/GFilterViewIds.repo';\r\nimport { TemplateType } from 'src/app/repo/template-entity-type.repo';\r\nimport { APOSearchService } from '../../services/aposearch-service.service';\r\nimport { SearchResultsPanelComponent } from '../apo-search-results-panel/apo-search-results-panel.component';\r\n\r\n@Component({\r\n selector: 'edit-parcel-form',\r\n templateUrl: './edit-parcel-form.component.html',\r\n styleUrls: ['./edit-parcel-form.component.less']\r\n})\r\nexport class EditParcelFormComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() model: ParcelModel;\r\n @Input() module: string;\r\n @Input() mode: PageLayoutMode;\r\n @Input() dataSourceType = '';\r\n @Input() parcelMax: number;\r\n\r\n @Output() saveChanges = new EventEmitter();\r\n @Output() closeDialog = new EventEmitter();\r\n @Output() uiBlock = new EventEmitter();\r\n\r\n @ViewChild('searchResultsPanel') searchResultsPanelComponent: SearchResultsPanelComponent;\r\n\r\n modelForm: FormGroup = this.formBuilder.group({});\r\n controlModelMap: Map;\r\n\r\n onLoadExpression: ExpressionResponse;\r\n onSubmitExpression: ExpressionResponse;\r\n onExecuteExpressions: ExpressionResponse[];\r\n executeFields = new Array();\r\n\r\n originalAPOTemplatesdata: any;\r\n pageLayoutModes = PageLayoutMode;\r\n processing = false;\r\n\r\n searchColumns: Array = [\r\n { field: 'parcelNumber', header: $localize`Parcel ID` },\r\n { field: 'lot', header: $localize`Lot` },\r\n { field: 'block', header: $localize`Block` }\r\n ];\r\n searchResults: ParcelModel[];\r\n editTermsText: string;\r\n showSearchResults: boolean;\r\n\r\n readonly viewId = GFilterViewIdRepo.ParcelEdit;\r\n readonly permissionLevel = GFilterViewPermissionLevel.APO;\r\n readonly permissionValue = APOEntityType.Parcel;\r\n\r\n protected destroyActions = new Subject();\r\n\r\n constructor(private formBuilder: FormBuilder, private messageService: MessageService, private datePipe: DatePipe,\r\n private expressionService: AAExpressionService, private pageLayoutService: PageLayoutService,\r\n private apoSearchService: APOSearchService) {\r\n this.populateControlModelMap();\r\n this.createFormInstance();\r\n }\r\n\r\n ngOnInit(): void {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n\r\n this.fetchExpressions();\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n }\r\n\r\n /* Data Setup */\r\n populateControlModelMap() {\r\n this.controlModelMap = new Map();\r\n this.controlModelMap.set('txtParcelNo', 'parcelNumber');\r\n this.controlModelMap.set('txtLot', 'lot');\r\n this.controlModelMap.set('txtBlock', 'block');\r\n this.controlModelMap.set('ddlSubdivision', 'subdivision');\r\n this.controlModelMap.set('txtBook', 'book');\r\n this.controlModelMap.set('txtPage', 'page');\r\n this.controlModelMap.set('txtTract', 'tract');\r\n this.controlModelMap.set('txtLegalDescription', 'legalDesc');\r\n this.controlModelMap.set('txtParcelArea', 'parcelArea');\r\n this.controlModelMap.set('txtLandValue', 'landValue');\r\n this.controlModelMap.set('txtImprovedValue', 'improvedValue');\r\n this.controlModelMap.set('txtExceptionValue', 'exemptValue');\r\n this.controlModelMap.set('txtRefParcelNo', 'refParcelNo');\r\n this.controlModelMap.set('txtParcelUID', 'UID');\r\n }\r\n\r\n createFormInstance() {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n this.modelForm = this.formBuilder.group({});\r\n this.pageLayoutService.getDynamicFormData(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe((resp => {\r\n this.processing = true;\r\n resp.forEach(controlData => {\r\n if ((this.mode === PageLayoutMode.ADMIN) || controlData.display) {\r\n const abstractControl = new FormControl(controlData.value);\r\n this.pageLayoutService.processAccelaControl(controlData, abstractControl);\r\n if (this.model) {\r\n if (controlData.templateField || this.isTemplateField(controlData.name)) {\r\n abstractControl.patchValue(this.getTemplateAtrributeVal(controlData.name));\r\n } else {\r\n abstractControl.patchValue(this.model[this.controlModelMap.get(controlData.name)]);\r\n }\r\n } else {\r\n abstractControl.patchValue(null);\r\n }\r\n\r\n if (controlData.display && (controlData.type !== AccelaControlType.Separator)) {\r\n this.modelForm.addControl(controlData.name, abstractControl);\r\n }\r\n\r\n }\r\n });\r\n this.handleOnLoadExpression();\r\n\r\n if (this.mode !== PageLayoutMode.ADMIN) {\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n\r\n this.expressionService\r\n .getExpressionJsScriptForExecute(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n if (res && res.length > 0) {\r\n this.onExecuteExpressions = res;\r\n res.forEach(data => {\r\n Object.keys(data.inputFields).forEach(fieldSet => {\r\n data.inputFields[fieldSet].forEach(field => {\r\n const inputField = this.modelForm.get(field);\r\n if (inputField && !(this.executeFields.findIndex(str => str === field) >= 0)) {\r\n this.executeFields.push(field);\r\n }\r\n });\r\n });\r\n });\r\n }\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n }\r\n })\r\n , error => {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: error,\r\n closable: false\r\n });\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n });\r\n this.getOriginalAPOTemplatesdata();\r\n }\r\n\r\n updateFormInstance(parcel: ParcelModel) {\r\n this.model = parcel;\r\n\r\n Object.keys(this.modelForm.controls).forEach(key => {\r\n if (this.isTemplateField(key)) {\r\n this.modelForm.controls[key].patchValue(this.getTemplateAtrributeVal(key));\r\n } else {\r\n this.modelForm.controls[key].patchValue(this.model[this.controlModelMap.get(key)]);\r\n }\r\n });\r\n this.handleOnLoadExpression();\r\n\r\n }\r\n\r\n /* Expression Handling */\r\n fetchExpressions() {\r\n //Expression loading\r\n this.expressionService\r\n .getExpressionJsScriptOnLoad(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.onLoadExpression = res;\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n\r\n this.expressionService\r\n .getExpressionJsScriptOnSubmit(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'anonymous')\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.onSubmitExpression = res;\r\n });\r\n }\r\n\r\n handleOnLoadExpression() {\r\n if (this.onLoadExpression) {\r\n this.expressionService\r\n .invokeExpression(this.onLoadExpression, this.modelForm)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }, err => {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n throw err;\r\n });\r\n } else {\r\n this.processing = false;\r\n this.uiBlock.emit(false);\r\n }\r\n }\r\n\r\n invokeExpressionForExecute(event: AbstractControl) {\r\n if (this.executeFields.findIndex(str => str === event.controlData.name) >= 0) {\r\n this.onExecuteExpressions.forEach(data => {\r\n this.executeFields.forEach(field => {\r\n const inputField = this.modelForm.get(field);\r\n if (inputField) {\r\n const ctrlData = inputField.controlData;\r\n ctrlData.value = inputField.value;\r\n data.inputFieldProperties[ctrlData.name] = inputField.controlData;\r\n }\r\n });\r\n this.expressionService.invokeExpression(data, this.modelForm, null).subscribe();\r\n\r\n });\r\n }\r\n }\r\n\r\n /* Template Handling */\r\n getOriginalAPOTemplatesdata() {\r\n this.pageLayoutService.getAPOTemplateData(TemplateType.CAP_ADDRESS).then((res) => {\r\n if (res) {\r\n this.originalAPOTemplatesdata = JSON.parse(res.toString());\r\n }\r\n });\r\n }\r\n\r\n getTemplateAtrributeVal(fieldname: string): string | Date {\r\n let fieldval: string | Date;\r\n if (this.model?.templates != null) {\r\n this.model.templates.forEach((templateData) => {\r\n if (templateData.attributeName === fieldname) {\r\n if (templateData.attributeValueDataType === 'Date') {\r\n fieldval = new Date(templateData.attributeValue);\r\n } else {\r\n fieldval = templateData.attributeValue;\r\n }\r\n return fieldval;\r\n }\r\n });\r\n }\r\n return fieldval;\r\n }\r\n\r\n isTemplateField(templateName: string): boolean {\r\n let isTemplate = false;\r\n if (this.model?.templates != null) {\r\n this.model.templates.forEach((templateData) => {\r\n if (templateData.attributeName === templateName) {\r\n isTemplate = true;\r\n return isTemplate;\r\n }\r\n });\r\n }\r\n return isTemplate;\r\n }\r\n\r\n /* Cross Page Messaging */\r\n resize(event) {\r\n window.parent.postMessage('CommunityView:ResizeDialog', '*');\r\n }\r\n\r\n collapseSize(event){\r\n window.parent.postMessage('CommunityView:RemoveMin', '*');\r\n }\r\n\r\n /* Perform Search */\r\n performSearch() {\r\n //this.displaySearchResults = true;\r\n if (this.processing || this.isSearchFormEmpty()) {\r\n return;\r\n }\r\n this.processing = true;\r\n this.uiBlock.emit(true);\r\n const valid = this.validateForm();\r\n if (!valid) {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: $localize`Not all fields are filled out correctly. Please check again.`,\r\n closable: false\r\n });\r\n this.processing = false;\r\n return;\r\n }\r\n const parcelModel = new ParcelModel();\r\n this.mapUiFieldsToModel(parcelModel);\r\n this.editTermsText = this.getEditTermText();\r\n const searchFormOwnerModel = parcelModel;\r\n this.apoSearchService.getLookupResultsFromParcelModel(parcelModel).subscribe(res => {\r\n this.searchResults = res;\r\n //Clearing selected search results before showing the lookup search results dialog\r\n this.searchResultsPanelComponent.selectedData = [];\r\n this.showSearchResults = true;\r\n this.uiBlock.emit(false);\r\n this.processing = false;\r\n });\r\n }\r\n\r\n backToSearch(){\r\n this.showSearchResults = false;\r\n }\r\n\r\n validateForm(): boolean {\r\n let valid = true;\r\n for (const simpleElemName in this.modelForm.controls) {\r\n if (Object.prototype.hasOwnProperty.call(this.modelForm.controls, simpleElemName)) {\r\n const formControl = this.modelForm.controls[simpleElemName] as FormControl;\r\n if (formControl.validator) {\r\n formControl.markAsDirty();\r\n }\r\n if (formControl.errors && Object.keys(formControl.errors).length > 0) {\r\n valid = false;\r\n }\r\n }\r\n }\r\n return valid;\r\n }\r\n\r\n isSearchFormEmpty(): boolean {\r\n const isEmpty = Object.values(this.modelForm.value).every(x => x === null || x === '');\r\n return isEmpty;\r\n }\r\n\r\n mapUiFieldsToModel(parcelModel: ParcelModel) {\r\n this.mapUItoModel(parcelModel, 'parcelNumber', 'txtParcelNo');\r\n this.mapUItoModel(parcelModel, 'lot', 'txtLot');\r\n this.mapUItoModel(parcelModel, 'block', 'txtBlock');\r\n this.mapUItoModel(parcelModel, 'subdivision', 'ddlSubdivision');\r\n this.mapUItoModel(parcelModel, 'book', 'txtBook');\r\n this.mapUItoModel(parcelModel, 'page', 'txtPage');\r\n this.mapUItoModel(parcelModel, 'tract', 'txtTract');\r\n this.mapUItoModel(parcelModel, 'legalDesc', 'txtLegalDescription');\r\n this.mapUItoModel(parcelModel, 'parcelArea', 'txtParcelArea');\r\n this.mapUItoModel(parcelModel, 'landValue', 'txtLandValue');\r\n this.mapUItoModel(parcelModel, 'improvedValue', 'txtImprovedValue');\r\n this.mapUItoModel(parcelModel, 'exemptValue', 'txtExceptionValue');\r\n this.mapUItoModel(parcelModel, 'refParcelNo', 'txtRefParcelNo');\r\n this.mapUItoModel(parcelModel, 'UID', 'txtParcelUID');\r\n parcelModel.parcelStatus = 'A';\r\n parcelModel.auditStatus = 'A';\r\n }\r\n\r\n mapUItoModel(parcelModel: ParcelModel, property: string, controlName: string) {\r\n if (this.modelForm.controls[controlName]) {\r\n parcelModel[property] = this.modelForm.controls[controlName].value;\r\n }\r\n }\r\n\r\n mapUItoTemplateAttributeModel(templatesData: TemplateAttributeModel[]): TemplateAttributeModel[] {\r\n if (templatesData == null) {\r\n return null;\r\n }\r\n templatesData.forEach((templateData, index) => {\r\n if (this.modelForm.controls[templateData.attributeName] && templateData.vchFlag === FlagEnum.Y) {\r\n if (this.modelForm.controls[templateData.attributeName].controlData.type === AccelaControlType.Date) {\r\n const dateVal = this.modelForm.controls[templateData.attributeName].value;\r\n templatesData[index]['attributeValue'] = (dateVal === null) ? null : this.datePipe.transform(dateVal, 'MM/dd/yy');\r\n } else {\r\n templatesData[index]['attributeValue'] = this.modelForm.controls[templateData.attributeName].value;\r\n }\r\n }\r\n });\r\n return templatesData;\r\n }\r\n\r\n getEditTermText() {\r\n let editTermsText = '';\r\n let addressControlData: AccelaControl;\r\n let name: string;\r\n let value: string;\r\n for (const key in this.modelForm.value) {\r\n if (this.modelForm.value[key] != null) {\r\n addressControlData = this.modelForm.controls[key].controlData;\r\n name = addressControlData.label;\r\n value = this.modelForm.value[key];\r\n if (addressControlData.type === AccelaControlType.Dropdown) {\r\n const dIndex = addressControlData.options.findIndex(x => x.value === value);\r\n if (dIndex > -1) {\r\n value = addressControlData.options[dIndex].label;\r\n }\r\n }\r\n if (addressControlData.type === AccelaControlType.Date) {\r\n value = this.datePipe.transform(value, 'MM/dd/yy');\r\n }\r\n if (value !== '') {\r\n editTermsText += `${name.replace(':', '')} contains: ${value} | `;\r\n }\r\n }\r\n }\r\n return editTermsText;\r\n }\r\n\r\n addResultsFromSearch(event: Event) {\r\n this.showSearchResults = false;\r\n this.saveChanges.emit(this.searchResultsPanelComponent.selectedData);\r\n }\r\n\r\n /* UI Operations */\r\n close(){\r\n this.closeDialog.emit(false);\r\n }\r\n\r\n cancelSearch(event: Event) {\r\n this.showSearchResults = false;\r\n }\r\n\r\n /* Save Changes */\r\n saveChangesToModel() {\r\n this.saveChanges.emit([this.model]);\r\n }\r\n}\r\n","\r\n
\r\n {{getAddressCardText()}} \r\n \r\n
\r\n {{getAddressCardText()}} \r\n \r\n
\r\n (Primary Address) | | \r\n
\r\n
\r\n","import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { AddressModel } from 'src/app/modules/shared/model/addressModel.model';\r\nimport { APOEntityType } from 'src/app/repo/contact-process-type.repo';\r\nimport { DataSourceFlag, FlagEnum } from 'src/app/repo/enum.repo';\r\nimport { ApoSuggestion } from '../../models/apoSuggestion.model';\r\nimport { APOSuggestionData } from '../../models/ApoSuggestionData.model';\r\nimport { APOSearchService } from '../../services/aposearch-service.service';\r\nimport { convertAddressModeltoRefAddressModel, convertRefAddressModeltoAddressModel, getAddressDescription } from '../../util/apo.util';\r\n\r\n@Component({\r\n selector: 'apo-address-card',\r\n templateUrl: './address-card.component.html',\r\n styleUrls: ['./address-card.component.less']\r\n})\r\nexport class AddressCardComponent implements OnInit, OnDestroy {\r\n\r\n @Input() address: AddressModel;\r\n @Input() sourceFlag: DataSourceFlag;\r\n @Input() xapoMode: boolean;\r\n @Input() module: string;\r\n @Input() adminMode: boolean;\r\n @Input() apoType: string;\r\n\r\n @Output() primaryRecordChanged = new EventEmitter();\r\n @Output() recordEditClicked = new EventEmitter();\r\n @Output() recordDeleted = new EventEmitter();\r\n @Output() suggestionsFound = new EventEmitter();\r\n\r\n suggestionLink: ApoSuggestion;\r\n validSuggestionLink = false;\r\n\r\n protected destroyActions = new Subject();\r\n\r\n constructor(private apoSearchService: APOSearchService) { }\r\n\r\n ngOnInit(): void {\r\n const refAddr = convertAddressModeltoRefAddressModel(this.address);\r\n this.apoSearchService.getRelatedAPOfromAddresses([refAddr], this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n const suggestionData: ApoSuggestion = {\r\n source: APOEntityType.Address.toLowerCase(),\r\n sourceId: this.xapoMode ? refAddr.UID : refAddr.refAddressId?.toString(),\r\n sourceLabel: getAddressDescription(this.address),\r\n addresses: res.AddressList.map(address => convertRefAddressModeltoAddressModel(address)),\r\n parcels: res.ParcelList,\r\n owners: res.OwnerList\r\n };\r\n this.suggestionLink = suggestionData;\r\n this.validSuggestionLink = (this.suggestionLink?.parcels.length > 0 || this.suggestionLink?.owners.length > 0);\r\n if (this.apoType === APOEntityType.Address) {\r\n this.setToSuggestions(event);\r\n }\r\n });\r\n }\r\n\r\n getAddressCardText(): string {\r\n return getAddressDescription(this.address);\r\n }\r\n\r\n isPrimary(): boolean{\r\n return this.address.primaryFlag === FlagEnum.Y;\r\n }\r\n\r\n setToPrimary(event: Event) {\r\n if(this.adminMode){\r\n return;\r\n }\r\n\r\n this.primaryRecordChanged.emit(this.address);\r\n event.stopPropagation();\r\n }\r\n\r\n showViewForm(event: Event){\r\n if(this.adminMode){\r\n return;\r\n }\r\n this.recordEditClicked.emit(this.address);\r\n }\r\n\r\n deleteRecord(event: Event) {\r\n this.recordDeleted.emit(this.address);\r\n event.stopPropagation();\r\n }\r\n\r\n getSuggestionTooltip(){\r\n if(!this.suggestionLink){\r\n return;\r\n }\r\n if(this.suggestionLink.addresses?.length > 0 || this.suggestionLink.owners?.length > 0) {\r\n const arry = new Array();\r\n if(this.suggestionLink.parcels?.length > 0){\r\n arry.push('parcels');\r\n if(this.suggestionLink.owners?.length > 0){\r\n arry.push('and');\r\n }\r\n }\r\n if(this.suggestionLink.owners?.length > 0){\r\n arry.push('owners');\r\n }\r\n const msg = arry.join(' ');\r\n return `This address has multiple associated ${msg}. Click to view and manage`;\r\n }\r\n }\r\n\r\n setToSuggestions(event: Event) {\r\n if (this.validSuggestionLink) {\r\n this.suggestionLink.addresses = [];\r\n this.suggestionsFound.emit(this.suggestionLink);\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.destroyActions.next();\r\n this.destroyActions.complete();\r\n }\r\n}\r\n","\r\n
\r\n {{getParcelCardText()}} \r\n \r\n
\r\n {{getParcelCardText()}} \r\n \r\n
\r\n (Primary Parcel) | | \r\n
\r\n
","import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { ParcelModel } from 'src/app/model/parcelModel.model';\r\nimport { APOEntityType } from 'src/app/repo/contact-process-type.repo';\r\nimport { DataSourceFlag, FlagEnum } from 'src/app/repo/enum.repo';\r\nimport { ApoSuggestion } from '../../models/apoSuggestion.model';\r\nimport { APOSearchService } from '../../services/aposearch-service.service';\r\nimport { convertRefAddressModeltoAddressModel, getParcelDescription } from '../../util/apo.util';\r\n\r\n@Component({\r\n selector: 'apo-parcel-card',\r\n templateUrl: './parcel-card.component.html',\r\n styleUrls: ['./parcel-card.component.less']\r\n})\r\nexport class ParcelCardComponent implements OnInit, OnDestroy {\r\n\r\n @Input() parcel: ParcelModel;\r\n @Input() sourceFlag: DataSourceFlag;\r\n @Input() xapoMode: boolean;\r\n @Input() module: string;\r\n @Input() adminMode: boolean;\r\n @Input() apoType: string;\r\n\r\n @Output() primaryRecordChanged = new EventEmitter();\r\n @Output() recordEditClicked = new EventEmitter();\r\n @Output() recordDeleted = new EventEmitter();\r\n @Output() suggestionsFound = new EventEmitter();\r\n\r\n suggestionLink: ApoSuggestion;\r\n validSuggestionLink = false;\r\n protected destroyActions = new Subject();\r\n\r\n constructor(private apoSearchService: APOSearchService) { }\r\n\r\n ngOnInit(): void {\r\n this.apoSearchService.getRelatedAPOfromParcels([this.parcel], this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n const suggestionData: ApoSuggestion = {\r\n source: APOEntityType.Parcel.toLowerCase(),\r\n sourceId: this.xapoMode ? this.parcel.UID : this.parcel.parcelNumber,\r\n sourceLabel: getParcelDescription(this.parcel),\r\n addresses: res.AddressList.map(address => convertRefAddressModeltoAddressModel(address)),\r\n parcels: res.ParcelList,\r\n owners: res.OwnerList\r\n };\r\n this.suggestionLink = suggestionData;\r\n this.validSuggestionLink = (this.suggestionLink?.owners.length > 0 || this.suggestionLink?.addresses.length > 0);\r\n if (this.apoType === APOEntityType.Parcel) {\r\n this.setToSuggestions(event);\r\n }\r\n });\r\n }\r\n\r\n getParcelCardText(): string {\r\n return this.parcel.parcelNumber;\r\n }\r\n\r\n isPrimary(): boolean{\r\n return this.parcel.primaryParcelFlag === FlagEnum.Y;\r\n }\r\n\r\n setToPrimary(event: Event) {\r\n if(this.adminMode){\r\n return;\r\n }\r\n\r\n this.primaryRecordChanged.emit(this.parcel);\r\n event.stopPropagation();\r\n }\r\n\r\n showViewForm(event: Event){\r\n if(this.adminMode){\r\n return;\r\n }\r\n\r\n this.recordEditClicked.emit(this.parcel);\r\n }\r\n\r\n deleteRecord(event: Event) {\r\n this.recordDeleted.emit(this.parcel);\r\n event.stopPropagation();\r\n }\r\n\r\n getSuggestionTooltip(){\r\n if(!this.suggestionLink){\r\n return;\r\n }\r\n if(this.suggestionLink.addresses?.length > 0 || this.suggestionLink.owners?.length > 0) {\r\n const arry = new Array();\r\n if(this.suggestionLink.parcels?.length > 0){\r\n arry.push('parcels');\r\n if(this.suggestionLink.owners?.length > 0){\r\n arry.push('and');\r\n }\r\n }\r\n if(this.suggestionLink.owners?.length > 0){\r\n arry.push('owners');\r\n }\r\n const msg = arry.join(' ');\r\n return `This address has multiple associated ${msg}. Click to view and manage`;\r\n }\r\n }\r\n\r\n setToSuggestions(event: Event) {\r\n if (this.validSuggestionLink) {\r\n this.suggestionLink.parcels = [];\r\n this.suggestionsFound.emit(this.suggestionLink);\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.destroyActions.next();\r\n this.destroyActions.complete();\r\n }\r\n}\r\n","\r\n
\r\n {{getOwnerCardText()}} \r\n \r\n
\r\n {{getOwnerCardText()}} \r\n \r\n
\r\n (Primary Owner) | | \r\n
\r\n
\r\n","import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { OwnerModel } from 'src/app/model/ownerModel.model';\r\nimport { APOEntityType } from 'src/app/repo/contact-process-type.repo';\r\nimport { DataSourceFlag, FlagEnum } from 'src/app/repo/enum.repo';\r\nimport { ApoSuggestion } from '../../models/apoSuggestion.model';\r\nimport { APOSearchService } from '../../services/aposearch-service.service';\r\nimport { convertRefAddressModeltoAddressModel, getOwnerNameDescription } from '../../util/apo.util';\r\n\r\n@Component({\r\n selector: 'apo-owner-card',\r\n templateUrl: './owner-card.component.html',\r\n styleUrls: ['./owner-card.component.less']\r\n})\r\nexport class OwnerCardComponent implements OnInit, OnDestroy {\r\n\r\n @Input() owner: OwnerModel;\r\n @Input() sourceFlag: DataSourceFlag;\r\n @Input() xapoMode: boolean;\r\n @Input() module: string;\r\n @Input() adminMode: boolean;\r\n @Input() apoType: string;\r\n\r\n @Output() primaryRecordChanged = new EventEmitter();\r\n @Output() recordEditClicked = new EventEmitter();\r\n @Output() recordDeleted = new EventEmitter();\r\n @Output() suggestionsFound = new EventEmitter();\r\n\r\n suggestionLink: ApoSuggestion;\r\n validSuggestionLink = false;\r\n protected destroyActions = new Subject();\r\n\r\n constructor(private apoSearchService: APOSearchService) { }\r\n\r\n ngOnInit(): void {\r\n this.apoSearchService.getRelatedAPOfromOwners([this.owner], this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n const suggestionData: ApoSuggestion = {\r\n source: APOEntityType.Owner.toLowerCase(),\r\n sourceId: this.xapoMode ? this.owner.UID : this.owner.ownerNumber?.toString(),\r\n sourceLabel: getOwnerNameDescription(this.owner),\r\n addresses: res.AddressList.map(address => convertRefAddressModeltoAddressModel(address)),\r\n parcels: res.ParcelList,\r\n owners: res.OwnerList\r\n };\r\n this.suggestionLink = suggestionData;\r\n this.validSuggestionLink = (this.suggestionLink?.parcels.length > 0 || this.suggestionLink?.addresses.length > 0);\r\n if (this.apoType === APOEntityType.Owner) {\r\n this.setToSuggestions(event);\r\n }\r\n });\r\n }\r\n\r\n getOwnerCardText(): string {\r\n return getOwnerNameDescription(this.owner);\r\n }\r\n\r\n isPrimary(): boolean{\r\n return this.owner.isPrimary === FlagEnum.Y;\r\n }\r\n\r\n setToPrimary(event: Event) {\r\n if(this.adminMode){\r\n return;\r\n }\r\n\r\n this.primaryRecordChanged.emit(this.owner);\r\n event.stopPropagation();\r\n }\r\n\r\n showViewForm(event: Event){\r\n if(this.adminMode){\r\n return;\r\n }\r\n\r\n this.recordEditClicked.emit(this.owner);\r\n }\r\n\r\n deleteRecord(event: Event) {\r\n this.recordDeleted.emit(this.owner);\r\n event.stopPropagation();\r\n }\r\n\r\n getSuggestionTooltip(){\r\n if(!this.suggestionLink){\r\n return;\r\n }\r\n if(this.suggestionLink.addresses?.length > 0 || this.suggestionLink.owners?.length > 0) {\r\n const arry = new Array();\r\n if(this.suggestionLink.parcels?.length > 0){\r\n arry.push('parcels');\r\n if(this.suggestionLink.owners?.length > 0){\r\n arry.push('and');\r\n }\r\n }\r\n if(this.suggestionLink.owners?.length > 0){\r\n arry.push('owners');\r\n }\r\n const msg = arry.join(' ');\r\n return `This address has multiple associated ${msg}. Click to view and manage`;\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.destroyActions.next();\r\n this.destroyActions.complete();\r\n }\r\n\r\n setToSuggestions(event: Event) {\r\n if (this.validSuggestionLink) {\r\n this.suggestionLink.owners = [];\r\n this.suggestionsFound.emit(this.suggestionLink);\r\n event.stopPropagation();\r\n }\r\n }\r\n\r\n}\r\n","\r\n Note: \r\n When you add an address, parcel, or owner (APO), we will look for any associated items and suggest them. Multiple APOs can be added to a single application. \r\n
\r\n\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n Addresses (Required) \r\n
\r\n
\r\n
\r\n ({{this.addressCards?.length}} of {{addressMax}} max) \r\n
\r\n
\r\n
\r\n
\r\n Parcels (Required) \r\n
\r\n
\r\n
\r\n ({{this.parcelCards?.length}} of {{parcelMax}} max) \r\n
\r\n
\r\n
\r\n
\r\n Owners (Required) \r\n
\r\n
\r\n
\r\n ({{this.ownerCards?.length}} of {{ownerMax}} max) \r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n Enter Address Information \r\n \r\n Enter Parcel Information \r\n \r\n Enter Owner Information \r\n \r\n
\r\n\r\n","import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild } from '@angular/core';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { Store } from '@ngrx/store';\r\nimport { MessageService } from 'primeng/api';\r\nimport { Subject } from 'rxjs';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { AppState } from 'src/app/app.state';\r\nimport { OwnerModel } from 'src/app/model/ownerModel.model';\r\nimport { ParcelModel } from 'src/app/model/parcelModel.model';\r\nimport { AddressModel } from 'src/app/modules/shared/model/addressModel.model';\r\nimport { SessionCapModelService } from 'src/app/modules/shared/services/session-cap-model.service';\r\nimport { SettingService } from 'src/app/modules/shared/services/setting.service';\r\nimport { DataSourceFlag, FlagEnum, PageLayoutMode } from 'src/app/repo/enum.repo';\r\nimport { selectAppSettings } from 'src/app/state/selectors/app-settings.selectors';\r\nimport { sortByProperty } from 'src/app/util/sortUtil';\r\nimport { RefAddressModel } from '../../../../model/refAddressModel.model';\r\nimport { APOEntityType } from '../../../../repo/contact-process-type.repo';\r\nimport { isStringNullOrWhiteSpace } from '../../../../util/StringUtil';\r\nimport { Column } from '../../../shared/model/column.model';\r\nimport { EditAddressFormComponent } from '../../components/edit-address-form/edit-address-form.component';\r\nimport { EditOwnerFormComponent } from '../../components/edit-owner-form/edit-owner-form.component';\r\nimport { EditParcelFormComponent } from '../../components/edit-parcel-form/edit-parcel-form.component';\r\nimport { ApoQueryable } from '../../models/apoRecord.model';\r\nimport { APOSearchOutputList } from '../../models/APOSearchResult.model';\r\nimport { ApoSuggestion } from '../../models/apoSuggestion.model';\r\nimport { APOSuggestionData } from '../../models/ApoSuggestionData.model';\r\nimport { APOSearchService } from '../../services/aposearch-service.service';\r\n\r\n@Component({\r\n selector: 'multi-apo-screen',\r\n templateUrl: './multi-apo-screen.component.html',\r\n styleUrls: ['./multi-apo-screen.component.less']\r\n})\r\nexport class MultiApoScreenComponent implements OnInit, OnDestroy, AfterViewInit {\r\n\r\n @ViewChild('addressLayout') addressFormLayout: EditAddressFormComponent;\r\n @ViewChild('parcelLayout') parcelFormLayout: EditParcelFormComponent;\r\n @ViewChild('ownerLayout') ownerFormLayout: EditOwnerFormComponent;\r\n\r\n module: string;\r\n compOrder = ['A', 'P', 'O'];\r\n xapoMode: boolean;\r\n adminMode: boolean;\r\n processing = false;\r\n pageLayoutModes = PageLayoutMode;\r\n sourceType: string; \r\n\r\n addressCards = new Array();\r\n selectedAddress: AddressModel;\r\n addressMode: PageLayoutMode;\r\n addressRequired: boolean;\r\n showAddressForm: boolean;\r\n addressType: string;\r\n addressMax: number;\r\n\r\n parcelCards = new Array();\r\n selectedParcel: ParcelModel;\r\n parcelMode: PageLayoutMode;\r\n parcelRequired: boolean;\r\n showParcelForm: boolean;\r\n parcelType: string;\r\n parcelMax: number;\r\n\r\n ownerCards = new Array();\r\n selectedOwner: OwnerModel;\r\n ownerMode: PageLayoutMode;\r\n ownerRequired: boolean;\r\n showOwnerForm: boolean;\r\n ownerType: string;\r\n ownerMax: number;\r\n\r\n protected destroyActions = new Subject();\r\n constructor(private store: Store, private route: ActivatedRoute, private capModelService: SessionCapModelService,\r\n private messageService: MessageService, private settingsService: SettingService) {\r\n this.route.queryParams.subscribe(params => {\r\n this.module = params['Module'];\r\n this.addressMax = params['addressMax'] ?? 1;\r\n this.parcelMax = params['parcelMax'] ?? 1;\r\n this.ownerMax = params['ownerMax'] ?? 1;\r\n this.addressType = params['addressType'];\r\n this.parcelType = params['parcelType'];\r\n this.ownerType = params['ownerType'];\r\n this.addressRequired = (params['addressRequired'] === 'Y');\r\n this.parcelRequired = (params['parcelRequired'] === 'Y');\r\n this.ownerRequired = (params['ownerRequired'] === 'Y');\r\n\r\n this.compOrder = [...params['compOrder']];\r\n \r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n this.store.select(selectAppSettings)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe({\r\n next: state => {\r\n this.adminMode = state.AdminMode;\r\n this.addressMode = PageLayoutMode.ADMIN;\r\n this.ownerMode = PageLayoutMode.ADMIN;\r\n this.parcelMode = PageLayoutMode.ADMIN;\r\n }\r\n });\r\n\r\n this.settingsService.isXAPOAgency()\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(isXapo => {\r\n this.xapoMode = isXapo;\r\n\r\n this.capModelService.getAddressesFromCapModel(this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe((res: AddressModel[]) => {\r\n if (res && res.length > 0) {\r\n //reset addresses to match Cap Model in session\r\n sortByProperty(res, 'primaryFlag', 'DESC');\r\n this.addressCards = res;\r\n //Set a primary record if none already provided\r\n this.setPrimaryAddressIfNeeded();\r\n }\r\n }, error => {\r\n this.handleError(error);\r\n });\r\n\r\n this.capModelService.getParcelsFromCapModel(this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe((res: ParcelModel[]) => {\r\n if (res && res.length > 0) {\r\n //reset parcels to match Cap Model in Session\r\n sortByProperty(res, 'primaryParcelFlag', 'DESC');\r\n this.parcelCards = res;\r\n //Set a primary record if none already provided\r\n this.setPrimaryParcelIfNeeded();\r\n }\r\n }, error => {\r\n this.handleError(error);\r\n });\r\n\r\n this.capModelService.getOwnersFromCapModel(this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe((res: OwnerModel[]) => {\r\n if (res && res.length > 0) {\r\n //reset owners to match Cap Model in Session\r\n sortByProperty(res, 'isPrimary', 'DESC');\r\n this.ownerCards = res;\r\n //Set a primary record if none already provided\r\n this.setPrimaryOwnerIfNeeded();\r\n }\r\n }, error => {\r\n this.handleError(error);\r\n });\r\n });\r\n\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n window.parent.postMessage('CommunityView:Resize', '*');\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.destroyActions.next();\r\n this.destroyActions.complete();\r\n }\r\n\r\n handleError(error: any) {\r\n if (typeof error !== 'string') {\r\n error = error.error;\r\n }\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: error,\r\n closable: false\r\n });\r\n }\r\n\r\n /* Primary Record Handling */\r\n\r\n setPrimaryAddressIfNeeded() {\r\n if (this.addressCards.length > 0) {\r\n if (!(this.addressCards.find((addr) => addr.primaryFlag === FlagEnum.Y))) {\r\n this.addressCards[0].primaryFlag = FlagEnum.Y;\r\n }\r\n }\r\n }\r\n\r\n setPrimaryParcelIfNeeded() {\r\n if (this.parcelCards.length > 0) {\r\n if (!(this.parcelCards.find((parcel) => parcel.primaryParcelFlag === FlagEnum.Y))) {\r\n this.parcelCards[0].primaryParcelFlag = FlagEnum.Y;\r\n }\r\n }\r\n }\r\n\r\n setPrimaryOwnerIfNeeded() {\r\n if (this.ownerCards.length > 0) {\r\n if (!(this.ownerCards.find((owner) => owner.isPrimary === FlagEnum.Y))) {\r\n this.ownerCards[0].isPrimary = FlagEnum.Y;\r\n }\r\n }\r\n }\r\n\r\n setPrimaryAddress(primaryRecord: AddressModel) {\r\n //Setting PrimaryFlag as 'N' to all addresses\r\n this.addressCards.forEach((card) => {\r\n card.primaryFlag = FlagEnum.N;\r\n });\r\n //Setting PrimaryFlag as 'Y' to current Address\r\n primaryRecord.primaryFlag = FlagEnum.Y;\r\n\r\n //Saving Address Data to capModel\r\n this.saveChanges(APOEntityType.Address);\r\n }\r\n\r\n suggestionsFoundClick(suggestionRecord: ApoSuggestion) {\r\n if (suggestionRecord?.addresses.length === 1) {\r\n this.addAddresses(suggestionRecord.addresses);\r\n }\r\n if (suggestionRecord?.parcels.length === 1) {\r\n this.addParcels(suggestionRecord.parcels);\r\n }\r\n if (suggestionRecord?.owners.length === 1) {\r\n this.addOwners(suggestionRecord.owners);\r\n }\r\n }\r\n\r\n setPrimaryParcel(primaryRecord: ParcelModel) {\r\n //Setting PrimaryFlag as 'N' to all addresses\r\n this.parcelCards.forEach((card) => {\r\n card.primaryParcelFlag = FlagEnum.N;\r\n });\r\n\r\n //Setting PrimaryFlag as 'Y' to current Address\r\n primaryRecord.primaryParcelFlag = FlagEnum.Y;\r\n\r\n //Saving Address Data to capModel\r\n this.saveChanges(APOEntityType.Address);\r\n }\r\n\r\n setPrimaryOwner(primaryRecord: OwnerModel) {\r\n //Setting PrimaryFlag as 'N' to all addresses\r\n this.ownerCards.forEach((card) => {\r\n card.isPrimary = FlagEnum.N;\r\n });\r\n //Setting PrimaryFlag as 'Y' to current Address\r\n primaryRecord.isPrimary = FlagEnum.Y;\r\n\r\n //Saving Address Data to capModel\r\n this.saveChanges(APOEntityType.Owner);\r\n }\r\n\r\n /* Add,Search launch links */\r\n addAddressClick(event: Event) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n this.processing = true;\r\n if (this.addressMax > this.addressCards.length) {\r\n \r\n this.addressMode = PageLayoutMode.EDIT;\r\n const addressModel = new AddressModel();\r\n this.addressCards.push(addressModel);\r\n this.selectedAddress = addressModel;\r\n this.addressFormLayout.updateAddressFormInstance(addressModel);\r\n this.showAddressForm = true;\r\n } else {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: $localize`A maximum of ${this.addressMax} address(es) can be added to this record.`,\r\n closable: false\r\n });\r\n }\r\n this.processing = false;\r\n }\r\n\r\n searchAddressClick(event: Event) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n\r\n this.processing = true;\r\n if (this.addressMax > this.addressCards.length) {\r\n this.sourceType = APOEntityType.Address;\r\n this.addressMode = PageLayoutMode.SEARCH;\r\n this.addressFormLayout.updateAddressFormInstance(new AddressModel());\r\n this.showAddressForm = true;\r\n } else {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: $localize`A maximum of ${this.addressMax} address(es) can be added to this record.`,\r\n closable: false\r\n });\r\n }\r\n this.processing = false;\r\n }\r\n\r\n viewAddressClick(addressModel: AddressModel) {\r\n if (this.adminMode) {\r\n return;\r\n }\r\n\r\n this.processing = true;\r\n this.selectedAddress = addressModel;\r\n this.addressFormLayout.updateAddressFormInstance(addressModel);\r\n this.addressMode = PageLayoutMode.VIEW;\r\n this.showAddressForm = true;\r\n this.processing = false;\r\n }\r\n\r\n\r\n addParcelClick(event: Event) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n \r\n const parcelModel = new ParcelModel();\r\n this.parcelCards.push(parcelModel);\r\n this.selectedParcel = parcelModel;\r\n this.parcelFormLayout.updateFormInstance(parcelModel);\r\n this.showParcelForm = true;\r\n }\r\n\r\n searchParcelClick(event: Event) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n\r\n this.processing = true;\r\n if (this.parcelMax > this.parcelCards.length) {\r\n this.sourceType = APOEntityType.Parcel;\r\n this.parcelMode = PageLayoutMode.SEARCH;\r\n this.parcelFormLayout.updateFormInstance(new ParcelModel());\r\n this.showParcelForm = true;\r\n } else {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: $localize`A maximum of ${this.parcelMax} parcel(s) can be added to this record.`,\r\n closable: false\r\n });\r\n }\r\n this.processing = false;\r\n }\r\n\r\n viewParcelClick(parcelModel: ParcelModel) {\r\n\r\n if (this.adminMode) {\r\n return;\r\n }\r\n\r\n this.processing = true;\r\n this.selectedParcel = parcelModel;\r\n this.parcelFormLayout.updateFormInstance(parcelModel);\r\n this.parcelMode = PageLayoutMode.VIEW;\r\n this.showParcelForm = true;\r\n this.processing = false;\r\n }\r\n\r\n\r\n addOwnerClick(event: Event) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n \r\n const ownerModel = new OwnerModel();\r\n this.ownerCards.push(ownerModel);\r\n this.selectedOwner = ownerModel;\r\n this.ownerFormLayout.updateFormInstance(ownerModel);\r\n this.showOwnerForm = true;\r\n }\r\n\r\n searchOwnerClick(event: Event) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n\r\n this.processing = true;\r\n if (this.ownerMax > this.ownerCards.length) {\r\n this.sourceType = APOEntityType.Owner;\r\n this.ownerMode = PageLayoutMode.SEARCH;\r\n this.ownerFormLayout.updateFormInstance(new OwnerModel());\r\n this.showOwnerForm = true;\r\n } else {\r\n this.messageService.clear();\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: $localize`A maximum of ${this.ownerMax} owner(s) can be added to this record.`,\r\n closable: false\r\n });\r\n }\r\n this.processing = false;\r\n }\r\n\r\n viewOwnerClick(ownerModel: OwnerModel) {\r\n\r\n if (this.adminMode) {\r\n return;\r\n }\r\n\r\n this.processing = true;\r\n this.selectedOwner = ownerModel;\r\n this.ownerFormLayout.updateFormInstance(ownerModel);\r\n this.ownerMode = PageLayoutMode.VIEW;\r\n this.showOwnerForm = true;\r\n this.processing = false;\r\n }\r\n\r\n editRecordClick(record: ApoQueryable) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n\r\n if (record.hasOwnProperty('addressId')) {\r\n this.selectedAddress = record as AddressModel;\r\n this.showAddressForm = true;\r\n } else if (record.hasOwnProperty('parcelNumber')) {\r\n this.selectedParcel = record as ParcelModel;\r\n this.showParcelForm = true;\r\n } else if (record.hasOwnProperty('ownerNumber')) {\r\n this.selectedOwner = record as OwnerModel;\r\n this.showOwnerForm = true;\r\n }\r\n }\r\n\r\n /* Add Methods */\r\n addAddress(addr: AddressModel) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.addressCards.findIndex((address) => address.UID === addr.UID);\r\n\r\n } else {\r\n idx = this.addressCards.findIndex((address) => address.addressId === addr.addressId);\r\n }\r\n \r\n if (idx >= 0) {\r\n this.addressCards[idx] = addr; //replace records\r\n } else {\r\n this.addressCards.push(addr);\r\n }\r\n this.setPrimaryAddressIfNeeded();\r\n }\r\n\r\n addParcel(prcl: ParcelModel) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n \r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.parcelCards.findIndex((parcel) => parcel.UID === prcl.UID);\r\n } else {\r\n idx = this.parcelCards.findIndex((parcel) => parcel.parcelNumber === prcl.parcelNumber);\r\n }\r\n\r\n if (idx >= 0) {\r\n this.parcelCards[idx] = prcl; //replace records\r\n } else {\r\n this.parcelCards.push(prcl);\r\n }\r\n this.setPrimaryParcelIfNeeded();\r\n\r\n }\r\n\r\n addOwner(ownr: OwnerModel) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n\r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.ownerCards.findIndex((owner) => owner.UID === ownr.UID);\r\n } else {\r\n idx = this.ownerCards.findIndex((owner) => owner.ownerNumber === ownr.ownerNumber);\r\n }\r\n\r\n if (idx >= 0) {\r\n this.ownerCards[idx] = ownr; //replace records\r\n } else {\r\n this.ownerCards.push(ownr);\r\n }\r\n this.setPrimaryOwnerIfNeeded();\r\n }\r\n\r\n /* Delete / Remove methods */\r\n deleteRecordClick(record: ApoQueryable) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n\r\n let isRecordDeleted = false;\r\n let apoEntityType;\r\n\r\n if (record.hasOwnProperty('addressId') || record.hasOwnProperty('refAddressId')) {\r\n apoEntityType = APOEntityType.Address;\r\n this.selectedAddress = null;\r\n this.showAddressForm = false;\r\n const addr = record as AddressModel;\r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.addressCards.findIndex((address) => address.UID === addr.UID);\r\n } else {\r\n idx = this.addressCards.findIndex((address) => address.addressId === addr.addressId);\r\n }\r\n const primaryRecordDeleted = addr.primaryFlag === FlagEnum.Y;\r\n if (idx >= 0) {\r\n this.addressCards.splice(idx, 1);\r\n isRecordDeleted = true;\r\n }\r\n //set primary when detlete the primary address\r\n if (primaryRecordDeleted && this.addressCards.length > 0) {\r\n this.setPrimaryAddressIfNeeded();\r\n }\r\n } else if (record.hasOwnProperty('parcelNumber')) {\r\n apoEntityType = APOEntityType.Parcel;\r\n this.selectedParcel = null;\r\n this.showParcelForm = false;\r\n const prcl = record as ParcelModel;\r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.parcelCards.findIndex((parcel) => parcel.UID === prcl.UID);\r\n } else {\r\n idx = this.parcelCards.findIndex((parcel) => parcel.parcelNumber === prcl.parcelNumber);\r\n }\r\n const primaryRecordDeleted = prcl.primaryParcelFlag === FlagEnum.Y;\r\n if (idx >= 0) {\r\n this.parcelCards.splice(idx, 1);\r\n isRecordDeleted = true;\r\n }\r\n //set primary when detlete the primary address\r\n if (primaryRecordDeleted && this.parcelCards.length > 0) {\r\n this.setPrimaryParcelIfNeeded();\r\n }\r\n\r\n } else if (record.hasOwnProperty('ownerNumber')) {\r\n apoEntityType = APOEntityType.Owner;\r\n this.selectedOwner = null;\r\n this.showOwnerForm = false;\r\n\r\n const ownr = record as OwnerModel;\r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.ownerCards.findIndex((owner) => owner.UID === ownr.UID);\r\n } else {\r\n idx = this.ownerCards.findIndex((owner) => owner.ownerNumber === ownr.ownerNumber);\r\n }\r\n const primaryRecordDeleted = ownr.isPrimary === FlagEnum.Y;\r\n if (idx >= 0) {\r\n this.ownerCards.splice(idx, 1);\r\n isRecordDeleted = true;\r\n }\r\n //set primary when detlete the primary address\r\n if (primaryRecordDeleted && this.ownerCards.length > 0) {\r\n this.setPrimaryOwnerIfNeeded();\r\n }\r\n\r\n } else {\r\n console.log('Error: Unable to identify record for deletion');\r\n console.log(record);\r\n }\r\n //Saving Data to capModel when APO is deleted\r\n if (isRecordDeleted) {\r\n this.saveChanges(apoEntityType);\r\n }\r\n }\r\n\r\n /* Record Filtering */\r\n //if APO, check to see if addressId present and compare - else compare refAddressId\r\n filterAddress =\r\n (addr: AddressModel, index: number, arry: Array): boolean =>\r\n this.xapoMode\r\n ? arry.findIndex(s => s.UID === addr.UID) < 0\r\n : (addr.addressId\r\n ? arry.findIndex(s => (s.addressId === addr.addressId)) < 0\r\n : arry.findIndex(s => s.refAddressId === addr.refAddressId) < 0);\r\n\r\n //if APO, compare parcelNumber\r\n filterParcels =\r\n (prcl: ParcelModel, index: number, arry: Array): boolean =>\r\n this.xapoMode\r\n ? arry.findIndex(s => s.UID === prcl.UID) < 0\r\n : arry.findIndex(s => s.parcelNumber === prcl.parcelNumber) < 0;\r\n\r\n //if APO, compare ownerNumber\r\n filterOwners =\r\n (ownr: OwnerModel, index: number, arry: Array): boolean =>\r\n this.xapoMode\r\n ? arry.findIndex(s => s.UID === ownr.UID) < 0\r\n : arry.findIndex(s => s.ownerNumber === ownr.ownerNumber) < 0;\r\n\r\n /* Cross Page Messaging */\r\n resize(event) {\r\n window.parent.postMessage('CommunityView:ResizeDialog', '*');\r\n }\r\n\r\n collapseSize(event) {\r\n window.parent.postMessage('CommunityView:RemoveMin', '*');\r\n }\r\n\r\n /* UI Operations */\r\n closeAddressDialog(event: boolean) {\r\n this.showAddressForm = false;\r\n }\r\n\r\n closeParcelDialog(event: boolean) {\r\n this.showParcelForm = false;\r\n }\r\n\r\n closeOwnerDialog(event: boolean) {\r\n this.showOwnerForm = false;\r\n }\r\n\r\n /* Save Operations */\r\n addAddresses(newAddresses: AddressModel[]) {\r\n newAddresses.forEach(addr => {\r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.addressCards.findIndex((a) => a.UID === addr.UID);\r\n }\r\n else {\r\n if (addr.refAddressId) {\r\n idx = this.addressCards.findIndex((a) => a.refAddressId === addr.refAddressId);\r\n }\r\n else if(addr.addressId){\r\n idx = this.addressCards.findIndex((a) => a.addressId === addr.addressId);\r\n }\r\n }\r\n if (idx >= 0) {\r\n this.addressCards.splice(idx, 1);\r\n }\r\n this.addressCards.push(addr);\r\n });\r\n this.showAddressForm = false;\r\n this.setPrimaryAddressIfNeeded();\r\n this.saveChanges(APOEntityType.Address);\r\n }\r\n\r\n addParcels(newparcels: ParcelModel[]) {\r\n newparcels.forEach(prcl => {\r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.parcelCards.findIndex((p) => p.UID === prcl.UID);\r\n } else {\r\n idx = this.parcelCards.findIndex((p) => p.parcelNumber === prcl.parcelNumber);\r\n }\r\n if (idx >= 0) {\r\n this.parcelCards.splice(idx, 1);\r\n }\r\n this.parcelCards.push(prcl);\r\n });\r\n this.showParcelForm = false;\r\n this.setPrimaryParcelIfNeeded();\r\n this.saveChanges(APOEntityType.Parcel);\r\n }\r\n\r\n addOwners(newOwners: OwnerModel[]) {\r\n newOwners.forEach(own => {\r\n let idx = -1;\r\n if (this.xapoMode) {\r\n idx = this.ownerCards.findIndex(o => o.UID === own.UID);\r\n } else {\r\n idx = this.ownerCards.findIndex(o => o.ownerNumber === own.ownerNumber);\r\n }\r\n if (idx >= 0) {\r\n this.ownerCards.splice(idx, 1);\r\n }\r\n this.ownerCards.push(own);\r\n });\r\n this.showOwnerForm = false;\r\n this.setPrimaryOwnerIfNeeded();\r\n this.saveChanges(APOEntityType.Owner);\r\n }\r\n\r\n saveChanges(apoEntityType) {\r\n if (this.adminMode || this.processing) {\r\n return;\r\n }\r\n let result = true;\r\n if (apoEntityType === APOEntityType.Address) {\r\n this.capModelService.saveAddressesToCapModel(this.addressCards, this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n if (res !== 'success') {\r\n result = false;\r\n }\r\n }, error => {\r\n this.handleError(error);\r\n });\r\n }\r\n\r\n if (apoEntityType === APOEntityType.Parcel) {\r\n this.capModelService.saveParcelsToCapModel(this.parcelCards, this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n if (res !== 'success') {\r\n result = false;\r\n }\r\n });\r\n }\r\n\r\n if (apoEntityType === APOEntityType.Owner) {\r\n this.capModelService.saveOwnersToCapModel(this.ownerCards, this.module)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe(res => {\r\n if (res !== 'success') {\r\n result = false;\r\n }\r\n }, error => {\r\n this.handleError(error);\r\n });\r\n }\r\n this.messageService.clear();\r\n\r\n if (result) {\r\n this.messageService.add({\r\n severity: 'success',\r\n summary: $localize`Your changes were applied successfully.`,\r\n closable: false\r\n });\r\n } else {\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: $localize`An Error occured while applying your changes. Please try again.`,\r\n closable: false\r\n });\r\n }\r\n }\r\n}\r\n","import { Routes, RouterModule } from '@angular/router';\r\nimport { MultiApoScreenComponent } from './screens/multi-apo-screen/multi-apo-screen.component';\r\n\r\nexport const APORoutes: Routes = [\r\n { path: 'multi-search', component: MultiApoScreenComponent },\r\n { path: '', redirectTo: 'new', pathMatch: 'full' },\r\n { path: '**', redirectTo: '/404' }\r\n\r\n];\r\n\r\nexport const APORoutingModule = RouterModule.forChild(\r\n APORoutes\r\n);\r\n","import { NgModule } from '@angular/core';\r\nimport { CommonModule, DatePipe } from '@angular/common';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport { CardModule } from 'primeng/card';\r\nimport {DialogModule} from 'primeng/dialog';\r\nimport {TableModule} from 'primeng/table';\r\nimport { ToastModule } from 'primeng/toast';\r\nimport {TooltipModule} from 'primeng/tooltip';\r\n\r\nimport { SharedModule } from '../shared/shared.module';\r\nimport { APORoutingModule } from './apo.routes';\r\n\r\nimport { AddressListComponent } from './components/address-list/address-list.component';\r\n\r\nimport { OwnerListComponent } from './components/owner-list/owner-list.component';\r\nimport { ParcelListComponent } from './components/parcel-list/parcel-list.component';\r\nimport { SearchResultsPanelComponent } from './components/apo-search-results-panel/apo-search-results-panel.component';\r\nimport { MultiApoScreenComponent } from './screens/multi-apo-screen/multi-apo-screen.component';\r\nimport { AddressCardComponent } from './components/address-card/address-card.component';\r\nimport { ParcelCardComponent } from './components/parcel-card/parcel-card.component';\r\nimport { OwnerCardComponent } from './components/owner-card/owner-card.component';\r\nimport { EditAddressFormComponent } from './components/edit-address-form/edit-address-form.component';\r\nimport { EditParcelFormComponent } from './components/edit-parcel-form/edit-parcel-form.component';\r\nimport { EditOwnerFormComponent } from './components/edit-owner-form/edit-owner-form.component';\r\n\r\n\r\n@NgModule({\r\n declarations: [\r\n AddressListComponent,\r\n OwnerListComponent,\r\n ParcelListComponent,\r\n SearchResultsPanelComponent,\r\n MultiApoScreenComponent,\r\n AddressCardComponent,\r\n ParcelCardComponent,\r\n OwnerCardComponent,\r\n EditAddressFormComponent,\r\n EditParcelFormComponent,\r\n EditOwnerFormComponent\r\n ],\r\n imports: [\r\n APORoutingModule,\r\n ButtonModule,\r\n CardModule,\r\n DialogModule,\r\n CommonModule,\r\n SharedModule,\r\n TableModule,\r\n ToastModule,\r\n TooltipModule\r\n ],\r\n exports: [\r\n\r\n ],\r\n providers: [\r\n DatePipe\r\n ]\r\n})\r\nexport class APOModule {}\r\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'accela-button-primary',\r\n templateUrl: './accela-button-primary.component.html',\r\n styleUrls: ['./accela-button-primary.component.css']\r\n})\r\nexport class AccelaButtonPrimaryComponent implements OnInit {\r\n\r\n @Output('onClicked') clickEmitter = new EventEmitter(true);\r\n\r\n @Input('icon') iconName: string;\r\n @Input('label') labelContent: string;\r\n @Input('disabled') processing: boolean;\r\n @Input() accessButton: string = null;\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n click(event: any){\r\n this.clickEmitter.emit(event);\r\n }\r\n}\r\n","\r\n \r\n
\r\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'accela-button-secondary',\r\n templateUrl: './accela-button-secondary.component.html',\r\n styleUrls: ['./accela-button-secondary.component.css']\r\n})\r\nexport class AccelaButtonSecondaryComponent implements OnInit {\r\n\r\n @Output('click') clickEmitter = new EventEmitter(true);\r\n\r\n @Input('icon') iconName: string;\r\n @Input('label') labelContent: string;\r\n @Input('disabled') processing: boolean;\r\n @Input() accessButton: string = null;\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n click(event: any){\r\n this.clickEmitter.emit(event);\r\n }\r\n\r\n}\r\n"," ","\r\n\r\n \r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-checkbox-input',\r\n templateUrl: './accela-checkbox-input.component.html',\r\n styleUrls: ['./accela-checkbox-input.component.css']\r\n})\r\nexport class AccelaCheckboxInputComponent implements OnInit, AfterViewInit {\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n @Output() oncbChange = new EventEmitter();\r\n label: string;\r\n\r\n controlData: AccelaControl;\r\n\r\n Value: boolean;\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(): string{\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getRequiredFieldValidationMsg(): string{\r\n return this.requiredValidationMsg + ' '+this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n handleInputChange(event) { \r\n this.oncbChange.emit(event.checked);\r\n }\r\n}\r\n","\r\n
{{this.label}} \r\n
\r\n \r\n
\r\n\r\n \r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-date-input',\r\n templateUrl: './accela-date-input.component.html',\r\n styleUrls: ['./accela-date-input.component.css']\r\n})\r\nexport class AccelaDateInputComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n label: string;\r\n controlData: AccelaControl;\r\n value: Date;\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(){\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n
\r\n
{{this.label}} \r\n
\r\n \r\n
\r\n
\r\n\r\n \r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, Renderer2, ViewChild, ViewEncapsulation } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { Dropdown } from 'primeng/dropdown';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-dropdown-input',\r\n templateUrl: './accela-dropdown-input.component.html',\r\n styleUrls: ['./accela-dropdown-input.component.css'],\r\n})\r\nexport class AccelaDropdownInputComponent implements OnInit, AfterViewInit {\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n \r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n @ViewChild('dropdownWrapper') accelaDropdown: Dropdown;\r\n\r\n label: string;\r\n\r\n controlData: AccelaControl;\r\n\r\n Value: string;\r\n\r\n constructor(private renderer: Renderer2) {}\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n\r\n this.accelaDropdown.labelId = this.getLabelElementId();\r\n const dropdownIconRef = this.accelaControlDiv.nativeElement.querySelector('div[role=\\'button\\']');\r\n if(dropdownIconRef){\r\n this.renderer.setAttribute(dropdownIconRef,'aria-label', 'Select '+this.controlData.label);\r\n }\r\n\r\n const inputControlRef = this.accelaControlDiv.nativeElement.querySelector('#'+this.controlData.name+'Input');\r\n if(inputControlRef){\r\n this.renderer.removeAttribute(inputControlRef,'aria-activedescendant');\r\n this.renderer.setAttribute(inputControlRef,'aria-label', this.controlData.label);\r\n }\r\n\r\n const dropdownLabelRef = this.accelaControlDiv.nativeElement.querySelectorAll('#'+this.getLabelElementId());\r\n if(dropdownLabelRef){\r\n dropdownLabelRef.forEach((element,idx) => {\r\n this.renderer.setAttribute(element,'id', this.controlData.name+'SelectedItem_'+idx);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(){\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'InputLabel';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any) {\r\n if (this.controlRef != null && this.controlRef.value != null)\r\n this.controlRef.setValue(this.controlRef.value.trim());\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n {{this.label}} \r\n \r\n
\r\n\r\n \r\n \r\n {{this.getEmailFieldValidationMsg()}}\r\n \r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-email-input',\r\n templateUrl: './accela-email-input.component.html',\r\n styleUrls: ['./accela-email-input.component.css']\r\n})\r\nexport class AccelaEmailInputComponent implements OnInit, AfterViewInit {\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Input() emailValidationMsg: string;\r\n\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n label: string;\r\n controlData: AccelaControl;\r\n Value: string;\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(){\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.label;\r\n }\r\n\r\n getEmailFieldValidationMsg(){\r\n return this.emailValidationMsg + ' '+this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n
\r\n \r\n
{{this.label}} \r\n
\r\n\r\n \r\n \r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-fein-input',\r\n templateUrl: './accela-fein-input.component.html',\r\n styleUrls: ['./accela-fein-input.component.css']\r\n})\r\nexport class AccelaFEINInputComponent implements OnInit, AfterViewInit {\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n label: string;\r\n controlData: AccelaControl;\r\n Value: string;\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId() {\r\n return 'div_' + this.controlData.name;\r\n }\r\n\r\n getLabelElementId() {\r\n return this.controlData.name + 'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg() {\r\n return this.requiredValidationMsg + ' ' + this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n\r\n
\r\n \r\n
{{this.controlData.label}} \r\n
\r\n\r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, Renderer2, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { InputNumber } from 'primeng/inputnumber';\r\nimport { AccelaControl } from '../../model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-money-input',\r\n templateUrl: './accela-money-input.component.html',\r\n styleUrls: ['./accela-money-input.component.less']\r\n})\r\nexport class AccelaMoneyInputComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n @ViewChild('numInput') inputNumber: InputNumber;\r\n\r\n maxLength: number; //maximum number of character that can be entered\r\n\r\n controlData: AccelaControl;\r\n\r\n constructor(private renderer: Renderer2) { }\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if (this.adminMode) {\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) => {\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n const inputRef = this.inputNumber.el.nativeElement.querySelector('input');\r\n if (inputRef) {\r\n //AXE doesn't allow aria-valuenow to equal null\r\n this.renderer.removeAttribute(inputRef, 'aria-valuenow');\r\n }\r\n }\r\n\r\n getDivElementId() {\r\n return 'div_' + this.controlData.name;\r\n }\r\n\r\n getLabelElementId() {\r\n return this.controlData.name + 'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg() {\r\n return this.requiredValidationMsg + ' ' + this.controlData.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({ controlData: this.controlData, elementRef: e });\r\n }\r\n\r\n emitBlurEvent(event: any) {\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n\r\n
\r\n \r\n
{{this.controlData.label}} \r\n
\r\n\r\n \r\n \r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, Renderer2, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { InputNumber } from 'primeng/inputnumber';\r\nimport { AccelaControl } from '../../model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-number-input',\r\n templateUrl: './accela-number-input.component.html',\r\n styleUrls: ['./accela-number-input.component.css']\r\n})\r\nexport class AccelaNumberInputComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n @ViewChild('numInput') inputNumber: InputNumber;\r\n\r\n maxLength: number; //maximum number of character that can be entered\r\n\r\n controlData: AccelaControl;\r\n\r\n constructor(private renderer: Renderer2) {}\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n\r\n const inputRef = this.inputNumber.el.nativeElement.querySelector('input');\r\n if(inputRef){\r\n //AXE doesn't allow aria-valuenow to equal null\r\n this.renderer.removeAttribute(inputRef,'aria-valuenow');\r\n }\r\n\r\n\r\n }\r\n\r\n getDivElementId(){\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.controlData.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n \r\n {{this.label}} \r\n
\r\n\r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n \r\n Password Confirmation does not match Password.\r\n \r\n \r\n {{this.controlRef?.errors?.passwordReq}}\r\n \r\n\r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, FormControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-password-input',\r\n templateUrl: './accela-password-input.component.html',\r\n styleUrls: ['./accela-password-input.component.css']\r\n})\r\nexport class AccelaPasswordInputComponent implements OnInit, AfterViewInit {\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Input() maxLength = 30; //maximum number of character that can be entered\r\n @Output() selectionEvent = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n label: string;\r\n controlData: AccelaControl;\r\n Value: string;\r\n\r\n constructor() {\r\n }\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(){\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n}\r\n","\r\n
{{this.label}} \r\n
\r\n \r\n
\r\n\r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-phone-input',\r\n templateUrl: './accela-phone-input.component.html',\r\n styleUrls: ['./accela-phone-input.component.css']\r\n})\r\nexport class AccelaPhoneInputComponent implements OnInit, AfterViewInit {\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n label: string;\r\n controlData: AccelaControl;\r\n\r\n Value: string;\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(){\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n"," \r\n \r\n {{this.controlData.label}} \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from '../../model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-radio-group',\r\n templateUrl: './accela-radio-group.component.html',\r\n styleUrls: ['./accela-radio-group.component.css']\r\n})\r\nexport class AccelaRadioGroupComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n controlData: AccelaControl;\r\n label: string;\r\n Value: string;\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(){ \r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.label;\r\n }\r\n\r\n getOptionLabel(opt){\r\n if (opt.label === 'Option1') {\r\n opt.value = 'Y';\r\n return 'Yes';\r\n } else if (opt.label === 'Option2') {\r\n opt.value = 'N';\r\n return 'No';\r\n } else {\r\n return opt.label;\r\n }\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'accela-separator',\r\n templateUrl: './accela-separator.component.html',\r\n styleUrls: ['./accela-separator.component.css']\r\n})\r\nexport class AccelaSeparatorComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n}\r\n","\r\n\r\n\r\n
\r\n\r\n","\r\n
{{this.label}} \r\n
\r\n \r\n
\r\n\r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-ssn-input',\r\n templateUrl: './accela-ssn-input.component.html',\r\n styleUrls: ['./accela-ssn-input.component.css']\r\n})\r\nexport class AccelaSsnInputComponent implements OnInit, AfterViewInit {\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n label: string;\r\n\r\n\r\n controlData: AccelaControl;\r\n\r\n Value: string;\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId() {\r\n return 'div_' + this.controlData.name;\r\n }\r\n\r\n getLabelElementId() {\r\n return this.controlData.name + 'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg() {\r\n return this.requiredValidationMsg + ' ' + this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n \r\n {{controlData.label}} \r\n
\r\n\r\n \r\n \r\n \r\n {{getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from 'src/app/modules/shared/model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-text-input',\r\n templateUrl: './accela-text-input.component.html',\r\n styleUrls: ['./accela-text-input.component.css']\r\n})\r\nexport class AccelaTextInputComponent implements OnInit, AfterViewInit {\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n maxLength: number; //maximum number of character that can be entered\r\n\r\n controlData: AccelaControl;\r\n\r\n constructor(){}\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(){\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.controlData.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n}\r\n","\r\n {{controlData.label}} \r\n \r\n
\r\n \r\n \r\n {{getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from 'src/app/modules/shared/model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-textarea-input',\r\n templateUrl: './accela-textarea-input.component.html',\r\n styleUrls: ['./accela-textarea-input.component.less']\r\n})\r\nexport class AccelaTextareaInputComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n maxLength: number; //maximum number of character that can be entered\r\n\r\n controlData: AccelaControl;\r\n\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if (this.adminMode) {\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) => {\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId() {\r\n return 'div_' + this.controlData.name;\r\n }\r\n\r\n getLabelElementId() {\r\n return this.controlData.name + 'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg() {\r\n return this.requiredValidationMsg + ' ' + this.controlData.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({ controlData: this.controlData, elementRef: e });\r\n }\r\n\r\n emitBlurEvent(event: any) {\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n
{{this.label}} \r\n
\r\n \r\n
\r\n\r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-timepicker-input',\r\n templateUrl: './accela-timepicker-input.component.html',\r\n styleUrls: ['./accela-timepicker-input.component.less']\r\n})\r\nexport class AccelaTimepickerInputComponent implements OnInit, AfterViewInit {\r\n @Input() controlRef: AbstractControl;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() requiredValidationMsg: string;\r\n\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n label: string;\r\n controlData: AccelaControl;\r\n value: Date;\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if (this.adminMode) {\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) => {\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId() {\r\n return 'div_' + this.controlData.name;\r\n }\r\n\r\n getLabelElementId() {\r\n return this.controlData.name + 'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg() {\r\n return this.requiredValidationMsg + ' ' + this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({ controlData: this.controlData, elementRef: e });\r\n }\r\n\r\n emitBlurEvent(event: any) {\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n}\r\n","\r\n
\r\n \r\n
{{this.label}} \r\n
\r\n\r\n \r\n \r\n \r\n {{this.getRequiredFieldValidationMsg()}}\r\n \r\n
\r\n","import { AfterViewInit, Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';\r\nimport { AbstractControl, UntypedFormGroup } from '@angular/forms';\r\nimport { AccelaControl } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\n\r\n@Component({\r\n selector: 'accela-zip-input',\r\n templateUrl: './accela-zip-input.component.html',\r\n styleUrls: ['./accela-zip-input.component.css']\r\n})\r\nexport class AccelaZipInputComponent implements OnInit, AfterViewInit {\r\n\r\n @Input() controlRef: AbstractControl;\r\n @Input() adminMode = false;\r\n @Input() readonlyMode = false;\r\n @Input() parentFormRef: UntypedFormGroup;\r\n @Input() requiredValidationMsg: string;\r\n @Output() selectionEvent = new EventEmitter();\r\n @Output() focusChange = new EventEmitter();\r\n @ViewChild('accelaControlDiv') accelaControlDiv: ElementRef;\r\n\r\n label: string;\r\n maxLength: number; //maximum number of character that can be entered\r\n\r\n controlData: AccelaControl;\r\n\r\n constructor() { }\r\n\r\n ngOnInit(): void {\r\n this.controlData = this.controlRef.controlData;\r\n this.label = this.controlData.label;\r\n }\r\n\r\n ngAfterViewInit(): void {\r\n if(this.adminMode){\r\n this.controlData.readOnly = true;\r\n this.accelaControlDiv.nativeElement.addEventListener('click', (e: MouseEvent) =>{\r\n this.adminSelect(e.target as Element);\r\n });\r\n }\r\n }\r\n\r\n getDivElementId(){\r\n return 'div_'+this.controlData.name;\r\n }\r\n\r\n getLabelElementId(){\r\n return this.controlData.name+'Label';\r\n }\r\n\r\n getRequiredFieldValidationMsg(){\r\n return this.requiredValidationMsg + ' '+this.label;\r\n }\r\n\r\n adminSelect(e: Element): void {\r\n this.selectionEvent.emit({controlData: this.controlData, elementRef: e});\r\n }\r\n\r\n emitBlurEvent(event: any){\r\n this.focusChange.emit(this.controlRef);\r\n }\r\n\r\n}\r\n","\r\n\r\n \r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n \r\n\r\n\r\n \r\n \r\n\t\t\r\n\t\t\t\r\n\t\t \r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n \r\n\t\t\t\t \r\n\t\t\t \r\n\t\t \r\n\t \r\n \r\n","import { AfterViewInit, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core';\r\nimport { UntypedFormBuilder, UntypedFormControl, } from '@angular/forms';\r\nimport { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';\r\nimport { DomHandler } from 'primeng/dom';\r\nimport { OverlayPanel } from 'primeng/overlaypanel';\r\nimport { map, takeUntil } from 'rxjs/operators';\r\nimport { Subject } from 'rxjs';\r\nimport { AccelaControl, AccelaControlType } from '../../model/accelaControl.model';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { AdminSelectionEvent } from '../../model/adminSelectionEvent';\r\nimport { Editor } from 'primeng/editor';\r\nimport { PageLayoutService } from '../../services/page-layout.service';\r\nimport { SettingService } from 'src/app/modules/shared/services/setting.service';\r\n\r\n@Component({\r\n selector: 'aca-admin-page-layout',\r\n templateUrl: './admin-page-layout.component.html',\r\n styleUrls: ['./admin-page-layout.component.less']\r\n})\r\nexport class AdminPageLayoutComponent implements AfterViewInit, OnDestroy {\r\n\r\n @Input() viewId: string;\r\n @Input() module: string;\r\n @Input() permissionLevel: string;\r\n @Input() permissionValue: string;\r\n @Input() loadLayoutOnInit = true;\r\n @Input() multiCol = false;\r\n\r\n @ViewChild('op') adminUpdatePanel: OverlayPanel;\r\n @ViewChild('FieldLabelContent') fieldLabelContent: ElementRef;\r\n @ViewChild('FieldTooltip') fieldTooltip: Editor;\r\n @ViewChild('FieldWatermark') fieldWatermark: ElementRef;\r\n tooltipValue = '';\r\n controlGroup = this.formBuilder.group({});\r\n simpleViewElementList: AccelaControl[];\r\n displayFormDesigner = false;\r\n showDrpDownOptions = false;\r\n displayFieldSelection = false;\r\n adminSelectedControl: AccelaControl;\r\n controlTypes = AccelaControlType;\r\n interactionObserver: IntersectionObserver;\r\n formDesignerLink: SafeResourceUrl = this.sanitizer\r\n .bypassSecurityTrustResourceUrl(this.apiRefService\r\n .getApiUrl('Admin/NGACAFormDesigner.aspx'));\r\n hideFields: Array = [\r\n 'txtAppStreetAdd1',\r\n 'txtAppStreetAdd2',\r\n 'txtAppStreetAdd3',\r\n 'txtAppCity',\r\n 'ddlAppCountry',\r\n 'txtAppFax',\r\n 'txtAppState',\r\n 'txtAppZipApplicant'\r\n ];\r\n isContactAddressEnabled = false;\r\n protected destoryActionSbj = new Subject();\r\n\r\n constructor(private pageLayoutService: PageLayoutService, private sanitizer: DomSanitizer, private apiRefService: ApiProviderService,\r\n private formBuilder: UntypedFormBuilder, private settingService: SettingService) { }\r\n\r\n ngAfterViewInit(): void {\r\n this.formDesignerLink = this.sanitizer\r\n .bypassSecurityTrustResourceUrl(this.apiRefService\r\n .getApiUrl(`Admin/NGACAFormDesigner.aspx?module=${this.module}&viewId=${this.viewId}` +\r\n `&permissionLevel=${this.permissionLevel}&permissionValue=${this.permissionValue}§ionName=`));\r\n\r\n //uses the IntersectionObserver to track if an element is in danger of being pushed off the screen\r\n this.interactionObserver = new IntersectionObserver(this.onIntersection, {\r\n root: null, // default is the viewport\r\n threshold: .65 // percentage of taregt's visible area. Triggers \"onIntersection\"\r\n });\r\n if (this.loadLayoutOnInit) {\r\n this.refreshPageLayout();\r\n }\r\n if (this.adminUpdatePanel && this.adminUpdatePanel.el) {\r\n this.interactionObserver.observe(this.adminUpdatePanel.el.nativeElement);\r\n }\r\n }\r\n\r\n // callback is called on intersection change\r\n onIntersection(entries: Array, opts: IntersectionObserver) {\r\n entries.forEach(entry =>\r\n entry.target.classList.toggle('admin-panel-flip', entry.isIntersecting)\r\n );\r\n }\r\n //Unsort the elements by keyvalue in FormGroup\r\n unsorted() {\r\n return 0;\r\n }\r\n\r\n adminSelection(ev: AdminSelectionEvent) {\r\n this.adminSelectedControl = ev.controlData;\r\n this.tooltipValue = this.adminSelectedControl.tooltip;\r\n const hostedDiv = ev.elementRef.closest('.accelaControl');\r\n this.showDrpDownOptions = (this.adminSelectedControl.type === AccelaControlType.Dropdown\r\n && this.adminSelectedControl.name !== 'ddlQuestion' //Security Questions\r\n && !this.adminSelectedControl.templateField); //template field \r\n hostedDiv.insertAdjacentElement('afterend', this.adminUpdatePanel.el.nativeElement);\r\n if (!this.adminUpdatePanel.container) {\r\n this.adminUpdatePanel.container = this.adminUpdatePanel.el.nativeElement.firstElementChild;\r\n }\r\n this.adminUpdatePanel.show(ev.elementRef, hostedDiv);\r\n\r\n if (this.adminUpdatePanel.el.nativeElement.classList.contains('admin-panel-flip')) {\r\n DomHandler.addClass(this.adminUpdatePanel.container, 'p-overlaypanel-flipped');\r\n if (this.adminUpdatePanel.container) {\r\n const elementDimensions = this.adminUpdatePanel.container.offsetParent ?\r\n { width: this.adminUpdatePanel.container.offsetWidth, height: this.adminUpdatePanel.container.offsetHeight } :\r\n DomHandler.getHiddenElementDimensions(this.adminUpdatePanel.container);\r\n\r\n let top = hostedDiv.getBoundingClientRect().top + DomHandler.getWindowScrollTop() - elementDimensions.height;\r\n this.adminUpdatePanel.container.style.transformOrigin = 'bottom';\r\n\r\n if (top < 0) {\r\n top = DomHandler.getWindowScrollTop();\r\n }\r\n this.adminUpdatePanel.container.style.top = top + 'px';\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n submitAdminContentUpdate(controlData: AccelaControl) {\r\n\r\n if (this.fieldTooltip.getQuill().getText().length > 1) {\r\n controlData.tooltip = this.fieldTooltip.getQuill().root.innerHTML?.trim();\r\n } else {\r\n controlData.tooltip = '';\r\n }\r\n controlData.placeholder = this.fieldWatermark.nativeElement.value;\r\n controlData.label = this.fieldLabelContent.nativeElement.value;\r\n\r\n if (this.showDrpDownOptions) {\r\n //Removing the blank value options\r\n for (let i = 0; i < this.adminSelectedControl.options.length; i++) {\r\n if (this.adminSelectedControl.options[i].value === '') {\r\n this.adminSelectedControl.options.splice(i--, 1);\r\n }\r\n }\r\n controlData.options = this.adminSelectedControl.options;\r\n }\r\n\r\n this.pageLayoutService.saveUpdatedControl(controlData, this.module, this.viewId).pipe(\r\n map(res => {\r\n this.adminUpdatePanel.hide();\r\n }),\r\n takeUntil(this.destoryActionSbj)\r\n ).subscribe(() => this.refreshPageLayout());\r\n }\r\n\r\n onValChangeEvent(event: any, index: number) {\r\n this.adminSelectedControl.options[index].label = event.target.value;\r\n this.adminSelectedControl.options[index].value = event.target.value;\r\n }\r\n\r\n addField() {\r\n this.adminSelectedControl.options.push({ label: '', value: '' });\r\n }\r\n\r\n deleteField(index) {\r\n this.adminSelectedControl.options.splice(index, 1);\r\n }\r\n\r\n\r\n submitSelectedFieldsUpdate() {\r\n this.pageLayoutService\r\n .saveUpdatedControlProperties(this.simpleViewElementList, this.module, this.viewId, this.permissionLevel, this.permissionValue).pipe(\r\n map(res => {\r\n this.displayFieldSelection = false;\r\n }),\r\n takeUntil(this.destoryActionSbj)\r\n ).subscribe(() => this.refreshPageLayout());\r\n }\r\n\r\n launchRearrangeFieldWorkflow() {\r\n this.formDesignerLink = this.sanitizer\r\n .bypassSecurityTrustResourceUrl(this.apiRefService\r\n .getApiUrl(`Admin/NGACAFormDesigner.aspx?module=${this.module}&viewId=${this.viewId}` +\r\n `&permissionLevel=${this.permissionLevel}&permissionValue=${this.permissionValue}§ionName=`));\r\n this.displayFormDesigner = true;\r\n }\r\n\r\n launchSelectFieldsWorkflow() {\r\n this.displayFieldSelection = true;\r\n }\r\n\r\n refreshPageLayout() {\r\n this.controlGroup = this.formBuilder.group({});\r\n this.simpleViewElementList = [];\r\n this.settingService.isContactAddressEnabled()\r\n .subscribe((res) => {\r\n if (res) {\r\n this.isContactAddressEnabled = true;\r\n }\r\n this.loadAdminPageLayout();\r\n });\r\n\r\n }\r\n\r\n loadAdminPageLayout() {\r\n this.pageLayoutService\r\n .getDynamicFormData(this.viewId, this.module, this.permissionLevel, this.permissionValue, 'ACA ADMIN').pipe(map(controls => {\r\n this.simpleViewElementList = controls\r\n .filter(controlData =>\r\n controlData.type !== AccelaControlType.Separator\r\n && controlData.type !== AccelaControlType.Blocked\r\n && !controlData.templateField);\r\n\r\n if (this.isContactAddressEnabled) {\r\n this.simpleViewElementList = this.simpleViewElementList.filter(cntrl => !this.hideFields.includes(cntrl.name));\r\n }\r\n controls.forEach(controlData => {\r\n if (this.isContactAddressEnabled) {\r\n if (this.hideFields.indexOf(controlData.name) > -1) {\r\n controlData.display = false;\r\n controlData.required = false;\r\n }\r\n }\r\n\r\n if (this.multiCol) {\r\n if (controlData.display && controlData.type !== AccelaControlType.Separator) {\r\n const abstractControl = new UntypedFormControl(controlData.value);\r\n controlData.readOnly = true;\r\n\r\n this.pageLayoutService.processAccelaControl(controlData, abstractControl);\r\n this.controlGroup.addControl(controlData.name, abstractControl);\r\n }\r\n } else {\r\n if (controlData.display) {\r\n const abstractControl = new UntypedFormControl(controlData.value);\r\n controlData.readOnly = true;\r\n\r\n this.pageLayoutService.processAccelaControl(controlData, abstractControl);\r\n this.controlGroup.addControl(controlData.name, abstractControl);\r\n }\r\n }\r\n\r\n });\r\n this.adminSelectedControl = controls[0];\r\n }),\r\n takeUntil(this.destoryActionSbj))\r\n .subscribe();\r\n }\r\n\r\n selectedColChange(rowData: AccelaControl) { \r\n if (rowData.display === false) {\r\n rowData.required = false; \r\n }\r\n }\r\n\r\n ngOnDestroy() {\r\n this.destoryActionSbj.next();\r\n this.destoryActionSbj.complete();\r\n\r\n if (this.interactionObserver)\r\n this.interactionObserver.disconnect();\r\n }\r\n\r\n}\r\n","\r\n \r\n \r\n
\r\n \r\n \r\n
{{message.summary}}
\r\n
{{message.detail}}
\r\n
\r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n \r\n \r\n","import { Component, Input, OnInit } from '@angular/core';\r\nimport { MessageService } from 'primeng/api';\r\n\r\n@Component({\r\n selector: 'aca-alert-message',\r\n templateUrl: './alert-message.component.html',\r\n styleUrls: ['./alert-message.component.css']\r\n})\r\nexport class AlertMessageComponent implements OnInit {\r\n\r\n@Input() key;\r\n\r\n constructor(private msgService: MessageService) {\r\n }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n // to clear the prompts\r\n onCloseIconClick(event: any) {\r\n this.msgService.clear();\r\n }\r\n\r\n // public methods for invocation\r\n displaySuccess(msg: string) {\r\n this.msgService.add({severity: 'success', summary: msg, closable: false, key: this.key, life: 1000, sticky: false });\r\n }\r\n\r\n displayInfo(msg: string) {\r\n this.msgService.add({severity: 'info', summary: msg, closable: false, key: this.key, life: 1000, sticky: false });\r\n }\r\n\r\n displayWarn(msg: string) {\r\n this.msgService.add({severity: 'warn', summary: msg, closable: false, key: this.key, life: 1000, sticky: false });\r\n }\r\n\r\n displayError(msg: string, err?: any) {\r\n this.msgService.add({severity: 'error', summary: msg, detail: err, closable: false, key: this.key, life: 1000, sticky: false });\r\n }\r\n\r\n}\r\n","\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n \r\n
\r\n
\r\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\r\nimport { UntypedFormControl, UntypedFormGroup } from '@angular/forms';\r\nimport { Store } from '@ngrx/store';\r\nimport { AppState } from 'src/app/app.state';\r\nimport { AccelaControlType } from 'src/app/modules/shared/model/accelaControl.model';\r\n\r\n@Component({\r\n selector: 'aca-page-layout-display',\r\n templateUrl: './page-layout-display.component.html',\r\n styleUrls: ['./page-layout-display.component.css']\r\n})\r\nexport class PageLayoutDisplayComponent implements OnInit {\r\n\r\n @Input() controlGroup: UntypedFormGroup;\r\n\r\n @Output() controlOnBlur: EventEmitter = new EventEmitter();\r\n @Output() onchkChange = new EventEmitter();\r\n controlTypes = AccelaControlType;\r\n\r\n constructor(private store: Store) { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n //Unsort the elements by keyvalue in FormGroup\r\n unsorted() {\r\n return 0;\r\n }\r\n\r\n onFocusChange(formRef: UntypedFormControl){\r\n this.controlOnBlur.emit(formRef);\r\n }\r\n\r\n chkstatus(newItem: boolean) {\r\n this.onchkChange.emit(newItem);\r\n }\r\n}\r\n","\r\n \r\n Click here to add instruction text \r\n
\r\n\r\n \r\n \r\n \r\n","import { AfterViewInit, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { MessageService } from 'primeng/api';\r\nimport { DomHandler } from 'primeng/dom';\r\nimport { Editor } from 'primeng/editor';\r\nimport { OverlayPanel } from 'primeng/overlaypanel';\r\nimport { LocalizationService } from 'src/app/modules/shared/services/localization.service';\r\nimport { isStringNullOrWhiteSpace } from 'src/app/util/StringUtil';\r\nimport Quill from 'quill';\r\nimport { PageLayoutService } from '../../services/page-layout.service';\r\n\r\n@Component({\r\n selector: 'section-instructions',\r\n templateUrl: './section-instructions.component.html',\r\n styleUrls: ['./section-instructions.component.less']\r\n})\r\nexport class SectionInstructionsComponent implements AfterViewInit {\r\n\r\n @Input() contentKey = '';\r\n @Input() admin = false;\r\n @Input() viewId = '';\r\n @Input() module = '';\r\n @Input() permissionLevel = '';\r\n @Input() permissionValue = '';\r\n @ViewChild('opInstructions') adminUpdatePanel: OverlayPanel;\r\n @ViewChild('FieldLabelContentInstr') fieldLabelContent: Editor;\r\n @ViewChild('toolbar') toolbar: ElementRef;\r\n @ViewChild('sectionInstr') sectionControl: ElementRef;\r\n editorContent = '';\r\n sectionContent = '';\r\n placeholderActive = false;\r\n defaultContent = '';\r\n placeholderContent = $localize`Click here to add instruction text`;\r\n interactionObserver: IntersectionObserver;\r\n quill: any;\r\n\r\n constructor(private pageLayoutService: PageLayoutService, private localizationService: LocalizationService,\r\n private messageService: MessageService) { }\r\n\r\n ngAfterViewInit(): void {\r\n if (this.admin) {\r\n this.interactionObserver = new IntersectionObserver(this.onIntersection, {\r\n root: null, // default is the viewport\r\n threshold: .65 // percentage of taregt's visible area. Triggers \"onIntersection\"\r\n });\r\n\r\n this.quill = this.fieldLabelContent.getQuill();\r\n const toolbar = this.quill.getModule('toolbar');\r\n toolbar.addHandler('image', function() {\r\n const value = prompt('Enter Image URL:');\r\n if (value !== null && value !== '') {\r\n const range = this.quill.getSelection();\r\n this.quill.insertEmbed(range.index, 'image', value);\r\n this.quill.formatText(range.index, range.index + 1, 'alt', 'Image');\r\n }\r\n });\r\n\r\n if (this.contentKey !== '') {\r\n this.localizationService.getDefaultLabelByKey(this.contentKey).subscribe(resp => this.defaultContent = resp, err => {\r\n console.log(err);\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: err,\r\n closable: false\r\n });\r\n });\r\n }\r\n\r\n this.interactionObserver.observe(this.adminUpdatePanel.el.nativeElement);\r\n }\r\n this.getContentFromDb();\r\n\r\n }\r\n\r\n getContentFromDb() {\r\n if (this.contentKey !== '') {\r\n this.localizationService.getHtmlText(this.contentKey, this.module).subscribe(resp => {\r\n if ((isStringNullOrWhiteSpace(resp)) && this.admin) {\r\n this.sectionContent = null;\r\n this.editorContent = null;\r\n this.placeholderActive = true;\r\n } else {\r\n this.sectionContent = resp;\r\n this.editorContent = resp;\r\n this.placeholderActive = false;\r\n }\r\n }, err => {\r\n console.log(err);\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: err,\r\n closable: false\r\n });\r\n });\r\n }\r\n }\r\n\r\n adminSelection() {\r\n if (this.admin) {\r\n const hostedDiv = this.sectionControl.nativeElement;\r\n hostedDiv.insertAdjacentElement('afterend', this.adminUpdatePanel.el.nativeElement);\r\n if (!this.adminUpdatePanel.container) {\r\n this.adminUpdatePanel.container = this.adminUpdatePanel.el.nativeElement.firstElementChild;\r\n }\r\n this.adminUpdatePanel.show(null, hostedDiv);\r\n\r\n if (this.adminUpdatePanel.el.nativeElement && this.adminUpdatePanel.el.nativeElement.classList.contains('admin-panel-flip')) {\r\n if (!this.adminUpdatePanel.container) {\r\n this.adminUpdatePanel.container = this.adminUpdatePanel.el.nativeElement.firstElementChild;\r\n }\r\n\r\n if(this.adminUpdatePanel.container){\r\n DomHandler.addClass(this.adminUpdatePanel.container, 'p-overlaypanel-flipped');\r\n const elementDimensions = this.adminUpdatePanel.container.offsetParent ?\r\n { width: this.adminUpdatePanel.container.offsetWidth, height: this.adminUpdatePanel.container.offsetHeight } :\r\n DomHandler.getHiddenElementDimensions(this.adminUpdatePanel.container);\r\n\r\n let top = hostedDiv.getBoundingClientRect().top + DomHandler.getWindowScrollTop() - elementDimensions.height;\r\n this.adminUpdatePanel.container.style.transformOrigin = 'bottom';\r\n if (top < 0) {\r\n top = DomHandler.getWindowScrollTop();\r\n }\r\n\r\n }\r\n\r\n if(this.adminUpdatePanel.container){\r\n this.adminUpdatePanel.container.style.top = top + 'px';\r\n }\r\n } else {\r\n this.adminUpdatePanel.align();\r\n }\r\n }\r\n }\r\n\r\n // callback is called on intersection change\r\n onIntersection(entries: Array, opts: IntersectionObserver) {\r\n entries.forEach(entry =>\r\n entry.target.classList.toggle('admin-panel-flip', entry.isIntersecting)\r\n );\r\n }\r\n\r\n submitAdminContentUpdate() {\r\n //Check for this html code when no text is entered but settings like header etc are selected\r\n const innerText = this.quill.root.innerText.replace('\\ufeff', '');\r\n const isImageAdded = this.quill.root.innerHTML?.trim().includes('img');\r\n const editorhtml = ((innerText.trim() === '') && !isImageAdded) ? '' : this.quill.root.innerHTML?.trim();\r\n this.pageLayoutService.saveUpdatedSection(editorhtml\r\n , this.contentKey, this.viewId, this.module, this.permissionLevel, this.permissionValue)\r\n .subscribe(res => {\r\n this.adminUpdatePanel.hide();\r\n this.getContentFromDb();\r\n });\r\n\r\n }\r\n\r\n}\r\n","\r\n
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n","import { AfterViewInit, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';\r\nimport { MessageService } from 'primeng/api';\r\nimport { DomHandler } from 'primeng/dom';\r\nimport { Editor } from 'primeng/editor';\r\nimport { OverlayPanel } from 'primeng/overlaypanel';\r\nimport { LocalizationService } from 'src/app/modules/shared/services/localization.service';\r\nimport { PageLayoutService } from '../../services/page-layout.service';\r\n\r\n@Component({\r\n selector: 'section-title',\r\n templateUrl: './section-title.component.html',\r\n styleUrls: ['./section-title.component.css']\r\n})\r\nexport class SectionTitleComponent implements AfterViewInit {\r\n\r\n @Input() contentKey = '';\r\n @Input() admin = false;\r\n @Input() viewId = '';\r\n @Input() module = '';\r\n @Input() permissionLevel = '';\r\n @Input() permissionValue = '';\r\n @ViewChild('op') adminUpdatePanel: OverlayPanel;\r\n @ViewChild('FieldLabelContent') fieldLabelContent: Editor;\r\n @ViewChild('title') titleControl: ElementRef;\r\n sectionContent = '';\r\n defaultContent = '';\r\n interactionObserver: IntersectionObserver;\r\n\r\n constructor(private pageLayoutService: PageLayoutService, private localizationService: LocalizationService,\r\n private messageService: MessageService) { }\r\n\r\n ngAfterViewInit(): void {\r\n if (this.admin) {\r\n this.interactionObserver = new IntersectionObserver(this.onIntersection, {\r\n root: null, // default is the viewport\r\n threshold: .65 // percentage of taregt's visible area. Triggers \"onIntersection\"\r\n });\r\n\r\n if (this.contentKey !== '') {\r\n this.localizationService.getDefaultLabelByKey(this.contentKey).subscribe(resp => this.defaultContent = resp, err => {\r\n console.log(err);\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: err,\r\n closable: false\r\n });\r\n });\r\n }\r\n\r\n this.interactionObserver.observe(this.adminUpdatePanel.el.nativeElement);\r\n }\r\n this.getContentFromDb();\r\n\r\n }\r\n\r\n getContentFromDb() {\r\n if (this.contentKey !== '') {\r\n this.localizationService.getHtmlText(this.contentKey, this.module).subscribe(resp => {\r\n this.sectionContent = resp;\r\n }, err => {\r\n console.log(err);\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: err,\r\n closable: false\r\n });\r\n });\r\n }\r\n }\r\n\r\n adminSelection() {\r\n if (this.admin) {\r\n const hostedDiv = this.titleControl.nativeElement;\r\n hostedDiv.insertAdjacentElement('afterend', this.adminUpdatePanel.el.nativeElement);\r\n if (!this.adminUpdatePanel.container) {\r\n this.adminUpdatePanel.container = this.adminUpdatePanel.el.nativeElement.firstElementChild;\r\n }\r\n this.adminUpdatePanel.show(this.titleControl.nativeElement, hostedDiv);\r\n\r\n if (this.adminUpdatePanel.el.nativeElement && this.adminUpdatePanel.el.nativeElement.classList.contains('admin-panel-flip')) {\r\n if (!this.adminUpdatePanel.container) {\r\n this.adminUpdatePanel.container = this.adminUpdatePanel.el.nativeElement.firstElementChild;\r\n }\r\n DomHandler.addClass(this.adminUpdatePanel.container, 'p-overlaypanel-flipped');\r\n const elementDimensions = this.adminUpdatePanel.container.offsetParent ?\r\n { width: this.adminUpdatePanel.container.offsetWidth, height: this.adminUpdatePanel.container.offsetHeight } :\r\n DomHandler.getHiddenElementDimensions(this.adminUpdatePanel.container);\r\n\r\n let top = hostedDiv.getBoundingClientRect().top + DomHandler.getWindowScrollTop() - elementDimensions.height;\r\n this.adminUpdatePanel.container.style.transformOrigin = 'bottom';\r\n\r\n if (top < 0) {\r\n top = DomHandler.getWindowScrollTop();\r\n }\r\n this.adminUpdatePanel.container.style.top = top + 'px';\r\n\r\n } else {\r\n this.adminUpdatePanel.align();\r\n }\r\n }\r\n }\r\n\r\n // callback is called on intersection change\r\n onIntersection(entries: Array, opts: IntersectionObserver) {\r\n entries.forEach(entry =>\r\n entry.target.classList.toggle('admin-panel-flip', entry.isIntersecting)\r\n );\r\n }\r\n\r\n submitAdminContentUpdate() {\r\n this.pageLayoutService.saveUpdatedSection(this.sectionContent\r\n , this.contentKey, this.viewId, this.module, this.permissionLevel, this.permissionValue)\r\n .subscribe(res => {\r\n this.adminUpdatePanel.hide();\r\n this.getContentFromDb();\r\n });\r\n }\r\n\r\n}\r\n","import { SelectItem } from 'primeng/api';\r\n\r\nexport class AccelaControl{\r\n name: string;\r\n type: AccelaControlType;\r\n display: boolean;\r\n required: boolean;\r\n readOnly: boolean;\r\n hidden = false;\r\n defaultLabel: string;\r\n label: string;\r\n tooltip: string;\r\n placeholder: string;\r\n options: SelectItem[];\r\n optionKey: string;\r\n mask: string;\r\n maxLength: number;\r\n value: any;\r\n templateField: boolean;\r\n isDBRequired: boolean;\r\n}\r\n\r\nexport enum AccelaControlType{\r\n Blocked,\r\n Checkbox,\r\n Dropdown,\r\n Date,\r\n Email,\r\n FEIN,\r\n Password,\r\n Phone,\r\n RadioGroup,\r\n SSN,\r\n Textbox,\r\n Zip,\r\n Number,\r\n Separator,\r\n Time,\r\n TextArea,\r\n Money\r\n}\r\n","import { HttpClient, HttpErrorResponse, HttpHeaders } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { UntypedFormGroup } from '@angular/forms';\r\nimport { MessageService } from 'primeng/api';\r\nimport { Observable, of } from 'rxjs';\r\nimport { catchError, map, switchMap } from 'rxjs/operators';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { isStringNullOrWhiteSpace } from 'src/app/util/StringUtil';\r\nimport { ExpressionRunResultModel } from '../model/expressionRunResult.model';\r\nimport { ExpressionResponse, ExpressionRuntimeArgumentsModel } from '../model/expressions.model';\r\nimport { HttpErrorHandler } from './error-handler.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AAExpressionService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService,\r\n private messageService: MessageService, private errorHandler: HttpErrorHandler) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/ExpressionJs/';\r\n }\r\n\r\n\r\n getExpressionJsScriptOnLoad(viewId: string, module: string, permissionLevel: string, permissionValue: string, callerId: string):\r\n Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetExpressionsForOnLoad`,\r\n [{ Key: 'module', Value: module },\r\n { Key: 'viewId', Value: viewId },\r\n { Key: 'permissionLevel', Value: permissionLevel },\r\n { Key: 'permissionValue', Value: permissionValue },\r\n { Key: 'callerId', Value: callerId }])\r\n , { headers: this.headers })\r\n .pipe(map(json => json as ExpressionResponse));\r\n }\r\n\r\n getExpressionJsScriptOnSubmit(viewId: string, module: string, permissionLevel: string, permissionValue: string, callerId: string):\r\n Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetExpressionsForOnSubmit`,\r\n [{ Key: 'module', Value: module },\r\n { Key: 'viewId', Value: viewId },\r\n { Key: 'permissionLevel', Value: permissionLevel },\r\n { Key: 'permissionValue', Value: permissionValue },\r\n { Key: 'callerId', Value: callerId }])\r\n , { headers: this.headers })\r\n .pipe(catchError(this.errorHandler.handleError))\r\n .pipe(map(json => json as ExpressionResponse));\r\n }\r\n\r\n getExpressionJsScriptForExecute(viewId: string, module: string, permissionLevel: string, permissionValue: string, callerId: string):\r\n Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetExpressionsForExecute`,\r\n [{ Key: 'module', Value: module },\r\n { Key: 'viewId', Value: viewId },\r\n { Key: 'permissionLevel', Value: permissionLevel },\r\n { Key: 'permissionValue', Value: permissionValue },\r\n { Key: 'callerId', Value: callerId }])\r\n , { headers: this.headers })\r\n .pipe(catchError(this.errorHandler.handleError))\r\n .pipe(map(json => json as ExpressionResponse[]));\r\n }\r\n\r\n invokeExpression(expressionData: ExpressionResponse, pageflowFormGroup: UntypedFormGroup, fireObject: HTMLElement = null): Observable {\r\n if (fireObject) {\r\n fireObject.focus();\r\n }\r\n\r\n if (expressionData && expressionData.inputFields) {\r\n //RunExpression\r\n return this.http\r\n .post(this.apiRef.getApiUrl(`${this.apiServer}RunExpression`), expressionData, { headers: this.headers })\r\n .pipe(\r\n catchError(this.errorHandler.handleError),\r\n map((resp) => {\r\n if (resp) {\r\n let exResult: ExpressionRunResultModel = null;\r\n try {\r\n exResult = JSON.parse(resp.toString());\r\n } catch (ex) { //AA will return a plaintext error in some circumstances\r\n console.log(`Error executing expression, invalid response: ${resp}`);\r\n return;\r\n }\r\n if (exResult) {\r\n const executeFieldName: ExpressionRuntimeArgumentsModel = expressionData.args && expressionData.args.executeFieldVariableKey\r\n ? expressionData.args.executeFieldVariableKey : null;\r\n\r\n this.handleResult(exResult, executeFieldName, pageflowFormGroup);\r\n }\r\n\r\n }\r\n }));\r\n } else {\r\n return of(); //skip and return void\r\n }\r\n }\r\n\r\n handleResult(result: ExpressionRunResultModel, executeFieldName: ExpressionRuntimeArgumentsModel, pageflowFormGroup: UntypedFormGroup) {\r\n if (!result || !result.fields || result.fields.length === 0) {\r\n return;\r\n }\r\n\r\n for (const oneResult of result.fields) {\r\n const formControl = pageflowFormGroup.controls[oneResult.name];\r\n\r\n if (!formControl) {\r\n console.log('ExpressionJs: unable to find control: ' + oneResult.name);\r\n } else {\r\n\r\n if (oneResult.value && oneResult.value !== '') {\r\n formControl.patchValue(oneResult.value);\r\n }\r\n\r\n if (oneResult.hidden !== null) {\r\n formControl.controlData.hidden = oneResult.hidden;\r\n }\r\n\r\n if (oneResult.readOnly !== null) {\r\n formControl.controlData.readOnly = oneResult.readOnly;\r\n }\r\n\r\n if (oneResult.required !== null) {\r\n formControl.controlData.required = oneResult.required;\r\n }\r\n\r\n if (!isStringNullOrWhiteSpace(oneResult.message)) {\r\n this.messageService.add({\r\n severity: 'info',\r\n summary: `${oneResult.name}: ${oneResult.message}`,\r\n detail: 'Via ExpressionService',\r\n closable: false\r\n });\r\n }\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n\r\n isYes(fieldValue, value) {\r\n if (typeof (value) != 'string' || isStringNullOrWhiteSpace(fieldValue) || isStringNullOrWhiteSpace(value)) {\r\n return false;\r\n }\r\n\r\n const checkValue = value.toUpperCase();\r\n\r\n if (checkValue === 'CHECK'\r\n || checkValue === 'CHECKED'\r\n || checkValue === 'TRUE'\r\n || checkValue === 'SELECT'\r\n || checkValue === 'SELECTED'\r\n || checkValue === 'ON'\r\n || checkValue === 'YES'\r\n || checkValue === 'Y') {\r\n value = 'Yes';\r\n } else if (checkValue !== 'FEMALE'\r\n && checkValue !== 'F'\r\n && checkValue !== 'MALE'\r\n && checkValue !== 'M') {\r\n value = 'No';\r\n }\r\n\r\n return fieldValue.substring(0, 1).toUpperCase() === value.substring(0, 1).toUpperCase();\r\n }\r\n\r\n}\r\n","import { HttpHeaders, HttpClient, HttpParams } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs/internal/Observable';\r\nimport { catchError, distinctUntilChanged, map, mergeMap, switchMap, tap } from 'rxjs/operators';\r\nimport { ApiResponse } from 'src/app/model/apiResponse.model';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { LoginResponse } from '../model/loginResponse.model';\r\nimport { PasswordResultModel } from '../model/PasswordResultModel.model';\r\nimport { PublicAccountSubmission } from '../model/publicAccountSubmission.model';\r\nimport { RecaptchaResponse } from '../model/recaptchaResponse.model';\r\nimport { StringKeyValue } from '../model/stringKeyValue.model';\r\nimport { UserModel } from '../model/userModel.model';\r\nimport { EncryptionService } from './encryption.service';\r\nimport { HttpErrorHandler } from './error-handler.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AccountService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService, private encryptionService: EncryptionService,\r\n private httpErrorHandler: HttpErrorHandler) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/PublicUser/';\r\n }\r\n\r\n getAccountStatus(): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}AccountStatus`), { headers: this.headers }).pipe(map(json => {\r\n if (json) {\r\n return json.toString().toLowerCase() === 'true';\r\n } else {\r\n return false;\r\n }\r\n }));\r\n }\r\n\r\n getSecurityQuestions(userName: string): Observable> {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetSecurityQuestions`, [{ Key: 'username', Value: userName }]),\r\n { headers: this.headers })\r\n .pipe(map((result) => result as Array));\r\n\r\n }\r\n\r\n verifyCaptchaData(token: string): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}VerifyRecaptcha`, [{ Key: 'token', Value: token }]), \r\n {headers: this.headers })\r\n .pipe(map(json => json as RecaptchaResponse));\r\n }\r\n\r\n getIfEmailRegistered(): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}UserExists`), { headers: this.headers })\r\n .pipe(map(json => {\r\n if (json) {\r\n const result = json.toString().toLowerCase() === 'true';\r\n return result;\r\n } else {\r\n return false;\r\n }\r\n }));\r\n }\r\n\r\n validateUserAccount(userModel: UserModel): Observable {\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}ValidateUser`), { headers: this.headers, body: userModel })\r\n .pipe(map(json => json as LoginResponse));\r\n }\r\n\r\n validatePasswordRequisites(userModel: UserModel): Observable {\r\n const encryptSvc = new EncryptionService(this.apiRef);\r\n userModel.Pwd = encryptSvc.encryptAes(userModel.Pwd);\r\n\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}VerifyPasswordReqs`),\r\n { headers: this.headers, body: userModel})\r\n .pipe(distinctUntilChanged())\r\n .pipe(map((res: ApiResponse) => {\r\n const result = res.result as PasswordResultModel;\r\n return result;\r\n }))\r\n .pipe(catchError(this.httpErrorHandler.handleError));\r\n }\r\n\r\n loginToACA(userModel: UserModel): Observable {\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}SignIn`), { headers: this.headers, body: userModel })\r\n .pipe(map(json => json as LoginResponse))\r\n .pipe(catchError(this.httpErrorHandler.handleError));\r\n }\r\n\r\n saveNewAccount(submission: PublicAccountSubmission): Observable {\r\n // encrypt Password\r\n submission.Password = this.encryptionService.encryptAes(submission.Password);\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}SaveNewUserAccount`), { headers: this.headers, body: submission })\r\n .pipe(map(resp => resp.Uri.toString()));\r\n }\r\n\r\n}\r\n","import { HttpHeaders, HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { SelectItem } from 'primeng/api';\r\nimport { Observable } from 'rxjs';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AddressInfoService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/Address/';\r\n }\r\n\r\n getAddressTypes(contactType: string) {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getAddressTypes`, [{Key: 'contactType', Value: contactType}]));\r\n }\r\n\r\n getCountryOptions() {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getCountryOptions`));\r\n }\r\n\r\n getStateOptions(countryCode) {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getStateOptions`, [{Key: 'countryCode', Value: countryCode}]));\r\n }\r\n\r\n getStreetDirectionValues() {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getStreetDirectionValues`));\r\n }\r\n\r\n getStreetSuffixValues() {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getStreetSuffixValues`));\r\n }\r\n\r\n getStreetTypeValues() {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getStreetTypeValues`));\r\n }\r\n\r\n getUnitTypes() {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getUnitTypes`));\r\n }\r\n\r\n getSubdivisionValues(showType) {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getSubdivisionValues`, [{ Key: 'showType', Value: showType }]));\r\n }\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { ContactModel } from '../model/contactModel.model';\r\nimport { StringKeyValue } from '../model/stringKeyValue.model';\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ContactInfoService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/ContactAddress/';\r\n }\r\n\r\n getContactTypes(): Observable> {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getContactTypes`)).pipe(map((result) => result as Array));\r\n }\r\n\r\n getContactTypesForMultiContact(parameterModel: string, moduleName: string, isMultipleContact: any): Observable> {\r\n try {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getContactTypes`,\r\n [{ Key: 'sessionParameterString', Value: parameterModel },\r\n { Key: 'moduleName', Value: moduleName },\r\n { Key: 'isMultipleContact', Value: isMultipleContact }]),\r\n { headers: this.headers})\r\n .pipe(map((result) => result as Array));\r\n\r\n } catch (e) {\r\n console.log(e);\r\n return null;\r\n }\r\n }\r\n\r\n getGenderList() {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getGenderList`));\r\n }\r\n\r\n getEthnicityValues() {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getEthnicityValues`));\r\n }\r\n\r\n getSalutationList() {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getSalutations`));\r\n }\r\n\r\n getPreferredChannel(): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getPrefferedChannel`)).pipe(map(res => res as StringKeyValue[]));\r\n }\r\n\r\n getContactInfo(contactSeqNmbr: number) {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetContactByContactSeqNbr`,\r\n [{ Key: 'contactSeqNbr', Value: contactSeqNmbr.toString() }]));\r\n }\r\n\r\n saveContactDataToSession(contact: ContactModel, moduleName: string): Observable {\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}SaveContactDataToSession`, [{ Key: 'Module', Value: moduleName }])\r\n , { headers: this.headers, body: contact })\r\n .pipe(map(resp => resp.message.toString()));\r\n }\r\n\r\n removeContactDataFromSession(moduleName: string, index: number) {\r\n const headers = { 'content-type': 'application/json' };\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}RemoveContactDataFromSession`, [\r\n { Key: 'Module', Value: moduleName },\r\n { Key: 'index', Value: index.toString() }\r\n ]), { headers });\r\n }\r\n\r\n CreateContactParametersSession(paramterModel: string, moduleName: string, processType: string, contactIndex: number = 0) {\r\n const headers = { 'content-type': 'application/json' };\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}CreateContactParametersSession`,\r\n [{ Key: 'moduleName', Value: moduleName },\r\n { Key: 'processType', Value: processType },\r\n { Key:'contactIndex', Value: contactIndex.toString()}])\r\n , paramterModel, { headers });\r\n }\r\n\r\n getContactModel(parameterModel: string, moduleName: string): Observable {\r\n const headers = { 'content-type': 'application/json' };\r\n return this.http.get(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetContactModelFromSession`, [\r\n { Key: 'sessionParameterString', Value: parameterModel },\r\n { Key: 'moduleName', Value: moduleName }\r\n ]), { headers: this.headers })\r\n .pipe(map((result) => result as ContactModel));\r\n }\r\n\r\n getContactListFromSession(parameterModel: string, moduleName: string): Observable {\r\n const headers = { 'content-type': 'application/json' };\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetContactListFromSession`, [\r\n { Key: 'sessionParameterString', Value: parameterModel },\r\n { Key: 'moduleName', Value: moduleName }]),\r\n { headers: this.headers })\r\n .pipe(map((result) => result as ContactModel[]));\r\n }\r\n\r\n validateContactAddress(Contact: ContactModel, moduleName: string) {\r\n const headers = { 'content-type': 'application/json' };\r\n\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}ValidateContactAddress`,\r\n [{ Key: 'moduleName', Value: moduleName }]),\r\n { headers: this.headers, body: Contact })\r\n .pipe(map(resp => resp.message.toString()));\r\n }\r\n\r\n getContactsFromAccount(moduleName: string): Observable {\r\n const headers = { 'content-type': 'application/json' };\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetContactsFromAccount`, [{ Key: 'moduleName', Value: moduleName }]),\r\n { headers: this.headers })\r\n .pipe(map((result) => result as ContactModel[]));\r\n }\r\n\r\n saveContactListToSession(ContactList: ContactModel[], ModuleName: string): Observable {\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}SaveContactListToSession`,\r\n [{ Key: 'moduleName', Value: ModuleName }]),\r\n { headers: this.headers, body: ContactList })\r\n .pipe(map(resp => resp.message.toString()));\r\n }\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Injectable, Renderer2 } from '@angular/core';\r\nimport { map } from 'rxjs/operators';\r\nimport { ApiResponse } from 'src/app/model/apiResponse.model';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class CustomScriptInjectionService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n private trackedLinks = new Array();\r\n private trackedScripts = new Array();\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/customizedcode/';\r\n }\r\n\r\n loadAndRunCustomScriptBlock(renderer: Renderer2, doc: Document, route: string) {\r\n\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}links`,\r\n [{Key: 'routeName', Value:route}]))\r\n .pipe(map((res) => {\r\n if(res.result){\r\n const links = res.result as string[];\r\n links.forEach((r)=>{\r\n if(r.endsWith('css')){\r\n const cssSrcUrl = this.apiRef.getCustomizationUrl(r);\r\n const c = doc.createElement('link');\r\n c.rel = 'stylesheet';\r\n c.type = 'text/css';\r\n c.id = r + 'style';\r\n c.href = cssSrcUrl;\r\n this.trackedLinks.push(c);\r\n renderer.appendChild(doc.body, c);\r\n } else {\r\n const jsSrcUrl = this.apiRef.getCustomizationUrl(r);\r\n const s = doc.createElement('script');\r\n s.type = 'text/javascript';\r\n s.id = r+'js';\r\n s.src = jsSrcUrl;\r\n this.trackedScripts.push(s);\r\n renderer.appendChild(doc.body, s);\r\n }\r\n });\r\n }\r\n\r\n }))\r\n .subscribe();\r\n\r\n }\r\n\r\n removeTrackedElements() {\r\n this.trackedLinks.forEach(link => link.remove());\r\n this.trackedScripts.forEach(s => s.remove());\r\n }\r\n\r\n}\r\n","import { AppState } from '../../app.state';\r\n\r\n\r\nexport const selectContact = (state: AppState) => state.Contact;\r\n","import { Injectable } from '@angular/core';\r\nimport { SelectItem } from 'primeng/api';\r\nimport { observable, Observable, of, Subscription } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { Store } from '@ngrx/store';\r\nimport { AppState } from 'src/app/app.state';\r\nimport { AddressInfoService } from './address-info.service';\r\nimport { ContactInfoService } from './contact-info.service';\r\nimport { selectContact } from 'src/app/state/selectors/contact-model.selectors';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class DropdownValueService {\r\n\r\n public static genderIds: SelectItem[] = new Array();\r\n\r\n public static preferedChannels: SelectItem[] = new Array();\r\n\r\n private static addressService: AddressInfoService;\r\n private static contactService: ContactInfoService;\r\n private static store: Store;\r\n\r\n private static salutationValues: SelectItem[] = new Array();\r\n\r\n private static streetDirectionValues: SelectItem[] = new Array();\r\n\r\n private static streetSuffixValues: SelectItem[] = new Array();\r\n \r\n private static unitTypes: SelectItem[] = new Array();\r\n\r\n private static streetTypeValues: SelectItem[] = new Array();\r\n\r\n private static countryValues: SelectItem[] = new Array();\r\n\r\n private static stateValues: SelectItem[] = new Array();\r\n\r\n private static ethniticityValues: SelectItem[] = new Array();\r\n\r\n public static addressTypes: SelectItem[] = new Array();\r\n\r\n private static subdivisionValues: SelectItem[] = new Array();\r\n\r\n private static securityTemplates: SelectItem[] = [\r\n { label: 'To what city did you go the first time you flew on a plane?',\r\n value: 'To what city did you go the first time you flew on a plane?' },\r\n { label: 'What is the first name of the person you first kissed?', value: 'What is the first name of the person you first kissed?' },\r\n { label: 'What was the last name of your favorite childhood teacher?',\r\n value: 'What was the last name of your favorite childhood teacher?' },\r\n { label: 'In what city or town does your nearest sibling live?', value: 'In what city or town does your nearest sibling live?' },\r\n { label: 'In what town or city was your first full time job?', value: 'In what town or city was your first full time job?' },\r\n { label: 'What was your favorite food as a child?', value: 'What was your favorite food as a child?' }\r\n ];\r\n\r\n private DropdownValueRepo = {\r\n ddlAddressType: this.getAddressTypes,\r\n ddlAppSalutation: this.getSalutationValue,\r\n ddlAppCountry: this.getCountryValues,\r\n ddlAppState: this.getStateValues,\r\n ddlBirthplaceState: this.getStateValues,\r\n ddlBirthplaceCountry: this.getCountryValues,\r\n ddlCountry: this.getCountryValues,\r\n ddlDriverLicenseState: this.getStateValues,\r\n ddlPreferredChannel: this.getPreferedChannels,\r\n ddlQuestion: this.getSecurityQuestionTemplates,\r\n ddlRace: this.getEthnicityValues,\r\n ddlStreetDirection: this.getStreetDirectionValues,\r\n ddlStreetSuffix: this.getStreetSuffixValues,\r\n ddlStreetSuffixDirection: this.getStreetDirectionValues,\r\n ddlStreetType: this.getStreetTypeValues,\r\n ddlUnitType: this.getUnitTypes,\r\n ddlQuestionForDaily: this.getSecurityQuestionTemplates,\r\n radioListAppGender: this.getGenderIdentityValue,\r\n ddlSubdivision: this.getSubdivisionValues,\r\n txtState: this.getStateValues,\r\n txtAppState: this.getStateValues\r\n };\r\n\r\n constructor(private appstore: Store, contactInfoService: ContactInfoService, addressInfoService: AddressInfoService) {\r\n DropdownValueService.addressService = addressInfoService;\r\n DropdownValueService.contactService = contactInfoService;\r\n DropdownValueService.store = appstore;\r\n }\r\n\r\n getDropdownValueFun(controlName: string, key?: string): Observable {\r\n const resolver = this.DropdownValueRepo[controlName];\r\n if (resolver) {\r\n if (key && key !== '') {\r\n return resolver(key);\r\n } else {\r\n return resolver();\r\n }\r\n }\r\n return of(null);\r\n }\r\n\r\n getRepoValueFunc(controlName: string): Observable {\r\n return this.DropdownValueRepo[controlName];\r\n }\r\n\r\n getSalutationValue() {\r\n if (DropdownValueService.salutationValues.length <= 0) {\r\n return DropdownValueService.contactService.getSalutationList().pipe(map(res => {\r\n const arry = res as Array;\r\n arry.forEach(s => {\r\n DropdownValueService.salutationValues.push({ label: s, value: s });\r\n });\r\n return DropdownValueService.salutationValues;\r\n }));\r\n }\r\n return of(DropdownValueService.salutationValues);\r\n\r\n }\r\n getStreetDirectionValues() {\r\n if (DropdownValueService.streetDirectionValues.length <= 0) {\r\n return DropdownValueService.addressService.getStreetDirectionValues().pipe(map(res => {\r\n DropdownValueService.streetDirectionValues.length = 0;\r\n Object.keys(res).forEach(s => {\r\n DropdownValueService.streetDirectionValues.push({ label: res[s], value: s });\r\n });\r\n return DropdownValueService.streetDirectionValues;\r\n }));\r\n }\r\n return of(DropdownValueService.streetDirectionValues);\r\n\r\n }\r\n\r\n getStreetSuffixValues() {\r\n if (DropdownValueService.streetSuffixValues.length <= 0) {\r\n return DropdownValueService.addressService.getStreetSuffixValues().pipe(map(res => {\r\n DropdownValueService.streetSuffixValues.length = 0;\r\n Object.keys(res).forEach(s => {\r\n DropdownValueService.streetSuffixValues.push({ label: res[s], value: s });\r\n });\r\n return DropdownValueService.streetSuffixValues;\r\n }));\r\n }\r\n return of(DropdownValueService.streetSuffixValues);\r\n\r\n }\r\n\r\n getUnitTypes() {\r\n if (DropdownValueService.unitTypes.length <= 0) {\r\n return DropdownValueService.addressService.getUnitTypes().pipe(map(res => {\r\n DropdownValueService.unitTypes.length = 0;\r\n Object.keys(res).forEach(s => {\r\n DropdownValueService.unitTypes.push({ label: res[s], value: s });\r\n });\r\n return DropdownValueService.unitTypes;\r\n }));\r\n }\r\n return of(DropdownValueService.unitTypes);\r\n }\r\n getStreetTypeValues() {\r\n if (DropdownValueService.streetTypeValues.length <= 0) {\r\n return DropdownValueService.addressService.getStreetTypeValues().pipe(map(res => {\r\n DropdownValueService.streetTypeValues.length = 0;\r\n Object.keys(res).forEach(s => {\r\n DropdownValueService.streetTypeValues.push({ label: res[s], value: s });\r\n });\r\n return DropdownValueService.streetTypeValues;\r\n }));\r\n }\r\n return of(DropdownValueService.streetTypeValues);\r\n\r\n }\r\n getPreferedChannels() {\r\n if (DropdownValueService.preferedChannels.length <= 0) {\r\n return DropdownValueService.contactService.getPreferredChannel().pipe(map(res => {\r\n res.forEach(s => {\r\n DropdownValueService.preferedChannels.push({ label: s.Key, value: s.Value });\r\n });\r\n return DropdownValueService.preferedChannels;\r\n }));\r\n }\r\n return of(DropdownValueService.preferedChannels);\r\n }\r\n getCountryValues() {\r\n if (DropdownValueService.countryValues.length <= 0) {\r\n return DropdownValueService.addressService.getCountryOptions().pipe(map(res => {\r\n Object.keys(res).forEach(s => {\r\n DropdownValueService.countryValues.push({ label: res[s].Value, value: res[s].Key});\r\n });\r\n return DropdownValueService.countryValues;\r\n }));\r\n }\r\n return of(DropdownValueService.countryValues);\r\n\r\n }\r\n getStateValues(countryCode) {\r\n if (countryCode === undefined)\r\n countryCode = \"\";\r\n if (DropdownValueService.stateValues.length <= 0) {\r\n return DropdownValueService.addressService.getStateOptions(countryCode)\r\n .pipe(map(res => {\r\n DropdownValueService.stateValues = [];\r\n Object.keys(res).forEach(s => {\r\n DropdownValueService.stateValues.push({ label: s, value: s });\r\n });\r\n return DropdownValueService.stateValues;\r\n }));\r\n }\r\n return of(DropdownValueService.stateValues);\r\n\r\n }\r\n getEthnicityValues() {\r\n if (DropdownValueService.ethniticityValues.length <= 0) {\r\n return DropdownValueService.contactService.getEthnicityValues().pipe(map(res => {\r\n const arry = res as Array;\r\n arry.forEach(s => {\r\n DropdownValueService.ethniticityValues.push({ label: s.Key, value: s.Value });\r\n });\r\n return DropdownValueService.ethniticityValues;\r\n }));\r\n }\r\n return of(DropdownValueService.ethniticityValues);\r\n }\r\n getAddressTypes(contactType: string) {\r\n if (DropdownValueService.addressTypes.length <= 0) {\r\n // Getting contactType from store\r\n if (!contactType) {\r\n DropdownValueService.store.select(selectContact).pipe(map(resp => resp)).subscribe(storedContacts => {\r\n if (storedContacts) {\r\n contactType = storedContacts.Type;\r\n }\r\n });\r\n }\r\n return DropdownValueService.addressService.getAddressTypes(contactType).pipe(map(res => {\r\n DropdownValueService.addressTypes.length = 0;\r\n const arry = res as Array;\r\n arry.forEach(s => {\r\n DropdownValueService.addressTypes.push({label: s, value: s});\r\n });\r\n\r\n return DropdownValueService.addressTypes;\r\n }));\r\n }\r\n return of(DropdownValueService.addressTypes);\r\n }\r\n getSecurityQuestionTemplates(): Observable {\r\n return of(DropdownValueService.securityTemplates);\r\n }\r\n getGenderIdentityValue(){\r\n if(DropdownValueService.genderIds.length <= 0){\r\n return DropdownValueService.contactService.getGenderList().pipe(map(res => {\r\n const arry = res as Array;\r\n arry.forEach(s => {\r\n DropdownValueService.genderIds.push({ label: s, value: s });\r\n });\r\n return DropdownValueService.genderIds;\r\n }));\r\n }\r\n return of(DropdownValueService.genderIds);\r\n }\r\n\r\n getSubdivisionValues() {\r\n //TODO: The input 'ShowType' must be retrieved from the dropdown list control. This needs to be developed when working for HER-2550 ACA Admin part. So hard coding to 0 for now\r\n\r\n if (DropdownValueService.subdivisionValues.length <= 0) {\r\n return DropdownValueService.addressService.getSubdivisionValues(0).pipe(map(res => {\r\n DropdownValueService.subdivisionValues = [];\r\n Object.keys(res).forEach(s => {\r\n DropdownValueService.subdivisionValues.push({ label: res[s].Key, value: res[s].Value });\r\n });\r\n return DropdownValueService.subdivisionValues;\r\n }));\r\n }\r\n return of(DropdownValueService.subdivisionValues);\r\n }\r\n}\r\n","import {\n WordArray,\n Hasher,\n} from './core.js';\n\n// Constants table\nconst T = [];\n\n// Compute constants\nfor (let i = 0; i < 64; i += 1) {\n T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;\n}\n\nconst FF = (a, b, c, d, x, s, t) => {\n const n = a + ((b & c) | (~b & d)) + x + t;\n return ((n << s) | (n >>> (32 - s))) + b;\n};\n\nconst GG = (a, b, c, d, x, s, t) => {\n const n = a + ((b & d) | (c & ~d)) + x + t;\n return ((n << s) | (n >>> (32 - s))) + b;\n};\n\nconst HH = (a, b, c, d, x, s, t) => {\n const n = a + (b ^ c ^ d) + x + t;\n return ((n << s) | (n >>> (32 - s))) + b;\n};\n\nconst II = (a, b, c, d, x, s, t) => {\n const n = a + (c ^ (b | ~d)) + x + t;\n return ((n << s) | (n >>> (32 - s))) + b;\n};\n\n/**\n * MD5 hash algorithm.\n */\nexport class MD5Algo extends Hasher {\n _doReset() {\n this._hash = new WordArray([\n 0x67452301,\n 0xefcdab89,\n 0x98badcfe,\n 0x10325476,\n ]);\n }\n\n _doProcessBlock(M, offset) {\n const _M = M;\n\n // Swap endian\n for (let i = 0; i < 16; i += 1) {\n // Shortcuts\n const offset_i = offset + i;\n const M_offset_i = M[offset_i];\n\n _M[offset_i] = (\n (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff)\n | (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n );\n }\n\n // Shortcuts\n const H = this._hash.words;\n\n const M_offset_0 = _M[offset + 0];\n const M_offset_1 = _M[offset + 1];\n const M_offset_2 = _M[offset + 2];\n const M_offset_3 = _M[offset + 3];\n const M_offset_4 = _M[offset + 4];\n const M_offset_5 = _M[offset + 5];\n const M_offset_6 = _M[offset + 6];\n const M_offset_7 = _M[offset + 7];\n const M_offset_8 = _M[offset + 8];\n const M_offset_9 = _M[offset + 9];\n const M_offset_10 = _M[offset + 10];\n const M_offset_11 = _M[offset + 11];\n const M_offset_12 = _M[offset + 12];\n const M_offset_13 = _M[offset + 13];\n const M_offset_14 = _M[offset + 14];\n const M_offset_15 = _M[offset + 15];\n\n // Working varialbes\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n\n // Computation\n a = FF(a, b, c, d, M_offset_0, 7, T[0]);\n d = FF(d, a, b, c, M_offset_1, 12, T[1]);\n c = FF(c, d, a, b, M_offset_2, 17, T[2]);\n b = FF(b, c, d, a, M_offset_3, 22, T[3]);\n a = FF(a, b, c, d, M_offset_4, 7, T[4]);\n d = FF(d, a, b, c, M_offset_5, 12, T[5]);\n c = FF(c, d, a, b, M_offset_6, 17, T[6]);\n b = FF(b, c, d, a, M_offset_7, 22, T[7]);\n a = FF(a, b, c, d, M_offset_8, 7, T[8]);\n d = FF(d, a, b, c, M_offset_9, 12, T[9]);\n c = FF(c, d, a, b, M_offset_10, 17, T[10]);\n b = FF(b, c, d, a, M_offset_11, 22, T[11]);\n a = FF(a, b, c, d, M_offset_12, 7, T[12]);\n d = FF(d, a, b, c, M_offset_13, 12, T[13]);\n c = FF(c, d, a, b, M_offset_14, 17, T[14]);\n b = FF(b, c, d, a, M_offset_15, 22, T[15]);\n\n a = GG(a, b, c, d, M_offset_1, 5, T[16]);\n d = GG(d, a, b, c, M_offset_6, 9, T[17]);\n c = GG(c, d, a, b, M_offset_11, 14, T[18]);\n b = GG(b, c, d, a, M_offset_0, 20, T[19]);\n a = GG(a, b, c, d, M_offset_5, 5, T[20]);\n d = GG(d, a, b, c, M_offset_10, 9, T[21]);\n c = GG(c, d, a, b, M_offset_15, 14, T[22]);\n b = GG(b, c, d, a, M_offset_4, 20, T[23]);\n a = GG(a, b, c, d, M_offset_9, 5, T[24]);\n d = GG(d, a, b, c, M_offset_14, 9, T[25]);\n c = GG(c, d, a, b, M_offset_3, 14, T[26]);\n b = GG(b, c, d, a, M_offset_8, 20, T[27]);\n a = GG(a, b, c, d, M_offset_13, 5, T[28]);\n d = GG(d, a, b, c, M_offset_2, 9, T[29]);\n c = GG(c, d, a, b, M_offset_7, 14, T[30]);\n b = GG(b, c, d, a, M_offset_12, 20, T[31]);\n\n a = HH(a, b, c, d, M_offset_5, 4, T[32]);\n d = HH(d, a, b, c, M_offset_8, 11, T[33]);\n c = HH(c, d, a, b, M_offset_11, 16, T[34]);\n b = HH(b, c, d, a, M_offset_14, 23, T[35]);\n a = HH(a, b, c, d, M_offset_1, 4, T[36]);\n d = HH(d, a, b, c, M_offset_4, 11, T[37]);\n c = HH(c, d, a, b, M_offset_7, 16, T[38]);\n b = HH(b, c, d, a, M_offset_10, 23, T[39]);\n a = HH(a, b, c, d, M_offset_13, 4, T[40]);\n d = HH(d, a, b, c, M_offset_0, 11, T[41]);\n c = HH(c, d, a, b, M_offset_3, 16, T[42]);\n b = HH(b, c, d, a, M_offset_6, 23, T[43]);\n a = HH(a, b, c, d, M_offset_9, 4, T[44]);\n d = HH(d, a, b, c, M_offset_12, 11, T[45]);\n c = HH(c, d, a, b, M_offset_15, 16, T[46]);\n b = HH(b, c, d, a, M_offset_2, 23, T[47]);\n\n a = II(a, b, c, d, M_offset_0, 6, T[48]);\n d = II(d, a, b, c, M_offset_7, 10, T[49]);\n c = II(c, d, a, b, M_offset_14, 15, T[50]);\n b = II(b, c, d, a, M_offset_5, 21, T[51]);\n a = II(a, b, c, d, M_offset_12, 6, T[52]);\n d = II(d, a, b, c, M_offset_3, 10, T[53]);\n c = II(c, d, a, b, M_offset_10, 15, T[54]);\n b = II(b, c, d, a, M_offset_1, 21, T[55]);\n a = II(a, b, c, d, M_offset_8, 6, T[56]);\n d = II(d, a, b, c, M_offset_15, 10, T[57]);\n c = II(c, d, a, b, M_offset_6, 15, T[58]);\n b = II(b, c, d, a, M_offset_13, 21, T[59]);\n a = II(a, b, c, d, M_offset_4, 6, T[60]);\n d = II(d, a, b, c, M_offset_11, 10, T[61]);\n c = II(c, d, a, b, M_offset_2, 15, T[62]);\n b = II(b, c, d, a, M_offset_9, 21, T[63]);\n\n // Intermediate hash value\n H[0] = (H[0] + a) | 0;\n H[1] = (H[1] + b) | 0;\n H[2] = (H[2] + c) | 0;\n H[3] = (H[3] + d) | 0;\n }\n /* eslint-ensable no-param-reassign */\n\n _doFinalize() {\n // Shortcuts\n const data = this._data;\n const dataWords = data.words;\n\n const nBitsTotal = this._nDataBytes * 8;\n const nBitsLeft = data.sigBytes * 8;\n\n // Add padding\n dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - (nBitsLeft % 32));\n\n const nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);\n const nBitsTotalL = nBitsTotal;\n dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (\n (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff)\n | (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)\n );\n dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff)\n | (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)\n );\n\n data.sigBytes = (dataWords.length + 1) * 4;\n\n // Hash final blocks\n this._process();\n\n // Shortcuts\n const hash = this._hash;\n const H = hash.words;\n\n // Swap endian\n for (let i = 0; i < 4; i += 1) {\n // Shortcut\n const H_i = H[i];\n\n H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff)\n | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n }\n\n // Return final computed hash\n return hash;\n }\n\n clone() {\n const clone = super.clone.call(this);\n clone._hash = this._hash.clone();\n\n return clone;\n }\n}\n\n/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.MD5('message');\n * var hash = CryptoJS.MD5(wordArray);\n */\nexport const MD5 = Hasher._createHelper(MD5Algo);\n\n/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacMD5(message, key);\n */\nexport const HmacMD5 = Hasher._createHmacHelper(MD5Algo);\n","/* eslint-disable no-use-before-define */\n\n/**\n * Base class for inheritance.\n */\nexport class Base {\n /**\n * Extends this object and runs the init method.\n * Arguments to create() will be passed to init().\n *\n * @return {Object} The new object.\n *\n * @static\n *\n * @example\n *\n * var instance = MyType.create();\n */\n static create(...args) {\n return new this(...args);\n }\n\n /**\n * Copies properties into this object.\n *\n * @param {Object} properties The properties to mix in.\n *\n * @example\n *\n * MyType.mixIn({\n * field: 'value'\n * });\n */\n mixIn(properties) {\n return Object.assign(this, properties);\n }\n\n /**\n * Creates a copy of this object.\n *\n * @return {Object} The clone.\n *\n * @example\n *\n * var clone = instance.clone();\n */\n clone() {\n const clone = new this.constructor();\n Object.assign(clone, this);\n return clone;\n }\n}\n\n/**\n * An array of 32-bit words.\n *\n * @property {Array} words The array of 32-bit words.\n * @property {number} sigBytes The number of significant bytes in this word array.\n */\nexport class WordArray extends Base {\n /**\n * Initializes a newly created word array.\n *\n * @param {Array} words (Optional) An array of 32-bit words.\n * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n *\n * @example\n *\n * var wordArray = CryptoJS.lib.WordArray.create();\n * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);\n * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);\n */\n constructor(words = [], sigBytes = words.length * 4) {\n super();\n\n let typedArray = words;\n // Convert buffers to uint8\n if (typedArray instanceof ArrayBuffer) {\n typedArray = new Uint8Array(typedArray);\n }\n\n // Convert other array views to uint8\n if (\n typedArray instanceof Int8Array\n || typedArray instanceof Uint8ClampedArray\n || typedArray instanceof Int16Array\n || typedArray instanceof Uint16Array\n || typedArray instanceof Int32Array\n || typedArray instanceof Uint32Array\n || typedArray instanceof Float32Array\n || typedArray instanceof Float64Array\n ) {\n typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);\n }\n\n // Handle Uint8Array\n if (typedArray instanceof Uint8Array) {\n // Shortcut\n const typedArrayByteLength = typedArray.byteLength;\n\n // Extract bytes\n const _words = [];\n for (let i = 0; i < typedArrayByteLength; i += 1) {\n _words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);\n }\n\n // Initialize this word array\n this.words = _words;\n this.sigBytes = typedArrayByteLength;\n } else {\n // Else call normal init\n this.words = words;\n this.sigBytes = sigBytes;\n }\n }\n\n /**\n * Creates a word array filled with random bytes.\n *\n * @param {number} nBytes The number of random bytes to generate.\n *\n * @return {WordArray} The random word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.lib.WordArray.random(16);\n */\n static random(nBytes) {\n const words = [];\n\n const r = (m_w) => {\n let _m_w = m_w;\n let _m_z = 0x3ade68b1;\n const mask = 0xffffffff;\n\n return () => {\n _m_z = (0x9069 * (_m_z & 0xFFFF) + (_m_z >> 0x10)) & mask;\n _m_w = (0x4650 * (_m_w & 0xFFFF) + (_m_w >> 0x10)) & mask;\n let result = ((_m_z << 0x10) + _m_w) & mask;\n result /= 0x100000000;\n result += 0.5;\n return result * (Math.random() > 0.5 ? 1 : -1);\n };\n };\n\n for (let i = 0, rcache; i < nBytes; i += 4) {\n const _r = r((rcache || Math.random()) * 0x100000000);\n\n rcache = _r() * 0x3ade67b7;\n words.push((_r() * 0x100000000) | 0);\n }\n\n return new WordArray(words, nBytes);\n }\n\n /**\n * Converts this word array to a string.\n *\n * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex\n *\n * @return {string} The stringified word array.\n *\n * @example\n *\n * var string = wordArray + '';\n * var string = wordArray.toString();\n * var string = wordArray.toString(CryptoJS.enc.Utf8);\n */\n toString(encoder = Hex) {\n return encoder.stringify(this);\n }\n\n /**\n * Concatenates a word array to this word array.\n *\n * @param {WordArray} wordArray The word array to append.\n *\n * @return {WordArray} This word array.\n *\n * @example\n *\n * wordArray1.concat(wordArray2);\n */\n concat(wordArray) {\n // Shortcuts\n const thisWords = this.words;\n const thatWords = wordArray.words;\n const thisSigBytes = this.sigBytes;\n const thatSigBytes = wordArray.sigBytes;\n\n // Clamp excess bits\n this.clamp();\n\n // Concat\n if (thisSigBytes % 4) {\n // Copy one byte at a time\n for (let i = 0; i < thatSigBytes; i += 1) {\n const thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);\n }\n } else {\n // Copy one word at a time\n for (let i = 0; i < thatSigBytes; i += 4) {\n thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];\n }\n }\n this.sigBytes += thatSigBytes;\n\n // Chainable\n return this;\n }\n\n /**\n * Removes insignificant bits.\n *\n * @example\n *\n * wordArray.clamp();\n */\n clamp() {\n // Shortcuts\n const { words, sigBytes } = this;\n\n // Clamp\n words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);\n words.length = Math.ceil(sigBytes / 4);\n }\n\n /**\n * Creates a copy of this word array.\n *\n * @return {WordArray} The clone.\n *\n * @example\n *\n * var clone = wordArray.clone();\n */\n clone() {\n const clone = super.clone.call(this);\n clone.words = this.words.slice(0);\n\n return clone;\n }\n}\n\n/**\n * Hex encoding strategy.\n */\nexport const Hex = {\n /**\n * Converts a word array to a hex string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The hex string.\n *\n * @static\n *\n * @example\n *\n * var hexString = CryptoJS.enc.Hex.stringify(wordArray);\n */\n stringify(wordArray) {\n // Shortcuts\n const { words, sigBytes } = wordArray;\n\n // Convert\n const hexChars = [];\n for (let i = 0; i < sigBytes; i += 1) {\n const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n\n return hexChars.join('');\n },\n\n /**\n * Converts a hex string to a word array.\n *\n * @param {string} hexStr The hex string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Hex.parse(hexString);\n */\n parse(hexStr) {\n // Shortcut\n const hexStrLength = hexStr.length;\n\n // Convert\n const words = [];\n for (let i = 0; i < hexStrLength; i += 2) {\n words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);\n }\n\n return new WordArray(words, hexStrLength / 2);\n },\n};\n\n/**\n * Latin1 encoding strategy.\n */\nexport const Latin1 = {\n /**\n * Converts a word array to a Latin1 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The Latin1 string.\n *\n * @static\n *\n * @example\n *\n * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);\n */\n stringify(wordArray) {\n // Shortcuts\n const { words, sigBytes } = wordArray;\n\n // Convert\n const latin1Chars = [];\n for (let i = 0; i < sigBytes; i += 1) {\n const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n latin1Chars.push(String.fromCharCode(bite));\n }\n\n return latin1Chars.join('');\n },\n\n /**\n * Converts a Latin1 string to a word array.\n *\n * @param {string} latin1Str The Latin1 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);\n */\n parse(latin1Str) {\n // Shortcut\n const latin1StrLength = latin1Str.length;\n\n // Convert\n const words = [];\n for (let i = 0; i < latin1StrLength; i += 1) {\n words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);\n }\n\n return new WordArray(words, latin1StrLength);\n },\n};\n\n/**\n * UTF-8 encoding strategy.\n */\nexport const Utf8 = {\n /**\n * Converts a word array to a UTF-8 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-8 string.\n *\n * @static\n *\n * @example\n *\n * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);\n */\n stringify(wordArray) {\n try {\n return decodeURIComponent(escape(Latin1.stringify(wordArray)));\n } catch (e) {\n throw new Error('Malformed UTF-8 data');\n }\n },\n\n /**\n * Converts a UTF-8 string to a word array.\n *\n * @param {string} utf8Str The UTF-8 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);\n */\n parse(utf8Str) {\n return Latin1.parse(unescape(encodeURIComponent(utf8Str)));\n },\n};\n\n/**\n * Abstract buffered block algorithm template.\n *\n * The property blockSize must be implemented in a concrete subtype.\n *\n * @property {number} _minBufferSize\n *\n * The number of blocks that should be kept unprocessed in the buffer. Default: 0\n */\nexport class BufferedBlockAlgorithm extends Base {\n constructor() {\n super();\n this._minBufferSize = 0;\n }\n\n /**\n * Resets this block algorithm's data buffer to its initial state.\n *\n * @example\n *\n * bufferedBlockAlgorithm.reset();\n */\n reset() {\n // Initial values\n this._data = new WordArray();\n this._nDataBytes = 0;\n }\n\n /**\n * Adds new data to this block algorithm's buffer.\n *\n * @param {WordArray|string} data\n *\n * The data to append. Strings are converted to a WordArray using UTF-8.\n *\n * @example\n *\n * bufferedBlockAlgorithm._append('data');\n * bufferedBlockAlgorithm._append(wordArray);\n */\n _append(data) {\n let m_data = data;\n\n // Convert string to WordArray, else assume WordArray already\n if (typeof m_data === 'string') {\n m_data = Utf8.parse(m_data);\n }\n\n // Append\n this._data.concat(m_data);\n this._nDataBytes += m_data.sigBytes;\n }\n\n /**\n * Processes available data blocks.\n *\n * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.\n *\n * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.\n *\n * @return {WordArray} The processed data.\n *\n * @example\n *\n * var processedData = bufferedBlockAlgorithm._process();\n * var processedData = bufferedBlockAlgorithm._process(!!'flush');\n */\n _process(doFlush) {\n let processedWords;\n\n // Shortcuts\n const { _data: data, blockSize } = this;\n const dataWords = data.words;\n const dataSigBytes = data.sigBytes;\n const blockSizeBytes = blockSize * 4;\n\n // Count blocks ready\n let nBlocksReady = dataSigBytes / blockSizeBytes;\n if (doFlush) {\n // Round up to include partial blocks\n nBlocksReady = Math.ceil(nBlocksReady);\n } else {\n // Round down to include only full blocks,\n // less the number of blocks that must remain in the buffer\n nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);\n }\n\n // Count words ready\n const nWordsReady = nBlocksReady * blockSize;\n\n // Count bytes ready\n const nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);\n\n // Process blocks\n if (nWordsReady) {\n for (let offset = 0; offset < nWordsReady; offset += blockSize) {\n // Perform concrete-algorithm logic\n this._doProcessBlock(dataWords, offset);\n }\n\n // Remove processed words\n processedWords = dataWords.splice(0, nWordsReady);\n data.sigBytes -= nBytesReady;\n }\n\n // Return processed words\n return new WordArray(processedWords, nBytesReady);\n }\n\n /**\n * Creates a copy of this object.\n *\n * @return {Object} The clone.\n *\n * @example\n *\n * var clone = bufferedBlockAlgorithm.clone();\n */\n clone() {\n const clone = super.clone.call(this);\n clone._data = this._data.clone();\n\n return clone;\n }\n}\n\n/**\n * Abstract hasher template.\n *\n * @property {number} blockSize\n *\n * The number of 32-bit words this hasher operates on. Default: 16 (512 bits)\n */\nexport class Hasher extends BufferedBlockAlgorithm {\n constructor(cfg) {\n super();\n\n this.blockSize = 512 / 32;\n\n /**\n * Configuration options.\n */\n this.cfg = Object.assign(new Base(), cfg);\n\n // Set initial values\n this.reset();\n }\n\n /**\n * Creates a shortcut function to a hasher's object interface.\n *\n * @param {Hasher} SubHasher The hasher to create a helper for.\n *\n * @return {Function} The shortcut function.\n *\n * @static\n *\n * @example\n *\n * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);\n */\n static _createHelper(SubHasher) {\n return (message, cfg) => new SubHasher(cfg).finalize(message);\n }\n\n /**\n * Creates a shortcut function to the HMAC's object interface.\n *\n * @param {Hasher} SubHasher The hasher to use in this HMAC helper.\n *\n * @return {Function} The shortcut function.\n *\n * @static\n *\n * @example\n *\n * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);\n */\n static _createHmacHelper(SubHasher) {\n return (message, key) => new HMAC(SubHasher, key).finalize(message);\n }\n\n /**\n * Resets this hasher to its initial state.\n *\n * @example\n *\n * hasher.reset();\n */\n reset() {\n // Reset data buffer\n super.reset.call(this);\n\n // Perform concrete-hasher logic\n this._doReset();\n }\n\n /**\n * Updates this hasher with a message.\n *\n * @param {WordArray|string} messageUpdate The message to append.\n *\n * @return {Hasher} This hasher.\n *\n * @example\n *\n * hasher.update('message');\n * hasher.update(wordArray);\n */\n update(messageUpdate) {\n // Append\n this._append(messageUpdate);\n\n // Update the hash\n this._process();\n\n // Chainable\n return this;\n }\n\n /**\n * Finalizes the hash computation.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} messageUpdate (Optional) A final message update.\n *\n * @return {WordArray} The hash.\n *\n * @example\n *\n * var hash = hasher.finalize();\n * var hash = hasher.finalize('message');\n * var hash = hasher.finalize(wordArray);\n */\n finalize(messageUpdate) {\n // Final message update\n if (messageUpdate) {\n this._append(messageUpdate);\n }\n\n // Perform concrete-hasher logic\n const hash = this._doFinalize();\n\n return hash;\n }\n}\n\n/**\n * HMAC algorithm.\n */\nexport class HMAC extends Base {\n /**\n * Initializes a newly created HMAC.\n *\n * @param {Hasher} SubHasher The hash algorithm to use.\n * @param {WordArray|string} key The secret key.\n *\n * @example\n *\n * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);\n */\n constructor(SubHasher, key) {\n super();\n\n const hasher = new SubHasher();\n this._hasher = hasher;\n\n // Convert string to WordArray, else assume WordArray already\n let _key = key;\n if (typeof _key === 'string') {\n _key = Utf8.parse(_key);\n }\n\n // Shortcuts\n const hasherBlockSize = hasher.blockSize;\n const hasherBlockSizeBytes = hasherBlockSize * 4;\n\n // Allow arbitrary length keys\n if (_key.sigBytes > hasherBlockSizeBytes) {\n _key = hasher.finalize(key);\n }\n\n // Clamp excess bits\n _key.clamp();\n\n // Clone key for inner and outer pads\n const oKey = _key.clone();\n this._oKey = oKey;\n const iKey = _key.clone();\n this._iKey = iKey;\n\n // Shortcuts\n const oKeyWords = oKey.words;\n const iKeyWords = iKey.words;\n\n // XOR keys with pad constants\n for (let i = 0; i < hasherBlockSize; i += 1) {\n oKeyWords[i] ^= 0x5c5c5c5c;\n iKeyWords[i] ^= 0x36363636;\n }\n oKey.sigBytes = hasherBlockSizeBytes;\n iKey.sigBytes = hasherBlockSizeBytes;\n\n // Set initial values\n this.reset();\n }\n\n /**\n * Resets this HMAC to its initial state.\n *\n * @example\n *\n * hmacHasher.reset();\n */\n reset() {\n // Shortcut\n const hasher = this._hasher;\n\n // Reset\n hasher.reset();\n hasher.update(this._iKey);\n }\n\n /**\n * Updates this HMAC with a message.\n *\n * @param {WordArray|string} messageUpdate The message to append.\n *\n * @return {HMAC} This HMAC instance.\n *\n * @example\n *\n * hmacHasher.update('message');\n * hmacHasher.update(wordArray);\n */\n update(messageUpdate) {\n this._hasher.update(messageUpdate);\n\n // Chainable\n return this;\n }\n\n /**\n * Finalizes the HMAC computation.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} messageUpdate (Optional) A final message update.\n *\n * @return {WordArray} The HMAC.\n *\n * @example\n *\n * var hmac = hmacHasher.finalize();\n * var hmac = hmacHasher.finalize('message');\n * var hmac = hmacHasher.finalize(wordArray);\n */\n finalize(messageUpdate) {\n // Shortcut\n const hasher = this._hasher;\n\n // Compute HMAC\n const innerHash = hasher.finalize(messageUpdate);\n hasher.reset();\n const hmac = hasher.finalize(this._oKey.clone().concat(innerHash));\n\n return hmac;\n }\n}\n","import {\n Base,\n WordArray,\n} from './core.js';\n\nconst X32WordArray = WordArray;\n\n/**\n * A 64-bit word.\n */\nexport class X64Word extends Base {\n /**\n * Initializes a newly created 64-bit word.\n *\n * @param {number} high The high 32 bits.\n * @param {number} low The low 32 bits.\n *\n * @example\n *\n * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);\n */\n constructor(high, low) {\n super();\n\n this.high = high;\n this.low = low;\n }\n}\n\n/**\n * An array of 64-bit words.\n *\n * @property {Array} words The array of CryptoJS.x64.Word objects.\n * @property {number} sigBytes The number of significant bytes in this word array.\n */\nexport class X64WordArray extends Base {\n /**\n * Initializes a newly created word array.\n *\n * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.\n * @param {number} sigBytes (Optional) The number of significant bytes in the words.\n *\n * @example\n *\n * var wordArray = CryptoJS.x64.WordArray.create();\n *\n * var wordArray = CryptoJS.x64.WordArray.create([\n * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n * ]);\n *\n * var wordArray = CryptoJS.x64.WordArray.create([\n * CryptoJS.x64.Word.create(0x00010203, 0x04050607),\n * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)\n * ], 10);\n */\n constructor(words = [], sigBytes = words.length * 8) {\n super();\n\n this.words = words;\n this.sigBytes = sigBytes;\n }\n\n /**\n * Converts this 64-bit word array to a 32-bit word array.\n *\n * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.\n *\n * @example\n *\n * var x32WordArray = x64WordArray.toX32();\n */\n toX32() {\n // Shortcuts\n const x64Words = this.words;\n const x64WordsLength = x64Words.length;\n\n // Convert\n const x32Words = [];\n for (let i = 0; i < x64WordsLength; i += 1) {\n const x64Word = x64Words[i];\n x32Words.push(x64Word.high);\n x32Words.push(x64Word.low);\n }\n\n return X32WordArray.create(x32Words, this.sigBytes);\n }\n\n /**\n * Creates a copy of this word array.\n *\n * @return {X64WordArray} The clone.\n *\n * @example\n *\n * var clone = x64WordArray.clone();\n */\n clone() {\n const clone = super.clone.call(this);\n\n // Clone \"words\" array\n clone.words = this.words.slice(0);\n const { words } = clone;\n\n // Clone each X64Word object\n const wordsLength = words.length;\n for (let i = 0; i < wordsLength; i += 1) {\n words[i] = words[i].clone();\n }\n\n return clone;\n }\n}\n","import {\n WordArray,\n} from './core.js';\n\nconst parseLoop = (base64Str, base64StrLength, reverseMap) => {\n const words = [];\n let nBytes = 0;\n for (let i = 0; i < base64StrLength; i += 1) {\n if (i % 4) {\n const bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);\n const bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);\n const bitsCombined = bits1 | bits2;\n words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);\n nBytes += 1;\n }\n }\n return WordArray.create(words, nBytes);\n};\n\n/**\n * Base64 encoding strategy.\n */\nexport const Base64 = {\n /**\n * Converts a word array to a Base64 string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The Base64 string.\n *\n * @static\n *\n * @example\n *\n * const base64String = CryptoJS.enc.Base64.stringify(wordArray);\n */\n stringify(wordArray) {\n // Shortcuts\n const { words, sigBytes } = wordArray;\n const map = this._map;\n\n // Clamp excess bits\n wordArray.clamp();\n\n // Convert\n const base64Chars = [];\n for (let i = 0; i < sigBytes; i += 3) {\n const byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n const byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\n const byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\n\n const triplet = (byte1 << 16) | (byte2 << 8) | byte3;\n\n for (let j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j += 1) {\n base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\n }\n }\n\n // Add padding\n const paddingChar = map.charAt(64);\n if (paddingChar) {\n while (base64Chars.length % 4) {\n base64Chars.push(paddingChar);\n }\n }\n\n return base64Chars.join('');\n },\n\n /**\n * Converts a Base64 string to a word array.\n *\n * @param {string} base64Str The Base64 string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * const wordArray = CryptoJS.enc.Base64.parse(base64String);\n */\n parse(base64Str) {\n // Shortcuts\n let base64StrLength = base64Str.length;\n const map = this._map;\n let reverseMap = this._reverseMap;\n\n if (!reverseMap) {\n this._reverseMap = [];\n reverseMap = this._reverseMap;\n for (let j = 0; j < map.length; j += 1) {\n reverseMap[map.charCodeAt(j)] = j;\n }\n }\n\n // Ignore padding\n const paddingChar = map.charAt(64);\n if (paddingChar) {\n const paddingIndex = base64Str.indexOf(paddingChar);\n if (paddingIndex !== -1) {\n base64StrLength = paddingIndex;\n }\n }\n\n // Convert\n return parseLoop(base64Str, base64StrLength, reverseMap);\n },\n\n _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',\n};\n","import {\n Base,\n WordArray,\n} from './core.js';\nimport { MD5Algo } from './md5.js';\n\n/**\n * This key derivation function is meant to conform with EVP_BytesToKey.\n * www.openssl.org/docs/crypto/EVP_BytesToKey.html\n */\nexport class EvpKDFAlgo extends Base {\n /**\n * Initializes a newly created key derivation function.\n *\n * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n *\n * @example\n *\n * const kdf = CryptoJS.algo.EvpKDF.create();\n * const kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });\n * const kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });\n */\n constructor(cfg) {\n super();\n\n /**\n * Configuration options.\n *\n * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n * @property {Hasher} hasher The hash algorithm to use. Default: MD5\n * @property {number} iterations The number of iterations to perform. Default: 1\n */\n this.cfg = Object.assign(\n new Base(),\n {\n keySize: 128 / 32,\n hasher: MD5Algo,\n iterations: 1,\n },\n cfg,\n );\n }\n\n /**\n * Derives a key from a password.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n *\n * @return {WordArray} The derived key.\n *\n * @example\n *\n * const key = kdf.compute(password, salt);\n */\n compute(password, salt) {\n let block;\n\n // Shortcut\n const { cfg } = this;\n\n // Init hasher\n const hasher = cfg.hasher.create();\n\n // Initial values\n const derivedKey = WordArray.create();\n\n // Shortcuts\n const derivedKeyWords = derivedKey.words;\n const { keySize, iterations } = cfg;\n\n // Generate key\n while (derivedKeyWords.length < keySize) {\n if (block) {\n hasher.update(block);\n }\n block = hasher.update(password).finalize(salt);\n hasher.reset();\n\n // Iterations\n for (let i = 1; i < iterations; i += 1) {\n block = hasher.finalize(block);\n hasher.reset();\n }\n\n derivedKey.concat(block);\n }\n derivedKey.sigBytes = keySize * 4;\n\n return derivedKey;\n }\n}\n\n/**\n * Derives a key from a password.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n * @param {Object} cfg (Optional) The configuration options to use for this computation.\n *\n * @return {WordArray} The derived key.\n *\n * @static\n *\n * @example\n *\n * var key = CryptoJS.EvpKDF(password, salt);\n * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });\n * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });\n */\nexport const EvpKDF = (password, salt, cfg) => EvpKDFAlgo.create(cfg).compute(password, salt);\n","/* eslint-disable no-use-before-define */\n\nimport {\n Base,\n WordArray,\n BufferedBlockAlgorithm,\n} from './core.js';\nimport { Base64 } from './enc-base64.js';\nimport { EvpKDFAlgo } from './evpkdf.js';\n\n/**\n * Abstract base cipher template.\n *\n * @property {number} keySize This cipher's key size. Default: 4 (128 bits)\n * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)\n * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.\n * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.\n */\nexport class Cipher extends BufferedBlockAlgorithm {\n /**\n * Initializes a newly created cipher.\n *\n * @param {number} xformMode Either the encryption or decryption transormation mode constant.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @example\n *\n * const cipher = CryptoJS.algo.AES.create(\n * CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray }\n * );\n */\n constructor(xformMode, key, cfg) {\n super();\n\n /**\n * Configuration options.\n *\n * @property {WordArray} iv The IV to use for this operation.\n */\n this.cfg = Object.assign(new Base(), cfg);\n\n // Store transform mode and key\n this._xformMode = xformMode;\n this._key = key;\n\n // Set initial values\n this.reset();\n }\n\n /**\n * Creates this cipher in encryption mode.\n *\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {Cipher} A cipher instance.\n *\n * @static\n *\n * @example\n *\n * const cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });\n */\n static createEncryptor(key, cfg) {\n return this.create(this._ENC_XFORM_MODE, key, cfg);\n }\n\n /**\n * Creates this cipher in decryption mode.\n *\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {Cipher} A cipher instance.\n *\n * @static\n *\n * @example\n *\n * const cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });\n */\n static createDecryptor(key, cfg) {\n return this.create(this._DEC_XFORM_MODE, key, cfg);\n }\n\n /**\n * Creates shortcut functions to a cipher's object interface.\n *\n * @param {Cipher} cipher The cipher to create a helper for.\n *\n * @return {Object} An object with encrypt and decrypt shortcut functions.\n *\n * @static\n *\n * @example\n *\n * const AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);\n */\n static _createHelper(SubCipher) {\n const selectCipherStrategy = (key) => {\n if (typeof key === 'string') {\n return PasswordBasedCipher;\n }\n return SerializableCipher;\n };\n\n return {\n encrypt(message, key, cfg) {\n return selectCipherStrategy(key).encrypt(SubCipher, message, key, cfg);\n },\n\n decrypt(ciphertext, key, cfg) {\n return selectCipherStrategy(key).decrypt(SubCipher, ciphertext, key, cfg);\n },\n };\n }\n\n /**\n * Resets this cipher to its initial state.\n *\n * @example\n *\n * cipher.reset();\n */\n reset() {\n // Reset data buffer\n super.reset.call(this);\n\n // Perform concrete-cipher logic\n this._doReset();\n }\n\n /**\n * Adds data to be encrypted or decrypted.\n *\n * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.\n *\n * @return {WordArray} The data after processing.\n *\n * @example\n *\n * const encrypted = cipher.process('data');\n * const encrypted = cipher.process(wordArray);\n */\n process(dataUpdate) {\n // Append\n this._append(dataUpdate);\n\n // Process available blocks\n return this._process();\n }\n\n /**\n * Finalizes the encryption or decryption process.\n * Note that the finalize operation is effectively a destructive, read-once operation.\n *\n * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.\n *\n * @return {WordArray} The data after final processing.\n *\n * @example\n *\n * const encrypted = cipher.finalize();\n * const encrypted = cipher.finalize('data');\n * const encrypted = cipher.finalize(wordArray);\n */\n finalize(dataUpdate) {\n // Final data update\n if (dataUpdate) {\n this._append(dataUpdate);\n }\n\n // Perform concrete-cipher logic\n const finalProcessedData = this._doFinalize();\n\n return finalProcessedData;\n }\n}\nCipher._ENC_XFORM_MODE = 1;\nCipher._DEC_XFORM_MODE = 2;\nCipher.keySize = 128 / 32;\nCipher.ivSize = 128 / 32;\n\n/**\n * Abstract base stream cipher template.\n *\n * @property {number} blockSize\n *\n * The number of 32-bit words this cipher operates on. Default: 1 (32 bits)\n */\nexport class StreamCipher extends Cipher {\n constructor(...args) {\n super(...args);\n\n this.blockSize = 1;\n }\n\n _doFinalize() {\n // Process partial blocks\n const finalProcessedBlocks = this._process(!!'flush');\n\n return finalProcessedBlocks;\n }\n}\n\n/**\n * Abstract base block cipher mode template.\n */\nexport class BlockCipherMode extends Base {\n /**\n * Initializes a newly created mode.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @example\n *\n * const mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);\n */\n constructor(cipher, iv) {\n super();\n\n this._cipher = cipher;\n this._iv = iv;\n }\n\n /**\n * Creates this mode for encryption.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @static\n *\n * @example\n *\n * const mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);\n */\n static createEncryptor(cipher, iv) {\n return this.Encryptor.create(cipher, iv);\n }\n\n /**\n * Creates this mode for decryption.\n *\n * @param {Cipher} cipher A block cipher instance.\n * @param {Array} iv The IV words.\n *\n * @static\n *\n * @example\n *\n * const mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);\n */\n static createDecryptor(cipher, iv) {\n return this.Decryptor.create(cipher, iv);\n }\n}\n\nfunction xorBlock(words, offset, blockSize) {\n const _words = words;\n let block;\n\n // Shortcut\n const iv = this._iv;\n\n // Choose mixing block\n if (iv) {\n block = iv;\n\n // Remove IV for subsequent blocks\n this._iv = undefined;\n } else {\n block = this._prevBlock;\n }\n\n // XOR blocks\n for (let i = 0; i < blockSize; i += 1) {\n _words[offset + i] ^= block[i];\n }\n}\n\n/**\n * Cipher Block Chaining mode.\n */\n\n/**\n * Abstract base CBC mode.\n */\nexport class CBC extends BlockCipherMode {\n}\n/**\n * CBC encryptor.\n */\nCBC.Encryptor = class extends CBC {\n /**\n * Processes the data block at offset.\n *\n * @param {Array} words The data words to operate on.\n * @param {number} offset The offset where the block starts.\n *\n * @example\n *\n * mode.processBlock(data.words, offset);\n */\n processBlock(words, offset) {\n // Shortcuts\n const cipher = this._cipher;\n const { blockSize } = cipher;\n\n // XOR and encrypt\n xorBlock.call(this, words, offset, blockSize);\n cipher.encryptBlock(words, offset);\n\n // Remember this block to use with next block\n this._prevBlock = words.slice(offset, offset + blockSize);\n }\n};\n/**\n * CBC decryptor.\n */\nCBC.Decryptor = class extends CBC {\n /**\n * Processes the data block at offset.\n *\n * @param {Array} words The data words to operate on.\n * @param {number} offset The offset where the block starts.\n *\n * @example\n *\n * mode.processBlock(data.words, offset);\n */\n processBlock(words, offset) {\n // Shortcuts\n const cipher = this._cipher;\n const { blockSize } = cipher;\n\n // Remember this block to use with next block\n const thisBlock = words.slice(offset, offset + blockSize);\n\n // Decrypt and XOR\n cipher.decryptBlock(words, offset);\n xorBlock.call(this, words, offset, blockSize);\n\n // This block becomes the previous block\n this._prevBlock = thisBlock;\n }\n};\n\n/**\n * PKCS #5/7 padding strategy.\n */\nexport const Pkcs7 = {\n /**\n * Pads data using the algorithm defined in PKCS #5/7.\n *\n * @param {WordArray} data The data to pad.\n * @param {number} blockSize The multiple that the data should be padded to.\n *\n * @static\n *\n * @example\n *\n * CryptoJS.pad.Pkcs7.pad(wordArray, 4);\n */\n pad(data, blockSize) {\n // Shortcut\n const blockSizeBytes = blockSize * 4;\n\n // Count padding bytes\n const nPaddingBytes = blockSizeBytes - (data.sigBytes % blockSizeBytes);\n\n // Create padding word\n const paddingWord = (nPaddingBytes << 24)\n | (nPaddingBytes << 16)\n | (nPaddingBytes << 8)\n | nPaddingBytes;\n\n // Create padding\n const paddingWords = [];\n for (let i = 0; i < nPaddingBytes; i += 4) {\n paddingWords.push(paddingWord);\n }\n const padding = WordArray.create(paddingWords, nPaddingBytes);\n\n // Add padding\n data.concat(padding);\n },\n\n /**\n * Unpads data that had been padded using the algorithm defined in PKCS #5/7.\n *\n * @param {WordArray} data The data to unpad.\n *\n * @static\n *\n * @example\n *\n * CryptoJS.pad.Pkcs7.unpad(wordArray);\n */\n unpad(data) {\n const _data = data;\n\n // Get number of padding bytes from last byte\n const nPaddingBytes = _data.words[(_data.sigBytes - 1) >>> 2] & 0xff;\n\n // Remove padding\n _data.sigBytes -= nPaddingBytes;\n },\n};\n\n/**\n * Abstract base block cipher template.\n *\n * @property {number} blockSize\n *\n * The number of 32-bit words this cipher operates on. Default: 4 (128 bits)\n */\nexport class BlockCipher extends Cipher {\n constructor(xformMode, key, cfg) {\n /**\n * Configuration options.\n *\n * @property {Mode} mode The block mode to use. Default: CBC\n * @property {Padding} padding The padding strategy to use. Default: Pkcs7\n */\n super(xformMode, key, Object.assign(\n {\n mode: CBC,\n padding: Pkcs7,\n },\n cfg,\n ));\n\n this.blockSize = 128 / 32;\n }\n\n reset() {\n let modeCreator;\n\n // Reset cipher\n super.reset.call(this);\n\n // Shortcuts\n const { cfg } = this;\n const { iv, mode } = cfg;\n\n // Reset block mode\n if (this._xformMode === this.constructor._ENC_XFORM_MODE) {\n modeCreator = mode.createEncryptor;\n } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {\n modeCreator = mode.createDecryptor;\n // Keep at least one block in the buffer for unpadding\n this._minBufferSize = 1;\n }\n\n this._mode = modeCreator.call(mode, this, iv && iv.words);\n this._mode.__creator = modeCreator;\n }\n\n _doProcessBlock(words, offset) {\n this._mode.processBlock(words, offset);\n }\n\n _doFinalize() {\n let finalProcessedBlocks;\n\n // Shortcut\n const { padding } = this.cfg;\n\n // Finalize\n if (this._xformMode === this.constructor._ENC_XFORM_MODE) {\n // Pad data\n padding.pad(this._data, this.blockSize);\n\n // Process final blocks\n finalProcessedBlocks = this._process(!!'flush');\n } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {\n // Process final blocks\n finalProcessedBlocks = this._process(!!'flush');\n\n // Unpad data\n padding.unpad(finalProcessedBlocks);\n }\n\n return finalProcessedBlocks;\n }\n}\n\n/**\n * A collection of cipher parameters.\n *\n * @property {WordArray} ciphertext The raw ciphertext.\n * @property {WordArray} key The key to this ciphertext.\n * @property {WordArray} iv The IV used in the ciphering operation.\n * @property {WordArray} salt The salt used with a key derivation function.\n * @property {Cipher} algorithm The cipher algorithm.\n * @property {Mode} mode The block mode used in the ciphering operation.\n * @property {Padding} padding The padding scheme used in the ciphering operation.\n * @property {number} blockSize The block size of the cipher.\n * @property {Format} formatter\n * The default formatting strategy to convert this cipher params object to a string.\n */\nexport class CipherParams extends Base {\n /**\n * Initializes a newly created cipher params object.\n *\n * @param {Object} cipherParams An object with any of the possible cipher parameters.\n *\n * @example\n *\n * var cipherParams = CryptoJS.lib.CipherParams.create({\n * ciphertext: ciphertextWordArray,\n * key: keyWordArray,\n * iv: ivWordArray,\n * salt: saltWordArray,\n * algorithm: CryptoJS.algo.AES,\n * mode: CryptoJS.mode.CBC,\n * padding: CryptoJS.pad.PKCS7,\n * blockSize: 4,\n * formatter: CryptoJS.format.OpenSSL\n * });\n */\n constructor(cipherParams) {\n super();\n\n this.mixIn(cipherParams);\n }\n\n /**\n * Converts this cipher params object to a string.\n *\n * @param {Format} formatter (Optional) The formatting strategy to use.\n *\n * @return {string} The stringified cipher params.\n *\n * @throws Error If neither the formatter nor the default formatter is set.\n *\n * @example\n *\n * var string = cipherParams + '';\n * var string = cipherParams.toString();\n * var string = cipherParams.toString(CryptoJS.format.OpenSSL);\n */\n toString(formatter) {\n return (formatter || this.formatter).stringify(this);\n }\n}\n\n/**\n * OpenSSL formatting strategy.\n */\nexport const OpenSSLFormatter = {\n /**\n * Converts a cipher params object to an OpenSSL-compatible string.\n *\n * @param {CipherParams} cipherParams The cipher params object.\n *\n * @return {string} The OpenSSL-compatible string.\n *\n * @static\n *\n * @example\n *\n * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);\n */\n stringify(cipherParams) {\n let wordArray;\n\n // Shortcuts\n const { ciphertext, salt } = cipherParams;\n\n // Format\n if (salt) {\n wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);\n } else {\n wordArray = ciphertext;\n }\n\n return wordArray.toString(Base64);\n },\n\n /**\n * Converts an OpenSSL-compatible string to a cipher params object.\n *\n * @param {string} openSSLStr The OpenSSL-compatible string.\n *\n * @return {CipherParams} The cipher params object.\n *\n * @static\n *\n * @example\n *\n * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);\n */\n parse(openSSLStr) {\n let salt;\n\n // Parse base64\n const ciphertext = Base64.parse(openSSLStr);\n\n // Shortcut\n const ciphertextWords = ciphertext.words;\n\n // Test for salt\n if (ciphertextWords[0] === 0x53616c74 && ciphertextWords[1] === 0x65645f5f) {\n // Extract salt\n salt = WordArray.create(ciphertextWords.slice(2, 4));\n\n // Remove salt from ciphertext\n ciphertextWords.splice(0, 4);\n ciphertext.sigBytes -= 16;\n }\n\n return CipherParams.create({ ciphertext, salt });\n },\n};\n\n/**\n * A cipher wrapper that returns ciphertext as a serializable cipher params object.\n */\nexport class SerializableCipher extends Base {\n /**\n * Encrypts a message.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {WordArray|string} message The message to encrypt.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {CipherParams} A cipher params object.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.SerializableCipher\n * .encrypt(CryptoJS.algo.AES, message, key);\n * var ciphertextParams = CryptoJS.lib.SerializableCipher\n * .encrypt(CryptoJS.algo.AES, message, key, { iv: iv });\n * var ciphertextParams = CryptoJS.lib.SerializableCipher\n * .encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });\n */\n static encrypt(cipher, message, key, cfg) {\n // Apply config defaults\n const _cfg = Object.assign(new Base(), this.cfg, cfg);\n\n // Encrypt\n const encryptor = cipher.createEncryptor(key, _cfg);\n const ciphertext = encryptor.finalize(message);\n\n // Shortcut\n const cipherCfg = encryptor.cfg;\n\n // Create and return serializable cipher params\n return CipherParams.create({\n ciphertext,\n key,\n iv: cipherCfg.iv,\n algorithm: cipher,\n mode: cipherCfg.mode,\n padding: cipherCfg.padding,\n blockSize: encryptor.blockSize,\n formatter: _cfg.format,\n });\n }\n\n /**\n * Decrypts serialized ciphertext.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n * @param {WordArray} key The key.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {WordArray} The plaintext.\n *\n * @static\n *\n * @example\n *\n * var plaintext = CryptoJS.lib.SerializableCipher\n * .decrypt(CryptoJS.algo.AES, formattedCiphertext, key,\n * { iv: iv, format: CryptoJS.format.OpenSSL });\n * var plaintext = CryptoJS.lib.SerializableCipher\n * .decrypt(CryptoJS.algo.AES, ciphertextParams, key,\n * { iv: iv, format: CryptoJS.format.OpenSSL });\n */\n static decrypt(cipher, ciphertext, key, cfg) {\n let _ciphertext = ciphertext;\n\n // Apply config defaults\n const _cfg = Object.assign(new Base(), this.cfg, cfg);\n\n // Convert string to CipherParams\n _ciphertext = this._parse(_ciphertext, _cfg.format);\n\n // Decrypt\n const plaintext = cipher.createDecryptor(key, _cfg).finalize(_ciphertext.ciphertext);\n\n return plaintext;\n }\n\n /**\n * Converts serialized ciphertext to CipherParams,\n * else assumed CipherParams already and returns ciphertext unchanged.\n *\n * @param {CipherParams|string} ciphertext The ciphertext.\n * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.\n *\n * @return {CipherParams} The unserialized ciphertext.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.SerializableCipher\n * ._parse(ciphertextStringOrParams, format);\n */\n static _parse(ciphertext, format) {\n if (typeof ciphertext === 'string') {\n return format.parse(ciphertext, this);\n }\n return ciphertext;\n }\n}\n/**\n * Configuration options.\n *\n * @property {Formatter} format\n *\n * The formatting strategy to convert cipher param objects to and from a string.\n * Default: OpenSSL\n */\nSerializableCipher.cfg = Object.assign(\n new Base(),\n { format: OpenSSLFormatter },\n);\n\n/**\n * OpenSSL key derivation function.\n */\nexport const OpenSSLKdf = {\n /**\n * Derives a key and IV from a password.\n *\n * @param {string} password The password to derive from.\n * @param {number} keySize The size in words of the key to generate.\n * @param {number} ivSize The size in words of the IV to generate.\n * @param {WordArray|string} salt\n * (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.\n *\n * @return {CipherParams} A cipher params object with the key, IV, and salt.\n *\n * @static\n *\n * @example\n *\n * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);\n * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');\n */\n execute(password, keySize, ivSize, salt) {\n let _salt = salt;\n\n // Generate random salt\n if (!_salt) {\n _salt = WordArray.random(64 / 8);\n }\n\n // Derive key and IV\n const key = EvpKDFAlgo.create({ keySize: keySize + ivSize }).compute(password, _salt);\n\n // Separate key and IV\n const iv = WordArray.create(key.words.slice(keySize), ivSize * 4);\n key.sigBytes = keySize * 4;\n\n // Return params\n return CipherParams.create({ key, iv, salt: _salt });\n },\n};\n\n/**\n * A serializable cipher wrapper that derives the key from a password,\n * and returns ciphertext as a serializable cipher params object.\n */\nexport class PasswordBasedCipher extends SerializableCipher {\n /**\n * Encrypts a message using a password.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {WordArray|string} message The message to encrypt.\n * @param {string} password The password.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {CipherParams} A cipher params object.\n *\n * @static\n *\n * @example\n *\n * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher\n * .encrypt(CryptoJS.algo.AES, message, 'password');\n * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher\n * .encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });\n */\n static encrypt(cipher, message, password, cfg) {\n // Apply config defaults\n const _cfg = Object.assign(new Base(), this.cfg, cfg);\n\n // Derive key and other params\n const derivedParams = _cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);\n\n // Add IV to config\n _cfg.iv = derivedParams.iv;\n\n // Encrypt\n const ciphertext = SerializableCipher.encrypt\n .call(this, cipher, message, derivedParams.key, _cfg);\n\n // Mix in derived params\n ciphertext.mixIn(derivedParams);\n\n return ciphertext;\n }\n\n /**\n * Decrypts serialized ciphertext using a password.\n *\n * @param {Cipher} cipher The cipher algorithm to use.\n * @param {CipherParams|string} ciphertext The ciphertext to decrypt.\n * @param {string} password The password.\n * @param {Object} cfg (Optional) The configuration options to use for this operation.\n *\n * @return {WordArray} The plaintext.\n *\n * @static\n *\n * @example\n *\n * var plaintext = CryptoJS.lib.PasswordBasedCipher\n * .decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password',\n * { format: CryptoJS.format.OpenSSL });\n * var plaintext = CryptoJS.lib.PasswordBasedCipher\n * .decrypt(CryptoJS.algo.AES, ciphertextParams, 'password',\n * { format: CryptoJS.format.OpenSSL });\n */\n static decrypt(cipher, ciphertext, password, cfg) {\n let _ciphertext = ciphertext;\n\n // Apply config defaults\n const _cfg = Object.assign(new Base(), this.cfg, cfg);\n\n // Convert string to CipherParams\n _ciphertext = this._parse(_ciphertext, _cfg.format);\n\n // Derive key and other params\n const derivedParams = _cfg.kdf\n .execute(password, cipher.keySize, cipher.ivSize, _ciphertext.salt);\n\n // Add IV to config\n _cfg.iv = derivedParams.iv;\n\n // Decrypt\n const plaintext = SerializableCipher.decrypt\n .call(this, cipher, _ciphertext, derivedParams.key, _cfg);\n\n return plaintext;\n }\n}\n/**\n * Configuration options.\n *\n * @property {KDF} kdf\n * The key derivation function to use to generate a key and IV from a password.\n * Default: OpenSSL\n */\nPasswordBasedCipher.cfg = Object.assign(SerializableCipher.cfg, { kdf: OpenSSLKdf });\n","import {\n WordArray,\n Hasher,\n} from './core.js';\n\n// Initialization and round constants tables\nconst H = [];\nconst K = [];\n\n// Compute constants\nconst isPrime = (n) => {\n const sqrtN = Math.sqrt(n);\n for (let factor = 2; factor <= sqrtN; factor += 1) {\n if (!(n % factor)) {\n return false;\n }\n }\n\n return true;\n};\n\nconst getFractionalBits = n => ((n - (n | 0)) * 0x100000000) | 0;\n\nlet n = 2;\nlet nPrime = 0;\nwhile (nPrime < 64) {\n if (isPrime(n)) {\n if (nPrime < 8) {\n H[nPrime] = getFractionalBits(n ** (1 / 2));\n }\n K[nPrime] = getFractionalBits(n ** (1 / 3));\n\n nPrime += 1;\n }\n\n n += 1;\n}\n\n// Reusable object\nconst W = [];\n\n/**\n * SHA-256 hash algorithm.\n */\nexport class SHA256Algo extends Hasher {\n _doReset() {\n this._hash = new WordArray(H.slice(0));\n }\n\n _doProcessBlock(M, offset) {\n // Shortcut\n const _H = this._hash.words;\n\n // Working variables\n let a = _H[0];\n let b = _H[1];\n let c = _H[2];\n let d = _H[3];\n let e = _H[4];\n let f = _H[5];\n let g = _H[6];\n let h = _H[7];\n\n // Computation\n for (let i = 0; i < 64; i += 1) {\n if (i < 16) {\n W[i] = M[offset + i] | 0;\n } else {\n const gamma0x = W[i - 15];\n const gamma0 = ((gamma0x << 25) | (gamma0x >>> 7))\n ^ ((gamma0x << 14) | (gamma0x >>> 18))\n ^ (gamma0x >>> 3);\n\n const gamma1x = W[i - 2];\n const gamma1 = ((gamma1x << 15) | (gamma1x >>> 17))\n ^ ((gamma1x << 13) | (gamma1x >>> 19))\n ^ (gamma1x >>> 10);\n\n W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];\n }\n\n const ch = (e & f) ^ (~e & g);\n const maj = (a & b) ^ (a & c) ^ (b & c);\n\n const sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));\n const sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));\n\n const t1 = h + sigma1 + ch + K[i] + W[i];\n const t2 = sigma0 + maj;\n\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n\n // Intermediate hash value\n _H[0] = (_H[0] + a) | 0;\n _H[1] = (_H[1] + b) | 0;\n _H[2] = (_H[2] + c) | 0;\n _H[3] = (_H[3] + d) | 0;\n _H[4] = (_H[4] + e) | 0;\n _H[5] = (_H[5] + f) | 0;\n _H[6] = (_H[6] + g) | 0;\n _H[7] = (_H[7] + h) | 0;\n }\n\n _doFinalize() {\n // Shortcuts\n const data = this._data;\n const dataWords = data.words;\n\n const nBitsTotal = this._nDataBytes * 8;\n const nBitsLeft = data.sigBytes * 8;\n\n // Add padding\n dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - (nBitsLeft % 32));\n dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n data.sigBytes = dataWords.length * 4;\n\n // Hash final blocks\n this._process();\n\n // Return final computed hash\n return this._hash;\n }\n\n clone() {\n const clone = super.clone.call(this);\n clone._hash = this._hash.clone();\n\n return clone;\n }\n}\n\n/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA256('message');\n * var hash = CryptoJS.SHA256(wordArray);\n */\nexport const SHA256 = Hasher._createHelper(SHA256Algo);\n\n/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA256(message, key);\n */\nexport const HmacSHA256 = Hasher._createHmacHelper(SHA256Algo);\n","import {\n WordArray,\n} from './core.js';\n\nconst swapEndian = word => ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);\n\n/**\n * UTF-16 BE encoding strategy.\n */\nexport const Utf16BE = {\n /**\n * Converts a word array to a UTF-16 BE string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-16 BE string.\n *\n * @static\n *\n * @example\n *\n * const utf16String = CryptoJS.enc.Utf16.stringify(wordArray);\n */\n stringify(wordArray) {\n // Shortcuts\n const { words, sigBytes } = wordArray;\n\n // Convert\n const utf16Chars = [];\n for (let i = 0; i < sigBytes; i += 2) {\n const codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;\n utf16Chars.push(String.fromCharCode(codePoint));\n }\n\n return utf16Chars.join('');\n },\n\n /**\n * Converts a UTF-16 BE string to a word array.\n *\n * @param {string} utf16Str The UTF-16 BE string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * const wordArray = CryptoJS.enc.Utf16.parse(utf16String);\n */\n parse(utf16Str) {\n // Shortcut\n const utf16StrLength = utf16Str.length;\n\n // Convert\n const words = [];\n for (let i = 0; i < utf16StrLength; i += 1) {\n words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);\n }\n\n return WordArray.create(words, utf16StrLength * 2);\n },\n};\nexport const Utf16 = Utf16BE;\n\n/**\n * UTF-16 LE encoding strategy.\n */\nexport const Utf16LE = {\n /**\n * Converts a word array to a UTF-16 LE string.\n *\n * @param {WordArray} wordArray The word array.\n *\n * @return {string} The UTF-16 LE string.\n *\n * @static\n *\n * @example\n *\n * const utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);\n */\n stringify(wordArray) {\n // Shortcuts\n const { words, sigBytes } = wordArray;\n\n // Convert\n const utf16Chars = [];\n for (let i = 0; i < sigBytes; i += 2) {\n const codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);\n utf16Chars.push(String.fromCharCode(codePoint));\n }\n\n return utf16Chars.join('');\n },\n\n /**\n * Converts a UTF-16 LE string to a word array.\n *\n * @param {string} utf16Str The UTF-16 LE string.\n *\n * @return {WordArray} The word array.\n *\n * @static\n *\n * @example\n *\n * const wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);\n */\n parse(utf16Str) {\n // Shortcut\n const utf16StrLength = utf16Str.length;\n\n // Convert\n const words = [];\n for (let i = 0; i < utf16StrLength; i += 1) {\n words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));\n }\n\n return WordArray.create(words, utf16StrLength * 2);\n },\n};\n","import {\n WordArray,\n Hasher,\n} from './core.js';\n\n// Reusable object\nconst W = [];\n\n/**\n * SHA-1 hash algorithm.\n */\nexport class SHA1Algo extends Hasher {\n _doReset() {\n this._hash = new WordArray([\n 0x67452301,\n 0xefcdab89,\n 0x98badcfe,\n 0x10325476,\n 0xc3d2e1f0,\n ]);\n }\n\n _doProcessBlock(M, offset) {\n // Shortcut\n const H = this._hash.words;\n\n // Working variables\n let a = H[0];\n let b = H[1];\n let c = H[2];\n let d = H[3];\n let e = H[4];\n\n // Computation\n for (let i = 0; i < 80; i += 1) {\n if (i < 16) {\n W[i] = M[offset + i] | 0;\n } else {\n const n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];\n W[i] = (n << 1) | (n >>> 31);\n }\n\n let t = ((a << 5) | (a >>> 27)) + e + W[i];\n if (i < 20) {\n t += ((b & c) | (~b & d)) + 0x5a827999;\n } else if (i < 40) {\n t += (b ^ c ^ d) + 0x6ed9eba1;\n } else if (i < 60) {\n t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;\n } else /* if (i < 80) */ {\n t += (b ^ c ^ d) - 0x359d3e2a;\n }\n\n e = d;\n d = c;\n c = (b << 30) | (b >>> 2);\n b = a;\n a = t;\n }\n\n // Intermediate hash value\n H[0] = (H[0] + a) | 0;\n H[1] = (H[1] + b) | 0;\n H[2] = (H[2] + c) | 0;\n H[3] = (H[3] + d) | 0;\n H[4] = (H[4] + e) | 0;\n }\n\n _doFinalize() {\n // Shortcuts\n const data = this._data;\n const dataWords = data.words;\n\n const nBitsTotal = this._nDataBytes * 8;\n const nBitsLeft = data.sigBytes * 8;\n\n // Add padding\n dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - (nBitsLeft % 32));\n dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);\n dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;\n data.sigBytes = dataWords.length * 4;\n\n // Hash final blocks\n this._process();\n\n // Return final computed hash\n return this._hash;\n }\n\n clone() {\n const clone = super.clone.call(this);\n clone._hash = this._hash.clone();\n\n return clone;\n }\n}\n\n/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA1('message');\n * var hash = CryptoJS.SHA1(wordArray);\n */\nexport const SHA1 = Hasher._createHelper(SHA1Algo);\n\n/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA1(message, key);\n */\nexport const HmacSHA1 = Hasher._createHmacHelper(SHA1Algo);\n","import { Hasher } from './core.js';\nimport {\n X64Word,\n X64WordArray,\n} from './x64-core.js';\n\n// Constants\nconst K = [\n new X64Word(0x428a2f98, 0xd728ae22),\n new X64Word(0x71374491, 0x23ef65cd),\n new X64Word(0xb5c0fbcf, 0xec4d3b2f),\n new X64Word(0xe9b5dba5, 0x8189dbbc),\n new X64Word(0x3956c25b, 0xf348b538),\n new X64Word(0x59f111f1, 0xb605d019),\n new X64Word(0x923f82a4, 0xaf194f9b),\n new X64Word(0xab1c5ed5, 0xda6d8118),\n new X64Word(0xd807aa98, 0xa3030242),\n new X64Word(0x12835b01, 0x45706fbe),\n new X64Word(0x243185be, 0x4ee4b28c),\n new X64Word(0x550c7dc3, 0xd5ffb4e2),\n new X64Word(0x72be5d74, 0xf27b896f),\n new X64Word(0x80deb1fe, 0x3b1696b1),\n new X64Word(0x9bdc06a7, 0x25c71235),\n new X64Word(0xc19bf174, 0xcf692694),\n new X64Word(0xe49b69c1, 0x9ef14ad2),\n new X64Word(0xefbe4786, 0x384f25e3),\n new X64Word(0x0fc19dc6, 0x8b8cd5b5),\n new X64Word(0x240ca1cc, 0x77ac9c65),\n new X64Word(0x2de92c6f, 0x592b0275),\n new X64Word(0x4a7484aa, 0x6ea6e483),\n new X64Word(0x5cb0a9dc, 0xbd41fbd4),\n new X64Word(0x76f988da, 0x831153b5),\n new X64Word(0x983e5152, 0xee66dfab),\n new X64Word(0xa831c66d, 0x2db43210),\n new X64Word(0xb00327c8, 0x98fb213f),\n new X64Word(0xbf597fc7, 0xbeef0ee4),\n new X64Word(0xc6e00bf3, 0x3da88fc2),\n new X64Word(0xd5a79147, 0x930aa725),\n new X64Word(0x06ca6351, 0xe003826f),\n new X64Word(0x14292967, 0x0a0e6e70),\n new X64Word(0x27b70a85, 0x46d22ffc),\n new X64Word(0x2e1b2138, 0x5c26c926),\n new X64Word(0x4d2c6dfc, 0x5ac42aed),\n new X64Word(0x53380d13, 0x9d95b3df),\n new X64Word(0x650a7354, 0x8baf63de),\n new X64Word(0x766a0abb, 0x3c77b2a8),\n new X64Word(0x81c2c92e, 0x47edaee6),\n new X64Word(0x92722c85, 0x1482353b),\n new X64Word(0xa2bfe8a1, 0x4cf10364),\n new X64Word(0xa81a664b, 0xbc423001),\n new X64Word(0xc24b8b70, 0xd0f89791),\n new X64Word(0xc76c51a3, 0x0654be30),\n new X64Word(0xd192e819, 0xd6ef5218),\n new X64Word(0xd6990624, 0x5565a910),\n new X64Word(0xf40e3585, 0x5771202a),\n new X64Word(0x106aa070, 0x32bbd1b8),\n new X64Word(0x19a4c116, 0xb8d2d0c8),\n new X64Word(0x1e376c08, 0x5141ab53),\n new X64Word(0x2748774c, 0xdf8eeb99),\n new X64Word(0x34b0bcb5, 0xe19b48a8),\n new X64Word(0x391c0cb3, 0xc5c95a63),\n new X64Word(0x4ed8aa4a, 0xe3418acb),\n new X64Word(0x5b9cca4f, 0x7763e373),\n new X64Word(0x682e6ff3, 0xd6b2b8a3),\n new X64Word(0x748f82ee, 0x5defb2fc),\n new X64Word(0x78a5636f, 0x43172f60),\n new X64Word(0x84c87814, 0xa1f0ab72),\n new X64Word(0x8cc70208, 0x1a6439ec),\n new X64Word(0x90befffa, 0x23631e28),\n new X64Word(0xa4506ceb, 0xde82bde9),\n new X64Word(0xbef9a3f7, 0xb2c67915),\n new X64Word(0xc67178f2, 0xe372532b),\n new X64Word(0xca273ece, 0xea26619c),\n new X64Word(0xd186b8c7, 0x21c0c207),\n new X64Word(0xeada7dd6, 0xcde0eb1e),\n new X64Word(0xf57d4f7f, 0xee6ed178),\n new X64Word(0x06f067aa, 0x72176fba),\n new X64Word(0x0a637dc5, 0xa2c898a6),\n new X64Word(0x113f9804, 0xbef90dae),\n new X64Word(0x1b710b35, 0x131c471b),\n new X64Word(0x28db77f5, 0x23047d84),\n new X64Word(0x32caab7b, 0x40c72493),\n new X64Word(0x3c9ebe0a, 0x15c9bebc),\n new X64Word(0x431d67c4, 0x9c100d4c),\n new X64Word(0x4cc5d4be, 0xcb3e42b6),\n new X64Word(0x597f299c, 0xfc657e2a),\n new X64Word(0x5fcb6fab, 0x3ad6faec),\n new X64Word(0x6c44198c, 0x4a475817),\n];\n\n// Reusable objects\nconst W = [];\nfor (let i = 0; i < 80; i += 1) {\n W[i] = new X64Word();\n}\n\n/**\n * SHA-512 hash algorithm.\n */\nexport class SHA512Algo extends Hasher {\n constructor() {\n super();\n\n this.blockSize = 1024 / 32;\n }\n\n _doReset() {\n this._hash = new X64WordArray([\n new X64Word(0x6a09e667, 0xf3bcc908),\n new X64Word(0xbb67ae85, 0x84caa73b),\n new X64Word(0x3c6ef372, 0xfe94f82b),\n new X64Word(0xa54ff53a, 0x5f1d36f1),\n new X64Word(0x510e527f, 0xade682d1),\n new X64Word(0x9b05688c, 0x2b3e6c1f),\n new X64Word(0x1f83d9ab, 0xfb41bd6b),\n new X64Word(0x5be0cd19, 0x137e2179),\n ]);\n }\n\n _doProcessBlock(M, offset) {\n // Shortcuts\n const H = this._hash.words;\n\n const H0 = H[0];\n const H1 = H[1];\n const H2 = H[2];\n const H3 = H[3];\n const H4 = H[4];\n const H5 = H[5];\n const H6 = H[6];\n const H7 = H[7];\n\n const H0h = H0.high;\n let H0l = H0.low;\n const H1h = H1.high;\n let H1l = H1.low;\n const H2h = H2.high;\n let H2l = H2.low;\n const H3h = H3.high;\n let H3l = H3.low;\n const H4h = H4.high;\n let H4l = H4.low;\n const H5h = H5.high;\n let H5l = H5.low;\n const H6h = H6.high;\n let H6l = H6.low;\n const H7h = H7.high;\n let H7l = H7.low;\n\n // Working variables\n let ah = H0h;\n let al = H0l;\n let bh = H1h;\n let bl = H1l;\n let ch = H2h;\n let cl = H2l;\n let dh = H3h;\n let dl = H3l;\n let eh = H4h;\n let el = H4l;\n let fh = H5h;\n let fl = H5l;\n let gh = H6h;\n let gl = H6l;\n let hh = H7h;\n let hl = H7l;\n\n // Rounds\n for (let i = 0; i < 80; i += 1) {\n let Wil;\n let Wih;\n\n // Shortcut\n const Wi = W[i];\n\n // Extend message\n if (i < 16) {\n Wi.high = M[offset + i * 2] | 0;\n Wih = Wi.high;\n Wi.low = M[offset + i * 2 + 1] | 0;\n Wil = Wi.low;\n } else {\n // Gamma0\n const gamma0x = W[i - 15];\n const gamma0xh = gamma0x.high;\n const gamma0xl = gamma0x.low;\n const gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31))\n ^ ((gamma0xh >>> 8) | (gamma0xl << 24))\n ^ (gamma0xh >>> 7);\n const gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31))\n ^ ((gamma0xl >>> 8) | (gamma0xh << 24))\n ^ ((gamma0xl >>> 7) | (gamma0xh << 25));\n\n // Gamma1\n const gamma1x = W[i - 2];\n const gamma1xh = gamma1x.high;\n const gamma1xl = gamma1x.low;\n const gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13))\n ^ ((gamma1xh << 3) | (gamma1xl >>> 29))\n ^ (gamma1xh >>> 6);\n const gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13))\n ^ ((gamma1xl << 3) | (gamma1xh >>> 29))\n ^ ((gamma1xl >>> 6) | (gamma1xh << 26));\n\n // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]\n const Wi7 = W[i - 7];\n const Wi7h = Wi7.high;\n const Wi7l = Wi7.low;\n\n const Wi16 = W[i - 16];\n const Wi16h = Wi16.high;\n const Wi16l = Wi16.low;\n\n Wil = gamma0l + Wi7l;\n Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);\n Wil += gamma1l;\n Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);\n Wil += Wi16l;\n Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);\n\n Wi.high = Wih;\n Wi.low = Wil;\n }\n\n const chh = (eh & fh) ^ (~eh & gh);\n const chl = (el & fl) ^ (~el & gl);\n const majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);\n const majl = (al & bl) ^ (al & cl) ^ (bl & cl);\n\n const sigma0h = ((ah >>> 28) | (al << 4))\n ^ ((ah << 30) | (al >>> 2))\n ^ ((ah << 25) | (al >>> 7));\n const sigma0l = ((al >>> 28) | (ah << 4))\n ^ ((al << 30) | (ah >>> 2))\n ^ ((al << 25) | (ah >>> 7));\n const sigma1h = ((eh >>> 14) | (el << 18))\n ^ ((eh >>> 18) | (el << 14))\n ^ ((eh << 23) | (el >>> 9));\n const sigma1l = ((el >>> 14) | (eh << 18))\n ^ ((el >>> 18) | (eh << 14))\n ^ ((el << 23) | (eh >>> 9));\n\n // t1 = h + sigma1 + ch + K[i] + W[i]\n const Ki = K[i];\n const Kih = Ki.high;\n const Kil = Ki.low;\n\n let t1l = hl + sigma1l;\n let t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);\n t1l += chl;\n t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);\n t1l += Kil;\n t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);\n t1l += Wil;\n t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);\n\n // t2 = sigma0 + maj\n const t2l = sigma0l + majl;\n const t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);\n\n // Update working variables\n hh = gh;\n hl = gl;\n gh = fh;\n gl = fl;\n fh = eh;\n fl = el;\n el = (dl + t1l) | 0;\n eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;\n dh = ch;\n dl = cl;\n ch = bh;\n cl = bl;\n bh = ah;\n bl = al;\n al = (t1l + t2l) | 0;\n ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;\n }\n\n // Intermediate hash value\n H0.low = (H0l + al);\n H0l = H0.low;\n H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));\n H1.low = (H1l + bl);\n H1l = H1.low;\n H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));\n H2.low = (H2l + cl);\n H2l = H2.low;\n H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));\n H3.low = (H3l + dl);\n H3l = H3.low;\n H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));\n H4.low = (H4l + el);\n H4l = H4.low;\n H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));\n H5.low = (H5l + fl);\n H5l = H5.low;\n H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));\n H6.low = (H6l + gl);\n H6l = H6.low;\n H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));\n H7.low = (H7l + hl);\n H7l = H7.low;\n H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));\n }\n\n _doFinalize() {\n // Shortcuts\n const data = this._data;\n const dataWords = data.words;\n\n const nBitsTotal = this._nDataBytes * 8;\n const nBitsLeft = data.sigBytes * 8;\n\n // Add padding\n dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - (nBitsLeft % 32));\n dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);\n dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;\n data.sigBytes = dataWords.length * 4;\n\n // Hash final blocks\n this._process();\n\n // Convert hash to 32-bit word array before returning\n const hash = this._hash.toX32();\n\n // Return final computed hash\n return hash;\n }\n\n clone() {\n const clone = super.clone.call(this);\n clone._hash = this._hash.clone();\n\n return clone;\n }\n}\n\n/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA512('message');\n * var hash = CryptoJS.SHA512(wordArray);\n */\nexport const SHA512 = Hasher._createHelper(SHA512Algo);\n\n/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA512(message, key);\n */\nexport const HmacSHA512 = Hasher._createHmacHelper(SHA512Algo);\n","import { WordArray } from './core.js';\nimport { SHA256Algo } from './sha256.js';\n\n/**\n * SHA-224 hash algorithm.\n */\nexport class SHA224Algo extends SHA256Algo {\n _doReset() {\n this._hash = new WordArray([\n 0xc1059ed8,\n 0x367cd507,\n 0x3070dd17,\n 0xf70e5939,\n 0xffc00b31,\n 0x68581511,\n 0x64f98fa7,\n 0xbefa4fa4,\n ]);\n }\n\n _doFinalize() {\n const hash = super._doFinalize.call(this);\n\n hash.sigBytes -= 4;\n\n return hash;\n }\n}\n\n/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA224('message');\n * var hash = CryptoJS.SHA224(wordArray);\n */\nexport const SHA224 = SHA256Algo._createHelper(SHA224Algo);\n\n/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA224(message, key);\n */\nexport const HmacSHA224 = SHA256Algo._createHmacHelper(SHA224Algo);\n","import {\n WordArray,\n Hasher,\n} from './core.js';\nimport { X64Word } from './x64-core.js';\n\n// Constants tables\nconst RHO_OFFSETS = [];\nconst PI_INDEXES = [];\nconst ROUND_CONSTANTS = [];\n\n// Compute Constants\n// Compute rho offset constants\nlet _x = 1;\nlet _y = 0;\nfor (let t = 0; t < 24; t += 1) {\n RHO_OFFSETS[_x + 5 * _y] = ((t + 1) * (t + 2) / 2) % 64;\n\n const newX = _y % 5;\n const newY = (2 * _x + 3 * _y) % 5;\n _x = newX;\n _y = newY;\n}\n\n// Compute pi index constants\nfor (let x = 0; x < 5; x += 1) {\n for (let y = 0; y < 5; y += 1) {\n PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;\n }\n}\n\n// Compute round constants\nlet LFSR = 0x01;\nfor (let i = 0; i < 24; i += 1) {\n let roundConstantMsw = 0;\n let roundConstantLsw = 0;\n\n for (let j = 0; j < 7; j += 1) {\n if (LFSR & 0x01) {\n const bitPosition = (1 << j) - 1;\n if (bitPosition < 32) {\n roundConstantLsw ^= 1 << bitPosition;\n } else /* if (bitPosition >= 32) */ {\n roundConstantMsw ^= 1 << (bitPosition - 32);\n }\n }\n\n // Compute next LFSR\n if (LFSR & 0x80) {\n // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1\n LFSR = (LFSR << 1) ^ 0x71;\n } else {\n LFSR <<= 1;\n }\n }\n\n ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);\n}\n\n// Reusable objects for temporary values\nconst T = [];\nfor (let i = 0; i < 25; i += 1) {\n T[i] = X64Word.create();\n}\n\n/**\n * SHA-3 hash algorithm.\n */\nexport class SHA3Algo extends Hasher {\n constructor(cfg) {\n /**\n * Configuration options.\n *\n * @property {number} outputLength\n * The desired number of bits in the output hash.\n * Only values permitted are: 224, 256, 384, 512.\n * Default: 512\n */\n super(Object.assign(\n { outputLength: 512 },\n cfg,\n ));\n }\n\n _doReset() {\n this._state = [];\n const state = this._state;\n for (let i = 0; i < 25; i += 1) {\n state[i] = new X64Word();\n }\n\n this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;\n }\n\n _doProcessBlock(M, offset) {\n // Shortcuts\n const state = this._state;\n const nBlockSizeLanes = this.blockSize / 2;\n\n // Absorb\n for (let i = 0; i < nBlockSizeLanes; i += 1) {\n // Shortcuts\n let M2i = M[offset + 2 * i];\n let M2i1 = M[offset + 2 * i + 1];\n\n // Swap endian\n M2i = (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff)\n | (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00);\n M2i1 = (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff)\n | (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00);\n\n // Absorb message into state\n const lane = state[i];\n lane.high ^= M2i1;\n lane.low ^= M2i;\n }\n\n // Rounds\n for (let round = 0; round < 24; round += 1) {\n // Theta\n for (let x = 0; x < 5; x += 1) {\n // Mix column lanes\n let tMsw = 0;\n let tLsw = 0;\n for (let y = 0; y < 5; y += 1) {\n const lane = state[x + 5 * y];\n tMsw ^= lane.high;\n tLsw ^= lane.low;\n }\n\n // Temporary values\n const Tx = T[x];\n Tx.high = tMsw;\n Tx.low = tLsw;\n }\n for (let x = 0; x < 5; x += 1) {\n // Shortcuts\n const Tx4 = T[(x + 4) % 5];\n const Tx1 = T[(x + 1) % 5];\n const Tx1Msw = Tx1.high;\n const Tx1Lsw = Tx1.low;\n\n // Mix surrounding columns\n const tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));\n const tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));\n for (let y = 0; y < 5; y += 1) {\n const lane = state[x + 5 * y];\n lane.high ^= tMsw;\n lane.low ^= tLsw;\n }\n }\n\n // Rho Pi\n for (let laneIndex = 1; laneIndex < 25; laneIndex += 1) {\n let tMsw;\n let tLsw;\n\n // Shortcuts\n const lane = state[laneIndex];\n const laneMsw = lane.high;\n const laneLsw = lane.low;\n const rhoOffset = RHO_OFFSETS[laneIndex];\n\n // Rotate lanes\n if (rhoOffset < 32) {\n tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));\n tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));\n } else /* if (rhoOffset >= 32) */ {\n tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));\n tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));\n }\n\n // Transpose lanes\n const TPiLane = T[PI_INDEXES[laneIndex]];\n TPiLane.high = tMsw;\n TPiLane.low = tLsw;\n }\n\n // Rho pi at x = y = 0\n const T0 = T[0];\n const state0 = state[0];\n T0.high = state0.high;\n T0.low = state0.low;\n\n // Chi\n for (let x = 0; x < 5; x += 1) {\n for (let y = 0; y < 5; y += 1) {\n // Shortcuts\n const laneIndex = x + 5 * y;\n const lane = state[laneIndex];\n const TLane = T[laneIndex];\n const Tx1Lane = T[((x + 1) % 5) + 5 * y];\n const Tx2Lane = T[((x + 2) % 5) + 5 * y];\n\n // Mix rows\n lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);\n lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);\n }\n }\n\n // Iota\n const lane = state[0];\n const roundConstant = ROUND_CONSTANTS[round];\n lane.high ^= roundConstant.high;\n lane.low ^= roundConstant.low;\n }\n }\n\n _doFinalize() {\n // Shortcuts\n const data = this._data;\n const dataWords = data.words;\n const nBitsLeft = data.sigBytes * 8;\n const blockSizeBits = this.blockSize * 32;\n\n // Add padding\n dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - (nBitsLeft % 32));\n dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;\n data.sigBytes = dataWords.length * 4;\n\n // Hash final blocks\n this._process();\n\n // Shortcuts\n const state = this._state;\n const outputLengthBytes = this.cfg.outputLength / 8;\n const outputLengthLanes = outputLengthBytes / 8;\n\n // Squeeze\n const hashWords = [];\n for (let i = 0; i < outputLengthLanes; i += 1) {\n // Shortcuts\n const lane = state[i];\n let laneMsw = lane.high;\n let laneLsw = lane.low;\n\n // Swap endian\n laneMsw = (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff)\n | (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00);\n laneLsw = (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff)\n | (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00);\n\n // Squeeze state to retrieve hash\n hashWords.push(laneLsw);\n hashWords.push(laneMsw);\n }\n\n // Return final computed hash\n return new WordArray(hashWords, outputLengthBytes);\n }\n\n clone() {\n const clone = super.clone.call(this);\n\n clone._state = this._state.slice(0);\n const state = clone._state;\n for (let i = 0; i < 25; i += 1) {\n state[i] = state[i].clone();\n }\n\n return clone;\n }\n}\n\n/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA3('message');\n * var hash = CryptoJS.SHA3(wordArray);\n */\nexport const SHA3 = Hasher._createHelper(SHA3Algo);\n\n/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA3(message, key);\n */\nexport const HmacSHA3 = Hasher._createHmacHelper(SHA3Algo);\n","import {\n X64Word,\n X64WordArray,\n} from './x64-core.js';\nimport { SHA512Algo } from './sha512.js';\n\n/**\n * SHA-384 hash algorithm.\n */\nexport class SHA384Algo extends SHA512Algo {\n _doReset() {\n this._hash = new X64WordArray([\n new X64Word(0xcbbb9d5d, 0xc1059ed8),\n new X64Word(0x629a292a, 0x367cd507),\n new X64Word(0x9159015a, 0x3070dd17),\n new X64Word(0x152fecd8, 0xf70e5939),\n new X64Word(0x67332667, 0xffc00b31),\n new X64Word(0x8eb44a87, 0x68581511),\n new X64Word(0xdb0c2e0d, 0x64f98fa7),\n new X64Word(0x47b5481d, 0xbefa4fa4),\n ]);\n }\n\n _doFinalize() {\n const hash = super._doFinalize.call(this);\n\n hash.sigBytes -= 16;\n\n return hash;\n }\n}\n\n/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.SHA384('message');\n * var hash = CryptoJS.SHA384(wordArray);\n */\nexport const SHA384 = SHA512Algo._createHelper(SHA384Algo);\n\n/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacSHA384(message, key);\n */\nexport const HmacSHA384 = SHA512Algo._createHmacHelper(SHA384Algo);\n","import {\n BlockCipher,\n} from './cipher-core.js';\n\n// Lookup tables\nconst _SBOX = [];\nconst INV_SBOX = [];\nconst _SUB_MIX_0 = [];\nconst _SUB_MIX_1 = [];\nconst _SUB_MIX_2 = [];\nconst _SUB_MIX_3 = [];\nconst INV_SUB_MIX_0 = [];\nconst INV_SUB_MIX_1 = [];\nconst INV_SUB_MIX_2 = [];\nconst INV_SUB_MIX_3 = [];\n\n// Compute lookup tables\n\n// Compute double table\nconst d = [];\nfor (let i = 0; i < 256; i += 1) {\n if (i < 128) {\n d[i] = i << 1;\n } else {\n d[i] = (i << 1) ^ 0x11b;\n }\n}\n\n// Walk GF(2^8)\nlet x = 0;\nlet xi = 0;\nfor (let i = 0; i < 256; i += 1) {\n // Compute sbox\n let sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);\n sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;\n _SBOX[x] = sx;\n INV_SBOX[sx] = x;\n\n // Compute multiplication\n const x2 = d[x];\n const x4 = d[x2];\n const x8 = d[x4];\n\n // Compute sub bytes, mix columns tables\n let t = (d[sx] * 0x101) ^ (sx * 0x1010100);\n _SUB_MIX_0[x] = (t << 24) | (t >>> 8);\n _SUB_MIX_1[x] = (t << 16) | (t >>> 16);\n _SUB_MIX_2[x] = (t << 8) | (t >>> 24);\n _SUB_MIX_3[x] = t;\n\n // Compute inv sub bytes, inv mix columns tables\n t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);\n INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);\n INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);\n INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);\n INV_SUB_MIX_3[sx] = t;\n\n // Compute next counter\n if (!x) {\n xi = 1;\n x = xi;\n } else {\n x = x2 ^ d[d[d[x8 ^ x2]]];\n xi ^= d[d[xi]];\n }\n}\n\n// Precomputed Rcon lookup\nconst RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];\n\n/**\n * AES block cipher algorithm.\n */\nexport class AESAlgo extends BlockCipher {\n _doReset() {\n let t;\n\n // Skip reset of nRounds has been set before and key did not change\n if (this._nRounds && this._keyPriorReset === this._key) {\n return;\n }\n\n // Shortcuts\n this._keyPriorReset = this._key;\n const key = this._keyPriorReset;\n const keyWords = key.words;\n const keySize = key.sigBytes / 4;\n\n // Compute number of rounds\n this._nRounds = keySize + 6;\n const nRounds = this._nRounds;\n\n // Compute number of key schedule rows\n const ksRows = (nRounds + 1) * 4;\n\n // Compute key schedule\n this._keySchedule = [];\n const keySchedule = this._keySchedule;\n for (let ksRow = 0; ksRow < ksRows; ksRow += 1) {\n if (ksRow < keySize) {\n keySchedule[ksRow] = keyWords[ksRow];\n } else {\n t = keySchedule[ksRow - 1];\n\n if (!(ksRow % keySize)) {\n // Rot word\n t = (t << 8) | (t >>> 24);\n\n // Sub word\n t = (_SBOX[t >>> 24] << 24)\n | (_SBOX[(t >>> 16) & 0xff] << 16)\n | (_SBOX[(t >>> 8) & 0xff] << 8)\n | _SBOX[t & 0xff];\n\n // Mix Rcon\n t ^= RCON[(ksRow / keySize) | 0] << 24;\n } else if (keySize > 6 && ksRow % keySize === 4) {\n // Sub word\n t = (_SBOX[t >>> 24] << 24)\n | (_SBOX[(t >>> 16) & 0xff] << 16)\n | (_SBOX[(t >>> 8) & 0xff] << 8)\n | _SBOX[t & 0xff];\n }\n\n keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;\n }\n }\n\n // Compute inv key schedule\n this._invKeySchedule = [];\n const invKeySchedule = this._invKeySchedule;\n for (let invKsRow = 0; invKsRow < ksRows; invKsRow += 1) {\n const ksRow = ksRows - invKsRow;\n\n if (invKsRow % 4) {\n t = keySchedule[ksRow];\n } else {\n t = keySchedule[ksRow - 4];\n }\n\n if (invKsRow < 4 || ksRow <= 4) {\n invKeySchedule[invKsRow] = t;\n } else {\n invKeySchedule[invKsRow] = INV_SUB_MIX_0[_SBOX[t >>> 24]]\n ^ INV_SUB_MIX_1[_SBOX[(t >>> 16) & 0xff]]\n ^ INV_SUB_MIX_2[_SBOX[(t >>> 8) & 0xff]]\n ^ INV_SUB_MIX_3[_SBOX[t & 0xff]];\n }\n }\n }\n\n encryptBlock(M, offset) {\n this._doCryptBlock(\n M, offset, this._keySchedule, _SUB_MIX_0, _SUB_MIX_1, _SUB_MIX_2, _SUB_MIX_3, _SBOX,\n );\n }\n\n decryptBlock(M, offset) {\n const _M = M;\n\n // Swap 2nd and 4th rows\n let t = _M[offset + 1];\n _M[offset + 1] = _M[offset + 3];\n _M[offset + 3] = t;\n\n this._doCryptBlock(\n _M,\n offset,\n this._invKeySchedule,\n INV_SUB_MIX_0,\n INV_SUB_MIX_1,\n INV_SUB_MIX_2,\n INV_SUB_MIX_3,\n INV_SBOX,\n );\n\n // Inv swap 2nd and 4th rows\n t = _M[offset + 1];\n _M[offset + 1] = _M[offset + 3];\n _M[offset + 3] = t;\n }\n\n _doCryptBlock(M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {\n const _M = M;\n\n // Shortcut\n const nRounds = this._nRounds;\n\n // Get input, add round key\n let s0 = _M[offset] ^ keySchedule[0];\n let s1 = _M[offset + 1] ^ keySchedule[1];\n let s2 = _M[offset + 2] ^ keySchedule[2];\n let s3 = _M[offset + 3] ^ keySchedule[3];\n\n // Key schedule row counter\n let ksRow = 4;\n\n // Rounds\n for (let round = 1; round < nRounds; round += 1) {\n // Shift rows, sub bytes, mix columns, add round key\n const t0 = SUB_MIX_0[s0 >>> 24]\n ^ SUB_MIX_1[(s1 >>> 16) & 0xff]\n ^ SUB_MIX_2[(s2 >>> 8) & 0xff]\n ^ SUB_MIX_3[s3 & 0xff]\n ^ keySchedule[ksRow];\n ksRow += 1;\n const t1 = SUB_MIX_0[s1 >>> 24]\n ^ SUB_MIX_1[(s2 >>> 16) & 0xff]\n ^ SUB_MIX_2[(s3 >>> 8) & 0xff]\n ^ SUB_MIX_3[s0 & 0xff]\n ^ keySchedule[ksRow];\n ksRow += 1;\n const t2 = SUB_MIX_0[s2 >>> 24]\n ^ SUB_MIX_1[(s3 >>> 16) & 0xff]\n ^ SUB_MIX_2[(s0 >>> 8) & 0xff]\n ^ SUB_MIX_3[s1 & 0xff]\n ^ keySchedule[ksRow];\n ksRow += 1;\n const t3 = SUB_MIX_0[s3 >>> 24]\n ^ SUB_MIX_1[(s0 >>> 16) & 0xff]\n ^ SUB_MIX_2[(s1 >>> 8) & 0xff]\n ^ SUB_MIX_3[s2 & 0xff]\n ^ keySchedule[ksRow];\n ksRow += 1;\n\n // Update state\n s0 = t0;\n s1 = t1;\n s2 = t2;\n s3 = t3;\n }\n\n // Shift rows, sub bytes, add round key\n const t0 = (\n (SBOX[s0 >>> 24] << 24)\n | (SBOX[(s1 >>> 16) & 0xff] << 16)\n | (SBOX[(s2 >>> 8) & 0xff] << 8)\n | SBOX[s3 & 0xff]\n ) ^ keySchedule[ksRow];\n ksRow += 1;\n const t1 = (\n (SBOX[s1 >>> 24] << 24)\n | (SBOX[(s2 >>> 16) & 0xff] << 16)\n | (SBOX[(s3 >>> 8) & 0xff] << 8)\n | SBOX[s0 & 0xff]\n ) ^ keySchedule[ksRow];\n ksRow += 1;\n const t2 = (\n (SBOX[s2 >>> 24] << 24)\n | (SBOX[(s3 >>> 16) & 0xff] << 16)\n | (SBOX[(s0 >>> 8) & 0xff] << 8)\n | SBOX[s1 & 0xff]\n ) ^ keySchedule[ksRow];\n ksRow += 1;\n const t3 = (\n (SBOX[s3 >>> 24] << 24)\n | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]\n ) ^ keySchedule[ksRow];\n ksRow += 1;\n\n // Set output\n _M[offset] = t0;\n _M[offset + 1] = t1;\n _M[offset + 2] = t2;\n _M[offset + 3] = t3;\n }\n}\nAESAlgo.keySize = 256 / 32;\n\n/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);\n */\nexport const AES = BlockCipher._createHelper(AESAlgo);\n","/** @preserve\n(c) 2012 by Cédric Mesnil. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted\nprovided that the following conditions are met:\n\n - Redistributions of source code must retain the above copyright notice, this list of\n conditions and the following disclaimer.\n - Redistributions in binary form must reproduce the above copyright notice, this list\n of conditions and the following disclaimer in the documentation and/or other materials\n provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\nOR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY\nWAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\nimport {\n WordArray,\n Hasher,\n} from './core.js';\n\n// Constants table\nconst _zl = WordArray.create([\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,\n 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,\n 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,\n 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);\nconst _zr = WordArray.create([\n 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,\n 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,\n 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,\n 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,\n 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);\nconst _sl = WordArray.create([\n 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,\n 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,\n 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,\n 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,\n 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]);\nconst _sr = WordArray.create([\n 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,\n 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,\n 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,\n 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,\n 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]);\n\nconst _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);\nconst _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);\n\nconst f1 = (x, y, z) => (x) ^ (y) ^ (z);\n\nconst f2 = (x, y, z) => ((x) & (y)) | ((~x) & (z));\n\nconst f3 = (x, y, z) => ((x) | (~(y))) ^ (z);\n\nconst f4 = (x, y, z) => ((x) & (z)) | ((y) & (~(z)));\n\nconst f5 = (x, y, z) => (x) ^ ((y) | (~(z)));\n\nconst rotl = (x, n) => (x << n) | (x >>> (32 - n));\n\n/**\n * RIPEMD160 hash algorithm.\n */\nexport class RIPEMD160Algo extends Hasher {\n _doReset() {\n this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);\n }\n\n _doProcessBlock(M, offset) {\n const _M = M;\n\n // Swap endian\n for (let i = 0; i < 16; i += 1) {\n // Shortcuts\n const offset_i = offset + i;\n const M_offset_i = _M[offset_i];\n\n // Swap\n _M[offset_i] = (\n (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff)\n | (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)\n );\n }\n // Shortcut\n const H = this._hash.words;\n const hl = _hl.words;\n const hr = _hr.words;\n const zl = _zl.words;\n const zr = _zr.words;\n const sl = _sl.words;\n const sr = _sr.words;\n\n // Working variables\n let al = H[0];\n let bl = H[1];\n let cl = H[2];\n let dl = H[3];\n let el = H[4];\n let ar = H[0];\n let br = H[1];\n let cr = H[2];\n let dr = H[3];\n let er = H[4];\n\n // Computation\n let t;\n for (let i = 0; i < 80; i += 1) {\n t = (al + _M[offset + zl[i]]) | 0;\n if (i < 16) {\n t += f1(bl, cl, dl) + hl[0];\n } else if (i < 32) {\n t += f2(bl, cl, dl) + hl[1];\n } else if (i < 48) {\n t += f3(bl, cl, dl) + hl[2];\n } else if (i < 64) {\n t += f4(bl, cl, dl) + hl[3];\n } else { // if (i<80) {\n t += f5(bl, cl, dl) + hl[4];\n }\n t |= 0;\n t = rotl(t, sl[i]);\n t = (t + el) | 0;\n al = el;\n el = dl;\n dl = rotl(cl, 10);\n cl = bl;\n bl = t;\n\n t = (ar + _M[offset + zr[i]]) | 0;\n if (i < 16) {\n t += f5(br, cr, dr) + hr[0];\n } else if (i < 32) {\n t += f4(br, cr, dr) + hr[1];\n } else if (i < 48) {\n t += f3(br, cr, dr) + hr[2];\n } else if (i < 64) {\n t += f2(br, cr, dr) + hr[3];\n } else { // if (i<80) {\n t += f1(br, cr, dr) + hr[4];\n }\n t |= 0;\n t = rotl(t, sr[i]);\n t = (t + er) | 0;\n ar = er;\n er = dr;\n dr = rotl(cr, 10);\n cr = br;\n br = t;\n }\n // Intermediate hash value\n t = (H[1] + cl + dr) | 0;\n H[1] = (H[2] + dl + er) | 0;\n H[2] = (H[3] + el + ar) | 0;\n H[3] = (H[4] + al + br) | 0;\n H[4] = (H[0] + bl + cr) | 0;\n H[0] = t;\n }\n\n _doFinalize() {\n // Shortcuts\n const data = this._data;\n const dataWords = data.words;\n\n const nBitsTotal = this._nDataBytes * 8;\n const nBitsLeft = data.sigBytes * 8;\n\n // Add padding\n dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - (nBitsLeft % 32));\n dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (\n (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff)\n | (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)\n );\n data.sigBytes = (dataWords.length + 1) * 4;\n\n // Hash final blocks\n this._process();\n\n // Shortcuts\n const hash = this._hash;\n const H = hash.words;\n\n // Swap endian\n for (let i = 0; i < 5; i += 1) {\n // Shortcut\n const H_i = H[i];\n\n // Swap\n H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff)\n | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);\n }\n\n // Return final computed hash\n return hash;\n }\n\n clone() {\n const clone = super.clone.call(this);\n clone._hash = this._hash.clone();\n\n return clone;\n }\n}\n\n/**\n * Shortcut function to the hasher's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n *\n * @return {WordArray} The hash.\n *\n * @static\n *\n * @example\n *\n * var hash = CryptoJS.RIPEMD160('message');\n * var hash = CryptoJS.RIPEMD160(wordArray);\n */\nexport const RIPEMD160 = Hasher._createHelper(RIPEMD160Algo);\n\n/**\n * Shortcut function to the HMAC's object interface.\n *\n * @param {WordArray|string} message The message to hash.\n * @param {WordArray|string} key The secret key.\n *\n * @return {WordArray} The HMAC.\n *\n * @static\n *\n * @example\n *\n * var hmac = CryptoJS.HmacRIPEMD160(message, key);\n */\nexport const HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160Algo);\n","import {\n Base,\n WordArray,\n} from './core.js';\nimport { SHA1Algo } from './sha1.js';\nimport { HMAC } from './hmac.js';\n\n/**\n * Password-Based Key Derivation Function 2 algorithm.\n */\nexport class PBKDF2Algo extends Base {\n /**\n * Initializes a newly created key derivation function.\n *\n * @param {Object} cfg (Optional) The configuration options to use for the derivation.\n *\n * @example\n *\n * const kdf = CryptoJS.algo.PBKDF2.create();\n * const kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });\n * const kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });\n */\n constructor(cfg) {\n super();\n\n /**\n * Configuration options.\n *\n * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)\n * @property {Hasher} hasher The hasher to use. Default: SHA1\n * @property {number} iterations The number of iterations to perform. Default: 1\n */\n this.cfg = Object.assign(\n new Base(),\n {\n keySize: 128 / 32,\n hasher: SHA1Algo,\n iterations: 1,\n },\n cfg,\n );\n }\n\n /**\n * Computes the Password-Based Key Derivation Function 2.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n *\n * @return {WordArray} The derived key.\n *\n * @example\n *\n * const key = kdf.compute(password, salt);\n */\n compute(password, salt) {\n // Shortcut\n const { cfg } = this;\n\n // Init HMAC\n const hmac = HMAC.create(cfg.hasher, password);\n\n // Initial values\n const derivedKey = WordArray.create();\n const blockIndex = WordArray.create([0x00000001]);\n\n // Shortcuts\n const derivedKeyWords = derivedKey.words;\n const blockIndexWords = blockIndex.words;\n const { keySize, iterations } = cfg;\n\n // Generate key\n while (derivedKeyWords.length < keySize) {\n const block = hmac.update(salt).finalize(blockIndex);\n hmac.reset();\n\n // Shortcuts\n const blockWords = block.words;\n const blockWordsLength = blockWords.length;\n\n // Iterations\n let intermediate = block;\n for (let i = 1; i < iterations; i += 1) {\n intermediate = hmac.finalize(intermediate);\n hmac.reset();\n\n // Shortcut\n const intermediateWords = intermediate.words;\n\n // XOR intermediate with block\n for (let j = 0; j < blockWordsLength; j += 1) {\n blockWords[j] ^= intermediateWords[j];\n }\n }\n\n derivedKey.concat(block);\n blockIndexWords[0] += 1;\n }\n derivedKey.sigBytes = keySize * 4;\n\n return derivedKey;\n }\n}\n\n/**\n * Computes the Password-Based Key Derivation Function 2.\n *\n * @param {WordArray|string} password The password.\n * @param {WordArray|string} salt A salt.\n * @param {Object} cfg (Optional) The configuration options to use for this computation.\n *\n * @return {WordArray} The derived key.\n *\n * @static\n *\n * @example\n *\n * var key = CryptoJS.PBKDF2(password, salt);\n * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });\n * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });\n */\nexport const PBKDF2 = (password, salt, cfg) => PBKDF2Algo.create(cfg).compute(password, salt);\n","import {\n WordArray,\n} from './core.js';\nimport {\n BlockCipher,\n} from './cipher-core.js';\n\n// Permuted Choice 1 constants\nconst PC1 = [\n 57, 49, 41, 33, 25, 17, 9, 1,\n 58, 50, 42, 34, 26, 18, 10, 2,\n 59, 51, 43, 35, 27, 19, 11, 3,\n 60, 52, 44, 36, 63, 55, 47, 39,\n 31, 23, 15, 7, 62, 54, 46, 38,\n 30, 22, 14, 6, 61, 53, 45, 37,\n 29, 21, 13, 5, 28, 20, 12, 4,\n];\n\n// Permuted Choice 2 constants\nconst PC2 = [\n 14, 17, 11, 24, 1, 5,\n 3, 28, 15, 6, 21, 10,\n 23, 19, 12, 4, 26, 8,\n 16, 7, 27, 20, 13, 2,\n 41, 52, 31, 37, 47, 55,\n 30, 40, 51, 45, 33, 48,\n 44, 49, 39, 56, 34, 53,\n 46, 42, 50, 36, 29, 32,\n];\n\n// Cumulative bit shift constants\nconst BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];\n\n// SBOXes and round permutation constants\nconst SBOX_P = [\n {\n 0x0: 0x808200,\n 0x10000000: 0x8000,\n 0x20000000: 0x808002,\n 0x30000000: 0x2,\n 0x40000000: 0x200,\n 0x50000000: 0x808202,\n 0x60000000: 0x800202,\n 0x70000000: 0x800000,\n 0x80000000: 0x202,\n 0x90000000: 0x800200,\n 0xa0000000: 0x8200,\n 0xb0000000: 0x808000,\n 0xc0000000: 0x8002,\n 0xd0000000: 0x800002,\n 0xe0000000: 0x0,\n 0xf0000000: 0x8202,\n 0x8000000: 0x0,\n 0x18000000: 0x808202,\n 0x28000000: 0x8202,\n 0x38000000: 0x8000,\n 0x48000000: 0x808200,\n 0x58000000: 0x200,\n 0x68000000: 0x808002,\n 0x78000000: 0x2,\n 0x88000000: 0x800200,\n 0x98000000: 0x8200,\n 0xa8000000: 0x808000,\n 0xb8000000: 0x800202,\n 0xc8000000: 0x800002,\n 0xd8000000: 0x8002,\n 0xe8000000: 0x202,\n 0xf8000000: 0x800000,\n 0x1: 0x8000,\n 0x10000001: 0x2,\n 0x20000001: 0x808200,\n 0x30000001: 0x800000,\n 0x40000001: 0x808002,\n 0x50000001: 0x8200,\n 0x60000001: 0x200,\n 0x70000001: 0x800202,\n 0x80000001: 0x808202,\n 0x90000001: 0x808000,\n 0xa0000001: 0x800002,\n 0xb0000001: 0x8202,\n 0xc0000001: 0x202,\n 0xd0000001: 0x800200,\n 0xe0000001: 0x8002,\n 0xf0000001: 0x0,\n 0x8000001: 0x808202,\n 0x18000001: 0x808000,\n 0x28000001: 0x800000,\n 0x38000001: 0x200,\n 0x48000001: 0x8000,\n 0x58000001: 0x800002,\n 0x68000001: 0x2,\n 0x78000001: 0x8202,\n 0x88000001: 0x8002,\n 0x98000001: 0x800202,\n 0xa8000001: 0x202,\n 0xb8000001: 0x808200,\n 0xc8000001: 0x800200,\n 0xd8000001: 0x0,\n 0xe8000001: 0x8200,\n 0xf8000001: 0x808002,\n },\n {\n 0x0: 0x40084010,\n 0x1000000: 0x4000,\n 0x2000000: 0x80000,\n 0x3000000: 0x40080010,\n 0x4000000: 0x40000010,\n 0x5000000: 0x40084000,\n 0x6000000: 0x40004000,\n 0x7000000: 0x10,\n 0x8000000: 0x84000,\n 0x9000000: 0x40004010,\n 0xa000000: 0x40000000,\n 0xb000000: 0x84010,\n 0xc000000: 0x80010,\n 0xd000000: 0x0,\n 0xe000000: 0x4010,\n 0xf000000: 0x40080000,\n 0x800000: 0x40004000,\n 0x1800000: 0x84010,\n 0x2800000: 0x10,\n 0x3800000: 0x40004010,\n 0x4800000: 0x40084010,\n 0x5800000: 0x40000000,\n 0x6800000: 0x80000,\n 0x7800000: 0x40080010,\n 0x8800000: 0x80010,\n 0x9800000: 0x0,\n 0xa800000: 0x4000,\n 0xb800000: 0x40080000,\n 0xc800000: 0x40000010,\n 0xd800000: 0x84000,\n 0xe800000: 0x40084000,\n 0xf800000: 0x4010,\n 0x10000000: 0x0,\n 0x11000000: 0x40080010,\n 0x12000000: 0x40004010,\n 0x13000000: 0x40084000,\n 0x14000000: 0x40080000,\n 0x15000000: 0x10,\n 0x16000000: 0x84010,\n 0x17000000: 0x4000,\n 0x18000000: 0x4010,\n 0x19000000: 0x80000,\n 0x1a000000: 0x80010,\n 0x1b000000: 0x40000010,\n 0x1c000000: 0x84000,\n 0x1d000000: 0x40004000,\n 0x1e000000: 0x40000000,\n 0x1f000000: 0x40084010,\n 0x10800000: 0x84010,\n 0x11800000: 0x80000,\n 0x12800000: 0x40080000,\n 0x13800000: 0x4000,\n 0x14800000: 0x40004000,\n 0x15800000: 0x40084010,\n 0x16800000: 0x10,\n 0x17800000: 0x40000000,\n 0x18800000: 0x40084000,\n 0x19800000: 0x40000010,\n 0x1a800000: 0x40004010,\n 0x1b800000: 0x80010,\n 0x1c800000: 0x0,\n 0x1d800000: 0x4010,\n 0x1e800000: 0x40080010,\n 0x1f800000: 0x84000,\n },\n {\n 0x0: 0x104,\n 0x100000: 0x0,\n 0x200000: 0x4000100,\n 0x300000: 0x10104,\n 0x400000: 0x10004,\n 0x500000: 0x4000004,\n 0x600000: 0x4010104,\n 0x700000: 0x4010000,\n 0x800000: 0x4000000,\n 0x900000: 0x4010100,\n 0xa00000: 0x10100,\n 0xb00000: 0x4010004,\n 0xc00000: 0x4000104,\n 0xd00000: 0x10000,\n 0xe00000: 0x4,\n 0xf00000: 0x100,\n 0x80000: 0x4010100,\n 0x180000: 0x4010004,\n 0x280000: 0x0,\n 0x380000: 0x4000100,\n 0x480000: 0x4000004,\n 0x580000: 0x10000,\n 0x680000: 0x10004,\n 0x780000: 0x104,\n 0x880000: 0x4,\n 0x980000: 0x100,\n 0xa80000: 0x4010000,\n 0xb80000: 0x10104,\n 0xc80000: 0x10100,\n 0xd80000: 0x4000104,\n 0xe80000: 0x4010104,\n 0xf80000: 0x4000000,\n 0x1000000: 0x4010100,\n 0x1100000: 0x10004,\n 0x1200000: 0x10000,\n 0x1300000: 0x4000100,\n 0x1400000: 0x100,\n 0x1500000: 0x4010104,\n 0x1600000: 0x4000004,\n 0x1700000: 0x0,\n 0x1800000: 0x4000104,\n 0x1900000: 0x4000000,\n 0x1a00000: 0x4,\n 0x1b00000: 0x10100,\n 0x1c00000: 0x4010000,\n 0x1d00000: 0x104,\n 0x1e00000: 0x10104,\n 0x1f00000: 0x4010004,\n 0x1080000: 0x4000000,\n 0x1180000: 0x104,\n 0x1280000: 0x4010100,\n 0x1380000: 0x0,\n 0x1480000: 0x10004,\n 0x1580000: 0x4000100,\n 0x1680000: 0x100,\n 0x1780000: 0x4010004,\n 0x1880000: 0x10000,\n 0x1980000: 0x4010104,\n 0x1a80000: 0x10104,\n 0x1b80000: 0x4000004,\n 0x1c80000: 0x4000104,\n 0x1d80000: 0x4010000,\n 0x1e80000: 0x4,\n 0x1f80000: 0x10100,\n },\n {\n 0x0: 0x80401000,\n 0x10000: 0x80001040,\n 0x20000: 0x401040,\n 0x30000: 0x80400000,\n 0x40000: 0x0,\n 0x50000: 0x401000,\n 0x60000: 0x80000040,\n 0x70000: 0x400040,\n 0x80000: 0x80000000,\n 0x90000: 0x400000,\n 0xa0000: 0x40,\n 0xb0000: 0x80001000,\n 0xc0000: 0x80400040,\n 0xd0000: 0x1040,\n 0xe0000: 0x1000,\n 0xf0000: 0x80401040,\n 0x8000: 0x80001040,\n 0x18000: 0x40,\n 0x28000: 0x80400040,\n 0x38000: 0x80001000,\n 0x48000: 0x401000,\n 0x58000: 0x80401040,\n 0x68000: 0x0,\n 0x78000: 0x80400000,\n 0x88000: 0x1000,\n 0x98000: 0x80401000,\n 0xa8000: 0x400000,\n 0xb8000: 0x1040,\n 0xc8000: 0x80000000,\n 0xd8000: 0x400040,\n 0xe8000: 0x401040,\n 0xf8000: 0x80000040,\n 0x100000: 0x400040,\n 0x110000: 0x401000,\n 0x120000: 0x80000040,\n 0x130000: 0x0,\n 0x140000: 0x1040,\n 0x150000: 0x80400040,\n 0x160000: 0x80401000,\n 0x170000: 0x80001040,\n 0x180000: 0x80401040,\n 0x190000: 0x80000000,\n 0x1a0000: 0x80400000,\n 0x1b0000: 0x401040,\n 0x1c0000: 0x80001000,\n 0x1d0000: 0x400000,\n 0x1e0000: 0x40,\n 0x1f0000: 0x1000,\n 0x108000: 0x80400000,\n 0x118000: 0x80401040,\n 0x128000: 0x0,\n 0x138000: 0x401000,\n 0x148000: 0x400040,\n 0x158000: 0x80000000,\n 0x168000: 0x80001040,\n 0x178000: 0x40,\n 0x188000: 0x80000040,\n 0x198000: 0x1000,\n 0x1a8000: 0x80001000,\n 0x1b8000: 0x80400040,\n 0x1c8000: 0x1040,\n 0x1d8000: 0x80401000,\n 0x1e8000: 0x400000,\n 0x1f8000: 0x401040,\n },\n {\n 0x0: 0x80,\n 0x1000: 0x1040000,\n 0x2000: 0x40000,\n 0x3000: 0x20000000,\n 0x4000: 0x20040080,\n 0x5000: 0x1000080,\n 0x6000: 0x21000080,\n 0x7000: 0x40080,\n 0x8000: 0x1000000,\n 0x9000: 0x20040000,\n 0xa000: 0x20000080,\n 0xb000: 0x21040080,\n 0xc000: 0x21040000,\n 0xd000: 0x0,\n 0xe000: 0x1040080,\n 0xf000: 0x21000000,\n 0x800: 0x1040080,\n 0x1800: 0x21000080,\n 0x2800: 0x80,\n 0x3800: 0x1040000,\n 0x4800: 0x40000,\n 0x5800: 0x20040080,\n 0x6800: 0x21040000,\n 0x7800: 0x20000000,\n 0x8800: 0x20040000,\n 0x9800: 0x0,\n 0xa800: 0x21040080,\n 0xb800: 0x1000080,\n 0xc800: 0x20000080,\n 0xd800: 0x21000000,\n 0xe800: 0x1000000,\n 0xf800: 0x40080,\n 0x10000: 0x40000,\n 0x11000: 0x80,\n 0x12000: 0x20000000,\n 0x13000: 0x21000080,\n 0x14000: 0x1000080,\n 0x15000: 0x21040000,\n 0x16000: 0x20040080,\n 0x17000: 0x1000000,\n 0x18000: 0x21040080,\n 0x19000: 0x21000000,\n 0x1a000: 0x1040000,\n 0x1b000: 0x20040000,\n 0x1c000: 0x40080,\n 0x1d000: 0x20000080,\n 0x1e000: 0x0,\n 0x1f000: 0x1040080,\n 0x10800: 0x21000080,\n 0x11800: 0x1000000,\n 0x12800: 0x1040000,\n 0x13800: 0x20040080,\n 0x14800: 0x20000000,\n 0x15800: 0x1040080,\n 0x16800: 0x80,\n 0x17800: 0x21040000,\n 0x18800: 0x40080,\n 0x19800: 0x21040080,\n 0x1a800: 0x0,\n 0x1b800: 0x21000000,\n 0x1c800: 0x1000080,\n 0x1d800: 0x40000,\n 0x1e800: 0x20040000,\n 0x1f800: 0x20000080,\n },\n {\n 0x0: 0x10000008,\n 0x100: 0x2000,\n 0x200: 0x10200000,\n 0x300: 0x10202008,\n 0x400: 0x10002000,\n 0x500: 0x200000,\n 0x600: 0x200008,\n 0x700: 0x10000000,\n 0x800: 0x0,\n 0x900: 0x10002008,\n 0xa00: 0x202000,\n 0xb00: 0x8,\n 0xc00: 0x10200008,\n 0xd00: 0x202008,\n 0xe00: 0x2008,\n 0xf00: 0x10202000,\n 0x80: 0x10200000,\n 0x180: 0x10202008,\n 0x280: 0x8,\n 0x380: 0x200000,\n 0x480: 0x202008,\n 0x580: 0x10000008,\n 0x680: 0x10002000,\n 0x780: 0x2008,\n 0x880: 0x200008,\n 0x980: 0x2000,\n 0xa80: 0x10002008,\n 0xb80: 0x10200008,\n 0xc80: 0x0,\n 0xd80: 0x10202000,\n 0xe80: 0x202000,\n 0xf80: 0x10000000,\n 0x1000: 0x10002000,\n 0x1100: 0x10200008,\n 0x1200: 0x10202008,\n 0x1300: 0x2008,\n 0x1400: 0x200000,\n 0x1500: 0x10000000,\n 0x1600: 0x10000008,\n 0x1700: 0x202000,\n 0x1800: 0x202008,\n 0x1900: 0x0,\n 0x1a00: 0x8,\n 0x1b00: 0x10200000,\n 0x1c00: 0x2000,\n 0x1d00: 0x10002008,\n 0x1e00: 0x10202000,\n 0x1f00: 0x200008,\n 0x1080: 0x8,\n 0x1180: 0x202000,\n 0x1280: 0x200000,\n 0x1380: 0x10000008,\n 0x1480: 0x10002000,\n 0x1580: 0x2008,\n 0x1680: 0x10202008,\n 0x1780: 0x10200000,\n 0x1880: 0x10202000,\n 0x1980: 0x10200008,\n 0x1a80: 0x2000,\n 0x1b80: 0x202008,\n 0x1c80: 0x200008,\n 0x1d80: 0x0,\n 0x1e80: 0x10000000,\n 0x1f80: 0x10002008,\n },\n {\n 0x0: 0x100000,\n 0x10: 0x2000401,\n 0x20: 0x400,\n 0x30: 0x100401,\n 0x40: 0x2100401,\n 0x50: 0x0,\n 0x60: 0x1,\n 0x70: 0x2100001,\n 0x80: 0x2000400,\n 0x90: 0x100001,\n 0xa0: 0x2000001,\n 0xb0: 0x2100400,\n 0xc0: 0x2100000,\n 0xd0: 0x401,\n 0xe0: 0x100400,\n 0xf0: 0x2000000,\n 0x8: 0x2100001,\n 0x18: 0x0,\n 0x28: 0x2000401,\n 0x38: 0x2100400,\n 0x48: 0x100000,\n 0x58: 0x2000001,\n 0x68: 0x2000000,\n 0x78: 0x401,\n 0x88: 0x100401,\n 0x98: 0x2000400,\n 0xa8: 0x2100000,\n 0xb8: 0x100001,\n 0xc8: 0x400,\n 0xd8: 0x2100401,\n 0xe8: 0x1,\n 0xf8: 0x100400,\n 0x100: 0x2000000,\n 0x110: 0x100000,\n 0x120: 0x2000401,\n 0x130: 0x2100001,\n 0x140: 0x100001,\n 0x150: 0x2000400,\n 0x160: 0x2100400,\n 0x170: 0x100401,\n 0x180: 0x401,\n 0x190: 0x2100401,\n 0x1a0: 0x100400,\n 0x1b0: 0x1,\n 0x1c0: 0x0,\n 0x1d0: 0x2100000,\n 0x1e0: 0x2000001,\n 0x1f0: 0x400,\n 0x108: 0x100400,\n 0x118: 0x2000401,\n 0x128: 0x2100001,\n 0x138: 0x1,\n 0x148: 0x2000000,\n 0x158: 0x100000,\n 0x168: 0x401,\n 0x178: 0x2100400,\n 0x188: 0x2000001,\n 0x198: 0x2100000,\n 0x1a8: 0x0,\n 0x1b8: 0x2100401,\n 0x1c8: 0x100401,\n 0x1d8: 0x400,\n 0x1e8: 0x2000400,\n 0x1f8: 0x100001,\n },\n {\n 0x0: 0x8000820,\n 0x1: 0x20000,\n 0x2: 0x8000000,\n 0x3: 0x20,\n 0x4: 0x20020,\n 0x5: 0x8020820,\n 0x6: 0x8020800,\n 0x7: 0x800,\n 0x8: 0x8020000,\n 0x9: 0x8000800,\n 0xa: 0x20800,\n 0xb: 0x8020020,\n 0xc: 0x820,\n 0xd: 0x0,\n 0xe: 0x8000020,\n 0xf: 0x20820,\n 0x80000000: 0x800,\n 0x80000001: 0x8020820,\n 0x80000002: 0x8000820,\n 0x80000003: 0x8000000,\n 0x80000004: 0x8020000,\n 0x80000005: 0x20800,\n 0x80000006: 0x20820,\n 0x80000007: 0x20,\n 0x80000008: 0x8000020,\n 0x80000009: 0x820,\n 0x8000000a: 0x20020,\n 0x8000000b: 0x8020800,\n 0x8000000c: 0x0,\n 0x8000000d: 0x8020020,\n 0x8000000e: 0x8000800,\n 0x8000000f: 0x20000,\n 0x10: 0x20820,\n 0x11: 0x8020800,\n 0x12: 0x20,\n 0x13: 0x800,\n 0x14: 0x8000800,\n 0x15: 0x8000020,\n 0x16: 0x8020020,\n 0x17: 0x20000,\n 0x18: 0x0,\n 0x19: 0x20020,\n 0x1a: 0x8020000,\n 0x1b: 0x8000820,\n 0x1c: 0x8020820,\n 0x1d: 0x20800,\n 0x1e: 0x820,\n 0x1f: 0x8000000,\n 0x80000010: 0x20000,\n 0x80000011: 0x800,\n 0x80000012: 0x8020020,\n 0x80000013: 0x20820,\n 0x80000014: 0x20,\n 0x80000015: 0x8020000,\n 0x80000016: 0x8000000,\n 0x80000017: 0x8000820,\n 0x80000018: 0x8020820,\n 0x80000019: 0x8000020,\n 0x8000001a: 0x8000800,\n 0x8000001b: 0x0,\n 0x8000001c: 0x20800,\n 0x8000001d: 0x820,\n 0x8000001e: 0x20020,\n 0x8000001f: 0x8020800,\n },\n];\n\n// Masks that select the SBOX input\nconst SBOX_MASK = [\n 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,\n 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f,\n];\n\n// Swap bits across the left and right words\nfunction exchangeLR(offset, mask) {\n const t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;\n this._rBlock ^= t;\n this._lBlock ^= t << offset;\n}\n\nfunction exchangeRL(offset, mask) {\n const t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;\n this._lBlock ^= t;\n this._rBlock ^= t << offset;\n}\n\n/**\n * DES block cipher algorithm.\n */\nexport class DESAlgo extends BlockCipher {\n _doReset() {\n // Shortcuts\n const key = this._key;\n const keyWords = key.words;\n\n // Select 56 bits according to PC1\n const keyBits = [];\n for (let i = 0; i < 56; i += 1) {\n const keyBitPos = PC1[i] - 1;\n keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - (keyBitPos % 32))) & 1;\n }\n\n // Assemble 16 subkeys\n this._subKeys = [];\n const subKeys = this._subKeys;\n for (let nSubKey = 0; nSubKey < 16; nSubKey += 1) {\n // Create subkey\n subKeys[nSubKey] = [];\n const subKey = subKeys[nSubKey];\n\n // Shortcut\n const bitShift = BIT_SHIFTS[nSubKey];\n\n // Select 48 bits according to PC2\n for (let i = 0; i < 24; i += 1) {\n // Select from the left 28 key bits\n subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - (i % 6));\n\n // Select from the right 28 key bits\n subKey[4 + ((i / 6) | 0)]\n |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)]\n << (31 - (i % 6));\n }\n\n // Since each subkey is applied to an expanded 32-bit input,\n // the subkey can be broken into 8 values scaled to 32-bits,\n // which allows the key to be used without expansion\n subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);\n for (let i = 1; i < 7; i += 1) {\n subKey[i] >>>= ((i - 1) * 4 + 3);\n }\n subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);\n }\n\n // Compute inverse subkeys\n this._invSubKeys = [];\n const invSubKeys = this._invSubKeys;\n for (let i = 0; i < 16; i += 1) {\n invSubKeys[i] = subKeys[15 - i];\n }\n }\n\n encryptBlock(M, offset) {\n this._doCryptBlock(M, offset, this._subKeys);\n }\n\n decryptBlock(M, offset) {\n this._doCryptBlock(M, offset, this._invSubKeys);\n }\n\n _doCryptBlock(M, offset, subKeys) {\n const _M = M;\n\n // Get input\n this._lBlock = M[offset];\n this._rBlock = M[offset + 1];\n\n // Initial permutation\n exchangeLR.call(this, 4, 0x0f0f0f0f);\n exchangeLR.call(this, 16, 0x0000ffff);\n exchangeRL.call(this, 2, 0x33333333);\n exchangeRL.call(this, 8, 0x00ff00ff);\n exchangeLR.call(this, 1, 0x55555555);\n\n // Rounds\n for (let round = 0; round < 16; round += 1) {\n // Shortcuts\n const subKey = subKeys[round];\n const lBlock = this._lBlock;\n const rBlock = this._rBlock;\n\n // Feistel function\n let f = 0;\n for (let i = 0; i < 8; i += 1) {\n f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];\n }\n this._lBlock = rBlock;\n this._rBlock = lBlock ^ f;\n }\n\n // Undo swap from last round\n const t = this._lBlock;\n this._lBlock = this._rBlock;\n this._rBlock = t;\n\n // Final permutation\n exchangeLR.call(this, 1, 0x55555555);\n exchangeRL.call(this, 8, 0x00ff00ff);\n exchangeRL.call(this, 2, 0x33333333);\n exchangeLR.call(this, 16, 0x0000ffff);\n exchangeLR.call(this, 4, 0x0f0f0f0f);\n\n // Set output\n _M[offset] = this._lBlock;\n _M[offset + 1] = this._rBlock;\n }\n}\nDESAlgo.keySize = 64 / 32;\nDESAlgo.ivSize = 64 / 32;\nDESAlgo.blockSize = 64 / 32;\n\n/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);\n */\nexport const DES = BlockCipher._createHelper(DESAlgo);\n\n/**\n * Triple-DES block cipher algorithm.\n */\nexport class TripleDESAlgo extends BlockCipher {\n _doReset() {\n // Shortcuts\n const key = this._key;\n const keyWords = key.words;\n // Make sure the key length is valid (64, 128 or >= 192 bit)\n if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {\n throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.');\n }\n\n // Extend the key according to the keying options defined in 3DES standard\n const key1 = keyWords.slice(0, 2);\n const key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);\n const key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);\n\n // Create DES instances\n this._des1 = DESAlgo.createEncryptor(WordArray.create(key1));\n this._des2 = DESAlgo.createEncryptor(WordArray.create(key2));\n this._des3 = DESAlgo.createEncryptor(WordArray.create(key3));\n }\n\n encryptBlock(M, offset) {\n this._des1.encryptBlock(M, offset);\n this._des2.decryptBlock(M, offset);\n this._des3.encryptBlock(M, offset);\n }\n\n decryptBlock(M, offset) {\n this._des3.decryptBlock(M, offset);\n this._des2.encryptBlock(M, offset);\n this._des1.decryptBlock(M, offset);\n }\n}\nTripleDESAlgo.keySize = 192 / 32;\nTripleDESAlgo.ivSize = 64 / 32;\nTripleDESAlgo.blockSize = 64 / 32;\n\n/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);\n */\nexport const TripleDES = BlockCipher._createHelper(TripleDESAlgo);\n","import {\n StreamCipher,\n} from './cipher-core.js';\n\n// Reusable objects\nconst S = [];\nconst C_ = [];\nconst G = [];\n\nfunction nextState() {\n // Shortcuts\n const X = this._X;\n const C = this._C;\n\n // Save old counter values\n for (let i = 0; i < 8; i += 1) {\n C_[i] = C[i];\n }\n\n // Calculate new counter values\n C[0] = (C[0] + 0x4d34d34d + this._b) | 0;\n C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;\n C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;\n C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;\n C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;\n C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;\n C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;\n C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;\n this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;\n\n // Calculate the g-values\n for (let i = 0; i < 8; i += 1) {\n const gx = X[i] + C[i];\n\n // Construct high and low argument for squaring\n const ga = gx & 0xffff;\n const gb = gx >>> 16;\n\n // Calculate high and low result of squaring\n const gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;\n const gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);\n\n // High XOR low\n G[i] = gh ^ gl;\n }\n\n // Calculate new state values\n X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;\n X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;\n X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;\n X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;\n X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;\n X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;\n X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;\n X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;\n}\n\n/**\n * Rabbit stream cipher algorithm\n */\nexport class RabbitAlgo extends StreamCipher {\n constructor(...args) {\n super(...args);\n\n this.blockSize = 128 / 32;\n this.ivSize = 64 / 32;\n }\n\n _doReset() {\n // Shortcuts\n const K = this._key.words;\n const { iv } = this.cfg;\n\n // Swap endian\n for (let i = 0; i < 4; i += 1) {\n K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff)\n | (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);\n }\n\n // Generate initial state values\n this._X = [\n K[0], (K[3] << 16) | (K[2] >>> 16),\n K[1], (K[0] << 16) | (K[3] >>> 16),\n K[2], (K[1] << 16) | (K[0] >>> 16),\n K[3], (K[2] << 16) | (K[1] >>> 16),\n ];\n const X = this._X;\n\n // Generate initial counter values\n this._C = [\n (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),\n (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),\n (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),\n (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff),\n ];\n const C = this._C;\n\n // Carry bit\n this._b = 0;\n\n // Iterate the system four times\n for (let i = 0; i < 4; i += 1) {\n nextState.call(this);\n }\n\n // Modify the counters\n for (let i = 0; i < 8; i += 1) {\n C[i] ^= X[(i + 4) & 7];\n }\n\n // IV setup\n if (iv) {\n // Shortcuts\n const IV = iv.words;\n const IV_0 = IV[0];\n const IV_1 = IV[1];\n\n // Generate four subvectors\n const i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff)\n | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);\n const i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff)\n | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);\n const i1 = (i0 >>> 16) | (i2 & 0xffff0000);\n const i3 = (i2 << 16) | (i0 & 0x0000ffff);\n\n // Modify counter values\n C[0] ^= i0;\n C[1] ^= i1;\n C[2] ^= i2;\n C[3] ^= i3;\n C[4] ^= i0;\n C[5] ^= i1;\n C[6] ^= i2;\n C[7] ^= i3;\n\n // Iterate the system four times\n for (let i = 0; i < 4; i += 1) {\n nextState.call(this);\n }\n }\n }\n\n _doProcessBlock(M, offset) {\n const _M = M;\n\n // Shortcut\n const X = this._X;\n\n // Iterate the system\n nextState.call(this);\n\n // Generate four keystream words\n S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);\n S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);\n S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);\n S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);\n\n for (let i = 0; i < 4; i += 1) {\n // Swap endian\n S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff)\n | (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);\n\n // Encrypt\n _M[offset + i] ^= S[i];\n }\n }\n}\n\n/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);\n */\nexport const Rabbit = StreamCipher._createHelper(RabbitAlgo);\n","import {\n StreamCipher,\n} from './cipher-core.js';\n\n// Reusable objects\nconst S = [];\nconst C_ = [];\nconst G = [];\n\nfunction nextState() {\n // Shortcuts\n const X = this._X;\n const C = this._C;\n\n // Save old counter values\n for (let i = 0; i < 8; i += 1) {\n C_[i] = C[i];\n }\n\n // Calculate new counter values\n C[0] = (C[0] + 0x4d34d34d + this._b) | 0;\n C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;\n C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;\n C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;\n C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;\n C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;\n C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;\n C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;\n this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;\n\n // Calculate the g-values\n for (let i = 0; i < 8; i += 1) {\n const gx = X[i] + C[i];\n\n // Construct high and low argument for squaring\n const ga = gx & 0xffff;\n const gb = gx >>> 16;\n\n // Calculate high and low result of squaring\n const gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;\n const gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);\n\n // High XOR low\n G[i] = gh ^ gl;\n }\n\n // Calculate new state values\n X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;\n X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;\n X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;\n X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;\n X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;\n X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;\n X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;\n X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;\n}\n\n/**\n * Rabbit stream cipher algorithm.\n *\n * This is a legacy version that neglected to convert the key to little-endian.\n * This error doesn't affect the cipher's security,\n * but it does affect its compatibility with other implementations.\n */\nexport class RabbitLegacyAlgo extends StreamCipher {\n constructor(...args) {\n super(...args);\n\n this.blockSize = 128 / 32;\n this.ivSize = 64 / 32;\n }\n\n _doReset() {\n // Shortcuts\n const K = this._key.words;\n const { iv } = this.cfg;\n\n // Generate initial state values\n this._X = [\n K[0], (K[3] << 16) | (K[2] >>> 16),\n K[1], (K[0] << 16) | (K[3] >>> 16),\n K[2], (K[1] << 16) | (K[0] >>> 16),\n K[3], (K[2] << 16) | (K[1] >>> 16),\n ];\n const X = this._X;\n\n // Generate initial counter values\n this._C = [\n (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),\n (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),\n (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),\n (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff),\n ];\n const C = this._C;\n\n // Carry bit\n this._b = 0;\n\n // Iterate the system four times\n for (let i = 0; i < 4; i += 1) {\n nextState.call(this);\n }\n\n // Modify the counters\n for (let i = 0; i < 8; i += 1) {\n C[i] ^= X[(i + 4) & 7];\n }\n\n // IV setup\n if (iv) {\n // Shortcuts\n const IV = iv.words;\n const IV_0 = IV[0];\n const IV_1 = IV[1];\n\n // Generate four subvectors\n const i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff)\n | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);\n const i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff)\n | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);\n const i1 = (i0 >>> 16) | (i2 & 0xffff0000);\n const i3 = (i2 << 16) | (i0 & 0x0000ffff);\n\n // Modify counter values\n C[0] ^= i0;\n C[1] ^= i1;\n C[2] ^= i2;\n C[3] ^= i3;\n C[4] ^= i0;\n C[5] ^= i1;\n C[6] ^= i2;\n C[7] ^= i3;\n\n // Iterate the system four times\n for (let i = 0; i < 4; i += 1) {\n nextState.call(this);\n }\n }\n }\n\n _doProcessBlock(M, offset) {\n const _M = M;\n\n // Shortcut\n const X = this._X;\n\n // Iterate the system\n nextState.call(this);\n\n // Generate four keystream words\n S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);\n S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);\n S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);\n S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);\n\n for (let i = 0; i < 4; i += 1) {\n // Swap endian\n S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff)\n | (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);\n\n // Encrypt\n _M[offset + i] ^= S[i];\n }\n }\n}\n\n/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);\n */\nexport const RabbitLegacy = StreamCipher._createHelper(RabbitLegacyAlgo);\n","import {\n StreamCipher,\n} from './cipher-core.js';\n\nfunction generateKeystreamWord() {\n // Shortcuts\n const S = this._S;\n let i = this._i;\n let j = this._j;\n\n // Generate keystream word\n let keystreamWord = 0;\n for (let n = 0; n < 4; n += 1) {\n i = (i + 1) % 256;\n j = (j + S[i]) % 256;\n\n // Swap\n const t = S[i];\n S[i] = S[j];\n S[j] = t;\n\n keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);\n }\n\n // Update counters\n this._i = i;\n this._j = j;\n\n return keystreamWord;\n}\n\n/**\n * RC4 stream cipher algorithm.\n */\nexport class RC4Algo extends StreamCipher {\n _doReset() {\n // Shortcuts\n const key = this._key;\n const keyWords = key.words;\n const keySigBytes = key.sigBytes;\n\n // Init sbox\n this._S = [];\n const S = this._S;\n for (let i = 0; i < 256; i += 1) {\n S[i] = i;\n }\n\n // Key setup\n for (let i = 0, j = 0; i < 256; i += 1) {\n const keyByteIndex = i % keySigBytes;\n const keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;\n\n j = (j + S[i] + keyByte) % 256;\n\n // Swap\n const t = S[i];\n S[i] = S[j];\n S[j] = t;\n }\n\n // Counters\n this._j = 0;\n this._i = this._j;\n }\n\n _doProcessBlock(M, offset) {\n const _M = M;\n\n _M[offset] ^= generateKeystreamWord.call(this);\n }\n}\nRC4Algo.keySize = 256 / 32;\nRC4Algo.ivSize = 0;\n\n/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);\n */\nexport const RC4 = StreamCipher._createHelper(RC4Algo);\n\n/**\n * Modified RC4 stream cipher algorithm.\n */\nexport class RC4DropAlgo extends RC4Algo {\n constructor(...args) {\n super(...args);\n\n /**\n * Configuration options.\n *\n * @property {number} drop The number of keystream words to drop. Default 192\n */\n Object.assign(this.cfg, { drop: 192 });\n }\n\n _doReset() {\n super._doReset.call(this);\n\n // Drop\n for (let i = this.cfg.drop; i > 0; i -= 1) {\n generateKeystreamWord.call(this);\n }\n }\n}\n\n/**\n * Shortcut functions to the cipher's object interface.\n *\n * @example\n *\n * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);\n * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);\n */\nexport const RC4Drop = StreamCipher._createHelper(RC4DropAlgo);\n","import {\n BlockCipherMode,\n} from './cipher-core.js';\n\nfunction generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {\n const _words = words;\n let keystream;\n\n // Shortcut\n const iv = this._iv;\n\n // Generate keystream\n if (iv) {\n keystream = iv.slice(0);\n\n // Remove IV for subsequent blocks\n this._iv = undefined;\n } else {\n keystream = this._prevBlock;\n }\n cipher.encryptBlock(keystream, 0);\n\n // Encrypt\n for (let i = 0; i < blockSize; i += 1) {\n _words[offset + i] ^= keystream[i];\n }\n}\n\n/**\n * Cipher Feedback block mode.\n */\nexport class CFB extends BlockCipherMode {\n}\nCFB.Encryptor = class extends CFB {\n processBlock(words, offset) {\n // Shortcuts\n const cipher = this._cipher;\n const { blockSize } = cipher;\n\n generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n // Remember this block to use with next block\n this._prevBlock = words.slice(offset, offset + blockSize);\n }\n};\nCFB.Decryptor = class extends CFB {\n processBlock(words, offset) {\n // Shortcuts\n const cipher = this._cipher;\n const { blockSize } = cipher;\n\n // Remember this block to use with next block\n const thisBlock = words.slice(offset, offset + blockSize);\n\n generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);\n\n // This block becomes the previous block\n this._prevBlock = thisBlock;\n }\n};\n","/**\n * Counter block mode.\n */\nimport {\n BlockCipherMode,\n} from './cipher-core.js';\n\nexport class CTR extends BlockCipherMode {\n}\nCTR.Encryptor = class extends CTR {\n processBlock(words, offset) {\n const _words = words;\n\n // Shortcuts\n const cipher = this._cipher;\n const { blockSize } = cipher;\n const iv = this._iv;\n let counter = this._counter;\n\n // Generate keystream\n if (iv) {\n this._counter = iv.slice(0);\n counter = this._counter;\n\n // Remove IV for subsequent blocks\n this._iv = undefined;\n }\n const keystream = counter.slice(0);\n cipher.encryptBlock(keystream, 0);\n\n // Increment counter\n counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0;\n\n // Encrypt\n for (let i = 0; i < blockSize; i += 1) {\n _words[offset + i] ^= keystream[i];\n }\n }\n};\nCTR.Decryptor = CTR.Encryptor;\n","import {\n BlockCipherMode,\n} from './cipher-core.js';\n\nconst incWord = (word) => {\n let _word = word;\n\n if (((word >> 24) & 0xff) === 0xff) { // overflow\n let b1 = (word >> 16) & 0xff;\n let b2 = (word >> 8) & 0xff;\n let b3 = word & 0xff;\n\n if (b1 === 0xff) { // overflow b1\n b1 = 0;\n if (b2 === 0xff) {\n b2 = 0;\n if (b3 === 0xff) {\n b3 = 0;\n } else {\n b3 += 1;\n }\n } else {\n b2 += 1;\n }\n } else {\n b1 += 1;\n }\n\n _word = 0;\n _word += (b1 << 16);\n _word += (b2 << 8);\n _word += b3;\n } else {\n _word += (0x01 << 24);\n }\n return _word;\n};\n\nconst incCounter = (counter) => {\n const _counter = counter;\n _counter[0] = incWord(_counter[0]);\n\n if (_counter[0] === 0) {\n // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8\n _counter[1] = incWord(_counter[1]);\n }\n return _counter;\n};\n\n/** @preserve\n * Counter block mode compatible with Dr Brian Gladman fileenc.c\n * derived from CryptoJS.mode.CTR\n * Jan Hruby jhruby.web@gmail.com\n */\nexport class CTRGladman extends BlockCipherMode {\n}\nCTRGladman.Encryptor = class extends CTRGladman {\n processBlock(words, offset) {\n const _words = words;\n\n // Shortcuts\n const cipher = this._cipher;\n const { blockSize } = cipher;\n const iv = this._iv;\n let counter = this._counter;\n\n // Generate keystream\n if (iv) {\n this._counter = iv.slice(0);\n counter = this._counter;\n\n // Remove IV for subsequent blocks\n this._iv = undefined;\n }\n\n incCounter(counter);\n\n const keystream = counter.slice(0);\n cipher.encryptBlock(keystream, 0);\n\n // Encrypt\n for (let i = 0; i < blockSize; i += 1) {\n _words[offset + i] ^= keystream[i];\n }\n }\n};\nCTRGladman.Decryptor = CTRGladman.Encryptor;\n","/**\n * Electronic Codebook block mode.\n */\nimport {\n BlockCipherMode,\n} from './cipher-core.js';\n\nexport class ECB extends BlockCipherMode {\n}\nECB.Encryptor = class extends ECB {\n processBlock(words, offset) {\n this._cipher.encryptBlock(words, offset);\n }\n};\nECB.Decryptor = class extends ECB {\n processBlock(words, offset) {\n this._cipher.decryptBlock(words, offset);\n }\n};\n","/**\n * Output Feedback block mode.\n */\nimport {\n BlockCipherMode,\n} from './cipher-core.js';\n\nexport class OFB extends BlockCipherMode {\n}\nOFB.Encryptor = class extends OFB {\n processBlock(words, offset) {\n const _words = words;\n\n // Shortcuts\n const cipher = this._cipher;\n const { blockSize } = cipher;\n const iv = this._iv;\n let keystream = this._keystream;\n\n // Generate keystream\n if (iv) {\n this._keystream = iv.slice(0);\n keystream = this._keystream;\n\n // Remove IV for subsequent blocks\n this._iv = undefined;\n }\n cipher.encryptBlock(keystream, 0);\n\n // Encrypt\n for (let i = 0; i < blockSize; i += 1) {\n _words[offset + i] ^= keystream[i];\n }\n }\n};\nOFB.Decryptor = OFB.Encryptor;\n","/**\n * ANSI X.923 padding strategy.\n */\nexport const AnsiX923 = {\n pad(data, blockSize) {\n const _data = data;\n\n // Shortcuts\n const dataSigBytes = _data.sigBytes;\n const blockSizeBytes = blockSize * 4;\n\n // Count padding bytes\n const nPaddingBytes = blockSizeBytes - (dataSigBytes % blockSizeBytes);\n\n // Compute last byte position\n const lastBytePos = dataSigBytes + nPaddingBytes - 1;\n\n // Pad\n _data.clamp();\n _data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);\n _data.sigBytes += nPaddingBytes;\n },\n\n unpad(data) {\n const _data = data;\n\n // Get number of padding bytes from last byte\n const nPaddingBytes = _data.words[(_data.sigBytes - 1) >>> 2] & 0xff;\n\n // Remove padding\n _data.sigBytes -= nPaddingBytes;\n },\n};\n","import {\n WordArray,\n} from './core.js';\n\n/**\n * ISO 10126 padding strategy.\n */\nexport const Iso10126 = {\n pad(data, blockSize) {\n // Shortcut\n const blockSizeBytes = blockSize * 4;\n\n // Count padding bytes\n const nPaddingBytes = blockSizeBytes - (data.sigBytes % blockSizeBytes);\n\n // Pad\n data\n .concat(WordArray.random(nPaddingBytes - 1))\n .concat(WordArray.create([nPaddingBytes << 24], 1));\n },\n\n unpad(data) {\n const _data = data;\n // Get number of padding bytes from last byte\n const nPaddingBytes = _data.words[(_data.sigBytes - 1) >>> 2] & 0xff;\n\n // Remove padding\n _data.sigBytes -= nPaddingBytes;\n },\n};\n","/**\n * Zero padding strategy.\n */\nexport const ZeroPadding = {\n pad(data, blockSize) {\n const _data = data;\n\n // Shortcut\n const blockSizeBytes = blockSize * 4;\n\n // Pad\n _data.clamp();\n _data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);\n },\n\n unpad(data) {\n const _data = data;\n\n // Shortcut\n const dataWords = _data.words;\n\n // Unpad\n for (let i = _data.sigBytes - 1; i >= 0; i -= 1) {\n if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {\n _data.sigBytes = i + 1;\n break;\n }\n }\n },\n};\n","import {\n WordArray,\n} from './core.js';\nimport {\n ZeroPadding,\n} from './pad-zeropadding.js';\n\n/**\n * ISO/IEC 9797-1 Padding Method 2.\n */\nexport const Iso97971 = {\n pad(data, blockSize) {\n // Add 0x80 byte\n data.concat(WordArray.create([0x80000000], 1));\n\n // Zero pad the rest\n ZeroPadding.pad(data, blockSize);\n },\n\n unpad(data) {\n const _data = data;\n\n // Remove zero padding\n ZeroPadding.unpad(_data);\n\n // Remove one more byte -- the 0x80 byte\n _data.sigBytes -= 1;\n },\n};\n","import {\n CipherParams,\n} from './cipher-core.js';\nimport {\n Hex,\n} from './core.js';\n\nexport const HexFormatter = {\n /**\n * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.\n *\n * @param {CipherParams} cipherParams The cipher params object.\n *\n * @return {string} The hexadecimally encoded string.\n *\n * @static\n *\n * @example\n *\n * var hexString = CryptoJS.format.Hex.stringify(cipherParams);\n */\n stringify(cipherParams) {\n return cipherParams.ciphertext.toString(Hex);\n },\n\n /**\n * Converts a hexadecimally encoded ciphertext string to a cipher params object.\n *\n * @param {string} input The hexadecimally encoded string.\n *\n * @return {CipherParams} The cipher params object.\n *\n * @static\n *\n * @example\n *\n * var cipherParams = CryptoJS.format.Hex.parse(hexString);\n */\n parse(input) {\n const ciphertext = Hex.parse(input);\n return CipherParams.create({ ciphertext });\n },\n};\n","import {\n Base,\n WordArray,\n Hex,\n Latin1,\n Utf8,\n BufferedBlockAlgorithm,\n Hasher,\n} from './core.js';\nimport {\n X64Word,\n X64WordArray,\n} from './x64-core.js';\nimport {\n Cipher,\n StreamCipher,\n BlockCipherMode,\n CBC,\n Pkcs7,\n BlockCipher,\n CipherParams,\n OpenSSLFormatter,\n SerializableCipher,\n OpenSSLKdf,\n PasswordBasedCipher,\n} from './cipher-core.js';\n\nimport { Utf16, Utf16BE, Utf16LE } from './enc-utf16.js';\nimport { Base64 } from './enc-base64.js';\nimport { HMAC } from './hmac.js';\nimport { MD5Algo, MD5, HmacMD5 } from './md5.js';\nimport { SHA1Algo, SHA1, HmacSHA1 } from './sha1.js';\nimport { SHA224Algo, SHA224, HmacSHA224 } from './sha224.js';\nimport { SHA256Algo, SHA256, HmacSHA256 } from './sha256.js';\nimport { SHA384Algo, SHA384, HmacSHA384 } from './sha384.js';\nimport { SHA512Algo, SHA512, HmacSHA512 } from './sha512.js';\nimport { SHA3Algo, SHA3, HmacSHA3 } from './sha3.js';\nimport { RIPEMD160Algo, RIPEMD160, HmacRIPEMD160 } from './ripemd160.js';\nimport { PBKDF2Algo, PBKDF2 } from './pbkdf2.js';\nimport { EvpKDFAlgo, EvpKDF } from './evpkdf.js';\nimport { AESAlgo, AES } from './aes.js';\nimport {\n DESAlgo,\n DES,\n TripleDESAlgo,\n TripleDES,\n} from './tripledes.js';\nimport { RabbitAlgo, Rabbit } from './rabbit.js';\nimport { RabbitLegacyAlgo, RabbitLegacy } from './rabbit-legacy.js';\nimport {\n RC4Algo,\n RC4,\n RC4DropAlgo,\n RC4Drop,\n} from './rc4.js';\nimport { CFB } from './mode-cfb.js';\nimport { CTR } from './mode-ctr.js';\nimport { CTRGladman } from './mode-ctr-gladman.js';\nimport { ECB } from './mode-ecb.js';\nimport { OFB } from './mode-ofb.js';\nimport { AnsiX923 } from './pad-ansix923.js';\nimport { Iso10126 } from './pad-iso10126.js';\nimport { Iso97971 } from './pad-iso97971.js';\nimport { NoPadding } from './pad-nopadding.js';\nimport { ZeroPadding } from './pad-zeropadding.js';\nimport { HexFormatter } from './format-hex.js';\n\nexport default {\n lib: {\n Base,\n WordArray,\n BufferedBlockAlgorithm,\n Hasher,\n Cipher,\n StreamCipher,\n BlockCipherMode,\n BlockCipher,\n CipherParams,\n SerializableCipher,\n PasswordBasedCipher,\n },\n\n x64: {\n Word: X64Word,\n WordArray: X64WordArray,\n },\n\n enc: {\n Hex,\n Latin1,\n Utf8,\n Utf16,\n Utf16BE,\n Utf16LE,\n Base64,\n },\n\n algo: {\n HMAC,\n MD5: MD5Algo,\n SHA1: SHA1Algo,\n SHA224: SHA224Algo,\n SHA256: SHA256Algo,\n SHA384: SHA384Algo,\n SHA512: SHA512Algo,\n SHA3: SHA3Algo,\n RIPEMD160: RIPEMD160Algo,\n\n PBKDF2: PBKDF2Algo,\n EvpKDF: EvpKDFAlgo,\n\n AES: AESAlgo,\n DES: DESAlgo,\n TripleDES: TripleDESAlgo,\n Rabbit: RabbitAlgo,\n RabbitLegacy: RabbitLegacyAlgo,\n RC4: RC4Algo,\n RC4Drop: RC4DropAlgo,\n },\n\n mode: {\n CBC,\n CFB,\n CTR,\n CTRGladman,\n ECB,\n OFB,\n },\n\n pad: {\n Pkcs7,\n AnsiX923,\n Iso10126,\n Iso97971,\n NoPadding,\n ZeroPadding,\n },\n\n format: {\n OpenSSL: OpenSSLFormatter,\n Hex: HexFormatter,\n },\n\n kdf: {\n OpenSSL: OpenSSLKdf,\n },\n\n MD5,\n HmacMD5,\n SHA1,\n HmacSHA1,\n SHA224,\n HmacSHA224,\n SHA256,\n HmacSHA256,\n SHA384,\n HmacSHA384,\n SHA512,\n HmacSHA512,\n SHA3,\n HmacSHA3,\n RIPEMD160,\n HmacRIPEMD160,\n\n PBKDF2,\n EvpKDF,\n\n AES,\n DES,\n TripleDES,\n Rabbit,\n RabbitLegacy,\n RC4,\n RC4Drop,\n};\n","/**\n * A noop padding strategy.\n */\nexport const NoPadding = {\n pad() {\n },\n\n unpad() {\n },\n};\n","import { Injectable } from '@angular/core';\r\nimport * as CryptoJS from 'crypto-es';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\n@Injectable()\r\nexport class EncryptionService {\r\n\r\n keySize = 256;\r\n salt = CryptoJS.default.lib.WordArray.random(16);\r\n iv = CryptoJS.default.lib.WordArray.random(128 / 8);\r\n private privateKey = '%DaQGi3E1$3Z';\r\n // well known algorithm to generate key\r\n key = CryptoJS.default.PBKDF2(this.privateKey, this.salt, {\r\n keySize: this.keySize / 32,\r\n iterations: 100\r\n });\r\n\r\n constructor(private apiRef: ApiProviderService) {\r\n this.privateKey += this.apiRef.vDir.split('/').join(''); // acts as replace all because IE doesn't support replaceAll\r\n }\r\n\r\n // For angular onbly encryption/decryption\r\n encryptObjRabbit(obj: any): string {\r\n const value = JSON.stringify(obj);\r\n const encryptedString = CryptoJS.default.Rabbit.encrypt(value, this.privateKey).toString();\r\n return encryptedString;\r\n }\r\n\r\n decryptObjRabbit(value: string): any {\r\n if (value === '') {\r\n return '';\r\n }\r\n\r\n const bytes = CryptoJS.default.Rabbit.decrypt(value, this.privateKey);\r\n const decryptedData = JSON.parse(bytes.toString(CryptoJS.default.enc.Utf8));\r\n return decryptedData;\r\n }\r\n\r\n // for encrypting to the .NET API\r\n encryptObjAes(obj: any): string {\r\n const value = JSON.stringify(obj);\r\n return this.encryptAes(value);\r\n }\r\n\r\n encryptAes(value: string) {\r\n const encrypted = CryptoJS.default.AES.encrypt(value, this.key, {\r\n iv: this.iv,\r\n padding: CryptoJS.default.pad.Pkcs7,\r\n mode: CryptoJS.default.mode.CBC\r\n });\r\n // combine everything together in base64 string\r\n const result = CryptoJS.default.enc.Base64.stringify(this.salt.concat(this.iv).concat(encrypted.ciphertext));\r\n return result;\r\n }\r\n\r\n // decryptAes(value: string): any {\r\n // const decode = (str: string):string => Buffer.from(str, 'base64').toString('binary');\r\n // let bytes = decode(value) ;\r\n // bytes = bytes.substring(16,bytes.length-1); //remove salt\r\n // bytes = bytes.substring(16,bytes.length-1); //remove iv\r\n\r\n // var decrypted = CryptoJS.default.AES.decrypt(bytes, this.key, {\r\n // iv: this.iv,\r\n // padding: CryptoJS.default.pad.Pkcs7,\r\n // mode: CryptoJS.default.mode.CBC\r\n // });\r\n // var decryptedData = decrypted.toString();\r\n // return decryptedData;\r\n\r\n // // var decryptedData = JSON.parse(bytes.toString(CryptoJS.default.enc.Utf8));\r\n // // return decryptedData;\r\n // }\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpErrorResponse } from '@angular/common/http';\r\nimport { throwError } from 'rxjs';\r\n\r\n@Injectable()\r\n\r\nexport class HttpErrorHandler {\r\n\r\n constructor() { }\r\n\r\n public handleError(error: HttpErrorResponse) {\r\n let errorMessage;\r\n if (error.error instanceof ErrorEvent) {\r\n // client-side error\r\n errorMessage = error.message;\r\n } else {\r\n // server-side error\r\n //**Localization - Need to fix\r\n errorMessage = $localize`We are experiencing technical difficulties. Please try again later or contact the Agency for assistance.`;\r\n }\r\n\r\n return throwError(errorMessage);\r\n }\r\n}\r\n","import { HttpHeaders, HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class LocalizationService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'text');\r\n this.headers.append('Accept', 'text');\r\n this.apiServer = 'api/LabelKey/';\r\n }\r\n\r\n getDefaultLabelByKey(labelKey: string): Observable {\r\n return this.http.get(\r\n this.apiRef.getApiUrl(`${this.apiServer}defaultLabel`, [{Key: 'labelKey', Value: labelKey}]), {responseType: 'text'})\r\n .pipe(map((result) => result));\r\n }\r\n\r\n getLabelByKey(labelKey: string): Observable {\r\n return this.http.get(\r\n this.apiRef.getApiUrl(`${this.apiServer}label`, [{Key: 'key', Value: labelKey}]), {responseType: 'text'})\r\n .pipe(map((result) => result));\r\n }\r\n\r\n getHtmlText(labelKey: string, module: string): Observable {\r\n return this.http.get(\r\n this.apiRef.getApiUrl(`${this.apiServer}GetHtmlText`,\r\n [{Key: 'key', Value: labelKey},{Key: 'module', Value: module}]), {responseType: 'text'})\r\n .pipe(map((result) => result));\r\n }\r\n}\r\n","export class StringKeyValue{\r\n Key: string;\r\n Value: string;\r\n}","import { Injectable } from '@angular/core';\r\nimport { ActivatedRoute, Router } from '@angular/router';\r\nimport { catchError, map, switchMap } from 'rxjs/operators';\r\nimport { Store } from '@ngrx/store';\r\nimport { AppState } from 'src/app/app.state';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { addAppSettings } from 'src/app/state/actions/app-settings.actions';\r\nimport { selectAppSettings } from 'src/app/state/selectors/app-settings.selectors';\r\nimport { AppSettings } from '../model/appSettings.model';\r\nimport { StringKeyValue } from '../model/stringKeyValue.model';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class NavigationService {\r\n\r\n appSettings: AppSettings;\r\n\r\n constructor(public activatedRoute: ActivatedRoute, private router: Router,private apiRef: ApiProviderService,\r\n private store: Store) {\r\n this.store.select(selectAppSettings)\r\n .subscribe({\r\n next: state => {\r\n if(state) {\r\n this.appSettings = state;\r\n }\r\n }});\r\n }\r\n\r\n isEmbedModeActive(): boolean {\r\n const embedInUrl = (this.activatedRoute.snapshot.queryParamMap.get('Embed') === 'true') || false;\r\n if(embedInUrl && this.appSettings) {\r\n this.appSettings.embedMode = true;\r\n this.store.dispatch(\r\n addAppSettings(this.appSettings)\r\n );\r\n } else {\r\n return embedInUrl;\r\n }\r\n return this.appSettings?.embedMode;\r\n }\r\n\r\n navigateNewTab(url: string, target: string = '_blank'){\r\n url = this.checkUrlParams(url);\r\n const win = this.getWindowReference();\r\n\r\n win.open(url, target); //'/account/register-termsofuse'\r\n }\r\n\r\n navigate(url: string): void {\r\n const isModernTheme = this.isEmbedModeActive();\r\n\r\n const win = this.getWindowReference();\r\n //Adding Embed param in url\r\n if (isModernTheme) {\r\n const idx = url.indexOf('?');\r\n url = url + ((idx < 0) ? '?' : '&') + 'Embed=true';\r\n }\r\n win.location.href = url;\r\n }\r\n\r\n getHomePageUrl(): string{\r\n const isModernTheme = this.isEmbedModeActive();\r\n if(isModernTheme){\r\n return 'Welcome.aspx';\r\n }\r\n return'Default.aspx';\r\n }\r\n\r\n\r\n navigateLegacyPage(url: string){\r\n url = this.checkUrlParams(url);\r\n const win = this.getWindowReference();\r\n win.location.href = url;\r\n }\r\n\r\n navigateRoute(url: string, params?: Array): void {\r\n const embedded = this.activatedRoute.snapshot.queryParamMap.get('inLegacyUI') === 'true' || false;\r\n const isModernTheme = this.isEmbedModeActive();\r\n\r\n if (embedded) {\r\n const win = window.parent;\r\n if(!params){\r\n params = new Array();\r\n }\r\n\r\n if(isModernTheme && !params.find(kvp=>(kvp.Key==='Embed'))){\r\n const svp = new StringKeyValue();\r\n svp.Key = 'Embed';\r\n svp.Value = 'true';\r\n\r\n params.unshift(svp);\r\n }\r\n let paramString = '';\r\n params.forEach(kvp => {\r\n paramString += '&' +kvp.Key +'='+ kvp.Value;\r\n });\r\n url += paramString.replace('&','?');//replaces first instance of & only\r\n win.location.href = this.apiRef.vDir+ 'CommunityView/' + url;\r\n } else {\r\n url = '/'+url;\r\n if(params){\r\n this.router.navigate([url, params.map(kvp => kvp.Key + '=' + kvp.Value)]);\r\n } else {\r\n this.router.navigate([url]);\r\n }\r\n }\r\n }\r\n\r\n checkUrlParams(url: string): string{\r\n url = this.apiRef.vDir + url;\r\n const isModernTheme = this.isEmbedModeActive();\r\n\r\n //Adding Embed param in url\r\n if (isModernTheme) {\r\n const idx = url.indexOf('?');\r\n url = url + ((idx < 0) ? '?' : '&') + 'Embed=true';\r\n }\r\n\r\n if(this.activatedRoute.snapshot.queryParamMap.get('OpenCities')){\r\n url += `&OpenCities=true`;\r\n }\r\n\r\n return url;\r\n }\r\n\r\n getWindowReference(): Window{\r\n const embedded = this.activatedRoute.snapshot.queryParamMap.get('inLegacyUI') === 'true' || false;\r\n let win = this.apiRef.nativeWindow;\r\n if (embedded) {\r\n win = window.parent;\r\n }\r\n return win;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { RegionalMasksDto } from 'src/app/modules/shared/model/regionalMasksDto.model';\r\nimport { SelectItem } from 'primeng/api';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class RegionalSettingsService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/RegionalSettings/';\r\n }\r\n\r\n /// Get a list of available countries for the related dropdown\r\n getCountryList(): Observable> {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getCountryList`)).pipe(map(res => res as string[]));\r\n }\r\n\r\n getRegionalMasks(region: string): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}getRegionalData`, [{Key: 'region', Value: region.toUpperCase()}]))\r\n .pipe(map((resp: any)=>{\r\n if(resp.Region){\r\n return ({\r\n Region: region,\r\n Phone: resp.Region.phoneNumMask,\r\n PhoneMask: this.getMask(resp.Region.phoneNumMask),\r\n Zip: resp.Region.zipCodeMask,\r\n ZipMask: this.getMask(resp.Region.zipCodeMask),\r\n States: this.getStates(resp.Province)\r\n }) as RegionalMasksDto;\r\n } else{\r\n return ({\r\n Region: region,\r\n Phone: null,\r\n PhoneMask: null,\r\n Zip: null,\r\n ZipMask: null,\r\n States: this.getStates(resp.Province)\r\n }) as RegionalMasksDto;\r\n }\r\n }));\r\n }\r\n\r\n getMask(mask: string){\r\n return mask.split('#').join('9')\r\n .split('A').join('a')\r\n .split('*').join('*')\r\n .split('[').join('')\r\n .split(']').join('');\r\n }\r\n\r\n getStates(states: any): Array {\r\n const arry = states as Array;\r\n let options: Array = new Array();\r\n Object.keys(arry).forEach(s => {\r\n options.push({ label: s, value: s });\r\n });\r\n return options;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { ValidatorFn, AbstractControl, ValidationErrors } from '@angular/forms';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AccelaTextValidators {\r\n\r\n private readonly EMAIL_REGEXP =\r\n // eslint-disable-next-line max-len\r\n /^(?=.{1,254}$)(?=.{1,64}@)[\\w+_-]+(?:\\.[\\w+_-]+)*@[\\w+_-](?:[\\w+_-\\s]{0,61}\\w)?(?:\\.[\\w](?:[\\w]{0,61}\\w)?)+$/;\r\n\r\n\r\n emailValidate(): ValidatorFn {\r\n return (control: AbstractControl): ValidationErrors | null => {\r\n const value: string = control.value;\r\n\r\n if (!value || value.length === 0) {\r\n return null; // don't validate empty values to allow optional controls\r\n }\r\n return this.EMAIL_REGEXP.test(value) ? null : { email: true };\r\n };\r\n }\r\n\r\n\r\n}\r\n\r\n","import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';\r\nimport { Injectable, Renderer2, RendererFactory2 } from '@angular/core';\r\nimport { AbstractControl, FormGroup, UntypedFormGroup, Validators } from '@angular/forms';\r\nimport { Observable } from 'rxjs';\r\nimport { map, catchError } from 'rxjs/operators';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { TemplateAttributeModel } from 'src/app/model/templateattributemodel.model';\r\nimport { AccelaControl, AccelaControlType } from 'src/app/modules/shared/model/accelaControl.model';\r\nimport { RegionalMasksDto } from 'src/app/modules/shared/model/regionalMasksDto.model';\r\nimport { SimpleViewElement } from 'src/app/modules/shared/model/simpleViewElement.model';\r\nimport { DropdownValueService } from './dropdown-value-service.service';\r\nimport { RegionalSettingsService } from './regional-settings.service';\r\nimport { HttpErrorHandler } from 'src/app/modules/shared/services/error-handler.service';\r\nimport { ExpressionResponse } from 'src/app/modules/shared/model/expressions.model';\r\nimport { SelectItem } from 'primeng/api';\r\nimport { isStringNullOrWhiteSpace } from 'src/app/util/StringUtil';\r\nimport { StringKeyValue } from 'src/app/modules/shared/model/stringKeyValue.model';\r\nimport { PasswordRequirementValidators } from 'src/app/validators/passwordRequirment.validator';\r\nimport { AccelaTextValidators } from 'src/app/validators/accelaText.validator';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class PageLayoutService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string; //GetSimpleViewElements\r\n private renderer: Renderer2;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService, rendererFactory: RendererFactory2,\r\n private dropdownValueRepo: DropdownValueService, private regionalService: RegionalSettingsService,\r\n private passwordValidator: PasswordRequirementValidators, private emailValidator: AccelaTextValidators,\r\n private errorHandler: HttpErrorHandler ) {\r\n this.renderer = rendererFactory.createRenderer(null, null);\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/PageLayout/';\r\n }\r\n\r\n getSimpleViewElements(viewId: string, module: string): Observable> {\r\n const httpParams = new HttpParams()\r\n .set('ViewId', viewId)\r\n .set('Module', module);\r\n return this.http.get>(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetSimpleViewElements`),\r\n { headers: this.headers, params: httpParams })\r\n .pipe(catchError(this.errorHandler.handleError));\r\n\r\n }\r\n\r\n getSimpleViewElementsWithPermissions(viewId: string, module: string, permissionLevel: string, permissionValue: string, callerId: string):\r\n Observable> {\r\n const httpParams = new HttpParams()\r\n .set('ViewId', viewId)\r\n .set('Module', module)\r\n .set('PermissionLevel', permissionLevel)\r\n .set('PermissionValue', permissionValue)\r\n .set('CallerId', callerId);\r\n\r\n return this.http.get>(this.apiRef.getApiUrl(`${this.apiServer}GetSimpleViewElements`),\r\n { headers: this.headers, params: httpParams })\r\n .pipe(catchError(this.errorHandler.handleError));\r\n\r\n }\r\n\r\n getDynamicFormData(\r\n viewId: string, module: string, permissionLevel: string, permissionValue: string, callerId: string): Observable> {\r\n const httpParams = new HttpParams()\r\n .set('ViewId', viewId)\r\n .set('Module', module)\r\n .set('PermissionLevel', permissionLevel)\r\n .set('PermissionValue', permissionValue)\r\n .set('CallerId', callerId);\r\n\r\n return this.http.get>(this.apiRef.getApiUrl(`${this.apiServer}GetDynamicFormData`),\r\n { headers: this.headers, params: httpParams })\r\n .pipe(catchError(this.errorHandler.handleError));\r\n\r\n }\r\n\r\n saveUpdatedControl(controlData: AccelaControl, module: string, viewId: string){\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}UpdateControlContentProperties`,\r\n [{Key: 'module', Value: module},\r\n {Key: 'viewId', Value:viewId}])\r\n ,{ headers: this.headers, body: controlData })\r\n .pipe(map(json => json as boolean));\r\n }\r\n\r\n saveUpdatedControlProperties(controlData: AccelaControl[], module: string, viewId: string,\r\n permissionLevel: string = '', permissionValue: string =''){\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}UpdateControlFieldProperties`,\r\n [{Key: 'module', Value: module},\r\n {Key: 'viewId', Value:viewId},\r\n {Key: 'permissionLevel', Value: permissionLevel},\r\n {Key: 'permissionValue', Value: permissionValue}])\r\n ,{ headers: this.headers, body: controlData })\r\n .pipe(map(json => json as boolean));\r\n }\r\n\r\n saveUpdatedSection(htmlText: string, key: string,viewId: string, module: string,\r\n permissionLevel: string = '', permissionValue: string =''){\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}UpdateSectionContent`,\r\n [{Key: 'contentKey', Value: key},\r\n {Key: 'viewId', Value:viewId},\r\n {Key: 'module', Value: module},\r\n {Key: 'permissionLevel', Value: permissionLevel},\r\n {Key: 'permissionValue', Value: permissionValue}]),\r\n {content: htmlText}, { headers: this.headers})\r\n .pipe(map(json => json as boolean));\r\n }\r\n\r\n saveLabelArray(labels: StringKeyValue[], viewId: string, module: string, permissionLevel: string = '', permissionValue: string =''){\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}SaveLabelArray`,\r\n [{Key: 'viewId', Value:viewId},\r\n {Key: 'module', Value: module},\r\n {Key: 'permissionLevel', Value: permissionLevel},\r\n {Key: 'permissionValue', Value: permissionValue}]),\r\n {content: labels}, { headers: this.headers})\r\n .pipe(map(json => json as boolean));\r\n }\r\n\r\n processAccelaControl(controlData: AccelaControl, abstractControl: AbstractControl, ddlValue?: string) {\r\n\r\n if (controlData.optionKey === 'Subdivision') {\r\n\r\n if (controlData.type === AccelaControlType.Dropdown) {\r\n abstractControl.controlData = controlData;\r\n if (!controlData.options || controlData.options.length === 0) {\r\n this.dropdownValueRepo.getDropdownValueFun(controlData.name, controlData.optionKey).subscribe(res => {\r\n if ((!isStringNullOrWhiteSpace(ddlValue))) {\r\n if (res.findIndex(i => i.value === ddlValue) < 0) {\r\n res.push({ label: ddlValue, value: ddlValue });\r\n }\r\n }\r\n\r\n controlData.options = res;\r\n });\r\n }\r\n }\r\n } else {\r\n\r\n abstractControl.controlData = controlData;\r\n //Fetch dropdown options\r\n if(controlData.type === AccelaControlType.Blocked){\r\n abstractControl.clearValidators();\r\n return;\r\n } else if(controlData.type === AccelaControlType.Dropdown || controlData.type === AccelaControlType.RadioGroup){\r\n if (!controlData.options || controlData.options.length === 0) {\r\n if (controlData.name.includes('ddlQuestion') && !controlData.name.includes('ddlQuestionForDaily') ) {\r\n this.dropdownValueRepo.getDropdownValueFun('ddlQuestion', controlData.optionKey).subscribe(res => {\r\n controlData.options = res;\r\n });\r\n }\r\n else {\r\n this.dropdownValueRepo.getDropdownValueFun(controlData.name, controlData.optionKey).subscribe(res => {\r\n controlData.options = res;\r\n });\r\n }\r\n }\r\n\r\n }else if (controlData.type === AccelaControlType.Email) {\r\n if (abstractControl.validator) {\r\n abstractControl.setValidators([abstractControl.validator, this.emailValidator.emailValidate()]);\r\n } else { /* if no validators added already */\r\n abstractControl.setValidators([this.emailValidator.emailValidate()]);\r\n }\r\n abstractControl.updateValueAndValidity();\r\n } else if(controlData.type === AccelaControlType.Password && controlData.name.toLowerCase() === 'txbpassword1'){\r\n abstractControl.setAsyncValidators([this.passwordValidator.validate()]);\r\n }\r\n\r\n //RegionControllers are dropdowns that change localized masks when the value changes\r\n if (controlData.optionKey === 'RegionController') {\r\n abstractControl.valueChanges.subscribe(res => {\r\n this.updateRegionalMasks(abstractControl, res);\r\n });\r\n }\r\n }\r\n\r\n if (controlData.required) {\r\n if (abstractControl.validator) {\r\n abstractControl.setValidators([abstractControl.validator, Validators.required]);\r\n } else { /* if no validators added already */\r\n abstractControl.setValidators([Validators.required]);\r\n }\r\n abstractControl.updateValueAndValidity();\r\n }\r\n }\r\n\r\n updateRegionalMasks(abstractControl: AbstractControl, region: string) {\r\n if (abstractControl.parent == null) {\r\n return;\r\n }\r\n\r\n if (region) {\r\n this.regionalService.getRegionalMasks(region).pipe(map(regionalData => {\r\n Object.keys(abstractControl.parent.controls).forEach(key => {\r\n const frm = (abstractControl.parent as UntypedFormGroup);\r\n const ctrl = frm.get(key);\r\n if (ctrl.controlData) {\r\n switch (ctrl.controlData.type) {\r\n case AccelaControlType.Zip:\r\n const zipVal = ctrl.value;\r\n ctrl.controlData.mask = regionalData.ZipMask ?? ctrl.controlData.mask;\r\n if (zipVal) {\r\n ctrl.controlData.value = zipVal;\r\n setTimeout(() => {\r\n ctrl.setValue(zipVal);\r\n }, 0);\r\n }\r\n break;\r\n case AccelaControlType.Phone:\r\n const phoneVal = ctrl.value;\r\n ctrl.controlData.mask = regionalData.PhoneMask ?? ctrl.controlData.mask;\r\n if (phoneVal) {\r\n ctrl.controlData.value = phoneVal;\r\n setTimeout(() => {\r\n ctrl.setValue(phoneVal);\r\n }, 0);\r\n }\r\n break;\r\n case AccelaControlType.Dropdown:\r\n case AccelaControlType.Textbox:\r\n if (ctrl.controlData.name == 'txtState' || ctrl.controlData.name == 'ddlAppState' || ctrl.controlData.name == 'txtAppState') {\r\n const stateVal = ctrl.value;\r\n const arry = regionalData.States as Array;\r\n if (arry.length !== 0) {\r\n ctrl.controlData.type = AccelaControlType.Dropdown;\r\n ctrl.controlData.options = arry;\r\n if (stateVal) {\r\n ctrl.patchValue(stateVal);\r\n }\r\n } else {\r\n ctrl.controlData.type = AccelaControlType.Textbox;\r\n if (stateVal) {\r\n ctrl.setValue(stateVal);\r\n }\r\n }\r\n\r\n }\r\n default:\r\n break;\r\n }\r\n }\r\n });\r\n })).subscribe();\r\n }\r\n }\r\n\r\n getAPOTemplateData(type: number): Promise {\r\n const httpParams = new HttpParams()\r\n .set('Type', type.toString());\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetOriginalTemplateData`), { headers: this.headers, params: httpParams })\r\n .pipe(map((result) => (result as TemplateAttributeModel[])\r\n )).toPromise();\r\n }\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable, pipe } from 'rxjs';\r\nimport { catchError, map } from 'rxjs/operators';\r\nimport { OwnerModel } from 'src/app/model/ownerModel.model';\r\nimport { ParcelModel } from 'src/app/model/parcelModel.model';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { AddressModel } from '../model/addressModel.model';\r\nimport { HttpErrorHandler } from './error-handler.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SessionCapModelService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService, private errorHandler: HttpErrorHandler) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/CapModel/';\r\n }\r\n\r\n saveAddressesToCapModel(addresses: Array, module: string): Observable{\r\n const headers = { 'content-type': 'application/json' };\r\n const body = JSON.stringify(addresses);\r\n return this.http.post(this.apiRef\r\n .getApiUrl(`${this.apiServer}SaveAddressesToCapModel`,[{Key:'module', Value:module}]), body, { headers })\r\n .pipe(map(resp => resp.toString()))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n getAddressesFromCapModel(module: string): Observable> {\r\n return this.http.get(this.apiRef\r\n .getApiUrl(`${this.apiServer}GetAddressesFromCapModel`,[{Key:'module', Value:module}])).pipe(map(resp => {\r\n resp = JSON.parse(resp.toString());\r\n if(resp && resp!=='null'){\r\n return resp as Array;\r\n } else {\r\n return new Array();\r\n }\r\n }))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n saveParcelsToCapModel(addresses: Array, module: string): Observable{\r\n const headers = { 'content-type': 'application/json' };\r\n const body = JSON.stringify(addresses);\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}SaveParcelsToCapModel`,[{Key:'module', Value:module}]), body, { headers })\r\n .pipe(map(resp => resp.toString()))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n getParcelsFromCapModel(module: string): Observable> {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetParcelsFromCapModel`,[{Key:'module', Value:module}])).pipe(map(resp => {\r\n resp = JSON.parse(resp.toString());\r\n if(resp && resp!=='null'){\r\n return resp as Array;\r\n } else {\r\n return new Array();\r\n }\r\n }))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n\r\n }\r\n\r\n saveOwnersToCapModel(addresses: Array, module: string): Observable{\r\n const headers = { 'content-type': 'application/json' };\r\n const body = JSON.stringify(addresses);\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}SaveOwnersToCapModel`,[{Key:'module', Value:module}]), body, { headers })\r\n .pipe(map(resp => resp.toString()))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n getOwnersFromCapModel(module: string): Observable> {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetOwnersFromCapModel`,[{Key:'module', Value:module}])).pipe(map(resp => {\r\n resp = JSON.parse(resp.toString());\r\n if(resp && resp!=='null'){\r\n return resp as Array;\r\n } else {\r\n return new Array();\r\n }\r\n }))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n\r\n }\r\n\r\n}\r\n","import { HttpHeaders, HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable, of } from 'rxjs';\r\nimport { catchError, map, switchMap } from 'rxjs/operators';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { LoginSettingsResponse } from 'src/app/modules/shared/model/loginSettingsResponse.model';\r\nimport { RecaptchaSettings } from 'src/app/modules/shared/model/recaptchaSettings.model';\r\nimport { HttpErrorHandler } from 'src/app/modules/shared/services/error-handler.service';\r\nimport { StringKeyValue } from '../model/stringKeyValue.model';\r\nimport { ApiResponse } from 'src/app/model/apiResponse.model';\r\nimport { Store } from '@ngrx/store';\r\nimport { AppState } from 'src/app/app.state';\r\nimport { selectAppSettings } from 'src/app/state/selectors/app-settings.selectors';\r\nimport { addAppSettings } from 'src/app/state/actions/app-settings.actions';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SettingService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n loginSettings: LoginSettingsResponse;\r\n recaptcha: RecaptchaSettings;\r\n isLicenseRequiredForAccount: boolean = null;\r\n enableCustomizationPerPage: boolean = null;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService, private errorHandler: HttpErrorHandler,\r\n private store: Store) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/Settings/';\r\n }\r\n\r\n getLoginSettings(): Observable {\r\n if (this.loginSettings) {\r\n return of(this.loginSettings);\r\n }\r\n\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetLoginSettings`))\r\n .pipe(map((result) => {\r\n this.loginSettings = result as LoginSettingsResponse;\r\n return this.loginSettings;\r\n }))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n\r\n }\r\n\r\n isContactAddressEnabled(): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetIsContactAddressSetting`)).pipe(map((result) => result as boolean));\r\n }\r\n\r\n isRegistrationEnabled(): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetRegistrationEnabledSetting`)).pipe(map((result) => result as boolean));\r\n }\r\n\r\n getRecaptchaSettings(): Observable {\r\n if (this.recaptcha) {\r\n return of(this.recaptcha);\r\n }\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}GetRecaptchaInfo`))\r\n .pipe(map((result) => {\r\n this.recaptcha = result as RecaptchaSettings;\r\n return this.recaptcha;\r\n }))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n isXAPOAgency(): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}IsXAPOAgency`))\r\n .pipe(map((result) => result as boolean))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n }\r\n\r\n getLicenseTypes(): Observable {\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}licenseTypes`))\r\n .pipe(map((res) => res.result as StringKeyValue[]));\r\n }\r\n\r\n isLicenseRequiredForRegistration(): Observable {\r\n if (this.isLicenseRequiredForAccount == null) {\r\n\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}configValue`,\r\n [{Key: 'key', Value: 'registrationIsLicenseReq'}]))\r\n .pipe(map((res) => {\r\n const result = res.result?.isLicenseRequiredForRegistration as boolean;\r\n return result;\r\n }));\r\n } else {\r\n return of(this.isLicenseRequiredForAccount);\r\n }\r\n }\r\n\r\n isEnableCustomizationPerPage(): Observable {\r\n if (this.enableCustomizationPerPage == null) {\r\n\r\n return this.http.get(this.apiRef.getApiUrl(`${this.apiServer}configValue`,\r\n [{ Key: 'key', Value: 'customPageSettings' }]))\r\n .pipe(map((res) => {\r\n const result = res.result?.isEnableCustomizationPerPage as boolean;\r\n this.enableCustomizationPerPage = result;\r\n return result;\r\n }))\r\n .pipe(catchError(this.errorHandler.handleError));\r\n } else {\r\n return of(this.enableCustomizationPerPage);\r\n }\r\n }\r\n}\r\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, ContentChildren, ViewChild, NgModule } from '@angular/core';\nimport * as i2 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport * as i1 from 'primeng/api';\nimport { PrimeTemplate } from 'primeng/api';\nimport { ZIndexUtils } from 'primeng/utils';\nimport { DomHandler } from 'primeng/dom';\n\nclass BlockUI {\n constructor(el, cd, config) {\n this.el = el;\n this.cd = cd;\n this.config = config;\n this.autoZIndex = true;\n this.baseZIndex = 0;\n }\n get blocked() {\n return this._blocked;\n }\n set blocked(val) {\n if (this.mask && this.mask.nativeElement) {\n if (val)\n this.block();\n else\n this.unblock();\n }\n else {\n this._blocked = val;\n }\n }\n ngAfterViewInit() {\n if (this.target && !this.target.getBlockableElement) {\n throw 'Target of BlockUI must implement BlockableUI interface';\n }\n }\n ngAfterContentInit() {\n this.templates.forEach((item) => {\n switch (item.getType()) {\n case 'content':\n this.contentTemplate = item.template;\n break;\n default:\n this.contentTemplate = item.template;\n break;\n }\n });\n }\n block() {\n this._blocked = true;\n if (this.target) {\n this.target.getBlockableElement().appendChild(this.mask.nativeElement);\n this.target.getBlockableElement().style.position = 'relative';\n }\n else {\n document.body.appendChild(this.mask.nativeElement);\n }\n if (this.autoZIndex) {\n ZIndexUtils.set('modal', this.mask.nativeElement, this.baseZIndex + this.config.zIndex.modal);\n }\n }\n unblock() {\n this.animationEndListener = this.destroyModal.bind(this);\n this.mask.nativeElement.addEventListener('animationend', this.animationEndListener);\n DomHandler.addClass(this.mask.nativeElement, 'p-component-overlay-leave');\n }\n destroyModal() {\n this._blocked = false;\n DomHandler.removeClass(this.mask.nativeElement, 'p-component-overlay-leave');\n ZIndexUtils.clear(this.mask.nativeElement);\n this.el.nativeElement.appendChild(this.mask.nativeElement);\n this.unbindAnimationEndListener();\n this.cd.markForCheck();\n }\n unbindAnimationEndListener() {\n if (this.animationEndListener && this.mask) {\n this.mask.nativeElement.removeEventListener('animationend', this.animationEndListener);\n this.animationEndListener = null;\n }\n }\n ngOnDestroy() {\n this.unblock();\n this.destroyModal();\n }\n}\nBlockUI.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: BlockUI, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.PrimeNGConfig }], target: i0.ɵɵFactoryTarget.Component });\nBlockUI.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"14.0.7\", type: BlockUI, selector: \"p-blockUI\", inputs: { target: \"target\", autoZIndex: \"autoZIndex\", baseZIndex: \"baseZIndex\", styleClass: \"styleClass\", blocked: \"blocked\" }, host: { classAttribute: \"p-element\" }, queries: [{ propertyName: \"templates\", predicate: PrimeTemplate }], viewQueries: [{ propertyName: \"mask\", first: true, predicate: [\"mask\"], descendants: true }], ngImport: i0, template: `\n \n \n \n
\n `, isInline: true, styles: [\".p-blockui{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;transition-property:background-color;display:flex;align-items:center;justify-content:center}.p-blockui.p-component-overlay{position:absolute}.p-blockui-document.p-component-overlay{position:fixed}.p-blockui-leave.p-component-overlay{background-color:transparent}\\n\"], dependencies: [{ kind: \"directive\", type: i2.NgClass, selector: \"[ngClass]\", inputs: [\"class\", \"ngClass\"] }, { kind: \"directive\", type: i2.NgTemplateOutlet, selector: \"[ngTemplateOutlet]\", inputs: [\"ngTemplateOutletContext\", \"ngTemplateOutlet\", \"ngTemplateOutletInjector\"] }, { kind: \"directive\", type: i2.NgStyle, selector: \"[ngStyle]\", inputs: [\"ngStyle\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: BlockUI, decorators: [{\n type: Component,\n args: [{ selector: 'p-blockUI', template: `\n \n \n \n
\n `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {\n class: 'p-element'\n }, styles: [\".p-blockui{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;transition-property:background-color;display:flex;align-items:center;justify-content:center}.p-blockui.p-component-overlay{position:absolute}.p-blockui-document.p-component-overlay{position:fixed}.p-blockui-leave.p-component-overlay{background-color:transparent}\\n\"] }]\n }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.PrimeNGConfig }]; }, propDecorators: { target: [{\n type: Input\n }], autoZIndex: [{\n type: Input\n }], baseZIndex: [{\n type: Input\n }], styleClass: [{\n type: Input\n }], templates: [{\n type: ContentChildren,\n args: [PrimeTemplate]\n }], mask: [{\n type: ViewChild,\n args: ['mask']\n }], blocked: [{\n type: Input\n }] } });\nclass BlockUIModule {\n}\nBlockUIModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: BlockUIModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nBlockUIModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"14.0.7\", ngImport: i0, type: BlockUIModule, declarations: [BlockUI], imports: [CommonModule], exports: [BlockUI] });\nBlockUIModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: BlockUIModule, imports: [CommonModule] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: BlockUIModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [CommonModule],\n exports: [BlockUI],\n declarations: [BlockUI]\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { BlockUI, BlockUIModule };\n","import * as i0 from '@angular/core';\nimport { forwardRef, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, NgModule } from '@angular/core';\nimport * as i1 from '@angular/common';\nimport { CommonModule } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nconst INPUTSWITCH_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => InputSwitch),\n multi: true\n};\nclass InputSwitch {\n constructor(cd) {\n this.cd = cd;\n this.trueValue = true;\n this.falseValue = false;\n this.onChange = new EventEmitter();\n this.modelValue = false;\n this.focused = false;\n this.onModelChange = () => { };\n this.onModelTouched = () => { };\n }\n onClick(event, cb) {\n if (!this.disabled && !this.readonly) {\n event.preventDefault();\n this.toggle(event);\n cb.focus();\n }\n }\n onInputChange(event) {\n if (!this.readonly) {\n const inputChecked = event.target.checked;\n this.updateModel(event, inputChecked);\n }\n }\n toggle(event) {\n this.updateModel(event, !this.checked());\n }\n updateModel(event, value) {\n this.modelValue = value ? this.trueValue : this.falseValue;\n this.onModelChange(this.modelValue);\n this.onChange.emit({\n originalEvent: event,\n checked: this.modelValue\n });\n }\n onFocus(event) {\n this.focused = true;\n }\n onBlur(event) {\n this.focused = false;\n this.onModelTouched();\n }\n writeValue(value) {\n this.modelValue = value;\n this.cd.markForCheck();\n }\n registerOnChange(fn) {\n this.onModelChange = fn;\n }\n registerOnTouched(fn) {\n this.onModelTouched = fn;\n }\n setDisabledState(val) {\n this.disabled = val;\n this.cd.markForCheck();\n }\n checked() {\n return this.modelValue === this.trueValue;\n }\n}\nInputSwitch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: InputSwitch, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });\nInputSwitch.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"14.0.7\", type: InputSwitch, selector: \"p-inputSwitch\", inputs: { style: \"style\", styleClass: \"styleClass\", tabindex: \"tabindex\", inputId: \"inputId\", name: \"name\", disabled: \"disabled\", readonly: \"readonly\", trueValue: \"trueValue\", falseValue: \"falseValue\", ariaLabel: \"ariaLabel\", ariaLabelledBy: \"ariaLabelledBy\" }, outputs: { onChange: \"onChange\" }, host: { classAttribute: \"p-element\" }, providers: [INPUTSWITCH_VALUE_ACCESSOR], ngImport: i0, template: `\n \n `, isInline: true, styles: [\".p-inputswitch{position:relative;display:inline-block;-webkit-user-select:none;user-select:none}.p-inputswitch-slider{position:absolute;cursor:pointer;inset:0}.p-inputswitch-slider:before{position:absolute;content:\\\"\\\";top:50%}\\n\"], dependencies: [{ kind: \"directive\", type: i1.NgClass, selector: \"[ngClass]\", inputs: [\"class\", \"ngClass\"] }, { kind: \"directive\", type: i1.NgStyle, selector: \"[ngStyle]\", inputs: [\"ngStyle\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: InputSwitch, decorators: [{\n type: Component,\n args: [{ selector: 'p-inputSwitch', template: `\n \n `, providers: [INPUTSWITCH_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {\n class: 'p-element'\n }, styles: [\".p-inputswitch{position:relative;display:inline-block;-webkit-user-select:none;user-select:none}.p-inputswitch-slider{position:absolute;cursor:pointer;inset:0}.p-inputswitch-slider:before{position:absolute;content:\\\"\\\";top:50%}\\n\"] }]\n }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { style: [{\n type: Input\n }], styleClass: [{\n type: Input\n }], tabindex: [{\n type: Input\n }], inputId: [{\n type: Input\n }], name: [{\n type: Input\n }], disabled: [{\n type: Input\n }], readonly: [{\n type: Input\n }], trueValue: [{\n type: Input\n }], falseValue: [{\n type: Input\n }], ariaLabel: [{\n type: Input\n }], ariaLabelledBy: [{\n type: Input\n }], onChange: [{\n type: Output\n }] } });\nclass InputSwitchModule {\n}\nInputSwitchModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: InputSwitchModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nInputSwitchModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"14.0.7\", ngImport: i0, type: InputSwitchModule, declarations: [InputSwitch], imports: [CommonModule], exports: [InputSwitch] });\nInputSwitchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: InputSwitchModule, imports: [CommonModule] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: InputSwitchModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [CommonModule],\n exports: [InputSwitch],\n declarations: [InputSwitch]\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { INPUTSWITCH_VALUE_ACCESSOR, InputSwitch, InputSwitchModule };\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule } from '@angular/core';\nimport * as i1 from '@angular/common';\nimport { CommonModule } from '@angular/common';\n\nclass UIMessage {\n constructor() {\n this.escape = true;\n }\n get icon() {\n let icon = null;\n if (this.severity) {\n switch (this.severity) {\n case 'success':\n icon = 'pi pi-check';\n break;\n case 'info':\n icon = 'pi pi-info-circle';\n break;\n case 'error':\n icon = 'pi pi-times-circle';\n break;\n case 'warn':\n icon = 'pi pi-exclamation-triangle';\n break;\n default:\n icon = 'pi pi-info-circle';\n break;\n }\n }\n return icon;\n }\n}\nUIMessage.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: UIMessage, deps: [], target: i0.ɵɵFactoryTarget.Component });\nUIMessage.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"14.0.7\", type: UIMessage, selector: \"p-message\", inputs: { severity: \"severity\", text: \"text\", escape: \"escape\", style: \"style\", styleClass: \"styleClass\" }, host: { classAttribute: \"p-element\" }, ngImport: i0, template: `\n \n
\n
\n \n
\n
\n {{ text }} \n \n
\n `, isInline: true, styles: [\".p-inline-message{display:inline-flex;align-items:center;justify-content:center;vertical-align:top}.p-inline-message-icon-only .p-inline-message-text{visibility:hidden;width:0}.p-fluid .p-inline-message{display:flex}\\n\"], dependencies: [{ kind: \"directive\", type: i1.NgClass, selector: \"[ngClass]\", inputs: [\"class\", \"ngClass\"] }, { kind: \"directive\", type: i1.NgIf, selector: \"[ngIf]\", inputs: [\"ngIf\", \"ngIfThen\", \"ngIfElse\"] }, { kind: \"directive\", type: i1.NgStyle, selector: \"[ngStyle]\", inputs: [\"ngStyle\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: UIMessage, decorators: [{\n type: Component,\n args: [{ selector: 'p-message', template: `\n \n
\n
\n \n
\n
\n {{ text }} \n \n
\n `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {\n class: 'p-element'\n }, styles: [\".p-inline-message{display:inline-flex;align-items:center;justify-content:center;vertical-align:top}.p-inline-message-icon-only .p-inline-message-text{visibility:hidden;width:0}.p-fluid .p-inline-message{display:flex}\\n\"] }]\n }], propDecorators: { severity: [{\n type: Input\n }], text: [{\n type: Input\n }], escape: [{\n type: Input\n }], style: [{\n type: Input\n }], styleClass: [{\n type: Input\n }] } });\nclass MessageModule {\n}\nMessageModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: MessageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nMessageModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"14.0.7\", ngImport: i0, type: MessageModule, declarations: [UIMessage], imports: [CommonModule], exports: [UIMessage] });\nMessageModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: MessageModule, imports: [CommonModule] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: MessageModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [CommonModule],\n exports: [UIMessage],\n declarations: [UIMessage]\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { MessageModule, UIMessage };\n","import * as i0 from '@angular/core';\nimport { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule } from '@angular/core';\nimport * as i1 from '@angular/common';\nimport { CommonModule } from '@angular/common';\n\nclass ProgressSpinner {\n constructor() {\n this.strokeWidth = '2';\n this.fill = 'none';\n this.animationDuration = '2s';\n }\n}\nProgressSpinner.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: ProgressSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component });\nProgressSpinner.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: \"14.0.0\", version: \"14.0.7\", type: ProgressSpinner, selector: \"p-progressSpinner\", inputs: { style: \"style\", styleClass: \"styleClass\", strokeWidth: \"strokeWidth\", fill: \"fill\", animationDuration: \"animationDuration\" }, host: { classAttribute: \"p-element\" }, ngImport: i0, template: `\n \n \n \n \n
\n `, isInline: true, styles: [\".p-progress-spinner{position:relative;margin:0 auto;width:100px;height:100px;display:inline-block}.p-progress-spinner:before{content:\\\"\\\";display:block;padding-top:100%}.p-progress-spinner-svg{animation:p-progress-spinner-rotate 2s linear infinite;height:100%;transform-origin:center center;width:100%;position:absolute;inset:0;margin:auto}.p-progress-spinner-circle{stroke-dasharray:89,200;stroke-dashoffset:0;stroke:#d62d20;animation:p-progress-spinner-dash 1.5s ease-in-out infinite,p-progress-spinner-color 6s ease-in-out infinite;stroke-linecap:round}@keyframes p-progress-spinner-rotate{to{transform:rotate(360deg)}}@keyframes p-progress-spinner-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes p-progress-spinner-color{to,0%{stroke:#d62d20}40%{stroke:#0057e7}66%{stroke:#008744}80%,90%{stroke:#ffa700}}\\n\"], dependencies: [{ kind: \"directive\", type: i1.NgClass, selector: \"[ngClass]\", inputs: [\"class\", \"ngClass\"] }, { kind: \"directive\", type: i1.NgStyle, selector: \"[ngStyle]\", inputs: [\"ngStyle\"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: ProgressSpinner, decorators: [{\n type: Component,\n args: [{ selector: 'p-progressSpinner', template: `\n \n \n \n \n
\n `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {\n class: 'p-element'\n }, styles: [\".p-progress-spinner{position:relative;margin:0 auto;width:100px;height:100px;display:inline-block}.p-progress-spinner:before{content:\\\"\\\";display:block;padding-top:100%}.p-progress-spinner-svg{animation:p-progress-spinner-rotate 2s linear infinite;height:100%;transform-origin:center center;width:100%;position:absolute;inset:0;margin:auto}.p-progress-spinner-circle{stroke-dasharray:89,200;stroke-dashoffset:0;stroke:#d62d20;animation:p-progress-spinner-dash 1.5s ease-in-out infinite,p-progress-spinner-color 6s ease-in-out infinite;stroke-linecap:round}@keyframes p-progress-spinner-rotate{to{transform:rotate(360deg)}}@keyframes p-progress-spinner-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:89,200;stroke-dashoffset:-35px}to{stroke-dasharray:89,200;stroke-dashoffset:-124px}}@keyframes p-progress-spinner-color{to,0%{stroke:#d62d20}40%{stroke:#0057e7}66%{stroke:#008744}80%,90%{stroke:#ffa700}}\\n\"] }]\n }], propDecorators: { style: [{\n type: Input\n }], styleClass: [{\n type: Input\n }], strokeWidth: [{\n type: Input\n }], fill: [{\n type: Input\n }], animationDuration: [{\n type: Input\n }] } });\nclass ProgressSpinnerModule {\n}\nProgressSpinnerModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: ProgressSpinnerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });\nProgressSpinnerModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"14.0.7\", ngImport: i0, type: ProgressSpinnerModule, declarations: [ProgressSpinner], imports: [CommonModule], exports: [ProgressSpinner] });\nProgressSpinnerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: ProgressSpinnerModule, imports: [CommonModule] });\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"14.0.7\", ngImport: i0, type: ProgressSpinnerModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [CommonModule],\n exports: [ProgressSpinner],\n declarations: [ProgressSpinner]\n }]\n }] });\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { ProgressSpinner, ProgressSpinnerModule };\n","import { HttpHeaders, HttpClient } from '@angular/common/http';\r\nimport { Injectable } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { ApiProviderService } from 'src/app/services/api-provider.service';\r\nimport { PeopleModel } from '../model/peopleModel.model';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SearchService {\r\n\r\n headers: HttpHeaders;\r\n apiServer: string;\r\n\r\n constructor(private http: HttpClient, private apiRef: ApiProviderService) {\r\n this.headers = new HttpHeaders();\r\n this.headers.append('Content-Type', 'application/json');\r\n this.headers.append('Accept', 'application/json');\r\n this.apiServer = 'api/GlobalSearch/';\r\n }\r\n\r\n getContactSuggestionsFromDatabase(searchData): Observable>{\r\n const body = searchData;\r\n return this.http.post(this.apiRef.getApiUrl(`${this.apiServer}GetContactSuggestionsFromDatabase`), body)\r\n .pipe(map(resp => {\r\n resp = JSON.parse(resp.toString());\r\n if(resp && resp!=='null'){\r\n return resp as Array;\r\n } else {\r\n return new Array();\r\n }\r\n }));\r\n\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { NgModule } from '@angular/core';\r\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\r\nimport { ButtonModule } from 'primeng/button';\r\nimport {BlockUIModule} from 'primeng/blockui';\r\nimport { CalendarModule } from 'primeng/calendar';\r\nimport { CaptchaModule } from 'primeng/captcha';\r\nimport { CheckboxModule } from 'primeng/checkbox';\r\nimport { DialogModule } from 'primeng/dialog';\r\nimport { DropdownModule } from 'primeng/dropdown';\r\nimport { EditorModule } from 'primeng/editor';\r\nimport { InputMaskModule } from 'primeng/inputmask';\r\nimport {InputNumberModule} from 'primeng/inputnumber';\r\nimport { InputSwitchModule } from 'primeng/inputswitch';\r\nimport { InputTextModule } from 'primeng/inputtext';\r\nimport { MessageModule } from 'primeng/message';\r\nimport { MessagesModule } from 'primeng/messages';\r\nimport {OverlayPanelModule} from 'primeng/overlaypanel';\r\nimport { PasswordModule } from 'primeng/password';\r\nimport {ProgressSpinnerModule} from 'primeng/progressspinner';\r\nimport { RadioButtonModule } from 'primeng/radiobutton';\r\nimport { ScrollPanelModule } from 'primeng/scrollpanel';\r\nimport {SidebarModule} from 'primeng/sidebar';\r\nimport { TableModule } from 'primeng/table';\r\nimport { ToastModule } from 'primeng/toast';\r\nimport { TooltipModule } from 'primeng/tooltip';\r\nimport { CookieService } from 'ngx-cookie-service';\r\nimport { AccelaCheckboxInputComponent } from './components/accela-checkbox-input/accela-checkbox-input.component';\r\nimport { AccelaDateInputComponent } from './components/accela-date-input/accela-date-input.component';\r\nimport { AccelaDropdownInputComponent } from './components/accela-dropdown-input/accela-dropdown-input.component';\r\nimport { AccelaEmailInputComponent } from './components/accela-email-input/accela-email-input.component';\r\nimport { AccelaFEINInputComponent } from './components/accela-fein-input/accela-fein-input.component';\r\nimport { AccelaPasswordInputComponent } from './components/accela-password-input/accela-password-input.component';\r\nimport { AccelaPhoneInputComponent } from './components/accela-phone-input/accela-phone-input.component';\r\nimport { AccelaSeparatorComponent } from './components/accela-separator/accela-separator.component';\r\nimport { AccelaSsnInputComponent } from './components/accela-ssn-input/accela-ssn-input.component';\r\nimport { AccelaTextInputComponent } from './components/accela-text-input/accela-text-input.component';\r\nimport { AccelaZipInputComponent } from './components/accela-zip-input/accela-zip-input.component';\r\nimport { AlertMessageComponent } from './components/alert-message/alert-message.component';\r\nimport { FormDebuggerComponent } from './components/form-debugger/form-debugger.component';\r\nimport { PageLayoutDisplayComponent } from './components/page-layout-display/page-layout-display.component';\r\nimport { AccelaSearchBoxInputComponent } from './components/accela-search-box-input/accela-search-box-input.component';\r\nimport { AccelaButtonPrimaryComponent } from './components/accela-button-primary/accela-button-primary.component';\r\nimport { AccelaButtonCreateComponent } from './components/accela-button-create/accela-button-create.component';\r\nimport { AccelaButtonSecondaryComponent } from './components/accela-button-secondary/accela-button-secondary.component';\r\nimport { AccelaButtonDeleteComponent } from './components/accela-button-delete/accela-button-delete.component';\r\nimport { ContactTypeSelectComponent } from './components/contact-type-select/contact-type-select.component';\r\nimport { AccelaRadioGroupComponent } from './components/accela-radio-group/accela-radio-group.component';\r\nimport { TrustHtmlPipe } from 'src/app/pipes/trustHtml.pipe';\r\nimport { SessionCapModelService } from './services/session-cap-model.service';\r\nimport { SearchService } from './services/search.service';\r\nimport { HttpErrorHandler } from './services/error-handler.service';\r\nimport { AccelaNumberInputComponent } from './components/accela-number-input/accela-number-input.component';\r\nimport { AdminPageLayoutComponent } from './components/admin-page-layout/admin-page-layout.component';\r\nimport { SectionTitleComponent } from './components/section-title/section-title.component';\r\nimport { ConditionBadgeComponent } from './components/condition-badge/condition-badge.component';\r\nimport { AAExpressionService } from './services/aaexpression-service.service';\r\nimport { ProgressSpinnerComponent } from './components/progress-spinner/progress-spinner.component';\r\nimport { SectionInstructionsComponent } from './components/section-instructions/section-instructions.component';\r\nimport { SearchPageLayoutComponent } from './components/search-page-layout/search-page-layout.component';\r\nimport { AccelaTooltipDirective } from 'src/app/directives/accela-tooltip.directive';\r\nimport { AccelaTimepickerInputComponent } from './components/accela-timepicker-input/accela-timepicker-input.component';\r\nimport { AccelaTextareaInputComponent } from './components/accela-textarea-input/accela-textarea-input.component';\r\nimport { AccelaMoneyInputComponent } from './components/accela-money-input/accela-money-input.component';\r\nimport { SharedDataService } from 'src/app/services/shared-data-service.service';\r\nimport { CustomScriptInjectionService } from './services/custom-script-injection.service';\r\nimport { InputTrimDirective } from 'src/app/directives/input-trim.directive';\r\n\r\n@NgModule({\r\n declarations: [\r\n AccelaCheckboxInputComponent,\r\n AccelaDateInputComponent,\r\n AccelaDropdownInputComponent,\r\n AccelaEmailInputComponent,\r\n AccelaFEINInputComponent,\r\n AccelaNumberInputComponent,\r\n AccelaPasswordInputComponent,\r\n AccelaPhoneInputComponent,\r\n AccelaSeparatorComponent,\r\n AccelaSsnInputComponent,\r\n AccelaTextInputComponent,\r\n AccelaZipInputComponent,\r\n AdminPageLayoutComponent,\r\n AlertMessageComponent,\r\n AccelaSearchBoxInputComponent,\r\n AccelaButtonPrimaryComponent,\r\n AccelaButtonCreateComponent,\r\n AccelaButtonSecondaryComponent,\r\n AccelaButtonDeleteComponent,\r\n AccelaRadioGroupComponent,\r\n ConditionBadgeComponent,\r\n ContactTypeSelectComponent,\r\n FormDebuggerComponent,\r\n PageLayoutDisplayComponent,\r\n ProgressSpinnerComponent,\r\n SearchPageLayoutComponent,\r\n SectionInstructionsComponent,\r\n SectionTitleComponent,\r\n TrustHtmlPipe,\r\n AccelaTooltipDirective,\r\n AccelaTimepickerInputComponent,\r\n AccelaTextareaInputComponent,\r\n AccelaMoneyInputComponent,\r\n InputTrimDirective,\r\n ],\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n ReactiveFormsModule,\r\n ButtonModule,\r\n BlockUIModule,\r\n CalendarModule,\r\n CaptchaModule,\r\n CheckboxModule,\r\n DialogModule,\r\n DropdownModule,\r\n EditorModule,\r\n InputMaskModule,\r\n InputNumberModule,\r\n InputSwitchModule,\r\n InputTextModule,\r\n MessageModule,\r\n MessagesModule,\r\n OverlayPanelModule,\r\n PasswordModule,\r\n ProgressSpinnerModule,\r\n RadioButtonModule,\r\n ScrollPanelModule,\r\n SidebarModule,\r\n TableModule,\r\n ToastModule,\r\n TooltipModule,\r\n ],\r\n exports: [\r\n AccelaButtonPrimaryComponent,\r\n AccelaButtonSecondaryComponent,\r\n AccelaButtonCreateComponent,\r\n AccelaButtonSecondaryComponent,\r\n AccelaButtonDeleteComponent,\r\n AccelaCheckboxInputComponent,\r\n AccelaDateInputComponent,\r\n AccelaDropdownInputComponent,\r\n AccelaEmailInputComponent,\r\n AccelaFEINInputComponent,\r\n AccelaPasswordInputComponent,\r\n AccelaPhoneInputComponent,\r\n AccelaSeparatorComponent,\r\n AccelaSsnInputComponent,\r\n AccelaTextInputComponent,\r\n AccelaRadioGroupComponent,\r\n AccelaSearchBoxInputComponent,\r\n AccelaZipInputComponent,\r\n AccelaTimepickerInputComponent,\r\n AccelaTextareaInputComponent,\r\n AdminPageLayoutComponent,\r\n AlertMessageComponent,\r\n ConditionBadgeComponent,\r\n ContactTypeSelectComponent,\r\n FormDebuggerComponent,\r\n PageLayoutDisplayComponent,\r\n ProgressSpinnerComponent,\r\n SearchPageLayoutComponent,\r\n SectionInstructionsComponent,\r\n SectionTitleComponent,\r\n AccelaTooltipDirective,\r\n TrustHtmlPipe,\r\n InputTrimDirective\r\n ],\r\n providers: [\r\n AAExpressionService,\r\n CookieService,\r\n CustomScriptInjectionService,\r\n SearchService,\r\n SessionCapModelService,\r\n SharedDataService,\r\n HttpErrorHandler,\r\n ]\r\n})\r\nexport class SharedModule{}\r\n","import { Component, EventEmitter, Input, OnInit, Output, OnDestroy } from '@angular/core';\r\nimport { CaptchaModule } from 'primeng/captcha';\r\nimport { MessageService } from 'primeng/api';\r\nimport { takeUntil } from 'rxjs/operators';\r\nimport { Subject } from 'rxjs';\r\nimport { AccountService } from 'src/app/modules/shared/services/account.service';\r\n\r\n@Component({\r\n selector: 'aca-recaptcha',\r\n templateUrl: './recaptcha.component.html',\r\n styleUrls: ['./recaptcha.component.css']\r\n})\r\nexport class RecaptchaComponent implements OnInit, OnDestroy {\r\n @Input() RecaptchaPublicKey: string;\r\n @Output() verifyUser = new EventEmitter(true);\r\n\r\n /// \r\n /// Defines wether the control should be rendered as 'normal' or 'compact'\r\n /// \r\n SizeMode = 'compact';\r\n protected destroyActions = new Subject();\r\n\r\n constructor(private accountService: AccountService, private messageService: MessageService) { }\r\n\r\n ngOnInit(): void {\r\n }\r\n\r\n showResponse(response) {\r\n this.accountService.verifyCaptchaData(response.response)\r\n .pipe(takeUntil(this.destroyActions))\r\n .subscribe((s => {\r\n this.verifyUser.emit(s.success);\r\n return s;\r\n })\r\n ,error => {\r\n this.messageService.add({\r\n severity: 'error',\r\n summary: error,\r\n closable: false\r\n });\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.destroyActions.next();\r\n this.destroyActions.complete();\r\n }\r\n}\r\n","","export class ContactAddressModel{\r\n\r\n\r\n /// \r\n addressLine1: string;\r\n\r\n /// \r\n addressLine2: string;\r\n\r\n /// \r\n addressLine3: string;\r\n\r\n /// \r\n addressType: string;\r\n\r\n /// \r\n //auditModel: SimpleAuditModel;\r\n\r\n /// \r\n city: string;\r\n\r\n /// \r\n //contactAddressPK: ContactAddressPKModel;\r\n\r\n /// \r\n countryCode: string;\r\n\r\n /// \r\n effectiveDate: Date;\r\n\r\n /// \r\n entityID: number;\r\n\r\n /// \r\n entityType: string;\r\n\r\n /// \r\n expirationDate: Date;\r\n\r\n /// \r\n fax: string;\r\n\r\n /// \r\n faxCountryCode: string;\r\n\r\n /// \r\n fullAddress: string;\r\n\r\n /// \r\n houseNumberEnd: number;\r\n\r\n /// \r\n houseNumberStart: number;\r\n\r\n /// \r\n orderBy: string;\r\n\r\n /// \r\n phone: string;\r\n\r\n /// \r\n phoneCountryCode: string;\r\n\r\n /// \r\n primary: string;\r\n\r\n /// \r\n recipient: string;\r\n\r\n /// \r\n state: string;\r\n\r\n /// \r\n streetDirection: string;\r\n\r\n /// \r\n streetName: string;\r\n\r\n /// \r\n streetPrefix: '';\r\n\r\n /// \r\n streetSuffix: string;\r\n\r\n /// \r\n streetSuffixDirection: string;\r\n\r\n /// \r\n unitEnd: string;\r\n\r\n /// \r\n unitStart: string;\r\n\r\n /// \r\n unitType: string;\r\n\r\n /// \r\n zip: string;\r\n\r\n /// \r\n levelPrefix: string;\r\n\r\n /// \r\n levelNumberStart: string;\r\n\r\n /// \r\n levelNumberEnd: string;\r\n\r\n /// \r\n houseNumberAlphaStart: string;\r\n\r\n /// \r\n houseNumberAlphaEnd: string;\r\n\r\n /// \r\n replaceAddressID: number;\r\n\r\n /// \r\n validateFlag: string;\r\n}\r\n","export class CompactAddressModel {\r\n addressId: string;\r\n\r\n addressLine1: string;\r\n\r\n addressLine2: string;\r\n\r\n addressLine3: string;\r\n\r\n city: string;\r\n\r\n country: string;\r\n\r\n countryCode: string;\r\n\r\n countryZip: string;\r\n\r\n resState: string;\r\n\r\n state: string;\r\n\r\n streetName: string;\r\n\r\n zip: string;\r\n}\r\n","import { CompactAddressModel } from './compactAddressModel.model';\r\nimport { ContactAddressModel } from './contactAddressModel.model';\r\n\r\nexport class ContactModel {\r\n id: number;\r\n Type: string;\r\n\r\n contactTypeFlag: string;\r\n preferredChannel: string;\r\n email: string;\r\n\r\n salutation: string;\r\n businessName: string;\r\n businessName2: string;\r\n fein: string;\r\n deceasedDate: Date;\r\n firstName: string;\r\n middleName: string;\r\n lastName: string;\r\n fullName: string;\r\n nameSuffix: string;\r\n title: string;\r\n\r\n genderIdentity: string;\r\n ethnicity: string;\r\n\r\n socialSecurityNumber: string;\r\n stateIdNumber: string;\r\n passportNumber: string;\r\n\r\n tradeName: string;\r\n\r\n countryCode: string;\r\n phone1: string;\r\n phone2: string;\r\n phone3: string;\r\n fax: string;\r\n\r\n addressLine1: string;\r\n addressLine2: string;\r\n addressLine3: string;\r\n\r\n birthCity: string;\r\n birthDate: Date;\r\n birthState: string;\r\n birthRegion: string;\r\n\r\n driverLicenseNbr: string;\r\n driverLicenseState: string;\r\n\r\n postOfficeBox: string;\r\n\r\n comment: string;\r\n contactSeqNumber: string;\r\n primaryAddressFlag: boolean;\r\n auditStatus: string;\r\n\r\n zip: string;\r\n\r\n rowIndex: number;\r\n\r\n Addresses: ContactAddressModel[] = new Array();\r\n CompactAddress: CompactAddressModel = new CompactAddressModel();\r\n}\r\n","import { AppState } from '../../app.state';\r\n\r\n\r\nexport const selectAccountSubmission = (state: AppState) => state.PublicUserAccount;\r\n\r\n","import { ContactModel } from './contactModel.model';\r\nimport { License } from './license.model';\r\nimport { QuestionModel } from './questionModel.model';\r\n\r\n\r\nexport class PublicAccountSubmission {\r\n Username: string;\r\n Password: string;\r\n ConfirmPassword: string; // TODO: Needed server-side?\r\n SecurityQuestion: string;\r\n SecurityAnswer: string;\r\n Email: string;\r\n PhoneNumber: string;\r\n PermissionToSendSMSMsgs: boolean;\r\n Contacts: ContactModel[] = new Array();\r\n licenseLinks: License[] = new Array();\r\n Questions: QuestionModel[] = new Array();\r\n}\r\n","