This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,26 @@
// Metro module 11089 (f11090).
import { useCallback } from "react";
import SafetyHubStore from "../SafetyHubStore";
import { SafetyHubAnalyticsActionSource } from "../SafetyHubConstants";
import { AnalyticEvents, EMPTY_STRING_SNOWFLAKE_ID } from "../../../Constants";
import { useStateFromStores } from "../../../_bundle/Module589";
import { useSafetyHubClassification } from "./useSafetyHubClassifications";
import { useSafetyHubAccountStanding } from "./useSafetyHubAccountStanding";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
export function useEmitAppealIngestionEvent() {
let safetyHubClassification, safetyHubAccountStanding, stateFromStores2;
const stateFromStores = useStateFromStores([SafetyHubStore], () => SafetyHubStore.getAppealClassificationId());
safetyHubClassification = useSafetyHubClassification(stateFromStores == null ? EMPTY_STRING_SNOWFLAKE_ID : stateFromStores);
safetyHubAccountStanding = useSafetyHubAccountStanding();
stateFromStores2 = useStateFromStores([SafetyHubStore], () => SafetyHubStore.getIsDsaEligible());
return useCallback((a0) => {
AnalyticsUtils.track(AnalyticEvents.SAFETY_HUB_ACTION, {
action: a0,
account_standing: safetyHubAccountStanding.state,
classification_ids: stateFromStores != null ? [Number(stateFromStores)] : null,
source: SafetyHubAnalyticsActionSource.AppealIngestion,
is_dsa_eligible: stateFromStores2,
violation_type: safetyHubClassification.violationType
});
}, [safetyHubAccountStanding.state, stateFromStores, safetyHubClassification, stateFromStores2]);
}
@@ -0,0 +1,5 @@
// Metro module 13787 (f13788).
import SnowflakeUtils from "../../../utils/SnowflakeUtils";
export function useIsNewClassification(a0) {
return Math.abs(SnowflakeUtils.extractTimestamp(a0.id) - new Date().getTime()) < 86400000;
}
@@ -0,0 +1,6 @@
// Metro module 11079 (f11080).
import SafetyHubStore from "../SafetyHubStore";
import { useStateFromStores } from "../../../_bundle/Module589";
export function useSafetyHubAccountStanding() {
return useStateFromStores([SafetyHubStore], () => SafetyHubStore.getAccountStanding());
}
@@ -0,0 +1,56 @@
// Metro module 11077 (f11078).
import { useEffect } from "react";
import SafetyHubStore from "../SafetyHubStore";
import { ViolationType } from "../SafetyHubConstants";
import { useStateFromStoresArray, useStateFromStores } from "../../../_bundle/Module589";
import SnowflakeUtils from "../../../utils/SnowflakeUtils";
import { isGuildClassification } from "../SafetyHubUtils";
import { MemberType } from "../SafetyHubModels";
import { getSafetyHubDataForClassification } from "../SafetyHubActionCreators";
let $mk86333 = function() {
return () => SafetyHubStore.getClassifications();
}, $mk86334 = function() {
return (a0, a1) => SnowflakeUtils.extractTimestamp(a1.id) - SnowflakeUtils.extractTimestamp(a0.id);
};
export function useSafetyHubClassifications() {
return useStateFromStoresArray([SafetyHubStore], $mk86333()).sort($mk86334());
}
export function useSafetyHubClassification(a0) {
let stateFromStores2;
const stateFromStores = useStateFromStores([SafetyHubStore], () => SafetyHubStore.getClassification(a0));
stateFromStores2 = useStateFromStores([SafetyHubStore], () => SafetyHubStore.getClassificationRequestState(a0));
const stateFromStores3 = useStateFromStores([SafetyHubStore], () => SafetyHubStore.getIsDsaEligible());
let isAppealEligible = useStateFromStores([SafetyHubStore], () => SafetyHubStore.getIsAppealEligible());
const violationType = isGuildClassification(stateFromStores) ? stateFromStores.guild_metadata?.member_type === MemberType.OWNER ? ViolationType.GUILD_OWNER : ViolationType.GUILD_MEMBER : ViolationType.USER;
useEffect(() => {
if (stateFromStores === void 0 && stateFromStores2 == null) {
getSafetyHubDataForClassification(a0);
}
}, [a0, stateFromStores, stateFromStores2]);
if (isAppealEligible) {
isAppealEligible = stateFromStores != null;
}
if (isAppealEligible) {
isAppealEligible = stateFromStores.appeal_status == null;
}
return {
classification: stateFromStores,
classificationRequestState: stateFromStores2,
isDsaEligible: stateFromStores3,
isAppealEligible,
violationType
};
}
export function useActiveSafetyHubClassifications() {
const r17 = useStateFromStoresArray([SafetyHubStore], $mk86333()).sort($mk86334());
let c18522_0 = new Date();
return r17.filter((item) => new Date(item.max_expiration_time) > c18522_0);
}
export function useExpiredSafetyHubClassifications() {
const r17 = useStateFromStoresArray([SafetyHubStore], $mk86333()).sort($mk86334());
let c18523_0 = new Date();
return r17.filter((item) => new Date(item.max_expiration_time) <= c18523_0);
}
export function useSafetyHubAppealSignal() {
return useStateFromStores([SafetyHubStore], () => SafetyHubStore.getAppealSignal());
}
@@ -0,0 +1,6 @@
// Metro module 13782 (f13783).
import SafetyHubStore from "../SafetyHubStore";
import { useStateFromStores } from "../../../_bundle/Module589";
export function useSafetyHubFetchError() {
return useStateFromStores([SafetyHubStore], () => SafetyHubStore.getFetchError());
}
@@ -0,0 +1,6 @@
// Metro module 11101 (f11102).
import SafetyHubStore from "../SafetyHubStore";
import { useStateFromStores } from "../../../_bundle/Module589";
export function useSafetyHubInitialized() {
return useStateFromStores([SafetyHubStore], () => SafetyHubStore.isInitialized());
}
@@ -0,0 +1,6 @@
// Metro module 13781 (f13782).
import SafetyHubStore from "../SafetyHubStore";
import { useStateFromStores } from "../../../_bundle/Module589";
export default function useIsSafetyHubLoading() {
return useStateFromStores([SafetyHubStore], () => SafetyHubStore.isFetching());
};