@dataclouder/ngx-agent-cards 0.1.83 → 0.1.85

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
- if (this.player) {
3364
- this.player.destroy();
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.player) {
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.player) {
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.player) {
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
- if (this.player) {
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.player) {
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.player && !this.player.playing) {
3447
- this.playNextInQueue();
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
- playNextInQueue() {
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.player.play();
3474
- this.player.once('ended', () => {
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.player.play();
3482
- this.player.once('ended', () => {
3483
- this.rewindVideo();
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,106 @@ 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
+ if (this.videoQueue.length > 0) {
3651
+ const videoUrl = this.videoQueue.shift();
3652
+ if (videoUrl && this.videoElement) {
3653
+ this.videoElement.src = videoUrl;
3654
+ this.videoElement.play();
3655
+ }
3656
+ }
3657
+ else if (this.defaultVideoUrl && this.videoElement) {
3658
+ this.videoElement.src = this.defaultVideoUrl;
3659
+ // this.videoElement.loop = true;
3660
+ this.videoElement.play();
3661
+ }
3662
+ }
3663
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3664
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, providedIn: 'root' }); }
3665
+ }
3666
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: VideoPlayerNativeService, decorators: [{
3667
+ type: Injectable,
3668
+ args: [{
3669
+ providedIn: 'root',
3670
+ }]
3671
+ }], ctorParameters: () => [] });
3672
+
3497
3673
  const Endpoints = 'conversationRule';
3498
3674
  class ConversationRuleService extends EntityCommunicationService {
3499
3675
  constructor() {
@@ -7221,8 +7397,9 @@ class DcAgentCardDetailsComponent {
7221
7397
  this.chatMonitorService = inject(ChatMonitorService);
7222
7398
  this.conversationFlowStateService = inject(ConversationFlowStateService);
7223
7399
  this.userService = inject(UserService);
7224
- this.videoPlayerService = inject(VideoPlayerService);
7400
+ this.videoPlayerService = inject(VideoPlayerNativeService);
7225
7401
  this.agentCardId = '';
7402
+ this.useNativePlayer = true;
7226
7403
  this.onStartConversation = output();
7227
7404
  this.agentCard = signal(undefined, ...(ngDevMode ? [{ debugName: "agentCard" }] : []));
7228
7405
  this.showInfoLayer = signal(false, ...(ngDevMode ? [{ debugName: "showInfoLayer" }] : []));
@@ -7239,6 +7416,7 @@ class DcAgentCardDetailsComponent {
7239
7416
  }
7240
7417
  ngAfterViewInit() {
7241
7418
  if (this.videoPlayer) {
7419
+ // this.videoPlayerService.initializePlayer(this.videoPlayer, this.useNativePlayer);
7242
7420
  this.videoPlayerService.initializePlayer(this.videoPlayer);
7243
7421
  }
7244
7422
  }
@@ -7266,25 +7444,30 @@ class DcAgentCardDetailsComponent {
7266
7444
  }
7267
7445
  }
7268
7446
  transformToLanguage(agentCard, targetLang) {
7269
- const translation = agentCard.characterCard?.data?.langTranslation?.[targetLang];
7270
- const cardTranslated = { ...agentCard };
7271
- // Set Greetings Communication and Language.
7272
- cardTranslated.characterCard.data.greetings = translation?.greetings;
7273
- if (cardTranslated.characterCard.data?.persona?.communication) {
7274
- cardTranslated.characterCard.data.persona.communication = translation?.communication;
7447
+ const cardTranslated = JSON.parse(JSON.stringify(agentCard));
7448
+ const translation = cardTranslated.characterCard?.data?.langTranslation?.[targetLang];
7449
+ if (cardTranslated.characterCard?.data) {
7450
+ cardTranslated.characterCard.data.greetings = translation?.greetings;
7451
+ if (cardTranslated.characterCard.data.persona && translation?.communication) {
7452
+ cardTranslated.characterCard.data.persona.communication = translation.communication;
7453
+ }
7275
7454
  }
7276
7455
  cardTranslated.lang = targetLang;
7277
7456
  console.log('cambiando idioma', agentCard.lang);
7278
- const locale = LANGUAGES[targetLang].defaultLocale;
7457
+ const locale = LANGUAGES[targetLang]?.defaultLocale;
7279
7458
  if (!locale)
7280
7459
  return cardTranslated;
7281
- const transformedMainVoice = this._transformVoice(agentCard.conversationSettings.mainVoice?.voice, locale);
7282
- if (transformedMainVoice) {
7283
- agentCard.conversationSettings.mainVoice.voice = transformedMainVoice;
7460
+ if (cardTranslated.conversationSettings?.mainVoice) {
7461
+ const transformedMainVoice = this._transformVoice(cardTranslated.conversationSettings.mainVoice.voice, locale);
7462
+ if (transformedMainVoice) {
7463
+ cardTranslated.conversationSettings.mainVoice.voice = transformedMainVoice;
7464
+ }
7284
7465
  }
7285
- const transformedSecondaryVoice = this._transformVoice(agentCard.conversationSettings.secondaryVoice?.voice, locale);
7286
- if (transformedSecondaryVoice) {
7287
- agentCard.conversationSettings.secondaryVoice.voice = transformedSecondaryVoice;
7466
+ if (cardTranslated.conversationSettings?.secondaryVoice) {
7467
+ const transformedSecondaryVoice = this._transformVoice(cardTranslated.conversationSettings.secondaryVoice.voice, locale);
7468
+ if (transformedSecondaryVoice) {
7469
+ cardTranslated.conversationSettings.secondaryVoice.voice = transformedSecondaryVoice;
7470
+ }
7288
7471
  }
7289
7472
  return cardTranslated;
7290
7473
  }
@@ -7298,29 +7481,34 @@ class DcAgentCardDetailsComponent {
7298
7481
  startConversation() {
7299
7482
  this.videoPlayerService.startConversation();
7300
7483
  const targetLang = this.userService.getTargetLanguage();
7301
- const translation = this.agentCard()?.characterCard?.data?.langTranslation?.[targetLang];
7302
- if (this.agentCard()?.lang === targetLang) {
7303
- this.onStartConversation.emit(this.agentCard());
7484
+ const agentCard = this.agentCard();
7485
+ if (!agentCard)
7486
+ return;
7487
+ const translation = agentCard.characterCard?.data?.langTranslation?.[targetLang];
7488
+ if (agentCard.lang === targetLang) {
7489
+ this.onStartConversation.emit(agentCard);
7304
7490
  }
7305
7491
  else if (translation) {
7306
- const transformedCard = this.transformToLanguage(this.agentCard(), targetLang);
7492
+ const transformedCard = this.transformToLanguage(agentCard, targetLang);
7307
7493
  this.onStartConversation.emit(transformedCard);
7308
7494
  }
7309
7495
  else {
7310
- this.onStartConversation.emit(this.agentCard());
7496
+ this.onStartConversation.emit(agentCard);
7311
7497
  }
7312
7498
  }
7313
7499
  toggleInfoLayer() {
7314
7500
  this.showInfoLayer.update((value) => !value);
7315
7501
  }
7316
7502
  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" }] }); }
7503
+ 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
7504
  }
7319
7505
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: DcAgentCardDetailsComponent, decorators: [{
7320
7506
  type: Component,
7321
7507
  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
7508
  }], ctorParameters: () => [], propDecorators: { agentCardId: [{
7323
7509
  type: Input
7510
+ }], useNativePlayer: [{
7511
+ type: Input
7324
7512
  }], videoPlayer: [{
7325
7513
  type: ViewChild,
7326
7514
  args: ['videoPlayer']
@@ -7686,5 +7874,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
7686
7874
  * Generated bundle index. Do not edit.
7687
7875
  */
7688
7876
 
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 };
7877
+ 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
7878
  //# sourceMappingURL=dataclouder-ngx-agent-cards.mjs.map