/* Metro module 13019; source: modules/rpc/server/commands/certifiedDevices.tsx; dependencies: [4135, 661, 4291, 4122, 8079, 8076, 13020, 2] */ import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as OAuth2ScopesModule from '../../../../external/discord_common/js/shared/shared-constants/OAuth2Scopes.tsx'; /* Metro dependency 4122 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 4135 */ import * as ConstantsModule2 from '../../../../external/discord_common/js/packages/media-engine/Constants.tsx'; /* Metro dependency 4291 */ import * as CertifiedDeviceActionCreatorsModule from '../../../../actions/CertifiedDeviceActionCreators.tsx'; /* Metro dependency 13020 */ function _fun99379(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:6, offset: 0x021c6264, size: 262 bytes, params: 8, frame: 23 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const RPC_LOCAL_SCOPE = value.RPC_LOCAL_SCOPE; const RPC_SCOPE_CONFIG = value.RPC_SCOPE_CONFIG; value = require(661) /* metro dependency 661: Constants */; const RPCCommands = value.RPCCommands; const env0_3 = value.RPCErrors; object = {}; const SET_CERTIFIED_DEVICES = RPCCommands.SET_CERTIFIED_DEVICES; const ANY = RPC_SCOPE_CONFIG.ANY; const OAuth2Scopes = (OAuth2ScopesModule).OAuth2Scopes; const RPC = OAuth2Scopes.RPC; object[SET_CERTIFIED_DEVICES] = {scope: {[ANY]: [RPC, RPC_LOCAL_SCOPE]}, validation: validation_99380, handler: handler_99381}; (FileImportTrackerModule).fileFinishedImporting('modules/rpc/server/commands/certifiedDevices.tsx'); exports.default = object; function validation_99380(a0) { // fn#99380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:295, offset: 0x021c636a, size: 496 bytes, params: 2, frame: 27 const value3 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0).required(); const keys = value3.keys; const value4 = a0.array(); const items2 = value4.items; const value5 = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0); const keys2 = value5.keys; const object2 = {}; const value7 = a0.string().required(); const valid = value7.valid; const AUDIO_INPUT = DeviceTypes.AUDIO_INPUT; const AUDIO_OUTPUT = DeviceTypes.AUDIO_OUTPUT; const VIDEO_INPUT = DeviceTypes.VIDEO_INPUT; object2.type = Reflect.apply(valid, value7, [[AUDIO_INPUT, AUDIO_OUTPUT, VIDEO_INPUT]]); let value = a0.string(); value = value.required(); object2.id = value.min(1); value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0); value = value.required(); const keys3 = value.keys; const object3 = {}; object3.name = a0.string().min(1); object3.url = a0.string().min(1); object2.vendor = Reflect.apply(keys3, value, [object3]); value = (importDefault(8079) /* metro dependency 8079: createRpcJoiSchemaObject */)(a0); value = value.required(); const keys4 = value.keys; const object4 = {}; object4.name = a0.string().min(1); object4.url = a0.string().min(1); object2.model = Reflect.apply(keys4, value, [object4]); value = a0.array(); const items3 = value.items; const value12 = a0.string(); object2.related = Reflect.apply(items3, value, [value12.min(1)]); object2.echo_cancellation = a0.boolean(); object2.noise_suppression = a0.boolean(); object2.automatic_gain_control = a0.boolean(); object2.hardware_mute = a0.boolean(); return Reflect.apply(keys, value3, [{devices: Reflect.apply(items2, value4, [Reflect.apply(keys2, value5, [object2])])}]); } function handler_99381({socket, args}) { // fn#99381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:810, offset: 0x021c655a, size: 182 bytes, params: 2, frame: 16 const devices = args.devices; if (socket.application.id == null) { throw new (importDefault(8076) /* metro dependency 8076: RPCError */)({errorCode: RPCErrors.INVALID_COMMAND}, 'No application.'); } CertifiedDeviceActionCreatorsModule.setCertifiedDevices(socket.application.id, devices.map(function(a0) { var object = {type: a0.type, id: a0.id, vendor: a0.vendor, model: a0.model}; object.related = a0.related.filter(_fun99383); object.echoCancellation = a0.echo_cancellation; object.noiseSuppression = a0.noise_suppression; object.automaticGainControl = a0.automatic_gain_control; object.hardwareMute = a0.hardware_mute; return object; })); function _fun99382({type, id, vendor, model, related, echo_cancellation, noise_suppression, automatic_gain_control, hardware_mute}) { // fn#99382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:993, offset: 0x021c6610, size: 121 bytes, params: 2, frame: 13 const object = {}; object.type = type; object.id = id; object.vendor = vendor; object.model = model; object.related = related.filter(function(a0) { var env0_0 = a0; return devices.some(_fun99384); }); object.echoCancellation = echo_cancellation; object.noiseSuppression = noise_suppression; object.automaticGainControl = automatic_gain_control; object.hardwareMute = hardware_mute; return object; function _fun99383(a0) { // fn#99383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:1074, offset: 0x021c6689, size: 36 bytes, params: 2, frame: 11 const env0_0 = a0; return devices.some(_fun99384); function _fun99384({id}) { // fn#99384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13209:1085, offset: 0x00db0c48, size: 21 bytes, params: 2, frame: 2 return id === env0_0; } } } } } global.__d(_fun99379, 13019, [4135, 661, 4291, 4122, 8079, 8076, 13020, 2]) /* metro module 13019, dependencies: [4135, 661, 4291, 4122, 8079, 8076, 13020, 2] */;