diff --git a/FileContentPreview/index.js b/FileContentPreview/index.js index 557a596..9e03468 100644 --- a/FileContentPreview/index.js +++ b/FileContentPreview/index.js @@ -1,4 +1,4 @@ (function(M,s,w,e,y,h,p,x,E,he,ve){"use strict";const Q=new Set(["1c","4d","abnf","accesslog","ada","arduino","ino","armasm","arm","avrasm","actionscript","as","alan","ansi","i","log","ln","angelscript","asc","apache","apacheconf","applescript","osascript","arcade","asciidoc","adoc","aspectj","autohotkey","autoit","awk","mawk","nawk","gawk","bash","sh","zsh","basic","bbcode","blade","bnf","brainfuck","bf","csharp","cs","c","h","cpp","hpp","cc","hh","c++","h++","cxx","hxx","cal","cos","cls","cmake","cmake.in","coq","csp","css","csv","capnproto","capnp","chaos","kaos","chapel","chpl","cisco","clojure","clj","coffeescript","coffee","cson","iced","cpc","crmsh","crm","pcmk","crystal","cr","cypher","d","dns","zone","bind","dos","bat","cmd","dart","delphi","dpr","dfm","pas","pascal","freepascal","lazarus","lpr","lfm","diff","patch","django","jinja","dockerfile","docker","dsconfig","dts","dust","dst","dylan","ebnf","elixir","ex","elm","erlang","erl","extempore","xtlang","xtm","fsharp","fs","fix","fortran","f90","f95","gcode","nc","gams","gms","gauss","gss","godot","gdscript","gherkin","gn","gni","go","golang","gf","golo","gololang","gradle","groovy","xml","html","xhtml","rss","atom","xjb","xsd","xsl","plist","svg","http","https","haml","handlebars","hbs","html.hbs","html.handlebars","haskell","hs","haxe","hx","hy","hylang","ini","toml","inform7","i7","irpf90","json","java","jsp","javascript","js","jsx","jolie","iol","ol","julia","julia-repl","kotlin","kt","tex","leaf","lean","lasso","ls","lassoscript","less","ldif","lisp","livecodeserver","livescript","lock","ls","lua","makefile","mk","mak","make","markdown","md","mkdown","mkd","mathematica","mma","wl","matlab","maxima","mel","mercury","mirc","mrc","mizar","mojolicious","monkey","moonscript","moon","n1ql","nsis","never","nginx","nginxconf","nim","nimrod","nix","ocl","ocaml","ml","objectivec","mm","objc","obj-c","obj-c++","objective-c++","glsl","openscad","scad","ruleslanguage","oxygene","pf","pf.conf","php","php3","php4","php5","php6","php7","parser3","perl","pl","pm","plaintext","txt","text","pony","pgsql","postgres","postgresql","powershell","ps","ps1","processing","prolog","properties","protobuf","puppet","pp","python","py","gyp","profile","python-repl","pycon","k","kdb","qml","r","cshtml","razor","razor-cshtml","reasonml","re","redbol","rebol","red","red-system","rib","rsl","graph","instances","robot","rf","rpm-specfile","rpm","spec","rpm-spec","specfile","ruby","rb","gemspec","podspec","thor","irb","rust","rs","SAS","sas","scss","sql","p21","step","stp","scala","scheme","scilab","sci","shexc","shell","console","smali","smalltalk","st","sml","ml","solidity","sol","stan","stanfuncs","stata","iecst","scl","structured-text","stylus","styl","subunit","supercollider","sc","svelte","swift","tcl","tk","terraform","tf","hcl","tap","thrift","tp","tsql","twig","craftcms","typescript","ts","tsx","unicorn-rails-log","vbnet","vb","vba","vbscript","vbs","vhdl","vala","verilog","v","vim","axapta","x++","x86asm","xl","tao","xquery","xpath","xq","yml","yaml","zephir","zep"]),{View:Z,TouchableOpacity:ee}=h.General,{FormIcon:Ee}=h.Forms,te=s.findByName("Svg",!1).default,S=s.findByName("Svg",!1).Path,Re=function(n){let{color:t}=n;return e.React.createElement(te,{height:"24",width:"24",viewBox:"0 0 24 24",fill:t},e.React.createElement(S,{d:"m2.75 5c-0.41421 0-0.75 0.33579-0.75 0.75s0.33579 0.75 0.75 0.75h18.5c0.4142 0 0.75-0.33579 0.75-0.75s-0.3358-0.75-0.75-0.75h-18.5z"}),e.React.createElement(S,{d:"m2.75 11.5c-0.41421 0-0.75 0.3358-0.75 0.75s0.33579 0.75 0.75 0.75h16.25c1.3807 0 2.5 1.1193 2.5 2.5s-1.1193 2.5-2.5 2.5h-4.4393l0.7196-0.7197c0.2929-0.2929 0.2929-0.7677 0-1.0606s-0.7677-0.2929-1.0606 0l-2 2c-0.2929 0.2929-0.2929 0.7677 0 1.0606l2 2c0.2929 0.2929 0.7677 0.2929 1.0606 0s0.2929-0.7677 0-1.0606l-0.7196-0.7197h4.4393c2.2091 0 4-1.7909 4-4s-1.7909-4-4-4h-16.25z"}),e.React.createElement(S,{d:"m2 18.75c0-0.4142 0.33579-0.75 0.75-0.75h6.5c0.41421 0 0.75 0.3358 0.75 0.75s-0.33579 0.75-0.75 0.75h-6.5c-0.41421 0-0.75-0.3358-0.75-0.75z"}))},be=function(n){let{color:t}=n;return e.React.createElement(te,{height:"24",width:"24",viewBox:"0 0 24 24"},e.React.createElement(S,{d:"m12.98 18.5 3.315-9.84h1.41l3.315 9.84h-1.32l-1.71-5.505c-0.17-0.55-0.34-1.095-0.51-1.635-0.16-0.55-0.315-1.11-0.465-1.68h-0.06c-0.16 0.56999-0.32 1.13-0.48 1.68-0.16 0.54-0.325 1.085-0.495 1.635l-1.725 5.505h-1.275zm1.74-3v-1.005h4.515v1.005h-4.515z",fill:t}),e.React.createElement(S,{d:"m12.966 15.411c-0.0877-0.2469-0.1828-0.5106-0.2853-0.7912h-6.1c-0.57333 1.6933-0.86 2.76-0.86 3.2 0 0.4267 0.10667 0.6933 0.32 0.8 0.22667 0.0933 0.62667 0.14 1.2 0.14l0.04 0.24h-4.5l0.04-0.24c0.38667 0 0.68667-0.0333 0.9-0.1 0.22667-0.0667 0.46667-0.24 0.72-0.52 0.26667-0.2933 0.52-0.7133 0.76-1.26s0.52667-1.3133 0.86-2.3l1.78-5.14c0.62667-1.8133 0.94-2.9133 0.94-3.3s-0.09333-0.63333-0.28-0.74c-0.18666-0.12-0.54666-0.18-1.08-0.18l-0.04-0.22h3.3l3.0301 8.2003-0.7448 2.2109zm2.558 2.3854c0.1749 0.3152 0.3405 0.523 0.4967 0.6234 0.3333 0.2267 0.7533 0.34 1.26 0.34l0.04 0.24h-2.1738l0.3771-1.2034zm-1.2607-3.1039c0.2553 0.674 0.4732 1.2396 0.6537 1.6968l-0.6613 2.1104h-0.6426c0.085-0.1095 0.1276-0.2694 0.1276-0.4799 0-0.161-0.0824-0.5084-0.2472-1.0424l0.7698-2.2849zm-7.5226-0.5527 2.82-8.06 2.96 8.06h-5.78z",clipRule:"evenodd",fill:t,fillRule:"evenodd"}))},D=function(n){let{onPress:t,info:a,colors:o,active:r,content:i}=n;return e.React.createElement(ee,{onPress:t,onLongPress:function(){x.showToast(a,p.getAssetIDByName("ic_information_filled_24px"))},style:{backgroundColor:r?o.background.active:o.background.inactive,padding:4,borderRadius:5,borderWidth:2,borderColor:r?o.border.active:o.border.inactive}},i)},ye=function(n){let{children:t}=n;return e.React.createElement(Z,{style:{padding:15,paddingBottom:0,display:"flex",flexDirection:"row",flexWrap:"nowrap",justifyContent:"space-between"}},e.React.createElement(Z,{style:{display:"flex",flexDirection:"row",gap:8}},t))},me=e.ReactNative.NativeModules.MediaManager.downloadMediaAsset,xe=function(n){let{url:t,saveText:a,failText:o,copyText:r}=n;function i(){me(t,0).then(function(R){R?x.showToast(a,p.getAssetIDByName("ic_selection_checked_24px")):x.showToast(o,p.getAssetIDByName("ic_close_circle"))})}function l(){e.clipboard.setString(t),x.showToast(r,p.getAssetIDByName("toast_copy_link"))}return e.React.createElement(ee,{onPress:i,onLongPress:l},e.React.createElement(Ee,{source:p.getAssetIDByName("ic_download_24px"),style:{marginRight:8,marginLeft:-8,opacity:1}}))};var m={PREVIEW:{"en-US":"Preview","en-GB":"Preview","zh-CN":"\u9884\u89C8","zh-TW":"\u9810\u89BD",cs:"N\xE1hled",da:"L\xE6s fil",nl:"Voorbeeld",fr:"Aper\xE7u",de:"Vorschau",el:"\u03B4\u03B9\u03B1\u03B2\u03AC\u03C3\u03B5\u03C4\u03B5","es-ES":"Leer",uk:"\u0447\u0438\u0442\u0430\u0442\u0438"},FILE_SAVED:{"en-US":"File saved","en-GB":"File saved","es-ES":"Archivo guardado",cs:"Soubor ulo\u017Een",uk:"\u0424\u0430\u0439\u043B \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u043E"},FILE_SAVE_ERROR:{"en-US":"Error saving file","en-GB":"Error saving file","es-ES":"Error guardando archivo",cs:"Chyba p\u0159i \xFAkl\xE1d\xE1n\xED souboru",uk:"\u041F\u043E\u043C\u0438\u043B\u043A\u0430 \u0437\u0431\u0435\u0440\u0435\u0436\u0435\u043D\u043D\u044F \u0444\u0430\u0439\u043B\u0443"},TOGGLE_WORD_WRAP:{"en-US":"Toggle Word Wrap","en-GB":"Toggle Word Wrap","es-ES":"Salto de l\xEDnea",cs:"P\u0159epnout obt\xE9k\xE1n\xED slov",uk:"\u041F\u0435\u0440\u0435\u043C\u0438\u043A\u0430\u0447 \u0430\u0432\u0442\u043E\u043F\u0435\u0440\u0435\u043D\u043E\u0441\u0443 \u0441\u043B\u043E\u0432"},JUMP_BOTTOM:{"en-US":"Jump to the bottom","en-GB":"Jump to the bottom","es-ES":"Saltar al final",cs:"Sko\u010Dit na konec",uk:"\u041F\u0440\u043E\u043A\u0440\u0443\u0442\u0456\u0442\u044C \u0434\u043E \u043D\u0438\u0437\u0443"},JUMP_TOP:{"en-US":"Jump to the top","en-GB":"Jump to the top","es-ES":"Saltar al principio",cs:"Sko\u010Dit na za\u010D\xE1tek",uk:"\u041F\u0440\u043E\u043A\u0440\u0443\u0442\u0456\u0442\u044C \u0434\u043E \u0432\u0435\u0440\u0445\u0443"},MONOSPACE:{"en-US":"Toggle Monospace Font","en-GB":"Toggle Monospace Font","es-ES":"Alternar fuente monoespaciada",cs:"P\u0159epnout pevn\xE9 p\xEDsmo",uk:"\u041F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0438\u0442\u0438 \u043C\u043E\u043D\u043E\u0448\u0438\u0440\u0438\u043D\u043D\u0438\u0439 \u0448\u0440\u0438\u0444\u0442"}};const{View:ne,TouchableOpacity:ae}=h.General,{FormText:Ce,FormIcon:N}=h.Forms,re=function(n){let{icon:t,buttonColor:a,textColor:o,text:r,onPress:i}=n;return e.React.createElement(ae,{style:{backgroundColor:a,borderRadius:5,padding:10,marginBottom:15,marginTop:5,flexDirection:"row",justifyContent:"space-between",alignItems:"center"},onPress:i},t,e.React.createElement(h.Forms.FormText,{style:{color:o,fontSize:16,fontFamily:e.constants.Fonts.PRIMARY_BOLD,textTransform:"uppercase"}},r),e.React.createElement(ne,null))},Be=function(n){let{onJumpToBottom:t,onJumpToTop:a,onClose:o,textColor:r,buttonColor:i,texts:l}=n;return e.React.createElement(e.React.Fragment,null,e.React.createElement(ne,{style:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",marginBottom:15}},e.React.createElement(Ce,{style:{fontSize:20,fontFamily:e.constants.Fonts.PRIMARY_BOLD}},l.JUMP),e.React.createElement(ae,{onPress:o},e.React.createElement(N,{source:p.getAssetIDByName("ic_close_16px"),style:{opacity:1}}))),e.React.createElement(re,{icon:e.React.createElement(N,{source:p.getAssetIDByName("ic_jump_to_bottom_24px"),style:{opacity:1}}),text:l.JUMP_BOTTOM,onPress:t,buttonColor:i,textColor:r}),e.React.createElement(re,{icon:e.React.createElement(N,{source:p.getAssetIDByName("ic_jump_to_bottom_24px"),style:{opacity:1,transform:[{scaleY:-1}]}}),text:l.JUMP_TOP,onPress:a,buttonColor:i,textColor:r}))},{Text:oe,TouchableOpacity:Te}=h.General,Se=function(n){let{filename:t,color:a,subtext:o}=n;return e.React.createElement(Te,{onPress:function(){e.clipboard.setString(t),x.showToast(e.i18n.Messages.COPIED_TEXT,p.getAssetIDByName("toast_copy_message"))}},e.React.createElement(oe,{numberOfLines:1,style:{color:a}},t),e.React.createElement(oe,{numberOfLines:1,style:{color:a,fontSize:12}},o))},{Text:le,TouchableOpacity:_e}=h.General,ke=function(n){let{buttonColor:t,textColor:a,buttonTextColor:o,remainingText:r,onPress:i}=n;return e.React.createElement(e.React.Fragment,null,e.React.createElement(le,{style:{color:a,marginTop:7}},r),e.React.createElement(_e,{style:{backgroundColor:t,borderRadius:5,padding:10,marginBottom:20,marginTop:5},onPress:i},e.React.createElement(le,{style:{color:o,textTransform:"uppercase",fontWeight:"bold",textAlign:"center",fontSize:20}},e.i18n.Messages.VOICE_PANEL_LOAD_MORE)))};var O,A,I,L,F;const _=s.findByStoreName("ThemeStore"),k=((O=s.find(function(n){var t,a;return(a=n.default)===null||a===void 0||(t=a.internal)===null||t===void 0?void 0:t.resolveSemanticColor}))===null||O===void 0?void 0:O.default.internal.resolveSemanticColor)??((A=s.find(function(n){var t;return(t=n.meta)===null||t===void 0?void 0:t.resolveSemanticColor}))===null||A===void 0?void 0:A.meta.resolveSemanticColor)??function(){},Pe=s.findByName("Navigator")??((I=s.findByProps("Navigator"))===null||I===void 0?void 0:I.Navigator),Me=((L=s.findByProps("getRenderCloseButton"))===null||L===void 0?void 0:L.getRenderCloseButton)??((F=s.findByProps("getHeaderCloseButton"))===null||F===void 0?void 0:F.getHeaderCloseButton),{ActivityIndicator:we,ScrollView:se,Image:De,Modal:Ne}=e.ReactNative,{View:C,Text:ie}=h.General,Oe=s.findByProps("useSafeAreaInsets"),Ae=s.findByProps("intword"),ce=function(n){return Ae.intword(n,["bytes","KB","MB","GB","TB","PB"],1024,void 0,void 0,void 0," ")},Ie=s.findByProps("pushModal"),Le={JUMP:Be},Fe=function(){return e.React.createElement(C,{style:{margin:32}},e.React.createElement(we,{size:"large"}))},$e=function(n){let{filename:t="unknown",url:a="https://cdn.discordapp.com/attachments/1068304660269641738/1144843403151020122/file.txt",bytes:o=1}=n;const r={header:k(_.theme,E.semanticColors.HEADER_PRIMARY),sub:k(_.theme,E.semanticColors.TEXT_MUTED),bgDark:k(_.theme,E.semanticColors.BACKGROUND_SECONDARY_ALT),bgBright:k(_.theme,E.semanticColors.BACKGROUND_SECONDARY),bgBrighter:k(_.theme,E.semanticColors.BACKGROUND_ACCENT)},i={background:{active:r.bgBrighter,inactive:r.bgDark},border:{active:r.bgBright,inactive:r.bgDark}},l=function(){const R=Oe.useSafeAreaInsets(),[b,g]=e.React.useState(null),v=y.storage.chunkSize||60928,[c,d]=e.React.useState({content:"",loadedBytes:v,firstTime:!0}),B=e.React.useRef(null),[P,fe]=e.React.useState(!1),[T,pe]=e.React.useState(!0),K=!c.content;c.firstTime&&(console.log("first time"),fetch(a,{headers:{Range:`bytes=0-${v}`}}).then(function(u){u.ok?u.text().then(function(f){d({content:f,loadedBytes:c.loadedBytes,firstTime:!1})}):d({content:"",loadedBytes:0,firstTime:!1})}));const Y=b?Le[b.key]:null;function pt(){var u;g(null);let f=B.current;f==null||(u=f.scrollTo)===null||u===void 0||u.call(f,{y:0,animated:!0})}function gt(){var u;g(null);let f=B.current;f==null||(u=f.scrollToEnd)===null||u===void 0||u.call(f,{animated:!0})}let X=!1;function ht(){X||(X=!0,fetch(a,{headers:{Range:`bytes=${c.loadedBytes+1}-${c.loadedBytes+v}`}}).then(function(u){u.ok?u.text().then(function(f){d({content:c.content+f,loadedBytes:c.loadedBytes+v,firstTime:!1})}):(X=!1,x.showToast("Error: Network response was not ok",p.getAssetIDByName("ic_close_circle")))}))}let vt=0;const[Et,Rt]=e.React.useState([]);return K?e.React.createElement(Fe,null):e.React.createElement(C,{style:{marginTop:0}},e.React.createElement(ye,null,e.React.createElement(D,{onPress:function(){return fe(function(u){return!u})},active:P,colors:i,info:m.TOGGLE_WORD_WRAP[e.i18n.getLocale()]??"Toggle Word Wrap",content:e.React.createElement(Re,{color:P?r.header:r.sub})}),e.React.createElement(D,{onPress:function(){return pe(function(u){return!u})},active:T,colors:i,info:m.MONOSPACE[e.i18n.getLocale()]??"Toggle Monospace Font",content:e.React.createElement(be,{color:T?r.header:r.sub})}),e.React.createElement(D,{onPress:function(){return g({key:"JUMP",props:{onJumpToTop:pt,onJumpToBottom:gt,onClose:function(){return g(null)},textColor:r.sub,buttonColor:r.bgBright,texts:{JUMP:e.i18n.Messages.JUMP,JUMP_BOTTOM:m.JUMP_BOTTOM[e.i18n.getLocale()]??"Jump to the bottom",JUMP_TOP:m.JUMP_TOP[e.i18n.getLocale()]??"Jump to the top"}}})},active:!1,colors:i,info:e.i18n.Messages.JUMP,content:e.React.createElement(De,{source:p.getAssetIDByName("ic_reply_24px"),style:{height:24,width:24,transform:[{scaleX:-1},{rotate:"-90deg"}]}})})),e.React.createElement(se,{ref:B,style:{margin:15,marginBottom:50+R.bottom}},e.React.createElement(se,{horizontal:!P},e.React.createElement(C,{style:{flexDirection:"row"}},e.React.createElement(C,{style:{borderTopLeftRadius:4,borderBottomLeftRadius:4,backgroundColor:r.bgDark,marginRight:5,paddingRight:2,paddingLeft:2,alignSelf:"flex-start"}},e.React.createElement(ie,{style:{textAlign:"right",color:r.sub,lineHeight:20}},Et.map(function(u){return u?++vt:" "}).join(` `))),e.React.createElement(ie,{selectable:!0,style:[{color:r.header,lineHeight:20,flex:1},T&&{fontFamily:e.constants.Fonts.CODE_SEMIBOLD}],onTextLayout:function(u){let f=u.nativeEvent.lines;Rt(f.map(function(bt,ge){return ge>0?f[ge-1].text.indexOf(` -`)>-1:!0}))}},c.content))),c.loadedBytes=R.length){const g=o-R.length,v=b[g],{filename:c,url:d,size:B}=v;ze.pushModal({key:"file-content-preview",modal:{key:"file-content-preview",modal:$e,props:{filename:c,url:d,bytes:B},animation:"slide-up",shouldPersistUnderModals:!1,closable:!0}})}})),function(){n.__fcp_patched=!1,t.forEach(function(a){return a()})}};function Ge(){let n=[],t=function(o){let r=je(o);r&&n.push(r)};const a=Object.getOwnPropertyDescriptor($.prototype,"params").get;return a&&Object.defineProperty($.prototype,"params",{configurable:!0,get(){return this&&t(this),a.call(this)}}),function(){a&&Object.defineProperty($.prototype,"params",{configurable:!0,get:a}),n.forEach(function(o){return o()})}}const Je=s.findByName("RowManager"),We=s.findByStoreName("ThemeStore"),Ve=s.findByName("getEmbedThemeColors")??function(){return{colors:{borderColor:335939079,backgroundColor:-14276817,headerColor:-4867391,headerText:"",acceptLabelGreenBackgroundColor:-14385083}}};function He(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"unknown",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"? bytes";const{colors:a}=Ve([We.theme]);return{borderColor:a.borderColor,backgroundColor:a.backgroundColor,thumbnailCornerRadius:15,headerColor:a.headerColor,headerText:"",acceptLabelBackgroundColor:a.acceptLabelGreenBackgroundColor,titleText:e.i18n.Messages.SEARCH_ANSWER_HAS_ATTACHMENT.toUpperCase()+" \u2014 "+t,type:null,extendedType:4,participantAvatarUris:[],acceptLabelText:m.PREVIEW[e.i18n.getLocale()]??"Preview",noParticipantsText:` +`)>-1:!0}))}},c.content))),c.loadedBytes=R.length){const g=o-R.length,v=b[g],{filename:c,url:d,size:B}=v;ze.pushModal({key:"file-content-preview",modal:{key:"file-content-preview",modal:$e,props:{filename:c,url:d,bytes:B},animation:"slide-up",shouldPersistUnderModals:!1,closable:!0}})}})),function(){n.__fcp_patched=!1,t.forEach(function(a){return a()})}};function Ge(){let n=[],t=function(o){let r=je(o);r&&n.push(r)};const a=Object.getOwnPropertyDescriptor($.prototype,"params").get;return a&&Object.defineProperty($.prototype,"params",{configurable:!0,get(){return this&&t(this),a.call(this)}}),function(){a&&Object.defineProperty($.prototype,"params",{configurable:!0,get:a}),n.forEach(function(o){return o()})}}const Je=s.findByName("RowManager"),We=s.findByStoreName("ThemeStore"),Ve=s.findByName("getEmbedThemeColors")??function(){return{colors:{borderColor:335939079,backgroundColor:-14276817,headerColor:-4867391,headerText:"",acceptLabelGreenBackgroundColor:-14385083}}};function He(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"unknown",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"? bytes";const{colors:a}=Ve(We.theme);return{borderColor:a.borderColor,backgroundColor:a.backgroundColor,thumbnailCornerRadius:15,headerColor:a.headerColor,headerText:"",acceptLabelBackgroundColor:a.acceptLabelGreenBackgroundColor,titleText:e.i18n.Messages.SEARCH_ANSWER_HAS_ATTACHMENT.toUpperCase()+" \u2014 "+t,type:null,extendedType:4,participantAvatarUris:[],acceptLabelText:m.PREVIEW[e.i18n.getLocale()]??"Preview",noParticipantsText:` `+n,ctaEnabled:!0}}function de(n){const{message:t}=n;if(!t||!t.attachments)return;let a=[],o=[];if(t.attachments.forEach(function(i){Q.has(i.filename.toLowerCase().split(".").pop())?a.push(He(i.filename,i.size)):o.push(i)}),a.length){var r;!((r=t.codedLinks)===null||r===void 0)&&r.length||(t.codedLinks=[]),t.codedLinks.push(...a),t.attachments=o}}const{NativeModules:qe}=e.ReactNative,{DCDChatManager:Ke,InfoDictionaryManager:Ye,RTNClientInfoManager:Xe}=qe,Qe=Ye??Xe;function Ze(){return parseInt(Qe.Build)>200013?w.before("updateRows",Ke,function(n){var t=JSON.parse(n[1]);for(const a of t)de(a);n[1]=JSON.stringify(t)}):w.after("generate",Je.prototype,function(n,t){de(t)})}var z,U;const{StyleSheet:et,PanResponder:tt}=e.ReactNative,j=s.findByStoreName("ThemeStore"),{View:G}=h.General,{useState:nt,useRef:at}=e.React,J=((z=s.find(function(n){var t,a;return(a=n.default)===null||a===void 0||(t=a.internal)===null||t===void 0?void 0:t.resolveSemanticColor}))===null||z===void 0?void 0:z.default.internal.resolveSemanticColor)??((U=s.find(function(n){var t;return(t=n.meta)===null||t===void 0?void 0:t.resolveSemanticColor}))===null||U===void 0?void 0:U.meta.resolveSemanticColor)??function(){},W={sliderOff:J(j.theme,E.semanticColors.DEPRECATED_QUICKSWITCHER_INPUT_BACKGROUND),sliderOn:J(j.theme,E.semanticColors.REDESIGN_BUTTON_PRIMARY_BACKGROUND),thumb:J(j.theme,E.semanticColors.MENTION_FOREGROUND)},rt=function(n){let{onSlide:t,value:a}=n;const o=a||0,[r,i]=nt(0),l=at(null);function R(c){l.current&&l.current.measure(function(d,B,P,fe,T,pe){let K=(c-T)/(P-T)*100;const Y=Math.min(Math.max(0,Math.round(K/5)*5),100);t&&t(Y)})}const b=e.React.useRef(tt.create({onStartShouldSetPanResponder:function(c,d){return!0},onStartShouldSetPanResponderCapture:function(c,d){return!0},onMoveShouldSetPanResponder:function(c,d){return!0},onMoveShouldSetPanResponderCapture:function(c,d){return!0},onPanResponderGrant:function(c,d){R(d.x0)},onPanResponderMove:function(c,d){R(d.moveX)},onPanResponderTerminationRequest:function(c,d){return!0},onPanResponderRelease:function(c,d){},onPanResponderTerminate:function(c,d){},onShouldBlockNativeResponder:function(c,d){return!0}})).current;function g(c){i(c.nativeEvent.layout.width)}const v=et.create({container:{marginLeft:"5%",width:"90%",height:20,borderRadius:25,backgroundColor:W.sliderOff,marginBottom:25},slid:{width:o+"%",height:"100%",borderTopLeftRadius:25,borderBottomLeftRadius:25,borderRadius:o===100?25:0,backgroundColor:W.sliderOn,justifyContent:"center"},thumb:{height:"150%",aspectRatio:1,alignSelf:"flex-end",right:-(r/2),borderRadius:100,backgroundColor:W.thumb}});return e.React.createElement(G,{style:v.container,...b.panHandlers,ref:l},e.React.createElement(G,{style:v.slid},e.React.createElement(G,{style:v.thumb,onLayout:g})))};var V,H;const{ScrollView:ot}=e.ReactNative,{Text:lt}=h.General,st=s.findByStoreName("ThemeStore"),it=((V=s.find(function(n){var t,a;return(a=n.default)===null||a===void 0||(t=a.internal)===null||t===void 0?void 0:t.resolveSemanticColor}))===null||V===void 0?void 0:V.default.internal.resolveSemanticColor)??((H=s.find(function(n){var t;return(t=n.meta)===null||t===void 0?void 0:t.resolveSemanticColor}))===null||H===void 0?void 0:H.meta.resolveSemanticColor)??function(){},ct={text:it(st.theme,E.semanticColors.TEXT_NORMAL)},ut=s.findByProps("intword");function dt(){var n;ve.useProxy(y.storage),(n=y.storage).chunkSize??(n.chunkSize=60928);let t=1024e3,a=10240,o=function(l){return l/100*(t-a)+a},r=function(l){return(l-a)/(t-a)*100},i=function(l){return ut.intword(l,["bytes","KB","MB","GB","TB","PB"],1024,void 0,void 0,void 0," ")};return React.createElement(ot,{style:{flex:1,marginTop:10}},React.createElement(he.FormRow,{label:"Load chunk size",subLabel:"How many bytes to load at a time"}),React.createElement(rt,{onSlide:function(l){y.storage.chunkSize=o(l)},value:r(y.storage.chunkSize),style:{marginBottom:0}}),React.createElement(lt,{style:{marginLeft:"5%",color:ct.text,fontFamily:e.constants.Fonts.DISPLAY_MEDIUM,fontSize:16,marginBottom:5,marginTop:-5}},"Current value: ",`${i(y.storage.chunkSize)} (${Math.round(r(y.storage.chunkSize))}%)`))}let q=[];var ft={onLoad:function(){q.push(Ge()),q.push(Ze())},onUnload:function(){for(const n of q)n()},settings:dt};return M.default=ft,Object.defineProperty(M,"__esModule",{value:!0}),M})({},vendetta.metro,vendetta.patcher,vendetta.metro.common,vendetta.plugin,vendetta.ui.components,vendetta.ui.assets,vendetta.ui.toasts,vendetta.ui,vendetta.ui.components.Forms,vendetta.storage); diff --git a/FileContentPreview/manifest.json b/FileContentPreview/manifest.json index 2343aca..bd08552 100644 --- a/FileContentPreview/manifest.json +++ b/FileContentPreview/manifest.json @@ -1 +1 @@ -{"name":"FileContentPreview","description":"Allows you to preview the contents of text files in the app.","authors":[{"name":"fres","id":"843448897737064448"}],"main":"index.js","vendetta":{"icon":"icon-qs-files"},"hash":"1e30089c96e0768b8167c6c0d7820636543bd1ea808a5403a73d944e5c261c53"} \ No newline at end of file +{"name":"FileContentPreview","description":"Allows you to preview the contents of text files in the app.","authors":[{"name":"fres","id":"843448897737064448"}],"main":"index.js","vendetta":{"icon":"icon-qs-files"},"hash":"a827e31f36927fdbfff77b54b52bf283b5832f998967975f910d29066f9b5bf9"} \ No newline at end of file diff --git a/Foxer/index.js b/Foxer/index.js new file mode 100644 index 0000000..6125bfa --- /dev/null +++ b/Foxer/index.js @@ -0,0 +1 @@ +(function(n){"use strict";let e=[];var o={onLoad:function(){},onUnload:function(){for(const t of e)t()}};return n.default=o,Object.defineProperty(n,"__esModule",{value:!0}),n})({}); diff --git a/Foxer/manifest.json b/Foxer/manifest.json new file mode 100644 index 0000000..ba3a2ba --- /dev/null +++ b/Foxer/manifest.json @@ -0,0 +1 @@ +{"name":"Foxer","description":"foxes some issues with old plugins in new versions :3","authors":[{"name":"fres","id":"843448897737064448"}],"main":"index.js","vendetta":{"icon":"TriangleExclamationPointIcon"},"hash":"248a82f7a5dc87355f9433db377c88a110005ca89c8f8b083e0b89f64a5eafc0"} \ No newline at end of file