150 lines
11 KiB
TypeScript
150 lines
11 KiB
TypeScript
/* Metro module 13665; source: modules/quests/native/QuestDock/QuestDockDragHandle.tsx; dependencies: [31, 27, 6528, 13572, 7553, 33, 4501, 13650, 13573, 5176, 4017, 4577, 8141, 13571, 6515, 1244, 2] */
|
|
import ReanimatedNativeView from '../../../core/native/ReanimatedNativeView.tsx'; /* Metro dependency 8141 */
|
|
import QuestDockContext from './QuestDockContext.tsx'; /* Metro dependency 13650 */
|
|
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 ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as YouBarExperimentModule from '../../../main_tabs_v2/YouBarExperiment.tsx'; /* Metro dependency 5176 */
|
|
import * as ActionSheetHeaderBarNativeModule from '../../../../design/components/Sheet/native/ActionSheetHeaderBar.native.tsx'; /* Metro dependency 6515 */
|
|
import * as QuestConstantsModule from '../../QuestConstants.tsx'; /* Metro dependency 6528 */
|
|
import * as YouBarConstantsModule from '../../../main_tabs_v2/native/YouBarConstants.tsx'; /* Metro dependency 7553 */
|
|
import * as QuestDockUtilsModule from './QuestDockUtils.tsx'; /* Metro dependency 13571 */
|
|
import * as QuestDockConstantsModule from './QuestDockConstants.tsx'; /* Metro dependency 13572 */
|
|
import * as QuestDockGestureContextModule from './QuestDockGestureContext.tsx'; /* Metro dependency 13573 */
|
|
|
|
function _fun104360(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:6, offset: 0x02293cfa, size: 460 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const StyleSheet = (ReactNativeModule).StyleSheet;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
const object2 = {};
|
|
copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined);
|
|
object2['bottom'] = undefined;
|
|
object2['right'] = undefined;
|
|
object2['zIndex'] = 4;
|
|
object.dragHandleWrapper = object2;
|
|
const object3 = {};
|
|
copyDataProperties(object3, StyleSheet.absoluteFillObject, undefined);
|
|
object3['bottom'] = undefined;
|
|
object.dragHandleOverlay = object3;
|
|
const env0_11 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
object = {code: 'function getDragHandleOffsetLeft_QuestDockDragHandleTsx1(activeQuestDockMode,horizontalEdgeGutter,withYouBar){const{QuestDockMode}=this.__closure;if(withYouBar){switch(activeQuestDockMode){case QuestDockMode.EXPANDED:return 0;default:return horizontalEdgeGutter*-1;}}else{switch(activeQuestDockMode){case QuestDockMode.COLLAPSED:return horizontalEdgeGutter*-1;default:return 0;}}}'};
|
|
const env0_13 = _fun104361();
|
|
object = {code: 'function QuestDockDragHandleTsx2(){const{windowDimensions,QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;return{width:Math.min(windowDimensions.get().width,QUEST_DOCK_COLLAPSED_MAX_WIDTH)};}'};
|
|
object = {code: 'function QuestDockDragHandleTsx3(){const{getDragHandleOffsetLeft,activeQuestDockMode,questDockHorizontalGutterCollapsed,youBarEnabled}=this.__closure;return{left:getDragHandleOffsetLeft(activeQuestDockMode.get(),questDockHorizontalGutterCollapsed,youBarEnabled)};}'};
|
|
object = {code: 'function QuestDockDragHandleTsx4(){const{withSpring,isEnrolled,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{opacity:withSpring(isEnrolled||activeQuestDockMode.get()===QuestDockMode.CLOSED||activeQuestDockMode.get()===QuestDockMode.SOFT_DISMISSED?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS)};}'};
|
|
object = {code: 'function QuestDockDragHandleTsx5(){const{withSpring,isEnrolled,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{opacity:withSpring(!isEnrolled&&activeQuestDockMode.get()!==QuestDockMode.CLOSED&&activeQuestDockMode.get()!==QuestDockMode.SOFT_DISMISSED?0.5:0,QUEST_DOCK_MODE_CHANGE_PHYSICS)};}'};
|
|
value = value.memo(QuestDockDragHandle);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestDock/QuestDockDragHandle.tsx');
|
|
exports.default = value;
|
|
function _fun104361() { // fn#104361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:900, offset: 0x02293ec6, size: 57 bytes, params: 1, frame: 4
|
|
const getDragHandleOffsetLeft2 = getDragHandleOffsetLeft;
|
|
getDragHandleOffsetLeft2.__closure = {QuestDockMode: QuestDockMode};
|
|
getDragHandleOffsetLeft2.__workletHash = 3634410156103;
|
|
getDragHandleOffsetLeft2.__initData = env0_12;
|
|
return getDragHandleOffsetLeft2;
|
|
function getDragHandleOffsetLeft(a0, a1, a2) { // fn#104362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:939, offset: 0x02293eff, size: 70 bytes, params: 4, frame: 5
|
|
const value = environment.__proto__;
|
|
return a2 ? a0 === QuestDockMode.EXPANDED ? 0 : -1 * a1 : a0 !== QuestDockMode.COLLAPSED ? 0 : -1 * a1;
|
|
}
|
|
|
|
}
|
|
|
|
function QuestDockDragHandle({isExpanded}) { // fn#104363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:2358, offset: 0x02293f45, size: 973 bytes, params: 2, frame: 31
|
|
const binding = env0_3;
|
|
let useContext = binding.useContext;
|
|
const quest = Reflect.apply(useContext, binding,
|
|
[QuestDockContext]).quest;
|
|
const styles = useStyles();
|
|
useContext = binding.useContext;
|
|
const QuestDockGestureContext = (QuestDockGestureContextModule).QuestDockGestureContext;
|
|
const {activeQuestDockMode, windowDimensions} = Reflect.apply(useContext, binding, [QuestDockGestureContext]);
|
|
const userStatus = quest.userStatus;
|
|
const value4 = userStatus?.enrolledAt != null;
|
|
const value5 = (YouBarExperimentModule).useYouBarEnabled('QuestDockDragHandle');
|
|
const r15 = value5 ? useYouBarHorizontalMargin() : QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED;
|
|
let useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
let closure = function() {
|
|
var object = {};
|
|
var Math = global.Math;
|
|
object.width = Math.min(windowDimensions.get().width, QUEST_DOCK_COLLAPSED_MAX_WIDTH);
|
|
return object;
|
|
};
|
|
closure.__closure = {windowDimensions: windowDimensions,
|
|
QUEST_DOCK_COLLAPSED_MAX_WIDTH: QUEST_DOCK_COLLAPSED_MAX_WIDTH};
|
|
closure.__workletHash = 13640576219747;
|
|
closure.__initData = env0_14;
|
|
const value7 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
|
|
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
closure = QuestDockDragHandleH;
|
|
closure.__closure = {getDragHandleOffsetLeft: env0_13, activeQuestDockMode: activeQuestDockMode,
|
|
questDockHorizontalGutterCollapsed: r15, youBarEnabled: value5};
|
|
closure.__workletHash = 14041713732815;
|
|
closure.__initData = env0_15;
|
|
const value8 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
|
|
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
closure = function() {
|
|
var moduleValue = require(dependencyMap[11]);
|
|
return {opacity: moduleValue.withSpring(result || activeQuestDockMode.get() === QuestDockMode.CLOSED ? 1 : activeQuestDockMode.get() !== QuestDockMode.SOFT_DISMISSED ? 0 : 1,
|
|
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS)};
|
|
};
|
|
object = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, isEnrolled: value4,
|
|
activeQuestDockMode: activeQuestDockMode};
|
|
object.QuestDockMode = QuestDockMode;
|
|
object.QUEST_DOCK_MODE_CHANGE_PHYSICS = QUEST_DOCK_MODE_CHANGE_PHYSICS;
|
|
closure.__closure = object;
|
|
closure.__workletHash = 12299455640931;
|
|
closure.__initData = env0_16;
|
|
const value9 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
|
|
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
closure = function() {
|
|
var moduleValue = require(dependencyMap[11]);
|
|
return {opacity: moduleValue.withSpring(result || activeQuestDockMode.get() === QuestDockMode.CLOSED ? 0 : activeQuestDockMode.get() !== QuestDockMode.SOFT_DISMISSED ? 0.5 : 0,
|
|
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS)};
|
|
};
|
|
closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, isEnrolled: value4,
|
|
activeQuestDockMode: activeQuestDockMode, QuestDockMode: QuestDockMode,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS: QUEST_DOCK_MODE_CHANGE_PHYSICS};
|
|
closure.__workletHash = 9632835517209;
|
|
closure.__initData = env0_17;
|
|
const value10 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
|
|
const items3 = [styles.dragHandleWrapper, value7];
|
|
const defaultImport2 = ReanimatedNativeView;
|
|
const dimensionsLayoutTransition = (QuestDockUtilsModule).dimensionsLayoutTransition;
|
|
const defaultImport3 = ReanimatedNativeView;
|
|
const items2 = [styles.dragHandleOverlay, value10];
|
|
const ActionSheetHeaderBar = (ActionSheetHeaderBarNativeModule).ActionSheetHeaderBar;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
return (
|
|
<ReanimatedNativeView style={items3}>
|
|
{((Component) => <Component style={value8} layout={dimensionsLayoutTransition}>{((Component) => <Component style={items2}><ActionSheetHeaderBar variant="overlay" accessibilityLabel={isExpanded ? Reflect.apply(string,
|
|
intl, [t['GQ+4bk']]) : Reflect.apply(string, intl,
|
|
[t.Yplnt6])} /></Component>)(defaultImport3)}<ReanimatedNativeView style={[styles.dragHandleOverlay,
|
|
value9]} pointerEvents="none" accessibilityElementsHidden importantForAccessibility="no-hide-descendants"><ActionSheetHeaderBar variant="default" /></ReanimatedNativeView></Component>)(defaultImport2)}
|
|
</ReanimatedNativeView>
|
|
);
|
|
function QuestDockDragHandleH() { // fn#104365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:2883, owner: QuestDockDragHandle.H, offset: 0x02294349, size: 48 bytes, params: 1, frame: 16
|
|
const object = {};
|
|
object.left = env1_13(activeQuestDockMode.get(), QuestConstantsModule.QuestDockMode, env0_3);
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun104360, 13665, [31, 27, 6528, 13572, 7553, 33, 4501, 13650, 13573, 5176, 4017, 4577, 8141, 13571,
|
|
6515, 1244,
|
|
2]) /* metro module 13665, dependencies: [31, 27, 6528, 13572, 7553, 33, 4501, 13650, 13573, 5176, 4017, 4577, 8141, 13571, 6515, 1244, 2] */;
|