decord/source/modules/polls/PollUploadAttachmentActionCreators.native.tsx

289 lines
9.1 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 11379
// Function ID: 11380
2026-07-20 16:05:17 +00:00
// Name: _handlePollGifAttachmentAdd
2026-08-15 05:55:55 +00:00
// Dependencies: [5, 4825, 7576, 11380, 8949, 4838, 4829, 8466, 2]
2026-07-20 16:05:17 +00:00
// Exports: handlePollGifAttachmentAdd, handlePollMediaAttachmentAdd, removeAllPollUploadAttachments, removePollUploadAttachment
2026-08-15 05:55:55 +00:00
// Module 11379 (_handlePollGifAttachmentAdd)
2026-07-23 10:11:24 +00:00
import openImagePickerUnhandled from "openImagePickerUnhandled";
2026-07-29 08:29:29 +00:00
import { DraftType } from "handleChanged";
2026-07-23 10:11:24 +00:00
import { POLL_ATTACHMENT_FOLDER } from "POLL_ATTACHMENT_FOLDER";
const require = arg1;
2026-07-20 16:05:17 +00:00
function _handlePollGifAttachmentAdd() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1, arg2) => {
let closure_0 = arg0;
let closure_1 = arg1;
let closure_2 = arg2;
let c7 = 0;
let c8 = 0;
let c6 = 0;
return (function*(arg0, arg1, arg2) {
if (c8 === 2) {
c8 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-15 05:55:55 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c8 = 2;
if (0 === obj7) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
c8 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let Poll = tmp3;
let openImagePickerUnhandled = tmp5;
let dependencyMap;
openImagePickerUnhandled = undefined;
Poll = undefined;
let closure_5;
let styles;
obj7 = undefined;
2026-08-15 05:55:55 +00:00
dependencyMap = callback(11380).getFileNameFromGifUrl(callback2, dependencyMap);
2026-07-29 08:29:29 +00:00
styles = 1;
2026-08-15 05:55:55 +00:00
const obj16 = callback(11380);
2026-07-29 08:29:29 +00:00
obj7 = 2;
c8 = 1;
const obj1 = { value: null, done: false };
2026-08-15 05:55:55 +00:00
obj1[0] = callback(11380).downloadPollGif(dependencyMap);
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (1 === tmp8) {
styles = 0;
c8 = 3;
2026-08-15 05:55:55 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
} else if (2 === tmp8) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
styles = 0;
c8 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
openImagePickerUnhandled = arg1;
if (null == openImagePickerUnhandled) {
styles = 0;
c8 = 3;
2026-08-15 05:55:55 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
} else {
2026-08-15 05:55:55 +00:00
obj7 = callback(11380);
2026-07-29 08:29:29 +00:00
Poll = obj7.getFilePathForGif(dependencyMap);
2026-08-15 05:55:55 +00:00
let obj8 = callback(8949);
2026-07-29 08:29:29 +00:00
obj7 = 3;
c8 = 1;
const obj3 = { value: null, done: false };
obj3[0] = obj8.writeFile("cache", Poll, openImagePickerUnhandled, "base64");
return obj3;
}
}
} else if (3 === tmp8) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
styles = 0;
c8 = 3;
let obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
} else {
closure_5 = arg1;
if (null == closure_5) {
styles = 0;
c8 = 3;
2026-08-15 05:55:55 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
} else {
2026-08-15 05:55:55 +00:00
obj4 = callback(4838);
2026-07-29 08:29:29 +00:00
obj7 = 4;
c8 = 1;
const obj5 = { value: null, done: false };
obj5[0] = obj4.getImageDimensionsIfMissing(closure_5);
return obj5;
}
}
} else if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
styles = 0;
c8 = 3;
const obj6 = { value: null, done: true };
obj6[0] = arg1;
return obj6;
} else {
styles = arg1;
obj7 = { id: null, origin: null, uri: null, originalUri: null, filename: null, mimeType: "image/gif", width: null, height: null, platform: null };
obj7[0] = callback2;
2026-08-15 05:55:55 +00:00
obj7[1] = callback(4829).UploadOrigin.IMAGE_PICKER;
2026-07-29 08:29:29 +00:00
obj7[2] = closure_5;
obj7[3] = closure_5;
obj7[4] = dependencyMap;
let width;
if (styles != null) {
width = styles.width;
}
obj7[6] = width;
let height;
if (styles != null) {
height = styles.height;
}
obj7[7] = height;
2026-08-15 05:55:55 +00:00
obj7[8] = callback(4829).UploadPlatform.REACT_NATIVE;
obj = callback2(8466);
2026-07-29 08:29:29 +00:00
obj8 = { file: null, channelId: null, draftType: null };
obj8[0] = obj7;
obj8[1] = callback;
obj8[2] = Poll.Poll;
obj.addFile(obj8);
styles = 0;
c8 = 3;
const obj9 = { value: null, done: true };
obj9[0] = closure_5;
return obj9;
}
} catch (tmp40) {
closure_5 = tmp40;
if (tmp4 === styles) {
c8 = tmp2;
throw tmp40;
} else {
obj7 = tmp;
}
}
}
})();
});
const _handlePollGifAttachmentAdd = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _removePollUploadAttachment() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1, arg2) => {
let closure_0 = arg0;
let closure_1 = arg1;
let closure_2 = arg2;
let c4 = 0;
let c3 = 0;
let c6 = 0;
return (function*(arg0, arg1, arg2) {
2026-08-04 21:03:28 +00:00
let c6 = 1;
2026-08-15 05:55:55 +00:00
callback2(8466).remove(callback, callback2, Poll.Poll);
const obj5 = callback2(8466);
const obj6 = callback(8949);
yield obj6.removeFile("cache", callback(11380).getFilePathForGif(dependencyMap));
2026-08-04 21:03:28 +00:00
if (1 === tmp6) {
c6 = 0;
let c3 = 3;
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c3 = 3;
2026-08-04 21:03:28 +00:00
throw arg1;
} else if (arg0 !== 2) {
c6 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
c6 = 0;
return arg1;
2026-07-29 08:29:29 +00:00
})();
});
const _removePollUploadAttachment = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _removeAllPollUploadAttachments() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
let closure_0 = arg0;
let c2 = 0;
let c1 = 0;
let c4 = 0;
return (function*(arg0) {
2026-08-04 21:03:28 +00:00
let Poll = 1;
2026-08-15 05:55:55 +00:00
const obj1 = v0(8466);
2026-08-04 21:03:28 +00:00
obj1.clearAll(callback, Poll.Poll);
2026-08-15 05:55:55 +00:00
yield callback(8949).clearFolder("cache", outer1_5);
2026-08-04 21:03:28 +00:00
if (1 === tmp6) {
Poll = 0;
2026-07-29 08:29:29 +00:00
v0 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 !== 2) {
Poll = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
Poll = 0;
return arg1;
2026-07-29 08:29:29 +00:00
})();
});
const _removeAllPollUploadAttachments = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const result = require("POLL_ATTACHMENT_FOLDER").fileFinishedImporting("modules/polls/PollUploadAttachmentActionCreators.native.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const handlePollGifAttachmentAdd = function handlePollGifAttachmentAdd(closure_0, localCreationAnswerId, closure_2) {
const self = this;
const apply = _handlePollGifAttachmentAdd.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export function handlePollMediaAttachmentAdd(arg0, localCreationAnswerId, arg2) {
}
export const removePollUploadAttachment = function removePollUploadAttachment(arg0, localCreationAnswerId, fileNameFromGifUrl) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _removePollUploadAttachment.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const removeAllPollUploadAttachments = function removeAllPollUploadAttachments(closure_4) {
const self = this;
const apply = _removeAllPollUploadAttachments.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};