import{Fn as MV,Gn as NV,Io as kg,Ja as g,Pa as eo,X as D$,Zi as aA,ht as Et,k as Bb,n as $B,nn as J$,qi as _F,s as $a,yc as wp}from"./chunk-b0nJCs5_.js";import{r as g$1,t as K}from"./chunk-BXrVgciI.js";import"./chunk-CswnO8Ym.js";import{t as c}from"./chunk-DNBjyHdz2.js";import"./chunk-uNqEPBRE2.js";import"./chunk-BMaHP5rD2.js";import"./chunk-D3sqbh442.js";import{t as A}from"./chunk-2WQXD8yV2.js";import{t as p}from"./chunk-WJVwu_bH2.js";function D(o,t){if(o&1&&(wp(0,`my-alert`,1),J$(1),Bb()),o&2){let e=D$();$B(),aA(e.error)}}var j=[{path:``,component:class o{route=g(eo);router=g(Et);search=g(A);error=``;ngOnInit(){let t=this.route.snapshot.queryParams.uri;if(!t){this.error="Le paramètre URL est manquant dans les paramètres URL";return}this.loadUrl(t)}loadUrl(t){_F([this.search.searchVideos({search:t}),this.search.searchVideoChannels({search:t})]).subscribe(([e,n])=>{let m;if(e.data.length!==0){let l=e.data[0];m=K.buildWatchUrl(l)}else if(n.data.length!==0)m=`/c/`+new g$1(n.data[0]).nameWithHost;else{this.error="Impossible d'accéder à la ressource à distance";return}this.router.navigateByUrl(m)})}static ɵfac=function(e){return new(e||o)};static ɵcmp=$a({type:o,selectors:[[`my-remote-interaction`]],decls:2,vars:1,consts:[[1,`root`],[`type`,`danger`]],template:function(e,n){e&1&&(wp(0,`div`,0),NV(1,D,2,1,`my-alert`,1),Bb()),e&2&&($B(),MV(n.error?1:-1))},dependencies:[c],encapsulation:2,changeDetection:1})},providers:[p,A],canActivate:[kg],data:{meta:{title:"Interaction à distance"}}}];export{j as default};
//# debugId=6a07b7cd-7d1a-5ffd-b16b-7da2c46587a9
//# sourceMappingURL=chunk-DRDfdbdV2.js.map