558 lines
28 KiB
TypeScript
558 lines
28 KiB
TypeScript
// Module ID: 14012
|
|
// Function ID: 14013
|
|
// Name: BadgeTileContent
|
|
// Dependencies: [19, 17, 8331, 1922, 8853, 676, 1924, 21, 4342, 712, 14011, 5437, 14009, 5446, 4083, 4343, 4346, 5488, 13989, 1236, 589, 4007, 5789, 5809, 5771, 8685, 8686, 698, 8856, 13990, 8562, 1493, 14013, 4338, 5884, 5458, 5457, 2]
|
|
// Exports: default
|
|
|
|
// Module 14012 (BadgeTileContent)
|
|
import importAllResult from "getSystemLocale";
|
|
import { View } from "LegacyBaseButton";
|
|
import handleFormOpen from "handleFormOpen";
|
|
import mergeGuildAvatar from "mergeGuildAvatar";
|
|
import map from "map";
|
|
import ME from "ME";
|
|
import { PremiumUpsellTypes } from "GuildFeatures";
|
|
import jsxProd from "getPremiumPlanItem";
|
|
import createCacheKey from "createCacheKey";
|
|
import createCacheKey from "createCacheKey";
|
|
|
|
let c10;
|
|
let c9;
|
|
let closure_14;
|
|
let map1;
|
|
let metroImportAll;
|
|
let unpackModuleId;
|
|
const require = arg1;
|
|
function BadgeTileContent(badge) {
|
|
let showGrip = badge.showGrip;
|
|
const tmp = callback2();
|
|
let obj = { variant: "secondary", border: "none", radius: 16, style: tmp.card, children: null };
|
|
obj = { badge: badge.badge, size: null };
|
|
obj[1] = require(14011) /* PX_16 */.BADGE_TILE_ICON_SIZE;
|
|
const items = [callback(importDefault(14009), obj), ];
|
|
if (showGrip) {
|
|
obj = { style: null, "aria-hidden": true, children: null };
|
|
obj[0] = tmp.grip;
|
|
obj[2] = tmp5(require(5446) /* DragIcon */.DragIcon, { size: "sm" });
|
|
showGrip = tmp5(View, obj);
|
|
}
|
|
items[1] = showGrip;
|
|
obj[4] = items;
|
|
return closure_14(require(5437) /* PressableCard */.Card, obj);
|
|
}
|
|
let c3 = importAllResult;
|
|
({ AnalyticEvents: metroImportAll, AnalyticsObjects: c9, AnalyticsPages: c10, AnalyticsSections: unpackModuleId } = ME);
|
|
({ jsx: map1, jsxs: closure_14 } = jsxProd);
|
|
let obj = { gridInset: null, grid: null, gridDisabled: null, upsell: null, upsellCard: null, upsellContent: null, upsellCta: null, upsellText: null, message: null, messageText: null };
|
|
obj = { paddingHorizontal: require("Themes").space.PX_16, paddingBottom: require("Themes").space.PX_16 };
|
|
obj[0] = obj;
|
|
createCacheKey = { position: "relative", width: "100%", marginTop: require("Themes").space.PX_8 };
|
|
obj[1] = createCacheKey;
|
|
obj[2] = { opacity: 0.5 };
|
|
obj[3] = { marginHorizontal: 0, marginTop: require("Themes").space.PX_8, marginBottom: require("Themes").space.PX_16 };
|
|
let obj2 = { marginHorizontal: 0, marginTop: require("Themes").space.PX_8, marginBottom: require("Themes").space.PX_16 };
|
|
obj[4] = { backgroundColor: require("Themes").colors.BACKGROUND_SURFACE_HIGHEST };
|
|
let obj3 = { backgroundColor: require("Themes").colors.BACKGROUND_SURFACE_HIGHEST };
|
|
obj[5] = { paddingVertical: require("Themes").space.PX_16, paddingHorizontal: require("Themes").space.PX_16 };
|
|
let obj4 = { paddingVertical: require("Themes").space.PX_16, paddingHorizontal: require("Themes").space.PX_16 };
|
|
obj[6] = { marginTop: require("Themes").space.PX_12, borderRadius: require("Themes").radii.sm };
|
|
obj[7] = { textAlign: "center" };
|
|
let obj5 = { marginTop: require("Themes").space.PX_12, borderRadius: require("Themes").radii.sm };
|
|
obj[8] = { alignItems: "center", justifyContent: "center", paddingHorizontal: require("Themes").space.PX_16, paddingVertical: require("Themes").space.PX_32 };
|
|
obj[9] = { textAlign: "center" };
|
|
let closure_15 = createCacheKey.createStyles(obj);
|
|
let obj7 = { position: { position: "absolute", top: 0, left: 0 }, card: { flex: 1, alignItems: "center", justifyContent: "center", padding: 0 }, grip: null };
|
|
let obj6 = { alignItems: "center", justifyContent: "center", paddingHorizontal: require("Themes").space.PX_16, paddingVertical: require("Themes").space.PX_32 };
|
|
obj7[2] = { position: "absolute", top: require("Themes").space.PX_4, end: 0, width: 32, height: 32, alignItems: "center", justifyContent: "center" };
|
|
let closure_16 = createCacheKey.createStyles(obj7);
|
|
function getSlotOffset(arg0, arg1) {
|
|
const obj = { x: null, y: null };
|
|
const result = arg0 % require(14011) /* PX_16 */.BADGE_GRID_COLUMNS;
|
|
obj[0] = result * (arg1 + require(14011) /* PX_16 */.BADGE_GRID_GAP);
|
|
const rounded = Math.floor(arg0 / require(14011) /* PX_16 */.BADGE_GRID_COLUMNS);
|
|
obj[1] = rounded * (arg1 + require(14011) /* PX_16 */.BADGE_GRID_GAP);
|
|
return obj;
|
|
}
|
|
let obj8 = { position: "absolute", top: require("Themes").space.PX_4, end: 0, width: 32, height: 32, alignItems: "center", justifyContent: "center" };
|
|
getSlotOffset.__closure = { BADGE_GRID_COLUMNS: require("PX_16").BADGE_GRID_COLUMNS, BADGE_GRID_GAP: require("PX_16").BADGE_GRID_GAP };
|
|
getSlotOffset.__workletHash = 3984288658776;
|
|
getSlotOffset.__initData = { code: "function getSlotOffset_ReorderBadgesSheetTsx1(index,tileSize){const{BADGE_GRID_COLUMNS,BADGE_GRID_GAP}=this.__closure;const column=index%BADGE_GRID_COLUMNS;return{x:column*(tileSize+BADGE_GRID_GAP),y:Math.floor(index/BADGE_GRID_COLUMNS)*(tileSize+BADGE_GRID_GAP)};}" };
|
|
let closure_19 = importAllResult.memo((arg0) => {
|
|
let badge;
|
|
let index;
|
|
let showGrip;
|
|
let tileSize;
|
|
({ badge, index, tileSize, showGrip } = arg0);
|
|
if (showGrip === undefined) {
|
|
showGrip = false;
|
|
}
|
|
if (typeof getSlotOffset !== "function") {
|
|
HermesBuiltin.throwTypeError();
|
|
}
|
|
const result = index % require(14011) /* PX_16 */.BADGE_GRID_COLUMNS;
|
|
const result1 = result * (tileSize + require(14011) /* PX_16 */.BADGE_GRID_GAP);
|
|
const rounded = Math.floor(index / require(14011) /* PX_16 */.BADGE_GRID_COLUMNS);
|
|
let obj = { accessible: true, accessibilityLabel: badge.name, style: null, children: null };
|
|
const items = [callback2().position, ];
|
|
obj = { width: tileSize, height: tileSize, transform: null };
|
|
const items1 = [{ translateX: result1 }, ];
|
|
obj = { translateY: rounded * (tileSize + require(14011) /* PX_16 */.BADGE_GRID_GAP) };
|
|
items1[1] = obj;
|
|
obj[2] = items1;
|
|
items[1] = obj;
|
|
obj[2] = items;
|
|
obj[3] = callback(BadgeTileContent, { badge, showGrip });
|
|
return callback(View, obj);
|
|
});
|
|
let closure_20 = { code: "function ReorderBadgesSheetTsx2(){const{orderShared,badgeId,getSlotOffset,slotOffset,tileSize}=this.__closure;const slot=orderShared.get().indexOf(badgeId);return slot<0?null:getSlotOffset(slot+slotOffset,tileSize);}" };
|
|
let closure_21 = { code: "function ReorderBadgesSheetTsx3(target,previousTarget){const{isDraggingShared,translateX,withTiming,timingStandard,translateY}=this.__closure;if(target==null||isDraggingShared.get()){return;}if(target.x!==(previousTarget===null||previousTarget===void 0?void 0:previousTarget.x)){translateX.set(withTiming(target.x,timingStandard));}if(target.y!==(previousTarget===null||previousTarget===void 0?void 0:previousTarget.y)){translateY.set(withTiming(target.y,timingStandard));}}" };
|
|
let closure_22 = { code: "function ReorderBadgesSheetTsx4(){const{isDraggingShared,orderShared,badgeId,getSlotOffset,slotOffset,tileSize,translateX,withTiming,timingStandard,translateY,scale,isDragActive,runOnJS,onCommitOrder}=this.__closure;if(!isDraggingShared.get()){return;}const order=orderShared.get();const slot=order.indexOf(badgeId);if(slot>=0){const target=getSlotOffset(slot+slotOffset,tileSize);translateX.set(withTiming(target.x,timingStandard));translateY.set(withTiming(target.y,timingStandard));}scale.set(withTiming(1,timingStandard));isDraggingShared.set(false);isDragActive.set(false);runOnJS(onCommitOrder)(order);}" };
|
|
let closure_23 = { code: "function ReorderBadgesSheetTsx5(event){const{isDraggingShared,translateX,translateY,orderShared,tileSize,BADGE_GRID_GAP,clamp,BADGE_GRID_COLUMNS,slotOffset,moveBadgeInDisplayOrder,badgeId}=this.__closure;if(!isDraggingShared.get()){return;}const x=translateX.get()+event.changeX;const y=translateY.get()+event.changeY;translateX.set(x);translateY.set(y);const order=orderShared.get();const step=tileSize+BADGE_GRID_GAP;const column=clamp(Math.floor((x+tileSize/2)/step),0,BADGE_GRID_COLUMNS-1);const row=Math.max(Math.floor((y+tileSize/2)/step),0);const to=clamp(row*BADGE_GRID_COLUMNS+column-slotOffset,0,order.length-1);const next=moveBadgeInDisplayOrder(order,order.indexOf(badgeId),to);if(next!==order){orderShared.set(next);}}" };
|
|
let closure_24 = { code: "function ReorderBadgesSheetTsx6(){const{isDragActive,isDraggingShared,scale,withTiming,DRAG_SCALE,timingStandard}=this.__closure;if(isDragActive.get()){return;}isDragActive.set(true);isDraggingShared.set(true);scale.set(withTiming(DRAG_SCALE,timingStandard));}" };
|
|
let closure_25 = { code: "function ReorderBadgesSheetTsx7(){const{isDraggingShared,translateX,translateY,scale}=this.__closure;return{zIndex:isDraggingShared.get()?10:0,transform:[{translateX:translateX.get()},{translateY:translateY.get()},{scale:scale.get()}]};}" };
|
|
let closure_26 = importAllResult.memo((slotOffset) => {
|
|
let badge;
|
|
let index;
|
|
let tileSize;
|
|
({ badge, index, tileSize } = slotOffset);
|
|
slotOffset = slotOffset.slotOffset;
|
|
const orderShared = slotOffset.orderShared;
|
|
const isDragActive = slotOffset.isDragActive;
|
|
const onCommitOrder = slotOffset.onCommitOrder;
|
|
let badge_id;
|
|
let sharedValue;
|
|
let sharedValue1;
|
|
let sharedValue2;
|
|
let sharedValue3;
|
|
badge_id = badge.badge_id;
|
|
let obj = tileSize(orderShared[14]);
|
|
sharedValue = obj.useSharedValue(false);
|
|
if (typeof getSlotOffset !== "function") {
|
|
HermesBuiltin.throwTypeError();
|
|
}
|
|
let result = index % tmp2(tmp3[10]).BADGE_GRID_COLUMNS;
|
|
let result1 = result * (tileSize + tmp2(tmp3[10]).BADGE_GRID_GAP);
|
|
let rounded = Math.floor(index / tmp2(tmp3[10]).BADGE_GRID_COLUMNS);
|
|
let result2 = rounded * (tileSize + tmp2(tmp3[10]).BADGE_GRID_GAP);
|
|
let tmp2Result = tmp2(tmp3[14]);
|
|
sharedValue1 = tmp2Result.useSharedValue(result1);
|
|
tmp2Result = tmp2(tmp3[14]);
|
|
sharedValue2 = tmp2Result.useSharedValue(result2);
|
|
const tmp = callback2();
|
|
const tmp5 = getSlotOffset;
|
|
sharedValue3 = tileSize(orderShared[14]).useSharedValue(1);
|
|
const tmp2Result1 = tileSize(orderShared[14]);
|
|
let fn = function u() {
|
|
const value = orderShared.get();
|
|
const index = value.indexOf(badge_id);
|
|
let tmp2 = null;
|
|
if (index >= 0) {
|
|
const sum = index + slotOffset;
|
|
if (typeof outer1_17 !== "function") {
|
|
HermesBuiltin.throwTypeError();
|
|
}
|
|
const obj = { x: null, y: null };
|
|
const result = sum % tileSize(orderShared[10]).BADGE_GRID_COLUMNS;
|
|
obj[0] = result * (tileSize + tileSize(orderShared[10]).BADGE_GRID_GAP);
|
|
const _Math = Math;
|
|
const rounded = Math.floor(sum / tileSize(orderShared[10]).BADGE_GRID_COLUMNS);
|
|
obj[1] = rounded * (tileSize + tileSize(orderShared[10]).BADGE_GRID_GAP);
|
|
tmp2 = obj;
|
|
}
|
|
return tmp2;
|
|
};
|
|
fn.__closure = { orderShared, badgeId: badge_id, getSlotOffset: tmp5, slotOffset, tileSize };
|
|
fn.__workletHash = 13884542984272;
|
|
fn.__initData = closure_20;
|
|
let fn2 = function h(arg0, arg1) {
|
|
let value = null == arg0;
|
|
if (!value) {
|
|
value = sharedValue.get();
|
|
}
|
|
if (!value) {
|
|
let x;
|
|
if (arg1 != null) {
|
|
x = arg1.x;
|
|
}
|
|
if (arg0.x !== x) {
|
|
const result = sharedValue1.set(tileSize(orderShared[15]).withTiming(arg0.x, tileSize(orderShared[16]).timingStandard));
|
|
const obj = tileSize(orderShared[15]);
|
|
}
|
|
let y;
|
|
if (arg1 != null) {
|
|
y = arg1.y;
|
|
}
|
|
if (arg0.y !== y) {
|
|
const result1 = sharedValue2.set(tileSize(orderShared[15]).withTiming(arg0.y, tileSize(orderShared[16]).timingStandard));
|
|
const obj2 = tileSize(orderShared[15]);
|
|
}
|
|
}
|
|
};
|
|
obj = { isDraggingShared: sharedValue, translateX: sharedValue1, withTiming: tmp2(tmp3[15]).withTiming, timingStandard: tmp2(tmp3[16]).timingStandard, translateY: sharedValue2 };
|
|
fn2.__closure = obj;
|
|
fn2.__workletHash = 14524703799805;
|
|
fn2.__initData = closure_21;
|
|
const animatedReaction = tileSize(orderShared[14]).useAnimatedReaction(fn, fn2);
|
|
let items = [badge_id, tileSize, slotOffset, orderShared, isDragActive, onCommitOrder, sharedValue, sharedValue3, sharedValue1, sharedValue2];
|
|
const memo = isDragActive.useMemo(() => {
|
|
const Gesture = tileSize(orderShared[17]).Gesture;
|
|
let result = Gesture.Pan().activateAfterLongPress(150);
|
|
const fn = function s() {
|
|
if (!store2.get()) {
|
|
const result = store2.set(true);
|
|
const result1 = store3.set(true);
|
|
const result2 = store6.set(outer1_0(outer1_2[15]).withTiming(1.05, outer1_0(outer1_2[16]).timingStandard));
|
|
const obj2 = outer1_0(outer1_2[15]);
|
|
}
|
|
};
|
|
let obj = { isDragActive, isDraggingShared: sharedValue, scale: sharedValue3, withTiming: tileSize(orderShared[15]).withTiming, DRAG_SCALE: 1.05, timingStandard: tileSize(orderShared[16]).timingStandard };
|
|
fn.__closure = obj;
|
|
fn.__workletHash = 2325334638758;
|
|
fn.__initData = outer1_24;
|
|
const PanResult = Gesture.Pan();
|
|
const fn2 = function n(changeX) {
|
|
if (store3.get()) {
|
|
const sum = store4.get() + changeX.changeX;
|
|
const sum1 = store5.get() + changeX.changeY;
|
|
const result = store4.set(sum);
|
|
const result1 = store5.set(sum1);
|
|
const value = store.get();
|
|
const sum2 = closure_0 + outer1_0(outer1_2[10]).BADGE_GRID_GAP;
|
|
const _Math = Math;
|
|
const rounded = Math.floor((sum + closure_0 / 2) / sum2);
|
|
const _Math2 = Math;
|
|
const _Math3 = Math;
|
|
const obj = store;
|
|
const obj2 = outer1_0(outer1_2[14]);
|
|
const bound = Math.max(Math.floor((sum1 + closure_0 / 2) / sum2), 0);
|
|
const clampResult = outer1_0(outer1_2[14]).clamp(rounded, 0, outer1_0(outer1_2[10]).BADGE_GRID_COLUMNS - 1);
|
|
const obj3 = outer1_0(outer1_2[14]);
|
|
const clampResult1 = outer1_0(outer1_2[14]).clamp(bound * outer1_0(outer1_2[10]).BADGE_GRID_COLUMNS + clampResult - closure_1, 0, value.length - 1);
|
|
const result2 = outer1_0(outer1_2[18]).moveBadgeInDisplayOrder(value, value.indexOf(handleFormOpen), clampResult1);
|
|
if (result2 !== value) {
|
|
const result3 = obj.set(result2);
|
|
}
|
|
const obj4 = outer1_0(outer1_2[18]);
|
|
}
|
|
};
|
|
obj = { isDraggingShared: sharedValue, translateX: sharedValue1, translateY: sharedValue2, orderShared, tileSize, BADGE_GRID_GAP: tileSize(orderShared[10]).BADGE_GRID_GAP, clamp: tileSize(orderShared[14]).clamp, BADGE_GRID_COLUMNS: tileSize(orderShared[10]).BADGE_GRID_COLUMNS, slotOffset, moveBadgeInDisplayOrder: tileSize(orderShared[18]).moveBadgeInDisplayOrder, badgeId: badge_id };
|
|
fn2.__closure = obj;
|
|
fn2.__workletHash = 15635480740882;
|
|
fn2.__initData = outer1_23;
|
|
const onStartResult = result.onStart(fn);
|
|
const fn3 = function t() {
|
|
if (store3.get()) {
|
|
const value = store.get();
|
|
const index = value.indexOf(handleFormOpen);
|
|
if (index >= 0) {
|
|
const sum = index + closure_1;
|
|
if (typeof outer1_17 !== "function") {
|
|
HermesBuiltin.throwTypeError();
|
|
}
|
|
const result = sum % outer1_0(outer1_2[10]).BADGE_GRID_COLUMNS;
|
|
const _Math = Math;
|
|
const result1 = result * (tmp45 + outer1_0(outer1_2[10]).BADGE_GRID_GAP);
|
|
const rounded = Math.floor(sum / outer1_0(outer1_2[10]).BADGE_GRID_COLUMNS);
|
|
const result2 = rounded * (tmp45 + outer1_0(outer1_2[10]).BADGE_GRID_GAP);
|
|
const result3 = store4.set(outer1_0(outer1_2[15]).withTiming(result1, outer1_0(outer1_2[16]).timingStandard));
|
|
const obj2 = outer1_0(outer1_2[15]);
|
|
const result4 = store5.set(outer1_0(outer1_2[15]).withTiming(result2, outer1_0(outer1_2[16]).timingStandard));
|
|
const obj3 = outer1_0(outer1_2[15]);
|
|
}
|
|
const result5 = store6.set(outer1_0(outer1_2[15]).withTiming(1, outer1_0(outer1_2[16]).timingStandard));
|
|
const result6 = store3.set(false);
|
|
const result7 = store2.set(false);
|
|
const obj4 = outer1_0(outer1_2[15]);
|
|
outer1_0(outer1_2[14]).runOnJS(closure_4)(value);
|
|
const obj5 = outer1_0(outer1_2[14]);
|
|
}
|
|
};
|
|
const onChangeResult = result.onStart(fn).onChange(fn2);
|
|
fn3.__closure = { isDraggingShared: sharedValue, orderShared, badgeId: badge_id, getSlotOffset: outer1_17, slotOffset, tileSize, translateX: sharedValue1, withTiming: tileSize(orderShared[15]).withTiming, timingStandard: tileSize(orderShared[16]).timingStandard, translateY: sharedValue2, scale: sharedValue3, isDragActive, runOnJS: tileSize(orderShared[14]).runOnJS, onCommitOrder };
|
|
fn3.__workletHash = 9865743803464;
|
|
fn3.__initData = outer1_22;
|
|
return onChangeResult.onFinalize(fn3);
|
|
}, items);
|
|
const tmp2Result2 = tileSize(orderShared[14]);
|
|
let fn3 = function w() {
|
|
let num = 0;
|
|
if (sharedValue.get()) {
|
|
num = 10;
|
|
}
|
|
let obj = { zIndex: num, transform: null };
|
|
obj = { translateX: sharedValue1.get() };
|
|
const items = [obj, , ];
|
|
obj = { translateY: sharedValue2.get() };
|
|
items[1] = obj;
|
|
items[2] = { scale: sharedValue3.get() };
|
|
obj[1] = items;
|
|
return obj;
|
|
};
|
|
fn3.__closure = { isDraggingShared: sharedValue, translateX: sharedValue1, translateY: sharedValue2, scale: sharedValue3 };
|
|
fn3.__workletHash = 2799732598078;
|
|
fn3.__initData = closure_25;
|
|
const animatedStyle = tileSize(orderShared[14]).useAnimatedStyle(fn3);
|
|
obj = { gesture: memo, children: null };
|
|
const obj1 = { accessible: true, accessibilityLabel: badge.name, accessibilityHint: null, style: null, children: null };
|
|
const intl = tmp2(tmp3[19]).intl;
|
|
obj1[2] = intl.string(tileSize(orderShared[19]).t.BGMUFB);
|
|
const items1 = [tmp.position, { width: tileSize, height: tileSize }, animatedStyle];
|
|
obj1[3] = items1;
|
|
obj1[4] = callback(BadgeTileContent, { badge, showGrip: true });
|
|
obj[1] = callback(slotOffset(orderShared[14]).View, obj1);
|
|
return callback(tileSize(orderShared[17]).GestureDetector, obj);
|
|
});
|
|
const obj9 = { BADGE_GRID_COLUMNS: require("PX_16").BADGE_GRID_COLUMNS, BADGE_GRID_GAP: require("PX_16").BADGE_GRID_GAP };
|
|
let result = require("handleFormOpen").fileFinishedImporting("modules/badges/native/ReorderBadgesSheet.tsx");
|
|
|
|
export default function ReorderBadgesSheet(analyticsLocations) {
|
|
analyticsLocations = analyticsLocations.analyticsLocations;
|
|
let stateFromStores;
|
|
let stateFromStores1;
|
|
analyticsLocations = undefined;
|
|
let context;
|
|
let stateFromStoresArray;
|
|
let hasCatalog;
|
|
let pendingBadgeDisplayOrder;
|
|
let pendingBadgeHiddenBadges;
|
|
let memo;
|
|
let fixedBadges;
|
|
let reorderableBadges;
|
|
let memo2;
|
|
let sharedValue;
|
|
let callback;
|
|
let sharedValue1;
|
|
let badgeTileSize;
|
|
let tmp = badgeTileSize();
|
|
let obj = stateFromStores(analyticsLocations[20]);
|
|
const items = [pendingBadgeDisplayOrder];
|
|
stateFromStores = obj.useStateFromStores(items, () => {
|
|
const currentUser = pendingBadgeDisplayOrder.getCurrentUser();
|
|
let id;
|
|
if (currentUser != null) {
|
|
id = currentUser.id;
|
|
}
|
|
return id;
|
|
});
|
|
let obj1 = stateFromStores(analyticsLocations[20]);
|
|
const items1 = [pendingBadgeDisplayOrder];
|
|
stateFromStores1 = obj1.useStateFromStores(items1, () => stateFromStores1(analyticsLocations[21]).canUsePremiumProfileCustomization(pendingBadgeDisplayOrder.getCurrentUser()));
|
|
if (analyticsLocations == null) {
|
|
analyticsLocations = [];
|
|
}
|
|
analyticsLocations = stateFromStores1(analyticsLocations[22])(analyticsLocations, tmp6(tmp3[23]).BADGES_REORDER_ACTION_SHEET).analyticsLocations;
|
|
context = context.useContext(tmp6(tmp3[24]));
|
|
const items2 = [context, analyticsLocations];
|
|
callback = context.useCallback(() => {
|
|
let obj = context;
|
|
if (context != null) {
|
|
obj.close();
|
|
}
|
|
obj = { analyticsLocation: obj, analyticsLocations, premiumFeatureCardOrder: null };
|
|
obj = { page: reorderableBadges.USER_SETTINGS, section: memo2.USER_PROFILE, object: fixedBadges.BUTTON_CTA };
|
|
obj[2] = stateFromStores(analyticsLocations[26]).PremiumFeatureCardOrder.TIER_2_LEADING;
|
|
stateFromStores1(analyticsLocations[25])(obj);
|
|
}, items2);
|
|
let tmp2Result = tmp2(tmp3[20]);
|
|
const items3 = [pendingBadgeHiddenBadges];
|
|
const items4 = [stateFromStores];
|
|
stateFromStoresArray = tmp2Result.useStateFromStoresArray(items3, () => pendingBadgeHiddenBadges.getBadges(stateFromStores), items4);
|
|
tmp2Result = tmp2(tmp3[20]);
|
|
const items5 = [pendingBadgeHiddenBadges];
|
|
const items6 = [stateFromStores];
|
|
const stateFromStoresObject = tmp2Result.useStateFromStoresObject(items5, () => {
|
|
let hasCatalogForResult = null != stateFromStores;
|
|
if (hasCatalogForResult) {
|
|
hasCatalogForResult = pendingBadgeHiddenBadges.hasCatalogFor(tmp);
|
|
}
|
|
return { hasCatalog: hasCatalogForResult, hasCatalogError: pendingBadgeHiddenBadges.hasCatalogFetchErrorFor(stateFromStores) };
|
|
}, items6);
|
|
hasCatalog = stateFromStoresObject.hasCatalog;
|
|
const items7 = [stateFromStores1, hasCatalog, analyticsLocations];
|
|
const effect = context.useEffect(() => {
|
|
let tmp = !stateFromStores1;
|
|
if (!stateFromStores1) {
|
|
tmp = hasCatalog;
|
|
}
|
|
if (tmp) {
|
|
let obj = stateFromStores1(analyticsLocations[27]);
|
|
obj = { type: null, location: null, location_stack: null };
|
|
obj[0] = sharedValue.BADGE_REORDERING_UPSELL;
|
|
obj = { page: null, section: null };
|
|
obj[0] = reorderableBadges.USER_SETTINGS;
|
|
obj[1] = memo2.USER_PROFILE;
|
|
obj[1] = obj;
|
|
obj[2] = analyticsLocations;
|
|
obj.track(memo.PREMIUM_UPSELL_VIEWED, obj);
|
|
}
|
|
}, items7);
|
|
const items8 = [stateFromStores];
|
|
const effect1 = context.useEffect(() => {
|
|
if (null != stateFromStores) {
|
|
if (!tmp2) {
|
|
const badgeDirectory = stateFromStores(analyticsLocations[28]).fetchBadgeDirectory(tmp);
|
|
const obj2 = stateFromStores(analyticsLocations[28]);
|
|
}
|
|
const obj = pendingBadgeHiddenBadges;
|
|
tmp2 = pendingBadgeHiddenBadges.hasCatalogFor(tmp) && !pendingBadgeHiddenBadges.isCatalogStaleFor(tmp);
|
|
}
|
|
}, items8);
|
|
let tmp7 = stateFromStores1(analyticsLocations[22]);
|
|
const items9 = [hasCatalog];
|
|
const stateFromStoresObject1 = stateFromStores(analyticsLocations[20]).useStateFromStoresObject(items9, () => {
|
|
const pendingChanges = hasCatalog.getPendingChanges();
|
|
return { pendingBadgeDisplayOrder: pendingChanges.pendingBadgeDisplayOrder, pendingBadgeHiddenBadges: pendingChanges.pendingBadgeHiddenBadges };
|
|
}, []);
|
|
pendingBadgeDisplayOrder = stateFromStoresObject1.pendingBadgeDisplayOrder;
|
|
pendingBadgeHiddenBadges = stateFromStoresObject1.pendingBadgeHiddenBadges;
|
|
const items10 = [stateFromStoresArray, pendingBadgeDisplayOrder, pendingBadgeHiddenBadges];
|
|
memo = context.useMemo(() => {
|
|
let obj = stateFromStores(analyticsLocations[18]);
|
|
obj = { pendingBadgeDisplayOrder, pendingBadgeHiddenBadges };
|
|
return obj.applyPendingBadgeSettings(stateFromStoresArray, obj);
|
|
}, items10);
|
|
const items11 = [memo];
|
|
const memo1 = context.useMemo(() => {
|
|
const fixedBadges = [];
|
|
const reorderableBadges = [];
|
|
const iter = memo[Symbol.iterator]();
|
|
const nextResult = iter.next();
|
|
while (iter !== undefined) {
|
|
let tmp3 = nextResult;
|
|
let owned = nextResult.owned;
|
|
if (owned) {
|
|
let tmp4 = nextResult;
|
|
owned = true !== tmp3.hidden;
|
|
}
|
|
if (owned) {
|
|
let tmp5 = stateFromStores;
|
|
let tmp6 = analyticsLocations;
|
|
let NON_CUSTOMIZABLE_BADGE_IDS = stateFromStores(analyticsLocations[29]).NON_CUSTOMIZABLE_BADGE_IDS;
|
|
let tmp7 = nextResult;
|
|
if (NON_CUSTOMIZABLE_BADGE_IDS.has(tmp3.badge_id)) {
|
|
let tmp10 = nextResult;
|
|
let arr = fixedBadges.push(tmp3);
|
|
} else {
|
|
let tmp8 = nextResult;
|
|
arr = reorderableBadges.push(tmp3);
|
|
}
|
|
}
|
|
continue;
|
|
}
|
|
return { fixedBadges, reorderableBadges };
|
|
}, items11);
|
|
fixedBadges = memo1.fixedBadges;
|
|
reorderableBadges = memo1.reorderableBadges;
|
|
const items12 = [reorderableBadges];
|
|
memo2 = context.useMemo(() => reorderableBadges.map((badge_id) => badge_id.badge_id), items12);
|
|
const tmp2Result1 = stateFromStores(analyticsLocations[20]);
|
|
sharedValue = stateFromStores(analyticsLocations[14]).useSharedValue(memo2);
|
|
callback = tmp6(tmp3[30])((arr) => {
|
|
const result = stateFromStores(analyticsLocations[18]).setPendingBadgeDisplayOrder(arr);
|
|
});
|
|
const tmp2Result2 = stateFromStores(analyticsLocations[14]);
|
|
sharedValue1 = stateFromStores(analyticsLocations[14]).useSharedValue(false);
|
|
const items13 = [memo2, sharedValue1, sharedValue];
|
|
const effect2 = context.useEffect(() => {
|
|
if (!sharedValue1.get()) {
|
|
const result = sharedValue.set(memo2);
|
|
}
|
|
}, items13);
|
|
const tmp2Result3 = stateFromStores(analyticsLocations[14]);
|
|
badgeTileSize = stateFromStores(analyticsLocations[10]).getBadgeTileSize(tmp6(tmp3[31])().width);
|
|
const sum = fixedBadges.length + reorderableBadges.length;
|
|
const rounded = Math.ceil(sum / tmp2(tmp3[10]).BADGE_GRID_COLUMNS);
|
|
let num = 0;
|
|
if (rounded > 0) {
|
|
let result = rounded * badgeTileSize;
|
|
const diff = rounded - 1;
|
|
num = result + diff * tmp2(tmp3[10]).BADGE_GRID_GAP;
|
|
}
|
|
if (hasCatalog) {
|
|
obj = { style: null, children: null };
|
|
obj[0] = tmp.gridInset;
|
|
let tmp31 = !stateFromStores1;
|
|
if (!stateFromStores1) {
|
|
obj = { style: null, ctaText: null, cardStyle: null, contentStyle: null, ctaStyle: null, showLinearGradient: true, onPress: null, children: null };
|
|
obj[0] = tmp.upsell;
|
|
const intl2 = tmp2(tmp3[19]).intl;
|
|
obj[1] = intl2.string(tmp2(tmp3[19]).t.pj0XBN);
|
|
({ upsellCard: obj13[2], upsellContent: obj13[3], upsellCta: obj13[4] } = tmp);
|
|
obj[6] = callback;
|
|
obj1 = { variant: "text-sm/normal", style: null, children: null };
|
|
obj1[1] = tmp.upsellText;
|
|
const intl3 = tmp2(tmp3[19]).intl;
|
|
obj1[2] = intl3.string(tmp2(tmp3[19]).t.JrOki0);
|
|
obj[7] = callback(tmp2(tmp3[33]).Text, obj1);
|
|
tmp31 = callback(tmp6(tmp3[32]), obj);
|
|
const tmp6Result = tmp6(tmp3[32]);
|
|
}
|
|
const items14 = [tmp31, ];
|
|
const items15 = [tmp.grid, , ];
|
|
let gridDisabled = !stateFromStores1;
|
|
if (!stateFromStores1) {
|
|
gridDisabled = tmp.gridDisabled;
|
|
}
|
|
let obj2 = { style: null, children: null };
|
|
items15[1] = gridDisabled;
|
|
const obj3 = { height: null };
|
|
obj3[0] = num;
|
|
items15[2] = obj3;
|
|
obj2[0] = items15;
|
|
const items16 = [
|
|
fixedBadges.map((badge, index) => callback(outer1_19, { badge, index, tileSize: badgeTileSize }, badge.badge_id)),
|
|
reorderableBadges.map((badge_id) => {
|
|
if (stateFromStores1) {
|
|
let obj = { badge: null, index: null, tileSize: null, slotOffset: null, orderShared: null, isDragActive: null, onCommitOrder: null };
|
|
obj[0] = badge_id;
|
|
obj[1] = fixedBadges.length + arg1;
|
|
obj[2] = badgeTileSize;
|
|
obj[3] = fixedBadges.length;
|
|
obj[4] = sharedValue;
|
|
obj[5] = sharedValue1;
|
|
obj[6] = closure_13;
|
|
let tmpResult = tmp(outer1_26, obj, badge_id.badge_id);
|
|
} else {
|
|
obj = { badge: null, index: null, tileSize: null, showGrip: true };
|
|
obj[0] = badge_id;
|
|
obj[1] = fixedBadges.length + arg1;
|
|
obj[2] = badgeTileSize;
|
|
tmpResult = tmp(outer1_19, obj, badge_id.badge_id);
|
|
}
|
|
return tmpResult;
|
|
})
|
|
];
|
|
obj2[1] = items16;
|
|
items14[1] = sharedValue1(stateFromStoresArray, obj2);
|
|
obj[1] = items14;
|
|
let tmp26Result = tmp29(tmp30, obj);
|
|
} else {
|
|
if (stateFromStoresObject.hasCatalogError) {
|
|
const obj4 = { style: null, accessibilityRole: "alert", children: null };
|
|
obj4[0] = tmp.message;
|
|
const obj5 = { variant: "text-md/normal", color: "text-muted", style: null, children: null };
|
|
obj5[2] = tmp.messageText;
|
|
const intl = tmp2(tmp3[19]).intl;
|
|
obj5[3] = intl.string(tmp2(tmp3[19]).t["rTU7/z"]);
|
|
obj4[2] = tmp26(tmp2(tmp3[33]).Text, obj5);
|
|
let obj6 = obj4;
|
|
} else {
|
|
obj6 = { style: null, children: null };
|
|
obj6[0] = tmp.message;
|
|
obj6[1] = tmp26(tmp2(tmp3[34]).ActivityIndicator, { animating: true, size: "large" });
|
|
}
|
|
tmp26Result = tmp26(stateFromStoresArray, obj6);
|
|
const tmp27 = stateFromStoresArray;
|
|
}
|
|
const obj7 = { startExpanded: true, dismissAccessibilityLabel: null, header: null, children: null };
|
|
const intl4 = tmp2(tmp3[19]).intl;
|
|
obj7[1] = intl4.string(stateFromStores(analyticsLocations[19]).t.opzPIQ);
|
|
const obj8 = { title: null, subtitle: null };
|
|
const intl5 = tmp2(tmp3[19]).intl;
|
|
obj8[0] = intl5.string(stateFromStores(analyticsLocations[19]).t.opzPIQ);
|
|
const intl6 = tmp2(tmp3[19]).intl;
|
|
obj8[1] = intl6.string(stateFromStores(analyticsLocations[19]).t.WvuuHt);
|
|
obj7[2] = callback(stateFromStores(analyticsLocations[36]).BottomSheetTitleHeader, obj8);
|
|
obj7[3] = tmp26Result;
|
|
return callback(stateFromStores(analyticsLocations[35]).BottomSheet, obj7);
|
|
};
|