Apex-Plugins/nsfwbypass/index.js
2025-07-27 19:18:06 +02:00

1 line
3.2 KiB
JavaScript

(function(c,a,o,B,n,t,w){"use strict";const{FormSection:S,FormRow:u,FormSwitchRow:l,FormText:N}=a.findByProps("FormSection"),F=function(){return w.useProxy(t.storage),t.storage.ageBypass??=!1,t.storage.nsfwBypass??=!0,t.storage.showWarningPopup??=!0,n.React.createElement(n.ReactNative.ScrollView,{style:{flex:1}},n.React.createElement(S,{title:"NSFW Plugin Settings"},n.React.createElement(N,{style:{color:"#FFFFFF",marginBottom:16,fontSize:15,fontWeight:"500"}},"Configure NSFW plugin settings. Restart the app to apply changes."),n.React.createElement(l,{label:"Enable Age Verification Bypass",subLabel:"Sets your account as verified adult",leading:n.React.createElement(u.Icon,{source:a.findByProps("getAssetByName")?.getAssetByName("ic_person")?.id}),value:t.storage.ageBypass,onValueChange:function(e){t.storage.ageBypass=e}}),n.React.createElement(l,{label:"Enable NSFW Content Bypass",subLabel:"Bypasses all NSFW restrictions and gates completely",leading:n.React.createElement(u.Icon,{source:a.findByProps("getAssetByName")?.getAssetByName("ic_warning")?.id}),value:t.storage.nsfwBypass,onValueChange:function(e){t.storage.nsfwBypass=e}}),n.React.createElement(l,{label:"Show NSFW Channel Warning",subLabel:"Display a warning popup when entering NSFW channels",leading:n.React.createElement(u.Icon,{source:a.findByProps("getAssetByName")?.getAssetByName("ic_alert")?.id}),value:t.storage.showWarningPopup,onValueChange:function(e){t.storage.showWarningPopup=e}})))},{Text:P}=a.findByProps("Button","Text","View"),f=a.findByProps("isNSFWInvite"),g=a.findByStoreName("UserStore"),{getChannel:d}=a.findByProps("getChannel")||a.findByName("getChannel",!1);let r=[];function W(e){return typeof e=="string"?d(e)?.nsfw===!0:e?.nsfw===!0}function v(){return n.React.createElement(P,{},"This channel contains content that may not be suitable for all audiences. Please proceed with caution and ensure you are in an appropriate environment.")}var C={onLoad:function(){if(t.storage.ageBypass??=!1,t.storage.nsfwBypass??=!0,t.storage.showWarningPopup??=!0,t.storage.nsfwBypass&&(r.push(o.instead("handleNSFWGuildInvite",f,function(){return!1})),r.push(o.instead("isNSFWInvite",f,function(){return!1})),r.push(o.instead("shouldNSFWGateGuild",f,function(){return!1})),r.push(o.after("getCurrentUser",g,function(e,s){return s?.hasOwnProperty("nsfwAllowed")&&(s.nsfwAllowed=!0),s}))),t.storage.ageBypass&&r.push(o.after("getCurrentUser",g,function(e,s){return s?.hasOwnProperty("ageVerificationStatus")&&(s.ageVerificationStatus=3),s})),t.storage.showWarningPopup){const e=a.findByProps("transitionToGuild");if(e)for(const s of Object.keys(e))typeof e[s]=="function"&&r.push(o.instead(s,e,function(i,y){if(typeof i[0]=="string"){const p=i[0].match(/(\d+)$/);if(p?.[1]){const R=p[1],h=d(R);if(h&&W(h))return B.showConfirmationAlert({title:"WARNING: Entering NSFW channel",content:n.React.createElement(v),confirmText:"Proceed with Caution",cancelText:"Cancel",onConfirm:function(){return y(...i)}}),{}}}return y(...i)}))}},onUnload:function(){for(const e of r)e();r=[]},settings:F};return c.default=C,Object.defineProperty(c,"__esModule",{value:!0}),c})({},vendetta.metro,vendetta.patcher,vendetta.ui.alerts,vendetta.metro.common,vendetta.plugin,vendetta.storage);