decord/source/actions/native/AlertActionCreators.tsx

235 lines
6.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 4662
// Function ID: 4663
// Dependencies: [19, 21, 4346, 709, 4663, 1236, 1367, 4667, 4768, 4768, 2008, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 4662
import noopAll from "noop" /* 19 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import useAlertStore from "useAlertStore" /* 4663 */;
import jsxProd from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
noopAll;
2026-07-29 08:29:29 +00:00
({ jsx: c3, Fragment: c4, jsxs: c5 } = jsxProd);
2026-07-23 10:11:24 +00:00
let c6 = null;
let c7 = 0;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("actions/native/AlertActionCreators.tsx");
2026-07-23 10:11:24 +00:00
export default {
2026-07-20 16:05:17 +00:00
openLazy(hideActionSheet) {
let flag = hideActionSheet.hideActionSheet;
if (flag === undefined) {
flag = true;
}
let flag2 = hideActionSheet.isDismissable;
if (flag2 === undefined) {
flag2 = false;
}
return hideActionSheet.importer().then((alert) => {
if (flag) {
2026-08-24 06:08:38 +00:00
let obj = flag2(closure_1_2[2]);
2026-07-20 16:05:17 +00:00
obj.hideActionSheet();
}
obj = { type: "ALERT_OPEN", alert, isDismissable: flag2 };
2026-08-24 06:08:38 +00:00
flag2(closure_1_2[3]).dispatch(obj);
2026-07-20 16:05:17 +00:00
});
},
close() {
2026-07-23 10:11:24 +00:00
if (null != c6) {
c6 = null;
2026-08-24 06:08:38 +00:00
useAlertStore.dismissAlert(tmp);
const obj = useAlertStore;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "ALERT_CLOSE" });
2026-07-20 16:05:17 +00:00
},
show(hideActionSheet) {
let flag = hideActionSheet.hideActionSheet;
if (flag === undefined) {
flag = true;
}
({ isDismissable, confirmText } = hideActionSheet);
if (confirmText === undefined) {
2026-07-29 08:29:29 +00:00
const intl = confirmText(1236).intl;
confirmText = intl.string(confirmText(1236).t.BddRzS);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let merged = Object.assign(hideActionSheet, Object.create(null));
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-20 16:05:17 +00:00
let callback;
2026-07-23 10:11:24 +00:00
c4 = undefined;
2026-08-24 06:08:38 +00:00
c5 = undefined;
2026-08-11 06:20:06 +00:00
let obj = confirmText(1367);
2026-07-29 08:29:29 +00:00
if (obj.isMobileVisualRefreshEnabled("AlertActionCreators")) {
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
let merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.confirmText = confirmText;
obj.isDismissable = isDismissable;
2026-07-20 16:05:17 +00:00
({ body, confirmText: confirmText2 } = obj);
2026-08-04 21:03:28 +00:00
let tmp9 = null != body && typeof body !== "string";
2026-07-29 08:29:29 +00:00
if (tmp9) {
2026-07-20 16:05:17 +00:00
const _Array = Array;
2026-07-29 08:29:29 +00:00
tmp9 = !Array.isArray(body);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp11 = null == obj.title;
if (!tmp11) {
tmp11 = "" === obj.title;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
2026-08-04 21:03:28 +00:00
tmp11 = null != confirmText2 && typeof confirmText2 !== "string";
const tmp12 = null != confirmText2 && typeof confirmText2 !== "string";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = tmp9;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.footer;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.helpText;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.renderConfirmButton;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.renderConfirmIcon;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.renderConfirmRightIcon;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = true === obj.noDefaultButtons;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.secondaryConfirmText;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.onConfirmSecondary;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = true === obj.isConfirmButtonDisabled;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.confirming;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.style;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = true === obj.fillCancelText;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = false === obj.autoCloseOnConfirm;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
tmp11 = null != obj.onClose;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp11) {
2026-07-20 16:05:17 +00:00
if (flag) {
2026-08-24 06:08:38 +00:00
let obj4 = merged(4346);
2026-07-29 08:29:29 +00:00
obj4.hideActionSheet();
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (null != c6) {
2026-08-24 06:08:38 +00:00
let tmp4Result = tmp4(4663);
2026-07-29 08:29:29 +00:00
tmp4Result.dismissAlert(c6);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
merged(709).dispatch({ type: "ALERT_CLOSE" });
2026-08-24 06:08:38 +00:00
closure_7 = tmp24 + 1;
2026-07-20 16:05:17 +00:00
const text = `legacy-alert-${tmp24}`;
dependencyMap = text;
2026-07-23 10:11:24 +00:00
c6 = text;
({ cancelText, onConfirm: c3, onCancel: c4 } = merged);
c5 = false;
2026-07-20 16:05:17 +00:00
({ title, body: body2, children, confirmColor } = merged);
2026-08-24 06:08:38 +00:00
tmp4Result = tmp4(4663);
2026-07-29 08:29:29 +00:00
obj = { title: null, content: null, extraContent: null, actions: null };
obj[0] = title;
obj[1] = body2;
obj[2] = children;
2026-08-24 06:08:38 +00:00
obj1 = { variant: null, text: null, onPress: null };
2026-07-29 08:29:29 +00:00
const obj7 = merged(709);
const tmp27 = c5;
const tmp28 = c4;
2026-08-24 06:08:38 +00:00
obj1[0] = tmp4(4768).getAlertButtonVariant(confirmColor);
2026-07-29 08:29:29 +00:00
obj1[1] = confirmText;
obj1[2] = function onPress() {
2026-08-24 06:08:38 +00:00
c5 = true;
2026-07-29 08:29:29 +00:00
if (c3 != null) {
tmp();
}
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
const items = [callback(tmp4(4667).AlertActionButton, obj1), ];
2026-07-29 08:29:29 +00:00
let tmp26Result = null;
2026-07-20 16:05:17 +00:00
if (null != cancelText) {
2026-07-29 08:29:29 +00:00
const obj2 = { variant: "secondary", text: null, onPress: null };
obj2[1] = cancelText;
obj2[2] = function onPress() {
2026-08-24 06:08:38 +00:00
c5 = true;
2026-07-29 08:29:29 +00:00
if (c4 != null) {
tmp();
}
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
tmp26Result = tmp26(tmp4(4667).AlertActionButton, obj2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj3 = { children: null };
items[1] = tmp26Result;
obj3[0] = items;
obj[3] = tmp27(tmp28, obj3);
obj4 = { dismissable: null };
obj4[0] = true === isDismissable;
2026-08-24 06:08:38 +00:00
tmp4Result.openAlert(text, callback(tmp4(4667).AlertModal, obj), () => {
2026-07-23 10:11:24 +00:00
if (!c5) {
2026-07-29 08:29:29 +00:00
if (c4 != null) {
tmp();
}
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (c6 === c2) {
c6 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}, obj4);
2026-08-24 06:08:38 +00:00
const tmp4Result1 = tmp4(4768);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
if (null != c6) {
2026-08-24 06:08:38 +00:00
tmp4(4663).dismissAlert(c6);
2026-07-23 10:11:24 +00:00
c6 = null;
2026-08-24 06:08:38 +00:00
const tmp4Result2 = tmp4(4663);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
this.openLazy({
2026-07-20 16:05:17 +00:00
importer() {
2026-07-23 10:11:24 +00:00
return confirmText(_undefined[10])(_undefined[9], _undefined.paths).then((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0.default;
2026-07-20 16:05:17 +00:00
return (arg0) => {
const obj = {};
2026-08-24 06:08:38 +00:00
merged = Object.assign(arg0);
const merged1 = Object.assign(closure_1_1);
2026-07-29 08:29:29 +00:00
obj.confirmText = closure_0;
2026-08-24 06:08:38 +00:00
return closure_2_3(closure_0, obj);
2026-07-20 16:05:17 +00:00
};
});
},
hideActionSheet: flag,
isDismissable
2026-07-29 08:29:29 +00:00
});
2026-07-20 16:05:17 +00:00
},
confirm(arg0) {
2026-07-23 10:11:24 +00:00
const self = this;
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-20 16:05:17 +00:00
return new Promise((arg0) => {
2026-07-29 08:29:29 +00:00
const callback = arg0;
2026-07-20 16:05:17 +00:00
const obj = {
onConfirm() {
2026-07-23 10:11:24 +00:00
callback(true);
2026-07-29 08:29:29 +00:00
},
cancelText: null,
onCancel: null
2026-07-20 16:05:17 +00:00
};
2026-08-24 06:08:38 +00:00
const intl = callback(closure_1_2[5]).intl;
obj[1] = intl.string(callback(closure_1_2[5]).t["ETE/oC"]);
2026-07-29 08:29:29 +00:00
obj[2] = function onCancel() {
2026-07-23 10:11:24 +00:00
callback(false);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(callback);
self.show(obj);
2026-07-20 16:05:17 +00:00
});
}
};