/* Metro module 14282; source: modules/devtools/native/components/DevWidget.tsx; dependencies: [31, 7111, 695, 33, 4501, 697, 4017, 11281, 14283, 5321, 4577, 4581, 5278, 13121, 13969, 14284, 13126, 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 DevToolsSettingsStore from '../../DevToolsSettingsStore.tsx'; /* Metro dependency 7111 */
import UseSafeAreaInsetsSharedValueNative from '../../../safe_area/useSafeAreaInsetsSharedValue.native.tsx'; /* Metro dependency 11281 */
import UseWindowDimensionsSharedValueNative from '../../../screen/useWindowDimensionsSharedValue.native.tsx'; /* Metro dependency 14283 */
import VEVOO from '../../../visual_effect_view/native/overrides/VEVOO.tsx'; /* Metro dependency 14284 */
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 JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 695 */
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 SpringPresetsModule from '../../../../design/animation/reanimated/spring/springPresets.tsx'; /* Metro dependency 4581 */
import * as PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as Module05321Module from '../../../../by-id/module-05321.js'; /* Metro dependency 5321 */
import * as DevToolsNavigatorModule from './DevToolsNavigator.tsx'; /* Metro dependency 13121 */
import * as DevToolsActionCreatorsModule from '../../DevToolsActionCreators.tsx'; /* Metro dependency 13126 */
import * as StaffBadgeIconModule from '../../../../design/components/Icon/native/redesign/generated/StaffBadgeIcon.tsx'; /* Metro dependency 13969 */
function _fun108017(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:6, offset: 0x02311eb6, size: 462 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const DEV_WIDGET_SIZE = (ConstantsModule).DEV_WIDGET_SIZE;
const createStyles = CreateStylesModule.createStyles;
const object3 = {'backgroundColor': null, 'justifyContent': 'center', 'alignItems': 'center'};
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object3.backgroundColor = BACKGROUND_BRAND;
object3.height = DEV_WIDGET_SIZE;
object3.width = DEV_WIDGET_SIZE;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
const SHADOW_MOBILE_NAVIGATOR_X = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_MOBILE_NAVIGATOR_X;
copyDataProperties(object3, SHADOW_MOBILE_NAVIGATOR_X, undefined);
const env0_9 = Reflect.apply(createStyles, CreateStylesModule, [{widgetContainer: {position: 'absolute'},
widget: object3}]);
object = {code: 'function DevWidgetTsx1(x,y){const{windowDimensionsSharedValue,insetsSharedValue,clamp,dragBoundsPadding,contentWidth,contentHeight}=this.__closure;const{width:windowWidth,height:windowHeight}=windowDimensionsSharedValue.get();const insets=insetsSharedValue.get();return{x:clamp(x,insets.left+dragBoundsPadding,windowWidth-insets.right-contentWidth-dragBoundsPadding),y:clamp(y,insets.top+dragBoundsPadding,windowHeight-insets.bottom-contentHeight-dragBoundsPadding)};}'};
object = {code: 'function DevWidgetTsx2(){const{runOnJS,onChangePosition,x,y}=this.__closure;runOnJS(onChangePosition)({x:x.get(),y:y.get()});}'};
object = {code: 'function DevWidgetTsx3(event){const{getClampedPosition,originalX,originalY,x,y}=this.__closure;const{x:xClamped,y:yClamped}=getClampedPosition(originalX.get()+event.translationX,originalY.get()+event.translationY);x.set(xClamped);y.set(yClamped);}'};
object = {code: 'function DevWidgetTsx4(){const{originalX,x,originalY,y}=this.__closure;originalX.set(x.get());originalY.set(y.get());}'};
object = {code: 'function DevWidgetTsx5(){const{getClampedPosition,x,y,withSpring,springUnclamped}=this.__closure;const{x:translateX,y:translateY}=getClampedPosition(x.get(),y.get());return{transform:[{translateX:withSpring(translateX,springUnclamped)},{translateY:withSpring(translateY,springUnclamped)}]};}'};
const env0_16 = ReactModule.memo(_fun108024);
(FileImportTrackerModule).fileFinishedImporting('modules/devtools/native/components/DevWidget.tsx');
exports.default = DevWidget;
function DraggableContainer({x, y, contentWidth, contentHeight, dragBoundsPadding, onChangePosition, children}) { // fn#108018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:1768, offset: 0x02312084, size: 817 bytes, params: 2, frame: 33
const contentHeight2 = contentHeight;
dragBoundsPadding = dragBoundsPadding === undefined ? 0 : dragBoundsPadding;
const styles = useStyles();
let useSharedValue = ReanimatedRexportModule.useSharedValue;
let get = x.get;
const value2 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [Reflect.apply(get, x, [])]);
useSharedValue = ReanimatedRexportModule.useSharedValue;
get = y.get;
const value3 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [Reflect.apply(get, y, [])]);
const value4 = (UseSafeAreaInsetsSharedValueNative)();
const value5 = (UseWindowDimensionsSharedValueNative)();
const binding = contentHeight2;
const useCallback = binding.useCallback;
let closure = DraggableContainerP;
let object = {windowDimensionsSharedValue: value5, insetsSharedValue: value4};
object.clamp = ReanimatedRexportModule.clamp;
object.dragBoundsPadding = dragBoundsPadding;
object.contentWidth = contentWidth;
object.contentHeight = contentHeight;
closure.__closure = object;
closure.__workletHash = 729779775192;
closure.__initData = undefined;
const value6 = Reflect.apply(useCallback, binding, [closure, [contentHeight, contentWidth, dragBoundsPadding,
value4, value5]]);
const Gesture = (Module05321Module).Gesture;
const value7 = Gesture.Pan();
const onStart = value7.onStart;
closure = DraggableContainerC;
closure.__closure = {originalX: value2, x: x, originalY: value3, y: y};
closure.__workletHash = 7165614533762;
closure.__initData = env0_13;
const value8 = Reflect.apply(onStart, value7, [closure]);
const onUpdate = value8.onUpdate;
closure = DraggableContainerD;
closure.__closure = {getClampedPosition: value6, originalX: value2, originalY: value3, x: x, y: y};
closure.__workletHash = 10056531764801;
closure.__initData = env0_12;
const value9 = Reflect.apply(onUpdate, value8, [closure]);
const onEnd = value9.onEnd;
closure = DraggableContainerF;
closure.__closure = {runOnJS: ReanimatedRexportModule.runOnJS, onChangePosition: onChangePosition, x: x, y: y};
closure.__workletHash = 12890758993684;
closure.__initData = env0_11;
const value10 = Reflect.apply(onEnd, value9, [closure]);
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = DraggableContainerW;
object = {getClampedPosition: value6, x: x, y: y};
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object.springUnclamped = (require(4581) /* metro dependency 4581: springPresets */).springUnclamped;
closure.__closure = object;
closure.__workletHash = 6251354551691;
closure.__initData = env0_14;
const value11 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const GestureDetector = (Module05321Module).GestureDetector;
const View = (ReanimatedRexport).View;
return (
{children}
);
function DraggableContainerP(a0, a1) { // fn#108019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:1996, owner: DraggableContainer.P, offset: 0x023123b5, size: 181 bytes, params: 3, frame: 24
const {width, height} = env0_9.get();
const value3 = JsxRuntimeModule.jsxs.get();
const object = {};
const clamp = ReanimatedRexportModule.clamp;
const left = value3.left;
const dragBoundsPaddingBinding = dragBoundsPadding;
object.x = Reflect.apply(clamp, ReanimatedRexportModule, [a0, left + dragBoundsPaddingBinding,
width - value3.right - contentWidth - dragBoundsPaddingBinding]);
object.y = ReanimatedRexportModule.clamp(a1, value3.top + dragBoundsPaddingBinding,
height - value3.bottom - contentHeight - dragBoundsPaddingBinding);
return object;
}
function DraggableContainerC() { // fn#108020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:2378, owner: DraggableContainer.C, offset: 0x0231246a, size: 61 bytes, params: 1, frame: 13
let binding = JsxRuntimeModule.jsx;
let set = binding.set;
const xBinding = x;
let get = xBinding.get;
Reflect.apply(set, binding, [Reflect.apply(get, xBinding, [])]);
binding = JsxRuntimeModule.Fragment;
set = binding.set;
const yBinding = y;
get = yBinding.get;
Reflect.apply(set, binding, [Reflect.apply(get, yBinding, [])]);
}
function DraggableContainerD({translationX, translationY}) { // fn#108021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:2527, owner: DraggableContainer.D, offset: 0x023124a7, size: 104 bytes, params: 2, frame: 15
const value5 = env0_10(JsxRuntimeModule.jsx.get() + translationX, JsxRuntimeModule.Fragment.get() + translationY);
const x2 = value5.x;
const y2 = value5.y;
x.set(x2);
y.set(y2);
}
function DraggableContainerF() { // fn#108022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:2751, owner: DraggableContainer.f, offset: 0x0231250f, size: 85 bytes, params: 1, frame: 14
let value = environment.__proto__;
value = Reflect.apply((require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS, value,
[onChangePosition]);
const object = {};
object.x = x.get();
object.y = y.get();
value(object);
}
function DraggableContainerW() { // fn#108023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:2949, owner: DraggableContainer.W, offset: 0x02312564, size: 172 bytes, params: 1, frame: 21
const binding = env0_10;
const value2 = x.get();
let value = y.get();
value = binding(value2, value);
const x2 = value.x;
const y2 = value.y;
value = environment.__proto__;
value = require(4577) /* metro dependency 4577: spring */;
const withSpring = value.withSpring;
const springUnclamped = (SpringPresetsModule).springUnclamped;
const items2 = [{translateX: Reflect.apply(withSpring, value, [x2, springUnclamped])}];
const object2 = {};
object2.translateY = (require(4577) /* metro dependency 4577: spring */).withSpring(y2, springUnclamped);
items2[1] = object2;
return {transform: items2};
}
}
function _fun108024() { // fn#108024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:3426, offset: 0x02312610, size: 141 bytes, params: 1, frame: 16
const styles = useStyles();
const PressableOpacity = (PressablesModule).PressableOpacity;
const pressableOpacityProps = {style: styles.widget, accessibilityRole: 'button', onPress: onPress_108025,
activeOpacity: 0.5};
const StaffBadgeIcon = (StaffBadgeIconModule).StaffBadgeIcon;
return (
);
function onPress_108025() { // fn#108025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:3533, offset: 0x0231269d, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (DevToolsNavigatorModule).navigateToDevTools();
}
}
function DevWidget() { // fn#108026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:3744, offset: 0x023126c2, size: 244 bytes, params: 1, frame: 22
const useSharedValue = ReanimatedRexportModule.useSharedValue;
const devToolsSettingsStoreBinding = DevToolsSettingsStore;
const value2 = Reflect.apply(useSharedValue, ReanimatedRexportModule,
[devToolsSettingsStoreBinding.devWidgetPosition.x]);
const value3 = ReanimatedRexportModule.useSharedValue(devToolsSettingsStoreBinding.devWidgetPosition.y);
const jsxRuntimeEnv0_7Binding = jsxRuntimeEnv0_7;
const value4 = ((Component) => )(VEVOO);
const PX_4 = (Native).space.PX_4;
return (
<>
{value4}
{((Component) => )(env0_16)}
>
);
function onChangePosition(a0) { // fn#108027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14479:4024, owner: DevWidget.onChangePosition, offset: 0x023127b6, size: 48 bytes, params: 2, frame: 12
const value = environment.__proto__;
return (DevToolsActionCreatorsModule).updateDevToolsSettings({devWidgetPosition: a0});
}
}
}
global.__d(_fun108017, 14282, [31, 7111, 695, 33, 4501, 697, 4017, 11281, 14283, 5321, 4577, 4581, 5278, 13121,
13969, 14284, 13126,
2]) /* metro module 14282, dependencies: [31, 7111, 695, 33, 4501, 697, 4017, 11281, 14283, 5321, 4577, 4581, 5278, 13121, 13969, 14284, 13126, 2] */;