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

694 lines
41 KiB
TypeScript

/* Metro module 8861; source: design/components/SegmentedControl/native/SegmentedControlPages.native.tsx; dependencies: [57, 31, 27, 33, 4017, 8862, 477, 5321, 4521, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import ReanimatedRexport from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
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 PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as FreezeModule from '../../../../by-id/module-04521-Freeze.jsx'; /* Metro dependency 4521 */
function _fun69083(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:6, offset: 0x01c67e56, size: 534 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const ScrollView = (ReactNativeModule).ScrollView;
const env0_6 = (ReanimatedRexport).createAnimatedComponent(ScrollView);
object = {code: 'function SegmentedControlPagesNativeTsx1(){const{activeIndex}=this.__closure;return activeIndex.get();}'};
object = {code: 'function SegmentedControlPagesNativeTsx2(value){const{runOnJS,updateCurrentActiveIndex}=this.__closure;runOnJS(updateCurrentActiveIndex)(value);}'};
object = {code: 'function SegmentedControlPagesNativeTsx3(){const{pageIndex}=this.__closure;return pageIndex.get();}'};
object = {code: 'function SegmentedControlPagesNativeTsx4(value){const{activeIndex}=this.__closure;activeIndex.set(value);}'};
object = {code: 'function SegmentedControlPagesNativeTsx5(contentOffset,contentSize){const{pageWidth,pageIndex,roundIfClose,reportedPageIndex,runOnJS,onPageChanged}=this.__closure;if(pageWidth===0){return;}pageIndex.set(Math.min(Math.max(roundIfClose(contentOffset.x/pageWidth,1e-4),0),roundIfClose(contentSize.width/pageWidth,1e-4)-1));const pageFullyVisible=pageIndex.get()%1===0;if(pageFullyVisible&&reportedPageIndex.get()!==pageIndex.get()){reportedPageIndex.set(pageIndex.get());runOnJS(onPageChanged)(pageIndex.get());}}'};
object = {code: 'function SegmentedControlPagesNativeTsx6(event){const{onBeginDragWorklet}=this.__closure;var _onBeginDragWorklet;(_onBeginDragWorklet=onBeginDragWorklet)===null||_onBeginDragWorklet===void 0||_onBeginDragWorklet(event);}'};
object = {code: 'function SegmentedControlPagesNativeTsx7(event){const{onEndDragWorklet}=this.__closure;var _onEndDragWorklet;(_onEndDragWorklet=onEndDragWorklet)===null||_onEndDragWorklet===void 0||_onEndDragWorklet(event);}'};
object = {code: 'function SegmentedControlPagesNativeTsx8({contentOffset:contentOffset,contentSize:contentSize}){const{scrollTarget,roundIfClose,runOnJS,refreshScrollOffset,resolvePageIndex}=this.__closure;if(scrollTarget.get()!==-1){const hasReachedTarget=roundIfClose(contentOffset.x-scrollTarget.get(),1e-4)===0;if(hasReachedTarget){scrollTarget.set(-1);}else{const page=scrollTarget.get();runOnJS(refreshScrollOffset)(page);}}resolvePageIndex(contentOffset,contentSize);}'};
object = {code: 'function SegmentedControlPagesNativeTsx9(event){const{lastScrollOffsetX,onScrollWorklet,itemCount,pageWidth,activeIndex,runOnJS,refreshScrollOffset,scrollOverflow,scrollTarget,roundIfClose,resolvePageIndex}=this.__closure;var _onScrollWorklet;const{contentOffset:contentOffset,contentSize:contentSize}=event;if(contentSize.width===0){return;}if(lastScrollOffsetX.get()===contentOffset.x){return;}lastScrollOffsetX.set(contentOffset.x);(_onScrollWorklet=onScrollWorklet)===null||_onScrollWorklet===void 0||_onScrollWorklet(event);const expectedContentSize=itemCount*pageWidth;if(Math.round(expectedContentSize)%Math.round(contentSize.width)!==0){const page=activeIndex.get()*pageWidth;runOnJS(refreshScrollOffset)(page);return;}if(contentOffset.x<0){scrollOverflow.set(contentOffset.x);}else if(contentOffset.x>contentSize.width-pageWidth){scrollOverflow.set(contentOffset.x-(contentSize.width-pageWidth));}else{scrollOverflow.set(0);}if(scrollTarget.get()!==-1){const hasReachedTarget=roundIfClose(contentOffset.x-scrollTarget.get(),1e-4)===0;if(hasReachedTarget){scrollTarget.set(-1);}else{return;}}resolvePageIndex(contentOffset,contentSize);}'};
object = {code: 'function SegmentedControlPagesNativeTsx10(){const{scrollTarget,roundIfClose,pageWidth}=this.__closure;if(scrollTarget.get()===-1){return-1;}return roundIfClose(scrollTarget.get()/pageWidth,1e-4);}'};
object = {code: 'function SegmentedControlPagesNativeTsx11(){const{pageIndex,scrollTargetPageIndex}=this.__closure;const idx=pageIndex.get();let lo=Math.floor(idx);let hi=Math.ceil(idx);const target=scrollTargetPageIndex.get();if(target!==-1){lo=Math.min(lo,target);hi=Math.max(hi,target);}return[lo,hi];}'};
object = {code: 'function SegmentedControlPagesNativeTsx12(range,prev){const{visiblePageRange}=this.__closure;if(prev==null||prev[0]!==range[0]||prev[1]!==range[1]){visiblePageRange.set(range);}}'};
object = {code: 'function SegmentedControlPagesNativeTsx13(){const{pageIndex,index,scrollTargetPageIndex}=this.__closure;if(Math.floor(pageIndex.get())===index||Math.ceil(pageIndex.get())===index){return true;}if(scrollTargetPageIndex.get()===index){return true;}return false;}'};
object = {code: "function SegmentedControlPagesNativeTsx14(){const{reportedPageIndex,index}=this.__closure;const isHidden=reportedPageIndex.get()!==index;return{pointerEvents:isHidden?'none':'box-none',importantForAccessibility:isHidden?'no-hide-descendants':'auto',accessibilityElementsHidden:isHidden};}"};
object = {code: "function SegmentedControlPagesNativeTsx15(){const{isVisibleOnScreen}=this.__closure;return{display:isVisibleOnScreen.get()?'flex':'none',flex:1};}"};
object = {code: 'function SegmentedControlPagesNativeTsx16(){const{activePageRangeStart,activePageRangeEnd}=this.__closure;return[activePageRangeStart.get(),activePageRangeEnd.get()];}'};
object = {code: 'function SegmentedControlPagesNativeTsx17([start,end]){const{index,runOnJS,setFreeze}=this.__closure;const isInActiveRange=index>=start&&index<=end;runOnJS(setFreeze)(!isInActiveRange);}'};
object = {code: 'function SegmentedControlPagesNativeTsx18(min,max){const{activePageRangeStart,activePageRangeEnd}=this.__closure;activePageRangeStart.set(Math.min(activePageRangeStart.get(),min));activePageRangeEnd.set(Math.max(activePageRangeEnd.get(),max));}'};
object = {code: 'function SegmentedControlPagesNativeTsx19(){const{activeIndex,pressedIndex}=this.__closure;return{activeIndex:activeIndex.get(),pressedIndex:pressedIndex.get()};}'};
object = {code: 'function SegmentedControlPagesNativeTsx20({activeIndex:activeIndex,pressedIndex:pressedIndex}){const{expandActivePageRange}=this.__closure;let min=activeIndex;let max=activeIndex;if(pressedIndex!==-1){min=Math.min(activeIndex,pressedIndex);max=Math.max(activeIndex,pressedIndex);}expandActivePageRange(Math.floor(min),Math.ceil(max));}'};
(FileImportTrackerModule).fileFinishedImporting('design/components/SegmentedControl/native/SegmentedControlPages.native.tsx');
exports.SegmentedControlPages = SegmentedControlPages;
function SegmentedControlPage(a0) { // fn#69084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5099, offset: 0x01c6806c, size: 668 bytes, params: 2, frame: 29
const reportedPageIndex = a0.reportedPageIndex;
const pageIndex = a0.pageIndex;
const scrollTargetPageIndex = a0.scrollTargetPageIndex;
const index = a0.index;
const index2 = index;
const item = a0.item;
const activePageRangeStart = a0.activePageRangeStart;
const activePageRangeStart2 = activePageRangeStart;
const activePageRangeEnd = a0.activePageRangeEnd;
const object = {'reportedPageIndex': 0, 'pageIndex': 0, 'scrollTargetPageIndex': 0, 'index': 0, 'item': 0,
'activePageRangeStart': 0, 'activePageRangeEnd': 0};
silentSetPrototypeOf(object, null, undefined);
const value = copyDataProperties({}, a0, object, activePageRangeStart);
const useDerivedValue = ReanimatedRexportModule.useDerivedValue;
let closure = SegmentedControlPageV;
closure.__closure = {pageIndex: pageIndex, index: index, scrollTargetPageIndex: scrollTargetPageIndex};
closure.__workletHash = 6181538518841;
closure.__initData = env0_19;
const value3 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
const useAnimatedProps = ReanimatedRexportModule.useAnimatedProps;
closure = SegmentedControlPageS;
closure.__closure = {reportedPageIndex: reportedPageIndex, index: index};
closure.__workletHash = 7759188305092;
closure.__initData = env0_20;
const value4 = Reflect.apply(useAnimatedProps, ReanimatedRexportModule, [closure]);
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = SegmentedControlPageI;
closure.__closure = {isVisibleOnScreen: value3};
closure.__workletHash = 7012147409415;
closure.__initData = env0_21;
const value5 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const [property, property2] = index2(activePageRangeStart2.useState(_fun69088), 2);
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = function() {
var items = [activePageRangeStart.get()];
items[1] = activePageRangeEnd.get();
return items;
};
closure.__closure = {activePageRangeStart: activePageRangeStart, activePageRangeEnd: activePageRangeEnd};
closure.__workletHash = 16149977006261;
closure.__initData = env0_22;
const SegmentedControlPageP_690902 = SegmentedControlPageP_69090;
const object4 = {index: index};
object4.runOnJS = ReanimatedRexportModule.runOnJS;
object4.setFreeze = property2;
SegmentedControlPageP_690902.__closure = object4;
SegmentedControlPageP_690902.__workletHash = 11164856499724;
SegmentedControlPageP_690902.__initData = env0_23;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, SegmentedControlPageP_690902]);
const View = (ReanimatedRexport).View;
const viewProps = {...value};
viewProps['animatedProps'] = value4;
const Freeze = (FreezeModule).Freeze;
const View2 = (ReanimatedRexport).View;
return (
<View {...viewProps} key={index}>
<Freeze freeze={property}>
<View2 style={value5}>
{item.page}
</View2>
</Freeze>
</View>
);
function SegmentedControlPageV() { // fn#69085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5296, owner: SegmentedControlPage.v, offset: 0x01c68308, size: 110 bytes, params: 1, frame: 14
const Math = global.Math;
const floor = Math.floor;
const pageIndexBinding = pageIndex;
const get = pageIndexBinding.get;
let r0 = Reflect.apply(floor, Math, [Reflect.apply(get, pageIndexBinding,
[])]) === index || global.Math.ceil(pageIndex.get()) === index;
r0 = !r0 ? scrollTargetPageIndex.get() === index : r0;
return r0;
}
function SegmentedControlPageS() { // fn#69086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5513, owner: SegmentedControlPage.S, offset: 0x01c68376, size: 69 bytes, params: 1, frame: 11
const value = reportedPageIndex.get() !== index;
return {pointerEvents: value ? 'none' : 'box-none',
importantForAccessibility: value ? 'no-hide-descendants' : 'auto', accessibilityElementsHidden: value};
}
function SegmentedControlPageI() { // fn#69087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5793, owner: SegmentedControlPage.I, offset: 0x01c683bb, size: 43 bytes, params: 1, frame: 10
const object = {};
object.display = env0_6.get() ? 'flex' : 'none';
object.flex = 1;
return object;
}
function _fun69088() { // fn#69088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5946, offset: 0x01c683e6, size: 53 bytes, params: 1, frame: 11
const indexBinding = index;
const activePageRangeStartBinding = activePageRangeStart;
const get = activePageRangeStartBinding.get;
return !(indexBinding >= Reflect.apply(get, activePageRangeStartBinding, []) && index <= activePageRangeEnd.get());
}
function SegmentedControlPageP_69090(a0) { // fn#69090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:6171, owner: SegmentedControlPage.p, offset: 0x01c68446, size: 132 bytes, params: 2, frame: 16
var r1;
var r2;
var r4;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r5 = value2 ? value : item;
if (value2) {
r1 = item2;
r2 = value2;
r4 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = item3;
r2 = value3;
r4 = value;
} else {
r1 = item3;
r2 = value3;
r4 = item;
}
}
if (!r2) {
r1.return();
}
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env0_7)(!(index >= r5 && index <= r4));
return value;
}
}
function SegmentedControlPages({state, style, bounces, nativeGesture, onBeginDragWorklet, onEndDragWorklet, onScrollWorklet}) { // fn#69091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:7371, offset: 0x01c684ca, size: 1759 bytes, params: 2, frame: 41
var object5;
const items3 = state.items;
const activeIndex = state.activeIndex;
const activeIndex2 = activeIndex;
const visiblePageRange = state.visiblePageRange;
const visiblePageRange2 = visiblePageRange;
const pagerRef = state.pagerRef;
const scrollTarget = state.scrollTarget;
const scrollTarget2 = scrollTarget;
const scrollOverflow = state.scrollOverflow;
const scrollOverflow2 = scrollOverflow;
const pressedIndex = state.pressedIndex;
const onPageChangeRef = state.onPageChangeRef;
const onPageChangeRef2 = onPageChangeRef;
const pageWidth = state.pageWidth;
const pageWidth2 = pageWidth;
let useSharedValue = ReanimatedRexportModule.useSharedValue;
let get = activeIndex.get;
const value3 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [Reflect.apply(get, activeIndex, [])]);
const env0_10 = value3;
useSharedValue = ReanimatedRexportModule.useSharedValue;
get = activeIndex.get;
const value4 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [Reflect.apply(get, activeIndex, [])]);
const env0_11 = value4;
const length = items3.length;
const length2 = length;
const value5 = ReanimatedRexportModule.useSharedValue(undefined);
const env0_13 = value5;
let binding = visiblePageRange2;
let useRef = binding.useRef;
const env0_14 = Reflect.apply(useRef, binding, [false]);
binding = visiblePageRange2;
useRef = binding.useRef;
get = activeIndex.get;
const env0_15 = Reflect.apply(useRef, binding, [Reflect.apply(get, activeIndex, [])]);
binding = visiblePageRange2;
let useCallback = binding.useCallback;
let closure = _fun69092;
const value6 = Reflect.apply(useCallback, binding, [closure, []]);
const env0_16 = value6;
let useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = function() {
return activeIndex.get();
};
closure.__closure = {activeIndex: activeIndex};
closure.__workletHash = 4275537317596;
closure.__initData = scrollOverflow2;
const SegmentedControlPagesH2 = SegmentedControlPagesH;
SegmentedControlPagesH2.__closure = {runOnJS: ReanimatedRexportModule.runOnJS, updateCurrentActiveIndex: value6};
SegmentedControlPagesH2.__workletHash = 1219187007872;
SegmentedControlPagesH2.__initData = onPageChangeRef2;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, SegmentedControlPagesH2]);
useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = SegmentedControlPagesZ;
closure.__closure = {pageIndex: value3};
closure.__workletHash = 3363652844798;
closure.__initData = pageWidth2;
const closure3 = function(a0) {
activeIndex.set(a0);
};
closure3.__closure = {activeIndex: activeIndex};
closure3.__workletHash = 10225590895783;
closure3.__initData = env0_10;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, closure3]);
const value7 = visiblePageRange2.useCallback(function(a0) {
if (!(onPageChangeRef == null || onPageChangeRef.current == null)) {
onPageChangeRef.current(a0);
}
}, [onPageChangeRef]);
const env0_17 = value7;
const value8 = visiblePageRange2.useCallback(_fun69098, [pagerRef, scrollTarget]);
const env0_18 = value8;
visiblePageRange2.useEffect(_fun69099, [pageWidth, value8]);
binding = visiblePageRange2;
useCallback = binding.useCallback;
closure = SegmentedControlPagesTe;
object5 = {pageWidth: pageWidth, pageIndex: value3};
object5.roundIfClose = (require(8862) /* metro dependency 8862: MathUtils */).roundIfClose;
object5.reportedPageIndex = value4;
object5.runOnJS = ReanimatedRexportModule.runOnJS;
object5.onPageChanged = value7;
closure.__closure = object5;
closure.__workletHash = 11872880107296;
closure.__initData = env0_11;
const value9 = Reflect.apply(useCallback, binding, [closure, [value7, value3, pageWidth, value4]]);
const useAnimatedScrollHandler = ReanimatedRexportModule.useAnimatedScrollHandler;
object5 = {};
closure = function(a0) {
if (onBeginDragWorklet != null) {
onBeginDragWorklet(a0);
}
};
closure.__closure = {onBeginDragWorklet: onBeginDragWorklet};
closure.__workletHash = 2903273634804;
closure.__initData = length2;
object5.onBeginDrag = closure;
closure = function(a0) {
if (onEndDragWorklet != null) {
onEndDragWorklet(a0);
}
};
closure.__closure = {onEndDragWorklet: onEndDragWorklet};
closure.__workletHash = 14857102500821;
closure.__initData = env0_13;
object5.onEndDrag = closure;
closure = onMomentumEnd;
const object = {scrollTarget: scrollTarget};
object.roundIfClose = (require(8862) /* metro dependency 8862: MathUtils */).roundIfClose;
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.refreshScrollOffset = value8;
object.resolvePageIndex = value9;
closure.__closure = object;
closure.__workletHash = 10636475595563;
closure.__initData = env0_14;
object5.onMomentumEnd = closure;
closure = onScroll_69104;
const object4 = {lastScrollOffsetX: value5, onScrollWorklet: onScrollWorklet, itemCount: length,
pageWidth: pageWidth, activeIndex: activeIndex};
object4.runOnJS = ReanimatedRexportModule.runOnJS;
object4.refreshScrollOffset = value8;
object4.scrollOverflow = scrollOverflow;
object4.scrollTarget = scrollTarget;
object4.roundIfClose = (require(8862) /* metro dependency 8862: MathUtils */).roundIfClose;
object4.resolvePageIndex = value9;
closure.__closure = object4;
closure.__workletHash = 9933659944135;
closure.__initData = env0_15;
object5.onScroll = closure;
const value10 = Reflect.apply(useAnimatedScrollHandler, ReanimatedRexportModule, [object5]);
const value11 = visiblePageRange2.useMemo(function() {
return {flex: 1, width: pageWidth};
}, [pageWidth]);
const value12 = visiblePageRange2.useMemo(_fun69106, [value3, pageWidth]);
const value14 = activeIndex2(useFrozenPageIndices(activeIndex, pressedIndex), 2);
const env0_21 = value14[0];
const env0_22 = value14[1];
const useDerivedValue = ReanimatedRexportModule.useDerivedValue;
closure = SegmentedControlPagesSe;
object5 = {scrollTarget: scrollTarget};
object5.roundIfClose = (require(8862) /* metro dependency 8862: MathUtils */).roundIfClose;
object5.pageWidth = pageWidth;
closure.__closure = object5;
closure.__workletHash = 7742060999778;
closure.__initData = env0_16;
const value15 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = SegmentedControlPagesLe;
closure.__closure = {pageIndex: value3, scrollTargetPageIndex: value15};
closure.__workletHash = 9125733538935;
closure.__initData = env0_17;
const ie2 = ie;
ie2.__closure = {visiblePageRange: visiblePageRange};
ie2.__workletHash = 14106897948399;
ie2.__initData = env0_18;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, ie2]);
if (pageWidth === 0) {
return null;
}
binding = scrollTarget2;
const items2 = [value11, style];
const binding2 = ((Component) => <Component ref={pagerRef} style={items2} contentOffset={value12} keyboardShouldPersistTaps="handled" showsHorizontalScrollIndicator={false} pagingEnabled snapToInterval={pageWidth} snapToAlignment="center" decelerationRate="fast" centerContent bounces={bounces} horizontal accessibilityRole="none" onScroll={value10} disableIntervalMomentum scrollEventThrottle={PlatformUtilsModule.isIOS() ? 32 : undefined}>{items3.map(_fun69116)}</Component>)(binding);
if (nativeGesture == null) {
return binding2;
} else {
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
return (
<GestureDetector gesture={nativeGesture}>
{binding2}
</GestureDetector>
);
}
function _fun69092(a0) { // fn#69092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:7828, offset: 0x01c68ba9, size: 20 bytes, params: 2, frame: 2
env0_15.current = a0;
}
function SegmentedControlPagesH(a0) { // fn#69094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:7973, owner: SegmentedControlPages.H, offset: 0x01c68bbd, size: 52 bytes, params: 2, frame: 12
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env0_16);
value(a0);
}
function SegmentedControlPagesZ() { // fn#69095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:8153, owner: SegmentedControlPages.z, offset: 0x01c68bf1, size: 18 bytes, params: 1, frame: 9
return env0_10.get();
}
function _fun69098(a0) { // fn#69098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:8429, offset: 0x01c68c38, size: 82 bytes, params: 2, frame: 15
var r1;
var r3;
var current;
scrollTarget.set(a0);
const value2 = pagerRef == null;
const value3 = undefined;
if (value2) {
r1 = value2;
r3 = value3;
} else {
current = pagerRef.current;
r1 = current == null;
r3 = current;
}
if (!r1) {
r3.scrollTo({x: a0, animated: false});
}
return value3;
}
function _fun69099() { // fn#69099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:8530, offset: 0x01c68c8a, size: 82 bytes, params: 1, frame: 12
if (pageWidth > 0) {
if (!env0_14.current) {
env0_14.current = true;
if (env0_15.current > 0) {
env0_18(env0_15.current * pageWidth);
}
}
}
}
function SegmentedControlPagesTe(a0, a1) { // fn#69100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:8668, owner: SegmentedControlPages.te, offset: 0x01c68cdc, size: 301 bytes, params: 3, frame: 27
var r3;
var binding;
var set;
var Math;
var min;
var Math2;
var max;
var value2;
var moduleValue;
var roundIfClose;
var x;
var value3;
var moduleValue2;
var get;
var value5;
var value6;
var binding2;
var value;
let pageWidthBinding = pageWidth;
if (pageWidthBinding !== 0) {
binding = env0_10;
set = binding.set;
Math = global.Math;
min = Math.min;
Math2 = global.Math;
max = Math2.max;
value2 = environment.__proto__;
moduleValue = require(8862) /* metro dependency 8862: MathUtils */;
roundIfClose = moduleValue.roundIfClose;
x = a0.x;
pageWidthBinding = pageWidth;
value3 = Reflect.apply(max, Math2, [Reflect.apply(roundIfClose, moduleValue,
[x / pageWidthBinding, 0.0001]), 0]);
moduleValue2 = require(8862) /* metro dependency 8862: MathUtils */;
roundIfClose = moduleValue2.roundIfClose;
Reflect.apply(set, binding, [Reflect.apply(min, Math, [value3, Reflect.apply(roundIfClose, moduleValue2,
[a1.width / pageWidthBinding, 0.0001]) - 1])]);
get = binding.get;
value5 = Reflect.apply(get, binding, []) % 1 === 0;
if (value5) {
binding = env0_11;
value6 = binding.get();
binding = env0_10;
r3 = value6 !== binding.get();
} else {
r3 = value5;
}
if (r3) {
binding = env0_11;
set = binding.set;
binding2 = env0_10;
get = binding2.get;
Reflect.apply(set, binding, [Reflect.apply(get, binding2, [])]);
value = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env0_17);
get = binding2.get;
value(Reflect.apply(get, binding2, []));
}
}
}
function onMomentumEnd({contentOffset, contentSize}) { // fn#69103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:9375, owner: SegmentedControlPages.onMomentumEnd, offset: 0x01c68e28, size: 201 bytes, params: 2, frame: 20
var value3;
var moduleValue;
var roundIfClose;
var x;
var value6;
var moduleValue2;
if (scrollTarget.get() !== -1) {
value3 = environment.__proto__;
moduleValue = require(8862) /* metro dependency 8862: MathUtils */;
roundIfClose = moduleValue.roundIfClose;
x = contentOffset.x;
scrollTargetBinding = scrollTarget;
if (Reflect.apply(roundIfClose, moduleValue, [x - scrollTargetBinding.get(), 0.0001]) === 0) {
scrollTarget.set(-1);
} else {
value6 = scrollTarget.get();
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue2.runOnJS(env0_18)(value6);
}
}
env0_19(contentOffset, contentSize);
}
function SegmentedControlPagesOnScroll(a0) { // fn#69104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:9735, owner: SegmentedControlPages.onScroll, offset: 0x01c68ef1, size: 458 bytes, params: 2, frame: 20
var scrollOverflowBinding;
var scrollTargetBinding;
var value8;
var moduleValue2;
var roundIfClose;
const contentOffset = a0.contentOffset;
const contentSize = a0.contentSize;
if (contentSize.width !== 0) {
var binding = env0_13;
var value2 = binding.get();
var x = contentOffset.x;
if (value2 === x) {
return undefined;
}
binding = env0_13;
var set = binding.set;
x = contentOffset.x;
Reflect.apply(set, binding, [x]);
if (onScrollWorklet != null) {
onScrollWorklet(a0);
}
var Math = global.Math;
var round = Math.round;
var value3 = Reflect.apply(round, Math, [length * pageWidth]);
Math = global.Math;
round = Math.round;
if (value3 % Reflect.apply(round, Math, [contentSize.width]) == 0) {
x = contentOffset.x;
if (x < 0) {
scrollOverflowBinding = scrollOverflow;
scrollOverflowBinding.set(contentOffset.x);
} else if (contentOffset.x > contentSize.width - pageWidth) {
scrollOverflowBinding = scrollOverflow;
scrollOverflowBinding.set(contentOffset.x - (contentSize.width - pageWidth));
} else {
scrollOverflow.set(0);
}
if (scrollTarget.get() === -1) {
env0_19(contentOffset, contentSize);
return undefined;
}
value8 = environment.__proto__;
moduleValue2 = require(8862) /* metro dependency 8862: MathUtils */;
roundIfClose = moduleValue2.roundIfClose;
x = contentOffset.x;
scrollTargetBinding = scrollTarget;
if (Reflect.apply(roundIfClose, moduleValue2, [x - scrollTargetBinding.get(), 0.0001]) !== 0) {
return undefined;
}
scrollTarget.set(-1);
env0_19(contentOffset, contentSize);
return undefined;
}
var value5 = activeIndex.get() * pageWidth;
var moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS(env0_18)(value5);
}
}
function _fun69106() { // fn#69106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10414, offset: 0x01c690d1, size: 52 bytes, params: 1, frame: 13
const value2 = env0_10.get();
const value3 = 0;
return {x: (value2 ?? value3) * pageWidth, y: value3};
}
function useFrozenPageIndices(a0, a1) { // fn#69107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10477, owner: SegmentedControlPages.useFrozenPageIndices, offset: 0x01c69105, size: 237 bytes, params: 3, frame: 22
var environment;
const env0_0 = a0;
const env0_1 = a1;
const value = environment.__proto__;
let useSharedValue = ReanimatedRexportModule.useSharedValue;
let get = a0.get;
const value2 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [Reflect.apply(get, a0, [])]);
useSharedValue = ReanimatedRexportModule.useSharedValue;
get = a0.get;
const value3 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [Reflect.apply(get, a0, [])]);
const binding = env1_4;
const useCallback = binding.useCallback;
const useFrozenPageIndicesU2 = useFrozenPageIndicesU;
useFrozenPageIndicesU2.__closure = {activePageRangeStart: value2, activePageRangeEnd: value3};
useFrozenPageIndicesU2.__workletHash = 12915998789021;
useFrozenPageIndicesU2.__initData = env1_24;
const env0_4 = Reflect.apply(useCallback, binding, [useFrozenPageIndicesU2, [value3, value2]]);
ReanimatedRexportModule.useAnimatedReaction(_fun69109(), _fun69111());
return [value2, value3];
function useFrozenPageIndicesU(a0, a1) { // fn#69108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10603, owner: SegmentedControlPages.useFrozenPageIndices.u, offset: 0x01c691f2, size: 95 bytes, params: 3, frame: 17
let binding = env0_2;
let set = binding.set;
let Math = global.Math;
Reflect.apply(set, binding, [Math.min(binding.get(), a0)]);
binding = Module00057;
set = binding.set;
Math = global.Math;
Reflect.apply(set, binding, [Math.max(binding.get(), a1)]);
}
function _fun69109() { // fn#69109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10826, offset: 0x01c69251, size: 69 bytes, params: 1, frame: 4
const SegmentedControlPagesNativeTsx192 = SegmentedControlPagesNativeTsx19;
SegmentedControlPagesNativeTsx192.__closure = {activeIndex: env0_0, pressedIndex: require};
SegmentedControlPagesNativeTsx192.__workletHash = 12859889409680;
SegmentedControlPagesNativeTsx192.__initData = env2_25;
return SegmentedControlPagesNativeTsx192;
function SegmentedControlPagesNativeTsx19() { // fn#69110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10874, offset: 0x01c69296, size: 43 bytes, params: 1, frame: 11
const object = {};
object.activeIndex = env1_0.get();
object.pressedIndex = require.get();
return object;
}
}
function _fun69111() { // fn#69111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:11147, offset: 0x01c692c1, size: 62 bytes, params: 1, frame: 3
const SegmentedControlPagesNativeTsx202 = SegmentedControlPagesNativeTsx20;
SegmentedControlPagesNativeTsx202.__closure = {expandActivePageRange: env0_4};
SegmentedControlPagesNativeTsx202.__workletHash = 8613036130189;
SegmentedControlPagesNativeTsx202.__initData = env2_26;
return SegmentedControlPagesNativeTsx202;
function SegmentedControlPagesNativeTsx20({activeIndex, pressedIndex}) { // fn#69112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:11195, offset: 0x01c692ff, size: 120 bytes, params: 2, frame: 16
var r4;
var r5;
var Math;
var value;
if (pressedIndex === -1) {
r4 = activeIndex;
r5 = activeIndex;
} else {
Math = global.Math;
value = Math.min(activeIndex, pressedIndex);
Math = global.Math;
r4 = Math.max(activeIndex, pressedIndex);
r5 = value;
}
value = environment.__proto__;
const binding = env1_4;
Math = global.Math;
value = Math.floor(r5);
Math = global.Math;
binding(value, Math.ceil(r4));
}
}
}
function SegmentedControlPagesSe() { // fn#69113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:11614, owner: SegmentedControlPages.se, offset: 0x01c69377, size: 96 bytes, params: 1, frame: 15
var r0;
var value4;
var moduleValue;
const value2 = scrollTarget.get();
const value3 = -1;
if (value3 === value2) {
r0 = value3;
} else {
value4 = environment.__proto__;
moduleValue = require(8862) /* metro dependency 8862: MathUtils */;
r0 = moduleValue.roundIfClose(scrollTarget.get() / pageWidth, 0.0001);
}
return r0;
}
function SegmentedControlPagesLe() { // fn#69114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:11847, owner: SegmentedControlPages.le, offset: 0x01c693d7, size: 129 bytes, params: 1, frame: 17
var r1;
var r2;
var value5;
const value2 = env0_10.get();
let Math = global.Math;
const value3 = Math.floor(value2);
Math = global.Math;
const value4 = Math.ceil(value2);
let value = env0_23.get();
if (value === -1) {
r1 = value4;
r2 = value3;
} else {
Math = global.Math;
value5 = Math.min(value3, value);
Math = global.Math;
value = Math.max(value4, value);
r1 = value;
r2 = value5;
}
return [r2, r1];
}
function ie(a0, a1) { // fn#69115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:12075, owner: SegmentedControlPages.ie, offset: 0x01c69458, size: 71 bytes, params: 3, frame: 13
if (!(a1 != null && a1[0] === a0[0] && a1[1] === a0[1])) {
visiblePageRange.set(a0);
}
}
function _fun69116(a0, a1) { // fn#69116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:12604, offset: 0x01c6949f, size: 94 bytes, params: 3, frame: 16
return (
<SegmentedControlPage
index={a1}
activePageRangeStart={env0_21}
activePageRangeEnd={env0_22}
reportedPageIndex={env0_11}
pageIndex={env0_10}
scrollTargetPageIndex={env0_23}
style={env0_20}
item={a0}
key={a1}
/>
);
}
}
}
global.__d(_fun69083, 8861, [57, 31, 27, 33, 4017, 8862, 477, 5321, 4521,
2]) /* metro module 8861, dependencies: [57, 31, 27, 33, 4017, 8862, 477, 5321, 4521, 2] */;