/* Metro module 9281; source: modules/rtc/hooks/useSecureFramesPairwiseFingerprint.tsx; dependencies: [5, 57, 31, 1226, 4259, 4294, 9277, 4291, 566, 44, 206, 9260, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import Module00206 from '../../../by-id/module-00206.js'; /* Metro dependency 206 */ import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */ import MediaEngineStore from '../../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */ import RTCConnectionStore from '../../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as ConstantsModule from '../../../external/discord_common/js/packages/media-engine/Constants.tsx'; /* Metro dependency 4291 */ import * as SecureFramesConstantsModule from '../SecureFramesConstants.tsx'; /* Metro dependency 9277 */ function _fun72593(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:6, offset: 0x01d4b3eb, size: 245 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/rtc/hooks/useSecureFramesPairwiseFingerprint.tsx'); exports.useSecureFramesPairwiseFingerprint = useSecureFramesPairwiseFingerprint; function useSecureFramesPairwiseFingerprint({userId}) { // fn#72594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:356, offset: 0x01d4b4e0, size: 423 bytes, params: 2, frame: 26 let useStateFromStores = FluxModule.useStateFromStores; const id = Reflect.apply(useStateFromStores, FluxModule, [[AuthenticationStore], function() { return AuthenticationStore.getId(); }]); (Module00044)(id !== userId, '[useSecureFramesPairwiseFingerprint] Should not pass current user id.'); const binding = env0_5; let useState = binding.useState; const value2 = Reflect.apply(useState, binding, [null]); const value3 = Module00057(value2, 2); const property = value3[0]; const env0_3 = value3[1]; useState = binding.useState; const value4 = Module00057(Reflect.apply(useState, binding, [false]), 2); const property2 = value4[0]; var env0_5 = value4[1]; useStateFromStores = FluxModule.useStateFromStores; const rtcConnectionStoreBinding = RTCConnectionStore; const secureFramesRosterMapEntry = Reflect.apply(useStateFromStores, FluxModule, [[rtcConnectionStoreBinding], function() { return RTCConnectionStore.getSecureFramesRosterMapEntry(userId); }]); const secureFramesRosterMapEntry2 = FluxModule.useStateFromStores([rtcConnectionStoreBinding], function() { return RTCConnectionStore.getSecureFramesRosterMapEntry(id); }); value = binding.useCallback(_fun72598, []); value = binding.useCallback(_fun72599(), [value]); const env0_10 = binding.useRef(null); binding.useEffect(_fun72604, [id, secureFramesRosterMapEntry2, value, userId, secureFramesRosterMapEntry]); return binding.useMemo(_fun72607, [property, property2, secureFramesRosterMapEntry]); function _fun72598(a0) { // fn#72598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:806, offset: 0x01d4b6bd, size: 64 bytes, params: 2, frame: 14 const binding = env0_3; const defaultImport = Module00206; binding(defaultImport.fromByteArray(a0)); env0_5(false); } function _fun72599() { // fn#72599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:867, offset: 0x01d4b6fd, size: 36 bytes, params: 1, frame: 12 const env0_0 = env1_3(_fun72601); return _fun72603; function* _fun72601(a0, a1, a2, a3) { // fn#72601, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:887, offset: 0x01d4b72c, size: 236 bytes, params: 5, frame: 23 var environment; var rTCConnection; if (true) { value = environment.__proto__.__proto__.__proto__; var binding = env3_7; var supports = binding.supports; var MLS_PAIRWISE_FINGERPRINTS = env3_10.MLS_PAIRWISE_FINGERPRINTS; if (Reflect.apply(supports, binding, [MLS_PAIRWISE_FINGERPRINTS])) { rTCConnection = env3_8.getRTCConnection(); if (rTCConnection != null) { rTCConnection.getMLSPairwiseFingerprint(env3_9, a2, _fun72602); } } else { binding = env3_0; var value3 = binding(env3_2[11]); var generatePairwiseFingerprint = value3.generatePairwiseFingerprint; binding = env3_9; var Uint8Array = global.Uint8Array; var prototype = Uint8Array.prototype; value = Object.create(prototype, {constructor: {value: Uint8Array}}); var uint8Array = new Uint8Array(a1); value = uint8Array instanceof Object ? uint8Array : value; Uint8Array = global.Uint8Array; prototype = Uint8Array.prototype; var value4 = Object.create(prototype, {constructor: {value: Uint8Array}}); uint8Array = new Uint8Array(a3); yield Reflect.apply(generatePairwiseFingerprint, value3, [binding, value, a0, uint8Array instanceof Object ? uint8Array : value4, a2]); value = undefined; if (false) { return value; } RTCConnectionStore(value); } } function _fun72602(a0) { // fn#72602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:1021, offset: 0x01d4b818, size: 47 bytes, params: 2, frame: 12 const value = environment.__proto__.__proto__.__proto__; const rtcConnectionStoreBinding = RTCConnectionStore; const Uint8Array = global.Uint8Array; rtcConnectionStoreBinding(new Uint8Array(a0)); } } function _fun72603() { // fn#72603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:1162, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13 return env0_0.apply(this, arguments); } } function _fun72604() { // fn#72604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:1250, offset: 0x01d4b847, size: 113 bytes, params: 1, frame: 16 if (secureFramesRosterMapEntry != null && secureFramesRosterMapEntry != null && env0_10.current == null) { env0_5(true); env0_10.current = global.setTimeout(_fun72605, 0); } const env0_0 = env0_10.current; return function() { if (current != null) { global.clearTimeout(current); } }; function _fun72605() { // fn#72605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:1319, offset: 0x01d4b8b8, size: 31 bytes, params: 1, frame: 17 return env1_9(id, secureFramesRosterMapEntry, userId, secureFramesRosterMapEntry); } } function _fun72607() { // fn#72607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9467:1418, offset: 0x01d4b8fb, size: 34 bytes, params: 1, frame: 3 return {fingerprint: env0_2, userKey: secureFramesRosterMapEntry, loading: Module00057}; } } } global.__d(_fun72593, 9281, [5, 57, 31, 1226, 4259, 4294, 9277, 4291, 566, 44, 206, 9260, 2]) /* metro module 9281, dependencies: [5, 57, 31, 1226, 4259, 4294, 9277, 4291, 566, 44, 206, 9260, 2] */;