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EVO,GAAQ,GACVV,EAAI6G,OAAOnG,EAAO,GAItB,IAAKH,EAAO,CACV,MAAMG,EAAIV,EAAI+F,UAAUnF,GACA,UAAfA,EAAKT,OAEVO,GAAI,GACNV,EAAI6G,OAAQnG,EAAG,GAInBM,KAAK8F,YAAc9G,EAGrB6D,cACE7C,KAAK8C,eAAeC,OACpB/C,KAAK8C,eAAeE,WAGtB+C,gBAAgB/G,GACIgB,KAAKqE,OAAOC,KAAK0B,IAAsB,CACvDpF,KAAM,CAACgB,KAAM5C,4CA/KNiH,GAAsBnG,4DAAtBmG,EAAsB9C,+pCDfnCrD,iBACEA,iBACEA,gBAAiBA,8BAAkBA,QACnCA,aACEA,qGACAA,kBAAQA,SAAeA,QAAUA,oLAEnCA,QACAA,aAAGA,gCAAgBA,cAAGA,wEAA2DA,QAAKA,gDAA+BA,QACrHA,qBAA6CA,gCAASV,kBAAgB,UAASU,mBAA2CA,sCAAwBA,QAElJA,wBAGAA,iCACAA,iCAEAA,wBAGAA,iCAuDFA,QACFA,eAvEcA,4BAMJA,kCAGSA,iCACAA,+BAETA,qFAGSA,6LEJZ,MAAMoG,EAAS,CACpB,CAACC,KAAM,GAAIC,UAAWH,EAAwBI,UAAW,SAsBpD,SACEC,SAASJ,wCADLI,4DAdF,CACPC,KACAC,cAAsBN,GACtBO,KACAC,IACAlF,KACAmF,KACAC,KACAC,KACAC,IACA5D,KACA6D","names":["N","o","t","Object","values","value","i","n","forEach","a","Array","length","s","filter","c","allFieldsRequired","e","constructor","this","v","formBuilder","array","ngOnInit","communicationForm","group","emails","emailList","phoneNumbers","mobileList","validator","data","config","clear","addEmail","push","email","mobilePhoneNumbers","mobile","addMobile","patchValue","createEmail","createMobile","l","test","germanMobileNumber","onSubmit","type","active","map","trim","communicationRestService","saveConfig","idf","subscribe","errorCode","dialogRef","close","success","onCancel","reset","removeEmail","removeAt","removeMobile","ngOnDestroy","ngUnsubscribe$","next","complete","p","d","selectors","label","tooltip","TRACK_TRACE","ESARE","PAYBACK","ONLINE_OFFERS","userService","loadAllIdfs","pharmacies","selectedIdf","getUserTypes","getConfigs","configs","returnObject","configStatus","openDialog","getSelectedConfig","dialog","open","width","console","log","afterClosed","message","ref","toArray","m","findIndex","u","error","types","find","id","checked","changeConfig","disable","selectPharmacy","isConfigActive","assign","paybackType","esare","splice","pharmaTypes","openVideoDialog","F","b","Z","path","component","pathMatch","g","f","P","h","K","j","$","T","C","A"],"sources":["webpack:///src/app/core/validators/all-fields-empty.validator.ts","webpack:///src/app/modules/account/components/communication/communication-dialog/communication-dialog.component.html","webpack:///src/app/modules/account/components/communication/communication-dialog/communication-dialog.component.ts","webpack:///src/app/core/validators/german-mobile-naumber.validator.ts","webpack:///src/app/modules/account/components/communication/communication.component.html","webpack:///src/app/modules/account/components/communication/communication.component.ts","webpack:///src/app/modules/account/components/communication/communication.module.ts"],"sourcesContent":["import {ValidatorFn, FormGroup, ValidationErrors} from '@angular/forms';\n\nexport const allFieldsEmpty: ValidatorFn = (formGroup: FormGroup): ValidationErrors | null => {\n const values = Object.values(formGroup.value);\n let hasEmptyFields = false;\n let empty = 0;\n values.forEach(value => {\n if (value instanceof Array) {\n if (value.length === 0) {\n } else if (value.length === 1) {\n if (value[0] instanceof Object) {\n const vals = Object.values(value[0]).filter(val => val !== '' && val !== null && val !== undefined);\n if (vals && vals.length === 0) {\n empty++;\n }\n } else if (!value[0]) {\n empty++;\n }\n } else {\n const vals = Object.values(value[0]).filter(val => val !== '' && val !== null && val !== undefined);\n if (vals && vals.length === 0) {\n empty++;\n }\n }\n }\n });\n\n hasEmptyFields = values.length === empty;\n return hasEmptyFields ? {allFieldsRequired: true} : null;\n};\n","

Abonnement {{ data['type'].label }}

\n\n

Geben Sie hier eine oder mehrere Kontaktdaten an.

\n\n
\n
\n
\n \n
\n
\n
\n \n E-Mail Adresse\n \n z.B. max@muster.de\n Bitte Eingabe prüfen\n \n \n
\n
\n \n Weitere E-Mail Adresse hinzufügen\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n Mobilfunknummer\n \n z. B. 01xxxxxxxx or +491xxxxxxxxxx\n Bitte Eingabe prüfen\n \n \n
\n
\n \n Weitere Nummer hinzufügen\n
\n
\n
\n
\n \n \n
\n
\n","import {Component, Inject, OnDestroy, OnInit} from '@angular/core';\nimport {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';\nimport {FormBuilder, Validators} from '@angular/forms';\nimport {CommunicationRestService} from '../../../../../core/services/api/communication.rest-service';\nimport {DialogData} from '../../../../../core/interfaces/dialog-data.interface';\nimport {GermanMobileNumberValidator} from '../../../../../core/validators/german-mobile-naumber.validator';\nimport {allFieldsEmpty} from '../../../../../core/validators/all-fields-empty.validator';\nimport {Subject} from 'rxjs';\n\n@Component({\n selector: 'app-communication-dialog',\n templateUrl: './communication-dialog.component.html',\n styleUrls: ['./communication-dialog.component.scss']\n})\nexport class CommunicationDialogComponent implements OnInit, OnDestroy {\n public ngUnsubscribe$: Subject = new Subject();\n emailList = this.formBuilder.array([]);\n mobileList = this.formBuilder.array([]);\n communicationForm;\n\n constructor(\n public dialogRef: MatDialogRef,\n private formBuilder: FormBuilder,\n private communicationRestService: CommunicationRestService,\n @Inject(MAT_DIALOG_DATA) public data: DialogData\n ) {\n }\n\n ngOnInit() {\n this.communicationForm = this.formBuilder.group({\n emails: this.emailList,\n phoneNumbers: this.mobileList\n }, { validator: allFieldsEmpty });\n if (this.data['config']) {\n this.emailList.clear();\n this.mobileList.clear();\n const selected = this.data['config'];\n const formData = {emails: [], phoneNumbers: []};\n\n for (const email of selected.emails) {\n this.addEmail();\n formData.emails.push({email: email});\n }\n\n for (const mobile of selected.mobilePhoneNumbers) {\n formData.phoneNumbers.push({mobile: mobile});\n this.addMobile();\n }\n\n if (selected.emails.length === 0) {\n this.addEmail();\n }\n\n if (selected.mobilePhoneNumbers.length === 0) {\n this.addMobile();\n }\n\n this.communicationForm.patchValue(formData);\n } else {\n this.emailList.push(this.createEmail());\n this.mobileList.push(this.createMobile());\n }\n }\n\n createEmail() {\n return this.formBuilder.group({email: ['', Validators.email]});\n }\n\n createMobile() {\n return this.formBuilder.group({mobile: ['', GermanMobileNumberValidator()]});\n }\n\n addEmail() {\n this.emailList.push(this.createEmail());\n }\n\n addMobile() {\n this.mobileList.push(this.createMobile());\n }\n\n onSubmit() {\n const values = this.communicationForm.value;\n values['type'] = this.data['type'].value;\n values['active'] = true;\n values['emails'] = values['emails'].map(val => {\n return val.email;\n });\n values['phoneNumbers'] = values['phoneNumbers'].map(val => {\n return val.mobile;\n });\n values['emails'] = values['emails'].filter(entry => entry.trim() !== '');\n values['phoneNumbers'] = values['phoneNumbers'].filter(entry => entry.trim() !== '');\n\n if (!(values['emails'].length === 0 && values['phoneNumbers'].length === 0)) {\n this.communicationRestService.saveConfig(this.data['idf'], values).subscribe(result => {\n if (!result.errorCode) {\n this.dialogRef.close({success: true, config: values});\n }\n });\n }\n }\n\n onCancel() {\n this.dialogRef.close({success: false, errorCode: null});\n this.communicationForm.reset();\n }\n\n removeEmail(i: number) {\n this.emailList.removeAt(i);\n }\n\n removeMobile(i: number) {\n this.mobileList.removeAt(i);\n }\n\n ngOnDestroy(): void {\n this.ngUnsubscribe$.next();\n this.ngUnsubscribe$.complete();\n }\n}\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\n\nexport function GermanMobileNumberValidator(): ValidatorFn {\n return (control: AbstractControl): {[key: string]: any} | null => {\n const isGermanMobileNumber = /^(\\+49|0)[1-9][0-9]{6,10}$/.test(control.value);\n return (!control.value || isGermanMobileNumber) ? null : { 'germanMobileNumber': { value: control.value } };\n };\n}\n","
\n
\n

Benachrichtigungen

\n

\n Hier können Sie verschiedene Kommunikationskanäle auswählen und abonnieren, um\n {{ startDate }} Benachrichtigungen per Mail und/oder SMS zu den von Ihnen ausgewählten Themen\n zu erhalten. Die Abonnements können jederzeit geändert oder gelöscht werden.\n

\n

Ein 2-minütiges \"How to\"-Video \"So richte ich ein Benachrichtigungsabo ein\" können Sie sich hier anschauen:

\n \n\n
\n Laden...\n
\n \n \n\n
\n

Zur Zeit sind keine aktiven Impfstoffe verfügbar. Bitte versuchen Sie es später noch einmal.

\n
\n 0\">\n \n
\n
\n
\n \n
\n
\n
\n
\n
\n

Abonnements

\n
\n
\n

Abonnieren

\n
\n
\n

Kontaktdaten

\n
\n
\n
\n
\n

{{ type.label }}

\n
\n
\n
\n \n\n \n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n","import {Component, ElementRef, OnDestroy, OnInit, QueryList, ViewChildren} from '@angular/core';\nimport {UserService} from '../../../../core/services/user.service';\nimport {MatDialog} from '@angular/material/dialog';\nimport {CommunicationRestService} from '../../../../core/services/api/communication.rest-service';\nimport {ThemePalette} from '@angular/material/core';\nimport {CommunicationDialogComponent} from './communication-dialog/communication-dialog.component';\nimport {Subject} from 'rxjs';\nimport {takeUntil} from \"rxjs/operators\";\nimport {VideoDialogComponent} from '../../../public/video-dialog/video-dialog.component';\n\n@Component({\n selector: 'app-communication',\n templateUrl: './communication.component.html',\n styleUrls: ['./communication.component.scss']\n})\nexport class CommunicationComponent implements OnInit, OnDestroy {\n public ngUnsubscribe$: Subject = new Subject();\n loading: true;\n pharmacies: any;\n @ViewChildren('toggleSwitch') ref: QueryList;\n primary: ThemePalette = 'primary';\n public success = false;\n public error = false;\n public configs = [];\n public selectedIdf;\n public startDate: string;\n public types = [\n {value: 'TRACK_TRACE', label: 'Belieferungsinformationen', tooltip: 'Wir versorgen Sie mit relevanten Informationen betreffend Ihrer Belieferung. (Feiertage, Techn. Störungen, Verspätungen etc.)'},\n {value: 'ESARE', label: 'Elektronische Sammelrechnung', tooltip: 'Wir benachrichtigen Sie über die Verfügbarkeit Ihrer elektronischen Sammelrechnung im Apothekenportal'},\n {value: 'PAYBACK', label: 'PAYBACK Sammelrechnung', tooltip: 'Wir benachrichtigen Sie über die Verfügbarkeit Ihrer PAYBACK Sammelrechnung im Apothekenportal'},\n {value: 'ONLINE_OFFERS', label: 'Online Sparangebote', tooltip: 'Wir benachrichtigen Sie, sobald ein neues Online Sparangebot für Sie zur Verfügung steht.'},\n ];\n message = '';\n pharmaTypes;\n configStatus = {'TRACK_TRACE': false, 'ESARE': false, 'PAYBACK': false, ONLINE_OFFERS: false};\n\n constructor(public userService: UserService,\n private communicationRestService: CommunicationRestService,\n private dialog: MatDialog) {\n this.userService.loadAllIdfs().subscribe(phar => {\n this.pharmacies = phar;\n\n if (this.pharmacies) {\n this.selectedIdf = this.pharmacies[0].idf;\n this.getUserTypes();\n this.communicationRestService.getConfigs(this.selectedIdf).subscribe(configs => {\n this.configs = configs.returnObject;\n this.configs.forEach(config => this.configStatus[config.type] = config.active);\n });\n\n // this.userService.getDistributionCentersObservable(this.pharmacies[0].idf).pipe(takeUntil(this.ngUnsubscribe$)).subscribe(\n // dc => {\n // if (dc) {\n // const vz = dc.filter(d => d.idf === this.pharmacies[0].idf)[0].branches[0].id;\n // if (vz === 9 || vz === 40 || vz === 46 || vz === 31 || vz === 33 || vz === 70 || vz === 78 || vz === 6 || vz === 59 || vz === 81 || vz === 82) {\n // this.startDate = 'ab Mitte August 2024';\n // }\n // }\n // });\n }\n });\n }\n\n ngOnInit(): void {\n }\n\n openDialog(type: any, idf: string) {\n const selectedConfig = this.getSelectedConfig(type);\n const dialogRef = this.dialog.open(CommunicationDialogComponent, {\n width: '700px',\n data: {type: type, idf: idf, config: selectedConfig}\n });\n console.log(idf);\n\n dialogRef.afterClosed().subscribe(result => {\n this.message = '';\n const refArray = this.ref.toArray();\n if (result) {\n if (result.success) {\n const i = this.configs.findIndex(config => config.type === result.config.type);\n if ( i < 0) {\n result.config['mobilePhoneNumbers'] = result.config.phoneNumbers;\n this.configs.push(result.config);\n } else {\n result.config['mobilePhoneNumbers'] = result.config.phoneNumbers;\n this.configs[i] = result.config;\n }\n this.success = true;\n this.error = false;\n this.message = 'Ihre Kontaktdaten für das Abonnement ' + this.types.find((type) => type.value === result.config.type).label + ' wurden erfolgreich gespeichert.';\n } else {\n this.success = false;\n if (!result.errorCode) {\n this.error = false;\n\n if (selectedConfig) {\n this.configStatus[selectedConfig.type] = selectedConfig.active;\n const toggle = refArray.find(el => el['id'] === selectedConfig.type);\n toggle['checked'] = selectedConfig.active;\n } else {\n this.configStatus[type.value] = false;\n const toggle = refArray.find(el => el['id'] === type.value);\n toggle['checked'] = false;\n }\n } else {\n this.error = true;\n this.message = 'There was an error saving your configuration, try again later.';\n }\n }\n } else {\n this.success = false;\n this.error = false;\n this.message = '';\n }\n });\n }\n\n changeConfig($event: any, type: any, idf: string) {\n if ($event.checked === true) {\n this.openDialog(type, this.selectedIdf);\n } else if ($event.checked === false) {\n\n this.communicationRestService.disable(this.selectedIdf, type.value).subscribe(result => {\n if (!result.errorCode) {\n this.configs.find(config => config.type === type.value).active = false;\n }\n });\n }\n }\n\n getSelectedConfig(type) {\n const selected = this.configs?.find(config => config.type === type.value);\n if (selected) {\n return selected;\n }\n if (type.value === 'ESARE') {\n const pharmacy = this.pharmacies.find(pharma => pharma.idf === this.selectedIdf);\n return {active: true, mobilePhoneNumbers: [], emails: [pharmacy.email], type: 'ESARE'};\n }\n return null;\n }\n\n selectPharmacy(idf: any) {\n this.selectedIdf = idf;\n this.getUserTypes();\n this.communicationRestService.getConfigs(this.selectedIdf).subscribe(configs => {\n this.configs = configs.returnObject;\n });\n }\n\n isConfigActive(type) {\n const selectedConfig = this.configs?.find(config => config.type === type.value);\n return selectedConfig ? selectedConfig.active : false;\n }\n\n getUserTypes() {\n const typ = Object.assign([], this.types);\n\n const selectedPharmacy = this.pharmacies.find(pharmacy => pharmacy.idf === this.selectedIdf);\n const payback = selectedPharmacy.paybackType;\n const esare = selectedPharmacy.esare;\n\n if (payback === 'N') {\n const index = typ.findIndex(type => {\n return type.value === 'PAYBACK';\n });\n if (index > -1) {\n typ.splice(index, 1);\n }\n }\n\n if (!esare) {\n const i = typ.findIndex(type => {\n return type.value === 'ESARE';\n });\n if (i > -1) {\n typ.splice( i, 1);\n }\n }\n\n this.pharmaTypes = typ;\n }\n\n ngOnDestroy(): void {\n this.ngUnsubscribe$.next();\n this.ngUnsubscribe$.complete();\n }\n\n openVideoDialog(typ: string) {\n const dialogRef = this.dialog.open(VideoDialogComponent, {\n data: {type: typ},\n });\n }\n}\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {CommunicationComponent} from './communication.component';\nimport {RouterModule} from '@angular/router';\nimport {MatFormFieldModule} from '@angular/material/form-field';\nimport {NotificationModule} from '../../../shared/notification/notification.module';\nimport {ReactiveFormsModule} from '@angular/forms';\nimport {MatOptionModule} from '@angular/material/core';\nimport {MatSelectModule} from '@angular/material/select';\nimport {MatSlideToggleModule} from '@angular/material/slide-toggle';\nimport {MatInputModule} from '@angular/material/input';\nimport {MatDialogModule} from '@angular/material/dialog';\nimport {CommunicationDialogComponent} from './communication-dialog/communication-dialog.component';\nimport {MatTooltipModule} from '@angular/material/tooltip';\nimport {RouteGuardService} from '../../../../core/services/routeGuards/route-guard.service';\n\nexport const routes = [\n {path: '', component: CommunicationComponent, pathMatch: 'full' },\n];\n\n@NgModule({\n declarations: [\n CommunicationComponent,\n CommunicationDialogComponent\n ],\n imports: [\n CommonModule,\n RouterModule.forChild(routes),\n MatFormFieldModule,\n NotificationModule,\n ReactiveFormsModule,\n MatOptionModule,\n MatSelectModule,\n MatSlideToggleModule,\n MatInputModule,\n MatDialogModule,\n MatTooltipModule\n ]\n})\nexport class CommunicationModule {\n static routes = routes;\n}\n"]}