226 lines
9.6 KiB
TypeScript
226 lines
9.6 KiB
TypeScript
/* Metro module 10988; source: modules/markup/native/Spoiler.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 661, 10980, 33, 4501, 477, 697, 1305, 3868, 2] */
|
|
function _fun84090(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:6, offset: 0x01f38a7a, size: 549 bytes, params: 8, frame: 25
|
|
var object5;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_5 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_6 = importDefault(18) /* metro dependency 18 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const value2 = require(27) /* metro dependency 27 */;
|
|
const env0_8 = value2.View;
|
|
const env0_9 = value2.StyleSheet;
|
|
const EMOJI_CHAT_SIZE = (require(661) /* metro dependency 661: Constants */).EMOJI_CHAT_SIZE;
|
|
const MUTED_OPACITY_CONTENT = (require(10980) /* metro dependency 10980: RedesignChannelListConstants */).MUTED_OPACITY_CONTENT;
|
|
const env0_10 = (require(33) /* metro dependency 33 */).jsx;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createLegacyClassComponentStyles = createStylesModule.createLegacyClassComponentStyles;
|
|
object5 = {};
|
|
const object6 = {};
|
|
object6.color = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'rgba(0,0,0,0.0019607844)' : 'transparent';
|
|
let SPOILER_HIDDEN_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.SPOILER_HIDDEN_BACKGROUND;
|
|
object6.backgroundColor = SPOILER_HIDDEN_BACKGROUND;
|
|
object5.spoiler = object6;
|
|
const object7 = {width: EMOJI_CHAT_SIZE, height: EMOJI_CHAT_SIZE};
|
|
SPOILER_HIDDEN_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.SPOILER_HIDDEN_BACKGROUND;
|
|
object7.backgroundColor = SPOILER_HIDDEN_BACKGROUND;
|
|
object5.placeholder = object7;
|
|
const object8 = {};
|
|
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
|
|
object8.color = TEXT_DEFAULT;
|
|
const SPOILER_REVEALED_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.SPOILER_REVEALED_BACKGROUND;
|
|
object8.backgroundColor = SPOILER_REVEALED_BACKGROUND;
|
|
object5.spoilerRevealed = object8;
|
|
object5.muted = {opacity: MUTED_OPACITY_CONTENT};
|
|
const env0_11 = Reflect.apply(createLegacyClassComponentStyles, createStylesModule, [object5]);
|
|
const PureComponent = value.PureComponent;
|
|
value = _fun84096(PureComponent);
|
|
const ThemeContext = (require(3868) /* metro dependency 3868: native */).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/markup/native/Spoiler.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_84091() { // fn#84091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:264, offset: 0x01f38c9f, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_84091_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function recursiveTextExtraction(a0, a1) { // fn#84094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:888, offset: 0x01f38d01, size: 45 bytes, params: 3, frame: 13
|
|
const env0_0 = a1;
|
|
const Children = env0_7.Children;
|
|
return Children.map(a0, _fun84095);
|
|
}
|
|
|
|
function _fun84096(a0) { // fn#84096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:1124, offset: 0x01f38dc8, size: 72 bytes, params: 2, frame: 15
|
|
const closure = Spoiler_84097;
|
|
env0_6(closure, a0);
|
|
return env0_3(closure, [{key: 'render', value: value_84099}]);
|
|
}
|
|
|
|
function _fun84095(a0) { // fn#84095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:913, offset: 0x01f38d2e, size: 154 bytes, params: 2, frame: 18
|
|
var r7;
|
|
var props;
|
|
var style;
|
|
var Array;
|
|
var cloneElement;
|
|
var object2;
|
|
var recursiveTextExtractionBinding;
|
|
let binding = env1_7;
|
|
if (binding.isValidElement(a0)) {
|
|
props = a0.props;
|
|
style = props.style;
|
|
Array = global.Array;
|
|
r7 = Array.isArray(style) ? StyleSheet.flatten(style) : style;
|
|
binding = env1_7;
|
|
cloneElement = binding.cloneElement;
|
|
object2 = {};
|
|
recursiveTextExtractionBinding = recursiveTextExtraction;
|
|
props = a0.props;
|
|
object2.children = recursiveTextExtractionBinding(props.children, require);
|
|
object2.style = [r7, require.spoiler];
|
|
object2.onPress = undefined;
|
|
return Reflect.apply(cloneElement, binding, [a0, object2]);
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function Spoiler_84097(a0) { // fn#84097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:1136, offset: 0x01f38e10, size: 160 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_2;
|
|
binding(this, Spoiler_84097);
|
|
const items = [];
|
|
arraySpread(items, value, 0, items);
|
|
value = env1_5(Spoiler_84097);
|
|
binding = env1_4;
|
|
if (_isNativeReflectConstruct_84091()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items, env1_5(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.state = {revealed: false};
|
|
value.handleTap = handleTap;
|
|
return value;
|
|
}
|
|
|
|
function value_84099() { // fn#84099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:1518, offset: 0x01f38eff, size: 284 bytes, params: 1, frame: 19
|
|
const binding = env1_11;
|
|
const context = this.context;
|
|
const value2 = undefined;
|
|
const value3 = binding(context);
|
|
const revealed = this.state.revealed;
|
|
const props = this.props;
|
|
const children = props.children;
|
|
const r7 = revealed ? [value3.spoilerRevealed, props.spoilerRevealedStyle] : [value3.spoiler, props.spoilerStyle];
|
|
let Children = env1_7.Children;
|
|
if (Children.count(children) === 0) {
|
|
return null;
|
|
}
|
|
Children = env1_7.Children;
|
|
const value5 = Children.map(children, _fun84100);
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
return (
|
|
<LegacyText
|
|
accessibilityRole="button"
|
|
style={[r7, this.props.muted && value3.muted]}
|
|
onPress={this.props.disableReveal ? value2 : this.handleTap}
|
|
>
|
|
{value5}
|
|
</LegacyText>
|
|
);
|
|
}
|
|
|
|
function handleTap() { // fn#84098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:1377, owner: Spoiler_84097.handleTap, offset: 0x01f38eb0, size: 79 bytes, params: 1, frame: 12
|
|
var binding;
|
|
if (!(env0_0.state.revealed || env0_0.props.disableReveal)) {
|
|
binding = env0_0;
|
|
binding.setState({revealed: !binding.state.revealed});
|
|
}
|
|
}
|
|
|
|
function _fun84100(a0) { // fn#84100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11174:1744, offset: 0x01f3901b, size: 168 bytes, params: 2, frame: 16
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
let value = a0;
|
|
const binding = env2_7;
|
|
if (binding.isValidElement(value)) {
|
|
if (value.type.displayName === 'Image') {
|
|
if (revealed) {
|
|
if (value.props == null) {
|
|
r2 = value;
|
|
} else if (revealed) {
|
|
r2 = value;
|
|
} else {
|
|
value = recursiveTextExtraction(value, env0_0);
|
|
r2 = value;
|
|
}
|
|
r1 = r2;
|
|
} else {
|
|
r1 = <View style={env0_0.placeholder} />;
|
|
}
|
|
} else if (value.props?.source == null) {
|
|
if (value.props == null) {
|
|
r2 = value;
|
|
} else if (revealed) {
|
|
r2 = value;
|
|
} else {
|
|
value = recursiveTextExtraction(value, env0_0);
|
|
r2 = value;
|
|
}
|
|
r1 = r2;
|
|
} else if (revealed) {
|
|
if (value.props == null) {
|
|
r2 = value;
|
|
} else if (revealed) {
|
|
r2 = value;
|
|
} else {
|
|
value = recursiveTextExtraction(value, env0_0);
|
|
r2 = value;
|
|
}
|
|
r1 = r2;
|
|
} else {
|
|
r1 = <View style={env0_0.placeholder} />;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|