decord/source/4144__fromURL.js

537 lines
15 KiB
JavaScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 4144
// Function ID: 4145
2026-07-29 08:29:29 +00:00
// Name: _fromURL
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 17, 4116]
2026-07-29 08:29:29 +00:00
2026-08-24 06:08:38 +00:00
// Module 4144 (_fromURL)
import _fromFileURL from "asyncGeneratorStep" /* 5 */;
import { Image as _fromResource } from "get ActivityIndicator" /* 17 */;
import { NitroModules } from "module_4116" /* 4116 */;
2026-07-29 08:29:29 +00:00
let _fromBytes = NitroModules.createHybridObject("RiveFileFactory");
let obj = {};
function _fromURL() {
const self = this;
const tmp = _fromFileURL((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
c5 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0, arg1) {
2026-08-12 06:57:52 +00:00
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 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-08-12 06:57:52 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_4 = tmp5;
closure_3 = tmp2;
2026-08-12 06:57:52 +00:00
let flag;
if (flag === undefined) {
flag = true;
}
c5 = 1;
c6 = 1;
return { value: "ct", done: true };
}
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-12 06:57:52 +00:00
obj1[0] = arg1;
return obj1;
} else {
let tmp12;
if (closure_1) {
obj = { data: null };
obj[0] = closure_1;
tmp12 = obj;
}
c6 = 3;
const obj2 = { value: null, done: true };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_3.fromURL(closure_0, flag, tmp12);
2026-08-12 06:57:52 +00:00
return obj2;
}
} catch (tmp17) {
c6 = tmp;
throw tmp17;
}
2026-07-29 08:29:29 +00:00
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_0 = 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;
}
_fromFileURL = function _fromFileURL(arg0) {
const self = this;
const tmp = _fromFileURL((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
c5 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0) {
2026-08-12 06:57:52 +00:00
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 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-08-12 06:57:52 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_4 = tmp5;
closure_3 = tmp2;
closure_1 = undefined;
2026-08-12 06:57:52 +00:00
let flag;
if (flag === undefined) {
flag = true;
}
c5 = 1;
c6 = 1;
return { value: "ct", done: true };
}
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-12 06:57:52 +00:00
obj1[0] = arg1;
return obj1;
} else {
let tmp12;
2026-08-24 06:08:38 +00:00
if (closure_1) {
2026-08-12 06:57:52 +00:00
obj = { data: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_1;
2026-08-12 06:57:52 +00:00
tmp12 = obj;
}
c6 = 3;
const obj2 = { value: null, done: true };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_3.fromFileURL(closure_0, flag, tmp12);
2026-08-12 06:57:52 +00:00
return obj2;
}
} catch (tmp17) {
c6 = tmp;
throw tmp17;
}
2026-07-29 08:29:29 +00:00
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_1 = 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;
};
_fromResource = function _fromResource() {
const self = this;
const tmp = _fromFileURL((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
c5 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0, arg1) {
2026-08-12 06:57:52 +00:00
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 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-08-12 06:57:52 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_4 = tmp5;
closure_3 = tmp2;
2026-08-12 06:57:52 +00:00
let flag;
if (flag === undefined) {
flag = true;
}
c5 = 1;
c6 = 1;
return { value: "ct", done: true };
}
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-12 06:57:52 +00:00
obj1[0] = arg1;
return obj1;
} else {
let tmp12;
if (closure_1) {
obj = { data: null };
obj[0] = closure_1;
tmp12 = obj;
}
c6 = 3;
const obj2 = { value: null, done: true };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_3.fromResource(closure_0, flag, tmp12);
2026-08-12 06:57:52 +00:00
return obj2;
}
} catch (tmp17) {
c6 = tmp;
throw tmp17;
}
2026-07-29 08:29:29 +00:00
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_2 = 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;
};
_fromBytes = function _fromBytes() {
const self = this;
const tmp = _fromFileURL((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
c5 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0, arg1) {
2026-08-12 06:57:52 +00:00
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 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-08-12 06:57:52 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_4 = tmp5;
closure_3 = tmp2;
2026-08-12 06:57:52 +00:00
let flag;
if (flag === undefined) {
flag = true;
}
c5 = 1;
c6 = 1;
return { value: "ct", done: true };
}
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-08-12 06:57:52 +00:00
obj1[0] = arg1;
return obj1;
} else {
let tmp12;
if (closure_1) {
obj = { data: null };
obj[0] = closure_1;
tmp12 = obj;
}
c6 = 3;
const obj2 = { value: null, done: true };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_3.fromBytes(closure_0, flag, tmp12);
2026-08-12 06:57:52 +00:00
return obj2;
}
} catch (tmp17) {
c6 = tmp;
throw tmp17;
}
2026-07-29 08:29:29 +00:00
}
})();
iter.next();
return iter;
});
2026-08-24 06:08:38 +00:00
closure_3 = 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;
};
function _fromSource() {
const self = this;
const tmp = _fromFileURL((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
c7 = 0;
c8 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
const iter = (function*(arg0, arg1) {
if (c8 === 2) {
c8 = 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 {
c8 = 2;
if (0 === message) {
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 uri = tmp3;
2026-08-24 06:08:38 +00:00
closure_3 = tmp7;
2026-07-29 08:29:29 +00:00
let flag;
if (flag === undefined) {
flag = true;
}
2026-08-24 06:08:38 +00:00
closure_3 = undefined;
2026-07-29 08:29:29 +00:00
uri = undefined;
2026-08-24 06:08:38 +00:00
closure_5 = undefined;
2026-07-29 08:29:29 +00:00
message = undefined;
message = 1;
c8 = 1;
2026-08-12 06:57:52 +00:00
return { value: "ct", done: true };
2026-07-29 08:29:29 +00:00
}
} else if (1 === tmp7) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
c8 = 3;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: true };
2026-07-29 08:29:29 +00:00
obj1[0] = arg1;
return obj1;
} else {
let tmp71 = null;
2026-08-04 21:03:28 +00:00
if (typeof closure_0 === "number") {
2026-07-29 08:29:29 +00:00
tmp71 = closure_0;
}
2026-08-24 06:08:38 +00:00
closure_3 = tmp71;
2026-07-29 08:29:29 +00:00
uri = null;
2026-08-04 21:03:28 +00:00
if (typeof closure_0 === "object") {
2026-07-29 08:29:29 +00:00
uri = closure_0.uri;
}
2026-08-24 06:08:38 +00:00
if (closure_3) {
const assetSource = closure_2.resolveAssetSource(closure_3);
2026-07-29 08:29:29 +00:00
let uri1;
if (assetSource != null) {
uri1 = assetSource.uri;
}
let tmp25 = uri1;
} else {
tmp25 = uri;
}
2026-08-24 06:08:38 +00:00
closure_5 = tmp25;
if (closure_5) {
2026-07-29 08:29:29 +00:00
message = 1;
2026-08-24 06:08:38 +00:00
if (closure_5.match(/https?:\/\//)) {
closure_0.fromURL(closure_5, closure_1, flag);
2026-07-29 08:29:29 +00:00
} else {
obj = closure_0;
2026-08-24 06:08:38 +00:00
if (closure_5.match(/file:\/\//)) {
obj.fromFileURL(closure_1_5, closure_1, closure_2);
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj.fromResource(closure_1_5, closure_1, closure_2);
2026-07-29 08:29:29 +00:00
}
}
message = 0;
c8 = 3;
} else {
const _Error3 = Error;
const _HermesInternal2 = HermesInternal;
2026-08-24 06:08:38 +00:00
error = new Error("Invalid source: could not resolve asset " + closure_0 + ". Ensure 'riv' is in metro.config.js assetExts.");
2026-07-29 08:29:29 +00:00
throw error;
}
}
} else {
message = 0;
2026-08-24 06:08:38 +00:00
message = closure_5;
2026-07-29 08:29:29 +00:00
const _Error = Error;
if (message instanceof Error) {
message = message.message;
} else {
const _String = String;
message = String(message);
}
const _Error2 = Error;
const _HermesInternal = HermesInternal;
const error1 = new Error("Failed to load Rive file from source: " + message);
throw error1;
}
} catch (tmp59) {
2026-08-24 06:08:38 +00:00
closure_5 = tmp59;
2026-07-29 08:29:29 +00:00
if (tmp4 === message) {
c8 = tmp2;
throw tmp59;
} else {
message = tmp;
}
}
}
})();
iter.next();
return iter;
});
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-08-24 06:08:38 +00:00
obj.fromURL = function fromURL(closure_5, closure_1, flag) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fromURL.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};
2026-08-24 06:08:38 +00:00
obj.fromFileURL = function fromFileURL(closure_1_5, closure_1, closure_2) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fromFileURL.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};
2026-08-24 06:08:38 +00:00
obj.fromResource = function fromResource(closure_1_5, closure_1, closure_2) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fromResource.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};
obj.fromBytes = function fromBytes(arg0, current, arg2) {
const self = this;
const apply = _fromBytes.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};
obj.fromSource = function fromSource(arg0, arg1) {
const self = this;
const apply = _fromSource.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
};
export const RiveFileFactory = obj;