Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4907.js (118.4 MB)
527 lines
26 KiB
TypeScript
527 lines
26 KiB
TypeScript
// Module ID: 12858
|
|
// Function ID: 12859
|
|
// Name: SegmentedControlPages
|
|
// Dependencies: [32, 19, 17, 21, 4458, 12859, 1364, 6848, 5138, 5097, 2]
|
|
// Exports: SegmentedControlPages
|
|
|
|
// Module 12858 (SegmentedControlPages)
|
|
import PlatformUtils from "PlatformUtils" /* 1364 */;
|
|
import ReanimatedRexport2 from "ReanimatedRexport" /* 4458 */;
|
|
import setAccessibilityFocus from "setAccessibilityFocus" /* 5138 */;
|
|
import MathUtils from "MathUtils" /* 12859 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
const ReanimatedRexport = ReanimatedRexport2;
|
|
|
|
require = fn;
|
|
function SegmentedControlPage(children) {
|
|
const reportedPageIndex = children.reportedPageIndex;
|
|
const pageIndex = children.pageIndex;
|
|
const scrollTargetPageIndex = children.scrollTargetPageIndex;
|
|
const index = children.index;
|
|
const activePageRangeStart = children.activePageRangeStart;
|
|
const activePageRangeEnd = children.activePageRangeEnd;
|
|
const merged = Object.assign(children, Object.assign({ reportedPageIndex: 0, pageIndex: 0, scrollTargetPageIndex: 0, index: 0, item: 0, activePageRangeStart: 0, activePageRangeEnd: 0 }));
|
|
let accessibilityElementsHidden;
|
|
closure_8 = undefined;
|
|
let ref;
|
|
closure_11 = undefined;
|
|
const fn = function v() {
|
|
let tmp2 = Math.floor(pageIndex.get()) === index;
|
|
if (!tmp2) {
|
|
const _Math = Math;
|
|
tmp2 = Math.ceil(pageIndex.get()) === tmp;
|
|
}
|
|
if (!tmp2) {
|
|
tmp2 = scrollTargetPageIndex.get() === tmp;
|
|
}
|
|
return tmp2;
|
|
};
|
|
fn.__closure = { pageIndex, index, scrollTargetPageIndex };
|
|
fn.__workletHash = 6181538518841;
|
|
fn.__initData = __initData3;
|
|
const derivedValue = reportedPageIndex(scrollTargetPageIndex[4]).useDerivedValue(fn);
|
|
let obj = reportedPageIndex(scrollTargetPageIndex[4]);
|
|
let tmp2 = reportedPageIndex;
|
|
class S {
|
|
constructor() {
|
|
pointerEvents = "box-none";
|
|
if (reportedPageIndex.get() !== index) {
|
|
pointerEvents = "none";
|
|
}
|
|
return { pointerEvents };
|
|
}
|
|
}
|
|
S.__closure = { reportedPageIndex, index };
|
|
S.__workletHash = 13786543795395;
|
|
S.__initData = __initData4;
|
|
const animatedProps = reportedPageIndex(scrollTargetPageIndex[4]).useAnimatedProps(S);
|
|
const tmp6 = index(activePageRangeStart.useState(() => reportedPageIndex.get() !== index), 2);
|
|
accessibilityElementsHidden = tmp6[0];
|
|
closure_8 = tmp8;
|
|
let obj2 = reportedPageIndex(scrollTargetPageIndex[4]);
|
|
const fn2 = function p() {
|
|
return reportedPageIndex.get() !== index;
|
|
};
|
|
fn2.__closure = { reportedPageIndex, index };
|
|
fn2.__workletHash = 7407561160388;
|
|
fn2.__initData = __initData5;
|
|
class I {
|
|
constructor(arg0) {
|
|
obj = closure_0(closure_2[4]);
|
|
tmp = obj.runOnJS(closure_8)(children);
|
|
return;
|
|
}
|
|
}
|
|
let obj3 = reportedPageIndex(scrollTargetPageIndex[4]);
|
|
I.__closure = { runOnJS: reportedPageIndex(scrollTargetPageIndex[4]).runOnJS, setIsAccessibilityHidden: tmp6[1] };
|
|
I.__workletHash = 1716421879381;
|
|
I.__initData = __initData6;
|
|
const animatedReaction = obj3.useAnimatedReaction(fn2, I);
|
|
activePageRangeStart.useRef(null);
|
|
ref = activePageRangeStart.useRef(accessibilityElementsHidden);
|
|
let items = [accessibilityElementsHidden];
|
|
const effect = activePageRangeStart.useEffect(() => {
|
|
let current = ref.current;
|
|
if (current) {
|
|
current = !current;
|
|
}
|
|
ref.current = current;
|
|
if (current) {
|
|
current = PlatformUtils.isIOS();
|
|
}
|
|
if (current) {
|
|
const obj3 = { ref, delay: 100 };
|
|
const result = setAccessibilityFocus.setAccessibilityFocus(obj3);
|
|
}
|
|
}, items);
|
|
const obj4 = { runOnJS: reportedPageIndex(scrollTargetPageIndex[4]).runOnJS, setIsAccessibilityHidden: tmp6[1] };
|
|
class A {
|
|
constructor() {
|
|
display = "none";
|
|
if (closure_6.get()) {
|
|
display = "flex";
|
|
}
|
|
return { display, flex: 1 };
|
|
}
|
|
}
|
|
A.__closure = { isVisibleOnScreen: derivedValue };
|
|
A.__workletHash = 10465509086469;
|
|
A.__initData = __initData7;
|
|
const animatedStyle = reportedPageIndex(scrollTargetPageIndex[4]).useAnimatedStyle(A);
|
|
const tmp13 = index(activePageRangeStart.useState(() => {
|
|
let tmp2 = index >= activePageRangeStart.get();
|
|
if (tmp2) {
|
|
tmp2 = index <= activePageRangeEnd.get();
|
|
}
|
|
return !tmp2;
|
|
}), 2);
|
|
closure_11 = tmp14;
|
|
const obj5 = reportedPageIndex(scrollTargetPageIndex[4]);
|
|
const fn3 = function y() {
|
|
const items = [activePageRangeStart.get(), activePageRangeEnd.get()];
|
|
return items;
|
|
};
|
|
fn3.__closure = { activePageRangeStart, activePageRangeEnd };
|
|
fn3.__workletHash = 3980327308475;
|
|
fn3.__initData = __initData8;
|
|
class N {
|
|
constructor(arg0) {
|
|
[tmp, tmp2] = children;
|
|
obj = closure_0(closure_2[4]);
|
|
tmp4 = index >= tmp;
|
|
runOnJSResult = obj.runOnJS(closure_11);
|
|
if (tmp4) {
|
|
tmp4 = index <= tmp2;
|
|
}
|
|
tmp3Result = runOnJSResult(!tmp4);
|
|
return;
|
|
}
|
|
}
|
|
const obj6 = reportedPageIndex(scrollTargetPageIndex[4]);
|
|
N.__closure = { index, runOnJS: reportedPageIndex(scrollTargetPageIndex[4]).runOnJS, setFreeze: tmp13[1] };
|
|
N.__workletHash = 16675026816258;
|
|
N.__initData = __initData9;
|
|
const animatedReaction1 = obj6.useAnimatedReaction(fn3, N);
|
|
const obj8 = { ref };
|
|
const merged1 = Object.assign(merged);
|
|
obj8.animatedProps = animatedProps;
|
|
let str = "auto";
|
|
if (accessibilityElementsHidden) {
|
|
str = "no-hide-descendants";
|
|
}
|
|
obj8.importantForAccessibility = str;
|
|
obj8.accessibilityElementsHidden = accessibilityElementsHidden;
|
|
const obj9 = { freeze: tmp13[0], children: activePageRangeEnd(pageIndex(scrollTargetPageIndex[4]).View, { style: animatedStyle, children: children.item.page }) };
|
|
obj8.children = activePageRangeEnd(tmp2(scrollTargetPageIndex[9]).Freeze, obj9);
|
|
return activePageRangeEnd(pageIndex(scrollTargetPageIndex[4]).View, obj8, index);
|
|
}
|
|
const jsx = fn(21).jsx;
|
|
let closure_6 = ReanimatedRexport.createAnimatedComponent(fn(17).ScrollView);
|
|
let closure_7 = { code: "function SegmentedControlPagesNativeTsx1(){const{activeIndex}=this.__closure;return activeIndex.get();}" };
|
|
let closure_8 = { code: "function SegmentedControlPagesNativeTsx2(value){const{runOnJS,updateCurrentActiveIndex}=this.__closure;runOnJS(updateCurrentActiveIndex)(value);}" };
|
|
let closure_9 = { code: "function SegmentedControlPagesNativeTsx3(){const{pageIndex}=this.__closure;return pageIndex.get();}" };
|
|
let closure_10 = { code: "function SegmentedControlPagesNativeTsx4(value){const{activeIndex}=this.__closure;activeIndex.set(value);}" };
|
|
let closure_11 = { 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());}}" };
|
|
let closure_12 = { code: "function SegmentedControlPagesNativeTsx6(event){const{scrollTarget,onBeginDragWorklet}=this.__closure;var _onBeginDragWorklet;scrollTarget.set(-1);(_onBeginDragWorklet=onBeginDragWorklet)===null||_onBeginDragWorklet===void 0||_onBeginDragWorklet(event);}" };
|
|
let closure_13 = { code: "function SegmentedControlPagesNativeTsx7(event){const{onEndDragWorklet}=this.__closure;var _onEndDragWorklet;(_onEndDragWorklet=onEndDragWorklet)===null||_onEndDragWorklet===void 0||_onEndDragWorklet(event);}" };
|
|
let __initData = { 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);}" };
|
|
let __initData2 = { 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);}" };
|
|
let closure_16 = { code: "function SegmentedControlPagesNativeTsx10(){const{scrollTarget,roundIfClose,pageWidth}=this.__closure;if(scrollTarget.get()===-1){return-1;}return roundIfClose(scrollTarget.get()/pageWidth,1e-4);}" };
|
|
let closure_17 = { 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];}" };
|
|
let closure_18 = { code: "function SegmentedControlPagesNativeTsx12(range,prev){const{visiblePageRange}=this.__closure;if(prev==null||prev[0]!==range[0]||prev[1]!==range[1]){visiblePageRange.set(range);}}" };
|
|
const __initData3 = { 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;}" };
|
|
const __initData4 = { code: "function SegmentedControlPagesNativeTsx14(){const{reportedPageIndex,index}=this.__closure;const isHidden=reportedPageIndex.get()!==index;return{pointerEvents:isHidden?'none':'box-none'};}" };
|
|
const __initData5 = { code: "function SegmentedControlPagesNativeTsx15(){const{reportedPageIndex,index}=this.__closure;return reportedPageIndex.get()!==index;}" };
|
|
const __initData6 = { code: "function SegmentedControlPagesNativeTsx16(hidden){const{runOnJS,setIsAccessibilityHidden}=this.__closure;runOnJS(setIsAccessibilityHidden)(hidden);}" };
|
|
const __initData7 = { code: "function SegmentedControlPagesNativeTsx17(){const{isVisibleOnScreen}=this.__closure;return{display:isVisibleOnScreen.get()?'flex':'none',flex:1};}" };
|
|
const __initData8 = { code: "function SegmentedControlPagesNativeTsx18(){const{activePageRangeStart,activePageRangeEnd}=this.__closure;return[activePageRangeStart.get(),activePageRangeEnd.get()];}" };
|
|
const __initData9 = { code: "function SegmentedControlPagesNativeTsx19([start,end]){const{index,runOnJS,setFreeze}=this.__closure;const isInActiveRange=index>=start&&index<=end;runOnJS(setFreeze)(!isInActiveRange);}" };
|
|
const __initData10 = { code: "function SegmentedControlPagesNativeTsx20(min,max){const{activePageRangeStart,activePageRangeEnd}=this.__closure;activePageRangeStart.set(Math.min(activePageRangeStart.get(),min));activePageRangeEnd.set(Math.max(activePageRangeEnd.get(),max));}" };
|
|
const __initData11 = { code: "function SegmentedControlPagesNativeTsx21(){const{activeIndex,pressedIndex}=this.__closure;return{activeIndex:activeIndex.get(),pressedIndex:pressedIndex.get()};}" };
|
|
const __initData12 = { code: "function SegmentedControlPagesNativeTsx22({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));}" };
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("design/components/SegmentedControl/native/SegmentedControlPages.native.tsx");
|
|
|
|
export const SegmentedControlPages = function SegmentedControlPages(onEndDragWorklet) {
|
|
({ state, nativeGesture, onBeginDragWorklet } = onEndDragWorklet);
|
|
activeIndex = onBeginDragWorklet;
|
|
onEndDragWorklet = onEndDragWorklet.onEndDragWorklet;
|
|
pressedIndex = onEndDragWorklet;
|
|
const onScrollWorklet = onEndDragWorklet.onScrollWorklet;
|
|
let sharedValue3 = onScrollWorklet;
|
|
onPageChangeRef = undefined;
|
|
let callback1;
|
|
let callback2;
|
|
let callback3;
|
|
let memo;
|
|
c21 = undefined;
|
|
c22 = undefined;
|
|
let derivedValue;
|
|
({ items, activeIndex } = state);
|
|
let sharedValue4 = activeIndex;
|
|
const visiblePageRange = state.visiblePageRange;
|
|
let callback4 = visiblePageRange;
|
|
const pagerRef = state.pagerRef;
|
|
const scrollTarget = state.scrollTarget;
|
|
const scrollOverflow = state.scrollOverflow;
|
|
({ pressedIndex, onPageChangeRef } = state);
|
|
const pageWidth = state.pageWidth;
|
|
({ style, bounces } = onEndDragWorklet);
|
|
const sharedValue = activeIndex(sharedValue3[4]).useSharedValue(activeIndex.get());
|
|
let obj = activeIndex(sharedValue3[4]);
|
|
const sharedValue1 = activeIndex(sharedValue3[4]).useSharedValue(activeIndex.get());
|
|
const length = items.length;
|
|
let obj2 = activeIndex(sharedValue3[4]);
|
|
const sharedValue2 = activeIndex(sharedValue3[4]).useSharedValue(undefined);
|
|
callback4.useRef(false);
|
|
__initData2 = callback4.useRef(activeIndex.get());
|
|
__initData = callback4.useCallback((current) => {
|
|
closure_15.current = current;
|
|
}, []);
|
|
let obj3 = activeIndex(sharedValue3[4]);
|
|
class J {
|
|
constructor() {
|
|
return closure_3.get();
|
|
}
|
|
}
|
|
J.__closure = { activeIndex };
|
|
J.__workletHash = 4275537317596;
|
|
J.__initData = scrollOverflow;
|
|
class W {
|
|
constructor(arg0) {
|
|
obj = closure_0(closure_2[4]);
|
|
tmp = obj.runOnJS(closure_16)(onEndDragWorklet);
|
|
return;
|
|
}
|
|
}
|
|
let obj4 = activeIndex(sharedValue3[4]);
|
|
W.__closure = { runOnJS: activeIndex(sharedValue3[4]).runOnJS, updateCurrentActiveIndex: __initData };
|
|
W.__workletHash = 1219187007872;
|
|
W.__initData = onPageChangeRef;
|
|
const animatedReaction = obj4.useAnimatedReaction(J, W);
|
|
const obj5 = { runOnJS: activeIndex(sharedValue3[4]).runOnJS, updateCurrentActiveIndex: __initData };
|
|
const fn = function z() {
|
|
return sharedValue.get();
|
|
};
|
|
fn.__closure = { pageIndex: sharedValue };
|
|
fn.__workletHash = 3363652844798;
|
|
fn.__initData = pageWidth;
|
|
class E {
|
|
constructor(arg0) {
|
|
result = closure_3.set(onEndDragWorklet);
|
|
return;
|
|
}
|
|
}
|
|
E.__closure = { activeIndex };
|
|
E.__workletHash = 10225590895783;
|
|
E.__initData = sharedValue;
|
|
const animatedReaction1 = activeIndex(sharedValue3[4]).useAnimatedReaction(fn, E);
|
|
const items1 = [onPageChangeRef];
|
|
callback1 = callback4.useCallback((AUTO_DISMISS) => {
|
|
if (onPageChangeRef != null) {
|
|
const current = onPageChangeRef.current;
|
|
if (current != null) {
|
|
current(AUTO_DISMISS);
|
|
}
|
|
}
|
|
}, items1);
|
|
const items2 = [pagerRef, scrollTarget];
|
|
callback2 = callback4.useCallback((x) => {
|
|
const result = scrollTarget.set(x);
|
|
if (pagerRef != null) {
|
|
const current = pagerRef.current;
|
|
if (current != null) {
|
|
const obj = { x, animated: false };
|
|
current.scrollTo(obj);
|
|
}
|
|
}
|
|
}, items2);
|
|
const items3 = [pageWidth, callback2];
|
|
const effect = callback4.useEffect(() => {
|
|
if (pageWidth > 0) {
|
|
if (!ref.current) {
|
|
tmp2.current = true;
|
|
if (ref2.current > 0) {
|
|
callback2(ref2.current * tmp);
|
|
}
|
|
}
|
|
}
|
|
}, items3);
|
|
function te(arg0, width) {
|
|
if (0 !== pageWidth) {
|
|
const _Math = Math;
|
|
const _Math2 = Math;
|
|
const bound = Math.max(MathUtils.roundIfClose(arg0.x / tmp, 0.0001), 0);
|
|
const tmp13 = require;
|
|
const result = sharedValue.set(Math.min(bound, MathUtils.roundIfClose(width.width / tmp, 0.0001) - 1));
|
|
const result1 = sharedValue.get() % 1;
|
|
let tmp4 = result1 === 0;
|
|
if (result1 === 0) {
|
|
value = sharedValue1.get();
|
|
tmp4 = value !== obj2.get();
|
|
}
|
|
if (tmp4) {
|
|
const result2 = sharedValue1.set(obj2.get());
|
|
const tmp13Result = tmp13(4458);
|
|
tmp13(4458).runOnJS(callback1)(obj2.get());
|
|
const runOnJSResult = tmp13(4458).runOnJS(callback1);
|
|
}
|
|
}
|
|
}
|
|
const obj6 = activeIndex(sharedValue3[4]);
|
|
te.__closure = { pageWidth, pageIndex: sharedValue, roundIfClose: activeIndex(sharedValue3[5]).roundIfClose, reportedPageIndex: sharedValue1, runOnJS: activeIndex(sharedValue3[4]).runOnJS, onPageChanged: callback1 };
|
|
te.__workletHash = 11872880107296;
|
|
te.__initData = sharedValue1;
|
|
const items4 = [callback1, sharedValue, pageWidth, sharedValue1];
|
|
callback3 = callback4.useCallback(te, items4);
|
|
const obj7 = { pageWidth, pageIndex: sharedValue, roundIfClose: activeIndex(sharedValue3[5]).roundIfClose, reportedPageIndex: sharedValue1, runOnJS: activeIndex(sharedValue3[4]).runOnJS, onPageChanged: callback1 };
|
|
const obj9 = { onBeginDrag: null, onEndDrag: null, onMomentumEnd: null, onScroll: null };
|
|
function oe(arg0) {
|
|
const result = scrollTarget.set(-1);
|
|
if (activeIndex != null) {
|
|
tmp2(arg0);
|
|
}
|
|
}
|
|
oe.__closure = { scrollTarget, onBeginDragWorklet };
|
|
oe.__workletHash = 3327779393906;
|
|
oe.__initData = length;
|
|
obj9.onBeginDrag = oe;
|
|
function ae(arg0) {
|
|
if (pressedIndex != null) {
|
|
tmp(arg0);
|
|
}
|
|
}
|
|
ae.__closure = { onEndDragWorklet };
|
|
ae.__workletHash = 14857102500821;
|
|
ae.__initData = sharedValue2;
|
|
obj9.onEndDrag = ae;
|
|
function re(contentOffset) {
|
|
contentOffset = contentOffset.contentOffset;
|
|
if (-1 !== scrollTarget.get()) {
|
|
if (0 === obj2.roundIfClose(contentOffset.x - obj.get(), 0.0001)) {
|
|
const result = obj.set(-1);
|
|
} else {
|
|
value = obj.get();
|
|
tmp(4458).runOnJS(callback2)(value);
|
|
const tmpResult = tmp(4458);
|
|
}
|
|
obj2 = MathUtils;
|
|
tmp = require;
|
|
}
|
|
callback3(contentOffset, contentOffset.contentSize);
|
|
}
|
|
const obj8 = activeIndex(sharedValue3[4]);
|
|
re.__closure = { scrollTarget, roundIfClose: activeIndex(sharedValue3[5]).roundIfClose, runOnJS: activeIndex(sharedValue3[4]).runOnJS, refreshScrollOffset: callback2, resolvePageIndex: callback3 };
|
|
re.__workletHash = 10636475595563;
|
|
re.__initData = __initData;
|
|
obj9.onMomentumEnd = re;
|
|
function ne(arg0) {
|
|
({ contentOffset, contentSize } = arg0);
|
|
if (0 !== contentSize.width) {
|
|
if (sharedValue2.get() !== contentOffset.x) {
|
|
const result = obj4.set(contentOffset.x);
|
|
if (sharedValue3 != null) {
|
|
tmp24(arg0);
|
|
}
|
|
const _Math = Math;
|
|
const _Math2 = Math;
|
|
const rounded = Math.round(length * pageWidth);
|
|
if (rounded % Math.round(contentSize.width) == 0) {
|
|
if (contentOffset.x < 0) {
|
|
const result1 = scrollOverflow.set(contentOffset.x);
|
|
} else if (contentOffset.x > contentSize.width - tmp4) {
|
|
const result2 = scrollOverflow.set(contentOffset.x - (contentSize.width - tmp4));
|
|
} else {
|
|
const result3 = scrollOverflow.set(0);
|
|
}
|
|
if (-1 !== scrollTarget.get()) {
|
|
if (0 === obj3.roundIfClose(contentOffset.x - obj2.get(), 0.0001)) {
|
|
const result4 = obj2.set(-1);
|
|
}
|
|
obj3 = MathUtils;
|
|
}
|
|
callback3(contentOffset, contentSize);
|
|
} else {
|
|
const result5 = sharedValue4.get() * tmp4;
|
|
ReanimatedRexport2.runOnJS(callback2)(result5);
|
|
}
|
|
}
|
|
obj4 = sharedValue2;
|
|
}
|
|
}
|
|
const obj10 = { scrollTarget, roundIfClose: activeIndex(sharedValue3[5]).roundIfClose, runOnJS: activeIndex(sharedValue3[4]).runOnJS, refreshScrollOffset: callback2, resolvePageIndex: callback3 };
|
|
ne.__closure = { lastScrollOffsetX: sharedValue2, onScrollWorklet, itemCount: length, pageWidth, activeIndex, runOnJS: activeIndex(sharedValue3[4]).runOnJS, refreshScrollOffset: callback2, scrollOverflow, scrollTarget, roundIfClose: activeIndex(sharedValue3[5]).roundIfClose, resolvePageIndex: callback3 };
|
|
ne.__workletHash = 9933659944135;
|
|
ne.__initData = __initData2;
|
|
obj9.onScroll = ne;
|
|
const items5 = [pageWidth];
|
|
const obj11 = { lastScrollOffsetX: sharedValue2, onScrollWorklet, itemCount: length, pageWidth, activeIndex, runOnJS: activeIndex(sharedValue3[4]).runOnJS, refreshScrollOffset: callback2, scrollOverflow, scrollTarget, roundIfClose: activeIndex(sharedValue3[5]).roundIfClose, resolvePageIndex: callback3 };
|
|
memo = callback4.useMemo(() => ({ flex: 1, width: pageWidth }), items5);
|
|
const items6 = [sharedValue, pageWidth];
|
|
sharedValue3 = undefined;
|
|
callback4 = undefined;
|
|
const memo1 = callback4.useMemo(() => {
|
|
let num = sharedValue.get();
|
|
if (num == null) {
|
|
num = 0;
|
|
}
|
|
const point = { x: num * pageWidth, y: 0 };
|
|
return point;
|
|
}, items6);
|
|
const animatedScrollHandler = obj8.useAnimatedScrollHandler(obj9);
|
|
sharedValue3 = activeIndex(sharedValue3[4]).useSharedValue(activeIndex.get());
|
|
const obj12 = activeIndex(sharedValue3[4]);
|
|
sharedValue4 = activeIndex(sharedValue3[4]).useSharedValue(activeIndex.get());
|
|
const fn2 = function u(arg0, arg1) {
|
|
const result = sharedValue3.set(Math.min(sharedValue3.get(), arg0));
|
|
const result1 = sharedValue4.set(Math.max(sharedValue4.get(), arg1));
|
|
};
|
|
fn2.__closure = { activePageRangeStart: sharedValue3, activePageRangeEnd: sharedValue4 };
|
|
fn2.__workletHash = 2682934677750;
|
|
fn2.__initData = __initData10;
|
|
const items7 = [sharedValue4, sharedValue3];
|
|
callback4 = callback4.useCallback(fn2, items7);
|
|
const obj13 = activeIndex(sharedValue3[4]);
|
|
class SegmentedControlPagesNativeTsx21 {
|
|
constructor() {
|
|
obj = { activeIndex: activeIndex.get(), pressedIndex: pressedIndex.get() };
|
|
return obj;
|
|
}
|
|
}
|
|
SegmentedControlPagesNativeTsx21.__closure = { activeIndex, pressedIndex };
|
|
SegmentedControlPagesNativeTsx21.__workletHash = 16203677263547;
|
|
SegmentedControlPagesNativeTsx21.__initData = __initData11;
|
|
class SegmentedControlPagesNativeTsx22 {
|
|
constructor(arg0) {
|
|
({ activeIndex, pressedIndex } = onEndDragWorklet);
|
|
bound1 = activeIndex;
|
|
bound = activeIndex;
|
|
if (-1 !== pressedIndex) {
|
|
tmp3 = globalThis;
|
|
_Math = Math;
|
|
bound = Math.min(activeIndex, pressedIndex);
|
|
_Math2 = Math;
|
|
bound1 = Math.max(activeIndex, pressedIndex);
|
|
}
|
|
rounded = Math.floor(bound);
|
|
tmp5 = closure_4(rounded, Math.ceil(bound1));
|
|
return;
|
|
}
|
|
}
|
|
SegmentedControlPagesNativeTsx22.__closure = { expandActivePageRange: callback4 };
|
|
SegmentedControlPagesNativeTsx22.__workletHash = 4886047206415;
|
|
SegmentedControlPagesNativeTsx22.__initData = __initData12;
|
|
const animatedReaction2 = activeIndex(sharedValue3[4]).useAnimatedReaction(SegmentedControlPagesNativeTsx21, SegmentedControlPagesNativeTsx22);
|
|
const items8 = [sharedValue3, sharedValue4];
|
|
const obj14 = activeIndex(sharedValue3[4]);
|
|
[c21, c22] = sharedValue4(items8, 2);
|
|
const tmp20 = sharedValue4(items8, 2);
|
|
function se() {
|
|
let num = -1;
|
|
if (-1 !== scrollTarget.get()) {
|
|
num = MathUtils.roundIfClose(scrollTarget.get() / pageWidth, 0.0001);
|
|
}
|
|
return num;
|
|
}
|
|
const obj15 = activeIndex(sharedValue3[4]);
|
|
se.__closure = { scrollTarget, roundIfClose: activeIndex(sharedValue3[5]).roundIfClose, pageWidth };
|
|
se.__workletHash = 7742060999778;
|
|
se.__initData = __initData;
|
|
derivedValue = obj15.useDerivedValue(se);
|
|
const obj16 = { scrollTarget, roundIfClose: activeIndex(sharedValue3[5]).roundIfClose, pageWidth };
|
|
function le() {
|
|
value = sharedValue.get();
|
|
const rounded = Math.floor(value);
|
|
const rounded1 = Math.ceil(value);
|
|
value2 = derivedValue.get();
|
|
let bound1 = rounded1;
|
|
let bound = rounded;
|
|
if (-1 !== value2) {
|
|
const _Math = Math;
|
|
bound = Math.min(rounded, value2);
|
|
const _Math2 = Math;
|
|
bound1 = Math.max(rounded1, value2);
|
|
}
|
|
const items = [bound, bound1];
|
|
return items;
|
|
}
|
|
le.__closure = { pageIndex: sharedValue, scrollTargetPageIndex: derivedValue };
|
|
le.__workletHash = 9125733538935;
|
|
le.__initData = callback1;
|
|
function ie(arg0, arg1) {
|
|
if (!tmp) {
|
|
const result = callback4.set(arg0);
|
|
}
|
|
}
|
|
ie.__closure = { visiblePageRange };
|
|
ie.__workletHash = 14106897948399;
|
|
ie.__initData = callback2;
|
|
const animatedReaction3 = activeIndex(sharedValue3[4]).useAnimatedReaction(le, ie);
|
|
if (0 === pageWidth) {
|
|
return null;
|
|
} else {
|
|
const obj18 = { ref: pagerRef, style: null, contentOffset: null, keyboardShouldPersistTaps: "handled", showsHorizontalScrollIndicator: false, pagingEnabled: true, snapToInterval: null, snapToAlignment: "center", decelerationRate: "fast", centerContent: true, bounces: null, horizontal: true, accessibilityRole: "none", onScroll: null, disableIntervalMomentum: true, scrollEventThrottle: null, children: null };
|
|
const items9 = [memo, style];
|
|
obj18.style = items9;
|
|
obj18.contentOffset = memo1;
|
|
obj18.snapToInterval = pageWidth;
|
|
obj18.bounces = bounces;
|
|
obj18.onScroll = animatedScrollHandler;
|
|
let num;
|
|
if (tmpResult.isIOS()) {
|
|
num = 32;
|
|
}
|
|
obj18.scrollEventThrottle = num;
|
|
obj18.children = items.map((item, index) => <SegmentedControlPage key={arg1} index={arg1} activePageRangeStart={activePageRangeStart} activePageRangeEnd={activePageRangeEnd} reportedPageIndex={sharedValue1} pageIndex={sharedValue} scrollTargetPageIndex={derivedValue} style={memo} item={arg0} />);
|
|
const tmp27Result = pagerRef(scrollTarget, obj18);
|
|
let tmp27Result2 = tmp27Result;
|
|
if (null != nativeGesture) {
|
|
const obj19 = { gesture: nativeGesture, children: tmp27Result };
|
|
tmp27Result2 = tmp27(tmp(tmp2[7]).GestureDetector, obj19);
|
|
}
|
|
return tmp27Result2;
|
|
}
|
|
const obj17 = activeIndex(sharedValue3[4]);
|
|
};
|