Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,346 @@
/* Metro module 10183; source: modules/quests/native/QuestContentImpressionTracker.native.tsx; dependencies: [57, 31, 7030, 9515, 661, 6266, 566, 9513, 9514, 7121, 2] */
function _fun79242(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:6, offset: 0x01e4a496, size: 260 bytes, params: 8, frame: 19
const env0_0 = require;
const _arrayLikeToArray_79245 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const appStateStore = importDefault(7030) /* metro dependency 7030: AppStateStore */;
const env0_6 = (require(9515) /* metro dependency 9515: ContentImpressionTrackerConstants */).MIN_QUEST_CONTENT_VISIBILITY_PERCENTAGE;
const env0_7 = (require(661) /* metro dependency 661: Constants */).AppStates;
const env0_8 = (require(31) /* metro dependency 31 */).createElement;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/QuestContentImpressionTracker.native.tsx');
exports.QuestContentImpressionTrackerNative = QuestContentImpressionTrackerNative;
}
function _createForOfIteratorHelperLoose_79243(a0, a1) { // fn#79243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:228, offset: 0x01e4a59a, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun79244;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_79245(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_79245(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_79245(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun79244;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function useVisibilityData({adContentIds, visibilityRef, overrideVisibility}) { // fn#79246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:2034, offset: 0x01e4a70e, size: 175 bytes, params: 2, frame: 20
var object2;
const [property, property2] = env0_3(env0_4.useState(0), 2);
env0_4.useEffect(_fun79247, [adContentIds, property2, visibilityRef]);
const r2 = overrideVisibility ?? property >= MIN_QUEST_CONTENT_VISIBILITY_PERCENTAGE;
object2 = {visible: r2};
object2.visibleChanged = r2 !== (importDefault(6266) /* metro dependency 6266: usePrevious */)(r2);
return object2;
}
function calculateVisibilityPercentage({visibilityRef, entityId}) { // fn#79251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:1172, offset: 0x01e4a8ce, size: 650 bytes, params: 2, frame: 19
var r3;
var r0;
var r4;
var current;
var property;
var parent;
var items2;
var scrollX;
var x;
var width;
var items3;
var firstItemOffset;
var Math;
var max;
var min;
var value2;
let value = undefined;
if (visibilityRef == null) {
r3 = value;
} else {
current = visibilityRef.current;
r3 = current == null || current.children == null ? value : current.children[entityId];
}
let layout = r3 == null ? value : r3.layout;
if (layout == null) {
return 0;
}
if (visibilityRef == null) {
layout = value;
} else {
parent = visibilityRef.current.parent;
layout = parent == null ? value : parent.layout;
}
if (layout == null) {
return 0;
}
let r2 = visibilityRef.current.axis ?? 'vertical';
if (r2 === 'horizontal') {
current = visibilityRef.current;
parent = current.parent;
scrollX = parent.scrollX;
if (scrollX == null) {
return 0;
}
layout = r3.layout;
x = layout.x;
items2 = [x];
layout = r3.layout;
x = layout.x;
layout = r3.layout;
width = layout.width;
items2[1] = x + width;
current = visibilityRef.current;
parent = current.parent;
scrollX = parent.scrollX;
items3 = [scrollX];
current = visibilityRef.current;
parent = current.parent;
scrollX = parent.scrollX;
current = visibilityRef.current;
parent = current.parent;
layout = parent.layout;
width = layout.width;
items3[1] = scrollX + width;
layout = r3.layout;
width = layout.width;
r0 = items3;
r2 = items2;
r4 = width;
current = visibilityRef.current;
parent = current.parent;
firstItemOffset = parent.firstItemOffset;
if (firstItemOffset != null) {
firstItemOffset = visibilityRef.current.parent.firstItemOffset;
r2[0] += firstItemOffset;
r2[1] += firstItemOffset;
}
Math = global.Math;
max = Math.max;
property = r2[0];
value = Reflect.apply(max, Math, [property, r0[0]]);
Math = global.Math;
min = Math.min;
property = r2[1];
value2 = Reflect.apply(min, Math, [property, r0[1]]);
} else {
if (visibilityRef.current.parent.scrollY == null) {
return 0;
}
var y = r3.layout.y;
items2 = [y];
y = r3.layout.y;
var height = r3.layout.height;
items2[1] = y + height;
height = r3.layout.height;
r0 = [visibilityRef.current.parent.scrollY,
visibilityRef.current.parent.scrollY + visibilityRef.current.parent.layout.height];
r2 = items2;
r4 = height;
firstItemOffset = visibilityRef.current.parent.firstItemOffset;
if (firstItemOffset != null) {
firstItemOffset = visibilityRef.current.parent.firstItemOffset;
r2[0] += firstItemOffset;
r2[1] += firstItemOffset;
}
Math = global.Math;
value = Math.max(r2[0], r0[0]);
Math = global.Math;
value2 = Math.min(r2[1], r0[1]);
}
Math = global.Math;
value = Math.max(0, value2 - value);
Math = global.Math;
return Math.min(value / r4, 1);
}
function QuestContentImpressionTrackerNative(a0) { // fn#79252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:2809, offset: 0x01e4ab58, size: 370 bytes, params: 2, frame: 23
var object3;
const state = (require(566) /* metro dependency 566: flux */).useStateFromStores([AppStateStore], function() {
return AppStateStore.getState();
});
const ACTIVE = AppStates.ACTIVE;
const value2 = state === ACTIVE;
const value3 = env0_4.useRef(null);
const value4 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(value2);
const {key,
adContentIds} = (require(9513) /* metro dependency 9513: ContentImpressionTrackerHooks */).useAdContentImpressionTrackerProps(a0);
object3 = {};
copyDataProperties(object3, a0, undefined);
object3['adContentIds'] = adContentIds;
const value6 = useVisibilityData(object3);
object3 = {};
const value7 = copyDataProperties(object3, a0, undefined);
copyDataProperties(object3, value6, value7);
object3['focused'] = value2;
object3['focusedChanged'] = value2 !== value4;
object3['reference'] = value3;
object3['isFocused'] = value2;
const createElementBinding = createElement;
const QuestContentImpressionTracker = (require(9514) /* metro dependency 9514: ContentImpressionTracker */).QuestContentImpressionTracker;
const value8 = 'questOrQuests' in a0;
const object4 = {};
copyDataProperties(object4, object3, value7);
object4['key'] = key;
object4['adContentIds'] = adContentIds;
if (value8) {
object4['adCreativeType'] = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST;
} else {
object4['adCreativeType'] = a0.adCreativeType;
}
return createElementBinding(QuestContentImpressionTracker, object4);
}
function _fun79247() { // fn#79247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:2172, offset: 0x01e4a7bd, size: 50 bytes, params: 1, frame: 11
initHandlers({adContentIds: adContentIds, setVisibilityPercentage: env0_2, visibilityRef: visibilityRef});
}
function initHandlers({adContentIds, setVisibilityPercentage, visibilityRef}) { // fn#79248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:2178, offset: 0x01e4a7ef, size: 99 bytes, params: 2, frame: 14
var environment;
var r1;
var closure;
var value;
var value2;
var done;
var value3;
var value4;
reducibleJoin3: while (true) {
if (visibilityRef == null) {
break reducibleJoin3;
}
closure = function(a0) {
var env0_0 = a0;
var visibilityRefBinding = visibilityRef;
var children = visibilityRefBinding.current.children;
var object = {};
var children2 = visibilityRefBinding.current.children;
copyDataProperties(object, children2[a0], children2);
object['calculateVisibility'] = _fun79250;
children[a0] = object;
};
value = environment.__proto__.__proto__;
value = _createForOfIteratorHelperLoose_79243(adContentIds);
value2 = value();
done = value2.done;
if (done) {
break reducibleJoin3;
}
r1 = value2;
reducibleLoop2: while (true) {
value3 = r1.value;
closure(value3);
value4 = value();
done = value4.done;
if (done) {
break reducibleJoin3;
}
r1 = value4;
continue reducibleLoop2;
}
}
}
function initHandlers_loop(a0) { // fn#79249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:2287, owner: initHandlers._loop, offset: 0x01e4a852, size: 73 bytes, params: 2, frame: 14
const env0_0 = a0;
const visibilityRefBinding = visibilityRef;
const children = visibilityRefBinding.current.children;
const object2 = {};
const children2 = visibilityRefBinding.current.children;
copyDataProperties(object2, children2[a0], children2);
object2['calculateVisibility'] = calculateVisibility;
children[a0] = object2;
}
function calculateVisibility() { // fn#79250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10369:2367, owner: initHandlers._loop.calculateVisibility, offset: 0x01e4a89b, size: 51 bytes, params: 1, frame: 12
setVisibilityPercentage(calculateVisibilityPercentage({visibilityRef: visibilityRef, entityId: env0_0}));
}