decord/source/__polyfill/04xxx/module_4012.js
github-actions f0f877e8ce chore: update source for alpha 347.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
2026-09-15 14:23:42 +00:00

125 lines
3.2 KiB
JavaScript

// Module ID: 4012
// Function ID: 4013
// Dependencies: [3990, 3991, 3944, 3729, 3732, 3733]
// Exports: default
// Module 4012
import _mod3733 from "module_3733" /* 3733 */;
import module_3990_mod from "module_3990" /* 3990 */;
import module_3991_mod from "module_3991" /* 3991 */;
import startOfMonth_mod from "startOfMonth" /* 3944 */;
import requiredArgs_mod from "requiredArgs" /* 3729 */;
import module_3732_mod from "module_3732" /* 3732 */;
let module_3990 = module_3990_mod;
if (!module_3990) {
const obj = { default: module_3990 };
let tmp3 = obj;
} else {
tmp3 = module_3990;
}
module_3990 = tmp3;
let module_3991 = module_3991_mod;
if (!module_3991) {
const obj2 = { default: module_3991 };
let tmp5 = obj2;
} else {
tmp5 = module_3991;
}
module_3991 = tmp5;
let startOfMonth = startOfMonth_mod;
if (!startOfMonth) {
const obj3 = { default: startOfMonth };
let tmp7 = obj3;
} else {
tmp7 = startOfMonth;
}
startOfMonth = tmp7;
let requiredArgs = requiredArgs_mod;
if (!requiredArgs) {
const obj4 = { default: requiredArgs };
let tmp9 = obj4;
} else {
tmp9 = requiredArgs;
}
requiredArgs = tmp9;
let module_3732 = module_3732_mod;
if (!module_3732) {
const obj5 = { default: module_3732 };
let tmp11 = obj5;
} else {
tmp11 = module_3732;
}
module_3732 = tmp11;
export default function getWeekOfMonth(arg0, weekStartsOn) {
requiredArgs.default(1, arguments);
const defaultOptions = _mod3733.getDefaultOptions();
weekStartsOn = undefined;
if (null != weekStartsOn) {
weekStartsOn = weekStartsOn.weekStartsOn;
}
if (null === weekStartsOn) {
let weekStartsOn1;
if (null != weekStartsOn) {
locale = weekStartsOn.locale;
if (null !== locale) {
if (undefined !== locale) {
const options = locale.options;
if (null !== options) {
if (undefined !== options) {
weekStartsOn1 = options.weekStartsOn;
}
}
}
}
}
weekStartsOn = weekStartsOn1;
}
if (null === weekStartsOn) {
weekStartsOn = defaultOptions.weekStartsOn;
}
if (null === weekStartsOn) {
const locale2 = defaultOptions.locale;
let weekStartsOn2;
if (null !== locale2) {
if (undefined !== locale2) {
const options2 = locale2.options;
if (null !== options2) {
if (undefined !== options2) {
weekStartsOn2 = options2.weekStartsOn;
}
}
}
}
weekStartsOn = weekStartsOn2;
}
let num = 0;
if (null !== weekStartsOn) {
num = 0;
if (undefined !== weekStartsOn) {
num = weekStartsOn;
}
}
const defaultResult1 = module_3732.default(num);
if (defaultResult1 >= 0) {
if (defaultResult1 <= 6) {
const defaultResult2 = module_3990.default(arg0);
const _isNaN = isNaN;
if (isNaN(defaultResult2)) {
return NaN;
} else {
const diff = defaultResult1 - module_3991.default(startOfMonth.default(arg0));
let sum = diff;
if (diff <= 0) {
sum = diff + 7;
}
const _Math = Math;
return Math.ceil((defaultResult2 - sum) / 7) + 1;
}
}
}
const rangeError = new RangeError("weekStartsOn must be between 0 and 6 inclusively");
throw rangeError;
};
export default exports.default;