159 lines
10 KiB
TypeScript
159 lines
10 KiB
TypeScript
/* Metro module 14398; source: modules/lurker_mode/native/LurkerPreviewCooldownBadge.tsx; dependencies: [57, 31, 27, 33, 4017, 7744, 4501, 697, 1305, 6929, 3860, 4504, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import Module07744 from '../../../by-id/module-07744.js'; /* Metro dependency 7744 */
|
|
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 NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
|
|
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 TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
|
|
import * as Module07744Module from '../../../by-id/module-07744.js'; /* Metro dependency 7744 */
|
|
|
|
function _fun109035(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:6, offset: 0x0233ad8d, size: 596 bytes, params: 8, frame: 25
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const Math = global.Math;
|
|
const PI = Math.PI;
|
|
const env0_7 = 2 * PI * 6;
|
|
object = {duration: 1000};
|
|
const Easing = (ReanimatedRexportModule).Easing;
|
|
object.easing = Easing.linear;
|
|
const createAnimatedComponent = ReanimatedRexport.createAnimatedComponent;
|
|
const Circle = (Module07744Module).Circle;
|
|
const env0_9 = Reflect.apply(createAnimatedComponent, ReanimatedRexport, [Circle]);
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
const object2 = {'borderRadius': 20, 'backgroundColor': null, 'position': 'absolute'};
|
|
const BACKGROUND_BASE_LOWEST = (Native).colors.BACKGROUND_BASE_LOWEST;
|
|
object2.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
const BADGE_PADDING = (NativeModule).BADGE_PADDING;
|
|
object2.bottom = -BADGE_PADDING;
|
|
object2.right = -BADGE_PADDING;
|
|
object2.padding = BADGE_PADDING;
|
|
object2.height = 22;
|
|
object2.width = 22;
|
|
object2.alignItems = 'center';
|
|
object2.justifyContent = 'center';
|
|
object.outerRing = object2;
|
|
const BACKGROUND_MOD_STRONG = (Native).colors.BACKGROUND_MOD_STRONG;
|
|
object.innerFill = {'borderRadius': 20, 'backgroundColor': null, 'height': 16, 'width': 16, 'alignItems': 'center',
|
|
'justifyContent': 'center', backgroundColor: BACKGROUND_MOD_STRONG};
|
|
object.progressRing = {position: 'absolute', transform: [{rotate: '90deg'}, {scaleX: -1}]};
|
|
const env0_10 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
object = {code: 'function LurkerPreviewCooldownBadgeTsx1(){const{PROGRESS_CIRCUMFERENCE,animatedProgress}=this.__closure;return{strokeDashoffset:PROGRESS_CIRCUMFERENCE*(1-animatedProgress.get())};}'};
|
|
value = value.memo(LurkerPreviewCooldownBadge);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/lurker_mode/native/LurkerPreviewCooldownBadge.tsx');
|
|
exports.default = value;
|
|
exports.useHasExpired = useHasExpired;
|
|
function LurkerPreviewCooldownBadge({expiresAt, totalDurationMs = require(dependencyMap[9]).LURKER_PREVIEW_PERSIST_MS, style}) { // fn#109036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:969, offset: 0x0233afe1, size: 485 bytes, params: 2, frame: 25
|
|
const styles = useStyles();
|
|
const useToken = UseTokenModule.useToken;
|
|
const BACKGROUND_BRAND = (Native).colors.BACKGROUND_BRAND;
|
|
const value2 = Reflect.apply(useToken, UseTokenModule, [BACKGROUND_BRAND]);
|
|
let binding = env0_4;
|
|
const value3 = binding.useCallback(_fun109037, [expiresAt, totalDurationMs]);
|
|
const value4 = (ReanimatedRexportModule).useSharedValue(value3());
|
|
binding.useEffect(_fun109038, [value4, value3]);
|
|
const useAnimatedProps = ReanimatedRexportModule.useAnimatedProps;
|
|
const LurkerPreviewCooldownBadgeP2 = LurkerPreviewCooldownBadgeP;
|
|
binding = env0_7;
|
|
LurkerPreviewCooldownBadgeP2.__closure = {PROGRESS_CIRCUMFERENCE: binding, animatedProgress: value4};
|
|
LurkerPreviewCooldownBadgeP2.__workletHash = 7162520447613;
|
|
LurkerPreviewCooldownBadgeP2.__initData = env0_11;
|
|
return (
|
|
<View
|
|
style={[styles.outerRing, style]}
|
|
pointerEvents="none"
|
|
accessibilityElementsHidden
|
|
importantForAccessibility="no-hide-descendants"
|
|
>
|
|
<View style={styles.innerFill}>
|
|
{((Component) => <Component width={16} height={16} style={styles.progressRing}>{((Component) => <Component cx={8} cy={8} r={6} fill="none" stroke={value2} strokeWidth={4} strokeDasharray={binding} strokeLinecap="butt" animatedProps={Reflect.apply(useAnimatedProps,
|
|
ReanimatedRexportModule,
|
|
[LurkerPreviewCooldownBadgeP2])} />)(env0_9)}</Component>)(Module07744)}
|
|
</View>
|
|
</View>
|
|
);
|
|
function _fun109037() { // fn#109037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:1160, offset: 0x0233b1c6, size: 71 bytes, params: 1, frame: 11
|
|
const expiresAtBinding = expiresAt;
|
|
const Date = global.Date;
|
|
const value = (expiresAtBinding - Date.now()) / env0_1;
|
|
const value3 = 0;
|
|
return 0.9 * (value < value3 ? value3 : value > 1 ? 1 : value);
|
|
}
|
|
|
|
function _fun109038() { // fn#109038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:1278, offset: 0x0233b20d, size: 114 bytes, params: 1, frame: 19
|
|
const set = Module00057.set;
|
|
Reflect.apply(set, Module00057, [TimingModule.withTiming(env0_2(), env1_8, 'animate-always')]);
|
|
const env0_0 = global.setInterval(_fun109039, 1000);
|
|
return _fun109040;
|
|
function _fun109039() { // fn#109039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:1353, offset: 0x0233b27f, size: 74 bytes, params: 1, frame: 18
|
|
const value = environment.__proto__;
|
|
const binding = env1_3;
|
|
const set = binding.set;
|
|
Reflect.apply(set, binding, [TimingModule.withTiming(env1_2(), env2_8, 'animate-always')]);
|
|
}
|
|
|
|
function _fun109040() { // fn#109040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:1422, offset: 0x01f6d8c0, size: 24 bytes, params: 1, frame: 11
|
|
global.clearInterval(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
function LurkerPreviewCooldownBadgeP() { // fn#109041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:1491, owner: LurkerPreviewCooldownBadge.p, offset: 0x0233b2c9, size: 43 bytes, params: 1, frame: 11
|
|
const object = {};
|
|
const value = environment.__proto__;
|
|
object.strokeDashoffset = env1_7 * (1 - Module00057.get());
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function useHasExpired(a0) { // fn#109042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:2111, offset: 0x0233b2f4, size: 99 bytes, params: 2, frame: 17
|
|
const env0_0 = a0;
|
|
const binding = env0_4;
|
|
const value = Module00057(binding.useState(null), 2);
|
|
const property = value[0];
|
|
const env0_1 = value[1];
|
|
binding.useEffect(_fun109043, [a0]);
|
|
return a0 != null && property === a0;
|
|
function _fun109043() { // fn#109043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:2203, offset: 0x0233b357, size: 97 bytes, params: 1, frame: 16
|
|
var Math;
|
|
var max;
|
|
var binding;
|
|
var Date;
|
|
var value;
|
|
if (env0_0 != null) {
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
binding = env0_0;
|
|
Date = global.Date;
|
|
value = binding - Date.now();
|
|
value = Reflect.apply(max, Math, [0, value]);
|
|
var env0_0 = global.setTimeout(_fun109044, value);
|
|
return _fun109045;
|
|
}
|
|
function _fun109044() { // fn#109044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:2265, offset: 0x02012732, size: 20 bytes, params: 1, frame: 11
|
|
return env1_1(env1_0);
|
|
}
|
|
|
|
function _fun109045() { // fn#109045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14595:2284, offset: 0x016d7e7e, size: 24 bytes, params: 1, frame: 11
|
|
return global.clearTimeout(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun109035, 14398, [57, 31, 27, 33, 4017, 7744, 4501, 697, 1305, 6929, 3860, 4504,
|
|
2]) /* metro module 14398, dependencies: [57, 31, 27, 33, 4017, 7744, 4501, 697, 1305, 6929, 3860, 4504, 2] */;
|