/* Metro module 7134; source: unknown; dependencies: [7135] */ function _fun57076(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7312:6, offset: 0x013dbc62, size: 163 bytes, params: 8, frame: 13 const closure = function(a0) { this.data = a0; this.left = null; this.right = null; this.red = true; }; const closure2 = function(a0) { this._root = null; this._comparator = a0; this.size = 0; }; const is_red = function(a0) { return a0 !== null && a0.red; }; const single_rotate = function(a0, a1) { var value = !a1; var value2 = a0.get_child(value); a0.set_child(value, value2.get_child(a1)); value2.set_child(a1, a0); a0.red = true; value2.red = false; return value2; }; const double_rotate = function(a0, a1) { var value = !a1; var single_rotateBinding = single_rotate; a0.set_child(value, single_rotateBinding(a0.get_child(value), value)); return single_rotateBinding(a0, a1); }; closure.prototype.get_child = function(a0) { return a0 ? this.right : this.left; }; closure.prototype.set_child = function(a0, a1) { if (a0) { this.right = a1; } else { this.left = a1; } }; let value = require(7135) /* metro dependency 7135 */; value = new value(); closure2.prototype = value; closure2.prototype.insert = insert_57084; closure2.prototype.remove = remove_57085; module.exports = closure2; } function insert_57084(a0) { // fn#57084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7312:628, offset: 0x013dbe19, size: 493 bytes, params: 2, frame: 34 var r5; var r6; var r7; var r8; var r9; var r10; var r14; var r19; var r0; var r18; var prototype; var value3; var node_57077; var value4; var value5; var value6; var value7; var is_redBinding; var left; var value8; var right; var value9; var value10; var value11; var size; var value12; var get_child; var _comparator; var data; var value13; var value14; var value15; let _root = this._root; const value = null; if (value === _root) { node_57077 = new Node_57077(a0); this._root = node_57077; size = this.size; this.size = typeof size === 'bigint' ? size + 1n : +size + 1; node_57077 = true; r0 = node_57077; } else { prototype = Node_57077.prototype; value3 = Object.create(prototype, {constructor: {value: Node_57077}}); node_57077 = new Node_57077(undefined); value4 = node_57077 instanceof Object ? node_57077 : value3; _root = this._root; value4.right = this._root; value5 = false; value6 = 0; value7 = true; r5 = value; r6 = value4; r7 = value; r8 = value6; r9 = value6; r10 = value5; r14 = _root; while (true) { if (value !== r14) { is_redBinding = is_red; left = r14.left; value8 = is_redBinding(left); if (!value8) { r19 = value8; continue; } value9 = is_red(r14.right); r19 = value9; if (r19) { r14.red = value7; left = r14.left; left.red = value5; r14.right.red = value5; r0 = r10; r18 = r14; break; } r0 = r10; r18 = r14; break; } prototype = Node_57077.prototype; value10 = Object.create(prototype, {constructor: {value: Node_57077}}); node_57077 = new Node_57077(a0); value11 = node_57077 instanceof Object ? node_57077 : value10; r5.set_child(r9, value11); size = this.size; this.size = typeof size === 'bigint' ? size + 1n : +size + 1; r0 = value7; r18 = value11; if (!is_red(r18)) { continue; } if (!is_red(r5)) { continue; } right = r6.right; value12 = right === r7; get_child = r5.get_child; if (r18 === Reflect.apply(get_child, r5, [r8])) { r6.set_child(value12, single_rotate(r7, !r8)); } else { r6.set_child(value12, double_rotate(r7, !r8)); } _comparator = this._comparator; data = r18.data; value13 = Reflect.apply(_comparator, this, [data, a0]); if (value6 === value13) { break; } value14 = value13 < value6; if (value === r7) { continue; } r6 = r7; continue; value15 = r18.get_child(value14); r7 = r5; r5 = r18; r8 = r9; r9 = value14; r10 = r0; r14 = value15; } right = value4.right; this._root = right; } this._root.red = false; return r0; } function remove_57085(a0) { // fn#57085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7312:1237, offset: 0x013dc006, size: 735 bytes, params: 2, frame: 40 var r10; var r11; var r12; var r13; var r20; var r6; var r8; var r9; var value7; var _comparator; var data; var value8; var value9; var is_redBinding; var value10; var value11; var value12; var right; var value13; var set_child; var value14; var left; var value15; var value17; var size; let _root = this._root; const value = null; if (value === _root) { return false; } const node_57077 = new Node_57077(undefined); node_57077.right = this._root; let get_child = node_57077.get_child; const value5 = 1; if (value === Reflect.apply(get_child, node_57077, [value5])) { r6 = value; r8 = value; r9 = node_57077; } else { r10 = value5; r11 = value; r12 = value; r13 = node_57077; reducibleLoop2: while (true) { get_child = r13.get_child; value7 = Reflect.apply(get_child, r13, [r10]); _comparator = this._comparator; data = value7.data; value8 = Reflect.apply(_comparator, this, [a0, data]); value9 = value8 > 0; if (value8 === 0) { r11 = value7; } is_redBinding = is_red; reducibleJoin17: while (true) { if (is_redBinding(value7)) { r20 = r13; break reducibleJoin17; } is_redBinding = is_red; get_child = value7.get_child; if (is_redBinding(Reflect.apply(get_child, value7, [value9]))) { r20 = r13; break reducibleJoin17; } is_redBinding = is_red; get_child = value7.get_child; value10 = !value9; if (is_redBinding(Reflect.apply(get_child, value7, [value10]))) { value15 = single_rotate(value7, value9); set_child = r13.set_child; Reflect.apply(set_child, r13, [r10, value15]); r20 = value15; break reducibleJoin17; } is_redBinding = is_red; get_child = value7.get_child; if (is_redBinding(Reflect.apply(get_child, value7, [value10]))) { r20 = r13; break reducibleJoin17; } get_child = r13.get_child; value11 = !r10; value12 = Reflect.apply(get_child, r13, [value11]); if (value === value12) { r20 = r13; break reducibleJoin17; } is_redBinding = is_red; get_child = value12.get_child; if (!is_redBinding(Reflect.apply(get_child, value12, [value11]))) { if (!is_red(value12.get_child(r10))) { r13.red = false; value12.red = true; value7.red = true; r20 = r13; break reducibleJoin17; } } right = r12.right; value13 = right === r13; is_redBinding = is_red; get_child = value12.get_child; if (is_redBinding(Reflect.apply(get_child, value12, [r10]))) { set_child = r12.set_child; Reflect.apply(set_child, r12, [value13, double_rotate(r13, r10)]); } else { reducibleJoin15: while (true) { if (is_red(value12.get_child(value11))) { set_child = r12.set_child; Reflect.apply(set_child, r12, [value13, single_rotate(r13, r10)]); break reducibleJoin15; } break reducibleJoin15; } } get_child = r12.get_child; value14 = Reflect.apply(get_child, r12, [value13]); value14.red = true; value7.red = true; left = value14.left; left.red = false; right = value14.right; right.red = false; r20 = r13; break reducibleJoin17; } get_child = value7.get_child; if (value !== Reflect.apply(get_child, value7, [value9])) { r10 = value9; r12 = r20; r13 = value7; continue reducibleLoop2; } r6 = r11; r8 = r20; r9 = value7; break reducibleLoop2; } } const value16 = value !== r6; reducibleJoin20: while (true) { if (value16) { data = r9.data; r6.data = data; set_child = r8.set_child; right = r8.right; get_child = r9.get_child; left = r9.left; value17 = Reflect.apply(get_child, r9, [value === left]); Reflect.apply(set_child, r8, [right === r9, value17]); size = this.size; this.size = typeof size === 'bigint' ? size - 1n : +size - 1; break reducibleJoin20; } break reducibleJoin20; } this._root = node_57077.right; _root = this._root; reducibleJoin22: while (true) { if (value === _root) { break reducibleJoin22; } _root = this._root; _root.red = false; break reducibleJoin22; } return value16; }