112 lines
3.2 KiB
TypeScript
112 lines
3.2 KiB
TypeScript
// Module ID: 7319
|
|
// Function ID: 7320
|
|
// Name: _createHandoffToken
|
|
// Dependencies: [5, 1074, 1256, 1272, 2]
|
|
|
|
// Module 7319 (_createHandoffToken)
|
|
import v1 from "v1" /* 1256 */;
|
|
import closure_2 from "asyncGeneratorStep" /* 5 */;
|
|
import { Endpoints } from "ME" /* 1074 */;
|
|
|
|
require = arg1;
|
|
function _createHandoffToken() {
|
|
const self = this;
|
|
const tmp = callback((arg0) => {
|
|
closure_0 = arg0;
|
|
c2 = 0;
|
|
c3 = 0;
|
|
return (function*(arg0, body) {
|
|
if (constants === 2) {
|
|
constants = 3;
|
|
HermesBuiltin.throwTypeError();
|
|
} else if (tmp3 === 3) {
|
|
if (arg0 === 1) {
|
|
throw body;
|
|
} else if (arg0 === 2) {
|
|
let obj = { value: null, done: true };
|
|
obj[0] = body;
|
|
return obj;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
constants = 2;
|
|
if (0 === c2) {
|
|
if (arg0 === 1) {
|
|
constants = 3;
|
|
throw body;
|
|
} else if (arg0 === 2) {
|
|
constants = 3;
|
|
obj = { value: null, done: true };
|
|
obj[0] = body;
|
|
return obj;
|
|
} else {
|
|
closure_1 = tmp4;
|
|
let handoff_token;
|
|
const HTTP = callback(closure_1_1[3]).HTTP;
|
|
obj1 = { url: null, body: null, oldFormErrors: true, retries: 1, rejectWithError: false };
|
|
obj1[0] = constants.HANDOFF;
|
|
const obj2 = { key: null };
|
|
obj2[0] = handoff_token;
|
|
obj1[1] = obj2;
|
|
c2 = 1;
|
|
constants = 1;
|
|
const obj3 = { value: null, done: false };
|
|
obj3[0] = HTTP.post(obj1);
|
|
return obj3;
|
|
}
|
|
} else if (arg0 === 1) {
|
|
constants = 3;
|
|
throw body;
|
|
} else if (arg0 === 2) {
|
|
constants = 3;
|
|
const obj4 = { value: null, done: true };
|
|
obj4[0] = body;
|
|
return obj4;
|
|
} else {
|
|
handoff_token = body.body.handoff_token;
|
|
if (null != handoff_token) {
|
|
constants = 3;
|
|
obj = { value: null, done: true };
|
|
obj[0] = handoff_token;
|
|
return obj;
|
|
} else {
|
|
const _Error = Error;
|
|
error = new Error("Missing handoff token!");
|
|
throw error;
|
|
}
|
|
}
|
|
} catch (tmp14) {
|
|
constants = tmp;
|
|
throw tmp14;
|
|
}
|
|
}
|
|
})();
|
|
});
|
|
closure_4 = tmp;
|
|
const apply = tmp.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
}
|
|
const result = require("set").fileFinishedImporting("modules/mobile_web_handoff/MobileWebHandoffUtils.tsx");
|
|
|
|
export default {
|
|
generateNonce() {
|
|
return v1.v4();
|
|
},
|
|
createHandoffToken(closure_0) {
|
|
const self = this;
|
|
const apply = _createHandoffToken.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
}
|
|
};
|