Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
// Module ID: 12275
|
|
// Function ID: 12276
|
|
// Name: PollAttachmentUtils
|
|
// Dependencies: [5, 7880, 2]
|
|
// Exports: downloadPollGif, getFileNameFromGifUrl, getFilePathForGif
|
|
|
|
// Module 12275 (PollAttachmentUtils)
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
|
|
let closure_2 = async function _downloadPollGif() {
|
|
const _fetch = fetch;
|
|
closure_130_0 = await fetch(closure_0);
|
|
function convertBlobToBase64(value) {
|
|
closure_0 = value;
|
|
const fileReader = new FileReader();
|
|
return new Promise((data, onerror) => {
|
|
fileReader.onload = () => {
|
|
const parts = fileReader.result.split(",");
|
|
data(parts.pop());
|
|
};
|
|
fileReader.onerror = onerror;
|
|
const asDataURL = fileReader.readAsDataURL(data);
|
|
});
|
|
}
|
|
await closure_130_0.blob();
|
|
return convertBlobToBase64(arg1);
|
|
};
|
|
const POLL_ATTACHMENT_FOLDER = fn(7880).POLL_ATTACHMENT_FOLDER;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/polls/PollAttachmentUtils.tsx");
|
|
|
|
export const getFileNameFromGifUrl = function getFileNameFromGifUrl(localCreationAnswerId, mediaURL) {
|
|
const parts = decodeURIComponent(mediaURL).split("/");
|
|
let str2 = parts.pop();
|
|
if (str2 == null) {
|
|
str2 = "temp.gif";
|
|
}
|
|
return "" + localCreationAnswerId + "-" + str2;
|
|
};
|
|
export const getFilePathForGif = function getFilePathForGif(arg0) {
|
|
return POLL_ATTACHMENT_FOLDER + "/" + arg0;
|
|
};
|
|
export const downloadPollGif = function downloadPollGif() {
|
|
const self = this;
|
|
const apply = closure_2.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|