import{C}from'./chunk-311LbAVZ.js';import{d7 as ak,g,aO as Vr,b2 as mt,aM as R1,dy as K,eZ as E,b as Pa,bW as v,s as sp,m as _2,u as ub,z as zB,A as w2,a6 as KV,o as bV,ak as wx}from'./main-ajlqprgK.js';import{j}from'./chunk-L5A5rljK.js';import'./chunk-DiHKqxPg.js';import'./chunk-BAzl70Bd.js';function V(t,_){if(t&1&&(sp(0,"my-alert",1),KV(1),ub()),t&2){let e=bV();zB(),wx(e.error);}}var D=(()=>{class t{route=g(Vr);router=g(mt);search=g(j);error="";ngOnInit(){let e=this.route.snapshot.queryParams.uri;if(!e){this.error="\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 URL \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 \u0443 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u0445 URL";return;}this.loadUrl(e);}loadUrl(e){R1([this.search.searchVideos({search:e}),this.search.searchVideoChannels({search:e})]).subscribe(([o,r])=>{let a;if(o.data.length!==0){let l=o.data[0];a=K.buildWatchUrl(l);}else if(r.data.length!==0)a="/c/"+new E(r.data[0]).nameWithHost;else{this.error="\u041D\u0435 \u0432\u0434\u0430\u0454\u0442\u044C\u0441\u044F \u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438 \u0434\u043E\u0441\u0442\u0443\u043F \u0434\u043E \u0432\u0456\u0434\u0434\u0430\u043B\u0435\u043D\u043E\u0433\u043E \u0440\u0435\u0441\u0443\u0440\u0441\u0443";return;}this.router.navigateByUrl(a);});}static ɵfac=function(o){return new(o||t)();};static ɵcmp=Pa({type:t,selectors:[["my-remote-interaction"]],decls:2,vars:1,consts:[[1,"root"],["type","danger"]],template:function(o,r){o&1&&(sp(0,"div",0),_2(1,V,2,1,"my-alert",1),ub()),o&2&&(zB(),w2(r.error?1:-1));},dependencies:[v],encapsulation:2,changeDetection:1});}return t;})();var G=[{path:"",component:D,providers:[C,j],canActivate:[ak],data:{meta:{title:"\u0412\u0456\u0434\u0434\u0430\u043B\u0435\u043D\u0430 \u0432\u0437\u0430\u0454\u043C\u043E\u0434\u0456\u044F"}}}];/**i18n:fad79908930cbb4c308e7550a5fe49bb3841dbb330066a6429aebaa006173605*/export{G as default};//# sourceMappingURL=chunk-BgtR-7mA.js.map