2026-10-07 22:43:51 +00:00
|
|
|
// Module ID: 7876
|
|
|
|
|
// Function ID: 7877
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: FileManagerUtils
|
2026-10-07 22:43:51 +00:00
|
|
|
// Dependencies: [5, 3, 1162, 1369, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
// Exports: clearFolder, moveFile, readFile, removeFile, writeFile
|
|
|
|
|
|
2026-10-07 22:43:51 +00:00
|
|
|
// Module 7876 (FileManagerUtils)
|
2026-09-18 19:45:33 +00:00
|
|
|
import LoggerDefault from "Logger" /* 3 */;
|
2026-10-07 22:43:51 +00:00
|
|
|
import react_nativeDefault from "react-native" /* 1162 */;
|
|
|
|
|
import PlatformUtils from "PlatformUtils" /* 1369 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let c7, c8, closure_5;
|
|
|
|
|
|
|
|
|
|
let obj = function _readFile() {
|
|
|
|
|
obj = _asyncToGenerator(async (arg0, value, arg2) => {
|
|
|
|
|
function getBaseDirectory(arg0) {
|
|
|
|
|
let DocumentsDirPath;
|
|
|
|
|
if ("shared" === arg0) {
|
|
|
|
|
let SharedDirPath;
|
|
|
|
|
obj = closure_1_0(closure_1_2[3]);
|
|
|
|
|
const tmp2 = closure_1_2;
|
|
|
|
|
if (!obj.isAndroid()) {
|
|
|
|
|
const obj2 = closure_1_1(tmp2[2]);
|
|
|
|
|
SharedDirPath = obj2.getConstants().SharedDirPath;
|
|
|
|
|
}
|
|
|
|
|
return SharedDirPath;
|
|
|
|
|
}
|
|
|
|
|
if ("cache" === arg0) {
|
|
|
|
|
const obj4 = closure_1_1(closure_1_2[2]);
|
|
|
|
|
DocumentsDirPath = obj4.getConstants().CacheDirPath;
|
|
|
|
|
} else {
|
|
|
|
|
const obj3 = closure_1_1(closure_1_2[2]);
|
|
|
|
|
DocumentsDirPath = obj3.getConstants().DocumentsDirPath;
|
|
|
|
|
}
|
|
|
|
|
SharedDirPath = DocumentsDirPath;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_0 = arg0;
|
|
|
|
|
let closure_1 = value;
|
|
|
|
|
let closure_2 = arg2;
|
|
|
|
|
if (c8 === 2) {
|
|
|
|
|
c8 = 3;
|
|
|
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
|
|
|
} else if (tmp3 === 3) {
|
|
|
|
|
if (arg0 === 1) {
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
let obj2 = { value, done: true };
|
|
|
|
|
return obj2;
|
|
|
|
|
} else {
|
2026-10-02 13:37:24 +00:00
|
|
|
return { value: "IconComponent", done: null };
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
let c6;
|
|
|
|
|
try {
|
|
|
|
|
let fileExistsResult;
|
|
|
|
|
c8 = 2;
|
|
|
|
|
const tmp4 = c7;
|
|
|
|
|
if (0 === c7) {
|
|
|
|
|
if (arg0 === 1) {
|
|
|
|
|
c8 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
c8 = 3;
|
|
|
|
|
const obj5 = { value, done: true };
|
|
|
|
|
return obj5;
|
|
|
|
|
} else {
|
|
|
|
|
closure_4 = tmp;
|
|
|
|
|
closure_0 = closure_1;
|
|
|
|
|
closure_1 = closure_2;
|
|
|
|
|
const tmp36 = getBaseDirectory(closure_0);
|
|
|
|
|
closure_2 = tmp36;
|
|
|
|
|
const tmp34 = closure_1;
|
|
|
|
|
if (null == tmp36) {
|
|
|
|
|
c8 = 3;
|
|
|
|
|
return { value: null, done: true };
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj7 = react_nativeDefault;
|
|
|
|
|
fileExistsResult = obj7.fileExists(tmp36 + "/" + tmp34);
|
|
|
|
|
c7 = 1;
|
|
|
|
|
c8 = 1;
|
|
|
|
|
const obj6 = { value: fileExistsResult, done: false };
|
|
|
|
|
return obj6;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
} else if (1 === tmp4) {
|
|
|
|
|
if (arg0 === 1) {
|
|
|
|
|
c8 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
|
|
|
|
c8 = 3;
|
|
|
|
|
const obj8 = { value, done: true };
|
|
|
|
|
return obj8;
|
|
|
|
|
} else if (value) {
|
|
|
|
|
c6 = 1;
|
|
|
|
|
let obj4 = closure_132_1(closure_132_2[2]);
|
|
|
|
|
fileExistsResult = obj4.readFile(closure_2 + "/" + closure_0, closure_1);
|
|
|
|
|
c7 = 3;
|
|
|
|
|
c8 = 1;
|
|
|
|
|
const obj9 = { value: fileExistsResult, done: false };
|
|
|
|
|
return obj9;
|
|
|
|
|
} else {
|
|
|
|
|
c8 = 3;
|
|
|
|
|
return { value: null, done: true };
|
|
|
|
|
}
|
|
|
|
|
} else if (2 === tmp4) {
|
|
|
|
|
c6 = 0;
|
|
|
|
|
let closure_3 = closure_5;
|
|
|
|
|
let obj3 = closure_132_0(closure_132_2[3]);
|
|
|
|
|
fileExistsResult = obj3.isAndroid();
|
|
|
|
|
if (fileExistsResult) {
|
|
|
|
|
closure_132_4.error("Failed to read file from disk", closure_3);
|
2026-09-18 19:45:33 +00:00
|
|
|
c8 = 3;
|
|
|
|
|
return { value: null, done: true };
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
fileExistsResult = closure_3;
|
|
|
|
|
throw closure_3;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
} else if (arg0 === 1) {
|
2026-09-18 19:45:33 +00:00
|
|
|
c8 = 3;
|
|
|
|
|
throw value;
|
|
|
|
|
} else if (arg0 === 2) {
|
2026-10-01 14:13:23 +00:00
|
|
|
c6 = 0;
|
2026-09-18 19:45:33 +00:00
|
|
|
c8 = 3;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj10 = { value, done: true };
|
|
|
|
|
return obj10;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
c6 = 0;
|
2026-09-18 19:45:33 +00:00
|
|
|
c8 = 3;
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = { value, done: true };
|
|
|
|
|
return obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
} catch (tmp26) {
|
|
|
|
|
closure_5 = tmp26;
|
|
|
|
|
if (0 === c6) {
|
2026-09-18 19:45:33 +00:00
|
|
|
c8 = 3;
|
2026-10-01 14:13:23 +00:00
|
|
|
throw tmp26;
|
2026-09-18 19:45:33 +00:00
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
c7 = 2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
});
|
|
|
|
|
return obj(...arguments);
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp2 = new LoggerDefault("FileManagerUtils");
|
|
|
|
|
let closure_4 = tmp2;
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("utils/FileManagerUtils.native.tsx");
|
|
|
|
|
|
2026-10-07 22:43:51 +00:00
|
|
|
export const writeFile = function writeFile(cache, combined2, value, utf8) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = react_nativeDefault;
|
2026-10-07 22:43:51 +00:00
|
|
|
const writeFileResult = obj.writeFile(cache, combined2, value, utf8);
|
2026-10-01 14:13:23 +00:00
|
|
|
return writeFileResult.then((result) => {
|
2026-09-18 19:45:33 +00:00
|
|
|
let combined = result;
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = PlatformUtils;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (obj.isAndroid()) {
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
combined = "file:" + result;
|
|
|
|
|
}
|
|
|
|
|
return combined;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
export const moveFile = function moveFile(arg0, arg1, arg2) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = react_nativeDefault;
|
|
|
|
|
return obj.moveFile(arg0, arg1, arg2);
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|
|
|
|
|
export const removeFile = function removeFile(cache, filePathForGif) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = react_nativeDefault;
|
|
|
|
|
return obj.removeFile(cache, filePathForGif);
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|
2026-10-07 22:43:51 +00:00
|
|
|
export const clearFolder = function clearFolder(cache, c5) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = react_nativeDefault;
|
2026-10-07 22:43:51 +00:00
|
|
|
return obj.clearFolder(cache, c5);
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|
|
|
|
|
export const readFile = function readFile() {
|
2026-10-01 14:13:23 +00:00
|
|
|
return obj(...arguments);
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|