/* Metro module 15327; source: modules/launchpad/native/shared/SimpleGuildContainer.tsx; dependencies: [31, 27, 33, 4501, 9608, 14421, 697, 15326, 3860, 15328, 4017, 4577, 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 UseSimpleGuildDefaultColors from './useSimpleGuildDefaultColors.tsx'; /* Metro dependency 15326 */
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 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 SpringModule from '../../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
function _fun117214(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:6, offset: 0x024a8cd3, size: 392 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_9 = {'mass': 0.2, 'damping': 40, 'stiffness': 300, 'overshootClamping': true, 'restSpeedThreshold': 1};
const env0_10 = (CreateStylesModule).createStyles({badgeWrapper: {'position': 'absolute',
'right': -4, 'bottom': 0}});
const env0_11 = ReactModule.memo(_fun117215);
const env0_12 = ReactModule.memo(_fun117216);
object = {code: 'function SimpleGuildContainerTsx1(){const{targetRadius}=this.__closure;return targetRadius;}'};
object = {code: 'function SimpleGuildContainerTsx2(){const{selected}=this.__closure;return selected?1:0;}'};
object = {code: "function SimpleGuildContainerTsx3(){const{withSpring,toRadius,springConfig,GUILD_SIZE,iconBackground}=this.__closure;return{borderRadius:withSpring(toRadius.get(),springConfig),width:GUILD_SIZE,height:GUILD_SIZE,overflow:'hidden',backgroundColor:iconBackground.color};}"};
object = {code: "function SimpleGuildContainerTsx4(){const{withSpring,toRadius,springConfig,interpolate,toStrokeWidth,borderColor,GUILD_SIZE}=this.__closure;return{borderRadius:withSpring(toRadius.get()+2,springConfig),borderWidth:withSpring(interpolate(toStrokeWidth.get(),[0,1],[0,2]),springConfig),borderColor:borderColor,position:'absolute',top:-2,left:-2,width:GUILD_SIZE+4,height:GUILD_SIZE+4};}"};
object = {code: "function SimpleGuildContainerTsx5(){const{withSpring,toRadius,springConfig,interpolate,toStrokeWidth,backgroundColor,GUILD_SIZE}=this.__closure;return{borderRadius:withSpring(toRadius.get(),springConfig),borderWidth:withSpring(interpolate(toStrokeWidth.get(),[0,1],[0,3]),springConfig),borderColor:backgroundColor,position:'absolute',top:0,left:0,width:GUILD_SIZE,height:GUILD_SIZE};}"};
(FileImportTrackerModule).fileFinishedImporting('modules/launchpad/native/shared/SimpleGuildContainer.tsx');
exports.SimpleGuildContainer = SimpleGuildContainer;
exports.SimpleGuildContainerAnimated = SimpleGuildContainerAnimated;
function _fun117215({badge, unread, backgroundColor}) { // fn#117215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:352, offset: 0x024a8e5b, size: 117 bytes, params: 2, frame: 20
var r0;
var value;
const styles = useStyles();
if (badge <= 0) {
if (unread) {
var viewBindingProps = {style: styles.badgeWrapper};
value = importDefault(9608) /* metro dependency 9608: MaskedBadge */;
value = (
{((Component) => )(value)}
);
r0 = value;
} else {
r0 = null;
}
} else {
var viewBindingProps = {style: styles.badgeWrapper};
value = importDefault(9608) /* metro dependency 9608: MaskedBadge */;
value = (
{((Component) => )(value)}
);
r0 = value;
}
return r0;
}
function _fun117216({guildId, activityIndicatorState, backgroundColor}) { // fn#117216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:528, offset: 0x024a8ed0, size: 183 bytes, params: 2, frame: 18
var r0;
let value = null;
if (value != (value == activityIndicatorState ? undefined : activityIndicatorState.source)) {
const GuildsBarActivityIndicatorBase = (require(14421) /* metro dependency 14421: GuildsBarActivityIndicator */).GuildsBarActivityIndicatorBase;
r0 = (
);
} else if (value != guildId) {
value = importDefault(14421) /* metro dependency 14421: GuildsBarActivityIndicator */;
value = ((Component) => )(value);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function SimpleGuildContainer({guildIconRef, guildId, style, children, selected, size, borderRadius = selected ? importDefault(dependencyMap[6]).radii.lg : 24, badge, unread, backgroundColor, folder, usingCutout, activityIndicatorState, accessibilityLabel, onAccessibilityAction, onLayout}) { // fn#117217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:2256, offset: 0x024a8f87, size: 651 bytes, params: 2, frame: 36
size = size === undefined ? 48 : size;
const badge2 = badge;
folder = !(folder === undefined) && folder;
usingCutout = !(usingCutout === undefined) && usingCutout;
const {iconStroke,
iconBackground} = (UseSimpleGuildDefaultColors)();
const useToken = UseTokenModule.useToken;
const BACKGROUND_BRAND = (Native).colors.BACKGROUND_BRAND;
return (
{children}
{badge2.useMemo(_fun117219, [borderRadius, usingCutout, size, iconStroke])}
{badge2.useMemo(_fun117218, [selected, usingCutout, activityIndicatorState?.source, badge, unread, size,
Reflect.apply(useToken, UseTokenModule, [BACKGROUND_BRAND]), borderRadius, backgroundColor])}
{((Component) => )(env0_12)}
{((Component) => )(env0_11)}
);
function _fun117218() { // fn#117218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:2653, offset: 0x024a9212, size: 397 bytes, params: 1, frame: 24
var source;
var r6;
var r1;
var r0;
var usingCutoutBinding;
var value3;
var jsxRuntimeEnv1_7Binding;
var binding;
var sizeBinding;
var items2;
var value5;
var CutoutImage;
var value6;
const selectedBinding = selected;
const value2 = null;
if (selectedBinding) {
usingCutoutBinding = usingCutout;
value3 = environment.__proto__;
if (usingCutoutBinding) {
value5 = undefined;
CutoutImage = importDefault(15328) /* metro dependency 15328: CutoutImage */;
var defaultImportProps = {'style': null, 'cutoutTopRightSize': null, 'cutoutTopRightInsetX': 8,
'cutoutTopRightInsetY': 8, 'cutoutBottomRightSize': null, 'cutoutBottomRightInsetX': 6,
'cutoutBottomRightInsetY': 7, style: {'position': 'absolute', 'top': -2, 'left': -2}};
source = value2 == activityIndicatorState ? value5 : activityIndicatorState.source;
value6 = 0;
r6 = value2 != source ? 13 : value6;
defaultImportProps.cutoutTopRightSize = r6;
r6 = badge > value6 ? 13 : unread ? 11 : value6;
defaultImportProps.cutoutBottomRightSize = r6;
sizeBinding = size;
defaultImportProps.imageSize = sizeBinding + 4;
defaultImportProps.imageBackgroundColor = env0_9;
defaultImportProps.imageBorderRadius = env0_2 + 2;
defaultImportProps.clipInnerAmount = sizeBinding;
r1 = ;
} else {
jsxRuntimeEnv1_7Binding = jsxRuntimeEnv1_7;
binding = env0_2;
sizeBinding = size;
items2 = [
,
];
items2[1] = (
);
r1 = (
<>
{items2}
>
);
}
r0 = r1;
} else {
r0 = value2;
}
return r0;
}
function _fun117219() { // fn#117219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:3288, offset: 0x024a939f, size: 87 bytes, params: 1, frame: 16
return (
usingCutout
? null
: (
)
);
}
}
function SimpleGuildContainerAnimated(a0) { // fn#117220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:3862, offset: 0x024a93f6, size: 1055 bytes, params: 2, frame: 42
const guildIconRef = a0.guildIconRef;
const guildId = a0.guildId;
const style = a0.style;
const children = a0.children;
const selected = a0.selected;
a0.size;
const borderRadius = a0.borderRadius;
const badge = a0.badge;
const unread = a0.unread;
const backgroundColor = a0.backgroundColor;
a0.folder;
a0.usingCutout;
const activityIndicatorState = a0.activityIndicatorState;
const accessibilityLabel = a0.accessibilityLabel;
const onAccessibilityAction = a0.onAccessibilityAction;
const onLayout = a0.onLayout;
const onPress = a0.onPress;
const onLongPress = a0.onLongPress;
const iconBackground = (UseSimpleGuildDefaultColors)().iconBackground;
const r16 = selected ? (importDefault(697) /* metro dependency 697: native */).radii.lg : borderRadius ?? 24;
let useDerivedValue = ReanimatedRexportModule.useDerivedValue;
let closure = SimpleGuildContainerAnimatedV;
closure.__closure = {targetRadius: r16};
closure.__workletHash = 5259600477627;
closure.__initData = env0_13;
const value3 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
useDerivedValue = ReanimatedRexportModule.useDerivedValue;
closure = SimpleGuildContainerAnimatedZ;
closure.__closure = {selected: selected};
closure.__workletHash = 12318204664732;
closure.__initData = env0_14;
const value4 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
let useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = SimpleGuildContainerAnimatedH;
object = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, toRadius: value3};
const binding = env0_9;
object.springConfig = binding;
object.GUILD_SIZE = 48;
object.iconBackground = iconBackground;
closure.__closure = object;
closure.__workletHash = 11339684212259;
closure.__initData = env0_15;
const value5 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const BRAND_500 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BRAND_500;
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = SimpleGuildContainerAnimatedJ;
closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, toRadius: value3,
springConfig: binding, interpolate: ReanimatedRexportModule.interpolate, toStrokeWidth: value4,
borderColor: BRAND_500, GUILD_SIZE: 48};
closure.__workletHash = 1481885125958;
closure.__initData = env0_16;
const value6 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = SimpleGuildContainerAnimatedM;
closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, toRadius: value3,
springConfig: binding, interpolate: ReanimatedRexportModule.interpolate, toStrokeWidth: value4,
backgroundColor: backgroundColor, GUILD_SIZE: 48};
closure.__workletHash = 11592745547551;
closure.__initData = env0_17;
const value7 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const jsxRuntimeEnv0_7Binding = jsxRuntimeEnv0_7;
const View2 = (ReanimatedRexport).View;
const items2 = [
{children}
,
];
const View3 = (ReanimatedRexport).View;
items2[1] = ;
const View4 = (ReanimatedRexport).View;
items2[2] = ;
items2[3] = ((Component) => )(env0_12);
items2[4] = ((Component) => )(env0_11);
const fragment = (
<>
{items2}
>
);
return (
onPress != null
? (
{fragment}
)
: (
{fragment}
)
);
function SimpleGuildContainerAnimatedV() { // fn#117221, owner: SimpleGuildContainerAnimated.V, offset: 0x00c7c381, size: 9 bytes, params: 1, frame: 1
return env0_3;
}
function SimpleGuildContainerAnimatedZ() { // fn#117222, owner: SimpleGuildContainerAnimated.z, offset: 0x024a9815, size: 17 bytes, params: 1, frame: 2
return selected ? 1 : 0;
}
function SimpleGuildContainerAnimatedH() { // fn#117223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:4478, owner: SimpleGuildContainerAnimated.H, offset: 0x024a9826, size: 91 bytes, params: 1, frame: 16
const object = {'borderRadius': null, 'width': 48, 'height': 48, 'overflow': 'hidden'};
object.borderRadius = SpringModule.withSpring(ReactNativeModule.Pressable.get(), env1_9);
object.backgroundColor = iconBackground.color;
return object;
}
function SimpleGuildContainerAnimatedJ() { // fn#117224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:4807, owner: SimpleGuildContainerAnimated.j, offset: 0x024a9881, size: 179 bytes, params: 1, frame: 21
const object = {'borderRadius': null, 'borderWidth': null, 'borderColor': null, 'position': 'absolute', 'top': -2,
'left': -2, 'width': 52, 'height': 52};
let value = environment.__proto__;
let withSpring = SpringModule.withSpring;
let binding = ReactNativeModule.Pressable;
const value4 = binding.get() + 2;
binding = env1_9;
object.borderRadius = Reflect.apply(withSpring, SpringModule, [value4, binding]);
value = SpringModule;
withSpring = value.withSpring;
object.borderWidth = Reflect.apply(withSpring, value, [ReanimatedRexportModule.interpolate(ReactNativeModule.View.get(), [0, 1], [0,
2]), binding]);
object.borderColor = BRAND_500;
return object;
}
function SimpleGuildContainerAnimatedM() { // fn#117225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15524:5233, owner: SimpleGuildContainerAnimated.M, offset: 0x024a9934, size: 172 bytes, params: 1, frame: 21
const object = {'borderRadius': null, 'borderWidth': null, 'borderColor': null, 'position': 'absolute', 'top': 0,
'left': 0, 'width': 48, 'height': 48};
let value = environment.__proto__;
let withSpring = SpringModule.withSpring;
let binding = ReactNativeModule.Pressable;
const value3 = binding.get();
binding = env1_9;
object.borderRadius = Reflect.apply(withSpring, SpringModule, [value3, binding]);
value = SpringModule;
withSpring = value.withSpring;
object.borderWidth = Reflect.apply(withSpring, value, [ReanimatedRexportModule.interpolate(ReactNativeModule.View.get(), [0, 1], [0,
3]), binding]);
object.borderColor = backgroundColor;
return object;
}
}
}
global.__d(_fun117214, 15327, [31, 27, 33, 4501, 9608, 14421, 697, 15326, 3860, 15328, 4017, 4577,
2]) /* metro module 15327, dependencies: [31, 27, 33, 4501, 9608, 14421, 697, 15326, 3860, 15328, 4017, 4577, 2] */;