decord/source/components_native/channel_settings/ChannelSettingsPermissionsOverrideCheckbox.tsx

159 lines
7.6 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 15588
// Function ID: 120179
2026-07-20 16:05:17 +00:00
// Name: getAccessibilityLabel
2026-07-27 11:26:19 +00:00
// Dependencies: [31, 27, 33, 689, 4131, 3764, 1212, 10388, 8623, 15589, 3849, 2]
2026-07-20 16:05:17 +00:00
2026-07-27 11:26:19 +00:00
// Module 15588 (getAccessibilityLabel)
2026-07-23 10:11:24 +00:00
import get_ActivityIndicator from "get ActivityIndicator";
import { jsx } from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import importAllResult from "result";
let closure_3;
let closure_4;
const require = arg1;
2026-07-20 16:05:17 +00:00
function getAccessibilityLabel(arg0) {
2026-07-25 08:10:48 +00:00
if (require(3764) /* calculateElevatedPermissions */.DENY === arg0) {
2026-07-23 10:11:24 +00:00
const intl3 = require(1212) /* getSystemLocale */.intl;
return intl3.string(require(1212) /* getSystemLocale */.t["6639O5"]);
2026-07-25 08:10:48 +00:00
} else if (require(3764) /* calculateElevatedPermissions */.ALLOW === arg0) {
2026-07-23 10:11:24 +00:00
const intl2 = require(1212) /* getSystemLocale */.intl;
return intl2.string(require(1212) /* getSystemLocale */.t.RzDfSk);
2026-07-25 08:10:48 +00:00
} else if (require(3764) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
2026-07-23 10:11:24 +00:00
const intl = require(1212) /* getSystemLocale */.intl;
return intl.string(require(1212) /* getSystemLocale */.t.ujC3ZS);
2026-07-20 16:05:17 +00:00
}
}
function getIcon(arg0, arg1, icon) {
2026-07-25 08:10:48 +00:00
if (require(3764) /* calculateElevatedPermissions */.DENY === arg0) {
2026-07-20 16:05:17 +00:00
let obj = { size: "sm", style: icon.icon };
2026-07-23 10:11:24 +00:00
const colors3 = importDefault(689).colors;
2026-07-20 16:05:17 +00:00
obj.color = arg1 ? colors3.WHITE : colors3.ICON_FEEDBACK_CRITICAL;
2026-07-27 11:26:19 +00:00
return jsx(require(10388) /* DenyIcon */.DenyIcon, { size: "sm", style: icon.icon });
2026-07-25 08:10:48 +00:00
} else if (require(3764) /* calculateElevatedPermissions */.ALLOW === arg0) {
2026-07-20 16:05:17 +00:00
obj = { size: "sm", style: icon.icon };
2026-07-23 10:11:24 +00:00
const colors2 = importDefault(689).colors;
2026-07-20 16:05:17 +00:00
obj.color = arg1 ? colors2.WHITE : colors2.ICON_FEEDBACK_POSITIVE;
2026-07-25 08:10:48 +00:00
return jsx(require(8623) /* CheckmarkLargeBoldIcon */.CheckmarkLargeBoldIcon, { size: "sm", style: icon.icon });
} else if (require(3764) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
2026-07-20 16:05:17 +00:00
obj = { size: "sm", style: icon.icon };
2026-07-23 10:11:24 +00:00
const colors = importDefault(689).colors;
2026-07-20 16:05:17 +00:00
obj.color = arg1 ? colors.WHITE : colors.INTERACTIVE_TEXT_DEFAULT;
2026-07-27 11:26:19 +00:00
return jsx(require(15589) /* SlashIcon */.SlashIcon, { size: "sm", style: icon.icon });
2026-07-20 16:05:17 +00:00
} else {
return null;
}
}
function getPressableStyleOverrides(arg0, arg1, denySelected) {
2026-07-25 08:10:48 +00:00
if (require(3764) /* calculateElevatedPermissions */.DENY === arg0) {
2026-07-20 16:05:17 +00:00
return arg1 ? denySelected.denySelected : denySelected.denyActive;
2026-07-25 08:10:48 +00:00
} else if (require(3764) /* calculateElevatedPermissions */.ALLOW === arg0) {
2026-07-20 16:05:17 +00:00
return arg1 ? denySelected.allowSelected : denySelected.allowActive;
2026-07-25 08:10:48 +00:00
} else if (require(3764) /* calculateElevatedPermissions */.PASSTHROUGH === arg0) {
2026-07-20 16:05:17 +00:00
return arg1 ? denySelected.passthroughSelected : denySelected.passthroughActive;
}
}
2026-07-25 08:10:48 +00:00
function OverrideOption(type) {
let onPress;
let permissionTitle;
type = type.type;
const selected = type.selected;
const styles = type.styles;
({ permissionTitle, onPress } = type);
2026-07-23 10:11:24 +00:00
let obj = type(styles[10]);
2026-07-20 16:05:17 +00:00
const radioA11yNative = obj.useRadioA11yNative({ selected });
2026-07-25 08:10:48 +00:00
obj = { accessibilityRole: radioA11yNative.accessibilityRole };
let items = [permissionTitle, getAccessibilityLabel(type)];
const found = items.filter(Boolean);
obj.accessibilityLabel = found.join(", ");
obj.accessibilityState = radioA11yNative.accessibilityState;
obj.style = function style(pressed) {
2026-07-23 10:11:24 +00:00
if (!selected) {
if (!pressed.pressed) {
let iconWrapper = styles.iconWrapper;
}
return iconWrapper;
}
const items = [outer1_10(type, selected, styles), styles.iconWrapper];
iconWrapper = items;
2026-07-25 08:10:48 +00:00
};
obj.onPress = onPress;
obj.children = getIcon(type, selected, styles);
return <closure_3 accessibilityRole={radioA11yNative.accessibilityRole} />;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ Pressable: closure_3, View: closure_4 } = get_ActivityIndicator);
const PX_4 = require("_createForOfIteratorHelperLoose").space.PX_4;
const md = require("_createForOfIteratorHelperLoose").radii.md;
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
obj = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_BASE_LOWEST, borderRadius: md, height: require("_createForOfIteratorHelperLoose").space.PX_32, paddingVertical: PX_4, paddingHorizontal: PX_4 / 2, flexDirection: "row" };
2026-07-20 16:05:17 +00:00
obj.ternaryCheckBox = obj;
2026-07-23 10:11:24 +00:00
_createForOfIteratorHelperLoose = { borderRadius: md - PX_4, marginHorizontal: PX_4 / 2, justifyContent: "center", height: "100%" };
obj.iconWrapper = _createForOfIteratorHelperLoose;
obj.icon = { marginHorizontal: require("_createForOfIteratorHelperLoose").space.PX_8 };
const obj2 = { marginHorizontal: require("_createForOfIteratorHelperLoose").space.PX_8 };
obj.denyActive = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_FEEDBACK_CRITICAL };
const obj3 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_FEEDBACK_CRITICAL };
obj.denySelected = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.ICON_FEEDBACK_CRITICAL, borderRadius: require("_createForOfIteratorHelperLoose").radii.sm - 2 };
const obj4 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.ICON_FEEDBACK_CRITICAL, borderRadius: require("_createForOfIteratorHelperLoose").radii.sm - 2 };
obj.allowActive = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_FEEDBACK_POSITIVE };
const obj5 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_FEEDBACK_POSITIVE };
obj.allowSelected = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.ICON_FEEDBACK_POSITIVE };
const obj6 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.ICON_FEEDBACK_POSITIVE };
obj.passthroughSelected = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_SELECTED };
const obj7 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_SELECTED };
obj.passthroughActive = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_HOVER };
2026-07-20 16:05:17 +00:00
obj.disabled = { opacity: 0.3 };
2026-07-23 10:11:24 +00:00
let closure_6 = _createForOfIteratorHelperLoose.createStyles(obj);
let items = [require("calculateElevatedPermissions").DENY, require("calculateElevatedPermissions").PASSTHROUGH, require("calculateElevatedPermissions").ALLOW];
const obj8 = { backgroundColor: require("_createForOfIteratorHelperLoose").colors.INTERACTIVE_BACKGROUND_HOVER };
2026-07-25 08:10:48 +00:00
const memoResult = importAllResult.memo(function ChannelSettingsPermissionsOverrideCheckbox(permissionTitle) {
2026-07-20 16:05:17 +00:00
let disabled;
2026-07-25 08:10:48 +00:00
let importDefault;
permissionTitle = permissionTitle.permissionTitle;
({ value: importDefault, disabled } = permissionTitle);
2026-07-20 16:05:17 +00:00
if (disabled === undefined) {
disabled = false;
}
2026-07-25 08:10:48 +00:00
const onValueChange = permissionTitle.onValueChange;
let c3;
2026-07-23 10:11:24 +00:00
let tmp = callback();
2026-07-25 08:10:48 +00:00
c3 = tmp;
2026-07-20 16:05:17 +00:00
const obj = {};
const items = [tmp.ternaryCheckBox, ];
let disabled2 = disabled;
if (disabled) {
disabled2 = tmp.disabled;
}
items[1] = disabled2;
obj.style = items;
let str = "auto";
if (disabled) {
str = "none";
}
obj.pointerEvents = str;
obj.accessibilityRole = "radiogroup";
2026-07-25 08:10:48 +00:00
obj.accessibilityLabel = permissionTitle;
2026-07-23 10:11:24 +00:00
obj.children = items.map((type) => {
let closure_0 = type;
return outer1_5(outer1_11, {
2026-07-25 08:10:48 +00:00
permissionTitle: closure_0,
2026-07-23 10:11:24 +00:00
type,
2026-07-25 08:10:48 +00:00
selected: closure_1 === type,
styles: c3,
2026-07-23 10:11:24 +00:00
onPress() {
2026-07-25 08:10:48 +00:00
let tmp = null != outer1_2;
2026-07-23 10:11:24 +00:00
if (tmp) {
2026-07-25 08:10:48 +00:00
tmp = outer1_1 !== closure_0;
2026-07-23 10:11:24 +00:00
}
if (tmp) {
2026-07-25 08:10:48 +00:00
outer1_2(closure_0);
2026-07-23 10:11:24 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
}, "checkbox-" + arg1);
});
return <closure_4 />;
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const result = require("jsxProd").fileFinishedImporting("components_native/channel_settings/ChannelSettingsPermissionsOverrideCheckbox.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;