22597 lines
758 KiB
JavaScript
22597 lines
758 KiB
JavaScript
/*
|
|
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
|
|
if you want to view the source, please visit the github repository of this plugin
|
|
*/
|
|
|
|
var __create = Object.create;
|
|
var __defProp = Object.defineProperty;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getProtoOf = Object.getPrototypeOf;
|
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
var __commonJS = (cb, mod) => function __require() {
|
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
};
|
|
var __export = (target, all) => {
|
|
for (var name in all)
|
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
};
|
|
var __copyProps = (to, from, except, desc) => {
|
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
for (let key of __getOwnPropNames(from))
|
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
}
|
|
return to;
|
|
};
|
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
// If the importer is in node compatibility mode or this is not an ESM
|
|
// file that has been converted to a CommonJS file using a Babel-
|
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
mod
|
|
));
|
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
|
|
// node_modules/obsidian-daily-notes-interface/dist/main.js
|
|
var require_main = __commonJS({
|
|
"node_modules/obsidian-daily-notes-interface/dist/main.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var obsidian = require("obsidian");
|
|
var DEFAULT_DAILY_NOTE_FORMAT2 = "YYYY-MM-DD";
|
|
var DEFAULT_WEEKLY_NOTE_FORMAT = "gggg-[W]ww";
|
|
var DEFAULT_MONTHLY_NOTE_FORMAT = "YYYY-MM";
|
|
var DEFAULT_QUARTERLY_NOTE_FORMAT = "YYYY-[Q]Q";
|
|
var DEFAULT_YEARLY_NOTE_FORMAT = "YYYY";
|
|
function shouldUsePeriodicNotesSettings(periodicity) {
|
|
var _a, _b;
|
|
const periodicNotes = window.app.plugins.getPlugin("periodic-notes");
|
|
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a[periodicity]) == null ? void 0 : _b.enabled);
|
|
}
|
|
function getDailyNoteSettings() {
|
|
var _a, _b, _c, _d;
|
|
try {
|
|
const { internalPlugins, plugins } = window.app;
|
|
if (shouldUsePeriodicNotesSettings("daily")) {
|
|
const { format: format2, folder: folder2, template: template2 } = ((_b = (_a = plugins.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.daily) || {};
|
|
return {
|
|
format: format2 || DEFAULT_DAILY_NOTE_FORMAT2,
|
|
folder: (folder2 == null ? void 0 : folder2.trim()) || "",
|
|
template: (template2 == null ? void 0 : template2.trim()) || ""
|
|
};
|
|
}
|
|
const { folder, format, template } = ((_d = (_c = internalPlugins.getPluginById("daily-notes")) == null ? void 0 : _c.instance) == null ? void 0 : _d.options) || {};
|
|
return {
|
|
format: format || DEFAULT_DAILY_NOTE_FORMAT2,
|
|
folder: (folder == null ? void 0 : folder.trim()) || "",
|
|
template: (template == null ? void 0 : template.trim()) || ""
|
|
};
|
|
} catch (err) {
|
|
console.info("No custom daily note settings found!", err);
|
|
}
|
|
}
|
|
function getWeeklyNoteSettings() {
|
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
try {
|
|
const pluginManager = window.app.plugins;
|
|
const calendarSettings = (_a = pluginManager.getPlugin("calendar")) == null ? void 0 : _a.options;
|
|
const periodicNotesSettings = (_c = (_b = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _b.settings) == null ? void 0 : _c.weekly;
|
|
if (shouldUsePeriodicNotesSettings("weekly")) {
|
|
return {
|
|
format: periodicNotesSettings.format || DEFAULT_WEEKLY_NOTE_FORMAT,
|
|
folder: ((_d = periodicNotesSettings.folder) == null ? void 0 : _d.trim()) || "",
|
|
template: ((_e = periodicNotesSettings.template) == null ? void 0 : _e.trim()) || ""
|
|
};
|
|
}
|
|
const settings2 = calendarSettings || {};
|
|
return {
|
|
format: settings2.weeklyNoteFormat || DEFAULT_WEEKLY_NOTE_FORMAT,
|
|
folder: ((_f = settings2.weeklyNoteFolder) == null ? void 0 : _f.trim()) || "",
|
|
template: ((_g = settings2.weeklyNoteTemplate) == null ? void 0 : _g.trim()) || ""
|
|
};
|
|
} catch (err) {
|
|
console.info("No custom weekly note settings found!", err);
|
|
}
|
|
}
|
|
function getMonthlyNoteSettings() {
|
|
var _a, _b, _c, _d;
|
|
const pluginManager = window.app.plugins;
|
|
try {
|
|
const settings2 = shouldUsePeriodicNotesSettings("monthly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.monthly) || {};
|
|
return {
|
|
format: settings2.format || DEFAULT_MONTHLY_NOTE_FORMAT,
|
|
folder: ((_c = settings2.folder) == null ? void 0 : _c.trim()) || "",
|
|
template: ((_d = settings2.template) == null ? void 0 : _d.trim()) || ""
|
|
};
|
|
} catch (err) {
|
|
console.info("No custom monthly note settings found!", err);
|
|
}
|
|
}
|
|
function getQuarterlyNoteSettings() {
|
|
var _a, _b, _c, _d;
|
|
const pluginManager = window.app.plugins;
|
|
try {
|
|
const settings2 = shouldUsePeriodicNotesSettings("quarterly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.quarterly) || {};
|
|
return {
|
|
format: settings2.format || DEFAULT_QUARTERLY_NOTE_FORMAT,
|
|
folder: ((_c = settings2.folder) == null ? void 0 : _c.trim()) || "",
|
|
template: ((_d = settings2.template) == null ? void 0 : _d.trim()) || ""
|
|
};
|
|
} catch (err) {
|
|
console.info("No custom quarterly note settings found!", err);
|
|
}
|
|
}
|
|
function getYearlyNoteSettings() {
|
|
var _a, _b, _c, _d;
|
|
const pluginManager = window.app.plugins;
|
|
try {
|
|
const settings2 = shouldUsePeriodicNotesSettings("yearly") && ((_b = (_a = pluginManager.getPlugin("periodic-notes")) == null ? void 0 : _a.settings) == null ? void 0 : _b.yearly) || {};
|
|
return {
|
|
format: settings2.format || DEFAULT_YEARLY_NOTE_FORMAT,
|
|
folder: ((_c = settings2.folder) == null ? void 0 : _c.trim()) || "",
|
|
template: ((_d = settings2.template) == null ? void 0 : _d.trim()) || ""
|
|
};
|
|
} catch (err) {
|
|
console.info("No custom yearly note settings found!", err);
|
|
}
|
|
}
|
|
function join(...partSegments) {
|
|
let parts = [];
|
|
for (let i = 0, l = partSegments.length; i < l; i++) {
|
|
parts = parts.concat(partSegments[i].split("/"));
|
|
}
|
|
const newParts = [];
|
|
for (let i = 0, l = parts.length; i < l; i++) {
|
|
const part = parts[i];
|
|
if (!part || part === ".")
|
|
continue;
|
|
else
|
|
newParts.push(part);
|
|
}
|
|
if (parts[0] === "")
|
|
newParts.unshift("");
|
|
return newParts.join("/");
|
|
}
|
|
function basename(fullPath) {
|
|
let base = fullPath.substring(fullPath.lastIndexOf("/") + 1);
|
|
if (base.lastIndexOf(".") != -1)
|
|
base = base.substring(0, base.lastIndexOf("."));
|
|
return base;
|
|
}
|
|
async function ensureFolderExists(path) {
|
|
const dirs = path.replace(/\\/g, "/").split("/");
|
|
dirs.pop();
|
|
if (dirs.length) {
|
|
const dir = join(...dirs);
|
|
if (!window.app.vault.getAbstractFileByPath(dir)) {
|
|
await window.app.vault.createFolder(dir);
|
|
}
|
|
}
|
|
}
|
|
async function getNotePath(directory, filename) {
|
|
if (!filename.endsWith(".md")) {
|
|
filename += ".md";
|
|
}
|
|
const path = obsidian.normalizePath(join(directory, filename));
|
|
await ensureFolderExists(path);
|
|
return path;
|
|
}
|
|
async function getTemplateInfo(template) {
|
|
const { metadataCache, vault } = window.app;
|
|
const templatePath = obsidian.normalizePath(template);
|
|
if (templatePath === "/") {
|
|
return Promise.resolve(["", null]);
|
|
}
|
|
try {
|
|
const templateFile = metadataCache.getFirstLinkpathDest(templatePath, "");
|
|
const contents = await vault.cachedRead(templateFile);
|
|
const IFoldInfo = window.app.foldManager.load(templateFile);
|
|
return [contents, IFoldInfo];
|
|
} catch (err) {
|
|
console.error(`Failed to read the daily note template '${templatePath}'`, err);
|
|
new obsidian.Notice("Failed to read the daily note template");
|
|
return ["", null];
|
|
}
|
|
}
|
|
function getDateUID(date, granularity = "day") {
|
|
const ts = date.clone().startOf(granularity).format();
|
|
return `${granularity}-${ts}`;
|
|
}
|
|
function removeEscapedCharacters(format) {
|
|
return format.replace(/\[[^\]]*\]/g, "");
|
|
}
|
|
function isFormatAmbiguous(format, granularity) {
|
|
if (granularity === "week") {
|
|
const cleanFormat = removeEscapedCharacters(format);
|
|
return /w{1,2}/i.test(cleanFormat) && (/M{1,4}/.test(cleanFormat) || /D{1,4}/.test(cleanFormat));
|
|
}
|
|
return false;
|
|
}
|
|
function getDateFromFile3(file, granularity) {
|
|
return getDateFromFilename(file.basename, granularity);
|
|
}
|
|
function getDateFromPath(path, granularity) {
|
|
return getDateFromFilename(basename(path), granularity);
|
|
}
|
|
function getDateFromFilename(filename, granularity) {
|
|
const getSettings = {
|
|
day: getDailyNoteSettings,
|
|
week: getWeeklyNoteSettings,
|
|
month: getMonthlyNoteSettings,
|
|
quarter: getQuarterlyNoteSettings,
|
|
year: getYearlyNoteSettings
|
|
};
|
|
const format = getSettings[granularity]().format.split("/").pop();
|
|
const noteDate = window.moment(filename, format, true);
|
|
if (!noteDate.isValid()) {
|
|
return null;
|
|
}
|
|
if (isFormatAmbiguous(format, granularity)) {
|
|
if (granularity === "week") {
|
|
const cleanFormat = removeEscapedCharacters(format);
|
|
if (/w{1,2}/i.test(cleanFormat)) {
|
|
return window.moment(
|
|
filename,
|
|
// If format contains week, remove day & month formatting
|
|
format.replace(/M{1,4}/g, "").replace(/D{1,4}/g, ""),
|
|
false
|
|
);
|
|
}
|
|
}
|
|
}
|
|
return noteDate;
|
|
}
|
|
var DailyNotesFolderMissingError = class extends Error {
|
|
};
|
|
async function createDailyNote3(date) {
|
|
const app = window.app;
|
|
const { vault } = app;
|
|
const moment2 = window.moment;
|
|
const { template, format, folder } = getDailyNoteSettings();
|
|
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
|
const filename = date.format(format);
|
|
const normalizedPath = await getNotePath(folder, filename);
|
|
try {
|
|
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, moment2().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
|
const now = moment2();
|
|
const currentDate = date.clone().set({
|
|
hour: now.get("hour"),
|
|
minute: now.get("minute"),
|
|
second: now.get("second")
|
|
});
|
|
if (calc) {
|
|
currentDate.add(parseInt(timeDelta, 10), unit);
|
|
}
|
|
if (momentFormat) {
|
|
return currentDate.format(momentFormat.substring(1).trim());
|
|
}
|
|
return currentDate.format(format);
|
|
}).replace(/{{\s*yesterday\s*}}/gi, date.clone().subtract(1, "day").format(format)).replace(/{{\s*tomorrow\s*}}/gi, date.clone().add(1, "d").format(format)));
|
|
app.foldManager.save(createdFile, IFoldInfo);
|
|
return createdFile;
|
|
} catch (err) {
|
|
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
|
new obsidian.Notice("Unable to create new file.");
|
|
}
|
|
}
|
|
function getDailyNote6(date, dailyNotes) {
|
|
var _a;
|
|
return (_a = dailyNotes[getDateUID(date, "day")]) != null ? _a : null;
|
|
}
|
|
function getAllDailyNotes6() {
|
|
const { vault } = window.app;
|
|
const { folder } = getDailyNoteSettings();
|
|
const dailyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
|
if (!dailyNotesFolder) {
|
|
throw new DailyNotesFolderMissingError("Failed to find daily notes folder");
|
|
}
|
|
const dailyNotes = {};
|
|
obsidian.Vault.recurseChildren(dailyNotesFolder, (note) => {
|
|
if (note instanceof obsidian.TFile) {
|
|
const date = getDateFromFile3(note, "day");
|
|
if (date) {
|
|
const dateString = getDateUID(date, "day");
|
|
dailyNotes[dateString] = note;
|
|
}
|
|
}
|
|
});
|
|
return dailyNotes;
|
|
}
|
|
var WeeklyNotesFolderMissingError = class extends Error {
|
|
};
|
|
function getDaysOfWeek2() {
|
|
const { moment: moment2 } = window;
|
|
let weekStart = moment2.localeData()._week.dow;
|
|
const daysOfWeek = [
|
|
"sunday",
|
|
"monday",
|
|
"tuesday",
|
|
"wednesday",
|
|
"thursday",
|
|
"friday",
|
|
"saturday"
|
|
];
|
|
while (weekStart) {
|
|
daysOfWeek.push(daysOfWeek.shift());
|
|
weekStart--;
|
|
}
|
|
return daysOfWeek;
|
|
}
|
|
function getDayOfWeekNumericalValue(dayOfWeekName) {
|
|
return getDaysOfWeek2().indexOf(dayOfWeekName.toLowerCase());
|
|
}
|
|
async function createWeeklyNote(date) {
|
|
const { vault } = window.app;
|
|
const { template, format, folder } = getWeeklyNoteSettings();
|
|
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
|
const filename = date.format(format);
|
|
const normalizedPath = await getNotePath(folder, filename);
|
|
try {
|
|
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
|
const now = window.moment();
|
|
const currentDate = date.clone().set({
|
|
hour: now.get("hour"),
|
|
minute: now.get("minute"),
|
|
second: now.get("second")
|
|
});
|
|
if (calc) {
|
|
currentDate.add(parseInt(timeDelta, 10), unit);
|
|
}
|
|
if (momentFormat) {
|
|
return currentDate.format(momentFormat.substring(1).trim());
|
|
}
|
|
return currentDate.format(format);
|
|
}).replace(/{{\s*title\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi, (_, dayOfWeek, momentFormat) => {
|
|
const day = getDayOfWeekNumericalValue(dayOfWeek);
|
|
return date.weekday(day).format(momentFormat.trim());
|
|
}));
|
|
window.app.foldManager.save(createdFile, IFoldInfo);
|
|
return createdFile;
|
|
} catch (err) {
|
|
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
|
new obsidian.Notice("Unable to create new file.");
|
|
}
|
|
}
|
|
function getWeeklyNote(date, weeklyNotes) {
|
|
var _a;
|
|
return (_a = weeklyNotes[getDateUID(date, "week")]) != null ? _a : null;
|
|
}
|
|
function getAllWeeklyNotes() {
|
|
const weeklyNotes = {};
|
|
if (!appHasWeeklyNotesPluginLoaded()) {
|
|
return weeklyNotes;
|
|
}
|
|
const { vault } = window.app;
|
|
const { folder } = getWeeklyNoteSettings();
|
|
const weeklyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
|
if (!weeklyNotesFolder) {
|
|
throw new WeeklyNotesFolderMissingError("Failed to find weekly notes folder");
|
|
}
|
|
obsidian.Vault.recurseChildren(weeklyNotesFolder, (note) => {
|
|
if (note instanceof obsidian.TFile) {
|
|
const date = getDateFromFile3(note, "week");
|
|
if (date) {
|
|
const dateString = getDateUID(date, "week");
|
|
weeklyNotes[dateString] = note;
|
|
}
|
|
}
|
|
});
|
|
return weeklyNotes;
|
|
}
|
|
var MonthlyNotesFolderMissingError = class extends Error {
|
|
};
|
|
async function createMonthlyNote(date) {
|
|
const { vault } = window.app;
|
|
const { template, format, folder } = getMonthlyNoteSettings();
|
|
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
|
const filename = date.format(format);
|
|
const normalizedPath = await getNotePath(folder, filename);
|
|
try {
|
|
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
|
const now = window.moment();
|
|
const currentDate = date.clone().set({
|
|
hour: now.get("hour"),
|
|
minute: now.get("minute"),
|
|
second: now.get("second")
|
|
});
|
|
if (calc) {
|
|
currentDate.add(parseInt(timeDelta, 10), unit);
|
|
}
|
|
if (momentFormat) {
|
|
return currentDate.format(momentFormat.substring(1).trim());
|
|
}
|
|
return currentDate.format(format);
|
|
}).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename));
|
|
window.app.foldManager.save(createdFile, IFoldInfo);
|
|
return createdFile;
|
|
} catch (err) {
|
|
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
|
new obsidian.Notice("Unable to create new file.");
|
|
}
|
|
}
|
|
function getMonthlyNote(date, monthlyNotes) {
|
|
var _a;
|
|
return (_a = monthlyNotes[getDateUID(date, "month")]) != null ? _a : null;
|
|
}
|
|
function getAllMonthlyNotes() {
|
|
const monthlyNotes = {};
|
|
if (!appHasMonthlyNotesPluginLoaded()) {
|
|
return monthlyNotes;
|
|
}
|
|
const { vault } = window.app;
|
|
const { folder } = getMonthlyNoteSettings();
|
|
const monthlyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
|
if (!monthlyNotesFolder) {
|
|
throw new MonthlyNotesFolderMissingError("Failed to find monthly notes folder");
|
|
}
|
|
obsidian.Vault.recurseChildren(monthlyNotesFolder, (note) => {
|
|
if (note instanceof obsidian.TFile) {
|
|
const date = getDateFromFile3(note, "month");
|
|
if (date) {
|
|
const dateString = getDateUID(date, "month");
|
|
monthlyNotes[dateString] = note;
|
|
}
|
|
}
|
|
});
|
|
return monthlyNotes;
|
|
}
|
|
var QuarterlyNotesFolderMissingError = class extends Error {
|
|
};
|
|
async function createQuarterlyNote(date) {
|
|
const { vault } = window.app;
|
|
const { template, format, folder } = getQuarterlyNoteSettings();
|
|
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
|
const filename = date.format(format);
|
|
const normalizedPath = await getNotePath(folder, filename);
|
|
try {
|
|
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
|
const now = window.moment();
|
|
const currentDate = date.clone().set({
|
|
hour: now.get("hour"),
|
|
minute: now.get("minute"),
|
|
second: now.get("second")
|
|
});
|
|
if (calc) {
|
|
currentDate.add(parseInt(timeDelta, 10), unit);
|
|
}
|
|
if (momentFormat) {
|
|
return currentDate.format(momentFormat.substring(1).trim());
|
|
}
|
|
return currentDate.format(format);
|
|
}).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename));
|
|
window.app.foldManager.save(createdFile, IFoldInfo);
|
|
return createdFile;
|
|
} catch (err) {
|
|
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
|
new obsidian.Notice("Unable to create new file.");
|
|
}
|
|
}
|
|
function getQuarterlyNote(date, quarterly) {
|
|
var _a;
|
|
return (_a = quarterly[getDateUID(date, "quarter")]) != null ? _a : null;
|
|
}
|
|
function getAllQuarterlyNotes() {
|
|
const quarterly = {};
|
|
if (!appHasQuarterlyNotesPluginLoaded()) {
|
|
return quarterly;
|
|
}
|
|
const { vault } = window.app;
|
|
const { folder } = getQuarterlyNoteSettings();
|
|
const quarterlyFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
|
if (!quarterlyFolder) {
|
|
throw new QuarterlyNotesFolderMissingError("Failed to find quarterly notes folder");
|
|
}
|
|
obsidian.Vault.recurseChildren(quarterlyFolder, (note) => {
|
|
if (note instanceof obsidian.TFile) {
|
|
const date = getDateFromFile3(note, "quarter");
|
|
if (date) {
|
|
const dateString = getDateUID(date, "quarter");
|
|
quarterly[dateString] = note;
|
|
}
|
|
}
|
|
});
|
|
return quarterly;
|
|
}
|
|
var YearlyNotesFolderMissingError = class extends Error {
|
|
};
|
|
async function createYearlyNote(date) {
|
|
const { vault } = window.app;
|
|
const { template, format, folder } = getYearlyNoteSettings();
|
|
const [templateContents, IFoldInfo] = await getTemplateInfo(template);
|
|
const filename = date.format(format);
|
|
const normalizedPath = await getNotePath(folder, filename);
|
|
try {
|
|
const createdFile = await vault.create(normalizedPath, templateContents.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi, (_, _timeOrDate, calc, timeDelta, unit, momentFormat) => {
|
|
const now = window.moment();
|
|
const currentDate = date.clone().set({
|
|
hour: now.get("hour"),
|
|
minute: now.get("minute"),
|
|
second: now.get("second")
|
|
});
|
|
if (calc) {
|
|
currentDate.add(parseInt(timeDelta, 10), unit);
|
|
}
|
|
if (momentFormat) {
|
|
return currentDate.format(momentFormat.substring(1).trim());
|
|
}
|
|
return currentDate.format(format);
|
|
}).replace(/{{\s*date\s*}}/gi, filename).replace(/{{\s*time\s*}}/gi, window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi, filename));
|
|
window.app.foldManager.save(createdFile, IFoldInfo);
|
|
return createdFile;
|
|
} catch (err) {
|
|
console.error(`Failed to create file: '${normalizedPath}'`, err);
|
|
new obsidian.Notice("Unable to create new file.");
|
|
}
|
|
}
|
|
function getYearlyNote(date, yearlyNotes) {
|
|
var _a;
|
|
return (_a = yearlyNotes[getDateUID(date, "year")]) != null ? _a : null;
|
|
}
|
|
function getAllYearlyNotes() {
|
|
const yearlyNotes = {};
|
|
if (!appHasYearlyNotesPluginLoaded()) {
|
|
return yearlyNotes;
|
|
}
|
|
const { vault } = window.app;
|
|
const { folder } = getYearlyNoteSettings();
|
|
const yearlyNotesFolder = vault.getAbstractFileByPath(obsidian.normalizePath(folder));
|
|
if (!yearlyNotesFolder) {
|
|
throw new YearlyNotesFolderMissingError("Failed to find yearly notes folder");
|
|
}
|
|
obsidian.Vault.recurseChildren(yearlyNotesFolder, (note) => {
|
|
if (note instanceof obsidian.TFile) {
|
|
const date = getDateFromFile3(note, "year");
|
|
if (date) {
|
|
const dateString = getDateUID(date, "year");
|
|
yearlyNotes[dateString] = note;
|
|
}
|
|
}
|
|
});
|
|
return yearlyNotes;
|
|
}
|
|
function appHasDailyNotesPluginLoaded() {
|
|
var _a, _b;
|
|
const { app } = window;
|
|
const dailyNotesPlugin = app.internalPlugins.plugins["daily-notes"];
|
|
if (dailyNotesPlugin && dailyNotesPlugin.enabled) {
|
|
return true;
|
|
}
|
|
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
|
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.daily) == null ? void 0 : _b.enabled);
|
|
}
|
|
function appHasWeeklyNotesPluginLoaded() {
|
|
var _a, _b;
|
|
const { app } = window;
|
|
if (app.plugins.getPlugin("calendar")) {
|
|
return true;
|
|
}
|
|
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
|
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.weekly) == null ? void 0 : _b.enabled);
|
|
}
|
|
function appHasMonthlyNotesPluginLoaded() {
|
|
var _a, _b;
|
|
const { app } = window;
|
|
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
|
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.monthly) == null ? void 0 : _b.enabled);
|
|
}
|
|
function appHasQuarterlyNotesPluginLoaded() {
|
|
var _a, _b;
|
|
const { app } = window;
|
|
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
|
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.quarterly) == null ? void 0 : _b.enabled);
|
|
}
|
|
function appHasYearlyNotesPluginLoaded() {
|
|
var _a, _b;
|
|
const { app } = window;
|
|
const periodicNotes = app.plugins.getPlugin("periodic-notes");
|
|
return periodicNotes && ((_b = (_a = periodicNotes.settings) == null ? void 0 : _a.yearly) == null ? void 0 : _b.enabled);
|
|
}
|
|
function getPeriodicNoteSettings(granularity) {
|
|
const getSettings = {
|
|
day: getDailyNoteSettings,
|
|
week: getWeeklyNoteSettings,
|
|
month: getMonthlyNoteSettings,
|
|
quarter: getQuarterlyNoteSettings,
|
|
year: getYearlyNoteSettings
|
|
}[granularity];
|
|
return getSettings();
|
|
}
|
|
function createPeriodicNote(granularity, date) {
|
|
const createFn = {
|
|
day: createDailyNote3,
|
|
month: createMonthlyNote,
|
|
week: createWeeklyNote
|
|
};
|
|
return createFn[granularity](date);
|
|
}
|
|
exports.DEFAULT_DAILY_NOTE_FORMAT = DEFAULT_DAILY_NOTE_FORMAT2;
|
|
exports.DEFAULT_MONTHLY_NOTE_FORMAT = DEFAULT_MONTHLY_NOTE_FORMAT;
|
|
exports.DEFAULT_QUARTERLY_NOTE_FORMAT = DEFAULT_QUARTERLY_NOTE_FORMAT;
|
|
exports.DEFAULT_WEEKLY_NOTE_FORMAT = DEFAULT_WEEKLY_NOTE_FORMAT;
|
|
exports.DEFAULT_YEARLY_NOTE_FORMAT = DEFAULT_YEARLY_NOTE_FORMAT;
|
|
exports.appHasDailyNotesPluginLoaded = appHasDailyNotesPluginLoaded;
|
|
exports.appHasMonthlyNotesPluginLoaded = appHasMonthlyNotesPluginLoaded;
|
|
exports.appHasQuarterlyNotesPluginLoaded = appHasQuarterlyNotesPluginLoaded;
|
|
exports.appHasWeeklyNotesPluginLoaded = appHasWeeklyNotesPluginLoaded;
|
|
exports.appHasYearlyNotesPluginLoaded = appHasYearlyNotesPluginLoaded;
|
|
exports.createDailyNote = createDailyNote3;
|
|
exports.createMonthlyNote = createMonthlyNote;
|
|
exports.createPeriodicNote = createPeriodicNote;
|
|
exports.createQuarterlyNote = createQuarterlyNote;
|
|
exports.createWeeklyNote = createWeeklyNote;
|
|
exports.createYearlyNote = createYearlyNote;
|
|
exports.getAllDailyNotes = getAllDailyNotes6;
|
|
exports.getAllMonthlyNotes = getAllMonthlyNotes;
|
|
exports.getAllQuarterlyNotes = getAllQuarterlyNotes;
|
|
exports.getAllWeeklyNotes = getAllWeeklyNotes;
|
|
exports.getAllYearlyNotes = getAllYearlyNotes;
|
|
exports.getDailyNote = getDailyNote6;
|
|
exports.getDailyNoteSettings = getDailyNoteSettings;
|
|
exports.getDateFromFile = getDateFromFile3;
|
|
exports.getDateFromPath = getDateFromPath;
|
|
exports.getDateUID = getDateUID;
|
|
exports.getMonthlyNote = getMonthlyNote;
|
|
exports.getMonthlyNoteSettings = getMonthlyNoteSettings;
|
|
exports.getPeriodicNoteSettings = getPeriodicNoteSettings;
|
|
exports.getQuarterlyNote = getQuarterlyNote;
|
|
exports.getQuarterlyNoteSettings = getQuarterlyNoteSettings;
|
|
exports.getTemplateInfo = getTemplateInfo;
|
|
exports.getWeeklyNote = getWeeklyNote;
|
|
exports.getWeeklyNoteSettings = getWeeklyNoteSettings;
|
|
exports.getYearlyNote = getYearlyNote;
|
|
exports.getYearlyNoteSettings = getYearlyNoteSettings;
|
|
}
|
|
});
|
|
|
|
// node_modules/typed-assert/build/index.js
|
|
var require_build = __commonJS({
|
|
"node_modules/typed-assert/build/index.js"(exports) {
|
|
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.check = exports.isPromise = exports.isInstanceOf = exports.isOneOfType = exports.isOneOf = exports.isOptionOfType = exports.isArrayOfType = exports.isRecordOfType = exports.isArray = exports.isRecordWithKeys = exports.isRecord = exports.isDate = exports.isString = exports.isNumber = exports.isBoolean = exports.isExactly = exports.isNotVoid = exports.isNotUndefined = exports.isNotNull = exports.isNever = exports.isUnknown = exports.safeJsonParse = exports.setBaseAssert = exports.assert = exports.defaultAssert = void 0;
|
|
var expectedToBe = (type) => `expected to be ${type}`;
|
|
var defaultAssert = (condition, message) => {
|
|
if (!condition) {
|
|
throw new TypeError(message);
|
|
}
|
|
};
|
|
exports.defaultAssert = defaultAssert;
|
|
var baseAssert = exports.defaultAssert;
|
|
var assert = (condition, message) => baseAssert(condition, message);
|
|
exports.assert = assert;
|
|
function setBaseAssert(assert2) {
|
|
if (assert2) {
|
|
baseAssert = assert2;
|
|
}
|
|
}
|
|
exports.setBaseAssert = setBaseAssert;
|
|
var safeJsonParse = (json) => JSON.parse(json);
|
|
exports.safeJsonParse = safeJsonParse;
|
|
function isUnknown(_input) {
|
|
return true;
|
|
}
|
|
exports.isUnknown = isUnknown;
|
|
function isNever(_input, message = expectedToBe("unreachable")) {
|
|
throw new TypeError(message);
|
|
}
|
|
exports.isNever = isNever;
|
|
function isNotNull(input, message = expectedToBe("not null")) {
|
|
(0, exports.assert)(input !== null, message);
|
|
}
|
|
exports.isNotNull = isNotNull;
|
|
function isNotUndefined(input, message = expectedToBe("not undefined")) {
|
|
(0, exports.assert)(input !== void 0, message);
|
|
}
|
|
exports.isNotUndefined = isNotUndefined;
|
|
function isNotVoid2(input, message = expectedToBe("neither null nor undefined")) {
|
|
(0, exports.assert)(input !== null && input !== void 0, message);
|
|
}
|
|
exports.isNotVoid = isNotVoid2;
|
|
function isExactly(input, value, message = expectedToBe(`exactly ${value}`)) {
|
|
(0, exports.assert)(input === value, message);
|
|
}
|
|
exports.isExactly = isExactly;
|
|
function isBoolean(input, message = expectedToBe("a boolean")) {
|
|
(0, exports.assert)(typeof input === "boolean", message);
|
|
}
|
|
exports.isBoolean = isBoolean;
|
|
function isNumber(input, message = expectedToBe("a number")) {
|
|
(0, exports.assert)(typeof input === "number", message);
|
|
}
|
|
exports.isNumber = isNumber;
|
|
function isString(input, message = expectedToBe("a string")) {
|
|
(0, exports.assert)(typeof input === "string", message);
|
|
}
|
|
exports.isString = isString;
|
|
function isDate(input, message = expectedToBe("a Date")) {
|
|
(0, exports.assert)(input instanceof Date, message);
|
|
}
|
|
exports.isDate = isDate;
|
|
function isRecord(input, message = expectedToBe("a record")) {
|
|
(0, exports.assert)(typeof input === "object", message);
|
|
isNotNull(input, message);
|
|
for (const key of Object.keys(input)) {
|
|
isString(key, message);
|
|
}
|
|
}
|
|
exports.isRecord = isRecord;
|
|
function isRecordWithKeys(input, keys, message = expectedToBe(`a record with keys ${keys.join(", ")}`)) {
|
|
isRecord(input, message);
|
|
for (const key of keys) {
|
|
isNotUndefined(input[key]);
|
|
}
|
|
}
|
|
exports.isRecordWithKeys = isRecordWithKeys;
|
|
function isArray(input, message = expectedToBe("an array")) {
|
|
(0, exports.assert)(Array.isArray(input), message);
|
|
}
|
|
exports.isArray = isArray;
|
|
function isRecordOfType(input, assertT, message = expectedToBe("a record of given type"), itemMessage = expectedToBe("of given type")) {
|
|
isRecord(input, message);
|
|
for (const item of Object.values(input)) {
|
|
assertT(item, itemMessage);
|
|
}
|
|
}
|
|
exports.isRecordOfType = isRecordOfType;
|
|
function isArrayOfType(input, assertT, message = expectedToBe("an array of given type"), itemMessage = expectedToBe("of given type")) {
|
|
isArray(input, message);
|
|
for (const item of input) {
|
|
assertT(item, itemMessage);
|
|
}
|
|
}
|
|
exports.isArrayOfType = isArrayOfType;
|
|
function isOptionOfType(input, assertT, message = expectedToBe("option of given type")) {
|
|
if (input === void 0) {
|
|
return;
|
|
}
|
|
assertT(input, message);
|
|
}
|
|
exports.isOptionOfType = isOptionOfType;
|
|
function isOneOf(input, values, message = expectedToBe(`one of ${values.join(", ")}`)) {
|
|
(0, exports.assert)(values.includes(input), message);
|
|
}
|
|
exports.isOneOf = isOneOf;
|
|
function isOneOfType(input, assertT, message = expectedToBe(`one of type`), itemMessage) {
|
|
for (const assert2 of assertT) {
|
|
try {
|
|
assert2(input, itemMessage);
|
|
return;
|
|
} catch (_) {
|
|
}
|
|
}
|
|
throw new TypeError(message);
|
|
}
|
|
exports.isOneOfType = isOneOfType;
|
|
function isInstanceOf2(input, constructor, message = expectedToBe("an instance of given constructor")) {
|
|
(0, exports.assert)(input instanceof constructor, message);
|
|
}
|
|
exports.isInstanceOf = isInstanceOf2;
|
|
function isPromise(input, message = expectedToBe("a promise")) {
|
|
isInstanceOf2(input, Promise, message);
|
|
}
|
|
exports.isPromise = isPromise;
|
|
function check(assertT) {
|
|
return (input) => {
|
|
try {
|
|
assertT(input);
|
|
return true;
|
|
} catch (_) {
|
|
return false;
|
|
}
|
|
};
|
|
}
|
|
exports.check = check;
|
|
}
|
|
});
|
|
|
|
// node_modules/lodash/lodash.min.js
|
|
var require_lodash_min = __commonJS({
|
|
"node_modules/lodash/lodash.min.js"(exports, module2) {
|
|
(function() {
|
|
function n(n2, t2, r2) {
|
|
switch (r2.length) {
|
|
case 0:
|
|
return n2.call(t2);
|
|
case 1:
|
|
return n2.call(t2, r2[0]);
|
|
case 2:
|
|
return n2.call(t2, r2[0], r2[1]);
|
|
case 3:
|
|
return n2.call(t2, r2[0], r2[1], r2[2]);
|
|
}
|
|
return n2.apply(t2, r2);
|
|
}
|
|
function t(n2, t2, r2, e2) {
|
|
for (var u2 = -1, i2 = null == n2 ? 0 : n2.length; ++u2 < i2; ) {
|
|
var o2 = n2[u2];
|
|
t2(e2, o2, r2(o2), n2);
|
|
}
|
|
return e2;
|
|
}
|
|
function r(n2, t2) {
|
|
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length; ++r2 < e2 && t2(n2[r2], r2, n2) !== false; )
|
|
;
|
|
return n2;
|
|
}
|
|
function e(n2, t2) {
|
|
for (var r2 = null == n2 ? 0 : n2.length; r2-- && t2(n2[r2], r2, n2) !== false; )
|
|
;
|
|
return n2;
|
|
}
|
|
function u(n2, t2) {
|
|
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length; ++r2 < e2; )
|
|
if (!t2(n2[r2], r2, n2))
|
|
return false;
|
|
return true;
|
|
}
|
|
function i(n2, t2) {
|
|
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length, u2 = 0, i2 = []; ++r2 < e2; ) {
|
|
var o2 = n2[r2];
|
|
t2(o2, r2, n2) && (i2[u2++] = o2);
|
|
}
|
|
return i2;
|
|
}
|
|
function o(n2, t2) {
|
|
return !!(null == n2 ? 0 : n2.length) && y(n2, t2, 0) > -1;
|
|
}
|
|
function f(n2, t2, r2) {
|
|
for (var e2 = -1, u2 = null == n2 ? 0 : n2.length; ++e2 < u2; )
|
|
if (r2(t2, n2[e2]))
|
|
return true;
|
|
return false;
|
|
}
|
|
function c(n2, t2) {
|
|
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length, u2 = Array(e2); ++r2 < e2; )
|
|
u2[r2] = t2(n2[r2], r2, n2);
|
|
return u2;
|
|
}
|
|
function a(n2, t2) {
|
|
for (var r2 = -1, e2 = t2.length, u2 = n2.length; ++r2 < e2; )
|
|
n2[u2 + r2] = t2[r2];
|
|
return n2;
|
|
}
|
|
function l(n2, t2, r2, e2) {
|
|
var u2 = -1, i2 = null == n2 ? 0 : n2.length;
|
|
for (e2 && i2 && (r2 = n2[++u2]); ++u2 < i2; )
|
|
r2 = t2(r2, n2[u2], u2, n2);
|
|
return r2;
|
|
}
|
|
function s(n2, t2, r2, e2) {
|
|
var u2 = null == n2 ? 0 : n2.length;
|
|
for (e2 && u2 && (r2 = n2[--u2]); u2--; )
|
|
r2 = t2(r2, n2[u2], u2, n2);
|
|
return r2;
|
|
}
|
|
function h(n2, t2) {
|
|
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length; ++r2 < e2; )
|
|
if (t2(n2[r2], r2, n2))
|
|
return true;
|
|
return false;
|
|
}
|
|
function p(n2) {
|
|
return n2.split("");
|
|
}
|
|
function _(n2) {
|
|
return n2.match($t) || [];
|
|
}
|
|
function v(n2, t2, r2) {
|
|
var e2;
|
|
return r2(n2, function(n3, r3, u2) {
|
|
if (t2(n3, r3, u2))
|
|
return e2 = r3, false;
|
|
}), e2;
|
|
}
|
|
function g(n2, t2, r2, e2) {
|
|
for (var u2 = n2.length, i2 = r2 + (e2 ? 1 : -1); e2 ? i2-- : ++i2 < u2; )
|
|
if (t2(n2[i2], i2, n2))
|
|
return i2;
|
|
return -1;
|
|
}
|
|
function y(n2, t2, r2) {
|
|
return t2 === t2 ? Z(n2, t2, r2) : g(n2, b, r2);
|
|
}
|
|
function d(n2, t2, r2, e2) {
|
|
for (var u2 = r2 - 1, i2 = n2.length; ++u2 < i2; )
|
|
if (e2(n2[u2], t2))
|
|
return u2;
|
|
return -1;
|
|
}
|
|
function b(n2) {
|
|
return n2 !== n2;
|
|
}
|
|
function w(n2, t2) {
|
|
var r2 = null == n2 ? 0 : n2.length;
|
|
return r2 ? k(n2, t2) / r2 : Cn;
|
|
}
|
|
function m(n2) {
|
|
return function(t2) {
|
|
return null == t2 ? X : t2[n2];
|
|
};
|
|
}
|
|
function x(n2) {
|
|
return function(t2) {
|
|
return null == n2 ? X : n2[t2];
|
|
};
|
|
}
|
|
function j(n2, t2, r2, e2, u2) {
|
|
return u2(n2, function(n3, u3, i2) {
|
|
r2 = e2 ? (e2 = false, n3) : t2(r2, n3, u3, i2);
|
|
}), r2;
|
|
}
|
|
function A(n2, t2) {
|
|
var r2 = n2.length;
|
|
for (n2.sort(t2); r2--; )
|
|
n2[r2] = n2[r2].value;
|
|
return n2;
|
|
}
|
|
function k(n2, t2) {
|
|
for (var r2, e2 = -1, u2 = n2.length; ++e2 < u2; ) {
|
|
var i2 = t2(n2[e2]);
|
|
i2 !== X && (r2 = r2 === X ? i2 : r2 + i2);
|
|
}
|
|
return r2;
|
|
}
|
|
function O(n2, t2) {
|
|
for (var r2 = -1, e2 = Array(n2); ++r2 < n2; )
|
|
e2[r2] = t2(r2);
|
|
return e2;
|
|
}
|
|
function I(n2, t2) {
|
|
return c(t2, function(t3) {
|
|
return [t3, n2[t3]];
|
|
});
|
|
}
|
|
function R(n2) {
|
|
return n2 ? n2.slice(0, H(n2) + 1).replace(Lt, "") : n2;
|
|
}
|
|
function z(n2) {
|
|
return function(t2) {
|
|
return n2(t2);
|
|
};
|
|
}
|
|
function E(n2, t2) {
|
|
return c(t2, function(t3) {
|
|
return n2[t3];
|
|
});
|
|
}
|
|
function S(n2, t2) {
|
|
return n2.has(t2);
|
|
}
|
|
function W(n2, t2) {
|
|
for (var r2 = -1, e2 = n2.length; ++r2 < e2 && y(t2, n2[r2], 0) > -1; )
|
|
;
|
|
return r2;
|
|
}
|
|
function L(n2, t2) {
|
|
for (var r2 = n2.length; r2-- && y(t2, n2[r2], 0) > -1; )
|
|
;
|
|
return r2;
|
|
}
|
|
function C(n2, t2) {
|
|
for (var r2 = n2.length, e2 = 0; r2--; )
|
|
n2[r2] === t2 && ++e2;
|
|
return e2;
|
|
}
|
|
function U(n2) {
|
|
return "\\" + Yr[n2];
|
|
}
|
|
function B(n2, t2) {
|
|
return null == n2 ? X : n2[t2];
|
|
}
|
|
function T(n2) {
|
|
return Nr.test(n2);
|
|
}
|
|
function $(n2) {
|
|
return Pr.test(n2);
|
|
}
|
|
function D(n2) {
|
|
for (var t2, r2 = []; !(t2 = n2.next()).done; )
|
|
r2.push(t2.value);
|
|
return r2;
|
|
}
|
|
function M(n2) {
|
|
var t2 = -1, r2 = Array(n2.size);
|
|
return n2.forEach(function(n3, e2) {
|
|
r2[++t2] = [e2, n3];
|
|
}), r2;
|
|
}
|
|
function F(n2, t2) {
|
|
return function(r2) {
|
|
return n2(t2(r2));
|
|
};
|
|
}
|
|
function N(n2, t2) {
|
|
for (var r2 = -1, e2 = n2.length, u2 = 0, i2 = []; ++r2 < e2; ) {
|
|
var o2 = n2[r2];
|
|
o2 !== t2 && o2 !== cn || (n2[r2] = cn, i2[u2++] = r2);
|
|
}
|
|
return i2;
|
|
}
|
|
function P(n2) {
|
|
var t2 = -1, r2 = Array(n2.size);
|
|
return n2.forEach(function(n3) {
|
|
r2[++t2] = n3;
|
|
}), r2;
|
|
}
|
|
function q(n2) {
|
|
var t2 = -1, r2 = Array(n2.size);
|
|
return n2.forEach(function(n3) {
|
|
r2[++t2] = [n3, n3];
|
|
}), r2;
|
|
}
|
|
function Z(n2, t2, r2) {
|
|
for (var e2 = r2 - 1, u2 = n2.length; ++e2 < u2; )
|
|
if (n2[e2] === t2)
|
|
return e2;
|
|
return -1;
|
|
}
|
|
function K(n2, t2, r2) {
|
|
for (var e2 = r2 + 1; e2--; )
|
|
if (n2[e2] === t2)
|
|
return e2;
|
|
return e2;
|
|
}
|
|
function V(n2) {
|
|
return T(n2) ? J(n2) : _e(n2);
|
|
}
|
|
function G(n2) {
|
|
return T(n2) ? Y(n2) : p(n2);
|
|
}
|
|
function H(n2) {
|
|
for (var t2 = n2.length; t2-- && Ct.test(n2.charAt(t2)); )
|
|
;
|
|
return t2;
|
|
}
|
|
function J(n2) {
|
|
for (var t2 = Mr.lastIndex = 0; Mr.test(n2); )
|
|
++t2;
|
|
return t2;
|
|
}
|
|
function Y(n2) {
|
|
return n2.match(Mr) || [];
|
|
}
|
|
function Q(n2) {
|
|
return n2.match(Fr) || [];
|
|
}
|
|
var X, nn = "4.17.21", tn = 200, rn = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", en = "Expected a function", un = "Invalid `variable` option passed into `_.template`", on = "__lodash_hash_undefined__", fn = 500, cn = "__lodash_placeholder__", an = 1, ln = 2, sn = 4, hn = 1, pn = 2, _n = 1, vn = 2, gn = 4, yn = 8, dn = 16, bn = 32, wn = 64, mn = 128, xn = 256, jn = 512, An = 30, kn = "...", On = 800, In = 16, Rn = 1, zn = 2, En = 3, Sn = 1 / 0, Wn = 9007199254740991, Ln = 17976931348623157e292, Cn = NaN, Un = 4294967295, Bn = Un - 1, Tn = Un >>> 1, $n = [["ary", mn], ["bind", _n], ["bindKey", vn], ["curry", yn], ["curryRight", dn], ["flip", jn], ["partial", bn], ["partialRight", wn], ["rearg", xn]], Dn = "[object Arguments]", Mn = "[object Array]", Fn = "[object AsyncFunction]", Nn = "[object Boolean]", Pn = "[object Date]", qn = "[object DOMException]", Zn = "[object Error]", Kn = "[object Function]", Vn = "[object GeneratorFunction]", Gn = "[object Map]", Hn = "[object Number]", Jn = "[object Null]", Yn = "[object Object]", Qn = "[object Promise]", Xn = "[object Proxy]", nt = "[object RegExp]", tt = "[object Set]", rt = "[object String]", et = "[object Symbol]", ut = "[object Undefined]", it = "[object WeakMap]", ot = "[object WeakSet]", ft = "[object ArrayBuffer]", ct = "[object DataView]", at = "[object Float32Array]", lt = "[object Float64Array]", st = "[object Int8Array]", ht = "[object Int16Array]", pt = "[object Int32Array]", _t = "[object Uint8Array]", vt = "[object Uint8ClampedArray]", gt = "[object Uint16Array]", yt = "[object Uint32Array]", dt = /\b__p \+= '';/g, bt = /\b(__p \+=) '' \+/g, wt = /(__e\(.*?\)|\b__t\)) \+\n'';/g, mt = /&(?:amp|lt|gt|quot|#39);/g, xt = /[&<>"']/g, jt = RegExp(mt.source), At = RegExp(xt.source), kt = /<%-([\s\S]+?)%>/g, Ot = /<%([\s\S]+?)%>/g, It = /<%=([\s\S]+?)%>/g, Rt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, zt = /^\w*$/, Et = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, St = /[\\^$.*+?()[\]{}|]/g, Wt = RegExp(St.source), Lt = /^\s+/, Ct = /\s/, Ut = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Bt = /\{\n\/\* \[wrapped with (.+)\] \*/, Tt = /,? & /, $t = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Dt = /[()=,{}\[\]\/\s]/, Mt = /\\(\\)?/g, Ft = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Nt = /\w*$/, Pt = /^[-+]0x[0-9a-f]+$/i, qt = /^0b[01]+$/i, Zt = /^\[object .+?Constructor\]$/, Kt = /^0o[0-7]+$/i, Vt = /^(?:0|[1-9]\d*)$/, Gt = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ht = /($^)/, Jt = /['\n\r\u2028\u2029\\]/g, Yt = "\\ud800-\\udfff", Qt = "\\u0300-\\u036f", Xt = "\\ufe20-\\ufe2f", nr = "\\u20d0-\\u20ff", tr = Qt + Xt + nr, rr = "\\u2700-\\u27bf", er = "a-z\\xdf-\\xf6\\xf8-\\xff", ur = "\\xac\\xb1\\xd7\\xf7", ir = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", or = "\\u2000-\\u206f", fr = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", cr = "A-Z\\xc0-\\xd6\\xd8-\\xde", ar = "\\ufe0e\\ufe0f", lr = ur + ir + or + fr, sr = "['\u2019]", hr = "[" + Yt + "]", pr = "[" + lr + "]", _r = "[" + tr + "]", vr = "\\d+", gr = "[" + rr + "]", yr = "[" + er + "]", dr = "[^" + Yt + lr + vr + rr + er + cr + "]", br = "\\ud83c[\\udffb-\\udfff]", wr = "(?:" + _r + "|" + br + ")", mr = "[^" + Yt + "]", xr = "(?:\\ud83c[\\udde6-\\uddff]){2}", jr = "[\\ud800-\\udbff][\\udc00-\\udfff]", Ar = "[" + cr + "]", kr = "\\u200d", Or = "(?:" + yr + "|" + dr + ")", Ir = "(?:" + Ar + "|" + dr + ")", Rr = "(?:" + sr + "(?:d|ll|m|re|s|t|ve))?", zr = "(?:" + sr + "(?:D|LL|M|RE|S|T|VE))?", Er = wr + "?", Sr = "[" + ar + "]?", Wr = "(?:" + kr + "(?:" + [mr, xr, jr].join("|") + ")" + Sr + Er + ")*", Lr = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", Cr = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Ur = Sr + Er + Wr, Br = "(?:" + [gr, xr, jr].join("|") + ")" + Ur, Tr = "(?:" + [mr + _r + "?", _r, xr, jr, hr].join("|") + ")", $r = RegExp(sr, "g"), Dr = RegExp(_r, "g"), Mr = RegExp(br + "(?=" + br + ")|" + Tr + Ur, "g"), Fr = RegExp([Ar + "?" + yr + "+" + Rr + "(?=" + [pr, Ar, "$"].join("|") + ")", Ir + "+" + zr + "(?=" + [pr, Ar + Or, "$"].join("|") + ")", Ar + "?" + Or + "+" + Rr, Ar + "+" + zr, Cr, Lr, vr, Br].join("|"), "g"), Nr = RegExp("[" + kr + Yt + tr + ar + "]"), Pr = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, qr = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], Zr = -1, Kr = {};
|
|
Kr[at] = Kr[lt] = Kr[st] = Kr[ht] = Kr[pt] = Kr[_t] = Kr[vt] = Kr[gt] = Kr[yt] = true, Kr[Dn] = Kr[Mn] = Kr[ft] = Kr[Nn] = Kr[ct] = Kr[Pn] = Kr[Zn] = Kr[Kn] = Kr[Gn] = Kr[Hn] = Kr[Yn] = Kr[nt] = Kr[tt] = Kr[rt] = Kr[it] = false;
|
|
var Vr = {};
|
|
Vr[Dn] = Vr[Mn] = Vr[ft] = Vr[ct] = Vr[Nn] = Vr[Pn] = Vr[at] = Vr[lt] = Vr[st] = Vr[ht] = Vr[pt] = Vr[Gn] = Vr[Hn] = Vr[Yn] = Vr[nt] = Vr[tt] = Vr[rt] = Vr[et] = Vr[_t] = Vr[vt] = Vr[gt] = Vr[yt] = true, Vr[Zn] = Vr[Kn] = Vr[it] = false;
|
|
var Gr = {
|
|
"\xC0": "A",
|
|
"\xC1": "A",
|
|
"\xC2": "A",
|
|
"\xC3": "A",
|
|
"\xC4": "A",
|
|
"\xC5": "A",
|
|
"\xE0": "a",
|
|
"\xE1": "a",
|
|
"\xE2": "a",
|
|
"\xE3": "a",
|
|
"\xE4": "a",
|
|
"\xE5": "a",
|
|
"\xC7": "C",
|
|
"\xE7": "c",
|
|
"\xD0": "D",
|
|
"\xF0": "d",
|
|
"\xC8": "E",
|
|
"\xC9": "E",
|
|
"\xCA": "E",
|
|
"\xCB": "E",
|
|
"\xE8": "e",
|
|
"\xE9": "e",
|
|
"\xEA": "e",
|
|
"\xEB": "e",
|
|
"\xCC": "I",
|
|
"\xCD": "I",
|
|
"\xCE": "I",
|
|
"\xCF": "I",
|
|
"\xEC": "i",
|
|
"\xED": "i",
|
|
"\xEE": "i",
|
|
"\xEF": "i",
|
|
"\xD1": "N",
|
|
"\xF1": "n",
|
|
"\xD2": "O",
|
|
"\xD3": "O",
|
|
"\xD4": "O",
|
|
"\xD5": "O",
|
|
"\xD6": "O",
|
|
"\xD8": "O",
|
|
"\xF2": "o",
|
|
"\xF3": "o",
|
|
"\xF4": "o",
|
|
"\xF5": "o",
|
|
"\xF6": "o",
|
|
"\xF8": "o",
|
|
"\xD9": "U",
|
|
"\xDA": "U",
|
|
"\xDB": "U",
|
|
"\xDC": "U",
|
|
"\xF9": "u",
|
|
"\xFA": "u",
|
|
"\xFB": "u",
|
|
"\xFC": "u",
|
|
"\xDD": "Y",
|
|
"\xFD": "y",
|
|
"\xFF": "y",
|
|
"\xC6": "Ae",
|
|
"\xE6": "ae",
|
|
"\xDE": "Th",
|
|
"\xFE": "th",
|
|
"\xDF": "ss",
|
|
"\u0100": "A",
|
|
"\u0102": "A",
|
|
"\u0104": "A",
|
|
"\u0101": "a",
|
|
"\u0103": "a",
|
|
"\u0105": "a",
|
|
"\u0106": "C",
|
|
"\u0108": "C",
|
|
"\u010A": "C",
|
|
"\u010C": "C",
|
|
"\u0107": "c",
|
|
"\u0109": "c",
|
|
"\u010B": "c",
|
|
"\u010D": "c",
|
|
"\u010E": "D",
|
|
"\u0110": "D",
|
|
"\u010F": "d",
|
|
"\u0111": "d",
|
|
"\u0112": "E",
|
|
"\u0114": "E",
|
|
"\u0116": "E",
|
|
"\u0118": "E",
|
|
"\u011A": "E",
|
|
"\u0113": "e",
|
|
"\u0115": "e",
|
|
"\u0117": "e",
|
|
"\u0119": "e",
|
|
"\u011B": "e",
|
|
"\u011C": "G",
|
|
"\u011E": "G",
|
|
"\u0120": "G",
|
|
"\u0122": "G",
|
|
"\u011D": "g",
|
|
"\u011F": "g",
|
|
"\u0121": "g",
|
|
"\u0123": "g",
|
|
"\u0124": "H",
|
|
"\u0126": "H",
|
|
"\u0125": "h",
|
|
"\u0127": "h",
|
|
"\u0128": "I",
|
|
"\u012A": "I",
|
|
"\u012C": "I",
|
|
"\u012E": "I",
|
|
"\u0130": "I",
|
|
"\u0129": "i",
|
|
"\u012B": "i",
|
|
"\u012D": "i",
|
|
"\u012F": "i",
|
|
"\u0131": "i",
|
|
"\u0134": "J",
|
|
"\u0135": "j",
|
|
"\u0136": "K",
|
|
"\u0137": "k",
|
|
"\u0138": "k",
|
|
"\u0139": "L",
|
|
"\u013B": "L",
|
|
"\u013D": "L",
|
|
"\u013F": "L",
|
|
"\u0141": "L",
|
|
"\u013A": "l",
|
|
"\u013C": "l",
|
|
"\u013E": "l",
|
|
"\u0140": "l",
|
|
"\u0142": "l",
|
|
"\u0143": "N",
|
|
"\u0145": "N",
|
|
"\u0147": "N",
|
|
"\u014A": "N",
|
|
"\u0144": "n",
|
|
"\u0146": "n",
|
|
"\u0148": "n",
|
|
"\u014B": "n",
|
|
"\u014C": "O",
|
|
"\u014E": "O",
|
|
"\u0150": "O",
|
|
"\u014D": "o",
|
|
"\u014F": "o",
|
|
"\u0151": "o",
|
|
"\u0154": "R",
|
|
"\u0156": "R",
|
|
"\u0158": "R",
|
|
"\u0155": "r",
|
|
"\u0157": "r",
|
|
"\u0159": "r",
|
|
"\u015A": "S",
|
|
"\u015C": "S",
|
|
"\u015E": "S",
|
|
"\u0160": "S",
|
|
"\u015B": "s",
|
|
"\u015D": "s",
|
|
"\u015F": "s",
|
|
"\u0161": "s",
|
|
"\u0162": "T",
|
|
"\u0164": "T",
|
|
"\u0166": "T",
|
|
"\u0163": "t",
|
|
"\u0165": "t",
|
|
"\u0167": "t",
|
|
"\u0168": "U",
|
|
"\u016A": "U",
|
|
"\u016C": "U",
|
|
"\u016E": "U",
|
|
"\u0170": "U",
|
|
"\u0172": "U",
|
|
"\u0169": "u",
|
|
"\u016B": "u",
|
|
"\u016D": "u",
|
|
"\u016F": "u",
|
|
"\u0171": "u",
|
|
"\u0173": "u",
|
|
"\u0174": "W",
|
|
"\u0175": "w",
|
|
"\u0176": "Y",
|
|
"\u0177": "y",
|
|
"\u0178": "Y",
|
|
"\u0179": "Z",
|
|
"\u017B": "Z",
|
|
"\u017D": "Z",
|
|
"\u017A": "z",
|
|
"\u017C": "z",
|
|
"\u017E": "z",
|
|
"\u0132": "IJ",
|
|
"\u0133": "ij",
|
|
"\u0152": "Oe",
|
|
"\u0153": "oe",
|
|
"\u0149": "'n",
|
|
"\u017F": "s"
|
|
}, Hr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Jr = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }, Yr = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, Qr = parseFloat, Xr = parseInt, ne = "object" == typeof global && global && global.Object === Object && global, te = "object" == typeof self && self && self.Object === Object && self, re = ne || te || Function("return this")(), ee = "object" == typeof exports && exports && !exports.nodeType && exports, ue = ee && "object" == typeof module2 && module2 && !module2.nodeType && module2, ie = ue && ue.exports === ee, oe = ie && ne.process, fe = function() {
|
|
try {
|
|
var n2 = ue && ue.require && ue.require("util").types;
|
|
return n2 ? n2 : oe && oe.binding && oe.binding("util");
|
|
} catch (n3) {
|
|
}
|
|
}(), ce = fe && fe.isArrayBuffer, ae = fe && fe.isDate, le = fe && fe.isMap, se = fe && fe.isRegExp, he = fe && fe.isSet, pe = fe && fe.isTypedArray, _e = m("length"), ve = x(Gr), ge = x(Hr), ye = x(Jr), de = function p2(x2) {
|
|
function Z2(n2) {
|
|
if (cc(n2) && !bh(n2) && !(n2 instanceof Ct2)) {
|
|
if (n2 instanceof Y2)
|
|
return n2;
|
|
if (bl.call(n2, "__wrapped__"))
|
|
return eo(n2);
|
|
}
|
|
return new Y2(n2);
|
|
}
|
|
function J2() {
|
|
}
|
|
function Y2(n2, t2) {
|
|
this.__wrapped__ = n2, this.__actions__ = [], this.__chain__ = !!t2, this.__index__ = 0, this.__values__ = X;
|
|
}
|
|
function Ct2(n2) {
|
|
this.__wrapped__ = n2, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = Un, this.__views__ = [];
|
|
}
|
|
function $t2() {
|
|
var n2 = new Ct2(this.__wrapped__);
|
|
return n2.__actions__ = Tu(this.__actions__), n2.__dir__ = this.__dir__, n2.__filtered__ = this.__filtered__, n2.__iteratees__ = Tu(this.__iteratees__), n2.__takeCount__ = this.__takeCount__, n2.__views__ = Tu(this.__views__), n2;
|
|
}
|
|
function Yt2() {
|
|
if (this.__filtered__) {
|
|
var n2 = new Ct2(this);
|
|
n2.__dir__ = -1, n2.__filtered__ = true;
|
|
} else
|
|
n2 = this.clone(), n2.__dir__ *= -1;
|
|
return n2;
|
|
}
|
|
function Qt2() {
|
|
var n2 = this.__wrapped__.value(), t2 = this.__dir__, r2 = bh(n2), e2 = t2 < 0, u2 = r2 ? n2.length : 0, i2 = Oi(0, u2, this.__views__), o2 = i2.start, f2 = i2.end, c2 = f2 - o2, a2 = e2 ? f2 : o2 - 1, l2 = this.__iteratees__, s2 = l2.length, h2 = 0, p3 = Hl(c2, this.__takeCount__);
|
|
if (!r2 || !e2 && u2 == c2 && p3 == c2)
|
|
return wu(n2, this.__actions__);
|
|
var _2 = [];
|
|
n:
|
|
for (; c2-- && h2 < p3; ) {
|
|
a2 += t2;
|
|
for (var v2 = -1, g2 = n2[a2]; ++v2 < s2; ) {
|
|
var y2 = l2[v2], d2 = y2.iteratee, b2 = y2.type, w2 = d2(g2);
|
|
if (b2 == zn)
|
|
g2 = w2;
|
|
else if (!w2) {
|
|
if (b2 == Rn)
|
|
continue n;
|
|
break n;
|
|
}
|
|
}
|
|
_2[h2++] = g2;
|
|
}
|
|
return _2;
|
|
}
|
|
function Xt2(n2) {
|
|
var t2 = -1, r2 = null == n2 ? 0 : n2.length;
|
|
for (this.clear(); ++t2 < r2; ) {
|
|
var e2 = n2[t2];
|
|
this.set(e2[0], e2[1]);
|
|
}
|
|
}
|
|
function nr2() {
|
|
this.__data__ = is ? is(null) : {}, this.size = 0;
|
|
}
|
|
function tr2(n2) {
|
|
var t2 = this.has(n2) && delete this.__data__[n2];
|
|
return this.size -= t2 ? 1 : 0, t2;
|
|
}
|
|
function rr2(n2) {
|
|
var t2 = this.__data__;
|
|
if (is) {
|
|
var r2 = t2[n2];
|
|
return r2 === on ? X : r2;
|
|
}
|
|
return bl.call(t2, n2) ? t2[n2] : X;
|
|
}
|
|
function er2(n2) {
|
|
var t2 = this.__data__;
|
|
return is ? t2[n2] !== X : bl.call(t2, n2);
|
|
}
|
|
function ur2(n2, t2) {
|
|
var r2 = this.__data__;
|
|
return this.size += this.has(n2) ? 0 : 1, r2[n2] = is && t2 === X ? on : t2, this;
|
|
}
|
|
function ir2(n2) {
|
|
var t2 = -1, r2 = null == n2 ? 0 : n2.length;
|
|
for (this.clear(); ++t2 < r2; ) {
|
|
var e2 = n2[t2];
|
|
this.set(e2[0], e2[1]);
|
|
}
|
|
}
|
|
function or2() {
|
|
this.__data__ = [], this.size = 0;
|
|
}
|
|
function fr2(n2) {
|
|
var t2 = this.__data__, r2 = Wr2(t2, n2);
|
|
return !(r2 < 0) && (r2 == t2.length - 1 ? t2.pop() : Ll.call(t2, r2, 1), --this.size, true);
|
|
}
|
|
function cr2(n2) {
|
|
var t2 = this.__data__, r2 = Wr2(t2, n2);
|
|
return r2 < 0 ? X : t2[r2][1];
|
|
}
|
|
function ar2(n2) {
|
|
return Wr2(this.__data__, n2) > -1;
|
|
}
|
|
function lr2(n2, t2) {
|
|
var r2 = this.__data__, e2 = Wr2(r2, n2);
|
|
return e2 < 0 ? (++this.size, r2.push([n2, t2])) : r2[e2][1] = t2, this;
|
|
}
|
|
function sr2(n2) {
|
|
var t2 = -1, r2 = null == n2 ? 0 : n2.length;
|
|
for (this.clear(); ++t2 < r2; ) {
|
|
var e2 = n2[t2];
|
|
this.set(e2[0], e2[1]);
|
|
}
|
|
}
|
|
function hr2() {
|
|
this.size = 0, this.__data__ = { hash: new Xt2(), map: new (ts || ir2)(), string: new Xt2() };
|
|
}
|
|
function pr2(n2) {
|
|
var t2 = xi(this, n2).delete(n2);
|
|
return this.size -= t2 ? 1 : 0, t2;
|
|
}
|
|
function _r2(n2) {
|
|
return xi(this, n2).get(n2);
|
|
}
|
|
function vr2(n2) {
|
|
return xi(this, n2).has(n2);
|
|
}
|
|
function gr2(n2, t2) {
|
|
var r2 = xi(this, n2), e2 = r2.size;
|
|
return r2.set(n2, t2), this.size += r2.size == e2 ? 0 : 1, this;
|
|
}
|
|
function yr2(n2) {
|
|
var t2 = -1, r2 = null == n2 ? 0 : n2.length;
|
|
for (this.__data__ = new sr2(); ++t2 < r2; )
|
|
this.add(n2[t2]);
|
|
}
|
|
function dr2(n2) {
|
|
return this.__data__.set(n2, on), this;
|
|
}
|
|
function br2(n2) {
|
|
return this.__data__.has(n2);
|
|
}
|
|
function wr2(n2) {
|
|
this.size = (this.__data__ = new ir2(n2)).size;
|
|
}
|
|
function mr2() {
|
|
this.__data__ = new ir2(), this.size = 0;
|
|
}
|
|
function xr2(n2) {
|
|
var t2 = this.__data__, r2 = t2.delete(n2);
|
|
return this.size = t2.size, r2;
|
|
}
|
|
function jr2(n2) {
|
|
return this.__data__.get(n2);
|
|
}
|
|
function Ar2(n2) {
|
|
return this.__data__.has(n2);
|
|
}
|
|
function kr2(n2, t2) {
|
|
var r2 = this.__data__;
|
|
if (r2 instanceof ir2) {
|
|
var e2 = r2.__data__;
|
|
if (!ts || e2.length < tn - 1)
|
|
return e2.push([n2, t2]), this.size = ++r2.size, this;
|
|
r2 = this.__data__ = new sr2(e2);
|
|
}
|
|
return r2.set(n2, t2), this.size = r2.size, this;
|
|
}
|
|
function Or2(n2, t2) {
|
|
var r2 = bh(n2), e2 = !r2 && dh(n2), u2 = !r2 && !e2 && mh(n2), i2 = !r2 && !e2 && !u2 && Oh(n2), o2 = r2 || e2 || u2 || i2, f2 = o2 ? O(n2.length, hl) : [], c2 = f2.length;
|
|
for (var a2 in n2)
|
|
!t2 && !bl.call(n2, a2) || o2 && ("length" == a2 || u2 && ("offset" == a2 || "parent" == a2) || i2 && ("buffer" == a2 || "byteLength" == a2 || "byteOffset" == a2) || Ci(a2, c2)) || f2.push(a2);
|
|
return f2;
|
|
}
|
|
function Ir2(n2) {
|
|
var t2 = n2.length;
|
|
return t2 ? n2[tu(0, t2 - 1)] : X;
|
|
}
|
|
function Rr2(n2, t2) {
|
|
return Xi(Tu(n2), Mr2(t2, 0, n2.length));
|
|
}
|
|
function zr2(n2) {
|
|
return Xi(Tu(n2));
|
|
}
|
|
function Er2(n2, t2, r2) {
|
|
(r2 === X || Gf(n2[t2], r2)) && (r2 !== X || t2 in n2) || Br2(n2, t2, r2);
|
|
}
|
|
function Sr2(n2, t2, r2) {
|
|
var e2 = n2[t2];
|
|
bl.call(n2, t2) && Gf(e2, r2) && (r2 !== X || t2 in n2) || Br2(n2, t2, r2);
|
|
}
|
|
function Wr2(n2, t2) {
|
|
for (var r2 = n2.length; r2--; )
|
|
if (Gf(n2[r2][0], t2))
|
|
return r2;
|
|
return -1;
|
|
}
|
|
function Lr2(n2, t2, r2, e2) {
|
|
return ys(n2, function(n3, u2, i2) {
|
|
t2(e2, n3, r2(n3), i2);
|
|
}), e2;
|
|
}
|
|
function Cr2(n2, t2) {
|
|
return n2 && $u(t2, Pc(t2), n2);
|
|
}
|
|
function Ur2(n2, t2) {
|
|
return n2 && $u(t2, qc(t2), n2);
|
|
}
|
|
function Br2(n2, t2, r2) {
|
|
"__proto__" == t2 && Tl ? Tl(n2, t2, { configurable: true, enumerable: true, value: r2, writable: true }) : n2[t2] = r2;
|
|
}
|
|
function Tr2(n2, t2) {
|
|
for (var r2 = -1, e2 = t2.length, u2 = il(e2), i2 = null == n2; ++r2 < e2; )
|
|
u2[r2] = i2 ? X : Mc(n2, t2[r2]);
|
|
return u2;
|
|
}
|
|
function Mr2(n2, t2, r2) {
|
|
return n2 === n2 && (r2 !== X && (n2 = n2 <= r2 ? n2 : r2), t2 !== X && (n2 = n2 >= t2 ? n2 : t2)), n2;
|
|
}
|
|
function Fr2(n2, t2, e2, u2, i2, o2) {
|
|
var f2, c2 = t2 & an, a2 = t2 & ln, l2 = t2 & sn;
|
|
if (e2 && (f2 = i2 ? e2(n2, u2, i2, o2) : e2(n2)), f2 !== X)
|
|
return f2;
|
|
if (!fc(n2))
|
|
return n2;
|
|
var s2 = bh(n2);
|
|
if (s2) {
|
|
if (f2 = zi(n2), !c2)
|
|
return Tu(n2, f2);
|
|
} else {
|
|
var h2 = zs(n2), p3 = h2 == Kn || h2 == Vn;
|
|
if (mh(n2))
|
|
return Iu(n2, c2);
|
|
if (h2 == Yn || h2 == Dn || p3 && !i2) {
|
|
if (f2 = a2 || p3 ? {} : Ei(n2), !c2)
|
|
return a2 ? Mu(n2, Ur2(f2, n2)) : Du(n2, Cr2(f2, n2));
|
|
} else {
|
|
if (!Vr[h2])
|
|
return i2 ? n2 : {};
|
|
f2 = Si(n2, h2, c2);
|
|
}
|
|
}
|
|
o2 || (o2 = new wr2());
|
|
var _2 = o2.get(n2);
|
|
if (_2)
|
|
return _2;
|
|
o2.set(n2, f2), kh(n2) ? n2.forEach(function(r2) {
|
|
f2.add(Fr2(r2, t2, e2, r2, n2, o2));
|
|
}) : jh(n2) && n2.forEach(function(r2, u3) {
|
|
f2.set(u3, Fr2(r2, t2, e2, u3, n2, o2));
|
|
});
|
|
var v2 = l2 ? a2 ? di : yi : a2 ? qc : Pc, g2 = s2 ? X : v2(n2);
|
|
return r(g2 || n2, function(r2, u3) {
|
|
g2 && (u3 = r2, r2 = n2[u3]), Sr2(f2, u3, Fr2(r2, t2, e2, u3, n2, o2));
|
|
}), f2;
|
|
}
|
|
function Nr2(n2) {
|
|
var t2 = Pc(n2);
|
|
return function(r2) {
|
|
return Pr2(r2, n2, t2);
|
|
};
|
|
}
|
|
function Pr2(n2, t2, r2) {
|
|
var e2 = r2.length;
|
|
if (null == n2)
|
|
return !e2;
|
|
for (n2 = ll(n2); e2--; ) {
|
|
var u2 = r2[e2], i2 = t2[u2], o2 = n2[u2];
|
|
if (o2 === X && !(u2 in n2) || !i2(o2))
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
function Gr2(n2, t2, r2) {
|
|
if ("function" != typeof n2)
|
|
throw new pl(en);
|
|
return Ws(function() {
|
|
n2.apply(X, r2);
|
|
}, t2);
|
|
}
|
|
function Hr2(n2, t2, r2, e2) {
|
|
var u2 = -1, i2 = o, a2 = true, l2 = n2.length, s2 = [], h2 = t2.length;
|
|
if (!l2)
|
|
return s2;
|
|
r2 && (t2 = c(t2, z(r2))), e2 ? (i2 = f, a2 = false) : t2.length >= tn && (i2 = S, a2 = false, t2 = new yr2(t2));
|
|
n:
|
|
for (; ++u2 < l2; ) {
|
|
var p3 = n2[u2], _2 = null == r2 ? p3 : r2(p3);
|
|
if (p3 = e2 || 0 !== p3 ? p3 : 0, a2 && _2 === _2) {
|
|
for (var v2 = h2; v2--; )
|
|
if (t2[v2] === _2)
|
|
continue n;
|
|
s2.push(p3);
|
|
} else
|
|
i2(t2, _2, e2) || s2.push(p3);
|
|
}
|
|
return s2;
|
|
}
|
|
function Jr2(n2, t2) {
|
|
var r2 = true;
|
|
return ys(n2, function(n3, e2, u2) {
|
|
return r2 = !!t2(n3, e2, u2);
|
|
}), r2;
|
|
}
|
|
function Yr2(n2, t2, r2) {
|
|
for (var e2 = -1, u2 = n2.length; ++e2 < u2; ) {
|
|
var i2 = n2[e2], o2 = t2(i2);
|
|
if (null != o2 && (f2 === X ? o2 === o2 && !bc(o2) : r2(o2, f2)))
|
|
var f2 = o2, c2 = i2;
|
|
}
|
|
return c2;
|
|
}
|
|
function ne2(n2, t2, r2, e2) {
|
|
var u2 = n2.length;
|
|
for (r2 = kc(r2), r2 < 0 && (r2 = -r2 > u2 ? 0 : u2 + r2), e2 = e2 === X || e2 > u2 ? u2 : kc(e2), e2 < 0 && (e2 += u2), e2 = r2 > e2 ? 0 : Oc(e2); r2 < e2; )
|
|
n2[r2++] = t2;
|
|
return n2;
|
|
}
|
|
function te2(n2, t2) {
|
|
var r2 = [];
|
|
return ys(n2, function(n3, e2, u2) {
|
|
t2(n3, e2, u2) && r2.push(n3);
|
|
}), r2;
|
|
}
|
|
function ee2(n2, t2, r2, e2, u2) {
|
|
var i2 = -1, o2 = n2.length;
|
|
for (r2 || (r2 = Li), u2 || (u2 = []); ++i2 < o2; ) {
|
|
var f2 = n2[i2];
|
|
t2 > 0 && r2(f2) ? t2 > 1 ? ee2(f2, t2 - 1, r2, e2, u2) : a(u2, f2) : e2 || (u2[u2.length] = f2);
|
|
}
|
|
return u2;
|
|
}
|
|
function ue2(n2, t2) {
|
|
return n2 && bs(n2, t2, Pc);
|
|
}
|
|
function oe2(n2, t2) {
|
|
return n2 && ws(n2, t2, Pc);
|
|
}
|
|
function fe2(n2, t2) {
|
|
return i(t2, function(t3) {
|
|
return uc(n2[t3]);
|
|
});
|
|
}
|
|
function _e2(n2, t2) {
|
|
t2 = ku(t2, n2);
|
|
for (var r2 = 0, e2 = t2.length; null != n2 && r2 < e2; )
|
|
n2 = n2[no(t2[r2++])];
|
|
return r2 && r2 == e2 ? n2 : X;
|
|
}
|
|
function de2(n2, t2, r2) {
|
|
var e2 = t2(n2);
|
|
return bh(n2) ? e2 : a(e2, r2(n2));
|
|
}
|
|
function we(n2) {
|
|
return null == n2 ? n2 === X ? ut : Jn : Bl && Bl in ll(n2) ? ki(n2) : Ki(n2);
|
|
}
|
|
function me(n2, t2) {
|
|
return n2 > t2;
|
|
}
|
|
function xe(n2, t2) {
|
|
return null != n2 && bl.call(n2, t2);
|
|
}
|
|
function je(n2, t2) {
|
|
return null != n2 && t2 in ll(n2);
|
|
}
|
|
function Ae(n2, t2, r2) {
|
|
return n2 >= Hl(t2, r2) && n2 < Gl(t2, r2);
|
|
}
|
|
function ke(n2, t2, r2) {
|
|
for (var e2 = r2 ? f : o, u2 = n2[0].length, i2 = n2.length, a2 = i2, l2 = il(i2), s2 = 1 / 0, h2 = []; a2--; ) {
|
|
var p3 = n2[a2];
|
|
a2 && t2 && (p3 = c(p3, z(t2))), s2 = Hl(p3.length, s2), l2[a2] = !r2 && (t2 || u2 >= 120 && p3.length >= 120) ? new yr2(a2 && p3) : X;
|
|
}
|
|
p3 = n2[0];
|
|
var _2 = -1, v2 = l2[0];
|
|
n:
|
|
for (; ++_2 < u2 && h2.length < s2; ) {
|
|
var g2 = p3[_2], y2 = t2 ? t2(g2) : g2;
|
|
if (g2 = r2 || 0 !== g2 ? g2 : 0, !(v2 ? S(v2, y2) : e2(h2, y2, r2))) {
|
|
for (a2 = i2; --a2; ) {
|
|
var d2 = l2[a2];
|
|
if (!(d2 ? S(d2, y2) : e2(n2[a2], y2, r2)))
|
|
continue n;
|
|
}
|
|
v2 && v2.push(y2), h2.push(g2);
|
|
}
|
|
}
|
|
return h2;
|
|
}
|
|
function Oe(n2, t2, r2, e2) {
|
|
return ue2(n2, function(n3, u2, i2) {
|
|
t2(e2, r2(n3), u2, i2);
|
|
}), e2;
|
|
}
|
|
function Ie(t2, r2, e2) {
|
|
r2 = ku(r2, t2), t2 = Gi(t2, r2);
|
|
var u2 = null == t2 ? t2 : t2[no(jo(r2))];
|
|
return null == u2 ? X : n(u2, t2, e2);
|
|
}
|
|
function Re(n2) {
|
|
return cc(n2) && we(n2) == Dn;
|
|
}
|
|
function ze(n2) {
|
|
return cc(n2) && we(n2) == ft;
|
|
}
|
|
function Ee(n2) {
|
|
return cc(n2) && we(n2) == Pn;
|
|
}
|
|
function Se(n2, t2, r2, e2, u2) {
|
|
return n2 === t2 || (null == n2 || null == t2 || !cc(n2) && !cc(t2) ? n2 !== n2 && t2 !== t2 : We(n2, t2, r2, e2, Se, u2));
|
|
}
|
|
function We(n2, t2, r2, e2, u2, i2) {
|
|
var o2 = bh(n2), f2 = bh(t2), c2 = o2 ? Mn : zs(n2), a2 = f2 ? Mn : zs(t2);
|
|
c2 = c2 == Dn ? Yn : c2, a2 = a2 == Dn ? Yn : a2;
|
|
var l2 = c2 == Yn, s2 = a2 == Yn, h2 = c2 == a2;
|
|
if (h2 && mh(n2)) {
|
|
if (!mh(t2))
|
|
return false;
|
|
o2 = true, l2 = false;
|
|
}
|
|
if (h2 && !l2)
|
|
return i2 || (i2 = new wr2()), o2 || Oh(n2) ? pi(n2, t2, r2, e2, u2, i2) : _i(n2, t2, c2, r2, e2, u2, i2);
|
|
if (!(r2 & hn)) {
|
|
var p3 = l2 && bl.call(n2, "__wrapped__"), _2 = s2 && bl.call(t2, "__wrapped__");
|
|
if (p3 || _2) {
|
|
var v2 = p3 ? n2.value() : n2, g2 = _2 ? t2.value() : t2;
|
|
return i2 || (i2 = new wr2()), u2(v2, g2, r2, e2, i2);
|
|
}
|
|
}
|
|
return !!h2 && (i2 || (i2 = new wr2()), vi(n2, t2, r2, e2, u2, i2));
|
|
}
|
|
function Le(n2) {
|
|
return cc(n2) && zs(n2) == Gn;
|
|
}
|
|
function Ce(n2, t2, r2, e2) {
|
|
var u2 = r2.length, i2 = u2, o2 = !e2;
|
|
if (null == n2)
|
|
return !i2;
|
|
for (n2 = ll(n2); u2--; ) {
|
|
var f2 = r2[u2];
|
|
if (o2 && f2[2] ? f2[1] !== n2[f2[0]] : !(f2[0] in n2))
|
|
return false;
|
|
}
|
|
for (; ++u2 < i2; ) {
|
|
f2 = r2[u2];
|
|
var c2 = f2[0], a2 = n2[c2], l2 = f2[1];
|
|
if (o2 && f2[2]) {
|
|
if (a2 === X && !(c2 in n2))
|
|
return false;
|
|
} else {
|
|
var s2 = new wr2();
|
|
if (e2)
|
|
var h2 = e2(a2, l2, c2, n2, t2, s2);
|
|
if (!(h2 === X ? Se(l2, a2, hn | pn, e2, s2) : h2))
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function Ue(n2) {
|
|
return !(!fc(n2) || Di(n2)) && (uc(n2) ? kl : Zt).test(to(n2));
|
|
}
|
|
function Be(n2) {
|
|
return cc(n2) && we(n2) == nt;
|
|
}
|
|
function Te(n2) {
|
|
return cc(n2) && zs(n2) == tt;
|
|
}
|
|
function $e(n2) {
|
|
return cc(n2) && oc(n2.length) && !!Kr[we(n2)];
|
|
}
|
|
function De(n2) {
|
|
return "function" == typeof n2 ? n2 : null == n2 ? La : "object" == typeof n2 ? bh(n2) ? Ze(n2[0], n2[1]) : qe(n2) : Fa(n2);
|
|
}
|
|
function Me(n2) {
|
|
if (!Mi(n2))
|
|
return Vl(n2);
|
|
var t2 = [];
|
|
for (var r2 in ll(n2))
|
|
bl.call(n2, r2) && "constructor" != r2 && t2.push(r2);
|
|
return t2;
|
|
}
|
|
function Fe(n2) {
|
|
if (!fc(n2))
|
|
return Zi(n2);
|
|
var t2 = Mi(n2), r2 = [];
|
|
for (var e2 in n2)
|
|
("constructor" != e2 || !t2 && bl.call(n2, e2)) && r2.push(e2);
|
|
return r2;
|
|
}
|
|
function Ne(n2, t2) {
|
|
return n2 < t2;
|
|
}
|
|
function Pe(n2, t2) {
|
|
var r2 = -1, e2 = Hf(n2) ? il(n2.length) : [];
|
|
return ys(n2, function(n3, u2, i2) {
|
|
e2[++r2] = t2(n3, u2, i2);
|
|
}), e2;
|
|
}
|
|
function qe(n2) {
|
|
var t2 = ji(n2);
|
|
return 1 == t2.length && t2[0][2] ? Ni(t2[0][0], t2[0][1]) : function(r2) {
|
|
return r2 === n2 || Ce(r2, n2, t2);
|
|
};
|
|
}
|
|
function Ze(n2, t2) {
|
|
return Bi(n2) && Fi(t2) ? Ni(no(n2), t2) : function(r2) {
|
|
var e2 = Mc(r2, n2);
|
|
return e2 === X && e2 === t2 ? Nc(r2, n2) : Se(t2, e2, hn | pn);
|
|
};
|
|
}
|
|
function Ke(n2, t2, r2, e2, u2) {
|
|
n2 !== t2 && bs(t2, function(i2, o2) {
|
|
if (u2 || (u2 = new wr2()), fc(i2))
|
|
Ve(n2, t2, o2, r2, Ke, e2, u2);
|
|
else {
|
|
var f2 = e2 ? e2(Ji(n2, o2), i2, o2 + "", n2, t2, u2) : X;
|
|
f2 === X && (f2 = i2), Er2(n2, o2, f2);
|
|
}
|
|
}, qc);
|
|
}
|
|
function Ve(n2, t2, r2, e2, u2, i2, o2) {
|
|
var f2 = Ji(n2, r2), c2 = Ji(t2, r2), a2 = o2.get(c2);
|
|
if (a2)
|
|
return Er2(n2, r2, a2), X;
|
|
var l2 = i2 ? i2(f2, c2, r2 + "", n2, t2, o2) : X, s2 = l2 === X;
|
|
if (s2) {
|
|
var h2 = bh(c2), p3 = !h2 && mh(c2), _2 = !h2 && !p3 && Oh(c2);
|
|
l2 = c2, h2 || p3 || _2 ? bh(f2) ? l2 = f2 : Jf(f2) ? l2 = Tu(f2) : p3 ? (s2 = false, l2 = Iu(c2, true)) : _2 ? (s2 = false, l2 = Wu(c2, true)) : l2 = [] : gc(c2) || dh(c2) ? (l2 = f2, dh(f2) ? l2 = Rc(f2) : fc(f2) && !uc(f2) || (l2 = Ei(c2))) : s2 = false;
|
|
}
|
|
s2 && (o2.set(c2, l2), u2(l2, c2, e2, i2, o2), o2.delete(c2)), Er2(n2, r2, l2);
|
|
}
|
|
function Ge(n2, t2) {
|
|
var r2 = n2.length;
|
|
if (r2)
|
|
return t2 += t2 < 0 ? r2 : 0, Ci(t2, r2) ? n2[t2] : X;
|
|
}
|
|
function He(n2, t2, r2) {
|
|
t2 = t2.length ? c(t2, function(n3) {
|
|
return bh(n3) ? function(t3) {
|
|
return _e2(t3, 1 === n3.length ? n3[0] : n3);
|
|
} : n3;
|
|
}) : [La];
|
|
var e2 = -1;
|
|
return t2 = c(t2, z(mi())), A(Pe(n2, function(n3, r3, u2) {
|
|
return { criteria: c(t2, function(t3) {
|
|
return t3(n3);
|
|
}), index: ++e2, value: n3 };
|
|
}), function(n3, t3) {
|
|
return Cu(n3, t3, r2);
|
|
});
|
|
}
|
|
function Je(n2, t2) {
|
|
return Ye(n2, t2, function(t3, r2) {
|
|
return Nc(n2, r2);
|
|
});
|
|
}
|
|
function Ye(n2, t2, r2) {
|
|
for (var e2 = -1, u2 = t2.length, i2 = {}; ++e2 < u2; ) {
|
|
var o2 = t2[e2], f2 = _e2(n2, o2);
|
|
r2(f2, o2) && fu(i2, ku(o2, n2), f2);
|
|
}
|
|
return i2;
|
|
}
|
|
function Qe(n2) {
|
|
return function(t2) {
|
|
return _e2(t2, n2);
|
|
};
|
|
}
|
|
function Xe(n2, t2, r2, e2) {
|
|
var u2 = e2 ? d : y, i2 = -1, o2 = t2.length, f2 = n2;
|
|
for (n2 === t2 && (t2 = Tu(t2)), r2 && (f2 = c(n2, z(r2))); ++i2 < o2; )
|
|
for (var a2 = 0, l2 = t2[i2], s2 = r2 ? r2(l2) : l2; (a2 = u2(f2, s2, a2, e2)) > -1; )
|
|
f2 !== n2 && Ll.call(f2, a2, 1), Ll.call(n2, a2, 1);
|
|
return n2;
|
|
}
|
|
function nu(n2, t2) {
|
|
for (var r2 = n2 ? t2.length : 0, e2 = r2 - 1; r2--; ) {
|
|
var u2 = t2[r2];
|
|
if (r2 == e2 || u2 !== i2) {
|
|
var i2 = u2;
|
|
Ci(u2) ? Ll.call(n2, u2, 1) : yu(n2, u2);
|
|
}
|
|
}
|
|
return n2;
|
|
}
|
|
function tu(n2, t2) {
|
|
return n2 + Nl(Ql() * (t2 - n2 + 1));
|
|
}
|
|
function ru(n2, t2, r2, e2) {
|
|
for (var u2 = -1, i2 = Gl(Fl((t2 - n2) / (r2 || 1)), 0), o2 = il(i2); i2--; )
|
|
o2[e2 ? i2 : ++u2] = n2, n2 += r2;
|
|
return o2;
|
|
}
|
|
function eu(n2, t2) {
|
|
var r2 = "";
|
|
if (!n2 || t2 < 1 || t2 > Wn)
|
|
return r2;
|
|
do
|
|
t2 % 2 && (r2 += n2), t2 = Nl(t2 / 2), t2 && (n2 += n2);
|
|
while (t2);
|
|
return r2;
|
|
}
|
|
function uu(n2, t2) {
|
|
return Ls(Vi(n2, t2, La), n2 + "");
|
|
}
|
|
function iu(n2) {
|
|
return Ir2(ra(n2));
|
|
}
|
|
function ou(n2, t2) {
|
|
var r2 = ra(n2);
|
|
return Xi(r2, Mr2(t2, 0, r2.length));
|
|
}
|
|
function fu(n2, t2, r2, e2) {
|
|
if (!fc(n2))
|
|
return n2;
|
|
t2 = ku(t2, n2);
|
|
for (var u2 = -1, i2 = t2.length, o2 = i2 - 1, f2 = n2; null != f2 && ++u2 < i2; ) {
|
|
var c2 = no(t2[u2]), a2 = r2;
|
|
if ("__proto__" === c2 || "constructor" === c2 || "prototype" === c2)
|
|
return n2;
|
|
if (u2 != o2) {
|
|
var l2 = f2[c2];
|
|
a2 = e2 ? e2(l2, c2, f2) : X, a2 === X && (a2 = fc(l2) ? l2 : Ci(t2[u2 + 1]) ? [] : {});
|
|
}
|
|
Sr2(f2, c2, a2), f2 = f2[c2];
|
|
}
|
|
return n2;
|
|
}
|
|
function cu(n2) {
|
|
return Xi(ra(n2));
|
|
}
|
|
function au(n2, t2, r2) {
|
|
var e2 = -1, u2 = n2.length;
|
|
t2 < 0 && (t2 = -t2 > u2 ? 0 : u2 + t2), r2 = r2 > u2 ? u2 : r2, r2 < 0 && (r2 += u2), u2 = t2 > r2 ? 0 : r2 - t2 >>> 0, t2 >>>= 0;
|
|
for (var i2 = il(u2); ++e2 < u2; )
|
|
i2[e2] = n2[e2 + t2];
|
|
return i2;
|
|
}
|
|
function lu(n2, t2) {
|
|
var r2;
|
|
return ys(n2, function(n3, e2, u2) {
|
|
return r2 = t2(n3, e2, u2), !r2;
|
|
}), !!r2;
|
|
}
|
|
function su(n2, t2, r2) {
|
|
var e2 = 0, u2 = null == n2 ? e2 : n2.length;
|
|
if ("number" == typeof t2 && t2 === t2 && u2 <= Tn) {
|
|
for (; e2 < u2; ) {
|
|
var i2 = e2 + u2 >>> 1, o2 = n2[i2];
|
|
null !== o2 && !bc(o2) && (r2 ? o2 <= t2 : o2 < t2) ? e2 = i2 + 1 : u2 = i2;
|
|
}
|
|
return u2;
|
|
}
|
|
return hu(n2, t2, La, r2);
|
|
}
|
|
function hu(n2, t2, r2, e2) {
|
|
var u2 = 0, i2 = null == n2 ? 0 : n2.length;
|
|
if (0 === i2)
|
|
return 0;
|
|
t2 = r2(t2);
|
|
for (var o2 = t2 !== t2, f2 = null === t2, c2 = bc(t2), a2 = t2 === X; u2 < i2; ) {
|
|
var l2 = Nl((u2 + i2) / 2), s2 = r2(n2[l2]), h2 = s2 !== X, p3 = null === s2, _2 = s2 === s2, v2 = bc(s2);
|
|
if (o2)
|
|
var g2 = e2 || _2;
|
|
else
|
|
g2 = a2 ? _2 && (e2 || h2) : f2 ? _2 && h2 && (e2 || !p3) : c2 ? _2 && h2 && !p3 && (e2 || !v2) : !p3 && !v2 && (e2 ? s2 <= t2 : s2 < t2);
|
|
g2 ? u2 = l2 + 1 : i2 = l2;
|
|
}
|
|
return Hl(i2, Bn);
|
|
}
|
|
function pu(n2, t2) {
|
|
for (var r2 = -1, e2 = n2.length, u2 = 0, i2 = []; ++r2 < e2; ) {
|
|
var o2 = n2[r2], f2 = t2 ? t2(o2) : o2;
|
|
if (!r2 || !Gf(f2, c2)) {
|
|
var c2 = f2;
|
|
i2[u2++] = 0 === o2 ? 0 : o2;
|
|
}
|
|
}
|
|
return i2;
|
|
}
|
|
function _u(n2) {
|
|
return "number" == typeof n2 ? n2 : bc(n2) ? Cn : +n2;
|
|
}
|
|
function vu(n2) {
|
|
if ("string" == typeof n2)
|
|
return n2;
|
|
if (bh(n2))
|
|
return c(n2, vu) + "";
|
|
if (bc(n2))
|
|
return vs ? vs.call(n2) : "";
|
|
var t2 = n2 + "";
|
|
return "0" == t2 && 1 / n2 == -Sn ? "-0" : t2;
|
|
}
|
|
function gu(n2, t2, r2) {
|
|
var e2 = -1, u2 = o, i2 = n2.length, c2 = true, a2 = [], l2 = a2;
|
|
if (r2)
|
|
c2 = false, u2 = f;
|
|
else if (i2 >= tn) {
|
|
var s2 = t2 ? null : ks(n2);
|
|
if (s2)
|
|
return P(s2);
|
|
c2 = false, u2 = S, l2 = new yr2();
|
|
} else
|
|
l2 = t2 ? [] : a2;
|
|
n:
|
|
for (; ++e2 < i2; ) {
|
|
var h2 = n2[e2], p3 = t2 ? t2(h2) : h2;
|
|
if (h2 = r2 || 0 !== h2 ? h2 : 0, c2 && p3 === p3) {
|
|
for (var _2 = l2.length; _2--; )
|
|
if (l2[_2] === p3)
|
|
continue n;
|
|
t2 && l2.push(p3), a2.push(h2);
|
|
} else
|
|
u2(l2, p3, r2) || (l2 !== a2 && l2.push(p3), a2.push(h2));
|
|
}
|
|
return a2;
|
|
}
|
|
function yu(n2, t2) {
|
|
return t2 = ku(t2, n2), n2 = Gi(n2, t2), null == n2 || delete n2[no(jo(t2))];
|
|
}
|
|
function du(n2, t2, r2, e2) {
|
|
return fu(n2, t2, r2(_e2(n2, t2)), e2);
|
|
}
|
|
function bu(n2, t2, r2, e2) {
|
|
for (var u2 = n2.length, i2 = e2 ? u2 : -1; (e2 ? i2-- : ++i2 < u2) && t2(n2[i2], i2, n2); )
|
|
;
|
|
return r2 ? au(n2, e2 ? 0 : i2, e2 ? i2 + 1 : u2) : au(n2, e2 ? i2 + 1 : 0, e2 ? u2 : i2);
|
|
}
|
|
function wu(n2, t2) {
|
|
var r2 = n2;
|
|
return r2 instanceof Ct2 && (r2 = r2.value()), l(t2, function(n3, t3) {
|
|
return t3.func.apply(t3.thisArg, a([n3], t3.args));
|
|
}, r2);
|
|
}
|
|
function mu(n2, t2, r2) {
|
|
var e2 = n2.length;
|
|
if (e2 < 2)
|
|
return e2 ? gu(n2[0]) : [];
|
|
for (var u2 = -1, i2 = il(e2); ++u2 < e2; )
|
|
for (var o2 = n2[u2], f2 = -1; ++f2 < e2; )
|
|
f2 != u2 && (i2[u2] = Hr2(i2[u2] || o2, n2[f2], t2, r2));
|
|
return gu(ee2(i2, 1), t2, r2);
|
|
}
|
|
function xu(n2, t2, r2) {
|
|
for (var e2 = -1, u2 = n2.length, i2 = t2.length, o2 = {}; ++e2 < u2; ) {
|
|
r2(o2, n2[e2], e2 < i2 ? t2[e2] : X);
|
|
}
|
|
return o2;
|
|
}
|
|
function ju(n2) {
|
|
return Jf(n2) ? n2 : [];
|
|
}
|
|
function Au(n2) {
|
|
return "function" == typeof n2 ? n2 : La;
|
|
}
|
|
function ku(n2, t2) {
|
|
return bh(n2) ? n2 : Bi(n2, t2) ? [n2] : Cs(Ec(n2));
|
|
}
|
|
function Ou(n2, t2, r2) {
|
|
var e2 = n2.length;
|
|
return r2 = r2 === X ? e2 : r2, !t2 && r2 >= e2 ? n2 : au(n2, t2, r2);
|
|
}
|
|
function Iu(n2, t2) {
|
|
if (t2)
|
|
return n2.slice();
|
|
var r2 = n2.length, e2 = zl ? zl(r2) : new n2.constructor(r2);
|
|
return n2.copy(e2), e2;
|
|
}
|
|
function Ru(n2) {
|
|
var t2 = new n2.constructor(n2.byteLength);
|
|
return new Rl(t2).set(new Rl(n2)), t2;
|
|
}
|
|
function zu(n2, t2) {
|
|
return new n2.constructor(t2 ? Ru(n2.buffer) : n2.buffer, n2.byteOffset, n2.byteLength);
|
|
}
|
|
function Eu(n2) {
|
|
var t2 = new n2.constructor(n2.source, Nt.exec(n2));
|
|
return t2.lastIndex = n2.lastIndex, t2;
|
|
}
|
|
function Su(n2) {
|
|
return _s ? ll(_s.call(n2)) : {};
|
|
}
|
|
function Wu(n2, t2) {
|
|
return new n2.constructor(t2 ? Ru(n2.buffer) : n2.buffer, n2.byteOffset, n2.length);
|
|
}
|
|
function Lu(n2, t2) {
|
|
if (n2 !== t2) {
|
|
var r2 = n2 !== X, e2 = null === n2, u2 = n2 === n2, i2 = bc(n2), o2 = t2 !== X, f2 = null === t2, c2 = t2 === t2, a2 = bc(t2);
|
|
if (!f2 && !a2 && !i2 && n2 > t2 || i2 && o2 && c2 && !f2 && !a2 || e2 && o2 && c2 || !r2 && c2 || !u2)
|
|
return 1;
|
|
if (!e2 && !i2 && !a2 && n2 < t2 || a2 && r2 && u2 && !e2 && !i2 || f2 && r2 && u2 || !o2 && u2 || !c2)
|
|
return -1;
|
|
}
|
|
return 0;
|
|
}
|
|
function Cu(n2, t2, r2) {
|
|
for (var e2 = -1, u2 = n2.criteria, i2 = t2.criteria, o2 = u2.length, f2 = r2.length; ++e2 < o2; ) {
|
|
var c2 = Lu(u2[e2], i2[e2]);
|
|
if (c2) {
|
|
if (e2 >= f2)
|
|
return c2;
|
|
return c2 * ("desc" == r2[e2] ? -1 : 1);
|
|
}
|
|
}
|
|
return n2.index - t2.index;
|
|
}
|
|
function Uu(n2, t2, r2, e2) {
|
|
for (var u2 = -1, i2 = n2.length, o2 = r2.length, f2 = -1, c2 = t2.length, a2 = Gl(i2 - o2, 0), l2 = il(c2 + a2), s2 = !e2; ++f2 < c2; )
|
|
l2[f2] = t2[f2];
|
|
for (; ++u2 < o2; )
|
|
(s2 || u2 < i2) && (l2[r2[u2]] = n2[u2]);
|
|
for (; a2--; )
|
|
l2[f2++] = n2[u2++];
|
|
return l2;
|
|
}
|
|
function Bu(n2, t2, r2, e2) {
|
|
for (var u2 = -1, i2 = n2.length, o2 = -1, f2 = r2.length, c2 = -1, a2 = t2.length, l2 = Gl(i2 - f2, 0), s2 = il(l2 + a2), h2 = !e2; ++u2 < l2; )
|
|
s2[u2] = n2[u2];
|
|
for (var p3 = u2; ++c2 < a2; )
|
|
s2[p3 + c2] = t2[c2];
|
|
for (; ++o2 < f2; )
|
|
(h2 || u2 < i2) && (s2[p3 + r2[o2]] = n2[u2++]);
|
|
return s2;
|
|
}
|
|
function Tu(n2, t2) {
|
|
var r2 = -1, e2 = n2.length;
|
|
for (t2 || (t2 = il(e2)); ++r2 < e2; )
|
|
t2[r2] = n2[r2];
|
|
return t2;
|
|
}
|
|
function $u(n2, t2, r2, e2) {
|
|
var u2 = !r2;
|
|
r2 || (r2 = {});
|
|
for (var i2 = -1, o2 = t2.length; ++i2 < o2; ) {
|
|
var f2 = t2[i2], c2 = e2 ? e2(r2[f2], n2[f2], f2, r2, n2) : X;
|
|
c2 === X && (c2 = n2[f2]), u2 ? Br2(r2, f2, c2) : Sr2(r2, f2, c2);
|
|
}
|
|
return r2;
|
|
}
|
|
function Du(n2, t2) {
|
|
return $u(n2, Is(n2), t2);
|
|
}
|
|
function Mu(n2, t2) {
|
|
return $u(n2, Rs(n2), t2);
|
|
}
|
|
function Fu(n2, r2) {
|
|
return function(e2, u2) {
|
|
var i2 = bh(e2) ? t : Lr2, o2 = r2 ? r2() : {};
|
|
return i2(e2, n2, mi(u2, 2), o2);
|
|
};
|
|
}
|
|
function Nu(n2) {
|
|
return uu(function(t2, r2) {
|
|
var e2 = -1, u2 = r2.length, i2 = u2 > 1 ? r2[u2 - 1] : X, o2 = u2 > 2 ? r2[2] : X;
|
|
for (i2 = n2.length > 3 && "function" == typeof i2 ? (u2--, i2) : X, o2 && Ui(r2[0], r2[1], o2) && (i2 = u2 < 3 ? X : i2, u2 = 1), t2 = ll(t2); ++e2 < u2; ) {
|
|
var f2 = r2[e2];
|
|
f2 && n2(t2, f2, e2, i2);
|
|
}
|
|
return t2;
|
|
});
|
|
}
|
|
function Pu(n2, t2) {
|
|
return function(r2, e2) {
|
|
if (null == r2)
|
|
return r2;
|
|
if (!Hf(r2))
|
|
return n2(r2, e2);
|
|
for (var u2 = r2.length, i2 = t2 ? u2 : -1, o2 = ll(r2); (t2 ? i2-- : ++i2 < u2) && e2(o2[i2], i2, o2) !== false; )
|
|
;
|
|
return r2;
|
|
};
|
|
}
|
|
function qu(n2) {
|
|
return function(t2, r2, e2) {
|
|
for (var u2 = -1, i2 = ll(t2), o2 = e2(t2), f2 = o2.length; f2--; ) {
|
|
var c2 = o2[n2 ? f2 : ++u2];
|
|
if (r2(i2[c2], c2, i2) === false)
|
|
break;
|
|
}
|
|
return t2;
|
|
};
|
|
}
|
|
function Zu(n2, t2, r2) {
|
|
function e2() {
|
|
return (this && this !== re && this instanceof e2 ? i2 : n2).apply(u2 ? r2 : this, arguments);
|
|
}
|
|
var u2 = t2 & _n, i2 = Gu(n2);
|
|
return e2;
|
|
}
|
|
function Ku(n2) {
|
|
return function(t2) {
|
|
t2 = Ec(t2);
|
|
var r2 = T(t2) ? G(t2) : X, e2 = r2 ? r2[0] : t2.charAt(0), u2 = r2 ? Ou(r2, 1).join("") : t2.slice(1);
|
|
return e2[n2]() + u2;
|
|
};
|
|
}
|
|
function Vu(n2) {
|
|
return function(t2) {
|
|
return l(Ra(ca(t2).replace($r, "")), n2, "");
|
|
};
|
|
}
|
|
function Gu(n2) {
|
|
return function() {
|
|
var t2 = arguments;
|
|
switch (t2.length) {
|
|
case 0:
|
|
return new n2();
|
|
case 1:
|
|
return new n2(t2[0]);
|
|
case 2:
|
|
return new n2(t2[0], t2[1]);
|
|
case 3:
|
|
return new n2(t2[0], t2[1], t2[2]);
|
|
case 4:
|
|
return new n2(t2[0], t2[1], t2[2], t2[3]);
|
|
case 5:
|
|
return new n2(t2[0], t2[1], t2[2], t2[3], t2[4]);
|
|
case 6:
|
|
return new n2(t2[0], t2[1], t2[2], t2[3], t2[4], t2[5]);
|
|
case 7:
|
|
return new n2(t2[0], t2[1], t2[2], t2[3], t2[4], t2[5], t2[6]);
|
|
}
|
|
var r2 = gs(n2.prototype), e2 = n2.apply(r2, t2);
|
|
return fc(e2) ? e2 : r2;
|
|
};
|
|
}
|
|
function Hu(t2, r2, e2) {
|
|
function u2() {
|
|
for (var o2 = arguments.length, f2 = il(o2), c2 = o2, a2 = wi(u2); c2--; )
|
|
f2[c2] = arguments[c2];
|
|
var l2 = o2 < 3 && f2[0] !== a2 && f2[o2 - 1] !== a2 ? [] : N(f2, a2);
|
|
return o2 -= l2.length, o2 < e2 ? oi(t2, r2, Qu, u2.placeholder, X, f2, l2, X, X, e2 - o2) : n(this && this !== re && this instanceof u2 ? i2 : t2, this, f2);
|
|
}
|
|
var i2 = Gu(t2);
|
|
return u2;
|
|
}
|
|
function Ju(n2) {
|
|
return function(t2, r2, e2) {
|
|
var u2 = ll(t2);
|
|
if (!Hf(t2)) {
|
|
var i2 = mi(r2, 3);
|
|
t2 = Pc(t2), r2 = function(n3) {
|
|
return i2(u2[n3], n3, u2);
|
|
};
|
|
}
|
|
var o2 = n2(t2, r2, e2);
|
|
return o2 > -1 ? u2[i2 ? t2[o2] : o2] : X;
|
|
};
|
|
}
|
|
function Yu(n2) {
|
|
return gi(function(t2) {
|
|
var r2 = t2.length, e2 = r2, u2 = Y2.prototype.thru;
|
|
for (n2 && t2.reverse(); e2--; ) {
|
|
var i2 = t2[e2];
|
|
if ("function" != typeof i2)
|
|
throw new pl(en);
|
|
if (u2 && !o2 && "wrapper" == bi(i2))
|
|
var o2 = new Y2([], true);
|
|
}
|
|
for (e2 = o2 ? e2 : r2; ++e2 < r2; ) {
|
|
i2 = t2[e2];
|
|
var f2 = bi(i2), c2 = "wrapper" == f2 ? Os(i2) : X;
|
|
o2 = c2 && $i(c2[0]) && c2[1] == (mn | yn | bn | xn) && !c2[4].length && 1 == c2[9] ? o2[bi(c2[0])].apply(o2, c2[3]) : 1 == i2.length && $i(i2) ? o2[f2]() : o2.thru(i2);
|
|
}
|
|
return function() {
|
|
var n3 = arguments, e3 = n3[0];
|
|
if (o2 && 1 == n3.length && bh(e3))
|
|
return o2.plant(e3).value();
|
|
for (var u3 = 0, i3 = r2 ? t2[u3].apply(this, n3) : e3; ++u3 < r2; )
|
|
i3 = t2[u3].call(this, i3);
|
|
return i3;
|
|
};
|
|
});
|
|
}
|
|
function Qu(n2, t2, r2, e2, u2, i2, o2, f2, c2, a2) {
|
|
function l2() {
|
|
for (var y2 = arguments.length, d2 = il(y2), b2 = y2; b2--; )
|
|
d2[b2] = arguments[b2];
|
|
if (_2)
|
|
var w2 = wi(l2), m2 = C(d2, w2);
|
|
if (e2 && (d2 = Uu(d2, e2, u2, _2)), i2 && (d2 = Bu(d2, i2, o2, _2)), y2 -= m2, _2 && y2 < a2) {
|
|
return oi(n2, t2, Qu, l2.placeholder, r2, d2, N(d2, w2), f2, c2, a2 - y2);
|
|
}
|
|
var x3 = h2 ? r2 : this, j2 = p3 ? x3[n2] : n2;
|
|
return y2 = d2.length, f2 ? d2 = Hi(d2, f2) : v2 && y2 > 1 && d2.reverse(), s2 && c2 < y2 && (d2.length = c2), this && this !== re && this instanceof l2 && (j2 = g2 || Gu(j2)), j2.apply(x3, d2);
|
|
}
|
|
var s2 = t2 & mn, h2 = t2 & _n, p3 = t2 & vn, _2 = t2 & (yn | dn), v2 = t2 & jn, g2 = p3 ? X : Gu(n2);
|
|
return l2;
|
|
}
|
|
function Xu(n2, t2) {
|
|
return function(r2, e2) {
|
|
return Oe(r2, n2, t2(e2), {});
|
|
};
|
|
}
|
|
function ni(n2, t2) {
|
|
return function(r2, e2) {
|
|
var u2;
|
|
if (r2 === X && e2 === X)
|
|
return t2;
|
|
if (r2 !== X && (u2 = r2), e2 !== X) {
|
|
if (u2 === X)
|
|
return e2;
|
|
"string" == typeof r2 || "string" == typeof e2 ? (r2 = vu(r2), e2 = vu(e2)) : (r2 = _u(r2), e2 = _u(e2)), u2 = n2(r2, e2);
|
|
}
|
|
return u2;
|
|
};
|
|
}
|
|
function ti(t2) {
|
|
return gi(function(r2) {
|
|
return r2 = c(r2, z(mi())), uu(function(e2) {
|
|
var u2 = this;
|
|
return t2(r2, function(t3) {
|
|
return n(t3, u2, e2);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
function ri(n2, t2) {
|
|
t2 = t2 === X ? " " : vu(t2);
|
|
var r2 = t2.length;
|
|
if (r2 < 2)
|
|
return r2 ? eu(t2, n2) : t2;
|
|
var e2 = eu(t2, Fl(n2 / V(t2)));
|
|
return T(t2) ? Ou(G(e2), 0, n2).join("") : e2.slice(0, n2);
|
|
}
|
|
function ei(t2, r2, e2, u2) {
|
|
function i2() {
|
|
for (var r3 = -1, c2 = arguments.length, a2 = -1, l2 = u2.length, s2 = il(l2 + c2), h2 = this && this !== re && this instanceof i2 ? f2 : t2; ++a2 < l2; )
|
|
s2[a2] = u2[a2];
|
|
for (; c2--; )
|
|
s2[a2++] = arguments[++r3];
|
|
return n(h2, o2 ? e2 : this, s2);
|
|
}
|
|
var o2 = r2 & _n, f2 = Gu(t2);
|
|
return i2;
|
|
}
|
|
function ui(n2) {
|
|
return function(t2, r2, e2) {
|
|
return e2 && "number" != typeof e2 && Ui(t2, r2, e2) && (r2 = e2 = X), t2 = Ac(t2), r2 === X ? (r2 = t2, t2 = 0) : r2 = Ac(r2), e2 = e2 === X ? t2 < r2 ? 1 : -1 : Ac(e2), ru(t2, r2, e2, n2);
|
|
};
|
|
}
|
|
function ii(n2) {
|
|
return function(t2, r2) {
|
|
return "string" == typeof t2 && "string" == typeof r2 || (t2 = Ic(t2), r2 = Ic(r2)), n2(t2, r2);
|
|
};
|
|
}
|
|
function oi(n2, t2, r2, e2, u2, i2, o2, f2, c2, a2) {
|
|
var l2 = t2 & yn, s2 = l2 ? o2 : X, h2 = l2 ? X : o2, p3 = l2 ? i2 : X, _2 = l2 ? X : i2;
|
|
t2 |= l2 ? bn : wn, t2 &= ~(l2 ? wn : bn), t2 & gn || (t2 &= ~(_n | vn));
|
|
var v2 = [n2, t2, u2, p3, s2, _2, h2, f2, c2, a2], g2 = r2.apply(X, v2);
|
|
return $i(n2) && Ss(g2, v2), g2.placeholder = e2, Yi(g2, n2, t2);
|
|
}
|
|
function fi(n2) {
|
|
var t2 = al[n2];
|
|
return function(n3, r2) {
|
|
if (n3 = Ic(n3), r2 = null == r2 ? 0 : Hl(kc(r2), 292), r2 && Zl(n3)) {
|
|
var e2 = (Ec(n3) + "e").split("e");
|
|
return e2 = (Ec(t2(e2[0] + "e" + (+e2[1] + r2))) + "e").split("e"), +(e2[0] + "e" + (+e2[1] - r2));
|
|
}
|
|
return t2(n3);
|
|
};
|
|
}
|
|
function ci(n2) {
|
|
return function(t2) {
|
|
var r2 = zs(t2);
|
|
return r2 == Gn ? M(t2) : r2 == tt ? q(t2) : I(t2, n2(t2));
|
|
};
|
|
}
|
|
function ai(n2, t2, r2, e2, u2, i2, o2, f2) {
|
|
var c2 = t2 & vn;
|
|
if (!c2 && "function" != typeof n2)
|
|
throw new pl(en);
|
|
var a2 = e2 ? e2.length : 0;
|
|
if (a2 || (t2 &= ~(bn | wn), e2 = u2 = X), o2 = o2 === X ? o2 : Gl(kc(o2), 0), f2 = f2 === X ? f2 : kc(f2), a2 -= u2 ? u2.length : 0, t2 & wn) {
|
|
var l2 = e2, s2 = u2;
|
|
e2 = u2 = X;
|
|
}
|
|
var h2 = c2 ? X : Os(n2), p3 = [n2, t2, r2, e2, u2, l2, s2, i2, o2, f2];
|
|
if (h2 && qi(p3, h2), n2 = p3[0], t2 = p3[1], r2 = p3[2], e2 = p3[3], u2 = p3[4], f2 = p3[9] = p3[9] === X ? c2 ? 0 : n2.length : Gl(p3[9] - a2, 0), !f2 && t2 & (yn | dn) && (t2 &= ~(yn | dn)), t2 && t2 != _n)
|
|
_2 = t2 == yn || t2 == dn ? Hu(n2, t2, f2) : t2 != bn && t2 != (_n | bn) || u2.length ? Qu.apply(X, p3) : ei(n2, t2, r2, e2);
|
|
else
|
|
var _2 = Zu(n2, t2, r2);
|
|
return Yi((h2 ? ms : Ss)(_2, p3), n2, t2);
|
|
}
|
|
function li(n2, t2, r2, e2) {
|
|
return n2 === X || Gf(n2, gl[r2]) && !bl.call(e2, r2) ? t2 : n2;
|
|
}
|
|
function si(n2, t2, r2, e2, u2, i2) {
|
|
return fc(n2) && fc(t2) && (i2.set(t2, n2), Ke(n2, t2, X, si, i2), i2.delete(t2)), n2;
|
|
}
|
|
function hi(n2) {
|
|
return gc(n2) ? X : n2;
|
|
}
|
|
function pi(n2, t2, r2, e2, u2, i2) {
|
|
var o2 = r2 & hn, f2 = n2.length, c2 = t2.length;
|
|
if (f2 != c2 && !(o2 && c2 > f2))
|
|
return false;
|
|
var a2 = i2.get(n2), l2 = i2.get(t2);
|
|
if (a2 && l2)
|
|
return a2 == t2 && l2 == n2;
|
|
var s2 = -1, p3 = true, _2 = r2 & pn ? new yr2() : X;
|
|
for (i2.set(n2, t2), i2.set(t2, n2); ++s2 < f2; ) {
|
|
var v2 = n2[s2], g2 = t2[s2];
|
|
if (e2)
|
|
var y2 = o2 ? e2(g2, v2, s2, t2, n2, i2) : e2(v2, g2, s2, n2, t2, i2);
|
|
if (y2 !== X) {
|
|
if (y2)
|
|
continue;
|
|
p3 = false;
|
|
break;
|
|
}
|
|
if (_2) {
|
|
if (!h(t2, function(n3, t3) {
|
|
if (!S(_2, t3) && (v2 === n3 || u2(v2, n3, r2, e2, i2)))
|
|
return _2.push(t3);
|
|
})) {
|
|
p3 = false;
|
|
break;
|
|
}
|
|
} else if (v2 !== g2 && !u2(v2, g2, r2, e2, i2)) {
|
|
p3 = false;
|
|
break;
|
|
}
|
|
}
|
|
return i2.delete(n2), i2.delete(t2), p3;
|
|
}
|
|
function _i(n2, t2, r2, e2, u2, i2, o2) {
|
|
switch (r2) {
|
|
case ct:
|
|
if (n2.byteLength != t2.byteLength || n2.byteOffset != t2.byteOffset)
|
|
return false;
|
|
n2 = n2.buffer, t2 = t2.buffer;
|
|
case ft:
|
|
return !(n2.byteLength != t2.byteLength || !i2(new Rl(n2), new Rl(t2)));
|
|
case Nn:
|
|
case Pn:
|
|
case Hn:
|
|
return Gf(+n2, +t2);
|
|
case Zn:
|
|
return n2.name == t2.name && n2.message == t2.message;
|
|
case nt:
|
|
case rt:
|
|
return n2 == t2 + "";
|
|
case Gn:
|
|
var f2 = M;
|
|
case tt:
|
|
var c2 = e2 & hn;
|
|
if (f2 || (f2 = P), n2.size != t2.size && !c2)
|
|
return false;
|
|
var a2 = o2.get(n2);
|
|
if (a2)
|
|
return a2 == t2;
|
|
e2 |= pn, o2.set(n2, t2);
|
|
var l2 = pi(f2(n2), f2(t2), e2, u2, i2, o2);
|
|
return o2.delete(n2), l2;
|
|
case et:
|
|
if (_s)
|
|
return _s.call(n2) == _s.call(t2);
|
|
}
|
|
return false;
|
|
}
|
|
function vi(n2, t2, r2, e2, u2, i2) {
|
|
var o2 = r2 & hn, f2 = yi(n2), c2 = f2.length;
|
|
if (c2 != yi(t2).length && !o2)
|
|
return false;
|
|
for (var a2 = c2; a2--; ) {
|
|
var l2 = f2[a2];
|
|
if (!(o2 ? l2 in t2 : bl.call(t2, l2)))
|
|
return false;
|
|
}
|
|
var s2 = i2.get(n2), h2 = i2.get(t2);
|
|
if (s2 && h2)
|
|
return s2 == t2 && h2 == n2;
|
|
var p3 = true;
|
|
i2.set(n2, t2), i2.set(t2, n2);
|
|
for (var _2 = o2; ++a2 < c2; ) {
|
|
l2 = f2[a2];
|
|
var v2 = n2[l2], g2 = t2[l2];
|
|
if (e2)
|
|
var y2 = o2 ? e2(g2, v2, l2, t2, n2, i2) : e2(v2, g2, l2, n2, t2, i2);
|
|
if (!(y2 === X ? v2 === g2 || u2(v2, g2, r2, e2, i2) : y2)) {
|
|
p3 = false;
|
|
break;
|
|
}
|
|
_2 || (_2 = "constructor" == l2);
|
|
}
|
|
if (p3 && !_2) {
|
|
var d2 = n2.constructor, b2 = t2.constructor;
|
|
d2 != b2 && "constructor" in n2 && "constructor" in t2 && !("function" == typeof d2 && d2 instanceof d2 && "function" == typeof b2 && b2 instanceof b2) && (p3 = false);
|
|
}
|
|
return i2.delete(n2), i2.delete(t2), p3;
|
|
}
|
|
function gi(n2) {
|
|
return Ls(Vi(n2, X, _o), n2 + "");
|
|
}
|
|
function yi(n2) {
|
|
return de2(n2, Pc, Is);
|
|
}
|
|
function di(n2) {
|
|
return de2(n2, qc, Rs);
|
|
}
|
|
function bi(n2) {
|
|
for (var t2 = n2.name + "", r2 = fs[t2], e2 = bl.call(fs, t2) ? r2.length : 0; e2--; ) {
|
|
var u2 = r2[e2], i2 = u2.func;
|
|
if (null == i2 || i2 == n2)
|
|
return u2.name;
|
|
}
|
|
return t2;
|
|
}
|
|
function wi(n2) {
|
|
return (bl.call(Z2, "placeholder") ? Z2 : n2).placeholder;
|
|
}
|
|
function mi() {
|
|
var n2 = Z2.iteratee || Ca;
|
|
return n2 = n2 === Ca ? De : n2, arguments.length ? n2(arguments[0], arguments[1]) : n2;
|
|
}
|
|
function xi(n2, t2) {
|
|
var r2 = n2.__data__;
|
|
return Ti(t2) ? r2["string" == typeof t2 ? "string" : "hash"] : r2.map;
|
|
}
|
|
function ji(n2) {
|
|
for (var t2 = Pc(n2), r2 = t2.length; r2--; ) {
|
|
var e2 = t2[r2], u2 = n2[e2];
|
|
t2[r2] = [e2, u2, Fi(u2)];
|
|
}
|
|
return t2;
|
|
}
|
|
function Ai(n2, t2) {
|
|
var r2 = B(n2, t2);
|
|
return Ue(r2) ? r2 : X;
|
|
}
|
|
function ki(n2) {
|
|
var t2 = bl.call(n2, Bl), r2 = n2[Bl];
|
|
try {
|
|
n2[Bl] = X;
|
|
var e2 = true;
|
|
} catch (n3) {
|
|
}
|
|
var u2 = xl.call(n2);
|
|
return e2 && (t2 ? n2[Bl] = r2 : delete n2[Bl]), u2;
|
|
}
|
|
function Oi(n2, t2, r2) {
|
|
for (var e2 = -1, u2 = r2.length; ++e2 < u2; ) {
|
|
var i2 = r2[e2], o2 = i2.size;
|
|
switch (i2.type) {
|
|
case "drop":
|
|
n2 += o2;
|
|
break;
|
|
case "dropRight":
|
|
t2 -= o2;
|
|
break;
|
|
case "take":
|
|
t2 = Hl(t2, n2 + o2);
|
|
break;
|
|
case "takeRight":
|
|
n2 = Gl(n2, t2 - o2);
|
|
}
|
|
}
|
|
return { start: n2, end: t2 };
|
|
}
|
|
function Ii(n2) {
|
|
var t2 = n2.match(Bt);
|
|
return t2 ? t2[1].split(Tt) : [];
|
|
}
|
|
function Ri(n2, t2, r2) {
|
|
t2 = ku(t2, n2);
|
|
for (var e2 = -1, u2 = t2.length, i2 = false; ++e2 < u2; ) {
|
|
var o2 = no(t2[e2]);
|
|
if (!(i2 = null != n2 && r2(n2, o2)))
|
|
break;
|
|
n2 = n2[o2];
|
|
}
|
|
return i2 || ++e2 != u2 ? i2 : (u2 = null == n2 ? 0 : n2.length, !!u2 && oc(u2) && Ci(o2, u2) && (bh(n2) || dh(n2)));
|
|
}
|
|
function zi(n2) {
|
|
var t2 = n2.length, r2 = new n2.constructor(t2);
|
|
return t2 && "string" == typeof n2[0] && bl.call(n2, "index") && (r2.index = n2.index, r2.input = n2.input), r2;
|
|
}
|
|
function Ei(n2) {
|
|
return "function" != typeof n2.constructor || Mi(n2) ? {} : gs(El(n2));
|
|
}
|
|
function Si(n2, t2, r2) {
|
|
var e2 = n2.constructor;
|
|
switch (t2) {
|
|
case ft:
|
|
return Ru(n2);
|
|
case Nn:
|
|
case Pn:
|
|
return new e2(+n2);
|
|
case ct:
|
|
return zu(n2, r2);
|
|
case at:
|
|
case lt:
|
|
case st:
|
|
case ht:
|
|
case pt:
|
|
case _t:
|
|
case vt:
|
|
case gt:
|
|
case yt:
|
|
return Wu(n2, r2);
|
|
case Gn:
|
|
return new e2();
|
|
case Hn:
|
|
case rt:
|
|
return new e2(n2);
|
|
case nt:
|
|
return Eu(n2);
|
|
case tt:
|
|
return new e2();
|
|
case et:
|
|
return Su(n2);
|
|
}
|
|
}
|
|
function Wi(n2, t2) {
|
|
var r2 = t2.length;
|
|
if (!r2)
|
|
return n2;
|
|
var e2 = r2 - 1;
|
|
return t2[e2] = (r2 > 1 ? "& " : "") + t2[e2], t2 = t2.join(r2 > 2 ? ", " : " "), n2.replace(Ut, "{\n/* [wrapped with " + t2 + "] */\n");
|
|
}
|
|
function Li(n2) {
|
|
return bh(n2) || dh(n2) || !!(Cl && n2 && n2[Cl]);
|
|
}
|
|
function Ci(n2, t2) {
|
|
var r2 = typeof n2;
|
|
return t2 = null == t2 ? Wn : t2, !!t2 && ("number" == r2 || "symbol" != r2 && Vt.test(n2)) && n2 > -1 && n2 % 1 == 0 && n2 < t2;
|
|
}
|
|
function Ui(n2, t2, r2) {
|
|
if (!fc(r2))
|
|
return false;
|
|
var e2 = typeof t2;
|
|
return !!("number" == e2 ? Hf(r2) && Ci(t2, r2.length) : "string" == e2 && t2 in r2) && Gf(r2[t2], n2);
|
|
}
|
|
function Bi(n2, t2) {
|
|
if (bh(n2))
|
|
return false;
|
|
var r2 = typeof n2;
|
|
return !("number" != r2 && "symbol" != r2 && "boolean" != r2 && null != n2 && !bc(n2)) || (zt.test(n2) || !Rt.test(n2) || null != t2 && n2 in ll(t2));
|
|
}
|
|
function Ti(n2) {
|
|
var t2 = typeof n2;
|
|
return "string" == t2 || "number" == t2 || "symbol" == t2 || "boolean" == t2 ? "__proto__" !== n2 : null === n2;
|
|
}
|
|
function $i(n2) {
|
|
var t2 = bi(n2), r2 = Z2[t2];
|
|
if ("function" != typeof r2 || !(t2 in Ct2.prototype))
|
|
return false;
|
|
if (n2 === r2)
|
|
return true;
|
|
var e2 = Os(r2);
|
|
return !!e2 && n2 === e2[0];
|
|
}
|
|
function Di(n2) {
|
|
return !!ml && ml in n2;
|
|
}
|
|
function Mi(n2) {
|
|
var t2 = n2 && n2.constructor;
|
|
return n2 === ("function" == typeof t2 && t2.prototype || gl);
|
|
}
|
|
function Fi(n2) {
|
|
return n2 === n2 && !fc(n2);
|
|
}
|
|
function Ni(n2, t2) {
|
|
return function(r2) {
|
|
return null != r2 && (r2[n2] === t2 && (t2 !== X || n2 in ll(r2)));
|
|
};
|
|
}
|
|
function Pi(n2) {
|
|
var t2 = Cf(n2, function(n3) {
|
|
return r2.size === fn && r2.clear(), n3;
|
|
}), r2 = t2.cache;
|
|
return t2;
|
|
}
|
|
function qi(n2, t2) {
|
|
var r2 = n2[1], e2 = t2[1], u2 = r2 | e2, i2 = u2 < (_n | vn | mn), o2 = e2 == mn && r2 == yn || e2 == mn && r2 == xn && n2[7].length <= t2[8] || e2 == (mn | xn) && t2[7].length <= t2[8] && r2 == yn;
|
|
if (!i2 && !o2)
|
|
return n2;
|
|
e2 & _n && (n2[2] = t2[2], u2 |= r2 & _n ? 0 : gn);
|
|
var f2 = t2[3];
|
|
if (f2) {
|
|
var c2 = n2[3];
|
|
n2[3] = c2 ? Uu(c2, f2, t2[4]) : f2, n2[4] = c2 ? N(n2[3], cn) : t2[4];
|
|
}
|
|
return f2 = t2[5], f2 && (c2 = n2[5], n2[5] = c2 ? Bu(c2, f2, t2[6]) : f2, n2[6] = c2 ? N(n2[5], cn) : t2[6]), f2 = t2[7], f2 && (n2[7] = f2), e2 & mn && (n2[8] = null == n2[8] ? t2[8] : Hl(n2[8], t2[8])), null == n2[9] && (n2[9] = t2[9]), n2[0] = t2[0], n2[1] = u2, n2;
|
|
}
|
|
function Zi(n2) {
|
|
var t2 = [];
|
|
if (null != n2)
|
|
for (var r2 in ll(n2))
|
|
t2.push(r2);
|
|
return t2;
|
|
}
|
|
function Ki(n2) {
|
|
return xl.call(n2);
|
|
}
|
|
function Vi(t2, r2, e2) {
|
|
return r2 = Gl(r2 === X ? t2.length - 1 : r2, 0), function() {
|
|
for (var u2 = arguments, i2 = -1, o2 = Gl(u2.length - r2, 0), f2 = il(o2); ++i2 < o2; )
|
|
f2[i2] = u2[r2 + i2];
|
|
i2 = -1;
|
|
for (var c2 = il(r2 + 1); ++i2 < r2; )
|
|
c2[i2] = u2[i2];
|
|
return c2[r2] = e2(f2), n(t2, this, c2);
|
|
};
|
|
}
|
|
function Gi(n2, t2) {
|
|
return t2.length < 2 ? n2 : _e2(n2, au(t2, 0, -1));
|
|
}
|
|
function Hi(n2, t2) {
|
|
for (var r2 = n2.length, e2 = Hl(t2.length, r2), u2 = Tu(n2); e2--; ) {
|
|
var i2 = t2[e2];
|
|
n2[e2] = Ci(i2, r2) ? u2[i2] : X;
|
|
}
|
|
return n2;
|
|
}
|
|
function Ji(n2, t2) {
|
|
if (("constructor" !== t2 || "function" != typeof n2[t2]) && "__proto__" != t2)
|
|
return n2[t2];
|
|
}
|
|
function Yi(n2, t2, r2) {
|
|
var e2 = t2 + "";
|
|
return Ls(n2, Wi(e2, ro(Ii(e2), r2)));
|
|
}
|
|
function Qi(n2) {
|
|
var t2 = 0, r2 = 0;
|
|
return function() {
|
|
var e2 = Jl(), u2 = In - (e2 - r2);
|
|
if (r2 = e2, u2 > 0) {
|
|
if (++t2 >= On)
|
|
return arguments[0];
|
|
} else
|
|
t2 = 0;
|
|
return n2.apply(X, arguments);
|
|
};
|
|
}
|
|
function Xi(n2, t2) {
|
|
var r2 = -1, e2 = n2.length, u2 = e2 - 1;
|
|
for (t2 = t2 === X ? e2 : t2; ++r2 < t2; ) {
|
|
var i2 = tu(r2, u2), o2 = n2[i2];
|
|
n2[i2] = n2[r2], n2[r2] = o2;
|
|
}
|
|
return n2.length = t2, n2;
|
|
}
|
|
function no(n2) {
|
|
if ("string" == typeof n2 || bc(n2))
|
|
return n2;
|
|
var t2 = n2 + "";
|
|
return "0" == t2 && 1 / n2 == -Sn ? "-0" : t2;
|
|
}
|
|
function to(n2) {
|
|
if (null != n2) {
|
|
try {
|
|
return dl.call(n2);
|
|
} catch (n3) {
|
|
}
|
|
try {
|
|
return n2 + "";
|
|
} catch (n3) {
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
function ro(n2, t2) {
|
|
return r($n, function(r2) {
|
|
var e2 = "_." + r2[0];
|
|
t2 & r2[1] && !o(n2, e2) && n2.push(e2);
|
|
}), n2.sort();
|
|
}
|
|
function eo(n2) {
|
|
if (n2 instanceof Ct2)
|
|
return n2.clone();
|
|
var t2 = new Y2(n2.__wrapped__, n2.__chain__);
|
|
return t2.__actions__ = Tu(n2.__actions__), t2.__index__ = n2.__index__, t2.__values__ = n2.__values__, t2;
|
|
}
|
|
function uo(n2, t2, r2) {
|
|
t2 = (r2 ? Ui(n2, t2, r2) : t2 === X) ? 1 : Gl(kc(t2), 0);
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
if (!e2 || t2 < 1)
|
|
return [];
|
|
for (var u2 = 0, i2 = 0, o2 = il(Fl(e2 / t2)); u2 < e2; )
|
|
o2[i2++] = au(n2, u2, u2 += t2);
|
|
return o2;
|
|
}
|
|
function io(n2) {
|
|
for (var t2 = -1, r2 = null == n2 ? 0 : n2.length, e2 = 0, u2 = []; ++t2 < r2; ) {
|
|
var i2 = n2[t2];
|
|
i2 && (u2[e2++] = i2);
|
|
}
|
|
return u2;
|
|
}
|
|
function oo() {
|
|
var n2 = arguments.length;
|
|
if (!n2)
|
|
return [];
|
|
for (var t2 = il(n2 - 1), r2 = arguments[0], e2 = n2; e2--; )
|
|
t2[e2 - 1] = arguments[e2];
|
|
return a(bh(r2) ? Tu(r2) : [r2], ee2(t2, 1));
|
|
}
|
|
function fo(n2, t2, r2) {
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
return e2 ? (t2 = r2 || t2 === X ? 1 : kc(t2), au(n2, t2 < 0 ? 0 : t2, e2)) : [];
|
|
}
|
|
function co(n2, t2, r2) {
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
return e2 ? (t2 = r2 || t2 === X ? 1 : kc(t2), t2 = e2 - t2, au(n2, 0, t2 < 0 ? 0 : t2)) : [];
|
|
}
|
|
function ao(n2, t2) {
|
|
return n2 && n2.length ? bu(n2, mi(t2, 3), true, true) : [];
|
|
}
|
|
function lo(n2, t2) {
|
|
return n2 && n2.length ? bu(n2, mi(t2, 3), true) : [];
|
|
}
|
|
function so(n2, t2, r2, e2) {
|
|
var u2 = null == n2 ? 0 : n2.length;
|
|
return u2 ? (r2 && "number" != typeof r2 && Ui(n2, t2, r2) && (r2 = 0, e2 = u2), ne2(n2, t2, r2, e2)) : [];
|
|
}
|
|
function ho(n2, t2, r2) {
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
if (!e2)
|
|
return -1;
|
|
var u2 = null == r2 ? 0 : kc(r2);
|
|
return u2 < 0 && (u2 = Gl(e2 + u2, 0)), g(n2, mi(t2, 3), u2);
|
|
}
|
|
function po(n2, t2, r2) {
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
if (!e2)
|
|
return -1;
|
|
var u2 = e2 - 1;
|
|
return r2 !== X && (u2 = kc(r2), u2 = r2 < 0 ? Gl(e2 + u2, 0) : Hl(u2, e2 - 1)), g(n2, mi(t2, 3), u2, true);
|
|
}
|
|
function _o(n2) {
|
|
return (null == n2 ? 0 : n2.length) ? ee2(n2, 1) : [];
|
|
}
|
|
function vo(n2) {
|
|
return (null == n2 ? 0 : n2.length) ? ee2(n2, Sn) : [];
|
|
}
|
|
function go(n2, t2) {
|
|
return (null == n2 ? 0 : n2.length) ? (t2 = t2 === X ? 1 : kc(t2), ee2(n2, t2)) : [];
|
|
}
|
|
function yo(n2) {
|
|
for (var t2 = -1, r2 = null == n2 ? 0 : n2.length, e2 = {}; ++t2 < r2; ) {
|
|
var u2 = n2[t2];
|
|
e2[u2[0]] = u2[1];
|
|
}
|
|
return e2;
|
|
}
|
|
function bo(n2) {
|
|
return n2 && n2.length ? n2[0] : X;
|
|
}
|
|
function wo(n2, t2, r2) {
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
if (!e2)
|
|
return -1;
|
|
var u2 = null == r2 ? 0 : kc(r2);
|
|
return u2 < 0 && (u2 = Gl(e2 + u2, 0)), y(n2, t2, u2);
|
|
}
|
|
function mo(n2) {
|
|
return (null == n2 ? 0 : n2.length) ? au(n2, 0, -1) : [];
|
|
}
|
|
function xo(n2, t2) {
|
|
return null == n2 ? "" : Kl.call(n2, t2);
|
|
}
|
|
function jo(n2) {
|
|
var t2 = null == n2 ? 0 : n2.length;
|
|
return t2 ? n2[t2 - 1] : X;
|
|
}
|
|
function Ao(n2, t2, r2) {
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
if (!e2)
|
|
return -1;
|
|
var u2 = e2;
|
|
return r2 !== X && (u2 = kc(r2), u2 = u2 < 0 ? Gl(e2 + u2, 0) : Hl(u2, e2 - 1)), t2 === t2 ? K(n2, t2, u2) : g(n2, b, u2, true);
|
|
}
|
|
function ko(n2, t2) {
|
|
return n2 && n2.length ? Ge(n2, kc(t2)) : X;
|
|
}
|
|
function Oo(n2, t2) {
|
|
return n2 && n2.length && t2 && t2.length ? Xe(n2, t2) : n2;
|
|
}
|
|
function Io(n2, t2, r2) {
|
|
return n2 && n2.length && t2 && t2.length ? Xe(n2, t2, mi(r2, 2)) : n2;
|
|
}
|
|
function Ro(n2, t2, r2) {
|
|
return n2 && n2.length && t2 && t2.length ? Xe(n2, t2, X, r2) : n2;
|
|
}
|
|
function zo(n2, t2) {
|
|
var r2 = [];
|
|
if (!n2 || !n2.length)
|
|
return r2;
|
|
var e2 = -1, u2 = [], i2 = n2.length;
|
|
for (t2 = mi(t2, 3); ++e2 < i2; ) {
|
|
var o2 = n2[e2];
|
|
t2(o2, e2, n2) && (r2.push(o2), u2.push(e2));
|
|
}
|
|
return nu(n2, u2), r2;
|
|
}
|
|
function Eo(n2) {
|
|
return null == n2 ? n2 : Xl.call(n2);
|
|
}
|
|
function So(n2, t2, r2) {
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
return e2 ? (r2 && "number" != typeof r2 && Ui(n2, t2, r2) ? (t2 = 0, r2 = e2) : (t2 = null == t2 ? 0 : kc(t2), r2 = r2 === X ? e2 : kc(r2)), au(n2, t2, r2)) : [];
|
|
}
|
|
function Wo(n2, t2) {
|
|
return su(n2, t2);
|
|
}
|
|
function Lo(n2, t2, r2) {
|
|
return hu(n2, t2, mi(r2, 2));
|
|
}
|
|
function Co(n2, t2) {
|
|
var r2 = null == n2 ? 0 : n2.length;
|
|
if (r2) {
|
|
var e2 = su(n2, t2);
|
|
if (e2 < r2 && Gf(n2[e2], t2))
|
|
return e2;
|
|
}
|
|
return -1;
|
|
}
|
|
function Uo(n2, t2) {
|
|
return su(n2, t2, true);
|
|
}
|
|
function Bo(n2, t2, r2) {
|
|
return hu(n2, t2, mi(r2, 2), true);
|
|
}
|
|
function To(n2, t2) {
|
|
if (null == n2 ? 0 : n2.length) {
|
|
var r2 = su(n2, t2, true) - 1;
|
|
if (Gf(n2[r2], t2))
|
|
return r2;
|
|
}
|
|
return -1;
|
|
}
|
|
function $o(n2) {
|
|
return n2 && n2.length ? pu(n2) : [];
|
|
}
|
|
function Do(n2, t2) {
|
|
return n2 && n2.length ? pu(n2, mi(t2, 2)) : [];
|
|
}
|
|
function Mo(n2) {
|
|
var t2 = null == n2 ? 0 : n2.length;
|
|
return t2 ? au(n2, 1, t2) : [];
|
|
}
|
|
function Fo(n2, t2, r2) {
|
|
return n2 && n2.length ? (t2 = r2 || t2 === X ? 1 : kc(t2), au(n2, 0, t2 < 0 ? 0 : t2)) : [];
|
|
}
|
|
function No(n2, t2, r2) {
|
|
var e2 = null == n2 ? 0 : n2.length;
|
|
return e2 ? (t2 = r2 || t2 === X ? 1 : kc(t2), t2 = e2 - t2, au(n2, t2 < 0 ? 0 : t2, e2)) : [];
|
|
}
|
|
function Po(n2, t2) {
|
|
return n2 && n2.length ? bu(n2, mi(t2, 3), false, true) : [];
|
|
}
|
|
function qo(n2, t2) {
|
|
return n2 && n2.length ? bu(n2, mi(t2, 3)) : [];
|
|
}
|
|
function Zo(n2) {
|
|
return n2 && n2.length ? gu(n2) : [];
|
|
}
|
|
function Ko(n2, t2) {
|
|
return n2 && n2.length ? gu(n2, mi(t2, 2)) : [];
|
|
}
|
|
function Vo(n2, t2) {
|
|
return t2 = "function" == typeof t2 ? t2 : X, n2 && n2.length ? gu(n2, X, t2) : [];
|
|
}
|
|
function Go(n2) {
|
|
if (!n2 || !n2.length)
|
|
return [];
|
|
var t2 = 0;
|
|
return n2 = i(n2, function(n3) {
|
|
if (Jf(n3))
|
|
return t2 = Gl(n3.length, t2), true;
|
|
}), O(t2, function(t3) {
|
|
return c(n2, m(t3));
|
|
});
|
|
}
|
|
function Ho(t2, r2) {
|
|
if (!t2 || !t2.length)
|
|
return [];
|
|
var e2 = Go(t2);
|
|
return null == r2 ? e2 : c(e2, function(t3) {
|
|
return n(r2, X, t3);
|
|
});
|
|
}
|
|
function Jo(n2, t2) {
|
|
return xu(n2 || [], t2 || [], Sr2);
|
|
}
|
|
function Yo(n2, t2) {
|
|
return xu(n2 || [], t2 || [], fu);
|
|
}
|
|
function Qo(n2) {
|
|
var t2 = Z2(n2);
|
|
return t2.__chain__ = true, t2;
|
|
}
|
|
function Xo(n2, t2) {
|
|
return t2(n2), n2;
|
|
}
|
|
function nf(n2, t2) {
|
|
return t2(n2);
|
|
}
|
|
function tf() {
|
|
return Qo(this);
|
|
}
|
|
function rf() {
|
|
return new Y2(this.value(), this.__chain__);
|
|
}
|
|
function ef() {
|
|
this.__values__ === X && (this.__values__ = jc(this.value()));
|
|
var n2 = this.__index__ >= this.__values__.length;
|
|
return { done: n2, value: n2 ? X : this.__values__[this.__index__++] };
|
|
}
|
|
function uf() {
|
|
return this;
|
|
}
|
|
function of(n2) {
|
|
for (var t2, r2 = this; r2 instanceof J2; ) {
|
|
var e2 = eo(r2);
|
|
e2.__index__ = 0, e2.__values__ = X, t2 ? u2.__wrapped__ = e2 : t2 = e2;
|
|
var u2 = e2;
|
|
r2 = r2.__wrapped__;
|
|
}
|
|
return u2.__wrapped__ = n2, t2;
|
|
}
|
|
function ff() {
|
|
var n2 = this.__wrapped__;
|
|
if (n2 instanceof Ct2) {
|
|
var t2 = n2;
|
|
return this.__actions__.length && (t2 = new Ct2(this)), t2 = t2.reverse(), t2.__actions__.push({ func: nf, args: [Eo], thisArg: X }), new Y2(t2, this.__chain__);
|
|
}
|
|
return this.thru(Eo);
|
|
}
|
|
function cf() {
|
|
return wu(this.__wrapped__, this.__actions__);
|
|
}
|
|
function af(n2, t2, r2) {
|
|
var e2 = bh(n2) ? u : Jr2;
|
|
return r2 && Ui(n2, t2, r2) && (t2 = X), e2(n2, mi(t2, 3));
|
|
}
|
|
function lf(n2, t2) {
|
|
return (bh(n2) ? i : te2)(n2, mi(t2, 3));
|
|
}
|
|
function sf(n2, t2) {
|
|
return ee2(yf(n2, t2), 1);
|
|
}
|
|
function hf(n2, t2) {
|
|
return ee2(yf(n2, t2), Sn);
|
|
}
|
|
function pf(n2, t2, r2) {
|
|
return r2 = r2 === X ? 1 : kc(r2), ee2(yf(n2, t2), r2);
|
|
}
|
|
function _f(n2, t2) {
|
|
return (bh(n2) ? r : ys)(n2, mi(t2, 3));
|
|
}
|
|
function vf(n2, t2) {
|
|
return (bh(n2) ? e : ds)(n2, mi(t2, 3));
|
|
}
|
|
function gf(n2, t2, r2, e2) {
|
|
n2 = Hf(n2) ? n2 : ra(n2), r2 = r2 && !e2 ? kc(r2) : 0;
|
|
var u2 = n2.length;
|
|
return r2 < 0 && (r2 = Gl(u2 + r2, 0)), dc(n2) ? r2 <= u2 && n2.indexOf(t2, r2) > -1 : !!u2 && y(n2, t2, r2) > -1;
|
|
}
|
|
function yf(n2, t2) {
|
|
return (bh(n2) ? c : Pe)(n2, mi(t2, 3));
|
|
}
|
|
function df(n2, t2, r2, e2) {
|
|
return null == n2 ? [] : (bh(t2) || (t2 = null == t2 ? [] : [t2]), r2 = e2 ? X : r2, bh(r2) || (r2 = null == r2 ? [] : [r2]), He(n2, t2, r2));
|
|
}
|
|
function bf(n2, t2, r2) {
|
|
var e2 = bh(n2) ? l : j, u2 = arguments.length < 3;
|
|
return e2(n2, mi(t2, 4), r2, u2, ys);
|
|
}
|
|
function wf(n2, t2, r2) {
|
|
var e2 = bh(n2) ? s : j, u2 = arguments.length < 3;
|
|
return e2(n2, mi(t2, 4), r2, u2, ds);
|
|
}
|
|
function mf(n2, t2) {
|
|
return (bh(n2) ? i : te2)(n2, Uf(mi(t2, 3)));
|
|
}
|
|
function xf(n2) {
|
|
return (bh(n2) ? Ir2 : iu)(n2);
|
|
}
|
|
function jf(n2, t2, r2) {
|
|
return t2 = (r2 ? Ui(n2, t2, r2) : t2 === X) ? 1 : kc(t2), (bh(n2) ? Rr2 : ou)(n2, t2);
|
|
}
|
|
function Af(n2) {
|
|
return (bh(n2) ? zr2 : cu)(n2);
|
|
}
|
|
function kf(n2) {
|
|
if (null == n2)
|
|
return 0;
|
|
if (Hf(n2))
|
|
return dc(n2) ? V(n2) : n2.length;
|
|
var t2 = zs(n2);
|
|
return t2 == Gn || t2 == tt ? n2.size : Me(n2).length;
|
|
}
|
|
function Of(n2, t2, r2) {
|
|
var e2 = bh(n2) ? h : lu;
|
|
return r2 && Ui(n2, t2, r2) && (t2 = X), e2(n2, mi(t2, 3));
|
|
}
|
|
function If(n2, t2) {
|
|
if ("function" != typeof t2)
|
|
throw new pl(en);
|
|
return n2 = kc(n2), function() {
|
|
if (--n2 < 1)
|
|
return t2.apply(this, arguments);
|
|
};
|
|
}
|
|
function Rf(n2, t2, r2) {
|
|
return t2 = r2 ? X : t2, t2 = n2 && null == t2 ? n2.length : t2, ai(n2, mn, X, X, X, X, t2);
|
|
}
|
|
function zf(n2, t2) {
|
|
var r2;
|
|
if ("function" != typeof t2)
|
|
throw new pl(en);
|
|
return n2 = kc(n2), function() {
|
|
return --n2 > 0 && (r2 = t2.apply(this, arguments)), n2 <= 1 && (t2 = X), r2;
|
|
};
|
|
}
|
|
function Ef(n2, t2, r2) {
|
|
t2 = r2 ? X : t2;
|
|
var e2 = ai(n2, yn, X, X, X, X, X, t2);
|
|
return e2.placeholder = Ef.placeholder, e2;
|
|
}
|
|
function Sf(n2, t2, r2) {
|
|
t2 = r2 ? X : t2;
|
|
var e2 = ai(n2, dn, X, X, X, X, X, t2);
|
|
return e2.placeholder = Sf.placeholder, e2;
|
|
}
|
|
function Wf(n2, t2, r2) {
|
|
function e2(t3) {
|
|
var r3 = h2, e3 = p3;
|
|
return h2 = p3 = X, d2 = t3, v2 = n2.apply(e3, r3);
|
|
}
|
|
function u2(n3) {
|
|
return d2 = n3, g2 = Ws(f2, t2), b2 ? e2(n3) : v2;
|
|
}
|
|
function i2(n3) {
|
|
var r3 = n3 - y2, e3 = n3 - d2, u3 = t2 - r3;
|
|
return w2 ? Hl(u3, _2 - e3) : u3;
|
|
}
|
|
function o2(n3) {
|
|
var r3 = n3 - y2, e3 = n3 - d2;
|
|
return y2 === X || r3 >= t2 || r3 < 0 || w2 && e3 >= _2;
|
|
}
|
|
function f2() {
|
|
var n3 = fh();
|
|
return o2(n3) ? c2(n3) : (g2 = Ws(f2, i2(n3)), X);
|
|
}
|
|
function c2(n3) {
|
|
return g2 = X, m2 && h2 ? e2(n3) : (h2 = p3 = X, v2);
|
|
}
|
|
function a2() {
|
|
g2 !== X && As(g2), d2 = 0, h2 = y2 = p3 = g2 = X;
|
|
}
|
|
function l2() {
|
|
return g2 === X ? v2 : c2(fh());
|
|
}
|
|
function s2() {
|
|
var n3 = fh(), r3 = o2(n3);
|
|
if (h2 = arguments, p3 = this, y2 = n3, r3) {
|
|
if (g2 === X)
|
|
return u2(y2);
|
|
if (w2)
|
|
return As(g2), g2 = Ws(f2, t2), e2(y2);
|
|
}
|
|
return g2 === X && (g2 = Ws(f2, t2)), v2;
|
|
}
|
|
var h2, p3, _2, v2, g2, y2, d2 = 0, b2 = false, w2 = false, m2 = true;
|
|
if ("function" != typeof n2)
|
|
throw new pl(en);
|
|
return t2 = Ic(t2) || 0, fc(r2) && (b2 = !!r2.leading, w2 = "maxWait" in r2, _2 = w2 ? Gl(Ic(r2.maxWait) || 0, t2) : _2, m2 = "trailing" in r2 ? !!r2.trailing : m2), s2.cancel = a2, s2.flush = l2, s2;
|
|
}
|
|
function Lf(n2) {
|
|
return ai(n2, jn);
|
|
}
|
|
function Cf(n2, t2) {
|
|
if ("function" != typeof n2 || null != t2 && "function" != typeof t2)
|
|
throw new pl(en);
|
|
var r2 = function() {
|
|
var e2 = arguments, u2 = t2 ? t2.apply(this, e2) : e2[0], i2 = r2.cache;
|
|
if (i2.has(u2))
|
|
return i2.get(u2);
|
|
var o2 = n2.apply(this, e2);
|
|
return r2.cache = i2.set(u2, o2) || i2, o2;
|
|
};
|
|
return r2.cache = new (Cf.Cache || sr2)(), r2;
|
|
}
|
|
function Uf(n2) {
|
|
if ("function" != typeof n2)
|
|
throw new pl(en);
|
|
return function() {
|
|
var t2 = arguments;
|
|
switch (t2.length) {
|
|
case 0:
|
|
return !n2.call(this);
|
|
case 1:
|
|
return !n2.call(this, t2[0]);
|
|
case 2:
|
|
return !n2.call(this, t2[0], t2[1]);
|
|
case 3:
|
|
return !n2.call(this, t2[0], t2[1], t2[2]);
|
|
}
|
|
return !n2.apply(this, t2);
|
|
};
|
|
}
|
|
function Bf(n2) {
|
|
return zf(2, n2);
|
|
}
|
|
function Tf(n2, t2) {
|
|
if ("function" != typeof n2)
|
|
throw new pl(en);
|
|
return t2 = t2 === X ? t2 : kc(t2), uu(n2, t2);
|
|
}
|
|
function $f(t2, r2) {
|
|
if ("function" != typeof t2)
|
|
throw new pl(en);
|
|
return r2 = null == r2 ? 0 : Gl(kc(r2), 0), uu(function(e2) {
|
|
var u2 = e2[r2], i2 = Ou(e2, 0, r2);
|
|
return u2 && a(i2, u2), n(t2, this, i2);
|
|
});
|
|
}
|
|
function Df(n2, t2, r2) {
|
|
var e2 = true, u2 = true;
|
|
if ("function" != typeof n2)
|
|
throw new pl(en);
|
|
return fc(r2) && (e2 = "leading" in r2 ? !!r2.leading : e2, u2 = "trailing" in r2 ? !!r2.trailing : u2), Wf(n2, t2, { leading: e2, maxWait: t2, trailing: u2 });
|
|
}
|
|
function Mf(n2) {
|
|
return Rf(n2, 1);
|
|
}
|
|
function Ff(n2, t2) {
|
|
return ph(Au(t2), n2);
|
|
}
|
|
function Nf() {
|
|
if (!arguments.length)
|
|
return [];
|
|
var n2 = arguments[0];
|
|
return bh(n2) ? n2 : [n2];
|
|
}
|
|
function Pf(n2) {
|
|
return Fr2(n2, sn);
|
|
}
|
|
function qf(n2, t2) {
|
|
return t2 = "function" == typeof t2 ? t2 : X, Fr2(n2, sn, t2);
|
|
}
|
|
function Zf(n2) {
|
|
return Fr2(n2, an | sn);
|
|
}
|
|
function Kf(n2, t2) {
|
|
return t2 = "function" == typeof t2 ? t2 : X, Fr2(n2, an | sn, t2);
|
|
}
|
|
function Vf(n2, t2) {
|
|
return null == t2 || Pr2(n2, t2, Pc(t2));
|
|
}
|
|
function Gf(n2, t2) {
|
|
return n2 === t2 || n2 !== n2 && t2 !== t2;
|
|
}
|
|
function Hf(n2) {
|
|
return null != n2 && oc(n2.length) && !uc(n2);
|
|
}
|
|
function Jf(n2) {
|
|
return cc(n2) && Hf(n2);
|
|
}
|
|
function Yf(n2) {
|
|
return n2 === true || n2 === false || cc(n2) && we(n2) == Nn;
|
|
}
|
|
function Qf(n2) {
|
|
return cc(n2) && 1 === n2.nodeType && !gc(n2);
|
|
}
|
|
function Xf(n2) {
|
|
if (null == n2)
|
|
return true;
|
|
if (Hf(n2) && (bh(n2) || "string" == typeof n2 || "function" == typeof n2.splice || mh(n2) || Oh(n2) || dh(n2)))
|
|
return !n2.length;
|
|
var t2 = zs(n2);
|
|
if (t2 == Gn || t2 == tt)
|
|
return !n2.size;
|
|
if (Mi(n2))
|
|
return !Me(n2).length;
|
|
for (var r2 in n2)
|
|
if (bl.call(n2, r2))
|
|
return false;
|
|
return true;
|
|
}
|
|
function nc(n2, t2) {
|
|
return Se(n2, t2);
|
|
}
|
|
function tc(n2, t2, r2) {
|
|
r2 = "function" == typeof r2 ? r2 : X;
|
|
var e2 = r2 ? r2(n2, t2) : X;
|
|
return e2 === X ? Se(n2, t2, X, r2) : !!e2;
|
|
}
|
|
function rc(n2) {
|
|
if (!cc(n2))
|
|
return false;
|
|
var t2 = we(n2);
|
|
return t2 == Zn || t2 == qn || "string" == typeof n2.message && "string" == typeof n2.name && !gc(n2);
|
|
}
|
|
function ec(n2) {
|
|
return "number" == typeof n2 && Zl(n2);
|
|
}
|
|
function uc(n2) {
|
|
if (!fc(n2))
|
|
return false;
|
|
var t2 = we(n2);
|
|
return t2 == Kn || t2 == Vn || t2 == Fn || t2 == Xn;
|
|
}
|
|
function ic(n2) {
|
|
return "number" == typeof n2 && n2 == kc(n2);
|
|
}
|
|
function oc(n2) {
|
|
return "number" == typeof n2 && n2 > -1 && n2 % 1 == 0 && n2 <= Wn;
|
|
}
|
|
function fc(n2) {
|
|
var t2 = typeof n2;
|
|
return null != n2 && ("object" == t2 || "function" == t2);
|
|
}
|
|
function cc(n2) {
|
|
return null != n2 && "object" == typeof n2;
|
|
}
|
|
function ac(n2, t2) {
|
|
return n2 === t2 || Ce(n2, t2, ji(t2));
|
|
}
|
|
function lc(n2, t2, r2) {
|
|
return r2 = "function" == typeof r2 ? r2 : X, Ce(n2, t2, ji(t2), r2);
|
|
}
|
|
function sc(n2) {
|
|
return vc(n2) && n2 != +n2;
|
|
}
|
|
function hc(n2) {
|
|
if (Es(n2))
|
|
throw new fl(rn);
|
|
return Ue(n2);
|
|
}
|
|
function pc(n2) {
|
|
return null === n2;
|
|
}
|
|
function _c(n2) {
|
|
return null == n2;
|
|
}
|
|
function vc(n2) {
|
|
return "number" == typeof n2 || cc(n2) && we(n2) == Hn;
|
|
}
|
|
function gc(n2) {
|
|
if (!cc(n2) || we(n2) != Yn)
|
|
return false;
|
|
var t2 = El(n2);
|
|
if (null === t2)
|
|
return true;
|
|
var r2 = bl.call(t2, "constructor") && t2.constructor;
|
|
return "function" == typeof r2 && r2 instanceof r2 && dl.call(r2) == jl;
|
|
}
|
|
function yc(n2) {
|
|
return ic(n2) && n2 >= -Wn && n2 <= Wn;
|
|
}
|
|
function dc(n2) {
|
|
return "string" == typeof n2 || !bh(n2) && cc(n2) && we(n2) == rt;
|
|
}
|
|
function bc(n2) {
|
|
return "symbol" == typeof n2 || cc(n2) && we(n2) == et;
|
|
}
|
|
function wc(n2) {
|
|
return n2 === X;
|
|
}
|
|
function mc(n2) {
|
|
return cc(n2) && zs(n2) == it;
|
|
}
|
|
function xc(n2) {
|
|
return cc(n2) && we(n2) == ot;
|
|
}
|
|
function jc(n2) {
|
|
if (!n2)
|
|
return [];
|
|
if (Hf(n2))
|
|
return dc(n2) ? G(n2) : Tu(n2);
|
|
if (Ul && n2[Ul])
|
|
return D(n2[Ul]());
|
|
var t2 = zs(n2);
|
|
return (t2 == Gn ? M : t2 == tt ? P : ra)(n2);
|
|
}
|
|
function Ac(n2) {
|
|
if (!n2)
|
|
return 0 === n2 ? n2 : 0;
|
|
if (n2 = Ic(n2), n2 === Sn || n2 === -Sn) {
|
|
return (n2 < 0 ? -1 : 1) * Ln;
|
|
}
|
|
return n2 === n2 ? n2 : 0;
|
|
}
|
|
function kc(n2) {
|
|
var t2 = Ac(n2), r2 = t2 % 1;
|
|
return t2 === t2 ? r2 ? t2 - r2 : t2 : 0;
|
|
}
|
|
function Oc(n2) {
|
|
return n2 ? Mr2(kc(n2), 0, Un) : 0;
|
|
}
|
|
function Ic(n2) {
|
|
if ("number" == typeof n2)
|
|
return n2;
|
|
if (bc(n2))
|
|
return Cn;
|
|
if (fc(n2)) {
|
|
var t2 = "function" == typeof n2.valueOf ? n2.valueOf() : n2;
|
|
n2 = fc(t2) ? t2 + "" : t2;
|
|
}
|
|
if ("string" != typeof n2)
|
|
return 0 === n2 ? n2 : +n2;
|
|
n2 = R(n2);
|
|
var r2 = qt.test(n2);
|
|
return r2 || Kt.test(n2) ? Xr(n2.slice(2), r2 ? 2 : 8) : Pt.test(n2) ? Cn : +n2;
|
|
}
|
|
function Rc(n2) {
|
|
return $u(n2, qc(n2));
|
|
}
|
|
function zc(n2) {
|
|
return n2 ? Mr2(kc(n2), -Wn, Wn) : 0 === n2 ? n2 : 0;
|
|
}
|
|
function Ec(n2) {
|
|
return null == n2 ? "" : vu(n2);
|
|
}
|
|
function Sc(n2, t2) {
|
|
var r2 = gs(n2);
|
|
return null == t2 ? r2 : Cr2(r2, t2);
|
|
}
|
|
function Wc(n2, t2) {
|
|
return v(n2, mi(t2, 3), ue2);
|
|
}
|
|
function Lc(n2, t2) {
|
|
return v(n2, mi(t2, 3), oe2);
|
|
}
|
|
function Cc(n2, t2) {
|
|
return null == n2 ? n2 : bs(n2, mi(t2, 3), qc);
|
|
}
|
|
function Uc(n2, t2) {
|
|
return null == n2 ? n2 : ws(n2, mi(t2, 3), qc);
|
|
}
|
|
function Bc(n2, t2) {
|
|
return n2 && ue2(n2, mi(t2, 3));
|
|
}
|
|
function Tc(n2, t2) {
|
|
return n2 && oe2(n2, mi(t2, 3));
|
|
}
|
|
function $c(n2) {
|
|
return null == n2 ? [] : fe2(n2, Pc(n2));
|
|
}
|
|
function Dc(n2) {
|
|
return null == n2 ? [] : fe2(n2, qc(n2));
|
|
}
|
|
function Mc(n2, t2, r2) {
|
|
var e2 = null == n2 ? X : _e2(n2, t2);
|
|
return e2 === X ? r2 : e2;
|
|
}
|
|
function Fc(n2, t2) {
|
|
return null != n2 && Ri(n2, t2, xe);
|
|
}
|
|
function Nc(n2, t2) {
|
|
return null != n2 && Ri(n2, t2, je);
|
|
}
|
|
function Pc(n2) {
|
|
return Hf(n2) ? Or2(n2) : Me(n2);
|
|
}
|
|
function qc(n2) {
|
|
return Hf(n2) ? Or2(n2, true) : Fe(n2);
|
|
}
|
|
function Zc(n2, t2) {
|
|
var r2 = {};
|
|
return t2 = mi(t2, 3), ue2(n2, function(n3, e2, u2) {
|
|
Br2(r2, t2(n3, e2, u2), n3);
|
|
}), r2;
|
|
}
|
|
function Kc(n2, t2) {
|
|
var r2 = {};
|
|
return t2 = mi(t2, 3), ue2(n2, function(n3, e2, u2) {
|
|
Br2(r2, e2, t2(n3, e2, u2));
|
|
}), r2;
|
|
}
|
|
function Vc(n2, t2) {
|
|
return Gc(n2, Uf(mi(t2)));
|
|
}
|
|
function Gc(n2, t2) {
|
|
if (null == n2)
|
|
return {};
|
|
var r2 = c(di(n2), function(n3) {
|
|
return [n3];
|
|
});
|
|
return t2 = mi(t2), Ye(n2, r2, function(n3, r3) {
|
|
return t2(n3, r3[0]);
|
|
});
|
|
}
|
|
function Hc(n2, t2, r2) {
|
|
t2 = ku(t2, n2);
|
|
var e2 = -1, u2 = t2.length;
|
|
for (u2 || (u2 = 1, n2 = X); ++e2 < u2; ) {
|
|
var i2 = null == n2 ? X : n2[no(t2[e2])];
|
|
i2 === X && (e2 = u2, i2 = r2), n2 = uc(i2) ? i2.call(n2) : i2;
|
|
}
|
|
return n2;
|
|
}
|
|
function Jc(n2, t2, r2) {
|
|
return null == n2 ? n2 : fu(n2, t2, r2);
|
|
}
|
|
function Yc(n2, t2, r2, e2) {
|
|
return e2 = "function" == typeof e2 ? e2 : X, null == n2 ? n2 : fu(n2, t2, r2, e2);
|
|
}
|
|
function Qc(n2, t2, e2) {
|
|
var u2 = bh(n2), i2 = u2 || mh(n2) || Oh(n2);
|
|
if (t2 = mi(t2, 4), null == e2) {
|
|
var o2 = n2 && n2.constructor;
|
|
e2 = i2 ? u2 ? new o2() : [] : fc(n2) && uc(o2) ? gs(El(n2)) : {};
|
|
}
|
|
return (i2 ? r : ue2)(n2, function(n3, r2, u3) {
|
|
return t2(e2, n3, r2, u3);
|
|
}), e2;
|
|
}
|
|
function Xc(n2, t2) {
|
|
return null == n2 || yu(n2, t2);
|
|
}
|
|
function na(n2, t2, r2) {
|
|
return null == n2 ? n2 : du(n2, t2, Au(r2));
|
|
}
|
|
function ta(n2, t2, r2, e2) {
|
|
return e2 = "function" == typeof e2 ? e2 : X, null == n2 ? n2 : du(n2, t2, Au(r2), e2);
|
|
}
|
|
function ra(n2) {
|
|
return null == n2 ? [] : E(n2, Pc(n2));
|
|
}
|
|
function ea(n2) {
|
|
return null == n2 ? [] : E(n2, qc(n2));
|
|
}
|
|
function ua(n2, t2, r2) {
|
|
return r2 === X && (r2 = t2, t2 = X), r2 !== X && (r2 = Ic(r2), r2 = r2 === r2 ? r2 : 0), t2 !== X && (t2 = Ic(t2), t2 = t2 === t2 ? t2 : 0), Mr2(Ic(n2), t2, r2);
|
|
}
|
|
function ia(n2, t2, r2) {
|
|
return t2 = Ac(t2), r2 === X ? (r2 = t2, t2 = 0) : r2 = Ac(r2), n2 = Ic(n2), Ae(n2, t2, r2);
|
|
}
|
|
function oa(n2, t2, r2) {
|
|
if (r2 && "boolean" != typeof r2 && Ui(n2, t2, r2) && (t2 = r2 = X), r2 === X && ("boolean" == typeof t2 ? (r2 = t2, t2 = X) : "boolean" == typeof n2 && (r2 = n2, n2 = X)), n2 === X && t2 === X ? (n2 = 0, t2 = 1) : (n2 = Ac(n2), t2 === X ? (t2 = n2, n2 = 0) : t2 = Ac(t2)), n2 > t2) {
|
|
var e2 = n2;
|
|
n2 = t2, t2 = e2;
|
|
}
|
|
if (r2 || n2 % 1 || t2 % 1) {
|
|
var u2 = Ql();
|
|
return Hl(n2 + u2 * (t2 - n2 + Qr("1e-" + ((u2 + "").length - 1))), t2);
|
|
}
|
|
return tu(n2, t2);
|
|
}
|
|
function fa(n2) {
|
|
return Qh(Ec(n2).toLowerCase());
|
|
}
|
|
function ca(n2) {
|
|
return n2 = Ec(n2), n2 && n2.replace(Gt, ve).replace(Dr, "");
|
|
}
|
|
function aa(n2, t2, r2) {
|
|
n2 = Ec(n2), t2 = vu(t2);
|
|
var e2 = n2.length;
|
|
r2 = r2 === X ? e2 : Mr2(kc(r2), 0, e2);
|
|
var u2 = r2;
|
|
return r2 -= t2.length, r2 >= 0 && n2.slice(r2, u2) == t2;
|
|
}
|
|
function la(n2) {
|
|
return n2 = Ec(n2), n2 && At.test(n2) ? n2.replace(xt, ge) : n2;
|
|
}
|
|
function sa(n2) {
|
|
return n2 = Ec(n2), n2 && Wt.test(n2) ? n2.replace(St, "\\$&") : n2;
|
|
}
|
|
function ha(n2, t2, r2) {
|
|
n2 = Ec(n2), t2 = kc(t2);
|
|
var e2 = t2 ? V(n2) : 0;
|
|
if (!t2 || e2 >= t2)
|
|
return n2;
|
|
var u2 = (t2 - e2) / 2;
|
|
return ri(Nl(u2), r2) + n2 + ri(Fl(u2), r2);
|
|
}
|
|
function pa(n2, t2, r2) {
|
|
n2 = Ec(n2), t2 = kc(t2);
|
|
var e2 = t2 ? V(n2) : 0;
|
|
return t2 && e2 < t2 ? n2 + ri(t2 - e2, r2) : n2;
|
|
}
|
|
function _a(n2, t2, r2) {
|
|
n2 = Ec(n2), t2 = kc(t2);
|
|
var e2 = t2 ? V(n2) : 0;
|
|
return t2 && e2 < t2 ? ri(t2 - e2, r2) + n2 : n2;
|
|
}
|
|
function va(n2, t2, r2) {
|
|
return r2 || null == t2 ? t2 = 0 : t2 && (t2 = +t2), Yl(Ec(n2).replace(Lt, ""), t2 || 0);
|
|
}
|
|
function ga(n2, t2, r2) {
|
|
return t2 = (r2 ? Ui(n2, t2, r2) : t2 === X) ? 1 : kc(t2), eu(Ec(n2), t2);
|
|
}
|
|
function ya() {
|
|
var n2 = arguments, t2 = Ec(n2[0]);
|
|
return n2.length < 3 ? t2 : t2.replace(n2[1], n2[2]);
|
|
}
|
|
function da(n2, t2, r2) {
|
|
return r2 && "number" != typeof r2 && Ui(n2, t2, r2) && (t2 = r2 = X), (r2 = r2 === X ? Un : r2 >>> 0) ? (n2 = Ec(n2), n2 && ("string" == typeof t2 || null != t2 && !Ah(t2)) && (t2 = vu(t2), !t2 && T(n2)) ? Ou(G(n2), 0, r2) : n2.split(t2, r2)) : [];
|
|
}
|
|
function ba(n2, t2, r2) {
|
|
return n2 = Ec(n2), r2 = null == r2 ? 0 : Mr2(kc(r2), 0, n2.length), t2 = vu(t2), n2.slice(r2, r2 + t2.length) == t2;
|
|
}
|
|
function wa(n2, t2, r2) {
|
|
var e2 = Z2.templateSettings;
|
|
r2 && Ui(n2, t2, r2) && (t2 = X), n2 = Ec(n2), t2 = Sh({}, t2, e2, li);
|
|
var u2, i2, o2 = Sh({}, t2.imports, e2.imports, li), f2 = Pc(o2), c2 = E(o2, f2), a2 = 0, l2 = t2.interpolate || Ht, s2 = "__p += '", h2 = sl((t2.escape || Ht).source + "|" + l2.source + "|" + (l2 === It ? Ft : Ht).source + "|" + (t2.evaluate || Ht).source + "|$", "g"), p3 = "//# sourceURL=" + (bl.call(t2, "sourceURL") ? (t2.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Zr + "]") + "\n";
|
|
n2.replace(h2, function(t3, r3, e3, o3, f3, c3) {
|
|
return e3 || (e3 = o3), s2 += n2.slice(a2, c3).replace(Jt, U), r3 && (u2 = true, s2 += "' +\n__e(" + r3 + ") +\n'"), f3 && (i2 = true, s2 += "';\n" + f3 + ";\n__p += '"), e3 && (s2 += "' +\n((__t = (" + e3 + ")) == null ? '' : __t) +\n'"), a2 = c3 + t3.length, t3;
|
|
}), s2 += "';\n";
|
|
var _2 = bl.call(t2, "variable") && t2.variable;
|
|
if (_2) {
|
|
if (Dt.test(_2))
|
|
throw new fl(un);
|
|
} else
|
|
s2 = "with (obj) {\n" + s2 + "\n}\n";
|
|
s2 = (i2 ? s2.replace(dt, "") : s2).replace(bt, "$1").replace(wt, "$1;"), s2 = "function(" + (_2 || "obj") + ") {\n" + (_2 ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (u2 ? ", __e = _.escape" : "") + (i2 ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + s2 + "return __p\n}";
|
|
var v2 = Xh(function() {
|
|
return cl(f2, p3 + "return " + s2).apply(X, c2);
|
|
});
|
|
if (v2.source = s2, rc(v2))
|
|
throw v2;
|
|
return v2;
|
|
}
|
|
function ma(n2) {
|
|
return Ec(n2).toLowerCase();
|
|
}
|
|
function xa(n2) {
|
|
return Ec(n2).toUpperCase();
|
|
}
|
|
function ja(n2, t2, r2) {
|
|
if (n2 = Ec(n2), n2 && (r2 || t2 === X))
|
|
return R(n2);
|
|
if (!n2 || !(t2 = vu(t2)))
|
|
return n2;
|
|
var e2 = G(n2), u2 = G(t2);
|
|
return Ou(e2, W(e2, u2), L(e2, u2) + 1).join("");
|
|
}
|
|
function Aa(n2, t2, r2) {
|
|
if (n2 = Ec(n2), n2 && (r2 || t2 === X))
|
|
return n2.slice(0, H(n2) + 1);
|
|
if (!n2 || !(t2 = vu(t2)))
|
|
return n2;
|
|
var e2 = G(n2);
|
|
return Ou(e2, 0, L(e2, G(t2)) + 1).join("");
|
|
}
|
|
function ka(n2, t2, r2) {
|
|
if (n2 = Ec(n2), n2 && (r2 || t2 === X))
|
|
return n2.replace(Lt, "");
|
|
if (!n2 || !(t2 = vu(t2)))
|
|
return n2;
|
|
var e2 = G(n2);
|
|
return Ou(e2, W(e2, G(t2))).join("");
|
|
}
|
|
function Oa(n2, t2) {
|
|
var r2 = An, e2 = kn;
|
|
if (fc(t2)) {
|
|
var u2 = "separator" in t2 ? t2.separator : u2;
|
|
r2 = "length" in t2 ? kc(t2.length) : r2, e2 = "omission" in t2 ? vu(t2.omission) : e2;
|
|
}
|
|
n2 = Ec(n2);
|
|
var i2 = n2.length;
|
|
if (T(n2)) {
|
|
var o2 = G(n2);
|
|
i2 = o2.length;
|
|
}
|
|
if (r2 >= i2)
|
|
return n2;
|
|
var f2 = r2 - V(e2);
|
|
if (f2 < 1)
|
|
return e2;
|
|
var c2 = o2 ? Ou(o2, 0, f2).join("") : n2.slice(0, f2);
|
|
if (u2 === X)
|
|
return c2 + e2;
|
|
if (o2 && (f2 += c2.length - f2), Ah(u2)) {
|
|
if (n2.slice(f2).search(u2)) {
|
|
var a2, l2 = c2;
|
|
for (u2.global || (u2 = sl(u2.source, Ec(Nt.exec(u2)) + "g")), u2.lastIndex = 0; a2 = u2.exec(l2); )
|
|
var s2 = a2.index;
|
|
c2 = c2.slice(0, s2 === X ? f2 : s2);
|
|
}
|
|
} else if (n2.indexOf(vu(u2), f2) != f2) {
|
|
var h2 = c2.lastIndexOf(u2);
|
|
h2 > -1 && (c2 = c2.slice(0, h2));
|
|
}
|
|
return c2 + e2;
|
|
}
|
|
function Ia(n2) {
|
|
return n2 = Ec(n2), n2 && jt.test(n2) ? n2.replace(mt, ye) : n2;
|
|
}
|
|
function Ra(n2, t2, r2) {
|
|
return n2 = Ec(n2), t2 = r2 ? X : t2, t2 === X ? $(n2) ? Q(n2) : _(n2) : n2.match(t2) || [];
|
|
}
|
|
function za(t2) {
|
|
var r2 = null == t2 ? 0 : t2.length, e2 = mi();
|
|
return t2 = r2 ? c(t2, function(n2) {
|
|
if ("function" != typeof n2[1])
|
|
throw new pl(en);
|
|
return [e2(n2[0]), n2[1]];
|
|
}) : [], uu(function(e3) {
|
|
for (var u2 = -1; ++u2 < r2; ) {
|
|
var i2 = t2[u2];
|
|
if (n(i2[0], this, e3))
|
|
return n(i2[1], this, e3);
|
|
}
|
|
});
|
|
}
|
|
function Ea(n2) {
|
|
return Nr2(Fr2(n2, an));
|
|
}
|
|
function Sa(n2) {
|
|
return function() {
|
|
return n2;
|
|
};
|
|
}
|
|
function Wa(n2, t2) {
|
|
return null == n2 || n2 !== n2 ? t2 : n2;
|
|
}
|
|
function La(n2) {
|
|
return n2;
|
|
}
|
|
function Ca(n2) {
|
|
return De("function" == typeof n2 ? n2 : Fr2(n2, an));
|
|
}
|
|
function Ua(n2) {
|
|
return qe(Fr2(n2, an));
|
|
}
|
|
function Ba(n2, t2) {
|
|
return Ze(n2, Fr2(t2, an));
|
|
}
|
|
function Ta(n2, t2, e2) {
|
|
var u2 = Pc(t2), i2 = fe2(t2, u2);
|
|
null != e2 || fc(t2) && (i2.length || !u2.length) || (e2 = t2, t2 = n2, n2 = this, i2 = fe2(t2, Pc(t2)));
|
|
var o2 = !(fc(e2) && "chain" in e2 && !e2.chain), f2 = uc(n2);
|
|
return r(i2, function(r2) {
|
|
var e3 = t2[r2];
|
|
n2[r2] = e3, f2 && (n2.prototype[r2] = function() {
|
|
var t3 = this.__chain__;
|
|
if (o2 || t3) {
|
|
var r3 = n2(this.__wrapped__);
|
|
return (r3.__actions__ = Tu(this.__actions__)).push({ func: e3, args: arguments, thisArg: n2 }), r3.__chain__ = t3, r3;
|
|
}
|
|
return e3.apply(n2, a([this.value()], arguments));
|
|
});
|
|
}), n2;
|
|
}
|
|
function $a() {
|
|
return re._ === this && (re._ = Al), this;
|
|
}
|
|
function Da() {
|
|
}
|
|
function Ma(n2) {
|
|
return n2 = kc(n2), uu(function(t2) {
|
|
return Ge(t2, n2);
|
|
});
|
|
}
|
|
function Fa(n2) {
|
|
return Bi(n2) ? m(no(n2)) : Qe(n2);
|
|
}
|
|
function Na(n2) {
|
|
return function(t2) {
|
|
return null == n2 ? X : _e2(n2, t2);
|
|
};
|
|
}
|
|
function Pa() {
|
|
return [];
|
|
}
|
|
function qa() {
|
|
return false;
|
|
}
|
|
function Za() {
|
|
return {};
|
|
}
|
|
function Ka() {
|
|
return "";
|
|
}
|
|
function Va() {
|
|
return true;
|
|
}
|
|
function Ga(n2, t2) {
|
|
if (n2 = kc(n2), n2 < 1 || n2 > Wn)
|
|
return [];
|
|
var r2 = Un, e2 = Hl(n2, Un);
|
|
t2 = mi(t2), n2 -= Un;
|
|
for (var u2 = O(e2, t2); ++r2 < n2; )
|
|
t2(r2);
|
|
return u2;
|
|
}
|
|
function Ha(n2) {
|
|
return bh(n2) ? c(n2, no) : bc(n2) ? [n2] : Tu(Cs(Ec(n2)));
|
|
}
|
|
function Ja(n2) {
|
|
var t2 = ++wl;
|
|
return Ec(n2) + t2;
|
|
}
|
|
function Ya(n2) {
|
|
return n2 && n2.length ? Yr2(n2, La, me) : X;
|
|
}
|
|
function Qa(n2, t2) {
|
|
return n2 && n2.length ? Yr2(n2, mi(t2, 2), me) : X;
|
|
}
|
|
function Xa(n2) {
|
|
return w(n2, La);
|
|
}
|
|
function nl(n2, t2) {
|
|
return w(n2, mi(t2, 2));
|
|
}
|
|
function tl(n2) {
|
|
return n2 && n2.length ? Yr2(n2, La, Ne) : X;
|
|
}
|
|
function rl(n2, t2) {
|
|
return n2 && n2.length ? Yr2(n2, mi(t2, 2), Ne) : X;
|
|
}
|
|
function el(n2) {
|
|
return n2 && n2.length ? k(n2, La) : 0;
|
|
}
|
|
function ul(n2, t2) {
|
|
return n2 && n2.length ? k(n2, mi(t2, 2)) : 0;
|
|
}
|
|
x2 = null == x2 ? re : be.defaults(re.Object(), x2, be.pick(re, qr));
|
|
var il = x2.Array, ol = x2.Date, fl = x2.Error, cl = x2.Function, al = x2.Math, ll = x2.Object, sl = x2.RegExp, hl = x2.String, pl = x2.TypeError, _l = il.prototype, vl = cl.prototype, gl = ll.prototype, yl = x2["__core-js_shared__"], dl = vl.toString, bl = gl.hasOwnProperty, wl = 0, ml = function() {
|
|
var n2 = /[^.]+$/.exec(yl && yl.keys && yl.keys.IE_PROTO || "");
|
|
return n2 ? "Symbol(src)_1." + n2 : "";
|
|
}(), xl = gl.toString, jl = dl.call(ll), Al = re._, kl = sl("^" + dl.call(bl).replace(St, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Ol = ie ? x2.Buffer : X, Il = x2.Symbol, Rl = x2.Uint8Array, zl = Ol ? Ol.allocUnsafe : X, El = F(ll.getPrototypeOf, ll), Sl = ll.create, Wl = gl.propertyIsEnumerable, Ll = _l.splice, Cl = Il ? Il.isConcatSpreadable : X, Ul = Il ? Il.iterator : X, Bl = Il ? Il.toStringTag : X, Tl = function() {
|
|
try {
|
|
var n2 = Ai(ll, "defineProperty");
|
|
return n2({}, "", {}), n2;
|
|
} catch (n3) {
|
|
}
|
|
}(), $l = x2.clearTimeout !== re.clearTimeout && x2.clearTimeout, Dl = ol && ol.now !== re.Date.now && ol.now, Ml = x2.setTimeout !== re.setTimeout && x2.setTimeout, Fl = al.ceil, Nl = al.floor, Pl = ll.getOwnPropertySymbols, ql = Ol ? Ol.isBuffer : X, Zl = x2.isFinite, Kl = _l.join, Vl = F(ll.keys, ll), Gl = al.max, Hl = al.min, Jl = ol.now, Yl = x2.parseInt, Ql = al.random, Xl = _l.reverse, ns = Ai(x2, "DataView"), ts = Ai(x2, "Map"), rs = Ai(x2, "Promise"), es = Ai(x2, "Set"), us = Ai(x2, "WeakMap"), is = Ai(ll, "create"), os = us && new us(), fs = {}, cs = to(ns), as = to(ts), ls = to(rs), ss = to(es), hs = to(us), ps = Il ? Il.prototype : X, _s = ps ? ps.valueOf : X, vs = ps ? ps.toString : X, gs = function() {
|
|
function n2() {
|
|
}
|
|
return function(t2) {
|
|
if (!fc(t2))
|
|
return {};
|
|
if (Sl)
|
|
return Sl(t2);
|
|
n2.prototype = t2;
|
|
var r2 = new n2();
|
|
return n2.prototype = X, r2;
|
|
};
|
|
}();
|
|
Z2.templateSettings = { escape: kt, evaluate: Ot, interpolate: It, variable: "", imports: { _: Z2 } }, Z2.prototype = J2.prototype, Z2.prototype.constructor = Z2, Y2.prototype = gs(J2.prototype), Y2.prototype.constructor = Y2, Ct2.prototype = gs(J2.prototype), Ct2.prototype.constructor = Ct2, Xt2.prototype.clear = nr2, Xt2.prototype.delete = tr2, Xt2.prototype.get = rr2, Xt2.prototype.has = er2, Xt2.prototype.set = ur2, ir2.prototype.clear = or2, ir2.prototype.delete = fr2, ir2.prototype.get = cr2, ir2.prototype.has = ar2, ir2.prototype.set = lr2, sr2.prototype.clear = hr2, sr2.prototype.delete = pr2, sr2.prototype.get = _r2, sr2.prototype.has = vr2, sr2.prototype.set = gr2, yr2.prototype.add = yr2.prototype.push = dr2, yr2.prototype.has = br2, wr2.prototype.clear = mr2, wr2.prototype.delete = xr2, wr2.prototype.get = jr2, wr2.prototype.has = Ar2, wr2.prototype.set = kr2;
|
|
var ys = Pu(ue2), ds = Pu(oe2, true), bs = qu(), ws = qu(true), ms = os ? function(n2, t2) {
|
|
return os.set(n2, t2), n2;
|
|
} : La, xs = Tl ? function(n2, t2) {
|
|
return Tl(n2, "toString", {
|
|
configurable: true,
|
|
enumerable: false,
|
|
value: Sa(t2),
|
|
writable: true
|
|
});
|
|
} : La, js = uu, As = $l || function(n2) {
|
|
return re.clearTimeout(n2);
|
|
}, ks = es && 1 / P(new es([, -0]))[1] == Sn ? function(n2) {
|
|
return new es(n2);
|
|
} : Da, Os = os ? function(n2) {
|
|
return os.get(n2);
|
|
} : Da, Is = Pl ? function(n2) {
|
|
return null == n2 ? [] : (n2 = ll(n2), i(Pl(n2), function(t2) {
|
|
return Wl.call(n2, t2);
|
|
}));
|
|
} : Pa, Rs = Pl ? function(n2) {
|
|
for (var t2 = []; n2; )
|
|
a(t2, Is(n2)), n2 = El(n2);
|
|
return t2;
|
|
} : Pa, zs = we;
|
|
(ns && zs(new ns(new ArrayBuffer(1))) != ct || ts && zs(new ts()) != Gn || rs && zs(rs.resolve()) != Qn || es && zs(new es()) != tt || us && zs(new us()) != it) && (zs = function(n2) {
|
|
var t2 = we(n2), r2 = t2 == Yn ? n2.constructor : X, e2 = r2 ? to(r2) : "";
|
|
if (e2)
|
|
switch (e2) {
|
|
case cs:
|
|
return ct;
|
|
case as:
|
|
return Gn;
|
|
case ls:
|
|
return Qn;
|
|
case ss:
|
|
return tt;
|
|
case hs:
|
|
return it;
|
|
}
|
|
return t2;
|
|
});
|
|
var Es = yl ? uc : qa, Ss = Qi(ms), Ws = Ml || function(n2, t2) {
|
|
return re.setTimeout(n2, t2);
|
|
}, Ls = Qi(xs), Cs = Pi(function(n2) {
|
|
var t2 = [];
|
|
return 46 === n2.charCodeAt(0) && t2.push(""), n2.replace(Et, function(n3, r2, e2, u2) {
|
|
t2.push(e2 ? u2.replace(Mt, "$1") : r2 || n3);
|
|
}), t2;
|
|
}), Us = uu(function(n2, t2) {
|
|
return Jf(n2) ? Hr2(n2, ee2(t2, 1, Jf, true)) : [];
|
|
}), Bs = uu(function(n2, t2) {
|
|
var r2 = jo(t2);
|
|
return Jf(r2) && (r2 = X), Jf(n2) ? Hr2(n2, ee2(t2, 1, Jf, true), mi(r2, 2)) : [];
|
|
}), Ts = uu(function(n2, t2) {
|
|
var r2 = jo(t2);
|
|
return Jf(r2) && (r2 = X), Jf(n2) ? Hr2(n2, ee2(t2, 1, Jf, true), X, r2) : [];
|
|
}), $s = uu(function(n2) {
|
|
var t2 = c(n2, ju);
|
|
return t2.length && t2[0] === n2[0] ? ke(t2) : [];
|
|
}), Ds = uu(function(n2) {
|
|
var t2 = jo(n2), r2 = c(n2, ju);
|
|
return t2 === jo(r2) ? t2 = X : r2.pop(), r2.length && r2[0] === n2[0] ? ke(r2, mi(t2, 2)) : [];
|
|
}), Ms = uu(function(n2) {
|
|
var t2 = jo(n2), r2 = c(n2, ju);
|
|
return t2 = "function" == typeof t2 ? t2 : X, t2 && r2.pop(), r2.length && r2[0] === n2[0] ? ke(r2, X, t2) : [];
|
|
}), Fs = uu(Oo), Ns = gi(function(n2, t2) {
|
|
var r2 = null == n2 ? 0 : n2.length, e2 = Tr2(n2, t2);
|
|
return nu(n2, c(t2, function(n3) {
|
|
return Ci(n3, r2) ? +n3 : n3;
|
|
}).sort(Lu)), e2;
|
|
}), Ps = uu(function(n2) {
|
|
return gu(ee2(n2, 1, Jf, true));
|
|
}), qs = uu(function(n2) {
|
|
var t2 = jo(n2);
|
|
return Jf(t2) && (t2 = X), gu(ee2(n2, 1, Jf, true), mi(t2, 2));
|
|
}), Zs = uu(function(n2) {
|
|
var t2 = jo(n2);
|
|
return t2 = "function" == typeof t2 ? t2 : X, gu(ee2(n2, 1, Jf, true), X, t2);
|
|
}), Ks = uu(function(n2, t2) {
|
|
return Jf(n2) ? Hr2(n2, t2) : [];
|
|
}), Vs = uu(function(n2) {
|
|
return mu(i(n2, Jf));
|
|
}), Gs = uu(function(n2) {
|
|
var t2 = jo(n2);
|
|
return Jf(t2) && (t2 = X), mu(i(n2, Jf), mi(t2, 2));
|
|
}), Hs = uu(function(n2) {
|
|
var t2 = jo(n2);
|
|
return t2 = "function" == typeof t2 ? t2 : X, mu(i(n2, Jf), X, t2);
|
|
}), Js = uu(Go), Ys = uu(function(n2) {
|
|
var t2 = n2.length, r2 = t2 > 1 ? n2[t2 - 1] : X;
|
|
return r2 = "function" == typeof r2 ? (n2.pop(), r2) : X, Ho(n2, r2);
|
|
}), Qs = gi(function(n2) {
|
|
var t2 = n2.length, r2 = t2 ? n2[0] : 0, e2 = this.__wrapped__, u2 = function(t3) {
|
|
return Tr2(t3, n2);
|
|
};
|
|
return !(t2 > 1 || this.__actions__.length) && e2 instanceof Ct2 && Ci(r2) ? (e2 = e2.slice(r2, +r2 + (t2 ? 1 : 0)), e2.__actions__.push({ func: nf, args: [u2], thisArg: X }), new Y2(e2, this.__chain__).thru(function(n3) {
|
|
return t2 && !n3.length && n3.push(X), n3;
|
|
})) : this.thru(u2);
|
|
}), Xs = Fu(function(n2, t2, r2) {
|
|
bl.call(n2, r2) ? ++n2[r2] : Br2(n2, r2, 1);
|
|
}), nh = Ju(ho), th = Ju(po), rh = Fu(function(n2, t2, r2) {
|
|
bl.call(n2, r2) ? n2[r2].push(t2) : Br2(n2, r2, [t2]);
|
|
}), eh = uu(function(t2, r2, e2) {
|
|
var u2 = -1, i2 = "function" == typeof r2, o2 = Hf(t2) ? il(t2.length) : [];
|
|
return ys(t2, function(t3) {
|
|
o2[++u2] = i2 ? n(r2, t3, e2) : Ie(t3, r2, e2);
|
|
}), o2;
|
|
}), uh = Fu(function(n2, t2, r2) {
|
|
Br2(n2, r2, t2);
|
|
}), ih = Fu(function(n2, t2, r2) {
|
|
n2[r2 ? 0 : 1].push(t2);
|
|
}, function() {
|
|
return [[], []];
|
|
}), oh = uu(function(n2, t2) {
|
|
if (null == n2)
|
|
return [];
|
|
var r2 = t2.length;
|
|
return r2 > 1 && Ui(n2, t2[0], t2[1]) ? t2 = [] : r2 > 2 && Ui(t2[0], t2[1], t2[2]) && (t2 = [t2[0]]), He(n2, ee2(t2, 1), []);
|
|
}), fh = Dl || function() {
|
|
return re.Date.now();
|
|
}, ch = uu(function(n2, t2, r2) {
|
|
var e2 = _n;
|
|
if (r2.length) {
|
|
var u2 = N(r2, wi(ch));
|
|
e2 |= bn;
|
|
}
|
|
return ai(n2, e2, t2, r2, u2);
|
|
}), ah = uu(function(n2, t2, r2) {
|
|
var e2 = _n | vn;
|
|
if (r2.length) {
|
|
var u2 = N(r2, wi(ah));
|
|
e2 |= bn;
|
|
}
|
|
return ai(t2, e2, n2, r2, u2);
|
|
}), lh = uu(function(n2, t2) {
|
|
return Gr2(n2, 1, t2);
|
|
}), sh = uu(function(n2, t2, r2) {
|
|
return Gr2(n2, Ic(t2) || 0, r2);
|
|
});
|
|
Cf.Cache = sr2;
|
|
var hh = js(function(t2, r2) {
|
|
r2 = 1 == r2.length && bh(r2[0]) ? c(r2[0], z(mi())) : c(ee2(r2, 1), z(mi()));
|
|
var e2 = r2.length;
|
|
return uu(function(u2) {
|
|
for (var i2 = -1, o2 = Hl(u2.length, e2); ++i2 < o2; )
|
|
u2[i2] = r2[i2].call(this, u2[i2]);
|
|
return n(t2, this, u2);
|
|
});
|
|
}), ph = uu(function(n2, t2) {
|
|
return ai(n2, bn, X, t2, N(t2, wi(ph)));
|
|
}), _h = uu(function(n2, t2) {
|
|
return ai(n2, wn, X, t2, N(t2, wi(_h)));
|
|
}), vh = gi(function(n2, t2) {
|
|
return ai(n2, xn, X, X, X, t2);
|
|
}), gh = ii(me), yh = ii(function(n2, t2) {
|
|
return n2 >= t2;
|
|
}), dh = Re(function() {
|
|
return arguments;
|
|
}()) ? Re : function(n2) {
|
|
return cc(n2) && bl.call(n2, "callee") && !Wl.call(n2, "callee");
|
|
}, bh = il.isArray, wh = ce ? z(ce) : ze, mh = ql || qa, xh = ae ? z(ae) : Ee, jh = le ? z(le) : Le, Ah = se ? z(se) : Be, kh = he ? z(he) : Te, Oh = pe ? z(pe) : $e, Ih = ii(Ne), Rh = ii(function(n2, t2) {
|
|
return n2 <= t2;
|
|
}), zh = Nu(function(n2, t2) {
|
|
if (Mi(t2) || Hf(t2))
|
|
return $u(t2, Pc(t2), n2), X;
|
|
for (var r2 in t2)
|
|
bl.call(t2, r2) && Sr2(n2, r2, t2[r2]);
|
|
}), Eh = Nu(function(n2, t2) {
|
|
$u(t2, qc(t2), n2);
|
|
}), Sh = Nu(function(n2, t2, r2, e2) {
|
|
$u(t2, qc(t2), n2, e2);
|
|
}), Wh = Nu(function(n2, t2, r2, e2) {
|
|
$u(t2, Pc(t2), n2, e2);
|
|
}), Lh = gi(Tr2), Ch = uu(function(n2, t2) {
|
|
n2 = ll(n2);
|
|
var r2 = -1, e2 = t2.length, u2 = e2 > 2 ? t2[2] : X;
|
|
for (u2 && Ui(t2[0], t2[1], u2) && (e2 = 1); ++r2 < e2; )
|
|
for (var i2 = t2[r2], o2 = qc(i2), f2 = -1, c2 = o2.length; ++f2 < c2; ) {
|
|
var a2 = o2[f2], l2 = n2[a2];
|
|
(l2 === X || Gf(l2, gl[a2]) && !bl.call(n2, a2)) && (n2[a2] = i2[a2]);
|
|
}
|
|
return n2;
|
|
}), Uh = uu(function(t2) {
|
|
return t2.push(X, si), n(Mh, X, t2);
|
|
}), Bh = Xu(function(n2, t2, r2) {
|
|
null != t2 && "function" != typeof t2.toString && (t2 = xl.call(t2)), n2[t2] = r2;
|
|
}, Sa(La)), Th = Xu(function(n2, t2, r2) {
|
|
null != t2 && "function" != typeof t2.toString && (t2 = xl.call(t2)), bl.call(n2, t2) ? n2[t2].push(r2) : n2[t2] = [r2];
|
|
}, mi), $h = uu(Ie), Dh = Nu(function(n2, t2, r2) {
|
|
Ke(n2, t2, r2);
|
|
}), Mh = Nu(function(n2, t2, r2, e2) {
|
|
Ke(n2, t2, r2, e2);
|
|
}), Fh = gi(function(n2, t2) {
|
|
var r2 = {};
|
|
if (null == n2)
|
|
return r2;
|
|
var e2 = false;
|
|
t2 = c(t2, function(t3) {
|
|
return t3 = ku(t3, n2), e2 || (e2 = t3.length > 1), t3;
|
|
}), $u(n2, di(n2), r2), e2 && (r2 = Fr2(r2, an | ln | sn, hi));
|
|
for (var u2 = t2.length; u2--; )
|
|
yu(r2, t2[u2]);
|
|
return r2;
|
|
}), Nh = gi(function(n2, t2) {
|
|
return null == n2 ? {} : Je(n2, t2);
|
|
}), Ph = ci(Pc), qh = ci(qc), Zh = Vu(function(n2, t2, r2) {
|
|
return t2 = t2.toLowerCase(), n2 + (r2 ? fa(t2) : t2);
|
|
}), Kh = Vu(function(n2, t2, r2) {
|
|
return n2 + (r2 ? "-" : "") + t2.toLowerCase();
|
|
}), Vh = Vu(function(n2, t2, r2) {
|
|
return n2 + (r2 ? " " : "") + t2.toLowerCase();
|
|
}), Gh = Ku("toLowerCase"), Hh = Vu(function(n2, t2, r2) {
|
|
return n2 + (r2 ? "_" : "") + t2.toLowerCase();
|
|
}), Jh = Vu(function(n2, t2, r2) {
|
|
return n2 + (r2 ? " " : "") + Qh(t2);
|
|
}), Yh = Vu(function(n2, t2, r2) {
|
|
return n2 + (r2 ? " " : "") + t2.toUpperCase();
|
|
}), Qh = Ku("toUpperCase"), Xh = uu(function(t2, r2) {
|
|
try {
|
|
return n(t2, X, r2);
|
|
} catch (n2) {
|
|
return rc(n2) ? n2 : new fl(n2);
|
|
}
|
|
}), np = gi(function(n2, t2) {
|
|
return r(t2, function(t3) {
|
|
t3 = no(t3), Br2(n2, t3, ch(n2[t3], n2));
|
|
}), n2;
|
|
}), tp = Yu(), rp = Yu(true), ep = uu(function(n2, t2) {
|
|
return function(r2) {
|
|
return Ie(r2, n2, t2);
|
|
};
|
|
}), up = uu(function(n2, t2) {
|
|
return function(r2) {
|
|
return Ie(n2, r2, t2);
|
|
};
|
|
}), ip = ti(c), op = ti(u), fp = ti(h), cp = ui(), ap = ui(true), lp = ni(function(n2, t2) {
|
|
return n2 + t2;
|
|
}, 0), sp = fi("ceil"), hp = ni(function(n2, t2) {
|
|
return n2 / t2;
|
|
}, 1), pp = fi("floor"), _p = ni(function(n2, t2) {
|
|
return n2 * t2;
|
|
}, 1), vp = fi("round"), gp = ni(function(n2, t2) {
|
|
return n2 - t2;
|
|
}, 0);
|
|
return Z2.after = If, Z2.ary = Rf, Z2.assign = zh, Z2.assignIn = Eh, Z2.assignInWith = Sh, Z2.assignWith = Wh, Z2.at = Lh, Z2.before = zf, Z2.bind = ch, Z2.bindAll = np, Z2.bindKey = ah, Z2.castArray = Nf, Z2.chain = Qo, Z2.chunk = uo, Z2.compact = io, Z2.concat = oo, Z2.cond = za, Z2.conforms = Ea, Z2.constant = Sa, Z2.countBy = Xs, Z2.create = Sc, Z2.curry = Ef, Z2.curryRight = Sf, Z2.debounce = Wf, Z2.defaults = Ch, Z2.defaultsDeep = Uh, Z2.defer = lh, Z2.delay = sh, Z2.difference = Us, Z2.differenceBy = Bs, Z2.differenceWith = Ts, Z2.drop = fo, Z2.dropRight = co, Z2.dropRightWhile = ao, Z2.dropWhile = lo, Z2.fill = so, Z2.filter = lf, Z2.flatMap = sf, Z2.flatMapDeep = hf, Z2.flatMapDepth = pf, Z2.flatten = _o, Z2.flattenDeep = vo, Z2.flattenDepth = go, Z2.flip = Lf, Z2.flow = tp, Z2.flowRight = rp, Z2.fromPairs = yo, Z2.functions = $c, Z2.functionsIn = Dc, Z2.groupBy = rh, Z2.initial = mo, Z2.intersection = $s, Z2.intersectionBy = Ds, Z2.intersectionWith = Ms, Z2.invert = Bh, Z2.invertBy = Th, Z2.invokeMap = eh, Z2.iteratee = Ca, Z2.keyBy = uh, Z2.keys = Pc, Z2.keysIn = qc, Z2.map = yf, Z2.mapKeys = Zc, Z2.mapValues = Kc, Z2.matches = Ua, Z2.matchesProperty = Ba, Z2.memoize = Cf, Z2.merge = Dh, Z2.mergeWith = Mh, Z2.method = ep, Z2.methodOf = up, Z2.mixin = Ta, Z2.negate = Uf, Z2.nthArg = Ma, Z2.omit = Fh, Z2.omitBy = Vc, Z2.once = Bf, Z2.orderBy = df, Z2.over = ip, Z2.overArgs = hh, Z2.overEvery = op, Z2.overSome = fp, Z2.partial = ph, Z2.partialRight = _h, Z2.partition = ih, Z2.pick = Nh, Z2.pickBy = Gc, Z2.property = Fa, Z2.propertyOf = Na, Z2.pull = Fs, Z2.pullAll = Oo, Z2.pullAllBy = Io, Z2.pullAllWith = Ro, Z2.pullAt = Ns, Z2.range = cp, Z2.rangeRight = ap, Z2.rearg = vh, Z2.reject = mf, Z2.remove = zo, Z2.rest = Tf, Z2.reverse = Eo, Z2.sampleSize = jf, Z2.set = Jc, Z2.setWith = Yc, Z2.shuffle = Af, Z2.slice = So, Z2.sortBy = oh, Z2.sortedUniq = $o, Z2.sortedUniqBy = Do, Z2.split = da, Z2.spread = $f, Z2.tail = Mo, Z2.take = Fo, Z2.takeRight = No, Z2.takeRightWhile = Po, Z2.takeWhile = qo, Z2.tap = Xo, Z2.throttle = Df, Z2.thru = nf, Z2.toArray = jc, Z2.toPairs = Ph, Z2.toPairsIn = qh, Z2.toPath = Ha, Z2.toPlainObject = Rc, Z2.transform = Qc, Z2.unary = Mf, Z2.union = Ps, Z2.unionBy = qs, Z2.unionWith = Zs, Z2.uniq = Zo, Z2.uniqBy = Ko, Z2.uniqWith = Vo, Z2.unset = Xc, Z2.unzip = Go, Z2.unzipWith = Ho, Z2.update = na, Z2.updateWith = ta, Z2.values = ra, Z2.valuesIn = ea, Z2.without = Ks, Z2.words = Ra, Z2.wrap = Ff, Z2.xor = Vs, Z2.xorBy = Gs, Z2.xorWith = Hs, Z2.zip = Js, Z2.zipObject = Jo, Z2.zipObjectDeep = Yo, Z2.zipWith = Ys, Z2.entries = Ph, Z2.entriesIn = qh, Z2.extend = Eh, Z2.extendWith = Sh, Ta(Z2, Z2), Z2.add = lp, Z2.attempt = Xh, Z2.camelCase = Zh, Z2.capitalize = fa, Z2.ceil = sp, Z2.clamp = ua, Z2.clone = Pf, Z2.cloneDeep = Zf, Z2.cloneDeepWith = Kf, Z2.cloneWith = qf, Z2.conformsTo = Vf, Z2.deburr = ca, Z2.defaultTo = Wa, Z2.divide = hp, Z2.endsWith = aa, Z2.eq = Gf, Z2.escape = la, Z2.escapeRegExp = sa, Z2.every = af, Z2.find = nh, Z2.findIndex = ho, Z2.findKey = Wc, Z2.findLast = th, Z2.findLastIndex = po, Z2.findLastKey = Lc, Z2.floor = pp, Z2.forEach = _f, Z2.forEachRight = vf, Z2.forIn = Cc, Z2.forInRight = Uc, Z2.forOwn = Bc, Z2.forOwnRight = Tc, Z2.get = Mc, Z2.gt = gh, Z2.gte = yh, Z2.has = Fc, Z2.hasIn = Nc, Z2.head = bo, Z2.identity = La, Z2.includes = gf, Z2.indexOf = wo, Z2.inRange = ia, Z2.invoke = $h, Z2.isArguments = dh, Z2.isArray = bh, Z2.isArrayBuffer = wh, Z2.isArrayLike = Hf, Z2.isArrayLikeObject = Jf, Z2.isBoolean = Yf, Z2.isBuffer = mh, Z2.isDate = xh, Z2.isElement = Qf, Z2.isEmpty = Xf, Z2.isEqual = nc, Z2.isEqualWith = tc, Z2.isError = rc, Z2.isFinite = ec, Z2.isFunction = uc, Z2.isInteger = ic, Z2.isLength = oc, Z2.isMap = jh, Z2.isMatch = ac, Z2.isMatchWith = lc, Z2.isNaN = sc, Z2.isNative = hc, Z2.isNil = _c, Z2.isNull = pc, Z2.isNumber = vc, Z2.isObject = fc, Z2.isObjectLike = cc, Z2.isPlainObject = gc, Z2.isRegExp = Ah, Z2.isSafeInteger = yc, Z2.isSet = kh, Z2.isString = dc, Z2.isSymbol = bc, Z2.isTypedArray = Oh, Z2.isUndefined = wc, Z2.isWeakMap = mc, Z2.isWeakSet = xc, Z2.join = xo, Z2.kebabCase = Kh, Z2.last = jo, Z2.lastIndexOf = Ao, Z2.lowerCase = Vh, Z2.lowerFirst = Gh, Z2.lt = Ih, Z2.lte = Rh, Z2.max = Ya, Z2.maxBy = Qa, Z2.mean = Xa, Z2.meanBy = nl, Z2.min = tl, Z2.minBy = rl, Z2.stubArray = Pa, Z2.stubFalse = qa, Z2.stubObject = Za, Z2.stubString = Ka, Z2.stubTrue = Va, Z2.multiply = _p, Z2.nth = ko, Z2.noConflict = $a, Z2.noop = Da, Z2.now = fh, Z2.pad = ha, Z2.padEnd = pa, Z2.padStart = _a, Z2.parseInt = va, Z2.random = oa, Z2.reduce = bf, Z2.reduceRight = wf, Z2.repeat = ga, Z2.replace = ya, Z2.result = Hc, Z2.round = vp, Z2.runInContext = p2, Z2.sample = xf, Z2.size = kf, Z2.snakeCase = Hh, Z2.some = Of, Z2.sortedIndex = Wo, Z2.sortedIndexBy = Lo, Z2.sortedIndexOf = Co, Z2.sortedLastIndex = Uo, Z2.sortedLastIndexBy = Bo, Z2.sortedLastIndexOf = To, Z2.startCase = Jh, Z2.startsWith = ba, Z2.subtract = gp, Z2.sum = el, Z2.sumBy = ul, Z2.template = wa, Z2.times = Ga, Z2.toFinite = Ac, Z2.toInteger = kc, Z2.toLength = Oc, Z2.toLower = ma, Z2.toNumber = Ic, Z2.toSafeInteger = zc, Z2.toString = Ec, Z2.toUpper = xa, Z2.trim = ja, Z2.trimEnd = Aa, Z2.trimStart = ka, Z2.truncate = Oa, Z2.unescape = Ia, Z2.uniqueId = Ja, Z2.upperCase = Yh, Z2.upperFirst = Qh, Z2.each = _f, Z2.eachRight = vf, Z2.first = bo, Ta(Z2, function() {
|
|
var n2 = {};
|
|
return ue2(Z2, function(t2, r2) {
|
|
bl.call(Z2.prototype, r2) || (n2[r2] = t2);
|
|
}), n2;
|
|
}(), { chain: false }), Z2.VERSION = nn, r(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(n2) {
|
|
Z2[n2].placeholder = Z2;
|
|
}), r(["drop", "take"], function(n2, t2) {
|
|
Ct2.prototype[n2] = function(r2) {
|
|
r2 = r2 === X ? 1 : Gl(kc(r2), 0);
|
|
var e2 = this.__filtered__ && !t2 ? new Ct2(this) : this.clone();
|
|
return e2.__filtered__ ? e2.__takeCount__ = Hl(r2, e2.__takeCount__) : e2.__views__.push({ size: Hl(r2, Un), type: n2 + (e2.__dir__ < 0 ? "Right" : "") }), e2;
|
|
}, Ct2.prototype[n2 + "Right"] = function(t3) {
|
|
return this.reverse()[n2](t3).reverse();
|
|
};
|
|
}), r(["filter", "map", "takeWhile"], function(n2, t2) {
|
|
var r2 = t2 + 1, e2 = r2 == Rn || r2 == En;
|
|
Ct2.prototype[n2] = function(n3) {
|
|
var t3 = this.clone();
|
|
return t3.__iteratees__.push({ iteratee: mi(n3, 3), type: r2 }), t3.__filtered__ = t3.__filtered__ || e2, t3;
|
|
};
|
|
}), r(["head", "last"], function(n2, t2) {
|
|
var r2 = "take" + (t2 ? "Right" : "");
|
|
Ct2.prototype[n2] = function() {
|
|
return this[r2](1).value()[0];
|
|
};
|
|
}), r(["initial", "tail"], function(n2, t2) {
|
|
var r2 = "drop" + (t2 ? "" : "Right");
|
|
Ct2.prototype[n2] = function() {
|
|
return this.__filtered__ ? new Ct2(this) : this[r2](1);
|
|
};
|
|
}), Ct2.prototype.compact = function() {
|
|
return this.filter(La);
|
|
}, Ct2.prototype.find = function(n2) {
|
|
return this.filter(n2).head();
|
|
}, Ct2.prototype.findLast = function(n2) {
|
|
return this.reverse().find(n2);
|
|
}, Ct2.prototype.invokeMap = uu(function(n2, t2) {
|
|
return "function" == typeof n2 ? new Ct2(this) : this.map(function(r2) {
|
|
return Ie(r2, n2, t2);
|
|
});
|
|
}), Ct2.prototype.reject = function(n2) {
|
|
return this.filter(Uf(mi(n2)));
|
|
}, Ct2.prototype.slice = function(n2, t2) {
|
|
n2 = kc(n2);
|
|
var r2 = this;
|
|
return r2.__filtered__ && (n2 > 0 || t2 < 0) ? new Ct2(r2) : (n2 < 0 ? r2 = r2.takeRight(-n2) : n2 && (r2 = r2.drop(n2)), t2 !== X && (t2 = kc(t2), r2 = t2 < 0 ? r2.dropRight(-t2) : r2.take(t2 - n2)), r2);
|
|
}, Ct2.prototype.takeRightWhile = function(n2) {
|
|
return this.reverse().takeWhile(n2).reverse();
|
|
}, Ct2.prototype.toArray = function() {
|
|
return this.take(Un);
|
|
}, ue2(Ct2.prototype, function(n2, t2) {
|
|
var r2 = /^(?:filter|find|map|reject)|While$/.test(t2), e2 = /^(?:head|last)$/.test(t2), u2 = Z2[e2 ? "take" + ("last" == t2 ? "Right" : "") : t2], i2 = e2 || /^find/.test(t2);
|
|
u2 && (Z2.prototype[t2] = function() {
|
|
var t3 = this.__wrapped__, o2 = e2 ? [1] : arguments, f2 = t3 instanceof Ct2, c2 = o2[0], l2 = f2 || bh(t3), s2 = function(n3) {
|
|
var t4 = u2.apply(Z2, a([n3], o2));
|
|
return e2 && h2 ? t4[0] : t4;
|
|
};
|
|
l2 && r2 && "function" == typeof c2 && 1 != c2.length && (f2 = l2 = false);
|
|
var h2 = this.__chain__, p3 = !!this.__actions__.length, _2 = i2 && !h2, v2 = f2 && !p3;
|
|
if (!i2 && l2) {
|
|
t3 = v2 ? t3 : new Ct2(this);
|
|
var g2 = n2.apply(t3, o2);
|
|
return g2.__actions__.push({ func: nf, args: [s2], thisArg: X }), new Y2(g2, h2);
|
|
}
|
|
return _2 && v2 ? n2.apply(this, o2) : (g2 = this.thru(s2), _2 ? e2 ? g2.value()[0] : g2.value() : g2);
|
|
});
|
|
}), r(["pop", "push", "shift", "sort", "splice", "unshift"], function(n2) {
|
|
var t2 = _l[n2], r2 = /^(?:push|sort|unshift)$/.test(n2) ? "tap" : "thru", e2 = /^(?:pop|shift)$/.test(n2);
|
|
Z2.prototype[n2] = function() {
|
|
var n3 = arguments;
|
|
if (e2 && !this.__chain__) {
|
|
var u2 = this.value();
|
|
return t2.apply(bh(u2) ? u2 : [], n3);
|
|
}
|
|
return this[r2](function(r3) {
|
|
return t2.apply(bh(r3) ? r3 : [], n3);
|
|
});
|
|
};
|
|
}), ue2(Ct2.prototype, function(n2, t2) {
|
|
var r2 = Z2[t2];
|
|
if (r2) {
|
|
var e2 = r2.name + "";
|
|
bl.call(fs, e2) || (fs[e2] = []), fs[e2].push({ name: t2, func: r2 });
|
|
}
|
|
}), fs[Qu(X, vn).name] = [{ name: "wrapper", func: X }], Ct2.prototype.clone = $t2, Ct2.prototype.reverse = Yt2, Ct2.prototype.value = Qt2, Z2.prototype.at = Qs, Z2.prototype.chain = tf, Z2.prototype.commit = rf, Z2.prototype.next = ef, Z2.prototype.plant = of, Z2.prototype.reverse = ff, Z2.prototype.toJSON = Z2.prototype.valueOf = Z2.prototype.value = cf, Z2.prototype.first = Z2.prototype.head, Ul && (Z2.prototype[Ul] = uf), Z2;
|
|
}, be = de();
|
|
"function" == typeof define && "object" == typeof define.amd && define.amd ? (re._ = be, define(function() {
|
|
return be;
|
|
})) : ue ? ((ue.exports = be)._ = be, ee._ = be) : re._ = be;
|
|
}).call(exports);
|
|
}
|
|
});
|
|
|
|
// node_modules/lodash/fp/_mapping.js
|
|
var require_mapping = __commonJS({
|
|
"node_modules/lodash/fp/_mapping.js"(exports) {
|
|
exports.aliasToReal = {
|
|
// Lodash aliases.
|
|
"each": "forEach",
|
|
"eachRight": "forEachRight",
|
|
"entries": "toPairs",
|
|
"entriesIn": "toPairsIn",
|
|
"extend": "assignIn",
|
|
"extendAll": "assignInAll",
|
|
"extendAllWith": "assignInAllWith",
|
|
"extendWith": "assignInWith",
|
|
"first": "head",
|
|
// Methods that are curried variants of others.
|
|
"conforms": "conformsTo",
|
|
"matches": "isMatch",
|
|
"property": "get",
|
|
// Ramda aliases.
|
|
"__": "placeholder",
|
|
"F": "stubFalse",
|
|
"T": "stubTrue",
|
|
"all": "every",
|
|
"allPass": "overEvery",
|
|
"always": "constant",
|
|
"any": "some",
|
|
"anyPass": "overSome",
|
|
"apply": "spread",
|
|
"assoc": "set",
|
|
"assocPath": "set",
|
|
"complement": "negate",
|
|
"compose": "flowRight",
|
|
"contains": "includes",
|
|
"dissoc": "unset",
|
|
"dissocPath": "unset",
|
|
"dropLast": "dropRight",
|
|
"dropLastWhile": "dropRightWhile",
|
|
"equals": "isEqual",
|
|
"identical": "eq",
|
|
"indexBy": "keyBy",
|
|
"init": "initial",
|
|
"invertObj": "invert",
|
|
"juxt": "over",
|
|
"omitAll": "omit",
|
|
"nAry": "ary",
|
|
"path": "get",
|
|
"pathEq": "matchesProperty",
|
|
"pathOr": "getOr",
|
|
"paths": "at",
|
|
"pickAll": "pick",
|
|
"pipe": "flow",
|
|
"pluck": "map",
|
|
"prop": "get",
|
|
"propEq": "matchesProperty",
|
|
"propOr": "getOr",
|
|
"props": "at",
|
|
"symmetricDifference": "xor",
|
|
"symmetricDifferenceBy": "xorBy",
|
|
"symmetricDifferenceWith": "xorWith",
|
|
"takeLast": "takeRight",
|
|
"takeLastWhile": "takeRightWhile",
|
|
"unapply": "rest",
|
|
"unnest": "flatten",
|
|
"useWith": "overArgs",
|
|
"where": "conformsTo",
|
|
"whereEq": "isMatch",
|
|
"zipObj": "zipObject"
|
|
};
|
|
exports.aryMethod = {
|
|
"1": [
|
|
"assignAll",
|
|
"assignInAll",
|
|
"attempt",
|
|
"castArray",
|
|
"ceil",
|
|
"create",
|
|
"curry",
|
|
"curryRight",
|
|
"defaultsAll",
|
|
"defaultsDeepAll",
|
|
"floor",
|
|
"flow",
|
|
"flowRight",
|
|
"fromPairs",
|
|
"invert",
|
|
"iteratee",
|
|
"memoize",
|
|
"method",
|
|
"mergeAll",
|
|
"methodOf",
|
|
"mixin",
|
|
"nthArg",
|
|
"over",
|
|
"overEvery",
|
|
"overSome",
|
|
"rest",
|
|
"reverse",
|
|
"round",
|
|
"runInContext",
|
|
"spread",
|
|
"template",
|
|
"trim",
|
|
"trimEnd",
|
|
"trimStart",
|
|
"uniqueId",
|
|
"words",
|
|
"zipAll"
|
|
],
|
|
"2": [
|
|
"add",
|
|
"after",
|
|
"ary",
|
|
"assign",
|
|
"assignAllWith",
|
|
"assignIn",
|
|
"assignInAllWith",
|
|
"at",
|
|
"before",
|
|
"bind",
|
|
"bindAll",
|
|
"bindKey",
|
|
"chunk",
|
|
"cloneDeepWith",
|
|
"cloneWith",
|
|
"concat",
|
|
"conformsTo",
|
|
"countBy",
|
|
"curryN",
|
|
"curryRightN",
|
|
"debounce",
|
|
"defaults",
|
|
"defaultsDeep",
|
|
"defaultTo",
|
|
"delay",
|
|
"difference",
|
|
"divide",
|
|
"drop",
|
|
"dropRight",
|
|
"dropRightWhile",
|
|
"dropWhile",
|
|
"endsWith",
|
|
"eq",
|
|
"every",
|
|
"filter",
|
|
"find",
|
|
"findIndex",
|
|
"findKey",
|
|
"findLast",
|
|
"findLastIndex",
|
|
"findLastKey",
|
|
"flatMap",
|
|
"flatMapDeep",
|
|
"flattenDepth",
|
|
"forEach",
|
|
"forEachRight",
|
|
"forIn",
|
|
"forInRight",
|
|
"forOwn",
|
|
"forOwnRight",
|
|
"get",
|
|
"groupBy",
|
|
"gt",
|
|
"gte",
|
|
"has",
|
|
"hasIn",
|
|
"includes",
|
|
"indexOf",
|
|
"intersection",
|
|
"invertBy",
|
|
"invoke",
|
|
"invokeMap",
|
|
"isEqual",
|
|
"isMatch",
|
|
"join",
|
|
"keyBy",
|
|
"lastIndexOf",
|
|
"lt",
|
|
"lte",
|
|
"map",
|
|
"mapKeys",
|
|
"mapValues",
|
|
"matchesProperty",
|
|
"maxBy",
|
|
"meanBy",
|
|
"merge",
|
|
"mergeAllWith",
|
|
"minBy",
|
|
"multiply",
|
|
"nth",
|
|
"omit",
|
|
"omitBy",
|
|
"overArgs",
|
|
"pad",
|
|
"padEnd",
|
|
"padStart",
|
|
"parseInt",
|
|
"partial",
|
|
"partialRight",
|
|
"partition",
|
|
"pick",
|
|
"pickBy",
|
|
"propertyOf",
|
|
"pull",
|
|
"pullAll",
|
|
"pullAt",
|
|
"random",
|
|
"range",
|
|
"rangeRight",
|
|
"rearg",
|
|
"reject",
|
|
"remove",
|
|
"repeat",
|
|
"restFrom",
|
|
"result",
|
|
"sampleSize",
|
|
"some",
|
|
"sortBy",
|
|
"sortedIndex",
|
|
"sortedIndexOf",
|
|
"sortedLastIndex",
|
|
"sortedLastIndexOf",
|
|
"sortedUniqBy",
|
|
"split",
|
|
"spreadFrom",
|
|
"startsWith",
|
|
"subtract",
|
|
"sumBy",
|
|
"take",
|
|
"takeRight",
|
|
"takeRightWhile",
|
|
"takeWhile",
|
|
"tap",
|
|
"throttle",
|
|
"thru",
|
|
"times",
|
|
"trimChars",
|
|
"trimCharsEnd",
|
|
"trimCharsStart",
|
|
"truncate",
|
|
"union",
|
|
"uniqBy",
|
|
"uniqWith",
|
|
"unset",
|
|
"unzipWith",
|
|
"without",
|
|
"wrap",
|
|
"xor",
|
|
"zip",
|
|
"zipObject",
|
|
"zipObjectDeep"
|
|
],
|
|
"3": [
|
|
"assignInWith",
|
|
"assignWith",
|
|
"clamp",
|
|
"differenceBy",
|
|
"differenceWith",
|
|
"findFrom",
|
|
"findIndexFrom",
|
|
"findLastFrom",
|
|
"findLastIndexFrom",
|
|
"getOr",
|
|
"includesFrom",
|
|
"indexOfFrom",
|
|
"inRange",
|
|
"intersectionBy",
|
|
"intersectionWith",
|
|
"invokeArgs",
|
|
"invokeArgsMap",
|
|
"isEqualWith",
|
|
"isMatchWith",
|
|
"flatMapDepth",
|
|
"lastIndexOfFrom",
|
|
"mergeWith",
|
|
"orderBy",
|
|
"padChars",
|
|
"padCharsEnd",
|
|
"padCharsStart",
|
|
"pullAllBy",
|
|
"pullAllWith",
|
|
"rangeStep",
|
|
"rangeStepRight",
|
|
"reduce",
|
|
"reduceRight",
|
|
"replace",
|
|
"set",
|
|
"slice",
|
|
"sortedIndexBy",
|
|
"sortedLastIndexBy",
|
|
"transform",
|
|
"unionBy",
|
|
"unionWith",
|
|
"update",
|
|
"xorBy",
|
|
"xorWith",
|
|
"zipWith"
|
|
],
|
|
"4": [
|
|
"fill",
|
|
"setWith",
|
|
"updateWith"
|
|
]
|
|
};
|
|
exports.aryRearg = {
|
|
"2": [1, 0],
|
|
"3": [2, 0, 1],
|
|
"4": [3, 2, 0, 1]
|
|
};
|
|
exports.iterateeAry = {
|
|
"dropRightWhile": 1,
|
|
"dropWhile": 1,
|
|
"every": 1,
|
|
"filter": 1,
|
|
"find": 1,
|
|
"findFrom": 1,
|
|
"findIndex": 1,
|
|
"findIndexFrom": 1,
|
|
"findKey": 1,
|
|
"findLast": 1,
|
|
"findLastFrom": 1,
|
|
"findLastIndex": 1,
|
|
"findLastIndexFrom": 1,
|
|
"findLastKey": 1,
|
|
"flatMap": 1,
|
|
"flatMapDeep": 1,
|
|
"flatMapDepth": 1,
|
|
"forEach": 1,
|
|
"forEachRight": 1,
|
|
"forIn": 1,
|
|
"forInRight": 1,
|
|
"forOwn": 1,
|
|
"forOwnRight": 1,
|
|
"map": 1,
|
|
"mapKeys": 1,
|
|
"mapValues": 1,
|
|
"partition": 1,
|
|
"reduce": 2,
|
|
"reduceRight": 2,
|
|
"reject": 1,
|
|
"remove": 1,
|
|
"some": 1,
|
|
"takeRightWhile": 1,
|
|
"takeWhile": 1,
|
|
"times": 1,
|
|
"transform": 2
|
|
};
|
|
exports.iterateeRearg = {
|
|
"mapKeys": [1],
|
|
"reduceRight": [1, 0]
|
|
};
|
|
exports.methodRearg = {
|
|
"assignInAllWith": [1, 0],
|
|
"assignInWith": [1, 2, 0],
|
|
"assignAllWith": [1, 0],
|
|
"assignWith": [1, 2, 0],
|
|
"differenceBy": [1, 2, 0],
|
|
"differenceWith": [1, 2, 0],
|
|
"getOr": [2, 1, 0],
|
|
"intersectionBy": [1, 2, 0],
|
|
"intersectionWith": [1, 2, 0],
|
|
"isEqualWith": [1, 2, 0],
|
|
"isMatchWith": [2, 1, 0],
|
|
"mergeAllWith": [1, 0],
|
|
"mergeWith": [1, 2, 0],
|
|
"padChars": [2, 1, 0],
|
|
"padCharsEnd": [2, 1, 0],
|
|
"padCharsStart": [2, 1, 0],
|
|
"pullAllBy": [2, 1, 0],
|
|
"pullAllWith": [2, 1, 0],
|
|
"rangeStep": [1, 2, 0],
|
|
"rangeStepRight": [1, 2, 0],
|
|
"setWith": [3, 1, 2, 0],
|
|
"sortedIndexBy": [2, 1, 0],
|
|
"sortedLastIndexBy": [2, 1, 0],
|
|
"unionBy": [1, 2, 0],
|
|
"unionWith": [1, 2, 0],
|
|
"updateWith": [3, 1, 2, 0],
|
|
"xorBy": [1, 2, 0],
|
|
"xorWith": [1, 2, 0],
|
|
"zipWith": [1, 2, 0]
|
|
};
|
|
exports.methodSpread = {
|
|
"assignAll": { "start": 0 },
|
|
"assignAllWith": { "start": 0 },
|
|
"assignInAll": { "start": 0 },
|
|
"assignInAllWith": { "start": 0 },
|
|
"defaultsAll": { "start": 0 },
|
|
"defaultsDeepAll": { "start": 0 },
|
|
"invokeArgs": { "start": 2 },
|
|
"invokeArgsMap": { "start": 2 },
|
|
"mergeAll": { "start": 0 },
|
|
"mergeAllWith": { "start": 0 },
|
|
"partial": { "start": 1 },
|
|
"partialRight": { "start": 1 },
|
|
"without": { "start": 1 },
|
|
"zipAll": { "start": 0 }
|
|
};
|
|
exports.mutate = {
|
|
"array": {
|
|
"fill": true,
|
|
"pull": true,
|
|
"pullAll": true,
|
|
"pullAllBy": true,
|
|
"pullAllWith": true,
|
|
"pullAt": true,
|
|
"remove": true,
|
|
"reverse": true
|
|
},
|
|
"object": {
|
|
"assign": true,
|
|
"assignAll": true,
|
|
"assignAllWith": true,
|
|
"assignIn": true,
|
|
"assignInAll": true,
|
|
"assignInAllWith": true,
|
|
"assignInWith": true,
|
|
"assignWith": true,
|
|
"defaults": true,
|
|
"defaultsAll": true,
|
|
"defaultsDeep": true,
|
|
"defaultsDeepAll": true,
|
|
"merge": true,
|
|
"mergeAll": true,
|
|
"mergeAllWith": true,
|
|
"mergeWith": true
|
|
},
|
|
"set": {
|
|
"set": true,
|
|
"setWith": true,
|
|
"unset": true,
|
|
"update": true,
|
|
"updateWith": true
|
|
}
|
|
};
|
|
exports.realToAlias = function() {
|
|
var hasOwnProperty = Object.prototype.hasOwnProperty, object = exports.aliasToReal, result = {};
|
|
for (var key in object) {
|
|
var value = object[key];
|
|
if (hasOwnProperty.call(result, value)) {
|
|
result[value].push(key);
|
|
} else {
|
|
result[value] = [key];
|
|
}
|
|
}
|
|
return result;
|
|
}();
|
|
exports.remap = {
|
|
"assignAll": "assign",
|
|
"assignAllWith": "assignWith",
|
|
"assignInAll": "assignIn",
|
|
"assignInAllWith": "assignInWith",
|
|
"curryN": "curry",
|
|
"curryRightN": "curryRight",
|
|
"defaultsAll": "defaults",
|
|
"defaultsDeepAll": "defaultsDeep",
|
|
"findFrom": "find",
|
|
"findIndexFrom": "findIndex",
|
|
"findLastFrom": "findLast",
|
|
"findLastIndexFrom": "findLastIndex",
|
|
"getOr": "get",
|
|
"includesFrom": "includes",
|
|
"indexOfFrom": "indexOf",
|
|
"invokeArgs": "invoke",
|
|
"invokeArgsMap": "invokeMap",
|
|
"lastIndexOfFrom": "lastIndexOf",
|
|
"mergeAll": "merge",
|
|
"mergeAllWith": "mergeWith",
|
|
"padChars": "pad",
|
|
"padCharsEnd": "padEnd",
|
|
"padCharsStart": "padStart",
|
|
"propertyOf": "get",
|
|
"rangeStep": "range",
|
|
"rangeStepRight": "rangeRight",
|
|
"restFrom": "rest",
|
|
"spreadFrom": "spread",
|
|
"trimChars": "trim",
|
|
"trimCharsEnd": "trimEnd",
|
|
"trimCharsStart": "trimStart",
|
|
"zipAll": "zip"
|
|
};
|
|
exports.skipFixed = {
|
|
"castArray": true,
|
|
"flow": true,
|
|
"flowRight": true,
|
|
"iteratee": true,
|
|
"mixin": true,
|
|
"rearg": true,
|
|
"runInContext": true
|
|
};
|
|
exports.skipRearg = {
|
|
"add": true,
|
|
"assign": true,
|
|
"assignIn": true,
|
|
"bind": true,
|
|
"bindKey": true,
|
|
"concat": true,
|
|
"difference": true,
|
|
"divide": true,
|
|
"eq": true,
|
|
"gt": true,
|
|
"gte": true,
|
|
"isEqual": true,
|
|
"lt": true,
|
|
"lte": true,
|
|
"matchesProperty": true,
|
|
"merge": true,
|
|
"multiply": true,
|
|
"overArgs": true,
|
|
"partial": true,
|
|
"partialRight": true,
|
|
"propertyOf": true,
|
|
"random": true,
|
|
"range": true,
|
|
"rangeRight": true,
|
|
"subtract": true,
|
|
"zip": true,
|
|
"zipObject": true,
|
|
"zipObjectDeep": true
|
|
};
|
|
}
|
|
});
|
|
|
|
// node_modules/lodash/fp/placeholder.js
|
|
var require_placeholder = __commonJS({
|
|
"node_modules/lodash/fp/placeholder.js"(exports, module2) {
|
|
module2.exports = {};
|
|
}
|
|
});
|
|
|
|
// node_modules/lodash/fp/_baseConvert.js
|
|
var require_baseConvert = __commonJS({
|
|
"node_modules/lodash/fp/_baseConvert.js"(exports, module2) {
|
|
var mapping = require_mapping();
|
|
var fallbackHolder = require_placeholder();
|
|
var push = Array.prototype.push;
|
|
function baseArity(func, n) {
|
|
return n == 2 ? function(a, b) {
|
|
return func.apply(void 0, arguments);
|
|
} : function(a) {
|
|
return func.apply(void 0, arguments);
|
|
};
|
|
}
|
|
function baseAry(func, n) {
|
|
return n == 2 ? function(a, b) {
|
|
return func(a, b);
|
|
} : function(a) {
|
|
return func(a);
|
|
};
|
|
}
|
|
function cloneArray(array) {
|
|
var length = array ? array.length : 0, result = Array(length);
|
|
while (length--) {
|
|
result[length] = array[length];
|
|
}
|
|
return result;
|
|
}
|
|
function createCloner(func) {
|
|
return function(object) {
|
|
return func({}, object);
|
|
};
|
|
}
|
|
function flatSpread(func, start) {
|
|
return function() {
|
|
var length = arguments.length, lastIndex = length - 1, args = Array(length);
|
|
while (length--) {
|
|
args[length] = arguments[length];
|
|
}
|
|
var array = args[start], otherArgs = args.slice(0, start);
|
|
if (array) {
|
|
push.apply(otherArgs, array);
|
|
}
|
|
if (start != lastIndex) {
|
|
push.apply(otherArgs, args.slice(start + 1));
|
|
}
|
|
return func.apply(this, otherArgs);
|
|
};
|
|
}
|
|
function wrapImmutable(func, cloner) {
|
|
return function() {
|
|
var length = arguments.length;
|
|
if (!length) {
|
|
return;
|
|
}
|
|
var args = Array(length);
|
|
while (length--) {
|
|
args[length] = arguments[length];
|
|
}
|
|
var result = args[0] = cloner.apply(void 0, args);
|
|
func.apply(void 0, args);
|
|
return result;
|
|
};
|
|
}
|
|
function baseConvert(util, name, func, options) {
|
|
var isLib = typeof name == "function", isObj = name === Object(name);
|
|
if (isObj) {
|
|
options = func;
|
|
func = name;
|
|
name = void 0;
|
|
}
|
|
if (func == null) {
|
|
throw new TypeError();
|
|
}
|
|
options || (options = {});
|
|
var config = {
|
|
"cap": "cap" in options ? options.cap : true,
|
|
"curry": "curry" in options ? options.curry : true,
|
|
"fixed": "fixed" in options ? options.fixed : true,
|
|
"immutable": "immutable" in options ? options.immutable : true,
|
|
"rearg": "rearg" in options ? options.rearg : true
|
|
};
|
|
var defaultHolder = isLib ? func : fallbackHolder, forceCurry = "curry" in options && options.curry, forceFixed = "fixed" in options && options.fixed, forceRearg = "rearg" in options && options.rearg, pristine = isLib ? func.runInContext() : void 0;
|
|
var helpers = isLib ? func : {
|
|
"ary": util.ary,
|
|
"assign": util.assign,
|
|
"clone": util.clone,
|
|
"curry": util.curry,
|
|
"forEach": util.forEach,
|
|
"isArray": util.isArray,
|
|
"isError": util.isError,
|
|
"isFunction": util.isFunction,
|
|
"isWeakMap": util.isWeakMap,
|
|
"iteratee": util.iteratee,
|
|
"keys": util.keys,
|
|
"rearg": util.rearg,
|
|
"toInteger": util.toInteger,
|
|
"toPath": util.toPath
|
|
};
|
|
var ary = helpers.ary, assign2 = helpers.assign, clone = helpers.clone, curry = helpers.curry, each = helpers.forEach, isArray = helpers.isArray, isError = helpers.isError, isFunction = helpers.isFunction, isWeakMap = helpers.isWeakMap, keys = helpers.keys, rearg = helpers.rearg, toInteger = helpers.toInteger, toPath = helpers.toPath;
|
|
var aryMethodKeys = keys(mapping.aryMethod);
|
|
var wrappers = {
|
|
"castArray": function(castArray) {
|
|
return function() {
|
|
var value = arguments[0];
|
|
return isArray(value) ? castArray(cloneArray(value)) : castArray.apply(void 0, arguments);
|
|
};
|
|
},
|
|
"iteratee": function(iteratee) {
|
|
return function() {
|
|
var func2 = arguments[0], arity = arguments[1], result = iteratee(func2, arity), length = result.length;
|
|
if (config.cap && typeof arity == "number") {
|
|
arity = arity > 2 ? arity - 2 : 1;
|
|
return length && length <= arity ? result : baseAry(result, arity);
|
|
}
|
|
return result;
|
|
};
|
|
},
|
|
"mixin": function(mixin) {
|
|
return function(source) {
|
|
var func2 = this;
|
|
if (!isFunction(func2)) {
|
|
return mixin(func2, Object(source));
|
|
}
|
|
var pairs2 = [];
|
|
each(keys(source), function(key) {
|
|
if (isFunction(source[key])) {
|
|
pairs2.push([key, func2.prototype[key]]);
|
|
}
|
|
});
|
|
mixin(func2, Object(source));
|
|
each(pairs2, function(pair) {
|
|
var value = pair[1];
|
|
if (isFunction(value)) {
|
|
func2.prototype[pair[0]] = value;
|
|
} else {
|
|
delete func2.prototype[pair[0]];
|
|
}
|
|
});
|
|
return func2;
|
|
};
|
|
},
|
|
"nthArg": function(nthArg) {
|
|
return function(n) {
|
|
var arity = n < 0 ? 1 : toInteger(n) + 1;
|
|
return curry(nthArg(n), arity);
|
|
};
|
|
},
|
|
"rearg": function(rearg2) {
|
|
return function(func2, indexes) {
|
|
var arity = indexes ? indexes.length : 0;
|
|
return curry(rearg2(func2, indexes), arity);
|
|
};
|
|
},
|
|
"runInContext": function(runInContext) {
|
|
return function(context) {
|
|
return baseConvert(util, runInContext(context), options);
|
|
};
|
|
}
|
|
};
|
|
function castCap(name2, func2) {
|
|
if (config.cap) {
|
|
var indexes = mapping.iterateeRearg[name2];
|
|
if (indexes) {
|
|
return iterateeRearg(func2, indexes);
|
|
}
|
|
var n = !isLib && mapping.iterateeAry[name2];
|
|
if (n) {
|
|
return iterateeAry(func2, n);
|
|
}
|
|
}
|
|
return func2;
|
|
}
|
|
function castCurry(name2, func2, n) {
|
|
return forceCurry || config.curry && n > 1 ? curry(func2, n) : func2;
|
|
}
|
|
function castFixed(name2, func2, n) {
|
|
if (config.fixed && (forceFixed || !mapping.skipFixed[name2])) {
|
|
var data = mapping.methodSpread[name2], start = data && data.start;
|
|
return start === void 0 ? ary(func2, n) : flatSpread(func2, start);
|
|
}
|
|
return func2;
|
|
}
|
|
function castRearg(name2, func2, n) {
|
|
return config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name2]) ? rearg(func2, mapping.methodRearg[name2] || mapping.aryRearg[n]) : func2;
|
|
}
|
|
function cloneByPath(object, path) {
|
|
path = toPath(path);
|
|
var index = -1, length = path.length, lastIndex = length - 1, result = clone(Object(object)), nested = result;
|
|
while (nested != null && ++index < length) {
|
|
var key = path[index], value = nested[key];
|
|
if (value != null && !(isFunction(value) || isError(value) || isWeakMap(value))) {
|
|
nested[key] = clone(index == lastIndex ? value : Object(value));
|
|
}
|
|
nested = nested[key];
|
|
}
|
|
return result;
|
|
}
|
|
function convertLib(options2) {
|
|
return _.runInContext.convert(options2)(void 0);
|
|
}
|
|
function createConverter(name2, func2) {
|
|
var realName = mapping.aliasToReal[name2] || name2, methodName = mapping.remap[realName] || realName, oldOptions = options;
|
|
return function(options2) {
|
|
var newUtil = isLib ? pristine : helpers, newFunc = isLib ? pristine[methodName] : func2, newOptions = assign2(assign2({}, oldOptions), options2);
|
|
return baseConvert(newUtil, realName, newFunc, newOptions);
|
|
};
|
|
}
|
|
function iterateeAry(func2, n) {
|
|
return overArg(func2, function(func3) {
|
|
return typeof func3 == "function" ? baseAry(func3, n) : func3;
|
|
});
|
|
}
|
|
function iterateeRearg(func2, indexes) {
|
|
return overArg(func2, function(func3) {
|
|
var n = indexes.length;
|
|
return baseArity(rearg(baseAry(func3, n), indexes), n);
|
|
});
|
|
}
|
|
function overArg(func2, transform2) {
|
|
return function() {
|
|
var length = arguments.length;
|
|
if (!length) {
|
|
return func2();
|
|
}
|
|
var args = Array(length);
|
|
while (length--) {
|
|
args[length] = arguments[length];
|
|
}
|
|
var index = config.rearg ? 0 : length - 1;
|
|
args[index] = transform2(args[index]);
|
|
return func2.apply(void 0, args);
|
|
};
|
|
}
|
|
function wrap(name2, func2, placeholder) {
|
|
var result, realName = mapping.aliasToReal[name2] || name2, wrapped = func2, wrapper = wrappers[realName];
|
|
if (wrapper) {
|
|
wrapped = wrapper(func2);
|
|
} else if (config.immutable) {
|
|
if (mapping.mutate.array[realName]) {
|
|
wrapped = wrapImmutable(func2, cloneArray);
|
|
} else if (mapping.mutate.object[realName]) {
|
|
wrapped = wrapImmutable(func2, createCloner(func2));
|
|
} else if (mapping.mutate.set[realName]) {
|
|
wrapped = wrapImmutable(func2, cloneByPath);
|
|
}
|
|
}
|
|
each(aryMethodKeys, function(aryKey) {
|
|
each(mapping.aryMethod[aryKey], function(otherName) {
|
|
if (realName == otherName) {
|
|
var data = mapping.methodSpread[realName], afterRearg = data && data.afterRearg;
|
|
result = afterRearg ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey);
|
|
result = castCap(realName, result);
|
|
result = castCurry(realName, result, aryKey);
|
|
return false;
|
|
}
|
|
});
|
|
return !result;
|
|
});
|
|
result || (result = wrapped);
|
|
if (result == func2) {
|
|
result = forceCurry ? curry(result, 1) : function() {
|
|
return func2.apply(this, arguments);
|
|
};
|
|
}
|
|
result.convert = createConverter(realName, func2);
|
|
result.placeholder = func2.placeholder = placeholder;
|
|
return result;
|
|
}
|
|
if (!isObj) {
|
|
return wrap(name, func, defaultHolder);
|
|
}
|
|
var _ = func;
|
|
var pairs = [];
|
|
each(aryMethodKeys, function(aryKey) {
|
|
each(mapping.aryMethod[aryKey], function(key) {
|
|
var func2 = _[mapping.remap[key] || key];
|
|
if (func2) {
|
|
pairs.push([key, wrap(key, func2, _)]);
|
|
}
|
|
});
|
|
});
|
|
each(keys(_), function(key) {
|
|
var func2 = _[key];
|
|
if (typeof func2 == "function") {
|
|
var length = pairs.length;
|
|
while (length--) {
|
|
if (pairs[length][0] == key) {
|
|
return;
|
|
}
|
|
}
|
|
func2.convert = createConverter(key, func2);
|
|
pairs.push([key, func2]);
|
|
}
|
|
});
|
|
each(pairs, function(pair) {
|
|
_[pair[0]] = pair[1];
|
|
});
|
|
_.convert = convertLib;
|
|
_.placeholder = _;
|
|
each(keys(_), function(key) {
|
|
each(mapping.realToAlias[key] || [], function(alias) {
|
|
_[alias] = _[key];
|
|
});
|
|
});
|
|
return _;
|
|
}
|
|
module2.exports = baseConvert;
|
|
}
|
|
});
|
|
|
|
// node_modules/lodash/fp.js
|
|
var require_fp = __commonJS({
|
|
"node_modules/lodash/fp.js"(exports, module2) {
|
|
var _ = require_lodash_min().runInContext();
|
|
module2.exports = require_baseConvert()(_, _);
|
|
}
|
|
});
|
|
|
|
// node_modules/fraction.js/fraction.js
|
|
var require_fraction = __commonJS({
|
|
"node_modules/fraction.js/fraction.js"(exports, module2) {
|
|
(function(root) {
|
|
"use strict";
|
|
var MAX_CYCLE_LEN = 2e3;
|
|
var P = {
|
|
"s": 1,
|
|
"n": 0,
|
|
"d": 1
|
|
};
|
|
function createError(name) {
|
|
function errorConstructor() {
|
|
var temp = Error.apply(this, arguments);
|
|
temp["name"] = this["name"] = name;
|
|
this["stack"] = temp["stack"];
|
|
this["message"] = temp["message"];
|
|
}
|
|
function IntermediateInheritor() {
|
|
}
|
|
IntermediateInheritor.prototype = Error.prototype;
|
|
errorConstructor.prototype = new IntermediateInheritor();
|
|
return errorConstructor;
|
|
}
|
|
var DivisionByZero = Fraction2["DivisionByZero"] = createError("DivisionByZero");
|
|
var InvalidParameter = Fraction2["InvalidParameter"] = createError("InvalidParameter");
|
|
function assign2(n, s) {
|
|
if (isNaN(n = parseInt(n, 10))) {
|
|
throwInvalidParam();
|
|
}
|
|
return n * s;
|
|
}
|
|
function throwInvalidParam() {
|
|
throw new InvalidParameter();
|
|
}
|
|
function factorize(num) {
|
|
var factors = {};
|
|
var n = num;
|
|
var i = 2;
|
|
var s = 4;
|
|
while (s <= n) {
|
|
while (n % i === 0) {
|
|
n /= i;
|
|
factors[i] = (factors[i] || 0) + 1;
|
|
}
|
|
s += 1 + 2 * i++;
|
|
}
|
|
if (n !== num) {
|
|
if (n > 1)
|
|
factors[n] = (factors[n] || 0) + 1;
|
|
} else {
|
|
factors[num] = (factors[num] || 0) + 1;
|
|
}
|
|
return factors;
|
|
}
|
|
var parse = function(p1, p2) {
|
|
var n = 0, d = 1, s = 1;
|
|
var v = 0, w = 0, x = 0, y = 1, z = 1;
|
|
var A = 0, B = 1;
|
|
var C = 1, D = 1;
|
|
var N = 1e7;
|
|
var M;
|
|
if (p1 === void 0 || p1 === null) {
|
|
} else if (p2 !== void 0) {
|
|
n = p1;
|
|
d = p2;
|
|
s = n * d;
|
|
} else
|
|
switch (typeof p1) {
|
|
case "object": {
|
|
if ("d" in p1 && "n" in p1) {
|
|
n = p1["n"];
|
|
d = p1["d"];
|
|
if ("s" in p1)
|
|
n *= p1["s"];
|
|
} else if (0 in p1) {
|
|
n = p1[0];
|
|
if (1 in p1)
|
|
d = p1[1];
|
|
} else {
|
|
throwInvalidParam();
|
|
}
|
|
s = n * d;
|
|
break;
|
|
}
|
|
case "number": {
|
|
if (p1 < 0) {
|
|
s = p1;
|
|
p1 = -p1;
|
|
}
|
|
if (p1 % 1 === 0) {
|
|
n = p1;
|
|
} else if (p1 > 0) {
|
|
if (p1 >= 1) {
|
|
z = Math.pow(10, Math.floor(1 + Math.log(p1) / Math.LN10));
|
|
p1 /= z;
|
|
}
|
|
while (B <= N && D <= N) {
|
|
M = (A + C) / (B + D);
|
|
if (p1 === M) {
|
|
if (B + D <= N) {
|
|
n = A + C;
|
|
d = B + D;
|
|
} else if (D > B) {
|
|
n = C;
|
|
d = D;
|
|
} else {
|
|
n = A;
|
|
d = B;
|
|
}
|
|
break;
|
|
} else {
|
|
if (p1 > M) {
|
|
A += C;
|
|
B += D;
|
|
} else {
|
|
C += A;
|
|
D += B;
|
|
}
|
|
if (B > N) {
|
|
n = C;
|
|
d = D;
|
|
} else {
|
|
n = A;
|
|
d = B;
|
|
}
|
|
}
|
|
}
|
|
n *= z;
|
|
} else if (isNaN(p1) || isNaN(p2)) {
|
|
d = n = NaN;
|
|
}
|
|
break;
|
|
}
|
|
case "string": {
|
|
B = p1.match(/\d+|./g);
|
|
if (B === null)
|
|
throwInvalidParam();
|
|
if (B[A] === "-") {
|
|
s = -1;
|
|
A++;
|
|
} else if (B[A] === "+") {
|
|
A++;
|
|
}
|
|
if (B.length === A + 1) {
|
|
w = assign2(B[A++], s);
|
|
} else if (B[A + 1] === "." || B[A] === ".") {
|
|
if (B[A] !== ".") {
|
|
v = assign2(B[A++], s);
|
|
}
|
|
A++;
|
|
if (A + 1 === B.length || B[A + 1] === "(" && B[A + 3] === ")" || B[A + 1] === "'" && B[A + 3] === "'") {
|
|
w = assign2(B[A], s);
|
|
y = Math.pow(10, B[A].length);
|
|
A++;
|
|
}
|
|
if (B[A] === "(" && B[A + 2] === ")" || B[A] === "'" && B[A + 2] === "'") {
|
|
x = assign2(B[A + 1], s);
|
|
z = Math.pow(10, B[A + 1].length) - 1;
|
|
A += 3;
|
|
}
|
|
} else if (B[A + 1] === "/" || B[A + 1] === ":") {
|
|
w = assign2(B[A], s);
|
|
y = assign2(B[A + 2], 1);
|
|
A += 3;
|
|
} else if (B[A + 3] === "/" && B[A + 1] === " ") {
|
|
v = assign2(B[A], s);
|
|
w = assign2(B[A + 2], s);
|
|
y = assign2(B[A + 4], 1);
|
|
A += 5;
|
|
}
|
|
if (B.length <= A) {
|
|
d = y * z;
|
|
s = /* void */
|
|
n = x + d * v + z * w;
|
|
break;
|
|
}
|
|
}
|
|
default:
|
|
throwInvalidParam();
|
|
}
|
|
if (d === 0) {
|
|
throw new DivisionByZero();
|
|
}
|
|
P["s"] = s < 0 ? -1 : 1;
|
|
P["n"] = Math.abs(n);
|
|
P["d"] = Math.abs(d);
|
|
};
|
|
function modpow(b, e, m) {
|
|
var r = 1;
|
|
for (; e > 0; b = b * b % m, e >>= 1) {
|
|
if (e & 1) {
|
|
r = r * b % m;
|
|
}
|
|
}
|
|
return r;
|
|
}
|
|
function cycleLen(n, d) {
|
|
for (; d % 2 === 0; d /= 2) {
|
|
}
|
|
for (; d % 5 === 0; d /= 5) {
|
|
}
|
|
if (d === 1)
|
|
return 0;
|
|
var rem = 10 % d;
|
|
var t = 1;
|
|
for (; rem !== 1; t++) {
|
|
rem = rem * 10 % d;
|
|
if (t > MAX_CYCLE_LEN)
|
|
return 0;
|
|
}
|
|
return t;
|
|
}
|
|
function cycleStart(n, d, len) {
|
|
var rem1 = 1;
|
|
var rem2 = modpow(10, len, d);
|
|
for (var t = 0; t < 300; t++) {
|
|
if (rem1 === rem2)
|
|
return t;
|
|
rem1 = rem1 * 10 % d;
|
|
rem2 = rem2 * 10 % d;
|
|
}
|
|
return 0;
|
|
}
|
|
function gcd(a, b) {
|
|
if (!a)
|
|
return b;
|
|
if (!b)
|
|
return a;
|
|
while (1) {
|
|
a %= b;
|
|
if (!a)
|
|
return b;
|
|
b %= a;
|
|
if (!b)
|
|
return a;
|
|
}
|
|
}
|
|
;
|
|
function Fraction2(a, b) {
|
|
if (!(this instanceof Fraction2)) {
|
|
return new Fraction2(a, b);
|
|
}
|
|
parse(a, b);
|
|
if (Fraction2["REDUCE"]) {
|
|
a = gcd(P["d"], P["n"]);
|
|
} else {
|
|
a = 1;
|
|
}
|
|
this["s"] = P["s"];
|
|
this["n"] = P["n"] / a;
|
|
this["d"] = P["d"] / a;
|
|
}
|
|
Fraction2["REDUCE"] = 1;
|
|
Fraction2.prototype = {
|
|
"s": 1,
|
|
"n": 0,
|
|
"d": 1,
|
|
/**
|
|
* Calculates the absolute value
|
|
*
|
|
* Ex: new Fraction(-4).abs() => 4
|
|
**/
|
|
"abs": function() {
|
|
return new Fraction2(this["n"], this["d"]);
|
|
},
|
|
/**
|
|
* Inverts the sign of the current fraction
|
|
*
|
|
* Ex: new Fraction(-4).neg() => 4
|
|
**/
|
|
"neg": function() {
|
|
return new Fraction2(-this["s"] * this["n"], this["d"]);
|
|
},
|
|
/**
|
|
* Adds two rational numbers
|
|
*
|
|
* Ex: new Fraction({n: 2, d: 3}).add("14.9") => 467 / 30
|
|
**/
|
|
"add": function(a, b) {
|
|
parse(a, b);
|
|
return new Fraction2(
|
|
this["s"] * this["n"] * P["d"] + P["s"] * this["d"] * P["n"],
|
|
this["d"] * P["d"]
|
|
);
|
|
},
|
|
/**
|
|
* Subtracts two rational numbers
|
|
*
|
|
* Ex: new Fraction({n: 2, d: 3}).add("14.9") => -427 / 30
|
|
**/
|
|
"sub": function(a, b) {
|
|
parse(a, b);
|
|
return new Fraction2(
|
|
this["s"] * this["n"] * P["d"] - P["s"] * this["d"] * P["n"],
|
|
this["d"] * P["d"]
|
|
);
|
|
},
|
|
/**
|
|
* Multiplies two rational numbers
|
|
*
|
|
* Ex: new Fraction("-17.(345)").mul(3) => 5776 / 111
|
|
**/
|
|
"mul": function(a, b) {
|
|
parse(a, b);
|
|
return new Fraction2(
|
|
this["s"] * P["s"] * this["n"] * P["n"],
|
|
this["d"] * P["d"]
|
|
);
|
|
},
|
|
/**
|
|
* Divides two rational numbers
|
|
*
|
|
* Ex: new Fraction("-17.(345)").inverse().div(3)
|
|
**/
|
|
"div": function(a, b) {
|
|
parse(a, b);
|
|
return new Fraction2(
|
|
this["s"] * P["s"] * this["n"] * P["d"],
|
|
this["d"] * P["n"]
|
|
);
|
|
},
|
|
/**
|
|
* Clones the actual object
|
|
*
|
|
* Ex: new Fraction("-17.(345)").clone()
|
|
**/
|
|
"clone": function() {
|
|
return new Fraction2(this);
|
|
},
|
|
/**
|
|
* Calculates the modulo of two rational numbers - a more precise fmod
|
|
*
|
|
* Ex: new Fraction('4.(3)').mod([7, 8]) => (13/3) % (7/8) = (5/6)
|
|
**/
|
|
"mod": function(a, b) {
|
|
if (isNaN(this["n"]) || isNaN(this["d"])) {
|
|
return new Fraction2(NaN);
|
|
}
|
|
if (a === void 0) {
|
|
return new Fraction2(this["s"] * this["n"] % this["d"], 1);
|
|
}
|
|
parse(a, b);
|
|
if (0 === P["n"] && 0 === this["d"]) {
|
|
Fraction2(0, 0);
|
|
}
|
|
return new Fraction2(
|
|
this["s"] * (P["d"] * this["n"]) % (P["n"] * this["d"]),
|
|
P["d"] * this["d"]
|
|
);
|
|
},
|
|
/**
|
|
* Calculates the fractional gcd of two rational numbers
|
|
*
|
|
* Ex: new Fraction(5,8).gcd(3,7) => 1/56
|
|
*/
|
|
"gcd": function(a, b) {
|
|
parse(a, b);
|
|
return new Fraction2(gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]), P["d"] * this["d"]);
|
|
},
|
|
/**
|
|
* Calculates the fractional lcm of two rational numbers
|
|
*
|
|
* Ex: new Fraction(5,8).lcm(3,7) => 15
|
|
*/
|
|
"lcm": function(a, b) {
|
|
parse(a, b);
|
|
if (P["n"] === 0 && this["n"] === 0) {
|
|
return new Fraction2();
|
|
}
|
|
return new Fraction2(P["n"] * this["n"], gcd(P["n"], this["n"]) * gcd(P["d"], this["d"]));
|
|
},
|
|
/**
|
|
* Calculates the ceil of a rational number
|
|
*
|
|
* Ex: new Fraction('4.(3)').ceil() => (5 / 1)
|
|
**/
|
|
"ceil": function(places) {
|
|
places = Math.pow(10, places || 0);
|
|
if (isNaN(this["n"]) || isNaN(this["d"])) {
|
|
return new Fraction2(NaN);
|
|
}
|
|
return new Fraction2(Math.ceil(places * this["s"] * this["n"] / this["d"]), places);
|
|
},
|
|
/**
|
|
* Calculates the floor of a rational number
|
|
*
|
|
* Ex: new Fraction('4.(3)').floor() => (4 / 1)
|
|
**/
|
|
"floor": function(places) {
|
|
places = Math.pow(10, places || 0);
|
|
if (isNaN(this["n"]) || isNaN(this["d"])) {
|
|
return new Fraction2(NaN);
|
|
}
|
|
return new Fraction2(Math.floor(places * this["s"] * this["n"] / this["d"]), places);
|
|
},
|
|
/**
|
|
* Rounds a rational numbers
|
|
*
|
|
* Ex: new Fraction('4.(3)').round() => (4 / 1)
|
|
**/
|
|
"round": function(places) {
|
|
places = Math.pow(10, places || 0);
|
|
if (isNaN(this["n"]) || isNaN(this["d"])) {
|
|
return new Fraction2(NaN);
|
|
}
|
|
return new Fraction2(Math.round(places * this["s"] * this["n"] / this["d"]), places);
|
|
},
|
|
/**
|
|
* Gets the inverse of the fraction, means numerator and denominator are exchanged
|
|
*
|
|
* Ex: new Fraction([-3, 4]).inverse() => -4 / 3
|
|
**/
|
|
"inverse": function() {
|
|
return new Fraction2(this["s"] * this["d"], this["n"]);
|
|
},
|
|
/**
|
|
* Calculates the fraction to some rational exponent, if possible
|
|
*
|
|
* Ex: new Fraction(-1,2).pow(-3) => -8
|
|
*/
|
|
"pow": function(a, b) {
|
|
parse(a, b);
|
|
if (P["d"] === 1) {
|
|
if (P["s"] < 0) {
|
|
return new Fraction2(Math.pow(this["s"] * this["d"], P["n"]), Math.pow(this["n"], P["n"]));
|
|
} else {
|
|
return new Fraction2(Math.pow(this["s"] * this["n"], P["n"]), Math.pow(this["d"], P["n"]));
|
|
}
|
|
}
|
|
if (this["s"] < 0)
|
|
return null;
|
|
var N = factorize(this["n"]);
|
|
var D = factorize(this["d"]);
|
|
var n = 1;
|
|
var d = 1;
|
|
for (var k in N) {
|
|
if (k === "1")
|
|
continue;
|
|
if (k === "0") {
|
|
n = 0;
|
|
break;
|
|
}
|
|
N[k] *= P["n"];
|
|
if (N[k] % P["d"] === 0) {
|
|
N[k] /= P["d"];
|
|
} else
|
|
return null;
|
|
n *= Math.pow(k, N[k]);
|
|
}
|
|
for (var k in D) {
|
|
if (k === "1")
|
|
continue;
|
|
D[k] *= P["n"];
|
|
if (D[k] % P["d"] === 0) {
|
|
D[k] /= P["d"];
|
|
} else
|
|
return null;
|
|
d *= Math.pow(k, D[k]);
|
|
}
|
|
if (P["s"] < 0) {
|
|
return new Fraction2(d, n);
|
|
}
|
|
return new Fraction2(n, d);
|
|
},
|
|
/**
|
|
* Check if two rational numbers are the same
|
|
*
|
|
* Ex: new Fraction(19.6).equals([98, 5]);
|
|
**/
|
|
"equals": function(a, b) {
|
|
parse(a, b);
|
|
return this["s"] * this["n"] * P["d"] === P["s"] * P["n"] * this["d"];
|
|
},
|
|
/**
|
|
* Check if two rational numbers are the same
|
|
*
|
|
* Ex: new Fraction(19.6).equals([98, 5]);
|
|
**/
|
|
"compare": function(a, b) {
|
|
parse(a, b);
|
|
var t = this["s"] * this["n"] * P["d"] - P["s"] * P["n"] * this["d"];
|
|
return (0 < t) - (t < 0);
|
|
},
|
|
"simplify": function(eps) {
|
|
if (isNaN(this["n"]) || isNaN(this["d"])) {
|
|
return this;
|
|
}
|
|
var cont = this["abs"]()["toContinued"]();
|
|
eps = eps || 1e-3;
|
|
function rec(a) {
|
|
if (a.length === 1)
|
|
return new Fraction2(a[0]);
|
|
return rec(a.slice(1))["inverse"]()["add"](a[0]);
|
|
}
|
|
for (var i = 0; i < cont.length; i++) {
|
|
var tmp = rec(cont.slice(0, i + 1));
|
|
if (tmp["sub"](this["abs"]())["abs"]().valueOf() < eps) {
|
|
return tmp["mul"](this["s"]);
|
|
}
|
|
}
|
|
return this;
|
|
},
|
|
/**
|
|
* Check if two rational numbers are divisible
|
|
*
|
|
* Ex: new Fraction(19.6).divisible(1.5);
|
|
*/
|
|
"divisible": function(a, b) {
|
|
parse(a, b);
|
|
return !(!(P["n"] * this["d"]) || this["n"] * P["d"] % (P["n"] * this["d"]));
|
|
},
|
|
/**
|
|
* Returns a decimal representation of the fraction
|
|
*
|
|
* Ex: new Fraction("100.'91823'").valueOf() => 100.91823918239183
|
|
**/
|
|
"valueOf": function() {
|
|
return this["s"] * this["n"] / this["d"];
|
|
},
|
|
/**
|
|
* Returns a string-fraction representation of a Fraction object
|
|
*
|
|
* Ex: new Fraction("1.'3'").toFraction() => "4 1/3"
|
|
**/
|
|
"toFraction": function(excludeWhole) {
|
|
var whole, str = "";
|
|
var n = this["n"];
|
|
var d = this["d"];
|
|
if (this["s"] < 0) {
|
|
str += "-";
|
|
}
|
|
if (d === 1) {
|
|
str += n;
|
|
} else {
|
|
if (excludeWhole && (whole = Math.floor(n / d)) > 0) {
|
|
str += whole;
|
|
str += " ";
|
|
n %= d;
|
|
}
|
|
str += n;
|
|
str += "/";
|
|
str += d;
|
|
}
|
|
return str;
|
|
},
|
|
/**
|
|
* Returns a latex representation of a Fraction object
|
|
*
|
|
* Ex: new Fraction("1.'3'").toLatex() => "\frac{4}{3}"
|
|
**/
|
|
"toLatex": function(excludeWhole) {
|
|
var whole, str = "";
|
|
var n = this["n"];
|
|
var d = this["d"];
|
|
if (this["s"] < 0) {
|
|
str += "-";
|
|
}
|
|
if (d === 1) {
|
|
str += n;
|
|
} else {
|
|
if (excludeWhole && (whole = Math.floor(n / d)) > 0) {
|
|
str += whole;
|
|
n %= d;
|
|
}
|
|
str += "\\frac{";
|
|
str += n;
|
|
str += "}{";
|
|
str += d;
|
|
str += "}";
|
|
}
|
|
return str;
|
|
},
|
|
/**
|
|
* Returns an array of continued fraction elements
|
|
*
|
|
* Ex: new Fraction("7/8").toContinued() => [0,1,7]
|
|
*/
|
|
"toContinued": function() {
|
|
var t;
|
|
var a = this["n"];
|
|
var b = this["d"];
|
|
var res = [];
|
|
if (isNaN(a) || isNaN(b)) {
|
|
return res;
|
|
}
|
|
do {
|
|
res.push(Math.floor(a / b));
|
|
t = a % b;
|
|
a = b;
|
|
b = t;
|
|
} while (a !== 1);
|
|
return res;
|
|
},
|
|
/**
|
|
* Creates a string representation of a fraction with all digits
|
|
*
|
|
* Ex: new Fraction("100.'91823'").toString() => "100.(91823)"
|
|
**/
|
|
"toString": function(dec) {
|
|
var g;
|
|
var N = this["n"];
|
|
var D = this["d"];
|
|
if (isNaN(N) || isNaN(D)) {
|
|
return "NaN";
|
|
}
|
|
if (!Fraction2["REDUCE"]) {
|
|
g = gcd(N, D);
|
|
N /= g;
|
|
D /= g;
|
|
}
|
|
dec = dec || 15;
|
|
var cycLen = cycleLen(N, D);
|
|
var cycOff = cycleStart(N, D, cycLen);
|
|
var str = this["s"] === -1 ? "-" : "";
|
|
str += N / D | 0;
|
|
N %= D;
|
|
N *= 10;
|
|
if (N)
|
|
str += ".";
|
|
if (cycLen) {
|
|
for (var i = cycOff; i--; ) {
|
|
str += N / D | 0;
|
|
N %= D;
|
|
N *= 10;
|
|
}
|
|
str += "(";
|
|
for (var i = cycLen; i--; ) {
|
|
str += N / D | 0;
|
|
N %= D;
|
|
N *= 10;
|
|
}
|
|
str += ")";
|
|
} else {
|
|
for (var i = dec; N && i--; ) {
|
|
str += N / D | 0;
|
|
N %= D;
|
|
N *= 10;
|
|
}
|
|
}
|
|
return str;
|
|
}
|
|
};
|
|
if (typeof define === "function" && define["amd"]) {
|
|
define([], function() {
|
|
return Fraction2;
|
|
});
|
|
} else if (typeof exports === "object") {
|
|
Object.defineProperty(Fraction2, "__esModule", { "value": true });
|
|
Fraction2["default"] = Fraction2;
|
|
Fraction2["Fraction"] = Fraction2;
|
|
module2["exports"] = Fraction2;
|
|
} else {
|
|
root["Fraction"] = Fraction2;
|
|
}
|
|
})(exports);
|
|
}
|
|
});
|
|
|
|
// node_modules/lodash/lodash.js
|
|
var require_lodash = __commonJS({
|
|
"node_modules/lodash/lodash.js"(exports, module2) {
|
|
(function() {
|
|
var undefined2;
|
|
var VERSION = "4.17.21";
|
|
var LARGE_ARRAY_SIZE = 200;
|
|
var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
|
|
var HASH_UNDEFINED = "__lodash_hash_undefined__";
|
|
var MAX_MEMOIZE_SIZE = 500;
|
|
var PLACEHOLDER = "__lodash_placeholder__";
|
|
var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
|
|
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
|
|
var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
|
|
var HOT_COUNT = 800, HOT_SPAN = 16;
|
|
var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
|
|
var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
|
|
var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
|
|
var wrapFlags = [
|
|
["ary", WRAP_ARY_FLAG],
|
|
["bind", WRAP_BIND_FLAG],
|
|
["bindKey", WRAP_BIND_KEY_FLAG],
|
|
["curry", WRAP_CURRY_FLAG],
|
|
["curryRight", WRAP_CURRY_RIGHT_FLAG],
|
|
["flip", WRAP_FLIP_FLAG],
|
|
["partial", WRAP_PARTIAL_FLAG],
|
|
["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
|
|
["rearg", WRAP_REARG_FLAG]
|
|
];
|
|
var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
|
|
var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
|
|
var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
|
|
var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
|
|
var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
|
|
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
|
|
var reTrimStart = /^\s+/;
|
|
var reWhitespace = /\s/;
|
|
var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
|
|
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
|
|
var reEscapeChar = /\\(\\)?/g;
|
|
var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
|
|
var reFlags = /\w*$/;
|
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
var reIsBinary = /^0b[01]+$/i;
|
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
var reIsOctal = /^0o[0-7]+$/i;
|
|
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
var reNoMatch = /($^)/;
|
|
var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
|
|
var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
|
|
var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
|
|
var reApos = RegExp(rsApos, "g");
|
|
var reComboMark = RegExp(rsCombo, "g");
|
|
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
|
|
var reUnicodeWord = RegExp([
|
|
rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
|
|
rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
|
|
rsUpper + "+" + rsOptContrUpper,
|
|
rsOrdUpper,
|
|
rsOrdLower,
|
|
rsDigits,
|
|
rsEmoji
|
|
].join("|"), "g");
|
|
var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
|
|
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
var contextProps = [
|
|
"Array",
|
|
"Buffer",
|
|
"DataView",
|
|
"Date",
|
|
"Error",
|
|
"Float32Array",
|
|
"Float64Array",
|
|
"Function",
|
|
"Int8Array",
|
|
"Int16Array",
|
|
"Int32Array",
|
|
"Map",
|
|
"Math",
|
|
"Object",
|
|
"Promise",
|
|
"RegExp",
|
|
"Set",
|
|
"String",
|
|
"Symbol",
|
|
"TypeError",
|
|
"Uint8Array",
|
|
"Uint8ClampedArray",
|
|
"Uint16Array",
|
|
"Uint32Array",
|
|
"WeakMap",
|
|
"_",
|
|
"clearTimeout",
|
|
"isFinite",
|
|
"parseInt",
|
|
"setTimeout"
|
|
];
|
|
var templateCounter = -1;
|
|
var typedArrayTags = {};
|
|
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
|
|
typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
|
|
var cloneableTags = {};
|
|
cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
|
cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
|
|
var deburredLetters = {
|
|
// Latin-1 Supplement block.
|
|
"\xC0": "A",
|
|
"\xC1": "A",
|
|
"\xC2": "A",
|
|
"\xC3": "A",
|
|
"\xC4": "A",
|
|
"\xC5": "A",
|
|
"\xE0": "a",
|
|
"\xE1": "a",
|
|
"\xE2": "a",
|
|
"\xE3": "a",
|
|
"\xE4": "a",
|
|
"\xE5": "a",
|
|
"\xC7": "C",
|
|
"\xE7": "c",
|
|
"\xD0": "D",
|
|
"\xF0": "d",
|
|
"\xC8": "E",
|
|
"\xC9": "E",
|
|
"\xCA": "E",
|
|
"\xCB": "E",
|
|
"\xE8": "e",
|
|
"\xE9": "e",
|
|
"\xEA": "e",
|
|
"\xEB": "e",
|
|
"\xCC": "I",
|
|
"\xCD": "I",
|
|
"\xCE": "I",
|
|
"\xCF": "I",
|
|
"\xEC": "i",
|
|
"\xED": "i",
|
|
"\xEE": "i",
|
|
"\xEF": "i",
|
|
"\xD1": "N",
|
|
"\xF1": "n",
|
|
"\xD2": "O",
|
|
"\xD3": "O",
|
|
"\xD4": "O",
|
|
"\xD5": "O",
|
|
"\xD6": "O",
|
|
"\xD8": "O",
|
|
"\xF2": "o",
|
|
"\xF3": "o",
|
|
"\xF4": "o",
|
|
"\xF5": "o",
|
|
"\xF6": "o",
|
|
"\xF8": "o",
|
|
"\xD9": "U",
|
|
"\xDA": "U",
|
|
"\xDB": "U",
|
|
"\xDC": "U",
|
|
"\xF9": "u",
|
|
"\xFA": "u",
|
|
"\xFB": "u",
|
|
"\xFC": "u",
|
|
"\xDD": "Y",
|
|
"\xFD": "y",
|
|
"\xFF": "y",
|
|
"\xC6": "Ae",
|
|
"\xE6": "ae",
|
|
"\xDE": "Th",
|
|
"\xFE": "th",
|
|
"\xDF": "ss",
|
|
// Latin Extended-A block.
|
|
"\u0100": "A",
|
|
"\u0102": "A",
|
|
"\u0104": "A",
|
|
"\u0101": "a",
|
|
"\u0103": "a",
|
|
"\u0105": "a",
|
|
"\u0106": "C",
|
|
"\u0108": "C",
|
|
"\u010A": "C",
|
|
"\u010C": "C",
|
|
"\u0107": "c",
|
|
"\u0109": "c",
|
|
"\u010B": "c",
|
|
"\u010D": "c",
|
|
"\u010E": "D",
|
|
"\u0110": "D",
|
|
"\u010F": "d",
|
|
"\u0111": "d",
|
|
"\u0112": "E",
|
|
"\u0114": "E",
|
|
"\u0116": "E",
|
|
"\u0118": "E",
|
|
"\u011A": "E",
|
|
"\u0113": "e",
|
|
"\u0115": "e",
|
|
"\u0117": "e",
|
|
"\u0119": "e",
|
|
"\u011B": "e",
|
|
"\u011C": "G",
|
|
"\u011E": "G",
|
|
"\u0120": "G",
|
|
"\u0122": "G",
|
|
"\u011D": "g",
|
|
"\u011F": "g",
|
|
"\u0121": "g",
|
|
"\u0123": "g",
|
|
"\u0124": "H",
|
|
"\u0126": "H",
|
|
"\u0125": "h",
|
|
"\u0127": "h",
|
|
"\u0128": "I",
|
|
"\u012A": "I",
|
|
"\u012C": "I",
|
|
"\u012E": "I",
|
|
"\u0130": "I",
|
|
"\u0129": "i",
|
|
"\u012B": "i",
|
|
"\u012D": "i",
|
|
"\u012F": "i",
|
|
"\u0131": "i",
|
|
"\u0134": "J",
|
|
"\u0135": "j",
|
|
"\u0136": "K",
|
|
"\u0137": "k",
|
|
"\u0138": "k",
|
|
"\u0139": "L",
|
|
"\u013B": "L",
|
|
"\u013D": "L",
|
|
"\u013F": "L",
|
|
"\u0141": "L",
|
|
"\u013A": "l",
|
|
"\u013C": "l",
|
|
"\u013E": "l",
|
|
"\u0140": "l",
|
|
"\u0142": "l",
|
|
"\u0143": "N",
|
|
"\u0145": "N",
|
|
"\u0147": "N",
|
|
"\u014A": "N",
|
|
"\u0144": "n",
|
|
"\u0146": "n",
|
|
"\u0148": "n",
|
|
"\u014B": "n",
|
|
"\u014C": "O",
|
|
"\u014E": "O",
|
|
"\u0150": "O",
|
|
"\u014D": "o",
|
|
"\u014F": "o",
|
|
"\u0151": "o",
|
|
"\u0154": "R",
|
|
"\u0156": "R",
|
|
"\u0158": "R",
|
|
"\u0155": "r",
|
|
"\u0157": "r",
|
|
"\u0159": "r",
|
|
"\u015A": "S",
|
|
"\u015C": "S",
|
|
"\u015E": "S",
|
|
"\u0160": "S",
|
|
"\u015B": "s",
|
|
"\u015D": "s",
|
|
"\u015F": "s",
|
|
"\u0161": "s",
|
|
"\u0162": "T",
|
|
"\u0164": "T",
|
|
"\u0166": "T",
|
|
"\u0163": "t",
|
|
"\u0165": "t",
|
|
"\u0167": "t",
|
|
"\u0168": "U",
|
|
"\u016A": "U",
|
|
"\u016C": "U",
|
|
"\u016E": "U",
|
|
"\u0170": "U",
|
|
"\u0172": "U",
|
|
"\u0169": "u",
|
|
"\u016B": "u",
|
|
"\u016D": "u",
|
|
"\u016F": "u",
|
|
"\u0171": "u",
|
|
"\u0173": "u",
|
|
"\u0174": "W",
|
|
"\u0175": "w",
|
|
"\u0176": "Y",
|
|
"\u0177": "y",
|
|
"\u0178": "Y",
|
|
"\u0179": "Z",
|
|
"\u017B": "Z",
|
|
"\u017D": "Z",
|
|
"\u017A": "z",
|
|
"\u017C": "z",
|
|
"\u017E": "z",
|
|
"\u0132": "IJ",
|
|
"\u0133": "ij",
|
|
"\u0152": "Oe",
|
|
"\u0153": "oe",
|
|
"\u0149": "'n",
|
|
"\u017F": "s"
|
|
};
|
|
var htmlEscapes = {
|
|
"&": "&",
|
|
"<": "<",
|
|
">": ">",
|
|
'"': """,
|
|
"'": "'"
|
|
};
|
|
var htmlUnescapes = {
|
|
"&": "&",
|
|
"<": "<",
|
|
">": ">",
|
|
""": '"',
|
|
"'": "'"
|
|
};
|
|
var stringEscapes = {
|
|
"\\": "\\",
|
|
"'": "'",
|
|
"\n": "n",
|
|
"\r": "r",
|
|
"\u2028": "u2028",
|
|
"\u2029": "u2029"
|
|
};
|
|
var freeParseFloat = parseFloat, freeParseInt = parseInt;
|
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
var root = freeGlobal || freeSelf || Function("return this")();
|
|
var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
|
|
var freeModule = freeExports && typeof module2 == "object" && module2 && !module2.nodeType && module2;
|
|
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
var freeProcess = moduleExports && freeGlobal.process;
|
|
var nodeUtil = function() {
|
|
try {
|
|
var types = freeModule && freeModule.require && freeModule.require("util").types;
|
|
if (types) {
|
|
return types;
|
|
}
|
|
return freeProcess && freeProcess.binding && freeProcess.binding("util");
|
|
} catch (e) {
|
|
}
|
|
}();
|
|
var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
|
|
function apply(func, thisArg, args) {
|
|
switch (args.length) {
|
|
case 0:
|
|
return func.call(thisArg);
|
|
case 1:
|
|
return func.call(thisArg, args[0]);
|
|
case 2:
|
|
return func.call(thisArg, args[0], args[1]);
|
|
case 3:
|
|
return func.call(thisArg, args[0], args[1], args[2]);
|
|
}
|
|
return func.apply(thisArg, args);
|
|
}
|
|
function arrayAggregator(array, setter, iteratee, accumulator) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
setter(accumulator, value, iteratee(value), array);
|
|
}
|
|
return accumulator;
|
|
}
|
|
function arrayEach(array, iteratee) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (iteratee(array[index], index, array) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
function arrayEachRight(array, iteratee) {
|
|
var length = array == null ? 0 : array.length;
|
|
while (length--) {
|
|
if (iteratee(array[length], length, array) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
function arrayEvery(array, predicate) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (!predicate(array[index], index, array)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function arrayFilter(array, predicate) {
|
|
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (predicate(value, index, array)) {
|
|
result[resIndex++] = value;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function arrayIncludes(array, value) {
|
|
var length = array == null ? 0 : array.length;
|
|
return !!length && baseIndexOf(array, value, 0) > -1;
|
|
}
|
|
function arrayIncludesWith(array, value, comparator) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (comparator(value, array[index])) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function arrayMap(array, iteratee) {
|
|
var index = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
while (++index < length) {
|
|
result[index] = iteratee(array[index], index, array);
|
|
}
|
|
return result;
|
|
}
|
|
function arrayPush(array, values) {
|
|
var index = -1, length = values.length, offset = array.length;
|
|
while (++index < length) {
|
|
array[offset + index] = values[index];
|
|
}
|
|
return array;
|
|
}
|
|
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
if (initAccum && length) {
|
|
accumulator = array[++index];
|
|
}
|
|
while (++index < length) {
|
|
accumulator = iteratee(accumulator, array[index], index, array);
|
|
}
|
|
return accumulator;
|
|
}
|
|
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (initAccum && length) {
|
|
accumulator = array[--length];
|
|
}
|
|
while (length--) {
|
|
accumulator = iteratee(accumulator, array[length], length, array);
|
|
}
|
|
return accumulator;
|
|
}
|
|
function arraySome(array, predicate) {
|
|
var index = -1, length = array == null ? 0 : array.length;
|
|
while (++index < length) {
|
|
if (predicate(array[index], index, array)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
var asciiSize = baseProperty("length");
|
|
function asciiToArray(string) {
|
|
return string.split("");
|
|
}
|
|
function asciiWords(string) {
|
|
return string.match(reAsciiWord) || [];
|
|
}
|
|
function baseFindKey(collection, predicate, eachFunc) {
|
|
var result;
|
|
eachFunc(collection, function(value, key, collection2) {
|
|
if (predicate(value, key, collection2)) {
|
|
result = key;
|
|
return false;
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
|
|
while (fromRight ? index-- : ++index < length) {
|
|
if (predicate(array[index], index, array)) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function baseIndexOf(array, value, fromIndex) {
|
|
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
|
|
}
|
|
function baseIndexOfWith(array, value, fromIndex, comparator) {
|
|
var index = fromIndex - 1, length = array.length;
|
|
while (++index < length) {
|
|
if (comparator(array[index], value)) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function baseIsNaN(value) {
|
|
return value !== value;
|
|
}
|
|
function baseMean(array, iteratee) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseSum(array, iteratee) / length : NAN;
|
|
}
|
|
function baseProperty(key) {
|
|
return function(object) {
|
|
return object == null ? undefined2 : object[key];
|
|
};
|
|
}
|
|
function basePropertyOf(object) {
|
|
return function(key) {
|
|
return object == null ? undefined2 : object[key];
|
|
};
|
|
}
|
|
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
|
|
eachFunc(collection, function(value, index, collection2) {
|
|
accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function baseSortBy(array, comparer) {
|
|
var length = array.length;
|
|
array.sort(comparer);
|
|
while (length--) {
|
|
array[length] = array[length].value;
|
|
}
|
|
return array;
|
|
}
|
|
function baseSum(array, iteratee) {
|
|
var result, index = -1, length = array.length;
|
|
while (++index < length) {
|
|
var current = iteratee(array[index]);
|
|
if (current !== undefined2) {
|
|
result = result === undefined2 ? current : result + current;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function baseTimes(n, iteratee) {
|
|
var index = -1, result = Array(n);
|
|
while (++index < n) {
|
|
result[index] = iteratee(index);
|
|
}
|
|
return result;
|
|
}
|
|
function baseToPairs(object, props) {
|
|
return arrayMap(props, function(key) {
|
|
return [key, object[key]];
|
|
});
|
|
}
|
|
function baseTrim(string) {
|
|
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
}
|
|
function baseUnary(func) {
|
|
return function(value) {
|
|
return func(value);
|
|
};
|
|
}
|
|
function baseValues(object, props) {
|
|
return arrayMap(props, function(key) {
|
|
return object[key];
|
|
});
|
|
}
|
|
function cacheHas(cache, key) {
|
|
return cache.has(key);
|
|
}
|
|
function charsStartIndex(strSymbols, chrSymbols) {
|
|
var index = -1, length = strSymbols.length;
|
|
while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
|
|
}
|
|
return index;
|
|
}
|
|
function charsEndIndex(strSymbols, chrSymbols) {
|
|
var index = strSymbols.length;
|
|
while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
|
|
}
|
|
return index;
|
|
}
|
|
function countHolders(array, placeholder) {
|
|
var length = array.length, result = 0;
|
|
while (length--) {
|
|
if (array[length] === placeholder) {
|
|
++result;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
var deburrLetter = basePropertyOf(deburredLetters);
|
|
var escapeHtmlChar = basePropertyOf(htmlEscapes);
|
|
function escapeStringChar(chr) {
|
|
return "\\" + stringEscapes[chr];
|
|
}
|
|
function getValue(object, key) {
|
|
return object == null ? undefined2 : object[key];
|
|
}
|
|
function hasUnicode(string) {
|
|
return reHasUnicode.test(string);
|
|
}
|
|
function hasUnicodeWord(string) {
|
|
return reHasUnicodeWord.test(string);
|
|
}
|
|
function iteratorToArray(iterator) {
|
|
var data, result = [];
|
|
while (!(data = iterator.next()).done) {
|
|
result.push(data.value);
|
|
}
|
|
return result;
|
|
}
|
|
function mapToArray(map) {
|
|
var index = -1, result = Array(map.size);
|
|
map.forEach(function(value, key) {
|
|
result[++index] = [key, value];
|
|
});
|
|
return result;
|
|
}
|
|
function overArg(func, transform2) {
|
|
return function(arg) {
|
|
return func(transform2(arg));
|
|
};
|
|
}
|
|
function replaceHolders(array, placeholder) {
|
|
var index = -1, length = array.length, resIndex = 0, result = [];
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (value === placeholder || value === PLACEHOLDER) {
|
|
array[index] = PLACEHOLDER;
|
|
result[resIndex++] = index;
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
function setToArray(set) {
|
|
var index = -1, result = Array(set.size);
|
|
set.forEach(function(value) {
|
|
result[++index] = value;
|
|
});
|
|
return result;
|
|
}
|
|
function setToPairs(set) {
|
|
var index = -1, result = Array(set.size);
|
|
set.forEach(function(value) {
|
|
result[++index] = [value, value];
|
|
});
|
|
return result;
|
|
}
|
|
function strictIndexOf(array, value, fromIndex) {
|
|
var index = fromIndex - 1, length = array.length;
|
|
while (++index < length) {
|
|
if (array[index] === value) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function strictLastIndexOf(array, value, fromIndex) {
|
|
var index = fromIndex + 1;
|
|
while (index--) {
|
|
if (array[index] === value) {
|
|
return index;
|
|
}
|
|
}
|
|
return index;
|
|
}
|
|
function stringSize(string) {
|
|
return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
|
|
}
|
|
function stringToArray(string) {
|
|
return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
|
|
}
|
|
function trimmedEndIndex(string) {
|
|
var index = string.length;
|
|
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
}
|
|
return index;
|
|
}
|
|
var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
|
|
function unicodeSize(string) {
|
|
var result = reUnicode.lastIndex = 0;
|
|
while (reUnicode.test(string)) {
|
|
++result;
|
|
}
|
|
return result;
|
|
}
|
|
function unicodeToArray(string) {
|
|
return string.match(reUnicode) || [];
|
|
}
|
|
function unicodeWords(string) {
|
|
return string.match(reUnicodeWord) || [];
|
|
}
|
|
var runInContext = function runInContext2(context) {
|
|
context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
|
|
var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
|
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
var coreJsData = context["__core-js_shared__"];
|
|
var funcToString = funcProto.toString;
|
|
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
var idCounter = 0;
|
|
var maskSrcKey = function() {
|
|
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
|
|
return uid ? "Symbol(src)_1." + uid : "";
|
|
}();
|
|
var nativeObjectToString = objectProto.toString;
|
|
var objectCtorString = funcToString.call(Object2);
|
|
var oldDash = root._;
|
|
var reIsNative = RegExp2(
|
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
);
|
|
var Buffer2 = moduleExports ? context.Buffer : undefined2, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2;
|
|
var defineProperty = function() {
|
|
try {
|
|
var func = getNative(Object2, "defineProperty");
|
|
func({}, "", {});
|
|
return func;
|
|
} catch (e) {
|
|
}
|
|
}();
|
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
|
var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
var metaMap = WeakMap2 && new WeakMap2();
|
|
var realNames = {};
|
|
var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
|
|
var symbolProto = Symbol2 ? Symbol2.prototype : undefined2, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined2, symbolToString = symbolProto ? symbolProto.toString : undefined2;
|
|
function lodash(value) {
|
|
if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
|
|
if (value instanceof LodashWrapper) {
|
|
return value;
|
|
}
|
|
if (hasOwnProperty.call(value, "__wrapped__")) {
|
|
return wrapperClone(value);
|
|
}
|
|
}
|
|
return new LodashWrapper(value);
|
|
}
|
|
var baseCreate = function() {
|
|
function object() {
|
|
}
|
|
return function(proto) {
|
|
if (!isObject(proto)) {
|
|
return {};
|
|
}
|
|
if (objectCreate) {
|
|
return objectCreate(proto);
|
|
}
|
|
object.prototype = proto;
|
|
var result2 = new object();
|
|
object.prototype = undefined2;
|
|
return result2;
|
|
};
|
|
}();
|
|
function baseLodash() {
|
|
}
|
|
function LodashWrapper(value, chainAll) {
|
|
this.__wrapped__ = value;
|
|
this.__actions__ = [];
|
|
this.__chain__ = !!chainAll;
|
|
this.__index__ = 0;
|
|
this.__values__ = undefined2;
|
|
}
|
|
lodash.templateSettings = {
|
|
/**
|
|
* Used to detect `data` property values to be HTML-escaped.
|
|
*
|
|
* @memberOf _.templateSettings
|
|
* @type {RegExp}
|
|
*/
|
|
"escape": reEscape,
|
|
/**
|
|
* Used to detect code to be evaluated.
|
|
*
|
|
* @memberOf _.templateSettings
|
|
* @type {RegExp}
|
|
*/
|
|
"evaluate": reEvaluate,
|
|
/**
|
|
* Used to detect `data` property values to inject.
|
|
*
|
|
* @memberOf _.templateSettings
|
|
* @type {RegExp}
|
|
*/
|
|
"interpolate": reInterpolate,
|
|
/**
|
|
* Used to reference the data object in the template text.
|
|
*
|
|
* @memberOf _.templateSettings
|
|
* @type {string}
|
|
*/
|
|
"variable": "",
|
|
/**
|
|
* Used to import variables into the compiled template.
|
|
*
|
|
* @memberOf _.templateSettings
|
|
* @type {Object}
|
|
*/
|
|
"imports": {
|
|
/**
|
|
* A reference to the `lodash` function.
|
|
*
|
|
* @memberOf _.templateSettings.imports
|
|
* @type {Function}
|
|
*/
|
|
"_": lodash
|
|
}
|
|
};
|
|
lodash.prototype = baseLodash.prototype;
|
|
lodash.prototype.constructor = lodash;
|
|
LodashWrapper.prototype = baseCreate(baseLodash.prototype);
|
|
LodashWrapper.prototype.constructor = LodashWrapper;
|
|
function LazyWrapper(value) {
|
|
this.__wrapped__ = value;
|
|
this.__actions__ = [];
|
|
this.__dir__ = 1;
|
|
this.__filtered__ = false;
|
|
this.__iteratees__ = [];
|
|
this.__takeCount__ = MAX_ARRAY_LENGTH;
|
|
this.__views__ = [];
|
|
}
|
|
function lazyClone() {
|
|
var result2 = new LazyWrapper(this.__wrapped__);
|
|
result2.__actions__ = copyArray(this.__actions__);
|
|
result2.__dir__ = this.__dir__;
|
|
result2.__filtered__ = this.__filtered__;
|
|
result2.__iteratees__ = copyArray(this.__iteratees__);
|
|
result2.__takeCount__ = this.__takeCount__;
|
|
result2.__views__ = copyArray(this.__views__);
|
|
return result2;
|
|
}
|
|
function lazyReverse() {
|
|
if (this.__filtered__) {
|
|
var result2 = new LazyWrapper(this);
|
|
result2.__dir__ = -1;
|
|
result2.__filtered__ = true;
|
|
} else {
|
|
result2 = this.clone();
|
|
result2.__dir__ *= -1;
|
|
}
|
|
return result2;
|
|
}
|
|
function lazyValue() {
|
|
var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
|
|
if (!isArr || !isRight && arrLength == length && takeCount == length) {
|
|
return baseWrapperValue(array, this.__actions__);
|
|
}
|
|
var result2 = [];
|
|
outer:
|
|
while (length-- && resIndex < takeCount) {
|
|
index += dir;
|
|
var iterIndex = -1, value = array[index];
|
|
while (++iterIndex < iterLength) {
|
|
var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
|
|
if (type == LAZY_MAP_FLAG) {
|
|
value = computed;
|
|
} else if (!computed) {
|
|
if (type == LAZY_FILTER_FLAG) {
|
|
continue outer;
|
|
} else {
|
|
break outer;
|
|
}
|
|
}
|
|
}
|
|
result2[resIndex++] = value;
|
|
}
|
|
return result2;
|
|
}
|
|
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
|
|
LazyWrapper.prototype.constructor = LazyWrapper;
|
|
function Hash(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
function hashClear() {
|
|
this.__data__ = nativeCreate ? nativeCreate(null) : {};
|
|
this.size = 0;
|
|
}
|
|
function hashDelete(key) {
|
|
var result2 = this.has(key) && delete this.__data__[key];
|
|
this.size -= result2 ? 1 : 0;
|
|
return result2;
|
|
}
|
|
function hashGet(key) {
|
|
var data = this.__data__;
|
|
if (nativeCreate) {
|
|
var result2 = data[key];
|
|
return result2 === HASH_UNDEFINED ? undefined2 : result2;
|
|
}
|
|
return hasOwnProperty.call(data, key) ? data[key] : undefined2;
|
|
}
|
|
function hashHas(key) {
|
|
var data = this.__data__;
|
|
return nativeCreate ? data[key] !== undefined2 : hasOwnProperty.call(data, key);
|
|
}
|
|
function hashSet(key, value) {
|
|
var data = this.__data__;
|
|
this.size += this.has(key) ? 0 : 1;
|
|
data[key] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value;
|
|
return this;
|
|
}
|
|
Hash.prototype.clear = hashClear;
|
|
Hash.prototype["delete"] = hashDelete;
|
|
Hash.prototype.get = hashGet;
|
|
Hash.prototype.has = hashHas;
|
|
Hash.prototype.set = hashSet;
|
|
function ListCache(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
function listCacheClear() {
|
|
this.__data__ = [];
|
|
this.size = 0;
|
|
}
|
|
function listCacheDelete(key) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
if (index < 0) {
|
|
return false;
|
|
}
|
|
var lastIndex = data.length - 1;
|
|
if (index == lastIndex) {
|
|
data.pop();
|
|
} else {
|
|
splice.call(data, index, 1);
|
|
}
|
|
--this.size;
|
|
return true;
|
|
}
|
|
function listCacheGet(key) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
return index < 0 ? undefined2 : data[index][1];
|
|
}
|
|
function listCacheHas(key) {
|
|
return assocIndexOf(this.__data__, key) > -1;
|
|
}
|
|
function listCacheSet(key, value) {
|
|
var data = this.__data__, index = assocIndexOf(data, key);
|
|
if (index < 0) {
|
|
++this.size;
|
|
data.push([key, value]);
|
|
} else {
|
|
data[index][1] = value;
|
|
}
|
|
return this;
|
|
}
|
|
ListCache.prototype.clear = listCacheClear;
|
|
ListCache.prototype["delete"] = listCacheDelete;
|
|
ListCache.prototype.get = listCacheGet;
|
|
ListCache.prototype.has = listCacheHas;
|
|
ListCache.prototype.set = listCacheSet;
|
|
function MapCache(entries) {
|
|
var index = -1, length = entries == null ? 0 : entries.length;
|
|
this.clear();
|
|
while (++index < length) {
|
|
var entry = entries[index];
|
|
this.set(entry[0], entry[1]);
|
|
}
|
|
}
|
|
function mapCacheClear() {
|
|
this.size = 0;
|
|
this.__data__ = {
|
|
"hash": new Hash(),
|
|
"map": new (Map2 || ListCache)(),
|
|
"string": new Hash()
|
|
};
|
|
}
|
|
function mapCacheDelete(key) {
|
|
var result2 = getMapData(this, key)["delete"](key);
|
|
this.size -= result2 ? 1 : 0;
|
|
return result2;
|
|
}
|
|
function mapCacheGet(key) {
|
|
return getMapData(this, key).get(key);
|
|
}
|
|
function mapCacheHas(key) {
|
|
return getMapData(this, key).has(key);
|
|
}
|
|
function mapCacheSet(key, value) {
|
|
var data = getMapData(this, key), size2 = data.size;
|
|
data.set(key, value);
|
|
this.size += data.size == size2 ? 0 : 1;
|
|
return this;
|
|
}
|
|
MapCache.prototype.clear = mapCacheClear;
|
|
MapCache.prototype["delete"] = mapCacheDelete;
|
|
MapCache.prototype.get = mapCacheGet;
|
|
MapCache.prototype.has = mapCacheHas;
|
|
MapCache.prototype.set = mapCacheSet;
|
|
function SetCache(values2) {
|
|
var index = -1, length = values2 == null ? 0 : values2.length;
|
|
this.__data__ = new MapCache();
|
|
while (++index < length) {
|
|
this.add(values2[index]);
|
|
}
|
|
}
|
|
function setCacheAdd(value) {
|
|
this.__data__.set(value, HASH_UNDEFINED);
|
|
return this;
|
|
}
|
|
function setCacheHas(value) {
|
|
return this.__data__.has(value);
|
|
}
|
|
SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
|
|
SetCache.prototype.has = setCacheHas;
|
|
function Stack(entries) {
|
|
var data = this.__data__ = new ListCache(entries);
|
|
this.size = data.size;
|
|
}
|
|
function stackClear() {
|
|
this.__data__ = new ListCache();
|
|
this.size = 0;
|
|
}
|
|
function stackDelete(key) {
|
|
var data = this.__data__, result2 = data["delete"](key);
|
|
this.size = data.size;
|
|
return result2;
|
|
}
|
|
function stackGet(key) {
|
|
return this.__data__.get(key);
|
|
}
|
|
function stackHas(key) {
|
|
return this.__data__.has(key);
|
|
}
|
|
function stackSet(key, value) {
|
|
var data = this.__data__;
|
|
if (data instanceof ListCache) {
|
|
var pairs = data.__data__;
|
|
if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
|
|
pairs.push([key, value]);
|
|
this.size = ++data.size;
|
|
return this;
|
|
}
|
|
data = this.__data__ = new MapCache(pairs);
|
|
}
|
|
data.set(key, value);
|
|
this.size = data.size;
|
|
return this;
|
|
}
|
|
Stack.prototype.clear = stackClear;
|
|
Stack.prototype["delete"] = stackDelete;
|
|
Stack.prototype.get = stackGet;
|
|
Stack.prototype.has = stackHas;
|
|
Stack.prototype.set = stackSet;
|
|
function arrayLikeKeys(value, inherited) {
|
|
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
|
|
for (var key in value) {
|
|
if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
(key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
|
|
isIndex(key, length)))) {
|
|
result2.push(key);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function arraySample(array) {
|
|
var length = array.length;
|
|
return length ? array[baseRandom(0, length - 1)] : undefined2;
|
|
}
|
|
function arraySampleSize(array, n) {
|
|
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
|
|
}
|
|
function arrayShuffle(array) {
|
|
return shuffleSelf(copyArray(array));
|
|
}
|
|
function assignMergeValue(object, key, value) {
|
|
if (value !== undefined2 && !eq(object[key], value) || value === undefined2 && !(key in object)) {
|
|
baseAssignValue(object, key, value);
|
|
}
|
|
}
|
|
function assignValue(object, key, value) {
|
|
var objValue = object[key];
|
|
if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined2 && !(key in object)) {
|
|
baseAssignValue(object, key, value);
|
|
}
|
|
}
|
|
function assocIndexOf(array, key) {
|
|
var length = array.length;
|
|
while (length--) {
|
|
if (eq(array[length][0], key)) {
|
|
return length;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function baseAggregator(collection, setter, iteratee2, accumulator) {
|
|
baseEach(collection, function(value, key, collection2) {
|
|
setter(accumulator, value, iteratee2(value), collection2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function baseAssign(object, source) {
|
|
return object && copyObject(source, keys(source), object);
|
|
}
|
|
function baseAssignIn(object, source) {
|
|
return object && copyObject(source, keysIn(source), object);
|
|
}
|
|
function baseAssignValue(object, key, value) {
|
|
if (key == "__proto__" && defineProperty) {
|
|
defineProperty(object, key, {
|
|
"configurable": true,
|
|
"enumerable": true,
|
|
"value": value,
|
|
"writable": true
|
|
});
|
|
} else {
|
|
object[key] = value;
|
|
}
|
|
}
|
|
function baseAt(object, paths) {
|
|
var index = -1, length = paths.length, result2 = Array2(length), skip = object == null;
|
|
while (++index < length) {
|
|
result2[index] = skip ? undefined2 : get(object, paths[index]);
|
|
}
|
|
return result2;
|
|
}
|
|
function baseClamp(number, lower, upper) {
|
|
if (number === number) {
|
|
if (upper !== undefined2) {
|
|
number = number <= upper ? number : upper;
|
|
}
|
|
if (lower !== undefined2) {
|
|
number = number >= lower ? number : lower;
|
|
}
|
|
}
|
|
return number;
|
|
}
|
|
function baseClone(value, bitmask, customizer, key, object, stack) {
|
|
var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
|
|
if (customizer) {
|
|
result2 = object ? customizer(value, key, object, stack) : customizer(value);
|
|
}
|
|
if (result2 !== undefined2) {
|
|
return result2;
|
|
}
|
|
if (!isObject(value)) {
|
|
return value;
|
|
}
|
|
var isArr = isArray(value);
|
|
if (isArr) {
|
|
result2 = initCloneArray(value);
|
|
if (!isDeep) {
|
|
return copyArray(value, result2);
|
|
}
|
|
} else {
|
|
var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
|
|
if (isBuffer(value)) {
|
|
return cloneBuffer(value, isDeep);
|
|
}
|
|
if (tag == objectTag || tag == argsTag || isFunc && !object) {
|
|
result2 = isFlat || isFunc ? {} : initCloneObject(value);
|
|
if (!isDeep) {
|
|
return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
|
|
}
|
|
} else {
|
|
if (!cloneableTags[tag]) {
|
|
return object ? value : {};
|
|
}
|
|
result2 = initCloneByTag(value, tag, isDeep);
|
|
}
|
|
}
|
|
stack || (stack = new Stack());
|
|
var stacked = stack.get(value);
|
|
if (stacked) {
|
|
return stacked;
|
|
}
|
|
stack.set(value, result2);
|
|
if (isSet(value)) {
|
|
value.forEach(function(subValue) {
|
|
result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
|
|
});
|
|
} else if (isMap(value)) {
|
|
value.forEach(function(subValue, key2) {
|
|
result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
});
|
|
}
|
|
var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
|
|
var props = isArr ? undefined2 : keysFunc(value);
|
|
arrayEach(props || value, function(subValue, key2) {
|
|
if (props) {
|
|
key2 = subValue;
|
|
subValue = value[key2];
|
|
}
|
|
assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
|
|
});
|
|
return result2;
|
|
}
|
|
function baseConforms(source) {
|
|
var props = keys(source);
|
|
return function(object) {
|
|
return baseConformsTo(object, source, props);
|
|
};
|
|
}
|
|
function baseConformsTo(object, source, props) {
|
|
var length = props.length;
|
|
if (object == null) {
|
|
return !length;
|
|
}
|
|
object = Object2(object);
|
|
while (length--) {
|
|
var key = props[length], predicate = source[key], value = object[key];
|
|
if (value === undefined2 && !(key in object) || !predicate(value)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function baseDelay(func, wait, args) {
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
return setTimeout(function() {
|
|
func.apply(undefined2, args);
|
|
}, wait);
|
|
}
|
|
function baseDifference(array, values2, iteratee2, comparator) {
|
|
var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length;
|
|
if (!length) {
|
|
return result2;
|
|
}
|
|
if (iteratee2) {
|
|
values2 = arrayMap(values2, baseUnary(iteratee2));
|
|
}
|
|
if (comparator) {
|
|
includes2 = arrayIncludesWith;
|
|
isCommon = false;
|
|
} else if (values2.length >= LARGE_ARRAY_SIZE) {
|
|
includes2 = cacheHas;
|
|
isCommon = false;
|
|
values2 = new SetCache(values2);
|
|
}
|
|
outer:
|
|
while (++index < length) {
|
|
var value = array[index], computed = iteratee2 == null ? value : iteratee2(value);
|
|
value = comparator || value !== 0 ? value : 0;
|
|
if (isCommon && computed === computed) {
|
|
var valuesIndex = valuesLength;
|
|
while (valuesIndex--) {
|
|
if (values2[valuesIndex] === computed) {
|
|
continue outer;
|
|
}
|
|
}
|
|
result2.push(value);
|
|
} else if (!includes2(values2, computed, comparator)) {
|
|
result2.push(value);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
var baseEach = createBaseEach(baseForOwn);
|
|
var baseEachRight = createBaseEach(baseForOwnRight, true);
|
|
function baseEvery(collection, predicate) {
|
|
var result2 = true;
|
|
baseEach(collection, function(value, index, collection2) {
|
|
result2 = !!predicate(value, index, collection2);
|
|
return result2;
|
|
});
|
|
return result2;
|
|
}
|
|
function baseExtremum(array, iteratee2, comparator) {
|
|
var index = -1, length = array.length;
|
|
while (++index < length) {
|
|
var value = array[index], current = iteratee2(value);
|
|
if (current != null && (computed === undefined2 ? current === current && !isSymbol(current) : comparator(current, computed))) {
|
|
var computed = current, result2 = value;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseFill(array, value, start, end) {
|
|
var length = array.length;
|
|
start = toInteger(start);
|
|
if (start < 0) {
|
|
start = -start > length ? 0 : length + start;
|
|
}
|
|
end = end === undefined2 || end > length ? length : toInteger(end);
|
|
if (end < 0) {
|
|
end += length;
|
|
}
|
|
end = start > end ? 0 : toLength(end);
|
|
while (start < end) {
|
|
array[start++] = value;
|
|
}
|
|
return array;
|
|
}
|
|
function baseFilter(collection, predicate) {
|
|
var result2 = [];
|
|
baseEach(collection, function(value, index, collection2) {
|
|
if (predicate(value, index, collection2)) {
|
|
result2.push(value);
|
|
}
|
|
});
|
|
return result2;
|
|
}
|
|
function baseFlatten(array, depth, predicate, isStrict, result2) {
|
|
var index = -1, length = array.length;
|
|
predicate || (predicate = isFlattenable);
|
|
result2 || (result2 = []);
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (depth > 0 && predicate(value)) {
|
|
if (depth > 1) {
|
|
baseFlatten(value, depth - 1, predicate, isStrict, result2);
|
|
} else {
|
|
arrayPush(result2, value);
|
|
}
|
|
} else if (!isStrict) {
|
|
result2[result2.length] = value;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
var baseFor = createBaseFor();
|
|
var baseForRight = createBaseFor(true);
|
|
function baseForOwn(object, iteratee2) {
|
|
return object && baseFor(object, iteratee2, keys);
|
|
}
|
|
function baseForOwnRight(object, iteratee2) {
|
|
return object && baseForRight(object, iteratee2, keys);
|
|
}
|
|
function baseFunctions(object, props) {
|
|
return arrayFilter(props, function(key) {
|
|
return isFunction(object[key]);
|
|
});
|
|
}
|
|
function baseGet(object, path) {
|
|
path = castPath(path, object);
|
|
var index = 0, length = path.length;
|
|
while (object != null && index < length) {
|
|
object = object[toKey(path[index++])];
|
|
}
|
|
return index && index == length ? object : undefined2;
|
|
}
|
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
var result2 = keysFunc(object);
|
|
return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object));
|
|
}
|
|
function baseGetTag(value) {
|
|
if (value == null) {
|
|
return value === undefined2 ? undefinedTag : nullTag;
|
|
}
|
|
return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
|
|
}
|
|
function baseGt(value, other) {
|
|
return value > other;
|
|
}
|
|
function baseHas(object, key) {
|
|
return object != null && hasOwnProperty.call(object, key);
|
|
}
|
|
function baseHasIn(object, key) {
|
|
return object != null && key in Object2(object);
|
|
}
|
|
function baseInRange(number, start, end) {
|
|
return number >= nativeMin(start, end) && number < nativeMax(start, end);
|
|
}
|
|
function baseIntersection(arrays, iteratee2, comparator) {
|
|
var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
|
|
while (othIndex--) {
|
|
var array = arrays[othIndex];
|
|
if (othIndex && iteratee2) {
|
|
array = arrayMap(array, baseUnary(iteratee2));
|
|
}
|
|
maxLength = nativeMin(array.length, maxLength);
|
|
caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined2;
|
|
}
|
|
array = arrays[0];
|
|
var index = -1, seen = caches[0];
|
|
outer:
|
|
while (++index < length && result2.length < maxLength) {
|
|
var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
|
|
value = comparator || value !== 0 ? value : 0;
|
|
if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) {
|
|
othIndex = othLength;
|
|
while (--othIndex) {
|
|
var cache = caches[othIndex];
|
|
if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) {
|
|
continue outer;
|
|
}
|
|
}
|
|
if (seen) {
|
|
seen.push(computed);
|
|
}
|
|
result2.push(value);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseInverter(object, setter, iteratee2, accumulator) {
|
|
baseForOwn(object, function(value, key, object2) {
|
|
setter(accumulator, iteratee2(value), key, object2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function baseInvoke(object, path, args) {
|
|
path = castPath(path, object);
|
|
object = parent(object, path);
|
|
var func = object == null ? object : object[toKey(last3(path))];
|
|
return func == null ? undefined2 : apply(func, object, args);
|
|
}
|
|
function baseIsArguments(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == argsTag;
|
|
}
|
|
function baseIsArrayBuffer(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
|
|
}
|
|
function baseIsDate(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == dateTag;
|
|
}
|
|
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
if (value === other) {
|
|
return true;
|
|
}
|
|
if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
|
|
return value !== value && other !== other;
|
|
}
|
|
return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
}
|
|
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
|
|
objTag = objTag == argsTag ? objectTag : objTag;
|
|
othTag = othTag == argsTag ? objectTag : othTag;
|
|
var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
|
|
if (isSameTag && isBuffer(object)) {
|
|
if (!isBuffer(other)) {
|
|
return false;
|
|
}
|
|
objIsArr = true;
|
|
objIsObj = false;
|
|
}
|
|
if (isSameTag && !objIsObj) {
|
|
stack || (stack = new Stack());
|
|
return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
}
|
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
|
|
if (objIsWrapped || othIsWrapped) {
|
|
var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
|
|
stack || (stack = new Stack());
|
|
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
}
|
|
}
|
|
if (!isSameTag) {
|
|
return false;
|
|
}
|
|
stack || (stack = new Stack());
|
|
return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
}
|
|
function baseIsMap(value) {
|
|
return isObjectLike(value) && getTag(value) == mapTag;
|
|
}
|
|
function baseIsMatch(object, source, matchData, customizer) {
|
|
var index = matchData.length, length = index, noCustomizer = !customizer;
|
|
if (object == null) {
|
|
return !length;
|
|
}
|
|
object = Object2(object);
|
|
while (index--) {
|
|
var data = matchData[index];
|
|
if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
|
|
return false;
|
|
}
|
|
}
|
|
while (++index < length) {
|
|
data = matchData[index];
|
|
var key = data[0], objValue = object[key], srcValue = data[1];
|
|
if (noCustomizer && data[2]) {
|
|
if (objValue === undefined2 && !(key in object)) {
|
|
return false;
|
|
}
|
|
} else {
|
|
var stack = new Stack();
|
|
if (customizer) {
|
|
var result2 = customizer(objValue, srcValue, key, object, source, stack);
|
|
}
|
|
if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) {
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function baseIsNative(value) {
|
|
if (!isObject(value) || isMasked(value)) {
|
|
return false;
|
|
}
|
|
var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
|
|
return pattern.test(toSource(value));
|
|
}
|
|
function baseIsRegExp(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == regexpTag;
|
|
}
|
|
function baseIsSet(value) {
|
|
return isObjectLike(value) && getTag(value) == setTag;
|
|
}
|
|
function baseIsTypedArray(value) {
|
|
return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
|
|
}
|
|
function baseIteratee(value) {
|
|
if (typeof value == "function") {
|
|
return value;
|
|
}
|
|
if (value == null) {
|
|
return identity;
|
|
}
|
|
if (typeof value == "object") {
|
|
return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
|
|
}
|
|
return property(value);
|
|
}
|
|
function baseKeys(object) {
|
|
if (!isPrototype(object)) {
|
|
return nativeKeys(object);
|
|
}
|
|
var result2 = [];
|
|
for (var key in Object2(object)) {
|
|
if (hasOwnProperty.call(object, key) && key != "constructor") {
|
|
result2.push(key);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseKeysIn(object) {
|
|
if (!isObject(object)) {
|
|
return nativeKeysIn(object);
|
|
}
|
|
var isProto = isPrototype(object), result2 = [];
|
|
for (var key in object) {
|
|
if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
|
|
result2.push(key);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseLt(value, other) {
|
|
return value < other;
|
|
}
|
|
function baseMap(collection, iteratee2) {
|
|
var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
baseEach(collection, function(value, key, collection2) {
|
|
result2[++index] = iteratee2(value, key, collection2);
|
|
});
|
|
return result2;
|
|
}
|
|
function baseMatches(source) {
|
|
var matchData = getMatchData(source);
|
|
if (matchData.length == 1 && matchData[0][2]) {
|
|
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
|
|
}
|
|
return function(object) {
|
|
return object === source || baseIsMatch(object, source, matchData);
|
|
};
|
|
}
|
|
function baseMatchesProperty(path, srcValue) {
|
|
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
}
|
|
return function(object) {
|
|
var objValue = get(object, path);
|
|
return objValue === undefined2 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
};
|
|
}
|
|
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
if (object === source) {
|
|
return;
|
|
}
|
|
baseFor(source, function(srcValue, key) {
|
|
stack || (stack = new Stack());
|
|
if (isObject(srcValue)) {
|
|
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
} else {
|
|
var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2;
|
|
if (newValue === undefined2) {
|
|
newValue = srcValue;
|
|
}
|
|
assignMergeValue(object, key, newValue);
|
|
}
|
|
}, keysIn);
|
|
}
|
|
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
|
|
if (stacked) {
|
|
assignMergeValue(object, key, stacked);
|
|
return;
|
|
}
|
|
var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined2;
|
|
var isCommon = newValue === undefined2;
|
|
if (isCommon) {
|
|
var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
|
|
newValue = srcValue;
|
|
if (isArr || isBuff || isTyped) {
|
|
if (isArray(objValue)) {
|
|
newValue = objValue;
|
|
} else if (isArrayLikeObject(objValue)) {
|
|
newValue = copyArray(objValue);
|
|
} else if (isBuff) {
|
|
isCommon = false;
|
|
newValue = cloneBuffer(srcValue, true);
|
|
} else if (isTyped) {
|
|
isCommon = false;
|
|
newValue = cloneTypedArray(srcValue, true);
|
|
} else {
|
|
newValue = [];
|
|
}
|
|
} else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
|
newValue = objValue;
|
|
if (isArguments(objValue)) {
|
|
newValue = toPlainObject(objValue);
|
|
} else if (!isObject(objValue) || isFunction(objValue)) {
|
|
newValue = initCloneObject(srcValue);
|
|
}
|
|
} else {
|
|
isCommon = false;
|
|
}
|
|
}
|
|
if (isCommon) {
|
|
stack.set(srcValue, newValue);
|
|
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
stack["delete"](srcValue);
|
|
}
|
|
assignMergeValue(object, key, newValue);
|
|
}
|
|
function baseNth(array, n) {
|
|
var length = array.length;
|
|
if (!length) {
|
|
return;
|
|
}
|
|
n += n < 0 ? length : 0;
|
|
return isIndex(n, length) ? array[n] : undefined2;
|
|
}
|
|
function baseOrderBy(collection, iteratees, orders) {
|
|
if (iteratees.length) {
|
|
iteratees = arrayMap(iteratees, function(iteratee2) {
|
|
if (isArray(iteratee2)) {
|
|
return function(value) {
|
|
return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
|
|
};
|
|
}
|
|
return iteratee2;
|
|
});
|
|
} else {
|
|
iteratees = [identity];
|
|
}
|
|
var index = -1;
|
|
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
|
var result2 = baseMap(collection, function(value, key, collection2) {
|
|
var criteria = arrayMap(iteratees, function(iteratee2) {
|
|
return iteratee2(value);
|
|
});
|
|
return { "criteria": criteria, "index": ++index, "value": value };
|
|
});
|
|
return baseSortBy(result2, function(object, other) {
|
|
return compareMultiple(object, other, orders);
|
|
});
|
|
}
|
|
function basePick(object, paths) {
|
|
return basePickBy(object, paths, function(value, path) {
|
|
return hasIn(object, path);
|
|
});
|
|
}
|
|
function basePickBy(object, paths, predicate) {
|
|
var index = -1, length = paths.length, result2 = {};
|
|
while (++index < length) {
|
|
var path = paths[index], value = baseGet(object, path);
|
|
if (predicate(value, path)) {
|
|
baseSet(result2, castPath(path, object), value);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function basePropertyDeep(path) {
|
|
return function(object) {
|
|
return baseGet(object, path);
|
|
};
|
|
}
|
|
function basePullAll(array, values2, iteratee2, comparator) {
|
|
var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array;
|
|
if (array === values2) {
|
|
values2 = copyArray(values2);
|
|
}
|
|
if (iteratee2) {
|
|
seen = arrayMap(array, baseUnary(iteratee2));
|
|
}
|
|
while (++index < length) {
|
|
var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value;
|
|
while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
|
|
if (seen !== array) {
|
|
splice.call(seen, fromIndex, 1);
|
|
}
|
|
splice.call(array, fromIndex, 1);
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
function basePullAt(array, indexes) {
|
|
var length = array ? indexes.length : 0, lastIndex = length - 1;
|
|
while (length--) {
|
|
var index = indexes[length];
|
|
if (length == lastIndex || index !== previous) {
|
|
var previous = index;
|
|
if (isIndex(index)) {
|
|
splice.call(array, index, 1);
|
|
} else {
|
|
baseUnset(array, index);
|
|
}
|
|
}
|
|
}
|
|
return array;
|
|
}
|
|
function baseRandom(lower, upper) {
|
|
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
|
|
}
|
|
function baseRange(start, end, step, fromRight) {
|
|
var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length);
|
|
while (length--) {
|
|
result2[fromRight ? length : ++index] = start;
|
|
start += step;
|
|
}
|
|
return result2;
|
|
}
|
|
function baseRepeat(string, n) {
|
|
var result2 = "";
|
|
if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
|
|
return result2;
|
|
}
|
|
do {
|
|
if (n % 2) {
|
|
result2 += string;
|
|
}
|
|
n = nativeFloor(n / 2);
|
|
if (n) {
|
|
string += string;
|
|
}
|
|
} while (n);
|
|
return result2;
|
|
}
|
|
function baseRest(func, start) {
|
|
return setToString(overRest(func, start, identity), func + "");
|
|
}
|
|
function baseSample(collection) {
|
|
return arraySample(values(collection));
|
|
}
|
|
function baseSampleSize(collection, n) {
|
|
var array = values(collection);
|
|
return shuffleSelf(array, baseClamp(n, 0, array.length));
|
|
}
|
|
function baseSet(object, path, value, customizer) {
|
|
if (!isObject(object)) {
|
|
return object;
|
|
}
|
|
path = castPath(path, object);
|
|
var index = -1, length = path.length, lastIndex = length - 1, nested = object;
|
|
while (nested != null && ++index < length) {
|
|
var key = toKey(path[index]), newValue = value;
|
|
if (key === "__proto__" || key === "constructor" || key === "prototype") {
|
|
return object;
|
|
}
|
|
if (index != lastIndex) {
|
|
var objValue = nested[key];
|
|
newValue = customizer ? customizer(objValue, key, nested) : undefined2;
|
|
if (newValue === undefined2) {
|
|
newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
|
|
}
|
|
}
|
|
assignValue(nested, key, newValue);
|
|
nested = nested[key];
|
|
}
|
|
return object;
|
|
}
|
|
var baseSetData = !metaMap ? identity : function(func, data) {
|
|
metaMap.set(func, data);
|
|
return func;
|
|
};
|
|
var baseSetToString = !defineProperty ? identity : function(func, string) {
|
|
return defineProperty(func, "toString", {
|
|
"configurable": true,
|
|
"enumerable": false,
|
|
"value": constant(string),
|
|
"writable": true
|
|
});
|
|
};
|
|
function baseShuffle(collection) {
|
|
return shuffleSelf(values(collection));
|
|
}
|
|
function baseSlice(array, start, end) {
|
|
var index = -1, length = array.length;
|
|
if (start < 0) {
|
|
start = -start > length ? 0 : length + start;
|
|
}
|
|
end = end > length ? length : end;
|
|
if (end < 0) {
|
|
end += length;
|
|
}
|
|
length = start > end ? 0 : end - start >>> 0;
|
|
start >>>= 0;
|
|
var result2 = Array2(length);
|
|
while (++index < length) {
|
|
result2[index] = array[index + start];
|
|
}
|
|
return result2;
|
|
}
|
|
function baseSome(collection, predicate) {
|
|
var result2;
|
|
baseEach(collection, function(value, index, collection2) {
|
|
result2 = predicate(value, index, collection2);
|
|
return !result2;
|
|
});
|
|
return !!result2;
|
|
}
|
|
function baseSortedIndex(array, value, retHighest) {
|
|
var low = 0, high = array == null ? low : array.length;
|
|
if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
|
|
while (low < high) {
|
|
var mid = low + high >>> 1, computed = array[mid];
|
|
if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
|
|
low = mid + 1;
|
|
} else {
|
|
high = mid;
|
|
}
|
|
}
|
|
return high;
|
|
}
|
|
return baseSortedIndexBy(array, value, identity, retHighest);
|
|
}
|
|
function baseSortedIndexBy(array, value, iteratee2, retHighest) {
|
|
var low = 0, high = array == null ? 0 : array.length;
|
|
if (high === 0) {
|
|
return 0;
|
|
}
|
|
value = iteratee2(value);
|
|
var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined2;
|
|
while (low < high) {
|
|
var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
|
|
if (valIsNaN) {
|
|
var setLow = retHighest || othIsReflexive;
|
|
} else if (valIsUndefined) {
|
|
setLow = othIsReflexive && (retHighest || othIsDefined);
|
|
} else if (valIsNull) {
|
|
setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
|
|
} else if (valIsSymbol) {
|
|
setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
|
|
} else if (othIsNull || othIsSymbol) {
|
|
setLow = false;
|
|
} else {
|
|
setLow = retHighest ? computed <= value : computed < value;
|
|
}
|
|
if (setLow) {
|
|
low = mid + 1;
|
|
} else {
|
|
high = mid;
|
|
}
|
|
}
|
|
return nativeMin(high, MAX_ARRAY_INDEX);
|
|
}
|
|
function baseSortedUniq(array, iteratee2) {
|
|
var index = -1, length = array.length, resIndex = 0, result2 = [];
|
|
while (++index < length) {
|
|
var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
|
|
if (!index || !eq(computed, seen)) {
|
|
var seen = computed;
|
|
result2[resIndex++] = value === 0 ? 0 : value;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseToNumber(value) {
|
|
if (typeof value == "number") {
|
|
return value;
|
|
}
|
|
if (isSymbol(value)) {
|
|
return NAN;
|
|
}
|
|
return +value;
|
|
}
|
|
function baseToString(value) {
|
|
if (typeof value == "string") {
|
|
return value;
|
|
}
|
|
if (isArray(value)) {
|
|
return arrayMap(value, baseToString) + "";
|
|
}
|
|
if (isSymbol(value)) {
|
|
return symbolToString ? symbolToString.call(value) : "";
|
|
}
|
|
var result2 = value + "";
|
|
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
}
|
|
function baseUniq(array, iteratee2, comparator) {
|
|
var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
|
|
if (comparator) {
|
|
isCommon = false;
|
|
includes2 = arrayIncludesWith;
|
|
} else if (length >= LARGE_ARRAY_SIZE) {
|
|
var set2 = iteratee2 ? null : createSet(array);
|
|
if (set2) {
|
|
return setToArray(set2);
|
|
}
|
|
isCommon = false;
|
|
includes2 = cacheHas;
|
|
seen = new SetCache();
|
|
} else {
|
|
seen = iteratee2 ? [] : result2;
|
|
}
|
|
outer:
|
|
while (++index < length) {
|
|
var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
|
|
value = comparator || value !== 0 ? value : 0;
|
|
if (isCommon && computed === computed) {
|
|
var seenIndex = seen.length;
|
|
while (seenIndex--) {
|
|
if (seen[seenIndex] === computed) {
|
|
continue outer;
|
|
}
|
|
}
|
|
if (iteratee2) {
|
|
seen.push(computed);
|
|
}
|
|
result2.push(value);
|
|
} else if (!includes2(seen, computed, comparator)) {
|
|
if (seen !== result2) {
|
|
seen.push(computed);
|
|
}
|
|
result2.push(value);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function baseUnset(object, path) {
|
|
path = castPath(path, object);
|
|
object = parent(object, path);
|
|
return object == null || delete object[toKey(last3(path))];
|
|
}
|
|
function baseUpdate(object, path, updater, customizer) {
|
|
return baseSet(object, path, updater(baseGet(object, path)), customizer);
|
|
}
|
|
function baseWhile(array, predicate, isDrop, fromRight) {
|
|
var length = array.length, index = fromRight ? length : -1;
|
|
while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {
|
|
}
|
|
return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
|
|
}
|
|
function baseWrapperValue(value, actions) {
|
|
var result2 = value;
|
|
if (result2 instanceof LazyWrapper) {
|
|
result2 = result2.value();
|
|
}
|
|
return arrayReduce(actions, function(result3, action) {
|
|
return action.func.apply(action.thisArg, arrayPush([result3], action.args));
|
|
}, result2);
|
|
}
|
|
function baseXor(arrays, iteratee2, comparator) {
|
|
var length = arrays.length;
|
|
if (length < 2) {
|
|
return length ? baseUniq(arrays[0]) : [];
|
|
}
|
|
var index = -1, result2 = Array2(length);
|
|
while (++index < length) {
|
|
var array = arrays[index], othIndex = -1;
|
|
while (++othIndex < length) {
|
|
if (othIndex != index) {
|
|
result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator);
|
|
}
|
|
}
|
|
}
|
|
return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
|
|
}
|
|
function baseZipObject(props, values2, assignFunc) {
|
|
var index = -1, length = props.length, valsLength = values2.length, result2 = {};
|
|
while (++index < length) {
|
|
var value = index < valsLength ? values2[index] : undefined2;
|
|
assignFunc(result2, props[index], value);
|
|
}
|
|
return result2;
|
|
}
|
|
function castArrayLikeObject(value) {
|
|
return isArrayLikeObject(value) ? value : [];
|
|
}
|
|
function castFunction(value) {
|
|
return typeof value == "function" ? value : identity;
|
|
}
|
|
function castPath(value, object) {
|
|
if (isArray(value)) {
|
|
return value;
|
|
}
|
|
return isKey(value, object) ? [value] : stringToPath(toString(value));
|
|
}
|
|
var castRest = baseRest;
|
|
function castSlice(array, start, end) {
|
|
var length = array.length;
|
|
end = end === undefined2 ? length : end;
|
|
return !start && end >= length ? array : baseSlice(array, start, end);
|
|
}
|
|
var clearTimeout = ctxClearTimeout || function(id) {
|
|
return root.clearTimeout(id);
|
|
};
|
|
function cloneBuffer(buffer, isDeep) {
|
|
if (isDeep) {
|
|
return buffer.slice();
|
|
}
|
|
var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
buffer.copy(result2);
|
|
return result2;
|
|
}
|
|
function cloneArrayBuffer(arrayBuffer) {
|
|
var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
|
|
return result2;
|
|
}
|
|
function cloneDataView(dataView, isDeep) {
|
|
var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
|
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
|
}
|
|
function cloneRegExp(regexp) {
|
|
var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
|
result2.lastIndex = regexp.lastIndex;
|
|
return result2;
|
|
}
|
|
function cloneSymbol(symbol) {
|
|
return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
|
|
}
|
|
function cloneTypedArray(typedArray, isDeep) {
|
|
var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
}
|
|
function compareAscending(value, other) {
|
|
if (value !== other) {
|
|
var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
|
|
var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
|
|
if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
|
|
return 1;
|
|
}
|
|
if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
|
|
return -1;
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
function compareMultiple(object, other, orders) {
|
|
var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
|
|
while (++index < length) {
|
|
var result2 = compareAscending(objCriteria[index], othCriteria[index]);
|
|
if (result2) {
|
|
if (index >= ordersLength) {
|
|
return result2;
|
|
}
|
|
var order = orders[index];
|
|
return result2 * (order == "desc" ? -1 : 1);
|
|
}
|
|
}
|
|
return object.index - other.index;
|
|
}
|
|
function composeArgs(args, partials, holders, isCurried) {
|
|
var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
|
|
while (++leftIndex < leftLength) {
|
|
result2[leftIndex] = partials[leftIndex];
|
|
}
|
|
while (++argsIndex < holdersLength) {
|
|
if (isUncurried || argsIndex < argsLength) {
|
|
result2[holders[argsIndex]] = args[argsIndex];
|
|
}
|
|
}
|
|
while (rangeLength--) {
|
|
result2[leftIndex++] = args[argsIndex++];
|
|
}
|
|
return result2;
|
|
}
|
|
function composeArgsRight(args, partials, holders, isCurried) {
|
|
var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
|
|
while (++argsIndex < rangeLength) {
|
|
result2[argsIndex] = args[argsIndex];
|
|
}
|
|
var offset = argsIndex;
|
|
while (++rightIndex < rightLength) {
|
|
result2[offset + rightIndex] = partials[rightIndex];
|
|
}
|
|
while (++holdersIndex < holdersLength) {
|
|
if (isUncurried || argsIndex < argsLength) {
|
|
result2[offset + holders[holdersIndex]] = args[argsIndex++];
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function copyArray(source, array) {
|
|
var index = -1, length = source.length;
|
|
array || (array = Array2(length));
|
|
while (++index < length) {
|
|
array[index] = source[index];
|
|
}
|
|
return array;
|
|
}
|
|
function copyObject(source, props, object, customizer) {
|
|
var isNew = !object;
|
|
object || (object = {});
|
|
var index = -1, length = props.length;
|
|
while (++index < length) {
|
|
var key = props[index];
|
|
var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined2;
|
|
if (newValue === undefined2) {
|
|
newValue = source[key];
|
|
}
|
|
if (isNew) {
|
|
baseAssignValue(object, key, newValue);
|
|
} else {
|
|
assignValue(object, key, newValue);
|
|
}
|
|
}
|
|
return object;
|
|
}
|
|
function copySymbols(source, object) {
|
|
return copyObject(source, getSymbols(source), object);
|
|
}
|
|
function copySymbolsIn(source, object) {
|
|
return copyObject(source, getSymbolsIn(source), object);
|
|
}
|
|
function createAggregator(setter, initializer) {
|
|
return function(collection, iteratee2) {
|
|
var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
|
|
return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
|
|
};
|
|
}
|
|
function createAssigner(assigner) {
|
|
return baseRest(function(object, sources) {
|
|
var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2;
|
|
customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2;
|
|
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
customizer = length < 3 ? undefined2 : customizer;
|
|
length = 1;
|
|
}
|
|
object = Object2(object);
|
|
while (++index < length) {
|
|
var source = sources[index];
|
|
if (source) {
|
|
assigner(object, source, index, customizer);
|
|
}
|
|
}
|
|
return object;
|
|
});
|
|
}
|
|
function createBaseEach(eachFunc, fromRight) {
|
|
return function(collection, iteratee2) {
|
|
if (collection == null) {
|
|
return collection;
|
|
}
|
|
if (!isArrayLike(collection)) {
|
|
return eachFunc(collection, iteratee2);
|
|
}
|
|
var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection);
|
|
while (fromRight ? index-- : ++index < length) {
|
|
if (iteratee2(iterable[index], index, iterable) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return collection;
|
|
};
|
|
}
|
|
function createBaseFor(fromRight) {
|
|
return function(object, iteratee2, keysFunc) {
|
|
var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
|
|
while (length--) {
|
|
var key = props[fromRight ? length : ++index];
|
|
if (iteratee2(iterable[key], key, iterable) === false) {
|
|
break;
|
|
}
|
|
}
|
|
return object;
|
|
};
|
|
}
|
|
function createBind(func, bitmask, thisArg) {
|
|
var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
|
|
function wrapper() {
|
|
var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
|
|
return fn.apply(isBind ? thisArg : this, arguments);
|
|
}
|
|
return wrapper;
|
|
}
|
|
function createCaseFirst(methodName) {
|
|
return function(string) {
|
|
string = toString(string);
|
|
var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2;
|
|
var chr = strSymbols ? strSymbols[0] : string.charAt(0);
|
|
var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
|
|
return chr[methodName]() + trailing;
|
|
};
|
|
}
|
|
function createCompounder(callback) {
|
|
return function(string) {
|
|
return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
|
|
};
|
|
}
|
|
function createCtor(Ctor) {
|
|
return function() {
|
|
var args = arguments;
|
|
switch (args.length) {
|
|
case 0:
|
|
return new Ctor();
|
|
case 1:
|
|
return new Ctor(args[0]);
|
|
case 2:
|
|
return new Ctor(args[0], args[1]);
|
|
case 3:
|
|
return new Ctor(args[0], args[1], args[2]);
|
|
case 4:
|
|
return new Ctor(args[0], args[1], args[2], args[3]);
|
|
case 5:
|
|
return new Ctor(args[0], args[1], args[2], args[3], args[4]);
|
|
case 6:
|
|
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
|
|
case 7:
|
|
return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
|
|
}
|
|
var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
|
|
return isObject(result2) ? result2 : thisBinding;
|
|
};
|
|
}
|
|
function createCurry(func, bitmask, arity) {
|
|
var Ctor = createCtor(func);
|
|
function wrapper() {
|
|
var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper);
|
|
while (index--) {
|
|
args[index] = arguments[index];
|
|
}
|
|
var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
|
|
length -= holders.length;
|
|
if (length < arity) {
|
|
return createRecurry(
|
|
func,
|
|
bitmask,
|
|
createHybrid,
|
|
wrapper.placeholder,
|
|
undefined2,
|
|
args,
|
|
holders,
|
|
undefined2,
|
|
undefined2,
|
|
arity - length
|
|
);
|
|
}
|
|
var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
|
|
return apply(fn, this, args);
|
|
}
|
|
return wrapper;
|
|
}
|
|
function createFind(findIndexFunc) {
|
|
return function(collection, predicate, fromIndex) {
|
|
var iterable = Object2(collection);
|
|
if (!isArrayLike(collection)) {
|
|
var iteratee2 = getIteratee(predicate, 3);
|
|
collection = keys(collection);
|
|
predicate = function(key) {
|
|
return iteratee2(iterable[key], key, iterable);
|
|
};
|
|
}
|
|
var index = findIndexFunc(collection, predicate, fromIndex);
|
|
return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined2;
|
|
};
|
|
}
|
|
function createFlow(fromRight) {
|
|
return flatRest(function(funcs) {
|
|
var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
|
|
if (fromRight) {
|
|
funcs.reverse();
|
|
}
|
|
while (index--) {
|
|
var func = funcs[index];
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
if (prereq && !wrapper && getFuncName(func) == "wrapper") {
|
|
var wrapper = new LodashWrapper([], true);
|
|
}
|
|
}
|
|
index = wrapper ? index : length;
|
|
while (++index < length) {
|
|
func = funcs[index];
|
|
var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined2;
|
|
if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
|
|
wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
|
|
} else {
|
|
wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
|
|
}
|
|
}
|
|
return function() {
|
|
var args = arguments, value = args[0];
|
|
if (wrapper && args.length == 1 && isArray(value)) {
|
|
return wrapper.plant(value).value();
|
|
}
|
|
var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value;
|
|
while (++index2 < length) {
|
|
result2 = funcs[index2].call(this, result2);
|
|
}
|
|
return result2;
|
|
};
|
|
});
|
|
}
|
|
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
|
|
var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func);
|
|
function wrapper() {
|
|
var length = arguments.length, args = Array2(length), index = length;
|
|
while (index--) {
|
|
args[index] = arguments[index];
|
|
}
|
|
if (isCurried) {
|
|
var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
|
|
}
|
|
if (partials) {
|
|
args = composeArgs(args, partials, holders, isCurried);
|
|
}
|
|
if (partialsRight) {
|
|
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
|
|
}
|
|
length -= holdersCount;
|
|
if (isCurried && length < arity) {
|
|
var newHolders = replaceHolders(args, placeholder);
|
|
return createRecurry(
|
|
func,
|
|
bitmask,
|
|
createHybrid,
|
|
wrapper.placeholder,
|
|
thisArg,
|
|
args,
|
|
newHolders,
|
|
argPos,
|
|
ary2,
|
|
arity - length
|
|
);
|
|
}
|
|
var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
|
|
length = args.length;
|
|
if (argPos) {
|
|
args = reorder(args, argPos);
|
|
} else if (isFlip && length > 1) {
|
|
args.reverse();
|
|
}
|
|
if (isAry && ary2 < length) {
|
|
args.length = ary2;
|
|
}
|
|
if (this && this !== root && this instanceof wrapper) {
|
|
fn = Ctor || createCtor(fn);
|
|
}
|
|
return fn.apply(thisBinding, args);
|
|
}
|
|
return wrapper;
|
|
}
|
|
function createInverter(setter, toIteratee) {
|
|
return function(object, iteratee2) {
|
|
return baseInverter(object, setter, toIteratee(iteratee2), {});
|
|
};
|
|
}
|
|
function createMathOperation(operator, defaultValue) {
|
|
return function(value, other) {
|
|
var result2;
|
|
if (value === undefined2 && other === undefined2) {
|
|
return defaultValue;
|
|
}
|
|
if (value !== undefined2) {
|
|
result2 = value;
|
|
}
|
|
if (other !== undefined2) {
|
|
if (result2 === undefined2) {
|
|
return other;
|
|
}
|
|
if (typeof value == "string" || typeof other == "string") {
|
|
value = baseToString(value);
|
|
other = baseToString(other);
|
|
} else {
|
|
value = baseToNumber(value);
|
|
other = baseToNumber(other);
|
|
}
|
|
result2 = operator(value, other);
|
|
}
|
|
return result2;
|
|
};
|
|
}
|
|
function createOver(arrayFunc) {
|
|
return flatRest(function(iteratees) {
|
|
iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
|
|
return baseRest(function(args) {
|
|
var thisArg = this;
|
|
return arrayFunc(iteratees, function(iteratee2) {
|
|
return apply(iteratee2, thisArg, args);
|
|
});
|
|
});
|
|
});
|
|
}
|
|
function createPadding(length, chars) {
|
|
chars = chars === undefined2 ? " " : baseToString(chars);
|
|
var charsLength = chars.length;
|
|
if (charsLength < 2) {
|
|
return charsLength ? baseRepeat(chars, length) : chars;
|
|
}
|
|
var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
|
return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
|
|
}
|
|
function createPartial(func, bitmask, thisArg, partials) {
|
|
var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
|
|
function wrapper() {
|
|
var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
|
|
while (++leftIndex < leftLength) {
|
|
args[leftIndex] = partials[leftIndex];
|
|
}
|
|
while (argsLength--) {
|
|
args[leftIndex++] = arguments[++argsIndex];
|
|
}
|
|
return apply(fn, isBind ? thisArg : this, args);
|
|
}
|
|
return wrapper;
|
|
}
|
|
function createRange(fromRight) {
|
|
return function(start, end, step) {
|
|
if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
|
|
end = step = undefined2;
|
|
}
|
|
start = toFinite(start);
|
|
if (end === undefined2) {
|
|
end = start;
|
|
start = 0;
|
|
} else {
|
|
end = toFinite(end);
|
|
}
|
|
step = step === undefined2 ? start < end ? 1 : -1 : toFinite(step);
|
|
return baseRange(start, end, step, fromRight);
|
|
};
|
|
}
|
|
function createRelationalOperation(operator) {
|
|
return function(value, other) {
|
|
if (!(typeof value == "string" && typeof other == "string")) {
|
|
value = toNumber(value);
|
|
other = toNumber(other);
|
|
}
|
|
return operator(value, other);
|
|
};
|
|
}
|
|
function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
|
|
var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials;
|
|
bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
|
|
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
|
|
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
|
|
bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
|
|
}
|
|
var newData = [
|
|
func,
|
|
bitmask,
|
|
thisArg,
|
|
newPartials,
|
|
newHolders,
|
|
newPartialsRight,
|
|
newHoldersRight,
|
|
argPos,
|
|
ary2,
|
|
arity
|
|
];
|
|
var result2 = wrapFunc.apply(undefined2, newData);
|
|
if (isLaziable(func)) {
|
|
setData(result2, newData);
|
|
}
|
|
result2.placeholder = placeholder;
|
|
return setWrapToString(result2, func, bitmask);
|
|
}
|
|
function createRound(methodName) {
|
|
var func = Math2[methodName];
|
|
return function(number, precision) {
|
|
number = toNumber(number);
|
|
precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
|
|
if (precision && nativeIsFinite(number)) {
|
|
var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
|
|
pair = (toString(value) + "e").split("e");
|
|
return +(pair[0] + "e" + (+pair[1] - precision));
|
|
}
|
|
return func(number);
|
|
};
|
|
}
|
|
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) {
|
|
return new Set2(values2);
|
|
};
|
|
function createToPairs(keysFunc) {
|
|
return function(object) {
|
|
var tag = getTag(object);
|
|
if (tag == mapTag) {
|
|
return mapToArray(object);
|
|
}
|
|
if (tag == setTag) {
|
|
return setToPairs(object);
|
|
}
|
|
return baseToPairs(object, keysFunc(object));
|
|
};
|
|
}
|
|
function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
|
|
var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
|
|
if (!isBindKey && typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
var length = partials ? partials.length : 0;
|
|
if (!length) {
|
|
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
|
|
partials = holders = undefined2;
|
|
}
|
|
ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger(ary2), 0);
|
|
arity = arity === undefined2 ? arity : toInteger(arity);
|
|
length -= holders ? holders.length : 0;
|
|
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
|
|
var partialsRight = partials, holdersRight = holders;
|
|
partials = holders = undefined2;
|
|
}
|
|
var data = isBindKey ? undefined2 : getData(func);
|
|
var newData = [
|
|
func,
|
|
bitmask,
|
|
thisArg,
|
|
partials,
|
|
holders,
|
|
partialsRight,
|
|
holdersRight,
|
|
argPos,
|
|
ary2,
|
|
arity
|
|
];
|
|
if (data) {
|
|
mergeData(newData, data);
|
|
}
|
|
func = newData[0];
|
|
bitmask = newData[1];
|
|
thisArg = newData[2];
|
|
partials = newData[3];
|
|
holders = newData[4];
|
|
arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
|
|
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
|
|
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
|
|
}
|
|
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
|
|
var result2 = createBind(func, bitmask, thisArg);
|
|
} else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
|
|
result2 = createCurry(func, bitmask, arity);
|
|
} else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
|
|
result2 = createPartial(func, bitmask, thisArg, partials);
|
|
} else {
|
|
result2 = createHybrid.apply(undefined2, newData);
|
|
}
|
|
var setter = data ? baseSetData : setData;
|
|
return setWrapToString(setter(result2, newData), func, bitmask);
|
|
}
|
|
function customDefaultsAssignIn(objValue, srcValue, key, object) {
|
|
if (objValue === undefined2 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
|
|
return srcValue;
|
|
}
|
|
return objValue;
|
|
}
|
|
function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
|
|
if (isObject(objValue) && isObject(srcValue)) {
|
|
stack.set(srcValue, objValue);
|
|
baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack);
|
|
stack["delete"](srcValue);
|
|
}
|
|
return objValue;
|
|
}
|
|
function customOmitClone(value) {
|
|
return isPlainObject(value) ? undefined2 : value;
|
|
}
|
|
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
|
|
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
return false;
|
|
}
|
|
var arrStacked = stack.get(array);
|
|
var othStacked = stack.get(other);
|
|
if (arrStacked && othStacked) {
|
|
return arrStacked == other && othStacked == array;
|
|
}
|
|
var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined2;
|
|
stack.set(array, other);
|
|
stack.set(other, array);
|
|
while (++index < arrLength) {
|
|
var arrValue = array[index], othValue = other[index];
|
|
if (customizer) {
|
|
var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
|
|
}
|
|
if (compared !== undefined2) {
|
|
if (compared) {
|
|
continue;
|
|
}
|
|
result2 = false;
|
|
break;
|
|
}
|
|
if (seen) {
|
|
if (!arraySome(other, function(othValue2, othIndex) {
|
|
if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
|
|
return seen.push(othIndex);
|
|
}
|
|
})) {
|
|
result2 = false;
|
|
break;
|
|
}
|
|
} else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
result2 = false;
|
|
break;
|
|
}
|
|
}
|
|
stack["delete"](array);
|
|
stack["delete"](other);
|
|
return result2;
|
|
}
|
|
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
switch (tag) {
|
|
case dataViewTag:
|
|
if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
|
|
return false;
|
|
}
|
|
object = object.buffer;
|
|
other = other.buffer;
|
|
case arrayBufferTag:
|
|
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
return false;
|
|
}
|
|
return true;
|
|
case boolTag:
|
|
case dateTag:
|
|
case numberTag:
|
|
return eq(+object, +other);
|
|
case errorTag:
|
|
return object.name == other.name && object.message == other.message;
|
|
case regexpTag:
|
|
case stringTag:
|
|
return object == other + "";
|
|
case mapTag:
|
|
var convert = mapToArray;
|
|
case setTag:
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
|
|
convert || (convert = setToArray);
|
|
if (object.size != other.size && !isPartial) {
|
|
return false;
|
|
}
|
|
var stacked = stack.get(object);
|
|
if (stacked) {
|
|
return stacked == other;
|
|
}
|
|
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
stack.set(object, other);
|
|
var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
stack["delete"](object);
|
|
return result2;
|
|
case symbolTag:
|
|
if (symbolValueOf) {
|
|
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
|
|
if (objLength != othLength && !isPartial) {
|
|
return false;
|
|
}
|
|
var index = objLength;
|
|
while (index--) {
|
|
var key = objProps[index];
|
|
if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
|
|
return false;
|
|
}
|
|
}
|
|
var objStacked = stack.get(object);
|
|
var othStacked = stack.get(other);
|
|
if (objStacked && othStacked) {
|
|
return objStacked == other && othStacked == object;
|
|
}
|
|
var result2 = true;
|
|
stack.set(object, other);
|
|
stack.set(other, object);
|
|
var skipCtor = isPartial;
|
|
while (++index < objLength) {
|
|
key = objProps[index];
|
|
var objValue = object[key], othValue = other[key];
|
|
if (customizer) {
|
|
var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
|
|
}
|
|
if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
|
|
result2 = false;
|
|
break;
|
|
}
|
|
skipCtor || (skipCtor = key == "constructor");
|
|
}
|
|
if (result2 && !skipCtor) {
|
|
var objCtor = object.constructor, othCtor = other.constructor;
|
|
if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
|
|
result2 = false;
|
|
}
|
|
}
|
|
stack["delete"](object);
|
|
stack["delete"](other);
|
|
return result2;
|
|
}
|
|
function flatRest(func) {
|
|
return setToString(overRest(func, undefined2, flatten), func + "");
|
|
}
|
|
function getAllKeys(object) {
|
|
return baseGetAllKeys(object, keys, getSymbols);
|
|
}
|
|
function getAllKeysIn(object) {
|
|
return baseGetAllKeys(object, keysIn, getSymbolsIn);
|
|
}
|
|
var getData = !metaMap ? noop2 : function(func) {
|
|
return metaMap.get(func);
|
|
};
|
|
function getFuncName(func) {
|
|
var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0;
|
|
while (length--) {
|
|
var data = array[length], otherFunc = data.func;
|
|
if (otherFunc == null || otherFunc == func) {
|
|
return data.name;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function getHolder(func) {
|
|
var object = hasOwnProperty.call(lodash, "placeholder") ? lodash : func;
|
|
return object.placeholder;
|
|
}
|
|
function getIteratee() {
|
|
var result2 = lodash.iteratee || iteratee;
|
|
result2 = result2 === iteratee ? baseIteratee : result2;
|
|
return arguments.length ? result2(arguments[0], arguments[1]) : result2;
|
|
}
|
|
function getMapData(map2, key) {
|
|
var data = map2.__data__;
|
|
return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
|
|
}
|
|
function getMatchData(object) {
|
|
var result2 = keys(object), length = result2.length;
|
|
while (length--) {
|
|
var key = result2[length], value = object[key];
|
|
result2[length] = [key, value, isStrictComparable(value)];
|
|
}
|
|
return result2;
|
|
}
|
|
function getNative(object, key) {
|
|
var value = getValue(object, key);
|
|
return baseIsNative(value) ? value : undefined2;
|
|
}
|
|
function getRawTag(value) {
|
|
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
try {
|
|
value[symToStringTag] = undefined2;
|
|
var unmasked = true;
|
|
} catch (e) {
|
|
}
|
|
var result2 = nativeObjectToString.call(value);
|
|
if (unmasked) {
|
|
if (isOwn) {
|
|
value[symToStringTag] = tag;
|
|
} else {
|
|
delete value[symToStringTag];
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
|
|
if (object == null) {
|
|
return [];
|
|
}
|
|
object = Object2(object);
|
|
return arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
return propertyIsEnumerable.call(object, symbol);
|
|
});
|
|
};
|
|
var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
|
|
var result2 = [];
|
|
while (object) {
|
|
arrayPush(result2, getSymbols(object));
|
|
object = getPrototype(object);
|
|
}
|
|
return result2;
|
|
};
|
|
var getTag = baseGetTag;
|
|
if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
|
|
getTag = function(value) {
|
|
var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined2, ctorString = Ctor ? toSource(Ctor) : "";
|
|
if (ctorString) {
|
|
switch (ctorString) {
|
|
case dataViewCtorString:
|
|
return dataViewTag;
|
|
case mapCtorString:
|
|
return mapTag;
|
|
case promiseCtorString:
|
|
return promiseTag;
|
|
case setCtorString:
|
|
return setTag;
|
|
case weakMapCtorString:
|
|
return weakMapTag;
|
|
}
|
|
}
|
|
return result2;
|
|
};
|
|
}
|
|
function getView(start, end, transforms) {
|
|
var index = -1, length = transforms.length;
|
|
while (++index < length) {
|
|
var data = transforms[index], size2 = data.size;
|
|
switch (data.type) {
|
|
case "drop":
|
|
start += size2;
|
|
break;
|
|
case "dropRight":
|
|
end -= size2;
|
|
break;
|
|
case "take":
|
|
end = nativeMin(end, start + size2);
|
|
break;
|
|
case "takeRight":
|
|
start = nativeMax(start, end - size2);
|
|
break;
|
|
}
|
|
}
|
|
return { "start": start, "end": end };
|
|
}
|
|
function getWrapDetails(source) {
|
|
var match = source.match(reWrapDetails);
|
|
return match ? match[1].split(reSplitDetails) : [];
|
|
}
|
|
function hasPath(object, path, hasFunc) {
|
|
path = castPath(path, object);
|
|
var index = -1, length = path.length, result2 = false;
|
|
while (++index < length) {
|
|
var key = toKey(path[index]);
|
|
if (!(result2 = object != null && hasFunc(object, key))) {
|
|
break;
|
|
}
|
|
object = object[key];
|
|
}
|
|
if (result2 || ++index != length) {
|
|
return result2;
|
|
}
|
|
length = object == null ? 0 : object.length;
|
|
return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
|
|
}
|
|
function initCloneArray(array) {
|
|
var length = array.length, result2 = new array.constructor(length);
|
|
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
|
|
result2.index = array.index;
|
|
result2.input = array.input;
|
|
}
|
|
return result2;
|
|
}
|
|
function initCloneObject(object) {
|
|
return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
|
|
}
|
|
function initCloneByTag(object, tag, isDeep) {
|
|
var Ctor = object.constructor;
|
|
switch (tag) {
|
|
case arrayBufferTag:
|
|
return cloneArrayBuffer(object);
|
|
case boolTag:
|
|
case dateTag:
|
|
return new Ctor(+object);
|
|
case dataViewTag:
|
|
return cloneDataView(object, isDeep);
|
|
case float32Tag:
|
|
case float64Tag:
|
|
case int8Tag:
|
|
case int16Tag:
|
|
case int32Tag:
|
|
case uint8Tag:
|
|
case uint8ClampedTag:
|
|
case uint16Tag:
|
|
case uint32Tag:
|
|
return cloneTypedArray(object, isDeep);
|
|
case mapTag:
|
|
return new Ctor();
|
|
case numberTag:
|
|
case stringTag:
|
|
return new Ctor(object);
|
|
case regexpTag:
|
|
return cloneRegExp(object);
|
|
case setTag:
|
|
return new Ctor();
|
|
case symbolTag:
|
|
return cloneSymbol(object);
|
|
}
|
|
}
|
|
function insertWrapDetails(source, details) {
|
|
var length = details.length;
|
|
if (!length) {
|
|
return source;
|
|
}
|
|
var lastIndex = length - 1;
|
|
details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
|
|
details = details.join(length > 2 ? ", " : " ");
|
|
return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
|
|
}
|
|
function isFlattenable(value) {
|
|
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
}
|
|
function isIndex(value, length) {
|
|
var type = typeof value;
|
|
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
}
|
|
function isIterateeCall(value, index, object) {
|
|
if (!isObject(object)) {
|
|
return false;
|
|
}
|
|
var type = typeof index;
|
|
if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
|
|
return eq(object[index], value);
|
|
}
|
|
return false;
|
|
}
|
|
function isKey(value, object) {
|
|
if (isArray(value)) {
|
|
return false;
|
|
}
|
|
var type = typeof value;
|
|
if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
|
|
return true;
|
|
}
|
|
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
|
|
}
|
|
function isKeyable(value) {
|
|
var type = typeof value;
|
|
return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
|
|
}
|
|
function isLaziable(func) {
|
|
var funcName = getFuncName(func), other = lodash[funcName];
|
|
if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
|
|
return false;
|
|
}
|
|
if (func === other) {
|
|
return true;
|
|
}
|
|
var data = getData(other);
|
|
return !!data && func === data[0];
|
|
}
|
|
function isMasked(func) {
|
|
return !!maskSrcKey && maskSrcKey in func;
|
|
}
|
|
var isMaskable = coreJsData ? isFunction : stubFalse;
|
|
function isPrototype(value) {
|
|
var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
|
|
return value === proto;
|
|
}
|
|
function isStrictComparable(value) {
|
|
return value === value && !isObject(value);
|
|
}
|
|
function matchesStrictComparable(key, srcValue) {
|
|
return function(object) {
|
|
if (object == null) {
|
|
return false;
|
|
}
|
|
return object[key] === srcValue && (srcValue !== undefined2 || key in Object2(object));
|
|
};
|
|
}
|
|
function memoizeCapped(func) {
|
|
var result2 = memoize(func, function(key) {
|
|
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
cache.clear();
|
|
}
|
|
return key;
|
|
});
|
|
var cache = result2.cache;
|
|
return result2;
|
|
}
|
|
function mergeData(data, source) {
|
|
var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
|
|
var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
|
|
if (!(isCommon || isCombo)) {
|
|
return data;
|
|
}
|
|
if (srcBitmask & WRAP_BIND_FLAG) {
|
|
data[2] = source[2];
|
|
newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
|
|
}
|
|
var value = source[3];
|
|
if (value) {
|
|
var partials = data[3];
|
|
data[3] = partials ? composeArgs(partials, value, source[4]) : value;
|
|
data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
|
|
}
|
|
value = source[5];
|
|
if (value) {
|
|
partials = data[5];
|
|
data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
|
|
data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
|
|
}
|
|
value = source[7];
|
|
if (value) {
|
|
data[7] = value;
|
|
}
|
|
if (srcBitmask & WRAP_ARY_FLAG) {
|
|
data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
|
|
}
|
|
if (data[9] == null) {
|
|
data[9] = source[9];
|
|
}
|
|
data[0] = source[0];
|
|
data[1] = newBitmask;
|
|
return data;
|
|
}
|
|
function nativeKeysIn(object) {
|
|
var result2 = [];
|
|
if (object != null) {
|
|
for (var key in Object2(object)) {
|
|
result2.push(key);
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function objectToString(value) {
|
|
return nativeObjectToString.call(value);
|
|
}
|
|
function overRest(func, start, transform3) {
|
|
start = nativeMax(start === undefined2 ? func.length - 1 : start, 0);
|
|
return function() {
|
|
var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
|
|
while (++index < length) {
|
|
array[index] = args[start + index];
|
|
}
|
|
index = -1;
|
|
var otherArgs = Array2(start + 1);
|
|
while (++index < start) {
|
|
otherArgs[index] = args[index];
|
|
}
|
|
otherArgs[start] = transform3(array);
|
|
return apply(func, this, otherArgs);
|
|
};
|
|
}
|
|
function parent(object, path) {
|
|
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
|
|
}
|
|
function reorder(array, indexes) {
|
|
var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
|
|
while (length--) {
|
|
var index = indexes[length];
|
|
array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined2;
|
|
}
|
|
return array;
|
|
}
|
|
function safeGet(object, key) {
|
|
if (key === "constructor" && typeof object[key] === "function") {
|
|
return;
|
|
}
|
|
if (key == "__proto__") {
|
|
return;
|
|
}
|
|
return object[key];
|
|
}
|
|
var setData = shortOut(baseSetData);
|
|
var setTimeout = ctxSetTimeout || function(func, wait) {
|
|
return root.setTimeout(func, wait);
|
|
};
|
|
var setToString = shortOut(baseSetToString);
|
|
function setWrapToString(wrapper, reference, bitmask) {
|
|
var source = reference + "";
|
|
return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
|
|
}
|
|
function shortOut(func) {
|
|
var count = 0, lastCalled = 0;
|
|
return function() {
|
|
var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
|
|
lastCalled = stamp;
|
|
if (remaining > 0) {
|
|
if (++count >= HOT_COUNT) {
|
|
return arguments[0];
|
|
}
|
|
} else {
|
|
count = 0;
|
|
}
|
|
return func.apply(undefined2, arguments);
|
|
};
|
|
}
|
|
function shuffleSelf(array, size2) {
|
|
var index = -1, length = array.length, lastIndex = length - 1;
|
|
size2 = size2 === undefined2 ? length : size2;
|
|
while (++index < size2) {
|
|
var rand = baseRandom(index, lastIndex), value = array[rand];
|
|
array[rand] = array[index];
|
|
array[index] = value;
|
|
}
|
|
array.length = size2;
|
|
return array;
|
|
}
|
|
var stringToPath = memoizeCapped(function(string) {
|
|
var result2 = [];
|
|
if (string.charCodeAt(0) === 46) {
|
|
result2.push("");
|
|
}
|
|
string.replace(rePropName, function(match, number, quote, subString) {
|
|
result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
|
|
});
|
|
return result2;
|
|
});
|
|
function toKey(value) {
|
|
if (typeof value == "string" || isSymbol(value)) {
|
|
return value;
|
|
}
|
|
var result2 = value + "";
|
|
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
}
|
|
function toSource(func) {
|
|
if (func != null) {
|
|
try {
|
|
return funcToString.call(func);
|
|
} catch (e) {
|
|
}
|
|
try {
|
|
return func + "";
|
|
} catch (e) {
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
function updateWrapDetails(details, bitmask) {
|
|
arrayEach(wrapFlags, function(pair) {
|
|
var value = "_." + pair[0];
|
|
if (bitmask & pair[1] && !arrayIncludes(details, value)) {
|
|
details.push(value);
|
|
}
|
|
});
|
|
return details.sort();
|
|
}
|
|
function wrapperClone(wrapper) {
|
|
if (wrapper instanceof LazyWrapper) {
|
|
return wrapper.clone();
|
|
}
|
|
var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
|
|
result2.__actions__ = copyArray(wrapper.__actions__);
|
|
result2.__index__ = wrapper.__index__;
|
|
result2.__values__ = wrapper.__values__;
|
|
return result2;
|
|
}
|
|
function chunk(array, size2, guard) {
|
|
if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined2) {
|
|
size2 = 1;
|
|
} else {
|
|
size2 = nativeMax(toInteger(size2), 0);
|
|
}
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length || size2 < 1) {
|
|
return [];
|
|
}
|
|
var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
|
|
while (index < length) {
|
|
result2[resIndex++] = baseSlice(array, index, index += size2);
|
|
}
|
|
return result2;
|
|
}
|
|
function compact(array) {
|
|
var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (value) {
|
|
result2[resIndex++] = value;
|
|
}
|
|
}
|
|
return result2;
|
|
}
|
|
function concat() {
|
|
var length = arguments.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
var args = Array2(length - 1), array = arguments[0], index = length;
|
|
while (index--) {
|
|
args[index - 1] = arguments[index];
|
|
}
|
|
return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
|
|
}
|
|
var difference2 = baseRest(function(array, values2) {
|
|
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
|
|
});
|
|
var differenceBy = baseRest(function(array, values2) {
|
|
var iteratee2 = last3(values2);
|
|
if (isArrayLikeObject(iteratee2)) {
|
|
iteratee2 = undefined2;
|
|
}
|
|
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
|
|
});
|
|
var differenceWith = baseRest(function(array, values2) {
|
|
var comparator = last3(values2);
|
|
if (isArrayLikeObject(comparator)) {
|
|
comparator = undefined2;
|
|
}
|
|
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : [];
|
|
});
|
|
function drop(array, n, guard) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
n = guard || n === undefined2 ? 1 : toInteger(n);
|
|
return baseSlice(array, n < 0 ? 0 : n, length);
|
|
}
|
|
function dropRight(array, n, guard) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
n = guard || n === undefined2 ? 1 : toInteger(n);
|
|
n = length - n;
|
|
return baseSlice(array, 0, n < 0 ? 0 : n);
|
|
}
|
|
function dropRightWhile(array, predicate) {
|
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
|
|
}
|
|
function dropWhile(array, predicate) {
|
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
|
|
}
|
|
function fill(array, value, start, end) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
|
|
start = 0;
|
|
end = length;
|
|
}
|
|
return baseFill(array, value, start, end);
|
|
}
|
|
function findIndex(array, predicate, fromIndex) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return -1;
|
|
}
|
|
var index = fromIndex == null ? 0 : toInteger(fromIndex);
|
|
if (index < 0) {
|
|
index = nativeMax(length + index, 0);
|
|
}
|
|
return baseFindIndex(array, getIteratee(predicate, 3), index);
|
|
}
|
|
function findLastIndex(array, predicate, fromIndex) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return -1;
|
|
}
|
|
var index = length - 1;
|
|
if (fromIndex !== undefined2) {
|
|
index = toInteger(fromIndex);
|
|
index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
|
|
}
|
|
return baseFindIndex(array, getIteratee(predicate, 3), index, true);
|
|
}
|
|
function flatten(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseFlatten(array, 1) : [];
|
|
}
|
|
function flattenDeep(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseFlatten(array, INFINITY) : [];
|
|
}
|
|
function flattenDepth(array, depth) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
depth = depth === undefined2 ? 1 : toInteger(depth);
|
|
return baseFlatten(array, depth);
|
|
}
|
|
function fromPairs(pairs) {
|
|
var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
|
|
while (++index < length) {
|
|
var pair = pairs[index];
|
|
result2[pair[0]] = pair[1];
|
|
}
|
|
return result2;
|
|
}
|
|
function head(array) {
|
|
return array && array.length ? array[0] : undefined2;
|
|
}
|
|
function indexOf(array, value, fromIndex) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return -1;
|
|
}
|
|
var index = fromIndex == null ? 0 : toInteger(fromIndex);
|
|
if (index < 0) {
|
|
index = nativeMax(length + index, 0);
|
|
}
|
|
return baseIndexOf(array, value, index);
|
|
}
|
|
function initial(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseSlice(array, 0, -1) : [];
|
|
}
|
|
var intersection = baseRest(function(arrays) {
|
|
var mapped = arrayMap(arrays, castArrayLikeObject);
|
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
|
|
});
|
|
var intersectionBy = baseRest(function(arrays) {
|
|
var iteratee2 = last3(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
|
|
if (iteratee2 === last3(mapped)) {
|
|
iteratee2 = undefined2;
|
|
} else {
|
|
mapped.pop();
|
|
}
|
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
|
|
});
|
|
var intersectionWith = baseRest(function(arrays) {
|
|
var comparator = last3(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
|
|
comparator = typeof comparator == "function" ? comparator : undefined2;
|
|
if (comparator) {
|
|
mapped.pop();
|
|
}
|
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
});
|
|
function join(array, separator) {
|
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
}
|
|
function last3(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? array[length - 1] : undefined2;
|
|
}
|
|
function lastIndexOf(array, value, fromIndex) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return -1;
|
|
}
|
|
var index = length;
|
|
if (fromIndex !== undefined2) {
|
|
index = toInteger(fromIndex);
|
|
index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
|
|
}
|
|
return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
|
|
}
|
|
function nth(array, n) {
|
|
return array && array.length ? baseNth(array, toInteger(n)) : undefined2;
|
|
}
|
|
var pull = baseRest(pullAll);
|
|
function pullAll(array, values2) {
|
|
return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
|
|
}
|
|
function pullAllBy(array, values2, iteratee2) {
|
|
return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
|
|
}
|
|
function pullAllWith(array, values2, comparator) {
|
|
return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined2, comparator) : array;
|
|
}
|
|
var pullAt = flatRest(function(array, indexes) {
|
|
var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes);
|
|
basePullAt(array, arrayMap(indexes, function(index) {
|
|
return isIndex(index, length) ? +index : index;
|
|
}).sort(compareAscending));
|
|
return result2;
|
|
});
|
|
function remove(array, predicate) {
|
|
var result2 = [];
|
|
if (!(array && array.length)) {
|
|
return result2;
|
|
}
|
|
var index = -1, indexes = [], length = array.length;
|
|
predicate = getIteratee(predicate, 3);
|
|
while (++index < length) {
|
|
var value = array[index];
|
|
if (predicate(value, index, array)) {
|
|
result2.push(value);
|
|
indexes.push(index);
|
|
}
|
|
}
|
|
basePullAt(array, indexes);
|
|
return result2;
|
|
}
|
|
function reverse(array) {
|
|
return array == null ? array : nativeReverse.call(array);
|
|
}
|
|
function slice(array, start, end) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
|
|
start = 0;
|
|
end = length;
|
|
} else {
|
|
start = start == null ? 0 : toInteger(start);
|
|
end = end === undefined2 ? length : toInteger(end);
|
|
}
|
|
return baseSlice(array, start, end);
|
|
}
|
|
function sortedIndex(array, value) {
|
|
return baseSortedIndex(array, value);
|
|
}
|
|
function sortedIndexBy(array, value, iteratee2) {
|
|
return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
|
|
}
|
|
function sortedIndexOf(array, value) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (length) {
|
|
var index = baseSortedIndex(array, value);
|
|
if (index < length && eq(array[index], value)) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function sortedLastIndex(array, value) {
|
|
return baseSortedIndex(array, value, true);
|
|
}
|
|
function sortedLastIndexBy(array, value, iteratee2) {
|
|
return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
|
|
}
|
|
function sortedLastIndexOf(array, value) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (length) {
|
|
var index = baseSortedIndex(array, value, true) - 1;
|
|
if (eq(array[index], value)) {
|
|
return index;
|
|
}
|
|
}
|
|
return -1;
|
|
}
|
|
function sortedUniq(array) {
|
|
return array && array.length ? baseSortedUniq(array) : [];
|
|
}
|
|
function sortedUniqBy(array, iteratee2) {
|
|
return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
|
|
}
|
|
function tail(array) {
|
|
var length = array == null ? 0 : array.length;
|
|
return length ? baseSlice(array, 1, length) : [];
|
|
}
|
|
function take(array, n, guard) {
|
|
if (!(array && array.length)) {
|
|
return [];
|
|
}
|
|
n = guard || n === undefined2 ? 1 : toInteger(n);
|
|
return baseSlice(array, 0, n < 0 ? 0 : n);
|
|
}
|
|
function takeRight(array, n, guard) {
|
|
var length = array == null ? 0 : array.length;
|
|
if (!length) {
|
|
return [];
|
|
}
|
|
n = guard || n === undefined2 ? 1 : toInteger(n);
|
|
n = length - n;
|
|
return baseSlice(array, n < 0 ? 0 : n, length);
|
|
}
|
|
function takeRightWhile(array, predicate) {
|
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
|
|
}
|
|
function takeWhile(array, predicate) {
|
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
|
|
}
|
|
var union = baseRest(function(arrays) {
|
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
|
|
});
|
|
var unionBy = baseRest(function(arrays) {
|
|
var iteratee2 = last3(arrays);
|
|
if (isArrayLikeObject(iteratee2)) {
|
|
iteratee2 = undefined2;
|
|
}
|
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
|
|
});
|
|
var unionWith = baseRest(function(arrays) {
|
|
var comparator = last3(arrays);
|
|
comparator = typeof comparator == "function" ? comparator : undefined2;
|
|
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator);
|
|
});
|
|
function uniq(array) {
|
|
return array && array.length ? baseUniq(array) : [];
|
|
}
|
|
function uniqBy(array, iteratee2) {
|
|
return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
|
|
}
|
|
function uniqWith(array, comparator) {
|
|
comparator = typeof comparator == "function" ? comparator : undefined2;
|
|
return array && array.length ? baseUniq(array, undefined2, comparator) : [];
|
|
}
|
|
function unzip(array) {
|
|
if (!(array && array.length)) {
|
|
return [];
|
|
}
|
|
var length = 0;
|
|
array = arrayFilter(array, function(group) {
|
|
if (isArrayLikeObject(group)) {
|
|
length = nativeMax(group.length, length);
|
|
return true;
|
|
}
|
|
});
|
|
return baseTimes(length, function(index) {
|
|
return arrayMap(array, baseProperty(index));
|
|
});
|
|
}
|
|
function unzipWith(array, iteratee2) {
|
|
if (!(array && array.length)) {
|
|
return [];
|
|
}
|
|
var result2 = unzip(array);
|
|
if (iteratee2 == null) {
|
|
return result2;
|
|
}
|
|
return arrayMap(result2, function(group) {
|
|
return apply(iteratee2, undefined2, group);
|
|
});
|
|
}
|
|
var without = baseRest(function(array, values2) {
|
|
return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
|
|
});
|
|
var xor = baseRest(function(arrays) {
|
|
return baseXor(arrayFilter(arrays, isArrayLikeObject));
|
|
});
|
|
var xorBy = baseRest(function(arrays) {
|
|
var iteratee2 = last3(arrays);
|
|
if (isArrayLikeObject(iteratee2)) {
|
|
iteratee2 = undefined2;
|
|
}
|
|
return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
|
|
});
|
|
var xorWith = baseRest(function(arrays) {
|
|
var comparator = last3(arrays);
|
|
comparator = typeof comparator == "function" ? comparator : undefined2;
|
|
return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator);
|
|
});
|
|
var zip = baseRest(unzip);
|
|
function zipObject(props, values2) {
|
|
return baseZipObject(props || [], values2 || [], assignValue);
|
|
}
|
|
function zipObjectDeep(props, values2) {
|
|
return baseZipObject(props || [], values2 || [], baseSet);
|
|
}
|
|
var zipWith = baseRest(function(arrays) {
|
|
var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2;
|
|
iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2;
|
|
return unzipWith(arrays, iteratee2);
|
|
});
|
|
function chain(value) {
|
|
var result2 = lodash(value);
|
|
result2.__chain__ = true;
|
|
return result2;
|
|
}
|
|
function tap(value, interceptor) {
|
|
interceptor(value);
|
|
return value;
|
|
}
|
|
function thru(value, interceptor) {
|
|
return interceptor(value);
|
|
}
|
|
var wrapperAt = flatRest(function(paths) {
|
|
var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
|
|
return baseAt(object, paths);
|
|
};
|
|
if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
|
|
return this.thru(interceptor);
|
|
}
|
|
value = value.slice(start, +start + (length ? 1 : 0));
|
|
value.__actions__.push({
|
|
"func": thru,
|
|
"args": [interceptor],
|
|
"thisArg": undefined2
|
|
});
|
|
return new LodashWrapper(value, this.__chain__).thru(function(array) {
|
|
if (length && !array.length) {
|
|
array.push(undefined2);
|
|
}
|
|
return array;
|
|
});
|
|
});
|
|
function wrapperChain() {
|
|
return chain(this);
|
|
}
|
|
function wrapperCommit() {
|
|
return new LodashWrapper(this.value(), this.__chain__);
|
|
}
|
|
function wrapperNext() {
|
|
if (this.__values__ === undefined2) {
|
|
this.__values__ = toArray(this.value());
|
|
}
|
|
var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++];
|
|
return { "done": done, "value": value };
|
|
}
|
|
function wrapperToIterator() {
|
|
return this;
|
|
}
|
|
function wrapperPlant(value) {
|
|
var result2, parent2 = this;
|
|
while (parent2 instanceof baseLodash) {
|
|
var clone2 = wrapperClone(parent2);
|
|
clone2.__index__ = 0;
|
|
clone2.__values__ = undefined2;
|
|
if (result2) {
|
|
previous.__wrapped__ = clone2;
|
|
} else {
|
|
result2 = clone2;
|
|
}
|
|
var previous = clone2;
|
|
parent2 = parent2.__wrapped__;
|
|
}
|
|
previous.__wrapped__ = value;
|
|
return result2;
|
|
}
|
|
function wrapperReverse() {
|
|
var value = this.__wrapped__;
|
|
if (value instanceof LazyWrapper) {
|
|
var wrapped = value;
|
|
if (this.__actions__.length) {
|
|
wrapped = new LazyWrapper(this);
|
|
}
|
|
wrapped = wrapped.reverse();
|
|
wrapped.__actions__.push({
|
|
"func": thru,
|
|
"args": [reverse],
|
|
"thisArg": undefined2
|
|
});
|
|
return new LodashWrapper(wrapped, this.__chain__);
|
|
}
|
|
return this.thru(reverse);
|
|
}
|
|
function wrapperValue() {
|
|
return baseWrapperValue(this.__wrapped__, this.__actions__);
|
|
}
|
|
var countBy = createAggregator(function(result2, value, key) {
|
|
if (hasOwnProperty.call(result2, key)) {
|
|
++result2[key];
|
|
} else {
|
|
baseAssignValue(result2, key, 1);
|
|
}
|
|
});
|
|
function every(collection, predicate, guard) {
|
|
var func = isArray(collection) ? arrayEvery : baseEvery;
|
|
if (guard && isIterateeCall(collection, predicate, guard)) {
|
|
predicate = undefined2;
|
|
}
|
|
return func(collection, getIteratee(predicate, 3));
|
|
}
|
|
function filter(collection, predicate) {
|
|
var func = isArray(collection) ? arrayFilter : baseFilter;
|
|
return func(collection, getIteratee(predicate, 3));
|
|
}
|
|
var find = createFind(findIndex);
|
|
var findLast = createFind(findLastIndex);
|
|
function flatMap(collection, iteratee2) {
|
|
return baseFlatten(map(collection, iteratee2), 1);
|
|
}
|
|
function flatMapDeep(collection, iteratee2) {
|
|
return baseFlatten(map(collection, iteratee2), INFINITY);
|
|
}
|
|
function flatMapDepth(collection, iteratee2, depth) {
|
|
depth = depth === undefined2 ? 1 : toInteger(depth);
|
|
return baseFlatten(map(collection, iteratee2), depth);
|
|
}
|
|
function forEach(collection, iteratee2) {
|
|
var func = isArray(collection) ? arrayEach : baseEach;
|
|
return func(collection, getIteratee(iteratee2, 3));
|
|
}
|
|
function forEachRight(collection, iteratee2) {
|
|
var func = isArray(collection) ? arrayEachRight : baseEachRight;
|
|
return func(collection, getIteratee(iteratee2, 3));
|
|
}
|
|
var groupBy = createAggregator(function(result2, value, key) {
|
|
if (hasOwnProperty.call(result2, key)) {
|
|
result2[key].push(value);
|
|
} else {
|
|
baseAssignValue(result2, key, [value]);
|
|
}
|
|
});
|
|
function includes(collection, value, fromIndex, guard) {
|
|
collection = isArrayLike(collection) ? collection : values(collection);
|
|
fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
|
|
var length = collection.length;
|
|
if (fromIndex < 0) {
|
|
fromIndex = nativeMax(length + fromIndex, 0);
|
|
}
|
|
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
}
|
|
var invokeMap = baseRest(function(collection, path, args) {
|
|
var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
baseEach(collection, function(value) {
|
|
result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
|
|
});
|
|
return result2;
|
|
});
|
|
var keyBy = createAggregator(function(result2, value, key) {
|
|
baseAssignValue(result2, key, value);
|
|
});
|
|
function map(collection, iteratee2) {
|
|
var func = isArray(collection) ? arrayMap : baseMap;
|
|
return func(collection, getIteratee(iteratee2, 3));
|
|
}
|
|
function orderBy(collection, iteratees, orders, guard) {
|
|
if (collection == null) {
|
|
return [];
|
|
}
|
|
if (!isArray(iteratees)) {
|
|
iteratees = iteratees == null ? [] : [iteratees];
|
|
}
|
|
orders = guard ? undefined2 : orders;
|
|
if (!isArray(orders)) {
|
|
orders = orders == null ? [] : [orders];
|
|
}
|
|
return baseOrderBy(collection, iteratees, orders);
|
|
}
|
|
var partition3 = createAggregator(function(result2, value, key) {
|
|
result2[key ? 0 : 1].push(value);
|
|
}, function() {
|
|
return [[], []];
|
|
});
|
|
function reduce(collection, iteratee2, accumulator) {
|
|
var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
|
|
return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
|
|
}
|
|
function reduceRight(collection, iteratee2, accumulator) {
|
|
var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
|
|
return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
|
|
}
|
|
function reject(collection, predicate) {
|
|
var func = isArray(collection) ? arrayFilter : baseFilter;
|
|
return func(collection, negate(getIteratee(predicate, 3)));
|
|
}
|
|
function sample(collection) {
|
|
var func = isArray(collection) ? arraySample : baseSample;
|
|
return func(collection);
|
|
}
|
|
function sampleSize(collection, n, guard) {
|
|
if (guard ? isIterateeCall(collection, n, guard) : n === undefined2) {
|
|
n = 1;
|
|
} else {
|
|
n = toInteger(n);
|
|
}
|
|
var func = isArray(collection) ? arraySampleSize : baseSampleSize;
|
|
return func(collection, n);
|
|
}
|
|
function shuffle(collection) {
|
|
var func = isArray(collection) ? arrayShuffle : baseShuffle;
|
|
return func(collection);
|
|
}
|
|
function size(collection) {
|
|
if (collection == null) {
|
|
return 0;
|
|
}
|
|
if (isArrayLike(collection)) {
|
|
return isString(collection) ? stringSize(collection) : collection.length;
|
|
}
|
|
var tag = getTag(collection);
|
|
if (tag == mapTag || tag == setTag) {
|
|
return collection.size;
|
|
}
|
|
return baseKeys(collection).length;
|
|
}
|
|
function some(collection, predicate, guard) {
|
|
var func = isArray(collection) ? arraySome : baseSome;
|
|
if (guard && isIterateeCall(collection, predicate, guard)) {
|
|
predicate = undefined2;
|
|
}
|
|
return func(collection, getIteratee(predicate, 3));
|
|
}
|
|
var sortBy = baseRest(function(collection, iteratees) {
|
|
if (collection == null) {
|
|
return [];
|
|
}
|
|
var length = iteratees.length;
|
|
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
|
|
iteratees = [];
|
|
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
|
iteratees = [iteratees[0]];
|
|
}
|
|
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
|
|
});
|
|
var now = ctxNow || function() {
|
|
return root.Date.now();
|
|
};
|
|
function after(n, func) {
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
n = toInteger(n);
|
|
return function() {
|
|
if (--n < 1) {
|
|
return func.apply(this, arguments);
|
|
}
|
|
};
|
|
}
|
|
function ary(func, n, guard) {
|
|
n = guard ? undefined2 : n;
|
|
n = func && n == null ? func.length : n;
|
|
return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n);
|
|
}
|
|
function before(n, func) {
|
|
var result2;
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
n = toInteger(n);
|
|
return function() {
|
|
if (--n > 0) {
|
|
result2 = func.apply(this, arguments);
|
|
}
|
|
if (n <= 1) {
|
|
func = undefined2;
|
|
}
|
|
return result2;
|
|
};
|
|
}
|
|
var bind = baseRest(function(func, thisArg, partials) {
|
|
var bitmask = WRAP_BIND_FLAG;
|
|
if (partials.length) {
|
|
var holders = replaceHolders(partials, getHolder(bind));
|
|
bitmask |= WRAP_PARTIAL_FLAG;
|
|
}
|
|
return createWrap(func, bitmask, thisArg, partials, holders);
|
|
});
|
|
var bindKey = baseRest(function(object, key, partials) {
|
|
var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
|
|
if (partials.length) {
|
|
var holders = replaceHolders(partials, getHolder(bindKey));
|
|
bitmask |= WRAP_PARTIAL_FLAG;
|
|
}
|
|
return createWrap(key, bitmask, object, partials, holders);
|
|
});
|
|
function curry(func, arity, guard) {
|
|
arity = guard ? undefined2 : arity;
|
|
var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity);
|
|
result2.placeholder = curry.placeholder;
|
|
return result2;
|
|
}
|
|
function curryRight(func, arity, guard) {
|
|
arity = guard ? undefined2 : arity;
|
|
var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity);
|
|
result2.placeholder = curryRight.placeholder;
|
|
return result2;
|
|
}
|
|
function debounce(func, wait, options) {
|
|
var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
wait = toNumber(wait) || 0;
|
|
if (isObject(options)) {
|
|
leading = !!options.leading;
|
|
maxing = "maxWait" in options;
|
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
}
|
|
function invokeFunc(time2) {
|
|
var args = lastArgs, thisArg = lastThis;
|
|
lastArgs = lastThis = undefined2;
|
|
lastInvokeTime = time2;
|
|
result2 = func.apply(thisArg, args);
|
|
return result2;
|
|
}
|
|
function leadingEdge(time2) {
|
|
lastInvokeTime = time2;
|
|
timerId = setTimeout(timerExpired, wait);
|
|
return leading ? invokeFunc(time2) : result2;
|
|
}
|
|
function remainingWait(time2) {
|
|
var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
}
|
|
function shouldInvoke(time2) {
|
|
var timeSinceLastCall = time2 - lastCallTime, timeSinceLastInvoke = time2 - lastInvokeTime;
|
|
return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
}
|
|
function timerExpired() {
|
|
var time2 = now();
|
|
if (shouldInvoke(time2)) {
|
|
return trailingEdge(time2);
|
|
}
|
|
timerId = setTimeout(timerExpired, remainingWait(time2));
|
|
}
|
|
function trailingEdge(time2) {
|
|
timerId = undefined2;
|
|
if (trailing && lastArgs) {
|
|
return invokeFunc(time2);
|
|
}
|
|
lastArgs = lastThis = undefined2;
|
|
return result2;
|
|
}
|
|
function cancel() {
|
|
if (timerId !== undefined2) {
|
|
clearTimeout(timerId);
|
|
}
|
|
lastInvokeTime = 0;
|
|
lastArgs = lastCallTime = lastThis = timerId = undefined2;
|
|
}
|
|
function flush2() {
|
|
return timerId === undefined2 ? result2 : trailingEdge(now());
|
|
}
|
|
function debounced() {
|
|
var time2 = now(), isInvoking = shouldInvoke(time2);
|
|
lastArgs = arguments;
|
|
lastThis = this;
|
|
lastCallTime = time2;
|
|
if (isInvoking) {
|
|
if (timerId === undefined2) {
|
|
return leadingEdge(lastCallTime);
|
|
}
|
|
if (maxing) {
|
|
clearTimeout(timerId);
|
|
timerId = setTimeout(timerExpired, wait);
|
|
return invokeFunc(lastCallTime);
|
|
}
|
|
}
|
|
if (timerId === undefined2) {
|
|
timerId = setTimeout(timerExpired, wait);
|
|
}
|
|
return result2;
|
|
}
|
|
debounced.cancel = cancel;
|
|
debounced.flush = flush2;
|
|
return debounced;
|
|
}
|
|
var defer = baseRest(function(func, args) {
|
|
return baseDelay(func, 1, args);
|
|
});
|
|
var delay = baseRest(function(func, wait, args) {
|
|
return baseDelay(func, toNumber(wait) || 0, args);
|
|
});
|
|
function flip(func) {
|
|
return createWrap(func, WRAP_FLIP_FLAG);
|
|
}
|
|
function memoize(func, resolver) {
|
|
if (typeof func != "function" || resolver != null && typeof resolver != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
var memoized = function() {
|
|
var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
|
|
if (cache.has(key)) {
|
|
return cache.get(key);
|
|
}
|
|
var result2 = func.apply(this, args);
|
|
memoized.cache = cache.set(key, result2) || cache;
|
|
return result2;
|
|
};
|
|
memoized.cache = new (memoize.Cache || MapCache)();
|
|
return memoized;
|
|
}
|
|
memoize.Cache = MapCache;
|
|
function negate(predicate) {
|
|
if (typeof predicate != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
return function() {
|
|
var args = arguments;
|
|
switch (args.length) {
|
|
case 0:
|
|
return !predicate.call(this);
|
|
case 1:
|
|
return !predicate.call(this, args[0]);
|
|
case 2:
|
|
return !predicate.call(this, args[0], args[1]);
|
|
case 3:
|
|
return !predicate.call(this, args[0], args[1], args[2]);
|
|
}
|
|
return !predicate.apply(this, args);
|
|
};
|
|
}
|
|
function once(func) {
|
|
return before(2, func);
|
|
}
|
|
var overArgs = castRest(function(func, transforms) {
|
|
transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
|
|
var funcsLength = transforms.length;
|
|
return baseRest(function(args) {
|
|
var index = -1, length = nativeMin(args.length, funcsLength);
|
|
while (++index < length) {
|
|
args[index] = transforms[index].call(this, args[index]);
|
|
}
|
|
return apply(func, this, args);
|
|
});
|
|
});
|
|
var partial = baseRest(function(func, partials) {
|
|
var holders = replaceHolders(partials, getHolder(partial));
|
|
return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders);
|
|
});
|
|
var partialRight = baseRest(function(func, partials) {
|
|
var holders = replaceHolders(partials, getHolder(partialRight));
|
|
return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders);
|
|
});
|
|
var rearg = flatRest(function(func, indexes) {
|
|
return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes);
|
|
});
|
|
function rest(func, start) {
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
start = start === undefined2 ? start : toInteger(start);
|
|
return baseRest(func, start);
|
|
}
|
|
function spread(func, start) {
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
start = start == null ? 0 : nativeMax(toInteger(start), 0);
|
|
return baseRest(function(args) {
|
|
var array = args[start], otherArgs = castSlice(args, 0, start);
|
|
if (array) {
|
|
arrayPush(otherArgs, array);
|
|
}
|
|
return apply(func, this, otherArgs);
|
|
});
|
|
}
|
|
function throttle(func, wait, options) {
|
|
var leading = true, trailing = true;
|
|
if (typeof func != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
if (isObject(options)) {
|
|
leading = "leading" in options ? !!options.leading : leading;
|
|
trailing = "trailing" in options ? !!options.trailing : trailing;
|
|
}
|
|
return debounce(func, wait, {
|
|
"leading": leading,
|
|
"maxWait": wait,
|
|
"trailing": trailing
|
|
});
|
|
}
|
|
function unary(func) {
|
|
return ary(func, 1);
|
|
}
|
|
function wrap(value, wrapper) {
|
|
return partial(castFunction(wrapper), value);
|
|
}
|
|
function castArray() {
|
|
if (!arguments.length) {
|
|
return [];
|
|
}
|
|
var value = arguments[0];
|
|
return isArray(value) ? value : [value];
|
|
}
|
|
function clone(value) {
|
|
return baseClone(value, CLONE_SYMBOLS_FLAG);
|
|
}
|
|
function cloneWith(value, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
|
|
}
|
|
function cloneDeep(value) {
|
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
|
|
}
|
|
function cloneDeepWith(value, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
|
|
}
|
|
function conformsTo(object, source) {
|
|
return source == null || baseConformsTo(object, source, keys(source));
|
|
}
|
|
function eq(value, other) {
|
|
return value === other || value !== value && other !== other;
|
|
}
|
|
var gt = createRelationalOperation(baseGt);
|
|
var gte = createRelationalOperation(function(value, other) {
|
|
return value >= other;
|
|
});
|
|
var isArguments = baseIsArguments(function() {
|
|
return arguments;
|
|
}()) ? baseIsArguments : function(value) {
|
|
return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
|
|
};
|
|
var isArray = Array2.isArray;
|
|
var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
|
|
function isArrayLike(value) {
|
|
return value != null && isLength(value.length) && !isFunction(value);
|
|
}
|
|
function isArrayLikeObject(value) {
|
|
return isObjectLike(value) && isArrayLike(value);
|
|
}
|
|
function isBoolean(value) {
|
|
return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
|
|
}
|
|
var isBuffer = nativeIsBuffer || stubFalse;
|
|
var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
|
|
function isElement(value) {
|
|
return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
|
|
}
|
|
function isEmpty(value) {
|
|
if (value == null) {
|
|
return true;
|
|
}
|
|
if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
|
|
return !value.length;
|
|
}
|
|
var tag = getTag(value);
|
|
if (tag == mapTag || tag == setTag) {
|
|
return !value.size;
|
|
}
|
|
if (isPrototype(value)) {
|
|
return !baseKeys(value).length;
|
|
}
|
|
for (var key in value) {
|
|
if (hasOwnProperty.call(value, key)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
function isEqual(value, other) {
|
|
return baseIsEqual(value, other);
|
|
}
|
|
function isEqualWith(value, other, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
var result2 = customizer ? customizer(value, other) : undefined2;
|
|
return result2 === undefined2 ? baseIsEqual(value, other, undefined2, customizer) : !!result2;
|
|
}
|
|
function isError(value) {
|
|
if (!isObjectLike(value)) {
|
|
return false;
|
|
}
|
|
var tag = baseGetTag(value);
|
|
return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
|
|
}
|
|
function isFinite(value) {
|
|
return typeof value == "number" && nativeIsFinite(value);
|
|
}
|
|
function isFunction(value) {
|
|
if (!isObject(value)) {
|
|
return false;
|
|
}
|
|
var tag = baseGetTag(value);
|
|
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
}
|
|
function isInteger(value) {
|
|
return typeof value == "number" && value == toInteger(value);
|
|
}
|
|
function isLength(value) {
|
|
return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
}
|
|
function isObject(value) {
|
|
var type = typeof value;
|
|
return value != null && (type == "object" || type == "function");
|
|
}
|
|
function isObjectLike(value) {
|
|
return value != null && typeof value == "object";
|
|
}
|
|
var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
|
|
function isMatch(object, source) {
|
|
return object === source || baseIsMatch(object, source, getMatchData(source));
|
|
}
|
|
function isMatchWith(object, source, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return baseIsMatch(object, source, getMatchData(source), customizer);
|
|
}
|
|
function isNaN2(value) {
|
|
return isNumber(value) && value != +value;
|
|
}
|
|
function isNative(value) {
|
|
if (isMaskable(value)) {
|
|
throw new Error2(CORE_ERROR_TEXT);
|
|
}
|
|
return baseIsNative(value);
|
|
}
|
|
function isNull(value) {
|
|
return value === null;
|
|
}
|
|
function isNil(value) {
|
|
return value == null;
|
|
}
|
|
function isNumber(value) {
|
|
return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
|
|
}
|
|
function isPlainObject(value) {
|
|
if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
|
|
return false;
|
|
}
|
|
var proto = getPrototype(value);
|
|
if (proto === null) {
|
|
return true;
|
|
}
|
|
var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
|
|
return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
|
}
|
|
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
|
|
function isSafeInteger(value) {
|
|
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
|
|
}
|
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
function isString(value) {
|
|
return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
|
|
}
|
|
function isSymbol(value) {
|
|
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
}
|
|
var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
|
|
function isUndefined(value) {
|
|
return value === undefined2;
|
|
}
|
|
function isWeakMap(value) {
|
|
return isObjectLike(value) && getTag(value) == weakMapTag;
|
|
}
|
|
function isWeakSet(value) {
|
|
return isObjectLike(value) && baseGetTag(value) == weakSetTag;
|
|
}
|
|
var lt = createRelationalOperation(baseLt);
|
|
var lte = createRelationalOperation(function(value, other) {
|
|
return value <= other;
|
|
});
|
|
function toArray(value) {
|
|
if (!value) {
|
|
return [];
|
|
}
|
|
if (isArrayLike(value)) {
|
|
return isString(value) ? stringToArray(value) : copyArray(value);
|
|
}
|
|
if (symIterator && value[symIterator]) {
|
|
return iteratorToArray(value[symIterator]());
|
|
}
|
|
var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
|
|
return func(value);
|
|
}
|
|
function toFinite(value) {
|
|
if (!value) {
|
|
return value === 0 ? value : 0;
|
|
}
|
|
value = toNumber(value);
|
|
if (value === INFINITY || value === -INFINITY) {
|
|
var sign = value < 0 ? -1 : 1;
|
|
return sign * MAX_INTEGER;
|
|
}
|
|
return value === value ? value : 0;
|
|
}
|
|
function toInteger(value) {
|
|
var result2 = toFinite(value), remainder = result2 % 1;
|
|
return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
|
|
}
|
|
function toLength(value) {
|
|
return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
|
|
}
|
|
function toNumber(value) {
|
|
if (typeof value == "number") {
|
|
return value;
|
|
}
|
|
if (isSymbol(value)) {
|
|
return NAN;
|
|
}
|
|
if (isObject(value)) {
|
|
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
value = isObject(other) ? other + "" : other;
|
|
}
|
|
if (typeof value != "string") {
|
|
return value === 0 ? value : +value;
|
|
}
|
|
value = baseTrim(value);
|
|
var isBinary = reIsBinary.test(value);
|
|
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
}
|
|
function toPlainObject(value) {
|
|
return copyObject(value, keysIn(value));
|
|
}
|
|
function toSafeInteger(value) {
|
|
return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
|
|
}
|
|
function toString(value) {
|
|
return value == null ? "" : baseToString(value);
|
|
}
|
|
var assign2 = createAssigner(function(object, source) {
|
|
if (isPrototype(source) || isArrayLike(source)) {
|
|
copyObject(source, keys(source), object);
|
|
return;
|
|
}
|
|
for (var key in source) {
|
|
if (hasOwnProperty.call(source, key)) {
|
|
assignValue(object, key, source[key]);
|
|
}
|
|
}
|
|
});
|
|
var assignIn = createAssigner(function(object, source) {
|
|
copyObject(source, keysIn(source), object);
|
|
});
|
|
var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
copyObject(source, keysIn(source), object, customizer);
|
|
});
|
|
var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
copyObject(source, keys(source), object, customizer);
|
|
});
|
|
var at = flatRest(baseAt);
|
|
function create2(prototype, properties) {
|
|
var result2 = baseCreate(prototype);
|
|
return properties == null ? result2 : baseAssign(result2, properties);
|
|
}
|
|
var defaults = baseRest(function(object, sources) {
|
|
object = Object2(object);
|
|
var index = -1;
|
|
var length = sources.length;
|
|
var guard = length > 2 ? sources[2] : undefined2;
|
|
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
length = 1;
|
|
}
|
|
while (++index < length) {
|
|
var source = sources[index];
|
|
var props = keysIn(source);
|
|
var propsIndex = -1;
|
|
var propsLength = props.length;
|
|
while (++propsIndex < propsLength) {
|
|
var key = props[propsIndex];
|
|
var value = object[key];
|
|
if (value === undefined2 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
|
|
object[key] = source[key];
|
|
}
|
|
}
|
|
}
|
|
return object;
|
|
});
|
|
var defaultsDeep = baseRest(function(args) {
|
|
args.push(undefined2, customDefaultsMerge);
|
|
return apply(mergeWith, undefined2, args);
|
|
});
|
|
function findKey(object, predicate) {
|
|
return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
|
|
}
|
|
function findLastKey(object, predicate) {
|
|
return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
|
|
}
|
|
function forIn(object, iteratee2) {
|
|
return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
|
|
}
|
|
function forInRight(object, iteratee2) {
|
|
return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
|
|
}
|
|
function forOwn(object, iteratee2) {
|
|
return object && baseForOwn(object, getIteratee(iteratee2, 3));
|
|
}
|
|
function forOwnRight(object, iteratee2) {
|
|
return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
|
|
}
|
|
function functions(object) {
|
|
return object == null ? [] : baseFunctions(object, keys(object));
|
|
}
|
|
function functionsIn(object) {
|
|
return object == null ? [] : baseFunctions(object, keysIn(object));
|
|
}
|
|
function get(object, path, defaultValue) {
|
|
var result2 = object == null ? undefined2 : baseGet(object, path);
|
|
return result2 === undefined2 ? defaultValue : result2;
|
|
}
|
|
function has(object, path) {
|
|
return object != null && hasPath(object, path, baseHas);
|
|
}
|
|
function hasIn(object, path) {
|
|
return object != null && hasPath(object, path, baseHasIn);
|
|
}
|
|
var invert = createInverter(function(result2, value, key) {
|
|
if (value != null && typeof value.toString != "function") {
|
|
value = nativeObjectToString.call(value);
|
|
}
|
|
result2[value] = key;
|
|
}, constant(identity));
|
|
var invertBy = createInverter(function(result2, value, key) {
|
|
if (value != null && typeof value.toString != "function") {
|
|
value = nativeObjectToString.call(value);
|
|
}
|
|
if (hasOwnProperty.call(result2, value)) {
|
|
result2[value].push(key);
|
|
} else {
|
|
result2[value] = [key];
|
|
}
|
|
}, getIteratee);
|
|
var invoke = baseRest(baseInvoke);
|
|
function keys(object) {
|
|
return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
|
|
}
|
|
function keysIn(object) {
|
|
return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
|
|
}
|
|
function mapKeys(object, iteratee2) {
|
|
var result2 = {};
|
|
iteratee2 = getIteratee(iteratee2, 3);
|
|
baseForOwn(object, function(value, key, object2) {
|
|
baseAssignValue(result2, iteratee2(value, key, object2), value);
|
|
});
|
|
return result2;
|
|
}
|
|
function mapValues(object, iteratee2) {
|
|
var result2 = {};
|
|
iteratee2 = getIteratee(iteratee2, 3);
|
|
baseForOwn(object, function(value, key, object2) {
|
|
baseAssignValue(result2, key, iteratee2(value, key, object2));
|
|
});
|
|
return result2;
|
|
}
|
|
var merge = createAssigner(function(object, source, srcIndex) {
|
|
baseMerge(object, source, srcIndex);
|
|
});
|
|
var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
|
|
baseMerge(object, source, srcIndex, customizer);
|
|
});
|
|
var omit = flatRest(function(object, paths) {
|
|
var result2 = {};
|
|
if (object == null) {
|
|
return result2;
|
|
}
|
|
var isDeep = false;
|
|
paths = arrayMap(paths, function(path) {
|
|
path = castPath(path, object);
|
|
isDeep || (isDeep = path.length > 1);
|
|
return path;
|
|
});
|
|
copyObject(object, getAllKeysIn(object), result2);
|
|
if (isDeep) {
|
|
result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
|
|
}
|
|
var length = paths.length;
|
|
while (length--) {
|
|
baseUnset(result2, paths[length]);
|
|
}
|
|
return result2;
|
|
});
|
|
function omitBy(object, predicate) {
|
|
return pickBy(object, negate(getIteratee(predicate)));
|
|
}
|
|
var pick = flatRest(function(object, paths) {
|
|
return object == null ? {} : basePick(object, paths);
|
|
});
|
|
function pickBy(object, predicate) {
|
|
if (object == null) {
|
|
return {};
|
|
}
|
|
var props = arrayMap(getAllKeysIn(object), function(prop) {
|
|
return [prop];
|
|
});
|
|
predicate = getIteratee(predicate);
|
|
return basePickBy(object, props, function(value, path) {
|
|
return predicate(value, path[0]);
|
|
});
|
|
}
|
|
function result(object, path, defaultValue) {
|
|
path = castPath(path, object);
|
|
var index = -1, length = path.length;
|
|
if (!length) {
|
|
length = 1;
|
|
object = undefined2;
|
|
}
|
|
while (++index < length) {
|
|
var value = object == null ? undefined2 : object[toKey(path[index])];
|
|
if (value === undefined2) {
|
|
index = length;
|
|
value = defaultValue;
|
|
}
|
|
object = isFunction(value) ? value.call(object) : value;
|
|
}
|
|
return object;
|
|
}
|
|
function set(object, path, value) {
|
|
return object == null ? object : baseSet(object, path, value);
|
|
}
|
|
function setWith(object, path, value, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return object == null ? object : baseSet(object, path, value, customizer);
|
|
}
|
|
var toPairs = createToPairs(keys);
|
|
var toPairsIn = createToPairs(keysIn);
|
|
function transform2(object, iteratee2, accumulator) {
|
|
var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
|
|
iteratee2 = getIteratee(iteratee2, 4);
|
|
if (accumulator == null) {
|
|
var Ctor = object && object.constructor;
|
|
if (isArrLike) {
|
|
accumulator = isArr ? new Ctor() : [];
|
|
} else if (isObject(object)) {
|
|
accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
|
|
} else {
|
|
accumulator = {};
|
|
}
|
|
}
|
|
(isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
|
|
return iteratee2(accumulator, value, index, object2);
|
|
});
|
|
return accumulator;
|
|
}
|
|
function unset(object, path) {
|
|
return object == null ? true : baseUnset(object, path);
|
|
}
|
|
function update2(object, path, updater) {
|
|
return object == null ? object : baseUpdate(object, path, castFunction(updater));
|
|
}
|
|
function updateWith(object, path, updater, customizer) {
|
|
customizer = typeof customizer == "function" ? customizer : undefined2;
|
|
return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
|
|
}
|
|
function values(object) {
|
|
return object == null ? [] : baseValues(object, keys(object));
|
|
}
|
|
function valuesIn(object) {
|
|
return object == null ? [] : baseValues(object, keysIn(object));
|
|
}
|
|
function clamp(number, lower, upper) {
|
|
if (upper === undefined2) {
|
|
upper = lower;
|
|
lower = undefined2;
|
|
}
|
|
if (upper !== undefined2) {
|
|
upper = toNumber(upper);
|
|
upper = upper === upper ? upper : 0;
|
|
}
|
|
if (lower !== undefined2) {
|
|
lower = toNumber(lower);
|
|
lower = lower === lower ? lower : 0;
|
|
}
|
|
return baseClamp(toNumber(number), lower, upper);
|
|
}
|
|
function inRange(number, start, end) {
|
|
start = toFinite(start);
|
|
if (end === undefined2) {
|
|
end = start;
|
|
start = 0;
|
|
} else {
|
|
end = toFinite(end);
|
|
}
|
|
number = toNumber(number);
|
|
return baseInRange(number, start, end);
|
|
}
|
|
function random(lower, upper, floating) {
|
|
if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
|
|
upper = floating = undefined2;
|
|
}
|
|
if (floating === undefined2) {
|
|
if (typeof upper == "boolean") {
|
|
floating = upper;
|
|
upper = undefined2;
|
|
} else if (typeof lower == "boolean") {
|
|
floating = lower;
|
|
lower = undefined2;
|
|
}
|
|
}
|
|
if (lower === undefined2 && upper === undefined2) {
|
|
lower = 0;
|
|
upper = 1;
|
|
} else {
|
|
lower = toFinite(lower);
|
|
if (upper === undefined2) {
|
|
upper = lower;
|
|
lower = 0;
|
|
} else {
|
|
upper = toFinite(upper);
|
|
}
|
|
}
|
|
if (lower > upper) {
|
|
var temp = lower;
|
|
lower = upper;
|
|
upper = temp;
|
|
}
|
|
if (floating || lower % 1 || upper % 1) {
|
|
var rand = nativeRandom();
|
|
return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
|
|
}
|
|
return baseRandom(lower, upper);
|
|
}
|
|
var camelCase = createCompounder(function(result2, word, index) {
|
|
word = word.toLowerCase();
|
|
return result2 + (index ? capitalize(word) : word);
|
|
});
|
|
function capitalize(string) {
|
|
return upperFirst(toString(string).toLowerCase());
|
|
}
|
|
function deburr(string) {
|
|
string = toString(string);
|
|
return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
}
|
|
function endsWith(string, target, position) {
|
|
string = toString(string);
|
|
target = baseToString(target);
|
|
var length = string.length;
|
|
position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length);
|
|
var end = position;
|
|
position -= target.length;
|
|
return position >= 0 && string.slice(position, end) == target;
|
|
}
|
|
function escape(string) {
|
|
string = toString(string);
|
|
return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
|
|
}
|
|
function escapeRegExp(string) {
|
|
string = toString(string);
|
|
return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
|
|
}
|
|
var kebabCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? "-" : "") + word.toLowerCase();
|
|
});
|
|
var lowerCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? " " : "") + word.toLowerCase();
|
|
});
|
|
var lowerFirst = createCaseFirst("toLowerCase");
|
|
function pad(string, length, chars) {
|
|
string = toString(string);
|
|
length = toInteger(length);
|
|
var strLength = length ? stringSize(string) : 0;
|
|
if (!length || strLength >= length) {
|
|
return string;
|
|
}
|
|
var mid = (length - strLength) / 2;
|
|
return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
|
|
}
|
|
function padEnd(string, length, chars) {
|
|
string = toString(string);
|
|
length = toInteger(length);
|
|
var strLength = length ? stringSize(string) : 0;
|
|
return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
|
|
}
|
|
function padStart(string, length, chars) {
|
|
string = toString(string);
|
|
length = toInteger(length);
|
|
var strLength = length ? stringSize(string) : 0;
|
|
return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
|
|
}
|
|
function parseInt2(string, radix, guard) {
|
|
if (guard || radix == null) {
|
|
radix = 0;
|
|
} else if (radix) {
|
|
radix = +radix;
|
|
}
|
|
return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0);
|
|
}
|
|
function repeat(string, n, guard) {
|
|
if (guard ? isIterateeCall(string, n, guard) : n === undefined2) {
|
|
n = 1;
|
|
} else {
|
|
n = toInteger(n);
|
|
}
|
|
return baseRepeat(toString(string), n);
|
|
}
|
|
function replace() {
|
|
var args = arguments, string = toString(args[0]);
|
|
return args.length < 3 ? string : string.replace(args[1], args[2]);
|
|
}
|
|
var snakeCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? "_" : "") + word.toLowerCase();
|
|
});
|
|
function split(string, separator, limit) {
|
|
if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
|
|
separator = limit = undefined2;
|
|
}
|
|
limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0;
|
|
if (!limit) {
|
|
return [];
|
|
}
|
|
string = toString(string);
|
|
if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
|
|
separator = baseToString(separator);
|
|
if (!separator && hasUnicode(string)) {
|
|
return castSlice(stringToArray(string), 0, limit);
|
|
}
|
|
}
|
|
return string.split(separator, limit);
|
|
}
|
|
var startCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? " " : "") + upperFirst(word);
|
|
});
|
|
function startsWith(string, target, position) {
|
|
string = toString(string);
|
|
position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
|
|
target = baseToString(target);
|
|
return string.slice(position, position + target.length) == target;
|
|
}
|
|
function template(string, options, guard) {
|
|
var settings2 = lodash.templateSettings;
|
|
if (guard && isIterateeCall(string, options, guard)) {
|
|
options = undefined2;
|
|
}
|
|
string = toString(string);
|
|
options = assignInWith({}, options, settings2, customDefaultsAssignIn);
|
|
var imports = assignInWith({}, options.imports, settings2.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
|
|
var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
|
|
var reDelimiters = RegExp2(
|
|
(options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
|
|
"g"
|
|
);
|
|
var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
|
|
string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
|
|
interpolateValue || (interpolateValue = esTemplateValue);
|
|
source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
|
|
if (escapeValue) {
|
|
isEscaping = true;
|
|
source += "' +\n__e(" + escapeValue + ") +\n'";
|
|
}
|
|
if (evaluateValue) {
|
|
isEvaluating = true;
|
|
source += "';\n" + evaluateValue + ";\n__p += '";
|
|
}
|
|
if (interpolateValue) {
|
|
source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
|
|
}
|
|
index = offset + match.length;
|
|
return match;
|
|
});
|
|
source += "';\n";
|
|
var variable = hasOwnProperty.call(options, "variable") && options.variable;
|
|
if (!variable) {
|
|
source = "with (obj) {\n" + source + "\n}\n";
|
|
} else if (reForbiddenIdentifierChars.test(variable)) {
|
|
throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
|
|
}
|
|
source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
|
|
source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
|
|
var result2 = attempt(function() {
|
|
return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues);
|
|
});
|
|
result2.source = source;
|
|
if (isError(result2)) {
|
|
throw result2;
|
|
}
|
|
return result2;
|
|
}
|
|
function toLower(value) {
|
|
return toString(value).toLowerCase();
|
|
}
|
|
function toUpper(value) {
|
|
return toString(value).toUpperCase();
|
|
}
|
|
function trim(string, chars, guard) {
|
|
string = toString(string);
|
|
if (string && (guard || chars === undefined2)) {
|
|
return baseTrim(string);
|
|
}
|
|
if (!string || !(chars = baseToString(chars))) {
|
|
return string;
|
|
}
|
|
var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
|
|
return castSlice(strSymbols, start, end).join("");
|
|
}
|
|
function trimEnd(string, chars, guard) {
|
|
string = toString(string);
|
|
if (string && (guard || chars === undefined2)) {
|
|
return string.slice(0, trimmedEndIndex(string) + 1);
|
|
}
|
|
if (!string || !(chars = baseToString(chars))) {
|
|
return string;
|
|
}
|
|
var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
|
|
return castSlice(strSymbols, 0, end).join("");
|
|
}
|
|
function trimStart(string, chars, guard) {
|
|
string = toString(string);
|
|
if (string && (guard || chars === undefined2)) {
|
|
return string.replace(reTrimStart, "");
|
|
}
|
|
if (!string || !(chars = baseToString(chars))) {
|
|
return string;
|
|
}
|
|
var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
|
|
return castSlice(strSymbols, start).join("");
|
|
}
|
|
function truncate(string, options) {
|
|
var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
|
|
if (isObject(options)) {
|
|
var separator = "separator" in options ? options.separator : separator;
|
|
length = "length" in options ? toInteger(options.length) : length;
|
|
omission = "omission" in options ? baseToString(options.omission) : omission;
|
|
}
|
|
string = toString(string);
|
|
var strLength = string.length;
|
|
if (hasUnicode(string)) {
|
|
var strSymbols = stringToArray(string);
|
|
strLength = strSymbols.length;
|
|
}
|
|
if (length >= strLength) {
|
|
return string;
|
|
}
|
|
var end = length - stringSize(omission);
|
|
if (end < 1) {
|
|
return omission;
|
|
}
|
|
var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
|
|
if (separator === undefined2) {
|
|
return result2 + omission;
|
|
}
|
|
if (strSymbols) {
|
|
end += result2.length - end;
|
|
}
|
|
if (isRegExp(separator)) {
|
|
if (string.slice(end).search(separator)) {
|
|
var match, substring = result2;
|
|
if (!separator.global) {
|
|
separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g");
|
|
}
|
|
separator.lastIndex = 0;
|
|
while (match = separator.exec(substring)) {
|
|
var newEnd = match.index;
|
|
}
|
|
result2 = result2.slice(0, newEnd === undefined2 ? end : newEnd);
|
|
}
|
|
} else if (string.indexOf(baseToString(separator), end) != end) {
|
|
var index = result2.lastIndexOf(separator);
|
|
if (index > -1) {
|
|
result2 = result2.slice(0, index);
|
|
}
|
|
}
|
|
return result2 + omission;
|
|
}
|
|
function unescape(string) {
|
|
string = toString(string);
|
|
return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
|
|
}
|
|
var upperCase = createCompounder(function(result2, word, index) {
|
|
return result2 + (index ? " " : "") + word.toUpperCase();
|
|
});
|
|
var upperFirst = createCaseFirst("toUpperCase");
|
|
function words(string, pattern, guard) {
|
|
string = toString(string);
|
|
pattern = guard ? undefined2 : pattern;
|
|
if (pattern === undefined2) {
|
|
return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
|
|
}
|
|
return string.match(pattern) || [];
|
|
}
|
|
var attempt = baseRest(function(func, args) {
|
|
try {
|
|
return apply(func, undefined2, args);
|
|
} catch (e) {
|
|
return isError(e) ? e : new Error2(e);
|
|
}
|
|
});
|
|
var bindAll = flatRest(function(object, methodNames) {
|
|
arrayEach(methodNames, function(key) {
|
|
key = toKey(key);
|
|
baseAssignValue(object, key, bind(object[key], object));
|
|
});
|
|
return object;
|
|
});
|
|
function cond(pairs) {
|
|
var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
|
|
pairs = !length ? [] : arrayMap(pairs, function(pair) {
|
|
if (typeof pair[1] != "function") {
|
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
}
|
|
return [toIteratee(pair[0]), pair[1]];
|
|
});
|
|
return baseRest(function(args) {
|
|
var index = -1;
|
|
while (++index < length) {
|
|
var pair = pairs[index];
|
|
if (apply(pair[0], this, args)) {
|
|
return apply(pair[1], this, args);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
function conforms(source) {
|
|
return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
|
|
}
|
|
function constant(value) {
|
|
return function() {
|
|
return value;
|
|
};
|
|
}
|
|
function defaultTo(value, defaultValue) {
|
|
return value == null || value !== value ? defaultValue : value;
|
|
}
|
|
var flow = createFlow();
|
|
var flowRight = createFlow(true);
|
|
function identity(value) {
|
|
return value;
|
|
}
|
|
function iteratee(func) {
|
|
return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
|
|
}
|
|
function matches(source) {
|
|
return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
|
|
}
|
|
function matchesProperty(path, srcValue) {
|
|
return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
|
|
}
|
|
var method = baseRest(function(path, args) {
|
|
return function(object) {
|
|
return baseInvoke(object, path, args);
|
|
};
|
|
});
|
|
var methodOf = baseRest(function(object, args) {
|
|
return function(path) {
|
|
return baseInvoke(object, path, args);
|
|
};
|
|
});
|
|
function mixin(object, source, options) {
|
|
var props = keys(source), methodNames = baseFunctions(source, props);
|
|
if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
|
|
options = source;
|
|
source = object;
|
|
object = this;
|
|
methodNames = baseFunctions(source, keys(source));
|
|
}
|
|
var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
|
|
arrayEach(methodNames, function(methodName) {
|
|
var func = source[methodName];
|
|
object[methodName] = func;
|
|
if (isFunc) {
|
|
object.prototype[methodName] = function() {
|
|
var chainAll = this.__chain__;
|
|
if (chain2 || chainAll) {
|
|
var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
|
|
actions.push({ "func": func, "args": arguments, "thisArg": object });
|
|
result2.__chain__ = chainAll;
|
|
return result2;
|
|
}
|
|
return func.apply(object, arrayPush([this.value()], arguments));
|
|
};
|
|
}
|
|
});
|
|
return object;
|
|
}
|
|
function noConflict() {
|
|
if (root._ === this) {
|
|
root._ = oldDash;
|
|
}
|
|
return this;
|
|
}
|
|
function noop2() {
|
|
}
|
|
function nthArg(n) {
|
|
n = toInteger(n);
|
|
return baseRest(function(args) {
|
|
return baseNth(args, n);
|
|
});
|
|
}
|
|
var over = createOver(arrayMap);
|
|
var overEvery = createOver(arrayEvery);
|
|
var overSome = createOver(arraySome);
|
|
function property(path) {
|
|
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
|
|
}
|
|
function propertyOf(object) {
|
|
return function(path) {
|
|
return object == null ? undefined2 : baseGet(object, path);
|
|
};
|
|
}
|
|
var range3 = createRange();
|
|
var rangeRight = createRange(true);
|
|
function stubArray() {
|
|
return [];
|
|
}
|
|
function stubFalse() {
|
|
return false;
|
|
}
|
|
function stubObject() {
|
|
return {};
|
|
}
|
|
function stubString() {
|
|
return "";
|
|
}
|
|
function stubTrue() {
|
|
return true;
|
|
}
|
|
function times(n, iteratee2) {
|
|
n = toInteger(n);
|
|
if (n < 1 || n > MAX_SAFE_INTEGER) {
|
|
return [];
|
|
}
|
|
var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
|
|
iteratee2 = getIteratee(iteratee2);
|
|
n -= MAX_ARRAY_LENGTH;
|
|
var result2 = baseTimes(length, iteratee2);
|
|
while (++index < n) {
|
|
iteratee2(index);
|
|
}
|
|
return result2;
|
|
}
|
|
function toPath(value) {
|
|
if (isArray(value)) {
|
|
return arrayMap(value, toKey);
|
|
}
|
|
return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
|
|
}
|
|
function uniqueId(prefix) {
|
|
var id = ++idCounter;
|
|
return toString(prefix) + id;
|
|
}
|
|
var add = createMathOperation(function(augend, addend) {
|
|
return augend + addend;
|
|
}, 0);
|
|
var ceil = createRound("ceil");
|
|
var divide = createMathOperation(function(dividend, divisor) {
|
|
return dividend / divisor;
|
|
}, 1);
|
|
var floor = createRound("floor");
|
|
function max(array) {
|
|
return array && array.length ? baseExtremum(array, identity, baseGt) : undefined2;
|
|
}
|
|
function maxBy(array, iteratee2) {
|
|
return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined2;
|
|
}
|
|
function mean(array) {
|
|
return baseMean(array, identity);
|
|
}
|
|
function meanBy(array, iteratee2) {
|
|
return baseMean(array, getIteratee(iteratee2, 2));
|
|
}
|
|
function min(array) {
|
|
return array && array.length ? baseExtremum(array, identity, baseLt) : undefined2;
|
|
}
|
|
function minBy(array, iteratee2) {
|
|
return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined2;
|
|
}
|
|
var multiply = createMathOperation(function(multiplier, multiplicand) {
|
|
return multiplier * multiplicand;
|
|
}, 1);
|
|
var round = createRound("round");
|
|
var subtract = createMathOperation(function(minuend, subtrahend) {
|
|
return minuend - subtrahend;
|
|
}, 0);
|
|
function sum(array) {
|
|
return array && array.length ? baseSum(array, identity) : 0;
|
|
}
|
|
function sumBy(array, iteratee2) {
|
|
return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
|
|
}
|
|
lodash.after = after;
|
|
lodash.ary = ary;
|
|
lodash.assign = assign2;
|
|
lodash.assignIn = assignIn;
|
|
lodash.assignInWith = assignInWith;
|
|
lodash.assignWith = assignWith;
|
|
lodash.at = at;
|
|
lodash.before = before;
|
|
lodash.bind = bind;
|
|
lodash.bindAll = bindAll;
|
|
lodash.bindKey = bindKey;
|
|
lodash.castArray = castArray;
|
|
lodash.chain = chain;
|
|
lodash.chunk = chunk;
|
|
lodash.compact = compact;
|
|
lodash.concat = concat;
|
|
lodash.cond = cond;
|
|
lodash.conforms = conforms;
|
|
lodash.constant = constant;
|
|
lodash.countBy = countBy;
|
|
lodash.create = create2;
|
|
lodash.curry = curry;
|
|
lodash.curryRight = curryRight;
|
|
lodash.debounce = debounce;
|
|
lodash.defaults = defaults;
|
|
lodash.defaultsDeep = defaultsDeep;
|
|
lodash.defer = defer;
|
|
lodash.delay = delay;
|
|
lodash.difference = difference2;
|
|
lodash.differenceBy = differenceBy;
|
|
lodash.differenceWith = differenceWith;
|
|
lodash.drop = drop;
|
|
lodash.dropRight = dropRight;
|
|
lodash.dropRightWhile = dropRightWhile;
|
|
lodash.dropWhile = dropWhile;
|
|
lodash.fill = fill;
|
|
lodash.filter = filter;
|
|
lodash.flatMap = flatMap;
|
|
lodash.flatMapDeep = flatMapDeep;
|
|
lodash.flatMapDepth = flatMapDepth;
|
|
lodash.flatten = flatten;
|
|
lodash.flattenDeep = flattenDeep;
|
|
lodash.flattenDepth = flattenDepth;
|
|
lodash.flip = flip;
|
|
lodash.flow = flow;
|
|
lodash.flowRight = flowRight;
|
|
lodash.fromPairs = fromPairs;
|
|
lodash.functions = functions;
|
|
lodash.functionsIn = functionsIn;
|
|
lodash.groupBy = groupBy;
|
|
lodash.initial = initial;
|
|
lodash.intersection = intersection;
|
|
lodash.intersectionBy = intersectionBy;
|
|
lodash.intersectionWith = intersectionWith;
|
|
lodash.invert = invert;
|
|
lodash.invertBy = invertBy;
|
|
lodash.invokeMap = invokeMap;
|
|
lodash.iteratee = iteratee;
|
|
lodash.keyBy = keyBy;
|
|
lodash.keys = keys;
|
|
lodash.keysIn = keysIn;
|
|
lodash.map = map;
|
|
lodash.mapKeys = mapKeys;
|
|
lodash.mapValues = mapValues;
|
|
lodash.matches = matches;
|
|
lodash.matchesProperty = matchesProperty;
|
|
lodash.memoize = memoize;
|
|
lodash.merge = merge;
|
|
lodash.mergeWith = mergeWith;
|
|
lodash.method = method;
|
|
lodash.methodOf = methodOf;
|
|
lodash.mixin = mixin;
|
|
lodash.negate = negate;
|
|
lodash.nthArg = nthArg;
|
|
lodash.omit = omit;
|
|
lodash.omitBy = omitBy;
|
|
lodash.once = once;
|
|
lodash.orderBy = orderBy;
|
|
lodash.over = over;
|
|
lodash.overArgs = overArgs;
|
|
lodash.overEvery = overEvery;
|
|
lodash.overSome = overSome;
|
|
lodash.partial = partial;
|
|
lodash.partialRight = partialRight;
|
|
lodash.partition = partition3;
|
|
lodash.pick = pick;
|
|
lodash.pickBy = pickBy;
|
|
lodash.property = property;
|
|
lodash.propertyOf = propertyOf;
|
|
lodash.pull = pull;
|
|
lodash.pullAll = pullAll;
|
|
lodash.pullAllBy = pullAllBy;
|
|
lodash.pullAllWith = pullAllWith;
|
|
lodash.pullAt = pullAt;
|
|
lodash.range = range3;
|
|
lodash.rangeRight = rangeRight;
|
|
lodash.rearg = rearg;
|
|
lodash.reject = reject;
|
|
lodash.remove = remove;
|
|
lodash.rest = rest;
|
|
lodash.reverse = reverse;
|
|
lodash.sampleSize = sampleSize;
|
|
lodash.set = set;
|
|
lodash.setWith = setWith;
|
|
lodash.shuffle = shuffle;
|
|
lodash.slice = slice;
|
|
lodash.sortBy = sortBy;
|
|
lodash.sortedUniq = sortedUniq;
|
|
lodash.sortedUniqBy = sortedUniqBy;
|
|
lodash.split = split;
|
|
lodash.spread = spread;
|
|
lodash.tail = tail;
|
|
lodash.take = take;
|
|
lodash.takeRight = takeRight;
|
|
lodash.takeRightWhile = takeRightWhile;
|
|
lodash.takeWhile = takeWhile;
|
|
lodash.tap = tap;
|
|
lodash.throttle = throttle;
|
|
lodash.thru = thru;
|
|
lodash.toArray = toArray;
|
|
lodash.toPairs = toPairs;
|
|
lodash.toPairsIn = toPairsIn;
|
|
lodash.toPath = toPath;
|
|
lodash.toPlainObject = toPlainObject;
|
|
lodash.transform = transform2;
|
|
lodash.unary = unary;
|
|
lodash.union = union;
|
|
lodash.unionBy = unionBy;
|
|
lodash.unionWith = unionWith;
|
|
lodash.uniq = uniq;
|
|
lodash.uniqBy = uniqBy;
|
|
lodash.uniqWith = uniqWith;
|
|
lodash.unset = unset;
|
|
lodash.unzip = unzip;
|
|
lodash.unzipWith = unzipWith;
|
|
lodash.update = update2;
|
|
lodash.updateWith = updateWith;
|
|
lodash.values = values;
|
|
lodash.valuesIn = valuesIn;
|
|
lodash.without = without;
|
|
lodash.words = words;
|
|
lodash.wrap = wrap;
|
|
lodash.xor = xor;
|
|
lodash.xorBy = xorBy;
|
|
lodash.xorWith = xorWith;
|
|
lodash.zip = zip;
|
|
lodash.zipObject = zipObject;
|
|
lodash.zipObjectDeep = zipObjectDeep;
|
|
lodash.zipWith = zipWith;
|
|
lodash.entries = toPairs;
|
|
lodash.entriesIn = toPairsIn;
|
|
lodash.extend = assignIn;
|
|
lodash.extendWith = assignInWith;
|
|
mixin(lodash, lodash);
|
|
lodash.add = add;
|
|
lodash.attempt = attempt;
|
|
lodash.camelCase = camelCase;
|
|
lodash.capitalize = capitalize;
|
|
lodash.ceil = ceil;
|
|
lodash.clamp = clamp;
|
|
lodash.clone = clone;
|
|
lodash.cloneDeep = cloneDeep;
|
|
lodash.cloneDeepWith = cloneDeepWith;
|
|
lodash.cloneWith = cloneWith;
|
|
lodash.conformsTo = conformsTo;
|
|
lodash.deburr = deburr;
|
|
lodash.defaultTo = defaultTo;
|
|
lodash.divide = divide;
|
|
lodash.endsWith = endsWith;
|
|
lodash.eq = eq;
|
|
lodash.escape = escape;
|
|
lodash.escapeRegExp = escapeRegExp;
|
|
lodash.every = every;
|
|
lodash.find = find;
|
|
lodash.findIndex = findIndex;
|
|
lodash.findKey = findKey;
|
|
lodash.findLast = findLast;
|
|
lodash.findLastIndex = findLastIndex;
|
|
lodash.findLastKey = findLastKey;
|
|
lodash.floor = floor;
|
|
lodash.forEach = forEach;
|
|
lodash.forEachRight = forEachRight;
|
|
lodash.forIn = forIn;
|
|
lodash.forInRight = forInRight;
|
|
lodash.forOwn = forOwn;
|
|
lodash.forOwnRight = forOwnRight;
|
|
lodash.get = get;
|
|
lodash.gt = gt;
|
|
lodash.gte = gte;
|
|
lodash.has = has;
|
|
lodash.hasIn = hasIn;
|
|
lodash.head = head;
|
|
lodash.identity = identity;
|
|
lodash.includes = includes;
|
|
lodash.indexOf = indexOf;
|
|
lodash.inRange = inRange;
|
|
lodash.invoke = invoke;
|
|
lodash.isArguments = isArguments;
|
|
lodash.isArray = isArray;
|
|
lodash.isArrayBuffer = isArrayBuffer;
|
|
lodash.isArrayLike = isArrayLike;
|
|
lodash.isArrayLikeObject = isArrayLikeObject;
|
|
lodash.isBoolean = isBoolean;
|
|
lodash.isBuffer = isBuffer;
|
|
lodash.isDate = isDate;
|
|
lodash.isElement = isElement;
|
|
lodash.isEmpty = isEmpty;
|
|
lodash.isEqual = isEqual;
|
|
lodash.isEqualWith = isEqualWith;
|
|
lodash.isError = isError;
|
|
lodash.isFinite = isFinite;
|
|
lodash.isFunction = isFunction;
|
|
lodash.isInteger = isInteger;
|
|
lodash.isLength = isLength;
|
|
lodash.isMap = isMap;
|
|
lodash.isMatch = isMatch;
|
|
lodash.isMatchWith = isMatchWith;
|
|
lodash.isNaN = isNaN2;
|
|
lodash.isNative = isNative;
|
|
lodash.isNil = isNil;
|
|
lodash.isNull = isNull;
|
|
lodash.isNumber = isNumber;
|
|
lodash.isObject = isObject;
|
|
lodash.isObjectLike = isObjectLike;
|
|
lodash.isPlainObject = isPlainObject;
|
|
lodash.isRegExp = isRegExp;
|
|
lodash.isSafeInteger = isSafeInteger;
|
|
lodash.isSet = isSet;
|
|
lodash.isString = isString;
|
|
lodash.isSymbol = isSymbol;
|
|
lodash.isTypedArray = isTypedArray;
|
|
lodash.isUndefined = isUndefined;
|
|
lodash.isWeakMap = isWeakMap;
|
|
lodash.isWeakSet = isWeakSet;
|
|
lodash.join = join;
|
|
lodash.kebabCase = kebabCase;
|
|
lodash.last = last3;
|
|
lodash.lastIndexOf = lastIndexOf;
|
|
lodash.lowerCase = lowerCase;
|
|
lodash.lowerFirst = lowerFirst;
|
|
lodash.lt = lt;
|
|
lodash.lte = lte;
|
|
lodash.max = max;
|
|
lodash.maxBy = maxBy;
|
|
lodash.mean = mean;
|
|
lodash.meanBy = meanBy;
|
|
lodash.min = min;
|
|
lodash.minBy = minBy;
|
|
lodash.stubArray = stubArray;
|
|
lodash.stubFalse = stubFalse;
|
|
lodash.stubObject = stubObject;
|
|
lodash.stubString = stubString;
|
|
lodash.stubTrue = stubTrue;
|
|
lodash.multiply = multiply;
|
|
lodash.nth = nth;
|
|
lodash.noConflict = noConflict;
|
|
lodash.noop = noop2;
|
|
lodash.now = now;
|
|
lodash.pad = pad;
|
|
lodash.padEnd = padEnd;
|
|
lodash.padStart = padStart;
|
|
lodash.parseInt = parseInt2;
|
|
lodash.random = random;
|
|
lodash.reduce = reduce;
|
|
lodash.reduceRight = reduceRight;
|
|
lodash.repeat = repeat;
|
|
lodash.replace = replace;
|
|
lodash.result = result;
|
|
lodash.round = round;
|
|
lodash.runInContext = runInContext2;
|
|
lodash.sample = sample;
|
|
lodash.size = size;
|
|
lodash.snakeCase = snakeCase;
|
|
lodash.some = some;
|
|
lodash.sortedIndex = sortedIndex;
|
|
lodash.sortedIndexBy = sortedIndexBy;
|
|
lodash.sortedIndexOf = sortedIndexOf;
|
|
lodash.sortedLastIndex = sortedLastIndex;
|
|
lodash.sortedLastIndexBy = sortedLastIndexBy;
|
|
lodash.sortedLastIndexOf = sortedLastIndexOf;
|
|
lodash.startCase = startCase;
|
|
lodash.startsWith = startsWith;
|
|
lodash.subtract = subtract;
|
|
lodash.sum = sum;
|
|
lodash.sumBy = sumBy;
|
|
lodash.template = template;
|
|
lodash.times = times;
|
|
lodash.toFinite = toFinite;
|
|
lodash.toInteger = toInteger;
|
|
lodash.toLength = toLength;
|
|
lodash.toLower = toLower;
|
|
lodash.toNumber = toNumber;
|
|
lodash.toSafeInteger = toSafeInteger;
|
|
lodash.toString = toString;
|
|
lodash.toUpper = toUpper;
|
|
lodash.trim = trim;
|
|
lodash.trimEnd = trimEnd;
|
|
lodash.trimStart = trimStart;
|
|
lodash.truncate = truncate;
|
|
lodash.unescape = unescape;
|
|
lodash.uniqueId = uniqueId;
|
|
lodash.upperCase = upperCase;
|
|
lodash.upperFirst = upperFirst;
|
|
lodash.each = forEach;
|
|
lodash.eachRight = forEachRight;
|
|
lodash.first = head;
|
|
mixin(lodash, function() {
|
|
var source = {};
|
|
baseForOwn(lodash, function(func, methodName) {
|
|
if (!hasOwnProperty.call(lodash.prototype, methodName)) {
|
|
source[methodName] = func;
|
|
}
|
|
});
|
|
return source;
|
|
}(), { "chain": false });
|
|
lodash.VERSION = VERSION;
|
|
arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
|
|
lodash[methodName].placeholder = lodash;
|
|
});
|
|
arrayEach(["drop", "take"], function(methodName, index) {
|
|
LazyWrapper.prototype[methodName] = function(n) {
|
|
n = n === undefined2 ? 1 : nativeMax(toInteger(n), 0);
|
|
var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
|
|
if (result2.__filtered__) {
|
|
result2.__takeCount__ = nativeMin(n, result2.__takeCount__);
|
|
} else {
|
|
result2.__views__.push({
|
|
"size": nativeMin(n, MAX_ARRAY_LENGTH),
|
|
"type": methodName + (result2.__dir__ < 0 ? "Right" : "")
|
|
});
|
|
}
|
|
return result2;
|
|
};
|
|
LazyWrapper.prototype[methodName + "Right"] = function(n) {
|
|
return this.reverse()[methodName](n).reverse();
|
|
};
|
|
});
|
|
arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
|
|
var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
|
|
LazyWrapper.prototype[methodName] = function(iteratee2) {
|
|
var result2 = this.clone();
|
|
result2.__iteratees__.push({
|
|
"iteratee": getIteratee(iteratee2, 3),
|
|
"type": type
|
|
});
|
|
result2.__filtered__ = result2.__filtered__ || isFilter;
|
|
return result2;
|
|
};
|
|
});
|
|
arrayEach(["head", "last"], function(methodName, index) {
|
|
var takeName = "take" + (index ? "Right" : "");
|
|
LazyWrapper.prototype[methodName] = function() {
|
|
return this[takeName](1).value()[0];
|
|
};
|
|
});
|
|
arrayEach(["initial", "tail"], function(methodName, index) {
|
|
var dropName = "drop" + (index ? "" : "Right");
|
|
LazyWrapper.prototype[methodName] = function() {
|
|
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
|
|
};
|
|
});
|
|
LazyWrapper.prototype.compact = function() {
|
|
return this.filter(identity);
|
|
};
|
|
LazyWrapper.prototype.find = function(predicate) {
|
|
return this.filter(predicate).head();
|
|
};
|
|
LazyWrapper.prototype.findLast = function(predicate) {
|
|
return this.reverse().find(predicate);
|
|
};
|
|
LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
|
|
if (typeof path == "function") {
|
|
return new LazyWrapper(this);
|
|
}
|
|
return this.map(function(value) {
|
|
return baseInvoke(value, path, args);
|
|
});
|
|
});
|
|
LazyWrapper.prototype.reject = function(predicate) {
|
|
return this.filter(negate(getIteratee(predicate)));
|
|
};
|
|
LazyWrapper.prototype.slice = function(start, end) {
|
|
start = toInteger(start);
|
|
var result2 = this;
|
|
if (result2.__filtered__ && (start > 0 || end < 0)) {
|
|
return new LazyWrapper(result2);
|
|
}
|
|
if (start < 0) {
|
|
result2 = result2.takeRight(-start);
|
|
} else if (start) {
|
|
result2 = result2.drop(start);
|
|
}
|
|
if (end !== undefined2) {
|
|
end = toInteger(end);
|
|
result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start);
|
|
}
|
|
return result2;
|
|
};
|
|
LazyWrapper.prototype.takeRightWhile = function(predicate) {
|
|
return this.reverse().takeWhile(predicate).reverse();
|
|
};
|
|
LazyWrapper.prototype.toArray = function() {
|
|
return this.take(MAX_ARRAY_LENGTH);
|
|
};
|
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
|
|
if (!lodashFunc) {
|
|
return;
|
|
}
|
|
lodash.prototype[methodName] = function() {
|
|
var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value);
|
|
var interceptor = function(value2) {
|
|
var result3 = lodashFunc.apply(lodash, arrayPush([value2], args));
|
|
return isTaker && chainAll ? result3[0] : result3;
|
|
};
|
|
if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
|
|
isLazy = useLazy = false;
|
|
}
|
|
var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
|
|
if (!retUnwrapped && useLazy) {
|
|
value = onlyLazy ? value : new LazyWrapper(this);
|
|
var result2 = func.apply(value, args);
|
|
result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined2 });
|
|
return new LodashWrapper(result2, chainAll);
|
|
}
|
|
if (isUnwrapped && onlyLazy) {
|
|
return func.apply(this, args);
|
|
}
|
|
result2 = this.thru(interceptor);
|
|
return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
|
|
};
|
|
});
|
|
arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
|
|
var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
|
|
lodash.prototype[methodName] = function() {
|
|
var args = arguments;
|
|
if (retUnwrapped && !this.__chain__) {
|
|
var value = this.value();
|
|
return func.apply(isArray(value) ? value : [], args);
|
|
}
|
|
return this[chainName](function(value2) {
|
|
return func.apply(isArray(value2) ? value2 : [], args);
|
|
});
|
|
};
|
|
});
|
|
baseForOwn(LazyWrapper.prototype, function(func, methodName) {
|
|
var lodashFunc = lodash[methodName];
|
|
if (lodashFunc) {
|
|
var key = lodashFunc.name + "";
|
|
if (!hasOwnProperty.call(realNames, key)) {
|
|
realNames[key] = [];
|
|
}
|
|
realNames[key].push({ "name": methodName, "func": lodashFunc });
|
|
}
|
|
});
|
|
realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{
|
|
"name": "wrapper",
|
|
"func": undefined2
|
|
}];
|
|
LazyWrapper.prototype.clone = lazyClone;
|
|
LazyWrapper.prototype.reverse = lazyReverse;
|
|
LazyWrapper.prototype.value = lazyValue;
|
|
lodash.prototype.at = wrapperAt;
|
|
lodash.prototype.chain = wrapperChain;
|
|
lodash.prototype.commit = wrapperCommit;
|
|
lodash.prototype.next = wrapperNext;
|
|
lodash.prototype.plant = wrapperPlant;
|
|
lodash.prototype.reverse = wrapperReverse;
|
|
lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
|
|
lodash.prototype.first = lodash.prototype.head;
|
|
if (symIterator) {
|
|
lodash.prototype[symIterator] = wrapperToIterator;
|
|
}
|
|
return lodash;
|
|
};
|
|
var _ = runInContext();
|
|
if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
|
|
root._ = _;
|
|
define(function() {
|
|
return _;
|
|
});
|
|
} else if (freeModule) {
|
|
(freeModule.exports = _)._ = _;
|
|
freeExports._ = _;
|
|
} else {
|
|
root._ = _;
|
|
}
|
|
}).call(exports);
|
|
}
|
|
});
|
|
|
|
// node_modules/chroma-js/chroma.js
|
|
var require_chroma = __commonJS({
|
|
"node_modules/chroma-js/chroma.js"(exports, module2) {
|
|
(function(global2, factory) {
|
|
typeof exports === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.chroma = factory());
|
|
})(exports, function() {
|
|
"use strict";
|
|
var limit$2 = function(x, min2, max2) {
|
|
if (min2 === void 0)
|
|
min2 = 0;
|
|
if (max2 === void 0)
|
|
max2 = 1;
|
|
return x < min2 ? min2 : x > max2 ? max2 : x;
|
|
};
|
|
var limit$1 = limit$2;
|
|
var clip_rgb$3 = function(rgb2) {
|
|
rgb2._clipped = false;
|
|
rgb2._unclipped = rgb2.slice(0);
|
|
for (var i2 = 0; i2 <= 3; i2++) {
|
|
if (i2 < 3) {
|
|
if (rgb2[i2] < 0 || rgb2[i2] > 255) {
|
|
rgb2._clipped = true;
|
|
}
|
|
rgb2[i2] = limit$1(rgb2[i2], 0, 255);
|
|
} else if (i2 === 3) {
|
|
rgb2[i2] = limit$1(rgb2[i2], 0, 1);
|
|
}
|
|
}
|
|
return rgb2;
|
|
};
|
|
var classToType = {};
|
|
for (var i$1 = 0, list$1 = ["Boolean", "Number", "String", "Function", "Array", "Date", "RegExp", "Undefined", "Null"]; i$1 < list$1.length; i$1 += 1) {
|
|
var name = list$1[i$1];
|
|
classToType["[object " + name + "]"] = name.toLowerCase();
|
|
}
|
|
var type$p = function(obj) {
|
|
return classToType[Object.prototype.toString.call(obj)] || "object";
|
|
};
|
|
var type$o = type$p;
|
|
var unpack$B = function(args, keyOrder) {
|
|
if (keyOrder === void 0)
|
|
keyOrder = null;
|
|
if (args.length >= 3) {
|
|
return Array.prototype.slice.call(args);
|
|
}
|
|
if (type$o(args[0]) == "object" && keyOrder) {
|
|
return keyOrder.split("").filter(function(k) {
|
|
return args[0][k] !== void 0;
|
|
}).map(function(k) {
|
|
return args[0][k];
|
|
});
|
|
}
|
|
return args[0];
|
|
};
|
|
var type$n = type$p;
|
|
var last$4 = function(args) {
|
|
if (args.length < 2) {
|
|
return null;
|
|
}
|
|
var l = args.length - 1;
|
|
if (type$n(args[l]) == "string") {
|
|
return args[l].toLowerCase();
|
|
}
|
|
return null;
|
|
};
|
|
var PI$2 = Math.PI;
|
|
var utils = {
|
|
clip_rgb: clip_rgb$3,
|
|
limit: limit$2,
|
|
type: type$p,
|
|
unpack: unpack$B,
|
|
last: last$4,
|
|
PI: PI$2,
|
|
TWOPI: PI$2 * 2,
|
|
PITHIRD: PI$2 / 3,
|
|
DEG2RAD: PI$2 / 180,
|
|
RAD2DEG: 180 / PI$2
|
|
};
|
|
var input$h = {
|
|
format: {},
|
|
autodetect: []
|
|
};
|
|
var last$3 = utils.last;
|
|
var clip_rgb$2 = utils.clip_rgb;
|
|
var type$m = utils.type;
|
|
var _input = input$h;
|
|
var Color$D = function Color2() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var me = this;
|
|
if (type$m(args[0]) === "object" && args[0].constructor && args[0].constructor === this.constructor) {
|
|
return args[0];
|
|
}
|
|
var mode = last$3(args);
|
|
var autodetect = false;
|
|
if (!mode) {
|
|
autodetect = true;
|
|
if (!_input.sorted) {
|
|
_input.autodetect = _input.autodetect.sort(function(a, b) {
|
|
return b.p - a.p;
|
|
});
|
|
_input.sorted = true;
|
|
}
|
|
for (var i2 = 0, list2 = _input.autodetect; i2 < list2.length; i2 += 1) {
|
|
var chk = list2[i2];
|
|
mode = chk.test.apply(chk, args);
|
|
if (mode) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if (_input.format[mode]) {
|
|
var rgb2 = _input.format[mode].apply(null, autodetect ? args : args.slice(0, -1));
|
|
me._rgb = clip_rgb$2(rgb2);
|
|
} else {
|
|
throw new Error("unknown format: " + args);
|
|
}
|
|
if (me._rgb.length === 3) {
|
|
me._rgb.push(1);
|
|
}
|
|
};
|
|
Color$D.prototype.toString = function toString() {
|
|
if (type$m(this.hex) == "function") {
|
|
return this.hex();
|
|
}
|
|
return "[" + this._rgb.join(",") + "]";
|
|
};
|
|
var Color_1 = Color$D;
|
|
var chroma$k = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(chroma$k.Color, [null].concat(args)))();
|
|
};
|
|
chroma$k.Color = Color_1;
|
|
chroma$k.version = "2.4.2";
|
|
var chroma_1 = chroma$k;
|
|
var unpack$A = utils.unpack;
|
|
var max$2 = Math.max;
|
|
var rgb2cmyk$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$A(args, "rgb");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
r = r / 255;
|
|
g = g / 255;
|
|
b = b / 255;
|
|
var k = 1 - max$2(r, max$2(g, b));
|
|
var f = k < 1 ? 1 / (1 - k) : 0;
|
|
var c = (1 - r - k) * f;
|
|
var m = (1 - g - k) * f;
|
|
var y = (1 - b - k) * f;
|
|
return [c, m, y, k];
|
|
};
|
|
var rgb2cmyk_1 = rgb2cmyk$1;
|
|
var unpack$z = utils.unpack;
|
|
var cmyk2rgb = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$z(args, "cmyk");
|
|
var c = args[0];
|
|
var m = args[1];
|
|
var y = args[2];
|
|
var k = args[3];
|
|
var alpha = args.length > 4 ? args[4] : 1;
|
|
if (k === 1) {
|
|
return [0, 0, 0, alpha];
|
|
}
|
|
return [
|
|
c >= 1 ? 0 : 255 * (1 - c) * (1 - k),
|
|
// r
|
|
m >= 1 ? 0 : 255 * (1 - m) * (1 - k),
|
|
// g
|
|
y >= 1 ? 0 : 255 * (1 - y) * (1 - k),
|
|
// b
|
|
alpha
|
|
];
|
|
};
|
|
var cmyk2rgb_1 = cmyk2rgb;
|
|
var chroma$j = chroma_1;
|
|
var Color$C = Color_1;
|
|
var input$g = input$h;
|
|
var unpack$y = utils.unpack;
|
|
var type$l = utils.type;
|
|
var rgb2cmyk = rgb2cmyk_1;
|
|
Color$C.prototype.cmyk = function() {
|
|
return rgb2cmyk(this._rgb);
|
|
};
|
|
chroma$j.cmyk = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$C, [null].concat(args, ["cmyk"])))();
|
|
};
|
|
input$g.format.cmyk = cmyk2rgb_1;
|
|
input$g.autodetect.push({
|
|
p: 2,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$y(args, "cmyk");
|
|
if (type$l(args) === "array" && args.length === 4) {
|
|
return "cmyk";
|
|
}
|
|
}
|
|
});
|
|
var unpack$x = utils.unpack;
|
|
var last$2 = utils.last;
|
|
var rnd = function(a) {
|
|
return Math.round(a * 100) / 100;
|
|
};
|
|
var hsl2css$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var hsla = unpack$x(args, "hsla");
|
|
var mode = last$2(args) || "lsa";
|
|
hsla[0] = rnd(hsla[0] || 0);
|
|
hsla[1] = rnd(hsla[1] * 100) + "%";
|
|
hsla[2] = rnd(hsla[2] * 100) + "%";
|
|
if (mode === "hsla" || hsla.length > 3 && hsla[3] < 1) {
|
|
hsla[3] = hsla.length > 3 ? hsla[3] : 1;
|
|
mode = "hsla";
|
|
} else {
|
|
hsla.length = 3;
|
|
}
|
|
return mode + "(" + hsla.join(",") + ")";
|
|
};
|
|
var hsl2css_1 = hsl2css$1;
|
|
var unpack$w = utils.unpack;
|
|
var rgb2hsl$3 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$w(args, "rgba");
|
|
var r = args[0];
|
|
var g = args[1];
|
|
var b = args[2];
|
|
r /= 255;
|
|
g /= 255;
|
|
b /= 255;
|
|
var min2 = Math.min(r, g, b);
|
|
var max2 = Math.max(r, g, b);
|
|
var l = (max2 + min2) / 2;
|
|
var s, h;
|
|
if (max2 === min2) {
|
|
s = 0;
|
|
h = Number.NaN;
|
|
} else {
|
|
s = l < 0.5 ? (max2 - min2) / (max2 + min2) : (max2 - min2) / (2 - max2 - min2);
|
|
}
|
|
if (r == max2) {
|
|
h = (g - b) / (max2 - min2);
|
|
} else if (g == max2) {
|
|
h = 2 + (b - r) / (max2 - min2);
|
|
} else if (b == max2) {
|
|
h = 4 + (r - g) / (max2 - min2);
|
|
}
|
|
h *= 60;
|
|
if (h < 0) {
|
|
h += 360;
|
|
}
|
|
if (args.length > 3 && args[3] !== void 0) {
|
|
return [h, s, l, args[3]];
|
|
}
|
|
return [h, s, l];
|
|
};
|
|
var rgb2hsl_1 = rgb2hsl$3;
|
|
var unpack$v = utils.unpack;
|
|
var last$1 = utils.last;
|
|
var hsl2css = hsl2css_1;
|
|
var rgb2hsl$2 = rgb2hsl_1;
|
|
var round$6 = Math.round;
|
|
var rgb2css$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var rgba = unpack$v(args, "rgba");
|
|
var mode = last$1(args) || "rgb";
|
|
if (mode.substr(0, 3) == "hsl") {
|
|
return hsl2css(rgb2hsl$2(rgba), mode);
|
|
}
|
|
rgba[0] = round$6(rgba[0]);
|
|
rgba[1] = round$6(rgba[1]);
|
|
rgba[2] = round$6(rgba[2]);
|
|
if (mode === "rgba" || rgba.length > 3 && rgba[3] < 1) {
|
|
rgba[3] = rgba.length > 3 ? rgba[3] : 1;
|
|
mode = "rgba";
|
|
}
|
|
return mode + "(" + rgba.slice(0, mode === "rgb" ? 3 : 4).join(",") + ")";
|
|
};
|
|
var rgb2css_1 = rgb2css$1;
|
|
var unpack$u = utils.unpack;
|
|
var round$5 = Math.round;
|
|
var hsl2rgb$1 = function() {
|
|
var assign2;
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$u(args, "hsl");
|
|
var h = args[0];
|
|
var s = args[1];
|
|
var l = args[2];
|
|
var r, g, b;
|
|
if (s === 0) {
|
|
r = g = b = l * 255;
|
|
} else {
|
|
var t3 = [0, 0, 0];
|
|
var c = [0, 0, 0];
|
|
var t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
var t1 = 2 * l - t2;
|
|
var h_ = h / 360;
|
|
t3[0] = h_ + 1 / 3;
|
|
t3[1] = h_;
|
|
t3[2] = h_ - 1 / 3;
|
|
for (var i2 = 0; i2 < 3; i2++) {
|
|
if (t3[i2] < 0) {
|
|
t3[i2] += 1;
|
|
}
|
|
if (t3[i2] > 1) {
|
|
t3[i2] -= 1;
|
|
}
|
|
if (6 * t3[i2] < 1) {
|
|
c[i2] = t1 + (t2 - t1) * 6 * t3[i2];
|
|
} else if (2 * t3[i2] < 1) {
|
|
c[i2] = t2;
|
|
} else if (3 * t3[i2] < 2) {
|
|
c[i2] = t1 + (t2 - t1) * (2 / 3 - t3[i2]) * 6;
|
|
} else {
|
|
c[i2] = t1;
|
|
}
|
|
}
|
|
assign2 = [round$5(c[0] * 255), round$5(c[1] * 255), round$5(c[2] * 255)], r = assign2[0], g = assign2[1], b = assign2[2];
|
|
}
|
|
if (args.length > 3) {
|
|
return [r, g, b, args[3]];
|
|
}
|
|
return [r, g, b, 1];
|
|
};
|
|
var hsl2rgb_1 = hsl2rgb$1;
|
|
var hsl2rgb = hsl2rgb_1;
|
|
var input$f = input$h;
|
|
var RE_RGB = /^rgb\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*\)$/;
|
|
var RE_RGBA = /^rgba\(\s*(-?\d+),\s*(-?\d+)\s*,\s*(-?\d+)\s*,\s*([01]|[01]?\.\d+)\)$/;
|
|
var RE_RGB_PCT = /^rgb\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;
|
|
var RE_RGBA_PCT = /^rgba\(\s*(-?\d+(?:\.\d+)?)%,\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;
|
|
var RE_HSL = /^hsl\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*\)$/;
|
|
var RE_HSLA = /^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/;
|
|
var round$4 = Math.round;
|
|
var css2rgb$1 = function(css) {
|
|
css = css.toLowerCase().trim();
|
|
var m;
|
|
if (input$f.format.named) {
|
|
try {
|
|
return input$f.format.named(css);
|
|
} catch (e) {
|
|
}
|
|
}
|
|
if (m = css.match(RE_RGB)) {
|
|
var rgb2 = m.slice(1, 4);
|
|
for (var i2 = 0; i2 < 3; i2++) {
|
|
rgb2[i2] = +rgb2[i2];
|
|
}
|
|
rgb2[3] = 1;
|
|
return rgb2;
|
|
}
|
|
if (m = css.match(RE_RGBA)) {
|
|
var rgb$1 = m.slice(1, 5);
|
|
for (var i$12 = 0; i$12 < 4; i$12++) {
|
|
rgb$1[i$12] = +rgb$1[i$12];
|
|
}
|
|
return rgb$1;
|
|
}
|
|
if (m = css.match(RE_RGB_PCT)) {
|
|
var rgb$2 = m.slice(1, 4);
|
|
for (var i$2 = 0; i$2 < 3; i$2++) {
|
|
rgb$2[i$2] = round$4(rgb$2[i$2] * 2.55);
|
|
}
|
|
rgb$2[3] = 1;
|
|
return rgb$2;
|
|
}
|
|
if (m = css.match(RE_RGBA_PCT)) {
|
|
var rgb$3 = m.slice(1, 5);
|
|
for (var i$3 = 0; i$3 < 3; i$3++) {
|
|
rgb$3[i$3] = round$4(rgb$3[i$3] * 2.55);
|
|
}
|
|
rgb$3[3] = +rgb$3[3];
|
|
return rgb$3;
|
|
}
|
|
if (m = css.match(RE_HSL)) {
|
|
var hsl2 = m.slice(1, 4);
|
|
hsl2[1] *= 0.01;
|
|
hsl2[2] *= 0.01;
|
|
var rgb$4 = hsl2rgb(hsl2);
|
|
rgb$4[3] = 1;
|
|
return rgb$4;
|
|
}
|
|
if (m = css.match(RE_HSLA)) {
|
|
var hsl$1 = m.slice(1, 4);
|
|
hsl$1[1] *= 0.01;
|
|
hsl$1[2] *= 0.01;
|
|
var rgb$5 = hsl2rgb(hsl$1);
|
|
rgb$5[3] = +m[4];
|
|
return rgb$5;
|
|
}
|
|
};
|
|
css2rgb$1.test = function(s) {
|
|
return RE_RGB.test(s) || RE_RGBA.test(s) || RE_RGB_PCT.test(s) || RE_RGBA_PCT.test(s) || RE_HSL.test(s) || RE_HSLA.test(s);
|
|
};
|
|
var css2rgb_1 = css2rgb$1;
|
|
var chroma$i = chroma_1;
|
|
var Color$B = Color_1;
|
|
var input$e = input$h;
|
|
var type$k = utils.type;
|
|
var rgb2css = rgb2css_1;
|
|
var css2rgb = css2rgb_1;
|
|
Color$B.prototype.css = function(mode) {
|
|
return rgb2css(this._rgb, mode);
|
|
};
|
|
chroma$i.css = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$B, [null].concat(args, ["css"])))();
|
|
};
|
|
input$e.format.css = css2rgb;
|
|
input$e.autodetect.push({
|
|
p: 5,
|
|
test: function(h) {
|
|
var rest = [], len = arguments.length - 1;
|
|
while (len-- > 0)
|
|
rest[len] = arguments[len + 1];
|
|
if (!rest.length && type$k(h) === "string" && css2rgb.test(h)) {
|
|
return "css";
|
|
}
|
|
}
|
|
});
|
|
var Color$A = Color_1;
|
|
var chroma$h = chroma_1;
|
|
var input$d = input$h;
|
|
var unpack$t = utils.unpack;
|
|
input$d.format.gl = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var rgb2 = unpack$t(args, "rgba");
|
|
rgb2[0] *= 255;
|
|
rgb2[1] *= 255;
|
|
rgb2[2] *= 255;
|
|
return rgb2;
|
|
};
|
|
chroma$h.gl = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$A, [null].concat(args, ["gl"])))();
|
|
};
|
|
Color$A.prototype.gl = function() {
|
|
var rgb2 = this._rgb;
|
|
return [rgb2[0] / 255, rgb2[1] / 255, rgb2[2] / 255, rgb2[3]];
|
|
};
|
|
var unpack$s = utils.unpack;
|
|
var rgb2hcg$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$s(args, "rgb");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
var min2 = Math.min(r, g, b);
|
|
var max2 = Math.max(r, g, b);
|
|
var delta = max2 - min2;
|
|
var c = delta * 100 / 255;
|
|
var _g = min2 / (255 - delta) * 100;
|
|
var h;
|
|
if (delta === 0) {
|
|
h = Number.NaN;
|
|
} else {
|
|
if (r === max2) {
|
|
h = (g - b) / delta;
|
|
}
|
|
if (g === max2) {
|
|
h = 2 + (b - r) / delta;
|
|
}
|
|
if (b === max2) {
|
|
h = 4 + (r - g) / delta;
|
|
}
|
|
h *= 60;
|
|
if (h < 0) {
|
|
h += 360;
|
|
}
|
|
}
|
|
return [h, c, _g];
|
|
};
|
|
var rgb2hcg_1 = rgb2hcg$1;
|
|
var unpack$r = utils.unpack;
|
|
var floor$3 = Math.floor;
|
|
var hcg2rgb = function() {
|
|
var assign2, assign$1, assign$2, assign$3, assign$4, assign$5;
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$r(args, "hcg");
|
|
var h = args[0];
|
|
var c = args[1];
|
|
var _g = args[2];
|
|
var r, g, b;
|
|
_g = _g * 255;
|
|
var _c = c * 255;
|
|
if (c === 0) {
|
|
r = g = b = _g;
|
|
} else {
|
|
if (h === 360) {
|
|
h = 0;
|
|
}
|
|
if (h > 360) {
|
|
h -= 360;
|
|
}
|
|
if (h < 0) {
|
|
h += 360;
|
|
}
|
|
h /= 60;
|
|
var i2 = floor$3(h);
|
|
var f = h - i2;
|
|
var p = _g * (1 - c);
|
|
var q = p + _c * (1 - f);
|
|
var t = p + _c * f;
|
|
var v = p + _c;
|
|
switch (i2) {
|
|
case 0:
|
|
assign2 = [v, t, p], r = assign2[0], g = assign2[1], b = assign2[2];
|
|
break;
|
|
case 1:
|
|
assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2];
|
|
break;
|
|
case 2:
|
|
assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2];
|
|
break;
|
|
case 3:
|
|
assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2];
|
|
break;
|
|
case 4:
|
|
assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2];
|
|
break;
|
|
case 5:
|
|
assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2];
|
|
break;
|
|
}
|
|
}
|
|
return [r, g, b, args.length > 3 ? args[3] : 1];
|
|
};
|
|
var hcg2rgb_1 = hcg2rgb;
|
|
var unpack$q = utils.unpack;
|
|
var type$j = utils.type;
|
|
var chroma$g = chroma_1;
|
|
var Color$z = Color_1;
|
|
var input$c = input$h;
|
|
var rgb2hcg = rgb2hcg_1;
|
|
Color$z.prototype.hcg = function() {
|
|
return rgb2hcg(this._rgb);
|
|
};
|
|
chroma$g.hcg = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$z, [null].concat(args, ["hcg"])))();
|
|
};
|
|
input$c.format.hcg = hcg2rgb_1;
|
|
input$c.autodetect.push({
|
|
p: 1,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$q(args, "hcg");
|
|
if (type$j(args) === "array" && args.length === 3) {
|
|
return "hcg";
|
|
}
|
|
}
|
|
});
|
|
var unpack$p = utils.unpack;
|
|
var last3 = utils.last;
|
|
var round$3 = Math.round;
|
|
var rgb2hex$2 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$p(args, "rgba");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
var a = ref[3];
|
|
var mode = last3(args) || "auto";
|
|
if (a === void 0) {
|
|
a = 1;
|
|
}
|
|
if (mode === "auto") {
|
|
mode = a < 1 ? "rgba" : "rgb";
|
|
}
|
|
r = round$3(r);
|
|
g = round$3(g);
|
|
b = round$3(b);
|
|
var u = r << 16 | g << 8 | b;
|
|
var str = "000000" + u.toString(16);
|
|
str = str.substr(str.length - 6);
|
|
var hxa = "0" + round$3(a * 255).toString(16);
|
|
hxa = hxa.substr(hxa.length - 2);
|
|
switch (mode.toLowerCase()) {
|
|
case "rgba":
|
|
return "#" + str + hxa;
|
|
case "argb":
|
|
return "#" + hxa + str;
|
|
default:
|
|
return "#" + str;
|
|
}
|
|
};
|
|
var rgb2hex_1 = rgb2hex$2;
|
|
var RE_HEX = /^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/;
|
|
var RE_HEXA = /^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/;
|
|
var hex2rgb$1 = function(hex) {
|
|
if (hex.match(RE_HEX)) {
|
|
if (hex.length === 4 || hex.length === 7) {
|
|
hex = hex.substr(1);
|
|
}
|
|
if (hex.length === 3) {
|
|
hex = hex.split("");
|
|
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
|
|
}
|
|
var u = parseInt(hex, 16);
|
|
var r = u >> 16;
|
|
var g = u >> 8 & 255;
|
|
var b = u & 255;
|
|
return [r, g, b, 1];
|
|
}
|
|
if (hex.match(RE_HEXA)) {
|
|
if (hex.length === 5 || hex.length === 9) {
|
|
hex = hex.substr(1);
|
|
}
|
|
if (hex.length === 4) {
|
|
hex = hex.split("");
|
|
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3];
|
|
}
|
|
var u$1 = parseInt(hex, 16);
|
|
var r$1 = u$1 >> 24 & 255;
|
|
var g$1 = u$1 >> 16 & 255;
|
|
var b$1 = u$1 >> 8 & 255;
|
|
var a = Math.round((u$1 & 255) / 255 * 100) / 100;
|
|
return [r$1, g$1, b$1, a];
|
|
}
|
|
throw new Error("unknown hex color: " + hex);
|
|
};
|
|
var hex2rgb_1 = hex2rgb$1;
|
|
var chroma$f = chroma_1;
|
|
var Color$y = Color_1;
|
|
var type$i = utils.type;
|
|
var input$b = input$h;
|
|
var rgb2hex$1 = rgb2hex_1;
|
|
Color$y.prototype.hex = function(mode) {
|
|
return rgb2hex$1(this._rgb, mode);
|
|
};
|
|
chroma$f.hex = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$y, [null].concat(args, ["hex"])))();
|
|
};
|
|
input$b.format.hex = hex2rgb_1;
|
|
input$b.autodetect.push({
|
|
p: 4,
|
|
test: function(h) {
|
|
var rest = [], len = arguments.length - 1;
|
|
while (len-- > 0)
|
|
rest[len] = arguments[len + 1];
|
|
if (!rest.length && type$i(h) === "string" && [3, 4, 5, 6, 7, 8, 9].indexOf(h.length) >= 0) {
|
|
return "hex";
|
|
}
|
|
}
|
|
});
|
|
var unpack$o = utils.unpack;
|
|
var TWOPI$2 = utils.TWOPI;
|
|
var min$2 = Math.min;
|
|
var sqrt$4 = Math.sqrt;
|
|
var acos = Math.acos;
|
|
var rgb2hsi$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$o(args, "rgb");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
r /= 255;
|
|
g /= 255;
|
|
b /= 255;
|
|
var h;
|
|
var min_ = min$2(r, g, b);
|
|
var i2 = (r + g + b) / 3;
|
|
var s = i2 > 0 ? 1 - min_ / i2 : 0;
|
|
if (s === 0) {
|
|
h = NaN;
|
|
} else {
|
|
h = (r - g + (r - b)) / 2;
|
|
h /= sqrt$4((r - g) * (r - g) + (r - b) * (g - b));
|
|
h = acos(h);
|
|
if (b > g) {
|
|
h = TWOPI$2 - h;
|
|
}
|
|
h /= TWOPI$2;
|
|
}
|
|
return [h * 360, s, i2];
|
|
};
|
|
var rgb2hsi_1 = rgb2hsi$1;
|
|
var unpack$n = utils.unpack;
|
|
var limit = utils.limit;
|
|
var TWOPI$1 = utils.TWOPI;
|
|
var PITHIRD = utils.PITHIRD;
|
|
var cos$4 = Math.cos;
|
|
var hsi2rgb = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$n(args, "hsi");
|
|
var h = args[0];
|
|
var s = args[1];
|
|
var i2 = args[2];
|
|
var r, g, b;
|
|
if (isNaN(h)) {
|
|
h = 0;
|
|
}
|
|
if (isNaN(s)) {
|
|
s = 0;
|
|
}
|
|
if (h > 360) {
|
|
h -= 360;
|
|
}
|
|
if (h < 0) {
|
|
h += 360;
|
|
}
|
|
h /= 360;
|
|
if (h < 1 / 3) {
|
|
b = (1 - s) / 3;
|
|
r = (1 + s * cos$4(TWOPI$1 * h) / cos$4(PITHIRD - TWOPI$1 * h)) / 3;
|
|
g = 1 - (b + r);
|
|
} else if (h < 2 / 3) {
|
|
h -= 1 / 3;
|
|
r = (1 - s) / 3;
|
|
g = (1 + s * cos$4(TWOPI$1 * h) / cos$4(PITHIRD - TWOPI$1 * h)) / 3;
|
|
b = 1 - (r + g);
|
|
} else {
|
|
h -= 2 / 3;
|
|
g = (1 - s) / 3;
|
|
b = (1 + s * cos$4(TWOPI$1 * h) / cos$4(PITHIRD - TWOPI$1 * h)) / 3;
|
|
r = 1 - (g + b);
|
|
}
|
|
r = limit(i2 * r * 3);
|
|
g = limit(i2 * g * 3);
|
|
b = limit(i2 * b * 3);
|
|
return [r * 255, g * 255, b * 255, args.length > 3 ? args[3] : 1];
|
|
};
|
|
var hsi2rgb_1 = hsi2rgb;
|
|
var unpack$m = utils.unpack;
|
|
var type$h = utils.type;
|
|
var chroma$e = chroma_1;
|
|
var Color$x = Color_1;
|
|
var input$a = input$h;
|
|
var rgb2hsi = rgb2hsi_1;
|
|
Color$x.prototype.hsi = function() {
|
|
return rgb2hsi(this._rgb);
|
|
};
|
|
chroma$e.hsi = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$x, [null].concat(args, ["hsi"])))();
|
|
};
|
|
input$a.format.hsi = hsi2rgb_1;
|
|
input$a.autodetect.push({
|
|
p: 2,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$m(args, "hsi");
|
|
if (type$h(args) === "array" && args.length === 3) {
|
|
return "hsi";
|
|
}
|
|
}
|
|
});
|
|
var unpack$l = utils.unpack;
|
|
var type$g = utils.type;
|
|
var chroma$d = chroma_1;
|
|
var Color$w = Color_1;
|
|
var input$9 = input$h;
|
|
var rgb2hsl$1 = rgb2hsl_1;
|
|
Color$w.prototype.hsl = function() {
|
|
return rgb2hsl$1(this._rgb);
|
|
};
|
|
chroma$d.hsl = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$w, [null].concat(args, ["hsl"])))();
|
|
};
|
|
input$9.format.hsl = hsl2rgb_1;
|
|
input$9.autodetect.push({
|
|
p: 2,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$l(args, "hsl");
|
|
if (type$g(args) === "array" && args.length === 3) {
|
|
return "hsl";
|
|
}
|
|
}
|
|
});
|
|
var unpack$k = utils.unpack;
|
|
var min$1 = Math.min;
|
|
var max$1 = Math.max;
|
|
var rgb2hsl = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$k(args, "rgb");
|
|
var r = args[0];
|
|
var g = args[1];
|
|
var b = args[2];
|
|
var min_ = min$1(r, g, b);
|
|
var max_ = max$1(r, g, b);
|
|
var delta = max_ - min_;
|
|
var h, s, v;
|
|
v = max_ / 255;
|
|
if (max_ === 0) {
|
|
h = Number.NaN;
|
|
s = 0;
|
|
} else {
|
|
s = delta / max_;
|
|
if (r === max_) {
|
|
h = (g - b) / delta;
|
|
}
|
|
if (g === max_) {
|
|
h = 2 + (b - r) / delta;
|
|
}
|
|
if (b === max_) {
|
|
h = 4 + (r - g) / delta;
|
|
}
|
|
h *= 60;
|
|
if (h < 0) {
|
|
h += 360;
|
|
}
|
|
}
|
|
return [h, s, v];
|
|
};
|
|
var rgb2hsv$1 = rgb2hsl;
|
|
var unpack$j = utils.unpack;
|
|
var floor$2 = Math.floor;
|
|
var hsv2rgb = function() {
|
|
var assign2, assign$1, assign$2, assign$3, assign$4, assign$5;
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$j(args, "hsv");
|
|
var h = args[0];
|
|
var s = args[1];
|
|
var v = args[2];
|
|
var r, g, b;
|
|
v *= 255;
|
|
if (s === 0) {
|
|
r = g = b = v;
|
|
} else {
|
|
if (h === 360) {
|
|
h = 0;
|
|
}
|
|
if (h > 360) {
|
|
h -= 360;
|
|
}
|
|
if (h < 0) {
|
|
h += 360;
|
|
}
|
|
h /= 60;
|
|
var i2 = floor$2(h);
|
|
var f = h - i2;
|
|
var p = v * (1 - s);
|
|
var q = v * (1 - s * f);
|
|
var t = v * (1 - s * (1 - f));
|
|
switch (i2) {
|
|
case 0:
|
|
assign2 = [v, t, p], r = assign2[0], g = assign2[1], b = assign2[2];
|
|
break;
|
|
case 1:
|
|
assign$1 = [q, v, p], r = assign$1[0], g = assign$1[1], b = assign$1[2];
|
|
break;
|
|
case 2:
|
|
assign$2 = [p, v, t], r = assign$2[0], g = assign$2[1], b = assign$2[2];
|
|
break;
|
|
case 3:
|
|
assign$3 = [p, q, v], r = assign$3[0], g = assign$3[1], b = assign$3[2];
|
|
break;
|
|
case 4:
|
|
assign$4 = [t, p, v], r = assign$4[0], g = assign$4[1], b = assign$4[2];
|
|
break;
|
|
case 5:
|
|
assign$5 = [v, p, q], r = assign$5[0], g = assign$5[1], b = assign$5[2];
|
|
break;
|
|
}
|
|
}
|
|
return [r, g, b, args.length > 3 ? args[3] : 1];
|
|
};
|
|
var hsv2rgb_1 = hsv2rgb;
|
|
var unpack$i = utils.unpack;
|
|
var type$f = utils.type;
|
|
var chroma$c = chroma_1;
|
|
var Color$v = Color_1;
|
|
var input$8 = input$h;
|
|
var rgb2hsv = rgb2hsv$1;
|
|
Color$v.prototype.hsv = function() {
|
|
return rgb2hsv(this._rgb);
|
|
};
|
|
chroma$c.hsv = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$v, [null].concat(args, ["hsv"])))();
|
|
};
|
|
input$8.format.hsv = hsv2rgb_1;
|
|
input$8.autodetect.push({
|
|
p: 2,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$i(args, "hsv");
|
|
if (type$f(args) === "array" && args.length === 3) {
|
|
return "hsv";
|
|
}
|
|
}
|
|
});
|
|
var labConstants = {
|
|
// Corresponds roughly to RGB brighter/darker
|
|
Kn: 18,
|
|
// D65 standard referent
|
|
Xn: 0.95047,
|
|
Yn: 1,
|
|
Zn: 1.08883,
|
|
t0: 0.137931034,
|
|
// 4 / 29
|
|
t1: 0.206896552,
|
|
// 6 / 29
|
|
t2: 0.12841855,
|
|
// 3 * t1 * t1
|
|
t3: 8856452e-9
|
|
// t1 * t1 * t1
|
|
};
|
|
var LAB_CONSTANTS$3 = labConstants;
|
|
var unpack$h = utils.unpack;
|
|
var pow$a = Math.pow;
|
|
var rgb2lab$2 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$h(args, "rgb");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
var ref$1 = rgb2xyz(r, g, b);
|
|
var x = ref$1[0];
|
|
var y = ref$1[1];
|
|
var z = ref$1[2];
|
|
var l = 116 * y - 16;
|
|
return [l < 0 ? 0 : l, 500 * (x - y), 200 * (y - z)];
|
|
};
|
|
var rgb_xyz = function(r) {
|
|
if ((r /= 255) <= 0.04045) {
|
|
return r / 12.92;
|
|
}
|
|
return pow$a((r + 0.055) / 1.055, 2.4);
|
|
};
|
|
var xyz_lab = function(t) {
|
|
if (t > LAB_CONSTANTS$3.t3) {
|
|
return pow$a(t, 1 / 3);
|
|
}
|
|
return t / LAB_CONSTANTS$3.t2 + LAB_CONSTANTS$3.t0;
|
|
};
|
|
var rgb2xyz = function(r, g, b) {
|
|
r = rgb_xyz(r);
|
|
g = rgb_xyz(g);
|
|
b = rgb_xyz(b);
|
|
var x = xyz_lab((0.4124564 * r + 0.3575761 * g + 0.1804375 * b) / LAB_CONSTANTS$3.Xn);
|
|
var y = xyz_lab((0.2126729 * r + 0.7151522 * g + 0.072175 * b) / LAB_CONSTANTS$3.Yn);
|
|
var z = xyz_lab((0.0193339 * r + 0.119192 * g + 0.9503041 * b) / LAB_CONSTANTS$3.Zn);
|
|
return [x, y, z];
|
|
};
|
|
var rgb2lab_1 = rgb2lab$2;
|
|
var LAB_CONSTANTS$2 = labConstants;
|
|
var unpack$g = utils.unpack;
|
|
var pow$9 = Math.pow;
|
|
var lab2rgb$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$g(args, "lab");
|
|
var l = args[0];
|
|
var a = args[1];
|
|
var b = args[2];
|
|
var x, y, z, r, g, b_;
|
|
y = (l + 16) / 116;
|
|
x = isNaN(a) ? y : y + a / 500;
|
|
z = isNaN(b) ? y : y - b / 200;
|
|
y = LAB_CONSTANTS$2.Yn * lab_xyz(y);
|
|
x = LAB_CONSTANTS$2.Xn * lab_xyz(x);
|
|
z = LAB_CONSTANTS$2.Zn * lab_xyz(z);
|
|
r = xyz_rgb(3.2404542 * x - 1.5371385 * y - 0.4985314 * z);
|
|
g = xyz_rgb(-0.969266 * x + 1.8760108 * y + 0.041556 * z);
|
|
b_ = xyz_rgb(0.0556434 * x - 0.2040259 * y + 1.0572252 * z);
|
|
return [r, g, b_, args.length > 3 ? args[3] : 1];
|
|
};
|
|
var xyz_rgb = function(r) {
|
|
return 255 * (r <= 304e-5 ? 12.92 * r : 1.055 * pow$9(r, 1 / 2.4) - 0.055);
|
|
};
|
|
var lab_xyz = function(t) {
|
|
return t > LAB_CONSTANTS$2.t1 ? t * t * t : LAB_CONSTANTS$2.t2 * (t - LAB_CONSTANTS$2.t0);
|
|
};
|
|
var lab2rgb_1 = lab2rgb$1;
|
|
var unpack$f = utils.unpack;
|
|
var type$e = utils.type;
|
|
var chroma$b = chroma_1;
|
|
var Color$u = Color_1;
|
|
var input$7 = input$h;
|
|
var rgb2lab$1 = rgb2lab_1;
|
|
Color$u.prototype.lab = function() {
|
|
return rgb2lab$1(this._rgb);
|
|
};
|
|
chroma$b.lab = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$u, [null].concat(args, ["lab"])))();
|
|
};
|
|
input$7.format.lab = lab2rgb_1;
|
|
input$7.autodetect.push({
|
|
p: 2,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$f(args, "lab");
|
|
if (type$e(args) === "array" && args.length === 3) {
|
|
return "lab";
|
|
}
|
|
}
|
|
});
|
|
var unpack$e = utils.unpack;
|
|
var RAD2DEG = utils.RAD2DEG;
|
|
var sqrt$3 = Math.sqrt;
|
|
var atan2$2 = Math.atan2;
|
|
var round$2 = Math.round;
|
|
var lab2lch$2 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$e(args, "lab");
|
|
var l = ref[0];
|
|
var a = ref[1];
|
|
var b = ref[2];
|
|
var c = sqrt$3(a * a + b * b);
|
|
var h = (atan2$2(b, a) * RAD2DEG + 360) % 360;
|
|
if (round$2(c * 1e4) === 0) {
|
|
h = Number.NaN;
|
|
}
|
|
return [l, c, h];
|
|
};
|
|
var lab2lch_1 = lab2lch$2;
|
|
var unpack$d = utils.unpack;
|
|
var rgb2lab = rgb2lab_1;
|
|
var lab2lch$1 = lab2lch_1;
|
|
var rgb2lch$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$d(args, "rgb");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
var ref$1 = rgb2lab(r, g, b);
|
|
var l = ref$1[0];
|
|
var a = ref$1[1];
|
|
var b_ = ref$1[2];
|
|
return lab2lch$1(l, a, b_);
|
|
};
|
|
var rgb2lch_1 = rgb2lch$1;
|
|
var unpack$c = utils.unpack;
|
|
var DEG2RAD = utils.DEG2RAD;
|
|
var sin$3 = Math.sin;
|
|
var cos$3 = Math.cos;
|
|
var lch2lab$2 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$c(args, "lch");
|
|
var l = ref[0];
|
|
var c = ref[1];
|
|
var h = ref[2];
|
|
if (isNaN(h)) {
|
|
h = 0;
|
|
}
|
|
h = h * DEG2RAD;
|
|
return [l, cos$3(h) * c, sin$3(h) * c];
|
|
};
|
|
var lch2lab_1 = lch2lab$2;
|
|
var unpack$b = utils.unpack;
|
|
var lch2lab$1 = lch2lab_1;
|
|
var lab2rgb = lab2rgb_1;
|
|
var lch2rgb$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$b(args, "lch");
|
|
var l = args[0];
|
|
var c = args[1];
|
|
var h = args[2];
|
|
var ref = lch2lab$1(l, c, h);
|
|
var L = ref[0];
|
|
var a = ref[1];
|
|
var b_ = ref[2];
|
|
var ref$1 = lab2rgb(L, a, b_);
|
|
var r = ref$1[0];
|
|
var g = ref$1[1];
|
|
var b = ref$1[2];
|
|
return [r, g, b, args.length > 3 ? args[3] : 1];
|
|
};
|
|
var lch2rgb_1 = lch2rgb$1;
|
|
var unpack$a = utils.unpack;
|
|
var lch2rgb = lch2rgb_1;
|
|
var hcl2rgb = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var hcl = unpack$a(args, "hcl").reverse();
|
|
return lch2rgb.apply(void 0, hcl);
|
|
};
|
|
var hcl2rgb_1 = hcl2rgb;
|
|
var unpack$9 = utils.unpack;
|
|
var type$d = utils.type;
|
|
var chroma$a = chroma_1;
|
|
var Color$t = Color_1;
|
|
var input$6 = input$h;
|
|
var rgb2lch = rgb2lch_1;
|
|
Color$t.prototype.lch = function() {
|
|
return rgb2lch(this._rgb);
|
|
};
|
|
Color$t.prototype.hcl = function() {
|
|
return rgb2lch(this._rgb).reverse();
|
|
};
|
|
chroma$a.lch = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$t, [null].concat(args, ["lch"])))();
|
|
};
|
|
chroma$a.hcl = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$t, [null].concat(args, ["hcl"])))();
|
|
};
|
|
input$6.format.lch = lch2rgb_1;
|
|
input$6.format.hcl = hcl2rgb_1;
|
|
["lch", "hcl"].forEach(function(m) {
|
|
return input$6.autodetect.push({
|
|
p: 2,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$9(args, m);
|
|
if (type$d(args) === "array" && args.length === 3) {
|
|
return m;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
var w3cx11$1 = {
|
|
aliceblue: "#f0f8ff",
|
|
antiquewhite: "#faebd7",
|
|
aqua: "#00ffff",
|
|
aquamarine: "#7fffd4",
|
|
azure: "#f0ffff",
|
|
beige: "#f5f5dc",
|
|
bisque: "#ffe4c4",
|
|
black: "#000000",
|
|
blanchedalmond: "#ffebcd",
|
|
blue: "#0000ff",
|
|
blueviolet: "#8a2be2",
|
|
brown: "#a52a2a",
|
|
burlywood: "#deb887",
|
|
cadetblue: "#5f9ea0",
|
|
chartreuse: "#7fff00",
|
|
chocolate: "#d2691e",
|
|
coral: "#ff7f50",
|
|
cornflower: "#6495ed",
|
|
cornflowerblue: "#6495ed",
|
|
cornsilk: "#fff8dc",
|
|
crimson: "#dc143c",
|
|
cyan: "#00ffff",
|
|
darkblue: "#00008b",
|
|
darkcyan: "#008b8b",
|
|
darkgoldenrod: "#b8860b",
|
|
darkgray: "#a9a9a9",
|
|
darkgreen: "#006400",
|
|
darkgrey: "#a9a9a9",
|
|
darkkhaki: "#bdb76b",
|
|
darkmagenta: "#8b008b",
|
|
darkolivegreen: "#556b2f",
|
|
darkorange: "#ff8c00",
|
|
darkorchid: "#9932cc",
|
|
darkred: "#8b0000",
|
|
darksalmon: "#e9967a",
|
|
darkseagreen: "#8fbc8f",
|
|
darkslateblue: "#483d8b",
|
|
darkslategray: "#2f4f4f",
|
|
darkslategrey: "#2f4f4f",
|
|
darkturquoise: "#00ced1",
|
|
darkviolet: "#9400d3",
|
|
deeppink: "#ff1493",
|
|
deepskyblue: "#00bfff",
|
|
dimgray: "#696969",
|
|
dimgrey: "#696969",
|
|
dodgerblue: "#1e90ff",
|
|
firebrick: "#b22222",
|
|
floralwhite: "#fffaf0",
|
|
forestgreen: "#228b22",
|
|
fuchsia: "#ff00ff",
|
|
gainsboro: "#dcdcdc",
|
|
ghostwhite: "#f8f8ff",
|
|
gold: "#ffd700",
|
|
goldenrod: "#daa520",
|
|
gray: "#808080",
|
|
green: "#008000",
|
|
greenyellow: "#adff2f",
|
|
grey: "#808080",
|
|
honeydew: "#f0fff0",
|
|
hotpink: "#ff69b4",
|
|
indianred: "#cd5c5c",
|
|
indigo: "#4b0082",
|
|
ivory: "#fffff0",
|
|
khaki: "#f0e68c",
|
|
laserlemon: "#ffff54",
|
|
lavender: "#e6e6fa",
|
|
lavenderblush: "#fff0f5",
|
|
lawngreen: "#7cfc00",
|
|
lemonchiffon: "#fffacd",
|
|
lightblue: "#add8e6",
|
|
lightcoral: "#f08080",
|
|
lightcyan: "#e0ffff",
|
|
lightgoldenrod: "#fafad2",
|
|
lightgoldenrodyellow: "#fafad2",
|
|
lightgray: "#d3d3d3",
|
|
lightgreen: "#90ee90",
|
|
lightgrey: "#d3d3d3",
|
|
lightpink: "#ffb6c1",
|
|
lightsalmon: "#ffa07a",
|
|
lightseagreen: "#20b2aa",
|
|
lightskyblue: "#87cefa",
|
|
lightslategray: "#778899",
|
|
lightslategrey: "#778899",
|
|
lightsteelblue: "#b0c4de",
|
|
lightyellow: "#ffffe0",
|
|
lime: "#00ff00",
|
|
limegreen: "#32cd32",
|
|
linen: "#faf0e6",
|
|
magenta: "#ff00ff",
|
|
maroon: "#800000",
|
|
maroon2: "#7f0000",
|
|
maroon3: "#b03060",
|
|
mediumaquamarine: "#66cdaa",
|
|
mediumblue: "#0000cd",
|
|
mediumorchid: "#ba55d3",
|
|
mediumpurple: "#9370db",
|
|
mediumseagreen: "#3cb371",
|
|
mediumslateblue: "#7b68ee",
|
|
mediumspringgreen: "#00fa9a",
|
|
mediumturquoise: "#48d1cc",
|
|
mediumvioletred: "#c71585",
|
|
midnightblue: "#191970",
|
|
mintcream: "#f5fffa",
|
|
mistyrose: "#ffe4e1",
|
|
moccasin: "#ffe4b5",
|
|
navajowhite: "#ffdead",
|
|
navy: "#000080",
|
|
oldlace: "#fdf5e6",
|
|
olive: "#808000",
|
|
olivedrab: "#6b8e23",
|
|
orange: "#ffa500",
|
|
orangered: "#ff4500",
|
|
orchid: "#da70d6",
|
|
palegoldenrod: "#eee8aa",
|
|
palegreen: "#98fb98",
|
|
paleturquoise: "#afeeee",
|
|
palevioletred: "#db7093",
|
|
papayawhip: "#ffefd5",
|
|
peachpuff: "#ffdab9",
|
|
peru: "#cd853f",
|
|
pink: "#ffc0cb",
|
|
plum: "#dda0dd",
|
|
powderblue: "#b0e0e6",
|
|
purple: "#800080",
|
|
purple2: "#7f007f",
|
|
purple3: "#a020f0",
|
|
rebeccapurple: "#663399",
|
|
red: "#ff0000",
|
|
rosybrown: "#bc8f8f",
|
|
royalblue: "#4169e1",
|
|
saddlebrown: "#8b4513",
|
|
salmon: "#fa8072",
|
|
sandybrown: "#f4a460",
|
|
seagreen: "#2e8b57",
|
|
seashell: "#fff5ee",
|
|
sienna: "#a0522d",
|
|
silver: "#c0c0c0",
|
|
skyblue: "#87ceeb",
|
|
slateblue: "#6a5acd",
|
|
slategray: "#708090",
|
|
slategrey: "#708090",
|
|
snow: "#fffafa",
|
|
springgreen: "#00ff7f",
|
|
steelblue: "#4682b4",
|
|
tan: "#d2b48c",
|
|
teal: "#008080",
|
|
thistle: "#d8bfd8",
|
|
tomato: "#ff6347",
|
|
turquoise: "#40e0d0",
|
|
violet: "#ee82ee",
|
|
wheat: "#f5deb3",
|
|
white: "#ffffff",
|
|
whitesmoke: "#f5f5f5",
|
|
yellow: "#ffff00",
|
|
yellowgreen: "#9acd32"
|
|
};
|
|
var w3cx11_1 = w3cx11$1;
|
|
var Color$s = Color_1;
|
|
var input$5 = input$h;
|
|
var type$c = utils.type;
|
|
var w3cx11 = w3cx11_1;
|
|
var hex2rgb = hex2rgb_1;
|
|
var rgb2hex = rgb2hex_1;
|
|
Color$s.prototype.name = function() {
|
|
var hex = rgb2hex(this._rgb, "rgb");
|
|
for (var i2 = 0, list2 = Object.keys(w3cx11); i2 < list2.length; i2 += 1) {
|
|
var n = list2[i2];
|
|
if (w3cx11[n] === hex) {
|
|
return n.toLowerCase();
|
|
}
|
|
}
|
|
return hex;
|
|
};
|
|
input$5.format.named = function(name2) {
|
|
name2 = name2.toLowerCase();
|
|
if (w3cx11[name2]) {
|
|
return hex2rgb(w3cx11[name2]);
|
|
}
|
|
throw new Error("unknown color name: " + name2);
|
|
};
|
|
input$5.autodetect.push({
|
|
p: 5,
|
|
test: function(h) {
|
|
var rest = [], len = arguments.length - 1;
|
|
while (len-- > 0)
|
|
rest[len] = arguments[len + 1];
|
|
if (!rest.length && type$c(h) === "string" && w3cx11[h.toLowerCase()]) {
|
|
return "named";
|
|
}
|
|
}
|
|
});
|
|
var unpack$8 = utils.unpack;
|
|
var rgb2num$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$8(args, "rgb");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
return (r << 16) + (g << 8) + b;
|
|
};
|
|
var rgb2num_1 = rgb2num$1;
|
|
var type$b = utils.type;
|
|
var num2rgb = function(num2) {
|
|
if (type$b(num2) == "number" && num2 >= 0 && num2 <= 16777215) {
|
|
var r = num2 >> 16;
|
|
var g = num2 >> 8 & 255;
|
|
var b = num2 & 255;
|
|
return [r, g, b, 1];
|
|
}
|
|
throw new Error("unknown num color: " + num2);
|
|
};
|
|
var num2rgb_1 = num2rgb;
|
|
var chroma$9 = chroma_1;
|
|
var Color$r = Color_1;
|
|
var input$4 = input$h;
|
|
var type$a = utils.type;
|
|
var rgb2num = rgb2num_1;
|
|
Color$r.prototype.num = function() {
|
|
return rgb2num(this._rgb);
|
|
};
|
|
chroma$9.num = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$r, [null].concat(args, ["num"])))();
|
|
};
|
|
input$4.format.num = num2rgb_1;
|
|
input$4.autodetect.push({
|
|
p: 5,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
if (args.length === 1 && type$a(args[0]) === "number" && args[0] >= 0 && args[0] <= 16777215) {
|
|
return "num";
|
|
}
|
|
}
|
|
});
|
|
var chroma$8 = chroma_1;
|
|
var Color$q = Color_1;
|
|
var input$3 = input$h;
|
|
var unpack$7 = utils.unpack;
|
|
var type$9 = utils.type;
|
|
var round$1 = Math.round;
|
|
Color$q.prototype.rgb = function(rnd2) {
|
|
if (rnd2 === void 0)
|
|
rnd2 = true;
|
|
if (rnd2 === false) {
|
|
return this._rgb.slice(0, 3);
|
|
}
|
|
return this._rgb.slice(0, 3).map(round$1);
|
|
};
|
|
Color$q.prototype.rgba = function(rnd2) {
|
|
if (rnd2 === void 0)
|
|
rnd2 = true;
|
|
return this._rgb.slice(0, 4).map(function(v, i2) {
|
|
return i2 < 3 ? rnd2 === false ? v : round$1(v) : v;
|
|
});
|
|
};
|
|
chroma$8.rgb = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$q, [null].concat(args, ["rgb"])))();
|
|
};
|
|
input$3.format.rgb = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var rgba = unpack$7(args, "rgba");
|
|
if (rgba[3] === void 0) {
|
|
rgba[3] = 1;
|
|
}
|
|
return rgba;
|
|
};
|
|
input$3.autodetect.push({
|
|
p: 3,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$7(args, "rgba");
|
|
if (type$9(args) === "array" && (args.length === 3 || args.length === 4 && type$9(args[3]) == "number" && args[3] >= 0 && args[3] <= 1)) {
|
|
return "rgb";
|
|
}
|
|
}
|
|
});
|
|
var log$1 = Math.log;
|
|
var temperature2rgb$1 = function(kelvin) {
|
|
var temp = kelvin / 100;
|
|
var r, g, b;
|
|
if (temp < 66) {
|
|
r = 255;
|
|
g = temp < 6 ? 0 : -155.25485562709179 - 0.44596950469579133 * (g = temp - 2) + 104.49216199393888 * log$1(g);
|
|
b = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b = temp - 10) + 115.67994401066147 * log$1(b);
|
|
} else {
|
|
r = 351.97690566805693 + 0.114206453784165 * (r = temp - 55) - 40.25366309332127 * log$1(r);
|
|
g = 325.4494125711974 + 0.07943456536662342 * (g = temp - 50) - 28.0852963507957 * log$1(g);
|
|
b = 255;
|
|
}
|
|
return [r, g, b, 1];
|
|
};
|
|
var temperature2rgb_1 = temperature2rgb$1;
|
|
var temperature2rgb = temperature2rgb_1;
|
|
var unpack$6 = utils.unpack;
|
|
var round = Math.round;
|
|
var rgb2temperature$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var rgb2 = unpack$6(args, "rgb");
|
|
var r = rgb2[0], b = rgb2[2];
|
|
var minTemp = 1e3;
|
|
var maxTemp = 4e4;
|
|
var eps = 0.4;
|
|
var temp;
|
|
while (maxTemp - minTemp > eps) {
|
|
temp = (maxTemp + minTemp) * 0.5;
|
|
var rgb$1 = temperature2rgb(temp);
|
|
if (rgb$1[2] / rgb$1[0] >= b / r) {
|
|
maxTemp = temp;
|
|
} else {
|
|
minTemp = temp;
|
|
}
|
|
}
|
|
return round(temp);
|
|
};
|
|
var rgb2temperature_1 = rgb2temperature$1;
|
|
var chroma$7 = chroma_1;
|
|
var Color$p = Color_1;
|
|
var input$2 = input$h;
|
|
var rgb2temperature = rgb2temperature_1;
|
|
Color$p.prototype.temp = Color$p.prototype.kelvin = Color$p.prototype.temperature = function() {
|
|
return rgb2temperature(this._rgb);
|
|
};
|
|
chroma$7.temp = chroma$7.kelvin = chroma$7.temperature = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$p, [null].concat(args, ["temp"])))();
|
|
};
|
|
input$2.format.temp = input$2.format.kelvin = input$2.format.temperature = temperature2rgb_1;
|
|
var unpack$5 = utils.unpack;
|
|
var cbrt = Math.cbrt;
|
|
var pow$8 = Math.pow;
|
|
var sign$1 = Math.sign;
|
|
var rgb2oklab$2 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$5(args, "rgb");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
var ref$1 = [rgb2lrgb(r / 255), rgb2lrgb(g / 255), rgb2lrgb(b / 255)];
|
|
var lr = ref$1[0];
|
|
var lg = ref$1[1];
|
|
var lb = ref$1[2];
|
|
var l = cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
var m = cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
var s = cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
return [
|
|
0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
|
|
1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
|
|
0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s
|
|
];
|
|
};
|
|
var rgb2oklab_1 = rgb2oklab$2;
|
|
function rgb2lrgb(c) {
|
|
var abs2 = Math.abs(c);
|
|
if (abs2 < 0.04045) {
|
|
return c / 12.92;
|
|
}
|
|
return (sign$1(c) || 1) * pow$8((abs2 + 0.055) / 1.055, 2.4);
|
|
}
|
|
var unpack$4 = utils.unpack;
|
|
var pow$7 = Math.pow;
|
|
var sign = Math.sign;
|
|
var oklab2rgb$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$4(args, "lab");
|
|
var L = args[0];
|
|
var a = args[1];
|
|
var b = args[2];
|
|
var l = pow$7(L + 0.3963377774 * a + 0.2158037573 * b, 3);
|
|
var m = pow$7(L - 0.1055613458 * a - 0.0638541728 * b, 3);
|
|
var s = pow$7(L - 0.0894841775 * a - 1.291485548 * b, 3);
|
|
return [
|
|
255 * lrgb2rgb(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),
|
|
255 * lrgb2rgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),
|
|
255 * lrgb2rgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),
|
|
args.length > 3 ? args[3] : 1
|
|
];
|
|
};
|
|
var oklab2rgb_1 = oklab2rgb$1;
|
|
function lrgb2rgb(c) {
|
|
var abs2 = Math.abs(c);
|
|
if (abs2 > 31308e-7) {
|
|
return (sign(c) || 1) * (1.055 * pow$7(abs2, 1 / 2.4) - 0.055);
|
|
}
|
|
return c * 12.92;
|
|
}
|
|
var unpack$3 = utils.unpack;
|
|
var type$8 = utils.type;
|
|
var chroma$6 = chroma_1;
|
|
var Color$o = Color_1;
|
|
var input$1 = input$h;
|
|
var rgb2oklab$1 = rgb2oklab_1;
|
|
Color$o.prototype.oklab = function() {
|
|
return rgb2oklab$1(this._rgb);
|
|
};
|
|
chroma$6.oklab = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$o, [null].concat(args, ["oklab"])))();
|
|
};
|
|
input$1.format.oklab = oklab2rgb_1;
|
|
input$1.autodetect.push({
|
|
p: 3,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$3(args, "oklab");
|
|
if (type$8(args) === "array" && args.length === 3) {
|
|
return "oklab";
|
|
}
|
|
}
|
|
});
|
|
var unpack$2 = utils.unpack;
|
|
var rgb2oklab = rgb2oklab_1;
|
|
var lab2lch = lab2lch_1;
|
|
var rgb2oklch$1 = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
var ref = unpack$2(args, "rgb");
|
|
var r = ref[0];
|
|
var g = ref[1];
|
|
var b = ref[2];
|
|
var ref$1 = rgb2oklab(r, g, b);
|
|
var l = ref$1[0];
|
|
var a = ref$1[1];
|
|
var b_ = ref$1[2];
|
|
return lab2lch(l, a, b_);
|
|
};
|
|
var rgb2oklch_1 = rgb2oklch$1;
|
|
var unpack$1 = utils.unpack;
|
|
var lch2lab = lch2lab_1;
|
|
var oklab2rgb = oklab2rgb_1;
|
|
var oklch2rgb = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack$1(args, "lch");
|
|
var l = args[0];
|
|
var c = args[1];
|
|
var h = args[2];
|
|
var ref = lch2lab(l, c, h);
|
|
var L = ref[0];
|
|
var a = ref[1];
|
|
var b_ = ref[2];
|
|
var ref$1 = oklab2rgb(L, a, b_);
|
|
var r = ref$1[0];
|
|
var g = ref$1[1];
|
|
var b = ref$1[2];
|
|
return [r, g, b, args.length > 3 ? args[3] : 1];
|
|
};
|
|
var oklch2rgb_1 = oklch2rgb;
|
|
var unpack = utils.unpack;
|
|
var type$7 = utils.type;
|
|
var chroma$5 = chroma_1;
|
|
var Color$n = Color_1;
|
|
var input = input$h;
|
|
var rgb2oklch = rgb2oklch_1;
|
|
Color$n.prototype.oklch = function() {
|
|
return rgb2oklch(this._rgb);
|
|
};
|
|
chroma$5.oklch = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
return new (Function.prototype.bind.apply(Color$n, [null].concat(args, ["oklch"])))();
|
|
};
|
|
input.format.oklch = oklch2rgb_1;
|
|
input.autodetect.push({
|
|
p: 3,
|
|
test: function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
args = unpack(args, "oklch");
|
|
if (type$7(args) === "array" && args.length === 3) {
|
|
return "oklch";
|
|
}
|
|
}
|
|
});
|
|
var Color$m = Color_1;
|
|
var type$6 = utils.type;
|
|
Color$m.prototype.alpha = function(a, mutate) {
|
|
if (mutate === void 0)
|
|
mutate = false;
|
|
if (a !== void 0 && type$6(a) === "number") {
|
|
if (mutate) {
|
|
this._rgb[3] = a;
|
|
return this;
|
|
}
|
|
return new Color$m([this._rgb[0], this._rgb[1], this._rgb[2], a], "rgb");
|
|
}
|
|
return this._rgb[3];
|
|
};
|
|
var Color$l = Color_1;
|
|
Color$l.prototype.clipped = function() {
|
|
return this._rgb._clipped || false;
|
|
};
|
|
var Color$k = Color_1;
|
|
var LAB_CONSTANTS$1 = labConstants;
|
|
Color$k.prototype.darken = function(amount) {
|
|
if (amount === void 0)
|
|
amount = 1;
|
|
var me = this;
|
|
var lab2 = me.lab();
|
|
lab2[0] -= LAB_CONSTANTS$1.Kn * amount;
|
|
return new Color$k(lab2, "lab").alpha(me.alpha(), true);
|
|
};
|
|
Color$k.prototype.brighten = function(amount) {
|
|
if (amount === void 0)
|
|
amount = 1;
|
|
return this.darken(-amount);
|
|
};
|
|
Color$k.prototype.darker = Color$k.prototype.darken;
|
|
Color$k.prototype.brighter = Color$k.prototype.brighten;
|
|
var Color$j = Color_1;
|
|
Color$j.prototype.get = function(mc) {
|
|
var ref = mc.split(".");
|
|
var mode = ref[0];
|
|
var channel = ref[1];
|
|
var src = this[mode]();
|
|
if (channel) {
|
|
var i2 = mode.indexOf(channel) - (mode.substr(0, 2) === "ok" ? 2 : 0);
|
|
if (i2 > -1) {
|
|
return src[i2];
|
|
}
|
|
throw new Error("unknown channel " + channel + " in mode " + mode);
|
|
} else {
|
|
return src;
|
|
}
|
|
};
|
|
var Color$i = Color_1;
|
|
var type$5 = utils.type;
|
|
var pow$6 = Math.pow;
|
|
var EPS = 1e-7;
|
|
var MAX_ITER = 20;
|
|
Color$i.prototype.luminance = function(lum) {
|
|
if (lum !== void 0 && type$5(lum) === "number") {
|
|
if (lum === 0) {
|
|
return new Color$i([0, 0, 0, this._rgb[3]], "rgb");
|
|
}
|
|
if (lum === 1) {
|
|
return new Color$i([255, 255, 255, this._rgb[3]], "rgb");
|
|
}
|
|
var cur_lum = this.luminance();
|
|
var mode = "rgb";
|
|
var max_iter = MAX_ITER;
|
|
var test = function(low, high) {
|
|
var mid = low.interpolate(high, 0.5, mode);
|
|
var lm = mid.luminance();
|
|
if (Math.abs(lum - lm) < EPS || !max_iter--) {
|
|
return mid;
|
|
}
|
|
return lm > lum ? test(low, mid) : test(mid, high);
|
|
};
|
|
var rgb2 = (cur_lum > lum ? test(new Color$i([0, 0, 0]), this) : test(this, new Color$i([255, 255, 255]))).rgb();
|
|
return new Color$i(rgb2.concat([this._rgb[3]]));
|
|
}
|
|
return rgb2luminance.apply(void 0, this._rgb.slice(0, 3));
|
|
};
|
|
var rgb2luminance = function(r, g, b) {
|
|
r = luminance_x(r);
|
|
g = luminance_x(g);
|
|
b = luminance_x(b);
|
|
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
};
|
|
var luminance_x = function(x) {
|
|
x /= 255;
|
|
return x <= 0.03928 ? x / 12.92 : pow$6((x + 0.055) / 1.055, 2.4);
|
|
};
|
|
var interpolator$1 = {};
|
|
var Color$h = Color_1;
|
|
var type$4 = utils.type;
|
|
var interpolator = interpolator$1;
|
|
var mix$1 = function(col1, col2, f) {
|
|
if (f === void 0)
|
|
f = 0.5;
|
|
var rest = [], len = arguments.length - 3;
|
|
while (len-- > 0)
|
|
rest[len] = arguments[len + 3];
|
|
var mode = rest[0] || "lrgb";
|
|
if (!interpolator[mode] && !rest.length) {
|
|
mode = Object.keys(interpolator)[0];
|
|
}
|
|
if (!interpolator[mode]) {
|
|
throw new Error("interpolation mode " + mode + " is not defined");
|
|
}
|
|
if (type$4(col1) !== "object") {
|
|
col1 = new Color$h(col1);
|
|
}
|
|
if (type$4(col2) !== "object") {
|
|
col2 = new Color$h(col2);
|
|
}
|
|
return interpolator[mode](col1, col2, f).alpha(col1.alpha() + f * (col2.alpha() - col1.alpha()));
|
|
};
|
|
var Color$g = Color_1;
|
|
var mix = mix$1;
|
|
Color$g.prototype.mix = Color$g.prototype.interpolate = function(col2, f) {
|
|
if (f === void 0)
|
|
f = 0.5;
|
|
var rest = [], len = arguments.length - 2;
|
|
while (len-- > 0)
|
|
rest[len] = arguments[len + 2];
|
|
return mix.apply(void 0, [this, col2, f].concat(rest));
|
|
};
|
|
var Color$f = Color_1;
|
|
Color$f.prototype.premultiply = function(mutate) {
|
|
if (mutate === void 0)
|
|
mutate = false;
|
|
var rgb2 = this._rgb;
|
|
var a = rgb2[3];
|
|
if (mutate) {
|
|
this._rgb = [rgb2[0] * a, rgb2[1] * a, rgb2[2] * a, a];
|
|
return this;
|
|
} else {
|
|
return new Color$f([rgb2[0] * a, rgb2[1] * a, rgb2[2] * a, a], "rgb");
|
|
}
|
|
};
|
|
var Color$e = Color_1;
|
|
var LAB_CONSTANTS = labConstants;
|
|
Color$e.prototype.saturate = function(amount) {
|
|
if (amount === void 0)
|
|
amount = 1;
|
|
var me = this;
|
|
var lch2 = me.lch();
|
|
lch2[1] += LAB_CONSTANTS.Kn * amount;
|
|
if (lch2[1] < 0) {
|
|
lch2[1] = 0;
|
|
}
|
|
return new Color$e(lch2, "lch").alpha(me.alpha(), true);
|
|
};
|
|
Color$e.prototype.desaturate = function(amount) {
|
|
if (amount === void 0)
|
|
amount = 1;
|
|
return this.saturate(-amount);
|
|
};
|
|
var Color$d = Color_1;
|
|
var type$3 = utils.type;
|
|
Color$d.prototype.set = function(mc, value, mutate) {
|
|
if (mutate === void 0)
|
|
mutate = false;
|
|
var ref = mc.split(".");
|
|
var mode = ref[0];
|
|
var channel = ref[1];
|
|
var src = this[mode]();
|
|
if (channel) {
|
|
var i2 = mode.indexOf(channel) - (mode.substr(0, 2) === "ok" ? 2 : 0);
|
|
if (i2 > -1) {
|
|
if (type$3(value) == "string") {
|
|
switch (value.charAt(0)) {
|
|
case "+":
|
|
src[i2] += +value;
|
|
break;
|
|
case "-":
|
|
src[i2] += +value;
|
|
break;
|
|
case "*":
|
|
src[i2] *= +value.substr(1);
|
|
break;
|
|
case "/":
|
|
src[i2] /= +value.substr(1);
|
|
break;
|
|
default:
|
|
src[i2] = +value;
|
|
}
|
|
} else if (type$3(value) === "number") {
|
|
src[i2] = value;
|
|
} else {
|
|
throw new Error("unsupported value for Color.set");
|
|
}
|
|
var out = new Color$d(src, mode);
|
|
if (mutate) {
|
|
this._rgb = out._rgb;
|
|
return this;
|
|
}
|
|
return out;
|
|
}
|
|
throw new Error("unknown channel " + channel + " in mode " + mode);
|
|
} else {
|
|
return src;
|
|
}
|
|
};
|
|
var Color$c = Color_1;
|
|
var rgb = function(col1, col2, f) {
|
|
var xyz0 = col1._rgb;
|
|
var xyz1 = col2._rgb;
|
|
return new Color$c(
|
|
xyz0[0] + f * (xyz1[0] - xyz0[0]),
|
|
xyz0[1] + f * (xyz1[1] - xyz0[1]),
|
|
xyz0[2] + f * (xyz1[2] - xyz0[2]),
|
|
"rgb"
|
|
);
|
|
};
|
|
interpolator$1.rgb = rgb;
|
|
var Color$b = Color_1;
|
|
var sqrt$2 = Math.sqrt;
|
|
var pow$5 = Math.pow;
|
|
var lrgb = function(col1, col2, f) {
|
|
var ref = col1._rgb;
|
|
var x1 = ref[0];
|
|
var y1 = ref[1];
|
|
var z1 = ref[2];
|
|
var ref$1 = col2._rgb;
|
|
var x2 = ref$1[0];
|
|
var y2 = ref$1[1];
|
|
var z2 = ref$1[2];
|
|
return new Color$b(
|
|
sqrt$2(pow$5(x1, 2) * (1 - f) + pow$5(x2, 2) * f),
|
|
sqrt$2(pow$5(y1, 2) * (1 - f) + pow$5(y2, 2) * f),
|
|
sqrt$2(pow$5(z1, 2) * (1 - f) + pow$5(z2, 2) * f),
|
|
"rgb"
|
|
);
|
|
};
|
|
interpolator$1.lrgb = lrgb;
|
|
var Color$a = Color_1;
|
|
var lab = function(col1, col2, f) {
|
|
var xyz0 = col1.lab();
|
|
var xyz1 = col2.lab();
|
|
return new Color$a(
|
|
xyz0[0] + f * (xyz1[0] - xyz0[0]),
|
|
xyz0[1] + f * (xyz1[1] - xyz0[1]),
|
|
xyz0[2] + f * (xyz1[2] - xyz0[2]),
|
|
"lab"
|
|
);
|
|
};
|
|
interpolator$1.lab = lab;
|
|
var Color$9 = Color_1;
|
|
var _hsx = function(col1, col2, f, m) {
|
|
var assign2, assign$1;
|
|
var xyz0, xyz1;
|
|
if (m === "hsl") {
|
|
xyz0 = col1.hsl();
|
|
xyz1 = col2.hsl();
|
|
} else if (m === "hsv") {
|
|
xyz0 = col1.hsv();
|
|
xyz1 = col2.hsv();
|
|
} else if (m === "hcg") {
|
|
xyz0 = col1.hcg();
|
|
xyz1 = col2.hcg();
|
|
} else if (m === "hsi") {
|
|
xyz0 = col1.hsi();
|
|
xyz1 = col2.hsi();
|
|
} else if (m === "lch" || m === "hcl") {
|
|
m = "hcl";
|
|
xyz0 = col1.hcl();
|
|
xyz1 = col2.hcl();
|
|
} else if (m === "oklch") {
|
|
xyz0 = col1.oklch().reverse();
|
|
xyz1 = col2.oklch().reverse();
|
|
}
|
|
var hue0, hue1, sat0, sat1, lbv0, lbv1;
|
|
if (m.substr(0, 1) === "h" || m === "oklch") {
|
|
assign2 = xyz0, hue0 = assign2[0], sat0 = assign2[1], lbv0 = assign2[2];
|
|
assign$1 = xyz1, hue1 = assign$1[0], sat1 = assign$1[1], lbv1 = assign$1[2];
|
|
}
|
|
var sat, hue, lbv, dh;
|
|
if (!isNaN(hue0) && !isNaN(hue1)) {
|
|
if (hue1 > hue0 && hue1 - hue0 > 180) {
|
|
dh = hue1 - (hue0 + 360);
|
|
} else if (hue1 < hue0 && hue0 - hue1 > 180) {
|
|
dh = hue1 + 360 - hue0;
|
|
} else {
|
|
dh = hue1 - hue0;
|
|
}
|
|
hue = hue0 + f * dh;
|
|
} else if (!isNaN(hue0)) {
|
|
hue = hue0;
|
|
if ((lbv1 == 1 || lbv1 == 0) && m != "hsv") {
|
|
sat = sat0;
|
|
}
|
|
} else if (!isNaN(hue1)) {
|
|
hue = hue1;
|
|
if ((lbv0 == 1 || lbv0 == 0) && m != "hsv") {
|
|
sat = sat1;
|
|
}
|
|
} else {
|
|
hue = Number.NaN;
|
|
}
|
|
if (sat === void 0) {
|
|
sat = sat0 + f * (sat1 - sat0);
|
|
}
|
|
lbv = lbv0 + f * (lbv1 - lbv0);
|
|
return m === "oklch" ? new Color$9([lbv, sat, hue], m) : new Color$9([hue, sat, lbv], m);
|
|
};
|
|
var interpolate_hsx$5 = _hsx;
|
|
var lch = function(col1, col2, f) {
|
|
return interpolate_hsx$5(col1, col2, f, "lch");
|
|
};
|
|
interpolator$1.lch = lch;
|
|
interpolator$1.hcl = lch;
|
|
var Color$8 = Color_1;
|
|
var num = function(col1, col2, f) {
|
|
var c1 = col1.num();
|
|
var c2 = col2.num();
|
|
return new Color$8(c1 + f * (c2 - c1), "num");
|
|
};
|
|
interpolator$1.num = num;
|
|
var interpolate_hsx$4 = _hsx;
|
|
var hcg = function(col1, col2, f) {
|
|
return interpolate_hsx$4(col1, col2, f, "hcg");
|
|
};
|
|
interpolator$1.hcg = hcg;
|
|
var interpolate_hsx$3 = _hsx;
|
|
var hsi = function(col1, col2, f) {
|
|
return interpolate_hsx$3(col1, col2, f, "hsi");
|
|
};
|
|
interpolator$1.hsi = hsi;
|
|
var interpolate_hsx$2 = _hsx;
|
|
var hsl = function(col1, col2, f) {
|
|
return interpolate_hsx$2(col1, col2, f, "hsl");
|
|
};
|
|
interpolator$1.hsl = hsl;
|
|
var interpolate_hsx$1 = _hsx;
|
|
var hsv = function(col1, col2, f) {
|
|
return interpolate_hsx$1(col1, col2, f, "hsv");
|
|
};
|
|
interpolator$1.hsv = hsv;
|
|
var Color$7 = Color_1;
|
|
var oklab = function(col1, col2, f) {
|
|
var xyz0 = col1.oklab();
|
|
var xyz1 = col2.oklab();
|
|
return new Color$7(
|
|
xyz0[0] + f * (xyz1[0] - xyz0[0]),
|
|
xyz0[1] + f * (xyz1[1] - xyz0[1]),
|
|
xyz0[2] + f * (xyz1[2] - xyz0[2]),
|
|
"oklab"
|
|
);
|
|
};
|
|
interpolator$1.oklab = oklab;
|
|
var interpolate_hsx = _hsx;
|
|
var oklch = function(col1, col2, f) {
|
|
return interpolate_hsx(col1, col2, f, "oklch");
|
|
};
|
|
interpolator$1.oklch = oklch;
|
|
var Color$6 = Color_1;
|
|
var clip_rgb$1 = utils.clip_rgb;
|
|
var pow$4 = Math.pow;
|
|
var sqrt$1 = Math.sqrt;
|
|
var PI$1 = Math.PI;
|
|
var cos$2 = Math.cos;
|
|
var sin$2 = Math.sin;
|
|
var atan2$1 = Math.atan2;
|
|
var average = function(colors, mode, weights) {
|
|
if (mode === void 0)
|
|
mode = "lrgb";
|
|
if (weights === void 0)
|
|
weights = null;
|
|
var l = colors.length;
|
|
if (!weights) {
|
|
weights = Array.from(new Array(l)).map(function() {
|
|
return 1;
|
|
});
|
|
}
|
|
var k = l / weights.reduce(function(a, b) {
|
|
return a + b;
|
|
});
|
|
weights.forEach(function(w, i3) {
|
|
weights[i3] *= k;
|
|
});
|
|
colors = colors.map(function(c) {
|
|
return new Color$6(c);
|
|
});
|
|
if (mode === "lrgb") {
|
|
return _average_lrgb(colors, weights);
|
|
}
|
|
var first = colors.shift();
|
|
var xyz = first.get(mode);
|
|
var cnt = [];
|
|
var dx = 0;
|
|
var dy = 0;
|
|
for (var i2 = 0; i2 < xyz.length; i2++) {
|
|
xyz[i2] = (xyz[i2] || 0) * weights[0];
|
|
cnt.push(isNaN(xyz[i2]) ? 0 : weights[0]);
|
|
if (mode.charAt(i2) === "h" && !isNaN(xyz[i2])) {
|
|
var A = xyz[i2] / 180 * PI$1;
|
|
dx += cos$2(A) * weights[0];
|
|
dy += sin$2(A) * weights[0];
|
|
}
|
|
}
|
|
var alpha = first.alpha() * weights[0];
|
|
colors.forEach(function(c, ci) {
|
|
var xyz2 = c.get(mode);
|
|
alpha += c.alpha() * weights[ci + 1];
|
|
for (var i3 = 0; i3 < xyz.length; i3++) {
|
|
if (!isNaN(xyz2[i3])) {
|
|
cnt[i3] += weights[ci + 1];
|
|
if (mode.charAt(i3) === "h") {
|
|
var A2 = xyz2[i3] / 180 * PI$1;
|
|
dx += cos$2(A2) * weights[ci + 1];
|
|
dy += sin$2(A2) * weights[ci + 1];
|
|
} else {
|
|
xyz[i3] += xyz2[i3] * weights[ci + 1];
|
|
}
|
|
}
|
|
}
|
|
});
|
|
for (var i$12 = 0; i$12 < xyz.length; i$12++) {
|
|
if (mode.charAt(i$12) === "h") {
|
|
var A$1 = atan2$1(dy / cnt[i$12], dx / cnt[i$12]) / PI$1 * 180;
|
|
while (A$1 < 0) {
|
|
A$1 += 360;
|
|
}
|
|
while (A$1 >= 360) {
|
|
A$1 -= 360;
|
|
}
|
|
xyz[i$12] = A$1;
|
|
} else {
|
|
xyz[i$12] = xyz[i$12] / cnt[i$12];
|
|
}
|
|
}
|
|
alpha /= l;
|
|
return new Color$6(xyz, mode).alpha(alpha > 0.99999 ? 1 : alpha, true);
|
|
};
|
|
var _average_lrgb = function(colors, weights) {
|
|
var l = colors.length;
|
|
var xyz = [0, 0, 0, 0];
|
|
for (var i2 = 0; i2 < colors.length; i2++) {
|
|
var col = colors[i2];
|
|
var f = weights[i2] / l;
|
|
var rgb2 = col._rgb;
|
|
xyz[0] += pow$4(rgb2[0], 2) * f;
|
|
xyz[1] += pow$4(rgb2[1], 2) * f;
|
|
xyz[2] += pow$4(rgb2[2], 2) * f;
|
|
xyz[3] += rgb2[3] * f;
|
|
}
|
|
xyz[0] = sqrt$1(xyz[0]);
|
|
xyz[1] = sqrt$1(xyz[1]);
|
|
xyz[2] = sqrt$1(xyz[2]);
|
|
if (xyz[3] > 0.9999999) {
|
|
xyz[3] = 1;
|
|
}
|
|
return new Color$6(clip_rgb$1(xyz));
|
|
};
|
|
var chroma$4 = chroma_1;
|
|
var type$2 = utils.type;
|
|
var pow$3 = Math.pow;
|
|
var scale$2 = function(colors) {
|
|
var _mode = "rgb";
|
|
var _nacol = chroma$4("#ccc");
|
|
var _spread = 0;
|
|
var _domain = [0, 1];
|
|
var _pos = [];
|
|
var _padding = [0, 0];
|
|
var _classes = false;
|
|
var _colors = [];
|
|
var _out = false;
|
|
var _min = 0;
|
|
var _max = 1;
|
|
var _correctLightness = false;
|
|
var _colorCache = {};
|
|
var _useCache = true;
|
|
var _gamma = 1;
|
|
var setColors = function(colors2) {
|
|
colors2 = colors2 || ["#fff", "#000"];
|
|
if (colors2 && type$2(colors2) === "string" && chroma$4.brewer && chroma$4.brewer[colors2.toLowerCase()]) {
|
|
colors2 = chroma$4.brewer[colors2.toLowerCase()];
|
|
}
|
|
if (type$2(colors2) === "array") {
|
|
if (colors2.length === 1) {
|
|
colors2 = [colors2[0], colors2[0]];
|
|
}
|
|
colors2 = colors2.slice(0);
|
|
for (var c = 0; c < colors2.length; c++) {
|
|
colors2[c] = chroma$4(colors2[c]);
|
|
}
|
|
_pos.length = 0;
|
|
for (var c$1 = 0; c$1 < colors2.length; c$1++) {
|
|
_pos.push(c$1 / (colors2.length - 1));
|
|
}
|
|
}
|
|
resetCache();
|
|
return _colors = colors2;
|
|
};
|
|
var getClass = function(value) {
|
|
if (_classes != null) {
|
|
var n = _classes.length - 1;
|
|
var i2 = 0;
|
|
while (i2 < n && value >= _classes[i2]) {
|
|
i2++;
|
|
}
|
|
return i2 - 1;
|
|
}
|
|
return 0;
|
|
};
|
|
var tMapLightness = function(t) {
|
|
return t;
|
|
};
|
|
var tMapDomain = function(t) {
|
|
return t;
|
|
};
|
|
var getColor = function(val, bypassMap) {
|
|
var col, t;
|
|
if (bypassMap == null) {
|
|
bypassMap = false;
|
|
}
|
|
if (isNaN(val) || val === null) {
|
|
return _nacol;
|
|
}
|
|
if (!bypassMap) {
|
|
if (_classes && _classes.length > 2) {
|
|
var c = getClass(val);
|
|
t = c / (_classes.length - 2);
|
|
} else if (_max !== _min) {
|
|
t = (val - _min) / (_max - _min);
|
|
} else {
|
|
t = 1;
|
|
}
|
|
} else {
|
|
t = val;
|
|
}
|
|
t = tMapDomain(t);
|
|
if (!bypassMap) {
|
|
t = tMapLightness(t);
|
|
}
|
|
if (_gamma !== 1) {
|
|
t = pow$3(t, _gamma);
|
|
}
|
|
t = _padding[0] + t * (1 - _padding[0] - _padding[1]);
|
|
t = Math.min(1, Math.max(0, t));
|
|
var k = Math.floor(t * 1e4);
|
|
if (_useCache && _colorCache[k]) {
|
|
col = _colorCache[k];
|
|
} else {
|
|
if (type$2(_colors) === "array") {
|
|
for (var i2 = 0; i2 < _pos.length; i2++) {
|
|
var p = _pos[i2];
|
|
if (t <= p) {
|
|
col = _colors[i2];
|
|
break;
|
|
}
|
|
if (t >= p && i2 === _pos.length - 1) {
|
|
col = _colors[i2];
|
|
break;
|
|
}
|
|
if (t > p && t < _pos[i2 + 1]) {
|
|
t = (t - p) / (_pos[i2 + 1] - p);
|
|
col = chroma$4.interpolate(_colors[i2], _colors[i2 + 1], t, _mode);
|
|
break;
|
|
}
|
|
}
|
|
} else if (type$2(_colors) === "function") {
|
|
col = _colors(t);
|
|
}
|
|
if (_useCache) {
|
|
_colorCache[k] = col;
|
|
}
|
|
}
|
|
return col;
|
|
};
|
|
var resetCache = function() {
|
|
return _colorCache = {};
|
|
};
|
|
setColors(colors);
|
|
var f = function(v) {
|
|
var c = chroma$4(getColor(v));
|
|
if (_out && c[_out]) {
|
|
return c[_out]();
|
|
} else {
|
|
return c;
|
|
}
|
|
};
|
|
f.classes = function(classes) {
|
|
if (classes != null) {
|
|
if (type$2(classes) === "array") {
|
|
_classes = classes;
|
|
_domain = [classes[0], classes[classes.length - 1]];
|
|
} else {
|
|
var d = chroma$4.analyze(_domain);
|
|
if (classes === 0) {
|
|
_classes = [d.min, d.max];
|
|
} else {
|
|
_classes = chroma$4.limits(d, "e", classes);
|
|
}
|
|
}
|
|
return f;
|
|
}
|
|
return _classes;
|
|
};
|
|
f.domain = function(domain) {
|
|
if (!arguments.length) {
|
|
return _domain;
|
|
}
|
|
_min = domain[0];
|
|
_max = domain[domain.length - 1];
|
|
_pos = [];
|
|
var k = _colors.length;
|
|
if (domain.length === k && _min !== _max) {
|
|
for (var i2 = 0, list2 = Array.from(domain); i2 < list2.length; i2 += 1) {
|
|
var d = list2[i2];
|
|
_pos.push((d - _min) / (_max - _min));
|
|
}
|
|
} else {
|
|
for (var c = 0; c < k; c++) {
|
|
_pos.push(c / (k - 1));
|
|
}
|
|
if (domain.length > 2) {
|
|
var tOut = domain.map(function(d2, i3) {
|
|
return i3 / (domain.length - 1);
|
|
});
|
|
var tBreaks = domain.map(function(d2) {
|
|
return (d2 - _min) / (_max - _min);
|
|
});
|
|
if (!tBreaks.every(function(val, i3) {
|
|
return tOut[i3] === val;
|
|
})) {
|
|
tMapDomain = function(t) {
|
|
if (t <= 0 || t >= 1) {
|
|
return t;
|
|
}
|
|
var i3 = 0;
|
|
while (t >= tBreaks[i3 + 1]) {
|
|
i3++;
|
|
}
|
|
var f2 = (t - tBreaks[i3]) / (tBreaks[i3 + 1] - tBreaks[i3]);
|
|
var out = tOut[i3] + f2 * (tOut[i3 + 1] - tOut[i3]);
|
|
return out;
|
|
};
|
|
}
|
|
}
|
|
}
|
|
_domain = [_min, _max];
|
|
return f;
|
|
};
|
|
f.mode = function(_m) {
|
|
if (!arguments.length) {
|
|
return _mode;
|
|
}
|
|
_mode = _m;
|
|
resetCache();
|
|
return f;
|
|
};
|
|
f.range = function(colors2, _pos2) {
|
|
setColors(colors2);
|
|
return f;
|
|
};
|
|
f.out = function(_o) {
|
|
_out = _o;
|
|
return f;
|
|
};
|
|
f.spread = function(val) {
|
|
if (!arguments.length) {
|
|
return _spread;
|
|
}
|
|
_spread = val;
|
|
return f;
|
|
};
|
|
f.correctLightness = function(v) {
|
|
if (v == null) {
|
|
v = true;
|
|
}
|
|
_correctLightness = v;
|
|
resetCache();
|
|
if (_correctLightness) {
|
|
tMapLightness = function(t) {
|
|
var L0 = getColor(0, true).lab()[0];
|
|
var L1 = getColor(1, true).lab()[0];
|
|
var pol = L0 > L1;
|
|
var L_actual = getColor(t, true).lab()[0];
|
|
var L_ideal = L0 + (L1 - L0) * t;
|
|
var L_diff = L_actual - L_ideal;
|
|
var t0 = 0;
|
|
var t1 = 1;
|
|
var max_iter = 20;
|
|
while (Math.abs(L_diff) > 0.01 && max_iter-- > 0) {
|
|
(function() {
|
|
if (pol) {
|
|
L_diff *= -1;
|
|
}
|
|
if (L_diff < 0) {
|
|
t0 = t;
|
|
t += (t1 - t) * 0.5;
|
|
} else {
|
|
t1 = t;
|
|
t += (t0 - t) * 0.5;
|
|
}
|
|
L_actual = getColor(t, true).lab()[0];
|
|
return L_diff = L_actual - L_ideal;
|
|
})();
|
|
}
|
|
return t;
|
|
};
|
|
} else {
|
|
tMapLightness = function(t) {
|
|
return t;
|
|
};
|
|
}
|
|
return f;
|
|
};
|
|
f.padding = function(p) {
|
|
if (p != null) {
|
|
if (type$2(p) === "number") {
|
|
p = [p, p];
|
|
}
|
|
_padding = p;
|
|
return f;
|
|
} else {
|
|
return _padding;
|
|
}
|
|
};
|
|
f.colors = function(numColors, out) {
|
|
if (arguments.length < 2) {
|
|
out = "hex";
|
|
}
|
|
var result = [];
|
|
if (arguments.length === 0) {
|
|
result = _colors.slice(0);
|
|
} else if (numColors === 1) {
|
|
result = [f(0.5)];
|
|
} else if (numColors > 1) {
|
|
var dm = _domain[0];
|
|
var dd = _domain[1] - dm;
|
|
result = __range__(0, numColors, false).map(function(i3) {
|
|
return f(dm + i3 / (numColors - 1) * dd);
|
|
});
|
|
} else {
|
|
colors = [];
|
|
var samples = [];
|
|
if (_classes && _classes.length > 2) {
|
|
for (var i2 = 1, end = _classes.length, asc = 1 <= end; asc ? i2 < end : i2 > end; asc ? i2++ : i2--) {
|
|
samples.push((_classes[i2 - 1] + _classes[i2]) * 0.5);
|
|
}
|
|
} else {
|
|
samples = _domain;
|
|
}
|
|
result = samples.map(function(v) {
|
|
return f(v);
|
|
});
|
|
}
|
|
if (chroma$4[out]) {
|
|
result = result.map(function(c) {
|
|
return c[out]();
|
|
});
|
|
}
|
|
return result;
|
|
};
|
|
f.cache = function(c) {
|
|
if (c != null) {
|
|
_useCache = c;
|
|
return f;
|
|
} else {
|
|
return _useCache;
|
|
}
|
|
};
|
|
f.gamma = function(g) {
|
|
if (g != null) {
|
|
_gamma = g;
|
|
return f;
|
|
} else {
|
|
return _gamma;
|
|
}
|
|
};
|
|
f.nodata = function(d) {
|
|
if (d != null) {
|
|
_nacol = chroma$4(d);
|
|
return f;
|
|
} else {
|
|
return _nacol;
|
|
}
|
|
};
|
|
return f;
|
|
};
|
|
function __range__(left, right, inclusive) {
|
|
var range3 = [];
|
|
var ascending = left < right;
|
|
var end = !inclusive ? right : ascending ? right + 1 : right - 1;
|
|
for (var i2 = left; ascending ? i2 < end : i2 > end; ascending ? i2++ : i2--) {
|
|
range3.push(i2);
|
|
}
|
|
return range3;
|
|
}
|
|
var Color$5 = Color_1;
|
|
var scale$1 = scale$2;
|
|
var binom_row = function(n) {
|
|
var row = [1, 1];
|
|
for (var i2 = 1; i2 < n; i2++) {
|
|
var newrow = [1];
|
|
for (var j = 1; j <= row.length; j++) {
|
|
newrow[j] = (row[j] || 0) + row[j - 1];
|
|
}
|
|
row = newrow;
|
|
}
|
|
return row;
|
|
};
|
|
var bezier = function(colors) {
|
|
var assign2, assign$1, assign$2;
|
|
var I, lab0, lab1, lab2;
|
|
colors = colors.map(function(c) {
|
|
return new Color$5(c);
|
|
});
|
|
if (colors.length === 2) {
|
|
assign2 = colors.map(function(c) {
|
|
return c.lab();
|
|
}), lab0 = assign2[0], lab1 = assign2[1];
|
|
I = function(t) {
|
|
var lab4 = [0, 1, 2].map(function(i2) {
|
|
return lab0[i2] + t * (lab1[i2] - lab0[i2]);
|
|
});
|
|
return new Color$5(lab4, "lab");
|
|
};
|
|
} else if (colors.length === 3) {
|
|
assign$1 = colors.map(function(c) {
|
|
return c.lab();
|
|
}), lab0 = assign$1[0], lab1 = assign$1[1], lab2 = assign$1[2];
|
|
I = function(t) {
|
|
var lab4 = [0, 1, 2].map(function(i2) {
|
|
return (1 - t) * (1 - t) * lab0[i2] + 2 * (1 - t) * t * lab1[i2] + t * t * lab2[i2];
|
|
});
|
|
return new Color$5(lab4, "lab");
|
|
};
|
|
} else if (colors.length === 4) {
|
|
var lab3;
|
|
assign$2 = colors.map(function(c) {
|
|
return c.lab();
|
|
}), lab0 = assign$2[0], lab1 = assign$2[1], lab2 = assign$2[2], lab3 = assign$2[3];
|
|
I = function(t) {
|
|
var lab4 = [0, 1, 2].map(function(i2) {
|
|
return (1 - t) * (1 - t) * (1 - t) * lab0[i2] + 3 * (1 - t) * (1 - t) * t * lab1[i2] + 3 * (1 - t) * t * t * lab2[i2] + t * t * t * lab3[i2];
|
|
});
|
|
return new Color$5(lab4, "lab");
|
|
};
|
|
} else if (colors.length >= 5) {
|
|
var labs, row, n;
|
|
labs = colors.map(function(c) {
|
|
return c.lab();
|
|
});
|
|
n = colors.length - 1;
|
|
row = binom_row(n);
|
|
I = function(t) {
|
|
var u = 1 - t;
|
|
var lab4 = [0, 1, 2].map(function(i2) {
|
|
return labs.reduce(function(sum, el, j) {
|
|
return sum + row[j] * Math.pow(u, n - j) * Math.pow(t, j) * el[i2];
|
|
}, 0);
|
|
});
|
|
return new Color$5(lab4, "lab");
|
|
};
|
|
} else {
|
|
throw new RangeError("No point in running bezier with only one color.");
|
|
}
|
|
return I;
|
|
};
|
|
var bezier_1 = function(colors) {
|
|
var f = bezier(colors);
|
|
f.scale = function() {
|
|
return scale$1(f);
|
|
};
|
|
return f;
|
|
};
|
|
var chroma$3 = chroma_1;
|
|
var blend = function(bottom, top, mode) {
|
|
if (!blend[mode]) {
|
|
throw new Error("unknown blend mode " + mode);
|
|
}
|
|
return blend[mode](bottom, top);
|
|
};
|
|
var blend_f = function(f) {
|
|
return function(bottom, top) {
|
|
var c0 = chroma$3(top).rgb();
|
|
var c1 = chroma$3(bottom).rgb();
|
|
return chroma$3.rgb(f(c0, c1));
|
|
};
|
|
};
|
|
var each = function(f) {
|
|
return function(c0, c1) {
|
|
var out = [];
|
|
out[0] = f(c0[0], c1[0]);
|
|
out[1] = f(c0[1], c1[1]);
|
|
out[2] = f(c0[2], c1[2]);
|
|
return out;
|
|
};
|
|
};
|
|
var normal = function(a) {
|
|
return a;
|
|
};
|
|
var multiply = function(a, b) {
|
|
return a * b / 255;
|
|
};
|
|
var darken = function(a, b) {
|
|
return a > b ? b : a;
|
|
};
|
|
var lighten = function(a, b) {
|
|
return a > b ? a : b;
|
|
};
|
|
var screen = function(a, b) {
|
|
return 255 * (1 - (1 - a / 255) * (1 - b / 255));
|
|
};
|
|
var overlay = function(a, b) {
|
|
return b < 128 ? 2 * a * b / 255 : 255 * (1 - 2 * (1 - a / 255) * (1 - b / 255));
|
|
};
|
|
var burn = function(a, b) {
|
|
return 255 * (1 - (1 - b / 255) / (a / 255));
|
|
};
|
|
var dodge = function(a, b) {
|
|
if (a === 255) {
|
|
return 255;
|
|
}
|
|
a = 255 * (b / 255) / (1 - a / 255);
|
|
return a > 255 ? 255 : a;
|
|
};
|
|
blend.normal = blend_f(each(normal));
|
|
blend.multiply = blend_f(each(multiply));
|
|
blend.screen = blend_f(each(screen));
|
|
blend.overlay = blend_f(each(overlay));
|
|
blend.darken = blend_f(each(darken));
|
|
blend.lighten = blend_f(each(lighten));
|
|
blend.dodge = blend_f(each(dodge));
|
|
blend.burn = blend_f(each(burn));
|
|
var blend_1 = blend;
|
|
var type$1 = utils.type;
|
|
var clip_rgb = utils.clip_rgb;
|
|
var TWOPI = utils.TWOPI;
|
|
var pow$2 = Math.pow;
|
|
var sin$1 = Math.sin;
|
|
var cos$1 = Math.cos;
|
|
var chroma$2 = chroma_1;
|
|
var cubehelix = function(start, rotations, hue, gamma, lightness) {
|
|
if (start === void 0)
|
|
start = 300;
|
|
if (rotations === void 0)
|
|
rotations = -1.5;
|
|
if (hue === void 0)
|
|
hue = 1;
|
|
if (gamma === void 0)
|
|
gamma = 1;
|
|
if (lightness === void 0)
|
|
lightness = [0, 1];
|
|
var dh = 0, dl;
|
|
if (type$1(lightness) === "array") {
|
|
dl = lightness[1] - lightness[0];
|
|
} else {
|
|
dl = 0;
|
|
lightness = [lightness, lightness];
|
|
}
|
|
var f = function(fract) {
|
|
var a = TWOPI * ((start + 120) / 360 + rotations * fract);
|
|
var l = pow$2(lightness[0] + dl * fract, gamma);
|
|
var h = dh !== 0 ? hue[0] + fract * dh : hue;
|
|
var amp = h * l * (1 - l) / 2;
|
|
var cos_a = cos$1(a);
|
|
var sin_a = sin$1(a);
|
|
var r = l + amp * (-0.14861 * cos_a + 1.78277 * sin_a);
|
|
var g = l + amp * (-0.29227 * cos_a - 0.90649 * sin_a);
|
|
var b = l + amp * (1.97294 * cos_a);
|
|
return chroma$2(clip_rgb([r * 255, g * 255, b * 255, 1]));
|
|
};
|
|
f.start = function(s) {
|
|
if (s == null) {
|
|
return start;
|
|
}
|
|
start = s;
|
|
return f;
|
|
};
|
|
f.rotations = function(r) {
|
|
if (r == null) {
|
|
return rotations;
|
|
}
|
|
rotations = r;
|
|
return f;
|
|
};
|
|
f.gamma = function(g) {
|
|
if (g == null) {
|
|
return gamma;
|
|
}
|
|
gamma = g;
|
|
return f;
|
|
};
|
|
f.hue = function(h) {
|
|
if (h == null) {
|
|
return hue;
|
|
}
|
|
hue = h;
|
|
if (type$1(hue) === "array") {
|
|
dh = hue[1] - hue[0];
|
|
if (dh === 0) {
|
|
hue = hue[1];
|
|
}
|
|
} else {
|
|
dh = 0;
|
|
}
|
|
return f;
|
|
};
|
|
f.lightness = function(h) {
|
|
if (h == null) {
|
|
return lightness;
|
|
}
|
|
if (type$1(h) === "array") {
|
|
lightness = h;
|
|
dl = h[1] - h[0];
|
|
} else {
|
|
lightness = [h, h];
|
|
dl = 0;
|
|
}
|
|
return f;
|
|
};
|
|
f.scale = function() {
|
|
return chroma$2.scale(f);
|
|
};
|
|
f.hue(hue);
|
|
return f;
|
|
};
|
|
var Color$4 = Color_1;
|
|
var digits = "0123456789abcdef";
|
|
var floor$1 = Math.floor;
|
|
var random = Math.random;
|
|
var random_1 = function() {
|
|
var code = "#";
|
|
for (var i2 = 0; i2 < 6; i2++) {
|
|
code += digits.charAt(floor$1(random() * 16));
|
|
}
|
|
return new Color$4(code, "hex");
|
|
};
|
|
var type = type$p;
|
|
var log = Math.log;
|
|
var pow$1 = Math.pow;
|
|
var floor = Math.floor;
|
|
var abs$1 = Math.abs;
|
|
var analyze = function(data, key2) {
|
|
if (key2 === void 0)
|
|
key2 = null;
|
|
var r = {
|
|
min: Number.MAX_VALUE,
|
|
max: Number.MAX_VALUE * -1,
|
|
sum: 0,
|
|
values: [],
|
|
count: 0
|
|
};
|
|
if (type(data) === "object") {
|
|
data = Object.values(data);
|
|
}
|
|
data.forEach(function(val) {
|
|
if (key2 && type(val) === "object") {
|
|
val = val[key2];
|
|
}
|
|
if (val !== void 0 && val !== null && !isNaN(val)) {
|
|
r.values.push(val);
|
|
r.sum += val;
|
|
if (val < r.min) {
|
|
r.min = val;
|
|
}
|
|
if (val > r.max) {
|
|
r.max = val;
|
|
}
|
|
r.count += 1;
|
|
}
|
|
});
|
|
r.domain = [r.min, r.max];
|
|
r.limits = function(mode, num2) {
|
|
return limits(r, mode, num2);
|
|
};
|
|
return r;
|
|
};
|
|
var limits = function(data, mode, num2) {
|
|
if (mode === void 0)
|
|
mode = "equal";
|
|
if (num2 === void 0)
|
|
num2 = 7;
|
|
if (type(data) == "array") {
|
|
data = analyze(data);
|
|
}
|
|
var min2 = data.min;
|
|
var max2 = data.max;
|
|
var values = data.values.sort(function(a, b) {
|
|
return a - b;
|
|
});
|
|
if (num2 === 1) {
|
|
return [min2, max2];
|
|
}
|
|
var limits2 = [];
|
|
if (mode.substr(0, 1) === "c") {
|
|
limits2.push(min2);
|
|
limits2.push(max2);
|
|
}
|
|
if (mode.substr(0, 1) === "e") {
|
|
limits2.push(min2);
|
|
for (var i2 = 1; i2 < num2; i2++) {
|
|
limits2.push(min2 + i2 / num2 * (max2 - min2));
|
|
}
|
|
limits2.push(max2);
|
|
} else if (mode.substr(0, 1) === "l") {
|
|
if (min2 <= 0) {
|
|
throw new Error("Logarithmic scales are only possible for values > 0");
|
|
}
|
|
var min_log = Math.LOG10E * log(min2);
|
|
var max_log = Math.LOG10E * log(max2);
|
|
limits2.push(min2);
|
|
for (var i$12 = 1; i$12 < num2; i$12++) {
|
|
limits2.push(pow$1(10, min_log + i$12 / num2 * (max_log - min_log)));
|
|
}
|
|
limits2.push(max2);
|
|
} else if (mode.substr(0, 1) === "q") {
|
|
limits2.push(min2);
|
|
for (var i$2 = 1; i$2 < num2; i$2++) {
|
|
var p = (values.length - 1) * i$2 / num2;
|
|
var pb = floor(p);
|
|
if (pb === p) {
|
|
limits2.push(values[pb]);
|
|
} else {
|
|
var pr = p - pb;
|
|
limits2.push(values[pb] * (1 - pr) + values[pb + 1] * pr);
|
|
}
|
|
}
|
|
limits2.push(max2);
|
|
} else if (mode.substr(0, 1) === "k") {
|
|
var cluster;
|
|
var n = values.length;
|
|
var assignments = new Array(n);
|
|
var clusterSizes = new Array(num2);
|
|
var repeat = true;
|
|
var nb_iters = 0;
|
|
var centroids = null;
|
|
centroids = [];
|
|
centroids.push(min2);
|
|
for (var i$3 = 1; i$3 < num2; i$3++) {
|
|
centroids.push(min2 + i$3 / num2 * (max2 - min2));
|
|
}
|
|
centroids.push(max2);
|
|
while (repeat) {
|
|
for (var j = 0; j < num2; j++) {
|
|
clusterSizes[j] = 0;
|
|
}
|
|
for (var i$4 = 0; i$4 < n; i$4++) {
|
|
var value = values[i$4];
|
|
var mindist = Number.MAX_VALUE;
|
|
var best = void 0;
|
|
for (var j$1 = 0; j$1 < num2; j$1++) {
|
|
var dist = abs$1(centroids[j$1] - value);
|
|
if (dist < mindist) {
|
|
mindist = dist;
|
|
best = j$1;
|
|
}
|
|
clusterSizes[best]++;
|
|
assignments[i$4] = best;
|
|
}
|
|
}
|
|
var newCentroids = new Array(num2);
|
|
for (var j$2 = 0; j$2 < num2; j$2++) {
|
|
newCentroids[j$2] = null;
|
|
}
|
|
for (var i$5 = 0; i$5 < n; i$5++) {
|
|
cluster = assignments[i$5];
|
|
if (newCentroids[cluster] === null) {
|
|
newCentroids[cluster] = values[i$5];
|
|
} else {
|
|
newCentroids[cluster] += values[i$5];
|
|
}
|
|
}
|
|
for (var j$3 = 0; j$3 < num2; j$3++) {
|
|
newCentroids[j$3] *= 1 / clusterSizes[j$3];
|
|
}
|
|
repeat = false;
|
|
for (var j$4 = 0; j$4 < num2; j$4++) {
|
|
if (newCentroids[j$4] !== centroids[j$4]) {
|
|
repeat = true;
|
|
break;
|
|
}
|
|
}
|
|
centroids = newCentroids;
|
|
nb_iters++;
|
|
if (nb_iters > 200) {
|
|
repeat = false;
|
|
}
|
|
}
|
|
var kClusters = {};
|
|
for (var j$5 = 0; j$5 < num2; j$5++) {
|
|
kClusters[j$5] = [];
|
|
}
|
|
for (var i$6 = 0; i$6 < n; i$6++) {
|
|
cluster = assignments[i$6];
|
|
kClusters[cluster].push(values[i$6]);
|
|
}
|
|
var tmpKMeansBreaks = [];
|
|
for (var j$6 = 0; j$6 < num2; j$6++) {
|
|
tmpKMeansBreaks.push(kClusters[j$6][0]);
|
|
tmpKMeansBreaks.push(kClusters[j$6][kClusters[j$6].length - 1]);
|
|
}
|
|
tmpKMeansBreaks = tmpKMeansBreaks.sort(function(a, b) {
|
|
return a - b;
|
|
});
|
|
limits2.push(tmpKMeansBreaks[0]);
|
|
for (var i$7 = 1; i$7 < tmpKMeansBreaks.length; i$7 += 2) {
|
|
var v = tmpKMeansBreaks[i$7];
|
|
if (!isNaN(v) && limits2.indexOf(v) === -1) {
|
|
limits2.push(v);
|
|
}
|
|
}
|
|
}
|
|
return limits2;
|
|
};
|
|
var analyze_1 = { analyze, limits };
|
|
var Color$3 = Color_1;
|
|
var contrast = function(a, b) {
|
|
a = new Color$3(a);
|
|
b = new Color$3(b);
|
|
var l1 = a.luminance();
|
|
var l2 = b.luminance();
|
|
return l1 > l2 ? (l1 + 0.05) / (l2 + 0.05) : (l2 + 0.05) / (l1 + 0.05);
|
|
};
|
|
var Color$2 = Color_1;
|
|
var sqrt = Math.sqrt;
|
|
var pow = Math.pow;
|
|
var min = Math.min;
|
|
var max = Math.max;
|
|
var atan2 = Math.atan2;
|
|
var abs = Math.abs;
|
|
var cos = Math.cos;
|
|
var sin = Math.sin;
|
|
var exp = Math.exp;
|
|
var PI = Math.PI;
|
|
var deltaE = function(a, b, Kl, Kc, Kh) {
|
|
if (Kl === void 0)
|
|
Kl = 1;
|
|
if (Kc === void 0)
|
|
Kc = 1;
|
|
if (Kh === void 0)
|
|
Kh = 1;
|
|
var rad2deg = function(rad) {
|
|
return 360 * rad / (2 * PI);
|
|
};
|
|
var deg2rad = function(deg) {
|
|
return 2 * PI * deg / 360;
|
|
};
|
|
a = new Color$2(a);
|
|
b = new Color$2(b);
|
|
var ref = Array.from(a.lab());
|
|
var L1 = ref[0];
|
|
var a1 = ref[1];
|
|
var b1 = ref[2];
|
|
var ref$1 = Array.from(b.lab());
|
|
var L2 = ref$1[0];
|
|
var a2 = ref$1[1];
|
|
var b2 = ref$1[2];
|
|
var avgL = (L1 + L2) / 2;
|
|
var C1 = sqrt(pow(a1, 2) + pow(b1, 2));
|
|
var C2 = sqrt(pow(a2, 2) + pow(b2, 2));
|
|
var avgC = (C1 + C2) / 2;
|
|
var G = 0.5 * (1 - sqrt(pow(avgC, 7) / (pow(avgC, 7) + pow(25, 7))));
|
|
var a1p = a1 * (1 + G);
|
|
var a2p = a2 * (1 + G);
|
|
var C1p = sqrt(pow(a1p, 2) + pow(b1, 2));
|
|
var C2p = sqrt(pow(a2p, 2) + pow(b2, 2));
|
|
var avgCp = (C1p + C2p) / 2;
|
|
var arctan1 = rad2deg(atan2(b1, a1p));
|
|
var arctan2 = rad2deg(atan2(b2, a2p));
|
|
var h1p = arctan1 >= 0 ? arctan1 : arctan1 + 360;
|
|
var h2p = arctan2 >= 0 ? arctan2 : arctan2 + 360;
|
|
var avgHp = abs(h1p - h2p) > 180 ? (h1p + h2p + 360) / 2 : (h1p + h2p) / 2;
|
|
var T = 1 - 0.17 * cos(deg2rad(avgHp - 30)) + 0.24 * cos(deg2rad(2 * avgHp)) + 0.32 * cos(deg2rad(3 * avgHp + 6)) - 0.2 * cos(deg2rad(4 * avgHp - 63));
|
|
var deltaHp = h2p - h1p;
|
|
deltaHp = abs(deltaHp) <= 180 ? deltaHp : h2p <= h1p ? deltaHp + 360 : deltaHp - 360;
|
|
deltaHp = 2 * sqrt(C1p * C2p) * sin(deg2rad(deltaHp) / 2);
|
|
var deltaL = L2 - L1;
|
|
var deltaCp = C2p - C1p;
|
|
var sl = 1 + 0.015 * pow(avgL - 50, 2) / sqrt(20 + pow(avgL - 50, 2));
|
|
var sc = 1 + 0.045 * avgCp;
|
|
var sh = 1 + 0.015 * avgCp * T;
|
|
var deltaTheta = 30 * exp(-pow((avgHp - 275) / 25, 2));
|
|
var Rc = 2 * sqrt(pow(avgCp, 7) / (pow(avgCp, 7) + pow(25, 7)));
|
|
var Rt = -Rc * sin(2 * deg2rad(deltaTheta));
|
|
var result = sqrt(pow(deltaL / (Kl * sl), 2) + pow(deltaCp / (Kc * sc), 2) + pow(deltaHp / (Kh * sh), 2) + Rt * (deltaCp / (Kc * sc)) * (deltaHp / (Kh * sh)));
|
|
return max(0, min(100, result));
|
|
};
|
|
var Color$1 = Color_1;
|
|
var distance = function(a, b, mode) {
|
|
if (mode === void 0)
|
|
mode = "lab";
|
|
a = new Color$1(a);
|
|
b = new Color$1(b);
|
|
var l1 = a.get(mode);
|
|
var l2 = b.get(mode);
|
|
var sum_sq = 0;
|
|
for (var i2 in l1) {
|
|
var d = (l1[i2] || 0) - (l2[i2] || 0);
|
|
sum_sq += d * d;
|
|
}
|
|
return Math.sqrt(sum_sq);
|
|
};
|
|
var Color = Color_1;
|
|
var valid = function() {
|
|
var args = [], len = arguments.length;
|
|
while (len--)
|
|
args[len] = arguments[len];
|
|
try {
|
|
new (Function.prototype.bind.apply(Color, [null].concat(args)))();
|
|
return true;
|
|
} catch (e) {
|
|
return false;
|
|
}
|
|
};
|
|
var chroma$1 = chroma_1;
|
|
var scale = scale$2;
|
|
var scales = {
|
|
cool: function cool() {
|
|
return scale([chroma$1.hsl(180, 1, 0.9), chroma$1.hsl(250, 0.7, 0.4)]);
|
|
},
|
|
hot: function hot() {
|
|
return scale(["#000", "#f00", "#ff0", "#fff"]).mode("rgb");
|
|
}
|
|
};
|
|
var colorbrewer = {
|
|
// sequential
|
|
OrRd: ["#fff7ec", "#fee8c8", "#fdd49e", "#fdbb84", "#fc8d59", "#ef6548", "#d7301f", "#b30000", "#7f0000"],
|
|
PuBu: ["#fff7fb", "#ece7f2", "#d0d1e6", "#a6bddb", "#74a9cf", "#3690c0", "#0570b0", "#045a8d", "#023858"],
|
|
BuPu: ["#f7fcfd", "#e0ecf4", "#bfd3e6", "#9ebcda", "#8c96c6", "#8c6bb1", "#88419d", "#810f7c", "#4d004b"],
|
|
Oranges: ["#fff5eb", "#fee6ce", "#fdd0a2", "#fdae6b", "#fd8d3c", "#f16913", "#d94801", "#a63603", "#7f2704"],
|
|
BuGn: ["#f7fcfd", "#e5f5f9", "#ccece6", "#99d8c9", "#66c2a4", "#41ae76", "#238b45", "#006d2c", "#00441b"],
|
|
YlOrBr: ["#ffffe5", "#fff7bc", "#fee391", "#fec44f", "#fe9929", "#ec7014", "#cc4c02", "#993404", "#662506"],
|
|
YlGn: ["#ffffe5", "#f7fcb9", "#d9f0a3", "#addd8e", "#78c679", "#41ab5d", "#238443", "#006837", "#004529"],
|
|
Reds: ["#fff5f0", "#fee0d2", "#fcbba1", "#fc9272", "#fb6a4a", "#ef3b2c", "#cb181d", "#a50f15", "#67000d"],
|
|
RdPu: ["#fff7f3", "#fde0dd", "#fcc5c0", "#fa9fb5", "#f768a1", "#dd3497", "#ae017e", "#7a0177", "#49006a"],
|
|
Greens: ["#f7fcf5", "#e5f5e0", "#c7e9c0", "#a1d99b", "#74c476", "#41ab5d", "#238b45", "#006d2c", "#00441b"],
|
|
YlGnBu: ["#ffffd9", "#edf8b1", "#c7e9b4", "#7fcdbb", "#41b6c4", "#1d91c0", "#225ea8", "#253494", "#081d58"],
|
|
Purples: ["#fcfbfd", "#efedf5", "#dadaeb", "#bcbddc", "#9e9ac8", "#807dba", "#6a51a3", "#54278f", "#3f007d"],
|
|
GnBu: ["#f7fcf0", "#e0f3db", "#ccebc5", "#a8ddb5", "#7bccc4", "#4eb3d3", "#2b8cbe", "#0868ac", "#084081"],
|
|
Greys: ["#ffffff", "#f0f0f0", "#d9d9d9", "#bdbdbd", "#969696", "#737373", "#525252", "#252525", "#000000"],
|
|
YlOrRd: ["#ffffcc", "#ffeda0", "#fed976", "#feb24c", "#fd8d3c", "#fc4e2a", "#e31a1c", "#bd0026", "#800026"],
|
|
PuRd: ["#f7f4f9", "#e7e1ef", "#d4b9da", "#c994c7", "#df65b0", "#e7298a", "#ce1256", "#980043", "#67001f"],
|
|
Blues: ["#f7fbff", "#deebf7", "#c6dbef", "#9ecae1", "#6baed6", "#4292c6", "#2171b5", "#08519c", "#08306b"],
|
|
PuBuGn: ["#fff7fb", "#ece2f0", "#d0d1e6", "#a6bddb", "#67a9cf", "#3690c0", "#02818a", "#016c59", "#014636"],
|
|
Viridis: ["#440154", "#482777", "#3f4a8a", "#31678e", "#26838f", "#1f9d8a", "#6cce5a", "#b6de2b", "#fee825"],
|
|
// diverging
|
|
Spectral: ["#9e0142", "#d53e4f", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#e6f598", "#abdda4", "#66c2a5", "#3288bd", "#5e4fa2"],
|
|
RdYlGn: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee08b", "#ffffbf", "#d9ef8b", "#a6d96a", "#66bd63", "#1a9850", "#006837"],
|
|
RdBu: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#f7f7f7", "#d1e5f0", "#92c5de", "#4393c3", "#2166ac", "#053061"],
|
|
PiYG: ["#8e0152", "#c51b7d", "#de77ae", "#f1b6da", "#fde0ef", "#f7f7f7", "#e6f5d0", "#b8e186", "#7fbc41", "#4d9221", "#276419"],
|
|
PRGn: ["#40004b", "#762a83", "#9970ab", "#c2a5cf", "#e7d4e8", "#f7f7f7", "#d9f0d3", "#a6dba0", "#5aae61", "#1b7837", "#00441b"],
|
|
RdYlBu: ["#a50026", "#d73027", "#f46d43", "#fdae61", "#fee090", "#ffffbf", "#e0f3f8", "#abd9e9", "#74add1", "#4575b4", "#313695"],
|
|
BrBG: ["#543005", "#8c510a", "#bf812d", "#dfc27d", "#f6e8c3", "#f5f5f5", "#c7eae5", "#80cdc1", "#35978f", "#01665e", "#003c30"],
|
|
RdGy: ["#67001f", "#b2182b", "#d6604d", "#f4a582", "#fddbc7", "#ffffff", "#e0e0e0", "#bababa", "#878787", "#4d4d4d", "#1a1a1a"],
|
|
PuOr: ["#7f3b08", "#b35806", "#e08214", "#fdb863", "#fee0b6", "#f7f7f7", "#d8daeb", "#b2abd2", "#8073ac", "#542788", "#2d004b"],
|
|
// qualitative
|
|
Set2: ["#66c2a5", "#fc8d62", "#8da0cb", "#e78ac3", "#a6d854", "#ffd92f", "#e5c494", "#b3b3b3"],
|
|
Accent: ["#7fc97f", "#beaed4", "#fdc086", "#ffff99", "#386cb0", "#f0027f", "#bf5b17", "#666666"],
|
|
Set1: ["#e41a1c", "#377eb8", "#4daf4a", "#984ea3", "#ff7f00", "#ffff33", "#a65628", "#f781bf", "#999999"],
|
|
Set3: ["#8dd3c7", "#ffffb3", "#bebada", "#fb8072", "#80b1d3", "#fdb462", "#b3de69", "#fccde5", "#d9d9d9", "#bc80bd", "#ccebc5", "#ffed6f"],
|
|
Dark2: ["#1b9e77", "#d95f02", "#7570b3", "#e7298a", "#66a61e", "#e6ab02", "#a6761d", "#666666"],
|
|
Paired: ["#a6cee3", "#1f78b4", "#b2df8a", "#33a02c", "#fb9a99", "#e31a1c", "#fdbf6f", "#ff7f00", "#cab2d6", "#6a3d9a", "#ffff99", "#b15928"],
|
|
Pastel2: ["#b3e2cd", "#fdcdac", "#cbd5e8", "#f4cae4", "#e6f5c9", "#fff2ae", "#f1e2cc", "#cccccc"],
|
|
Pastel1: ["#fbb4ae", "#b3cde3", "#ccebc5", "#decbe4", "#fed9a6", "#ffffcc", "#e5d8bd", "#fddaec", "#f2f2f2"]
|
|
};
|
|
for (var i = 0, list = Object.keys(colorbrewer); i < list.length; i += 1) {
|
|
var key = list[i];
|
|
colorbrewer[key.toLowerCase()] = colorbrewer[key];
|
|
}
|
|
var colorbrewer_1 = colorbrewer;
|
|
var chroma3 = chroma_1;
|
|
chroma3.average = average;
|
|
chroma3.bezier = bezier_1;
|
|
chroma3.blend = blend_1;
|
|
chroma3.cubehelix = cubehelix;
|
|
chroma3.mix = chroma3.interpolate = mix$1;
|
|
chroma3.random = random_1;
|
|
chroma3.scale = scale$2;
|
|
chroma3.analyze = analyze_1.analyze;
|
|
chroma3.contrast = contrast;
|
|
chroma3.deltaE = deltaE;
|
|
chroma3.distance = distance;
|
|
chroma3.limits = analyze_1.limits;
|
|
chroma3.valid = valid;
|
|
chroma3.scales = scales;
|
|
chroma3.colors = w3cx11_1;
|
|
chroma3.brewer = colorbrewer_1;
|
|
var chroma_js = chroma3;
|
|
return chroma_js;
|
|
});
|
|
}
|
|
});
|
|
|
|
// src/main.ts
|
|
var main_exports = {};
|
|
__export(main_exports, {
|
|
default: () => DayPlanner
|
|
});
|
|
module.exports = __toCommonJS(main_exports);
|
|
var import_obsidian6 = require("obsidian");
|
|
var import_obsidian_daily_notes_interface6 = __toESM(require_main());
|
|
|
|
// node_modules/svelte/internal/index.mjs
|
|
function noop() {
|
|
}
|
|
function assign(tar, src) {
|
|
for (const k in src)
|
|
tar[k] = src[k];
|
|
return tar;
|
|
}
|
|
function is_promise(value) {
|
|
return !!value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
|
|
}
|
|
function run(fn) {
|
|
return fn();
|
|
}
|
|
function blank_object() {
|
|
return /* @__PURE__ */ Object.create(null);
|
|
}
|
|
function run_all(fns) {
|
|
fns.forEach(run);
|
|
}
|
|
function is_function(thing) {
|
|
return typeof thing === "function";
|
|
}
|
|
function safe_not_equal(a, b) {
|
|
return a != a ? b == b : a !== b || (a && typeof a === "object" || typeof a === "function");
|
|
}
|
|
function is_empty(obj) {
|
|
return Object.keys(obj).length === 0;
|
|
}
|
|
function subscribe(store, ...callbacks) {
|
|
if (store == null) {
|
|
return noop;
|
|
}
|
|
const unsub = store.subscribe(...callbacks);
|
|
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
|
}
|
|
function get_store_value(store) {
|
|
let value;
|
|
subscribe(store, (_) => value = _)();
|
|
return value;
|
|
}
|
|
function component_subscribe(component, store, callback) {
|
|
component.$$.on_destroy.push(subscribe(store, callback));
|
|
}
|
|
function create_slot(definition, ctx, $$scope, fn) {
|
|
if (definition) {
|
|
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
|
return definition[0](slot_ctx);
|
|
}
|
|
}
|
|
function get_slot_context(definition, ctx, $$scope, fn) {
|
|
return definition[1] && fn ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) : $$scope.ctx;
|
|
}
|
|
function get_slot_changes(definition, $$scope, dirty, fn) {
|
|
if (definition[2] && fn) {
|
|
const lets = definition[2](fn(dirty));
|
|
if ($$scope.dirty === void 0) {
|
|
return lets;
|
|
}
|
|
if (typeof lets === "object") {
|
|
const merged = [];
|
|
const len = Math.max($$scope.dirty.length, lets.length);
|
|
for (let i = 0; i < len; i += 1) {
|
|
merged[i] = $$scope.dirty[i] | lets[i];
|
|
}
|
|
return merged;
|
|
}
|
|
return $$scope.dirty | lets;
|
|
}
|
|
return $$scope.dirty;
|
|
}
|
|
function update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {
|
|
if (slot_changes) {
|
|
const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);
|
|
slot.p(slot_context, slot_changes);
|
|
}
|
|
}
|
|
function get_all_dirty_from_scope($$scope) {
|
|
if ($$scope.ctx.length > 32) {
|
|
const dirty = [];
|
|
const length = $$scope.ctx.length / 32;
|
|
for (let i = 0; i < length; i++) {
|
|
dirty[i] = -1;
|
|
}
|
|
return dirty;
|
|
}
|
|
return -1;
|
|
}
|
|
function exclude_internal_props(props) {
|
|
const result = {};
|
|
for (const k in props)
|
|
if (k[0] !== "$")
|
|
result[k] = props[k];
|
|
return result;
|
|
}
|
|
function compute_rest_props(props, keys) {
|
|
const rest = {};
|
|
keys = new Set(keys);
|
|
for (const k in props)
|
|
if (!keys.has(k) && k[0] !== "$")
|
|
rest[k] = props[k];
|
|
return rest;
|
|
}
|
|
function set_store_value(store, ret, value) {
|
|
store.set(value);
|
|
return ret;
|
|
}
|
|
function action_destroyer(action_result) {
|
|
return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;
|
|
}
|
|
var globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : global;
|
|
var ResizeObserverSingleton = class _ResizeObserverSingleton {
|
|
constructor(options) {
|
|
this.options = options;
|
|
this._listeners = "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0;
|
|
}
|
|
observe(element2, listener) {
|
|
this._listeners.set(element2, listener);
|
|
this._getObserver().observe(element2, this.options);
|
|
return () => {
|
|
this._listeners.delete(element2);
|
|
this._observer.unobserve(element2);
|
|
};
|
|
}
|
|
_getObserver() {
|
|
var _a;
|
|
return (_a = this._observer) !== null && _a !== void 0 ? _a : this._observer = new ResizeObserver((entries) => {
|
|
var _a2;
|
|
for (const entry of entries) {
|
|
_ResizeObserverSingleton.entries.set(entry.target, entry);
|
|
(_a2 = this._listeners.get(entry.target)) === null || _a2 === void 0 ? void 0 : _a2(entry);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
ResizeObserverSingleton.entries = "WeakMap" in globals ? /* @__PURE__ */ new WeakMap() : void 0;
|
|
var is_hydrating = false;
|
|
function start_hydrating() {
|
|
is_hydrating = true;
|
|
}
|
|
function end_hydrating() {
|
|
is_hydrating = false;
|
|
}
|
|
function upper_bound(low, high, key, value) {
|
|
while (low < high) {
|
|
const mid = low + (high - low >> 1);
|
|
if (key(mid) <= value) {
|
|
low = mid + 1;
|
|
} else {
|
|
high = mid;
|
|
}
|
|
}
|
|
return low;
|
|
}
|
|
function init_hydrate(target) {
|
|
if (target.hydrate_init)
|
|
return;
|
|
target.hydrate_init = true;
|
|
let children2 = target.childNodes;
|
|
if (target.nodeName === "HEAD") {
|
|
const myChildren = [];
|
|
for (let i = 0; i < children2.length; i++) {
|
|
const node = children2[i];
|
|
if (node.claim_order !== void 0) {
|
|
myChildren.push(node);
|
|
}
|
|
}
|
|
children2 = myChildren;
|
|
}
|
|
const m = new Int32Array(children2.length + 1);
|
|
const p = new Int32Array(children2.length);
|
|
m[0] = -1;
|
|
let longest = 0;
|
|
for (let i = 0; i < children2.length; i++) {
|
|
const current = children2[i].claim_order;
|
|
const seqLen = (longest > 0 && children2[m[longest]].claim_order <= current ? longest + 1 : upper_bound(1, longest, (idx) => children2[m[idx]].claim_order, current)) - 1;
|
|
p[i] = m[seqLen] + 1;
|
|
const newLen = seqLen + 1;
|
|
m[newLen] = i;
|
|
longest = Math.max(newLen, longest);
|
|
}
|
|
const lis = [];
|
|
const toMove = [];
|
|
let last3 = children2.length - 1;
|
|
for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {
|
|
lis.push(children2[cur - 1]);
|
|
for (; last3 >= cur; last3--) {
|
|
toMove.push(children2[last3]);
|
|
}
|
|
last3--;
|
|
}
|
|
for (; last3 >= 0; last3--) {
|
|
toMove.push(children2[last3]);
|
|
}
|
|
lis.reverse();
|
|
toMove.sort((a, b) => a.claim_order - b.claim_order);
|
|
for (let i = 0, j = 0; i < toMove.length; i++) {
|
|
while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {
|
|
j++;
|
|
}
|
|
const anchor = j < lis.length ? lis[j] : null;
|
|
target.insertBefore(toMove[i], anchor);
|
|
}
|
|
}
|
|
function append(target, node) {
|
|
target.appendChild(node);
|
|
}
|
|
function append_styles(target, style_sheet_id, styles) {
|
|
const append_styles_to = get_root_for_style(target);
|
|
if (!append_styles_to.getElementById(style_sheet_id)) {
|
|
const style = element("style");
|
|
style.id = style_sheet_id;
|
|
style.textContent = styles;
|
|
append_stylesheet(append_styles_to, style);
|
|
}
|
|
}
|
|
function get_root_for_style(node) {
|
|
if (!node)
|
|
return document;
|
|
const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;
|
|
if (root && root.host) {
|
|
return root;
|
|
}
|
|
return node.ownerDocument;
|
|
}
|
|
function append_stylesheet(node, style) {
|
|
append(node.head || node, style);
|
|
return style.sheet;
|
|
}
|
|
function append_hydration(target, node) {
|
|
if (is_hydrating) {
|
|
init_hydrate(target);
|
|
if (target.actual_end_child === void 0 || target.actual_end_child !== null && target.actual_end_child.parentNode !== target) {
|
|
target.actual_end_child = target.firstChild;
|
|
}
|
|
while (target.actual_end_child !== null && target.actual_end_child.claim_order === void 0) {
|
|
target.actual_end_child = target.actual_end_child.nextSibling;
|
|
}
|
|
if (node !== target.actual_end_child) {
|
|
if (node.claim_order !== void 0 || node.parentNode !== target) {
|
|
target.insertBefore(node, target.actual_end_child);
|
|
}
|
|
} else {
|
|
target.actual_end_child = node.nextSibling;
|
|
}
|
|
} else if (node.parentNode !== target || node.nextSibling !== null) {
|
|
target.appendChild(node);
|
|
}
|
|
}
|
|
function insert(target, node, anchor) {
|
|
target.insertBefore(node, anchor || null);
|
|
}
|
|
function insert_hydration(target, node, anchor) {
|
|
if (is_hydrating && !anchor) {
|
|
append_hydration(target, node);
|
|
} else if (node.parentNode !== target || node.nextSibling != anchor) {
|
|
target.insertBefore(node, anchor || null);
|
|
}
|
|
}
|
|
function detach(node) {
|
|
if (node.parentNode) {
|
|
node.parentNode.removeChild(node);
|
|
}
|
|
}
|
|
function destroy_each(iterations, detaching) {
|
|
for (let i = 0; i < iterations.length; i += 1) {
|
|
if (iterations[i])
|
|
iterations[i].d(detaching);
|
|
}
|
|
}
|
|
function element(name) {
|
|
return document.createElement(name);
|
|
}
|
|
function svg_element(name) {
|
|
return document.createElementNS("http://www.w3.org/2000/svg", name);
|
|
}
|
|
function text(data) {
|
|
return document.createTextNode(data);
|
|
}
|
|
function space() {
|
|
return text(" ");
|
|
}
|
|
function empty() {
|
|
return text("");
|
|
}
|
|
function listen(node, event, handler, options) {
|
|
node.addEventListener(event, handler, options);
|
|
return () => node.removeEventListener(event, handler, options);
|
|
}
|
|
function stop_propagation(fn) {
|
|
return function(event) {
|
|
event.stopPropagation();
|
|
return fn.call(this, event);
|
|
};
|
|
}
|
|
function attr(node, attribute, value) {
|
|
if (value == null)
|
|
node.removeAttribute(attribute);
|
|
else if (node.getAttribute(attribute) !== value)
|
|
node.setAttribute(attribute, value);
|
|
}
|
|
function set_svg_attributes(node, attributes) {
|
|
for (const key in attributes) {
|
|
attr(node, key, attributes[key]);
|
|
}
|
|
}
|
|
function children(element2) {
|
|
return Array.from(element2.childNodes);
|
|
}
|
|
function init_claim_info(nodes) {
|
|
if (nodes.claim_info === void 0) {
|
|
nodes.claim_info = { last_index: 0, total_claimed: 0 };
|
|
}
|
|
}
|
|
function claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {
|
|
init_claim_info(nodes);
|
|
const resultNode = (() => {
|
|
for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {
|
|
const node = nodes[i];
|
|
if (predicate(node)) {
|
|
const replacement = processNode(node);
|
|
if (replacement === void 0) {
|
|
nodes.splice(i, 1);
|
|
} else {
|
|
nodes[i] = replacement;
|
|
}
|
|
if (!dontUpdateLastIndex) {
|
|
nodes.claim_info.last_index = i;
|
|
}
|
|
return node;
|
|
}
|
|
}
|
|
for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {
|
|
const node = nodes[i];
|
|
if (predicate(node)) {
|
|
const replacement = processNode(node);
|
|
if (replacement === void 0) {
|
|
nodes.splice(i, 1);
|
|
} else {
|
|
nodes[i] = replacement;
|
|
}
|
|
if (!dontUpdateLastIndex) {
|
|
nodes.claim_info.last_index = i;
|
|
} else if (replacement === void 0) {
|
|
nodes.claim_info.last_index--;
|
|
}
|
|
return node;
|
|
}
|
|
}
|
|
return createNode();
|
|
})();
|
|
resultNode.claim_order = nodes.claim_info.total_claimed;
|
|
nodes.claim_info.total_claimed += 1;
|
|
return resultNode;
|
|
}
|
|
function claim_element_base(nodes, name, attributes, create_element) {
|
|
return claim_node(nodes, (node) => node.nodeName === name, (node) => {
|
|
const remove = [];
|
|
for (let j = 0; j < node.attributes.length; j++) {
|
|
const attribute = node.attributes[j];
|
|
if (!attributes[attribute.name]) {
|
|
remove.push(attribute.name);
|
|
}
|
|
}
|
|
remove.forEach((v) => node.removeAttribute(v));
|
|
return void 0;
|
|
}, () => create_element(name));
|
|
}
|
|
function claim_svg_element(nodes, name, attributes) {
|
|
return claim_element_base(nodes, name, attributes, svg_element);
|
|
}
|
|
function set_data(text2, data) {
|
|
data = "" + data;
|
|
if (text2.data === data)
|
|
return;
|
|
text2.data = data;
|
|
}
|
|
function set_style(node, key, value, important) {
|
|
if (value == null) {
|
|
node.style.removeProperty(key);
|
|
} else {
|
|
node.style.setProperty(key, value, important ? "important" : "");
|
|
}
|
|
}
|
|
function select_option(select, value, mounting) {
|
|
for (let i = 0; i < select.options.length; i += 1) {
|
|
const option = select.options[i];
|
|
if (option.__value === value) {
|
|
option.selected = true;
|
|
return;
|
|
}
|
|
}
|
|
if (!mounting || value !== void 0) {
|
|
select.selectedIndex = -1;
|
|
}
|
|
}
|
|
function toggle_class(element2, name, toggle) {
|
|
element2.classList[toggle ? "add" : "remove"](name);
|
|
}
|
|
var current_component;
|
|
function set_current_component(component) {
|
|
current_component = component;
|
|
}
|
|
function get_current_component() {
|
|
if (!current_component)
|
|
throw new Error("Function called outside component initialization");
|
|
return current_component;
|
|
}
|
|
function onDestroy(fn) {
|
|
get_current_component().$$.on_destroy.push(fn);
|
|
}
|
|
function bubble(component, event) {
|
|
const callbacks = component.$$.callbacks[event.type];
|
|
if (callbacks) {
|
|
callbacks.slice().forEach((fn) => fn.call(this, event));
|
|
}
|
|
}
|
|
var dirty_components = [];
|
|
var binding_callbacks = [];
|
|
var render_callbacks = [];
|
|
var flush_callbacks = [];
|
|
var resolved_promise = /* @__PURE__ */ Promise.resolve();
|
|
var update_scheduled = false;
|
|
function schedule_update() {
|
|
if (!update_scheduled) {
|
|
update_scheduled = true;
|
|
resolved_promise.then(flush);
|
|
}
|
|
}
|
|
function add_render_callback(fn) {
|
|
render_callbacks.push(fn);
|
|
}
|
|
var seen_callbacks = /* @__PURE__ */ new Set();
|
|
var flushidx = 0;
|
|
function flush() {
|
|
if (flushidx !== 0) {
|
|
return;
|
|
}
|
|
const saved_component = current_component;
|
|
do {
|
|
try {
|
|
while (flushidx < dirty_components.length) {
|
|
const component = dirty_components[flushidx];
|
|
flushidx++;
|
|
set_current_component(component);
|
|
update(component.$$);
|
|
}
|
|
} catch (e) {
|
|
dirty_components.length = 0;
|
|
flushidx = 0;
|
|
throw e;
|
|
}
|
|
set_current_component(null);
|
|
dirty_components.length = 0;
|
|
flushidx = 0;
|
|
while (binding_callbacks.length)
|
|
binding_callbacks.pop()();
|
|
for (let i = 0; i < render_callbacks.length; i += 1) {
|
|
const callback = render_callbacks[i];
|
|
if (!seen_callbacks.has(callback)) {
|
|
seen_callbacks.add(callback);
|
|
callback();
|
|
}
|
|
}
|
|
render_callbacks.length = 0;
|
|
} while (dirty_components.length);
|
|
while (flush_callbacks.length) {
|
|
flush_callbacks.pop()();
|
|
}
|
|
update_scheduled = false;
|
|
seen_callbacks.clear();
|
|
set_current_component(saved_component);
|
|
}
|
|
function update($$) {
|
|
if ($$.fragment !== null) {
|
|
$$.update();
|
|
run_all($$.before_update);
|
|
const dirty = $$.dirty;
|
|
$$.dirty = [-1];
|
|
$$.fragment && $$.fragment.p($$.ctx, dirty);
|
|
$$.after_update.forEach(add_render_callback);
|
|
}
|
|
}
|
|
function flush_render_callbacks(fns) {
|
|
const filtered = [];
|
|
const targets = [];
|
|
render_callbacks.forEach((c) => fns.indexOf(c) === -1 ? filtered.push(c) : targets.push(c));
|
|
targets.forEach((c) => c());
|
|
render_callbacks = filtered;
|
|
}
|
|
var outroing = /* @__PURE__ */ new Set();
|
|
var outros;
|
|
function group_outros() {
|
|
outros = {
|
|
r: 0,
|
|
c: [],
|
|
p: outros
|
|
// parent group
|
|
};
|
|
}
|
|
function check_outros() {
|
|
if (!outros.r) {
|
|
run_all(outros.c);
|
|
}
|
|
outros = outros.p;
|
|
}
|
|
function transition_in(block, local) {
|
|
if (block && block.i) {
|
|
outroing.delete(block);
|
|
block.i(local);
|
|
}
|
|
}
|
|
function transition_out(block, local, detach2, callback) {
|
|
if (block && block.o) {
|
|
if (outroing.has(block))
|
|
return;
|
|
outroing.add(block);
|
|
outros.c.push(() => {
|
|
outroing.delete(block);
|
|
if (callback) {
|
|
if (detach2)
|
|
block.d(1);
|
|
callback();
|
|
}
|
|
});
|
|
block.o(local);
|
|
} else if (callback) {
|
|
callback();
|
|
}
|
|
}
|
|
function handle_promise(promise, info) {
|
|
const token = info.token = {};
|
|
function update2(type, index, key, value) {
|
|
if (info.token !== token)
|
|
return;
|
|
info.resolved = value;
|
|
let child_ctx = info.ctx;
|
|
if (key !== void 0) {
|
|
child_ctx = child_ctx.slice();
|
|
child_ctx[key] = value;
|
|
}
|
|
const block = type && (info.current = type)(child_ctx);
|
|
let needs_flush = false;
|
|
if (info.block) {
|
|
if (info.blocks) {
|
|
info.blocks.forEach((block2, i) => {
|
|
if (i !== index && block2) {
|
|
group_outros();
|
|
transition_out(block2, 1, 1, () => {
|
|
if (info.blocks[i] === block2) {
|
|
info.blocks[i] = null;
|
|
}
|
|
});
|
|
check_outros();
|
|
}
|
|
});
|
|
} else {
|
|
info.block.d(1);
|
|
}
|
|
block.c();
|
|
transition_in(block, 1);
|
|
block.m(info.mount(), info.anchor);
|
|
needs_flush = true;
|
|
}
|
|
info.block = block;
|
|
if (info.blocks)
|
|
info.blocks[index] = block;
|
|
if (needs_flush) {
|
|
flush();
|
|
}
|
|
}
|
|
if (is_promise(promise)) {
|
|
const current_component2 = get_current_component();
|
|
promise.then((value) => {
|
|
set_current_component(current_component2);
|
|
update2(info.then, 1, info.value, value);
|
|
set_current_component(null);
|
|
}, (error) => {
|
|
set_current_component(current_component2);
|
|
update2(info.catch, 2, info.error, error);
|
|
set_current_component(null);
|
|
if (!info.hasCatch) {
|
|
throw error;
|
|
}
|
|
});
|
|
if (info.current !== info.pending) {
|
|
update2(info.pending, 0);
|
|
return true;
|
|
}
|
|
} else {
|
|
if (info.current !== info.then) {
|
|
update2(info.then, 1, info.value, promise);
|
|
return true;
|
|
}
|
|
info.resolved = promise;
|
|
}
|
|
}
|
|
function update_await_block_branch(info, ctx, dirty) {
|
|
const child_ctx = ctx.slice();
|
|
const { resolved } = info;
|
|
if (info.current === info.then) {
|
|
child_ctx[info.value] = resolved;
|
|
}
|
|
if (info.current === info.catch) {
|
|
child_ctx[info.error] = resolved;
|
|
}
|
|
info.block.p(child_ctx, dirty);
|
|
}
|
|
function outro_and_destroy_block(block, lookup) {
|
|
transition_out(block, 1, 1, () => {
|
|
lookup.delete(block.key);
|
|
});
|
|
}
|
|
function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block7, next, get_context) {
|
|
let o = old_blocks.length;
|
|
let n = list.length;
|
|
let i = o;
|
|
const old_indexes = {};
|
|
while (i--)
|
|
old_indexes[old_blocks[i].key] = i;
|
|
const new_blocks = [];
|
|
const new_lookup = /* @__PURE__ */ new Map();
|
|
const deltas = /* @__PURE__ */ new Map();
|
|
const updates = [];
|
|
i = n;
|
|
while (i--) {
|
|
const child_ctx = get_context(ctx, list, i);
|
|
const key = get_key(child_ctx);
|
|
let block = lookup.get(key);
|
|
if (!block) {
|
|
block = create_each_block7(key, child_ctx);
|
|
block.c();
|
|
} else if (dynamic) {
|
|
updates.push(() => block.p(child_ctx, dirty));
|
|
}
|
|
new_lookup.set(key, new_blocks[i] = block);
|
|
if (key in old_indexes)
|
|
deltas.set(key, Math.abs(i - old_indexes[key]));
|
|
}
|
|
const will_move = /* @__PURE__ */ new Set();
|
|
const did_move = /* @__PURE__ */ new Set();
|
|
function insert2(block) {
|
|
transition_in(block, 1);
|
|
block.m(node, next);
|
|
lookup.set(block.key, block);
|
|
next = block.first;
|
|
n--;
|
|
}
|
|
while (o && n) {
|
|
const new_block = new_blocks[n - 1];
|
|
const old_block = old_blocks[o - 1];
|
|
const new_key = new_block.key;
|
|
const old_key = old_block.key;
|
|
if (new_block === old_block) {
|
|
next = new_block.first;
|
|
o--;
|
|
n--;
|
|
} else if (!new_lookup.has(old_key)) {
|
|
destroy(old_block, lookup);
|
|
o--;
|
|
} else if (!lookup.has(new_key) || will_move.has(new_key)) {
|
|
insert2(new_block);
|
|
} else if (did_move.has(old_key)) {
|
|
o--;
|
|
} else if (deltas.get(new_key) > deltas.get(old_key)) {
|
|
did_move.add(new_key);
|
|
insert2(new_block);
|
|
} else {
|
|
will_move.add(old_key);
|
|
o--;
|
|
}
|
|
}
|
|
while (o--) {
|
|
const old_block = old_blocks[o];
|
|
if (!new_lookup.has(old_block.key))
|
|
destroy(old_block, lookup);
|
|
}
|
|
while (n)
|
|
insert2(new_blocks[n - 1]);
|
|
run_all(updates);
|
|
return new_blocks;
|
|
}
|
|
function get_spread_update(levels, updates) {
|
|
const update2 = {};
|
|
const to_null_out = {};
|
|
const accounted_for = { $$scope: 1 };
|
|
let i = levels.length;
|
|
while (i--) {
|
|
const o = levels[i];
|
|
const n = updates[i];
|
|
if (n) {
|
|
for (const key in o) {
|
|
if (!(key in n))
|
|
to_null_out[key] = 1;
|
|
}
|
|
for (const key in n) {
|
|
if (!accounted_for[key]) {
|
|
update2[key] = n[key];
|
|
accounted_for[key] = 1;
|
|
}
|
|
}
|
|
levels[i] = n;
|
|
} else {
|
|
for (const key in o) {
|
|
accounted_for[key] = 1;
|
|
}
|
|
}
|
|
}
|
|
for (const key in to_null_out) {
|
|
if (!(key in update2))
|
|
update2[key] = void 0;
|
|
}
|
|
return update2;
|
|
}
|
|
function get_spread_object(spread_props) {
|
|
return typeof spread_props === "object" && spread_props !== null ? spread_props : {};
|
|
}
|
|
var _boolean_attributes = [
|
|
"allowfullscreen",
|
|
"allowpaymentrequest",
|
|
"async",
|
|
"autofocus",
|
|
"autoplay",
|
|
"checked",
|
|
"controls",
|
|
"default",
|
|
"defer",
|
|
"disabled",
|
|
"formnovalidate",
|
|
"hidden",
|
|
"inert",
|
|
"ismap",
|
|
"loop",
|
|
"multiple",
|
|
"muted",
|
|
"nomodule",
|
|
"novalidate",
|
|
"open",
|
|
"playsinline",
|
|
"readonly",
|
|
"required",
|
|
"reversed",
|
|
"selected"
|
|
];
|
|
var boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]);
|
|
function create_component(block) {
|
|
block && block.c();
|
|
}
|
|
function claim_component(block, parent_nodes) {
|
|
block && block.l(parent_nodes);
|
|
}
|
|
function mount_component(component, target, anchor, customElement) {
|
|
const { fragment, after_update } = component.$$;
|
|
fragment && fragment.m(target, anchor);
|
|
if (!customElement) {
|
|
add_render_callback(() => {
|
|
const new_on_destroy = component.$$.on_mount.map(run).filter(is_function);
|
|
if (component.$$.on_destroy) {
|
|
component.$$.on_destroy.push(...new_on_destroy);
|
|
} else {
|
|
run_all(new_on_destroy);
|
|
}
|
|
component.$$.on_mount = [];
|
|
});
|
|
}
|
|
after_update.forEach(add_render_callback);
|
|
}
|
|
function destroy_component(component, detaching) {
|
|
const $$ = component.$$;
|
|
if ($$.fragment !== null) {
|
|
flush_render_callbacks($$.after_update);
|
|
run_all($$.on_destroy);
|
|
$$.fragment && $$.fragment.d(detaching);
|
|
$$.on_destroy = $$.fragment = null;
|
|
$$.ctx = [];
|
|
}
|
|
}
|
|
function make_dirty(component, i) {
|
|
if (component.$$.dirty[0] === -1) {
|
|
dirty_components.push(component);
|
|
schedule_update();
|
|
component.$$.dirty.fill(0);
|
|
}
|
|
component.$$.dirty[i / 31 | 0] |= 1 << i % 31;
|
|
}
|
|
function init(component, options, instance20, create_fragment24, not_equal, props, append_styles2, dirty = [-1]) {
|
|
const parent_component = current_component;
|
|
set_current_component(component);
|
|
const $$ = component.$$ = {
|
|
fragment: null,
|
|
ctx: [],
|
|
// state
|
|
props,
|
|
update: noop,
|
|
not_equal,
|
|
bound: blank_object(),
|
|
// lifecycle
|
|
on_mount: [],
|
|
on_destroy: [],
|
|
on_disconnect: [],
|
|
before_update: [],
|
|
after_update: [],
|
|
context: new Map(options.context || (parent_component ? parent_component.$$.context : [])),
|
|
// everything else
|
|
callbacks: blank_object(),
|
|
dirty,
|
|
skip_bound: false,
|
|
root: options.target || parent_component.$$.root
|
|
};
|
|
append_styles2 && append_styles2($$.root);
|
|
let ready = false;
|
|
$$.ctx = instance20 ? instance20(component, options.props || {}, (i, ret, ...rest) => {
|
|
const value = rest.length ? rest[0] : ret;
|
|
if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) {
|
|
if (!$$.skip_bound && $$.bound[i])
|
|
$$.bound[i](value);
|
|
if (ready)
|
|
make_dirty(component, i);
|
|
}
|
|
return ret;
|
|
}) : [];
|
|
$$.update();
|
|
ready = true;
|
|
run_all($$.before_update);
|
|
$$.fragment = create_fragment24 ? create_fragment24($$.ctx) : false;
|
|
if (options.target) {
|
|
if (options.hydrate) {
|
|
start_hydrating();
|
|
const nodes = children(options.target);
|
|
$$.fragment && $$.fragment.l(nodes);
|
|
nodes.forEach(detach);
|
|
} else {
|
|
$$.fragment && $$.fragment.c();
|
|
}
|
|
if (options.intro)
|
|
transition_in(component.$$.fragment);
|
|
mount_component(component, options.target, options.anchor, options.customElement);
|
|
end_hydrating();
|
|
flush();
|
|
}
|
|
set_current_component(parent_component);
|
|
}
|
|
var SvelteElement;
|
|
if (typeof HTMLElement === "function") {
|
|
SvelteElement = class extends HTMLElement {
|
|
constructor() {
|
|
super();
|
|
this.attachShadow({ mode: "open" });
|
|
}
|
|
connectedCallback() {
|
|
const { on_mount } = this.$$;
|
|
this.$$.on_disconnect = on_mount.map(run).filter(is_function);
|
|
for (const key in this.$$.slotted) {
|
|
this.appendChild(this.$$.slotted[key]);
|
|
}
|
|
}
|
|
attributeChangedCallback(attr2, _oldValue, newValue) {
|
|
this[attr2] = newValue;
|
|
}
|
|
disconnectedCallback() {
|
|
run_all(this.$$.on_disconnect);
|
|
}
|
|
$destroy() {
|
|
destroy_component(this, 1);
|
|
this.$destroy = noop;
|
|
}
|
|
$on(type, callback) {
|
|
if (!is_function(callback)) {
|
|
return noop;
|
|
}
|
|
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
|
callbacks.push(callback);
|
|
return () => {
|
|
const index = callbacks.indexOf(callback);
|
|
if (index !== -1)
|
|
callbacks.splice(index, 1);
|
|
};
|
|
}
|
|
$set($$props) {
|
|
if (this.$$set && !is_empty($$props)) {
|
|
this.$$.skip_bound = true;
|
|
this.$$set($$props);
|
|
this.$$.skip_bound = false;
|
|
}
|
|
}
|
|
};
|
|
}
|
|
var SvelteComponent = class {
|
|
$destroy() {
|
|
destroy_component(this, 1);
|
|
this.$destroy = noop;
|
|
}
|
|
$on(type, callback) {
|
|
if (!is_function(callback)) {
|
|
return noop;
|
|
}
|
|
const callbacks = this.$$.callbacks[type] || (this.$$.callbacks[type] = []);
|
|
callbacks.push(callback);
|
|
return () => {
|
|
const index = callbacks.indexOf(callback);
|
|
if (index !== -1)
|
|
callbacks.splice(index, 1);
|
|
};
|
|
}
|
|
$set($$props) {
|
|
if (this.$$set && !is_empty($$props)) {
|
|
this.$$.skip_bound = true;
|
|
this.$$set($$props);
|
|
this.$$.skip_bound = false;
|
|
}
|
|
}
|
|
};
|
|
|
|
// node_modules/svelte/store/index.mjs
|
|
var subscriber_queue = [];
|
|
function readable(value, start) {
|
|
return {
|
|
subscribe: writable(value, start).subscribe
|
|
};
|
|
}
|
|
function writable(value, start = noop) {
|
|
let stop;
|
|
const subscribers = /* @__PURE__ */ new Set();
|
|
function set(new_value) {
|
|
if (safe_not_equal(value, new_value)) {
|
|
value = new_value;
|
|
if (stop) {
|
|
const run_queue = !subscriber_queue.length;
|
|
for (const subscriber of subscribers) {
|
|
subscriber[1]();
|
|
subscriber_queue.push(subscriber, value);
|
|
}
|
|
if (run_queue) {
|
|
for (let i = 0; i < subscriber_queue.length; i += 2) {
|
|
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
|
}
|
|
subscriber_queue.length = 0;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
function update2(fn) {
|
|
set(fn(value));
|
|
}
|
|
function subscribe2(run2, invalidate = noop) {
|
|
const subscriber = [run2, invalidate];
|
|
subscribers.add(subscriber);
|
|
if (subscribers.size === 1) {
|
|
stop = start(set) || noop;
|
|
}
|
|
run2(value);
|
|
return () => {
|
|
subscribers.delete(subscriber);
|
|
if (subscribers.size === 0 && stop) {
|
|
stop();
|
|
stop = null;
|
|
}
|
|
};
|
|
}
|
|
return { set, update: update2, subscribe: subscribe2 };
|
|
}
|
|
function derived(stores, fn, initial_value) {
|
|
const single = !Array.isArray(stores);
|
|
const stores_array = single ? [stores] : stores;
|
|
const auto = fn.length < 2;
|
|
return readable(initial_value, (set) => {
|
|
let started = false;
|
|
const values = [];
|
|
let pending = 0;
|
|
let cleanup = noop;
|
|
const sync = () => {
|
|
if (pending) {
|
|
return;
|
|
}
|
|
cleanup();
|
|
const result = fn(single ? values[0] : values, set);
|
|
if (auto) {
|
|
set(result);
|
|
} else {
|
|
cleanup = is_function(result) ? result : noop;
|
|
}
|
|
};
|
|
const unsubscribers = stores_array.map((store, i) => subscribe(store, (value) => {
|
|
values[i] = value;
|
|
pending &= ~(1 << i);
|
|
if (started) {
|
|
sync();
|
|
}
|
|
}, () => {
|
|
pending |= 1 << i;
|
|
}));
|
|
started = true;
|
|
sync();
|
|
return function stop() {
|
|
run_all(unsubscribers);
|
|
cleanup();
|
|
started = false;
|
|
};
|
|
});
|
|
}
|
|
|
|
// src/constants.ts
|
|
var viewTypeTimeline = "timeline";
|
|
var viewTypeWeekly = "weekly";
|
|
var defaultDurationMinutes = 30;
|
|
var snapStepMinutes = 10;
|
|
var icons = [
|
|
"any-key",
|
|
"audio-file",
|
|
"blocks",
|
|
"broken-link",
|
|
"bullet-list",
|
|
"calendar-with-checkmark",
|
|
"checkmark",
|
|
"create-new",
|
|
"cross",
|
|
"cross-in-box",
|
|
"crossed-star",
|
|
"dice",
|
|
"document",
|
|
"documents",
|
|
"dot-network",
|
|
"enter",
|
|
"expand-vertically",
|
|
"filled-pin",
|
|
"folder",
|
|
"gear",
|
|
"go-to-file",
|
|
"hashtag",
|
|
"help",
|
|
"horizontal-split",
|
|
"image-file",
|
|
"info",
|
|
"install",
|
|
"languages",
|
|
"left-arrow",
|
|
"left-arrow-with-tail",
|
|
"lines-of-text",
|
|
"link",
|
|
"logo-crystal",
|
|
"magnifying-glass",
|
|
"microphone",
|
|
"microphone-filled",
|
|
"open-vault",
|
|
"pane-layout",
|
|
"paper-plane",
|
|
"pdf-file",
|
|
"pencil",
|
|
"pin",
|
|
"popup-open",
|
|
"presentation",
|
|
"reset",
|
|
"right-arrow",
|
|
"right-arrow-with-tail",
|
|
"right-triangle",
|
|
"search",
|
|
"sheets-in-box",
|
|
"star",
|
|
"star-list",
|
|
"switch",
|
|
"three-horizontal-bars",
|
|
"trash",
|
|
"two-columns",
|
|
"up-and-down-arrows",
|
|
"uppercase-lowercase-a",
|
|
"vault",
|
|
"vertical-split",
|
|
"vertical-three-dots"
|
|
];
|
|
|
|
// src/global-store/app-store.ts
|
|
var appStore = writable();
|
|
|
|
// src/global-store/settings.ts
|
|
var settings = writable({
|
|
zoomLevel: 1,
|
|
startHour: 0,
|
|
centerNeedle: true,
|
|
showHelp: true,
|
|
timelineDateFormat: "LLLL",
|
|
plannerHeading: "Day planner",
|
|
plannerHeadingLevel: 1,
|
|
timelineColored: false,
|
|
timelineStartColor: "#006466",
|
|
timelineEndColor: "#4d194d"
|
|
});
|
|
|
|
// src/global-store/visible-date-range.ts
|
|
var visibleDateRange = writable();
|
|
|
|
// src/global-store/visible-day-in-timeline.ts
|
|
var visibleDayInTimeline = writable(window.moment());
|
|
|
|
// src/service/obsidian-facade.ts
|
|
var import_obsidian = require("obsidian");
|
|
var import_obsidian_daily_notes_interface = __toESM(require_main());
|
|
var import_typed_assert = __toESM(require_build());
|
|
|
|
// node_modules/ts-dedent/esm/index.js
|
|
function dedent(templ) {
|
|
var values = [];
|
|
for (var _i = 1; _i < arguments.length; _i++) {
|
|
values[_i - 1] = arguments[_i];
|
|
}
|
|
var strings = Array.from(typeof templ === "string" ? [templ] : templ);
|
|
strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
var indentLengths = strings.reduce(function(arr, str) {
|
|
var matches = str.match(/\n([\t ]+|(?!\s).)/g);
|
|
if (matches) {
|
|
return arr.concat(matches.map(function(match) {
|
|
var _a, _b;
|
|
return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
}));
|
|
}
|
|
return arr;
|
|
}, []);
|
|
if (indentLengths.length) {
|
|
var pattern_1 = new RegExp("\n[ ]{" + Math.min.apply(Math, indentLengths) + "}", "g");
|
|
strings = strings.map(function(str) {
|
|
return str.replace(pattern_1, "\n");
|
|
});
|
|
}
|
|
strings[0] = strings[0].replace(/^\r?\n/, "");
|
|
var string = strings[0];
|
|
values.forEach(function(value, i) {
|
|
var endentations = string.match(/(?:^|\n)( *)$/);
|
|
var endentation = endentations ? endentations[1] : "";
|
|
var indentedValue = value;
|
|
if (typeof value === "string" && value.includes("\n")) {
|
|
indentedValue = String(value).split("\n").map(function(str, i2) {
|
|
return i2 === 0 ? str : "" + endentation + str;
|
|
}).join("\n");
|
|
}
|
|
string += indentedValue + strings[i + 1];
|
|
});
|
|
return string;
|
|
}
|
|
|
|
// obsidian-metadata-utils/src/position.ts
|
|
var getTextAtPosition = (textInput, pos) => textInput.substring(pos.start.offset, pos.end.offset);
|
|
|
|
// obsidian-metadata-utils/src/list.ts
|
|
function isTopLevelListItem(listItem) {
|
|
return listItem.parent < 0;
|
|
}
|
|
|
|
// src/regexp.ts
|
|
var ulToken = `[-*+]`;
|
|
var olToken = `\\d+\\.`;
|
|
var listToken = `(${ulToken}|${olToken})\\s+`;
|
|
var checkbox = `\\[(?<completion>[^\\]])]\\s+`;
|
|
var checkboxOrNothing = `(${checkbox})?`;
|
|
var durationSeparator = `\\s*-{1,2}\\s*`;
|
|
var hours = `\\d{1,2}`;
|
|
var minutes = `\\d{2}`;
|
|
var hourMinuteSeparator = `[:. ]`;
|
|
var time = `(${hours})(?:${hourMinuteSeparator}?(${minutes}))?\\s*([apAP][mM])?`;
|
|
var timeRegExp = new RegExp(time);
|
|
var timestampRegExp = new RegExp(
|
|
`^(?<listTokens>${listToken}${checkboxOrNothing})(?<times>(?<start>${time})(?:${durationSeparator}(?<end>${time}))?)(?<text>.+)$`,
|
|
"im"
|
|
);
|
|
|
|
// src/util/id.ts
|
|
function getId() {
|
|
return String(Math.random());
|
|
}
|
|
|
|
// src/util/moment.ts
|
|
var import_fp = __toESM(require_fp());
|
|
var moment = window.moment;
|
|
function getMinutesSinceMidnight(moment2) {
|
|
return moment2.diff(moment2.clone().startOf("day"), "minutes");
|
|
}
|
|
function getMinutesSinceMidnightOfDayTo(day, moment2) {
|
|
return getDiffInMinutes(moment2, day.clone().startOf("day"));
|
|
}
|
|
function getDiffInMinutes(a, b) {
|
|
return Math.abs(a.diff(b, "minutes"));
|
|
}
|
|
function getDaysOfCurrentWeek() {
|
|
return getDaysOfWeek(window.moment());
|
|
}
|
|
function getDaysOfWeek(moment2) {
|
|
const firstDay = moment2.clone().startOf("isoWeek");
|
|
return (0, import_fp.range)(1, 7).reduce(
|
|
(result, dayIndex) => {
|
|
const nextDay = firstDay.clone().add(dayIndex, "day");
|
|
return [...result, nextDay];
|
|
},
|
|
[firstDay]
|
|
);
|
|
}
|
|
function minutesToMomentOfDay(minutesSinceMidnight, moment2) {
|
|
return moment2.clone().startOf("day").add(minutesSinceMidnight, "minutes");
|
|
}
|
|
function minutesToMoment(minutesSinceMidnight) {
|
|
return moment().startOf("day").add(minutesSinceMidnight, "minutes");
|
|
}
|
|
function addMinutes(moment2, minutes2) {
|
|
return moment2.clone().add(minutes2, "minutes");
|
|
}
|
|
function getRelationToNow(now, start, end) {
|
|
if (end.isBefore(now)) {
|
|
return "past";
|
|
}
|
|
if (start.isAfter(now)) {
|
|
return "future";
|
|
}
|
|
return "present";
|
|
}
|
|
function isToday(moment2) {
|
|
return moment2.isSame(window.moment(), "day");
|
|
}
|
|
|
|
// src/parser/calculate-default-duration.ts
|
|
function calculateDefaultDuration(item, next) {
|
|
if (item.endTime) {
|
|
return getDiffInMinutes(item.startTime, item.endTime);
|
|
}
|
|
if (next) {
|
|
const minutesUntilNext = getDiffInMinutes(next.startTime, item.startTime);
|
|
if (minutesUntilNext < defaultDurationMinutes) {
|
|
return minutesUntilNext;
|
|
}
|
|
}
|
|
return defaultDurationMinutes;
|
|
}
|
|
|
|
// src/parser/timestamp/timestamp.ts
|
|
function parseTimestamp(asText, day) {
|
|
if (!asText) {
|
|
return null;
|
|
}
|
|
const result = timeRegExp.exec(asText);
|
|
if (result === null) {
|
|
throw new Error(`${asText} is not a valid timestamp`);
|
|
}
|
|
const [, hours2, minutes2, ampm] = result;
|
|
let parsedHours = parseInt(hours2);
|
|
if (isNaN(parsedHours)) {
|
|
throw new Error(`${asText} is not a valid timestamp`);
|
|
}
|
|
const parsedMinutes = parseInt(minutes2) || 0;
|
|
if ((ampm == null ? void 0 : ampm.toLowerCase()) === "pm" && parsedHours < 12) {
|
|
parsedHours += 12;
|
|
}
|
|
const timeOfDay = window.moment.duration({
|
|
hours: parsedHours,
|
|
minutes: parsedMinutes
|
|
});
|
|
return day.clone().startOf("day").add(timeOfDay);
|
|
}
|
|
function taskLineToString(planItem, { startMinutes, durationMinutes }) {
|
|
return `${planItem.listTokens}${createTimestamp(
|
|
startMinutes,
|
|
durationMinutes
|
|
)} ${planItem.firstLineText}`;
|
|
}
|
|
function createTimestamp(startMinutes, durationMinutes) {
|
|
const start = minutesToMoment(startMinutes);
|
|
const end = addMinutes(start, durationMinutes);
|
|
return `${formatTimestamp(start)} - ${formatTimestamp(end)}`;
|
|
}
|
|
function formatTimestamp(moment2) {
|
|
return moment2.format("HH:mm");
|
|
}
|
|
|
|
// src/parser/parser.ts
|
|
function parsePlanItems(content, metadata, planHeadingContent, path, day) {
|
|
const listItemsUnderPlan = getListItemsUnderHeading(
|
|
metadata,
|
|
planHeadingContent
|
|
);
|
|
if (!listItemsUnderPlan) {
|
|
return [];
|
|
}
|
|
const listItemsWithContent = getListItemContent(content, listItemsUnderPlan);
|
|
return listItemsWithContent.map(
|
|
(li) => createPlanItem({
|
|
line: li.listItemLineContent,
|
|
completeContent: li.listItemCompleteContent,
|
|
location: { path, line: li.line },
|
|
day
|
|
})
|
|
).filter((item) => item !== null).map((item, index, items) => {
|
|
const next = items[index + 1];
|
|
const durationMinutes = calculateDefaultDuration(item, next);
|
|
const endTime = item.endTime || item.startTime.clone().add(durationMinutes, "minutes");
|
|
return {
|
|
...item,
|
|
endTime,
|
|
startMinutes: getMinutesSinceMidnightOfDayTo(day, item.startTime),
|
|
endMinutes: getMinutesSinceMidnightOfDayTo(day, endTime),
|
|
durationMinutes
|
|
};
|
|
}).sort((a, b) => a.startMinutes - b.startMinutes);
|
|
}
|
|
function getListItemsUnderHeading(metadata, heading) {
|
|
var _a;
|
|
const { headings } = metadata;
|
|
if (!headings) {
|
|
return [];
|
|
}
|
|
const planHeadingIndex = headings.findIndex((h) => h.heading === heading);
|
|
if (planHeadingIndex < 0) {
|
|
return [];
|
|
}
|
|
const planHeading = headings[planHeadingIndex];
|
|
const nextHeadingOfSameLevel = headings.slice(planHeadingIndex + 1).find((heading2) => heading2.level <= planHeading.level);
|
|
return (_a = metadata.listItems) == null ? void 0 : _a.filter((li) => {
|
|
const isBelowPlan = li.position.start.line > planHeading.position.start.line;
|
|
const isAboveNextHeadingIfItExists = !nextHeadingOfSameLevel || li.position.start.line < nextHeadingOfSameLevel.position.start.line;
|
|
return isBelowPlan && isAboveNextHeadingIfItExists;
|
|
});
|
|
}
|
|
function getHeadingByText(metadata, text2) {
|
|
const { headings = [] } = metadata;
|
|
return headings == null ? void 0 : headings.find((h) => h.heading === text2);
|
|
}
|
|
function createPlanItem({
|
|
line,
|
|
completeContent,
|
|
location,
|
|
day
|
|
}) {
|
|
const match = timestampRegExp.exec(line.trim());
|
|
if (!match) {
|
|
return null;
|
|
}
|
|
const {
|
|
groups: { listTokens, start, end, text: text2 }
|
|
} = match;
|
|
const startTime = parseTimestamp(start, day);
|
|
return {
|
|
listTokens,
|
|
startTime,
|
|
endTime: parseTimestamp(end, day),
|
|
rawStartTime: start,
|
|
rawEndTime: end,
|
|
text: getDisplayedText(match, completeContent),
|
|
firstLineText: text2,
|
|
location,
|
|
id: getId()
|
|
};
|
|
}
|
|
function getDisplayedText({ groups: { text: text2, listTokens, completion } }, completeContent) {
|
|
const isTask = (completion == null ? void 0 : completion.length) > 0;
|
|
const indexOfFirstNewline = completeContent.indexOf("\n");
|
|
const indexAfterFirstNewline = indexOfFirstNewline + 1;
|
|
const linesAfterFirst = completeContent.substring(indexAfterFirstNewline);
|
|
if (indexOfFirstNewline < 0) {
|
|
if (isTask) {
|
|
return `${listTokens}${text2}`;
|
|
}
|
|
return text2;
|
|
}
|
|
if (isTask) {
|
|
return `${listTokens}${text2}
|
|
${linesAfterFirst}`;
|
|
}
|
|
const formattedLinesAfterFirst = dedent(linesAfterFirst).trimStart();
|
|
return `${text2}
|
|
${formattedLinesAfterFirst}`;
|
|
}
|
|
function groupTopListItemsWithDescendants(listItems) {
|
|
return listItems.reduce((result, current) => {
|
|
if (isTopLevelListItem(current)) {
|
|
result.push({ root: current, descendants: [] });
|
|
} else {
|
|
const previousTopListItem = result[result.length - 1];
|
|
previousTopListItem.descendants.push(current);
|
|
}
|
|
return result;
|
|
}, []);
|
|
}
|
|
function getListItemContent(content, listItems) {
|
|
return groupTopListItemsWithDescendants(listItems).map(
|
|
({ root, descendants }) => {
|
|
var _a, _b;
|
|
const lastDescendantPosition = (_b = (_a = descendants == null ? void 0 : descendants[descendants.length - 1]) == null ? void 0 : _a.position) == null ? void 0 : _b.end;
|
|
const betweenRootAndLastDescendant = {
|
|
start: root.position.start,
|
|
end: lastDescendantPosition || root.position.end
|
|
};
|
|
return {
|
|
line: root.position.start.line,
|
|
listItemLineContent: getTextAtPosition(content, root.position),
|
|
listItemCompleteContent: getTextAtPosition(
|
|
content,
|
|
betweenRootAndLastDescendant
|
|
)
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|
|
// src/service/obsidian-facade.ts
|
|
var ObsidianFacade = class {
|
|
constructor(workspace, vault, metadataCache, settings2) {
|
|
this.workspace = workspace;
|
|
this.vault = vault;
|
|
this.metadataCache = metadataCache;
|
|
this.settings = settings2;
|
|
}
|
|
async openFileInEditor(file) {
|
|
var _a;
|
|
const leaf = this.workspace.getLeaf(false);
|
|
await leaf.openFile(file);
|
|
return (_a = this.workspace.activeEditor) == null ? void 0 : _a.editor;
|
|
}
|
|
// todo: this class should not know about daily notes
|
|
async openFileForDay(moment2) {
|
|
const dailyNote = (0, import_obsidian_daily_notes_interface.getDailyNote)(moment2, (0, import_obsidian_daily_notes_interface.getAllDailyNotes)()) || await (0, import_obsidian_daily_notes_interface.createDailyNote)(moment2);
|
|
return this.openFileInEditor(dailyNote);
|
|
}
|
|
getFileByPath(path) {
|
|
const file = this.vault.getAbstractFileByPath(path);
|
|
(0, import_typed_assert.isInstanceOf)(file, import_obsidian.TFile, `Unable to open file: ${path}`);
|
|
return file;
|
|
}
|
|
getMetadataForPath(path) {
|
|
const file = this.getFileByPath(path);
|
|
return this.metadataCache.getFileCache(file);
|
|
}
|
|
async revealLineInFile(path, line) {
|
|
var _a;
|
|
const file = this.getFileByPath(path);
|
|
const editor = await this.openFileInEditor(file);
|
|
(_a = this.workspace.getActiveViewOfType(import_obsidian.MarkdownView)) == null ? void 0 : _a.setEphemeralState({ line });
|
|
editor.setCursor({ line, ch: 0 });
|
|
}
|
|
async editFile(path, editFn) {
|
|
const file = this.vault.getAbstractFileByPath(path);
|
|
(0, import_typed_assert.isInstanceOf)(file, import_obsidian.TFile, `${path} is not a markdown file`);
|
|
const contents = await this.vault.read(file);
|
|
const newContents = editFn(contents);
|
|
await this.vault.modify(file, newContents);
|
|
}
|
|
// todo: move to plan-editor. it should be a wrapper for plans
|
|
async getPlanItemsFromFile(file) {
|
|
if (!file) {
|
|
return [];
|
|
}
|
|
const { plannerHeading } = this.settings;
|
|
const fileContents = await this.vault.read(file);
|
|
const metadata = this.metadataCache.getFileCache(file);
|
|
const fileDay = (0, import_obsidian_daily_notes_interface.getDateFromFile)(file, "day");
|
|
(0, import_typed_assert.isNotVoid)(
|
|
fileDay,
|
|
`Tried to parse plan in file that is not a daily note: ${file.path}`
|
|
);
|
|
return parsePlanItems(
|
|
fileContents,
|
|
metadata,
|
|
plannerHeading,
|
|
file.path,
|
|
fileDay
|
|
);
|
|
}
|
|
};
|
|
|
|
// src/service/plan-editor.ts
|
|
var import_fp2 = __toESM(require_fp());
|
|
|
|
// src/util/task-utils.ts
|
|
function isEqualTask(a, b) {
|
|
return a.id === b.id && a.startMinutes === b.startMinutes && a.endMinutes === b.endMinutes && // todo: remove after endMinutes is replaced with a getter
|
|
a.durationMinutes === b.durationMinutes;
|
|
}
|
|
|
|
// src/service/plan-editor.ts
|
|
var PlanEditor = class {
|
|
constructor(settings2, obsidianFacade) {
|
|
this.settings = settings2;
|
|
this.obsidianFacade = obsidianFacade;
|
|
this.syncTasksWithFile = async (baseline, updated) => {
|
|
const pristine = updated.filter(
|
|
(task) => baseline.find((baselineTask) => isEqualTask(task, baselineTask))
|
|
);
|
|
const dirty = (0, import_fp2.difference)(updated, pristine);
|
|
const [edited, created] = (0, import_fp2.partition)((task) => task.location.line, dirty);
|
|
const path = updated[0].location.path;
|
|
await this.obsidianFacade.editFile(path, (contents) => {
|
|
const withUpdatedEdited = edited.reduce(
|
|
(result2, current) => this.updateTaskInFileContents(result2, current),
|
|
contents
|
|
);
|
|
const createdList = created.map(
|
|
(task) => taskLineToString(task, { ...task })
|
|
);
|
|
const metadata = this.obsidianFacade.getMetadataForPath(path) || {};
|
|
const [planEndLine, splitContents] = this.getPlanEndLine(
|
|
withUpdatedEdited.split("\n"),
|
|
metadata
|
|
);
|
|
const result = [...splitContents];
|
|
result.splice(planEndLine + 1, 0, ...createdList);
|
|
return result.join("\n");
|
|
});
|
|
};
|
|
}
|
|
createPlannerHeading() {
|
|
const { plannerHeading, plannerHeadingLevel } = this.settings;
|
|
const headingTokens = "#".repeat(plannerHeadingLevel);
|
|
return `${headingTokens} ${plannerHeading}`;
|
|
}
|
|
// todo: we might want to update not only duration. Better: syncTaskWithNote
|
|
updateTaskInFileContents(contents, task) {
|
|
return contents.split("\n").map((line, index) => {
|
|
var _a;
|
|
if (index === ((_a = task.location) == null ? void 0 : _a.line)) {
|
|
return taskLineToString(task, {
|
|
startMinutes: task.startMinutes,
|
|
durationMinutes: task.durationMinutes
|
|
});
|
|
}
|
|
return line;
|
|
}).join("\n");
|
|
}
|
|
getPlanEndLine(contents, metadata) {
|
|
const planHeading = getHeadingByText(
|
|
metadata,
|
|
this.settings.plannerHeading
|
|
);
|
|
const planListItems = getListItemsUnderHeading(
|
|
metadata,
|
|
this.settings.plannerHeading
|
|
);
|
|
if ((planListItems == null ? void 0 : planListItems.length) > 0) {
|
|
const lastListItem = planListItems[planListItems.length - 1];
|
|
return [lastListItem.position.start.line, contents];
|
|
}
|
|
if (planHeading) {
|
|
return [planHeading.position.start.line, contents];
|
|
}
|
|
const withNewPlan = [...contents, "", this.createPlannerHeading(), ""];
|
|
return [withNewPlan.length, withNewPlan];
|
|
}
|
|
};
|
|
|
|
// src/settings.ts
|
|
var DayPlannerSettings = class {
|
|
constructor() {
|
|
this.circularProgress = false;
|
|
this.nowAndNextInStatusBar = false;
|
|
this.showTaskNotification = false;
|
|
this.zoomLevel = 2;
|
|
this.timelineIcon = "calendar-with-checkmark";
|
|
this.endLabel = "All done";
|
|
this.startHour = 6;
|
|
this.timelineDateFormat = "LLLL";
|
|
this.centerNeedle = false;
|
|
this.showHelp = true;
|
|
this.plannerHeading = "Day planner";
|
|
this.plannerHeadingLevel = 1;
|
|
this.timelineColored = false;
|
|
this.timelineStartColor = "#006466";
|
|
this.timelineEndColor = "#4d194d";
|
|
}
|
|
};
|
|
|
|
// src/ui/settings-tab.ts
|
|
var import_obsidian2 = require("obsidian");
|
|
var DayPlannerSettingsTab = class extends import_obsidian2.PluginSettingTab {
|
|
constructor(app, plugin) {
|
|
super(app, plugin);
|
|
this.plugin = plugin;
|
|
}
|
|
display() {
|
|
const { containerEl } = this;
|
|
containerEl.empty();
|
|
new import_obsidian2.Setting(containerEl).setName("Status Bar - Circular Progress").setDesc("Display a circular progress bar in the status bar").addToggle(
|
|
(toggle) => toggle.setValue(this.plugin.settings.circularProgress).onChange((value) => {
|
|
this.plugin.settings.circularProgress = value;
|
|
this.plugin.saveData(this.plugin.settings);
|
|
})
|
|
);
|
|
new import_obsidian2.Setting(containerEl).setName("Status Bar - Now and Next").setDesc("Display now and next tasks in the status bar").addToggle(
|
|
(toggle) => toggle.setValue(this.plugin.settings.nowAndNextInStatusBar).onChange((value) => {
|
|
this.plugin.settings.nowAndNextInStatusBar = value;
|
|
this.plugin.saveData(this.plugin.settings);
|
|
})
|
|
);
|
|
new import_obsidian2.Setting(containerEl).setName("Task Notification").setDesc("Display a notification when a new task is started").addToggle(
|
|
(toggle) => toggle.setValue(this.plugin.settings.showTaskNotification).onChange((value) => {
|
|
this.plugin.settings.showTaskNotification = value;
|
|
this.plugin.saveData(this.plugin.settings);
|
|
})
|
|
);
|
|
new import_obsidian2.Setting(containerEl).setName("Timeline Zoom Level").setDesc(
|
|
"The zoom level to display the timeline. The higher the number, the more vertical space each task will take up."
|
|
).addSlider(
|
|
(slider) => {
|
|
var _a;
|
|
return slider.setLimits(1, 5, 1).setValue((_a = Number(this.plugin.settings.zoomLevel)) != null ? _a : 4).setDynamicTooltip().onChange(async (value) => {
|
|
settings.update((settings2) => ({ ...settings2, zoomLevel: value }));
|
|
this.plugin.settings.zoomLevel = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
});
|
|
}
|
|
);
|
|
new import_obsidian2.Setting(containerEl).setName("Timeline Icon").setDesc(
|
|
"The icon of the timeline pane. Reopen timeline pane or restart obsidian to see the change."
|
|
).addDropdown((dropdown) => {
|
|
var _a;
|
|
icons.forEach((icon) => dropdown.addOption(icon, icon));
|
|
return dropdown.setValue(
|
|
(_a = this.plugin.settings.timelineIcon) != null ? _a : "calendar-with-checkmark"
|
|
).onChange((value) => {
|
|
this.plugin.settings.timelineIcon = value;
|
|
this.plugin.saveData(this.plugin.settings);
|
|
});
|
|
});
|
|
new import_obsidian2.Setting(containerEl).setName("Start Hour").setDesc("The planner is going to start at this hour each day").addDropdown(
|
|
(component) => component.addOptions({
|
|
"0": "0",
|
|
"1": "1",
|
|
"2": "2",
|
|
"3": "3",
|
|
"4": "4",
|
|
"5": "5",
|
|
"6": "6",
|
|
"7": "7",
|
|
"8": "8",
|
|
"9": "9",
|
|
"10": "10",
|
|
"11": "11",
|
|
"12": "12"
|
|
}).setValue(String(this.plugin.settings.startHour)).onChange(async (value) => {
|
|
const asNumber = Number(value);
|
|
settings.update((previous) => ({
|
|
...previous,
|
|
startHour: asNumber
|
|
}));
|
|
this.plugin.settings.startHour = asNumber;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
})
|
|
);
|
|
new import_obsidian2.Setting(containerEl).setName("Date Format in Timeline Header").then((component) => {
|
|
component.setDesc(
|
|
createFragment((fragment) => {
|
|
fragment.appendText("Your current syntax looks like this: ");
|
|
component.addMomentFormat(
|
|
(momentFormat) => momentFormat.setValue(this.plugin.settings.timelineDateFormat).setSampleEl(fragment.createSpan()).onChange(async (value) => {
|
|
settings.update((previous) => ({
|
|
...previous,
|
|
timelineDateFormat: value
|
|
}));
|
|
this.plugin.settings.timelineDateFormat = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
})
|
|
);
|
|
fragment.append(
|
|
createEl("br"),
|
|
createEl(
|
|
"a",
|
|
{
|
|
text: "format reference",
|
|
href: "https://momentjs.com/docs/#/displaying/format/"
|
|
},
|
|
(a) => {
|
|
a.setAttr("target", "_blank");
|
|
}
|
|
)
|
|
);
|
|
})
|
|
);
|
|
});
|
|
new import_obsidian2.Setting(containerEl).setName("Center the Pointer in the Timeline View").setDesc(
|
|
"Should the pointer continuously get scrolled to the center of the view"
|
|
).addToggle((component) => {
|
|
component.setValue(this.plugin.settings.centerNeedle).onChange(async (value) => {
|
|
settings.update((previous) => ({
|
|
...previous,
|
|
centerNeedle: value
|
|
}));
|
|
this.plugin.settings.centerNeedle = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
});
|
|
});
|
|
new import_obsidian2.Setting(containerEl).setName("Planner Heading").setDesc(
|
|
`When you create a planner, this text is going to be in the heading.
|
|
When you open a file, the plugin will search for this heading to detect a day plan`
|
|
).addText(
|
|
(component) => component.setValue(this.plugin.settings.plannerHeading).onChange(async (value) => {
|
|
settings.update((previous) => ({
|
|
...previous,
|
|
plannerHeading: value
|
|
}));
|
|
this.plugin.settings.plannerHeading = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
})
|
|
);
|
|
new import_obsidian2.Setting(containerEl).setName("Planner heading level").setDesc(
|
|
"When you create a planner in a file, this level of heading is going to be used"
|
|
).addSlider(
|
|
(component) => component.setLimits(1, 6, 1).setDynamicTooltip().setValue(this.plugin.settings.plannerHeadingLevel).onChange(async (value) => {
|
|
settings.update((previous) => ({
|
|
...previous,
|
|
plannerHeadingLevel: value
|
|
}));
|
|
this.plugin.settings.plannerHeadingLevel = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
})
|
|
);
|
|
new import_obsidian2.Setting(containerEl).setName("Colorful Timeline").setDesc(
|
|
"If the planner timeline should be monochrome or color tasks based on time of day"
|
|
).addToggle((component) => {
|
|
component.setValue(this.plugin.settings.timelineColored).onChange(async (value) => {
|
|
settings.update((previous) => ({
|
|
...previous,
|
|
timelineColored: value
|
|
}));
|
|
this.plugin.settings.timelineColored = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
});
|
|
});
|
|
new import_obsidian2.Setting(containerEl).setName("Colorful Timeline - Start Color").addColorPicker((component) => {
|
|
component.setValue(this.plugin.settings.timelineStartColor).onChange(async (value) => {
|
|
settings.update((previous) => ({
|
|
...previous,
|
|
timelineStartColor: value
|
|
}));
|
|
this.plugin.settings.timelineStartColor = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
});
|
|
});
|
|
new import_obsidian2.Setting(containerEl).setName("Colorful Timeline - End Color").addColorPicker((component) => {
|
|
component.setValue(this.plugin.settings.timelineEndColor).onChange(async (value) => {
|
|
settings.update((previous) => ({
|
|
...previous,
|
|
timelineEndColor: value
|
|
}));
|
|
this.plugin.settings.timelineEndColor = value;
|
|
await this.plugin.saveData(this.plugin.settings);
|
|
});
|
|
});
|
|
}
|
|
modeDescriptionContent() {
|
|
const descEl = document.createDocumentFragment();
|
|
descEl.appendText("Choose between 3 modes to use the Day Planner plugin:");
|
|
descEl.appendChild(document.createElement("br"));
|
|
descEl.appendChild(document.createElement("strong")).appendText("File mode");
|
|
descEl.appendChild(document.createElement("br"));
|
|
descEl.appendText(
|
|
"Plugin automatically generates day planner notes for each day within a Day Planners folder."
|
|
);
|
|
descEl.appendChild(document.createElement("br"));
|
|
descEl.appendChild(document.createElement("strong")).appendText("Command mode");
|
|
descEl.appendChild(document.createElement("br"));
|
|
descEl.appendText(
|
|
"Command used to insert a Day Planner for today within the current note."
|
|
);
|
|
descEl.appendChild(document.createElement("br"));
|
|
descEl.appendChild(document.createElement("strong")).appendText("Daily mode");
|
|
descEl.appendChild(document.createElement("br"));
|
|
descEl.appendText(
|
|
"Plugin automatically links to the current daily note. Daily notes plugin must be enabled."
|
|
);
|
|
descEl.appendChild(document.createElement("br"));
|
|
this.addDocsLink(descEl);
|
|
return descEl;
|
|
}
|
|
addDocsLink(descEl) {
|
|
const a = document.createElement("a");
|
|
a.href = "https://github.com/lynchjames/obsidian-day-planner/blob/main/README.md";
|
|
a.text = "plugin README";
|
|
a.target = "_blank";
|
|
descEl.appendChild(a);
|
|
descEl.appendChild(document.createElement("br"));
|
|
}
|
|
};
|
|
|
|
// src/ui/status-bar.ts
|
|
var StatusBar = class {
|
|
constructor(settings2, containerEl, workspace) {
|
|
this.settings = settings2;
|
|
this.containerEl = containerEl;
|
|
this.workspace = workspace;
|
|
this.containerEl.addClass("day-planner");
|
|
this.setupCard();
|
|
this.statusBarText = this.containerEl.createEl("span", {
|
|
cls: ["status-bar-item-segment", "day-planner-status-bar-text"]
|
|
});
|
|
this.setupCircularProgressBar();
|
|
this.setupHorizontalProgressBar();
|
|
this.nextText = this.containerEl.createEl("span", {
|
|
cls: ["status-bar-item-segment", "day-planner-status-bar-text"]
|
|
});
|
|
this.setupStatusBarEvents();
|
|
}
|
|
async update(planItems) {
|
|
this.containerEl.show();
|
|
if (planItems.length > 0) {
|
|
this.updateProgress(planItems);
|
|
} else {
|
|
this.setEmpty();
|
|
}
|
|
}
|
|
setEmpty() {
|
|
this.setText("No plan for today");
|
|
}
|
|
setText(text2) {
|
|
this.statusBarText.textContent = text2;
|
|
}
|
|
setupStatusBarEvents() {
|
|
this.containerEl.onClickEvent(async () => {
|
|
});
|
|
this.containerEl.on("mouseenter", ".day-planner", () => {
|
|
this.card.show();
|
|
});
|
|
this.containerEl.on("mouseleave", ".day-planner", () => {
|
|
this.card.hide();
|
|
});
|
|
}
|
|
hideProgress() {
|
|
this.statusBarProgress.hide();
|
|
this.circle.hide();
|
|
this.nextText.hide();
|
|
}
|
|
updateProgress(planItems) {
|
|
const now = window.moment();
|
|
const currentItemIndex = planItems.findIndex(
|
|
(item) => item.startTime.isBefore(now) && item.endTime.isAfter(now)
|
|
);
|
|
if (currentItemIndex < 0) {
|
|
this.hideProgress();
|
|
this.statusBarText.innerText = this.settings.endLabel;
|
|
return;
|
|
}
|
|
const currentItem = planItems[currentItemIndex];
|
|
const nextItem = planItems[currentItemIndex + 1];
|
|
const minutesFromStart = getDiffInMinutes(currentItem.startTime, now);
|
|
const percentageComplete = minutesFromStart / (currentItem.durationMinutes / 100);
|
|
this.updateStatusBarText(currentItem, nextItem);
|
|
if (nextItem) {
|
|
this.setStatusText(
|
|
getDiffInMinutes(now, nextItem.startTime),
|
|
currentItem,
|
|
nextItem,
|
|
percentageComplete
|
|
);
|
|
}
|
|
if (this.settings.circularProgress) {
|
|
this.statusBarProgress.hide();
|
|
this.progressCircle(percentageComplete);
|
|
} else {
|
|
this.circle.hide();
|
|
this.progressBar(percentageComplete);
|
|
}
|
|
}
|
|
progressBar(percentageComplete) {
|
|
this.statusBarCurrentProgress.style.width = `${percentageComplete}%`;
|
|
this.statusBarProgress.show();
|
|
}
|
|
progressCircle(percentageComplete) {
|
|
this.circle.setAttr("data-value", percentageComplete.toFixed(0));
|
|
this.circle.show();
|
|
}
|
|
setStatusText(minsUntilNext, current, next, percentageComplete) {
|
|
const minsUntilNextText = minsUntilNext === 0 ? "1" : minsUntilNext;
|
|
const minsText = `${minsUntilNextText} min${minsUntilNextText === "1" ? "" : "s"}`;
|
|
const percent = percentageComplete.toFixed(0);
|
|
const currentTaskStatus = `Current Task (${percent}% complete)`;
|
|
const currentTaskTimeAndText = `${current.rawStartTime} ${current.text}`;
|
|
const nextTask = `Next Task (in ${minsText})`;
|
|
const nextTaskTimeAndText = `${next.rawStartTime} ${next.text}`;
|
|
this.cardCurrent.textContent = `${currentTaskStatus}: ${currentTaskTimeAndText}`;
|
|
this.cardNext.textContent = `${nextTask}: ${nextTaskTimeAndText}`;
|
|
this.taskNotification(
|
|
current,
|
|
currentTaskTimeAndText,
|
|
nextTask,
|
|
nextTaskTimeAndText
|
|
);
|
|
}
|
|
updateStatusBarText(currentItem, nextItem) {
|
|
if (this.settings.nowAndNextInStatusBar) {
|
|
this.statusBarText.textContent = `Now: ${currentItem.rawStartTime} ${this.ellipsis(currentItem.text, 15)}`;
|
|
if (nextItem) {
|
|
this.nextText.textContent = `Next: ${nextItem.rawStartTime} ${this.ellipsis(nextItem.text, 15)}`;
|
|
this.nextText.show();
|
|
}
|
|
this.nextText.hide();
|
|
} else {
|
|
this.nextText.hide();
|
|
const minutesLeft = getDiffInMinutes(
|
|
currentItem.endTime,
|
|
window.moment()
|
|
);
|
|
this.statusBarText.textContent = `Minutes left: ${minutesLeft}`;
|
|
}
|
|
}
|
|
taskNotification(current, currentTaskTimeAndText, nextTask, nextTaskText) {
|
|
if (this.settings.showTaskNotification && this.currentTime !== void 0 && this.currentTime !== current.startTime.toString()) {
|
|
new Notification(`Task started, ${currentTaskTimeAndText}`, {
|
|
body: `${nextTask}: ${nextTaskText}`,
|
|
requireInteraction: true
|
|
});
|
|
}
|
|
this.currentTime = current.startTime.toString();
|
|
}
|
|
// todo: this doesn't belong to the class
|
|
ellipsis(input, limit) {
|
|
if (input.length <= limit) {
|
|
return input;
|
|
}
|
|
return input.substring(0, limit) + "...";
|
|
}
|
|
setupHorizontalProgressBar() {
|
|
this.statusBarProgress = this.containerEl.createEl("div", {
|
|
cls: ["status-bar-item-segment", "day-planner-progress-bar"]
|
|
});
|
|
this.statusBarProgress.hide();
|
|
this.statusBarCurrentProgress = this.statusBarProgress.createEl("div", {
|
|
cls: "day-planner-progress-value"
|
|
});
|
|
}
|
|
setupCircularProgressBar() {
|
|
this.circle = this.containerEl.createEl("div", {
|
|
cls: ["status-bar-item-segment", "progress-pie day-planner"]
|
|
});
|
|
}
|
|
setupCard() {
|
|
this.card = this.containerEl.createEl("div", {
|
|
cls: "day-planner-status-card"
|
|
});
|
|
this.cardCurrent = this.card.createEl("span");
|
|
this.card.createEl("br");
|
|
this.card.createEl("br");
|
|
this.cardNext = this.card.createEl("span");
|
|
this.card.createEl("div", { cls: "arrow-down" });
|
|
}
|
|
};
|
|
|
|
// src/ui/timeline-view.ts
|
|
var import_obsidian4 = require("obsidian");
|
|
|
|
// src/ui/components/timeline.svelte
|
|
var import_obsidian_daily_notes_interface4 = __toESM(require_main());
|
|
|
|
// src/global-store/settings-utils.ts
|
|
var hourSize = derived(
|
|
settings,
|
|
($settings) => $settings.zoomLevel * 60
|
|
);
|
|
var visibleHours = derived(
|
|
settings,
|
|
($settings) => [...Array(24).keys()].slice($settings.startHour)
|
|
);
|
|
var hiddenHoursSize = derived(
|
|
[settings, hourSize],
|
|
([$settings, $hourSize]) => $settings.startHour * $hourSize
|
|
);
|
|
var timeToTimelineOffset = derived(
|
|
[settings, hiddenHoursSize],
|
|
([$settings, $hiddenHoursSize]) => (minutes2) => minutes2 * $settings.zoomLevel - $hiddenHoursSize
|
|
);
|
|
function snap(coords, zoomLevel) {
|
|
return coords - coords % (snapStepMinutes * zoomLevel);
|
|
}
|
|
function getTimeFromYOffset(yCoords) {
|
|
const { zoomLevel } = get_store_value(settings);
|
|
return (yCoords + get_store_value(hiddenHoursSize)) / zoomLevel;
|
|
}
|
|
function sizeToDuration(size) {
|
|
const { zoomLevel } = get_store_value(settings);
|
|
return size / zoomLevel;
|
|
}
|
|
var durationToSize = derived(settings, ($settings) => {
|
|
return (duration) => {
|
|
const { zoomLevel } = $settings;
|
|
return duration * zoomLevel;
|
|
};
|
|
});
|
|
|
|
// src/overlap/overlap.ts
|
|
var import_fraction = __toESM(require_fraction());
|
|
var import_fp3 = __toESM(require_fp());
|
|
|
|
// src/overlap/horizontal-placing.ts
|
|
function getHorizontalPlacing(overlap) {
|
|
const widthPercent = overlap ? overlap.span / overlap.columns * 100 : 100;
|
|
const xOffsetPercent = overlap ? 100 / overlap.columns * overlap.start : 0;
|
|
return {
|
|
widthPercent,
|
|
xOffsetPercent
|
|
};
|
|
}
|
|
|
|
// src/overlap/overlap.ts
|
|
var empty2 = "empty";
|
|
var taken = "taken";
|
|
function computeOverlap(items) {
|
|
return items.reduce((overlapLookup, item) => {
|
|
const overlapGroup = getItemsOverlappingItemAndEachOther(item, items);
|
|
return computeOverlapForGroup(overlapGroup, overlapLookup);
|
|
}, /* @__PURE__ */ new Map());
|
|
}
|
|
function getItemsOverlappingItemAndEachOther(item, items) {
|
|
return items.reduce(
|
|
(result, current) => {
|
|
if (current === item) {
|
|
return result;
|
|
}
|
|
const currentOverlapsWithPreviousItems = result.every(
|
|
(intersectingItem) => overlaps(intersectingItem, current)
|
|
);
|
|
if (currentOverlapsWithPreviousItems) {
|
|
result.push(current);
|
|
}
|
|
return result;
|
|
},
|
|
[item]
|
|
).sort((a, b) => a.startMinutes - b.startMinutes);
|
|
}
|
|
function computeOverlapForGroup(overlapGroup, previousLookup) {
|
|
const newLookup = new Map([...previousLookup]);
|
|
const [itemsPlacedPreviously, itemsToBePlaced] = (0, import_fp3.partition)(
|
|
({ id }) => newLookup.has(id),
|
|
overlapGroup
|
|
);
|
|
if (itemsToBePlaced.length === 0) {
|
|
return newLookup;
|
|
}
|
|
const fractionOfPlacedItems = itemsPlacedPreviously.reduce((sum, current) => {
|
|
const { span, columns } = newLookup.get(current.id);
|
|
return new import_fraction.default(span, columns).add(sum);
|
|
}, new import_fraction.default(0));
|
|
const fractionForNewItems = new import_fraction.default(1).sub(fractionOfPlacedItems);
|
|
const fractionForEachNewItem = fractionForNewItems.div(
|
|
itemsToBePlaced.length
|
|
);
|
|
const columnsForNewGroup = fractionForEachNewItem.d;
|
|
const newItemInherentSpan = fractionForEachNewItem.n;
|
|
const slots = Array(columnsForNewGroup).fill(empty2);
|
|
itemsPlacedPreviously.forEach((item) => {
|
|
const { start, span, columns: previousColumns } = newLookup.get(item.id);
|
|
const scale = columnsForNewGroup / previousColumns;
|
|
const scaledStart = scale * start;
|
|
const scaledSpan = scale * span;
|
|
const scaledEnd = scaledStart + scaledSpan;
|
|
slots.fill(taken, scaledStart, scaledEnd);
|
|
});
|
|
itemsToBePlaced.forEach((itemInGroup) => {
|
|
const firstFreeSlotIndex = slots.findIndex((slot) => slot === empty2);
|
|
const nextTakenSlotIndex = slots.findIndex(
|
|
(slot, i) => i > firstFreeSlotIndex && slot === taken
|
|
);
|
|
const fromFreeToNextTakenSlot = nextTakenSlotIndex - firstFreeSlotIndex;
|
|
const onlyEmptySlotsLeft = nextTakenSlotIndex === -1;
|
|
const span = onlyEmptySlotsLeft ? newItemInherentSpan : Math.min(newItemInherentSpan, fromFreeToNextTakenSlot);
|
|
const fillEnd = firstFreeSlotIndex + span;
|
|
slots.fill(taken, firstFreeSlotIndex, fillEnd);
|
|
newLookup.set(itemInGroup.id, {
|
|
start: firstFreeSlotIndex,
|
|
span,
|
|
columns: columnsForNewGroup
|
|
});
|
|
});
|
|
return newLookup;
|
|
}
|
|
function overlaps(a, b) {
|
|
const [early, late] = a.startMinutes < b.startMinutes ? [a, b] : [b, a];
|
|
return early.endMinutes > late.startMinutes;
|
|
}
|
|
function addPlacing(planItems) {
|
|
const overlapLookup = computeOverlap(planItems);
|
|
return planItems.map((planItem) => {
|
|
const overlap = overlapLookup.get(planItem.id);
|
|
return {
|
|
...planItem,
|
|
placing: getHorizontalPlacing(overlap)
|
|
};
|
|
});
|
|
}
|
|
|
|
// src/ui/components/column.svelte
|
|
function add_css(target) {
|
|
append_styles(target, "svelte-af5q45", ".task-grid.svelte-af5q45{position:relative;flex:1 0 0}.time-grid-block.svelte-af5q45{flex:1 0 0;border-bottom:1px solid var(--background-modifier-border)}.half-hour-separator.svelte-af5q45{border-bottom:1px dashed var(--background-modifier-border)}");
|
|
}
|
|
function get_each_context(ctx, list, i) {
|
|
const child_ctx = ctx.slice();
|
|
child_ctx[4] = list[i];
|
|
return child_ctx;
|
|
}
|
|
function create_each_block(ctx) {
|
|
let div1;
|
|
let div0;
|
|
let style_height = `${/*$hourSize*/
|
|
ctx[1] / 2}px`;
|
|
let t;
|
|
let style_height_1 = `${/*$hourSize*/
|
|
ctx[1]}px`;
|
|
return {
|
|
c() {
|
|
div1 = element("div");
|
|
div0 = element("div");
|
|
t = space();
|
|
attr(div0, "class", "half-hour-separator svelte-af5q45");
|
|
set_style(div0, "height", style_height);
|
|
attr(div1, "class", "time-grid-block svelte-af5q45");
|
|
set_style(div1, "height", style_height_1);
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div1, anchor);
|
|
append(div1, div0);
|
|
append(div1, t);
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (dirty & /*$hourSize*/
|
|
2 && style_height !== (style_height = `${/*$hourSize*/
|
|
ctx2[1] / 2}px`)) {
|
|
set_style(div0, "height", style_height);
|
|
}
|
|
if (dirty & /*$hourSize*/
|
|
2 && style_height_1 !== (style_height_1 = `${/*$hourSize*/
|
|
ctx2[1]}px`)) {
|
|
set_style(div1, "height", style_height_1);
|
|
}
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div1);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment(ctx) {
|
|
let div;
|
|
let t;
|
|
let current;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[3].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[2],
|
|
null
|
|
);
|
|
let each_value = (
|
|
/*visibleHours*/
|
|
ctx[0]
|
|
);
|
|
let each_blocks = [];
|
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
each_blocks[i] = create_each_block(get_each_context(ctx, each_value, i));
|
|
}
|
|
return {
|
|
c() {
|
|
div = element("div");
|
|
if (default_slot)
|
|
default_slot.c();
|
|
t = space();
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].c();
|
|
}
|
|
attr(div, "class", "task-grid svelte-af5q45");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div, anchor);
|
|
if (default_slot) {
|
|
default_slot.m(div, null);
|
|
}
|
|
append(div, t);
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].m(div, null);
|
|
}
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
4)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[2],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[2]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[2],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
if (dirty & /*$hourSize, visibleHours*/
|
|
3) {
|
|
each_value = /*visibleHours*/
|
|
ctx2[0];
|
|
let i;
|
|
for (i = 0; i < each_value.length; i += 1) {
|
|
const child_ctx = get_each_context(ctx2, each_value, i);
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].p(child_ctx, dirty);
|
|
} else {
|
|
each_blocks[i] = create_each_block(child_ctx);
|
|
each_blocks[i].c();
|
|
each_blocks[i].m(div, null);
|
|
}
|
|
}
|
|
for (; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].d(1);
|
|
}
|
|
each_blocks.length = each_value.length;
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div);
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
destroy_each(each_blocks, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance($$self, $$props, $$invalidate) {
|
|
let $hourSize;
|
|
component_subscribe($$self, hourSize, ($$value) => $$invalidate(1, $hourSize = $$value));
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
let { visibleHours: visibleHours2 } = $$props;
|
|
$$self.$$set = ($$props2) => {
|
|
if ("visibleHours" in $$props2)
|
|
$$invalidate(0, visibleHours2 = $$props2.visibleHours);
|
|
if ("$$scope" in $$props2)
|
|
$$invalidate(2, $$scope = $$props2.$$scope);
|
|
};
|
|
return [visibleHours2, $hourSize, $$scope, slots];
|
|
}
|
|
var Column = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance, create_fragment, safe_not_equal, { visibleHours: 0 }, add_css);
|
|
}
|
|
};
|
|
var column_default = Column;
|
|
|
|
// node_modules/tslib/tslib.es6.mjs
|
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
function adopt(value) {
|
|
return value instanceof P ? value : new P(function(resolve) {
|
|
resolve(value);
|
|
});
|
|
}
|
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
function fulfilled(value) {
|
|
try {
|
|
step(generator.next(value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function rejected(value) {
|
|
try {
|
|
step(generator["throw"](value));
|
|
} catch (e) {
|
|
reject(e);
|
|
}
|
|
}
|
|
function step(result) {
|
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
}
|
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
});
|
|
}
|
|
|
|
// src/ui/components/controls.svelte
|
|
var import_fp4 = __toESM(require_fp());
|
|
|
|
// node_modules/lucide-svelte/dist/esm/defaultAttributes.js
|
|
var defaultAttributes = {
|
|
xmlns: "http://www.w3.org/2000/svg",
|
|
width: 24,
|
|
height: 24,
|
|
viewBox: "0 0 24 24",
|
|
fill: "none",
|
|
stroke: "currentColor",
|
|
"stroke-width": 2,
|
|
"stroke-linecap": "round",
|
|
"stroke-linejoin": "round"
|
|
};
|
|
|
|
// node_modules/lucide-svelte/dist/esm/Icon.svelte.js
|
|
function get_each_context2(ctx, list, i) {
|
|
const child_ctx = ctx.slice();
|
|
child_ctx[10] = list[i][0];
|
|
child_ctx[11] = list[i][1];
|
|
return child_ctx;
|
|
}
|
|
function create_dynamic_element(ctx) {
|
|
let svelte_element;
|
|
let svelte_element_levels = [
|
|
/*attrs*/
|
|
ctx[11]
|
|
];
|
|
let svelte_element_data = {};
|
|
for (let i = 0; i < svelte_element_levels.length; i += 1) {
|
|
svelte_element_data = assign(svelte_element_data, svelte_element_levels[i]);
|
|
}
|
|
return {
|
|
c() {
|
|
svelte_element = svg_element(
|
|
/*tag*/
|
|
ctx[10]
|
|
);
|
|
this.h();
|
|
},
|
|
l(nodes) {
|
|
svelte_element = claim_svg_element(
|
|
nodes,
|
|
/*tag*/
|
|
ctx[10],
|
|
{}
|
|
);
|
|
children(svelte_element).forEach(detach);
|
|
this.h();
|
|
},
|
|
h() {
|
|
set_svg_attributes(svelte_element, svelte_element_data);
|
|
},
|
|
m(target, anchor) {
|
|
insert_hydration(target, svelte_element, anchor);
|
|
},
|
|
p(ctx2, dirty) {
|
|
svelte_element_data = get_spread_update(svelte_element_levels, [dirty & /*iconNode*/
|
|
32 && /*attrs*/
|
|
ctx2[11]]);
|
|
set_svg_attributes(svelte_element, svelte_element_data);
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(svelte_element);
|
|
}
|
|
};
|
|
}
|
|
function create_each_block2(ctx) {
|
|
let previous_tag = (
|
|
/*tag*/
|
|
ctx[10]
|
|
);
|
|
let svelte_element_anchor;
|
|
let svelte_element = (
|
|
/*tag*/
|
|
ctx[10] && create_dynamic_element(ctx)
|
|
);
|
|
return {
|
|
c() {
|
|
if (svelte_element)
|
|
svelte_element.c();
|
|
svelte_element_anchor = empty();
|
|
},
|
|
l(nodes) {
|
|
if (svelte_element)
|
|
svelte_element.l(nodes);
|
|
svelte_element_anchor = empty();
|
|
},
|
|
m(target, anchor) {
|
|
if (svelte_element)
|
|
svelte_element.m(target, anchor);
|
|
insert_hydration(target, svelte_element_anchor, anchor);
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (
|
|
/*tag*/
|
|
ctx2[10]
|
|
) {
|
|
if (!previous_tag) {
|
|
svelte_element = create_dynamic_element(ctx2);
|
|
svelte_element.c();
|
|
svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor);
|
|
} else if (safe_not_equal(
|
|
previous_tag,
|
|
/*tag*/
|
|
ctx2[10]
|
|
)) {
|
|
svelte_element.d(1);
|
|
svelte_element = create_dynamic_element(ctx2);
|
|
svelte_element.c();
|
|
svelte_element.m(svelte_element_anchor.parentNode, svelte_element_anchor);
|
|
} else {
|
|
svelte_element.p(ctx2, dirty);
|
|
}
|
|
} else if (previous_tag) {
|
|
svelte_element.d(1);
|
|
svelte_element = null;
|
|
}
|
|
previous_tag = /*tag*/
|
|
ctx2[10];
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(svelte_element_anchor);
|
|
if (svelte_element)
|
|
svelte_element.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment2(ctx) {
|
|
var _a;
|
|
let svg;
|
|
let each_1_anchor;
|
|
let svg_stroke_width_value;
|
|
let svg_class_value;
|
|
let current;
|
|
let each_value = (
|
|
/*iconNode*/
|
|
ctx[5]
|
|
);
|
|
let each_blocks = [];
|
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
each_blocks[i] = create_each_block2(get_each_context2(ctx, each_value, i));
|
|
}
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[9].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[8],
|
|
null
|
|
);
|
|
let svg_levels = [
|
|
defaultAttributes,
|
|
/*$$restProps*/
|
|
ctx[6],
|
|
{ width: (
|
|
/*size*/
|
|
ctx[2]
|
|
) },
|
|
{ height: (
|
|
/*size*/
|
|
ctx[2]
|
|
) },
|
|
{ stroke: (
|
|
/*color*/
|
|
ctx[1]
|
|
) },
|
|
{
|
|
"stroke-width": svg_stroke_width_value = /*absoluteStrokeWidth*/
|
|
ctx[4] ? Number(
|
|
/*strokeWidth*/
|
|
ctx[3]
|
|
) * 24 / Number(
|
|
/*size*/
|
|
ctx[2]
|
|
) : (
|
|
/*strokeWidth*/
|
|
ctx[3]
|
|
)
|
|
},
|
|
{
|
|
class: svg_class_value = `lucide-icon lucide lucide-${/*name*/
|
|
ctx[0]} ${/*$$props*/
|
|
(_a = ctx[7].class) != null ? _a : ""}`
|
|
}
|
|
];
|
|
let svg_data = {};
|
|
for (let i = 0; i < svg_levels.length; i += 1) {
|
|
svg_data = assign(svg_data, svg_levels[i]);
|
|
}
|
|
return {
|
|
c() {
|
|
svg = svg_element("svg");
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].c();
|
|
}
|
|
each_1_anchor = empty();
|
|
if (default_slot)
|
|
default_slot.c();
|
|
this.h();
|
|
},
|
|
l(nodes) {
|
|
svg = claim_svg_element(nodes, "svg", {
|
|
width: true,
|
|
height: true,
|
|
stroke: true,
|
|
"stroke-width": true,
|
|
class: true
|
|
});
|
|
var svg_nodes = children(svg);
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].l(svg_nodes);
|
|
}
|
|
each_1_anchor = empty();
|
|
if (default_slot)
|
|
default_slot.l(svg_nodes);
|
|
svg_nodes.forEach(detach);
|
|
this.h();
|
|
},
|
|
h() {
|
|
set_svg_attributes(svg, svg_data);
|
|
},
|
|
m(target, anchor) {
|
|
insert_hydration(target, svg, anchor);
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].m(svg, null);
|
|
}
|
|
append_hydration(svg, each_1_anchor);
|
|
if (default_slot) {
|
|
default_slot.m(svg, null);
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
var _a2;
|
|
if (dirty & /*iconNode*/
|
|
32) {
|
|
each_value = /*iconNode*/
|
|
ctx2[5];
|
|
let i;
|
|
for (i = 0; i < each_value.length; i += 1) {
|
|
const child_ctx = get_each_context2(ctx2, each_value, i);
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].p(child_ctx, dirty);
|
|
} else {
|
|
each_blocks[i] = create_each_block2(child_ctx);
|
|
each_blocks[i].c();
|
|
each_blocks[i].m(svg, each_1_anchor);
|
|
}
|
|
}
|
|
for (; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].d(1);
|
|
}
|
|
each_blocks.length = each_value.length;
|
|
}
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
256)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[8],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[8]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[8],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
set_svg_attributes(svg, svg_data = get_spread_update(svg_levels, [
|
|
defaultAttributes,
|
|
dirty & /*$$restProps*/
|
|
64 && /*$$restProps*/
|
|
ctx2[6],
|
|
(!current || dirty & /*size*/
|
|
4) && { width: (
|
|
/*size*/
|
|
ctx2[2]
|
|
) },
|
|
(!current || dirty & /*size*/
|
|
4) && { height: (
|
|
/*size*/
|
|
ctx2[2]
|
|
) },
|
|
(!current || dirty & /*color*/
|
|
2) && { stroke: (
|
|
/*color*/
|
|
ctx2[1]
|
|
) },
|
|
(!current || dirty & /*absoluteStrokeWidth, strokeWidth, size*/
|
|
28 && svg_stroke_width_value !== (svg_stroke_width_value = /*absoluteStrokeWidth*/
|
|
ctx2[4] ? Number(
|
|
/*strokeWidth*/
|
|
ctx2[3]
|
|
) * 24 / Number(
|
|
/*size*/
|
|
ctx2[2]
|
|
) : (
|
|
/*strokeWidth*/
|
|
ctx2[3]
|
|
))) && { "stroke-width": svg_stroke_width_value },
|
|
(!current || dirty & /*name, $$props*/
|
|
129 && svg_class_value !== (svg_class_value = `lucide-icon lucide lucide-${/*name*/
|
|
ctx2[0]} ${/*$$props*/
|
|
(_a2 = ctx2[7].class) != null ? _a2 : ""}`)) && { class: svg_class_value }
|
|
]));
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(svg);
|
|
destroy_each(each_blocks, detaching);
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance2($$self, $$props, $$invalidate) {
|
|
const omit_props_names = ["name", "color", "size", "strokeWidth", "absoluteStrokeWidth", "iconNode"];
|
|
let $$restProps = compute_rest_props($$props, omit_props_names);
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
let { name } = $$props;
|
|
let { color = "currentColor" } = $$props;
|
|
let { size = 24 } = $$props;
|
|
let { strokeWidth = 2 } = $$props;
|
|
let { absoluteStrokeWidth = false } = $$props;
|
|
let { iconNode } = $$props;
|
|
$$self.$$set = ($$new_props) => {
|
|
$$invalidate(7, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
$$invalidate(6, $$restProps = compute_rest_props($$props, omit_props_names));
|
|
if ("name" in $$new_props)
|
|
$$invalidate(0, name = $$new_props.name);
|
|
if ("color" in $$new_props)
|
|
$$invalidate(1, color = $$new_props.color);
|
|
if ("size" in $$new_props)
|
|
$$invalidate(2, size = $$new_props.size);
|
|
if ("strokeWidth" in $$new_props)
|
|
$$invalidate(3, strokeWidth = $$new_props.strokeWidth);
|
|
if ("absoluteStrokeWidth" in $$new_props)
|
|
$$invalidate(4, absoluteStrokeWidth = $$new_props.absoluteStrokeWidth);
|
|
if ("iconNode" in $$new_props)
|
|
$$invalidate(5, iconNode = $$new_props.iconNode);
|
|
if ("$$scope" in $$new_props)
|
|
$$invalidate(8, $$scope = $$new_props.$$scope);
|
|
};
|
|
$$props = exclude_internal_props($$props);
|
|
return [
|
|
name,
|
|
color,
|
|
size,
|
|
strokeWidth,
|
|
absoluteStrokeWidth,
|
|
iconNode,
|
|
$$restProps,
|
|
$$props,
|
|
$$scope,
|
|
slots
|
|
];
|
|
}
|
|
var Icon = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance2, create_fragment2, safe_not_equal, {
|
|
name: 0,
|
|
color: 1,
|
|
size: 2,
|
|
strokeWidth: 3,
|
|
absoluteStrokeWidth: 4,
|
|
iconNode: 5
|
|
});
|
|
}
|
|
};
|
|
var Icon$1 = Icon;
|
|
|
|
// node_modules/lucide-svelte/dist/esm/icons/arrow-left-to-line.svelte.js
|
|
function create_default_slot(ctx) {
|
|
let current;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[2].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[3],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
if (default_slot)
|
|
default_slot.c();
|
|
},
|
|
l(nodes) {
|
|
if (default_slot)
|
|
default_slot.l(nodes);
|
|
},
|
|
m(target, anchor) {
|
|
if (default_slot) {
|
|
default_slot.m(target, anchor);
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
8)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[3]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment3(ctx) {
|
|
let icon;
|
|
let current;
|
|
const icon_spread_levels = [
|
|
{ name: "arrow-left-to-line" },
|
|
/*$$props*/
|
|
ctx[1],
|
|
{ iconNode: (
|
|
/*iconNode*/
|
|
ctx[0]
|
|
) }
|
|
];
|
|
let icon_props = {
|
|
$$slots: { default: [create_default_slot] },
|
|
$$scope: { ctx }
|
|
};
|
|
for (let i = 0; i < icon_spread_levels.length; i += 1) {
|
|
icon_props = assign(icon_props, icon_spread_levels[i]);
|
|
}
|
|
icon = new Icon$1({ props: icon_props });
|
|
return {
|
|
c() {
|
|
create_component(icon.$$.fragment);
|
|
},
|
|
l(nodes) {
|
|
claim_component(icon.$$.fragment, nodes);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(icon, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const icon_changes = dirty & /*$$props, iconNode*/
|
|
3 ? get_spread_update(icon_spread_levels, [
|
|
icon_spread_levels[0],
|
|
dirty & /*$$props*/
|
|
2 && get_spread_object(
|
|
/*$$props*/
|
|
ctx2[1]
|
|
),
|
|
dirty & /*iconNode*/
|
|
1 && { iconNode: (
|
|
/*iconNode*/
|
|
ctx2[0]
|
|
) }
|
|
]) : {};
|
|
if (dirty & /*$$scope*/
|
|
8) {
|
|
icon_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
icon.$set(icon_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(icon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(icon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(icon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance3($$self, $$props, $$invalidate) {
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
const iconNode = [
|
|
["path", { "d": "M3 19V5" }],
|
|
["path", { "d": "m13 6-6 6 6 6" }],
|
|
["path", { "d": "M7 12h14" }]
|
|
];
|
|
$$self.$$set = ($$new_props) => {
|
|
$$invalidate(1, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
if ("$$scope" in $$new_props)
|
|
$$invalidate(3, $$scope = $$new_props.$$scope);
|
|
};
|
|
$$props = exclude_internal_props($$props);
|
|
return [iconNode, $$props, slots, $$scope];
|
|
}
|
|
var Arrow_left_to_line = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance3, create_fragment3, safe_not_equal, {});
|
|
}
|
|
};
|
|
var Arrow_left_to_line$1 = Arrow_left_to_line;
|
|
|
|
// node_modules/lucide-svelte/dist/esm/icons/arrow-right-to-line.svelte.js
|
|
function create_default_slot2(ctx) {
|
|
let current;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[2].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[3],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
if (default_slot)
|
|
default_slot.c();
|
|
},
|
|
l(nodes) {
|
|
if (default_slot)
|
|
default_slot.l(nodes);
|
|
},
|
|
m(target, anchor) {
|
|
if (default_slot) {
|
|
default_slot.m(target, anchor);
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
8)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[3]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment4(ctx) {
|
|
let icon;
|
|
let current;
|
|
const icon_spread_levels = [
|
|
{ name: "arrow-right-to-line" },
|
|
/*$$props*/
|
|
ctx[1],
|
|
{ iconNode: (
|
|
/*iconNode*/
|
|
ctx[0]
|
|
) }
|
|
];
|
|
let icon_props = {
|
|
$$slots: { default: [create_default_slot2] },
|
|
$$scope: { ctx }
|
|
};
|
|
for (let i = 0; i < icon_spread_levels.length; i += 1) {
|
|
icon_props = assign(icon_props, icon_spread_levels[i]);
|
|
}
|
|
icon = new Icon$1({ props: icon_props });
|
|
return {
|
|
c() {
|
|
create_component(icon.$$.fragment);
|
|
},
|
|
l(nodes) {
|
|
claim_component(icon.$$.fragment, nodes);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(icon, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const icon_changes = dirty & /*$$props, iconNode*/
|
|
3 ? get_spread_update(icon_spread_levels, [
|
|
icon_spread_levels[0],
|
|
dirty & /*$$props*/
|
|
2 && get_spread_object(
|
|
/*$$props*/
|
|
ctx2[1]
|
|
),
|
|
dirty & /*iconNode*/
|
|
1 && { iconNode: (
|
|
/*iconNode*/
|
|
ctx2[0]
|
|
) }
|
|
]) : {};
|
|
if (dirty & /*$$scope*/
|
|
8) {
|
|
icon_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
icon.$set(icon_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(icon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(icon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(icon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance4($$self, $$props, $$invalidate) {
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
const iconNode = [
|
|
["path", { "d": "M17 12H3" }],
|
|
["path", { "d": "m11 18 6-6-6-6" }],
|
|
["path", { "d": "M21 5v14" }]
|
|
];
|
|
$$self.$$set = ($$new_props) => {
|
|
$$invalidate(1, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
if ("$$scope" in $$new_props)
|
|
$$invalidate(3, $$scope = $$new_props.$$scope);
|
|
};
|
|
$$props = exclude_internal_props($$props);
|
|
return [iconNode, $$props, slots, $$scope];
|
|
}
|
|
var Arrow_right_to_line = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance4, create_fragment4, safe_not_equal, {});
|
|
}
|
|
};
|
|
var Arrow_right_to_line$1 = Arrow_right_to_line;
|
|
|
|
// node_modules/lucide-svelte/dist/esm/icons/circle-dot.svelte.js
|
|
function create_default_slot3(ctx) {
|
|
let current;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[2].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[3],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
if (default_slot)
|
|
default_slot.c();
|
|
},
|
|
l(nodes) {
|
|
if (default_slot)
|
|
default_slot.l(nodes);
|
|
},
|
|
m(target, anchor) {
|
|
if (default_slot) {
|
|
default_slot.m(target, anchor);
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
8)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[3]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment5(ctx) {
|
|
let icon;
|
|
let current;
|
|
const icon_spread_levels = [
|
|
{ name: "circle-dot" },
|
|
/*$$props*/
|
|
ctx[1],
|
|
{ iconNode: (
|
|
/*iconNode*/
|
|
ctx[0]
|
|
) }
|
|
];
|
|
let icon_props = {
|
|
$$slots: { default: [create_default_slot3] },
|
|
$$scope: { ctx }
|
|
};
|
|
for (let i = 0; i < icon_spread_levels.length; i += 1) {
|
|
icon_props = assign(icon_props, icon_spread_levels[i]);
|
|
}
|
|
icon = new Icon$1({ props: icon_props });
|
|
return {
|
|
c() {
|
|
create_component(icon.$$.fragment);
|
|
},
|
|
l(nodes) {
|
|
claim_component(icon.$$.fragment, nodes);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(icon, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const icon_changes = dirty & /*$$props, iconNode*/
|
|
3 ? get_spread_update(icon_spread_levels, [
|
|
icon_spread_levels[0],
|
|
dirty & /*$$props*/
|
|
2 && get_spread_object(
|
|
/*$$props*/
|
|
ctx2[1]
|
|
),
|
|
dirty & /*iconNode*/
|
|
1 && { iconNode: (
|
|
/*iconNode*/
|
|
ctx2[0]
|
|
) }
|
|
]) : {};
|
|
if (dirty & /*$$scope*/
|
|
8) {
|
|
icon_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
icon.$set(icon_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(icon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(icon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(icon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance5($$self, $$props, $$invalidate) {
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
const iconNode = [
|
|
["circle", { "cx": "12", "cy": "12", "r": "10" }],
|
|
["circle", { "cx": "12", "cy": "12", "r": "1" }]
|
|
];
|
|
$$self.$$set = ($$new_props) => {
|
|
$$invalidate(1, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
if ("$$scope" in $$new_props)
|
|
$$invalidate(3, $$scope = $$new_props.$$scope);
|
|
};
|
|
$$props = exclude_internal_props($$props);
|
|
return [iconNode, $$props, slots, $$scope];
|
|
}
|
|
var Circle_dot = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance5, create_fragment5, safe_not_equal, {});
|
|
}
|
|
};
|
|
var Circle_dot$1 = Circle_dot;
|
|
|
|
// node_modules/lucide-svelte/dist/esm/icons/copy.svelte.js
|
|
function create_default_slot4(ctx) {
|
|
let current;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[2].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[3],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
if (default_slot)
|
|
default_slot.c();
|
|
},
|
|
l(nodes) {
|
|
if (default_slot)
|
|
default_slot.l(nodes);
|
|
},
|
|
m(target, anchor) {
|
|
if (default_slot) {
|
|
default_slot.m(target, anchor);
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
8)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[3]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment6(ctx) {
|
|
let icon;
|
|
let current;
|
|
const icon_spread_levels = [
|
|
{ name: "copy" },
|
|
/*$$props*/
|
|
ctx[1],
|
|
{ iconNode: (
|
|
/*iconNode*/
|
|
ctx[0]
|
|
) }
|
|
];
|
|
let icon_props = {
|
|
$$slots: { default: [create_default_slot4] },
|
|
$$scope: { ctx }
|
|
};
|
|
for (let i = 0; i < icon_spread_levels.length; i += 1) {
|
|
icon_props = assign(icon_props, icon_spread_levels[i]);
|
|
}
|
|
icon = new Icon$1({ props: icon_props });
|
|
return {
|
|
c() {
|
|
create_component(icon.$$.fragment);
|
|
},
|
|
l(nodes) {
|
|
claim_component(icon.$$.fragment, nodes);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(icon, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const icon_changes = dirty & /*$$props, iconNode*/
|
|
3 ? get_spread_update(icon_spread_levels, [
|
|
icon_spread_levels[0],
|
|
dirty & /*$$props*/
|
|
2 && get_spread_object(
|
|
/*$$props*/
|
|
ctx2[1]
|
|
),
|
|
dirty & /*iconNode*/
|
|
1 && { iconNode: (
|
|
/*iconNode*/
|
|
ctx2[0]
|
|
) }
|
|
]) : {};
|
|
if (dirty & /*$$scope*/
|
|
8) {
|
|
icon_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
icon.$set(icon_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(icon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(icon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(icon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance6($$self, $$props, $$invalidate) {
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
const iconNode = [
|
|
[
|
|
"rect",
|
|
{
|
|
"width": "14",
|
|
"height": "14",
|
|
"x": "8",
|
|
"y": "8",
|
|
"rx": "2",
|
|
"ry": "2"
|
|
}
|
|
],
|
|
[
|
|
"path",
|
|
{
|
|
"d": "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
}
|
|
]
|
|
];
|
|
$$self.$$set = ($$new_props) => {
|
|
$$invalidate(1, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
if ("$$scope" in $$new_props)
|
|
$$invalidate(3, $$scope = $$new_props.$$scope);
|
|
};
|
|
$$props = exclude_internal_props($$props);
|
|
return [iconNode, $$props, slots, $$scope];
|
|
}
|
|
var Copy = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance6, create_fragment6, safe_not_equal, {});
|
|
}
|
|
};
|
|
var Copy$1 = Copy;
|
|
|
|
// node_modules/lucide-svelte/dist/esm/icons/grip-vertical.svelte.js
|
|
function create_default_slot5(ctx) {
|
|
let current;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[2].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[3],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
if (default_slot)
|
|
default_slot.c();
|
|
},
|
|
l(nodes) {
|
|
if (default_slot)
|
|
default_slot.l(nodes);
|
|
},
|
|
m(target, anchor) {
|
|
if (default_slot) {
|
|
default_slot.m(target, anchor);
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
8)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[3]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment7(ctx) {
|
|
let icon;
|
|
let current;
|
|
const icon_spread_levels = [
|
|
{ name: "grip-vertical" },
|
|
/*$$props*/
|
|
ctx[1],
|
|
{ iconNode: (
|
|
/*iconNode*/
|
|
ctx[0]
|
|
) }
|
|
];
|
|
let icon_props = {
|
|
$$slots: { default: [create_default_slot5] },
|
|
$$scope: { ctx }
|
|
};
|
|
for (let i = 0; i < icon_spread_levels.length; i += 1) {
|
|
icon_props = assign(icon_props, icon_spread_levels[i]);
|
|
}
|
|
icon = new Icon$1({ props: icon_props });
|
|
return {
|
|
c() {
|
|
create_component(icon.$$.fragment);
|
|
},
|
|
l(nodes) {
|
|
claim_component(icon.$$.fragment, nodes);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(icon, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const icon_changes = dirty & /*$$props, iconNode*/
|
|
3 ? get_spread_update(icon_spread_levels, [
|
|
icon_spread_levels[0],
|
|
dirty & /*$$props*/
|
|
2 && get_spread_object(
|
|
/*$$props*/
|
|
ctx2[1]
|
|
),
|
|
dirty & /*iconNode*/
|
|
1 && { iconNode: (
|
|
/*iconNode*/
|
|
ctx2[0]
|
|
) }
|
|
]) : {};
|
|
if (dirty & /*$$scope*/
|
|
8) {
|
|
icon_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
icon.$set(icon_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(icon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(icon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(icon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance7($$self, $$props, $$invalidate) {
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
const iconNode = [
|
|
["circle", { "cx": "9", "cy": "12", "r": "1" }],
|
|
["circle", { "cx": "9", "cy": "5", "r": "1" }],
|
|
["circle", { "cx": "9", "cy": "19", "r": "1" }],
|
|
["circle", { "cx": "15", "cy": "12", "r": "1" }],
|
|
["circle", { "cx": "15", "cy": "5", "r": "1" }],
|
|
["circle", { "cx": "15", "cy": "19", "r": "1" }]
|
|
];
|
|
$$self.$$set = ($$new_props) => {
|
|
$$invalidate(1, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
if ("$$scope" in $$new_props)
|
|
$$invalidate(3, $$scope = $$new_props.$$scope);
|
|
};
|
|
$$props = exclude_internal_props($$props);
|
|
return [iconNode, $$props, slots, $$scope];
|
|
}
|
|
var Grip_vertical = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance7, create_fragment7, safe_not_equal, {});
|
|
}
|
|
};
|
|
var Grip_vertical$1 = Grip_vertical;
|
|
|
|
// node_modules/lucide-svelte/dist/esm/icons/help-circle.svelte.js
|
|
function create_default_slot6(ctx) {
|
|
let current;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[2].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[3],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
if (default_slot)
|
|
default_slot.c();
|
|
},
|
|
l(nodes) {
|
|
if (default_slot)
|
|
default_slot.l(nodes);
|
|
},
|
|
m(target, anchor) {
|
|
if (default_slot) {
|
|
default_slot.m(target, anchor);
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
8)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[3]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment8(ctx) {
|
|
let icon;
|
|
let current;
|
|
const icon_spread_levels = [
|
|
{ name: "help-circle" },
|
|
/*$$props*/
|
|
ctx[1],
|
|
{ iconNode: (
|
|
/*iconNode*/
|
|
ctx[0]
|
|
) }
|
|
];
|
|
let icon_props = {
|
|
$$slots: { default: [create_default_slot6] },
|
|
$$scope: { ctx }
|
|
};
|
|
for (let i = 0; i < icon_spread_levels.length; i += 1) {
|
|
icon_props = assign(icon_props, icon_spread_levels[i]);
|
|
}
|
|
icon = new Icon$1({ props: icon_props });
|
|
return {
|
|
c() {
|
|
create_component(icon.$$.fragment);
|
|
},
|
|
l(nodes) {
|
|
claim_component(icon.$$.fragment, nodes);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(icon, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const icon_changes = dirty & /*$$props, iconNode*/
|
|
3 ? get_spread_update(icon_spread_levels, [
|
|
icon_spread_levels[0],
|
|
dirty & /*$$props*/
|
|
2 && get_spread_object(
|
|
/*$$props*/
|
|
ctx2[1]
|
|
),
|
|
dirty & /*iconNode*/
|
|
1 && { iconNode: (
|
|
/*iconNode*/
|
|
ctx2[0]
|
|
) }
|
|
]) : {};
|
|
if (dirty & /*$$scope*/
|
|
8) {
|
|
icon_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
icon.$set(icon_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(icon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(icon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(icon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance8($$self, $$props, $$invalidate) {
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
const iconNode = [
|
|
["circle", { "cx": "12", "cy": "12", "r": "10" }],
|
|
[
|
|
"path",
|
|
{
|
|
"d": "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"
|
|
}
|
|
],
|
|
["path", { "d": "M12 17h.01" }]
|
|
];
|
|
$$self.$$set = ($$new_props) => {
|
|
$$invalidate(1, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
if ("$$scope" in $$new_props)
|
|
$$invalidate(3, $$scope = $$new_props.$$scope);
|
|
};
|
|
$$props = exclude_internal_props($$props);
|
|
return [iconNode, $$props, slots, $$scope];
|
|
}
|
|
var Help_circle = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance8, create_fragment8, safe_not_equal, {});
|
|
}
|
|
};
|
|
var Help_circle$1 = Help_circle;
|
|
|
|
// node_modules/lucide-svelte/dist/esm/icons/layers.svelte.js
|
|
function create_default_slot7(ctx) {
|
|
let current;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[2].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[3],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
if (default_slot)
|
|
default_slot.c();
|
|
},
|
|
l(nodes) {
|
|
if (default_slot)
|
|
default_slot.l(nodes);
|
|
},
|
|
m(target, anchor) {
|
|
if (default_slot) {
|
|
default_slot.m(target, anchor);
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
8)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[3]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[3],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment9(ctx) {
|
|
let icon;
|
|
let current;
|
|
const icon_spread_levels = [
|
|
{ name: "layers" },
|
|
/*$$props*/
|
|
ctx[1],
|
|
{ iconNode: (
|
|
/*iconNode*/
|
|
ctx[0]
|
|
) }
|
|
];
|
|
let icon_props = {
|
|
$$slots: { default: [create_default_slot7] },
|
|
$$scope: { ctx }
|
|
};
|
|
for (let i = 0; i < icon_spread_levels.length; i += 1) {
|
|
icon_props = assign(icon_props, icon_spread_levels[i]);
|
|
}
|
|
icon = new Icon$1({ props: icon_props });
|
|
return {
|
|
c() {
|
|
create_component(icon.$$.fragment);
|
|
},
|
|
l(nodes) {
|
|
claim_component(icon.$$.fragment, nodes);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(icon, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const icon_changes = dirty & /*$$props, iconNode*/
|
|
3 ? get_spread_update(icon_spread_levels, [
|
|
icon_spread_levels[0],
|
|
dirty & /*$$props*/
|
|
2 && get_spread_object(
|
|
/*$$props*/
|
|
ctx2[1]
|
|
),
|
|
dirty & /*iconNode*/
|
|
1 && { iconNode: (
|
|
/*iconNode*/
|
|
ctx2[0]
|
|
) }
|
|
]) : {};
|
|
if (dirty & /*$$scope*/
|
|
8) {
|
|
icon_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
icon.$set(icon_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(icon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(icon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(icon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance9($$self, $$props, $$invalidate) {
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
const iconNode = [
|
|
["polygon", { "points": "12 2 2 7 12 12 22 7 12 2" }],
|
|
["polyline", { "points": "2 17 12 22 22 17" }],
|
|
["polyline", { "points": "2 12 12 17 22 12" }]
|
|
];
|
|
$$self.$$set = ($$new_props) => {
|
|
$$invalidate(1, $$props = assign(assign({}, $$props), exclude_internal_props($$new_props)));
|
|
if ("$$scope" in $$new_props)
|
|
$$invalidate(3, $$scope = $$new_props.$$scope);
|
|
};
|
|
$$props = exclude_internal_props($$props);
|
|
return [iconNode, $$props, slots, $$scope];
|
|
}
|
|
var Layers = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance9, create_fragment9, safe_not_equal, {});
|
|
}
|
|
};
|
|
var Layers$1 = Layers;
|
|
|
|
// src/ui/components/controls.svelte
|
|
var import_obsidian_daily_notes_interface3 = __toESM(require_main());
|
|
|
|
// src/util/daily-notes.ts
|
|
var import_obsidian_daily_notes_interface2 = __toESM(require_main());
|
|
async function createDailyNoteIfNeeded(moment2) {
|
|
return (0, import_obsidian_daily_notes_interface2.getDailyNote)(moment2, (0, import_obsidian_daily_notes_interface2.getAllDailyNotes)()) || (0, import_obsidian_daily_notes_interface2.createDailyNote)(moment2);
|
|
}
|
|
function dailyNoteExists() {
|
|
return Boolean((0, import_obsidian_daily_notes_interface2.getDailyNote)(window.moment(), (0, import_obsidian_daily_notes_interface2.getAllDailyNotes)()));
|
|
}
|
|
|
|
// src/ui/components/control-button.svelte
|
|
function add_css2(target) {
|
|
append_styles(target, "svelte-3xb39a", ".clickable-icon.svelte-3xb39a{grid-column-start:var(--grid-column-start, auto);flex-basis:var(--input-height);align-self:center;justify-self:var(--justify-self, auto);color:var(--color, var(--icon-color));white-space:nowrap}");
|
|
}
|
|
function create_fragment10(ctx) {
|
|
let div;
|
|
let div_class_value;
|
|
let current;
|
|
let mounted;
|
|
let dispose;
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[5].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[4],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
div = element("div");
|
|
if (default_slot)
|
|
default_slot.c();
|
|
attr(div, "class", div_class_value = "clickable-icon " + /*classes*/
|
|
ctx[3] + " svelte-3xb39a");
|
|
attr(
|
|
div,
|
|
"aria-disabled",
|
|
/*disabled*/
|
|
ctx[2]
|
|
);
|
|
attr(
|
|
div,
|
|
"aria-label",
|
|
/*label*/
|
|
ctx[0]
|
|
);
|
|
toggle_class(
|
|
div,
|
|
"is-active",
|
|
/*isActive*/
|
|
ctx[1]
|
|
);
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div, anchor);
|
|
if (default_slot) {
|
|
default_slot.m(div, null);
|
|
}
|
|
current = true;
|
|
if (!mounted) {
|
|
dispose = listen(
|
|
div,
|
|
"click",
|
|
/*click_handler*/
|
|
ctx[6]
|
|
);
|
|
mounted = true;
|
|
}
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
16)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx2,
|
|
/*$$scope*/
|
|
ctx2[4],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx2[4]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx2[4],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
if (!current || dirty & /*classes*/
|
|
8 && div_class_value !== (div_class_value = "clickable-icon " + /*classes*/
|
|
ctx2[3] + " svelte-3xb39a")) {
|
|
attr(div, "class", div_class_value);
|
|
}
|
|
if (!current || dirty & /*disabled*/
|
|
4) {
|
|
attr(
|
|
div,
|
|
"aria-disabled",
|
|
/*disabled*/
|
|
ctx2[2]
|
|
);
|
|
}
|
|
if (!current || dirty & /*label*/
|
|
1) {
|
|
attr(
|
|
div,
|
|
"aria-label",
|
|
/*label*/
|
|
ctx2[0]
|
|
);
|
|
}
|
|
if (!current || dirty & /*classes, isActive*/
|
|
10) {
|
|
toggle_class(
|
|
div,
|
|
"is-active",
|
|
/*isActive*/
|
|
ctx2[1]
|
|
);
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div);
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
mounted = false;
|
|
dispose();
|
|
}
|
|
};
|
|
}
|
|
function instance10($$self, $$props, $$invalidate) {
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
let { label } = $$props;
|
|
let { isActive = false } = $$props;
|
|
let { disabled = false } = $$props;
|
|
let { classes = "" } = $$props;
|
|
function click_handler(event) {
|
|
bubble.call(this, $$self, event);
|
|
}
|
|
$$self.$$set = ($$props2) => {
|
|
if ("label" in $$props2)
|
|
$$invalidate(0, label = $$props2.label);
|
|
if ("isActive" in $$props2)
|
|
$$invalidate(1, isActive = $$props2.isActive);
|
|
if ("disabled" in $$props2)
|
|
$$invalidate(2, disabled = $$props2.disabled);
|
|
if ("classes" in $$props2)
|
|
$$invalidate(3, classes = $$props2.classes);
|
|
if ("$$scope" in $$props2)
|
|
$$invalidate(4, $$scope = $$props2.$$scope);
|
|
};
|
|
return [label, isActive, disabled, classes, $$scope, slots, click_handler];
|
|
}
|
|
var Control_button = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(
|
|
this,
|
|
options,
|
|
instance10,
|
|
create_fragment10,
|
|
safe_not_equal,
|
|
{
|
|
label: 0,
|
|
isActive: 1,
|
|
disabled: 2,
|
|
classes: 3
|
|
},
|
|
add_css2
|
|
);
|
|
}
|
|
};
|
|
var control_button_default = Control_button;
|
|
|
|
// src/ui/components/icons/arrow-left.svelte
|
|
function create_fragment11(ctx) {
|
|
let svg;
|
|
let path0;
|
|
let path1;
|
|
return {
|
|
c() {
|
|
svg = svg_element("svg");
|
|
path0 = svg_element("path");
|
|
path1 = svg_element("path");
|
|
attr(path0, "d", "m12 19-7-7 7-7");
|
|
attr(path1, "d", "M19 12H5");
|
|
attr(svg, "class", "svg-icon lucide lucide-arrow-left");
|
|
attr(svg, "fill", "none");
|
|
attr(svg, "height", "24");
|
|
attr(svg, "stroke", "currentColor");
|
|
attr(svg, "stroke-linecap", "round");
|
|
attr(svg, "stroke-linejoin", "round");
|
|
attr(svg, "stroke-width", "2");
|
|
attr(svg, "viewBox", "0 0 24 24");
|
|
attr(svg, "width", "24");
|
|
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, svg, anchor);
|
|
append(svg, path0);
|
|
append(svg, path1);
|
|
},
|
|
p: noop,
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(svg);
|
|
}
|
|
};
|
|
}
|
|
var Arrow_left = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, null, create_fragment11, safe_not_equal, {});
|
|
}
|
|
};
|
|
var arrow_left_default = Arrow_left;
|
|
|
|
// src/ui/components/icons/arrow-right.svelte
|
|
function create_fragment12(ctx) {
|
|
let svg;
|
|
let path0;
|
|
let path1;
|
|
return {
|
|
c() {
|
|
svg = svg_element("svg");
|
|
path0 = svg_element("path");
|
|
path1 = svg_element("path");
|
|
attr(path0, "d", "M5 12h14");
|
|
attr(path1, "d", "m12 5 7 7-7 7");
|
|
attr(svg, "class", "svg-icon lucide lucide-arrow-right");
|
|
attr(svg, "fill", "none");
|
|
attr(svg, "height", "24");
|
|
attr(svg, "stroke", "currentColor");
|
|
attr(svg, "stroke-linecap", "round");
|
|
attr(svg, "stroke-linejoin", "round");
|
|
attr(svg, "stroke-width", "2");
|
|
attr(svg, "viewBox", "0 0 24 24");
|
|
attr(svg, "width", "24");
|
|
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, svg, anchor);
|
|
append(svg, path0);
|
|
append(svg, path1);
|
|
},
|
|
p: noop,
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(svg);
|
|
}
|
|
};
|
|
}
|
|
var Arrow_right = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, null, create_fragment12, safe_not_equal, {});
|
|
}
|
|
};
|
|
var arrow_right_default = Arrow_right;
|
|
|
|
// src/ui/components/icons/go-to-file.svelte
|
|
function create_fragment13(ctx) {
|
|
let svg;
|
|
let path0;
|
|
let polyline;
|
|
let path1;
|
|
let path2;
|
|
return {
|
|
c() {
|
|
svg = svg_element("svg");
|
|
path0 = svg_element("path");
|
|
polyline = svg_element("polyline");
|
|
path1 = svg_element("path");
|
|
path2 = svg_element("path");
|
|
attr(path0, "d", "M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4");
|
|
attr(polyline, "points", "14 2 14 8 20 8");
|
|
attr(path1, "d", "M2 15h10");
|
|
attr(path2, "d", "m9 18 3-3-3-3");
|
|
attr(svg, "class", "svg-icon lucide lucide-file-input");
|
|
attr(svg, "fill", "none");
|
|
attr(svg, "height", "24");
|
|
attr(svg, "stroke", "currentColor");
|
|
attr(svg, "stroke-linecap", "round");
|
|
attr(svg, "stroke-linejoin", "round");
|
|
attr(svg, "stroke-width", "2");
|
|
attr(svg, "viewBox", "0 0 24 24");
|
|
attr(svg, "width", "24");
|
|
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, svg, anchor);
|
|
append(svg, path0);
|
|
append(svg, polyline);
|
|
append(svg, path1);
|
|
append(svg, path2);
|
|
},
|
|
p: noop,
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(svg);
|
|
}
|
|
};
|
|
}
|
|
var Go_to_file = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, null, create_fragment13, safe_not_equal, {});
|
|
}
|
|
};
|
|
var go_to_file_default = Go_to_file;
|
|
|
|
// src/ui/components/icons/settings.svelte
|
|
function create_fragment14(ctx) {
|
|
let svg;
|
|
let line0;
|
|
let line1;
|
|
let line2;
|
|
let line3;
|
|
let line4;
|
|
let line5;
|
|
let line6;
|
|
let line7;
|
|
let line8;
|
|
return {
|
|
c() {
|
|
svg = svg_element("svg");
|
|
line0 = svg_element("line");
|
|
line1 = svg_element("line");
|
|
line2 = svg_element("line");
|
|
line3 = svg_element("line");
|
|
line4 = svg_element("line");
|
|
line5 = svg_element("line");
|
|
line6 = svg_element("line");
|
|
line7 = svg_element("line");
|
|
line8 = svg_element("line");
|
|
attr(line0, "x1", "21");
|
|
attr(line0, "x2", "14");
|
|
attr(line0, "y1", "4");
|
|
attr(line0, "y2", "4");
|
|
attr(line1, "x1", "10");
|
|
attr(line1, "x2", "3");
|
|
attr(line1, "y1", "4");
|
|
attr(line1, "y2", "4");
|
|
attr(line2, "x1", "21");
|
|
attr(line2, "x2", "12");
|
|
attr(line2, "y1", "12");
|
|
attr(line2, "y2", "12");
|
|
attr(line3, "x1", "8");
|
|
attr(line3, "x2", "3");
|
|
attr(line3, "y1", "12");
|
|
attr(line3, "y2", "12");
|
|
attr(line4, "x1", "21");
|
|
attr(line4, "x2", "16");
|
|
attr(line4, "y1", "20");
|
|
attr(line4, "y2", "20");
|
|
attr(line5, "x1", "12");
|
|
attr(line5, "x2", "3");
|
|
attr(line5, "y1", "20");
|
|
attr(line5, "y2", "20");
|
|
attr(line6, "x1", "14");
|
|
attr(line6, "x2", "14");
|
|
attr(line6, "y1", "2");
|
|
attr(line6, "y2", "6");
|
|
attr(line7, "x1", "8");
|
|
attr(line7, "x2", "8");
|
|
attr(line7, "y1", "10");
|
|
attr(line7, "y2", "14");
|
|
attr(line8, "x1", "16");
|
|
attr(line8, "x2", "16");
|
|
attr(line8, "y1", "18");
|
|
attr(line8, "y2", "22");
|
|
attr(svg, "class", "svg-icon lucide-sliders-horizontal");
|
|
attr(svg, "fill", "none");
|
|
attr(svg, "height", "24");
|
|
attr(svg, "stroke", "currentColor");
|
|
attr(svg, "stroke-linecap", "round");
|
|
attr(svg, "stroke-linejoin", "round");
|
|
attr(svg, "stroke-width", "2");
|
|
attr(svg, "viewBox", "0 0 24 24");
|
|
attr(svg, "width", "24");
|
|
attr(svg, "xmlns", "http://www.w3.org/2000/svg");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, svg, anchor);
|
|
append(svg, line0);
|
|
append(svg, line1);
|
|
append(svg, line2);
|
|
append(svg, line3);
|
|
append(svg, line4);
|
|
append(svg, line5);
|
|
append(svg, line6);
|
|
append(svg, line7);
|
|
append(svg, line8);
|
|
},
|
|
p: noop,
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(svg);
|
|
}
|
|
};
|
|
}
|
|
var Settings = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, null, create_fragment14, safe_not_equal, {});
|
|
}
|
|
};
|
|
var settings_default = Settings;
|
|
|
|
// src/ui/components/controls.svelte
|
|
function add_css3(target) {
|
|
append_styles(target, "svelte-1rjga2i", ".help-item.svelte-1rjga2i{margin:var(--size-2-3) var(--size-4-4);font-size:var(--font-ui-small);color:var(--text-muted)}.date.svelte-1rjga2i{display:flex;align-items:center;justify-content:center;font-size:var(--font-ui-small);font-weight:var(--font-medium);color:var(--text-normal)}.settings.svelte-1rjga2i{margin:var(--size-4-1) var(--size-4-4)}.setting-item.svelte-1rjga2i{padding:var(--size-2-3) 0;border:none}.setting-item-name.svelte-1rjga2i{font-size:var(--font-ui-small)}.controls.svelte-1rjga2i{display:flex;flex-direction:column;border-bottom:1px solid var(--background-modifier-border)}.header.svelte-1rjga2i{display:grid;grid-template-columns:repeat(2, var(--size-4-8)) repeat(3, 1fr) repeat(\n 2,\n var(--size-4-8)\n );margin:var(--size-4-2)}");
|
|
}
|
|
function get_each_context3(ctx, list, i) {
|
|
const child_ctx = ctx.slice();
|
|
child_ctx[18] = list[i];
|
|
return child_ctx;
|
|
}
|
|
function get_each_context_1(ctx, list, i) {
|
|
const child_ctx = ctx.slice();
|
|
child_ctx[21] = list[i];
|
|
return child_ctx;
|
|
}
|
|
function create_default_slot_5(ctx) {
|
|
let gotofileicon;
|
|
let current;
|
|
gotofileicon = new go_to_file_default({});
|
|
return {
|
|
c() {
|
|
create_component(gotofileicon.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(gotofileicon, target, anchor);
|
|
current = true;
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(gotofileicon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(gotofileicon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(gotofileicon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot_4(ctx) {
|
|
let arrowlefticon;
|
|
let current;
|
|
arrowlefticon = new arrow_left_default({});
|
|
return {
|
|
c() {
|
|
create_component(arrowlefticon.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(arrowlefticon, target, anchor);
|
|
current = true;
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(arrowlefticon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(arrowlefticon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(arrowlefticon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot_3(ctx) {
|
|
let span;
|
|
let t_value = (
|
|
/*day*/
|
|
ctx[0].format(import_obsidian_daily_notes_interface3.DEFAULT_DAILY_NOTE_FORMAT) + ""
|
|
);
|
|
let t;
|
|
return {
|
|
c() {
|
|
span = element("span");
|
|
t = text(t_value);
|
|
attr(span, "class", "date svelte-1rjga2i");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, span, anchor);
|
|
append(span, t);
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (dirty & /*day*/
|
|
1 && t_value !== (t_value = /*day*/
|
|
ctx2[0].format(import_obsidian_daily_notes_interface3.DEFAULT_DAILY_NOTE_FORMAT) + ""))
|
|
set_data(t, t_value);
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(span);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot_2(ctx) {
|
|
let arrowrighticon;
|
|
let current;
|
|
arrowrighticon = new arrow_right_default({});
|
|
return {
|
|
c() {
|
|
create_component(arrowrighticon.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(arrowrighticon, target, anchor);
|
|
current = true;
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(arrowrighticon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(arrowrighticon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(arrowrighticon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot_1(ctx) {
|
|
let helpcircle;
|
|
let current;
|
|
helpcircle = new Help_circle$1({ props: { class: "svg-icon" } });
|
|
return {
|
|
c() {
|
|
create_component(helpcircle.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(helpcircle, target, anchor);
|
|
current = true;
|
|
},
|
|
p: noop,
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(helpcircle.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(helpcircle.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(helpcircle, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot8(ctx) {
|
|
let settingsicon;
|
|
let current;
|
|
settingsicon = new settings_default({});
|
|
return {
|
|
c() {
|
|
create_component(settingsicon.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(settingsicon, target, anchor);
|
|
current = true;
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(settingsicon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(settingsicon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(settingsicon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_if_block_1(ctx) {
|
|
let p0;
|
|
let t1;
|
|
let p1;
|
|
let t5;
|
|
let p2;
|
|
return {
|
|
c() {
|
|
p0 = element("p");
|
|
p0.innerHTML = `<strong>Advanced editing:</strong>`;
|
|
t1 = space();
|
|
p1 = element("p");
|
|
p1.innerHTML = `Hold <strong>Shift</strong> and drag to copy`;
|
|
t5 = space();
|
|
p2 = element("p");
|
|
p2.innerHTML = `Hold <strong>Control</strong> and drag/resize to push neighboring tasks`;
|
|
attr(p0, "class", "help-item svelte-1rjga2i");
|
|
attr(p1, "class", "help-item svelte-1rjga2i");
|
|
attr(p2, "class", "help-item svelte-1rjga2i");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, p0, anchor);
|
|
insert(target, t1, anchor);
|
|
insert(target, p1, anchor);
|
|
insert(target, t5, anchor);
|
|
insert(target, p2, anchor);
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(p0);
|
|
if (detaching)
|
|
detach(t1);
|
|
if (detaching)
|
|
detach(p1);
|
|
if (detaching)
|
|
detach(t5);
|
|
if (detaching)
|
|
detach(p2);
|
|
}
|
|
};
|
|
}
|
|
function create_if_block(ctx) {
|
|
let div18;
|
|
let div3;
|
|
let div1;
|
|
let t1;
|
|
let div2;
|
|
let select0;
|
|
let select0_value_value;
|
|
let t2;
|
|
let div7;
|
|
let div5;
|
|
let t4;
|
|
let div6;
|
|
let select1;
|
|
let select1_value_value;
|
|
let t5;
|
|
let div12;
|
|
let div9;
|
|
let t7;
|
|
let div11;
|
|
let div10;
|
|
let t8;
|
|
let div17;
|
|
let div14;
|
|
let t10;
|
|
let div16;
|
|
let div15;
|
|
let mounted;
|
|
let dispose;
|
|
let each_value_1 = (
|
|
/*startHourOptions*/
|
|
ctx[5]
|
|
);
|
|
let each_blocks_1 = [];
|
|
for (let i = 0; i < each_value_1.length; i += 1) {
|
|
each_blocks_1[i] = create_each_block_1(get_each_context_1(ctx, each_value_1, i));
|
|
}
|
|
let each_value = (
|
|
/*zoomLevelOptions*/
|
|
ctx[6]
|
|
);
|
|
let each_blocks = [];
|
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
each_blocks[i] = create_each_block3(get_each_context3(ctx, each_value, i));
|
|
}
|
|
return {
|
|
c() {
|
|
div18 = element("div");
|
|
div3 = element("div");
|
|
div1 = element("div");
|
|
div1.innerHTML = `<div class="setting-item-name svelte-1rjga2i">Start hour</div>`;
|
|
t1 = space();
|
|
div2 = element("div");
|
|
select0 = element("select");
|
|
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
each_blocks_1[i].c();
|
|
}
|
|
t2 = space();
|
|
div7 = element("div");
|
|
div5 = element("div");
|
|
div5.innerHTML = `<div class="setting-item-name svelte-1rjga2i">Zoom</div>`;
|
|
t4 = space();
|
|
div6 = element("div");
|
|
select1 = element("select");
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].c();
|
|
}
|
|
t5 = space();
|
|
div12 = element("div");
|
|
div9 = element("div");
|
|
div9.innerHTML = `<div class="setting-item-name svelte-1rjga2i">Auto-scroll to now</div>`;
|
|
t7 = space();
|
|
div11 = element("div");
|
|
div10 = element("div");
|
|
div10.innerHTML = `<input tabindex="0" type="checkbox"/>`;
|
|
t8 = space();
|
|
div17 = element("div");
|
|
div14 = element("div");
|
|
div14.innerHTML = `<div class="setting-item-name svelte-1rjga2i">Show help while dragging</div>`;
|
|
t10 = space();
|
|
div16 = element("div");
|
|
div15 = element("div");
|
|
div15.innerHTML = `<input tabindex="0" type="checkbox"/>`;
|
|
attr(div1, "class", "setting-item-info");
|
|
attr(select0, "class", "dropdown");
|
|
attr(div2, "class", "setting-item-control");
|
|
attr(div3, "class", "setting-item svelte-1rjga2i");
|
|
attr(div5, "class", "setting-item-info");
|
|
attr(select1, "class", "dropdown");
|
|
attr(div6, "class", "setting-item-control");
|
|
attr(div7, "class", "setting-item svelte-1rjga2i");
|
|
attr(div9, "class", "setting-item-info");
|
|
attr(div10, "class", "checkbox-container mod-small");
|
|
toggle_class(
|
|
div10,
|
|
"is-enabled",
|
|
/*$settings*/
|
|
ctx[4].centerNeedle
|
|
);
|
|
attr(div11, "class", "setting-item-control");
|
|
attr(div12, "class", "setting-item mod-toggle svelte-1rjga2i");
|
|
attr(div14, "class", "setting-item-info");
|
|
attr(div15, "class", "checkbox-container mod-small");
|
|
toggle_class(
|
|
div15,
|
|
"is-enabled",
|
|
/*$settings*/
|
|
ctx[4].showHelp
|
|
);
|
|
attr(div16, "class", "setting-item-control");
|
|
attr(div17, "class", "setting-item mod-toggle svelte-1rjga2i");
|
|
attr(div18, "class", "settings svelte-1rjga2i");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div18, anchor);
|
|
append(div18, div3);
|
|
append(div3, div1);
|
|
append(div3, t1);
|
|
append(div3, div2);
|
|
append(div2, select0);
|
|
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
if (each_blocks_1[i]) {
|
|
each_blocks_1[i].m(select0, null);
|
|
}
|
|
}
|
|
select_option(select0, String(
|
|
/*$settings*/
|
|
ctx[4].startHour
|
|
));
|
|
append(div18, t2);
|
|
append(div18, div7);
|
|
append(div7, div5);
|
|
append(div7, t4);
|
|
append(div7, div6);
|
|
append(div6, select1);
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].m(select1, null);
|
|
}
|
|
}
|
|
select_option(select1, String(
|
|
/*$settings*/
|
|
ctx[4].zoomLevel
|
|
));
|
|
append(div18, t5);
|
|
append(div18, div12);
|
|
append(div12, div9);
|
|
append(div12, t7);
|
|
append(div12, div11);
|
|
append(div11, div10);
|
|
append(div18, t8);
|
|
append(div18, div17);
|
|
append(div17, div14);
|
|
append(div17, t10);
|
|
append(div17, div16);
|
|
append(div16, div15);
|
|
if (!mounted) {
|
|
dispose = [
|
|
listen(
|
|
select0,
|
|
"input",
|
|
/*input_handler*/
|
|
ctx[13]
|
|
),
|
|
listen(
|
|
select1,
|
|
"input",
|
|
/*input_handler_1*/
|
|
ctx[14]
|
|
),
|
|
listen(
|
|
div10,
|
|
"click",
|
|
/*click_handler_1*/
|
|
ctx[15]
|
|
),
|
|
listen(
|
|
div15,
|
|
"click",
|
|
/*click_handler_2*/
|
|
ctx[16]
|
|
)
|
|
];
|
|
mounted = true;
|
|
}
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (dirty & /*startHourOptions*/
|
|
32) {
|
|
each_value_1 = /*startHourOptions*/
|
|
ctx2[5];
|
|
let i;
|
|
for (i = 0; i < each_value_1.length; i += 1) {
|
|
const child_ctx = get_each_context_1(ctx2, each_value_1, i);
|
|
if (each_blocks_1[i]) {
|
|
each_blocks_1[i].p(child_ctx, dirty);
|
|
} else {
|
|
each_blocks_1[i] = create_each_block_1(child_ctx);
|
|
each_blocks_1[i].c();
|
|
each_blocks_1[i].m(select0, null);
|
|
}
|
|
}
|
|
for (; i < each_blocks_1.length; i += 1) {
|
|
each_blocks_1[i].d(1);
|
|
}
|
|
each_blocks_1.length = each_value_1.length;
|
|
}
|
|
if (dirty & /*$settings, startHourOptions*/
|
|
48 && select0_value_value !== (select0_value_value = String(
|
|
/*$settings*/
|
|
ctx2[4].startHour
|
|
))) {
|
|
select_option(select0, String(
|
|
/*$settings*/
|
|
ctx2[4].startHour
|
|
));
|
|
}
|
|
if (dirty & /*zoomLevelOptions*/
|
|
64) {
|
|
each_value = /*zoomLevelOptions*/
|
|
ctx2[6];
|
|
let i;
|
|
for (i = 0; i < each_value.length; i += 1) {
|
|
const child_ctx = get_each_context3(ctx2, each_value, i);
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].p(child_ctx, dirty);
|
|
} else {
|
|
each_blocks[i] = create_each_block3(child_ctx);
|
|
each_blocks[i].c();
|
|
each_blocks[i].m(select1, null);
|
|
}
|
|
}
|
|
for (; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].d(1);
|
|
}
|
|
each_blocks.length = each_value.length;
|
|
}
|
|
if (dirty & /*$settings, startHourOptions*/
|
|
48 && select1_value_value !== (select1_value_value = String(
|
|
/*$settings*/
|
|
ctx2[4].zoomLevel
|
|
))) {
|
|
select_option(select1, String(
|
|
/*$settings*/
|
|
ctx2[4].zoomLevel
|
|
));
|
|
}
|
|
if (dirty & /*$settings*/
|
|
16) {
|
|
toggle_class(
|
|
div10,
|
|
"is-enabled",
|
|
/*$settings*/
|
|
ctx2[4].centerNeedle
|
|
);
|
|
}
|
|
if (dirty & /*$settings*/
|
|
16) {
|
|
toggle_class(
|
|
div15,
|
|
"is-enabled",
|
|
/*$settings*/
|
|
ctx2[4].showHelp
|
|
);
|
|
}
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div18);
|
|
destroy_each(each_blocks_1, detaching);
|
|
destroy_each(each_blocks, detaching);
|
|
mounted = false;
|
|
run_all(dispose);
|
|
}
|
|
};
|
|
}
|
|
function create_each_block_1(ctx) {
|
|
let option;
|
|
let t_value = (
|
|
/*hour*/
|
|
ctx[21] + ""
|
|
);
|
|
let t;
|
|
let option_value_value;
|
|
return {
|
|
c() {
|
|
option = element("option");
|
|
t = text(t_value);
|
|
option.__value = option_value_value = /*hour*/
|
|
ctx[21];
|
|
option.value = option.__value;
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, option, anchor);
|
|
append(option, t);
|
|
},
|
|
p: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(option);
|
|
}
|
|
};
|
|
}
|
|
function create_each_block3(ctx) {
|
|
let option;
|
|
let t_value = (
|
|
/*level*/
|
|
ctx[18] + ""
|
|
);
|
|
let t;
|
|
let option_value_value;
|
|
return {
|
|
c() {
|
|
option = element("option");
|
|
t = text(t_value);
|
|
option.__value = option_value_value = /*level*/
|
|
ctx[18];
|
|
option.value = option.__value;
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, option, anchor);
|
|
append(option, t);
|
|
},
|
|
p: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(option);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment15(ctx) {
|
|
let div1;
|
|
let div0;
|
|
let controlbutton0;
|
|
let t0;
|
|
let controlbutton1;
|
|
let div;
|
|
let t1;
|
|
let controlbutton2;
|
|
let t2;
|
|
let controlbutton3;
|
|
let div_1;
|
|
let t3;
|
|
let controlbutton4;
|
|
let t4;
|
|
let controlbutton5;
|
|
let t5;
|
|
let t6;
|
|
let current;
|
|
controlbutton0 = new control_button_default({
|
|
props: {
|
|
label: "Open today's daily note",
|
|
$$slots: { default: [create_default_slot_5] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton0.$on(
|
|
"click",
|
|
/*goToToday*/
|
|
ctx[11]
|
|
);
|
|
controlbutton1 = new control_button_default({
|
|
props: {
|
|
label: "Go to previous daily plan",
|
|
$$slots: { default: [create_default_slot_4] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton1.$on(
|
|
"click",
|
|
/*goBack*/
|
|
ctx[9]
|
|
);
|
|
controlbutton2 = new control_button_default({
|
|
props: {
|
|
label: "Go to file",
|
|
$$slots: { default: [create_default_slot_3] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton2.$on(
|
|
"click",
|
|
/*click_handler*/
|
|
ctx[12]
|
|
);
|
|
controlbutton3 = new control_button_default({
|
|
props: {
|
|
label: "Go to next daily plan",
|
|
$$slots: { default: [create_default_slot_2] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton3.$on(
|
|
"click",
|
|
/*goForward*/
|
|
ctx[10]
|
|
);
|
|
controlbutton4 = new control_button_default({
|
|
props: {
|
|
isActive: (
|
|
/*helpVisible*/
|
|
ctx[3]
|
|
),
|
|
label: "Help",
|
|
$$slots: { default: [create_default_slot_1] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton4.$on(
|
|
"click",
|
|
/*toggleHelp*/
|
|
ctx[8]
|
|
);
|
|
controlbutton5 = new control_button_default({
|
|
props: {
|
|
isActive: (
|
|
/*settingsVisible*/
|
|
ctx[2]
|
|
),
|
|
label: "Settings",
|
|
$$slots: { default: [create_default_slot8] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton5.$on(
|
|
"click",
|
|
/*toggleSettings*/
|
|
ctx[7]
|
|
);
|
|
let if_block0 = (
|
|
/*helpVisible*/
|
|
ctx[3] && create_if_block_1(ctx)
|
|
);
|
|
let if_block1 = (
|
|
/*settingsVisible*/
|
|
ctx[2] && create_if_block(ctx)
|
|
);
|
|
return {
|
|
c() {
|
|
div1 = element("div");
|
|
div0 = element("div");
|
|
create_component(controlbutton0.$$.fragment);
|
|
t0 = space();
|
|
div = element("div");
|
|
create_component(controlbutton1.$$.fragment);
|
|
t1 = space();
|
|
create_component(controlbutton2.$$.fragment);
|
|
t2 = space();
|
|
div_1 = element("div");
|
|
create_component(controlbutton3.$$.fragment);
|
|
t3 = space();
|
|
create_component(controlbutton4.$$.fragment);
|
|
t4 = space();
|
|
create_component(controlbutton5.$$.fragment);
|
|
t5 = space();
|
|
if (if_block0)
|
|
if_block0.c();
|
|
t6 = space();
|
|
if (if_block1)
|
|
if_block1.c();
|
|
set_style(div, "display", "contents");
|
|
set_style(div, "--grid-column-start", "3");
|
|
set_style(div, "--justify-self", "flex-end");
|
|
set_style(div_1, "display", "contents");
|
|
set_style(div_1, "--justify-self", "flex-start");
|
|
attr(div0, "class", "header svelte-1rjga2i");
|
|
attr(div1, "class", "controls svelte-1rjga2i");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div1, anchor);
|
|
append(div1, div0);
|
|
mount_component(controlbutton0, div0, null);
|
|
append(div0, t0);
|
|
append(div0, div);
|
|
mount_component(controlbutton1, div, null);
|
|
append(div0, t1);
|
|
mount_component(controlbutton2, div0, null);
|
|
append(div0, t2);
|
|
append(div0, div_1);
|
|
mount_component(controlbutton3, div_1, null);
|
|
append(div0, t3);
|
|
mount_component(controlbutton4, div0, null);
|
|
append(div0, t4);
|
|
mount_component(controlbutton5, div0, null);
|
|
append(div1, t5);
|
|
if (if_block0)
|
|
if_block0.m(div1, null);
|
|
append(div1, t6);
|
|
if (if_block1)
|
|
if_block1.m(div1, null);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const controlbutton0_changes = {};
|
|
if (dirty & /*$$scope*/
|
|
16777216) {
|
|
controlbutton0_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton0.$set(controlbutton0_changes);
|
|
const controlbutton1_changes = {};
|
|
if (dirty & /*$$scope*/
|
|
16777216) {
|
|
controlbutton1_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton1.$set(controlbutton1_changes);
|
|
const controlbutton2_changes = {};
|
|
if (dirty & /*$$scope, day*/
|
|
16777217) {
|
|
controlbutton2_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton2.$set(controlbutton2_changes);
|
|
const controlbutton3_changes = {};
|
|
if (dirty & /*$$scope*/
|
|
16777216) {
|
|
controlbutton3_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton3.$set(controlbutton3_changes);
|
|
const controlbutton4_changes = {};
|
|
if (dirty & /*helpVisible*/
|
|
8)
|
|
controlbutton4_changes.isActive = /*helpVisible*/
|
|
ctx2[3];
|
|
if (dirty & /*$$scope*/
|
|
16777216) {
|
|
controlbutton4_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton4.$set(controlbutton4_changes);
|
|
const controlbutton5_changes = {};
|
|
if (dirty & /*settingsVisible*/
|
|
4)
|
|
controlbutton5_changes.isActive = /*settingsVisible*/
|
|
ctx2[2];
|
|
if (dirty & /*$$scope*/
|
|
16777216) {
|
|
controlbutton5_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton5.$set(controlbutton5_changes);
|
|
if (
|
|
/*helpVisible*/
|
|
ctx2[3]
|
|
) {
|
|
if (if_block0) {
|
|
} else {
|
|
if_block0 = create_if_block_1(ctx2);
|
|
if_block0.c();
|
|
if_block0.m(div1, t6);
|
|
}
|
|
} else if (if_block0) {
|
|
if_block0.d(1);
|
|
if_block0 = null;
|
|
}
|
|
if (
|
|
/*settingsVisible*/
|
|
ctx2[2]
|
|
) {
|
|
if (if_block1) {
|
|
if_block1.p(ctx2, dirty);
|
|
} else {
|
|
if_block1 = create_if_block(ctx2);
|
|
if_block1.c();
|
|
if_block1.m(div1, null);
|
|
}
|
|
} else if (if_block1) {
|
|
if_block1.d(1);
|
|
if_block1 = null;
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(controlbutton0.$$.fragment, local);
|
|
transition_in(controlbutton1.$$.fragment, local);
|
|
transition_in(controlbutton2.$$.fragment, local);
|
|
transition_in(controlbutton3.$$.fragment, local);
|
|
transition_in(controlbutton4.$$.fragment, local);
|
|
transition_in(controlbutton5.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(controlbutton0.$$.fragment, local);
|
|
transition_out(controlbutton1.$$.fragment, local);
|
|
transition_out(controlbutton2.$$.fragment, local);
|
|
transition_out(controlbutton3.$$.fragment, local);
|
|
transition_out(controlbutton4.$$.fragment, local);
|
|
transition_out(controlbutton5.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div1);
|
|
destroy_component(controlbutton0);
|
|
destroy_component(controlbutton1);
|
|
destroy_component(controlbutton2);
|
|
destroy_component(controlbutton3);
|
|
destroy_component(controlbutton4);
|
|
destroy_component(controlbutton5);
|
|
if (if_block0)
|
|
if_block0.d();
|
|
if (if_block1)
|
|
if_block1.d();
|
|
}
|
|
};
|
|
}
|
|
function instance11($$self, $$props, $$invalidate) {
|
|
let $visibleDayInTimeline;
|
|
let $settings;
|
|
component_subscribe($$self, visibleDayInTimeline, ($$value) => $$invalidate(17, $visibleDayInTimeline = $$value));
|
|
component_subscribe($$self, settings, ($$value) => $$invalidate(4, $settings = $$value));
|
|
let { day } = $$props;
|
|
let { obsidianFacade } = $$props;
|
|
const startHourOptions = (0, import_fp4.range)(0, 13).map(String);
|
|
const zoomLevelOptions = (0, import_fp4.range)(1, 5).map(String);
|
|
let settingsVisible = false;
|
|
let helpVisible = false;
|
|
function toggleSettings() {
|
|
$$invalidate(2, settingsVisible = !settingsVisible);
|
|
}
|
|
function toggleHelp() {
|
|
$$invalidate(3, helpVisible = !helpVisible);
|
|
}
|
|
function goBack() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const previousDay = $visibleDayInTimeline.clone().subtract(1, "day");
|
|
const previousNote = yield createDailyNoteIfNeeded(previousDay);
|
|
yield obsidianFacade.openFileInEditor(previousNote);
|
|
set_store_value(visibleDayInTimeline, $visibleDayInTimeline = previousDay, $visibleDayInTimeline);
|
|
});
|
|
}
|
|
function goForward() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const nextDay = $visibleDayInTimeline.clone().add(1, "day");
|
|
const nextNote = yield createDailyNoteIfNeeded(nextDay);
|
|
yield obsidianFacade.openFileInEditor(nextNote);
|
|
set_store_value(visibleDayInTimeline, $visibleDayInTimeline = nextDay, $visibleDayInTimeline);
|
|
});
|
|
}
|
|
function goToToday() {
|
|
return __awaiter(this, void 0, void 0, function* () {
|
|
const noteForToday = yield createDailyNoteIfNeeded(window.moment());
|
|
yield obsidianFacade.openFileInEditor(noteForToday);
|
|
});
|
|
}
|
|
const click_handler = async () => {
|
|
const note = await createDailyNoteIfNeeded(day);
|
|
await obsidianFacade.openFileInEditor(note);
|
|
};
|
|
const input_handler = (event) => {
|
|
set_store_value(settings, $settings.startHour = Number(event.currentTarget.value), $settings);
|
|
};
|
|
const input_handler_1 = (event) => {
|
|
set_store_value(settings, $settings.zoomLevel = Number(event.currentTarget.value), $settings);
|
|
};
|
|
const click_handler_1 = () => {
|
|
set_store_value(settings, $settings.centerNeedle = !$settings.centerNeedle, $settings);
|
|
};
|
|
const click_handler_2 = () => {
|
|
set_store_value(settings, $settings.showHelp = !$settings.showHelp, $settings);
|
|
};
|
|
$$self.$$set = ($$props2) => {
|
|
if ("day" in $$props2)
|
|
$$invalidate(0, day = $$props2.day);
|
|
if ("obsidianFacade" in $$props2)
|
|
$$invalidate(1, obsidianFacade = $$props2.obsidianFacade);
|
|
};
|
|
return [
|
|
day,
|
|
obsidianFacade,
|
|
settingsVisible,
|
|
helpVisible,
|
|
$settings,
|
|
startHourOptions,
|
|
zoomLevelOptions,
|
|
toggleSettings,
|
|
toggleHelp,
|
|
goBack,
|
|
goForward,
|
|
goToToday,
|
|
click_handler,
|
|
input_handler,
|
|
input_handler_1,
|
|
click_handler_1,
|
|
click_handler_2
|
|
];
|
|
}
|
|
var Controls = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance11, create_fragment15, safe_not_equal, { day: 0, obsidianFacade: 1 }, add_css3);
|
|
}
|
|
};
|
|
var controls_default = Controls;
|
|
|
|
// src/global-store/current-time.ts
|
|
var currentTime = readable(window.moment(), (set) => {
|
|
const interval = setInterval(() => {
|
|
set(window.moment());
|
|
}, 1e3);
|
|
return () => {
|
|
clearInterval(interval);
|
|
};
|
|
});
|
|
|
|
// src/ui/components/needle.svelte
|
|
function add_css4(target) {
|
|
append_styles(target, "svelte-1rbwtw9", ".needle.svelte-1rbwtw9{height:2px;background-color:var(--color-accent)}");
|
|
}
|
|
function create_fragment16(ctx) {
|
|
let div;
|
|
let style_transform = `translateY(${/*coords*/
|
|
ctx[1]}px)`;
|
|
return {
|
|
c() {
|
|
div = element("div");
|
|
attr(div, "class", "needle absolute-stretch-x svelte-1rbwtw9");
|
|
set_style(div, "transform", style_transform);
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div, anchor);
|
|
ctx[5](div);
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
if (dirty & /*coords*/
|
|
2 && style_transform !== (style_transform = `translateY(${/*coords*/
|
|
ctx2[1]}px)`)) {
|
|
set_style(div, "transform", style_transform);
|
|
}
|
|
},
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div);
|
|
ctx[5](null);
|
|
}
|
|
};
|
|
}
|
|
function instance12($$self, $$props, $$invalidate) {
|
|
let $currentTime;
|
|
let $timeToTimelineOffset;
|
|
let $visibleDayInTimeline;
|
|
let $settings;
|
|
component_subscribe($$self, currentTime, ($$value) => $$invalidate(3, $currentTime = $$value));
|
|
component_subscribe($$self, timeToTimelineOffset, ($$value) => $$invalidate(4, $timeToTimelineOffset = $$value));
|
|
component_subscribe($$self, visibleDayInTimeline, ($$value) => $$invalidate(6, $visibleDayInTimeline = $$value));
|
|
component_subscribe($$self, settings, ($$value) => $$invalidate(7, $settings = $$value));
|
|
let { autoScrollBlocked = false } = $$props;
|
|
let el;
|
|
let coords = $timeToTimelineOffset(getMinutesSinceMidnight($currentTime));
|
|
function scrollIntoView() {
|
|
if ($settings.centerNeedle && !autoScrollBlocked && isToday($visibleDayInTimeline)) {
|
|
el === null || el === void 0 ? void 0 : el.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
}
|
|
}
|
|
function div_binding($$value) {
|
|
binding_callbacks[$$value ? "unshift" : "push"](() => {
|
|
el = $$value;
|
|
$$invalidate(0, el);
|
|
});
|
|
}
|
|
$$self.$$set = ($$props2) => {
|
|
if ("autoScrollBlocked" in $$props2)
|
|
$$invalidate(2, autoScrollBlocked = $$props2.autoScrollBlocked);
|
|
};
|
|
$$self.$$.update = () => {
|
|
if ($$self.$$.dirty & /*$timeToTimelineOffset, $currentTime*/
|
|
24) {
|
|
$: {
|
|
$$invalidate(1, coords = $timeToTimelineOffset(getMinutesSinceMidnight($currentTime)));
|
|
scrollIntoView();
|
|
}
|
|
}
|
|
};
|
|
return [
|
|
el,
|
|
coords,
|
|
autoScrollBlocked,
|
|
$currentTime,
|
|
$timeToTimelineOffset,
|
|
div_binding
|
|
];
|
|
}
|
|
var Needle = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance12, create_fragment16, safe_not_equal, { autoScrollBlocked: 2 }, add_css4);
|
|
}
|
|
};
|
|
var needle_default = Needle;
|
|
|
|
// src/ui/components/ruler.svelte
|
|
function add_css5(target) {
|
|
append_styles(target, "svelte-y3mmrv", ".hours-container.svelte-y3mmrv{position:sticky;z-index:5;left:0;display:flex;flex:0 0 30px;flex-direction:column;background-color:var(--background-primary);border-right:1px solid var(--background-modifier-border)}.hour.svelte-y3mmrv{display:flex;flex:1 0 0;border-bottom:1px solid var(--background-modifier-border)}.hour-number-container.svelte-y3mmrv{display:flex;flex:0 0 30px;align-self:flex-start;justify-content:center;font-size:var(--nav-item-size);color:var(--text-muted)}");
|
|
}
|
|
function get_each_context4(ctx, list, i) {
|
|
const child_ctx = ctx.slice();
|
|
child_ctx[2] = list[i];
|
|
return child_ctx;
|
|
}
|
|
function create_each_block4(ctx) {
|
|
let div1;
|
|
let div0;
|
|
let t0_value = (
|
|
/*hour*/
|
|
ctx[2] + ""
|
|
);
|
|
let t0;
|
|
let t1;
|
|
let style_height = `${/*$hourSize*/
|
|
ctx[1]}px`;
|
|
return {
|
|
c() {
|
|
div1 = element("div");
|
|
div0 = element("div");
|
|
t0 = text(t0_value);
|
|
t1 = space();
|
|
attr(div0, "class", "hour-number-container svelte-y3mmrv");
|
|
attr(div1, "class", "hour svelte-y3mmrv");
|
|
set_style(div1, "height", style_height);
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div1, anchor);
|
|
append(div1, div0);
|
|
append(div0, t0);
|
|
append(div1, t1);
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (dirty & /*visibleHours*/
|
|
1 && t0_value !== (t0_value = /*hour*/
|
|
ctx2[2] + ""))
|
|
set_data(t0, t0_value);
|
|
if (dirty & /*$hourSize*/
|
|
2 && style_height !== (style_height = `${/*$hourSize*/
|
|
ctx2[1]}px`)) {
|
|
set_style(div1, "height", style_height);
|
|
}
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div1);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment17(ctx) {
|
|
let div;
|
|
let each_value = (
|
|
/*visibleHours*/
|
|
ctx[0]
|
|
);
|
|
let each_blocks = [];
|
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
each_blocks[i] = create_each_block4(get_each_context4(ctx, each_value, i));
|
|
}
|
|
return {
|
|
c() {
|
|
div = element("div");
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].c();
|
|
}
|
|
attr(div, "class", "hours-container svelte-y3mmrv");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div, anchor);
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].m(div, null);
|
|
}
|
|
}
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
if (dirty & /*$hourSize, visibleHours*/
|
|
3) {
|
|
each_value = /*visibleHours*/
|
|
ctx2[0];
|
|
let i;
|
|
for (i = 0; i < each_value.length; i += 1) {
|
|
const child_ctx = get_each_context4(ctx2, each_value, i);
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].p(child_ctx, dirty);
|
|
} else {
|
|
each_blocks[i] = create_each_block4(child_ctx);
|
|
each_blocks[i].c();
|
|
each_blocks[i].m(div, null);
|
|
}
|
|
}
|
|
for (; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].d(1);
|
|
}
|
|
each_blocks.length = each_value.length;
|
|
}
|
|
},
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div);
|
|
destroy_each(each_blocks, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance13($$self, $$props, $$invalidate) {
|
|
let $hourSize;
|
|
component_subscribe($$self, hourSize, ($$value) => $$invalidate(1, $hourSize = $$value));
|
|
let { visibleHours: visibleHours2 } = $$props;
|
|
$$self.$$set = ($$props2) => {
|
|
if ("visibleHours" in $$props2)
|
|
$$invalidate(0, visibleHours2 = $$props2.visibleHours);
|
|
};
|
|
return [visibleHours2, $hourSize];
|
|
}
|
|
var Ruler = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance13, create_fragment17, safe_not_equal, { visibleHours: 0 }, add_css5);
|
|
}
|
|
};
|
|
var ruler_default = Ruler;
|
|
|
|
// src/util/create-watchable.ts
|
|
function createWatchable() {
|
|
const { subscribe: subscribe2, set } = writable();
|
|
function trigger() {
|
|
set({});
|
|
}
|
|
return {
|
|
subscribe: subscribe2,
|
|
trigger
|
|
};
|
|
}
|
|
|
|
// src/global-store/edit-events.ts
|
|
var editConfirmation = createWatchable();
|
|
var editCancellation = createWatchable();
|
|
|
|
// src/ui/actions/styled-cursor.ts
|
|
function styledCursor(el, cursor) {
|
|
const initial = el.style.cursor;
|
|
el.style.cursor = cursor;
|
|
return {
|
|
update(newCursor) {
|
|
el.style.cursor = newCursor || initial;
|
|
},
|
|
destroy() {
|
|
el.style.cursor = initial;
|
|
}
|
|
};
|
|
}
|
|
|
|
// src/ui/hooks/use-edit/transform/create.ts
|
|
function create(baseline, editTarget, cursorTime) {
|
|
const startMinutes = cursorTime;
|
|
const endMinutes = cursorTime + editTarget.durationMinutes;
|
|
const updated = {
|
|
...editTarget,
|
|
startMinutes,
|
|
endMinutes
|
|
};
|
|
return [...baseline, updated];
|
|
}
|
|
async function createPlanItem2(day, startMinutes) {
|
|
const endMinutes = startMinutes + defaultDurationMinutes;
|
|
const { path } = await createDailyNoteIfNeeded(day);
|
|
return {
|
|
id: getId(),
|
|
startMinutes,
|
|
durationMinutes: defaultDurationMinutes,
|
|
endMinutes,
|
|
firstLineText: "New item",
|
|
text: "New item",
|
|
startTime: minutesToMomentOfDay(startMinutes, day),
|
|
endTime: minutesToMomentOfDay(endMinutes, day),
|
|
// todo: no hardcode, this should be configurable
|
|
listTokens: "- ",
|
|
// todo: fix this, do not check for newly created tasks using their location
|
|
// @ts-ignore
|
|
location: {
|
|
path
|
|
},
|
|
placing: {
|
|
widthPercent: 100,
|
|
xOffsetPercent: 0
|
|
}
|
|
};
|
|
}
|
|
|
|
// src/util/to-spliced.ts
|
|
function toSpliced(array, index, el) {
|
|
const copy = [...array];
|
|
copy[index] = el;
|
|
return copy;
|
|
}
|
|
|
|
// src/ui/hooks/use-edit/transform/drag.ts
|
|
function drag(baseline, editTarget, cursorTime) {
|
|
const index = baseline.findIndex((task) => task.id === editTarget.id);
|
|
const startMinutes = cursorTime;
|
|
const endMinutes = cursorTime + editTarget.durationMinutes;
|
|
const updated = {
|
|
...editTarget,
|
|
startMinutes,
|
|
endMinutes
|
|
};
|
|
return toSpliced(baseline, index, updated);
|
|
}
|
|
|
|
// src/ui/hooks/use-edit/transform/drag-and-shift-others.ts
|
|
var import_lodash = __toESM(require_lodash());
|
|
function dragAndShiftOthers(baseline, editTarget, cursorTime) {
|
|
const index = baseline.findIndex((task) => task.id === editTarget.id);
|
|
const preceding = baseline.slice(0, index);
|
|
const following = baseline.slice(index + 1);
|
|
const newStartMinutes = cursorTime;
|
|
const newEndMinutes = cursorTime + editTarget.durationMinutes;
|
|
const updated = {
|
|
...editTarget,
|
|
startMinutes: newStartMinutes,
|
|
endMinutes: newEndMinutes
|
|
};
|
|
const updatedFollowing = following.reduce((result, current) => {
|
|
const previous = (0, import_lodash.last)(result) || updated;
|
|
if (previous.endMinutes > current.startMinutes) {
|
|
return [
|
|
...result,
|
|
{
|
|
...current,
|
|
startMinutes: previous.endMinutes,
|
|
endMinutes: previous.endMinutes + current.durationMinutes
|
|
}
|
|
];
|
|
}
|
|
return [...result, current];
|
|
}, []);
|
|
const updatedPreceding = preceding.reverse().reduce((result, current) => {
|
|
const nextInTimeline = (0, import_lodash.last)(result) || updated;
|
|
if (nextInTimeline.startMinutes < current.endMinutes) {
|
|
return [
|
|
...result,
|
|
{
|
|
...current,
|
|
startMinutes: nextInTimeline.startMinutes - current.durationMinutes,
|
|
endMinutes: nextInTimeline.startMinutes
|
|
}
|
|
];
|
|
}
|
|
return [...result, current];
|
|
}, []).reverse();
|
|
return [...updatedPreceding, updated, ...updatedFollowing];
|
|
}
|
|
|
|
// src/ui/hooks/use-edit/transform/resize.ts
|
|
function resize(baseline, editTarget, cursorTime) {
|
|
const index = baseline.findIndex((task) => task.id === editTarget.id);
|
|
const endMinutes = cursorTime;
|
|
const durationMinutes = cursorTime - editTarget.startMinutes;
|
|
const updated = {
|
|
...editTarget,
|
|
durationMinutes,
|
|
endMinutes
|
|
};
|
|
return toSpliced(baseline, index, updated);
|
|
}
|
|
|
|
// src/ui/hooks/use-edit/transform/resize-and-shift-others.ts
|
|
var import_lodash2 = __toESM(require_lodash());
|
|
function resizeAndShiftOthers(baseline, editTarget, cursorTime) {
|
|
const index = baseline.findIndex((task) => task.id === editTarget.id);
|
|
const preceding = baseline.slice(0, index);
|
|
const following = baseline.slice(index + 1);
|
|
const endMinutes = cursorTime;
|
|
const durationMinutes = endMinutes - editTarget.startMinutes;
|
|
const updated = {
|
|
...editTarget,
|
|
durationMinutes,
|
|
endMinutes
|
|
};
|
|
const updatedFollowing = following.reduce((result, current) => {
|
|
const previous = (0, import_lodash2.last)(result) || updated;
|
|
if (previous.endMinutes > current.startMinutes) {
|
|
return [
|
|
...result,
|
|
{
|
|
...current,
|
|
startMinutes: previous.endMinutes,
|
|
endMinutes: previous.endMinutes + current.durationMinutes
|
|
}
|
|
];
|
|
}
|
|
return [...result, current];
|
|
}, []);
|
|
return [...preceding, updated, ...updatedFollowing];
|
|
}
|
|
|
|
// src/ui/hooks/use-edit/transform/transform.ts
|
|
function transform(baseline, cursorTime, { task, mode }) {
|
|
switch (mode) {
|
|
case "DRAG" /* DRAG */:
|
|
return drag(baseline, task, cursorTime);
|
|
case "DRAG_AND_SHIFT_OTHERS" /* DRAG_AND_SHIFT_OTHERS */:
|
|
return dragAndShiftOthers(baseline, task, cursorTime);
|
|
case "CREATE" /* CREATE */:
|
|
return create(baseline, task, cursorTime);
|
|
case "RESIZE" /* RESIZE */:
|
|
return resize(baseline, task, cursorTime);
|
|
case "RESIZE_AND_SHIFT_OTHERS" /* RESIZE_AND_SHIFT_OTHERS */:
|
|
return resizeAndShiftOthers(baseline, task, cursorTime);
|
|
default:
|
|
throw new Error(`Unknown edit mode: ${mode}`);
|
|
}
|
|
}
|
|
|
|
// src/ui/hooks/use-edit/use-edit.ts
|
|
function offsetYToMinutes_NEW(offsetY, zoomLevel, startHour) {
|
|
const hiddenHoursSize2 = startHour * 60 * zoomLevel;
|
|
return (offsetY + hiddenHoursSize2) / zoomLevel;
|
|
}
|
|
function useEdit({
|
|
parsedTasks,
|
|
pointerOffsetY,
|
|
settings: settings2,
|
|
onUpdate
|
|
}) {
|
|
const baselineTasks = writable(parsedTasks);
|
|
const editOperation = writable();
|
|
const displayedTasks = derived(
|
|
[editOperation, pointerOffsetY, baselineTasks, settings2],
|
|
([$editOperation, $pointerOffsetY, $baselineTasks, $settings]) => {
|
|
if (!$editOperation) {
|
|
return $baselineTasks;
|
|
}
|
|
const cursorMinutes = offsetYToMinutes_NEW(
|
|
$pointerOffsetY,
|
|
$settings.zoomLevel,
|
|
$settings.startHour
|
|
);
|
|
return transform($baselineTasks, cursorMinutes, $editOperation);
|
|
}
|
|
);
|
|
const editStatus = derived(
|
|
editOperation,
|
|
($editOperation) => $editOperation == null ? void 0 : $editOperation.mode
|
|
);
|
|
function startEdit(operation) {
|
|
editOperation.set(operation);
|
|
}
|
|
async function confirmEdit() {
|
|
const currentTasks = get_store_value(displayedTasks);
|
|
baselineTasks.set(currentTasks.map((t) => ({ ...t, isGhost: false })));
|
|
editOperation.set(void 0);
|
|
await onUpdate(parsedTasks, currentTasks);
|
|
}
|
|
function cancelEdit() {
|
|
editOperation.set(void 0);
|
|
}
|
|
return {
|
|
startEdit,
|
|
confirmEdit,
|
|
cancelEdit,
|
|
displayedTasks,
|
|
editStatus
|
|
};
|
|
}
|
|
|
|
// src/global-store/settings-with-utils.ts
|
|
var settingsWithUtils = {
|
|
settings,
|
|
hourSize,
|
|
hiddenHoursSize,
|
|
visibleHours,
|
|
sizeToDuration,
|
|
durationToSize,
|
|
getTimeFromYOffset
|
|
};
|
|
|
|
// src/ui/hooks/use-color.ts
|
|
var import_chroma_js2 = __toESM(require_chroma());
|
|
|
|
// src/util/color.ts
|
|
var import_chroma_js = __toESM(require_chroma());
|
|
var lightThemeColors = {
|
|
normal: "#222222",
|
|
muted: "#5c5c5c",
|
|
faint: "#666666"
|
|
};
|
|
var darkThemeColors = {
|
|
normal: "#dadada",
|
|
muted: "#b3b3b3",
|
|
faint: "#ababab"
|
|
};
|
|
function getTextColorWithEnoughContrast(backgroundColor) {
|
|
return import_chroma_js.default.contrast(backgroundColor, darkThemeColors.normal) > import_chroma_js.default.contrast(backgroundColor, lightThemeColors.normal) ? darkThemeColors : lightThemeColors;
|
|
}
|
|
|
|
// src/ui/hooks/use-color.ts
|
|
function useColor({ settings: settings2, task }) {
|
|
const colorScale = derived(settings2, ($settings) => {
|
|
return import_chroma_js2.default.scale([$settings.timelineStartColor, $settings.timelineEndColor]).mode("lab");
|
|
});
|
|
const backgroundColor = derived(
|
|
[settings2, colorScale],
|
|
([$settings, $colorScale]) => {
|
|
const scaleKey = (task.startTime.hour() - $settings.startHour) / (24 - $settings.startHour);
|
|
return $settings.timelineColored && task.startTime ? $colorScale(scaleKey).hex() : "var(--background-primary)";
|
|
}
|
|
);
|
|
const properContrastColors = derived(
|
|
[settings2, backgroundColor],
|
|
([$settings, $backgroundColor]) => {
|
|
return $settings.timelineColored && task.startTime ? getTextColorWithEnoughContrast($backgroundColor) : {
|
|
normal: "var(--text-normal)",
|
|
muted: "var(--text-muted)",
|
|
faint: "var(--text-faint)"
|
|
};
|
|
}
|
|
);
|
|
return { properContrastColors, backgroundColor };
|
|
}
|
|
|
|
// src/ui/hooks/use-task.ts
|
|
function useTask(task, { settings: settings2, currentTime: currentTime2 }) {
|
|
const useColorValues = useColor({ settings: settings2.settings, task });
|
|
const offset = derived(
|
|
[settings2.settings, settings2.hiddenHoursSize],
|
|
([$settings, $hiddenHoursSize]) => {
|
|
return task.startMinutes * $settings.zoomLevel - $hiddenHoursSize;
|
|
}
|
|
);
|
|
const height = derived([settings2.settings], ([$settings]) => {
|
|
return task.durationMinutes * $settings.zoomLevel;
|
|
});
|
|
const relationToNow = derived([currentTime2], ([$currentTime]) => {
|
|
return getRelationToNow($currentTime, task.startTime, task.endTime);
|
|
});
|
|
return {
|
|
offset,
|
|
height,
|
|
relationToNow,
|
|
...useColorValues
|
|
};
|
|
}
|
|
|
|
// src/ui/components/rendered-markdown.svelte
|
|
var import_obsidian3 = require("obsidian");
|
|
function add_css6(target) {
|
|
append_styles(target, "svelte-13xlqzz", '.rendered-markdown.svelte-13xlqzz{--checkbox-size:var(--font-ui-small);flex:1 0 0;color:var(--text-normal)}.rendered-markdown.svelte-13xlqzz p,.rendered-markdown.svelte-13xlqzz ul{margin-block-start:0;margin-block-end:0}.rendered-markdown.svelte-13xlqzz ul,.rendered-markdown.svelte-13xlqzz ol{padding-inline-start:20px}.rendered-markdown.svelte-13xlqzz input[type="checkbox"]{top:2px;margin-inline-end:4px;border-color:var(--text-muted)}.rendered-markdown.svelte-13xlqzz li{color:var(--text-normal)}.rendered-markdown.svelte-13xlqzz li.task-list-item[data-task="x"],.rendered-markdown.svelte-13xlqzz li.task-list-item[data-task="X"]{color:var(--text-muted)}');
|
|
}
|
|
function create_fragment18(ctx) {
|
|
let div;
|
|
return {
|
|
c() {
|
|
div = element("div");
|
|
attr(div, "class", "rendered-markdown svelte-13xlqzz");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div, anchor);
|
|
ctx[5](div);
|
|
},
|
|
p: noop,
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div);
|
|
ctx[5](null);
|
|
}
|
|
};
|
|
}
|
|
function instance14($$self, $$props, $$invalidate) {
|
|
let $appStore;
|
|
component_subscribe($$self, appStore, ($$value) => $$invalidate(4, $appStore = $$value));
|
|
var _a;
|
|
let { text: text2 } = $$props;
|
|
let markdownLifecycleManager = new import_obsidian3.Component();
|
|
let el;
|
|
onDestroy(() => {
|
|
markdownLifecycleManager.unload();
|
|
});
|
|
function div_binding($$value) {
|
|
binding_callbacks[$$value ? "unshift" : "push"](() => {
|
|
el = $$value;
|
|
$$invalidate(0, el);
|
|
});
|
|
}
|
|
$$self.$$set = ($$props2) => {
|
|
if ("text" in $$props2)
|
|
$$invalidate(1, text2 = $$props2.text);
|
|
};
|
|
$$self.$$.update = () => {
|
|
if ($$self.$$.dirty & /*el, markdownLifecycleManager, $appStore, text, _a*/
|
|
31) {
|
|
$:
|
|
if (el) {
|
|
markdownLifecycleManager.unload();
|
|
$$invalidate(3, markdownLifecycleManager = new import_obsidian3.Component());
|
|
el.empty();
|
|
import_obsidian3.MarkdownRenderer.render($appStore, text2, el, "", markdownLifecycleManager);
|
|
markdownLifecycleManager.load();
|
|
$$invalidate(2, _a = el.querySelectorAll(`input[type="checkbox"]`)) === null || _a === void 0 ? void 0 : _a.forEach((checkbox2) => checkbox2.setAttribute("disabled", "true"));
|
|
}
|
|
}
|
|
};
|
|
return [el, text2, _a, markdownLifecycleManager, $appStore, div_binding];
|
|
}
|
|
var Rendered_markdown = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance14, create_fragment18, safe_not_equal, { text: 1 }, add_css6);
|
|
}
|
|
};
|
|
var rendered_markdown_default = Rendered_markdown;
|
|
|
|
// src/ui/components/task.svelte
|
|
function add_css7(target) {
|
|
append_styles(target, "svelte-1exzatw", ":not(#dummy).workspace-leaf-resize-handle.svelte-1exzatw{cursor:row-resize;right:0;bottom:0;left:0;display:block;height:calc(var(--divider-width-hover) * 2);border-bottom-style:solid;border-bottom-width:var(--divider-width)}.gap-box.svelte-1exzatw{display:flex;padding:0 1px 2px;transition:0.05s linear}.task.svelte-1exzatw{position:relative;overflow:hidden;display:flex;flex:1 0 0;padding:4px 6px 6px;font-size:var(--font-ui-small);text-align:left;overflow-wrap:anywhere;white-space:normal;border:1px solid var(--color-base-50);border-radius:var(--radius-s)}.past.svelte-1exzatw{background-color:var(--background-secondary)}.present.svelte-1exzatw{border-color:var(--color-accent)}.is-ghost.svelte-1exzatw{opacity:0.6}");
|
|
}
|
|
function create_fragment19(ctx) {
|
|
let div1;
|
|
let div0;
|
|
let renderedmarkdown;
|
|
let div;
|
|
let __text_faint_last;
|
|
let __text_muted_last;
|
|
let __text_normal_last;
|
|
let t0;
|
|
let t1;
|
|
let hr;
|
|
let div0_class_value;
|
|
let style_height = `${/*$height*/
|
|
ctx[7]}px`;
|
|
let style_transform = `translateY(${/*$offset*/
|
|
ctx[8]}px)`;
|
|
let style_width = `${/*planItem*/
|
|
ctx[0].placing.widthPercent || 100}%`;
|
|
let style_left = `${/*planItem*/
|
|
ctx[0].placing.xOffsetPercent || 0}%`;
|
|
let current;
|
|
let mounted;
|
|
let dispose;
|
|
renderedmarkdown = new rendered_markdown_default({
|
|
props: { text: (
|
|
/*planItem*/
|
|
ctx[0].text
|
|
) }
|
|
});
|
|
const default_slot_template = (
|
|
/*#slots*/
|
|
ctx[13].default
|
|
);
|
|
const default_slot = create_slot(
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[12],
|
|
null
|
|
);
|
|
return {
|
|
c() {
|
|
div1 = element("div");
|
|
div0 = element("div");
|
|
div = element("div");
|
|
create_component(renderedmarkdown.$$.fragment);
|
|
t0 = space();
|
|
if (default_slot)
|
|
default_slot.c();
|
|
t1 = space();
|
|
hr = element("hr");
|
|
set_style(div, "display", "contents");
|
|
set_style(div, "--text-faint", __text_faint_last = /*$properContrastColors*/
|
|
ctx[11].faint);
|
|
set_style(div, "--text-muted", __text_muted_last = /*$properContrastColors*/
|
|
ctx[11].muted);
|
|
set_style(div, "--text-normal", __text_normal_last = /*$properContrastColors*/
|
|
ctx[11].normal);
|
|
attr(hr, "class", "workspace-leaf-resize-handle svelte-1exzatw");
|
|
attr(div0, "class", div0_class_value = "task " + /*$relationToNow*/
|
|
ctx[10] + " svelte-1exzatw");
|
|
toggle_class(
|
|
div0,
|
|
"is-ghost",
|
|
/*planItem*/
|
|
ctx[0].isGhost
|
|
);
|
|
set_style(
|
|
div0,
|
|
"background-color",
|
|
/*$backgroundColor*/
|
|
ctx[9]
|
|
);
|
|
attr(div1, "class", "gap-box absolute-stretch-x svelte-1exzatw");
|
|
set_style(div1, "height", style_height);
|
|
set_style(div1, "transform", style_transform);
|
|
set_style(div1, "width", style_width);
|
|
set_style(div1, "left", style_left);
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div1, anchor);
|
|
append(div1, div0);
|
|
append(div0, div);
|
|
mount_component(renderedmarkdown, div, null);
|
|
append(div0, t0);
|
|
if (default_slot) {
|
|
default_slot.m(div0, null);
|
|
}
|
|
append(div0, t1);
|
|
append(div0, hr);
|
|
current = true;
|
|
if (!mounted) {
|
|
dispose = [
|
|
listen(hr, "mousedown", stop_propagation(function() {
|
|
if (is_function(
|
|
/*onResizeStart*/
|
|
ctx[1]
|
|
))
|
|
ctx[1].apply(this, arguments);
|
|
})),
|
|
listen(div0, "mousedown", mousedown_handler),
|
|
listen(
|
|
div0,
|
|
"mouseup",
|
|
/*mouseup_handler*/
|
|
ctx[14]
|
|
)
|
|
];
|
|
mounted = true;
|
|
}
|
|
},
|
|
p(new_ctx, [dirty]) {
|
|
ctx = new_ctx;
|
|
if (dirty & /*$properContrastColors*/
|
|
2048 && __text_faint_last !== (__text_faint_last = /*$properContrastColors*/
|
|
ctx[11].faint)) {
|
|
set_style(div, "--text-faint", __text_faint_last);
|
|
}
|
|
if (dirty & /*$properContrastColors*/
|
|
2048 && __text_muted_last !== (__text_muted_last = /*$properContrastColors*/
|
|
ctx[11].muted)) {
|
|
set_style(div, "--text-muted", __text_muted_last);
|
|
}
|
|
if (dirty & /*$properContrastColors*/
|
|
2048 && __text_normal_last !== (__text_normal_last = /*$properContrastColors*/
|
|
ctx[11].normal)) {
|
|
set_style(div, "--text-normal", __text_normal_last);
|
|
}
|
|
const renderedmarkdown_changes = {};
|
|
if (dirty & /*planItem*/
|
|
1)
|
|
renderedmarkdown_changes.text = /*planItem*/
|
|
ctx[0].text;
|
|
renderedmarkdown.$set(renderedmarkdown_changes);
|
|
if (default_slot) {
|
|
if (default_slot.p && (!current || dirty & /*$$scope*/
|
|
4096)) {
|
|
update_slot_base(
|
|
default_slot,
|
|
default_slot_template,
|
|
ctx,
|
|
/*$$scope*/
|
|
ctx[12],
|
|
!current ? get_all_dirty_from_scope(
|
|
/*$$scope*/
|
|
ctx[12]
|
|
) : get_slot_changes(
|
|
default_slot_template,
|
|
/*$$scope*/
|
|
ctx[12],
|
|
dirty,
|
|
null
|
|
),
|
|
null
|
|
);
|
|
}
|
|
}
|
|
if (!current || dirty & /*$relationToNow*/
|
|
1024 && div0_class_value !== (div0_class_value = "task " + /*$relationToNow*/
|
|
ctx[10] + " svelte-1exzatw")) {
|
|
attr(div0, "class", div0_class_value);
|
|
}
|
|
if (!current || dirty & /*$relationToNow, planItem*/
|
|
1025) {
|
|
toggle_class(
|
|
div0,
|
|
"is-ghost",
|
|
/*planItem*/
|
|
ctx[0].isGhost
|
|
);
|
|
}
|
|
if (dirty & /*$backgroundColor*/
|
|
512) {
|
|
set_style(
|
|
div0,
|
|
"background-color",
|
|
/*$backgroundColor*/
|
|
ctx[9]
|
|
);
|
|
}
|
|
if (dirty & /*$height*/
|
|
128 && style_height !== (style_height = `${/*$height*/
|
|
ctx[7]}px`)) {
|
|
set_style(div1, "height", style_height);
|
|
}
|
|
if (dirty & /*$offset*/
|
|
256 && style_transform !== (style_transform = `translateY(${/*$offset*/
|
|
ctx[8]}px)`)) {
|
|
set_style(div1, "transform", style_transform);
|
|
}
|
|
if (dirty & /*planItem*/
|
|
1 && style_width !== (style_width = `${/*planItem*/
|
|
ctx[0].placing.widthPercent || 100}%`)) {
|
|
set_style(div1, "width", style_width);
|
|
}
|
|
if (dirty & /*planItem*/
|
|
1 && style_left !== (style_left = `${/*planItem*/
|
|
ctx[0].placing.xOffsetPercent || 0}%`)) {
|
|
set_style(div1, "left", style_left);
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(renderedmarkdown.$$.fragment, local);
|
|
transition_in(default_slot, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(renderedmarkdown.$$.fragment, local);
|
|
transition_out(default_slot, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div1);
|
|
destroy_component(renderedmarkdown);
|
|
if (default_slot)
|
|
default_slot.d(detaching);
|
|
mounted = false;
|
|
run_all(dispose);
|
|
}
|
|
};
|
|
}
|
|
var mousedown_handler = (event) => event.stopPropagation();
|
|
function instance15($$self, $$props, $$invalidate) {
|
|
let height;
|
|
let offset;
|
|
let relationToNow;
|
|
let backgroundColor;
|
|
let properContrastColors;
|
|
let $height, $$unsubscribe_height = noop, $$subscribe_height = () => ($$unsubscribe_height(), $$unsubscribe_height = subscribe(height, ($$value) => $$invalidate(7, $height = $$value)), height);
|
|
let $offset, $$unsubscribe_offset = noop, $$subscribe_offset = () => ($$unsubscribe_offset(), $$unsubscribe_offset = subscribe(offset, ($$value) => $$invalidate(8, $offset = $$value)), offset);
|
|
let $backgroundColor, $$unsubscribe_backgroundColor = noop, $$subscribe_backgroundColor = () => ($$unsubscribe_backgroundColor(), $$unsubscribe_backgroundColor = subscribe(backgroundColor, ($$value) => $$invalidate(9, $backgroundColor = $$value)), backgroundColor);
|
|
let $relationToNow, $$unsubscribe_relationToNow = noop, $$subscribe_relationToNow = () => ($$unsubscribe_relationToNow(), $$unsubscribe_relationToNow = subscribe(relationToNow, ($$value) => $$invalidate(10, $relationToNow = $$value)), relationToNow);
|
|
let $properContrastColors, $$unsubscribe_properContrastColors = noop, $$subscribe_properContrastColors = () => ($$unsubscribe_properContrastColors(), $$unsubscribe_properContrastColors = subscribe(properContrastColors, ($$value) => $$invalidate(11, $properContrastColors = $$value)), properContrastColors);
|
|
$$self.$$.on_destroy.push(() => $$unsubscribe_height());
|
|
$$self.$$.on_destroy.push(() => $$unsubscribe_offset());
|
|
$$self.$$.on_destroy.push(() => $$unsubscribe_backgroundColor());
|
|
$$self.$$.on_destroy.push(() => $$unsubscribe_relationToNow());
|
|
$$self.$$.on_destroy.push(() => $$unsubscribe_properContrastColors());
|
|
let { $$slots: slots = {}, $$scope } = $$props;
|
|
let { planItem } = $$props;
|
|
let { onResizeStart } = $$props;
|
|
function mouseup_handler(event) {
|
|
bubble.call(this, $$self, event);
|
|
}
|
|
$$self.$$set = ($$props2) => {
|
|
if ("planItem" in $$props2)
|
|
$$invalidate(0, planItem = $$props2.planItem);
|
|
if ("onResizeStart" in $$props2)
|
|
$$invalidate(1, onResizeStart = $$props2.onResizeStart);
|
|
if ("$$scope" in $$props2)
|
|
$$invalidate(12, $$scope = $$props2.$$scope);
|
|
};
|
|
$$self.$$.update = () => {
|
|
if ($$self.$$.dirty & /*planItem*/
|
|
1) {
|
|
$:
|
|
$$subscribe_height($$invalidate(6, { height, offset, relationToNow, backgroundColor, properContrastColors } = useTask(planItem, { settings: settingsWithUtils, currentTime }), height, $$subscribe_offset($$invalidate(5, offset)), $$subscribe_relationToNow($$invalidate(4, relationToNow)), $$subscribe_backgroundColor($$invalidate(3, backgroundColor)), $$subscribe_properContrastColors($$invalidate(2, properContrastColors))));
|
|
}
|
|
};
|
|
return [
|
|
planItem,
|
|
onResizeStart,
|
|
properContrastColors,
|
|
backgroundColor,
|
|
relationToNow,
|
|
offset,
|
|
height,
|
|
$height,
|
|
$offset,
|
|
$backgroundColor,
|
|
$relationToNow,
|
|
$properContrastColors,
|
|
$$scope,
|
|
slots,
|
|
mouseup_handler
|
|
];
|
|
}
|
|
var Task = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance15, create_fragment19, safe_not_equal, { planItem: 0, onResizeStart: 1 }, add_css7);
|
|
}
|
|
};
|
|
var task_default = Task;
|
|
|
|
// src/ui/components/task-container.svelte
|
|
function add_css8(target) {
|
|
append_styles(target, "svelte-1o14c0z", "@keyframes svelte-1o14c0z-pulse{from{opacity:0.8}to{opacity:0.2}}.banner.svelte-1o14c0z{position:sticky;z-index:10;top:0;display:flex;align-items:center;justify-content:center;padding:var(--size-4-4);animation:svelte-1o14c0z-pulse 1s infinite alternate}.task-container.svelte-1o14c0z{top:0;bottom:0;display:flex;flex-direction:column;margin-right:10px;margin-left:10px}.grip.svelte-1o14c0z{position:relative;right:-4px;grid-column:2;align-self:flex-start;color:var(--text-faint)}.grip.svelte-1o14c0z:hover{color:var(--text-muted)}");
|
|
}
|
|
function get_each_context5(ctx, list, i) {
|
|
const child_ctx = ctx.slice();
|
|
child_ctx[29] = list[i];
|
|
return child_ctx;
|
|
}
|
|
function create_if_block_3(ctx) {
|
|
let div;
|
|
return {
|
|
c() {
|
|
div = element("div");
|
|
div.textContent = "Release outside this column to cancel edit";
|
|
attr(div, "class", "banner svelte-1o14c0z");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div, anchor);
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div);
|
|
}
|
|
};
|
|
}
|
|
function create_if_block2(ctx) {
|
|
let div;
|
|
let current_block_type_index;
|
|
let if_block;
|
|
let current;
|
|
let mounted;
|
|
let dispose;
|
|
const if_block_creators = [create_if_block_12, create_if_block_2, create_else_block];
|
|
const if_blocks = [];
|
|
function select_block_type(ctx2, dirty) {
|
|
if (
|
|
/*shiftPressed*/
|
|
ctx2[3]
|
|
)
|
|
return 0;
|
|
if (
|
|
/*controlPressed*/
|
|
ctx2[4]
|
|
)
|
|
return 1;
|
|
return 2;
|
|
}
|
|
current_block_type_index = select_block_type(ctx, [-1, -1]);
|
|
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
function mousedown_handler2() {
|
|
return (
|
|
/*mousedown_handler*/
|
|
ctx[23](
|
|
/*planItem*/
|
|
ctx[29]
|
|
)
|
|
);
|
|
}
|
|
return {
|
|
c() {
|
|
div = element("div");
|
|
if_block.c();
|
|
attr(div, "class", "grip svelte-1o14c0z");
|
|
set_style(
|
|
div,
|
|
"cursor",
|
|
/*gripCursor*/
|
|
ctx[7]
|
|
);
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div, anchor);
|
|
if_blocks[current_block_type_index].m(div, null);
|
|
current = true;
|
|
if (!mounted) {
|
|
dispose = listen(div, "mousedown", stop_propagation(mousedown_handler2));
|
|
mounted = true;
|
|
}
|
|
},
|
|
p(new_ctx, dirty) {
|
|
ctx = new_ctx;
|
|
let previous_block_index = current_block_type_index;
|
|
current_block_type_index = select_block_type(ctx, dirty);
|
|
if (current_block_type_index !== previous_block_index) {
|
|
group_outros();
|
|
transition_out(if_blocks[previous_block_index], 1, 1, () => {
|
|
if_blocks[previous_block_index] = null;
|
|
});
|
|
check_outros();
|
|
if_block = if_blocks[current_block_type_index];
|
|
if (!if_block) {
|
|
if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx);
|
|
if_block.c();
|
|
} else {
|
|
}
|
|
transition_in(if_block, 1);
|
|
if_block.m(div, null);
|
|
}
|
|
if (dirty[0] & /*gripCursor*/
|
|
128) {
|
|
set_style(
|
|
div,
|
|
"cursor",
|
|
/*gripCursor*/
|
|
ctx[7]
|
|
);
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(if_block);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(if_block);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div);
|
|
if_blocks[current_block_type_index].d();
|
|
mounted = false;
|
|
dispose();
|
|
}
|
|
};
|
|
}
|
|
function create_else_block(ctx) {
|
|
let gripvertical;
|
|
let current;
|
|
gripvertical = new Grip_vertical$1({ props: { class: "svg-icon" } });
|
|
return {
|
|
c() {
|
|
create_component(gripvertical.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(gripvertical, target, anchor);
|
|
current = true;
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(gripvertical.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(gripvertical.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(gripvertical, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_if_block_2(ctx) {
|
|
let layers;
|
|
let current;
|
|
layers = new Layers$1({ props: { class: "svg-icon" } });
|
|
return {
|
|
c() {
|
|
create_component(layers.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(layers, target, anchor);
|
|
current = true;
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(layers.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(layers.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(layers, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_if_block_12(ctx) {
|
|
let copy;
|
|
let current;
|
|
copy = new Copy$1({ props: { class: "svg-icon" } });
|
|
return {
|
|
c() {
|
|
create_component(copy.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(copy, target, anchor);
|
|
current = true;
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(copy.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(copy.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(copy, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot9(ctx) {
|
|
let t;
|
|
let current;
|
|
let if_block = !/*planItem*/
|
|
ctx[29].isGhost && create_if_block2(ctx);
|
|
return {
|
|
c() {
|
|
if (if_block)
|
|
if_block.c();
|
|
t = space();
|
|
},
|
|
m(target, anchor) {
|
|
if (if_block)
|
|
if_block.m(target, anchor);
|
|
insert(target, t, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (!/*planItem*/
|
|
ctx2[29].isGhost) {
|
|
if (if_block) {
|
|
if_block.p(ctx2, dirty);
|
|
if (dirty[0] & /*$displayedTasks*/
|
|
16384) {
|
|
transition_in(if_block, 1);
|
|
}
|
|
} else {
|
|
if_block = create_if_block2(ctx2);
|
|
if_block.c();
|
|
transition_in(if_block, 1);
|
|
if_block.m(t.parentNode, t);
|
|
}
|
|
} else if (if_block) {
|
|
group_outros();
|
|
transition_out(if_block, 1, 1, () => {
|
|
if_block = null;
|
|
});
|
|
check_outros();
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(if_block);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(if_block);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (if_block)
|
|
if_block.d(detaching);
|
|
if (detaching)
|
|
detach(t);
|
|
}
|
|
};
|
|
}
|
|
function create_each_block5(key_1, ctx) {
|
|
let first;
|
|
let task_1;
|
|
let current;
|
|
function func() {
|
|
return (
|
|
/*func*/
|
|
ctx[24](
|
|
/*planItem*/
|
|
ctx[29]
|
|
)
|
|
);
|
|
}
|
|
function mouseup_handler() {
|
|
return (
|
|
/*mouseup_handler*/
|
|
ctx[25](
|
|
/*planItem*/
|
|
ctx[29]
|
|
)
|
|
);
|
|
}
|
|
task_1 = new task_default({
|
|
props: {
|
|
onResizeStart: func,
|
|
planItem: (
|
|
/*planItem*/
|
|
ctx[29]
|
|
),
|
|
$$slots: { default: [create_default_slot9] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
task_1.$on("mouseup", mouseup_handler);
|
|
return {
|
|
key: key_1,
|
|
first: null,
|
|
c() {
|
|
first = empty();
|
|
create_component(task_1.$$.fragment);
|
|
this.first = first;
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, first, anchor);
|
|
mount_component(task_1, target, anchor);
|
|
current = true;
|
|
},
|
|
p(new_ctx, dirty) {
|
|
ctx = new_ctx;
|
|
const task_1_changes = {};
|
|
if (dirty[0] & /*controlPressed, startEdit, $displayedTasks*/
|
|
18448)
|
|
task_1_changes.onResizeStart = func;
|
|
if (dirty[0] & /*$displayedTasks*/
|
|
16384)
|
|
task_1_changes.planItem = /*planItem*/
|
|
ctx[29];
|
|
if (dirty[0] & /*gripCursor, $displayedTasks, controlPressed, shiftPressed, startEdit*/
|
|
18584 | dirty[1] & /*$$scope*/
|
|
2) {
|
|
task_1_changes.$$scope = { dirty, ctx };
|
|
}
|
|
task_1.$set(task_1_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(task_1.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(task_1.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(first);
|
|
destroy_component(task_1, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment20(ctx) {
|
|
let styledCursor_action;
|
|
let t0;
|
|
let t1;
|
|
let div;
|
|
let t2;
|
|
let each_blocks = [];
|
|
let each_1_lookup = /* @__PURE__ */ new Map();
|
|
let current;
|
|
let mounted;
|
|
let dispose;
|
|
let if_block = (
|
|
/*$editStatus*/
|
|
ctx[2] && /*$settings*/
|
|
ctx[12].showHelp && create_if_block_3(ctx)
|
|
);
|
|
let each_value = (
|
|
/*$displayedTasks*/
|
|
ctx[14]
|
|
);
|
|
const get_key = (ctx2) => getKey(
|
|
/*planItem*/
|
|
ctx2[29]
|
|
);
|
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
let child_ctx = get_each_context5(ctx, each_value, i);
|
|
let key = get_key(child_ctx);
|
|
each_1_lookup.set(key, each_blocks[i] = create_each_block5(key, child_ctx));
|
|
}
|
|
return {
|
|
c() {
|
|
t0 = space();
|
|
t1 = space();
|
|
div = element("div");
|
|
if (if_block)
|
|
if_block.c();
|
|
t2 = space();
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].c();
|
|
}
|
|
attr(div, "class", "task-container absolute-stretch-x svelte-1o14c0z");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, t0, anchor);
|
|
insert(target, t1, anchor);
|
|
insert(target, div, anchor);
|
|
if (if_block)
|
|
if_block.m(div, null);
|
|
append(div, t2);
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].m(div, null);
|
|
}
|
|
}
|
|
ctx[26](div);
|
|
current = true;
|
|
if (!mounted) {
|
|
dispose = [
|
|
action_destroyer(styledCursor_action = styledCursor.call(
|
|
null,
|
|
document.body,
|
|
/*bodyCursor*/
|
|
ctx[6]
|
|
)),
|
|
listen(document, "mouseup", editCancellation.trigger),
|
|
listen(
|
|
document,
|
|
"mousemove",
|
|
/*mousemove_handler*/
|
|
ctx[20]
|
|
),
|
|
listen(
|
|
document,
|
|
"keydown",
|
|
/*keydown_handler*/
|
|
ctx[21]
|
|
),
|
|
listen(
|
|
document,
|
|
"keyup",
|
|
/*keyup_handler*/
|
|
ctx[22]
|
|
),
|
|
listen(
|
|
div,
|
|
"mousedown",
|
|
/*mousedown_handler_1*/
|
|
ctx[27]
|
|
),
|
|
listen(div, "mouseup", stop_propagation(
|
|
/*mouseup_handler_1*/
|
|
ctx[28]
|
|
))
|
|
];
|
|
mounted = true;
|
|
}
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (styledCursor_action && is_function(styledCursor_action.update) && dirty[0] & /*bodyCursor*/
|
|
64)
|
|
styledCursor_action.update.call(
|
|
null,
|
|
/*bodyCursor*/
|
|
ctx2[6]
|
|
);
|
|
if (
|
|
/*$editStatus*/
|
|
ctx2[2] && /*$settings*/
|
|
ctx2[12].showHelp
|
|
) {
|
|
if (if_block) {
|
|
} else {
|
|
if_block = create_if_block_3(ctx2);
|
|
if_block.c();
|
|
if_block.m(div, t2);
|
|
}
|
|
} else if (if_block) {
|
|
if_block.d(1);
|
|
if_block = null;
|
|
}
|
|
if (dirty[0] & /*controlPressed, startEdit, $displayedTasks, $editStatus, obsidianFacade, gripCursor, shiftPressed*/
|
|
18590) {
|
|
each_value = /*$displayedTasks*/
|
|
ctx2[14];
|
|
group_outros();
|
|
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx2, each_value, each_1_lookup, div, outro_and_destroy_block, create_each_block5, null, get_each_context5);
|
|
check_outros();
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
transition_in(each_blocks[i]);
|
|
}
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
transition_out(each_blocks[i]);
|
|
}
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(t0);
|
|
if (detaching)
|
|
detach(t1);
|
|
if (detaching)
|
|
detach(div);
|
|
if (if_block)
|
|
if_block.d();
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].d();
|
|
}
|
|
ctx[26](null);
|
|
mounted = false;
|
|
run_all(dispose);
|
|
}
|
|
};
|
|
}
|
|
function getKey(task) {
|
|
var _a;
|
|
return `${task.startMinutes} ${task.endMinutes} ${task.text} ${(_a = task.isGhost) !== null && _a !== void 0 ? _a : ""}`;
|
|
}
|
|
function instance16($$self, $$props, $$invalidate) {
|
|
let startEdit;
|
|
let displayedTasks;
|
|
let cancelEdit;
|
|
let editStatus;
|
|
let confirmEdit;
|
|
let $editCancellation;
|
|
let $editStatus, $$unsubscribe_editStatus = noop, $$subscribe_editStatus = () => ($$unsubscribe_editStatus(), $$unsubscribe_editStatus = subscribe(editStatus, ($$value) => $$invalidate(2, $editStatus = $$value)), editStatus);
|
|
let $settings;
|
|
let $pointerOffsetY;
|
|
let $displayedTasks, $$unsubscribe_displayedTasks = noop, $$subscribe_displayedTasks = () => ($$unsubscribe_displayedTasks(), $$unsubscribe_displayedTasks = subscribe(displayedTasks, ($$value) => $$invalidate(14, $displayedTasks = $$value)), displayedTasks);
|
|
component_subscribe($$self, editCancellation, ($$value) => $$invalidate(19, $editCancellation = $$value));
|
|
component_subscribe($$self, settings, ($$value) => $$invalidate(12, $settings = $$value));
|
|
$$self.$$.on_destroy.push(() => $$unsubscribe_editStatus());
|
|
$$self.$$.on_destroy.push(() => $$unsubscribe_displayedTasks());
|
|
let { tasks } = $$props;
|
|
let { day } = $$props;
|
|
let { obsidianFacade } = $$props;
|
|
let { onUpdate } = $$props;
|
|
let shiftPressed = false;
|
|
let controlPressed = false;
|
|
let el;
|
|
let bodyCursor = void 0;
|
|
let gripCursor = "grab";
|
|
const pointerOffsetY = writable(0);
|
|
component_subscribe($$self, pointerOffsetY, (value) => $$invalidate(13, $pointerOffsetY = value));
|
|
const mousemove_handler = (event) => {
|
|
const viewportToElOffsetY = el.getBoundingClientRect().top;
|
|
const borderTopToPointerOffsetY = event.clientY - viewportToElOffsetY;
|
|
pointerOffsetY.set(snap(borderTopToPointerOffsetY, $settings.zoomLevel));
|
|
};
|
|
const keydown_handler = (event) => {
|
|
if (event.shiftKey) {
|
|
$$invalidate(3, shiftPressed = true);
|
|
}
|
|
if (event.ctrlKey) {
|
|
$$invalidate(4, controlPressed = true);
|
|
}
|
|
};
|
|
const keyup_handler = (event) => {
|
|
if (!event.shiftKey) {
|
|
$$invalidate(3, shiftPressed = false);
|
|
}
|
|
if (!event.ctrlKey) {
|
|
$$invalidate(4, controlPressed = false);
|
|
}
|
|
};
|
|
const mousedown_handler2 = (planItem) => {
|
|
let mode = "DRAG" /* DRAG */;
|
|
let task = planItem;
|
|
if (controlPressed) {
|
|
mode = "DRAG_AND_SHIFT_OTHERS" /* DRAG_AND_SHIFT_OTHERS */;
|
|
} else if (shiftPressed) {
|
|
mode = "CREATE" /* CREATE */;
|
|
task = {
|
|
...planItem,
|
|
id: getId(),
|
|
isGhost: true,
|
|
location: { ...planItem.location, line: void 0 }
|
|
};
|
|
}
|
|
startEdit({ task, mode });
|
|
};
|
|
const func = (planItem) => {
|
|
const mode = controlPressed ? "RESIZE_AND_SHIFT_OTHERS" /* RESIZE_AND_SHIFT_OTHERS */ : "RESIZE" /* RESIZE */;
|
|
startEdit({ task: planItem, mode });
|
|
};
|
|
const mouseup_handler = async (planItem) => {
|
|
if ($editStatus) {
|
|
return;
|
|
}
|
|
const { path, line } = planItem.location;
|
|
await obsidianFacade.revealLineInFile(path, line);
|
|
};
|
|
function div_binding($$value) {
|
|
binding_callbacks[$$value ? "unshift" : "push"](() => {
|
|
el = $$value;
|
|
$$invalidate(5, el);
|
|
});
|
|
}
|
|
const mousedown_handler_1 = async () => {
|
|
const newTask = await createPlanItem2(day, offsetYToMinutes_NEW($pointerOffsetY, $settings.zoomLevel, $settings.startHour));
|
|
startEdit({
|
|
task: { ...newTask, isGhost: true },
|
|
mode: "CREATE" /* CREATE */
|
|
});
|
|
};
|
|
const mouseup_handler_1 = async () => {
|
|
editConfirmation.trigger();
|
|
await confirmEdit();
|
|
};
|
|
$$self.$$set = ($$props2) => {
|
|
if ("tasks" in $$props2)
|
|
$$invalidate(16, tasks = $$props2.tasks);
|
|
if ("day" in $$props2)
|
|
$$invalidate(0, day = $$props2.day);
|
|
if ("obsidianFacade" in $$props2)
|
|
$$invalidate(1, obsidianFacade = $$props2.obsidianFacade);
|
|
if ("onUpdate" in $$props2)
|
|
$$invalidate(17, onUpdate = $$props2.onUpdate);
|
|
};
|
|
$$self.$$.update = () => {
|
|
if ($$self.$$.dirty[0] & /*tasks, onUpdate*/
|
|
196608) {
|
|
$:
|
|
$$invalidate(
|
|
11,
|
|
{ startEdit, displayedTasks, cancelEdit, editStatus, confirmEdit } = useEdit({
|
|
parsedTasks: tasks,
|
|
settings,
|
|
pointerOffsetY,
|
|
onUpdate
|
|
}),
|
|
startEdit,
|
|
$$subscribe_displayedTasks($$invalidate(10, displayedTasks)),
|
|
($$invalidate(18, cancelEdit), $$invalidate(16, tasks), $$invalidate(17, onUpdate)),
|
|
$$subscribe_editStatus($$invalidate(9, editStatus)),
|
|
($$invalidate(8, confirmEdit), $$invalidate(16, tasks), $$invalidate(17, onUpdate))
|
|
);
|
|
}
|
|
if ($$self.$$.dirty[0] & /*$editStatus*/
|
|
4) {
|
|
$:
|
|
if ($editStatus === "CREATE" /* CREATE */ || $editStatus === "DRAG" /* DRAG */ || $editStatus === "DRAG_AND_SHIFT_OTHERS" /* DRAG_AND_SHIFT_OTHERS */) {
|
|
$$invalidate(6, bodyCursor = "grabbing");
|
|
$$invalidate(7, gripCursor = "grabbing");
|
|
} else if ($editStatus === "RESIZE" /* RESIZE */ || $editStatus === "RESIZE_AND_SHIFT_OTHERS" /* RESIZE_AND_SHIFT_OTHERS */) {
|
|
$$invalidate(6, bodyCursor = "row-resize");
|
|
} else {
|
|
$$invalidate(6, bodyCursor = void 0);
|
|
$$invalidate(7, gripCursor = "grab");
|
|
}
|
|
}
|
|
if ($$self.$$.dirty[0] & /*$editCancellation, cancelEdit*/
|
|
786432) {
|
|
$: {
|
|
$editCancellation;
|
|
cancelEdit();
|
|
}
|
|
}
|
|
};
|
|
return [
|
|
day,
|
|
obsidianFacade,
|
|
$editStatus,
|
|
shiftPressed,
|
|
controlPressed,
|
|
el,
|
|
bodyCursor,
|
|
gripCursor,
|
|
confirmEdit,
|
|
editStatus,
|
|
displayedTasks,
|
|
startEdit,
|
|
$settings,
|
|
$pointerOffsetY,
|
|
$displayedTasks,
|
|
pointerOffsetY,
|
|
tasks,
|
|
onUpdate,
|
|
cancelEdit,
|
|
$editCancellation,
|
|
mousemove_handler,
|
|
keydown_handler,
|
|
keyup_handler,
|
|
mousedown_handler2,
|
|
func,
|
|
mouseup_handler,
|
|
div_binding,
|
|
mousedown_handler_1,
|
|
mouseup_handler_1
|
|
];
|
|
}
|
|
var Task_container = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(
|
|
this,
|
|
options,
|
|
instance16,
|
|
create_fragment20,
|
|
safe_not_equal,
|
|
{
|
|
tasks: 16,
|
|
day: 0,
|
|
obsidianFacade: 1,
|
|
onUpdate: 17
|
|
},
|
|
add_css8,
|
|
[-1, -1]
|
|
);
|
|
}
|
|
};
|
|
var task_container_default = Task_container;
|
|
|
|
// src/ui/components/timeline.svelte
|
|
function add_css9(target) {
|
|
append_styles(target, "svelte-1fzzjqj", ".vertical-scroller.svelte-1fzzjqj{overflow:auto;height:100%}.scale-with-days.svelte-1fzzjqj{display:flex}");
|
|
}
|
|
function create_if_block3(ctx) {
|
|
let needle;
|
|
let current;
|
|
needle = new needle_default({
|
|
props: {
|
|
autoScrollBlocked: (
|
|
/*userHoversOverScroller*/
|
|
ctx[2]
|
|
)
|
|
}
|
|
});
|
|
return {
|
|
c() {
|
|
create_component(needle.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(needle, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
const needle_changes = {};
|
|
if (dirty & /*userHoversOverScroller*/
|
|
4)
|
|
needle_changes.autoScrollBlocked = /*userHoversOverScroller*/
|
|
ctx2[2];
|
|
needle.$set(needle_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(needle.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(needle.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(needle, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot10(ctx) {
|
|
let show_if = isToday(
|
|
/*$visibleDayInTimeline*/
|
|
ctx[3]
|
|
);
|
|
let t;
|
|
let taskcontainer;
|
|
let current;
|
|
let if_block = show_if && create_if_block3(ctx);
|
|
taskcontainer = new task_container_default({
|
|
props: {
|
|
day: (
|
|
/*$visibleDayInTimeline*/
|
|
ctx[3]
|
|
),
|
|
obsidianFacade: (
|
|
/*obsidianFacade*/
|
|
ctx[0]
|
|
),
|
|
onUpdate: (
|
|
/*onUpdate*/
|
|
ctx[1]
|
|
),
|
|
tasks: (
|
|
/*$parsedTasks*/
|
|
ctx[5]
|
|
)
|
|
}
|
|
});
|
|
return {
|
|
c() {
|
|
if (if_block)
|
|
if_block.c();
|
|
t = space();
|
|
create_component(taskcontainer.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
if (if_block)
|
|
if_block.m(target, anchor);
|
|
insert(target, t, anchor);
|
|
mount_component(taskcontainer, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (dirty & /*$visibleDayInTimeline*/
|
|
8)
|
|
show_if = isToday(
|
|
/*$visibleDayInTimeline*/
|
|
ctx2[3]
|
|
);
|
|
if (show_if) {
|
|
if (if_block) {
|
|
if_block.p(ctx2, dirty);
|
|
if (dirty & /*$visibleDayInTimeline*/
|
|
8) {
|
|
transition_in(if_block, 1);
|
|
}
|
|
} else {
|
|
if_block = create_if_block3(ctx2);
|
|
if_block.c();
|
|
transition_in(if_block, 1);
|
|
if_block.m(t.parentNode, t);
|
|
}
|
|
} else if (if_block) {
|
|
group_outros();
|
|
transition_out(if_block, 1, 1, () => {
|
|
if_block = null;
|
|
});
|
|
check_outros();
|
|
}
|
|
const taskcontainer_changes = {};
|
|
if (dirty & /*$visibleDayInTimeline*/
|
|
8)
|
|
taskcontainer_changes.day = /*$visibleDayInTimeline*/
|
|
ctx2[3];
|
|
if (dirty & /*obsidianFacade*/
|
|
1)
|
|
taskcontainer_changes.obsidianFacade = /*obsidianFacade*/
|
|
ctx2[0];
|
|
if (dirty & /*onUpdate*/
|
|
2)
|
|
taskcontainer_changes.onUpdate = /*onUpdate*/
|
|
ctx2[1];
|
|
if (dirty & /*$parsedTasks*/
|
|
32)
|
|
taskcontainer_changes.tasks = /*$parsedTasks*/
|
|
ctx2[5];
|
|
taskcontainer.$set(taskcontainer_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(if_block);
|
|
transition_in(taskcontainer.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(if_block);
|
|
transition_out(taskcontainer.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (if_block)
|
|
if_block.d(detaching);
|
|
if (detaching)
|
|
detach(t);
|
|
destroy_component(taskcontainer, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment21(ctx) {
|
|
let controls;
|
|
let t0;
|
|
let div1;
|
|
let div0;
|
|
let ruler;
|
|
let t1;
|
|
let column;
|
|
let current;
|
|
let mounted;
|
|
let dispose;
|
|
controls = new controls_default({
|
|
props: {
|
|
day: (
|
|
/*$visibleDayInTimeline*/
|
|
ctx[3]
|
|
),
|
|
obsidianFacade: (
|
|
/*obsidianFacade*/
|
|
ctx[0]
|
|
)
|
|
}
|
|
});
|
|
ruler = new ruler_default({
|
|
props: { visibleHours: (
|
|
/*$visibleHours*/
|
|
ctx[4]
|
|
) }
|
|
});
|
|
column = new column_default({
|
|
props: {
|
|
visibleHours: (
|
|
/*$visibleHours*/
|
|
ctx[4]
|
|
),
|
|
$$slots: { default: [create_default_slot10] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
return {
|
|
c() {
|
|
create_component(controls.$$.fragment);
|
|
t0 = space();
|
|
div1 = element("div");
|
|
div0 = element("div");
|
|
create_component(ruler.$$.fragment);
|
|
t1 = space();
|
|
create_component(column.$$.fragment);
|
|
attr(div0, "class", "scale-with-days svelte-1fzzjqj");
|
|
attr(div1, "class", "vertical-scroller svelte-1fzzjqj");
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(controls, target, anchor);
|
|
insert(target, t0, anchor);
|
|
insert(target, div1, anchor);
|
|
append(div1, div0);
|
|
mount_component(ruler, div0, null);
|
|
append(div0, t1);
|
|
mount_component(column, div0, null);
|
|
current = true;
|
|
if (!mounted) {
|
|
dispose = [
|
|
listen(
|
|
div1,
|
|
"mouseenter",
|
|
/*handleMouseEnter*/
|
|
ctx[6]
|
|
),
|
|
listen(
|
|
div1,
|
|
"mouseleave",
|
|
/*handleMouseLeave*/
|
|
ctx[7]
|
|
)
|
|
];
|
|
mounted = true;
|
|
}
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
const controls_changes = {};
|
|
if (dirty & /*$visibleDayInTimeline*/
|
|
8)
|
|
controls_changes.day = /*$visibleDayInTimeline*/
|
|
ctx2[3];
|
|
if (dirty & /*obsidianFacade*/
|
|
1)
|
|
controls_changes.obsidianFacade = /*obsidianFacade*/
|
|
ctx2[0];
|
|
controls.$set(controls_changes);
|
|
const ruler_changes = {};
|
|
if (dirty & /*$visibleHours*/
|
|
16)
|
|
ruler_changes.visibleHours = /*$visibleHours*/
|
|
ctx2[4];
|
|
ruler.$set(ruler_changes);
|
|
const column_changes = {};
|
|
if (dirty & /*$visibleHours*/
|
|
16)
|
|
column_changes.visibleHours = /*$visibleHours*/
|
|
ctx2[4];
|
|
if (dirty & /*$$scope, $visibleDayInTimeline, obsidianFacade, onUpdate, $parsedTasks, userHoversOverScroller*/
|
|
559) {
|
|
column_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
column.$set(column_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(controls.$$.fragment, local);
|
|
transition_in(ruler.$$.fragment, local);
|
|
transition_in(column.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(controls.$$.fragment, local);
|
|
transition_out(ruler.$$.fragment, local);
|
|
transition_out(column.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(controls, detaching);
|
|
if (detaching)
|
|
detach(t0);
|
|
if (detaching)
|
|
detach(div1);
|
|
destroy_component(ruler);
|
|
destroy_component(column);
|
|
mounted = false;
|
|
run_all(dispose);
|
|
}
|
|
};
|
|
}
|
|
function instance17($$self, $$props, $$invalidate) {
|
|
let $visibleDayInTimeline;
|
|
let $visibleHours;
|
|
let $parsedTasks;
|
|
component_subscribe($$self, visibleDayInTimeline, ($$value) => $$invalidate(3, $visibleDayInTimeline = $$value));
|
|
component_subscribe($$self, visibleHours, ($$value) => $$invalidate(4, $visibleHours = $$value));
|
|
let { obsidianFacade } = $$props;
|
|
let { onUpdate } = $$props;
|
|
let userHoversOverScroller = false;
|
|
function handleMouseEnter() {
|
|
$$invalidate(2, userHoversOverScroller = true);
|
|
}
|
|
function handleMouseLeave() {
|
|
$$invalidate(2, userHoversOverScroller = false);
|
|
}
|
|
const parsedTasks = derived(
|
|
visibleDayInTimeline,
|
|
(v, set) => {
|
|
const note = (0, import_obsidian_daily_notes_interface4.getDailyNote)(v, (0, import_obsidian_daily_notes_interface4.getAllDailyNotes)());
|
|
obsidianFacade.getPlanItemsFromFile(note).then((v2) => set(addPlacing(v2)));
|
|
},
|
|
[]
|
|
);
|
|
component_subscribe($$self, parsedTasks, (value) => $$invalidate(5, $parsedTasks = value));
|
|
$$self.$$set = ($$props2) => {
|
|
if ("obsidianFacade" in $$props2)
|
|
$$invalidate(0, obsidianFacade = $$props2.obsidianFacade);
|
|
if ("onUpdate" in $$props2)
|
|
$$invalidate(1, onUpdate = $$props2.onUpdate);
|
|
};
|
|
return [
|
|
obsidianFacade,
|
|
onUpdate,
|
|
userHoversOverScroller,
|
|
$visibleDayInTimeline,
|
|
$visibleHours,
|
|
$parsedTasks,
|
|
handleMouseEnter,
|
|
handleMouseLeave,
|
|
parsedTasks
|
|
];
|
|
}
|
|
var Timeline = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance17, create_fragment21, safe_not_equal, { obsidianFacade: 0, onUpdate: 1 }, add_css9);
|
|
}
|
|
};
|
|
var timeline_default = Timeline;
|
|
|
|
// src/ui/timeline-view.ts
|
|
var TimelineView = class extends import_obsidian4.ItemView {
|
|
constructor(leaf, settings2, obsidianFacade, planEditor) {
|
|
super(leaf);
|
|
this.settings = settings2;
|
|
this.obsidianFacade = obsidianFacade;
|
|
this.planEditor = planEditor;
|
|
}
|
|
getViewType() {
|
|
return viewTypeTimeline;
|
|
}
|
|
getDisplayText() {
|
|
return "Day Planner Timeline";
|
|
}
|
|
getIcon() {
|
|
return this.settings.timelineIcon;
|
|
}
|
|
async onOpen() {
|
|
const contentEl = this.containerEl.children[1];
|
|
this.timeline = new timeline_default({
|
|
target: contentEl,
|
|
props: {
|
|
obsidianFacade: this.obsidianFacade,
|
|
onUpdate: this.planEditor.syncTasksWithFile
|
|
}
|
|
});
|
|
}
|
|
async onClose() {
|
|
var _a;
|
|
(_a = this.timeline) == null ? void 0 : _a.$destroy();
|
|
}
|
|
};
|
|
|
|
// src/ui/weekly-view.ts
|
|
var import_obsidian5 = require("obsidian");
|
|
|
|
// src/ui/components/week/header-actions.svelte
|
|
function add_css10(target) {
|
|
append_styles(target, "svelte-vfradk", ".range.svelte-vfradk{flex:1 0 0;margin-right:10px;white-space:nowrap}");
|
|
}
|
|
function create_default_slot_22(ctx) {
|
|
let arrowlefttoline;
|
|
let current;
|
|
arrowlefttoline = new Arrow_left_to_line$1({ props: { class: "svg-icon" } });
|
|
return {
|
|
c() {
|
|
create_component(arrowlefttoline.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(arrowlefttoline, target, anchor);
|
|
current = true;
|
|
},
|
|
p: noop,
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(arrowlefttoline.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(arrowlefttoline.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(arrowlefttoline, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot_12(ctx) {
|
|
let circledoticon;
|
|
let current;
|
|
circledoticon = new Circle_dot$1({ props: { class: "svg-icon" } });
|
|
return {
|
|
c() {
|
|
create_component(circledoticon.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(circledoticon, target, anchor);
|
|
current = true;
|
|
},
|
|
p: noop,
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(circledoticon.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(circledoticon.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(circledoticon, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_default_slot11(ctx) {
|
|
let arrowrighttoline;
|
|
let current;
|
|
arrowrighttoline = new Arrow_right_to_line$1({ props: { class: "svg-icon" } });
|
|
return {
|
|
c() {
|
|
create_component(arrowrighttoline.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(arrowrighttoline, target, anchor);
|
|
current = true;
|
|
},
|
|
p: noop,
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(arrowrighttoline.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(arrowrighttoline.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(arrowrighttoline, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment22(ctx) {
|
|
let div1;
|
|
let div0;
|
|
let t0;
|
|
let t1;
|
|
let t2;
|
|
let t3;
|
|
let controlbutton0;
|
|
let t4;
|
|
let controlbutton1;
|
|
let t5;
|
|
let controlbutton2;
|
|
let current;
|
|
controlbutton0 = new control_button_default({
|
|
props: {
|
|
label: "Show previous week",
|
|
$$slots: { default: [create_default_slot_22] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton0.$on(
|
|
"click",
|
|
/*handleShowPrevious*/
|
|
ctx[2]
|
|
);
|
|
controlbutton1 = new control_button_default({
|
|
props: {
|
|
label: "Show current week",
|
|
$$slots: { default: [create_default_slot_12] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton1.$on(
|
|
"click",
|
|
/*handleShowCurrent*/
|
|
ctx[3]
|
|
);
|
|
controlbutton2 = new control_button_default({
|
|
props: {
|
|
label: "Show next week",
|
|
$$slots: { default: [create_default_slot11] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton2.$on(
|
|
"click",
|
|
/*handleShowNext*/
|
|
ctx[4]
|
|
);
|
|
return {
|
|
c() {
|
|
div1 = element("div");
|
|
div0 = element("div");
|
|
t0 = text(
|
|
/*startOfRange*/
|
|
ctx[1]
|
|
);
|
|
t1 = text(" - ");
|
|
t2 = text(
|
|
/*endOfRange*/
|
|
ctx[0]
|
|
);
|
|
t3 = space();
|
|
create_component(controlbutton0.$$.fragment);
|
|
t4 = space();
|
|
create_component(controlbutton1.$$.fragment);
|
|
t5 = space();
|
|
create_component(controlbutton2.$$.fragment);
|
|
attr(div0, "class", "range svelte-vfradk");
|
|
attr(div1, "class", "view-header-nav-buttons");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div1, anchor);
|
|
append(div1, div0);
|
|
append(div0, t0);
|
|
append(div0, t1);
|
|
append(div0, t2);
|
|
append(div1, t3);
|
|
mount_component(controlbutton0, div1, null);
|
|
append(div1, t4);
|
|
mount_component(controlbutton1, div1, null);
|
|
append(div1, t5);
|
|
mount_component(controlbutton2, div1, null);
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
if (!current || dirty & /*startOfRange*/
|
|
2)
|
|
set_data(
|
|
t0,
|
|
/*startOfRange*/
|
|
ctx2[1]
|
|
);
|
|
if (!current || dirty & /*endOfRange*/
|
|
1)
|
|
set_data(
|
|
t2,
|
|
/*endOfRange*/
|
|
ctx2[0]
|
|
);
|
|
const controlbutton0_changes = {};
|
|
if (dirty & /*$$scope*/
|
|
128) {
|
|
controlbutton0_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton0.$set(controlbutton0_changes);
|
|
const controlbutton1_changes = {};
|
|
if (dirty & /*$$scope*/
|
|
128) {
|
|
controlbutton1_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton1.$set(controlbutton1_changes);
|
|
const controlbutton2_changes = {};
|
|
if (dirty & /*$$scope*/
|
|
128) {
|
|
controlbutton2_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
controlbutton2.$set(controlbutton2_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(controlbutton0.$$.fragment, local);
|
|
transition_in(controlbutton1.$$.fragment, local);
|
|
transition_in(controlbutton2.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(controlbutton0.$$.fragment, local);
|
|
transition_out(controlbutton1.$$.fragment, local);
|
|
transition_out(controlbutton2.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div1);
|
|
destroy_component(controlbutton0);
|
|
destroy_component(controlbutton1);
|
|
destroy_component(controlbutton2);
|
|
}
|
|
};
|
|
}
|
|
function instance18($$self, $$props, $$invalidate) {
|
|
let firstDayOfShownWeek;
|
|
let startOfRange;
|
|
let endOfRange;
|
|
let $visibleDateRange;
|
|
component_subscribe($$self, visibleDateRange, ($$value) => $$invalidate(6, $visibleDateRange = $$value));
|
|
function handleShowPrevious() {
|
|
const firstDayOfPreviousWeek = firstDayOfShownWeek.clone().subtract(1, "week");
|
|
const daysOfPreviousWeek = getDaysOfWeek(firstDayOfPreviousWeek);
|
|
visibleDateRange.set(daysOfPreviousWeek);
|
|
}
|
|
function handleShowCurrent() {
|
|
visibleDateRange.set(getDaysOfCurrentWeek());
|
|
}
|
|
function handleShowNext() {
|
|
const firstDayOfNextWeek = firstDayOfShownWeek.clone().add(1, "week");
|
|
const daysOfNextWeek = getDaysOfWeek(firstDayOfNextWeek);
|
|
visibleDateRange.set(daysOfNextWeek);
|
|
}
|
|
$$self.$$.update = () => {
|
|
if ($$self.$$.dirty & /*$visibleDateRange*/
|
|
64) {
|
|
$:
|
|
$$invalidate(5, firstDayOfShownWeek = $visibleDateRange[0]);
|
|
}
|
|
if ($$self.$$.dirty & /*firstDayOfShownWeek*/
|
|
32) {
|
|
$:
|
|
$$invalidate(1, startOfRange = firstDayOfShownWeek.format("MMM, D"));
|
|
}
|
|
if ($$self.$$.dirty & /*$visibleDateRange*/
|
|
64) {
|
|
$:
|
|
$$invalidate(0, endOfRange = $visibleDateRange.at(-1).format("MMM, D"));
|
|
}
|
|
};
|
|
return [
|
|
endOfRange,
|
|
startOfRange,
|
|
handleShowPrevious,
|
|
handleShowCurrent,
|
|
handleShowNext,
|
|
firstDayOfShownWeek,
|
|
$visibleDateRange
|
|
];
|
|
}
|
|
var Header_actions = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance18, create_fragment22, safe_not_equal, {}, add_css10);
|
|
}
|
|
};
|
|
var header_actions_default = Header_actions;
|
|
|
|
// src/ui/components/week/week.svelte
|
|
var import_obsidian_daily_notes_interface5 = __toESM(require_main());
|
|
function add_css11(target) {
|
|
append_styles(target, "svelte-8r78hm", ".corner.svelte-8r78hm{position:sticky;z-index:100;top:0;left:0;flex:0 0 var(--time-ruler-width);background-color:var(--background-primary);border:1px solid var(--background-modifier-border);border-top:none;border-left:none}.days.svelte-8r78hm{display:flex}.day-column.svelte-8r78hm{display:flex;flex:1 0 150px;flex-direction:column;background-color:var(--background-secondary);border-right:1px solid var(--background-modifier-border)}.week-header.svelte-8r78hm{position:sticky;z-index:10;top:0;display:flex}.day-header.svelte-8r78hm{flex:1 0 150px;padding:5px;background-color:var(--background-primary);border-right:1px solid var(--background-modifier-border);border-bottom:1px solid var(--background-modifier-border)}.today.svelte-8r78hm{color:white;background-color:var(--color-accent)}.scale-with-days.svelte-8r78hm{display:flex}");
|
|
}
|
|
function get_each_context6(ctx, list, i) {
|
|
const child_ctx = ctx.slice();
|
|
child_ctx[5] = list[i];
|
|
return child_ctx;
|
|
}
|
|
function get_each_context_12(ctx, list, i) {
|
|
const child_ctx = ctx.slice();
|
|
child_ctx[5] = list[i];
|
|
return child_ctx;
|
|
}
|
|
function create_default_slot_13(ctx) {
|
|
let t_value = (
|
|
/*day*/
|
|
ctx[5].format("MMM D, ddd") + ""
|
|
);
|
|
let t;
|
|
return {
|
|
c() {
|
|
t = text(t_value);
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, t, anchor);
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (dirty & /*$visibleDateRange*/
|
|
4 && t_value !== (t_value = /*day*/
|
|
ctx2[5].format("MMM D, ddd") + ""))
|
|
set_data(t, t_value);
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(t);
|
|
}
|
|
};
|
|
}
|
|
function create_each_block_12(ctx) {
|
|
let div;
|
|
let controlbutton;
|
|
let div_1;
|
|
let __color_last;
|
|
let t;
|
|
let current;
|
|
function click_handler() {
|
|
return (
|
|
/*click_handler*/
|
|
ctx[4](
|
|
/*day*/
|
|
ctx[5]
|
|
)
|
|
);
|
|
}
|
|
controlbutton = new control_button_default({
|
|
props: {
|
|
label: "Open note for day",
|
|
$$slots: { default: [create_default_slot_13] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
controlbutton.$on("click", click_handler);
|
|
return {
|
|
c() {
|
|
div = element("div");
|
|
div_1 = element("div");
|
|
create_component(controlbutton.$$.fragment);
|
|
t = space();
|
|
set_style(div_1, "display", "contents");
|
|
set_style(div_1, "--color", __color_last = isToday(
|
|
/*day*/
|
|
ctx[5]
|
|
) ? "white" : "var(--icon-color)");
|
|
attr(div, "class", "day-header svelte-8r78hm");
|
|
toggle_class(div, "today", isToday(
|
|
/*day*/
|
|
ctx[5]
|
|
));
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div, anchor);
|
|
append(div, div_1);
|
|
mount_component(controlbutton, div_1, null);
|
|
append(div, t);
|
|
current = true;
|
|
},
|
|
p(new_ctx, dirty) {
|
|
ctx = new_ctx;
|
|
if (dirty & /*$visibleDateRange*/
|
|
4 && __color_last !== (__color_last = isToday(
|
|
/*day*/
|
|
ctx[5]
|
|
) ? "white" : "var(--icon-color)")) {
|
|
set_style(div_1, "--color", __color_last);
|
|
}
|
|
const controlbutton_changes = {};
|
|
if (dirty & /*$$scope, $visibleDateRange*/
|
|
4100) {
|
|
controlbutton_changes.$$scope = { dirty, ctx };
|
|
}
|
|
controlbutton.$set(controlbutton_changes);
|
|
if (!current || dirty & /*isToday, $visibleDateRange*/
|
|
4) {
|
|
toggle_class(div, "today", isToday(
|
|
/*day*/
|
|
ctx[5]
|
|
));
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(controlbutton.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(controlbutton.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div);
|
|
destroy_component(controlbutton);
|
|
}
|
|
};
|
|
}
|
|
function create_if_block4(ctx) {
|
|
let needle;
|
|
let current;
|
|
needle = new needle_default({ props: { autoScrollBlocked: true } });
|
|
return {
|
|
c() {
|
|
create_component(needle.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(needle, target, anchor);
|
|
current = true;
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(needle.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(needle.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(needle, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_catch_block(ctx) {
|
|
let pre;
|
|
let t0;
|
|
let t1_value = (
|
|
/*error*/
|
|
ctx[9] + ""
|
|
);
|
|
let t1;
|
|
return {
|
|
c() {
|
|
pre = element("pre");
|
|
t0 = text("Could not render tasks: ");
|
|
t1 = text(t1_value);
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, pre, anchor);
|
|
append(pre, t0);
|
|
append(pre, t1);
|
|
},
|
|
p(ctx2, dirty) {
|
|
if (dirty & /*obsidianFacade, $visibleDateRange*/
|
|
5 && t1_value !== (t1_value = /*error*/
|
|
ctx2[9] + ""))
|
|
set_data(t1, t1_value);
|
|
},
|
|
i: noop,
|
|
o: noop,
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(pre);
|
|
}
|
|
};
|
|
}
|
|
function create_then_block(ctx) {
|
|
let taskcontainer;
|
|
let current;
|
|
taskcontainer = new task_container_default({
|
|
props: {
|
|
day: (
|
|
/*day*/
|
|
ctx[5]
|
|
),
|
|
obsidianFacade: (
|
|
/*obsidianFacade*/
|
|
ctx[0]
|
|
),
|
|
onUpdate: (
|
|
/*onUpdate*/
|
|
ctx[1]
|
|
),
|
|
tasks: addPlacing(
|
|
/*tasks*/
|
|
ctx[8]
|
|
)
|
|
}
|
|
});
|
|
return {
|
|
c() {
|
|
create_component(taskcontainer.$$.fragment);
|
|
},
|
|
m(target, anchor) {
|
|
mount_component(taskcontainer, target, anchor);
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
const taskcontainer_changes = {};
|
|
if (dirty & /*$visibleDateRange*/
|
|
4)
|
|
taskcontainer_changes.day = /*day*/
|
|
ctx2[5];
|
|
if (dirty & /*obsidianFacade*/
|
|
1)
|
|
taskcontainer_changes.obsidianFacade = /*obsidianFacade*/
|
|
ctx2[0];
|
|
if (dirty & /*onUpdate*/
|
|
2)
|
|
taskcontainer_changes.onUpdate = /*onUpdate*/
|
|
ctx2[1];
|
|
if (dirty & /*obsidianFacade, $visibleDateRange*/
|
|
5)
|
|
taskcontainer_changes.tasks = addPlacing(
|
|
/*tasks*/
|
|
ctx2[8]
|
|
);
|
|
taskcontainer.$set(taskcontainer_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(taskcontainer.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(taskcontainer.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
destroy_component(taskcontainer, detaching);
|
|
}
|
|
};
|
|
}
|
|
function create_pending_block(ctx) {
|
|
return {
|
|
c: noop,
|
|
m: noop,
|
|
p: noop,
|
|
i: noop,
|
|
o: noop,
|
|
d: noop
|
|
};
|
|
}
|
|
function create_default_slot12(ctx) {
|
|
let show_if = isToday(
|
|
/*day*/
|
|
ctx[5]
|
|
);
|
|
let t;
|
|
let await_block_anchor;
|
|
let promise;
|
|
let current;
|
|
let if_block = show_if && create_if_block4(ctx);
|
|
let info = {
|
|
ctx,
|
|
current: null,
|
|
token: null,
|
|
hasCatch: true,
|
|
pending: create_pending_block,
|
|
then: create_then_block,
|
|
catch: create_catch_block,
|
|
value: 8,
|
|
error: 9,
|
|
blocks: [, , ,]
|
|
};
|
|
handle_promise(promise = /*obsidianFacade*/
|
|
ctx[0].getPlanItemsFromFile((0, import_obsidian_daily_notes_interface5.getDailyNote)(
|
|
/*day*/
|
|
ctx[5],
|
|
(0, import_obsidian_daily_notes_interface5.getAllDailyNotes)()
|
|
)), info);
|
|
return {
|
|
c() {
|
|
if (if_block)
|
|
if_block.c();
|
|
t = space();
|
|
await_block_anchor = empty();
|
|
info.block.c();
|
|
},
|
|
m(target, anchor) {
|
|
if (if_block)
|
|
if_block.m(target, anchor);
|
|
insert(target, t, anchor);
|
|
insert(target, await_block_anchor, anchor);
|
|
info.block.m(target, info.anchor = anchor);
|
|
info.mount = () => await_block_anchor.parentNode;
|
|
info.anchor = await_block_anchor;
|
|
current = true;
|
|
},
|
|
p(new_ctx, dirty) {
|
|
ctx = new_ctx;
|
|
if (dirty & /*$visibleDateRange*/
|
|
4)
|
|
show_if = isToday(
|
|
/*day*/
|
|
ctx[5]
|
|
);
|
|
if (show_if) {
|
|
if (if_block) {
|
|
if (dirty & /*$visibleDateRange*/
|
|
4) {
|
|
transition_in(if_block, 1);
|
|
}
|
|
} else {
|
|
if_block = create_if_block4(ctx);
|
|
if_block.c();
|
|
transition_in(if_block, 1);
|
|
if_block.m(t.parentNode, t);
|
|
}
|
|
} else if (if_block) {
|
|
group_outros();
|
|
transition_out(if_block, 1, 1, () => {
|
|
if_block = null;
|
|
});
|
|
check_outros();
|
|
}
|
|
info.ctx = ctx;
|
|
if (dirty & /*obsidianFacade, $visibleDateRange*/
|
|
5 && promise !== (promise = /*obsidianFacade*/
|
|
ctx[0].getPlanItemsFromFile((0, import_obsidian_daily_notes_interface5.getDailyNote)(
|
|
/*day*/
|
|
ctx[5],
|
|
(0, import_obsidian_daily_notes_interface5.getAllDailyNotes)()
|
|
))) && handle_promise(promise, info)) {
|
|
} else {
|
|
update_await_block_branch(info, ctx, dirty);
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(if_block);
|
|
transition_in(info.block);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(if_block);
|
|
for (let i = 0; i < 3; i += 1) {
|
|
const block = info.blocks[i];
|
|
transition_out(block);
|
|
}
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (if_block)
|
|
if_block.d(detaching);
|
|
if (detaching)
|
|
detach(t);
|
|
if (detaching)
|
|
detach(await_block_anchor);
|
|
info.block.d(detaching);
|
|
info.token = null;
|
|
info = null;
|
|
}
|
|
};
|
|
}
|
|
function create_each_block6(ctx) {
|
|
let div1;
|
|
let div0;
|
|
let column;
|
|
let t;
|
|
let current;
|
|
column = new column_default({
|
|
props: {
|
|
visibleHours: (
|
|
/*$visibleHours*/
|
|
ctx[3]
|
|
),
|
|
$$slots: { default: [create_default_slot12] },
|
|
$$scope: { ctx }
|
|
}
|
|
});
|
|
return {
|
|
c() {
|
|
div1 = element("div");
|
|
div0 = element("div");
|
|
create_component(column.$$.fragment);
|
|
t = space();
|
|
attr(div0, "class", "scale-with-days svelte-8r78hm");
|
|
attr(div1, "class", "day-column svelte-8r78hm");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div1, anchor);
|
|
append(div1, div0);
|
|
mount_component(column, div0, null);
|
|
append(div1, t);
|
|
current = true;
|
|
},
|
|
p(ctx2, dirty) {
|
|
const column_changes = {};
|
|
if (dirty & /*$visibleHours*/
|
|
8)
|
|
column_changes.visibleHours = /*$visibleHours*/
|
|
ctx2[3];
|
|
if (dirty & /*$$scope, obsidianFacade, $visibleDateRange, onUpdate*/
|
|
4103) {
|
|
column_changes.$$scope = { dirty, ctx: ctx2 };
|
|
}
|
|
column.$set(column_changes);
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
transition_in(column.$$.fragment, local);
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
transition_out(column.$$.fragment, local);
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div1);
|
|
destroy_component(column);
|
|
}
|
|
};
|
|
}
|
|
function create_fragment23(ctx) {
|
|
let div1;
|
|
let div0;
|
|
let t0;
|
|
let t1;
|
|
let div2;
|
|
let ruler;
|
|
let t2;
|
|
let current;
|
|
let each_value_1 = (
|
|
/*$visibleDateRange*/
|
|
ctx[2]
|
|
);
|
|
let each_blocks_1 = [];
|
|
for (let i = 0; i < each_value_1.length; i += 1) {
|
|
each_blocks_1[i] = create_each_block_12(get_each_context_12(ctx, each_value_1, i));
|
|
}
|
|
const out = (i) => transition_out(each_blocks_1[i], 1, 1, () => {
|
|
each_blocks_1[i] = null;
|
|
});
|
|
ruler = new ruler_default({
|
|
props: { visibleHours: (
|
|
/*$visibleHours*/
|
|
ctx[3]
|
|
) }
|
|
});
|
|
let each_value = (
|
|
/*$visibleDateRange*/
|
|
ctx[2]
|
|
);
|
|
let each_blocks = [];
|
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
each_blocks[i] = create_each_block6(get_each_context6(ctx, each_value, i));
|
|
}
|
|
const out_1 = (i) => transition_out(each_blocks[i], 1, 1, () => {
|
|
each_blocks[i] = null;
|
|
});
|
|
return {
|
|
c() {
|
|
div1 = element("div");
|
|
div0 = element("div");
|
|
t0 = space();
|
|
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
each_blocks_1[i].c();
|
|
}
|
|
t1 = space();
|
|
div2 = element("div");
|
|
create_component(ruler.$$.fragment);
|
|
t2 = space();
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
each_blocks[i].c();
|
|
}
|
|
attr(div0, "class", "corner svelte-8r78hm");
|
|
attr(div1, "class", "week-header svelte-8r78hm");
|
|
attr(div2, "class", "days svelte-8r78hm");
|
|
},
|
|
m(target, anchor) {
|
|
insert(target, div1, anchor);
|
|
append(div1, div0);
|
|
append(div1, t0);
|
|
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
if (each_blocks_1[i]) {
|
|
each_blocks_1[i].m(div1, null);
|
|
}
|
|
}
|
|
insert(target, t1, anchor);
|
|
insert(target, div2, anchor);
|
|
mount_component(ruler, div2, null);
|
|
append(div2, t2);
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].m(div2, null);
|
|
}
|
|
}
|
|
current = true;
|
|
},
|
|
p(ctx2, [dirty]) {
|
|
if (dirty & /*isToday, $visibleDateRange, obsidianFacade*/
|
|
5) {
|
|
each_value_1 = /*$visibleDateRange*/
|
|
ctx2[2];
|
|
let i;
|
|
for (i = 0; i < each_value_1.length; i += 1) {
|
|
const child_ctx = get_each_context_12(ctx2, each_value_1, i);
|
|
if (each_blocks_1[i]) {
|
|
each_blocks_1[i].p(child_ctx, dirty);
|
|
transition_in(each_blocks_1[i], 1);
|
|
} else {
|
|
each_blocks_1[i] = create_each_block_12(child_ctx);
|
|
each_blocks_1[i].c();
|
|
transition_in(each_blocks_1[i], 1);
|
|
each_blocks_1[i].m(div1, null);
|
|
}
|
|
}
|
|
group_outros();
|
|
for (i = each_value_1.length; i < each_blocks_1.length; i += 1) {
|
|
out(i);
|
|
}
|
|
check_outros();
|
|
}
|
|
const ruler_changes = {};
|
|
if (dirty & /*$visibleHours*/
|
|
8)
|
|
ruler_changes.visibleHours = /*$visibleHours*/
|
|
ctx2[3];
|
|
ruler.$set(ruler_changes);
|
|
if (dirty & /*$visibleHours, obsidianFacade, getDailyNote, $visibleDateRange, getAllDailyNotes, onUpdate, addPlacing, isToday*/
|
|
15) {
|
|
each_value = /*$visibleDateRange*/
|
|
ctx2[2];
|
|
let i;
|
|
for (i = 0; i < each_value.length; i += 1) {
|
|
const child_ctx = get_each_context6(ctx2, each_value, i);
|
|
if (each_blocks[i]) {
|
|
each_blocks[i].p(child_ctx, dirty);
|
|
transition_in(each_blocks[i], 1);
|
|
} else {
|
|
each_blocks[i] = create_each_block6(child_ctx);
|
|
each_blocks[i].c();
|
|
transition_in(each_blocks[i], 1);
|
|
each_blocks[i].m(div2, null);
|
|
}
|
|
}
|
|
group_outros();
|
|
for (i = each_value.length; i < each_blocks.length; i += 1) {
|
|
out_1(i);
|
|
}
|
|
check_outros();
|
|
}
|
|
},
|
|
i(local) {
|
|
if (current)
|
|
return;
|
|
for (let i = 0; i < each_value_1.length; i += 1) {
|
|
transition_in(each_blocks_1[i]);
|
|
}
|
|
transition_in(ruler.$$.fragment, local);
|
|
for (let i = 0; i < each_value.length; i += 1) {
|
|
transition_in(each_blocks[i]);
|
|
}
|
|
current = true;
|
|
},
|
|
o(local) {
|
|
each_blocks_1 = each_blocks_1.filter(Boolean);
|
|
for (let i = 0; i < each_blocks_1.length; i += 1) {
|
|
transition_out(each_blocks_1[i]);
|
|
}
|
|
transition_out(ruler.$$.fragment, local);
|
|
each_blocks = each_blocks.filter(Boolean);
|
|
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
transition_out(each_blocks[i]);
|
|
}
|
|
current = false;
|
|
},
|
|
d(detaching) {
|
|
if (detaching)
|
|
detach(div1);
|
|
destroy_each(each_blocks_1, detaching);
|
|
if (detaching)
|
|
detach(t1);
|
|
if (detaching)
|
|
detach(div2);
|
|
destroy_component(ruler);
|
|
destroy_each(each_blocks, detaching);
|
|
}
|
|
};
|
|
}
|
|
function instance19($$self, $$props, $$invalidate) {
|
|
let $visibleDateRange;
|
|
let $visibleHours;
|
|
component_subscribe($$self, visibleDateRange, ($$value) => $$invalidate(2, $visibleDateRange = $$value));
|
|
component_subscribe($$self, visibleHours, ($$value) => $$invalidate(3, $visibleHours = $$value));
|
|
let { obsidianFacade } = $$props;
|
|
let { onUpdate } = $$props;
|
|
const click_handler = async (day) => await obsidianFacade.openFileForDay(day);
|
|
$$self.$$set = ($$props2) => {
|
|
if ("obsidianFacade" in $$props2)
|
|
$$invalidate(0, obsidianFacade = $$props2.obsidianFacade);
|
|
if ("onUpdate" in $$props2)
|
|
$$invalidate(1, onUpdate = $$props2.onUpdate);
|
|
};
|
|
return [obsidianFacade, onUpdate, $visibleDateRange, $visibleHours, click_handler];
|
|
}
|
|
var Week = class extends SvelteComponent {
|
|
constructor(options) {
|
|
super();
|
|
init(this, options, instance19, create_fragment23, safe_not_equal, { obsidianFacade: 0, onUpdate: 1 }, add_css11);
|
|
}
|
|
};
|
|
var week_default = Week;
|
|
|
|
// src/ui/weekly-view.ts
|
|
var WeeklyView = class extends import_obsidian5.ItemView {
|
|
constructor(leaf, settings2, obsidianFacade, planEditor) {
|
|
super(leaf);
|
|
this.settings = settings2;
|
|
this.obsidianFacade = obsidianFacade;
|
|
this.planEditor = planEditor;
|
|
}
|
|
getViewType() {
|
|
return viewTypeWeekly;
|
|
}
|
|
getDisplayText() {
|
|
return "Week Planner";
|
|
}
|
|
getIcon() {
|
|
return this.settings.timelineIcon;
|
|
}
|
|
async onOpen() {
|
|
const headerEl = this.containerEl.children[0];
|
|
const contentEl = this.containerEl.children[1];
|
|
const viewActionsEl = headerEl.querySelector(".view-actions");
|
|
const customActionsEl = createDiv();
|
|
viewActionsEl.prepend(customActionsEl);
|
|
this.headerActionsComponent = new header_actions_default({
|
|
target: customActionsEl
|
|
});
|
|
this.weekComponent = new week_default({
|
|
target: contentEl,
|
|
props: {
|
|
obsidianFacade: this.obsidianFacade,
|
|
onUpdate: this.planEditor.syncTasksWithFile
|
|
}
|
|
});
|
|
}
|
|
async onClose() {
|
|
var _a, _b;
|
|
(_a = this.weekComponent) == null ? void 0 : _a.$destroy();
|
|
(_b = this.headerActionsComponent) == null ? void 0 : _b.$destroy();
|
|
}
|
|
};
|
|
|
|
// src/main.ts
|
|
var DayPlanner = class extends import_obsidian6.Plugin {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.handleActiveLeafChanged = ({ view }) => {
|
|
if (!(view instanceof import_obsidian6.FileView) || !view.file) {
|
|
return;
|
|
}
|
|
const dayUserSwitchedTo = (0, import_obsidian_daily_notes_interface6.getDateFromFile)(view.file, "day");
|
|
if (dayUserSwitchedTo.isSame(get_store_value(visibleDayInTimeline), "day")) {
|
|
return;
|
|
}
|
|
if (!dayUserSwitchedTo) {
|
|
if (isToday(get_store_value(visibleDayInTimeline))) {
|
|
visibleDayInTimeline.set(window.moment());
|
|
}
|
|
return;
|
|
}
|
|
visibleDayInTimeline.set(dayUserSwitchedTo);
|
|
};
|
|
this.handleLayoutReady = async () => {
|
|
visibleDateRange.set(getDaysOfCurrentWeek());
|
|
};
|
|
this.updateStatusBar = async () => {
|
|
if (dailyNoteExists()) {
|
|
const note = (0, import_obsidian_daily_notes_interface6.getDailyNote)(window.moment(), (0, import_obsidian_daily_notes_interface6.getAllDailyNotes)());
|
|
const planItems = await this.obsidianFacade.getPlanItemsFromFile(note);
|
|
await this.statusBar.update(planItems);
|
|
} else {
|
|
this.statusBar.setEmpty();
|
|
}
|
|
};
|
|
}
|
|
async onload() {
|
|
this.settings = Object.assign(
|
|
new DayPlannerSettings(),
|
|
await this.loadData()
|
|
);
|
|
this.statusBar = new StatusBar(
|
|
this.settings,
|
|
this.addStatusBarItem(),
|
|
this.app.workspace
|
|
);
|
|
this.registerCommands();
|
|
this.obsidianFacade = new ObsidianFacade(
|
|
this.app.workspace,
|
|
this.app.vault,
|
|
this.app.metadataCache,
|
|
this.settings
|
|
);
|
|
this.planEditor = new PlanEditor(this.settings, this.obsidianFacade);
|
|
this.registerView(
|
|
viewTypeTimeline,
|
|
(leaf) => new TimelineView(
|
|
leaf,
|
|
this.settings,
|
|
this.obsidianFacade,
|
|
this.planEditor
|
|
)
|
|
);
|
|
this.registerView(
|
|
viewTypeWeekly,
|
|
(leaf) => new WeeklyView(
|
|
leaf,
|
|
this.settings,
|
|
this.obsidianFacade,
|
|
this.planEditor
|
|
)
|
|
);
|
|
this.addRibbonIcon(
|
|
"calendar-range",
|
|
"Week plan",
|
|
async () => await this.initWeeklyLeaf()
|
|
);
|
|
this.addSettingTab(new DayPlannerSettingsTab(this.app, this));
|
|
this.initAppAndSettingsStores();
|
|
this.app.workspace.onLayoutReady(this.handleLayoutReady);
|
|
this.app.workspace.on("active-leaf-change", this.handleActiveLeafChanged);
|
|
this.app.metadataCache.on("changed", async (file) => {
|
|
visibleDateRange.update((prev) => [...prev]);
|
|
visibleDayInTimeline.update((prev) => prev.clone());
|
|
});
|
|
this.registerInterval(
|
|
window.setInterval(
|
|
() => this.updateStatusBarOnFailed(this.updateStatusBar),
|
|
5e3
|
|
)
|
|
);
|
|
}
|
|
registerCommands() {
|
|
this.addCommand({
|
|
id: "show-day-planner-timeline",
|
|
name: "Show the Day Planner Timeline",
|
|
callback: async () => await this.initTimelineLeaf()
|
|
});
|
|
this.addCommand({
|
|
id: "show-weekly-view",
|
|
name: "Show the Week Planner",
|
|
callback: async () => await this.initWeeklyLeaf()
|
|
});
|
|
this.addCommand({
|
|
id: "show-day-planner-today-note",
|
|
name: "Open today's Day Planner",
|
|
callback: async () => this.app.workspace.getLeaf(false).openFile(await createDailyNoteIfNeeded(window.moment()))
|
|
});
|
|
this.addCommand({
|
|
id: "insert-planner-heading-at-cursor",
|
|
name: "Insert Planner Heading at Cursor",
|
|
editorCallback: (editor) => editor.replaceSelection(this.planEditor.createPlannerHeading())
|
|
});
|
|
}
|
|
initAppAndSettingsStores() {
|
|
appStore.set(this.app);
|
|
const {
|
|
zoomLevel,
|
|
centerNeedle,
|
|
startHour,
|
|
timelineDateFormat,
|
|
plannerHeading,
|
|
plannerHeadingLevel,
|
|
timelineColored,
|
|
timelineStartColor,
|
|
timelineEndColor,
|
|
showHelp
|
|
} = this.settings;
|
|
settings.set({
|
|
zoomLevel,
|
|
centerNeedle,
|
|
startHour,
|
|
timelineDateFormat,
|
|
plannerHeading,
|
|
plannerHeadingLevel,
|
|
timelineColored,
|
|
timelineStartColor,
|
|
timelineEndColor,
|
|
showHelp
|
|
});
|
|
settings.subscribe(async (newValue) => {
|
|
this.settings = { ...this.settings, ...newValue };
|
|
await this.saveData(this.settings);
|
|
});
|
|
}
|
|
onunload() {
|
|
this.detachLeavesOfType(viewTypeTimeline);
|
|
this.detachLeavesOfType(viewTypeWeekly);
|
|
}
|
|
async updateStatusBarOnFailed(fn) {
|
|
try {
|
|
await fn();
|
|
} catch (error) {
|
|
this.statusBar.setText(`\u26A0\uFE0F Planner update failed (see console)`);
|
|
console.error(error);
|
|
}
|
|
}
|
|
async initWeeklyLeaf() {
|
|
this.detachLeavesOfType(viewTypeWeekly);
|
|
await this.app.workspace.getLeaf(false).setViewState({
|
|
type: viewTypeWeekly,
|
|
active: true
|
|
});
|
|
}
|
|
async initTimelineLeaf() {
|
|
this.detachLeavesOfType(viewTypeTimeline);
|
|
await this.app.workspace.getRightLeaf(false).setViewState({
|
|
type: viewTypeTimeline,
|
|
active: true
|
|
});
|
|
this.app.workspace.rightSplit.expand();
|
|
}
|
|
detachLeavesOfType(type) {
|
|
this.app.workspace.getLeavesOfType(type).forEach((leaf) => leaf.detach());
|
|
}
|
|
};
|
|
/*! Bundled license information:
|
|
|
|
lodash/lodash.min.js:
|
|
(**
|
|
* @license
|
|
* Lodash <https://lodash.com/>
|
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
* Released under MIT license <https://lodash.com/license>
|
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
*)
|
|
|
|
fraction.js/fraction.js:
|
|
(**
|
|
* @license Fraction.js v4.1.1 23/05/2021
|
|
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
*
|
|
* Copyright (c) 2021, Robert Eisele (robert@xarg.org)
|
|
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
**)
|
|
|
|
lodash/lodash.js:
|
|
(**
|
|
* @license
|
|
* Lodash <https://lodash.com/>
|
|
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
* Released under MIT license <https://lodash.com/license>
|
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
*)
|
|
|
|
chroma-js/chroma.js:
|
|
(**
|
|
* chroma.js - JavaScript library for color conversions
|
|
*
|
|
* Copyright (c) 2011-2019, Gregor Aisch
|
|
* All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions are met:
|
|
*
|
|
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
* list of conditions and the following disclaimer.
|
|
*
|
|
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
* this list of conditions and the following disclaimer in the documentation
|
|
* and/or other materials provided with the distribution.
|
|
*
|
|
* 3. The name Gregor Aisch may not be used to endorse or promote products
|
|
* derived from this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
* DISCLAIMED. IN NO EVENT SHALL GREGOR AISCH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
|
|
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*
|
|
* -------------------------------------------------------
|
|
*
|
|
* chroma.js includes colors from colorbrewer2.org, which are released under
|
|
* the following license:
|
|
*
|
|
* Copyright (c) 2002 Cynthia Brewer, Mark Harrower,
|
|
* and The Pennsylvania State University.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing,
|
|
* software distributed under the License is distributed on an
|
|
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
|
* either express or implied. See the License for the specific
|
|
* language governing permissions and limitations under the License.
|
|
*
|
|
* ------------------------------------------------------
|
|
*
|
|
* Named colors are taken from X11 Color Names.
|
|
* http://www.w3.org/TR/css3-color/#svg-color
|
|
*
|
|
* @preserve
|
|
*)
|
|
*/
|