decord/source/4658_items.js

108 lines
2.9 KiB
JavaScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 4658
// Function ID: 4659
2026-07-29 08:29:29 +00:00
// Name: items
// Dependencies: [17]
2026-07-20 16:05:17 +00:00
// Exports: assertDetentsArrayIsSorted, resolveSheetAllowedDetents, resolveSheetInitialDetentIndex, resolveSheetLargestUndimmedDetent
2026-08-08 06:10:11 +00:00
// Module 4658 (items)
2026-07-23 10:11:24 +00:00
import { Platform } from "get ActivityIndicator";
2026-07-20 16:05:17 +00:00
const items = [-1];
2026-07-23 10:11:24 +00:00
const items1 = [1];
const items2 = [0.5];
const items3 = [0.5, 1];
2026-07-20 16:05:17 +00:00
export const SHEET_FIT_TO_CONTENTS = items;
export const SHEET_COMPAT_LARGE = items1;
export const SHEET_COMPAT_MEDIUM = items2;
export const SHEET_COMPAT_ALL = items3;
export const SHEET_DIMMED_ALWAYS = -1;
export const assertDetentsArrayIsSorted = function assertDetentsArrayIsSorted(arg0) {
let num = 1;
if (1 < arg0.length) {
while (arg0[num - 1] <= arg0[num]) {
num = num + 1;
}
const _Error = Error;
const error = new Error("[RNScreens] The detent array is not sorted in ascending order!");
throw error;
}
};
export const resolveSheetAllowedDetents = function resolveSheetAllowedDetents(sheetAllowedDetents) {
if (Array.isArray(sheetAllowedDetents)) {
let substr = sheetAllowedDetents;
if (sheetAllowedDetents.length > 3) {
substr = sheetAllowedDetents.slice(0, 3);
}
let tmp = substr;
} else if ("fitToContents" === sheetAllowedDetents) {
tmp = items;
} else if ("large" === sheetAllowedDetents) {
tmp = items1;
} else if ("medium" === sheetAllowedDetents) {
tmp = items2;
} else {
tmp = "all" === sheetAllowedDetents ? items3 : items1;
}
return tmp;
};
export const resolveSheetLargestUndimmedDetent = function resolveSheetLargestUndimmedDetent(SHEET_DIMMED_ALWAYS, arg1) {
2026-08-04 21:03:28 +00:00
if (typeof SHEET_DIMMED_ALWAYS === "number") {
2026-07-29 08:29:29 +00:00
const _Number = Number;
let isIntegerResult = Number.isInteger(SHEET_DIMMED_ALWAYS);
if (isIntegerResult) {
isIntegerResult = SHEET_DIMMED_ALWAYS >= -1;
}
if (isIntegerResult) {
isIntegerResult = SHEET_DIMMED_ALWAYS <= arg1;
}
let num5 = -1;
if (isIntegerResult) {
num5 = SHEET_DIMMED_ALWAYS;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp = num5;
2026-07-20 16:05:17 +00:00
} else {
tmp = arg1;
if ("last" !== SHEET_DIMMED_ALWAYS) {
let num = -1;
let num2 = -1;
if ("none" !== SHEET_DIMMED_ALWAYS) {
num2 = num;
if ("all" !== SHEET_DIMMED_ALWAYS) {
let num3 = 1;
if ("large" !== SHEET_DIMMED_ALWAYS) {
if ("medium" === SHEET_DIMMED_ALWAYS) {
num = 0;
}
num3 = num;
}
num2 = num3;
}
}
tmp = num2;
}
}
return tmp;
};
2026-07-29 08:29:29 +00:00
export const resolveSheetInitialDetentIndex = function resolveSheetInitialDetentIndex(arg0, arg1) {
2026-07-20 16:05:17 +00:00
let num = arg1;
2026-07-29 08:29:29 +00:00
if ("last" !== arg0) {
num = arg0;
if (null == arg0) {
2026-07-20 16:05:17 +00:00
num = 0;
}
}
2026-07-29 08:29:29 +00:00
let isIntegerResult = Number.isInteger(num);
if (isIntegerResult) {
isIntegerResult = num >= 0;
}
if (isIntegerResult) {
isIntegerResult = num <= arg1;
}
let num3 = 0;
if (isIntegerResult) {
num3 = num;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return num3;
2026-07-20 16:05:17 +00:00
};