Files
2026-07-28 01:06:53 +03:00

113 lines
8.0 KiB
TypeScript

/* Metro module 8541; source: modules/reactions/native/BurstReactionToggle.tsx; dependencies: [31, 27, 4502, 1376, 33, 4017, 566, 3860, 697, 4504, 4577, 4501, 8542, 1244, 7952, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import UseBurstToggleCoachmark from './useBurstToggleCoachmark.tsx'; /* Metro dependency 8542 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as DismissibleContentConstantsModule from '../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
import * as SpringModule from '../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
import * as SuperReactionIconModule from '../../../design/components/Icon/native/redesign/generated/SuperReactionIcon.tsx'; /* Metro dependency 7952 */
function _fun67711(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8726:6, offset: 0x01c2def3, size: 386 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object = {duration: 100};
const Easing = (ReanimatedRexportModule).Easing;
const out = Easing.out;
const Easing2 = (ReanimatedRexportModule).Easing;
object.easing = Reflect.apply(out, Easing, [Easing2.quad]);
const env0_9 = {'stiffness': 750, 'mass': 2.5, 'damping': 70};
object = {code: 'function BurstReactionToggleTsx1(){const{reducedMotion,targetBackgroundColor,backgroundColor,rotation}=this.__closure;const _backgroundColor=reducedMotion?targetBackgroundColor:backgroundColor.get();const _rotation=reducedMotion?0:rotation.get();return{backgroundColor:_backgroundColor,transform:[{rotate:_rotation+"deg"}]};}'};
const createStyles = CreateStylesModule.createStyles;
const BORDER_RADIUS = (Native).modules.button.BORDER_RADIUS;
const env0_11 = Reflect.apply(createStyles, CreateStylesModule, [{container: {'borderRadius': null, 'padding': 8,
'marginLeft': 8, 'width': 40, 'height': 40, borderRadius: BORDER_RADIUS}}]);
(FileImportTrackerModule).fileFinishedImporting('modules/reactions/native/BurstReactionToggle.tsx');
exports.default = BurstReactionToggle;
function BurstReactionToggle({onPress, isActive}) { // fn#67712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8726:848, offset: 0x01c2e075, size: 380 bytes, params: 2, frame: 24
const styles = useStyles();
const colors = (Native).colors;
const r9 = isActive ? colors.WHITE : colors.INTERACTIVE_TEXT_DEFAULT;
const value2 = ReactModule.useRef(null);
const env0_1 = (UseBurstToggleCoachmark)(value2);
const containerStyle = _fun67713(isActive).containerStyle;
const object = {onPress: onPress_67717, accessible: true};
const intl = (IndexNativeModule).intl;
const string = intl.string;
const t = (IndexNativeModule).t;
object.accessibilityLabel = isActive ? Reflect.apply(string, intl, [t['5cRA/b']]) : Reflect.apply(string, intl,
[t.buV4av]);
object.accessibilityRole = 'switch';
object.accessibilityState = {checked: isActive};
const View = (ReanimatedRexport).View;
const items2 = [styles.container, containerStyle];
const SuperReactionIcon = (SuperReactionIconModule).SuperReactionIcon;
return (
<Pressable {...object}>
<View style={items2} ref={value2}>
<SuperReactionIcon color={r9} />
</View>
</Pressable>
);
function _fun67713(a0) { // fn#67713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8726:1010, offset: 0x01c2e1f1, size: 356 bytes, params: 2, frame: 21
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const useToken = UseTokenModule.useToken;
const colors = (Native).colors;
const r7 = Reflect.apply(useToken, UseTokenModule,
[a0 ? colors.BACKGROUND_BRAND : colors.INPUT_BACKGROUND_DEFAULT]) ?? '';
const r5 = a0 ? 360 : 0;
const value6 = (ReanimatedRexportModule).useSharedValue(r7);
const value7 = (ReanimatedRexportModule).useSharedValue(r5);
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
const c_677152 = c_67715;
c_677152.__closure = {reducedMotion: useReducedMotion, targetBackgroundColor: r7, backgroundColor: value6,
rotation: value7};
c_677152.__workletHash = 1525758595013;
c_677152.__initData = env1_10;
const value8 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [c_677152]);
env1_3.useEffect(_fun67716, [value6, r7, value7, r5]);
return {containerStyle: value8};
function c_67715() { // fn#67715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8726:1287, offset: 0x01c2e364, size: 107 bytes, params: 1, frame: 15
const object = {};
object.backgroundColor = useReducedMotion ? env0_1 : ReactModule.get();
object.transform = [{rotate: '' + (useReducedMotion ? 0 : ReactNativeModule.Pressable.get()) + 'deg'}];
return object;
}
function _fun67716() { // fn#67716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8726:1527, offset: 0x01c2e3cf, size: 108 bytes, params: 1, frame: 20
let binding = ReactModule;
let set = binding.set;
Reflect.apply(set, binding, [TimingModule.withTiming(env0_1, env2_8)]);
binding = ReactNativeModule.Pressable;
set = binding.set;
Reflect.apply(set, binding, [SpringModule.withSpring(env0_2, env2_9)]);
}
}
function BurstReactionToggleOnPress() { // fn#67717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8726:1667, owner: BurstReactionToggle.onPress, offset: 0x01c2e43b, size: 37 bytes, params: 1, frame: 12
const binding = env0_1;
const AUTO = ContentDismissActionType.AUTO;
binding(AUTO);
onPress();
}
}
}
global.__d(_fun67711, 8541, [31, 27, 4502, 1376, 33, 4017, 566, 3860, 697, 4504, 4577, 4501, 8542, 1244, 7952,
2]) /* metro module 8541, dependencies: [31, 27, 4502, 1376, 33, 4017, 566, 3860, 697, 4504, 4577, 4501, 8542, 1244, 7952, 2] */;