// Module ID: 13909 // Function ID: 13910 // Name: onClose // Dependencies: [5, 32, 19, 1386, 13861, 21, 3, 4731, 8292, 586, 4494, 689, 13910, 2] // Exports: default // Module 13909 (onClose) import timestampDefault from "timestamp" /* 3 */; import _modDef4731 from "module_4731" /* 4731 */; import closure_3 from "asyncGeneratorStep" /* 5 */; import closure_4 from "_slicedToArray" /* 32 */; import closure_5 from "noop" /* 19 */; import closure_6 from "ensureGuildLoaded" /* 1386 */; import { SHARE_SCREEN_MODAL_KEY } from "SHARE_SCREEN_MODAL_KEY" /* 13861 */; import { jsx } from "jsxProd" /* 21 */; let require = arg1; function onClose() { _modDef4731.popWithKey(SHARE_SCREEN_MODAL_KEY); } let closure_9 = new timestampDefault("ShareScreenModal"); const tmp2 = new timestampDefault("ShareScreenModal"); const result = require("set").fileFinishedImporting("modules/share/native/ShareScreenModal.tsx"); export default function ShareScreenModal(text) { text = text.text; require = text; const channelId = text.channelId; const shareId = text.shareId; const attachmentManifest = text.attachmentManifest; let first; let React; let stateFromStores; closure_7 = undefined; let first1; let obj = React; let tmp = first(React.useState(null), 2); first = tmp[0]; React = tmp[1]; let items = [shareId, attachmentManifest]; const effect = React.useEffect(() => { function _fetchAttachments() { const self = this; const tmp = attachmentManifest(function*() { if (v0 === 2) { v0 = 3; HermesBuiltin.throwTypeError(); } else if (tmp6 === 3) { if (arg0 === 1) { throw arg1; } else if (arg0 === 2) { let obj = { value: null, done: true }; obj[0] = arg1; return obj; } else { return { value: "HermesInternal", done: null }; } } else { try { v0 = 2; if (0 === c4) { if (arg0 === 1) { v0 = 3; throw arg1; } else if (arg0 === 2) { v0 = 3; obj = { value: null, done: true }; obj[0] = arg1; return obj; } else { closure_1 = tmp3; closure_0 = tmp7; closure_0 = undefined; if (undefined !== closure_1_2) { if (undefined !== c3) { c3 = 1; obj1 = closure_2_1(closure_2_2[8]); c4 = 2; v0 = 1; obj1 = { value: null, done: false }; obj1[0] = obj1.sharedAttachments(tmp20, tmp21); return obj1; } } } } else { if (1 === tmp7) { c3 = 0; closure_1 = closure_2; closure_2_9.error("Error fetching attachments:", closure_1); } else if (arg0 === 1) { v0 = 3; throw arg1; } else if (arg0 !== 2) { closure_0 = arg1; v0(closure_0); c3 = 0; } c3 = 0; v0 = 3; obj = { value: null, done: true }; obj[0] = arg1; return obj; } v0 = 3; } catch (tmp24) { closure_2 = tmp24; if (tmp4 === c3) { v0 = tmp2; throw tmp24; } else { c4 = tmp; } } } }); closure_0 = tmp; const apply = tmp.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; } !(function fetchAttachments() { const self = this; const apply = _fetchAttachments.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; })(); }, items); const items1 = [stateFromStores]; stateFromStores = require(shareId[9]).useStateFromStores(items1, () => stateFromStores.getChannel(channelId)); const tmp6 = first(React.useState(null), 2); closure_7 = tmp6[1]; const items2 = [channelId, stateFromStores]; const effect1 = React.useEffect(() => { function _fetchChannel() { const self = this; const tmp = attachmentManifest(function*() { if (c5 === 2) { c5 = 3; HermesBuiltin.throwTypeError(); } else if (tmp6 === 3) { if (arg0 === 1) { throw arg1; } else if (arg0 === 2) { let obj = { value: null, done: true }; obj[0] = arg1; return obj; } else { return { value: "HermesInternal", done: null }; } } else { try { c5 = 2; if (0 === c4) { if (arg0 === 1) { c5 = 3; throw arg1; } else if (arg0 === 2) { c5 = 3; obj = { value: null, done: true }; obj[0] = arg1; return obj; } else { closure_1 = tmp3; closure_0 = tmp7; closure_0 = undefined; if (null != closure_1_1) { if (null == closure_1_6) { c3 = 1; obj1 = closure_2_1(closure_2_2[10]); c4 = 2; c5 = 1; obj1 = { value: null, done: false }; obj1[0] = obj1.fetchChannel(tmp20); return obj1; } } } } else { if (1 === tmp7) { c3 = 0; closure_1 = closure_2; closure_2_9.error("Error fetching channel:", closure_1); } else if (arg0 === 1) { c5 = 3; throw arg1; } else if (arg0 !== 2) { closure_0 = arg1; closure_1_7(closure_0); c3 = 0; } c3 = 0; c5 = 3; obj = { value: null, done: true }; obj[0] = arg1; return obj; } c5 = 3; } catch (tmp24) { closure_2 = tmp24; if (tmp4 === c3) { c5 = tmp2; throw tmp24; } else { c4 = tmp; } } } }); closure_0 = tmp; const apply = tmp.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; } !(function fetchChannel() { const self = this; const apply = _fetchChannel.apply; if (typeof apply === "unknown") { let applyArgumentsResult = HermesBuiltin.applyArguments(self); } else { applyArgumentsResult = apply(self, arguments); } return applyArgumentsResult; })(); }, items2); first1 = stateFromStores; if (stateFromStores == null) { first1 = tmp6[0]; } const items3 = [text, first, channelId, first1]; const memo = obj.useMemo(() => { const obj = { text: closure_0, attachments: null }; let items = first; if (first == null) { items = []; } obj[1] = items; if (null != first1) { if (tmp.type !== text(shareId[11]).ChannelTypes.DM) { obj.targetChannelId = channelId; } else { let isArray = tmp; if (tmp) { isArray = "recipients" in tmp; } if (isArray) { const _Array = Array; isArray = Array.isArray(tmp.recipients); } if (isArray) { obj.targetUserId = tmp.recipients[0]; } else { let tmp4 = tmp; if (tmp) { tmp4 = "recipient" in tmp; } if (tmp4) { tmp4 = "id" in tmp.recipient; } if (tmp4) { const recipient = tmp.recipient; let id; if (recipient != null) { id = recipient.id; } obj.targetUserId = id; } } } } return obj; }, items3); obj = { sharedContent: memo, onClose }; return first1(channelId(shareId[12]), obj); };