@rolatech/angular-services 20.0.0-beta.9 → 20.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, viewChild, ViewContainerRef, OutputEmitterRef, EventEmitter, HostListener, Component, Injectable, PLATFORM_ID, Directive, APP_INITIALIZER, makeEnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { inject, viewChild, ViewContainerRef, OutputEmitterRef, EventEmitter, HostListener, Component, Injectable, signal, computed, PLATFORM_ID, Directive, APP_INITIALIZER, makeEnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions, MatDialogTitle, MatDialogContent, MatDialog } from '@angular/material/dialog';
|
|
4
4
|
import * as i1 from '@angular/material/button';
|
|
5
5
|
import { MatButtonModule } from '@angular/material/button';
|
|
6
|
-
import { switchMap, map, take, BehaviorSubject } from 'rxjs';
|
|
6
|
+
import { switchMap, map, take, BehaviorSubject, Observable, Subject, firstValueFrom } from 'rxjs';
|
|
7
7
|
import _ from 'lodash';
|
|
8
8
|
import { HttpClient, HTTP_INTERCEPTORS } from '@angular/common/http';
|
|
9
9
|
import { APP_CONFIG } from '@rolatech/angular-common';
|
|
10
10
|
import { Location, isPlatformBrowser } from '@angular/common';
|
|
11
|
-
import { Router, NavigationEnd } from '@angular/router';
|
|
12
|
-
import
|
|
13
|
-
import { Breakpoints, MediaMatcher } from '@angular/cdk/layout';
|
|
11
|
+
import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
|
|
12
|
+
import { BreakpointObserver, Breakpoints, MediaMatcher } from '@angular/cdk/layout';
|
|
14
13
|
import { map as map$1, shareReplay, finalize } from 'rxjs/operators';
|
|
15
14
|
import { MatSnackBar } from '@angular/material/snack-bar';
|
|
16
15
|
import { Title } from '@angular/platform-browser';
|
|
@@ -73,10 +72,10 @@ class DialogComponent {
|
|
|
73
72
|
confirm() {
|
|
74
73
|
this.close(this.result || true);
|
|
75
74
|
}
|
|
76
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
77
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0
|
|
75
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
76
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.2.0", type: DialogComponent, isStandalone: true, selector: "rolatech-dialog", host: { listeners: { "keydown.esc": "onEsc()" } }, viewQueries: [{ propertyName: "componentRef", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, isSignal: true }], ngImport: i0, template: "<div class=\"min-w-[320px]\">\n <h1 class=\"text-xl\" mat-dialog-title i18n>{{ data.title }}</h1>\n <mat-dialog-content>\n <div>\n <p i18n>{{ data.message }}</p>\n <ng-template #container></ng-template>\n <!-- <ng-container #container></ng-container> -->\n </div>\n </mat-dialog-content>\n <div class=\"flex-1\"></div>\n <mat-dialog-actions>\n <button mat-button (click)=\"close()\" i18n>{{ data.cancelText ? data.cancelText : 'Cancel' }}</button>\n <button mat-flat-button class=\"w-20\" (click)=\"confirm()\" i18n>{{ data.confirmText ? data.confirmText : 'Ok' }}</button>\n </mat-dialog-actions>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] });
|
|
78
77
|
}
|
|
79
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
78
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DialogComponent, decorators: [{
|
|
80
79
|
type: Component,
|
|
81
80
|
args: [{ selector: 'rolatech-dialog', imports: [MatButtonModule, MatDialogActions, MatDialogTitle, MatDialogContent], template: "<div class=\"min-w-[320px]\">\n <h1 class=\"text-xl\" mat-dialog-title i18n>{{ data.title }}</h1>\n <mat-dialog-content>\n <div>\n <p i18n>{{ data.message }}</p>\n <ng-template #container></ng-template>\n <!-- <ng-container #container></ng-container> -->\n </div>\n </mat-dialog-content>\n <div class=\"flex-1\"></div>\n <mat-dialog-actions>\n <button mat-button (click)=\"close()\" i18n>{{ data.cancelText ? data.cancelText : 'Cancel' }}</button>\n <button mat-flat-button class=\"w-20\" (click)=\"confirm()\" i18n>{{ data.confirmText ? data.confirmText : 'Ok' }}</button>\n </mat-dialog-actions>\n</div>\n" }]
|
|
82
81
|
}], propDecorators: { onEsc: [{
|
|
@@ -132,10 +131,10 @@ class BaseService {
|
|
|
132
131
|
withCredentials,
|
|
133
132
|
});
|
|
134
133
|
}
|
|
135
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
136
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
134
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BaseService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
135
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BaseService, providedIn: 'root' });
|
|
137
136
|
}
|
|
138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BaseService, decorators: [{
|
|
139
138
|
type: Injectable,
|
|
140
139
|
args: [{
|
|
141
140
|
providedIn: 'root',
|
|
@@ -307,10 +306,10 @@ class ProductService extends BaseService {
|
|
|
307
306
|
withCredentials: true,
|
|
308
307
|
});
|
|
309
308
|
}
|
|
310
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
311
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
309
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ProductService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
310
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ProductService, providedIn: 'root' });
|
|
312
311
|
}
|
|
313
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
312
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ProductService, decorators: [{
|
|
314
313
|
type: Injectable,
|
|
315
314
|
args: [{
|
|
316
315
|
providedIn: 'root',
|
|
@@ -383,10 +382,10 @@ class CartService extends BaseService {
|
|
|
383
382
|
withCredentials: true,
|
|
384
383
|
});
|
|
385
384
|
}
|
|
386
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
387
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
385
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CartService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
386
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CartService, providedIn: 'root' });
|
|
388
387
|
}
|
|
389
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
388
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CartService, decorators: [{
|
|
390
389
|
type: Injectable,
|
|
391
390
|
args: [{
|
|
392
391
|
providedIn: 'root',
|
|
@@ -429,10 +428,10 @@ class NavigationService {
|
|
|
429
428
|
}
|
|
430
429
|
return '';
|
|
431
430
|
}
|
|
432
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
433
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
431
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NavigationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
432
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NavigationService, providedIn: 'root' });
|
|
434
433
|
}
|
|
435
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
434
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NavigationService, decorators: [{
|
|
436
435
|
type: Injectable,
|
|
437
436
|
args: [{
|
|
438
437
|
providedIn: 'root',
|
|
@@ -455,10 +454,10 @@ class DialogService {
|
|
|
455
454
|
confirmed() {
|
|
456
455
|
return this.dialogRef.afterClosed().pipe(take(1), map((res) => res));
|
|
457
456
|
}
|
|
458
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
459
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
457
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
458
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DialogService });
|
|
460
459
|
}
|
|
461
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
460
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: DialogService, decorators: [{
|
|
462
461
|
type: Injectable
|
|
463
462
|
}] });
|
|
464
463
|
|
|
@@ -479,10 +478,10 @@ class LoadingService {
|
|
|
479
478
|
async dismiss() {
|
|
480
479
|
this.isLoading = false;
|
|
481
480
|
}
|
|
482
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
483
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
481
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LoadingService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
482
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LoadingService, providedIn: 'root' });
|
|
484
483
|
}
|
|
485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LoadingService, decorators: [{
|
|
486
485
|
type: Injectable,
|
|
487
486
|
args: [{
|
|
488
487
|
providedIn: 'root',
|
|
@@ -530,10 +529,10 @@ class MediaService extends BaseService {
|
|
|
530
529
|
getImageInfo(url) {
|
|
531
530
|
return this.http.get(`${url}?imageInfo`);
|
|
532
531
|
}
|
|
533
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
534
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
532
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: MediaService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
533
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: MediaService, providedIn: 'root' });
|
|
535
534
|
}
|
|
536
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
535
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: MediaService, decorators: [{
|
|
537
536
|
type: Injectable,
|
|
538
537
|
args: [{
|
|
539
538
|
providedIn: 'root',
|
|
@@ -541,20 +540,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
|
|
|
541
540
|
}] });
|
|
542
541
|
|
|
543
542
|
class LayoutService {
|
|
544
|
-
breakpointObserver;
|
|
543
|
+
breakpointObserver = inject(BreakpointObserver);
|
|
544
|
+
route = inject(ActivatedRoute);
|
|
545
|
+
router = inject(Router);
|
|
545
546
|
isHandset$;
|
|
546
|
-
|
|
547
|
-
|
|
547
|
+
_hideFooter = signal(false, ...(ngDevMode ? [{ debugName: "_hideFooter" }] : []));
|
|
548
|
+
hideFooter = computed(() => this._hideFooter(), ...(ngDevMode ? [{ debugName: "hideFooter" }] : []));
|
|
549
|
+
constructor() {
|
|
548
550
|
this.isHandset$ = this.breakpointObserver
|
|
549
551
|
.observe([Breakpoints.Small, Breakpoints.HandsetPortrait])
|
|
550
552
|
.pipe(map$1((result) => result.matches), shareReplay());
|
|
553
|
+
this.router.events
|
|
554
|
+
// .pipe(filter((e): e is NavigationEnd => e instanceof NavigationEnd))
|
|
555
|
+
.subscribe(() => {
|
|
556
|
+
let r = this.route;
|
|
557
|
+
while (r.firstChild)
|
|
558
|
+
r = r.firstChild;
|
|
559
|
+
const hide = r.snapshot.data['hideFooter'] === true;
|
|
560
|
+
this.setHideFooter(hide);
|
|
561
|
+
});
|
|
562
|
+
}
|
|
563
|
+
setHideFooter(v) {
|
|
564
|
+
this._hideFooter.set(v);
|
|
551
565
|
}
|
|
552
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
553
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
566
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LayoutService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
567
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LayoutService });
|
|
554
568
|
}
|
|
555
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
569
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LayoutService, decorators: [{
|
|
556
570
|
type: Injectable
|
|
557
|
-
}], ctorParameters: () => [
|
|
571
|
+
}], ctorParameters: () => [] });
|
|
558
572
|
|
|
559
573
|
class SnackBarService {
|
|
560
574
|
snackBar = inject(MatSnackBar);
|
|
@@ -564,10 +578,10 @@ class SnackBarService {
|
|
|
564
578
|
dismiss() {
|
|
565
579
|
this.snackBar.dismiss();
|
|
566
580
|
}
|
|
567
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
568
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
581
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SnackBarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
582
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SnackBarService });
|
|
569
583
|
}
|
|
570
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SnackBarService, decorators: [{
|
|
571
585
|
type: Injectable
|
|
572
586
|
}] });
|
|
573
587
|
|
|
@@ -632,10 +646,10 @@ class SupportService {
|
|
|
632
646
|
withCredentials: true,
|
|
633
647
|
});
|
|
634
648
|
}
|
|
635
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
636
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
649
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SupportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
650
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SupportService, providedIn: 'root' });
|
|
637
651
|
}
|
|
638
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
652
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SupportService, decorators: [{
|
|
639
653
|
type: Injectable,
|
|
640
654
|
args: [{
|
|
641
655
|
providedIn: 'root',
|
|
@@ -663,10 +677,10 @@ class BreadcrumbService {
|
|
|
663
677
|
relativeTo: route,
|
|
664
678
|
});
|
|
665
679
|
}
|
|
666
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
667
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
680
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BreadcrumbService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
681
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BreadcrumbService, providedIn: 'root' });
|
|
668
682
|
}
|
|
669
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
683
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BreadcrumbService, decorators: [{
|
|
670
684
|
type: Injectable,
|
|
671
685
|
args: [{
|
|
672
686
|
providedIn: 'root',
|
|
@@ -698,10 +712,10 @@ class SidenavService {
|
|
|
698
712
|
this.isCollaped = !this.isMobile && !this.sidenav?.opened;
|
|
699
713
|
}
|
|
700
714
|
lists() { }
|
|
701
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
702
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
715
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SidenavService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
716
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SidenavService });
|
|
703
717
|
}
|
|
704
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
718
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: SidenavService, decorators: [{
|
|
705
719
|
type: Injectable
|
|
706
720
|
}], ctorParameters: () => [] });
|
|
707
721
|
|
|
@@ -739,10 +753,10 @@ class ThemeService {
|
|
|
739
753
|
setDarkTheme(isDarkTheme) {
|
|
740
754
|
this.darkTheme.next(isDarkTheme);
|
|
741
755
|
}
|
|
742
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
743
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
756
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
757
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
744
758
|
}
|
|
745
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
759
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ThemeService, decorators: [{
|
|
746
760
|
type: Injectable,
|
|
747
761
|
args: [{
|
|
748
762
|
providedIn: 'root',
|
|
@@ -840,10 +854,10 @@ class OrderService extends BaseService {
|
|
|
840
854
|
withCredentials: true,
|
|
841
855
|
});
|
|
842
856
|
}
|
|
843
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
844
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
857
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OrderService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
858
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OrderService, providedIn: 'root' });
|
|
845
859
|
}
|
|
846
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OrderService, decorators: [{
|
|
847
861
|
type: Injectable,
|
|
848
862
|
args: [{
|
|
849
863
|
providedIn: 'root',
|
|
@@ -925,10 +939,10 @@ class InventoryService extends BaseService {
|
|
|
925
939
|
adjustStocksByLocationId(data) {
|
|
926
940
|
return this.http.put(`${this.actionUrl}/levels/adjust`, data, { withCredentials: true });
|
|
927
941
|
}
|
|
928
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
929
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
942
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: InventoryService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
943
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: InventoryService, providedIn: 'root' });
|
|
930
944
|
}
|
|
931
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: InventoryService, decorators: [{
|
|
932
946
|
type: Injectable,
|
|
933
947
|
args: [{
|
|
934
948
|
providedIn: 'root',
|
|
@@ -940,10 +954,10 @@ class NotificationStore {
|
|
|
940
954
|
getCount() {
|
|
941
955
|
return this.$count.asObservable();
|
|
942
956
|
}
|
|
943
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
944
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
957
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationStore, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
958
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationStore, providedIn: 'root' });
|
|
945
959
|
}
|
|
946
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
960
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationStore, decorators: [{
|
|
947
961
|
type: Injectable,
|
|
948
962
|
args: [{
|
|
949
963
|
providedIn: 'root',
|
|
@@ -1015,10 +1029,10 @@ class NotificationService {
|
|
|
1015
1029
|
return data;
|
|
1016
1030
|
}));
|
|
1017
1031
|
}
|
|
1018
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1019
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1032
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1033
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationService, providedIn: 'root' });
|
|
1020
1034
|
}
|
|
1021
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1035
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationService, decorators: [{
|
|
1022
1036
|
type: Injectable,
|
|
1023
1037
|
args: [{
|
|
1024
1038
|
providedIn: 'root',
|
|
@@ -1050,10 +1064,10 @@ class ProductCategoryService extends BaseService {
|
|
|
1050
1064
|
withCredentials: true,
|
|
1051
1065
|
});
|
|
1052
1066
|
}
|
|
1053
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1054
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1067
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ProductCategoryService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1068
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ProductCategoryService, providedIn: 'root' });
|
|
1055
1069
|
}
|
|
1056
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1070
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ProductCategoryService, decorators: [{
|
|
1057
1071
|
type: Injectable,
|
|
1058
1072
|
args: [{
|
|
1059
1073
|
providedIn: 'root',
|
|
@@ -1095,10 +1109,10 @@ class NotificationTemplateService {
|
|
|
1095
1109
|
withCredentials: true,
|
|
1096
1110
|
});
|
|
1097
1111
|
}
|
|
1098
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1099
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1112
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationTemplateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1113
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationTemplateService, providedIn: 'root' });
|
|
1100
1114
|
}
|
|
1101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: NotificationTemplateService, decorators: [{
|
|
1102
1116
|
type: Injectable,
|
|
1103
1117
|
args: [{
|
|
1104
1118
|
providedIn: 'root',
|
|
@@ -1120,10 +1134,10 @@ class FulfillmentService extends BaseService {
|
|
|
1120
1134
|
withCredentials: true,
|
|
1121
1135
|
});
|
|
1122
1136
|
}
|
|
1123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1124
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1137
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FulfillmentService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1138
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FulfillmentService, providedIn: 'root' });
|
|
1125
1139
|
}
|
|
1126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1140
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FulfillmentService, decorators: [{
|
|
1127
1141
|
type: Injectable,
|
|
1128
1142
|
args: [{
|
|
1129
1143
|
providedIn: 'root',
|
|
@@ -1139,10 +1153,10 @@ class TitleService {
|
|
|
1139
1153
|
setTitle(newTitle) {
|
|
1140
1154
|
this.titleService.setTitle(`${newTitle} - ${this.environment.name}`);
|
|
1141
1155
|
}
|
|
1142
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1143
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1156
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TitleService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1157
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TitleService, providedIn: 'root' });
|
|
1144
1158
|
}
|
|
1145
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1159
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: TitleService, decorators: [{
|
|
1146
1160
|
type: Injectable,
|
|
1147
1161
|
args: [{
|
|
1148
1162
|
providedIn: 'root',
|
|
@@ -1172,10 +1186,10 @@ class PostService extends BaseService {
|
|
|
1172
1186
|
withCredentials: true,
|
|
1173
1187
|
});
|
|
1174
1188
|
}
|
|
1175
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1176
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1189
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PostService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1190
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PostService, providedIn: 'root' });
|
|
1177
1191
|
}
|
|
1178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PostService, decorators: [{
|
|
1179
1193
|
type: Injectable,
|
|
1180
1194
|
args: [{
|
|
1181
1195
|
providedIn: 'root',
|
|
@@ -1198,10 +1212,10 @@ class OrderPayoutService extends BaseService {
|
|
|
1198
1212
|
withCredentials: true,
|
|
1199
1213
|
});
|
|
1200
1214
|
}
|
|
1201
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1202
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1215
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OrderPayoutService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1216
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OrderPayoutService, providedIn: 'root' });
|
|
1203
1217
|
}
|
|
1204
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OrderPayoutService, decorators: [{
|
|
1205
1219
|
type: Injectable,
|
|
1206
1220
|
args: [{
|
|
1207
1221
|
providedIn: 'root',
|
|
@@ -1370,10 +1384,10 @@ class ResourceService extends BaseService {
|
|
|
1370
1384
|
withCredentials: true,
|
|
1371
1385
|
});
|
|
1372
1386
|
}
|
|
1373
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1374
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1387
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ResourceService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1388
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ResourceService, providedIn: 'root' });
|
|
1375
1389
|
}
|
|
1376
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1390
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ResourceService, decorators: [{
|
|
1377
1391
|
type: Injectable,
|
|
1378
1392
|
args: [{
|
|
1379
1393
|
providedIn: 'root',
|
|
@@ -1395,10 +1409,10 @@ class ResourceCategoryService extends BaseService {
|
|
|
1395
1409
|
withCredentials: true,
|
|
1396
1410
|
});
|
|
1397
1411
|
}
|
|
1398
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1399
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1412
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ResourceCategoryService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1413
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ResourceCategoryService, providedIn: 'root' });
|
|
1400
1414
|
}
|
|
1401
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1415
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ResourceCategoryService, decorators: [{
|
|
1402
1416
|
type: Injectable,
|
|
1403
1417
|
args: [{
|
|
1404
1418
|
providedIn: 'root',
|
|
@@ -1469,10 +1483,10 @@ class BookingService extends BaseService {
|
|
|
1469
1483
|
withCredentials: true,
|
|
1470
1484
|
});
|
|
1471
1485
|
}
|
|
1472
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1473
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1486
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BookingService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1487
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BookingService, providedIn: 'root' });
|
|
1474
1488
|
}
|
|
1475
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BookingService, decorators: [{
|
|
1476
1490
|
type: Injectable,
|
|
1477
1491
|
args: [{
|
|
1478
1492
|
providedIn: 'root',
|
|
@@ -1484,10 +1498,10 @@ class FacilityService extends BaseService {
|
|
|
1484
1498
|
this.endpoint = 'facilities';
|
|
1485
1499
|
super.init();
|
|
1486
1500
|
}
|
|
1487
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1488
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1501
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FacilityService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1502
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FacilityService, providedIn: 'root' });
|
|
1489
1503
|
}
|
|
1490
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1504
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FacilityService, decorators: [{
|
|
1491
1505
|
type: Injectable,
|
|
1492
1506
|
args: [{
|
|
1493
1507
|
providedIn: 'root',
|
|
@@ -1499,10 +1513,10 @@ class AmenityService extends BaseService {
|
|
|
1499
1513
|
this.endpoint = 'resources/amenities';
|
|
1500
1514
|
super.init();
|
|
1501
1515
|
}
|
|
1502
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1503
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1516
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AmenityService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1517
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AmenityService, providedIn: 'root' });
|
|
1504
1518
|
}
|
|
1505
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AmenityService, decorators: [{
|
|
1506
1520
|
type: Injectable,
|
|
1507
1521
|
args: [{
|
|
1508
1522
|
providedIn: 'root',
|
|
@@ -1547,6 +1561,20 @@ class PropertyService extends BaseService {
|
|
|
1547
1561
|
withCredentials: true,
|
|
1548
1562
|
});
|
|
1549
1563
|
}
|
|
1564
|
+
export() {
|
|
1565
|
+
return this.http.get(`${this.actionUrl}/export`, {
|
|
1566
|
+
observe: 'response',
|
|
1567
|
+
responseType: 'blob',
|
|
1568
|
+
withCredentials: true
|
|
1569
|
+
}).pipe(map((resp) => {
|
|
1570
|
+
const cd = resp.headers.get('Content-Disposition') || '';
|
|
1571
|
+
const match = /filename\*?=(?:UTF-8''|")?([^";]+)/i.exec(cd);
|
|
1572
|
+
const raw = match?.[1] ?? 'properties.csv';
|
|
1573
|
+
// decode RFC5987 filenames
|
|
1574
|
+
const filename = decodeURIComponent(raw.replace(/"/g, ''));
|
|
1575
|
+
return { blob: resp.body, filename };
|
|
1576
|
+
}));
|
|
1577
|
+
}
|
|
1550
1578
|
archived(propertyId) {
|
|
1551
1579
|
return this.http.post(`${this.actionUrl}/${propertyId}/archived`, {}, {
|
|
1552
1580
|
withCredentials: true,
|
|
@@ -1883,10 +1911,39 @@ class PropertyService extends BaseService {
|
|
|
1883
1911
|
deleteTenant(id) {
|
|
1884
1912
|
return this.http.delete(`${this.actionUrl}/tenants/${id}`, { withCredentials: true });
|
|
1885
1913
|
}
|
|
1886
|
-
|
|
1887
|
-
|
|
1914
|
+
//COS
|
|
1915
|
+
uploadVideoTourInit(propertyId, data) {
|
|
1916
|
+
return this.http.post(`${this.actionUrl}/${propertyId}/video-tour/init`, data, {
|
|
1917
|
+
withCredentials: true,
|
|
1918
|
+
});
|
|
1919
|
+
}
|
|
1920
|
+
uploadVideoTourPartsToProperty(propertyId, data) {
|
|
1921
|
+
return this.http.post(`${this.actionUrl}/${propertyId}/video-tour/parts`, data, {
|
|
1922
|
+
withCredentials: true,
|
|
1923
|
+
});
|
|
1924
|
+
}
|
|
1925
|
+
completePartUpload(propertyId, data) {
|
|
1926
|
+
return this.http.put(`${this.actionUrl}/${propertyId}/video-tour/parts`, data, {
|
|
1927
|
+
withCredentials: true,
|
|
1928
|
+
});
|
|
1929
|
+
}
|
|
1930
|
+
uploadVideoToProperty(propertyId, data) {
|
|
1931
|
+
return this.http.post(`${this.actionUrl}/${propertyId}/video-tour`, data, {
|
|
1932
|
+
withCredentials: true,
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
deletePropertyVideo(propertyId, videoId) {
|
|
1936
|
+
return this.http.delete(`${this.actionUrl}/${propertyId}/video-tour/${videoId}`, { withCredentials: true });
|
|
1937
|
+
}
|
|
1938
|
+
uploadPropertyVideoThumbnail(videoId, data) {
|
|
1939
|
+
return this.http.post(`${this.actionUrl}/video-tour/${videoId}/thumbnail`, data, {
|
|
1940
|
+
withCredentials: true,
|
|
1941
|
+
});
|
|
1942
|
+
}
|
|
1943
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PropertyService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1944
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PropertyService, providedIn: 'root' });
|
|
1888
1945
|
}
|
|
1889
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1946
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PropertyService, decorators: [{
|
|
1890
1947
|
type: Injectable,
|
|
1891
1948
|
args: [{
|
|
1892
1949
|
providedIn: 'root',
|
|
@@ -1913,10 +1970,10 @@ class FeatureService extends BaseService {
|
|
|
1913
1970
|
withCredentials: true,
|
|
1914
1971
|
});
|
|
1915
1972
|
}
|
|
1916
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1917
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1973
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FeatureService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1974
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FeatureService, providedIn: 'root' });
|
|
1918
1975
|
}
|
|
1919
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
1976
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: FeatureService, decorators: [{
|
|
1920
1977
|
type: Injectable,
|
|
1921
1978
|
args: [{
|
|
1922
1979
|
providedIn: 'root',
|
|
@@ -1938,10 +1995,10 @@ class PaymentService extends BaseService {
|
|
|
1938
1995
|
withCredentials: true,
|
|
1939
1996
|
});
|
|
1940
1997
|
}
|
|
1941
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
1942
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
1998
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PaymentService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1999
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PaymentService, providedIn: 'root' });
|
|
1943
2000
|
}
|
|
1944
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
2001
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: PaymentService, decorators: [{
|
|
1945
2002
|
type: Injectable,
|
|
1946
2003
|
args: [{
|
|
1947
2004
|
providedIn: 'root',
|
|
@@ -2303,10 +2360,10 @@ class OfferingService extends BaseService {
|
|
|
2303
2360
|
deleteVideoTour(id, videoTourId, y) {
|
|
2304
2361
|
return this.http.delete(`${this.actionUrl}/${id}/video-tour/${videoTourId}`, { withCredentials: true });
|
|
2305
2362
|
}
|
|
2306
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
2307
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
2363
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OfferingService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2364
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OfferingService, providedIn: 'root' });
|
|
2308
2365
|
}
|
|
2309
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
2366
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: OfferingService, decorators: [{
|
|
2310
2367
|
type: Injectable,
|
|
2311
2368
|
args: [{
|
|
2312
2369
|
providedIn: 'root',
|
|
@@ -2365,10 +2422,10 @@ class MembershipService extends BaseService {
|
|
|
2365
2422
|
withCredentials: true,
|
|
2366
2423
|
});
|
|
2367
2424
|
}
|
|
2368
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
2369
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
2425
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: MembershipService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2426
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: MembershipService, providedIn: 'root' });
|
|
2370
2427
|
}
|
|
2371
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
2428
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: MembershipService, decorators: [{
|
|
2372
2429
|
type: Injectable,
|
|
2373
2430
|
args: [{
|
|
2374
2431
|
providedIn: 'root',
|
|
@@ -2426,16 +2483,509 @@ class CategoryService extends BaseService {
|
|
|
2426
2483
|
withCredentials: true,
|
|
2427
2484
|
});
|
|
2428
2485
|
}
|
|
2429
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
2430
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
2486
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CategoryService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
2487
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CategoryService, providedIn: 'root' });
|
|
2431
2488
|
}
|
|
2432
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
2489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: CategoryService, decorators: [{
|
|
2433
2490
|
type: Injectable,
|
|
2434
2491
|
args: [{
|
|
2435
2492
|
providedIn: 'root',
|
|
2436
2493
|
}]
|
|
2437
2494
|
}] });
|
|
2438
2495
|
|
|
2496
|
+
/* ========= Service ========= */
|
|
2497
|
+
class AssistantStreamService {
|
|
2498
|
+
environment = inject(APP_CONFIG);
|
|
2499
|
+
/**
|
|
2500
|
+
* POST + SSE streaming via fetch + ReadableStream
|
|
2501
|
+
*/
|
|
2502
|
+
stream(req, init) {
|
|
2503
|
+
return new Observable((subscriber) => {
|
|
2504
|
+
const ctrl = new AbortController();
|
|
2505
|
+
const headers = {
|
|
2506
|
+
'Content-Type': 'application/json',
|
|
2507
|
+
'Accept': 'text/event-stream',
|
|
2508
|
+
'client-id': this.environment.clientId,
|
|
2509
|
+
...(init?.headers ?? {}),
|
|
2510
|
+
};
|
|
2511
|
+
fetch(`${this.environment.baseUrl}/conversations`, {
|
|
2512
|
+
method: 'POST',
|
|
2513
|
+
body: JSON.stringify(req),
|
|
2514
|
+
headers,
|
|
2515
|
+
signal: ctrl.signal,
|
|
2516
|
+
keepalive: true,
|
|
2517
|
+
mode: 'cors',
|
|
2518
|
+
credentials: 'include',
|
|
2519
|
+
...init,
|
|
2520
|
+
})
|
|
2521
|
+
.then(async (res) => {
|
|
2522
|
+
if (!res.ok || !res.body) {
|
|
2523
|
+
subscriber.error({
|
|
2524
|
+
type: 'error',
|
|
2525
|
+
message: `HTTP ${res.status} ${res.statusText}`,
|
|
2526
|
+
});
|
|
2527
|
+
return;
|
|
2528
|
+
}
|
|
2529
|
+
const reader = res.body.getReader();
|
|
2530
|
+
const decoder = new TextDecoder('utf-8');
|
|
2531
|
+
let buffer = '';
|
|
2532
|
+
try {
|
|
2533
|
+
for (;;) {
|
|
2534
|
+
const { value, done } = await reader.read();
|
|
2535
|
+
if (done)
|
|
2536
|
+
break;
|
|
2537
|
+
buffer += decoder.decode(value, { stream: true });
|
|
2538
|
+
// SSE blocks are separated by blank lines
|
|
2539
|
+
let idx;
|
|
2540
|
+
while ((idx = buffer.indexOf('\n\n')) !== -1) {
|
|
2541
|
+
const rawBlock = buffer.slice(0, idx);
|
|
2542
|
+
buffer = buffer.slice(idx + 2);
|
|
2543
|
+
const events = this.parseSSEBlock(rawBlock);
|
|
2544
|
+
for (const e of events) {
|
|
2545
|
+
const typed = this.toStreamEvent(e);
|
|
2546
|
+
if (!typed)
|
|
2547
|
+
continue;
|
|
2548
|
+
subscriber.next(typed);
|
|
2549
|
+
if (typed.type === 'done') {
|
|
2550
|
+
ctrl.abort();
|
|
2551
|
+
subscriber.complete();
|
|
2552
|
+
return;
|
|
2553
|
+
}
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
// Flush any trailing data
|
|
2558
|
+
if (buffer.trim().length) {
|
|
2559
|
+
const events = this.parseSSEBlock(buffer);
|
|
2560
|
+
for (const e of events) {
|
|
2561
|
+
const typed = this.toStreamEvent(e);
|
|
2562
|
+
if (typed)
|
|
2563
|
+
subscriber.next(typed);
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
subscriber.complete();
|
|
2567
|
+
}
|
|
2568
|
+
catch (err) {
|
|
2569
|
+
if (err?.name === 'AbortError') {
|
|
2570
|
+
subscriber.complete();
|
|
2571
|
+
}
|
|
2572
|
+
else {
|
|
2573
|
+
subscriber.error({
|
|
2574
|
+
type: 'error',
|
|
2575
|
+
message: 'Stream read error',
|
|
2576
|
+
cause: err,
|
|
2577
|
+
});
|
|
2578
|
+
}
|
|
2579
|
+
}
|
|
2580
|
+
})
|
|
2581
|
+
.catch((err) => {
|
|
2582
|
+
console.log(err);
|
|
2583
|
+
subscriber.error({
|
|
2584
|
+
type: 'error',
|
|
2585
|
+
message: 'Fetch error',
|
|
2586
|
+
cause: err,
|
|
2587
|
+
});
|
|
2588
|
+
});
|
|
2589
|
+
// teardown
|
|
2590
|
+
return () => ctrl.abort();
|
|
2591
|
+
});
|
|
2592
|
+
}
|
|
2593
|
+
/* ========= SSE parsing ========= */
|
|
2594
|
+
/**
|
|
2595
|
+
* Parse one SSE "block" (between blank lines). Supports multi-line `data:` and optional `event:`.
|
|
2596
|
+
* Returns a list because some servers pack multiple JSON items in the data.
|
|
2597
|
+
*/
|
|
2598
|
+
parseSSEBlock(block) {
|
|
2599
|
+
const lines = block.split(/\r?\n/);
|
|
2600
|
+
let eventName;
|
|
2601
|
+
const dataLines = [];
|
|
2602
|
+
for (const line of lines) {
|
|
2603
|
+
if (!line)
|
|
2604
|
+
continue;
|
|
2605
|
+
if (line.startsWith(':'))
|
|
2606
|
+
continue; // comment
|
|
2607
|
+
if (line.startsWith('event:')) {
|
|
2608
|
+
eventName = line.slice(6).trim();
|
|
2609
|
+
}
|
|
2610
|
+
else if (line.startsWith('data:')) {
|
|
2611
|
+
dataLines.push(line.slice(5).trimStart());
|
|
2612
|
+
}
|
|
2613
|
+
else {
|
|
2614
|
+
// fallback: some servers may omit "data:"
|
|
2615
|
+
dataLines.push(line);
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
const dataStr = dataLines.join('\n').trim();
|
|
2619
|
+
if (!dataStr)
|
|
2620
|
+
return [];
|
|
2621
|
+
// Handle possible JSONL
|
|
2622
|
+
const parts = this.splitPossibleJSONL(dataStr);
|
|
2623
|
+
return parts.map((d) => ({ event: eventName, data: d }));
|
|
2624
|
+
}
|
|
2625
|
+
splitPossibleJSONL(s) {
|
|
2626
|
+
const lines = s.split(/\r?\n/);
|
|
2627
|
+
if (lines.length > 1 && lines.every((ln) => /^[[{"\-0-9tfn]/.test(ln.trim()))) {
|
|
2628
|
+
return lines;
|
|
2629
|
+
}
|
|
2630
|
+
return [s];
|
|
2631
|
+
}
|
|
2632
|
+
/**
|
|
2633
|
+
* Convert raw SSE payload into our typed StreamEvent union.
|
|
2634
|
+
* - honors `event:` header names: start, message, group, json, tool, done, error
|
|
2635
|
+
* - normalizes conversationId -> sessionId on start
|
|
2636
|
+
* - falls back to JsonEvent on unknown shapes
|
|
2637
|
+
*/
|
|
2638
|
+
toStreamEvent(raw) {
|
|
2639
|
+
const { event, data } = raw;
|
|
2640
|
+
if (!data || data.length === 0)
|
|
2641
|
+
return null;
|
|
2642
|
+
// explicit "done" or OpenAI-style [DONE]
|
|
2643
|
+
if (event?.toLowerCase() === 'done' || data === '[DONE]') {
|
|
2644
|
+
return { type: 'done' };
|
|
2645
|
+
}
|
|
2646
|
+
// Try JSON
|
|
2647
|
+
let parsed;
|
|
2648
|
+
try {
|
|
2649
|
+
parsed = JSON.parse(data);
|
|
2650
|
+
}
|
|
2651
|
+
catch {
|
|
2652
|
+
// Not JSON -> treat as assistant text delta for streaming
|
|
2653
|
+
return {
|
|
2654
|
+
type: 'message',
|
|
2655
|
+
role: 'assistant',
|
|
2656
|
+
text: data,
|
|
2657
|
+
delta: true,
|
|
2658
|
+
};
|
|
2659
|
+
}
|
|
2660
|
+
// If server already includes a `type`, trust it
|
|
2661
|
+
if (parsed && typeof parsed === 'object' && 'type' in parsed) {
|
|
2662
|
+
return parsed;
|
|
2663
|
+
}
|
|
2664
|
+
switch ((event ?? '').toLowerCase()) {
|
|
2665
|
+
case 'start': {
|
|
2666
|
+
const sessionId = parsed.sessionId ?? parsed.conversationId ?? parsed.id;
|
|
2667
|
+
if (!sessionId)
|
|
2668
|
+
return { type: 'json', data: parsed };
|
|
2669
|
+
const start = {
|
|
2670
|
+
type: 'start',
|
|
2671
|
+
sessionId,
|
|
2672
|
+
conversationId: parsed.conversationId,
|
|
2673
|
+
at: parsed.at,
|
|
2674
|
+
};
|
|
2675
|
+
return start;
|
|
2676
|
+
}
|
|
2677
|
+
case 'message': {
|
|
2678
|
+
const role = parsed.role === 'user' || parsed.role === 'assistant' ? parsed.role : 'assistant';
|
|
2679
|
+
const text = typeof parsed.text === 'string' ? parsed.text : '';
|
|
2680
|
+
const delta = !!parsed.delta;
|
|
2681
|
+
return { type: 'message', role, text, delta };
|
|
2682
|
+
}
|
|
2683
|
+
case 'group': {
|
|
2684
|
+
return { type: 'group', ...parsed };
|
|
2685
|
+
}
|
|
2686
|
+
case 'json': {
|
|
2687
|
+
return { type: 'json', data: parsed };
|
|
2688
|
+
}
|
|
2689
|
+
case 'tool': {
|
|
2690
|
+
return { type: 'tool', ...parsed };
|
|
2691
|
+
}
|
|
2692
|
+
case 'error': {
|
|
2693
|
+
const msg = typeof parsed?.message === 'string' ? parsed.message : 'Unknown error';
|
|
2694
|
+
return { type: 'error', message: msg };
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
// Fallback: unknown event name -> json wrapper
|
|
2698
|
+
return { type: 'json', data: parsed };
|
|
2699
|
+
}
|
|
2700
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AssistantStreamService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2701
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AssistantStreamService, providedIn: 'root' });
|
|
2702
|
+
}
|
|
2703
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: AssistantStreamService, decorators: [{
|
|
2704
|
+
type: Injectable,
|
|
2705
|
+
args: [{ providedIn: 'root' }]
|
|
2706
|
+
}] });
|
|
2707
|
+
|
|
2708
|
+
class ConversationService {
|
|
2709
|
+
assistant = inject(AssistantStreamService);
|
|
2710
|
+
conversationId;
|
|
2711
|
+
_messages$ = new BehaviorSubject([]);
|
|
2712
|
+
messages$ = this._messages$.asObservable();
|
|
2713
|
+
_typing$ = new BehaviorSubject(false);
|
|
2714
|
+
typing$ = this._typing$.asObservable();
|
|
2715
|
+
// ✅ new: streaming$
|
|
2716
|
+
_streaming$ = new BehaviorSubject(false);
|
|
2717
|
+
streaming$ = this._streaming$.asObservable();
|
|
2718
|
+
streamSub;
|
|
2719
|
+
currentAssistantMsgId;
|
|
2720
|
+
// Accumulation state for streaming assistant text deltas
|
|
2721
|
+
pendingDelta = '';
|
|
2722
|
+
rafId = null;
|
|
2723
|
+
timeoutId = null;
|
|
2724
|
+
// Control how consecutive "message" events are split
|
|
2725
|
+
// false = coalesce streaming chunks (delta:true), start new segment when delta === false
|
|
2726
|
+
// true = split every message event into its own text segment
|
|
2727
|
+
strictMessageSegmentation = false;
|
|
2728
|
+
// lightweight UI signals (snackbar, etc.)
|
|
2729
|
+
events$ = new Subject();
|
|
2730
|
+
/** Set known conversationId id (optional). */
|
|
2731
|
+
setConversationId(conversationId) {
|
|
2732
|
+
this.conversationId = conversationId;
|
|
2733
|
+
}
|
|
2734
|
+
/** Clear current conversation state. */
|
|
2735
|
+
dispose() {
|
|
2736
|
+
this.cancel();
|
|
2737
|
+
this._messages$.next([]);
|
|
2738
|
+
this.currentAssistantMsgId = undefined;
|
|
2739
|
+
this.clearSchedulers();
|
|
2740
|
+
}
|
|
2741
|
+
/** Stop current stream (e.g., user pressed Stop). */
|
|
2742
|
+
cancel() {
|
|
2743
|
+
if (this.streamSub) {
|
|
2744
|
+
this.streamSub.unsubscribe();
|
|
2745
|
+
this.streamSub = undefined;
|
|
2746
|
+
this._typing$.next(false);
|
|
2747
|
+
this._streaming$.next(false); // ✅ stop spinner immediately
|
|
2748
|
+
this.flushPending();
|
|
2749
|
+
}
|
|
2750
|
+
}
|
|
2751
|
+
/** Send a user message and start streaming an assistant response. */
|
|
2752
|
+
send(message) {
|
|
2753
|
+
const trimmed = message?.trim();
|
|
2754
|
+
if (!trimmed)
|
|
2755
|
+
return;
|
|
2756
|
+
// Append user message to timeline
|
|
2757
|
+
this._messages$.next([
|
|
2758
|
+
...this._messages$.value,
|
|
2759
|
+
{ id: this.nextId(), role: 'user', text: trimmed, createdAt: Date.now() },
|
|
2760
|
+
]);
|
|
2761
|
+
// Start/continue assistant stream
|
|
2762
|
+
this.cancel();
|
|
2763
|
+
this._typing$.next(true);
|
|
2764
|
+
this._streaming$.next(true); // ✅ start spinner as soon as we stream
|
|
2765
|
+
this.streamSub = this.assistant
|
|
2766
|
+
.stream({ message: trimmed, conversationId: this.conversationId })
|
|
2767
|
+
.subscribe({
|
|
2768
|
+
next: (ev) => this.handleStreamEvent(ev),
|
|
2769
|
+
error: (e) => {
|
|
2770
|
+
this._typing$.next(false);
|
|
2771
|
+
this._streaming$.next(false); // ✅ stop spinner
|
|
2772
|
+
this.flushPending();
|
|
2773
|
+
this.pushAssistantError(e?.message ?? 'Stream failed');
|
|
2774
|
+
this.events$.next({ kind: 'error', text: e?.message ?? 'Stream failed' });
|
|
2775
|
+
},
|
|
2776
|
+
complete: () => {
|
|
2777
|
+
this._typing$.next(false);
|
|
2778
|
+
this._streaming$.next(false); // ✅ stop spinner
|
|
2779
|
+
this.flushPending();
|
|
2780
|
+
this.markAssistantDone();
|
|
2781
|
+
},
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2784
|
+
/* ========== Internals ========== */
|
|
2785
|
+
handleStreamEvent(ev) {
|
|
2786
|
+
switch (ev.type) {
|
|
2787
|
+
case 'start': {
|
|
2788
|
+
const s = ev;
|
|
2789
|
+
if (s.conversationId)
|
|
2790
|
+
this.conversationId = s.conversationId;
|
|
2791
|
+
this.ensureAssistantMessage();
|
|
2792
|
+
this._streaming$.next(true); // ✅ ensure spinner even if we begin on 'start'
|
|
2793
|
+
break;
|
|
2794
|
+
}
|
|
2795
|
+
case 'message': {
|
|
2796
|
+
const m = ev;
|
|
2797
|
+
// Most apps avoid echoing server "user" messages to prevent duplicates
|
|
2798
|
+
if (m.role !== 'assistant')
|
|
2799
|
+
break;
|
|
2800
|
+
this.bufferAssistantMessage(m);
|
|
2801
|
+
break;
|
|
2802
|
+
}
|
|
2803
|
+
case 'group': {
|
|
2804
|
+
this.flushPending();
|
|
2805
|
+
const g = ev;
|
|
2806
|
+
this.pushAssistantSegment({ kind: 'group', item: g });
|
|
2807
|
+
break;
|
|
2808
|
+
}
|
|
2809
|
+
case 'json': {
|
|
2810
|
+
this.flushPending();
|
|
2811
|
+
const j = ev;
|
|
2812
|
+
this.pushAssistantSegment({ kind: 'json', data: j.data });
|
|
2813
|
+
break;
|
|
2814
|
+
}
|
|
2815
|
+
case 'tool': {
|
|
2816
|
+
this.flushPending();
|
|
2817
|
+
const t = ev;
|
|
2818
|
+
this.pushAssistantSegment({ kind: 'tool', tool: t });
|
|
2819
|
+
break;
|
|
2820
|
+
}
|
|
2821
|
+
case 'error': {
|
|
2822
|
+
this.flushPending();
|
|
2823
|
+
const e = ev;
|
|
2824
|
+
this.pushAssistantError(e.message);
|
|
2825
|
+
this._streaming$.next(false); // ✅ stop spinner on error
|
|
2826
|
+
break;
|
|
2827
|
+
}
|
|
2828
|
+
case 'done': {
|
|
2829
|
+
this.flushPending();
|
|
2830
|
+
this.markAssistantDone();
|
|
2831
|
+
this._streaming$.next(false); // ✅ stop spinner on done
|
|
2832
|
+
this._typing$.next(false);
|
|
2833
|
+
break;
|
|
2834
|
+
}
|
|
2835
|
+
}
|
|
2836
|
+
}
|
|
2837
|
+
ensureAssistantMessage() {
|
|
2838
|
+
if (!this.currentAssistantMsgId) {
|
|
2839
|
+
const msg = {
|
|
2840
|
+
id: this.nextId(),
|
|
2841
|
+
role: 'assistant',
|
|
2842
|
+
segments: [],
|
|
2843
|
+
createdAt: Date.now(),
|
|
2844
|
+
};
|
|
2845
|
+
this.currentAssistantMsgId = msg.id;
|
|
2846
|
+
this._messages$.next([...this._messages$.value, msg]);
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
withCurrentAssistant(mut) {
|
|
2850
|
+
if (!this.currentAssistantMsgId)
|
|
2851
|
+
this.ensureAssistantMessage();
|
|
2852
|
+
const id = this.currentAssistantMsgId;
|
|
2853
|
+
const list = this._messages$.value;
|
|
2854
|
+
const idx = list.findIndex((m) => m.id === id);
|
|
2855
|
+
if (idx === -1)
|
|
2856
|
+
return;
|
|
2857
|
+
const updated = mut(list[idx]);
|
|
2858
|
+
const newList = [...list];
|
|
2859
|
+
newList[idx] = updated;
|
|
2860
|
+
this._messages$.next(newList);
|
|
2861
|
+
}
|
|
2862
|
+
/* ========== Segment helpers (ordered) ========== */
|
|
2863
|
+
pushAssistantSegment(seg) {
|
|
2864
|
+
this.ensureAssistantMessage();
|
|
2865
|
+
this.withCurrentAssistant((m) => ({
|
|
2866
|
+
...m,
|
|
2867
|
+
segments: [...(m.segments ?? []), seg],
|
|
2868
|
+
}));
|
|
2869
|
+
}
|
|
2870
|
+
appendToLastTextSegment(delta) {
|
|
2871
|
+
this.withCurrentAssistant((m) => {
|
|
2872
|
+
const segs = [...(m.segments ?? [])];
|
|
2873
|
+
if (segs.length && segs[segs.length - 1].kind === 'text') {
|
|
2874
|
+
const last = segs[segs.length - 1];
|
|
2875
|
+
segs[segs.length - 1] = { kind: 'text', text: last.text + delta };
|
|
2876
|
+
}
|
|
2877
|
+
else {
|
|
2878
|
+
segs.push({ kind: 'text', text: delta });
|
|
2879
|
+
}
|
|
2880
|
+
return { ...m, segments: segs };
|
|
2881
|
+
});
|
|
2882
|
+
}
|
|
2883
|
+
/* ========== Message buffering / accumulation ========== */
|
|
2884
|
+
bufferAssistantMessage(m) {
|
|
2885
|
+
const text = m.text ?? '';
|
|
2886
|
+
if (!text)
|
|
2887
|
+
return;
|
|
2888
|
+
if (this.strictMessageSegmentation) {
|
|
2889
|
+
// Split every message as its own segment
|
|
2890
|
+
this.flushPending();
|
|
2891
|
+
this.pushAssistantSegment({ kind: 'text', text });
|
|
2892
|
+
return;
|
|
2893
|
+
}
|
|
2894
|
+
// Default: coalesce streaming chunks (delta:true);
|
|
2895
|
+
// if delta === false, start a new segment
|
|
2896
|
+
if (m.delta === false) {
|
|
2897
|
+
this.flushPending();
|
|
2898
|
+
this.pushAssistantSegment({ kind: 'text', text });
|
|
2899
|
+
}
|
|
2900
|
+
else {
|
|
2901
|
+
this.bufferAssistantDelta(text);
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
bufferAssistantDelta(chunk) {
|
|
2905
|
+
if (!chunk)
|
|
2906
|
+
return;
|
|
2907
|
+
this.pendingDelta += chunk;
|
|
2908
|
+
this.scheduleFlush();
|
|
2909
|
+
}
|
|
2910
|
+
scheduleFlush() {
|
|
2911
|
+
if (this.rafId != null || this.timeoutId != null)
|
|
2912
|
+
return;
|
|
2913
|
+
const raf = globalThis.requestAnimationFrame?.bind(globalThis);
|
|
2914
|
+
if (raf) {
|
|
2915
|
+
this.rafId = raf(() => {
|
|
2916
|
+
this.rafId = null;
|
|
2917
|
+
this.flushPending();
|
|
2918
|
+
});
|
|
2919
|
+
}
|
|
2920
|
+
else {
|
|
2921
|
+
this.timeoutId = setTimeout(() => {
|
|
2922
|
+
this.timeoutId = null;
|
|
2923
|
+
this.flushPending();
|
|
2924
|
+
}, 33); // ~30fps
|
|
2925
|
+
}
|
|
2926
|
+
}
|
|
2927
|
+
clearSchedulers() {
|
|
2928
|
+
const caf = globalThis.cancelAnimationFrame?.bind(globalThis);
|
|
2929
|
+
if (this.rafId != null && caf)
|
|
2930
|
+
caf(this.rafId);
|
|
2931
|
+
if (this.timeoutId != null)
|
|
2932
|
+
clearTimeout(this.timeoutId);
|
|
2933
|
+
this.rafId = null;
|
|
2934
|
+
this.timeoutId = null;
|
|
2935
|
+
}
|
|
2936
|
+
flushPending() {
|
|
2937
|
+
if (!this.pendingDelta)
|
|
2938
|
+
return;
|
|
2939
|
+
const delta = this.pendingDelta;
|
|
2940
|
+
this.pendingDelta = '';
|
|
2941
|
+
this.clearSchedulers();
|
|
2942
|
+
this.appendToLastTextSegment(delta);
|
|
2943
|
+
}
|
|
2944
|
+
/* ========== Finalization / error ========== */
|
|
2945
|
+
pushAssistantError(message) {
|
|
2946
|
+
this.ensureAssistantMessage();
|
|
2947
|
+
this.withCurrentAssistant((m) => ({
|
|
2948
|
+
...m,
|
|
2949
|
+
segments: [
|
|
2950
|
+
...(m.segments ?? []),
|
|
2951
|
+
{ kind: 'text', text: `⚠️ ${message || 'Unknown error'}` },
|
|
2952
|
+
],
|
|
2953
|
+
error: message || 'Unknown error',
|
|
2954
|
+
}));
|
|
2955
|
+
}
|
|
2956
|
+
markAssistantDone() {
|
|
2957
|
+
if (!this.currentAssistantMsgId)
|
|
2958
|
+
return;
|
|
2959
|
+
this.withCurrentAssistant((m) => ({ ...m, done: true }));
|
|
2960
|
+
this.currentAssistantMsgId = undefined;
|
|
2961
|
+
}
|
|
2962
|
+
/* ========== Utils ========== */
|
|
2963
|
+
nextId() {
|
|
2964
|
+
return Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
2965
|
+
}
|
|
2966
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ConversationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2967
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ConversationService, providedIn: 'root' });
|
|
2968
|
+
}
|
|
2969
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ConversationService, decorators: [{
|
|
2970
|
+
type: Injectable,
|
|
2971
|
+
args: [{ providedIn: 'root' }]
|
|
2972
|
+
}] });
|
|
2973
|
+
|
|
2974
|
+
// src/app/services/conversation-init.service.ts
|
|
2975
|
+
class ConversationInitService {
|
|
2976
|
+
environment = inject(APP_CONFIG);
|
|
2977
|
+
http = inject(HttpClient);
|
|
2978
|
+
init(message) {
|
|
2979
|
+
return firstValueFrom(this.http.post(`${this.environment.baseUrl}/conversations/init`, { message }, { withCredentials: true }));
|
|
2980
|
+
}
|
|
2981
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ConversationInitService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2982
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ConversationInitService, providedIn: 'root' });
|
|
2983
|
+
}
|
|
2984
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: ConversationInitService, decorators: [{
|
|
2985
|
+
type: Injectable,
|
|
2986
|
+
args: [{ providedIn: 'root' }]
|
|
2987
|
+
}] });
|
|
2988
|
+
|
|
2439
2989
|
class LoadingInterceptor {
|
|
2440
2990
|
loadingService;
|
|
2441
2991
|
activeRequests = 0;
|
|
@@ -2454,10 +3004,10 @@ class LoadingInterceptor {
|
|
|
2454
3004
|
}
|
|
2455
3005
|
}));
|
|
2456
3006
|
}
|
|
2457
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
2458
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.0
|
|
3007
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LoadingInterceptor, deps: [{ token: LoadingService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
3008
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LoadingInterceptor, providedIn: 'root' });
|
|
2459
3009
|
}
|
|
2460
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
3010
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: LoadingInterceptor, decorators: [{
|
|
2461
3011
|
type: Injectable,
|
|
2462
3012
|
args: [{
|
|
2463
3013
|
providedIn: 'root',
|
|
@@ -2470,10 +3020,10 @@ class BackButtonDirective {
|
|
|
2470
3020
|
onClick() {
|
|
2471
3021
|
this.navigation.back();
|
|
2472
3022
|
}
|
|
2473
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0
|
|
2474
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.0
|
|
3023
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BackButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3024
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0", type: BackButtonDirective, isStandalone: true, selector: "[rolatechBackButton]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
2475
3025
|
}
|
|
2476
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0
|
|
3026
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: BackButtonDirective, decorators: [{
|
|
2477
3027
|
type: Directive,
|
|
2478
3028
|
args: [{
|
|
2479
3029
|
selector: '[rolatechBackButton]',
|
|
@@ -2483,6 +3033,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.3", ngImpor
|
|
|
2483
3033
|
args: ['click']
|
|
2484
3034
|
}] } });
|
|
2485
3035
|
|
|
3036
|
+
class HideFooterDirective {
|
|
3037
|
+
layout = inject(LayoutService);
|
|
3038
|
+
ngOnInit() { this.layout.setHideFooter(true); }
|
|
3039
|
+
ngOnDestroy() { this.layout.setHideFooter(false); }
|
|
3040
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: HideFooterDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
3041
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0", type: HideFooterDirective, isStandalone: true, selector: "[rolatechHideFooter]", ngImport: i0 });
|
|
3042
|
+
}
|
|
3043
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0", ngImport: i0, type: HideFooterDirective, decorators: [{
|
|
3044
|
+
type: Directive,
|
|
3045
|
+
args: [{
|
|
3046
|
+
selector: '[rolatechHideFooter]',
|
|
3047
|
+
}]
|
|
3048
|
+
}] });
|
|
3049
|
+
|
|
2486
3050
|
const SERVICE_DIRECTIVES = [BackButtonDirective];
|
|
2487
3051
|
|
|
2488
3052
|
function provideAngularServices() {
|
|
@@ -2516,5 +3080,5 @@ function provideAngularServices() {
|
|
|
2516
3080
|
* Generated bundle index. Do not edit.
|
|
2517
3081
|
*/
|
|
2518
3082
|
|
|
2519
|
-
export { AmenityService, BackButtonDirective, BaseService, BookingService, BreadcrumbService, CartEventType, CartService, CategoryService, DialogComponent, DialogService, FacilityService, FeatureService, FulfillmentService, InventoryService, LayoutService, LoadingInterceptor, LoadingService, MediaService, MembershipService, NavigationService, NotificationService, NotificationStore, NotificationTemplateService, OfferingService, OrderPayoutService, OrderService, PaymentService, PostService, ProductCategoryService, ProductService, PropertyService, ResourceCategoryService, ResourceService, SERVICE_DIRECTIVES, SidenavService, SnackBarService, SupportService, ThemeService, TitleService, provideAngularServices };
|
|
3083
|
+
export { AmenityService, BackButtonDirective, BaseService, BookingService, BreadcrumbService, CartEventType, CartService, CategoryService, ConversationInitService, ConversationService, DialogComponent, DialogService, FacilityService, FeatureService, FulfillmentService, HideFooterDirective, InventoryService, LayoutService, LoadingInterceptor, LoadingService, MediaService, MembershipService, NavigationService, NotificationService, NotificationStore, NotificationTemplateService, OfferingService, OrderPayoutService, OrderService, PaymentService, PostService, ProductCategoryService, ProductService, PropertyService, ResourceCategoryService, ResourceService, SERVICE_DIRECTIVES, SidenavService, SnackBarService, SupportService, ThemeService, TitleService, provideAngularServices };
|
|
2520
3084
|
//# sourceMappingURL=rolatech-angular-services.mjs.map
|