decord/source/modules/message_previews/RemoteFetchData.tsx

172 lines
4.6 KiB
TypeScript
Raw Normal View History

// Module ID: 15244
// Function ID: 15245
2026-07-29 08:29:29 +00:00
// Name: FetchStatus
// Dependencies: [5, 2]
2026-07-20 16:05:17 +00:00
// Module 15244 (FetchStatus)
2026-08-24 06:08:38 +00:00
import closure_0 from "asyncGeneratorStep" /* 5 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let obj = { Pending: 0, [0]: "Pending", Fetching: 1, [1]: "Fetching" };
const result = require("set").fileFinishedImporting("modules/message_previews/RemoteFetchData.tsx");
class RemoteFetchData {
constructor() {
obj = Object.create(new.target.prototype);
set = new Set();
obj[0] = set;
set1 = new Set();
obj[1] = set1;
return obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const prototype = RemoteFetchData.prototype;
prototype["empty"] = function empty() {
return 0 === this.pending.size && 0 === this.fetching.size;
};
prototype["status"] = function status(arg0) {
const pending = this.pending;
if (pending.has(arg0)) {
let Pending = obj.Pending;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const fetching = this.fetching;
Pending = null;
if (fetching.has(arg0)) {
Pending = obj.Fetching;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return Pending;
};
prototype["addWant"] = function addWant(arg0) {
const fetching = this.fetching;
if (!fetching.has(arg0)) {
const pending = this.pending;
pending.add(arg0);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
prototype["removeWant"] = function removeWant(channel_id) {
const pending = this.pending;
pending.delete(channel_id);
const fetching = this.fetching;
fetching.delete(channel_id);
};
prototype["nextWants"] = function nextWants(arg0) {
const items = [...this.pending];
items.length = Math.min(arg0, items.length);
return items;
};
2026-08-24 06:08:38 +00:00
prototype["markFetching"] = function markFetching(closure_1_0) {
2026-07-29 08:29:29 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
const iter = closure_1_0[Symbol.iterator]();
2026-07-29 08:29:29 +00:00
const nextResult = iter.next();
while (iter !== undefined) {
let pending = self.pending;
let deleteResult = pending.delete(nextResult);
let fetching = self.fetching;
let addResult = fetching.add(nextResult);
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
prototype["markCompleted"] = function markCompleted(closure_0) {
2026-07-29 08:29:29 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
const iter = closure_0[Symbol.iterator]();
2026-07-29 08:29:29 +00:00
const nextResult = iter.next();
while (iter !== undefined) {
let pending = self.pending;
let deleteResult = pending.delete(nextResult);
let fetching = self.fetching;
let deleteResult1 = fetching.delete(nextResult);
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
2026-08-24 06:08:38 +00:00
prototype["markFailed"] = function markFailed(closure_0) {
2026-07-29 08:29:29 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
const iter = closure_0[Symbol.iterator]();
2026-07-29 08:29:29 +00:00
const nextResult = iter.next();
while (iter !== undefined) {
let pending = self.pending;
let addResult = pending.add(nextResult);
let fetching = self.fetching;
let deleteResult = fetching.delete(nextResult);
continue;
}
};
prototype["try"] = function try(nextWantsResult, arg1) {
const callback = nextWantsResult;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
2026-07-29 08:29:29 +00:00
const self = this;
return callback(function*() {
if (c5 === 2) {
c5 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
2026-08-24 06:08:38 +00:00
obj = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj[0] = arg1;
return obj;
2026-07-20 16:05:17 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-20 16:05:17 +00:00
}
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 {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3;
closure_0 = tmp7;
closure_0 = undefined;
c3 = 1;
closure_1_2.markFetching(closure_1_0);
2026-07-29 08:29:29 +00:00
c4 = 2;
c5 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_1();
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (1 === tmp7) {
c3 = 0;
closure_1 = closure_2;
2026-08-24 06:08:38 +00:00
closure_2.markFailed(closure_0);
2026-07-29 08:29:29 +00:00
throw closure_1;
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c3 = 0;
c5 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
closure_2.markCompleted(closure_0);
2026-07-29 08:29:29 +00:00
c3 = 0;
c5 = 3;
obj = { value: null, done: true };
2026-08-24 06:08:38 +00:00
obj[0] = closure_0;
2026-07-29 08:29:29 +00:00
return obj;
}
} catch (tmp25) {
closure_2 = tmp25;
if (tmp4 === c3) {
c5 = tmp2;
throw tmp25;
} else {
c4 = tmp;
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
})();
};
2026-07-20 16:05:17 +00:00
export const FetchStatus = obj;
2026-07-29 08:29:29 +00:00
export { RemoteFetchData };