@rtsee/ngx 0.0.111 → 0.0.112

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,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, Input, Component, ViewChild, EventEmitter, Output, forwardRef, Directive, HostListener, reflectComponentType, DOCUMENT, Inject, ChangeDetectionStrategy, output, CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
3
3
  import * as i2$1 from '@angular/common';
4
- import { NgClass, NgIf, NgForOf, DatePipe, NgComponentOutlet, SlicePipe, JsonPipe, DOCUMENT as DOCUMENT$1, NgStyle, CommonModule, NgOptimizedImage } from '@angular/common';
4
+ import { NgClass, NgIf, NgForOf, DatePipe, NgComponentOutlet, SlicePipe, JsonPipe, DOCUMENT as DOCUMENT$1, CommonModule, NgStyle, NgOptimizedImage } from '@angular/common';
5
5
  import * as i1 from '@angular/forms';
6
6
  import { FormsModule, FormGroup, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
7
7
  import { Select } from 'primeng/select';
@@ -3919,9 +3919,249 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
3919
3919
  type: Input
3920
3920
  }] } });
3921
3921
 
3922
+ class BaseEventWidgetComponent {
3923
+ set event(value) {
3924
+ this._event = value;
3925
+ this.initCounter();
3926
+ }
3927
+ get event() {
3928
+ return this._event;
3929
+ }
3930
+ set session(value) {
3931
+ this._session = value;
3932
+ this.initCounter();
3933
+ }
3934
+ get session() {
3935
+ return this._session;
3936
+ }
3937
+ constructor(cd) {
3938
+ this.cd = cd;
3939
+ this.durationText = '0s';
3940
+ this.totalSeconds = 0;
3941
+ this.isLive = false;
3942
+ this.intervalId = null;
3943
+ }
3944
+ ngOnInit() {
3945
+ this.initCounter();
3946
+ }
3947
+ ngOnChanges(changes) {
3948
+ if (changes['event'] || changes['session']) {
3949
+ this.initCounter();
3950
+ }
3951
+ }
3952
+ ngOnDestroy() {
3953
+ this.stopCounter();
3954
+ }
3955
+ initCounter() {
3956
+ this.stopCounter();
3957
+ this.updateDuration();
3958
+ if (this.isLive) {
3959
+ this.intervalId = setInterval(() => {
3960
+ this.updateDuration();
3961
+ this.cd.markForCheck();
3962
+ }, 1000);
3963
+ }
3964
+ }
3965
+ stopCounter() {
3966
+ if (this.intervalId) {
3967
+ clearInterval(this.intervalId);
3968
+ this.intervalId = null;
3969
+ }
3970
+ }
3971
+ updateDuration() {
3972
+ if (!this.event?.createdAt) {
3973
+ this.durationText = '0s';
3974
+ this.totalSeconds = 0;
3975
+ this.isLive = false;
3976
+ return;
3977
+ }
3978
+ const eventTime = new Date(this.event.createdAt).getTime();
3979
+ if (isNaN(eventTime)) {
3980
+ this.durationText = '0s';
3981
+ this.totalSeconds = 0;
3982
+ this.isLive = false;
3983
+ return;
3984
+ }
3985
+ const events = this.session?.events || [];
3986
+ // Sort all events chronologically (oldest to newest)
3987
+ const sortedChronological = [...events].sort((a, b) => {
3988
+ const timeA = new Date(a.createdAt).getTime();
3989
+ const timeB = new Date(b.createdAt).getTime();
3990
+ return timeA - timeB;
3991
+ });
3992
+ const currentIndex = sortedChronological.findIndex((e) => (e.id && this.event.id && e.id === this.event.id) || e === this.event);
3993
+ // If there is an event chronologically after this one in the session:
3994
+ if (currentIndex >= 0 && currentIndex < sortedChronological.length - 1) {
3995
+ this.isLive = false;
3996
+ const nextEvent = sortedChronological[currentIndex + 1];
3997
+ const nextTime = new Date(nextEvent.createdAt).getTime();
3998
+ this.totalSeconds = Math.max(0, Math.floor((nextTime - eventTime) / 1000));
3999
+ this.durationText = this.formatSeconds(this.totalSeconds);
4000
+ this.stopCounter();
4001
+ return;
4002
+ }
4003
+ // This is the chronologically last event in the session (or standalone event)
4004
+ if (this.session?.isActive) {
4005
+ this.isLive = true;
4006
+ this.totalSeconds = Math.max(0, Math.floor((Date.now() - eventTime) / 1000));
4007
+ this.durationText = this.formatSeconds(this.totalSeconds);
4008
+ }
4009
+ else {
4010
+ // Past session loaded from server: no subsequent event occurred, so counter is 0s
4011
+ this.isLive = false;
4012
+ this.totalSeconds = 0;
4013
+ this.durationText = '0s';
4014
+ this.stopCounter();
4015
+ }
4016
+ }
4017
+ formatSeconds(seconds) {
4018
+ if (seconds < 60) {
4019
+ return `${seconds}s`;
4020
+ }
4021
+ const mins = Math.floor(seconds / 60);
4022
+ const secs = seconds % 60;
4023
+ return `${mins}m ${secs}s`;
4024
+ }
4025
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: BaseEventWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
4026
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.4", type: BaseEventWidgetComponent, isStandalone: true, inputs: { event: "event", session: "session" }, usesOnChanges: true, ngImport: i0 }); }
4027
+ }
4028
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: BaseEventWidgetComponent, decorators: [{
4029
+ type: Directive
4030
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { event: [{
4031
+ type: Input
4032
+ }], session: [{
4033
+ type: Input
4034
+ }] } });
4035
+
4036
+ class StoryDetailsOpenedWidgetComponent extends BaseEventWidgetComponent {
4037
+ constructor(cd) {
4038
+ super(cd);
4039
+ }
4040
+ get storyName() {
4041
+ return (this.event?.payload?.text ||
4042
+ this.event?.payload?.data?.storyName ||
4043
+ this.event?.payload?.data?.story?.name ||
4044
+ 'Story Details');
4045
+ }
4046
+ get storyUrl() {
4047
+ if (this.event?.payload?.url) {
4048
+ return this.event.payload.url;
4049
+ }
4050
+ const storyId = this.event?.payload?.data?.storyId ||
4051
+ this.event?.payload?.data?.story?.id;
4052
+ return storyId ? `/presentation/content/${storyId}` : null;
4053
+ }
4054
+ get imageUrl() {
4055
+ return (this.event?.payload?.imageUrl ||
4056
+ this.event?.payload?.data?.story?.imageUrl ||
4057
+ null);
4058
+ }
4059
+ get description() {
4060
+ return (this.event?.payload?.data?.storyDescription ||
4061
+ this.event?.payload?.data?.story?.description ||
4062
+ null);
4063
+ }
4064
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: StoryDetailsOpenedWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4065
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: StoryDetailsOpenedWidgetComponent, isStandalone: true, selector: "rtsee-story-details-opened-widget", usesInheritance: true, ngImport: i0, template: "<div class=\"rtsee-event-widget story-details-opened-widget\">\n <div class=\"widget-header\">\n <div class=\"widget-badge opened-badge\">\n <span class=\"material-icons-outlined widget-badge-icon\">visibility</span>\n <span class=\"widget-badge-label\">Story Opened</span>\n </div>\n <div\n class=\"widget-timer\"\n [class.live]=\"isLive\"\n [title]=\"isLive ? 'Currently active' : 'Time spent before next event'\"\n >\n <span class=\"material-icons-outlined widget-timer-icon\">timer</span>\n <span class=\"widget-timer-text\">{{ durationText }}</span>\n </div>\n </div>\n\n <div class=\"widget-body\">\n <div class=\"widget-media\">\n @if (imageUrl) {\n <img\n [src]=\"imageUrl\"\n [alt]=\"storyName\"\n class=\"widget-thumbnail-image\"\n />\n } @else {\n <div class=\"widget-thumbnail-placeholder\">\n <span class=\"material-icons-outlined\">auto_stories</span>\n </div>\n }\n </div>\n\n <div class=\"widget-info\">\n @if (storyUrl) {\n <a\n [href]=\"storyUrl\"\n target=\"_blank\"\n class=\"widget-title-link\"\n [title]=\"storyName\"\n >\n <span class=\"widget-title\">{{ storyName }}</span>\n <span class=\"material-icons-outlined external-icon\">open_in_new</span>\n </a>\n } @else {\n <span class=\"widget-title\" [title]=\"storyName\">{{ storyName }}</span>\n }\n\n @if (description) {\n <p class=\"widget-description\">{{ description }}</p>\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
4066
+ }
4067
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: StoryDetailsOpenedWidgetComponent, decorators: [{
4068
+ type: Component,
4069
+ args: [{ selector: 'rtsee-story-details-opened-widget', standalone: true, imports: [CommonModule], template: "<div class=\"rtsee-event-widget story-details-opened-widget\">\n <div class=\"widget-header\">\n <div class=\"widget-badge opened-badge\">\n <span class=\"material-icons-outlined widget-badge-icon\">visibility</span>\n <span class=\"widget-badge-label\">Story Opened</span>\n </div>\n <div\n class=\"widget-timer\"\n [class.live]=\"isLive\"\n [title]=\"isLive ? 'Currently active' : 'Time spent before next event'\"\n >\n <span class=\"material-icons-outlined widget-timer-icon\">timer</span>\n <span class=\"widget-timer-text\">{{ durationText }}</span>\n </div>\n </div>\n\n <div class=\"widget-body\">\n <div class=\"widget-media\">\n @if (imageUrl) {\n <img\n [src]=\"imageUrl\"\n [alt]=\"storyName\"\n class=\"widget-thumbnail-image\"\n />\n } @else {\n <div class=\"widget-thumbnail-placeholder\">\n <span class=\"material-icons-outlined\">auto_stories</span>\n </div>\n }\n </div>\n\n <div class=\"widget-info\">\n @if (storyUrl) {\n <a\n [href]=\"storyUrl\"\n target=\"_blank\"\n class=\"widget-title-link\"\n [title]=\"storyName\"\n >\n <span class=\"widget-title\">{{ storyName }}</span>\n <span class=\"material-icons-outlined external-icon\">open_in_new</span>\n </a>\n } @else {\n <span class=\"widget-title\" [title]=\"storyName\">{{ storyName }}</span>\n }\n\n @if (description) {\n <p class=\"widget-description\">{{ description }}</p>\n }\n </div>\n </div>\n</div>\n" }]
4070
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
4071
+
4072
+ class StoryReadingStartedWidgetComponent extends BaseEventWidgetComponent {
4073
+ constructor(cd) {
4074
+ super(cd);
4075
+ }
4076
+ get storyName() {
4077
+ return (this.event?.payload?.text ||
4078
+ this.event?.payload?.data?.storyName ||
4079
+ this.event?.payload?.data?.story?.name ||
4080
+ 'Reading Story');
4081
+ }
4082
+ get storyUrl() {
4083
+ if (this.event?.payload?.url) {
4084
+ return this.event.payload.url;
4085
+ }
4086
+ const storyId = this.event?.payload?.data?.storyId ||
4087
+ this.event?.payload?.data?.story?.id;
4088
+ return storyId ? `/presentation/content/${storyId}` : null;
4089
+ }
4090
+ get imageUrl() {
4091
+ return (this.event?.payload?.imageUrl ||
4092
+ this.event?.payload?.data?.story?.imageUrl ||
4093
+ null);
4094
+ }
4095
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: StoryReadingStartedWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4096
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: StoryReadingStartedWidgetComponent, isStandalone: true, selector: "rtsee-story-reading-started-widget", usesInheritance: true, ngImport: i0, template: "<div class=\"rtsee-event-widget story-reading-started-widget\">\n <div class=\"widget-header\">\n <div class=\"widget-badge reading-badge\">\n <span class=\"material-icons-outlined widget-badge-icon\">menu_book</span>\n <span class=\"widget-badge-label\">Reading Started</span>\n </div>\n <div\n class=\"widget-timer\"\n [class.live]=\"isLive\"\n [title]=\"isLive ? 'Currently reading' : 'Time spent reading'\"\n >\n <span class=\"material-icons-outlined widget-timer-icon\">timer</span>\n <span class=\"widget-timer-text\">{{ durationText }}</span>\n </div>\n </div>\n\n <div class=\"widget-body\">\n <div class=\"widget-media\">\n @if (imageUrl) {\n <img\n [src]=\"imageUrl\"\n [alt]=\"storyName\"\n class=\"widget-thumbnail-image\"\n />\n } @else {\n <div class=\"widget-thumbnail-placeholder reading-placeholder\">\n <span class=\"material-icons-outlined\">menu_book</span>\n </div>\n }\n </div>\n\n <div class=\"widget-info\">\n @if (storyUrl) {\n <a\n [href]=\"storyUrl\"\n target=\"_blank\"\n class=\"widget-title-link\"\n [title]=\"storyName\"\n >\n <span class=\"widget-title\">{{ storyName }}</span>\n <span class=\"material-icons-outlined external-icon\">open_in_new</span>\n </a>\n } @else {\n <span class=\"widget-title\" [title]=\"storyName\">{{ storyName }}</span>\n }\n <span class=\"widget-subtitle\">Interactive Story Session</span>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
4097
+ }
4098
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: StoryReadingStartedWidgetComponent, decorators: [{
4099
+ type: Component,
4100
+ args: [{ selector: 'rtsee-story-reading-started-widget', standalone: true, imports: [CommonModule], template: "<div class=\"rtsee-event-widget story-reading-started-widget\">\n <div class=\"widget-header\">\n <div class=\"widget-badge reading-badge\">\n <span class=\"material-icons-outlined widget-badge-icon\">menu_book</span>\n <span class=\"widget-badge-label\">Reading Started</span>\n </div>\n <div\n class=\"widget-timer\"\n [class.live]=\"isLive\"\n [title]=\"isLive ? 'Currently reading' : 'Time spent reading'\"\n >\n <span class=\"material-icons-outlined widget-timer-icon\">timer</span>\n <span class=\"widget-timer-text\">{{ durationText }}</span>\n </div>\n </div>\n\n <div class=\"widget-body\">\n <div class=\"widget-media\">\n @if (imageUrl) {\n <img\n [src]=\"imageUrl\"\n [alt]=\"storyName\"\n class=\"widget-thumbnail-image\"\n />\n } @else {\n <div class=\"widget-thumbnail-placeholder reading-placeholder\">\n <span class=\"material-icons-outlined\">menu_book</span>\n </div>\n }\n </div>\n\n <div class=\"widget-info\">\n @if (storyUrl) {\n <a\n [href]=\"storyUrl\"\n target=\"_blank\"\n class=\"widget-title-link\"\n [title]=\"storyName\"\n >\n <span class=\"widget-title\">{{ storyName }}</span>\n <span class=\"material-icons-outlined external-icon\">open_in_new</span>\n </a>\n } @else {\n <span class=\"widget-title\" [title]=\"storyName\">{{ storyName }}</span>\n }\n <span class=\"widget-subtitle\">Interactive Story Session</span>\n </div>\n </div>\n</div>\n" }]
4101
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
4102
+
4103
+ class SlideNumberChangedWidgetComponent extends BaseEventWidgetComponent {
4104
+ constructor(cd) {
4105
+ super(cd);
4106
+ }
4107
+ get slideNumber() {
4108
+ const num = this.event?.payload?.data?.slideNumber ??
4109
+ this.event?.payload?.data?.slide?.slideNumber;
4110
+ return num !== undefined ? num : '?';
4111
+ }
4112
+ get totalSlides() {
4113
+ const total = this.event?.payload?.data?.totalSlides;
4114
+ return total !== undefined ? total : null;
4115
+ }
4116
+ get slideText() {
4117
+ return (this.event?.payload?.text ||
4118
+ this.event?.payload?.data?.slide?.description ||
4119
+ this.event?.payload?.data?.slide?.name ||
4120
+ `Slide ${this.slideNumber}`);
4121
+ }
4122
+ get storyName() {
4123
+ return (this.event?.payload?.data?.storyName ||
4124
+ this.event?.payload?.data?.story?.name ||
4125
+ null);
4126
+ }
4127
+ get storyUrl() {
4128
+ if (this.event?.payload?.url) {
4129
+ return this.event.payload.url;
4130
+ }
4131
+ const storyId = this.event?.payload?.data?.storyId ||
4132
+ this.event?.payload?.data?.story?.id;
4133
+ return storyId ? `/presentation/content/${storyId}` : null;
4134
+ }
4135
+ get imageUrl() {
4136
+ return (this.event?.payload?.imageUrl ||
4137
+ this.event?.payload?.data?.slide?.imageUrl ||
4138
+ this.event?.payload?.data?.story?.imageUrl ||
4139
+ null);
4140
+ }
4141
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: SlideNumberChangedWidgetComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4142
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: SlideNumberChangedWidgetComponent, isStandalone: true, selector: "rtsee-slide-number-changed-widget", usesInheritance: true, ngImport: i0, template: "<div class=\"rtsee-event-widget slide-number-changed-widget\">\n <div class=\"widget-header\">\n <div class=\"widget-badge slide-badge\">\n <span class=\"material-icons-outlined widget-badge-icon\"\n >view_carousel</span\n >\n <span class=\"widget-badge-label\">\n Slide {{ slideNumber }}\n @if (totalSlides) {\n / {{ totalSlides }}\n }\n </span>\n </div>\n <div\n class=\"widget-timer\"\n [class.live]=\"isLive\"\n [title]=\"isLive ? 'Currently viewing slide' : 'Time spent on this slide'\"\n >\n <span class=\"material-icons-outlined widget-timer-icon\">timer</span>\n <span class=\"widget-timer-text\">{{ durationText }}</span>\n </div>\n </div>\n\n <div class=\"widget-body\">\n <div class=\"widget-media\">\n @if (imageUrl) {\n <img\n [src]=\"imageUrl\"\n [alt]=\"slideText\"\n class=\"widget-thumbnail-image\"\n />\n } @else {\n <div class=\"widget-thumbnail-placeholder slide-placeholder\">\n <span class=\"material-icons-outlined\">image</span>\n </div>\n }\n </div>\n\n <div class=\"widget-info\">\n <span class=\"widget-title\" [title]=\"slideText\">{{ slideText }}</span>\n @if (storyName) {\n @if (storyUrl) {\n <a\n [href]=\"storyUrl\"\n target=\"_blank\"\n class=\"widget-story-link\"\n [title]=\"storyName\"\n >\n <span class=\"widget-story-name\">{{ storyName }}</span>\n <span class=\"material-icons-outlined external-icon\"\n >open_in_new</span\n >\n </a>\n } @else {\n <span class=\"widget-story-name\">{{ storyName }}</span>\n }\n }\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }] }); }
4143
+ }
4144
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: SlideNumberChangedWidgetComponent, decorators: [{
4145
+ type: Component,
4146
+ args: [{ selector: 'rtsee-slide-number-changed-widget', standalone: true, imports: [CommonModule], template: "<div class=\"rtsee-event-widget slide-number-changed-widget\">\n <div class=\"widget-header\">\n <div class=\"widget-badge slide-badge\">\n <span class=\"material-icons-outlined widget-badge-icon\"\n >view_carousel</span\n >\n <span class=\"widget-badge-label\">\n Slide {{ slideNumber }}\n @if (totalSlides) {\n / {{ totalSlides }}\n }\n </span>\n </div>\n <div\n class=\"widget-timer\"\n [class.live]=\"isLive\"\n [title]=\"isLive ? 'Currently viewing slide' : 'Time spent on this slide'\"\n >\n <span class=\"material-icons-outlined widget-timer-icon\">timer</span>\n <span class=\"widget-timer-text\">{{ durationText }}</span>\n </div>\n </div>\n\n <div class=\"widget-body\">\n <div class=\"widget-media\">\n @if (imageUrl) {\n <img\n [src]=\"imageUrl\"\n [alt]=\"slideText\"\n class=\"widget-thumbnail-image\"\n />\n } @else {\n <div class=\"widget-thumbnail-placeholder slide-placeholder\">\n <span class=\"material-icons-outlined\">image</span>\n </div>\n }\n </div>\n\n <div class=\"widget-info\">\n <span class=\"widget-title\" [title]=\"slideText\">{{ slideText }}</span>\n @if (storyName) {\n @if (storyUrl) {\n <a\n [href]=\"storyUrl\"\n target=\"_blank\"\n class=\"widget-story-link\"\n [title]=\"storyName\"\n >\n <span class=\"widget-story-name\">{{ storyName }}</span>\n <span class=\"material-icons-outlined external-icon\"\n >open_in_new</span\n >\n </a>\n } @else {\n <span class=\"widget-story-name\">{{ storyName }}</span>\n }\n }\n </div>\n </div>\n</div>\n" }]
4147
+ }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
4148
+
3922
4149
  class EventsWidgetsService {
3923
4150
  constructor() {
3924
- this.widgetsMap = [];
4151
+ this.widgetsMap = [
4152
+ {
4153
+ name: 'story-details-opened',
4154
+ component: StoryDetailsOpenedWidgetComponent,
4155
+ },
4156
+ {
4157
+ name: 'story-reading-started',
4158
+ component: StoryReadingStartedWidgetComponent,
4159
+ },
4160
+ {
4161
+ name: 'slide-number-changed',
4162
+ component: SlideNumberChangedWidgetComponent,
4163
+ },
4164
+ ];
3925
4165
  }
3926
4166
  getWidgetComponentByName(name) {
3927
4167
  /* eslint-disable */
@@ -3951,7 +4191,8 @@ class EventThumbnailComponent {
3951
4191
  this.timeInAgoFormat = '';
3952
4192
  }
3953
4193
  ngOnInit() {
3954
- if (this.event.data) {
4194
+ const eventData = this.event.payload?.data || this.event.data;
4195
+ if (eventData) {
3955
4196
  this.generateTooltip();
3956
4197
  }
3957
4198
  this.timeInAgoFormat = this.timeFormatService.toAgo(this.event.createdAt);
@@ -3962,16 +4203,17 @@ class EventThumbnailComponent {
3962
4203
  generateTooltip() {
3963
4204
  /* eslint-disable */
3964
4205
  let tooltip = '';
3965
- if (typeof this.event.data !== 'object') {
4206
+ const eventData = this.event.payload?.data || this.event.data;
4207
+ if (typeof eventData !== 'object' || !eventData) {
3966
4208
  return;
3967
4209
  }
3968
4210
  try {
3969
- for (const key in this.event.data) {
3970
- if (this.event.data.hasOwnProperty(key)) {
4211
+ for (const key in eventData) {
4212
+ if (eventData.hasOwnProperty(key)) {
3971
4213
  if (tooltip) {
3972
- tooltip += '&#013;';
4214
+ tooltip += '\n';
3973
4215
  }
3974
- tooltip += key + ' -> ' + this.event.data[key];
4216
+ tooltip += key + ' -> ' + eventData[key];
3975
4217
  }
3976
4218
  }
3977
4219
  this.tooltip = tooltip;
@@ -3981,6 +4223,17 @@ class EventThumbnailComponent {
3981
4223
  }
3982
4224
  /* eslint-enable */
3983
4225
  }
4226
+ ngOnChanges(changes) {
4227
+ if (this.componentRef) {
4228
+ if (changes['event']) {
4229
+ this.componentRef.instance.event = this.event;
4230
+ }
4231
+ if (changes['session']) {
4232
+ this.componentRef.instance.session = this.session;
4233
+ }
4234
+ this.componentRef.changeDetectorRef.detectChanges();
4235
+ }
4236
+ }
3984
4237
  ngAfterViewInit() {
3985
4238
  this.cd.detectChanges();
3986
4239
  /* eslint-disable */
@@ -3992,37 +4245,99 @@ class EventThumbnailComponent {
3992
4245
  const viewContainerRef = this.widgetHost.viewContainerRef;
3993
4246
  viewContainerRef.clear();
3994
4247
  const componentToShow = this.componentFactoryResolver.resolveComponentFactory(widget);
3995
- const componentRef = viewContainerRef.createComponent(componentToShow);
3996
- componentRef.instance.event = this.event;
3997
- componentRef.instance.event = this.event;
3998
- componentRef.changeDetectorRef.detectChanges();
4248
+ this.componentRef = viewContainerRef.createComponent(componentToShow);
4249
+ this.componentRef.instance.event = this.event;
4250
+ this.componentRef.instance.session = this.session;
4251
+ this.componentRef.changeDetectorRef.detectChanges();
3999
4252
  }
4000
4253
  /* eslint-enable */
4001
4254
  }
4002
4255
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: EventThumbnailComponent, deps: [{ token: EventsWidgetsService }, { token: i0.ComponentFactoryResolver }, { token: TimeFormatHelperService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4003
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: EventThumbnailComponent, isStandalone: true, selector: "rtsee-event-thumbnail", inputs: { event: "event" }, viewQueries: [{ propertyName: "widgetHost", first: true, predicate: WidgetDirective, descendants: true }], ngImport: i0, template: "<div class=\"rtsee-events-dashboard-event-thumbnail\">\n @if (event.widget) {\n <ng-template widgetHost></ng-template>\n } @else if (!event.widget) {\n <div class=\"rtsee-events-dashboard-default-event-thumbnail\"\n [ngClass]=\"{'rtsee-events-dashboard-default-event-thumbnail-with-data': event.data}\"\n >\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-name\">{{event.name}}</div>\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-info\">\n @if (event.data) {\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-details\"\n [title]=\"tooltip\"\n >\n <span class=\"rtsee-events-dashboard-default-event-thumbnail-details-icon material-icons-outlined\"\n >info</span>\n </div>\n }\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-time\">\n <span>{{ timeInAgoFormat }}</span>\n </div>\n </div>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: WidgetDirective, selector: "[widgetHost]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
4256
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: EventThumbnailComponent, isStandalone: true, selector: "rtsee-event-thumbnail", inputs: { event: "event", session: "session" }, viewQueries: [{ propertyName: "widgetHost", first: true, predicate: WidgetDirective, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div class=\"rtsee-events-dashboard-event-thumbnail\">\n @if (event.widget) {\n <ng-template widgetHost></ng-template>\n } @else if (!event.widget) {\n <div\n class=\"rtsee-events-dashboard-default-event-thumbnail\"\n [ngClass]=\"{\n 'rtsee-events-dashboard-default-event-thumbnail-with-data':\n event.payload?.data || event.data,\n }\"\n >\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-name\">\n {{ event.name }}\n </div>\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-info\">\n @if (event.payload?.data || event.data) {\n <div\n class=\"rtsee-events-dashboard-default-event-thumbnail-details\"\n [title]=\"tooltip\"\n >\n <span\n class=\"rtsee-events-dashboard-default-event-thumbnail-details-icon material-icons-outlined\"\n >info</span\n >\n </div>\n }\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-time\">\n <span>{{ timeInAgoFormat }}</span>\n </div>\n </div>\n </div>\n }\n</div>\n", dependencies: [{ kind: "directive", type: WidgetDirective, selector: "[widgetHost]" }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
4004
4257
  }
4005
4258
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: EventThumbnailComponent, decorators: [{
4006
4259
  type: Component,
4007
- args: [{ selector: 'rtsee-event-thumbnail', imports: [WidgetDirective, NgClass], standalone: true, template: "<div class=\"rtsee-events-dashboard-event-thumbnail\">\n @if (event.widget) {\n <ng-template widgetHost></ng-template>\n } @else if (!event.widget) {\n <div class=\"rtsee-events-dashboard-default-event-thumbnail\"\n [ngClass]=\"{'rtsee-events-dashboard-default-event-thumbnail-with-data': event.data}\"\n >\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-name\">{{event.name}}</div>\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-info\">\n @if (event.data) {\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-details\"\n [title]=\"tooltip\"\n >\n <span class=\"rtsee-events-dashboard-default-event-thumbnail-details-icon material-icons-outlined\"\n >info</span>\n </div>\n }\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-time\">\n <span>{{ timeInAgoFormat }}</span>\n </div>\n </div>\n </div>\n }\n</div>\n" }]
4260
+ args: [{ selector: 'rtsee-event-thumbnail', imports: [WidgetDirective, NgClass], standalone: true, template: "<div class=\"rtsee-events-dashboard-event-thumbnail\">\n @if (event.widget) {\n <ng-template widgetHost></ng-template>\n } @else if (!event.widget) {\n <div\n class=\"rtsee-events-dashboard-default-event-thumbnail\"\n [ngClass]=\"{\n 'rtsee-events-dashboard-default-event-thumbnail-with-data':\n event.payload?.data || event.data,\n }\"\n >\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-name\">\n {{ event.name }}\n </div>\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-info\">\n @if (event.payload?.data || event.data) {\n <div\n class=\"rtsee-events-dashboard-default-event-thumbnail-details\"\n [title]=\"tooltip\"\n >\n <span\n class=\"rtsee-events-dashboard-default-event-thumbnail-details-icon material-icons-outlined\"\n >info</span\n >\n </div>\n }\n <div class=\"rtsee-events-dashboard-default-event-thumbnail-time\">\n <span>{{ timeInAgoFormat }}</span>\n </div>\n </div>\n </div>\n }\n</div>\n" }]
4008
4261
  }], ctorParameters: () => [{ type: EventsWidgetsService }, { type: i0.ComponentFactoryResolver }, { type: TimeFormatHelperService }, { type: i0.ChangeDetectorRef }], propDecorators: { event: [{
4009
4262
  type: Input
4263
+ }], session: [{
4264
+ type: Input
4010
4265
  }], widgetHost: [{
4011
4266
  type: ViewChild,
4012
4267
  args: [WidgetDirective, { static: false }]
4013
4268
  }] } });
4014
4269
 
4015
4270
  class RtseeEventsDashboardSessionComponent {
4016
- constructor(timeFormatService) {
4271
+ constructor(timeFormatService, cd) {
4017
4272
  this.timeFormatService = timeFormatService;
4273
+ this.cd = cd;
4274
+ this.durationText = '00:00';
4275
+ this.visibleEventsCount = 5;
4276
+ this.timerInterval = null;
4277
+ }
4278
+ ngOnInit() {
4279
+ this.initTimer();
4280
+ }
4281
+ ngOnChanges(changes) {
4282
+ if (changes['session']) {
4283
+ this.initTimer();
4284
+ }
4285
+ }
4286
+ ngOnDestroy() {
4287
+ this.stopTimer();
4288
+ }
4289
+ loadMoreEvents() {
4290
+ this.visibleEventsCount += 5;
4291
+ this.cd.markForCheck();
4292
+ }
4293
+ initTimer() {
4294
+ this.stopTimer();
4295
+ this.updateDuration();
4296
+ if (this.session?.isActive) {
4297
+ this.timerInterval = setInterval(() => {
4298
+ this.updateDuration();
4299
+ this.cd.markForCheck();
4300
+ }, 1000);
4301
+ }
4302
+ }
4303
+ stopTimer() {
4304
+ if (this.timerInterval) {
4305
+ clearInterval(this.timerInterval);
4306
+ this.timerInterval = null;
4307
+ }
4018
4308
  }
4019
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardSessionComponent, deps: [{ token: TimeFormatHelperService }], target: i0.ɵɵFactoryTarget.Component }); }
4020
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: RtseeEventsDashboardSessionComponent, isStandalone: true, selector: "rtsee-rtsee-events-dashboard-session", inputs: { session: "session" }, ngImport: i0, template: "<div class=\"rtsee-events-dashboard-session\">\n @if (session.info) {\n <div class=\"rtsee-events-dashboard-session-header\">\n <p class=\"rtsee-events-dashboard-session-client-info\">{{session.info.clientThumbnail}}</p>\n <p class=\"rtsee-events-dashboard-session-os-info\">{{session.info.osThumbnail}}</p>\n <div class=\"rtsee-events-dashboard-session-device-info\" [title]=\"session.info.deviceThumbnail\">\n @if (session.info.deviceType === 'smartphone' && !session.info.botName) {\n <span class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >phone_iphone</span>\n }\n @if (session.info.deviceType === 'tablet' && !session.info.botName) {\n <span class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >tablet_mac</span>\n }\n @if (session.info.deviceType === 'desktop' && !session.info.botName) {\n <span class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >computer</span>\n }\n @if (session.info.botName) {\n <span class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >smart_toy</span>\n }\n </div>\n </div>\n }\n @if (session.events && session.events.length) {\n <ul class=\"rtsee-events-dashboard-session-events-list\"\n >\n @for (event of session.events | slice:0:5; track event.id) {\n <li class=\"rtsee-events-dashboard-session-event\">\n <rtsee-event-thumbnail [event]=\"event\"></rtsee-event-thumbnail>\n </li>\n }\n </ul>\n }\n\n <div class=\"rtsee-events-dashboard-session-footer\">\n <button *ngIf=\"session.events.length > 5\">{{session.events.length - 5}} more</button>\n </div>\n</div>\n", dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: EventThumbnailComponent, selector: "rtsee-event-thumbnail", inputs: ["event"] }, { kind: "pipe", type: SlicePipe, name: "slice" }] }); }
4309
+ updateDuration() {
4310
+ if (!this.session) {
4311
+ return;
4312
+ }
4313
+ const start = this.session.connectedAt
4314
+ ? new Date(this.session.connectedAt).getTime()
4315
+ : Date.now();
4316
+ let end;
4317
+ if (this.session.isActive) {
4318
+ end = Date.now();
4319
+ }
4320
+ else if (this.session.endedAt) {
4321
+ end = new Date(this.session.endedAt).getTime();
4322
+ }
4323
+ else if (this.session.events && this.session.events.length > 0) {
4324
+ end = new Date(this.session.events[0].createdAt).getTime();
4325
+ }
4326
+ else {
4327
+ end = start;
4328
+ }
4329
+ const totalSeconds = Math.max(0, Math.floor((end - start) / 1000));
4330
+ const minutes = Math.floor(totalSeconds / 60);
4331
+ const seconds = totalSeconds % 60;
4332
+ this.durationText = `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
4333
+ }
4334
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardSessionComponent, deps: [{ token: TimeFormatHelperService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
4335
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: RtseeEventsDashboardSessionComponent, isStandalone: true, selector: "rtsee-rtsee-events-dashboard-session", inputs: { session: "session" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"rtsee-events-dashboard-session\">\n <div class=\"rtsee-events-dashboard-session-header\">\n @if (session.info) {\n <div class=\"rtsee-events-dashboard-session-header-client\">\n <p class=\"rtsee-events-dashboard-session-client-info\">\n {{ session.info.clientThumbnail }}\n </p>\n <p class=\"rtsee-events-dashboard-session-os-info\">\n {{ session.info.osThumbnail }}\n </p>\n </div>\n <div\n class=\"rtsee-events-dashboard-session-device-info\"\n [title]=\"session.info.deviceThumbnail\"\n >\n @if (\n session.info.deviceType === \"smartphone\" && !session.info.botName\n ) {\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >phone_iphone</span\n >\n }\n @if (session.info.deviceType === \"tablet\" && !session.info.botName) {\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >tablet_mac</span\n >\n }\n @if (session.info.deviceType === \"desktop\" && !session.info.botName) {\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >computer</span\n >\n }\n @if (session.info.botName) {\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >smart_toy</span\n >\n }\n </div>\n }\n <div\n class=\"rtsee-events-dashboard-session-duration\"\n [class.is-active]=\"session.isActive\"\n [title]=\"session.isActive ? 'Active session' : 'Session ended'\"\n >\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-duration-icon\"\n >timer</span\n >\n <span class=\"rtsee-events-dashboard-session-duration-text\">{{\n durationText\n }}</span>\n </div>\n </div>\n\n @if (session.events && session.events.length) {\n <ul class=\"rtsee-events-dashboard-session-events-list\">\n @for (\n event of session.events | slice: 0 : visibleEventsCount;\n track event.id\n ) {\n <li class=\"rtsee-events-dashboard-session-event\">\n <rtsee-event-thumbnail\n [event]=\"event\"\n [session]=\"session\"\n ></rtsee-event-thumbnail>\n </li>\n }\n </ul>\n }\n\n @if (session.events && session.events.length > visibleEventsCount) {\n <div class=\"rtsee-events-dashboard-session-footer\">\n <button\n class=\"rtsee-events-dashboard-session-more-btn\"\n (click)=\"loadMoreEvents()\"\n >\n {{ session.events.length - visibleEventsCount }} more\n </button>\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: EventThumbnailComponent, selector: "rtsee-event-thumbnail", inputs: ["event", "session"] }, { kind: "pipe", type: SlicePipe, name: "slice" }] }); }
4021
4336
  }
4022
4337
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardSessionComponent, decorators: [{
4023
4338
  type: Component,
4024
- args: [{ selector: 'rtsee-rtsee-events-dashboard-session', imports: [NgIf, EventThumbnailComponent, SlicePipe], standalone: true, template: "<div class=\"rtsee-events-dashboard-session\">\n @if (session.info) {\n <div class=\"rtsee-events-dashboard-session-header\">\n <p class=\"rtsee-events-dashboard-session-client-info\">{{session.info.clientThumbnail}}</p>\n <p class=\"rtsee-events-dashboard-session-os-info\">{{session.info.osThumbnail}}</p>\n <div class=\"rtsee-events-dashboard-session-device-info\" [title]=\"session.info.deviceThumbnail\">\n @if (session.info.deviceType === 'smartphone' && !session.info.botName) {\n <span class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >phone_iphone</span>\n }\n @if (session.info.deviceType === 'tablet' && !session.info.botName) {\n <span class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >tablet_mac</span>\n }\n @if (session.info.deviceType === 'desktop' && !session.info.botName) {\n <span class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >computer</span>\n }\n @if (session.info.botName) {\n <span class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >smart_toy</span>\n }\n </div>\n </div>\n }\n @if (session.events && session.events.length) {\n <ul class=\"rtsee-events-dashboard-session-events-list\"\n >\n @for (event of session.events | slice:0:5; track event.id) {\n <li class=\"rtsee-events-dashboard-session-event\">\n <rtsee-event-thumbnail [event]=\"event\"></rtsee-event-thumbnail>\n </li>\n }\n </ul>\n }\n\n <div class=\"rtsee-events-dashboard-session-footer\">\n <button *ngIf=\"session.events.length > 5\">{{session.events.length - 5}} more</button>\n </div>\n</div>\n" }]
4025
- }], ctorParameters: () => [{ type: TimeFormatHelperService }], propDecorators: { session: [{
4339
+ args: [{ selector: 'rtsee-rtsee-events-dashboard-session', imports: [NgIf, EventThumbnailComponent, SlicePipe, NgClass], standalone: true, template: "<div class=\"rtsee-events-dashboard-session\">\n <div class=\"rtsee-events-dashboard-session-header\">\n @if (session.info) {\n <div class=\"rtsee-events-dashboard-session-header-client\">\n <p class=\"rtsee-events-dashboard-session-client-info\">\n {{ session.info.clientThumbnail }}\n </p>\n <p class=\"rtsee-events-dashboard-session-os-info\">\n {{ session.info.osThumbnail }}\n </p>\n </div>\n <div\n class=\"rtsee-events-dashboard-session-device-info\"\n [title]=\"session.info.deviceThumbnail\"\n >\n @if (\n session.info.deviceType === \"smartphone\" && !session.info.botName\n ) {\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >phone_iphone</span\n >\n }\n @if (session.info.deviceType === \"tablet\" && !session.info.botName) {\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >tablet_mac</span\n >\n }\n @if (session.info.deviceType === \"desktop\" && !session.info.botName) {\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >computer</span\n >\n }\n @if (session.info.botName) {\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-device-info-icon\"\n >smart_toy</span\n >\n }\n </div>\n }\n <div\n class=\"rtsee-events-dashboard-session-duration\"\n [class.is-active]=\"session.isActive\"\n [title]=\"session.isActive ? 'Active session' : 'Session ended'\"\n >\n <span\n class=\"material-icons-outlined rtsee-events-dashboard-session-duration-icon\"\n >timer</span\n >\n <span class=\"rtsee-events-dashboard-session-duration-text\">{{\n durationText\n }}</span>\n </div>\n </div>\n\n @if (session.events && session.events.length) {\n <ul class=\"rtsee-events-dashboard-session-events-list\">\n @for (\n event of session.events | slice: 0 : visibleEventsCount;\n track event.id\n ) {\n <li class=\"rtsee-events-dashboard-session-event\">\n <rtsee-event-thumbnail\n [event]=\"event\"\n [session]=\"session\"\n ></rtsee-event-thumbnail>\n </li>\n }\n </ul>\n }\n\n @if (session.events && session.events.length > visibleEventsCount) {\n <div class=\"rtsee-events-dashboard-session-footer\">\n <button\n class=\"rtsee-events-dashboard-session-more-btn\"\n (click)=\"loadMoreEvents()\"\n >\n {{ session.events.length - visibleEventsCount }} more\n </button>\n </div>\n }\n</div>\n" }]
4340
+ }], ctorParameters: () => [{ type: TimeFormatHelperService }, { type: i0.ChangeDetectorRef }], propDecorators: { session: [{
4026
4341
  type: Input
4027
4342
  }] } });
4028
4343
 
@@ -4036,11 +4351,11 @@ class RtseeEventsDashboardClientThumbnailComponent {
4036
4351
  this.dashboard.openChat(this.client);
4037
4352
  }
4038
4353
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardClientThumbnailComponent, deps: [{ token: TimeFormatHelperService }, { token: DefaultImagesService }], target: i0.ɵɵFactoryTarget.Component }); }
4039
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: RtseeEventsDashboardClientThumbnailComponent, isStandalone: true, selector: "ngx-rtsee-events-dashboard-client-thumbnail", inputs: { dashboard: "dashboard", client: "client" }, ngImport: i0, template: "<div class=\"rtsee-dashboard-client-thumbnail\">\n <div class=\"rtsee-dashboard-client-header\">\n <div class=\"rtsee-dashboard-client-header-photo\">\n <div class=\"rtsee-dashboard-client-header-image\"\n [style.background-image]=\"'url(' + client.imageUrl || defaultImagesService.PROFILE + ')'\"\n ></div>\n @if (client.isConnected) {\n <div class=\"rtsee-dashboard-client-live-indicator\"></div>\n }\n </div>\n <p class=\"rtsee-dashboard-client-name\">\n <span class=\"rtsee-dashboard-client-name-text\">{{ client.name || client.id }}</span>\n <button (click)=\"openChat()\" class=\"rtsee-dashboard-client-engage\">\n <span class=\"rtsee-dashboard-client-engage-icon material-icons-outlined\">chat_bubble</span>\n </button>\n </p>\n </div>\n <div class=\"rtsee-dashboard-sessions\">\n @for(session of client.sessions; track session.id) {\n <div class=\"rtsee-dashboard-sessions-container\">\n <rtsee-rtsee-events-dashboard-session [session]=\"session\"></rtsee-rtsee-events-dashboard-session>\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: RtseeEventsDashboardSessionComponent, selector: "rtsee-rtsee-events-dashboard-session", inputs: ["session"] }] }); }
4354
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: RtseeEventsDashboardClientThumbnailComponent, isStandalone: true, selector: "ngx-rtsee-events-dashboard-client-thumbnail", inputs: { dashboard: "dashboard", client: "client" }, ngImport: i0, template: "<div class=\"rtsee-dashboard-client-thumbnail\">\n <div class=\"rtsee-dashboard-client-header\">\n <div class=\"rtsee-dashboard-client-header-photo\">\n <div\n class=\"rtsee-dashboard-client-header-image\"\n [style.background-image]=\"\n 'url(' + client.imageUrl || defaultImagesService.PROFILE + ')'\n \"\n ></div>\n @if (client.isConnected) {\n <div class=\"rtsee-dashboard-client-live-indicator\"></div>\n }\n </div>\n <p class=\"rtsee-dashboard-client-name\">\n <span class=\"rtsee-dashboard-client-name-text\">{{\n client.name || client.id\n }}</span>\n <button (click)=\"openChat()\" class=\"rtsee-dashboard-client-engage\">\n <span class=\"rtsee-dashboard-client-engage-icon material-icons-outlined\"\n >chat_bubble</span\n >\n </button>\n </p>\n </div>\n <div class=\"rtsee-dashboard-sessions\">\n @for (session of client.sessions; track session.id) {\n <div class=\"rtsee-dashboard-sessions-container\">\n <rtsee-rtsee-events-dashboard-session\n [session]=\"session\"\n ></rtsee-rtsee-events-dashboard-session>\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: RtseeEventsDashboardSessionComponent, selector: "rtsee-rtsee-events-dashboard-session", inputs: ["session"] }] }); }
4040
4355
  }
4041
4356
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardClientThumbnailComponent, decorators: [{
4042
4357
  type: Component,
4043
- args: [{ selector: 'ngx-rtsee-events-dashboard-client-thumbnail', imports: [RtseeEventsDashboardSessionComponent], standalone: true, template: "<div class=\"rtsee-dashboard-client-thumbnail\">\n <div class=\"rtsee-dashboard-client-header\">\n <div class=\"rtsee-dashboard-client-header-photo\">\n <div class=\"rtsee-dashboard-client-header-image\"\n [style.background-image]=\"'url(' + client.imageUrl || defaultImagesService.PROFILE + ')'\"\n ></div>\n @if (client.isConnected) {\n <div class=\"rtsee-dashboard-client-live-indicator\"></div>\n }\n </div>\n <p class=\"rtsee-dashboard-client-name\">\n <span class=\"rtsee-dashboard-client-name-text\">{{ client.name || client.id }}</span>\n <button (click)=\"openChat()\" class=\"rtsee-dashboard-client-engage\">\n <span class=\"rtsee-dashboard-client-engage-icon material-icons-outlined\">chat_bubble</span>\n </button>\n </p>\n </div>\n <div class=\"rtsee-dashboard-sessions\">\n @for(session of client.sessions; track session.id) {\n <div class=\"rtsee-dashboard-sessions-container\">\n <rtsee-rtsee-events-dashboard-session [session]=\"session\"></rtsee-rtsee-events-dashboard-session>\n </div>\n }\n </div>\n</div>\n" }]
4358
+ args: [{ selector: 'ngx-rtsee-events-dashboard-client-thumbnail', imports: [RtseeEventsDashboardSessionComponent], standalone: true, template: "<div class=\"rtsee-dashboard-client-thumbnail\">\n <div class=\"rtsee-dashboard-client-header\">\n <div class=\"rtsee-dashboard-client-header-photo\">\n <div\n class=\"rtsee-dashboard-client-header-image\"\n [style.background-image]=\"\n 'url(' + client.imageUrl || defaultImagesService.PROFILE + ')'\n \"\n ></div>\n @if (client.isConnected) {\n <div class=\"rtsee-dashboard-client-live-indicator\"></div>\n }\n </div>\n <p class=\"rtsee-dashboard-client-name\">\n <span class=\"rtsee-dashboard-client-name-text\">{{\n client.name || client.id\n }}</span>\n <button (click)=\"openChat()\" class=\"rtsee-dashboard-client-engage\">\n <span class=\"rtsee-dashboard-client-engage-icon material-icons-outlined\"\n >chat_bubble</span\n >\n </button>\n </p>\n </div>\n <div class=\"rtsee-dashboard-sessions\">\n @for (session of client.sessions; track session.id) {\n <div class=\"rtsee-dashboard-sessions-container\">\n <rtsee-rtsee-events-dashboard-session\n [session]=\"session\"\n ></rtsee-rtsee-events-dashboard-session>\n </div>\n }\n </div>\n</div>\n" }]
4044
4359
  }], ctorParameters: () => [{ type: TimeFormatHelperService }, { type: DefaultImagesService }], propDecorators: { dashboard: [{
4045
4360
  type: Input
4046
4361
  }], client: [{
@@ -4048,12 +4363,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
4048
4363
  }] } });
4049
4364
 
4050
4365
  class RtseeEventsDashboardComponent {
4366
+ loadMore() {
4367
+ if (this.eventsDashboard) {
4368
+ this.eventsDashboard.loadMoreClients();
4369
+ }
4370
+ }
4051
4371
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
4052
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: RtseeEventsDashboardComponent, isStandalone: true, selector: "rtsee-events-dashboard", inputs: { eventsDashboard: "eventsDashboard" }, ngImport: i0, template: "<div class=\"rtsee-events-dashboard\">\n <div class=\"rtsee-events-dashboard-client-thumbnails\">\n @for (client of eventsDashboard.clients; track client.id) {\n <div class=\"rtsee-events-dashboard-client-thumbnail-wrapper\">\n <ngx-rtsee-events-dashboard-client-thumbnail\n [client]=\"client\"\n [dashboard]=\"eventsDashboard\"\n ></ngx-rtsee-events-dashboard-client-thumbnail>\n </div>\n }\n </div>\n</div>\n", dependencies: [{ kind: "component", type: RtseeEventsDashboardClientThumbnailComponent, selector: "ngx-rtsee-events-dashboard-client-thumbnail", inputs: ["dashboard", "client"] }] }); }
4372
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: RtseeEventsDashboardComponent, isStandalone: true, selector: "rtsee-events-dashboard", inputs: { eventsDashboard: "eventsDashboard" }, ngImport: i0, template: "<div class=\"rtsee-events-dashboard\">\n <div class=\"rtsee-events-dashboard-client-thumbnails\">\n @for (client of eventsDashboard.clients; track client.id) {\n <div class=\"rtsee-events-dashboard-client-thumbnail-wrapper\">\n <ngx-rtsee-events-dashboard-client-thumbnail\n [client]=\"client\"\n [dashboard]=\"eventsDashboard\"\n ></ngx-rtsee-events-dashboard-client-thumbnail>\n </div>\n }\n </div>\n\n @if (eventsDashboard?.hasMoreClients) {\n <div class=\"rtsee-events-dashboard-load-more\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-load-more-btn\"\n [disabled]=\"eventsDashboard.isLoadingMore\"\n (click)=\"loadMore()\"\n >\n @if (eventsDashboard.isLoadingMore) {\n <span class=\"material-icons-outlined spin-icon\">sync</span>\n <span>Loading...</span>\n } @else {\n <span class=\"material-icons-outlined\">expand_more</span>\n <span>Load More Sessions</span>\n }\n </button>\n </div>\n }\n</div>\n", dependencies: [{ kind: "component", type: RtseeEventsDashboardClientThumbnailComponent, selector: "ngx-rtsee-events-dashboard-client-thumbnail", inputs: ["dashboard", "client"] }] }); }
4053
4373
  }
4054
4374
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: RtseeEventsDashboardComponent, decorators: [{
4055
4375
  type: Component,
4056
- args: [{ selector: 'rtsee-events-dashboard', imports: [RtseeEventsDashboardClientThumbnailComponent], standalone: true, template: "<div class=\"rtsee-events-dashboard\">\n <div class=\"rtsee-events-dashboard-client-thumbnails\">\n @for (client of eventsDashboard.clients; track client.id) {\n <div class=\"rtsee-events-dashboard-client-thumbnail-wrapper\">\n <ngx-rtsee-events-dashboard-client-thumbnail\n [client]=\"client\"\n [dashboard]=\"eventsDashboard\"\n ></ngx-rtsee-events-dashboard-client-thumbnail>\n </div>\n }\n </div>\n</div>\n" }]
4376
+ args: [{ selector: 'rtsee-events-dashboard', imports: [RtseeEventsDashboardClientThumbnailComponent], standalone: true, template: "<div class=\"rtsee-events-dashboard\">\n <div class=\"rtsee-events-dashboard-client-thumbnails\">\n @for (client of eventsDashboard.clients; track client.id) {\n <div class=\"rtsee-events-dashboard-client-thumbnail-wrapper\">\n <ngx-rtsee-events-dashboard-client-thumbnail\n [client]=\"client\"\n [dashboard]=\"eventsDashboard\"\n ></ngx-rtsee-events-dashboard-client-thumbnail>\n </div>\n }\n </div>\n\n @if (eventsDashboard?.hasMoreClients) {\n <div class=\"rtsee-events-dashboard-load-more\">\n <button\n type=\"button\"\n class=\"rtsee-events-dashboard-load-more-btn\"\n [disabled]=\"eventsDashboard.isLoadingMore\"\n (click)=\"loadMore()\"\n >\n @if (eventsDashboard.isLoadingMore) {\n <span class=\"material-icons-outlined spin-icon\">sync</span>\n <span>Loading...</span>\n } @else {\n <span class=\"material-icons-outlined\">expand_more</span>\n <span>Load More Sessions</span>\n }\n </button>\n </div>\n }\n</div>\n" }]
4057
4377
  }], propDecorators: { eventsDashboard: [{
4058
4378
  type: Input
4059
4379
  }] } });
@@ -6889,5 +7209,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
6889
7209
  * Generated bundle index. Do not edit.
6890
7210
  */
6891
7211
 
6892
- export { EntitiesConfigurationsListComponent, EntitiesListComponent, FormComponent, GtagService, IllustratorComponent, InteractiveStoryEditorComponent, ManageEntityComponent, ManageEntityConfigurationComponent, MessengerComponent, NgxService, PaymentProductSnippetComponent, PresentationComponent, ProfileComponent, RTSeeAuthComponent, RTSeeConferenceComponent, RTSeeContainerComponent, RTSeeControlsComponent, RTSeeModule, RTSeeTaskComponent, RtseeEntityCommentsComponent, RtseeEntityPreviewComponent, RtseeEntityTagsComponent, RtseeEventsDashboardComponent, RtseePeerComponent, RtseeSettingsComponent, RtseeTagGroupManageComponent, RtseeTagGroupsManageComponent, RtseeTagManageComponent, RtseeTagsAccordionMenuComponent, StoryElementsSectionComponent, WorkflowStepsService };
7212
+ export { BaseEventWidgetComponent, EntitiesConfigurationsListComponent, EntitiesListComponent, EventsWidgetsService, FormComponent, GtagService, IllustratorComponent, InteractiveStoryEditorComponent, ManageEntityComponent, ManageEntityConfigurationComponent, MessengerComponent, NgxService, PaymentProductSnippetComponent, PresentationComponent, ProfileComponent, RTSeeAuthComponent, RTSeeConferenceComponent, RTSeeContainerComponent, RTSeeControlsComponent, RTSeeModule, RTSeeTaskComponent, RtseeEntityCommentsComponent, RtseeEntityPreviewComponent, RtseeEntityTagsComponent, RtseeEventsDashboardComponent, RtseePeerComponent, RtseeSettingsComponent, RtseeTagGroupManageComponent, RtseeTagGroupsManageComponent, RtseeTagManageComponent, RtseeTagsAccordionMenuComponent, SlideNumberChangedWidgetComponent, StoryDetailsOpenedWidgetComponent, StoryElementsSectionComponent, StoryReadingStartedWidgetComponent };
6893
7213
  //# sourceMappingURL=rtsee-ngx.mjs.map