diff --git a/rose-utils/install/index.js b/rose-utils/install/index.js index 2eabca4..1970875 100644 --- a/rose-utils/install/index.js +++ b/rose-utils/install/index.js @@ -1,4 +1,5 @@ -(function(S,g,o,a,u,H,h,R,b,w){"use strict";function I(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(e,t){for(var n=0;nt&&(n.message.communicationDisabled=!0)}}))},onStop(){}}});const he=o.findByStoreName("ThemeStore"),be=o.find(function(e){return e?.default?.internal?.resolveSemanticColor})?.default?.internal?.resolveSemanticColor??o.find(function(e){return e?.meta?.resolveSemanticColor})?.meta?.resolveSemanticColor??function(){};function O(e,t=he?.theme){if(e)try{return be(t,e)}catch{return}}const{View:ye,Text:pe}=a.ReactNative,V={destructive:{bg:"#F23F42",fg:"#FFFFFF"},default:{bg:"#4E5058",fg:"#FFFFFF"}};function ve({variant:e="default",children:t}){const n=V[e]??V.default;return a.React.createElement(ye,{style:{backgroundColor:n.bg,borderRadius:4,paddingHorizontal:4,paddingVertical:1,marginLeft:4,alignSelf:"center"}},a.React.createElement(pe,{style:{color:n.fg,fontSize:10,fontWeight:"700",textTransform:"uppercase"}},t))}var Se="f47fd463dcaac61e.png",Re="f944dbd033a60207.png",we="88eacd3588829ded.png",Ee="4d1aef97fe869aaf.png",ke="3a73d84a21043a5e.png",me="8b628d7e3fc05957.png",Fe="cb7a2c9b3fb9561c.png",$e="11d89273b5bd6cc6.png",Te="ea31146eb15fdde7.png",Ae="b0d124bd12658047.png",Ie="cb8b45023e70bb61.png",Ne="a738efc867a225ee.png",Ce="cba17334eeaf3198.png",Be="fead9e69933db668.png",Le="fead9e69933db668.png",xe="d6a4e512cdcf1078.png",De="9901722947705011.png",Pe=function(e){return e.Lock="Lock",e.Warning="Warning",e.Controller="Controller",e}(Pe||{});function Me(e,t){if(e==="Lock")return t?Te:$e;if(e==="Warning")return t?De:xe;if(e==="Controller")return we}const Ue={Lock:["#f0b232","STATUS_WARNING"],Warning:["#f23f43","STATUS_DANGER"],Controller:["#23a55a","STATUS_POSITIVE"]},_e=[{name:"Announcements",kind:"Lock",base:Se},{name:"Announcements",kind:"Warning",base:Re},{name:"Text",kind:"Lock",base:Ne},{name:"Text",kind:"Warning",base:Ce},{name:"Text",kind:"Controller",base:Ie},{name:"Voice",kind:"Lock",base:Be},{name:"Voice",kind:"Warning",base:Le},{name:"Forum",kind:"Lock",base:Ee},{name:"Forum",kind:"Warning",base:ke},{name:"Stage",kind:"Lock",bottom:!0,base:Ae},{name:"Stage",kind:"Warning",bottom:!0,base:0},{name:"Image",kind:"Lock",bottom:!0,base:me},{name:"Image",kind:"Warning",bottom:!0,base:Fe}],W=o.findByName("ChannelInfo",!1),j=o.findByProps("BaseChannelIcon");var Oe=new d({id:"colorful-channels",label:"Colorful Channels",meta:{sublabel:"Gives channel icons with symbols colors to make them more aesthetically pleasing",category:c.Useful},settings:{nsfwTag:{label:"NSFW tag",subLabel:"Adds a red NSFW tag next to channel names",type:"toggle",default:!0},colorIcons:{label:"Colored icon symbols",subLabel:"Turns locked channel symbols yellow, NSFW channel symbols red",type:"toggle",default:!0},colorIconsFallback:{label:"Fallback colors for colored icon symbols",subLabel:"Uses yellow, red and green colors regardless of theme",type:"toggle",default:!1}},handlers:{onStart(){var e=this;this.storage.options.nsfwTag&&W&&this.patches.add(u.after("default",W,function([{channel:t}],n){return a.React.createElement(a.React.Fragment,{},t?.nsfw_&&a.React.createElement(ve,{variant:"destructive"},"nsfw"),n)})),this.storage.options.colorIcons&&j?.BaseChannelIcon&&this.patches.add(u.after("BaseChannelIcon",j,function([{source:t,style:n}],r){try{const i=typeof t?.original=="number"?b.getAssetByID(t.original)?.name:typeof t=="number"?b.getAssetByID(t)?.name:null;if(!i)return;const s=_e.find(function(G){return i===`${G.name}${G.kind}Icon`});if(!s)return;const[l,T]=Ue[s.kind],A=Me(s.kind,s.bottom),f=r?.props?.color?.replace(/-/g,"_")?.toUpperCase(),nt=f&&w.semanticColors?.[f]?O(w.semanticColors[f]):void 0,z=a.ReactNative.StyleSheet.flatten([n,r?.props?.style,{width:18,height:18,tintColor:nt}]),at=e.storage.options.colorIconsFallback?l:O(w.semanticColors?.[T])??l;return a.React.createElement(a.ReactNative.View,{},a.React.createElement(a.ReactNative.Image,{style:z,source:s.base}),a.React.createElement(a.ReactNative.View,{style:{position:"absolute",right:0,bottom:0}},a.React.createElement(a.ReactNative.Image,{style:{...z,tintColor:at},source:A})))}catch{return}}))},onStop(){}}});const Ve=o.findByProps("DeveloperMode","DarkSidebar");var We=new d({id:"enforce-developer-mode",label:"Enforce Developer Mode",meta:{sublabel:"Keeps Developer Mode switched on - it tends to reset itself on Revenge-based clients",category:c.Fixes},handlers:{onStart(){const e=Ve?.DeveloperMode;if(!e?.getSetting||!e?.updateSetting)return;const t=function(){try{e.getSetting()||e.updateSetting(!0)}catch{}};t(),this.patches.add(p("USER_SETTINGS_PROTO_UPDATE",t));const n=setInterval(t,5e3);this.patches.add(function(){return clearInterval(n)})},onStop(){}}}),F=[ne,ae,de,ge,Oe,We];const{ScrollView:je,View:Ye}=a.ReactNative;function ze({children:e}){return a.React.createElement(je,{style:{flex:1}},e,a.React.createElement(Ye,{style:{height:24}}))}const{View:Ge,Text:He}=a.ReactNative;function Ke({children:e,style:t}){return a.React.createElement(Ge,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},a.React.createElement(He,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{FormSection:Je,FormSwitchRow:Y,FormRow:$}=R.Forms;function qe(e,t){return typeof e.subLabel=="function"?e.subLabel(t):e.subLabel}function Qe({module:e,settingKey:t}){const n=e.settings[t];if(n.predicate&&!n.predicate.call(e))return null;const r=e.storage.options[t],i=qe(n,r),s=!e.storage.enabled;return n.type==="toggle"?a.React.createElement(Y,{label:n.label,subLabel:i,value:!!r,disabled:s,onValueChange:function(l){e.storage.options[t]=l,e.restart()}}):n.type==="button"?a.React.createElement($,{label:n.label,subLabel:i,disabled:s,onPress:function(){return n.action.call(e)}}):a.React.createElement($,{label:n.label,subLabel:[i,r].filter(Boolean).join(" - "),disabled:s,onPress:function(){const l=n.choices.indexOf(r);e.storage.options[t]=n.choices[(l+1)%n.choices.length],e.restart()}})}function Xe({module:e}){e.useRefresh();const t=Object.entries(e.errors);return a.React.createElement(Je,{title:e.label},a.React.createElement(Y,{label:"Enabled",subLabel:e.meta.sublabel,value:!!e.storage.enabled,onValueChange:function(){return e.toggle()}}),e.storage.enabled&&Object.keys(e.settings).map(function(n){return a.React.createElement(Qe,{key:n,module:e,settingKey:n})}),t.length>0&&a.React.createElement($,{label:`${t.length} error${t.length===1?"":"s"} - tap to copy`,onPress:function(){const n=t.map(function([r,i]){return`[${e.label}] ${r} -${i}`}).join(` +(function(N,$,s,r,y,le,d,F,f,L,_){"use strict";function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var n=0;nt&&(n.message.communicationDisabled=!0)}}))},onStop(){}}});const Ce=s.findByStoreName("ThemeStore"),Ee=s.find(function(e){return e?.default?.internal?.resolveSemanticColor})?.default?.internal?.resolveSemanticColor??s.find(function(e){return e?.meta?.resolveSemanticColor})?.meta?.resolveSemanticColor??function(){};function q(e,t=Ce?.theme){if(e)try{return Ee(t,e)}catch{return}}const{View:Te,Text:Ne}=r.ReactNative,Q={destructive:{bg:"#F23F42",fg:"#FFFFFF"},default:{bg:"#4E5058",fg:"#FFFFFF"}};function Fe({variant:e="default",children:t}){const n=Q[e]??Q.default;return r.React.createElement(Te,{style:{backgroundColor:n.bg,borderRadius:4,paddingHorizontal:4,paddingVertical:1,marginLeft:4,alignSelf:"center"}},r.React.createElement(Ne,{style:{color:n.fg,fontSize:10,fontWeight:"700",textTransform:"uppercase"}},t))}var Le="f47fd463dcaac61e.png",_e="f944dbd033a60207.png",Be="88eacd3588829ded.png",Pe="4d1aef97fe869aaf.png",Me="3a73d84a21043a5e.png",Ue="8b628d7e3fc05957.png",xe="cb7a2c9b3fb9561c.png",Oe="11d89273b5bd6cc6.png",We="ea31146eb15fdde7.png",Ve="b0d124bd12658047.png",je="cb8b45023e70bb61.png",Ge="a738efc867a225ee.png",ze="cba17334eeaf3198.png",Ye="fead9e69933db668.png",He="fead9e69933db668.png",Je="d6a4e512cdcf1078.png",Ke="9901722947705011.png",qe=function(e){return e.Lock="Lock",e.Warning="Warning",e.Controller="Controller",e}(qe||{});function Qe(e,t){if(e==="Lock")return t?We:Oe;if(e==="Warning")return t?Ke:Je;if(e==="Controller")return Be}const Xe={Lock:["#f0b232","STATUS_WARNING"],Warning:["#f23f43","STATUS_DANGER"],Controller:["#23a55a","STATUS_POSITIVE"]},Ze=[{name:"Announcements",kind:"Lock",base:Le},{name:"Announcements",kind:"Warning",base:_e},{name:"Text",kind:"Lock",base:Ge},{name:"Text",kind:"Warning",base:ze},{name:"Text",kind:"Controller",base:je},{name:"Voice",kind:"Lock",base:Ye},{name:"Voice",kind:"Warning",base:He},{name:"Forum",kind:"Lock",base:Pe},{name:"Forum",kind:"Warning",base:Me},{name:"Stage",kind:"Lock",bottom:!0,base:Ve},{name:"Stage",kind:"Warning",bottom:!0,base:0},{name:"Image",kind:"Lock",bottom:!0,base:Ue},{name:"Image",kind:"Warning",bottom:!0,base:xe}],X=s.findByName("ChannelInfo",!1),Z=s.findByProps("BaseChannelIcon");var et=new h({id:"colorful-channels",label:"Colorful Channels",meta:{sublabel:"Gives channel icons with symbols colors to make them more aesthetically pleasing",category:u.Useful},settings:{nsfwTag:{label:"NSFW tag",subLabel:"Adds a red NSFW tag next to channel names",type:"toggle",default:!0},colorIcons:{label:"Colored icon symbols",subLabel:"Turns locked channel symbols yellow, NSFW channel symbols red",type:"toggle",default:!0},colorIconsFallback:{label:"Fallback colors for colored icon symbols",subLabel:"Uses yellow, red and green colors regardless of theme",type:"toggle",default:!1}},handlers:{onStart(){var e=this;this.storage.options.nsfwTag&&X&&this.patches.add(y.after("default",X,function([{channel:t}],n){return r.React.createElement(r.React.Fragment,{},t?.nsfw_&&r.React.createElement(Fe,{variant:"destructive"},"nsfw"),n)})),this.storage.options.colorIcons&&Z?.BaseChannelIcon&&this.patches.add(y.after("BaseChannelIcon",Z,function([{source:t,style:n}],a){try{const o=typeof t?.original=="number"?f.getAssetByID(t.original)?.name:typeof t=="number"?f.getAssetByID(t)?.name:null;if(!o)return;const i=Ze.find(function(T){return o===`${T.name}${T.kind}Icon`});if(!i)return;const[l,g]=Xe[i.kind],m=Qe(i.kind,i.bottom),c=a?.props?.color?.replace(/-/g,"_")?.toUpperCase(),S=c&&L.semanticColors?.[c]?q(L.semanticColors[c]):void 0,w=r.ReactNative.StyleSheet.flatten([n,a?.props?.style,{width:18,height:18,tintColor:S}]),E=e.storage.options.colorIconsFallback?l:q(L.semanticColors?.[g])??l;return r.React.createElement(r.ReactNative.View,{},r.React.createElement(r.ReactNative.Image,{style:w,source:i.base}),r.React.createElement(r.ReactNative.View,{style:{position:"absolute",right:0,bottom:0}},r.React.createElement(r.ReactNative.Image,{style:{...w,tintColor:E},source:m})))}catch{return}}))},onStop(){}}});const U=s.findByProps("openLazy","hideActionSheet"),{ActionSheetRow:b}=s.findByProps("ActionSheetRow")??{},C=new Set;let I=null;function tt(e,t){return b?r.React.createElement(b,{label:e.label,subLabel:e.sublabel,icon:e.icon?r.React.createElement(b.Icon,{source:f.getAssetIDByName(e.icon)}):void 0,onPress:function(){try{e.onPress(t)}finally{U?.hideActionSheet?.()}},key:e.key}):null}function nt(e){const t=[];for(const n of C)try{for(const a of n(e)){const o=tt(a,e);o&&t.push(o)}}catch{}return t}function at(){return y.before("openLazy",U,function([e,t,n]){t!=="MessageLongPressActionSheet"||!n?.message||e.then(function(a){a.__roseUtilsActiveMessage=n.message,!a.__roseUtilsPatched&&(a.__roseUtilsPatched=!0,y.after("default",a,function(o,i){try{const l=nt(a.__roseUtilsActiveMessage);if(!l.length)return;const g=_.findInReactTree(i,function(c){return Array.isArray(c)&&c[0]?.type?.name==="ActionSheetRowGroup"});if(Array.isArray(g)&&g.length&&b){let c=!1;for(const S of g){const w=_.findInReactTree(S,function(E){return Array.isArray(E)&&E.some(function(T){return T?.type?.name==="ActionSheetRow"})});if(Array.isArray(w)){w.push(...l),c=!0;break}}if(!c&&typeof g.unshift=="function"&&b.Group&&(g.unshift(r.React.createElement(b.Group,{},l)),c=!0),c)return}const m=_.findInReactTree(i,function(c){return Array.isArray(c)&&c.length>0&&c.every(function(S){return typeof S?.props?.label=="string"&&typeof S?.props?.onPress=="function"})});Array.isArray(m)&&m.push(...l)}catch{}}))})})}function p(e){return!I&&U&&(I=at()),C.add(e),function(){C.delete(e),C.size===0&&I&&(I(),I=null)}}const rt=s.findByProps("DeveloperMode","DarkSidebar"),ee=s.findByStoreName("PresenceStore");function ot(e){const t=e?.interaction??e?.interactionMetadata??e?.interaction_metadata;return t?.id?{id:String(t.id),name:t.name}:null}function it(e){const t=ot(e);return t?[{key:"rose-utils-copy-command-id",label:"Copy Command ID",sublabel:t.name?`/${t.name}`:"Slash command interaction",icon:"ic_copy_24px",onPress:function(){r.clipboard.setString(t.id),d.showToast("Copied command ID to clipboard",f.getAssetIDByName("ic_copy_24px"))}}]:[]}function st(e){if(!ee?.getActivities)return[];const t=e?.author?.id;if(!t)return[];let n;try{n=ee.getActivities(t)}catch{return[]}if(!Array.isArray(n))return[];const a=n.filter(function(o){return o?.application_id??o?.applicationId});return a.length?a.map(function(o,i){const l=String(o.application_id??o.applicationId);return{key:`rose-utils-copy-activity-id-${i}`,label:a.length>1?`Copy Activity ID (${o.name??i+1})`:"Copy Activity/Game ID",sublabel:o.name,icon:"ic_copy_24px",onPress:function(){r.clipboard.setString(l),d.showToast(`Copied ${o.name??"activity"} ID to clipboard`,f.getAssetIDByName("ic_copy_24px"))}}}):[]}var lt=new h({id:"enforce-developer-mode",label:"Developer Mode",meta:{sublabel:"Turns on Discord's real Developer Mode (all its native Copy ID options) and adds extra copy-ID tools slash commands and activities don't get natively",category:u.Useful},settings:{keepNativeOn:{label:"Keep native Developer Mode on",subLabel:"Re-asserts Discord's own Developer Mode setting - it tends to reset itself on Revenge-based clients",type:"toggle",default:!0},copyCommandId:{label:"Copy Command ID",subLabel:"Adds a row to the message long-press menu for messages sent via a slash command",type:"toggle",default:!0},copyActivityId:{label:"Copy Activity/Game ID",subLabel:"Adds a row to the message long-press menu to copy the author's current game/activity application ID (not every activity type has one, e.g. a plain custom status)",type:"toggle",default:!0}},handlers:{onStart(){if(this.storage.options.keepNativeOn){const e=rt?.DeveloperMode;if(e?.getSetting&&e?.updateSetting){const t=function(){try{e.getSetting()||e.updateSetting(!0)}catch{}};t(),this.patches.add(D("USER_SETTINGS_PROTO_UPDATE",t));const n=setInterval(t,5e3);this.patches.add(function(){return clearInterval(n)})}}this.storage.options.copyCommandId&&this.patches.add(p(it)),this.storage.options.copyActivityId&&this.patches.add(p(st))},onStop(){}}});const v="ic_copy_24px";function R(e,t){r.clipboard.setString(e),d.showToast(t,f.getAssetIDByName(v))}function ct(e){const t=e?.webhookId??e?.webhook_id;return t?[{key:"rose-utils-copy-webhook-id",label:"Copy Webhook ID",icon:v,onPress:function(){return R(String(t),"Copied webhook ID to clipboard")}}]:[]}function ut(e){const t=e?.nonce;return t?[{key:"rose-utils-copy-nonce",label:"Copy Nonce",icon:v,onPress:function(){return R(String(t),"Copied nonce to clipboard")}}]:[]}function dt(e){const t=e?.attachments;if(!Array.isArray(t)||!t.length)return[];const n=t.map(function(a){return a?.id}).filter(Boolean);return n.length?[{key:"rose-utils-copy-attachment-ids",label:n.length>1?`Copy Attachment IDs (${n.length})`:"Copy Attachment ID",icon:v,onPress:function(){return R(n.join(", "),`Copied ${n.length} attachment ID${n.length===1?"":"s"} to clipboard`)}}]:[]}function ft(e){const t=e?.messageReference??e?.message_reference,n=t?.messageId??t?.message_id;return n?[{key:"rose-utils-copy-referenced-id",label:"Copy Replied-to Message ID",icon:v,onPress:function(){return R(String(n),"Copied replied-to message ID to clipboard")}}]:[]}function pt(e){return e?.id?[{key:"rose-utils-copy-debug-info",label:"Copy Message Debug Info",sublabel:"Type, flags, and timestamps",icon:v,onPress:function(){const t={id:e.id,channelId:e.channelId??e.channel_id,type:e.type,flags:e.flags,timestamp:e.timestamp,editedTimestamp:e.editedTimestamp??e.edited_timestamp};R(JSON.stringify(t,null,2),"Copied message debug info to clipboard")}}]:[]}var gt=new h({id:"message-dev-tools",label:"Message Dev Tools",meta:{sublabel:"Extra copy-ID rows in the message long-press menu, beyond what Discord's Developer Mode gives you natively",category:u.Useful},settings:{copyWebhookId:{label:"Copy Webhook ID",subLabel:"For messages sent by a webhook",type:"toggle",default:!0},copyNonce:{label:"Copy Nonce",subLabel:"The client-generated ID used to match an optimistic send to its real message",type:"toggle",default:!0},copyAttachmentIds:{label:"Copy Attachment ID(s)",type:"toggle",default:!0},copyReferencedId:{label:"Copy Replied-to Message ID",type:"toggle",default:!0},copyDebugInfo:{label:"Copy Message Debug Info",subLabel:"Type, flags, and creation/edit timestamps as JSON",type:"toggle",default:!0}},handlers:{onStart(){const e=this.storage.options;e.copyWebhookId&&this.patches.add(p(ct)),e.copyNonce&&this.patches.add(p(ut)),e.copyAttachmentIds&&this.patches.add(p(dt)),e.copyReferencedId&&this.patches.add(p(ft)),e.copyDebugInfo&&this.patches.add(p(pt))},onStop(){}}});const yt=1420070400000n;function te(e){const t=e.trim();if(!/^\d{15,20}$/.test(t))return null;try{const n=(BigInt(t)>>22n)+yt;return new Date(Number(n))}catch{return null}}function ht(e){return te(e)?.toISOString()??null}var bt=new h({id:"snowflake-tools",label:"Snowflake Tools",meta:{sublabel:"Decode any Discord ID's creation timestamp - useful after copying an ID with Developer Mode",category:u.Useful},settings:{decodeClipboard:{label:"Decode ID(s) in clipboard",subLabel:"Copy one or more Discord IDs first (one per line, or comma-separated), then tap this",type:"button",action(){r.clipboard.getString().then(function(e){const t=e.split(/[\s,]+/).map(function(o){return o.trim()}).filter(Boolean);if(!t.length){d.showToast("Clipboard is empty",void 0);return}const n=t.map(function(o){const i=ht(o);return i?`${o} -> ${i}`:`${o} -> not a valid snowflake`}),a=n.join(` +`);r.clipboard.setString(a),d.showToast(`Decoded ${n.length} ID${n.length===1?"":"s"} - result copied`,f.getAssetIDByName("ic_copy_24px"))})}}},handlers:{onStart(){},onStop(){}}});const ne=s.findByStoreName("GuildStore"),ae=s.findByStoreName("RelationshipStore"),re=s.findByStoreName("GuildMemberStore"),vt=s.findByStoreName("UserStore"),x="ic_copy_24px";function oe(e,t){r.clipboard.setString(e),d.showToast(t,f.getAssetIDByName(x))}function ie(e){return e?.guildId??e?.guild_id??null}function mt(e){const t=ie(e);if(!t||!ne?.getGuild)return[];const n=ne.getGuild(t);return n?[{key:"rose-utils-copy-server-info",label:"Copy Server Info",sublabel:n.name,icon:x,onPress:function(){const a={id:t,name:n.name,ownerId:n.ownerId,createdAt:te(t)?.toISOString(),boostTier:n.premiumTier,boostCount:n.premiumSubscriberCount,verificationLevel:n.verificationLevel,vanityURLCode:n.vanityURLCode,description:n.description,features:n.features};oe(JSON.stringify(a,null,2),"Copied server info to clipboard")}}]:[]}function St(e){const t=ie(e);if(!t||!ae?.getFriendIDs||!re?.getMember)return[];let n;try{n=ae.getFriendIDs()}catch{return[]}return!Array.isArray(n)||!n.length?[]:[{key:"rose-utils-copy-friends-in-server",label:"Copy Friends In This Server",sublabel:"Only counts friends already loaded into this server's member list this session",icon:x,onPress:function(){const a=n.filter(function(o){try{return!!re.getMember(t,o)}catch{return!1}}).map(function(o){return vt?.getUser?.(o)?.username??o});oe(a.length?a.join(", "):"(none found - they may just not be loaded into the member list yet)",`Copied ${a.length} friend${a.length===1?"":"s"} in this server to clipboard`)}}]}var It=new h({id:"server-info-tools",label:"Server Info Tools",meta:{sublabel:"Adds Copy Server Info and Copy Friends In This Server rows to the message long-press menu",category:u.Useful},settings:{copyServerInfo:{label:"Copy Server Info",subLabel:"Boost tier, verification level, features, vanity URL, creation date, and more",type:"toggle",default:!0},copyFriendsInServer:{label:"Copy Friends In This Server",subLabel:"Cross-references your friends list against this server's cached member list",type:"toggle",default:!0}},handlers:{onStart(){const e=this.storage.options;e.copyServerInfo&&this.patches.add(p(mt)),e.copyFriendsInServer&&this.patches.add(p(St))},onStop(){}}}),O=[be,Ae,ke,et,lt,gt,bt,It];const{ScrollView:Rt,View:wt}=r.ReactNative;function $t({children:e}){return r.React.createElement(Rt,{style:{flex:1}},e,r.React.createElement(wt,{style:{height:24}}))}const{View:At,Text:Dt}=r.ReactNative;function kt({children:e,style:t}){return r.React.createElement(At,{style:[{marginHorizontal:16,marginVertical:8,padding:10,borderRadius:8,borderWidth:1,borderColor:"rgba(128,128,128,0.25)"},t]},r.React.createElement(Dt,{style:{fontSize:12.5,lineHeight:18,opacity:.75}},e))}const{FormSection:Ct,FormSwitchRow:se,FormRow:W}=F.Forms;function Et(e,t){return typeof e.subLabel=="function"?e.subLabel(t):e.subLabel}function Tt({module:e,settingKey:t}){const n=e.settings[t];if(n.predicate&&!n.predicate.call(e))return null;const a=e.storage.options[t],o=Et(n,a),i=!e.storage.enabled;return n.type==="toggle"?r.React.createElement(se,{label:n.label,subLabel:o,value:!!a,disabled:i,onValueChange:function(l){e.storage.options[t]=l,e.restart()}}):n.type==="button"?r.React.createElement(W,{label:n.label,subLabel:o,disabled:i,onPress:function(){return n.action.call(e)}}):r.React.createElement(W,{label:n.label,subLabel:[o,a].filter(Boolean).join(" - "),disabled:i,onPress:function(){const l=n.choices.indexOf(a);e.storage.options[t]=n.choices[(l+1)%n.choices.length],e.restart()}})}function Nt({module:e}){e.useRefresh();const t=Object.entries(e.errors);return r.React.createElement(Ct,{title:e.label},r.React.createElement(se,{label:"Enabled",subLabel:e.meta.sublabel,value:!!e.storage.enabled,onValueChange:function(){return e.toggle()}}),e.storage.enabled&&Object.keys(e.settings).map(function(n){return r.React.createElement(Tt,{key:n,module:e,settingKey:n})}),t.length>0&&r.React.createElement(W,{label:`${t.length} error${t.length===1?"":"s"} - tap to copy`,onPress:function(){const n=t.map(function([a,o]){return`[${e.label}] ${a} +${o}`}).join(` -`);a.clipboard.setString(n),h.showToast("Copied - paste this when reporting the issue",void 0)}}))}const Ze=[c.Useful,c.Fixes,c.Fun];function et(){return a.React.createElement(ze,null,a.React.createElement(Ke,null,"RoseUtils is a collection of small, independent utilities - toggle whichever ones you want. Fork of nexpid's NexxUtils, with fixes for lookups that broke on newer Discord versions. If a module shows an error below, tap it to copy the details for a bug report."),Ze.flatMap(function(e){return F.filter(function(t){return t.meta.category===e}).map(function(t){return a.React.createElement(Xe,{key:t.id,module:t})})}))}var tt={onLoad(){y.modules??={};for(const e of F)try{e.storage.enabled&&e.start()}catch(t){g.logger.error(`[RoseUtils] Failed to start "${e.label}" on load: ${t}`)}},onUnload(){for(const e of F)try{e.stop()}catch(t){g.logger.error(`[RoseUtils] Failed to stop "${e.label}" cleanly: ${t}`)}},settings:et};return S.default=tt,Object.defineProperty(S,"__esModule",{value:!0}),S})({},vendetta,vendetta.metro,vendetta.metro.common,vendetta.patcher,vendetta.plugin,vendetta.ui.toasts,vendetta.ui.components,vendetta.ui.assets,vendetta.ui); +`);r.clipboard.setString(n),d.showToast("Copied - paste this when reporting the issue",void 0)}}))}const Ft=[u.Useful,u.Fixes,u.Fun];function Lt(){return r.React.createElement($t,null,r.React.createElement(kt,null,"RoseUtils is a collection of small, independent utilities - toggle whichever ones you want. Fork of nexpid's NexxUtils, with fixes for lookups that broke on newer Discord versions. If a module shows an error below, tap it to copy the details for a bug report."),Ft.flatMap(function(e){return O.filter(function(t){return t.meta.category===e}).map(function(t){return r.React.createElement(Nt,{key:t.id,module:t})})}))}var _t={onLoad(){A.modules??={};for(const e of O)try{e.storage.enabled&&e.start()}catch(t){$.logger.error(`[RoseUtils] Failed to start "${e.label}" on load: ${t}`)}},onUnload(){for(const e of O)try{e.stop()}catch(t){$.logger.error(`[RoseUtils] Failed to stop "${e.label}" cleanly: ${t}`)}},settings:Lt};return N.default=_t,Object.defineProperty(N,"__esModule",{value:!0}),N})({},vendetta,vendetta.metro,vendetta.metro.common,vendetta.patcher,vendetta.plugin,vendetta.ui.toasts,vendetta.ui.components,vendetta.ui.assets,vendetta.ui,vendetta.utils); diff --git a/rose-utils/install/manifest.json b/rose-utils/install/manifest.json index 8757ed1..2db6f23 100644 --- a/rose-utils/install/manifest.json +++ b/rose-utils/install/manifest.json @@ -1 +1 @@ -{"name":"RoseUtils","description":"A small collection of independent utilities - Spotify listen-along, a Tenor download fix, colorful channel icons, and more. Fork of nexpid's NexxUtils.","authors":[{"name":"everestmcarthur"},{"name":"nexpid"}],"main":"index.js","hash":"fa54bc3e77dd332fd3e3d859268a4a79b26bae320c19a26e0c6eb148c57398e0"} \ No newline at end of file +{"name":"RoseUtils","description":"A small collection of independent utilities - Spotify listen-along, a Tenor download fix, colorful channel icons, and more. Fork of nexpid's NexxUtils.","authors":[{"name":"everestmcarthur"},{"name":"nexpid"}],"main":"index.js","hash":"395e341a784c7918a27e3525fa5dad9e365700156e2ee9b2525accbf80992118"} \ No newline at end of file