function v(e){window.enmity.plugins.registerPlugin(e)}const h=window.enmity.modules.common.Constants;window.enmity.modules.common.Clipboard,window.enmity.modules.common.Assets,window.enmity.modules.common.Messages,window.enmity.modules.common.Clyde,window.enmity.modules.common.Avatars,window.enmity.modules.common.Native;const r=window.enmity.modules.common.React;window.enmity.modules.common.Dispatcher,window.enmity.modules.common.Storage,window.enmity.modules.common.Toasts,window.enmity.modules.common.Dialog,window.enmity.modules.common.Token;const R=window.enmity.modules.common.REST;window.enmity.modules.common.Settings,window.enmity.modules.common.Users,window.enmity.modules.common.Navigation,window.enmity.modules.common.NavigationNative,window.enmity.modules.common.NavigationStack,window.enmity.modules.common.Theme;const M=window.enmity.modules.common.Linking,E=window.enmity.modules.common.StyleSheet;window.enmity.modules.common.ColorMap,window.enmity.modules.common.Components,window.enmity.modules.common.Locale,window.enmity.modules.common.Profiles,window.enmity.modules.common.Lodash,window.enmity.modules.common.Logger,window.enmity.modules.common.Flux,window.enmity.modules.common.SVG,window.enmity.modules.common.Scenes,window.enmity.modules.common.Moment;function W(e){return window.enmity.patcher.create(e)}function m(e,n,l,s){window.enmity.clyde.sendReply(e,n,l,s)}var k;(function(e){e[e.BuiltIn=0]="BuiltIn",e[e.Guild=1]="Guild",e[e.DM=2]="DM"})(k||(k={}));var c;(function(e){e[e.Chat=1]="Chat",e[e.User=2]="User",e[e.Message=3]="Message"})(c||(c={}));var w;(function(e){e[e.BuiltIn=0]="BuiltIn",e[e.BuiltInText=1]="BuiltInText",e[e.BuiltInIntegration=2]="BuiltInIntegration",e[e.Bot=3]="Bot",e[e.Placeholder=4]="Placeholder"})(w||(w={}));var f;(function(e){e[e.Role=1]="Role",e[e.User=2]="User"})(f||(f={}));var g;(function(e){e[e.SubCommand=1]="SubCommand",e[e.SubCommandGroup=2]="SubCommandGroup",e[e.String=3]="String",e[e.Integer=4]="Integer",e[e.Boolean=5]="Boolean",e[e.User=6]="User",e[e.Channel=7]="Channel",e[e.Role=8]="Role",e[e.Mentionnable=9]="Mentionnable",e[e.Number=10]="Number",e[e.Attachment=11]="Attachment"})(g||(g={}));var y;(function(e){e[e.ApplicationCommand=2]="ApplicationCommand",e[e.MessageComponent=3]="MessageComponent"})(y||(y={}));const D={id:"deletewebhook",name:"deletewebhook",displayName:"deletewebhook",description:"Delete a webhook.",displayDescription:"Delete a webhook.",type:c.Chat,inputType:w.BuiltInText,options:[{name:"url",displayName:"url",description:"The URL of the webhook.",displayDescription:"The URL of the webhook.",type:g.String,required:!0}],execute:async function(e,n){var l,s,t;const u=e[e.findIndex(d=>d.name==="url")].value;try{const d=await R.delete(u);console.log("[WebhookManager] Webhook deletion response: "+JSON.stringify(d)),d.ok==!0?m((l=n==null?void 0:n.channel.id)!=null?l:"0","Webhook deleted successfully."):(console.log("[WebhookManager] Webhook deletion failed, output: "+d.status),m((s=n==null?void 0:n.channel.id)!=null?s:"0","There was an error deleting the webhook. Check the console for more info."))}catch{console.log("[WebhookManager] Webhook deletion failed."),m((t=n==null?void 0:n.channel.id)!=null?t:"0","There was an error deleting the webhook. Did you input a valid webhook URL?")}}},B={id:"webhookinfo",name:"webhookinfo",displayName:"webhookinfo",description:"Retrieve information about a webhook.",displayDescription:"Retrieve information about a webhook.",type:c.Chat,inputType:w.BuiltInText,options:[{name:"url",displayName:"url",description:"The URL of the webhook.",displayDescription:"The URL of the webhook.",type:g.String,required:!0}],execute:async function(e,n){var l;const s=e[e.findIndex(t=>t.name==="url")].value;try{await fetch(s).then(t=>t.json()).then(t=>{var u;console.log("[WebhookManager] Webhook GET response: "+JSON.stringify(t)),m((u=n==null?void 0:n.channel.id)!=null?u:"0",`# Webhook Information: Webhook Username: `+t.name+` Webhook ID: `+t.id+` Webhook Token: `+t.token+` Channel ID: `+t.channel_id+` Server ID:`+t.guild_id+` Webhook Profile Picture: [Click Me](https://cdn.discordapp.com/avatars/`+t.id+"/"+t.avatar+`.png) Webhook Type: `+t.type+` # Webhook Creator Information: Creator User ID:`+t.user.id+` Creator Username: `+t.user.username+" | ( <@"+t.user.id+`> ) Creator Profile: [Click Me](https://img.discord.dog/`+t.user.id+`) `)})}catch(t){console.log("[WebhookManager] Webhook GET failed: "+t),m((l=n==null?void 0:n.channel.id)!=null?l:"0","There was an error getting information the webhook. Check the console for further information.")}}};var F="WebhookManager",L="1.0.1",x="Manage your webhooks easily; delete, send messages, get detailed info and more.",I=[{name:"byron",id:"639577344276692992"}],N="#00007d",U="https://github.com/byeoon/WebhookManager",P=["Fixed bug where plugin would not load, fixed bug where /webhookinfo would not output anything, fixed variables to reflect the Vencord version, added extra information on /webhookinfo."],b={name:F,version:L,description:x,authors:I,color:N,sourceUrl:U,changelog:P};const{components:o}=window.enmity;o.Alert,o.Button,o.FlatList,o.Image,o.ImageBackground,o.KeyboardAvoidingView,o.Modal,o.Pressable,o.RefreshControl;const z=o.ScrollView;o.SectionList,o.StatusBar,o.StyleSheet,o.Switch;const i=o.Text;o.TextInput,o.TouchableHighlight,o.TouchableOpacity,o.TouchableWithoutFeedback,o.Touchable;const C=o.View;o.VirtualizedList,o.Form,o.FormArrow,o.FormCTA,o.FormCTAButton,o.FormCardSection,o.FormCheckbox,o.FormDivider,o.FormHint,o.FormIcon,o.FormInput,o.FormLabel,o.FormRadio,o.FormRow,o.FormSection,o.FormSelect,o.FormSubLabel,o.FormSwitch,o.FormTernaryCheckBox,o.FormText,o.FormTextColors,o.FormTextSizes;function S(...e){return window.enmity.modules.getByProps(...e)}window.enmity.modules.common;const V=S("setString"),{default:a}=S("ButtonColors","ButtonSizes");var G=({settings:e})=>{const n=E.createThemedStyleSheet({title:{flexDirection:"column"},pluginTitle:{fontSize:30,paddingTop:20,paddingLeft:20,paddingRight:30,color:h.ThemeColorMap.HEADER_PRIMARY},pluginAuthor:{fontSize:12,paddingLeft:45,color:h.ThemeColorMap.HEADER_SECONDARY},br:{fontSize:0,paddingTop:20,paddingLeft:20,paddingRight:30,color:h.ThemeColorMap.HEADER_SECONDARY},tab:{fontSize:14,paddingTop:20,paddingLeft:20,paddingRight:25,color:h.ThemeColorMap.HEADER_SECONDARY}});return r.createElement(z,null,r.createElement(C,{style:n.title},r.createElement(i,{style:n.pluginTitle},"WebhookManager"),r.createElement(i,{style:n.pluginAuthor},"Developed by byron"),r.createElement(i,{style:n.pluginAuthor},"Version ",b.version),r.createElement(i,{style:n.br}," "),r.createElement(i,{style:n.br}," "),r.createElement(a,{color:a.Colors.BRAND,text:"Copy Plugin Link",size:a.Sizes.SMALL,onPress:()=>{V.setString("https://raw.githubusercontent.com/byeoon/WebhookManager/main/dist/WebhookManager.js")}}),r.createElement(i,{style:n.br}," "),r.createElement(a,{color:a.Colors.BRAND,text:"Visit GitHub Repository",size:a.Sizes.SMALL,onPress:()=>{M.openURL("https://github.com/byeoon/WebhookManager")}}),r.createElement(i,{style:n.br}," "),r.createElement(i,{style:n.br}," "),r.createElement(i,{style:n.pluginAuthor},"Changelog: ",b.changelog)))};const H=W("WebhookManager"),_={...b,onStart(){console.log("[WebhookManager] Hello World!"),this.commands=[D,B]},onStop(){H.unpatchAll(),this.commands=[]},getSettingsPanel({settings:e}){return r.createElement(G,{settings:e})}};v(_);