decord/source/modules/remote_auth/RemoteAuthUtils.tsx

78 lines
2.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15322
// Function ID: 15323
2026-07-20 16:05:17 +00:00
// Name: _decodeEncodedUserRecord
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 5, 1930, 15320, 2]
2026-07-20 16:05:17 +00:00
// Exports: base64Decode, base64Encode, decodeEncodedUserRecord
2026-08-24 06:08:38 +00:00
// Module 15322 (_decodeEncodedUserRecord)
import closure_2 from "_slicedToArray" /* 32 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "createdAt" /* 1930 */;
2026-07-23 10:11:24 +00:00
2026-07-20 16:05:17 +00:00
function _decodeEncodedUserRecord() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
c4 = 0;
c5 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, str) {
2026-08-24 06:08:38 +00:00
closure_3 = tmp2;
dependencyMap = tmp5;
2026-08-04 21:03:28 +00:00
let callback = table;
const obj2 = callback(table[3]);
callback = yield obj2.decryptEncodedCiphertext(callback, callback);
table = str.match(/^(\d+):(\d{1,4}):([a-zA-Z0-9_]+):(.*)$/);
if (null == table) {
const _Error = Error;
2026-08-24 06:08:38 +00:00
error = new Error("Invalid encoded user record.");
2026-08-04 21:03:28 +00:00
throw error;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
dependencyMap = dependencyMap(table, 5);
2026-08-24 06:08:38 +00:00
closure_3 = 5;
closure_6 = 2;
2026-08-04 21:03:28 +00:00
const obj3 = { id: null, discriminator: null, avatar: null, username: null };
2026-08-24 06:08:38 +00:00
obj3[0] = closure_3;
obj3[1] = closure_4;
2026-08-04 21:03:28 +00:00
let tmp7 = null;
if ("0" !== c5) {
tmp7 = c5;
}
obj3[2] = tmp7;
obj3[3] = closure_6;
tmp42 = new tmp42(obj3);
return tmp42;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_5 = 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-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/remote_auth/RemoteAuthUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
export const decodeEncodedUserRecord = function decodeEncodedUserRecord(arg0, closure_6) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _decodeEncodedUserRecord.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
};
export const base64Encode = function base64Encode(arg0) {
const uint8Array = new Uint8Array(arg0);
const items = [...uint8Array];
const str = btoa(String.fromCharCode.apply(items));
const str2 = btoa(String.fromCharCode.apply(items)).replace(/\//g, "_");
return btoa(String.fromCharCode.apply(items)).replace(/\//g, "_").replace(/\+/g, "-").replace(/={1,2}$/, "");
};
2026-07-29 08:29:29 +00:00
export const base64Decode = function base64Decode(closure_0) {
return Uint8Array.from(atob(closure_0), (str) => str.charCodeAt(0));
2026-07-20 16:05:17 +00:00
};