decord/source/components_native/MobileSurvey.tsx

127 lines
4.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 16236
// Function ID: 16237
2026-07-20 16:05:17 +00:00
// Name: MobileSurvey
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 19, 9913, 676, 21, 4668, 589, 698, 9914, 4768, 1236, 4093, 1297, 712, 9880, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 16236 (MobileSurvey)
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "noop" /* 19 */;
import closure_5 from "fetchSurveyIfNeeded" /* 9913 */;
import { AnalyticEvents } from "ME" /* 676 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let closure_8 = createCacheKey.createStyles({ confirmIcon: { marginLeft: 4 } });
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("components_native/MobileSurvey.tsx");
2026-07-20 16:05:17 +00:00
export default function MobileSurvey() {
2026-07-23 10:11:24 +00:00
const _require = callback();
2026-07-29 08:29:29 +00:00
let obj = _require(589);
2026-08-24 06:08:38 +00:00
const items = [closure_5];
2026-07-29 08:29:29 +00:00
const stateFromStores = obj.useStateFromStores(items, () => currentSurvey.getCurrentSurvey());
2026-07-20 16:05:17 +00:00
const items1 = [stateFromStores];
const effect = React.useEffect(() => {
if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
function _setSurveySeen() {
const self = this;
2026-08-24 06:08:38 +00:00
const tmp = closure_2_3(function*() {
2026-07-29 08:29:29 +00:00
if (c0 === 2) {
c0 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 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 {
c0 = 2;
if (0 === c1) {
if (arg0 === 1) {
c0 = 3;
throw arg1;
} else if (arg0 === 2) {
c0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else if (null != c1) {
2026-08-24 06:08:38 +00:00
obj1 = v0(closure_2_2[8]);
2026-07-29 08:29:29 +00:00
c1 = 1;
c0 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.surveySeen(tmp5.key);
return obj1;
}
} else if (arg0 === 1) {
c0 = 3;
throw arg1;
} else if (arg0 === 2) {
c0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
c0 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} catch (tmp9) {
c0 = tmp;
throw tmp9;
}
}
});
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;
}
2026-08-24 06:08:38 +00:00
let obj = stateFromStores(closure_1_2[7]);
2026-07-29 08:29:29 +00:00
obj = { type: "survey", promotion_id: null };
obj[1] = tmp.id;
2026-08-24 06:08:38 +00:00
obj.track(closure_1_6.OPEN_MODAL, obj);
2026-07-23 10:11:24 +00:00
(function setSurveySeen() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _setSurveySeen.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
}
}, items1);
2026-07-29 08:29:29 +00:00
let tmp5 = null;
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
obj = { body: null, confirmText: null, cancelText: null, onConfirm: null, onCancel: null, renderConfirmRightIcon: null };
({ prompt: obj2[0], cta: obj2[1] } = stateFromStores);
const intl = tmp(1236).intl;
obj[2] = intl.string(tmp(1236).t.f3Pet9);
obj[3] = function onConfirm() {
2026-08-24 06:08:38 +00:00
stateFromStores(closure_1_2[11]).openURL(stateFromStores.url);
const obj = stateFromStores(closure_1_2[11]);
lib(closure_1_2[8]).surveyHide(stateFromStores.key, false);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[4] = function onCancel() {
2026-08-24 06:08:38 +00:00
return lib(closure_1_2[8]).surveyHide(stateFromStores.key, true);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[5] = function renderConfirmRightIcon() {
2026-08-24 06:08:38 +00:00
return closure_1_7(lib(closure_1_2[12]).Icon, { style: lib.confirmIcon, color: stateFromStores(closure_1_2[13]).unsafe_rawColors.WHITE, size: lib(closure_1_2[12]).Icon.Sizes.SMALL, source: stateFromStores(closure_1_2[14]) });
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
tmp5 = jsx(stateFromStores(4768), { body: null, confirmText: null, cancelText: null, onConfirm: null, onCancel: null, renderConfirmRightIcon: null });
const tmp8 = stateFromStores(4768);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
};