decord/source/utils/LazyAPIPromise.tsx

128 lines
3.5 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 8835
// Function ID: 8836
2026-07-20 16:05:17 +00:00
// Name: useLazyAPIPromise
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 32, 19, 4277, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 8835 (useLazyAPIPromise)
import closure_2 from "asyncGeneratorStep" /* 5 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("utils/LazyAPIPromise.tsx");
2026-07-20 16:05:17 +00:00
export default function useLazyAPIPromise(arg0, arg1) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
2026-07-28 08:39:19 +00:00
function _execFn() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback(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 {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} 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 {
let aPIError = tmp3;
2026-08-24 06:08:38 +00:00
closure_0 = tmp7;
2026-07-29 08:29:29 +00:00
closure_0 = undefined;
aPIError = undefined;
2026-08-24 06:08:38 +00:00
closure_1_2(true);
2026-07-29 08:29:29 +00:00
v0(null);
v0 = 1;
c4 = 2;
c5 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_0();
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (1 === tmp7) {
v0 = 0;
2026-08-24 06:08:38 +00:00
aPIError = new closure_1_0(closure_1_1[3]).APIError(callback);
2026-07-29 08:29:29 +00:00
if (aPIError != null) {
tmp25(aPIError);
}
2026-08-24 06:08:38 +00:00
v0(closure_1_1);
2026-07-29 08:29:29 +00:00
callback(false);
c5 = 3;
return { value: null, done: true };
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 0;
c5 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
closure_0 = arg1;
callback(false);
v0(null);
v0 = 0;
c5 = 3;
obj = { value: null, done: true };
obj[0] = closure_0;
return obj;
}
} catch (tmp41) {
callback = tmp41;
if (tmp4 === v0) {
c5 = tmp2;
throw tmp41;
} else {
c4 = tmp;
}
}
}
});
2026-08-24 06:08:38 +00:00
closure_4 = tmp;
2026-07-29 08:29:29 +00:00
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-29 08:29:29 +00:00
let tmp = callback(_execFn.useState(false), 2);
2026-08-24 06:08:38 +00:00
closure_2 = tmp[1];
2026-07-20 16:05:17 +00:00
const tmp2 = callback(_execFn.useState(null), 2);
2026-07-23 10:11:24 +00:00
callback = tmp2[1];
2026-07-20 16:05:17 +00:00
const items = [
function execFn() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _execFn.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
},
{ loading: tmp[0], error: tmp2[0] }
];
return items;
};