@dataclouder/ngx-agent-cards 0.1.83 → 0.1.86
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.
|
@@ -3331,6 +3331,7 @@ const BACKGROUND_SERVICE_TOKEN = new InjectionToken('BACKGROUND_SERVICE_TOKEN');
|
|
|
3331
3331
|
class VideoPlayerService {
|
|
3332
3332
|
constructor() {
|
|
3333
3333
|
this.conversationFlowStateService = inject(ConversationFlowStateService);
|
|
3334
|
+
this.useNativePlayer = false;
|
|
3334
3335
|
this.isRewinding = false;
|
|
3335
3336
|
this.videoQueue = [];
|
|
3336
3337
|
this.defaultVideoUrl = null;
|
|
@@ -3338,9 +3339,7 @@ class VideoPlayerService {
|
|
|
3338
3339
|
this.playAndRewinded$ = this.playAndRewindedSource.asObservable();
|
|
3339
3340
|
this.agentCard = signal(undefined, ...(ngDevMode ? [{ debugName: "agentCard" }] : []));
|
|
3340
3341
|
console.log(' CONSTRUCTOR FOR VIDEO PLAYER...');
|
|
3341
|
-
this.playAndRewindedSubscription = this.playAndRewinded$.subscribe(() => {
|
|
3342
|
-
this.playNextInQueue();
|
|
3343
|
-
});
|
|
3342
|
+
this.playAndRewindedSubscription = this.playAndRewinded$.subscribe(() => { });
|
|
3344
3343
|
this.moodSubscription = this.conversationFlowStateService.moodUpdated$.subscribe((mood) => {
|
|
3345
3344
|
console.log('CHANGING MOOD.. ', mood);
|
|
3346
3345
|
const card = this.agentCard();
|
|
@@ -3359,20 +3358,29 @@ class VideoPlayerService {
|
|
|
3359
3358
|
this.setVideoSource(card.assets.motion.url);
|
|
3360
3359
|
}
|
|
3361
3360
|
}
|
|
3362
|
-
initializePlayer(videoPlayer) {
|
|
3363
|
-
|
|
3364
|
-
|
|
3361
|
+
initializePlayer(videoPlayer, useNativePlayer = false) {
|
|
3362
|
+
this.useNativePlayer = useNativePlayer;
|
|
3363
|
+
if (this.useNativePlayer) {
|
|
3364
|
+
this.videoElement = videoPlayer.nativeElement;
|
|
3365
|
+
}
|
|
3366
|
+
else {
|
|
3367
|
+
if (this.player) {
|
|
3368
|
+
this.player.destroy();
|
|
3369
|
+
}
|
|
3370
|
+
this.player = new Plyr.default(videoPlayer.nativeElement, {
|
|
3371
|
+
controls: [],
|
|
3372
|
+
});
|
|
3373
|
+
this.player.on('ready', (event) => {
|
|
3374
|
+
const instance = event.detail.plyr;
|
|
3375
|
+
console.log('El video esta redyinstance', instance);
|
|
3376
|
+
});
|
|
3365
3377
|
}
|
|
3366
|
-
this.player = new Plyr.default(videoPlayer.nativeElement, {
|
|
3367
|
-
controls: [],
|
|
3368
|
-
});
|
|
3369
|
-
this.player.on('ready', (event) => {
|
|
3370
|
-
const instance = event.detail.plyr;
|
|
3371
|
-
console.log('El video esta redyinstance', instance);
|
|
3372
|
-
});
|
|
3373
3378
|
}
|
|
3374
3379
|
setVideoSource(videoUrl) {
|
|
3375
|
-
if (this.
|
|
3380
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3381
|
+
this.videoElement.src = videoUrl;
|
|
3382
|
+
}
|
|
3383
|
+
else if (this.player) {
|
|
3376
3384
|
this.player.source = {
|
|
3377
3385
|
type: 'video',
|
|
3378
3386
|
sources: [
|
|
@@ -3398,12 +3406,19 @@ class VideoPlayerService {
|
|
|
3398
3406
|
}
|
|
3399
3407
|
}
|
|
3400
3408
|
playVideo() {
|
|
3401
|
-
if (this.
|
|
3409
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3410
|
+
this.videoElement.play();
|
|
3411
|
+
}
|
|
3412
|
+
else if (this.player) {
|
|
3402
3413
|
this.player.play();
|
|
3403
3414
|
}
|
|
3404
3415
|
}
|
|
3405
3416
|
rewindVideo() {
|
|
3406
|
-
if (this.
|
|
3417
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3418
|
+
this.videoElement.currentTime = 0;
|
|
3419
|
+
this.videoElement.play();
|
|
3420
|
+
}
|
|
3421
|
+
else if (this.player) {
|
|
3407
3422
|
if (this.isRewinding) {
|
|
3408
3423
|
this.isRewinding = false;
|
|
3409
3424
|
clearInterval(this.rewindInterval);
|
|
@@ -3414,10 +3429,10 @@ class VideoPlayerService {
|
|
|
3414
3429
|
this.isRewinding = true;
|
|
3415
3430
|
this.player.pause();
|
|
3416
3431
|
this.rewindInterval = setInterval(() => {
|
|
3417
|
-
if (this.player.currentTime > 0) {
|
|
3432
|
+
if (this.player && this.player.currentTime > 0) {
|
|
3418
3433
|
this.player.rewind(0.1);
|
|
3419
3434
|
}
|
|
3420
|
-
else {
|
|
3435
|
+
else if (this.player) {
|
|
3421
3436
|
this.player.currentTime = 0;
|
|
3422
3437
|
this.isRewinding = false;
|
|
3423
3438
|
clearInterval(this.rewindInterval);
|
|
@@ -3429,22 +3444,28 @@ class VideoPlayerService {
|
|
|
3429
3444
|
}
|
|
3430
3445
|
}
|
|
3431
3446
|
changeVideoSource(videoUrl) {
|
|
3432
|
-
|
|
3433
|
-
this.setVideoSource(videoUrl);
|
|
3434
|
-
}
|
|
3447
|
+
this.setVideoSource(videoUrl);
|
|
3435
3448
|
}
|
|
3436
3449
|
addVideosToQueue(videoUrls) {
|
|
3437
3450
|
console.log('ADING VIDEOS TO QUEUE, ', videoUrls);
|
|
3438
3451
|
this.videoQueue.push(...videoUrls);
|
|
3439
3452
|
}
|
|
3440
3453
|
destroyPlayer() {
|
|
3441
|
-
if (this.
|
|
3454
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3455
|
+
this.videoElement.pause();
|
|
3456
|
+
this.videoElement = undefined;
|
|
3457
|
+
}
|
|
3458
|
+
else if (this.player) {
|
|
3442
3459
|
this.player.destroy();
|
|
3460
|
+
this.player = undefined;
|
|
3443
3461
|
}
|
|
3444
3462
|
}
|
|
3445
3463
|
playAndRewind() {
|
|
3446
|
-
if (this.
|
|
3447
|
-
this.
|
|
3464
|
+
if (this.useNativePlayer && this.videoElement && this.videoElement.paused) {
|
|
3465
|
+
this.playNextInQueueNative();
|
|
3466
|
+
}
|
|
3467
|
+
else if (this.player && !this.player.playing) {
|
|
3468
|
+
this.playNextInQueuePlayr();
|
|
3448
3469
|
}
|
|
3449
3470
|
}
|
|
3450
3471
|
cleanUp() {
|
|
@@ -3465,23 +3486,78 @@ class VideoPlayerService {
|
|
|
3465
3486
|
this.moodSubscription.unsubscribe();
|
|
3466
3487
|
}
|
|
3467
3488
|
}
|
|
3468
|
-
|
|
3489
|
+
playNextInQueueNative() {
|
|
3469
3490
|
if (this.videoQueue.length > 0) {
|
|
3470
3491
|
const videoUrl = this.videoQueue.shift();
|
|
3471
3492
|
if (videoUrl) {
|
|
3472
3493
|
this.changeVideoSource(videoUrl);
|
|
3473
|
-
this.
|
|
3474
|
-
|
|
3494
|
+
this.playVideo();
|
|
3495
|
+
const onEnded = () => {
|
|
3475
3496
|
this.rewindVideo();
|
|
3476
|
-
|
|
3497
|
+
if (this.videoElement) {
|
|
3498
|
+
this.videoElement.removeEventListener('ended', onEnded);
|
|
3499
|
+
}
|
|
3500
|
+
};
|
|
3501
|
+
if (this.videoElement) {
|
|
3502
|
+
this.videoElement.addEventListener('ended', onEnded);
|
|
3503
|
+
}
|
|
3477
3504
|
}
|
|
3478
3505
|
}
|
|
3479
3506
|
else if (this.defaultVideoUrl) {
|
|
3480
3507
|
this.changeVideoSource(this.defaultVideoUrl);
|
|
3481
|
-
this.
|
|
3482
|
-
|
|
3483
|
-
this.
|
|
3484
|
-
|
|
3508
|
+
this.playVideo();
|
|
3509
|
+
const onEnded = () => {
|
|
3510
|
+
this.playDefaultVideoForever();
|
|
3511
|
+
if (this.videoElement) {
|
|
3512
|
+
this.videoElement.removeEventListener('ended', onEnded);
|
|
3513
|
+
}
|
|
3514
|
+
};
|
|
3515
|
+
if (this.videoElement) {
|
|
3516
|
+
this.videoElement.addEventListener('ended', onEnded);
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
}
|
|
3520
|
+
playNextInQueuePlayr() {
|
|
3521
|
+
if (this.videoQueue.length > 0) {
|
|
3522
|
+
const videoUrl = this.videoQueue.shift();
|
|
3523
|
+
if (videoUrl) {
|
|
3524
|
+
this.changeVideoSource(videoUrl);
|
|
3525
|
+
this.playVideo();
|
|
3526
|
+
const onEnded = () => {
|
|
3527
|
+
this.rewindVideo();
|
|
3528
|
+
};
|
|
3529
|
+
if (this.player) {
|
|
3530
|
+
this.player.once('ended', onEnded);
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
}
|
|
3534
|
+
else if (this.defaultVideoUrl) {
|
|
3535
|
+
this.changeVideoSource(this.defaultVideoUrl);
|
|
3536
|
+
this.playVideo();
|
|
3537
|
+
const onEnded = () => {
|
|
3538
|
+
this.playDefaultVideoForever();
|
|
3539
|
+
};
|
|
3540
|
+
if (this.player) {
|
|
3541
|
+
this.player.once('ended', onEnded);
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
playDefaultVideoForever() {
|
|
3546
|
+
if (this.defaultVideoUrl) {
|
|
3547
|
+
this.changeVideoSource(this.defaultVideoUrl);
|
|
3548
|
+
this.playVideo();
|
|
3549
|
+
const onEnded = () => {
|
|
3550
|
+
this.playDefaultVideoForever(); // Recursive call to loop
|
|
3551
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3552
|
+
this.videoElement.removeEventListener('ended', onEnded);
|
|
3553
|
+
}
|
|
3554
|
+
};
|
|
3555
|
+
if (this.useNativePlayer && this.videoElement) {
|
|
3556
|
+
this.videoElement.addEventListener('ended', onEnded);
|
|
3557
|
+
}
|
|
3558
|
+
else if (this.player) {
|
|
3559
|
+
this.player.once('ended', onEnded);
|
|
3560
|
+
}
|
|
3485
3561
|
}
|
|
3486
3562
|
}
|
|
3487
3563
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
@@ -3494,6 +3570,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3494
3570
|
}]
|
|
3495
3571
|
}], ctorParameters: () => [] });
|
|
3496
3572
|
|
|
3573
|
+
class VideoPlayerNativeService {
|
|
3574
|
+
constructor() {
|
|
3575
|
+
this.conversationFlowStateService = inject(ConversationFlowStateService);
|
|
3576
|
+
this.videoQueue = [];
|
|
3577
|
+
this.defaultVideoUrl = null;
|
|
3578
|
+
this.agentCard = signal(undefined, ...(ngDevMode ? [{ debugName: "agentCard" }] : []));
|
|
3579
|
+
this.moodSubscription = this.conversationFlowStateService.moodUpdated$.subscribe((mood) => {
|
|
3580
|
+
const card = this.agentCard();
|
|
3581
|
+
if (mood && card?.assets?.motions) {
|
|
3582
|
+
const motionUrl = card.assets.motions.find((m) => m.metadata?.moodState === mood)?.url;
|
|
3583
|
+
if (motionUrl) {
|
|
3584
|
+
this.addVideosToQueue([motionUrl]);
|
|
3585
|
+
this.playAndRewind();
|
|
3586
|
+
}
|
|
3587
|
+
}
|
|
3588
|
+
});
|
|
3589
|
+
}
|
|
3590
|
+
setAgentCard(card) {
|
|
3591
|
+
this.agentCard.set(card);
|
|
3592
|
+
if (card.assets?.motion?.url) {
|
|
3593
|
+
this.setVideoSource(card.assets.motion.url);
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
initializePlayer(videoPlayer) {
|
|
3597
|
+
this.videoElement = videoPlayer.nativeElement;
|
|
3598
|
+
this.videoElement.addEventListener('ended', this.onVideoEnded.bind(this));
|
|
3599
|
+
}
|
|
3600
|
+
setVideoSource(videoUrl) {
|
|
3601
|
+
if (this.videoElement) {
|
|
3602
|
+
this.videoElement.src = videoUrl;
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
startConversation(defaultVideo) {
|
|
3606
|
+
if (defaultVideo) {
|
|
3607
|
+
this.defaultVideoUrl = defaultVideo;
|
|
3608
|
+
}
|
|
3609
|
+
else {
|
|
3610
|
+
this.defaultVideoUrl = this.agentCard()?.assets?.motion?.url || null;
|
|
3611
|
+
}
|
|
3612
|
+
const introMotion = this.agentCard()?.assets?.motions?.find((m) => m.metadata?.event === 'intro');
|
|
3613
|
+
if (introMotion?.url) {
|
|
3614
|
+
this.addVideosToQueue([introMotion.url]);
|
|
3615
|
+
this.playAndRewind();
|
|
3616
|
+
}
|
|
3617
|
+
}
|
|
3618
|
+
playVideo() {
|
|
3619
|
+
this.videoElement?.play();
|
|
3620
|
+
}
|
|
3621
|
+
addVideosToQueue(videoUrls) {
|
|
3622
|
+
this.videoQueue.push(...videoUrls);
|
|
3623
|
+
}
|
|
3624
|
+
destroyPlayer() {
|
|
3625
|
+
if (this.videoElement) {
|
|
3626
|
+
this.videoElement.removeEventListener('ended', this.onVideoEnded.bind(this));
|
|
3627
|
+
this.videoElement.pause();
|
|
3628
|
+
this.videoElement = undefined;
|
|
3629
|
+
}
|
|
3630
|
+
}
|
|
3631
|
+
playAndRewind() {
|
|
3632
|
+
if (this.videoElement && this.videoElement.paused) {
|
|
3633
|
+
this.playNextInQueue();
|
|
3634
|
+
}
|
|
3635
|
+
}
|
|
3636
|
+
cleanUp() {
|
|
3637
|
+
this.destroyPlayer();
|
|
3638
|
+
this.videoQueue = [];
|
|
3639
|
+
this.defaultVideoUrl = null;
|
|
3640
|
+
this.agentCard.set(undefined);
|
|
3641
|
+
}
|
|
3642
|
+
ngOnDestroy() {
|
|
3643
|
+
this.moodSubscription?.unsubscribe();
|
|
3644
|
+
this.destroyPlayer();
|
|
3645
|
+
}
|
|
3646
|
+
onVideoEnded() {
|
|
3647
|
+
this.playNextInQueue();
|
|
3648
|
+
}
|
|
3649
|
+
playNextInQueue() {
|
|
3650
|
+
console.log('Playing next in queue');
|
|
3651
|
+
if (this.videoQueue.length > 0) {
|
|
3652
|
+
const videoUrl = this.videoQueue.shift();
|
|
3653
|
+
if (videoUrl && this.videoElement) {
|
|
3654
|
+
this.videoElement.src = videoUrl;
|
|
3655
|
+
this.videoElement.play();
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
else if (this.defaultVideoUrl && this.videoElement) {
|
|
3659
|
+
console.log('Playing default video');
|
|
3660
|
+
this.videoElement.src = this.defaultVideoUrl;
|
|
3661
|
+
// this.videoElement.loop = true;
|
|
3662
|
+
this.videoElement.play();
|
|
3663
|
+
}
|
|
3664
|
+
else {
|
|
3665
|
+
console.log('No default video');
|
|
3666
|
+
}
|
|
3667
|
+
}
|
|
3668
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3669
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, providedIn: 'root' }); }
|
|
3670
|
+
}
|
|
3671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, decorators: [{
|
|
3672
|
+
type: Injectable,
|
|
3673
|
+
args: [{
|
|
3674
|
+
providedIn: 'root',
|
|
3675
|
+
}]
|
|
3676
|
+
}], ctorParameters: () => [] });
|
|
3677
|
+
|
|
3497
3678
|
const Endpoints = 'conversationRule';
|
|
3498
3679
|
class ConversationRuleService extends EntityCommunicationService {
|
|
3499
3680
|
constructor() {
|
|
@@ -3786,7 +3967,6 @@ class MessageContentDisplayer {
|
|
|
3786
3967
|
}, ...(ngDevMode ? [{ debugName: "hasTranscription" }] : []));
|
|
3787
3968
|
effect(() => {
|
|
3788
3969
|
const currentMsg = this.message();
|
|
3789
|
-
console.log('currentMsg', currentMsg);
|
|
3790
3970
|
if (currentMsg) {
|
|
3791
3971
|
this.initializeBasedOnMessage(currentMsg);
|
|
3792
3972
|
}
|
|
@@ -7221,8 +7401,9 @@ class DcAgentCardDetailsComponent {
|
|
|
7221
7401
|
this.chatMonitorService = inject(ChatMonitorService);
|
|
7222
7402
|
this.conversationFlowStateService = inject(ConversationFlowStateService);
|
|
7223
7403
|
this.userService = inject(UserService);
|
|
7224
|
-
this.videoPlayerService = inject(
|
|
7404
|
+
this.videoPlayerService = inject(VideoPlayerNativeService);
|
|
7225
7405
|
this.agentCardId = '';
|
|
7406
|
+
this.useNativePlayer = true;
|
|
7226
7407
|
this.onStartConversation = output();
|
|
7227
7408
|
this.agentCard = signal(undefined, ...(ngDevMode ? [{ debugName: "agentCard" }] : []));
|
|
7228
7409
|
this.showInfoLayer = signal(false, ...(ngDevMode ? [{ debugName: "showInfoLayer" }] : []));
|
|
@@ -7266,25 +7447,30 @@ class DcAgentCardDetailsComponent {
|
|
|
7266
7447
|
}
|
|
7267
7448
|
}
|
|
7268
7449
|
transformToLanguage(agentCard, targetLang) {
|
|
7269
|
-
const
|
|
7270
|
-
const
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7450
|
+
const cardTranslated = JSON.parse(JSON.stringify(agentCard));
|
|
7451
|
+
const translation = cardTranslated.characterCard?.data?.langTranslation?.[targetLang];
|
|
7452
|
+
if (cardTranslated.characterCard?.data) {
|
|
7453
|
+
cardTranslated.characterCard.data.greetings = translation?.greetings;
|
|
7454
|
+
if (cardTranslated.characterCard.data.persona && translation?.communication) {
|
|
7455
|
+
cardTranslated.characterCard.data.persona.communication = translation.communication;
|
|
7456
|
+
}
|
|
7275
7457
|
}
|
|
7276
7458
|
cardTranslated.lang = targetLang;
|
|
7277
7459
|
console.log('cambiando idioma', agentCard.lang);
|
|
7278
|
-
const locale = LANGUAGES[targetLang]
|
|
7460
|
+
const locale = LANGUAGES[targetLang]?.defaultLocale;
|
|
7279
7461
|
if (!locale)
|
|
7280
7462
|
return cardTranslated;
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7463
|
+
if (cardTranslated.conversationSettings?.mainVoice) {
|
|
7464
|
+
const transformedMainVoice = this._transformVoice(cardTranslated.conversationSettings.mainVoice.voice, locale);
|
|
7465
|
+
if (transformedMainVoice) {
|
|
7466
|
+
cardTranslated.conversationSettings.mainVoice.voice = transformedMainVoice;
|
|
7467
|
+
}
|
|
7284
7468
|
}
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7469
|
+
if (cardTranslated.conversationSettings?.secondaryVoice) {
|
|
7470
|
+
const transformedSecondaryVoice = this._transformVoice(cardTranslated.conversationSettings.secondaryVoice.voice, locale);
|
|
7471
|
+
if (transformedSecondaryVoice) {
|
|
7472
|
+
cardTranslated.conversationSettings.secondaryVoice.voice = transformedSecondaryVoice;
|
|
7473
|
+
}
|
|
7288
7474
|
}
|
|
7289
7475
|
return cardTranslated;
|
|
7290
7476
|
}
|
|
@@ -7298,29 +7484,34 @@ class DcAgentCardDetailsComponent {
|
|
|
7298
7484
|
startConversation() {
|
|
7299
7485
|
this.videoPlayerService.startConversation();
|
|
7300
7486
|
const targetLang = this.userService.getTargetLanguage();
|
|
7301
|
-
const
|
|
7302
|
-
if (
|
|
7303
|
-
|
|
7487
|
+
const agentCard = this.agentCard();
|
|
7488
|
+
if (!agentCard)
|
|
7489
|
+
return;
|
|
7490
|
+
const translation = agentCard.characterCard?.data?.langTranslation?.[targetLang];
|
|
7491
|
+
if (agentCard.lang === targetLang) {
|
|
7492
|
+
this.onStartConversation.emit(agentCard);
|
|
7304
7493
|
}
|
|
7305
7494
|
else if (translation) {
|
|
7306
|
-
const transformedCard = this.transformToLanguage(
|
|
7495
|
+
const transformedCard = this.transformToLanguage(agentCard, targetLang);
|
|
7307
7496
|
this.onStartConversation.emit(transformedCard);
|
|
7308
7497
|
}
|
|
7309
7498
|
else {
|
|
7310
|
-
this.onStartConversation.emit(
|
|
7499
|
+
this.onStartConversation.emit(agentCard);
|
|
7311
7500
|
}
|
|
7312
7501
|
}
|
|
7313
7502
|
toggleInfoLayer() {
|
|
7314
7503
|
this.showInfoLayer.update((value) => !value);
|
|
7315
7504
|
}
|
|
7316
7505
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcAgentCardDetailsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7317
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: DcAgentCardDetailsComponent, isStandalone: true, selector: "dc-agent-card-details", inputs: { agentCardId: "agentCardId" }, outputs: { onStartConversation: "onStartConversation" }, viewQueries: [{ propertyName: "videoPlayer", first: true, predicate: ["videoPlayer"], descendants: true }], ngImport: i0, template: "<div style=\"display: flex; justify-content: center; align-items: center\">\n <p-card>\n <div class=\"card-container\">\n <img class=\"card-image\" [src]=\"agentCard()?.assets?.image?.url\" alt=\"\" />\n <!-- This video is affected by Plyr i set by default background transparent -->\n <video #videoPlayer class=\"card-image\"></video>\n\n <div class=\"info-button\" (click)=\"toggleInfoLayer()\">\n <p-button icon=\"pi pi-arrow-down-left\" [rounded]=\"true\" [raised]=\"true\" severity=\"primary\" [outlined]=\"true\" />\n </div>\n\n @if(!chatMonitorService.isConversationActive()) {\n <div style=\"position: absolute; bottom: 20px; right: 50%; transform: translateX(50%); z-index: 3\">\n <p-button\n size=\"large\"\n [label]=\"'dataclouder.agentCards.dcAgentCardDetails.startConversation' | translate\"\n [rounded]=\"true\"\n (click)=\"startConversation()\" />\n </div>\n }\n\n <div class=\"info-layer\" [class.active]=\"showInfoLayer()\">\n <div class=\"info-content\">\n <h1\n ><strong>{{ agentCard()?.name }}</strong></h1\n >\n <p>{{ agentCard()?.characterCard?.data?.name }}</p>\n\n @if (agentCard()?.characterCard?.data?.scenario) {\n <div class=\"scenario\">\n <h4>{{ 'dataclouder.agentCards.dcAgentCardDetails.scenario' | translate }}</h4>\n <p>{{ agentCard()?.characterCard?.data?.scenario | parseCard : agentCard() }}</p>\n </div>\n }\n </div>\n </div>\n </div>\n </p-card>\n</div>\n", styles: ["::ng-deep .p-card{width:420px;height:700px}::ng-deep .p-card .p-card-body{width:100%;height:100%}.card-image{height:100%;width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}::ng-deep .plyr--full-ui{width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}.info-button{position:absolute;top:15px;right:15px;z-index:3}.info-button:hover{transform:scale(1.1)}.info-layer{height:100%;width:100%;position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;z-index:2;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:#ed122833;color:#fff;opacity:1;clip-path:circle(0% at top right);transition:clip-path .5s cubic-bezier(.25,1,.5,1);pointer-events:none}.info-layer.active{clip-path:circle(150% at top right);pointer-events:auto}.info-content{padding:15px;text-align:center;max-width:90%}.info-content h1{margin-top:0;font-size:18px;margin-bottom:10px}.info-content p{font-size:12px;margin:0}::ng-deep .info-button .p-button{background-color:#ffffff47}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CardModule }, { kind: "component", type: i2$8.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: ParseCardPipe, name: "parseCard" }, { kind: "pipe", type: i3$6.TranslatePipe, name: "translate" }] }); }
|
|
7506
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: DcAgentCardDetailsComponent, isStandalone: true, selector: "dc-agent-card-details", inputs: { agentCardId: "agentCardId", useNativePlayer: "useNativePlayer" }, outputs: { onStartConversation: "onStartConversation" }, viewQueries: [{ propertyName: "videoPlayer", first: true, predicate: ["videoPlayer"], descendants: true }], ngImport: i0, template: "<div style=\"display: flex; justify-content: center; align-items: center\">\n <p-card>\n <div class=\"card-container\">\n <img class=\"card-image\" [src]=\"agentCard()?.assets?.image?.url\" alt=\"\" />\n <!-- This video is affected by Plyr i set by default background transparent -->\n <video #videoPlayer class=\"card-image\"></video>\n\n <div class=\"info-button\" (click)=\"toggleInfoLayer()\">\n <p-button icon=\"pi pi-arrow-down-left\" [rounded]=\"true\" [raised]=\"true\" severity=\"primary\" [outlined]=\"true\" />\n </div>\n\n @if(!chatMonitorService.isConversationActive()) {\n <div style=\"position: absolute; bottom: 20px; right: 50%; transform: translateX(50%); z-index: 3\">\n <p-button\n size=\"large\"\n [label]=\"'dataclouder.agentCards.dcAgentCardDetails.startConversation' | translate\"\n [rounded]=\"true\"\n (click)=\"startConversation()\" />\n </div>\n }\n\n <div class=\"info-layer\" [class.active]=\"showInfoLayer()\">\n <div class=\"info-content\">\n <h1\n ><strong>{{ agentCard()?.name }}</strong></h1\n >\n <p>{{ agentCard()?.characterCard?.data?.name }}</p>\n\n @if (agentCard()?.characterCard?.data?.scenario) {\n <div class=\"scenario\">\n <h4>{{ 'dataclouder.agentCards.dcAgentCardDetails.scenario' | translate }}</h4>\n <p>{{ agentCard()?.characterCard?.data?.scenario | parseCard : agentCard() }}</p>\n </div>\n }\n </div>\n </div>\n </div>\n </p-card>\n</div>\n", styles: ["::ng-deep .p-card{width:420px;height:700px}::ng-deep .p-card .p-card-body{width:100%;height:100%}.card-image{height:100%;width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}::ng-deep .plyr--full-ui{width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}.info-button{position:absolute;top:15px;right:15px;z-index:3}.info-button:hover{transform:scale(1.1)}.info-layer{height:100%;width:100%;position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;z-index:2;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:#ed122833;color:#fff;opacity:1;clip-path:circle(0% at top right);transition:clip-path .5s cubic-bezier(.25,1,.5,1);pointer-events:none}.info-layer.active{clip-path:circle(150% at top right);pointer-events:auto}.info-content{padding:15px;text-align:center;max-width:90%}.info-content h1{margin-top:0;font-size:18px;margin-bottom:10px}.info-content p{font-size:12px;margin:0}::ng-deep .info-button .p-button{background-color:#ffffff47}\n"], dependencies: [{ kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i2.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CardModule }, { kind: "component", type: i2$8.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: ParseCardPipe, name: "parseCard" }, { kind: "pipe", type: i3$6.TranslatePipe, name: "translate" }] }); }
|
|
7318
7507
|
}
|
|
7319
7508
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcAgentCardDetailsComponent, decorators: [{
|
|
7320
7509
|
type: Component,
|
|
7321
7510
|
args: [{ selector: 'dc-agent-card-details', standalone: true, imports: [ButtonModule, CardModule, ParseCardPipe, TranslateModule], template: "<div style=\"display: flex; justify-content: center; align-items: center\">\n <p-card>\n <div class=\"card-container\">\n <img class=\"card-image\" [src]=\"agentCard()?.assets?.image?.url\" alt=\"\" />\n <!-- This video is affected by Plyr i set by default background transparent -->\n <video #videoPlayer class=\"card-image\"></video>\n\n <div class=\"info-button\" (click)=\"toggleInfoLayer()\">\n <p-button icon=\"pi pi-arrow-down-left\" [rounded]=\"true\" [raised]=\"true\" severity=\"primary\" [outlined]=\"true\" />\n </div>\n\n @if(!chatMonitorService.isConversationActive()) {\n <div style=\"position: absolute; bottom: 20px; right: 50%; transform: translateX(50%); z-index: 3\">\n <p-button\n size=\"large\"\n [label]=\"'dataclouder.agentCards.dcAgentCardDetails.startConversation' | translate\"\n [rounded]=\"true\"\n (click)=\"startConversation()\" />\n </div>\n }\n\n <div class=\"info-layer\" [class.active]=\"showInfoLayer()\">\n <div class=\"info-content\">\n <h1\n ><strong>{{ agentCard()?.name }}</strong></h1\n >\n <p>{{ agentCard()?.characterCard?.data?.name }}</p>\n\n @if (agentCard()?.characterCard?.data?.scenario) {\n <div class=\"scenario\">\n <h4>{{ 'dataclouder.agentCards.dcAgentCardDetails.scenario' | translate }}</h4>\n <p>{{ agentCard()?.characterCard?.data?.scenario | parseCard : agentCard() }}</p>\n </div>\n }\n </div>\n </div>\n </div>\n </p-card>\n</div>\n", styles: ["::ng-deep .p-card{width:420px;height:700px}::ng-deep .p-card .p-card-body{width:100%;height:100%}.card-image{height:100%;width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}::ng-deep .plyr--full-ui{width:100%;object-fit:cover;object-position:center;position:absolute;top:0;left:0;transition:filter .3s ease}.info-button{position:absolute;top:15px;right:15px;z-index:3}.info-button:hover{transform:scale(1.1)}.info-layer{height:100%;width:100%;position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;z-index:2;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background-color:#ed122833;color:#fff;opacity:1;clip-path:circle(0% at top right);transition:clip-path .5s cubic-bezier(.25,1,.5,1);pointer-events:none}.info-layer.active{clip-path:circle(150% at top right);pointer-events:auto}.info-content{padding:15px;text-align:center;max-width:90%}.info-content h1{margin-top:0;font-size:18px;margin-bottom:10px}.info-content p{font-size:12px;margin:0}::ng-deep .info-button .p-button{background-color:#ffffff47}\n"] }]
|
|
7322
7511
|
}], ctorParameters: () => [], propDecorators: { agentCardId: [{
|
|
7323
7512
|
type: Input
|
|
7513
|
+
}], useNativePlayer: [{
|
|
7514
|
+
type: Input
|
|
7324
7515
|
}], videoPlayer: [{
|
|
7325
7516
|
type: ViewChild,
|
|
7326
7517
|
args: ['videoPlayer']
|
|
@@ -7686,5 +7877,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
7686
7877
|
* Generated bundle index. Do not edit.
|
|
7687
7878
|
*/
|
|
7688
7879
|
|
|
7689
|
-
export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEngineTestComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationFlowStateService, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
|
|
7880
|
+
export { ACCDataGenerationComponent, AGENT_CARDS_STATE_SERVICE, AIGenerationService, AgentCardListComponent, AgentCardUI, AgentCardsGenerationService, AudioService, AudioSpeed, BACKGROUND_SERVICE_TOKEN, CONVERSATION_AI_TOKEN, CardsCreatorComponent, ChatEngineTestComponent, ChatEventType, ChatMessage, ChatMessageOrchestratorComponent, ChatMonitorService, ChatRole, ConditionOperator, ConditionType, ContextEngineService, ContextType, ConversationDTO, ConversationEvents, ConversationFlowStateService, ConversationMessagesDTO, ConversationPromptBuilderService, ConversationRuleService, ConversationRulesComponent, ConversationType, ConversationTypeOptions, DCAgentCardFormComponent, DCChatComponent, DCConversationUserChatSettingsComponent, DcAgentCardDetailsComponent, DefaultAgentCardsService, DoActionTypeOptions, DynamicFlowService, DynamicFlowTaskTypeOptions, EAccountsPlatform, EAgentType, EDoActionType, EDynamicFlowTaskType, EntityThen, EntityWhatOptions, EntityWhenOptions, EvalResultStringDefinition, GlobalToolsService, MessageContent, MessageContentDisplayer, MessagesStateService, ModelSelectorComponent, PopupService, PromptPreviewComponent, SectionType, SystemPromptType, TextEngineOptions, TextEngines, VIDEO_PLAYER_SERVICE_TOKEN, VideoPlayerNativeService, VideoPlayerService, VoiceTTSOption, VoiceTTSOptions, WordTimestamps, buildObjectTTSRequest, characterCardStringDataDefinition, convertToHTML, createAIModelFormGroup, defaultconvUserSettings, extractAudioAndTranscription, extractJsonFromResponse, getMoodStateLabelsAsString, getMoodStatePrompt, markdownToHtml, matchTranscription, provideAgentCardService, removeEmojis, removeEmojisAndSpecialCharacters, removeSpecialCharacters };
|
|
7690
7881
|
//# sourceMappingURL=dataclouder-ngx-agent-cards.mjs.map
|