/* Metro module 14491; source: modules/permissions/useFirstGloballyViewbleGuildChannelId.tsx; dependencies: [1935, 482, 566, 3789, 2] */ function _fun109674(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14688:6, offset: 0x023565b2, size: 165 bytes, params: 8, frame: 18 let env0_0 = require; const _arrayLikeToArray_109677 = 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 guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */; const env0_4 = (require(482) /* metro dependency 482: Constants */).Permissions; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/permissions/useFirstGloballyViewbleGuildChannelId.tsx'); exports.useFirstGloballyViewbleGuildChannelId = function(a0) { var env0_0 = a0; return require(dependencyMap[2]).useStateFromStores([GuildChannelStore], _fun109679, [a0]); }; } function _createForOfIteratorHelperLoose_109675(a0, a1) { // fn#109675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14688:133, offset: 0x02356657, 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 _fun109676; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_109677(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_109677(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_109677(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun109676; } 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 useFirstGloballyViewbleGuildChannelId(a0) { // fn#109678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14688:1180, offset: 0x023567cb, size: 75 bytes, params: 2, frame: 16 const env0_0 = a0; return (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildChannelStore], _fun109679, [a0]); } function _fun109679() { // fn#109679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14688:1270, offset: 0x02356816, size: 182 bytes, params: 1, frame: 20 var r5; var id; var value2; var _createForOfIteratorHelperLoose_109675Binding; var value3; var value4; var value5; var done; var value6; var channel; var moduleValue; var canEveryone; var VIEW_CHANNEL; var value7; var property; var selectableChannels; if (env0_0 != null) { value2 = environment.__proto__; selectableChannels = GuildChannelStore.getSelectableChannels(env0_0); _createForOfIteratorHelperLoose_109675Binding = _createForOfIteratorHelperLoose_109675; value3 = undefined; value4 = _createForOfIteratorHelperLoose_109675Binding(selectableChannels); value5 = value4(); done = value5.done; if (done) { return selectableChannels == null || selectableChannels[0] == null ? value3 : selectableChannels[0].channel.id; } r5 = value5; loopExit3: while (true) { value6 = r5.value; channel = value6.channel; moduleValue = importAll(3789) /* metro dependency 3789: PermissionUtils */; canEveryone = moduleValue.canEveryone; VIEW_CHANNEL = Permissions.VIEW_CHANNEL; if (Reflect.apply(canEveryone, moduleValue, [VIEW_CHANNEL, channel])) { break loopExit3; } value7 = value4(); done = value7.done; if (done) { if (selectableChannels == null) { id = value3; continue; } property = selectableChannels[0]; if (property == null) { id = value3; continue; } channel = property.channel; id = channel.id; return id; } r5 = value7; continue; } return channel.id; } }