156 lines
10 KiB
TypeScript
156 lines
10 KiB
TypeScript
/* Metro module 13571; source: modules/quests/native/QuestDock/QuestDockUtils.tsx; dependencies: [27, 13572, 672, 4577, 2] */
|
|
import Durations from '../../../../utils/Durations.tsx'; /* Metro dependency 672 */
|
|
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 QuestDockConstantsModule from './QuestDockConstants.tsx'; /* Metro dependency 13572 */
|
|
|
|
function _fun103155(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#103155, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:6, offset: 0x0225a722, size: 414 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const PixelRatio = (ReactNativeModule).PixelRatio;
|
|
let value = QuestDockConstantsModule;
|
|
const env0_2 = value.QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED;
|
|
const env0_3 = value.QUEST_DOCK_COLLAPSED_MAX_WIDTH;
|
|
const env0_4 = value.QUEST_DOCK_COLLAPSED_HEIGHT;
|
|
const env0_5 = value.QUEST_DOCK_MODE_CHANGE_PHYSICS;
|
|
const env0_6 = PixelRatio.get();
|
|
object = {code: 'function roundToNearestPixel_QuestDockUtilsTsx1(position){const{PIXEL_DENSITY}=this.__closure;return Math.round(position*PIXEL_DENSITY)/PIXEL_DENSITY;}'};
|
|
value = _fun103156();
|
|
object = {code: 'function getQuestDockExpandedHeightLimits_QuestDockUtilsTsx2(windowHeight,safeAreaTop,minContentHeight){const{QUEST_DOCK_COLLAPSED_HEIGHT}=this.__closure;return{minHeight:QUEST_DOCK_COLLAPSED_HEIGHT,maxHeight:Math.min(minContentHeight,windowHeight-safeAreaTop)};}'};
|
|
const value2 = _fun103158();
|
|
object = {code: 'function getQuestDockCollapsedWidth_QuestDockUtilsTsx3(windowWidth,safeAreaLeft,safeAreaRight){const{QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED,QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;safeAreaLeft=Math.max(safeAreaLeft,QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED);safeAreaRight=Math.max(safeAreaRight,QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED);return Math.min(windowWidth-safeAreaLeft-safeAreaRight,QUEST_DOCK_COLLAPSED_MAX_WIDTH);}'};
|
|
const value3 = _fun103160();
|
|
object = {code: 'function getQuestDockExpandedWidth_QuestDockUtilsTsx4(windowWidth,safeAreaLeft,safeAreaRight){const{QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;return Math.min(windowWidth-safeAreaLeft-safeAreaRight,QUEST_DOCK_COLLAPSED_MAX_WIDTH);}'};
|
|
const value4 = _fun103162();
|
|
object = {code: 'function getQuestDockClosedWidth_QuestDockUtilsTsx5(windowWidth,safeAreaLeft,safeAreaRight){const{QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;return Math.min(windowWidth-safeAreaLeft-safeAreaRight,QUEST_DOCK_COLLAPSED_MAX_WIDTH);}'};
|
|
const value5 = _fun103164();
|
|
const Millis = (Durations).Millis;
|
|
const HOUR = Millis.HOUR;
|
|
const env0_12 = 3 * HOUR;
|
|
object = {code: 'function dimensionsLayoutTransition_QuestDockUtilsTsx6(values){const{withSpring,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{initialValues:{originX:values.currentOriginX,originY:values.currentOriginY,width:values.currentWidth,height:values.currentHeight},animations:{originX:withSpring(values.targetOriginX,QUEST_DOCK_MODE_CHANGE_PHYSICS),originY:withSpring(values.targetOriginY,QUEST_DOCK_MODE_CHANGE_PHYSICS),height:withSpring(values.targetHeight,QUEST_DOCK_MODE_CHANGE_PHYSICS),width:withSpring(values.targetWidth,QUEST_DOCK_MODE_CHANGE_PHYSICS)}};}'};
|
|
const value6 = _fun103166();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestDock/QuestDockUtils.tsx');
|
|
exports.roundToNearestPixel = value;
|
|
exports.getQuestDockExpandedHeightLimits = value2;
|
|
exports.getQuestDockCollapsedWidth = value3;
|
|
exports.getQuestDockExpandedWidth = value4;
|
|
exports.getQuestDockClosedWidth = value5;
|
|
exports.isSoftDismissed = isSoftDismissed;
|
|
exports.dimensionsLayoutTransition = value6;
|
|
function _fun103156() { // fn#103156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:452, offset: 0x0225a8c0, size: 57 bytes, params: 1, frame: 4
|
|
const roundToNearestPixel2 = roundToNearestPixel;
|
|
roundToNearestPixel2.__closure = {PIXEL_DENSITY: env0_6};
|
|
roundToNearestPixel2.__workletHash = 9602449563120;
|
|
roundToNearestPixel2.__initData = env0_7;
|
|
return roundToNearestPixel2;
|
|
function roundToNearestPixel(a0) { // fn#103157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:487, offset: 0x0225a8f9, size: 38 bytes, params: 2, frame: 12
|
|
const Math = global.Math;
|
|
const round = Math.round;
|
|
const binding = env1_6;
|
|
return Reflect.apply(round, Math, [a0 * binding]) / binding;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun103158() { // fn#103158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:961, offset: 0x0225a91f, size: 57 bytes, params: 1, frame: 4
|
|
const closure = function(a0, a1, a2) {
|
|
var object = {};
|
|
object.minHeight = QUEST_DOCK_COLLAPSED_HEIGHT;
|
|
var Math = global.Math;
|
|
object.maxHeight = Math.min(a2, a0 - a1);
|
|
return object;
|
|
};
|
|
closure.__closure = {QUEST_DOCK_COLLAPSED_HEIGHT: QUEST_DOCK_COLLAPSED_HEIGHT};
|
|
closure.__workletHash = 880847803554;
|
|
closure.__initData = env0_8;
|
|
return closure;
|
|
}
|
|
|
|
function _fun103160() { // fn#103160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:1752, offset: 0x0225a98d, size: 66 bytes, params: 1, frame: 4
|
|
const closure = function(a0, a1, a2) {
|
|
var Math = global.Math;
|
|
var value2 = Math.max(a1, QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED);
|
|
Math = global.Math;
|
|
var value3 = Math.max(a2, QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED);
|
|
Math = global.Math;
|
|
return Math.min(a0 - value2 - value3, QUEST_DOCK_COLLAPSED_MAX_WIDTH);
|
|
};
|
|
closure.__closure = {QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED: QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED,
|
|
QUEST_DOCK_COLLAPSED_MAX_WIDTH: QUEST_DOCK_COLLAPSED_MAX_WIDTH};
|
|
closure.__workletHash = 1119343760780;
|
|
closure.__initData = env0_9;
|
|
return closure;
|
|
}
|
|
|
|
function _fun103162() { // fn#103162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:2367, offset: 0x0225aa22, size: 57 bytes, params: 1, frame: 4
|
|
const closure = function(a0, a1, a2) {
|
|
var Math = global.Math;
|
|
return Math.min(a0 - a1 - a2, QUEST_DOCK_COLLAPSED_MAX_WIDTH);
|
|
};
|
|
closure.__closure = {QUEST_DOCK_COLLAPSED_MAX_WIDTH: QUEST_DOCK_COLLAPSED_MAX_WIDTH};
|
|
closure.__workletHash = 6480418564130;
|
|
closure.__initData = env0_10;
|
|
return closure;
|
|
}
|
|
|
|
function _fun103164() { // fn#103164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:2897, offset: 0x0225aa88, size: 57 bytes, params: 1, frame: 4
|
|
const closure = function(a0, a1, a2) {
|
|
var Math = global.Math;
|
|
return Math.min(a0 - a1 - a2, QUEST_DOCK_COLLAPSED_MAX_WIDTH);
|
|
};
|
|
closure.__closure = {QUEST_DOCK_COLLAPSED_MAX_WIDTH: QUEST_DOCK_COLLAPSED_MAX_WIDTH};
|
|
closure.__workletHash = 14159592925974;
|
|
closure.__initData = env0_11;
|
|
return closure;
|
|
}
|
|
|
|
function _fun103166() { // fn#103166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:3773, offset: 0x0225aac1, size: 88 bytes, params: 1, frame: 14
|
|
const dimensionsLayoutTransition2 = dimensionsLayoutTransition;
|
|
const object = {};
|
|
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
|
|
object.QUEST_DOCK_MODE_CHANGE_PHYSICS = QUEST_DOCK_MODE_CHANGE_PHYSICS;
|
|
dimensionsLayoutTransition2.__closure = object;
|
|
dimensionsLayoutTransition2.__workletHash = 4497154070776;
|
|
dimensionsLayoutTransition2.__initData = env0_13;
|
|
return dimensionsLayoutTransition2;
|
|
function dimensionsLayoutTransition({currentOriginX, currentOriginY, currentWidth, currentHeight, targetOriginX, targetOriginY, targetHeight, targetWidth}) { // fn#103167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:3815, offset: 0x0225ab19, size: 205 bytes, params: 2, frame: 20
|
|
const object = {};
|
|
object.initialValues = {originX: currentOriginX, originY: currentOriginY, width: currentWidth,
|
|
height: currentHeight};
|
|
const object3 = {};
|
|
const value = environment.__proto__;
|
|
object3.originX = (require(4577) /* metro dependency 4577: spring */).withSpring(targetOriginX,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS);
|
|
object3.originY = (require(4577) /* metro dependency 4577: spring */).withSpring(targetOriginY,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS);
|
|
object3.height = (require(4577) /* metro dependency 4577: spring */).withSpring(targetHeight,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS);
|
|
object3.width = (require(4577) /* metro dependency 4577: spring */).withSpring(targetWidth,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS);
|
|
object.animations = object3;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function isSoftDismissed(a0) { // fn#103168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13761:4623, offset: 0x0225abe6, size: 46 bytes, params: 2, frame: 11
|
|
var r0;
|
|
var Date;
|
|
let value = a0 != null;
|
|
if (value) {
|
|
Date = global.Date;
|
|
value = Date.now() - a0;
|
|
value = value < env0_12;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun103155, 13571, [27, 13572, 672, 4577,
|
|
2]) /* metro module 13571, dependencies: [27, 13572, 672, 4577, 2] */;
|