\\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\"","module.exports = \".scan-wrapper {\\n padding-left: 20%;\\n padding-right: 20%;\\n height: 100%;\\n background-color: #e7ebed; }\\n .scan-wrapper .scan-header {\\n color: #636c72; }\\n .scan-wrapper .btn-scanner {\\n padding: 1rem; }\\n .scan-wrapper-quagga {\\n padding-right: 20%;\\n height: 50%;\\n background-color: #e7ebed; }\\n .scan-wrapper-quagga .scan-header {\\n color: #636c72; }\\n .scan-wrapper-quagga .btn-scanner {\\n padding: 1rem; }\\n .spinner {\\n margin-top: 20%; }\\n /* mobile + tablet */\\n @media only screen and (max-width: 969px) {\\n .scan-wrapper {\\n padding-left: 6%;\\n padding-right: 6%; }\\n .scan-wrapper-quagga {\\n padding-left: 20%;\\n padding-right: 20%; }\\n .viewport {\\n display: flex;\\n width: 100%;\\n height: 80%;\\n -o-object-fit: cover;\\n object-fit: cover; } }\\n /* desktop narrow */\\n @media only screen and (min-width: 970px) and (max-width: 1169px) {\\n .scan-wrapper {\\n padding-left: 10%;\\n padding-right: 10%; } }\\n .viewport::ng-deep video {\\n width: 100%;\\n height: auto;\\n -o-object-fit: cover;\\n object-fit: cover; }\\n .drawingBuffer {\\n display: none !important; }\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY29tcG9uZW50cy9zY2FubmluZy9DOlxcUFBHUmVwb1xcUGFja2FnaW5nVERTX05ld1xcY2xpZW50XFxQYWNrYWdpbmdURFMgR1VJL3NyY1xcYXBwXFxjb21wb25lbnRzXFxzY2FubmluZ1xcc2Nhbm5pbmcuY29tcG9uZW50LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxpQkFBaUI7R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iAgfVxyXG59XHJcbi52aWV3cG9ydDo6bmctZGVlcCB2aWRlbyB7XHJcbiAgd2lkdGg6IDEwMCU7XHJcbiAgaGVpZ2h0OiBhdXRvO1xyXG4gIG9iamVjdC1maXQ6IGNvdmVyO1xyXG59XHJcbi5kcmF3aW5nQnVmZmVye1xyXG4gIGRpc3BsYXk6IG5vbmUgIWltcG9ydGFudDtcclxufVxyXG4iXX0= */\"","import { Component, OnInit, ViewChild } from '@angular/core';\r\nimport { ZXingScannerComponent } from '@zxing/ngx-scanner';\r\nimport { ProductService } from 'src/app/services/ProductService';\r\nimport { ResponseCode } from 'src/app/models/responses/ResponseCode';\r\nimport { Router, NavigationEnd } from '@angular/router';\r\nimport { ToastrService } from 'ngx-toastr';\r\nimport { TranslateService } from '@ngx-translate/core';\r\nimport { BarcodeFormat } from '@zxing/library';\r\n\r\ndeclare var Quagga: any;\r\n@Component({\r\n selector: 'app-scanning',\r\n templateUrl: './scanning.component.html',\r\n styleUrls: ['./scanning.component.scss']\r\n})\r\nexport class ScanningComponent implements OnInit {\r\n @ViewChild('scanner')\r\n private scanner: ZXingScannerComponent;\r\n private hasCameras = false;\r\n private hasPermission: boolean;\r\n\r\n public isScannerVisible = false;\r\n public selectedDevice: MediaDeviceInfo;\r\n public scannedCode: string = null;\r\n public showNoProductFoundError = false;\r\n public allowedFormats = [ BarcodeFormat.QR_CODE, BarcodeFormat.CODE_128, BarcodeFormat.CODE_39];\r\n public checkScanner = true;\r\n\r\n constructor(\r\n private productService: ProductService,\r\n private router: Router,\r\n private translate: TranslateService,\r\n private toastr: ToastrService\r\n ) {\r\n router.events.subscribe(event => {\r\n if (event instanceof NavigationEnd) {\r\n if (event.url === '/no-product') {\r\n this.router.navigate(['scan']);\r\n }\r\n }\r\n });\r\n }\r\n\r\n ngOnInit(): void {\r\n Quagga.stop();\r\n // this.initializeScanner();\r\n this.initQuaggaScanner();\r\n }\r\n ngOnChange(): void {\r\n Quagga.stop();\r\n }\r\n // Init zxing scanner\r\n initializeScanner() {\r\n this.scanner.camerasFound.subscribe((devices: MediaDeviceInfo[]) => {\r\n this.hasCameras = true;\r\n\r\n let deviceToBeSelected: MediaDeviceInfo = null;\r\n\r\n // try to find back camera\r\n for (const device of devices) {\r\n if (/back|rear|environment/gi.test(device.label)) {\r\n deviceToBeSelected = device;\r\n break;\r\n }\r\n }\r\n\r\n // if back camera is not found take first camera\r\n if (!deviceToBeSelected) {\r\n for (const device of devices) {\r\n deviceToBeSelected = device;\r\n break;\r\n }\r\n }\r\n\r\n this.scanner.changeDevice(deviceToBeSelected);\r\n this.selectedDevice = deviceToBeSelected;\r\n this.openScanning();\r\n });\r\n\r\n this.scanner.permissionResponse.subscribe((answer: boolean) => {\r\n this.hasPermission = answer;\r\n });\r\n }\r\n initQuaggaScanner() {\r\n const that = this;\r\n Quagga.init({\r\n inputStream : {\r\n name : 'Live',\r\n type : 'LiveStream',\r\n target: document.querySelector('#interactive') // Or '#yourElement' (optional)\r\n },\r\n decoder : {\r\n readers : ['ean_reader', 'ean_5_reader', 'ean_2_reader', 'code_128_reader', 'code_39_reader']\r\n }\r\n }, (err) => {\r\n if (err) {\r\n return;\r\n }\r\n // console.log(\"Initialization finished. Ready to start\");\r\n Quagga.start();\r\n Quagga.onDetected((res) => {\r\n // window.alert(`code: ${res.codeResult.code}`);\r\n if (res.codeResult.code) {\r\n Quagga.stop();\r\n that.getScannedCode(res.codeResult.code);\r\n }\r\n });\r\n });\r\n }\r\n // Function for Zxing library and dont find any product because remove the first character\r\n handleScannedCode(code: string) {\r\n // Remove prefix (labelling convention):\r\n this.scannedCode = (code.startsWith('P') || code.startsWith('T') || code.startsWith('S'))\r\n ? code.substring(1)\r\n : code;\r\n\r\n // Remove text after the last / in the product code\r\n if (this.scannedCode.indexOf('/') > 0) {\r\n this.scannedCode = this.scannedCode.substring(0, this.scannedCode.lastIndexOf('/'));\r\n }\r\n\r\n this.isScannerVisible = false;\r\n this.scanner.resetCodeReader();\r\n this.scanner.scannerEnabled = false;\r\n\r\n this.productService.getProduct(this.scannedCode).subscribe(\r\n response => {\r\n if (response.status.code === ResponseCode.Ok && response.product.id !== null) {\r\n this.toastr.success(`${this.translate.instant('SCANNING.SCAN_OK')}: ${this.scannedCode}`);\r\n this.router.navigate(['/product', this.scannedCode]);\r\n } else {\r\n this.toastr.error(`${this.translate.instant('SCANNING.NO_PRODUCT')}`);\r\n this.router.navigate(['/no-product']);\r\n }\r\n },\r\n () => {\r\n this.toastr.error(`${this.translate.instant('SCANNING.NO_PRODUCT')}`);\r\n this.router.navigate(['/no-product']);\r\n }\r\n );\r\n }\r\n getScannedCode(code: string) {\r\n this.scannedCode = (code.startsWith('P') || code.startsWith('T') || code.startsWith('S'))\r\n ? code.substring(1)\r\n : code;\r\n\r\n // Remove text after the last / in the product code\r\n if (this.scannedCode.indexOf('/') > 0) {\r\n this.scannedCode = this.scannedCode.substring(0, this.scannedCode.lastIndexOf('/'));\r\n }\r\n\r\n this.productService.getProduct(this.scannedCode).subscribe(\r\n response => {\r\n if (response.status.code === ResponseCode.Ok && response.product.id !== null) {\r\n this.toastr.success(`${this.translate.instant('SCANNING.SCAN_OK')}: ${this.scannedCode}`);\r\n this.router.navigate(['/product', this.scannedCode]);\r\n } else {\r\n this.toastr.error(`${this.translate.instant('SCANNING.NO_PRODUCT')}`);\r\n this.router.navigate(['/no-product']);\r\n }\r\n },\r\n () => {\r\n this.toastr.error(`${this.translate.instant('SCANNING.NO_PRODUCT')}`);\r\n this.router.navigate(['/no-product']);\r\n }\r\n );\r\n }\r\n onDeviceSelectChange(selectedValue: string) {\r\n this.selectedDevice = this.scanner.getDeviceById(selectedValue);\r\n }\r\n\r\n openScanning() {\r\n this.showNoProductFoundError = false;\r\n if (this.hasCameras && this.hasPermission && this.selectedDevice != null) {\r\n this.isScannerVisible = true;\r\n this.scanner.scannerEnabled = true;\r\n this.scanner.restartScan();\r\n }\r\n }\r\n}\r\n","module.exports = \"
\\r\\n \\r\\n clear\\r\\n
\\r\\n\"","module.exports = \".search-field-wrapper {\\n position: relative; }\\n .search-field-wrapper .search-field {\\n width: 100%;\\n padding-right: 30px; }\\n .search-field-wrapper .clear-search-field {\\n position: absolute;\\n top: 6px;\\n right: 6px;\\n font-size: 28px;\\n color: #999999;\\n cursor: pointer; }\\n .search-field-wrapper input::-ms-clear {\\n display: none; }\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY29tcG9uZW50cy9zZWFyY2gtZmllbGQvQzpcXFBQR1JlcG9cXFBhY2thZ2luZ1REU19OZXdcXGNsaWVudFxcUGFja2FnaW5nVERTIEdVSS9zcmNcXGFwcFxcY29tcG9uZW50c1xcc2VhcmNoLWZpZWxkXFxzZWFyY2gtZmllbGQuY29tcG9uZW50LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7RUFDRSxrQkFBa0IsRUFBQTtFQURwQjtJQUlJLFdBQVc7SUFDWCxtQkFBbUIsRUFBQTtFQUx2QjtJQVNJLGtCQUFrQjtJQUNsQixRQUFRO0lBQ1IsVUFBVTtJQUNWLGVBQWU7SUFDZixjQUFjO0lBQ2QsZUFBZSxFQUFBO0VBZG5CO0lBa0JJLGFBQWEsRUFBQSIsImZpbGUiOiJzcmMvYXBwL2NvbXBvbmVudHMvc2VhcmNoLWZpZWxkL3NlYXJjaC1maWVsZC5jb21wb25lbnQuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5zZWFyY2gtZmllbGQtd3JhcHBlciB7XHJcbiAgcG9zaXRpb246IHJlbGF0aXZlO1xyXG5cclxuICAmIC5zZWFyY2gtZmllbGQge1xyXG4gICAgd2lkdGg6IDEwMCU7XHJcbiAgICBwYWRkaW5nLXJpZ2h0OiAzMHB4O1xyXG4gIH1cclxuXHJcbiAgJiAuY2xlYXItc2VhcmNoLWZpZWxkIHtcclxuICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcclxuICAgIHRvcDogNnB4O1xyXG4gICAgcmlnaHQ6IDZweDtcclxuICAgIGZvbnQtc2l6ZTogMjhweDtcclxuICAgIGNvbG9yOiAjOTk5OTk5O1xyXG4gICAgY3Vyc29yOiBwb2ludGVyO1xyXG4gIH1cclxuXHJcbiAgaW5wdXQ6Oi1tcy1jbGVhciB7XHJcbiAgICBkaXNwbGF5OiBub25lO1xyXG4gIH1cclxufVxyXG4iXX0= */\"","import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\r\nimport { FormGroup, FormBuilder, AbstractControl } from '../../../../node_modules/@angular/forms';\r\n\r\n@Component({\r\n selector: 'app-search-field',\r\n templateUrl: './search-field.component.html',\r\n styleUrls: ['./search-field.component.scss']\r\n})\r\nexport class SearchFieldComponent implements OnInit {\r\n // 3 seconds as default\r\n @Input() timeoutMillis = 3000;\r\n @Output() typingEnded: EventEmitter
= new EventEmitter();\r\n private call: any = null;\r\n public searchFieldGroup: FormGroup;\r\n private searchField: AbstractControl;\r\n\r\n constructor(private formBuilder: FormBuilder) {\r\n this.searchFieldGroup = this.formBuilder.group({\r\n search: ['']\r\n });\r\n this.searchField = this.searchFieldGroup.controls.search;\r\n }\r\n\r\n ngOnInit() { }\r\n\r\n private cancelCall() {\r\n if (this.call !== null) {\r\n clearTimeout(this.call);\r\n }\r\n }\r\n\r\n onKeyUp() {\r\n this.cancelCall();\r\n\r\n this.call = setTimeout(() => {\r\n this.typingEnded.emit([this.searchField.value]);\r\n this.call = null;\r\n }, this.timeoutMillis);\r\n }\r\n\r\n clearField() {\r\n this.cancelCall();\r\n\r\n if (this.searchField.value !== '') {\r\n this.searchField.setValue('');\r\n this.typingEnded.emit([this.searchField.value]);\r\n }\r\n }\r\n\r\n public getValue(): string {\r\n return this.searchField.value;\r\n }\r\n\r\n public setValue(value: string) {\r\n this.searchField.setValue(value);\r\n }\r\n}\r\n","module.exports = \"\\r\\n\"","module.exports = \"\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsImZpbGUiOiJzcmMvYXBwL2NvbXBvbmVudHMvc2lnbi1pbi9zaWduLWluLmNvbXBvbmVudC5zY3NzIn0= */\"","import { Component, OnInit } from '@angular/core';\r\nimport { AuthService } from 'src/app/services/AuthService';\r\n\r\n@Component({\r\n selector: 'app-sign-in',\r\n templateUrl: './sign-in.component.html',\r\n styleUrls: ['./sign-in.component.scss']\r\n})\r\nexport class SignInComponent implements OnInit {\r\n\r\n constructor(private authService: AuthService) { }\r\n\r\n ngOnInit() {\r\n this.authService.signIn();\r\n }\r\n}\r\n","module.exports = \"\"","module.exports = \".spinner-loading {\\n width: 75px;\\n height: 75px;\\n border-radius: 50%;\\n border: 5px solid #ddebf3;\\n border-left-color: #3c83af;\\n background: transparent;\\n -webkit-animation: rotate-spinner 0.8s linear infinite;\\n animation: rotate-spinner 0.8s linear infinite;\\n position: relative;\\n top: calc(50% - 39px);\\n left: calc(50% - 39px); }\\n\\n@-webkit-keyframes rotate-spinner {\\n from {\\n -webkit-transform: rotate(0);\\n transform: rotate(0); }\\n to {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg); } }\\n\\n@keyframes rotate-spinner {\\n from {\\n -webkit-transform: rotate(0);\\n transform: rotate(0); }\\n to {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg); } }\\n\\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNyYy9hcHAvY29tcG9uZW50cy9zcGlubmVyL0M6XFxQUEdSZXBvXFxQYWNrYWdpbmdURFNfTmV3XFxjbGllbnRcXFBhY2thZ2luZ1REUyBHVUkvc3JjXFxhcHBcXGNvbXBvbmVudHNcXHNwaW5uZXJcXHNwaW5uZXIuY29tcG9uZW50LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBSUE7RUFDRSxXQUhtQjtFQUluQixZQUptQjtFQUtuQixrQkFBa0I7RUFD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yXG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcclxuICB0b3A6IGNhbGMoNTAlIC0gMzlweCk7XHJcbiAgbGVmdDogY2FsYyg1MCUgLSAzOXB4KTtcclxufVxyXG5cclxuQGtleWZyYW1lcyByb3RhdGUtc3Bpbm5lciB7XHJcbiAgZnJvbSB7XHJcbiAgICB0cmFuc2Zvcm06IHJvdGF0ZSgwKTtcclxuICB9XHJcbiAgdG8ge1xyXG4gICAgdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTtcclxuICB9XHJcbn1cclxuIl19 */\"","import { Component, OnInit } from '@angular/core';\r\n\r\n@Component({\r\n selector: 'app-spinner',\r\n templateUrl: './spinner.component.html',\r\n styleUrls: ['./spinner.component.scss']\r\n})\r\nexport class SpinnerComponent implements OnInit {\r\n\r\n constructor() { }\r\n\r\n ngOnInit() {\r\n }\r\n\r\n}\r\n","import { Directive, Input } from '@angular/core';\r\nimport { NG_VALIDATORS, Validator, FormControl } from '@angular/forms';\r\n\r\n@Directive({\r\n selector: '[appMin][formControlName],[appMin][formControl],[appMin][ngModel]',\r\n providers: [{ provide: NG_VALIDATORS, useExisting: MinValidatorDirective, multi: true }]\r\n})\r\nexport class MinValidatorDirective {\r\n @Input()\r\n appMin: number;\r\n\r\n validate(c: FormControl): { [key: string]: any } {\r\n const v = c.value;\r\n return (v < this.appMin) ? { appMin: true } : null;\r\n }\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router';\r\nimport { Observable, of } from 'rxjs';\r\nimport { tap, map } from 'rxjs/operators';\r\nimport { AuthService } from '../services/AuthService';\r\nimport { Environment } from 'src/environments/environment';\r\nimport { EnvironmentService } from '../services/EnvironmentService';\r\nimport { UserService } from '../services/UserService';\r\nimport { User } from '../models/User';\r\nimport { UserResponse } from '../models/responses/UserResponse';\r\n\r\n@Injectable()\r\nexport class AuthorizationGuard implements CanActivate {\r\n private route: ActivatedRouteSnapshot;\r\n\r\n constructor(\r\n private router: Router,\r\n private authService: AuthService,\r\n private environmentService: EnvironmentService,\r\n private userService: UserService) { }\r\n\r\n canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable {\r\n this.route = route;\r\n return this.checkUser();\r\n }\r\n\r\n private checkUser(): Observable {\r\n return this.authService.getIsLoggedIn().pipe(\r\n tap((isAuthorized: boolean) => {\r\n if (!isAuthorized) {\r\n const environment: Environment = this.environmentService.getEnvironment();\r\n this.router.navigate([environment.authorizationConfig.common.unauthorizedRoute]);\r\n } else {\r\n this.checkOrderRole();\r\n }\r\n })\r\n );\r\n }\r\n\r\n private checkOrderRole() {\r\n if (this.route.data.role === 'order') {\r\n this.userService.getUser().subscribe(\r\n data => {\r\n if (data && data.user && !data.user.canPlaceOrders) {\r\n const environment: Environment = this.environmentService.getEnvironment();\r\n this.router.navigate([environment.authorizationConfig.common.unauthorizedRoute]);\r\n }\r\n },\r\n () => { }\r\n );\r\n }\r\n }\r\n}\r\n","import { HttpInterceptor, HttpHandler, HttpRequest, HttpEvent, HttpErrorResponse } from '@angular/common/http';\r\nimport { OidcSecurityService } from 'angular-auth-oidc-client';\r\nimport { Observable, of, throwError } from 'rxjs';\r\nimport { Injector, Injectable } from '@angular/core';\r\nimport { catchError } from 'rxjs/operators';\r\nimport { Router } from '@angular/router';\r\nimport { EnvironmentService } from '../services/EnvironmentService';\r\nimport { Environment } from 'src/environments/environment';\r\n\r\n@Injectable()\r\nexport class AuthInterceptor implements HttpInterceptor {\r\n private oidcSecurityService: OidcSecurityService;\r\n\r\n constructor(\r\n private injector: Injector,\r\n private router: Router,\r\n private environmentService: EnvironmentService) { }\r\n\r\n intercept(req: HttpRequest, next: HttpHandler): Observable> {\r\n let requestToForward = req;\r\n\r\n if (this.oidcSecurityService === undefined) {\r\n this.oidcSecurityService = this.injector.get(OidcSecurityService);\r\n }\r\n\r\n if (this.oidcSecurityService !== undefined) {\r\n const token = this.oidcSecurityService.getToken();\r\n if (token !== '') {\r\n requestToForward = req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`\r\n }\r\n });\r\n }\r\n }\r\n\r\n return next.handle(requestToForward).pipe(\r\n catchError((error: any) => {\r\n if (error instanceof HttpErrorResponse) {\r\n const environment: Environment = this.environmentService.getEnvironment();\r\n\r\n switch (error.status) {\r\n case 401:\r\n this.router.navigate([environment.authorizationConfig.common.unauthorizedRoute]);\r\n return of(error as any);\r\n case 403:\r\n this.router.navigate(\r\n [environment.authorizationConfig.common.forbiddenRoute],\r\n { state: { error: error.error } }\r\n );\r\n return of(error as any);\r\n }\r\n }\r\n\r\n return throwError(error);\r\n })\r\n );\r\n }\r\n}\r\n","export enum AuthorizationState {\r\n Unverified = 0,\r\n Active = 1,\r\n Disabled = 2\r\n}\r\n","export enum Languages {\r\n English = 'en-us',\r\n German = 'de-de',\r\n French = 'fr-fr',\r\n Italian = 'it-it',\r\n 'Spanish (Mexico)' = 'es-mx',\r\n 'Spanish (Spain)' = 'es-es',\r\n 'Portuguese (Brazil)' = 'pt-br',\r\n Russian = 'ru-ru',\r\n Polish = 'pl-pl',\r\n Chinese = 'zh-cn',\r\n 'Chinese (Traditional)' = 'zh-tw',\r\n Thai = 'th-th',\r\n 'Korean (South Korea)' = 'ko-kr',\r\n Indonesian = 'id-id',\r\n Vietnamese = 'vi-vn'\r\n}\r\n","import { OrderItems } from './OrderItems';\r\nimport { OrderAddress } from './OrderAddress';\r\n\r\nexport class Order {\r\n public orderId: string;\r\n\r\n public orderNumber: number;\r\n\r\n public customerId: number;\r\n\r\n public orderStatus: string;\r\n\r\n public createdByUserId: number;\r\n\r\n public lineItemCount: number;\r\n\r\n public orderItems: OrderItems[] = [];\r\n\r\n public orderDate: string;\r\n\r\n public requiredDate: string;\r\n\r\n public customerName: string;\r\n\r\n public poNumber: string;\r\n\r\n public address: OrderAddress;\r\n}\r\n","\r\nexport class OrderItems {\r\n public orderItemId: number;\r\n\r\n public productId: number;\r\n\r\n public productCode: string;\r\n\r\n public quantity: number;\r\n\r\n public price: number;\r\n\r\n public lineNumber: number;\r\n\r\n public extendedPriceClient: number;\r\n\r\n public uom: string;\r\n\r\n public customerProductCode: string;\r\n\r\n}\r\n","export class OrderSearch {\r\n public userId: number;\r\n\r\n public customerId: number;\r\n\r\n public orderId: string;\r\n\r\n public orderStatus: string;\r\n\r\n public orderCustomerId: number;\r\n\r\n public orderUserId: number;\r\n\r\n public orderNumber: number;\r\n}\r\n","import { Customer } from './Customer';\r\n\r\nexport class User {\r\n\r\n public emailAddress: string;\r\n\r\n public firstName: string;\r\n\r\n public lastName: string;\r\n\r\n public companyId: number;\r\n\r\n public customer: Customer;\r\n\r\n public isInternal: boolean;\r\n\r\n public canPlaceOrders: boolean;\r\n\r\n public userRegion: number;\r\n\r\n}\r\n","export enum ResponseCode {\r\n Ok = 0,\r\n InternalServerError = 1,\r\n ProductNotFound = 2\r\n}\r\n","import { OidcConfigService, OidcSecurityService, OpenIDImplicitFlowConfiguration, AuthWellKnownEndpoints } from 'angular-auth-oidc-client';\r\nimport { Injectable } from '@angular/core';\r\nimport { Subscription, Observable } from 'rxjs';\r\nimport { filter, take } from 'rxjs/operators';\r\nimport { EnvironmentService } from './EnvironmentService';\r\nimport { AuthConfig } from 'src/environments/AuthorizationSetting';\r\nimport { Environment } from 'src/environments/environment';\r\n\r\nexport enum AuthType {\r\n ADFS = 'ADFS',\r\n ADB2C = 'ADB2C'\r\n}\r\n\r\n@Injectable()\r\nexport class AuthService {\r\n private readonly authTypeStorageItemName: string = 'auth-type';\r\n private readonly adb2cResponseFragmentFirstArgumentName: string = 'state';\r\n private readonly adfsResponseFragmentFirstArgumentName: string = 'access_token';\r\n\r\n private isLoggedInSubscriptions: Subscription[] = [];\r\n\r\n constructor(\r\n private oidcConfigService: OidcConfigService,\r\n private oidcSecurityService: OidcSecurityService,\r\n private environmentService: EnvironmentService) { }\r\n\r\n authorizationCallback() {\r\n const type: AuthType = this.getType();\r\n const responseFragmentFirstArgumentName = this.getResponseFragmentFirstArgumentName(type);\r\n const hash = this.getTokenHash(responseFragmentFirstArgumentName);\r\n\r\n if (hash) {\r\n this.oidcSecurityService.authorizedImplicitFlowCallback(hash);\r\n }\r\n }\r\n\r\n configure(type?: AuthType) {\r\n if (!type) {\r\n type = this.getType();\r\n }\r\n\r\n if (type) {\r\n this.configure_internal(type);\r\n } else {\r\n // window.location.href = this.environmentService.getEnvironment().authorizationConfig.common.postLogoutRedirectUrl;\r\n this.configure_internal(AuthType.ADB2C);\r\n }\r\n }\r\n\r\n getIsLoggedIn(): Observable {\r\n return this.oidcSecurityService.getIsAuthorized();\r\n }\r\n\r\n signIn() {\r\n this.oidcSecurityService.getIsModuleSetup().pipe(\r\n filter((isModuleSetup: boolean) => isModuleSetup),\r\n take(1)\r\n ).subscribe(() => {\r\n const config = this.getConfig(this.getType());\r\n\r\n if (config.resourceId) {\r\n this.oidcSecurityService.setCustomRequestParameters({\r\n resource: config.resourceId\r\n });\r\n }\r\n\r\n this.oidcSecurityService.authorize();\r\n });\r\n }\r\n\r\n signOut() {\r\n this.clear();\r\n this.oidcSecurityService.logoff();\r\n }\r\n\r\n resetPassword() {\r\n const config: AuthConfig = this.getConfig(AuthType.ADB2C);\r\n\r\n window.location.href = `${config.passResetUrl}?p=${config.passResetPolicy}&client_id=${config.clientId}\r\n &nonce=defaultNonce&redirect_uri=${window.location.origin}\r\n &scope=${config.passResetScope}&response_type=${config.passResetResponseType}&prompt=login`;\r\n }\r\n\r\n private clear() {\r\n if (this.isLoggedInSubscriptions) {\r\n this.isLoggedInSubscriptions.forEach(subscription => {\r\n subscription.unsubscribe();\r\n });\r\n }\r\n\r\n this.isLoggedInSubscriptions = [];\r\n localStorage.removeItem(this.authTypeStorageItemName);\r\n sessionStorage.removeItem('user');\r\n }\r\n\r\n private configure_internal(type: AuthType) {\r\n this.setType(type);\r\n const config: AuthConfig = this.getConfig(type);\r\n\r\n this.oidcConfigService.load_using_custom_stsServer(config.metadataUrl);\r\n this.oidcConfigService.onConfigurationLoaded.subscribe(() => {\r\n const environment: Environment = this.environmentService.getEnvironment();\r\n const openIDImplicitFlowConfiguration = new OpenIDImplicitFlowConfiguration();\r\n openIDImplicitFlowConfiguration.stsServer = config.stsServerUrl;\r\n openIDImplicitFlowConfiguration.client_id = config.clientId;\r\n openIDImplicitFlowConfiguration.scope = config.scope;\r\n openIDImplicitFlowConfiguration.redirect_url = environment.authorizationConfig.common.redirectUrl;\r\n openIDImplicitFlowConfiguration.response_type = environment.authorizationConfig.common.responseType;\r\n openIDImplicitFlowConfiguration.post_logout_redirect_uri = environment.authorizationConfig.common.postLogoutRedirectUrl;\r\n openIDImplicitFlowConfiguration.post_login_route = environment.authorizationConfig.common.postLoginRoute;\r\n openIDImplicitFlowConfiguration.forbidden_route = environment.authorizationConfig.common.forbiddenRoute;\r\n openIDImplicitFlowConfiguration.unauthorized_route = environment.authorizationConfig.common.unauthorizedRoute;\r\n openIDImplicitFlowConfiguration.auto_userinfo = environment.authorizationConfig.common.autoUserInfo;\r\n openIDImplicitFlowConfiguration.log_console_warning_active = environment.authorizationConfig.common.enableLogs;\r\n openIDImplicitFlowConfiguration.log_console_debug_active = environment.authorizationConfig.common.enableLogs;\r\n openIDImplicitFlowConfiguration.max_id_token_iat_offset_allowed_in_seconds =\r\n environment.authorizationConfig.common.maxIdTokenIATOffsetAllowedInSeconds;\r\n openIDImplicitFlowConfiguration.storage = environment.authorizationConfig.common.storage;\r\n openIDImplicitFlowConfiguration.silent_renew = environment.authorizationConfig.common.renewToken;\r\n openIDImplicitFlowConfiguration.silent_renew_url = environment.authorizationConfig.common.renewTokenUrl;\r\n openIDImplicitFlowConfiguration.silent_renew_offset_in_seconds = config.renewTokenSecondsOffset;\r\n\r\n const authWellKnownEndpoints = new AuthWellKnownEndpoints();\r\n authWellKnownEndpoints.setWellKnownEndpoints(this.oidcConfigService.wellKnownEndpoints);\r\n\r\n this.oidcSecurityService.setupModule(openIDImplicitFlowConfiguration, authWellKnownEndpoints);\r\n });\r\n }\r\n\r\n private getConfig(type: AuthType) {\r\n const environment: Environment = this.environmentService.getEnvironment();\r\n switch (type) {\r\n case AuthType.ADB2C:\r\n case AuthType.ADFS:\r\n return environment.authorizationConfig.ADB2C;\r\n \r\n // return environment.authorizationConfig.ADFS;\r\n default:\r\n // return undefined;\r\n return environment.authorizationConfig.ADB2C;\r\n }\r\n }\r\n\r\n private getResponseFragmentFirstArgumentName(type: AuthType) {\r\n switch (type) {\r\n case AuthType.ADB2C:\r\n case AuthType.ADFS:\r\n return this.adb2cResponseFragmentFirstArgumentName;\r\n \r\n // return this.adfsResponseFragmentFirstArgumentName;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n\r\n private getTokenHash(fragmentFirstParameterName: string) {\r\n if (typeof location !== undefined && window.location.hash) {\r\n const indexHash = window.location.hash.indexOf(fragmentFirstParameterName);\r\n return indexHash > -1 && window.location.hash.substr(indexHash);\r\n }\r\n }\r\n\r\n private getType() {\r\n const type = localStorage.getItem(this.authTypeStorageItemName);\r\n\r\n switch (type) {\r\n case AuthType.ADB2C.toString():\r\n case AuthType.ADFS.toString():\r\n return AuthType.ADB2C;\r\n \r\n //return AuthType.ADFS;\r\n default:\r\n return undefined;\r\n }\r\n }\r\n\r\n private setType(type: AuthType) {\r\n localStorage.setItem(this.authTypeStorageItemName, type.toString());\r\n }\r\n}\r\n","import { Injectable } from '../../../node_modules/@angular/core';\r\nimport { ServiceBase } from './ServiceBase';\r\nimport { Observable } from '../../../node_modules/rxjs';\r\nimport { EnvironmentService } from './EnvironmentService';\r\n\r\n@Injectable()\r\nexport class DocumentService {\r\n constructor(\r\n private serviceBase: ServiceBase,\r\n private environmentService: EnvironmentService,\r\n ) { }\r\n\r\n getApplicationDataSheetFile(productId: string, runConditionId: string, lang: string): Observable {\r\n return this.serviceBase.getBlob(`/document/ads/${productId}?runConditionId=${runConditionId}&lang=${lang}`);\r\n }\r\n\r\n getProductDataSheetFile(productId: string, lang: string): Observable {\r\n return this.serviceBase.getBlob(`/document/pds/${productId}?lang=${lang}`);\r\n }\r\n\r\n getSafetyDataSheetUrl(productId: string, lang: string) {\r\n let env: string;\r\n this.environmentService.getEnvironment().production ? env = '' : env = 'stg';\r\n const langCodes = lang.split('-');\r\n productId = productId.split(' ')[0];\r\n lang = `${langCodes[0]}-${langCodes[1].toUpperCase()}`;\r\n // tslint:disable-next-line:max-line-length\r\n return `https://${env}buyat.ppg.com/EHSDocumentManagerPublic/documentSearch.aspx?FolderID1=87&SearchAllPublicFolders=True&CodeCondition=BeginsWith&CodeValue=${productId}&SuppressSearchControls=True`;\r\n }\r\n\r\n getSafetyDataSheetUrlSDS(id: string, productId: string, lang: string) {\r\n let env: string;\r\n this.environmentService.getEnvironment().production ? env = '' : env = 'stg';\r\n const langCodes = lang.split('-');\r\n productId = productId.split(' ')[0];\r\n lang = `${langCodes[0]}-${langCodes[1].toUpperCase()}`;\r\n\r\n return this.serviceBase.get(`/product/ValidateSds/${id}`);\r\n }\r\n\r\n getEnvUrl() {\r\n let env: string;\r\n this.environmentService.getEnvironment().production ? env = '' : env = 'stg';\r\n\r\n return env;\r\n }\r\n\r\n getVocFile(productId: string): Observable {\r\n return this.serviceBase.getBlob(`/document/voc/${productId}`);\r\n }\r\n\r\n getCoaFile(parentItem: string, lotNumber: string): Observable {\r\n return this.serviceBase.getBlob(`/document/coa/${parentItem}?lotNumber=${lotNumber}`);\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Environment } from 'src/environments/environment';\r\nimport { local, dev, test, prd } from 'src/environments/EnvironmentDefinitions';\r\n\r\n@Injectable()\r\nexport class EnvironmentService {\r\n constructor() {\r\n const hostname: string = window.location.hostname.toLowerCase().trim();\r\n this.environment = EnvironmentService.urlToEnvironment[hostname];\r\n }\r\n\r\n private static urlToEnvironment: {[key: string]: Environment} = {\r\n localhost: local,\r\n 'devpackagingtdsspa.z20.web.core.windows.net': dev,\r\n 'testpackagingtdsspa.z20.web.core.windows.net': test,\r\n 'packagingtdsspa.z20.web.core.windows.net': prd,\r\n 'packaging.ppg.com': prd,\r\n };\r\n\r\n private environment: Environment;\r\n\r\n getEnvironment(): Environment {\r\n return this.environment;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\n@Injectable()\r\nexport class InternalDataTransferService {\r\n private storage: any;\r\n public constructor() { }\r\n\r\n public setStorage(storage: any) {\r\n this.storage = storage;\r\n }\r\n\r\n public getStorage(): any {\r\n return this.storage;\r\n }\r\n}\r\n","import { Injectable } from '../../../node_modules/@angular/core';\r\nimport { ServiceBase } from './ServiceBase';\r\nimport { Observable } from '../../../node_modules/rxjs';\r\nimport { HttpHeaders, HttpParams } from '../../../node_modules/@angular/common/http';\r\nimport { OrderResponse } from '../models/responses/OrderResponse';\r\nimport { CopyOrderResponse } from '../models/responses/CopyOrderResponse';\r\nimport { UpsertOrderResponse } from '../models/responses/UpsertOrderResponse';\r\nimport { SubmitOrderResponse } from '../models/responses/SubmitOrderResponse';\r\nimport { GetOrderAddressResponse } from '../models/responses/GetOrderAddressResponse';\r\nimport { Order } from '../models/Order';\r\nimport { OrderSearch } from '../models/OrderSearch';\r\n\r\n@Injectable()\r\nexport class OrderService {\r\n constructor(private serviceBase: ServiceBase) { }\r\n\r\n UpsertOrder(orderReq: Order, cartFunc: string): Observable {\r\n let headers: HttpHeaders = new HttpHeaders();\r\n headers = headers.set('Content-Type', 'application/json');\r\n\r\n return this.serviceBase.postWithOptions(`/order/UpsertOrder?cartFunc=${cartFunc}`, JSON.stringify(orderReq), headers, null);\r\n }\r\n\r\n CopyOrder(orderReq: Order): Observable {\r\n let headers: HttpHeaders = new HttpHeaders();\r\n headers = headers.set('Content-Type', 'application/json');\r\n\r\n return this.serviceBase.postWithOptions('/order/CopyOrder', JSON.stringify(orderReq), headers, null);\r\n }\r\n\r\n SubmitOrder(orderId: string): Observable {\r\n let headers: HttpHeaders = new HttpHeaders();\r\n headers = headers.set('Content-Type', 'application/json');\r\n\r\n return this.serviceBase.postWithOptions(`/order/SubmitOrder/${orderId}`, null, headers, null);\r\n }\r\n\r\n GetOrder(orderSearch: OrderSearch): Observable {\r\n let headers: HttpHeaders = new HttpHeaders();\r\n headers = headers.set('Content-Type', 'application/json');\r\n return this.serviceBase.postWithOptions('/order/GetOrder', JSON.stringify(orderSearch), headers, null);\r\n }\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { Router, NavigationEnd } from '@angular/router';\r\n\r\n@Injectable()\r\nexport class PreviousRouteService {\r\n\r\n private previousUrl: string;\r\n private currentUrl: string;\r\n\r\n constructor(private router: Router) {\r\n this.currentUrl = this.router.url;\r\n router.events.subscribe(event => {\r\n if (event instanceof NavigationEnd) {\r\n this.previousUrl = this.currentUrl;\r\n this.currentUrl = event.url;\r\n }\r\n });\r\n }\r\n\r\n public getPreviousUrl() {\r\n return this.previousUrl;\r\n }\r\n}\r\n","import { Injectable } from '../../../node_modules/@angular/core';\r\nimport { ServiceBase } from './ServiceBase';\r\nimport { Observable } from '../../../node_modules/rxjs';\r\nimport { HttpParams } from '../../../node_modules/@angular/common/http';\r\nimport { GetProductListItemsResponse } from '../models/responses/GetProductListItemsResponse';\r\nimport { GetProductResponse } from '../models/responses/GetProductResponse';\r\n\r\n@Injectable()\r\nexport class ProductService {\r\n constructor(private serviceBase: ServiceBase) { }\r\n\r\n getProductList(idOrDescription: string): Observable {\r\n let params: HttpParams = new HttpParams();\r\n params = params.append('idOrDescription', idOrDescription);\r\n return this.serviceBase.get(`/product`, params);\r\n }\r\n\r\n getProduct(id: string): Observable {\r\n return this.serviceBase.get(`/product/${id}`);\r\n }\r\n}\r\n","import { Injectable } from '../../../node_modules/@angular/core';\r\nimport { Observable } from '../../../node_modules/rxjs';\r\nimport { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';\r\nimport { EnvironmentService } from './EnvironmentService';\r\nimport { Params } from '@angular/router';\r\n\r\n@Injectable()\r\nexport class ServiceBase {\r\n private baseURL: string;\r\n\r\n constructor(private http: HttpClient, private environmentService: EnvironmentService) {\r\n this.baseURL = this.environmentService.getEnvironment().apiUrl;\r\n }\r\n\r\n public get(apiUrl: string, params?: HttpParams): Observable {\r\n return this.http.get(this.baseURL + apiUrl, {\r\n params\r\n });\r\n }\r\n\r\n public getBlob(apiUrl: string): Observable {\r\n return this.http.get(this.baseURL + apiUrl, {\r\n responseType: 'blob'\r\n });\r\n }\r\n\r\n public postWithOptions(apiUrl: string, body: T, h?: HttpHeaders, p?: Params): Observable {\r\n return this.http.post(this.baseURL + apiUrl, body, { headers: h, params: p });\r\n }\r\n\r\n public post(apiUrl: string, body: T): Observable {\r\n return this.http.post(this.baseURL + apiUrl, body);\r\n }\r\n}\r\n","import { Injectable } from '../../../node_modules/@angular/core';\r\nimport { ServiceBase } from './ServiceBase';\r\nimport { UserResponse } from '../models/responses/UserResponse';\r\nimport { ResponseCode } from '../models/responses/ResponseCode';\r\nimport { User } from '../models/User';\r\nimport { Observable, of } from '../../../node_modules/rxjs';\r\nimport { tap } from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class UserService {\r\n constructor(private serviceBase: ServiceBase) { }\r\n\r\n getUser(): Observable {\r\n const user = sessionStorage.getItem('user');\r\n\r\n if (user) {\r\n console.log(user);\r\n return of(JSON.parse(user));\r\n } else {\r\n return this.serviceBase.get('/user').pipe(\r\n tap((u: UserResponse) => {\r\n if (u && u.user && u.user.customer) {\r\n u.user.canPlaceOrders = u.user.canPlaceOrders && (u.user.customer.canPlaceOrder ? u.user.customer.canPlaceOrder : false);\r\n } else {\r\n u.user.canPlaceOrders = false;\r\n }\r\n sessionStorage.setItem('user', JSON.stringify(u));\r\n })\r\n );\r\n }\r\n }\r\n SetLogOut(): Observable {\r\n const session = sessionStorage.getItem('user');\r\n if (session == null) return null;\r\n const object = JSON.parse(session);\r\n return this.serviceBase.get(`/event/SetLogOutDate/${object.user.emailAddress}`);\r\n }\r\n}\r\n","import { Environment } from './environment';\r\n\r\nexport const local: Environment = {\r\n production: false,\r\n apiUrl: 'https://localhost:44375/api',\r\n googleAnalyticsId: '',\r\n authorizationConfig: {\r\n ADFS: {\r\n metadataUrl: 'https://ppgadfsproxytest.azurewebsites.net/testsso4.ppg.com/adfs/.well-known/openid-configuration',\r\n stsServerUrl: 'https://testsso4.ppg.com/adfs/',\r\n clientId: 'https://devpackagingtdsspa.z20.web.core.windows.net/',\r\n scope: 'openid',\r\n resourceId: 'https://devpackagingtdsapi.azurewebsites.net/',\r\n renewTokenSecondsOffset: 3570,\r\n passResetUrl: '',\r\n passResetPolicy: '',\r\n passResetScope: '',\r\n passResetResponseType: ''\r\n },\r\n ADB2C: {\r\n metadataUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/' +\r\n 'v2.0/.well-known/openid-configuration?p=B2C_1_PackagingTDS_SignUpSignIn_v2',\r\n stsServerUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/',\r\n clientId: '038b3f6f-f63e-44d1-90c4-322dc6fcc4ae',\r\n scope: 'openid https://ppgindustriesincb2cdev.onmicrosoft.com/api/user_impersonation',\r\n resourceId: null,\r\n renewTokenSecondsOffset: 270,\r\n passResetUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/oauth2/v2.0/authorize',\r\n passResetPolicy: 'B2C_1_PackagingTDS_Password_Reset_v2',\r\n passResetScope: 'openid',\r\n passResetResponseType: 'id_token'\r\n },\r\n common: {\r\n redirectUrl: window.location.origin,\r\n responseType: 'id_token token',\r\n postLogoutRedirectUrl: `${window.location.origin}/#/sign-in?authtype=b2c`,\r\n postLoginRoute: '/products',\r\n forbiddenRoute: '/error/forbidden',\r\n unauthorizedRoute: '/error/unauthorized',\r\n autoUserInfo: false,\r\n enableLogs: true,\r\n maxIdTokenIATOffsetAllowedInSeconds: 30,\r\n storage: localStorage,\r\n renewToken: true,\r\n renewTokenUrl: window.location.origin\r\n }\r\n }\r\n};\r\n\r\nexport const dev: Environment = {\r\n production: false,\r\n apiUrl: 'https://devpackagingtdsapi.azurewebsites.net/api',\r\n googleAnalyticsId: '',\r\n authorizationConfig: {\r\n ADFS: { \r\n //metadataUrl: 'https://testsso4.ppg.com/adfs/.well-known/openid-configuration',\r\n //stsServerUrl: 'https://testsso4.ppg.com/adfs/',\r\n metadataUrl: 'https://login.microsoftonline.com/9dfd1e5e-bb06-40df-8eeb-2a295fe4dda5/.well-known/openid-configuration',\r\n stsServerUrl: 'https://sts.windows.net/9dfd1e5e-bb06-40df-8eeb-2a295fe4dda5/',\r\n clientId: 'cdc58565-c3e9-421b-a589-2dc81505d6f7',\r\n scope: 'openid',\r\n resourceId: 'https://devpackagingtdsapi.azurewebsites.net/',\r\n renewTokenSecondsOffset: 3570,\r\n passResetUrl: '',\r\n passResetPolicy: '',\r\n passResetScope: '',\r\n passResetResponseType: ''\r\n \r\n //tenantName: 'PPGIndustriesInc'\r\n },\r\n ADB2C: {\r\n metadataUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/' +\r\n 'v2.0/.well-known/openid-configuration?p=B2C_1_PackagingTDS_SignUpSignIn_v2',\r\n stsServerUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/',\r\n clientId: '038b3f6f-f63e-44d1-90c4-322dc6fcc4ae',\r\n scope: 'openid https://ppgindustriesincb2cdev.onmicrosoft.com/api/user_impersonation',\r\n resourceId: null,\r\n renewTokenSecondsOffset: 270,\r\n passResetUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/oauth2/v2.0/authorize',\r\n passResetPolicy: 'B2C_1_PackagingTDS_Password_Reset_v2',\r\n passResetScope: 'openid',\r\n passResetResponseType: 'id_token'\r\n },\r\n common: {\r\n redirectUrl: window.location.origin,\r\n responseType: 'id_token token',\r\n postLogoutRedirectUrl: `${window.location.origin}/#/sign-in?authtype=b2c`,\r\n postLoginRoute: '/products',\r\n forbiddenRoute: '/error/forbidden',\r\n unauthorizedRoute: '/error/unauthorized',\r\n autoUserInfo: false,\r\n enableLogs: true,\r\n maxIdTokenIATOffsetAllowedInSeconds: 30,\r\n storage: localStorage,\r\n renewToken: true,\r\n renewTokenUrl: window.location.origin\r\n }\r\n }\r\n};\r\n\r\nexport const test: Environment = {\r\n production: false,\r\n apiUrl: 'https://testpackagingtdsapi.azurewebsites.net/api',\r\n googleAnalyticsId: '',\r\n authorizationConfig: {\r\n ADFS: {\r\n metadataUrl: 'https://testsso4.ppg.com/adfs/.well-known/openid-configuration',\r\n stsServerUrl: 'https://testsso4.ppg.com/adfs/',\r\n clientId: 'https://testpackagingtdsspa.z20.web.core.windows.net/',\r\n scope: 'openid',\r\n resourceId: 'https://testpackagingtdsapi.azurewebsites.net/',\r\n renewTokenSecondsOffset: 3570,\r\n passResetUrl: '',\r\n passResetPolicy: '',\r\n passResetScope: '',\r\n passResetResponseType: ''\r\n },\r\n ADB2C: {\r\n metadataUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/' +\r\n 'v2.0/.well-known/openid-configuration?p=B2C_1_PackagingTDS_SignUpSignIn_v2',\r\n stsServerUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/',\r\n clientId: '038b3f6f-f63e-44d1-90c4-322dc6fcc4ae',\r\n scope: 'openid https://ppgindustriesincb2cdev.onmicrosoft.com/api/user_impersonation',\r\n resourceId: null,\r\n renewTokenSecondsOffset: 270,\r\n passResetUrl: 'https://ppgindustriesincb2cdev.b2clogin.com/ppgindustriesincb2cdev.onmicrosoft.com/oauth2/v2.0/authorize',\r\n passResetPolicy: 'B2C_1_PackagingTDS_Password_Reset_v2',\r\n passResetScope: 'openid',\r\n passResetResponseType: 'id_token'\r\n },\r\n common: {\r\n redirectUrl: window.location.origin,\r\n responseType: 'id_token token',\r\n postLogoutRedirectUrl: `${window.location.origin}/#/sign-in?authtype=b2c`,\r\n postLoginRoute: '/products',\r\n forbiddenRoute: '/error/forbidden',\r\n unauthorizedRoute: '/error/unauthorized',\r\n autoUserInfo: false,\r\n enableLogs: true,\r\n maxIdTokenIATOffsetAllowedInSeconds: 30,\r\n storage: localStorage,\r\n renewToken: true,\r\n renewTokenUrl: window.location.origin\r\n }\r\n }\r\n};\r\n\r\nexport const prd: Environment = {\r\n production: true,\r\n apiUrl: 'https://packagingtdsapi.azurewebsites.net/api',\r\n //googleAnalyticsId: 'UA-168212728-1',\r\n googleAnalyticsId: '',\r\n authorizationConfig: {\r\n ADFS: {\r\n metadataUrl: 'https://sso4.ppg.com/adfs/.well-known/openid-configuration',\r\n stsServerUrl: 'https://sso4.ppg.com/adfs/',\r\n clientId: 'https://packagingtdsspa.z20.web.core.windows.net/',\r\n scope: 'openid',\r\n resourceId: 'https://packagingtdsapi.azurewebsites.net/',\r\n renewTokenSecondsOffset: 0,\r\n passResetUrl: '',\r\n passResetPolicy: '',\r\n passResetScope: '',\r\n passResetResponseType: ''\r\n },\r\n ADB2C: {\r\n metadataUrl: 'https://ppgindustriesincb2cprod.b2clogin.com/ppgindustriesincb2cprod.onmicrosoft.com/' +\r\n 'v2.0/.well-known/openid-configuration?p=B2C_1_PackagingTDS_SignUpSignIn_v2',\r\n stsServerUrl: 'https://ppgindustriesincb2cprod.b2clogin.com/ppgindustriesincb2cprod.onmicrosoft.com/',\r\n clientId: 'b66a5c8c-6a54-4b80-a3cb-beadb0f04d09',\r\n scope: 'openid https://ppgindustriesincb2cprod.onmicrosoft.com/packagingtdsapi/user_impersonation',\r\n resourceId: null,\r\n renewTokenSecondsOffset: 270,\r\n passResetUrl: 'https://ppgindustriesincb2cprod.b2clogin.com/ppgindustriesincb2cprod.onmicrosoft.com/oauth2/v2.0/authorize',\r\n passResetPolicy: 'B2C_1_PackagingTDS_Password_Reset_v2',\r\n passResetScope: 'openid',\r\n passResetResponseType: 'id_token'\r\n },\r\n common: {\r\n redirectUrl: window.location.origin,\r\n responseType: 'id_token token',\r\n postLogoutRedirectUrl: `${window.location.origin}/#/sign-in?authtype=b2c`,\r\n postLoginRoute: '/products',\r\n forbiddenRoute: '/error/forbidden',\r\n unauthorizedRoute: '/error/unauthorized',\r\n autoUserInfo: false,\r\n enableLogs: true,\r\n maxIdTokenIATOffsetAllowedInSeconds: 30,\r\n storage: localStorage,\r\n renewToken: true,\r\n renewTokenUrl: window.location.origin\r\n }\r\n }\r\n};\r\n","import { enableProdMode } from '@angular/core';\r\nimport { platformBrowserDynamic } from '@angular/platform-browser-dynamic';\r\n\r\nimport { AppModule } from './app/app.module';\r\nimport { EnvironmentService } from './app/services/EnvironmentService';\r\n\r\nif (new EnvironmentService().getEnvironment().production) {\r\n enableProdMode();\r\n}\r\n\r\nplatformBrowserDynamic().bootstrapModule(AppModule)\r\n .catch(err => console.error(err));\r\n"],"sourceRoot":""}