/* Metro module 7434; source: unknown; dependencies: [57] */ function _fun59992(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#59992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7612:6, offset: 0x016f8a38, size: 126 bytes, params: 8, frame: 19 const closure = parseRetryAfterHeader_59993; const closure2 = function(a0, a1) { var r0; r0 = a0[a1] || a0.all; r0 = !r0 ? 0 : r0; return r0; }; const env0_0 = require(57) /* metro dependency 57 */; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); exports.DEFAULT_RETRY_AFTER = 60000; exports.disabledUntil = closure2; exports.isRateLimited = isRateLimited_59995; exports.parseRetryAfterHeader = closure; exports.updateRateLimits = updateRateLimits_59996; } function parseRetryAfterHeader_59993(a0) { // fn#59993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7612:93, offset: 0x016f8ab6, size: 170 bytes, params: 2, frame: 17 var r0; const r2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : global.Date.now(); const parseInt = global.parseInt; let value = '' + a0; value = parseInt(value, 10); if (global.isNaN(value)) { value = global.Date.parse('' + a0); if (global.isNaN(value)) { r0 = 60000; } else { value -= r2; r0 = value; } return r0; } return 1000 * value; } function isRateLimited_59995(a0, a1) { // fn#59995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7612:418, offset: 0x016f8b60, size: 70 bytes, params: 3, frame: 14 return disabledUntil_59994(a0, a1) > (arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : global.Date.now()); } function updateRateLimits_59996(a0, a1) { // fn#59996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7612:612, offset: 0x016f8ba6, size: 516 bytes, params: 3, frame: 38 var r2; var r22; var r5; var r23; var r24; var r26; var r25; var statusCode; var headers; var Date; var now; var value; var Object; var assign; var property; var value2; var trim; var value3; var split; var iterator; var iterator2; var value4; var value5; var item; var item2; var value6; var binding; var value7; var property2; var property3; var parseInt; var int; var isNaN; var isNaN2; var value8; var value9; var value10; var iterator3; var item3; var value11; var value12; var value13; var includes; var value14; var value15; var value16; var error; exceptionSkip60: while (true) { exceptionLanding60: while (true) { exceptionSkip57: while (true) { exceptionLanding57: while (true) { statusCode = a1.statusCode; headers = a1.headers; if (arguments.length > 2) { if (arguments[2] !== undefined) { r2 = arguments[2]; break; } Date = global.Date; r2 = Date.now(); break; } Date = global.Date; now = Date.now; r2 = Reflect.apply(now, Date, []); Object = global.Object; assign = Object.assign; value = Reflect.apply(assign, Object, [{}, a0]); if (headers) { property = headers['x-sentry-rate-limits']; r22 = property; } else { r22 = headers; } if (headers) { property = headers['retry-after']; r5 = property; } else { r5 = headers; } if (!r22) { if (r5) { value2 = environment; value.all = r2 + parseRetryAfterHeader_59993(r5, r2); break; } if (statusCode !== 429) { break; } value.all = r2 + 60000; break; } trim = r22.trim; value3 = Reflect.apply(trim, r22, []); split = value3.split; iterator = Reflect.apply(split, value3, [','])[Symbol.iterator](); iterator2 = iterator.next; value4 = environment; value5 = 60; r23 = iterator; while (true) { item2 = Reflect.apply(iterator2, r23, []); item = item2.value; item2 = item2.done ? undefined : r23; if (item2 === undefined) { break; } try { split = item.split; } catch (error) { break exceptionLanding60; } try { value6 = Reflect.apply(split, item, [':', 5]); } catch (error) { break exceptionLanding60; } try { binding = env0_0; } catch (error) { break exceptionLanding60; } try { value7 = binding(value6, 5); } catch (error) { break exceptionLanding60; } try { property = value7[0]; } catch (error) { break exceptionLanding60; } try { property2 = value7[1]; } catch (error) { break exceptionLanding60; } try { property3 = value7[4]; } catch (error) { break exceptionLanding60; } try { parseInt = global.parseInt; } catch (error) { break exceptionLanding60; } try { int = parseInt(property, 10); } catch (error) { break exceptionLanding60; } try { isNaN = global.isNaN; } catch (error) { break exceptionLanding60; } try { isNaN2 = isNaN(int); } catch (error) { break exceptionLanding60; } if (isNaN2) { r23 = value5; continue; } r23 = int; try { value8 = 1000 * r23; } catch (error) { break exceptionLanding60; } if (property2) { try { split = property2.split; } catch (error) { break exceptionLanding60; } try { value10 = Reflect.apply(split, property2, [';']); } catch (error) { break exceptionLanding60; } try { iterator = value10[Symbol.iterator](); iterator3 = iterator.next; } catch (error) { break exceptionLanding60; } r24 = iterator; while (true) { try { item3 = Reflect.apply(iterator3, r24, []); item = item3.value; item3 = item3.done ? undefined : r24; } catch (error) { break exceptionLanding60; } try { value11 = item3 === undefined; } catch (error) { break exceptionLanding60; } if (value11) { r23 = item2; break; } value12 = item === 'metric_bucket'; if (!value12) { r26 = value12; continue; } r26 = property3; if (!r26) { r25 = r26; continue; } try { try { split = property3.split; } catch (error) { break exceptionLanding57; } } catch (error) { break exceptionLanding60; } try { try { value13 = Reflect.apply(split, property3, [';']); } catch (error) { break exceptionLanding57; } } catch (error) { break exceptionLanding60; } try { try { includes = value13.includes; } catch (error) { break exceptionLanding57; } } catch (error) { break exceptionLanding60; } try { try { value14 = Reflect.apply(includes, value13, ['custom']); } catch (error) { break exceptionLanding57; } } catch (error) { break exceptionLanding60; } value15 = !value14; r25 = value15; if (r25) { continue; } try { try { value16 = r2 + value8; } catch (error) { break exceptionLanding57; } } catch (error) { break exceptionLanding60; } try { try { value[item] = value16; } catch (error) { break exceptionLanding57; } } catch (error) { break exceptionLanding60; } r24 = item3; } } else { try { value9 = r2 + value8; } catch (error) { break exceptionLanding60; } try { value.all = value9; } catch (error) { break exceptionLanding60; } r23 = item2; } } return value; break exceptionSkip57; } try { try { item3.return(); } catch { } } catch (error) { break exceptionLanding60; } try { throw error; } catch (error) { break exceptionLanding60; } break exceptionSkip57; } break exceptionSkip60; } try { item2.return(); } catch { } throw error; break exceptionSkip60; } }