{ "version": 3, "sources": ["src/app/providers/ws-bulletin-service/ws-bulletin.service.ts", "src/app/models/bulletin-lock.model.ts", "src/app/providers/bulletins-service/bulletins.service.ts", "src/app/providers/copy-service/copy.service.ts", "src/app/providers/media-file-service/media-file.service.ts", "src/app/providers/undo-redo-service/undo-redo.service.ts", "src/app/providers/ws-update-service/ws-update.service.ts"], "sourcesContent": ["import { Injectable } from \"@angular/core\";\nimport * as Rx from \"rxjs\";\n\n@Injectable()\nexport class WsBulletinService {\n private subject: Rx.Subject;\n\n public connect(url): Rx.Subject {\n if (!this.subject) {\n this.subject = this.create(url);\n console.debug(\"Successfully connected: \" + url);\n }\n return this.subject;\n }\n\n private create(url): Rx.Subject {\n const ws = new WebSocket(url);\n\n const observable = Rx.Observable.create((obs: Rx.Observer) => {\n ws.onmessage = obs.next.bind(obs);\n ws.onerror = obs.error.bind(obs);\n ws.onclose = obs.complete.bind(obs);\n return ws.close.bind(ws);\n });\n const observer = {\n next: (data: object) => {\n if (ws.readyState === WebSocket.OPEN) {\n ws.send(JSON.stringify(data));\n }\n },\n };\n return Rx.Subject.create(observer, observable);\n }\n\n public disconnect() {\n this.subject.unsubscribe();\n }\n}\n", "import { formatDate } from \"@angular/common\";\n\nexport class BulletinLockModel {\n public bulletin: string;\n public date: Date;\n public userEmail: string;\n public userName: string;\n public lock: boolean;\n\n static createFromJson(json) {\n const bulletinLock = new BulletinLockModel();\n\n bulletinLock.setDate(new Date(json.date));\n bulletinLock.setBulletin(json.bulletin);\n bulletinLock.setUserEmail(json.userEmail);\n bulletinLock.setUserName(json.userName);\n bulletinLock.setLock(json.lock);\n\n return bulletinLock;\n }\n\n constructor() {\n this.bulletin = undefined;\n this.date = undefined;\n this.userEmail = undefined;\n this.userName = undefined;\n this.lock = undefined;\n }\n\n getBulletin() {\n return this.bulletin;\n }\n\n setBulletin(bulletin: string) {\n this.bulletin = bulletin;\n }\n\n getDate() {\n return this.date;\n }\n\n setDate(date: Date) {\n this.date = date;\n }\n\n getUserEmail() {\n return this.userEmail;\n }\n\n setUserEmail(userEmail: string) {\n this.userEmail = userEmail;\n }\n\n getUserName() {\n return this.userName;\n }\n\n setUserName(userName: string) {\n this.userName = userName;\n }\n\n getLock() {\n return this.lock;\n }\n\n setLock(lock: boolean) {\n this.lock = lock;\n }\n\n toJson() {\n const json = Object();\n\n if (this.bulletin) {\n json[\"bulletin\"] = this.bulletin;\n }\n if (this.date) {\n json[\"date\"] = formatDate(this.date, \"yyyy-MM-ddTHH:mm:ssZZZZZ\", \"en-US\");\n }\n if (this.userName) {\n json[\"userName\"] = this.userName;\n }\n if (this.userEmail) {\n json[\"userEmail\"] = this.userEmail;\n }\n json[\"lock\"] = this.lock;\n\n return json;\n }\n}\n", "import { inject, Injectable } from \"@angular/core\";\nimport { HttpClient, HttpHeaders } from \"@angular/common/http\";\nimport { Observable, of, Subject } from \"rxjs\";\nimport { map, switchMap } from \"rxjs/operators\";\nimport { ConstantsService } from \"../constants-service/constants.service\";\nimport { AuthenticationService } from \"../authentication-service/authentication.service\";\nimport { WsBulletinService } from \"../ws-bulletin-service/ws-bulletin.service\";\nimport { LocalStorageService } from \"../local-storage-service/local-storage.service\";\nimport { BulletinLockModel } from \"../../models/bulletin-lock.model\";\nimport { ServerModel } from \"../../models/server.model\";\nimport * as Enums from \"../../enums/enums\";\nimport { BulletinModel, BulletinModelAsJSON } from \"app/models/bulletin.model\";\nimport { DateIsoString } from \"app/models/stress-level.model\";\nimport { UserService } from \"../user-service/user.service\";\nimport { TranslateService } from \"@ngx-translate/core\";\n\nclass TrainingModeError extends Error {}\n\ninterface AccordionChangeEvent {\n isOpen: boolean;\n groupName: string;\n}\n\n@Injectable()\nexport class BulletinsService {\n http = inject(HttpClient);\n private constantsService = inject(ConstantsService);\n private authenticationService = inject(AuthenticationService);\n private translateService = inject(TranslateService);\n private localStorageService = inject(LocalStorageService);\n private userService = inject(UserService);\n private wsBulletinService = inject(WsBulletinService);\n\n private activeDate: [Date, Date];\n private copyDate: [Date, Date];\n private isEditable: boolean;\n private isReadOnly: boolean;\n\n public lockedBulletins: Map;\n public bulletinLocks: Subject;\n\n public stress: Record = {};\n\n public statusMap: Map>;\n\n public dates: [Date, Date][];\n\n private accordionChangedSubject = new Subject(); // used to synchronize accordion between compared bulletins\n accordionChanged$: Observable = this.accordionChangedSubject.asObservable();\n\n init({ days } = { days: 10 }) {\n this.dates = [];\n this.activeDate = undefined;\n this.copyDate = undefined;\n this.isEditable = false;\n this.isReadOnly = false;\n this.lockedBulletins = new Map();\n\n // connect to websockets\n this.wsBulletinConnect();\n\n const { isTrainingEnabled, trainingTimestamp } = this.localStorageService;\n const startDate = isTrainingEnabled ? new Date(trainingTimestamp) : new Date();\n startDate.setDate(startDate.getDate() - 7);\n startDate.setHours(0, 0, 0, 0);\n\n const endDate = isTrainingEnabled ? new Date(trainingTimestamp) : new Date();\n endDate.setDate(endDate.getDate() + 3);\n endDate.setHours(0, 0, 0, 0);\n\n for (let i = 0; i <= days; i++) {\n const date = new Date(endDate.valueOf());\n date.setDate(endDate.getDate() - i);\n this.dates.push(this.getValidFromUntil(date));\n }\n\n this.loadStressLevels();\n this.loadStatus();\n }\n\n private loadStressLevels() {\n if (this.localStorageService.isTrainingEnabled) {\n return;\n }\n this.userService.getStressLevels([this.dates.at(-1)[0], this.dates.at(0)[1]]).subscribe((stressLevels) => {\n this.stress = Object.fromEntries(stressLevels.map((s) => [s.date, s.stressLevel]));\n });\n }\n\n public loadStatus() {\n const startDate = this.dates[this.dates.length - 1];\n const endDate = this.dates[0];\n this.statusMap = new Map>();\n this.getStatus(this.authenticationService.getActiveRegionId(), startDate, endDate).subscribe(\n (data) => {\n const map = new Map();\n for (let i = (data as any).length - 1; i >= 0; i--) {\n map.set(Date.parse((data as any)[i].date), Enums.BulletinStatus[(data as any)[i].status as string]);\n }\n this.statusMap.set(this.authenticationService.getActiveRegionId(), map);\n },\n () => {\n console.error(\"Status {} could not be loaded!\", this.authenticationService.getActiveRegionId());\n },\n );\n this.authenticationService.getActiveRegion()?.neighborRegions.forEach((neighborRegion) => {\n this.getStatus(neighborRegion, startDate, endDate).subscribe(\n (data) => {\n const map = new Map();\n for (let i = (data as any).length - 1; i >= 0; i--) {\n map.set(Date.parse((data as any)[i].date), Enums.BulletinStatus[(data as any)[i].status as string]);\n }\n this.statusMap.set(neighborRegion, map);\n },\n () => {\n console.error(\"Status {} could not be loaded!\", neighborRegion);\n },\n );\n });\n }\n\n public wsBulletinConnect() {\n this.bulletinLocks = this.wsBulletinService\n .connect(this.constantsService.getServerWsUrl() + \"../bulletin/\" + this.authenticationService.getUsername())\n .pipe(\n map((response: any): BulletinLockModel => {\n const data = JSON.parse(response.data);\n const bulletinLock = BulletinLockModel.createFromJson(data);\n if (bulletinLock.getLock()) {\n console.debug(\"Bulletin lock received: \" + bulletinLock.getBulletin());\n this.addLockedBulletin(bulletinLock);\n } else {\n console.debug(\"Bulletin unlock received: \" + bulletinLock.getBulletin());\n this.removeLockedBulletin(bulletinLock.getBulletin());\n }\n return bulletinLock;\n }),\n ) as Subject;\n\n this.bulletinLocks.subscribe(() => {});\n }\n\n public wsBulletinDisconnect() {\n this.wsBulletinService.disconnect();\n }\n\n getActiveDate(): [Date, Date] {\n return this.activeDate;\n }\n\n setActiveDate(date: [Date, Date]) {\n this.activeDate = date;\n }\n\n hasBeenPublished5PM(date: [Date, Date]): boolean {\n // date[0] = validFrom = 17:00 = published at\n const published = date[0];\n return new Date().getTime() >= published.getTime();\n }\n\n hasBeenPublished8AM(date: [Date, Date]): boolean {\n // date[1] = validUntil = 17:00\n // date[1] at 08:00 = updated at\n const updated = new Date(date[1]);\n updated.setHours(8, 0, 0, 0);\n return new Date().getTime() >= updated.getTime();\n }\n\n getValidFromUntil(date: Date): [Date, Date] {\n const validFrom = new Date(date);\n validFrom.setTime(validFrom.getTime() - 7 * 60 * 60 * 1000);\n const validUntil = new Date(date);\n validUntil.setTime(validUntil.getTime() + 17 * 60 * 60 * 1000);\n return [validFrom, validUntil];\n }\n\n /**\n * Returns a date that's offset from the activeDate by a given amount.\n *\n * @param offset - Number of days to offset. Can be negative (future) or positive (past).\n * @returns Date offset from the activeDate or null if not found or out of bounds.\n */\n private getDateOffset(offset: number): [Date, Date] | null {\n if (!this.activeDate) {\n return null;\n }\n\n const index = this.dates.findIndex((d) => d[0].getTime() === this.activeDate[0].getTime());\n\n if (index === -1 || index + offset < 0 || index + offset >= this.dates.length) {\n return null;\n }\n\n return this.dates[index + offset];\n }\n\n getNextDate(): [Date, Date] | null {\n return this.getDateOffset(-1);\n }\n\n getPreviousDate(): [Date, Date] | null {\n return this.getDateOffset(1);\n }\n\n getCopyDate(): [Date, Date] {\n return this.copyDate;\n }\n\n setCopyDate(date: [Date, Date]) {\n this.copyDate = date;\n }\n\n getIsEditable(): boolean {\n return this.isEditable && !this.isReadOnly;\n }\n\n setIsEditable(isEditable: boolean) {\n this.isEditable = isEditable;\n }\n\n getIsReadOnly(): boolean {\n return this.isReadOnly;\n }\n\n setIsReadOnly(isReadOnly: boolean) {\n this.isReadOnly = isReadOnly;\n }\n\n getUserRegionStatus(date: [Date, Date]): Enums.BulletinStatus {\n const region = this.authenticationService.getActiveRegionId();\n const regionStatusMap = this.statusMap.get(region);\n if (regionStatusMap) return regionStatusMap.get(date[0].getTime());\n else return Enums.BulletinStatus.missing;\n }\n\n setUserRegionStatus(date: [Date, Date], status: Enums.BulletinStatus) {\n const region = this.authenticationService.getActiveRegionId();\n this.statusMap.get(region).set(date[0].getTime(), status);\n }\n\n getPreviewPdf(bulletins: BulletinModel[]): Observable {\n const body = JSON.stringify(bulletins.map((b) => b.toJson()));\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/preview?\" +\n this.constantsService\n .createSearchParams([\n [\"region\", this.authenticationService.getActiveRegionId()],\n [\"lang\", this.translateService.currentLang],\n ])\n .toString();\n const headers = new HttpHeaders({ Accept: \"application/pdf\" });\n return this.http.post(url, body, { headers, responseType: \"blob\" });\n }\n\n getStatus(\n region: string,\n startDate: [Date, Date],\n endDate: [Date, Date],\n ): Observable<{ date: string; status: keyof typeof Enums.BulletinStatus }[]> {\n if (this.localStorageService.isTrainingEnabled) {\n return of(\n this.dates.map((date) => {\n return {\n date: date[0].toISOString(),\n status: this.localStorageService.getTrainingBulletins(date)?.length ? \"draft\" : undefined,\n } as const;\n }),\n );\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/status/internal?\" +\n this.constantsService\n .createSearchParams([\n [\"startDate\", this.constantsService.getISOStringWithTimezoneOffset(startDate[0])],\n [\"endDate\", this.constantsService.getISOStringWithTimezoneOffset(endDate[0])],\n [\"region\", region],\n ])\n .toString();\n return this.http.get(url);\n }\n\n getPublicationStatus(region: string, date: [Date, Date]) {\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/status/publication?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n return this.http.get(url);\n }\n\n loadBulletins(\n date: [Date, Date],\n regions: string[],\n etag?: string,\n ): Observable<{ bulletins: BulletinModelAsJSON[]; etag: string | null }> {\n if (this.localStorageService.isTrainingEnabled) {\n const bulletins = this.localStorageService.getTrainingBulletins(date);\n return of({ bulletins, etag: null });\n }\n return this.loadBulletinsFromServer(date, regions, etag);\n }\n\n loadBulletinsFromServer(\n date: [Date, Date],\n regions: string[],\n etag?: string,\n ): Observable<{ bulletins: BulletinModelAsJSON[]; etag: string | null }> {\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/edit?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"regions\", regions],\n ])\n .toString();\n const headers = etag ? new HttpHeaders({ \"If-None-Match\": etag }) : undefined;\n return this.http\n .get(url, { headers, observe: \"response\" })\n .pipe(map((response) => ({ bulletins: response.body, etag: response.headers.get(\"ETag\") })));\n }\n\n loadExternalBulletins([date0]: [Date, Date], server: ServerModel): Observable {\n if (this.localStorageService.isTrainingEnabled) {\n return of([]);\n }\n const headers = new HttpHeaders({ Authorization: \"Bearer \" + server.accessToken });\n return this.http.get<{ date: string }>(server.apiUrl + \"bulletins/latest\", { headers }).pipe(\n switchMap((latest) => {\n const date = new Date(date0);\n if (latest.date.endsWith(\"T22:00:00Z\") || latest.date.endsWith(\"T23:00:00Z\")) {\n date.setHours(24, 0, 0);\n }\n const url =\n server.apiUrl +\n \"bulletins/edit?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date)],\n [\"regions\", server.regions.filter((region) => !this.authenticationService.isInternalRegion(region))],\n ])\n .toString();\n return this.http.get(url, { headers });\n }),\n );\n }\n\n loadCaamlBulletins(date: [Date, Date]): Observable {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"lang\", this.translateService.currentLang],\n ])\n .toString();\n const headers = new HttpHeaders({ Accept: \"application/xml\" });\n return this.http.get(url, { headers, responseType: \"text\" });\n }\n\n loadJsonBulletins(date: [Date, Date]) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins?\" +\n this.constantsService\n .createSearchParams([[\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])]])\n .toString();\n return this.http.get(url);\n }\n\n saveBulletins(bulletins: BulletinModel[], date: [Date, Date]): Observable {\n if (this.localStorageService.isTrainingEnabled) {\n const newBulletins = bulletins.map((b) => b.toJson());\n this.localStorageService.setTrainingBulletins(date, newBulletins);\n return of(newBulletins);\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", this.authenticationService.getActiveRegionId()],\n ])\n .toString();\n const jsonBulletins = [];\n for (let i = bulletins.length - 1; i >= 0; i--) {\n jsonBulletins.push(bulletins[i].toJson());\n }\n const body = JSON.stringify(jsonBulletins);\n return this.http.post(url, body);\n }\n\n createBulletin(bulletin: BulletinModel, date: [Date, Date]): Observable {\n if (this.localStorageService.isTrainingEnabled) {\n bulletin.id ??= crypto.randomUUID();\n const bulletins = this.localStorageService.getTrainingBulletins(date);\n const newBulletins = [...bulletins, bulletin.toJson()];\n this.localStorageService.setTrainingBulletins(date, newBulletins);\n return of(newBulletins);\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", this.authenticationService.getActiveRegionId()],\n ])\n .toString();\n const body = JSON.stringify(bulletin.toJson());\n return this.http.put(url, body);\n }\n\n updateBulletin(bulletin: BulletinModel, date: [Date, Date]): Observable {\n // check if bulletin has ID\n if (this.localStorageService.isTrainingEnabled) {\n const bulletins = this.localStorageService.getTrainingBulletins(date);\n const newBulletins = [...bulletins.filter((b) => b.id !== bulletin.id), bulletin.toJson()];\n this.localStorageService.setTrainingBulletins(date, newBulletins);\n return of(newBulletins);\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/\" +\n bulletin.getId() +\n \"?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", this.authenticationService.getActiveRegionId()],\n ])\n .toString();\n const body = JSON.stringify(bulletin.toJson());\n return this.http.post(url, body);\n }\n\n deleteBulletin(bulletin: BulletinModel, date: [Date, Date]): Observable {\n // check if bulletin has ID\n if (this.localStorageService.isTrainingEnabled) {\n const bulletins = this.localStorageService.getTrainingBulletins(date);\n const newBulletins = bulletins.filter((b) => b.id !== bulletin.id);\n this.localStorageService.setTrainingBulletins(date, newBulletins);\n return of(newBulletins);\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/\" +\n bulletin.getId() +\n \"?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", this.authenticationService.getActiveRegionId()],\n ])\n .toString();\n return this.http.delete(url);\n }\n\n submitBulletins(date: [Date, Date], region: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/submit?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n publishBulletins(date: [Date, Date], region: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n changeBulletins(date: [Date, Date], region: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/change?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n const jsonBulletins = [];\n const body = JSON.stringify(jsonBulletins);\n return this.http.post(url, body);\n }\n\n publishAllBulletins(date: [Date, Date]) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/all?\" +\n this.constantsService\n .createSearchParams([[\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])]])\n .toString();\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n sendEmail(date: [Date, Date], region: string, language: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n let url: string;\n if (language) {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/email?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n [\"lang\", language],\n ])\n .toString();\n } else {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/email?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n }\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n sendTestEmail(date: [Date, Date], region: string, language: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n let url: string;\n if (language) {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/email/test?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n [\"lang\", language],\n ])\n .toString();\n } else {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/email/test?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n }\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n triggerTelegramChannel(date: [Date, Date], region: string, language: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n let url: string;\n if (language) {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/telegram?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n [\"lang\", language],\n ])\n .toString();\n } else {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/telegram?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n }\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n triggerTestTelegramChannel(date: [Date, Date], region: string, language: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n let url: string;\n if (language) {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/telegram/test?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n [\"lang\", language],\n ])\n .toString();\n } else {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/telegram/test?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n }\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n triggerPushNotifications(date: [Date, Date], region: string, language: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n let url: string;\n if (language) {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/push?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n [\"lang\", language],\n ])\n .toString();\n } else {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/push?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n }\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n triggerTestPushNotifications(date: [Date, Date], region: string, language: string) {\n if (this.localStorageService.isTrainingEnabled) {\n throw new TrainingModeError();\n }\n let url: string;\n if (language) {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/push/test?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n [\"lang\", language],\n ])\n .toString();\n } else {\n url =\n this.constantsService.getServerUrl() +\n \"bulletins/publish/push/test?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n }\n const body = JSON.stringify(\"\");\n return this.http.post(url, body);\n }\n\n checkBulletins(date: [Date, Date], region: string) {\n if (this.localStorageService.isTrainingEnabled) {\n // TODO check bulletins from POST JSON\n }\n const url =\n this.constantsService.getServerUrl() +\n \"bulletins/check?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[0])],\n [\"region\", region],\n ])\n .toString();\n return this.http.get(url);\n }\n\n loadLockedBulletins() {\n this.lockedBulletins.clear();\n const url = this.constantsService.getServerUrl() + \"bulletins/locked\";\n this.http.get(url).subscribe(\n (data) => {\n for (const response of data as any) {\n const data = JSON.parse(response.data);\n const bulletinLock = BulletinLockModel.createFromJson(data);\n this.addLockedBulletin(bulletinLock);\n }\n },\n (error) => {\n console.warn(\"Locked bulletins could not be loaded!\");\n },\n );\n }\n\n isLocked(bulletinId: string) {\n return (\n this.lockedBulletins.has(bulletinId) &&\n this.lockedBulletins.get(bulletinId).getUserEmail() !== this.authenticationService.getEmail()\n );\n }\n\n lockBulletin(date: [Date, Date], bulletinId: string) {\n const bulletinLock = new BulletinLockModel();\n bulletinLock.setBulletin(bulletinId);\n bulletinLock.setDate(date[0]);\n bulletinLock.setUserName(this.authenticationService.getUsername());\n bulletinLock.setUserEmail(this.authenticationService.getEmail());\n bulletinLock.setLock(true);\n\n this.bulletinLocks.next(bulletinLock);\n\n console.debug(\"Bulletin lock sent: \" + bulletinLock.getDate() + \" - \" + bulletinLock.getBulletin());\n }\n\n unlockBulletin(date: [Date, Date], bulletinId: string) {\n const bulletinLock = new BulletinLockModel();\n bulletinLock.setBulletin(bulletinId);\n bulletinLock.setDate(date[0]);\n bulletinLock.setUserName(this.authenticationService.getUsername());\n bulletinLock.setUserEmail(this.authenticationService.getEmail());\n bulletinLock.setLock(false);\n\n this.bulletinLocks.next(bulletinLock);\n\n console.debug(\"Bulletin unlock sent: \" + bulletinLock.getDate() + \" - \" + bulletinLock.getBulletin());\n }\n\n addLockedBulletin(bulletinLock: BulletinLockModel) {\n if (this.lockedBulletins.has(bulletinLock.getBulletin())) {\n console.warn(\"Bulletin already locked by \" + bulletinLock.getUserName());\n } else {\n this.lockedBulletins.set(bulletinLock.getBulletin(), bulletinLock);\n }\n }\n\n removeLockedBulletin(bulletinId: string) {\n if (this.lockedBulletins.has(bulletinId)) {\n this.lockedBulletins.delete(bulletinId);\n } else {\n console.warn(\"Bulletin was not locked!\");\n }\n }\n\n getStressLevelColor(date: DateIsoString) {\n const stress0 = this.stress[date];\n return !stress0\n ? this.constantsService.colorDangerRatingMissing\n : stress0 < 25\n ? this.constantsService.colorDangerRatingLow\n : stress0 < 50\n ? this.constantsService.colorDangerRatingModerate\n : stress0 < 75\n ? this.constantsService.colorDangerRatingConsiderable\n : this.constantsService.colorDangerRatingHigh;\n }\n\n getStressLevelIcon(date: DateIsoString) {\n const stress0 = this.stress[date];\n return stress0 < 25\n ? \"ph-smiley\"\n : stress0 < 50\n ? \"ph-smiley-meh\"\n : stress0 < 75\n ? \"ph-smiley-nervous\"\n : stress0 <= 100\n ? \"ph-smiley-x-eyes\"\n : \"ph-circle-dashed\";\n }\n\n emitAccordionChanged(event: AccordionChangeEvent) {\n this.accordionChangedSubject.next(event);\n }\n}\n", "import { Injectable, inject } from \"@angular/core\";\nimport { BulletinModel } from \"app/models/bulletin.model\";\nimport { ConstantsService } from \"../constants-service/constants.service\";\nimport { LangTexts } from \"../../models/text.model\";\n\n@Injectable()\nexport class CopyService {\n constantsService = inject(ConstantsService);\n\n private copyTextcat: boolean;\n private copyBulletin: boolean;\n private textTextcat: string;\n private bulletin: BulletinModel;\n private texts: LangTexts;\n\n constructor() {\n this.copyTextcat = false;\n this.copyBulletin = false;\n }\n\n isCopyTextcat(): boolean {\n return this.copyTextcat;\n }\n\n setCopyTextcat(copyTextcat: boolean) {\n this.copyTextcat = copyTextcat;\n }\n\n getTextTextcat(): string {\n return this.textTextcat;\n }\n\n setTextTextcat(textTextcat: string) {\n this.textTextcat = textTextcat;\n }\n\n resetCopyTextcat() {\n this.copyTextcat = false;\n this.textTextcat = undefined;\n this.texts = undefined;\n }\n\n isCopyBulletin(): boolean {\n return this.copyBulletin;\n }\n\n setCopyBulletin(copyBulletin: boolean) {\n this.copyBulletin = copyBulletin;\n }\n\n getBulletin(): BulletinModel {\n return this.bulletin;\n }\n\n setBulletin(bulletin: BulletinModel) {\n this.bulletin = bulletin;\n }\n\n resetCopyBulletin() {\n this.copyBulletin = false;\n this.bulletin = undefined;\n }\n\n setFromLangTexts(l: LangTexts) {\n this.texts = { ...l };\n }\n\n get toLangTexts(): LangTexts {\n return { ...this.texts };\n }\n}\n", "import { inject, Injectable } from \"@angular/core\";\nimport { HttpClient } from \"@angular/common/http\";\nimport { ConstantsService } from \"../constants-service/constants.service\";\nimport { AuthenticationService } from \"../authentication-service/authentication.service\";\nimport { TranslateService } from \"@ngx-translate/core\";\n\n@Injectable()\nexport class MediaFileService {\n http = inject(HttpClient);\n private constantsService = inject(ConstantsService);\n private translateService = inject(TranslateService);\n private authenticationService = inject(AuthenticationService);\n\n uploadFile(date: [Date, Date], file: File, text: string, important: boolean) {\n const url =\n this.constantsService.getServerUrl() +\n \"media?\" +\n this.constantsService\n .createSearchParams([\n [\"date\", this.constantsService.getISOStringWithTimezoneOffset(date[1])],\n [\"region\", this.authenticationService.getActiveRegionId()],\n [\"lang\", this.translateService.currentLang],\n [\"important\", important],\n ])\n .toString();\n const formData = new FormData();\n formData.append(\"file\", file);\n formData.append(\"text\", text);\n\n return this.http.post(url, formData, {});\n }\n}\n", "import { Injectable } from \"@angular/core\";\nimport { BulletinModel } from \"app/models/bulletin.model\";\n\n@Injectable()\nexport class UndoRedoService {\n public undoStack: Record = {};\n public redoStack: Record = {};\n\n undoRedoActiveBulletin(type: \"undo\" | \"redo\", activeBulletinID: string) {\n if (!activeBulletinID) return undefined;\n if (type === \"undo\" && this.isEnabled(type, activeBulletinID)) {\n this.redoStack[activeBulletinID].push(this.undoStack[activeBulletinID].pop());\n } else if (type === \"redo\" && this.isEnabled(type, activeBulletinID)) {\n this.undoStack[activeBulletinID].push(this.redoStack[activeBulletinID].pop());\n } else {\n return undefined;\n }\n console.info(\n \"performing \" + type,\n \"undo stack size: \" + this.undoStack[activeBulletinID].length,\n \"redo stack size: \" + this.redoStack[activeBulletinID].length,\n );\n const jsonBulletin = JSON.parse(this.undoStack[activeBulletinID].at(-1));\n return BulletinModel.createFromJson(jsonBulletin);\n }\n\n isEnabled(type: \"undo\" | \"redo\", activeBulletinID: string) {\n if (type === \"undo\") {\n return this.undoStack[activeBulletinID]?.length > 1;\n } else if (type === \"redo\") {\n return this.undoStack[activeBulletinID]?.length > 0 && this.redoStack[activeBulletinID]?.length > 0;\n } else return false;\n }\n\n pushToUndoStack(bulletin: BulletinModel) {\n this.redoStack[bulletin.getId()] = [];\n this.undoStack[bulletin.getId()] ??= [];\n // cap undo stack at 100 entries\n if (this.undoStack[bulletin.getId()].length >= 100) {\n this.undoStack[bulletin.getId()].shift();\n }\n this.undoStack[bulletin.getId()].push(JSON.stringify(bulletin.toJson()));\n console.info(\n \"undo stack size: \" + this.undoStack[bulletin.getId()].length,\n \"redo stack size: \" + this.redoStack[bulletin.getId()].length,\n );\n }\n\n initUndoRedoStacksFromServer(bulletin: BulletinModel) {\n this.undoStack[bulletin.getId()] ??= [];\n this.redoStack[bulletin.getId()] ??= [];\n // If the user did not perform any actions of their own, and the state changes on the server, the undo stack should be re-initialized with the state from the server.\n // On the other hand: if the undo stack has length <= 1 because the user is in the middle of some undo/redo, the stacks should not be overwritten.\n if (this.undoStack[bulletin.getId()].length <= 1 && this.redoStack[bulletin.getId()].length === 0) {\n this.pushToUndoStack(bulletin);\n }\n }\n}\n", "import { Injectable } from \"@angular/core\";\nimport * as Rx from \"rxjs\";\n\n@Injectable()\nexport class WsUpdateService {\n private subject: Rx.Subject;\n\n public connect(url): Rx.Subject {\n if (!this.subject) {\n this.subject = this.create(url);\n console.debug(\"Successfully connected: \" + url);\n }\n return this.subject;\n }\n\n private create(url): Rx.Subject {\n const ws = new WebSocket(url);\n\n const observable = Rx.Observable.create((obs: Rx.Observer) => {\n ws.onmessage = obs.next.bind(obs);\n ws.onerror = obs.error.bind(obs);\n ws.onclose = obs.complete.bind(obs);\n return ws.close.bind(ws);\n });\n const observer = {\n next: (data: object) => {\n if (ws.readyState === WebSocket.OPEN) {\n ws.send(JSON.stringify(data));\n }\n },\n };\n return Rx.Subject.create(observer, observable);\n }\n\n public disconnect() {\n this.subject.unsubscribe();\n }\n}\n"], "mappings": "0OAIA,IAAaA,GAAiB,IAAA,CAAxB,MAAOA,CAAiB,CAGrBC,QAAQC,EAAG,CAChB,OAAK,KAAKC,UACR,KAAKA,QAAU,KAAKC,OAAOF,CAAG,EAC9BG,QAAQC,MAAM,2BAA6BJ,CAAG,GAEzC,KAAKC,OACd,CAEQC,OAAOF,EAAG,CAChB,IAAMK,EAAK,IAAIC,UAAUN,CAAG,EAEtBO,EAAgBC,EAAWN,OAAQO,IACvCJ,EAAGK,UAAYD,EAAIE,KAAKC,KAAKH,CAAG,EAChCJ,EAAGQ,QAAUJ,EAAIK,MAAMF,KAAKH,CAAG,EAC/BJ,EAAGU,QAAUN,EAAIO,SAASJ,KAAKH,CAAG,EAC3BJ,EAAGY,MAAML,KAAKP,CAAE,EACxB,EACKa,EAAW,CACfP,KAAOQ,GAAgB,CACjBd,EAAGe,aAAed,UAAUe,MAC9BhB,EAAGiB,KAAKC,KAAKC,UAAUL,CAAI,CAAC,CAEhC,GAEF,OAAUM,EAAQvB,OAAOgB,EAAUX,CAAU,CAC/C,CAEOmB,YAAU,CACf,KAAKzB,QAAQ0B,YAAW,CAC1B,iDAhCW7B,EAAiB,CAAA,iCAAjBA,EAAiB8B,QAAjB9B,EAAiB+B,SAAA,CAAA,CAAA,SAAjB/B,CAAiB,GAAA,ECFxB,IAAOgC,EAAP,MAAOA,CAAiB,CAO5B,OAAOC,eAAeC,EAAI,CACxB,IAAMC,EAAe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,CAClD,KAAKlB,UAAUkB,EAASC,MAAK,CAAE,IAAM,CAAA,EACrC,KAAKlB,UAAUiB,EAASC,MAAK,CAAE,IAAM,CAAA,EAGjC,KAAKnB,UAAUkB,EAASC,MAAK,CAAE,EAAET,QAAU,GAAK,KAAKT,UAAUiB,EAASC,MAAK,CAAE,EAAET,SAAW,GAC9F,KAAKO,gBAAgBC,CAAQ,CAEjC,iDApDWpB,EAAe,CAAA,iCAAfA,EAAe0B,QAAf1B,EAAe2B,SAAA,CAAA,CAAA,SAAf3B,CAAe,GAAA,ECA5B,IAAa4B,IAAe,IAAA,CAAtB,MAAOA,CAAe,CAGnBC,QAAQC,EAAG,CAChB,OAAK,KAAKC,UACR,KAAKA,QAAU,KAAKC,OAAOF,CAAG,EAC9BG,QAAQC,MAAM,2BAA6BJ,CAAG,GAEzC,KAAKC,OACd,CAEQC,OAAOF,EAAG,CAChB,IAAMK,EAAK,IAAIC,UAAUN,CAAG,EAEtBO,EAAgBC,EAAWN,OAAQO,IACvCJ,EAAGK,UAAYD,EAAIE,KAAKC,KAAKH,CAAG,EAChCJ,EAAGQ,QAAUJ,EAAIK,MAAMF,KAAKH,CAAG,EAC/BJ,EAAGU,QAAUN,EAAIO,SAASJ,KAAKH,CAAG,EAC3BJ,EAAGY,MAAML,KAAKP,CAAE,EACxB,EACKa,EAAW,CACfP,KAAOQ,GAAgB,CACjBd,EAAGe,aAAed,UAAUe,MAC9BhB,EAAGiB,KAAKC,KAAKC,UAAUL,CAAI,CAAC,CAEhC,GAEF,OAAUM,EAAQvB,OAAOgB,EAAUX,CAAU,CAC/C,CAEOmB,YAAU,CACf,KAAKzB,QAAQ0B,YAAW,CAC1B,iDAhCW7B,EAAe,CAAA,iCAAfA,EAAe8B,QAAf9B,EAAe+B,SAAA,CAAA,CAAA,SAAf/B,CAAe,GAAA", "names": ["WsBulletinService", "connect", "url", "subject", "create", "console", "debug", "ws", "WebSocket", "observable", "Observable", "obs", "onmessage", "next", "bind", "onerror", "error", "onclose", "complete", "close", "observer", "data", "readyState", "OPEN", "send", "JSON", "stringify", "Subject", "disconnect", "unsubscribe", "factory", "\u0275fac", "BulletinLockModel", "createFromJson", "json", "bulletinLock", "setDate", "Date", "date", "setBulletin", "bulletin", "setUserEmail", "userEmail", "setUserName", "userName", "setLock", "lock", "constructor", "undefined", "getBulletin", "getDate", "getUserEmail", "getUserName", "getLock", "toJson", "Object", "formatDate", "TrainingModeError", "Error", "BulletinsService", "constructor", "http", "inject", "HttpClient", "constantsService", "ConstantsService", "authenticationService", "AuthenticationService", "translateService", "TranslateService", "localStorageService", "LocalStorageService", "userService", "UserService", "wsBulletinService", "WsBulletinService", "stress", "accordionChangedSubject", "Subject", "accordionChanged$", "asObservable", "init", "days", "dates", "activeDate", "undefined", "copyDate", "isEditable", "isReadOnly", "lockedBulletins", "Map", "wsBulletinConnect", "isTrainingEnabled", "trainingTimestamp", "startDate", "Date", "setDate", "getDate", "setHours", "endDate", "i", "date", "valueOf", "push", "getValidFromUntil", "loadStressLevels", "loadStatus", "getStressLevels", "at", "subscribe", "stressLevels", "Object", "fromEntries", "map", "s", "stressLevel", "length", "statusMap", "getStatus", "getActiveRegionId", "data", "set", "parse", "BulletinStatus", "status", "console", "error", "getActiveRegion", "neighborRegions", "forEach", "neighborRegion", "bulletinLocks", "connect", "getServerWsUrl", "getUsername", "pipe", "response", "JSON", "bulletinLock", "BulletinLockModel", "createFromJson", "getLock", "debug", "getBulletin", "addLockedBulletin", "removeLockedBulletin", "wsBulletinDisconnect", "disconnect", "getActiveDate", "setActiveDate", "hasBeenPublished5PM", "published", "getTime", "hasBeenPublished8AM", "updated", "validFrom", "setTime", "validUntil", "getDateOffset", "offset", "index", "findIndex", "d", "getNextDate", "getPreviousDate", "getCopyDate", "setCopyDate", "getIsEditable", "setIsEditable", "getIsReadOnly", "setIsReadOnly", "getUserRegionStatus", "region", "regionStatusMap", "get", "missing", "setUserRegionStatus", "getPreviewPdf", "bulletins", "body", "stringify", "b", "toJson", "url", "getServerUrl", "createSearchParams", "currentLang", "toString", "headers", "HttpHeaders", "Accept", "post", "responseType", "of", "toISOString", "getTrainingBulletins", "getISOStringWithTimezoneOffset", "getPublicationStatus", "loadBulletins", "regions", "etag", "loadBulletinsFromServer", "observe", "loadExternalBulletins", "date0", "server", "Authorization", "accessToken", "apiUrl", "switchMap", "latest", "endsWith", "filter", "isInternalRegion", "loadCaamlBulletins", "loadJsonBulletins", "saveBulletins", "newBulletins", "setTrainingBulletins", "jsonBulletins", "createBulletin", "bulletin", "id", "crypto", "randomUUID", "put", "updateBulletin", "getId", "deleteBulletin", "delete", "submitBulletins", "publishBulletins", "changeBulletins", "publishAllBulletins", "sendEmail", "language", "sendTestEmail", "triggerTelegramChannel", "triggerTestTelegramChannel", "triggerPushNotifications", "triggerTestPushNotifications", "checkBulletins", "loadLockedBulletins", "clear", "warn", "isLocked", "bulletinId", "has", "getUserEmail", "getEmail", "lockBulletin", "setBulletin", "setUserName", "setUserEmail", "setLock", "next", "unlockBulletin", "getUserName", "getStressLevelColor", "stress0", "colorDangerRatingLow", "colorDangerRatingModerate", "colorDangerRatingConsiderable", "colorDangerRatingHigh", "colorDangerRatingMissing", "getStressLevelIcon", "emitAccordionChanged", "event", "factory", "\u0275fac", "CopyService", "constructor", "constantsService", "inject", "ConstantsService", "copyTextcat", "copyBulletin", "isCopyTextcat", "setCopyTextcat", "getTextTextcat", "textTextcat", "setTextTextcat", "resetCopyTextcat", "undefined", "texts", "isCopyBulletin", "setCopyBulletin", "getBulletin", "bulletin", "setBulletin", "resetCopyBulletin", "setFromLangTexts", "l", "__spreadValues", "toLangTexts", "factory", "\u0275fac", "MediaFileService", "constructor", "http", "inject", "HttpClient", "constantsService", "ConstantsService", "translateService", "TranslateService", "authenticationService", "AuthenticationService", "uploadFile", "date", "file", "text", "important", "url", "getServerUrl", "createSearchParams", "getISOStringWithTimezoneOffset", "getActiveRegionId", "currentLang", "toString", "formData", "FormData", "append", "post", "factory", "\u0275fac", "UndoRedoService", "constructor", "undoStack", "redoStack", "undoRedoActiveBulletin", "type", "activeBulletinID", "isEnabled", "push", "pop", "console", "info", "length", "jsonBulletin", "JSON", "parse", "at", "BulletinModel", "createFromJson", "pushToUndoStack", "bulletin", "getId", "shift", "stringify", "toJson", "initUndoRedoStacksFromServer", "factory", "\u0275fac", "WsUpdateService", "connect", "url", "subject", "create", "console", "debug", "ws", "WebSocket", "observable", "Observable", "obs", "onmessage", "next", "bind", "onerror", "error", "onclose", "complete", "close", "observer", "data", "readyState", "OPEN", "send", "JSON", "stringify", "Subject", "disconnect", "unsubscribe", "factory", "\u0275fac"] }