(function(s,u,o){"use strict";functionp(n,t){if(!(ninstanceoft))thrownewTypeError("Cannot call a class as a function")}functionh(n,t){for(vare=0;e<t.length;e++){varr=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}functionw(n,t,e){returnt&&h(n.prototype,t),e&&h(n,e),n}functionm(n,t,e){returntinn?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}consty=o.findByProps("show","confirm","close"),v=o.findByProps("addRelationship"),b=o.findByProps("handleStartCall"),$=o.findByProps("hideActionSheet"),g=o.findByStoreName("UserStore");varC=new(function(){functionn(){p(this,n),m(this,"patches",[])}returnw(n,[{key:"onLoad",value:function(){vart=this;this.patches.push(u.patcher.instead("handleStartCall",b,function(e,r){const[{rawRecipients:[{username:i,discriminator:c},a]},f]=e,l=f?"video call":"call";y.show({title:a?`Start a group ${l}?`:`Start a ${l} with ${i}#${c}?`,body:a?"Are you sure you want to start the group call?":`Are you sure you want to ${l}${i}#${c}?`,confirmText:"Yes",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){try{r(...e)}catch(d){u.logger.error("Failed to start call",d)}}})})),this.patches.push(u.patcher.instead("addRelationship",v,function(e,r){if(typeofe[0]!="object"||!e[0].userId)returnr.apply(t,e);const{username:i,discriminator:c}=g.getUser(e[0].userId),a=setInterval(function(){return$.hideActionSheet()},100);setTimeout(function(){returnclearInterval(a)},3e3);constf=e[0].type===2;returnnewPromise(function(l){y.show({title:`${f?"Block":"Friend"}${i}#${c}?`,body:`Are you sure you want to ${f?"block":"friend"}${i}#${c}?`,confirmText:"Yes",cancelText:"Cancel",confirmColor:"brand",onConfirm:function(){try{l(r.apply(t,e))}catch(d){u.logger.error("Failed to add relationship",d)}finally{clearInterval(a)}},onCancel:function(){returnvoidclearInterval(a)}})})}))}},{key:"onUnload",value:function(){for(consttofthis.patches)t()}}]),n}());returns.default=C,Object.defineProperty(s,"__esModule",{value:!0}),s})({},vendetta,vendetta.metro);