decord/source/modules/quests/native/QuestProgressIndicator.tsx

253 lines
10 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 14089
// Function ID: 107836
2026-07-20 16:05:17 +00:00
// Name: QUEST_PROGRESS_DIAMETER_BY_SIZE
2026-07-27 11:26:19 +00:00
// Dependencies: [31, 27, 4123, 33, 3992, 8463, 4131, 689, 566, 4132, 4661, 1212, 5453, 14090, 10901, 2]
2026-07-20 16:05:17 +00:00
2026-07-27 11:26:19 +00:00
// Module 14089 (QUEST_PROGRESS_DIAMETER_BY_SIZE)
2026-07-23 10:11:24 +00:00
import result from "result";
import importDefaultResult from "result";
import { View } from "get ActivityIndicator";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
2026-07-25 08:10:48 +00:00
import importDefaultResult1 from "module_3992";
2026-07-23 10:11:24 +00:00
let closure_10;
let closure_3;
let closure_4;
let closure_5;
let closure_9;
({ useMemo: closure_3, useEffect: closure_4, useRef: closure_5 } = result);
({ jsx: closure_9, jsxs: closure_10 } = jsxProd);
let closure_11 = ["#666777", "#535564"];
2026-07-25 08:10:48 +00:00
let closure_12 = require("module_3992").createAnimatedComponent(require("inlineStyles").Circle);
2026-07-23 10:11:24 +00:00
let obj = { "x-sm": 40, sm: 64, md: 70, "md-lg": 100, lg: 128 };
let closure_14 = _createForOfIteratorHelperLoose.createStyles((arg0) => {
obj = { wrapper: { position: "relative" }, container: { position: "relative", display: "flex", justifyContent: "center", alignItems: "center", zIndex: 1 }, completionGlow: obj, canvas: { transform: items } };
obj = { shadowOffset: { width: 0, height: 0 }, shadowRadius: 20, shadowOpacity: 0, elevation: 4, shadowColor: "#30C77399" };
items = [{ rotate: "-90deg" }];
obj = { position: "absolute", height: 0.78 * arg0, width: 0.78 * arg0, borderRadius: importDefault(689).radii.round, overflow: "hidden" };
2026-07-20 16:05:17 +00:00
obj.imageContainer = obj;
2026-07-23 10:11:24 +00:00
obj.progressPath = { color: importDefault(689).colors.STATUS_POSITIVE };
obj.confetti = { position: "absolute", pointerEvents: "none" };
const obj2 = { backgroundColor: importDefault(689).colors.CARD_BACKGROUND_DEFAULT, position: "absolute", top: 0, left: 0, right: 0, bottom: 0, zIndex: 2 };
obj.opacityMask = obj2;
2026-07-20 16:05:17 +00:00
return obj;
});
let closure_15 = { code: "function QuestProgressIndicatorTsx1(){const{glowOpacity}=this.__closure;return{shadowOpacity:glowOpacity.get()};}" };
let closure_16 = { code: "function QuestProgressIndicatorTsx2(){const{circumference,animatedProgress}=this.__closure;return{strokeDashoffset:circumference-circumference*animatedProgress.get()};}" };
let closure_17 = { code: "function QuestProgressIndicatorTsx3(){const{underlayOpacity,styles}=this.__closure;return{opacity:underlayOpacity.get(),...styles.opacityMask};}" };
2026-07-23 10:11:24 +00:00
const memoResult = importDefaultResult.memo(function QuestProgressIndicator(loading) {
2026-07-20 16:05:17 +00:00
let accessibilityLabel;
let onPress;
let progress;
let quest;
let size;
({ quest, size, progress } = loading);
let flag = loading.loading;
if (flag === undefined) {
flag = false;
}
let flag2 = loading.hasConfetti;
if (flag2 === undefined) {
flag2 = false;
}
({ onPress, accessibilityLabel } = loading);
2026-07-23 10:11:24 +00:00
let stateFromStores;
let callback;
let callback2;
let callback3;
2026-07-20 16:05:17 +00:00
let importDefaultResult;
2026-07-23 10:11:24 +00:00
let sharedValue;
let sharedValue1;
let callback4;
2026-07-20 16:05:17 +00:00
let sharedValue2;
2026-07-23 10:11:24 +00:00
let dependencyMap;
let obj = progress(stateFromStores[8]);
let items = [sharedValue1];
stateFromStores = obj.useStateFromStores(items, () => sharedValue1.useReducedMotion);
const tmp2 = { "x-sm": 3, sm: 3, md: 3, "md-lg": 4, lg: 6 }[size];
callback = tmp3;
const tmp4 = { "x-sm": 1.6, sm: 1, md: 1.4, "md-lg": 1.5, lg: 1.6 }[size];
callback2 = tmp4;
2026-07-20 16:05:17 +00:00
const diff = tmp3 / 2 - tmp2 / 2;
2026-07-23 10:11:24 +00:00
let result = 2 * Math.PI * diff;
callback3 = result;
const tmp7 = callback5(obj[size]);
2026-07-20 16:05:17 +00:00
importDefaultResult = tmp7;
2026-07-23 10:11:24 +00:00
let obj1 = progress(stateFromStores[4]);
sharedValue = obj1.useSharedValue(progress);
let obj2 = progress(stateFromStores[4]);
2026-07-20 16:05:17 +00:00
let num = 0;
if (flag) {
num = 0.7;
}
2026-07-23 10:11:24 +00:00
sharedValue1 = obj2.useSharedValue(num);
2026-07-20 16:05:17 +00:00
const userStatus = quest.userStatus;
let completedAt;
if (null != userStatus) {
completedAt = userStatus.completedAt;
}
2026-07-23 10:11:24 +00:00
callback4 = tmp11;
let obj3 = progress(stateFromStores[4]);
2026-07-20 16:05:17 +00:00
let num2 = 0;
2026-07-23 10:11:24 +00:00
if (null != completedAt) {
2026-07-20 16:05:17 +00:00
num2 = 1;
}
sharedValue2 = obj3.useSharedValue(num2);
2026-07-23 10:11:24 +00:00
let obj4 = progress(stateFromStores[4]);
2026-07-20 16:05:17 +00:00
class D {
constructor() {
obj = { shadowOpacity: useSharedValue.get() };
return obj;
}
}
D.__closure = { glowOpacity: sharedValue2 };
D.__workletHash = 17183837725505;
D.__initData = closure_15;
const animatedStyle = obj4.useAnimatedStyle(D);
2026-07-23 10:11:24 +00:00
let obj5 = progress(stateFromStores[4]);
2026-07-20 16:05:17 +00:00
class R {
constructor() {
2026-07-23 10:11:24 +00:00
obj = { strokeDashoffset: c5 - c5 * c7.get() };
2026-07-20 16:05:17 +00:00
return obj;
}
}
R.__closure = { circumference: result, animatedProgress: sharedValue };
R.__workletHash = 17281152506254;
R.__initData = closure_16;
const animatedProps = obj5.useAnimatedProps(R);
2026-07-23 10:11:24 +00:00
let obj6 = progress(stateFromStores[4]);
2026-07-20 16:05:17 +00:00
class E {
constructor() {
2026-07-23 10:11:24 +00:00
obj = { opacity: c8.get() };
merged = Object.assign(c6.opacityMask);
2026-07-20 16:05:17 +00:00
return obj;
}
}
E.__closure = { underlayOpacity: sharedValue1, styles: tmp7 };
E.__workletHash = 4427598698568;
E.__initData = closure_17;
const items1 = [sharedValue, progress, stateFromStores];
const animatedStyle1 = obj6.useAnimatedStyle(E);
2026-07-23 10:11:24 +00:00
callback2(() => {
2026-07-20 16:05:17 +00:00
let obj = progress(stateFromStores[9]);
obj = {};
let num = 500;
if (stateFromStores) {
num = 0;
}
obj.duration = num;
const result = sharedValue.set(obj.withTiming(progress, obj));
return () => {
2026-07-23 10:11:24 +00:00
progress(stateFromStores[4]).cancelAnimation(outer1_7);
2026-07-20 16:05:17 +00:00
};
}, items1);
const items2 = [sharedValue1, flag];
2026-07-23 10:11:24 +00:00
callback2(() => {
2026-07-20 16:05:17 +00:00
let num = 0;
if (flag) {
num = 0.7;
}
const result = sharedValue1.set(progress(stateFromStores[9]).withTiming(num, { duration: 500 }));
return () => {
2026-07-23 10:11:24 +00:00
progress(stateFromStores[4]).cancelAnimation(outer1_8);
2026-07-20 16:05:17 +00:00
};
}, items2);
2026-07-23 10:11:24 +00:00
const tmp18 = callback3(null);
dependencyMap = tmp18;
const items3 = [tmp7.confetti, tmp4, obj[size]];
const items4 = [null != completedAt, sharedValue2, stateFromStores];
callback2(() => {
2026-07-20 16:05:17 +00:00
if (!stateFromStores) {
2026-07-23 10:11:24 +00:00
if (c9) {
2026-07-20 16:05:17 +00:00
let obj = progress(stateFromStores[9]);
obj = { duration: 500 };
const result = sharedValue2.set(obj.withTiming(1, obj));
2026-07-23 10:11:24 +00:00
const current = _undefined2.current;
2026-07-20 16:05:17 +00:00
if (null != current) {
current.play();
}
}
}
const result1 = sharedValue2.set(0);
2026-07-23 10:11:24 +00:00
const current2 = _undefined2.current;
2026-07-20 16:05:17 +00:00
if (null != current2) {
current2.reset();
}
}, items4);
if (null == onPress) {
let PressableOpacity = importDefaultResult.Fragment;
} else {
2026-07-23 10:11:24 +00:00
PressableOpacity = progress(stateFromStores[10]).PressableOpacity;
2026-07-20 16:05:17 +00:00
}
const rounded = Math.round(100 * progress);
obj = {};
if (null == onPress) {
obj = {};
} else {
obj = { onPress };
}
2026-07-23 10:11:24 +00:00
let merged = Object.assign(obj);
obj1 = { style: null, accessible: true, accessibilityRole: "progressbar" };
2026-07-20 16:05:17 +00:00
const items5 = [, , ];
({ wrapper: arr6[0], completionGlow: arr6[1] } = tmp7);
items5[2] = animatedStyle;
2026-07-23 10:11:24 +00:00
obj1.style = items5;
2026-07-20 16:05:17 +00:00
let formatToPlainStringResult = accessibilityLabel;
if (null == accessibilityLabel) {
2026-07-23 10:11:24 +00:00
const intl = progress(stateFromStores[11]).intl;
2026-07-20 16:05:17 +00:00
obj2 = { percent: rounded };
2026-07-23 10:11:24 +00:00
formatToPlainStringResult = intl.formatToPlainString(progress(stateFromStores[11]).t.Gj8Jqn, obj2);
2026-07-20 16:05:17 +00:00
}
obj1.accessibilityLabel = formatToPlainStringResult;
2026-07-23 10:11:24 +00:00
obj3 = { min: 0, max: 100, now: rounded };
obj1.accessibilityValue = obj3;
const items6 = [callback4(flag(stateFromStores[4]).View, { style: animatedStyle1 }), ];
obj4 = { style: tmp7.container };
obj5 = { height: tmp3, width: tmp3, style: tmp7.canvas };
obj6 = {};
const obj7 = { id: "underlayGradient", x1: "0", y1: "0.5", x2: "1", y2: "0.5" };
const items7 = [callback4(progress(stateFromStores[5]).Stop, { offset: "0", stopColor: 31 }), callback4(progress(stateFromStores[5]).Stop, { offset: "1", stopColor: 27 })];
obj7.children = items7;
obj6.children = sharedValue2(progress(stateFromStores[5]).LinearGradient, obj7);
const items8 = [callback4(progress(stateFromStores[5]).Defs, obj6), callback4(progress(stateFromStores[5]).Circle, { cx: obj[size] / 2, cy: obj[size] / 2, r: diff, fill: "none", stroke: "url(#underlayGradient)", strokeWidth: tmp2 }), callback4(closure_12, { cx: obj[size] / 2, cy: obj[size] / 2, r: diff, fill: "none", stroke: tmp7.progressPath.color, strokeWidth: tmp2, strokeDasharray: result, strokeLinecap: "round", animatedProps })];
obj5.children = items8;
const items9 = [sharedValue2(progress(stateFromStores[5]).Svg, obj5), , ];
2026-07-20 16:05:17 +00:00
let tmp33 = null;
if (flag2) {
2026-07-23 10:11:24 +00:00
const obj12 = { ref: tmp18, style: tmp19, source: progress(stateFromStores[13]), autoPlay: false, loop: false };
tmp33 = callback4(flag(stateFromStores[12]), obj12);
const tmp37 = flag(stateFromStores[12]);
2026-07-20 16:05:17 +00:00
}
items9[1] = tmp33;
2026-07-23 10:11:24 +00:00
const obj10 = { cx: obj[size] / 2, cy: obj[size] / 2, r: diff, fill: "none", stroke: "url(#underlayGradient)", strokeWidth: tmp2 };
const obj11 = { cx: obj[size] / 2, cy: obj[size] / 2, r: diff, fill: "none", stroke: tmp7.progressPath.color, strokeWidth: tmp2, strokeDasharray: result, strokeLinecap: "round", animatedProps };
const obj8 = { offset: "0", stopColor: 31 };
const obj9 = { offset: "1", stopColor: 27 };
tmp19 = callback(() => {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(_undefined.confetti);
obj["width"] = c3;
obj["height"] = c3;
obj = { scale: c4 };
2026-07-20 16:05:17 +00:00
const items = [obj];
obj["transform"] = items;
return obj;
}, items3);
2026-07-23 10:11:24 +00:00
const tmp25 = callback4;
2026-07-20 16:05:17 +00:00
const tmp27 = sharedValue2;
const tmp31 = sharedValue2;
2026-07-23 10:11:24 +00:00
const tmp32 = sharedValue;
items9[2] = callback4(sharedValue, { style: tmp7.imageContainer, children: callback4(flag(stateFromStores[14]), obj14) });
obj4.children = items9;
items6[1] = tmp31(tmp32, obj4);
2026-07-20 16:05:17 +00:00
obj1.children = items6;
2026-07-23 10:11:24 +00:00
obj["children"] = tmp27(flag(stateFromStores[4]).View, obj1);
2026-07-20 16:05:17 +00:00
return tmp25(PressableOpacity, obj);
});
2026-07-23 10:11:24 +00:00
result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/quests/native/QuestProgressIndicator.tsx");
export default memoResult;
2026-07-20 16:05:17 +00:00
export const QUEST_PROGRESS_DIAMETER_BY_SIZE = obj;