386 lines
28 KiB
TypeScript
386 lines
28 KiB
TypeScript
/* Metro module 13569; source: modules/quests/native/QuestDock/QuestDockHooks.tsx; dependencies: [57, 31, 13570, 6528, 13572, 7553, 13573, 13576, 11281, 5176, 4017, 7739, 13571, 566, 672, 9949, 9513, 9519, 9517, 9518, 7121, 7120, 6531, 4080, 13577, 1962, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Durations from '../../../../utils/Durations.tsx'; /* Metro dependency 672 */
|
|
import UseSafeAreaInsetsSharedValueNative from '../../../safe_area/useSafeAreaInsetsSharedValue.native.tsx'; /* Metro dependency 11281 */
|
|
import QuestDockStore from './QuestDockStore.tsx'; /* Metro dependency 13570 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as ReanimatedRexportModule from '../../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as YouBarExperimentModule from '../../../main_tabs_v2/YouBarExperiment.tsx'; /* Metro dependency 5176 */
|
|
import * as QuestConstantsModule from '../../QuestConstants.tsx'; /* Metro dependency 6528 */
|
|
import * as CheapWorkletShallowEqualModule from '../../../reanimated/native/cheapWorkletShallowEqual.tsx'; /* Metro dependency 7739 */
|
|
import * as ContentImpressionTrackerHooksModule from '../../lib/analytics/ContentImpressionTrackerHooks.tsx'; /* Metro dependency 9513 */
|
|
import * as AnalyticsHooksModule from '../../lib/analytics/AnalyticsHooks.tsx'; /* Metro dependency 9949 */
|
|
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 */
|
|
import * as QuestDockExternalCoordinationContextModule from './QuestDockExternalCoordinationContext.tsx'; /* Metro dependency 13576 */
|
|
|
|
function _fun103128(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#103128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:6, offset: 0x02259705, size: 390 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = QuestDockConstantsModule;
|
|
const env0_7 = value.QUEST_DOCK_CLOSED_HEIGHT;
|
|
const env0_8 = value.QUEST_DOCK_COLLAPSED_HEIGHT;
|
|
const env0_9 = value.QUEST_DOCK_EXTERNAL_OFFSET_CLOSED;
|
|
const env0_10 = value.QUEST_DOCK_EXTERNAL_OFFSET_COLLAPSED;
|
|
const env0_11 = value.QUEST_DOCK_EXTERNAL_OFFSET_COLLAPSED_WITH_YOU_BAR;
|
|
const env0_12 = value.QUEST_DOCK_EXTERNAL_OFFSET_EXPANDED;
|
|
const env0_13 = value.QUEST_DOCK_EXTERNAL_OFFSET_EXPANDED_WITH_YOU_BAR;
|
|
const env0_14 = value.QUEST_DOCK_VERTICAL_EDGE_GUTTER_CLOSED;
|
|
const env0_15 = value.QUEST_DOCK_VERTICAL_EDGE_GUTTER_COLLAPSED;
|
|
const env0_16 = value.QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED;
|
|
value = require(7553) /* metro dependency 7553: YouBarConstants */;
|
|
const env0_17 = value.useYouBarHorizontalMargin;
|
|
const env0_18 = value.useYouBarTotalHeight;
|
|
object = {code: 'function QuestDockHooksTsx1(){const{restingQuestDockMode,minExpandedContentHeight,windowDimensions,safeArea}=this.__closure;return{restingQuestDockMode:restingQuestDockMode.get(),minExpandedContentHeight:minExpandedContentHeight.get(),windowWidth:windowDimensions.get().width,windowHeight:windowDimensions.get().height,safeArea:safeArea.get()};}'};
|
|
object = {code: 'function QuestDockHooksTsx2(props,previous){const{cheapWorkletShallowEqual,QuestDockMode,runOnJS,setRestingQuestDockMode,questDockWrapperSpecs,youBarEnabled,QUEST_DOCK_VERTICAL_EDGE_GUTTER_COLLAPSED,getQuestDockCollapsedWidth,youBarHorizontalMargin,QUEST_DOCK_COLLAPSED_HEIGHT,activeQuestDockMode,QUEST_DOCK_VERTICAL_EDGE_GUTTER_CLOSED,getQuestDockClosedWidth,QUEST_DOCK_CLOSED_HEIGHT,getQuestDockExpandedHeightLimits,youBarHeight,QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED,getQuestDockExpandedWidth}=this.__closure;var _previous$restingQues;if(cheapWorkletShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const{restingQuestDockMode:restingQuestDockMode,minExpandedContentHeight:minExpandedContentHeight,windowWidth:windowWidth,windowHeight:windowHeight,safeArea:safeArea}=props;switch(restingQuestDockMode){case QuestDockMode.RESET_TO_PREVIOUS:runOnJS(setRestingQuestDockMode)((_previous$restingQues=previous===null||previous===void 0?void 0:previous.restingQuestDockMode)!==null&&_previous$restingQues!==void 0?_previous$restingQues:QuestDockMode.COLLAPSED);return;case QuestDockMode.COLLAPSED:questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:youBarEnabled?0:QUEST_DOCK_VERTICAL_EDGE_GUTTER_COLLAPSED*-1,width:getQuestDockCollapsedWidth(windowWidth,youBarEnabled?youBarHorizontalMargin:safeArea.left,youBarEnabled?youBarHorizontalMargin:safeArea.right),height:QUEST_DOCK_COLLAPSED_HEIGHT});activeQuestDockMode.set(QuestDockMode.COLLAPSED);break;case QuestDockMode.CLOSED:case QuestDockMode.SOFT_DISMISSED:questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:youBarEnabled?0:QUEST_DOCK_VERTICAL_EDGE_GUTTER_CLOSED*-1,width:getQuestDockClosedWidth(windowWidth,youBarEnabled?youBarHorizontalMargin:safeArea.left,youBarEnabled?youBarHorizontalMargin:safeArea.right),height:QUEST_DOCK_CLOSED_HEIGHT});activeQuestDockMode.set(restingQuestDockMode);break;case QuestDockMode.EXPANDED:const minContentHeight=minExpandedContentHeight;const{minHeight:minHeight,maxHeight:maxHeight}=getQuestDockExpandedHeightLimits(windowHeight,safeArea.top,minContentHeight);const heightMidpoint=(maxHeight+minHeight)/2;let height;if(questDockWrapperSpecs.get().height<=QUEST_DOCK_COLLAPSED_HEIGHT){height=maxHeight;}else if(previous!=null&&questDockWrapperSpecs.get().height===getQuestDockExpandedHeightLimits(previous.windowHeight,previous.safeArea.top,minContentHeight).maxHeight){height=maxHeight;}else if(questDockWrapperSpecs.get().height>=heightMidpoint){height=maxHeight;}else{height=maxHeight;}questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:youBarHeight>0?youBarHeight:QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED,width:getQuestDockExpandedWidth(windowWidth,safeArea.left,safeArea.right),height:height});activeQuestDockMode.set(QuestDockMode.EXPANDED);break;}}'};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestDock/QuestDockHooks.tsx');
|
|
exports.useQuestDockModeAnimatedReaction = useQuestDockModeAnimatedReaction;
|
|
exports.useQuestDockExternalOffset = useQuestDockExternalOffset;
|
|
exports.useQuestDockDismissalReset = useQuestDockDismissalReset;
|
|
exports.useActionSheetPressHandler = useActionSheetPressHandler;
|
|
function useQuestDockModeAnimatedReaction() { // fn#103129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:3948, offset: 0x0225988b, size: 554 bytes, params: 1, frame: 29
|
|
let useContext = ReactModule.useContext;
|
|
const QuestDockGestureContext = (QuestDockGestureContextModule).QuestDockGestureContext;
|
|
const {questDockWrapperSpecs, windowDimensions, activeQuestDockMode,
|
|
minExpandedContentHeight} = Reflect.apply(useContext, ReactModule, [QuestDockGestureContext]);
|
|
useContext = ReactModule.useContext;
|
|
const QuestDockExternalCoordinationContext = (QuestDockExternalCoordinationContextModule).QuestDockExternalCoordinationContext;
|
|
const {restingQuestDockMode, setRestingQuestDockMode} = Reflect.apply(useContext, ReactModule,
|
|
[QuestDockExternalCoordinationContext]);
|
|
const value4 = (UseSafeAreaInsetsSharedValueNative)();
|
|
const value5 = useYouBarHorizontalMargin();
|
|
const value6 = (YouBarExperimentModule).useYouBarEnabled('QuestDock');
|
|
const value7 = useYouBarTotalHeight();
|
|
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
|
|
const useQuestDockModeAnimatedReactionO2 = useQuestDockModeAnimatedReactionO;
|
|
useQuestDockModeAnimatedReactionO2.__closure = {restingQuestDockMode: restingQuestDockMode,
|
|
minExpandedContentHeight: minExpandedContentHeight, windowDimensions: windowDimensions, safeArea: value4};
|
|
useQuestDockModeAnimatedReactionO2.__workletHash = 9502251090521;
|
|
useQuestDockModeAnimatedReactionO2.__initData = env0_19;
|
|
const useQuestDockModeAnimatedReactionT2 = useQuestDockModeAnimatedReactionT;
|
|
object = {};
|
|
object.cheapWorkletShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletShallowEqual;
|
|
object.QuestDockMode = QuestDockMode;
|
|
object.runOnJS = ReanimatedRexportModule.runOnJS;
|
|
object.setRestingQuestDockMode = setRestingQuestDockMode;
|
|
object.questDockWrapperSpecs = questDockWrapperSpecs;
|
|
object.youBarEnabled = value6;
|
|
object.QUEST_DOCK_VERTICAL_EDGE_GUTTER_COLLAPSED = QUEST_DOCK_VERTICAL_EDGE_GUTTER_COLLAPSED;
|
|
const getQuestDockCollapsedWidth = (QuestDockUtilsModule).getQuestDockCollapsedWidth;
|
|
object.getQuestDockCollapsedWidth = getQuestDockCollapsedWidth;
|
|
object.youBarHorizontalMargin = value5;
|
|
object.QUEST_DOCK_COLLAPSED_HEIGHT = QUEST_DOCK_COLLAPSED_HEIGHT;
|
|
object.activeQuestDockMode = activeQuestDockMode;
|
|
object.QUEST_DOCK_VERTICAL_EDGE_GUTTER_CLOSED = QUEST_DOCK_VERTICAL_EDGE_GUTTER_CLOSED;
|
|
const getQuestDockClosedWidth = (QuestDockUtilsModule).getQuestDockClosedWidth;
|
|
object.getQuestDockClosedWidth = getQuestDockClosedWidth;
|
|
object.QUEST_DOCK_CLOSED_HEIGHT = QUEST_DOCK_CLOSED_HEIGHT;
|
|
const getQuestDockExpandedHeightLimits = (QuestDockUtilsModule).getQuestDockExpandedHeightLimits;
|
|
object.getQuestDockExpandedHeightLimits = getQuestDockExpandedHeightLimits;
|
|
object.youBarHeight = value7;
|
|
object.QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED = QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED;
|
|
const getQuestDockExpandedWidth = (QuestDockUtilsModule).getQuestDockExpandedWidth;
|
|
object.getQuestDockExpandedWidth = getQuestDockExpandedWidth;
|
|
useQuestDockModeAnimatedReactionT2.__closure = object;
|
|
useQuestDockModeAnimatedReactionT2.__workletHash = 9030555854984;
|
|
useQuestDockModeAnimatedReactionT2.__initData = env0_20;
|
|
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [useQuestDockModeAnimatedReactionO2,
|
|
useQuestDockModeAnimatedReactionT2]);
|
|
function useQuestDockModeAnimatedReactionO() { // fn#103130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:4359, owner: useQuestDockModeAnimatedReaction.o, offset: 0x02259ab5, size: 103 bytes, params: 1, frame: 11
|
|
const object = {};
|
|
const restingQuestDockModeBinding = restingQuestDockMode;
|
|
let get = restingQuestDockModeBinding.get;
|
|
object.restingQuestDockMode = Reflect.apply(get, restingQuestDockModeBinding, []);
|
|
object.minExpandedContentHeight = minExpandedContentHeight.get();
|
|
const windowDimensionsBinding = windowDimensions;
|
|
get = windowDimensionsBinding.get;
|
|
object.windowWidth = Reflect.apply(get, windowDimensionsBinding, []).width;
|
|
get = windowDimensionsBinding.get;
|
|
object.windowHeight = Reflect.apply(get, windowDimensionsBinding, []).height;
|
|
object.safeArea = QuestConstantsModule.QuestDockMode.get();
|
|
return object;
|
|
}
|
|
|
|
function useQuestDockModeAnimatedReactionT(a0, a1) { // fn#103131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:4645, owner: useQuestDockModeAnimatedReaction.t, offset: 0x02259b1c, size: 979 bytes, params: 3, frame: 28
|
|
var r7;
|
|
var r11;
|
|
var moduleValue2;
|
|
var value4;
|
|
var maxHeight;
|
|
var questDockWrapperSpecsBinding;
|
|
var get;
|
|
var height;
|
|
var value6;
|
|
var value7;
|
|
var moduleValue3;
|
|
var set;
|
|
var object;
|
|
var value8;
|
|
var moduleValue4;
|
|
var getQuestDockClosedWidth;
|
|
var value11;
|
|
var moduleValue5;
|
|
var moduleValue6;
|
|
let value = a1;
|
|
const value3 = undefined;
|
|
const cheapWorkletShallowEqual = CheapWorkletShallowEqualModule.cheapWorkletShallowEqual;
|
|
let r2 = value ?? value3;
|
|
if (!Reflect.apply(cheapWorkletShallowEqual, CheapWorkletShallowEqualModule, [a0, r2])) {
|
|
var restingQuestDockMode = a0.restingQuestDockMode;
|
|
var minExpandedContentHeight = a0.minExpandedContentHeight;
|
|
var windowWidth = a0.windowWidth;
|
|
var windowHeight = a0.windowHeight;
|
|
var safeArea = a0.safeArea;
|
|
var RESET_TO_PREVIOUS = QuestDockMode.RESET_TO_PREVIOUS;
|
|
if (RESET_TO_PREVIOUS === restingQuestDockMode) {
|
|
moduleValue6 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
moduleValue6.runOnJS(setRestingQuestDockMode)((value == null ? value3 : value.restingQuestDockMode) ?? QuestDockMode.COLLAPSED);
|
|
return value3;
|
|
}
|
|
var COLLAPSED = QuestDockMode.COLLAPSED;
|
|
if (COLLAPSED === restingQuestDockMode) {
|
|
questDockWrapperSpecsBinding = questDockWrapperSpecs;
|
|
set = questDockWrapperSpecsBinding.set;
|
|
object = {};
|
|
copyDataProperties(object, questDockWrapperSpecsBinding.get(), undefined);
|
|
value11 = 0;
|
|
object['x'] = value11;
|
|
object['y'] = env0_8 ? value11 : -1 * QUEST_DOCK_VERTICAL_EDGE_GUTTER_COLLAPSED;
|
|
moduleValue5 = require(13571) /* metro dependency 13571: QuestDockUtils */;
|
|
object['width'] = moduleValue5.getQuestDockCollapsedWidth(windowWidth, env0_8 ? env0_7 : safeArea.left,
|
|
env0_8 ? env0_7 : safeArea.right);
|
|
object['height'] = QUEST_DOCK_COLLAPSED_HEIGHT;
|
|
Reflect.apply(set, questDockWrapperSpecsBinding, [object]);
|
|
activeQuestDockMode.set(QuestDockMode.COLLAPSED);
|
|
} else if (QuestDockMode.CLOSED === restingQuestDockMode) {
|
|
questDockWrapperSpecsBinding = questDockWrapperSpecs;
|
|
set = questDockWrapperSpecsBinding.set;
|
|
object = {};
|
|
copyDataProperties(object, questDockWrapperSpecsBinding.get(), undefined);
|
|
value8 = 0;
|
|
object['x'] = value8;
|
|
r11 = env0_8 ? value8 : -1 * QUEST_DOCK_VERTICAL_EDGE_GUTTER_CLOSED;
|
|
object['y'] = r11;
|
|
moduleValue4 = require(13571) /* metro dependency 13571: QuestDockUtils */;
|
|
getQuestDockClosedWidth = moduleValue4.getQuestDockClosedWidth;
|
|
r11 = env0_8 ? env0_7 : safeArea.left;
|
|
object['width'] = Reflect.apply(getQuestDockClosedWidth, moduleValue4, [windowWidth, r11,
|
|
env0_8 ? env0_7 : safeArea.right]);
|
|
object['height'] = QUEST_DOCK_CLOSED_HEIGHT;
|
|
Reflect.apply(set, questDockWrapperSpecsBinding, [object]);
|
|
activeQuestDockMode.set(restingQuestDockMode);
|
|
} else if (QuestDockMode.SOFT_DISMISSED === restingQuestDockMode) {
|
|
questDockWrapperSpecsBinding = questDockWrapperSpecs;
|
|
set = questDockWrapperSpecsBinding.set;
|
|
object = {};
|
|
copyDataProperties(object, questDockWrapperSpecsBinding.get(), undefined);
|
|
value8 = 0;
|
|
object['x'] = value8;
|
|
r11 = env0_8 ? value8 : -1 * QUEST_DOCK_VERTICAL_EDGE_GUTTER_CLOSED;
|
|
object['y'] = r11;
|
|
moduleValue4 = require(13571) /* metro dependency 13571: QuestDockUtils */;
|
|
getQuestDockClosedWidth = moduleValue4.getQuestDockClosedWidth;
|
|
r11 = env0_8 ? env0_7 : safeArea.left;
|
|
object['width'] = Reflect.apply(getQuestDockClosedWidth, moduleValue4, [windowWidth, r11,
|
|
env0_8 ? env0_7 : safeArea.right]);
|
|
object['height'] = QUEST_DOCK_CLOSED_HEIGHT;
|
|
Reflect.apply(set, questDockWrapperSpecsBinding, [object]);
|
|
activeQuestDockMode.set(restingQuestDockMode);
|
|
} else if (QuestDockMode.EXPANDED === restingQuestDockMode) {
|
|
moduleValue2 = require(13571) /* metro dependency 13571: QuestDockUtils */;
|
|
value4 = moduleValue2.getQuestDockExpandedHeightLimits(windowHeight, safeArea.top,
|
|
minExpandedContentHeight);
|
|
value4.minHeight;
|
|
maxHeight = value4.maxHeight;
|
|
questDockWrapperSpecsBinding = questDockWrapperSpecs;
|
|
get = questDockWrapperSpecsBinding.get;
|
|
height = Reflect.apply(get, questDockWrapperSpecsBinding, []).height;
|
|
value6 = height <= QUEST_DOCK_COLLAPSED_HEIGHT;
|
|
if (value6) {
|
|
r2 = value6;
|
|
} else {
|
|
value7 = value != null;
|
|
if (value7) {
|
|
questDockWrapperSpecsBinding = questDockWrapperSpecs;
|
|
height = questDockWrapperSpecsBinding.get().height;
|
|
moduleValue3 = require(13571) /* metro dependency 13571: QuestDockUtils */;
|
|
value = height === moduleValue3.getQuestDockExpandedHeightLimits(value.windowHeight,
|
|
value.safeArea.top,
|
|
minExpandedContentHeight).maxHeight;
|
|
r7 = value;
|
|
} else {
|
|
r7 = value7;
|
|
}
|
|
r2 = r7;
|
|
}
|
|
if (!r2) {
|
|
questDockWrapperSpecsBinding = questDockWrapperSpecs;
|
|
questDockWrapperSpecsBinding.get().height;
|
|
}
|
|
questDockWrapperSpecsBinding = questDockWrapperSpecs;
|
|
set = questDockWrapperSpecsBinding.set;
|
|
object = {};
|
|
get = questDockWrapperSpecsBinding.get;
|
|
copyDataProperties(object, Reflect.apply(get, questDockWrapperSpecsBinding, []), undefined);
|
|
object['x'] = 0;
|
|
object['y'] = env0_9 > 0 ? env0_9 : QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED;
|
|
value = require(13571) /* metro dependency 13571: QuestDockUtils */;
|
|
value = value.getQuestDockExpandedWidth(windowWidth, safeArea.left, safeArea.right);
|
|
object['width'] = value;
|
|
object['height'] = maxHeight;
|
|
Reflect.apply(set, questDockWrapperSpecsBinding, [object]);
|
|
activeQuestDockMode.set(QuestDockMode.EXPANDED);
|
|
}
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestDockExternalOffset() { // fn#103132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:6415, offset: 0x02259eef, size: 165 bytes, params: 1, frame: 18
|
|
const useStateFromStoresArray = FluxModule.useStateFromStoresArray;
|
|
const value3 = Module00057(Reflect.apply(useStateFromStoresArray, FluxModule, [[QuestDockStore], function() {
|
|
var questDockStoreBinding = QuestDockStore;
|
|
return [questDockStoreBinding.prevRestingQuestDockMode, questDockStoreBinding.isEligibleToBeVisible];
|
|
}]), 2);
|
|
return ReactModule.useMemo(_fun103134, [value3[1], value3[0],
|
|
(YouBarExperimentModule).useYouBarEnabled('QuestDock')]);
|
|
function _fun103134() { // fn#103134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:6637, offset: 0x02259fb5, size: 125 bytes, params: 1, frame: 4
|
|
var binding;
|
|
var value2;
|
|
if (env0_1) {
|
|
binding = env0_0;
|
|
value2 = environment.__proto__;
|
|
if (QuestDockMode.COLLAPSED === binding) {
|
|
return env0_2 ? QUEST_DOCK_EXTERNAL_OFFSET_COLLAPSED_WITH_YOU_BAR : QUEST_DOCK_EXTERNAL_OFFSET_COLLAPSED;
|
|
}
|
|
if (QuestDockMode.EXPANDED === binding) {
|
|
return env0_2 ? QUEST_DOCK_EXTERNAL_OFFSET_EXPANDED_WITH_YOU_BAR : QUEST_DOCK_EXTERNAL_OFFSET_EXPANDED;
|
|
}
|
|
if (QuestDockMode.CLOSED === binding) {
|
|
return QUEST_DOCK_EXTERNAL_OFFSET_CLOSED;
|
|
}
|
|
if (QuestDockMode.SOFT_DISMISSED === binding) {
|
|
return QUEST_DOCK_EXTERNAL_OFFSET_CLOSED;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
}
|
|
|
|
function useQuestDockDismissalReset() { // fn#103135, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:6830, offset: 0x0225a032, size: 129 bytes, params: 1, frame: 17
|
|
let useContext = ReactModule.useContext;
|
|
const QuestDockExternalCoordinationContext = (QuestDockExternalCoordinationContextModule).QuestDockExternalCoordinationContext;
|
|
const setRestingQuestDockMode = Reflect.apply(useContext, ReactModule,
|
|
[QuestDockExternalCoordinationContext]).setRestingQuestDockMode;
|
|
useContext = ReactModule.useContext;
|
|
const QuestDockGestureContext = (QuestDockGestureContextModule).QuestDockGestureContext;
|
|
ReactModule.useEffect(function() {
|
|
var closure = _fun103137;
|
|
closure();
|
|
var setInterval = global.setInterval;
|
|
var MINUTE = importDefault(dependencyMap[14]).Millis.MINUTE;
|
|
var env0_0 = setInterval(closure, 5 * MINUTE);
|
|
return _fun103138;
|
|
}, [setRestingQuestDockMode, Reflect.apply(useContext, ReactModule, [QuestDockGestureContext]).activeQuestDockMode]);
|
|
function _fun103136() { // fn#103136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:7038, offset: 0x0225a0b3, size: 84 bytes, params: 1, frame: 16
|
|
const closure = function() {
|
|
if (!(activeQuestDockMode.get() !== QuestDockMode.SOFT_DISMISSED || require(dependencyMap[12]).isSoftDismissed(QuestDockStore.questDockSoftDismissedAt))) {
|
|
setRestingQuestDockMode(QuestDockMode.COLLAPSED);
|
|
}
|
|
};
|
|
closure();
|
|
const setInterval = global.setInterval;
|
|
const Millis = (Durations).Millis;
|
|
const MINUTE = Millis.MINUTE;
|
|
const env0_0 = setInterval(closure, 5 * MINUTE);
|
|
return _fun103138;
|
|
function maybeResetSoftDismissal() { // fn#103137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:7043, offset: 0x0225a107, size: 107 bytes, params: 1, frame: 14
|
|
var r2;
|
|
var moduleValue;
|
|
const value2 = activeQuestDockMode.get();
|
|
const SOFT_DISMISSED = QuestDockMode.SOFT_DISMISSED;
|
|
const value4 = value2 !== SOFT_DISMISSED;
|
|
if (value4) {
|
|
r2 = value4;
|
|
} else {
|
|
moduleValue = require(13571) /* metro dependency 13571: QuestDockUtils */;
|
|
r2 = moduleValue.isSoftDismissed(QuestDockStore.questDockSoftDismissedAt);
|
|
}
|
|
if (!r2) {
|
|
setRestingQuestDockMode(QuestDockMode.COLLAPSED);
|
|
}
|
|
}
|
|
|
|
function _fun103138() { // fn#103138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:7275, offset: 0x01f6d8c0, size: 24 bytes, params: 1, frame: 11
|
|
global.clearInterval(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function useActionSheetPressHandler(a0) { // fn#103139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:7337, offset: 0x0225a172, size: 114 bytes, params: 2, frame: 17
|
|
const env0_0 = a0;
|
|
return ReactModule.useCallback(_fun103140, [a0,
|
|
(AnalyticsHooksModule).useTrackQuestContentClickedWithImpression(),
|
|
(ContentImpressionTrackerHooksModule).useQuestImpressionId()]);
|
|
function _fun103140() { // fn#103140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13759:7491, offset: 0x0225a1e4, size: 484 bytes, params: 1, frame: 20
|
|
var binding;
|
|
var object;
|
|
const QuestContent = require(dependencyMap[22]).QuestContent;
|
|
var QUEST_BAR_MOBILE;
|
|
const QuestContentCTA = require(dependencyMap[21]).QuestContentCTA;
|
|
var moduleValue2;
|
|
var captureAdUserAction;
|
|
let value = environment.__proto__;
|
|
const moduleValue = require(dependencyMap[17]);
|
|
const shouldMigrateToAdAnalyticsInterface = moduleValue.shouldMigrateToAdAnalyticsInterface;
|
|
const AdAnalyticsInterfaceExperimentStep = require(dependencyMap[17]).AdAnalyticsInterfaceExperimentStep;
|
|
const STEP_2_CLICKED_INTERNAL = AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL;
|
|
if (Reflect.apply(shouldMigrateToAdAnalyticsInterface, moduleValue, [STEP_2_CLICKED_INTERNAL,
|
|
'quest_dock_action_sheet'])) {
|
|
moduleValue2 = require(dependencyMap[18]);
|
|
captureAdUserAction = moduleValue2.captureAdUserAction;
|
|
object = {};
|
|
object.type = require(dependencyMap[19]).AdUserActionType.CLICK_INTERNAL;
|
|
object.adCreativeType = require(dependencyMap[20]).AdCreativeType.QUEST;
|
|
object.adCreativeId = env0_0.id;
|
|
object.questContentCTA = QuestContentCTA.OPEN_CONTEXT_MENU;
|
|
QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
object.surfaceId = QUEST_BAR_MOBILE;
|
|
QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
object.sourceQuestContent = QUEST_BAR_MOBILE;
|
|
object.impressionId = env0_2;
|
|
Reflect.apply(captureAdUserAction, moduleValue2, [object]);
|
|
} else {
|
|
binding = env0_1;
|
|
object = {};
|
|
object.questId = env0_0.id;
|
|
QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
object.questContent = QUEST_BAR_MOBILE;
|
|
object.questContentCTA = QuestContentCTA.OPEN_CONTEXT_MENU;
|
|
QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
object.sourceQuestContent = QUEST_BAR_MOBILE;
|
|
binding(object);
|
|
}
|
|
const defaultImport = importDefault(dependencyMap[23]);
|
|
const openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[25]);
|
|
value = value(dependencyMap[24], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport, [value, 'QuestDockContextMenuActionSheet', {quest: env0_0}]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun103128, 13569, [57, 31, 13570, 6528, 13572, 7553, 13573, 13576, 11281, 5176, 4017, 7739, 13571, 566,
|
|
672, 9949, 9513, 9519, 9517, 9518, 7121, 7120, 6531, 4080, 13577, 1962,
|
|
2]) /* metro module 13569, dependencies: [57, 31, 13570, 6528, 13572, 7553, 13573, 13576, 11281, 5176, 4017, 7739, 13571, 566, 672, 9949, 9513, 9519, 9517, 9518, 7121, 7120, 6531, 4080, 13577, 1962, 2] */;
|