obsidian-sandbox-vault/.obsidian/plugins/obsidian-divide-and-conquer/main.js

1590 lines
197 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 __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
var __commonJS = (cb, mod) => function __require() {
return mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
__markAsModule(target);
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __reExport = (target, module2, desc) => {
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
for (let key of __getOwnPropNames(module2))
if (!__hasOwnProp.call(target, key) && key !== "default")
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
}
return target;
};
var __toModule = (module2) => {
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
};
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// node_modules/tinycolor2/tinycolor.js
var require_tinycolor = __commonJS({
"node_modules/tinycolor2/tinycolor.js"(exports, module2) {
(function(Math2) {
var trimLeft = /^\s+/, trimRight = /\s+$/, tinyCounter = 0, mathRound = Math2.round, mathMin = Math2.min, mathMax = Math2.max, mathRandom = Math2.random;
function tinycolor2(color, opts) {
color = color ? color : "";
opts = opts || {};
if (color instanceof tinycolor2) {
return color;
}
if (!(this instanceof tinycolor2)) {
return new tinycolor2(color, opts);
}
var rgb = inputToRGB(color);
this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = mathRound(100 * this._a) / 100, this._format = opts.format || rgb.format;
this._gradientType = opts.gradientType;
if (this._r < 1) {
this._r = mathRound(this._r);
}
if (this._g < 1) {
this._g = mathRound(this._g);
}
if (this._b < 1) {
this._b = mathRound(this._b);
}
this._ok = rgb.ok;
this._tc_id = tinyCounter++;
}
tinycolor2.prototype = {
isDark: function() {
return this.getBrightness() < 128;
},
isLight: function() {
return !this.isDark();
},
isValid: function() {
return this._ok;
},
getOriginalInput: function() {
return this._originalInput;
},
getFormat: function() {
return this._format;
},
getAlpha: function() {
return this._a;
},
getBrightness: function() {
var rgb = this.toRgb();
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
},
getLuminance: function() {
var rgb = this.toRgb();
var RsRGB, GsRGB, BsRGB, R, G, B;
RsRGB = rgb.r / 255;
GsRGB = rgb.g / 255;
BsRGB = rgb.b / 255;
if (RsRGB <= 0.03928) {
R = RsRGB / 12.92;
} else {
R = Math2.pow((RsRGB + 0.055) / 1.055, 2.4);
}
if (GsRGB <= 0.03928) {
G = GsRGB / 12.92;
} else {
G = Math2.pow((GsRGB + 0.055) / 1.055, 2.4);
}
if (BsRGB <= 0.03928) {
B = BsRGB / 12.92;
} else {
B = Math2.pow((BsRGB + 0.055) / 1.055, 2.4);
}
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
},
setAlpha: function(value) {
this._a = boundAlpha(value);
this._roundA = mathRound(100 * this._a) / 100;
return this;
},
toHsv: function() {
var hsv = rgbToHsv(this._r, this._g, this._b);
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };
},
toHsvString: function() {
var hsv = rgbToHsv(this._r, this._g, this._b);
var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);
return this._a == 1 ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, " + this._roundA + ")";
},
toHsl: function() {
var hsl = rgbToHsl(this._r, this._g, this._b);
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };
},
toHslString: function() {
var hsl = rgbToHsl(this._r, this._g, this._b);
var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);
return this._a == 1 ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, " + this._roundA + ")";
},
toHex: function(allow3Char) {
return rgbToHex(this._r, this._g, this._b, allow3Char);
},
toHexString: function(allow3Char) {
return "#" + this.toHex(allow3Char);
},
toHex8: function(allow4Char) {
return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);
},
toHex8String: function(allow4Char) {
return "#" + this.toHex8(allow4Char);
},
toRgb: function() {
return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };
},
toRgbString: function() {
return this._a == 1 ? "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")";
},
toPercentageRgb: function() {
return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a };
},
toPercentageRgbString: function() {
return this._a == 1 ? "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")";
},
toName: function() {
if (this._a === 0) {
return "transparent";
}
if (this._a < 1) {
return false;
}
return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;
},
toFilter: function(secondColor) {
var hex8String = "#" + rgbaToArgbHex(this._r, this._g, this._b, this._a);
var secondHex8String = hex8String;
var gradientType = this._gradientType ? "GradientType = 1, " : "";
if (secondColor) {
var s = tinycolor2(secondColor);
secondHex8String = "#" + rgbaToArgbHex(s._r, s._g, s._b, s._a);
}
return "progid:DXImageTransform.Microsoft.gradient(" + gradientType + "startColorstr=" + hex8String + ",endColorstr=" + secondHex8String + ")";
},
toString: function(format) {
var formatSet = !!format;
format = format || this._format;
var formattedString = false;
var hasAlpha = this._a < 1 && this._a >= 0;
var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name");
if (needsAlphaFormat) {
if (format === "name" && this._a === 0) {
return this.toName();
}
return this.toRgbString();
}
if (format === "rgb") {
formattedString = this.toRgbString();
}
if (format === "prgb") {
formattedString = this.toPercentageRgbString();
}
if (format === "hex" || format === "hex6") {
formattedString = this.toHexString();
}
if (format === "hex3") {
formattedString = this.toHexString(true);
}
if (format === "hex4") {
formattedString = this.toHex8String(true);
}
if (format === "hex8") {
formattedString = this.toHex8String();
}
if (format === "name") {
formattedString = this.toName();
}
if (format === "hsl") {
formattedString = this.toHslString();
}
if (format === "hsv") {
formattedString = this.toHsvString();
}
return formattedString || this.toHexString();
},
clone: function() {
return tinycolor2(this.toString());
},
_applyModification: function(fn, args) {
var color = fn.apply(null, [this].concat([].slice.call(args)));
this._r = color._r;
this._g = color._g;
this._b = color._b;
this.setAlpha(color._a);
return this;
},
lighten: function() {
return this._applyModification(lighten, arguments);
},
brighten: function() {
return this._applyModification(brighten, arguments);
},
darken: function() {
return this._applyModification(darken, arguments);
},
desaturate: function() {
return this._applyModification(desaturate, arguments);
},
saturate: function() {
return this._applyModification(saturate, arguments);
},
greyscale: function() {
return this._applyModification(greyscale, arguments);
},
spin: function() {
return this._applyModification(spin, arguments);
},
_applyCombination: function(fn, args) {
return fn.apply(null, [this].concat([].slice.call(args)));
},
analogous: function() {
return this._applyCombination(analogous, arguments);
},
complement: function() {
return this._applyCombination(complement, arguments);
},
monochromatic: function() {
return this._applyCombination(monochromatic, arguments);
},
splitcomplement: function() {
return this._applyCombination(splitcomplement, arguments);
},
triad: function() {
return this._applyCombination(triad, arguments);
},
tetrad: function() {
return this._applyCombination(tetrad, arguments);
}
};
tinycolor2.fromRatio = function(color, opts) {
if (typeof color == "object") {
var newColor = {};
for (var i in color) {
if (color.hasOwnProperty(i)) {
if (i === "a") {
newColor[i] = color[i];
} else {
newColor[i] = convertToPercentage(color[i]);
}
}
}
color = newColor;
}
return tinycolor2(color, opts);
};
function inputToRGB(color) {
var rgb = { r: 0, g: 0, b: 0 };
var a = 1;
var s = null;
var v = null;
var l = null;
var ok = false;
var format = false;
if (typeof color == "string") {
color = stringInputToObject(color);
}
if (typeof color == "object") {
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
rgb = rgbToRgb(color.r, color.g, color.b);
ok = true;
format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
s = convertToPercentage(color.s);
v = convertToPercentage(color.v);
rgb = hsvToRgb(color.h, s, v);
ok = true;
format = "hsv";
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
s = convertToPercentage(color.s);
l = convertToPercentage(color.l);
rgb = hslToRgb(color.h, s, l);
ok = true;
format = "hsl";
}
if (color.hasOwnProperty("a")) {
a = color.a;
}
}
a = boundAlpha(a);
return {
ok,
format: color.format || format,
r: mathMin(255, mathMax(rgb.r, 0)),
g: mathMin(255, mathMax(rgb.g, 0)),
b: mathMin(255, mathMax(rgb.b, 0)),
a
};
}
function rgbToRgb(r, g, b) {
return {
r: bound01(r, 255) * 255,
g: bound01(g, 255) * 255,
b: bound01(b, 255) * 255
};
}
function rgbToHsl(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = mathMax(r, g, b), min = mathMin(r, g, b);
var h, s, l = (max + min) / 2;
if (max == min) {
h = s = 0;
} else {
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
}
h /= 6;
}
return { h, s, l };
}
function hslToRgb(h, s, l) {
var r, g, b;
h = bound01(h, 360);
s = bound01(s, 100);
l = bound01(l, 100);
function hue2rgb(p2, q2, t) {
if (t < 0)
t += 1;
if (t > 1)
t -= 1;
if (t < 1 / 6)
return p2 + (q2 - p2) * 6 * t;
if (t < 1 / 2)
return q2;
if (t < 2 / 3)
return p2 + (q2 - p2) * (2 / 3 - t) * 6;
return p2;
}
if (s === 0) {
r = g = b = l;
} else {
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
r = hue2rgb(p, q, h + 1 / 3);
g = hue2rgb(p, q, h);
b = hue2rgb(p, q, h - 1 / 3);
}
return { r: r * 255, g: g * 255, b: b * 255 };
}
function rgbToHsv(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = mathMax(r, g, b), min = mathMin(r, g, b);
var h, s, v = max;
var d = max - min;
s = max === 0 ? 0 : d / max;
if (max == min) {
h = 0;
} else {
switch (max) {
case r:
h = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h = (b - r) / d + 2;
break;
case b:
h = (r - g) / d + 4;
break;
}
h /= 6;
}
return { h, s, v };
}
function hsvToRgb(h, s, v) {
h = bound01(h, 360) * 6;
s = bound01(s, 100);
v = bound01(v, 100);
var i = Math2.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v, q, p, p, t, v][mod], g = [t, v, v, q, p, p][mod], b = [p, p, t, v, v, q][mod];
return { r: r * 255, g: g * 255, b: b * 255 };
}
function rgbToHex(r, g, b, allow3Char) {
var hex = [
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16))
];
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
}
return hex.join("");
}
function rgbaToHex(r, g, b, a, allow4Char) {
var hex = [
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16)),
pad2(convertDecimalToHex(a))
];
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
}
return hex.join("");
}
function rgbaToArgbHex(r, g, b, a) {
var hex = [
pad2(convertDecimalToHex(a)),
pad2(mathRound(r).toString(16)),
pad2(mathRound(g).toString(16)),
pad2(mathRound(b).toString(16))
];
return hex.join("");
}
tinycolor2.equals = function(color1, color2) {
if (!color1 || !color2) {
return false;
}
return tinycolor2(color1).toRgbString() == tinycolor2(color2).toRgbString();
};
tinycolor2.random = function() {
return tinycolor2.fromRatio({
r: mathRandom(),
g: mathRandom(),
b: mathRandom()
});
};
function desaturate(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var hsl = tinycolor2(color).toHsl();
hsl.s -= amount / 100;
hsl.s = clamp01(hsl.s);
return tinycolor2(hsl);
}
function saturate(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var hsl = tinycolor2(color).toHsl();
hsl.s += amount / 100;
hsl.s = clamp01(hsl.s);
return tinycolor2(hsl);
}
function greyscale(color) {
return tinycolor2(color).desaturate(100);
}
function lighten(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var hsl = tinycolor2(color).toHsl();
hsl.l += amount / 100;
hsl.l = clamp01(hsl.l);
return tinycolor2(hsl);
}
function brighten(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var rgb = tinycolor2(color).toRgb();
rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * -(amount / 100))));
rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * -(amount / 100))));
rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * -(amount / 100))));
return tinycolor2(rgb);
}
function darken(color, amount) {
amount = amount === 0 ? 0 : amount || 10;
var hsl = tinycolor2(color).toHsl();
hsl.l -= amount / 100;
hsl.l = clamp01(hsl.l);
return tinycolor2(hsl);
}
function spin(color, amount) {
var hsl = tinycolor2(color).toHsl();
var hue = (hsl.h + amount) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return tinycolor2(hsl);
}
function complement(color) {
var hsl = tinycolor2(color).toHsl();
hsl.h = (hsl.h + 180) % 360;
return tinycolor2(hsl);
}
function triad(color) {
var hsl = tinycolor2(color).toHsl();
var h = hsl.h;
return [
tinycolor2(color),
tinycolor2({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),
tinycolor2({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })
];
}
function tetrad(color) {
var hsl = tinycolor2(color).toHsl();
var h = hsl.h;
return [
tinycolor2(color),
tinycolor2({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),
tinycolor2({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),
tinycolor2({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })
];
}
function splitcomplement(color) {
var hsl = tinycolor2(color).toHsl();
var h = hsl.h;
return [
tinycolor2(color),
tinycolor2({ h: (h + 72) % 360, s: hsl.s, l: hsl.l }),
tinycolor2({ h: (h + 216) % 360, s: hsl.s, l: hsl.l })
];
}
function analogous(color, results, slices) {
results = results || 6;
slices = slices || 30;
var hsl = tinycolor2(color).toHsl();
var part = 360 / slices;
var ret = [tinycolor2(color)];
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
hsl.h = (hsl.h + part) % 360;
ret.push(tinycolor2(hsl));
}
return ret;
}
function monochromatic(color, results) {
results = results || 6;
var hsv = tinycolor2(color).toHsv();
var h = hsv.h, s = hsv.s, v = hsv.v;
var ret = [];
var modification = 1 / results;
while (results--) {
ret.push(tinycolor2({ h, s, v }));
v = (v + modification) % 1;
}
return ret;
}
tinycolor2.mix = function(color1, color2, amount) {
amount = amount === 0 ? 0 : amount || 50;
var rgb1 = tinycolor2(color1).toRgb();
var rgb2 = tinycolor2(color2).toRgb();
var p = amount / 100;
var rgba = {
r: (rgb2.r - rgb1.r) * p + rgb1.r,
g: (rgb2.g - rgb1.g) * p + rgb1.g,
b: (rgb2.b - rgb1.b) * p + rgb1.b,
a: (rgb2.a - rgb1.a) * p + rgb1.a
};
return tinycolor2(rgba);
};
tinycolor2.readability = function(color1, color2) {
var c1 = tinycolor2(color1);
var c2 = tinycolor2(color2);
return (Math2.max(c1.getLuminance(), c2.getLuminance()) + 0.05) / (Math2.min(c1.getLuminance(), c2.getLuminance()) + 0.05);
};
tinycolor2.isReadable = function(color1, color2, wcag2) {
var readability = tinycolor2.readability(color1, color2);
var wcag2Parms, out;
out = false;
wcag2Parms = validateWCAG2Parms(wcag2);
switch (wcag2Parms.level + wcag2Parms.size) {
case "AAsmall":
case "AAAlarge":
out = readability >= 4.5;
break;
case "AAlarge":
out = readability >= 3;
break;
case "AAAsmall":
out = readability >= 7;
break;
}
return out;
};
tinycolor2.mostReadable = function(baseColor, colorList, args) {
var bestColor = null;
var bestScore = 0;
var readability;
var includeFallbackColors, level, size;
args = args || {};
includeFallbackColors = args.includeFallbackColors;
level = args.level;
size = args.size;
for (var i = 0; i < colorList.length; i++) {
readability = tinycolor2.readability(baseColor, colorList[i]);
if (readability > bestScore) {
bestScore = readability;
bestColor = tinycolor2(colorList[i]);
}
}
if (tinycolor2.isReadable(baseColor, bestColor, { "level": level, "size": size }) || !includeFallbackColors) {
return bestColor;
} else {
args.includeFallbackColors = false;
return tinycolor2.mostReadable(baseColor, ["#fff", "#000"], args);
}
};
var names = tinycolor2.names = {
aliceblue: "f0f8ff",
antiquewhite: "faebd7",
aqua: "0ff",
aquamarine: "7fffd4",
azure: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "000",
blanchedalmond: "ffebcd",
blue: "00f",
blueviolet: "8a2be2",
brown: "a52a2a",
burlywood: "deb887",
burntsienna: "ea7e5d",
cadetblue: "5f9ea0",
chartreuse: "7fff00",
chocolate: "d2691e",
coral: "ff7f50",
cornflowerblue: "6495ed",
cornsilk: "fff8dc",
crimson: "dc143c",
cyan: "0ff",
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: "f0f",
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",
lavender: "e6e6fa",
lavenderblush: "fff0f5",
lawngreen: "7cfc00",
lemonchiffon: "fffacd",
lightblue: "add8e6",
lightcoral: "f08080",
lightcyan: "e0ffff",
lightgoldenrodyellow: "fafad2",
lightgray: "d3d3d3",
lightgreen: "90ee90",
lightgrey: "d3d3d3",
lightpink: "ffb6c1",
lightsalmon: "ffa07a",
lightseagreen: "20b2aa",
lightskyblue: "87cefa",
lightslategray: "789",
lightslategrey: "789",
lightsteelblue: "b0c4de",
lightyellow: "ffffe0",
lime: "0f0",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "f0f",
maroon: "800000",
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",
rebeccapurple: "663399",
red: "f00",
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: "fff",
whitesmoke: "f5f5f5",
yellow: "ff0",
yellowgreen: "9acd32"
};
var hexNames = tinycolor2.hexNames = flip(names);
function flip(o) {
var flipped = {};
for (var i in o) {
if (o.hasOwnProperty(i)) {
flipped[o[i]] = i;
}
}
return flipped;
}
function boundAlpha(a) {
a = parseFloat(a);
if (isNaN(a) || a < 0 || a > 1) {
a = 1;
}
return a;
}
function bound01(n, max) {
if (isOnePointZero(n)) {
n = "100%";
}
var processPercent = isPercentage(n);
n = mathMin(max, mathMax(0, parseFloat(n)));
if (processPercent) {
n = parseInt(n * max, 10) / 100;
}
if (Math2.abs(n - max) < 1e-6) {
return 1;
}
return n % max / parseFloat(max);
}
function clamp01(val) {
return mathMin(1, mathMax(0, val));
}
function parseIntFromHex(val) {
return parseInt(val, 16);
}
function isOnePointZero(n) {
return typeof n == "string" && n.indexOf(".") != -1 && parseFloat(n) === 1;
}
function isPercentage(n) {
return typeof n === "string" && n.indexOf("%") != -1;
}
function pad2(c) {
return c.length == 1 ? "0" + c : "" + c;
}
function convertToPercentage(n) {
if (n <= 1) {
n = n * 100 + "%";
}
return n;
}
function convertDecimalToHex(d) {
return Math2.round(parseFloat(d) * 255).toString(16);
}
function convertHexToDecimal(h) {
return parseIntFromHex(h) / 255;
}
var matchers = function() {
var CSS_INTEGER = "[-\\+]?\\d+%?";
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
return {
CSS_UNIT: new RegExp(CSS_UNIT),
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
}();
function isValidCSSUnit(color) {
return !!matchers.CSS_UNIT.exec(color);
}
function stringInputToObject(color) {
color = color.replace(trimLeft, "").replace(trimRight, "").toLowerCase();
var named = false;
if (names[color]) {
color = names[color];
named = true;
} else if (color == "transparent") {
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
}
var match;
if (match = matchers.rgb.exec(color)) {
return { r: match[1], g: match[2], b: match[3] };
}
if (match = matchers.rgba.exec(color)) {
return { r: match[1], g: match[2], b: match[3], a: match[4] };
}
if (match = matchers.hsl.exec(color)) {
return { h: match[1], s: match[2], l: match[3] };
}
if (match = matchers.hsla.exec(color)) {
return { h: match[1], s: match[2], l: match[3], a: match[4] };
}
if (match = matchers.hsv.exec(color)) {
return { h: match[1], s: match[2], v: match[3] };
}
if (match = matchers.hsva.exec(color)) {
return { h: match[1], s: match[2], v: match[3], a: match[4] };
}
if (match = matchers.hex8.exec(color)) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
a: convertHexToDecimal(match[4]),
format: named ? "name" : "hex8"
};
}
if (match = matchers.hex6.exec(color)) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
format: named ? "name" : "hex"
};
}
if (match = matchers.hex4.exec(color)) {
return {
r: parseIntFromHex(match[1] + "" + match[1]),
g: parseIntFromHex(match[2] + "" + match[2]),
b: parseIntFromHex(match[3] + "" + match[3]),
a: convertHexToDecimal(match[4] + "" + match[4]),
format: named ? "name" : "hex8"
};
}
if (match = matchers.hex3.exec(color)) {
return {
r: parseIntFromHex(match[1] + "" + match[1]),
g: parseIntFromHex(match[2] + "" + match[2]),
b: parseIntFromHex(match[3] + "" + match[3]),
format: named ? "name" : "hex"
};
}
return false;
}
function validateWCAG2Parms(parms) {
var level, size;
parms = parms || { "level": "AA", "size": "small" };
level = (parms.level || "AA").toUpperCase();
size = (parms.size || "small").toLowerCase();
if (level !== "AA" && level !== "AAA") {
level = "AA";
}
if (size !== "small" && size !== "large") {
size = "small";
}
return { "level": level, "size": size };
}
if (typeof module2 !== "undefined" && module2.exports) {
module2.exports = tinycolor2;
} else if (typeof define === "function" && define.amd) {
define(function() {
return tinycolor2;
});
} else {
window.tinycolor = tinycolor2;
}
})(Math);
}
});
// main.ts
__export(exports, {
default: () => divideAndConquer
});
var import_obsidian2 = __toModule(require("obsidian"));
// settings.ts
var import_obsidian = __toModule(require("obsidian"));
var DEFAULT_SETTINGS = {
pluginFilterRegexes: [
"hot-reload",
"obsidian-divide-and-conquer"
],
snippetFilterRegexes: [],
filterUsingDisplayName: true,
filterUsingAuthor: false,
filterUsingDescription: false,
initializeAfterPluginChanges: false,
reloadAfterPluginChanges: false,
disabledStates: void 0,
snapshots: void 0
};
var DACSettingsTab = class extends import_obsidian.PluginSettingTab {
constructor(app, plugin) {
super(app, plugin);
this.toggles = [];
this.plugin = plugin;
}
display() {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h1", { text: "Divide and Conquer" });
containerEl.createEl("h5", {
text: "Note: Reinitializing or Reloading may cause disabled plugins to dissappear; close and open the menu to see them again"
}).style.color = getComputedStyle(containerEl).getPropertyValue("--interactive-accent");
new import_obsidian.Setting(containerEl).setName("Reinitialize Obsidian after plugin changes").setDesc(`This is not usually necessary. If you have "Debug startup time" enabled in the Community Plugins tab you'll see startup times when using commmands`).addToggle((toggle) => toggle.setValue(this.plugin.settings.initializeAfterPluginChanges).onChange((value) => __async(this, null, function* () {
this.plugin.settings.initializeAfterPluginChanges = value;
yield this.plugin.saveData(false);
})));
new import_obsidian.Setting(containerEl).setName("Reload Obsidian after plugin changes").addToggle((toggle) => toggle.setValue(this.plugin.settings.reloadAfterPluginChanges).onChange((value) => __async(this, null, function* () {
this.plugin.settings.reloadAfterPluginChanges = value;
yield this.plugin.saveData(false);
})));
containerEl.createEl("hr").createEl("br");
containerEl.createEl("h3", { text: "Changing any of the following settings will restore plugins to the original state." });
new import_obsidian.Setting(containerEl).setName("Use Filters on Plugin Display Names").setDesc("If this is off, DAC will only match plugins by their ID").addToggle((toggle) => {
this.toggles.push(toggle);
return toggle.setValue(this.plugin.settings.filterUsingDisplayName).onChange((value) => __async(this, null, function* () {
this.plugin.settings.filterUsingDisplayName = value;
yield this.plugin.saveData();
}));
});
new import_obsidian.Setting(containerEl).setName("Use Filters on Plugin Authors").addToggle((toggle) => {
this.toggles.push(toggle);
return toggle.setValue(this.plugin.settings.filterUsingAuthor).onChange((value) => __async(this, null, function* () {
this.plugin.settings.filterUsingAuthor = value;
yield this.plugin.saveData();
}));
});
new import_obsidian.Setting(containerEl).setName("Use Filters on Plugin Descriptions").addToggle((toggle) => {
this.toggles.push(toggle);
return toggle.setValue(this.plugin.settings.filterUsingDescription).onChange((value) => __async(this, null, function* () {
this.plugin.settings.filterUsingDescription = value;
yield this.plugin.saveData();
}));
});
let pluginExclusions = new import_obsidian.Setting(containerEl).setName("Plugin Exclusions").setDesc("Exclude plugins using regex (case insensitive).\nEach new line is a new regex. Plugin ids are used for matching by default. Included plugins are on the left, excluded on the right. ");
this.addTextArea({
mode: "plugins",
container: pluginExclusions,
placeholder: "^daily/\n\\.png$\netc...",
value: this.plugin.settings.pluginFilterRegexes.join("\n"),
disabledArea: this.addTextArea({ mode: "plugins", container: pluginExclusions })
});
let snippetExclusions = new import_obsidian.Setting(containerEl).setName("Snippet Exclusions").setDesc("Exclude snippets using regex (case insensitive).\nEach new line is a new regex. Snippet are only exclude by their name.");
this.addTextArea({
mode: "snippets",
container: snippetExclusions,
placeholder: "^daily/\n\\.png$\netc...",
value: this.plugin.settings.snippetFilterRegexes.join("\n"),
disabledArea: this.addTextArea({ mode: "snippets", container: snippetExclusions })
});
[pluginExclusions, snippetExclusions].forEach((s) => {
s.controlEl.style.width = "100%";
s.infoEl.style.width = "45%";
});
}
addTextArea({ mode, container, placeholder, value, disabledArea }) {
let ret;
let reset = (area, mode2) => {
this.plugin.saveData();
area.setPlaceholder([...this.plugin.getIncludedItems(mode2)].map((p) => p.name).join("\n")).setDisabled(true);
};
container.addTextArea((textArea) => {
ret = textArea;
textArea.inputEl.setAttr("rows", 10);
textArea.inputEl.style.width = "100%";
if (value)
textArea.setPlaceholder(placeholder).setValue(value);
textArea.setPlaceholder(placeholder != null ? placeholder : [...this.plugin.getIncludedItems(mode)].map((p) => p.name).join("\n")).setDisabled(!disabledArea);
if (disabledArea) {
this.toggles.forEach((t) => t.toggleEl.onClickEvent(reset.bind(this, disabledArea, mode)));
textArea.inputEl.onblur = (e) => {
this.setFilters(mode, e.target.value);
reset(disabledArea, mode);
};
}
});
return ret;
}
setFilters(mode, input) {
let f = input == null ? void 0 : input.split("\n").filter((p) => p.length);
switch (mode) {
case "plugins":
this.plugin.settings.pluginFilterRegexes = f;
break;
case "snippets":
this.plugin.settings.snippetFilterRegexes = f;
break;
}
this.plugin.saveData();
}
};
// util.ts
function simpleCalc(str) {
const calcRegex = /calc\((\d+)%\s*([+-])\s*(\d+)%\)/;
const match = str.match(calcRegex);
if (!match)
return str;
const [_, a, op, b] = match;
const result = op === "+" ? +a + +b : +a - +b;
return str.replace(calcRegex, `${result}%`);
}
function removeSetupDebugNotice() {
let notices = document.querySelectorAll(".notice");
for (let i = 0; i < notices.length; i++) {
let notice = notices[i];
if (notice == null ? void 0 : notice.innerText.includes("plugin setup"))
notice.remove();
}
}
function queryText(el, selector, text) {
return Array.from(el.querySelectorAll(selector)).find((heading) => heading.innerText.includes(text));
}
var compose = (_this, ...funcs) => (...args) => funcs.reduce((promise, func) => promise.then(func.bind(_this)), Promise.resolve());
function makeArray(collection) {
const array = [];
for (let i = 0; i < collection.length; i++) {
array.push(collection[i]);
}
return array;
}
function getSnippetItems(tab) {
const headings = tab.containerEl.querySelectorAll(".setting-item-heading");
const lastHeading = headings[headings.length - 1];
let res = Array.from(tab.containerEl.children).filter((child) => !(child.compareDocumentPosition(lastHeading) & Node.DOCUMENT_POSITION_FOLLOWING));
console.log(res, headings);
return res;
}
var Modes = [
"plugins",
"snippets"
];
// node_modules/monkey-around/mjs/index.js
function around(obj, factories) {
const removers = Object.keys(factories).map((key) => around1(obj, key, factories[key]));
return removers.length === 1 ? removers[0] : function() {
removers.forEach((r) => r());
};
}
function around1(obj, method, createWrapper) {
const original = obj[method], hadOwn = obj.hasOwnProperty(method);
let current = createWrapper(original);
if (original)
Object.setPrototypeOf(current, original);
Object.setPrototypeOf(wrapper, current);
obj[method] = wrapper;
return remove;
function wrapper(...args) {
if (current === original && obj[method] === wrapper)
remove();
return current.apply(this, args);
}
function remove() {
if (obj[method] === wrapper) {
if (hadOwn)
obj[method] = original;
else
delete obj[method];
}
if (current === original)
return;
current = original;
Object.setPrototypeOf(wrapper, original || Function);
}
}
// main.ts
var tinycolor = require_tinycolor();
var CSS_DELAY = 200;
var RESET_DELAY = 1e3;
var pluginCommands = [
{ id: "reset", name: "Plugin Reset - forget the original state and set the current state as the new original state" },
{ id: "restore", name: "Plugin Restore - return to the original state" },
{ id: "unBisect", name: "Plugin Un-Bisect - Undo the last bisection, or enable all plugins if in the original state" },
{ id: "bisect", name: "Plugin Bisect - Disable half of the active plugins, or return to the original state if all plugins are active" },
{ id: "reBisect", name: "Plugin Re-Bisect - Undo the last bisection, then disable the other half" }
];
var snippetCommands = [
{ id: "reset", name: "Snippet Reset - forget the original state and set the current state as the new original state" },
{ id: "restore", name: "Snippet Restore - return to the original state" },
{ id: "unBisect", name: "Snippet Un-Bisect - Undo the last bisection, or enable all snippets if in the original state" },
{ id: "bisect", name: "Snippet Bisect - Disable half of the active snippets, or return to the original state if all snippets are active" },
{ id: "reBisect", name: "Snippet Re-Bisect - Undo the last bisection, then disable the other half" }
];
var UIButtons = [
{ id: "reset", tooltip: "Reset - Snapshot the current state" },
{ id: "restore", tooltip: "Restore - Restore Snapshot" },
{ id: "unBisect", tooltip: "UnBisect - Go up a level" },
{ id: "bisect", tooltip: "Bisect - Go down a level" },
{ id: "reBisect", tooltip: "Re-bisect - Go back a level, then down the other side" }
];
var icons = [
["reset", "camera"],
["restore", "switch-camera"],
["unBisect", "expand"],
["bisect", "minimize"],
["reBisect", "flip-vertical"]
];
var divideAndConquer = class extends import_obsidian2.Plugin {
constructor() {
super(...arguments);
this.manifests = this.app.plugins.manifests;
this.enabledColor = null;
this.disabledColor = null;
this._mode = "plugins";
this.mode2Call = new Map();
this.mode2Refresh = new Map();
this.mode2Tab = new Map();
this.mode2Controls = new Map();
this.mode2DisabledStates = new Map();
this.mode2Snapshot = new Map();
this.mode2Level = new Map(Modes.map((mode) => [mode, 1]));
this.key2Icon = new Map(icons);
this.disableButtons = false;
}
get mode() {
return this._mode;
}
setMode(mode) {
this._mode = mode;
}
get disabledState() {
var _a;
return (_a = this.mode2DisabledStates.get(this.mode)) != null ? _a : [];
}
set disabledState(s) {
this.mode2DisabledStates.set(this.mode, s != null ? s : []);
}
get snapshot() {
var _a;
return (_a = this.mode2Snapshot.get(this.mode)) != null ? _a : new Set();
}
set snapshot(s) {
this.mode2Snapshot.set(this.mode, s != null ? s : new Set());
}
get controls() {
var _a;
return (_a = this.mode2Controls.get(this.mode)) != null ? _a : [];
}
set controls(c) {
this.mode2Controls.set(this.mode, c != null ? c : []);
}
get tab() {
return this.mode2Tab.get(this.mode);
}
get wrapper() {
return this.mode2Call.get(this.mode);
}
get refreshTab() {
return this.mode2Refresh.get(this.mode);
}
set refreshTab(f) {
this.mode2Refresh.set(this.mode, f);
}
set level(l) {
this.mode2Level.set(this.mode, l);
}
get level() {
if (!this.mode2Level.has(this.mode))
this.mode2Level.set(this.mode, 1);
return this.mode2Level.get(this.mode);
}
onunload() {
return __async(this, null, function* () {
this.saveData();
console.log("Divide & Conquer Plugin unloaded.");
});
}
onload() {
return __async(this, null, function* () {
yield this.loadData();
this.addSettingTab(new DACSettingsTab(this.app, this));
console.log("Divide & Conquer Plugin loaded.");
const notice = () => {
removeSetupDebugNotice();
let notic_str = `${this.mode} level:${this.level} `;
if (this.level === 1)
new import_obsidian2.Notice(notic_str + "- Now in the original state");
else if (this.level === 0)
new import_obsidian2.Notice(notic_str + "- Enabled All");
else
new import_obsidian2.Notice(notic_str);
};
const maybeReload = () => {
if (this.settings.reloadAfterPluginChanges)
setTimeout(() => this.app.commands.executeCommandById("app:reload"), 2e3);
};
const maybeInit = () => {
if (this.settings.initializeAfterPluginChanges)
return this.app.plugins.initialize();
};
this.mode2Call = new Map(Modes.map((mode) => [mode, (f) => () => __async(this, null, function* () {
return compose(this, () => this.setMode(mode), () => console.log("called: ", f.name), f, () => this.mode2Refresh.get(this.mode)(), maybeReload, maybeInit, notice).bind(this)();
})]));
this.mode2Tab = new Map([
["plugins", "community-plugins"],
["snippets", "appearance"]
].map(([mode, id]) => [mode, this.getSettingsTab(id)]));
Object.assign(this.mode2Tab.get("plugins"), { heading: "Installed plugins", reloadLabel: "Reload plugins", reload: () => this.app.plugins.loadManifests() });
Object.assign(this.mode2Tab.get("snippets"), { heading: "CSS snippets", reloadLabel: "Reload snippets", reload: () => this.app.customCss.loadSnippets() });
[...this.mode2Tab.entries()].forEach(([mode, tab]) => this.register(around(tab, { display: this.overrideDisplay.bind(this, mode, tab) })));
this.getItemEls = () => {
switch (this.mode) {
case "plugins":
return makeArray(this.tab.containerEl.find(".installed-plugins-container").children);
case "snippets":
return getSnippetItems(this.tab);
default:
throw new Error("Unknown mode: " + this.mode);
}
};
this.getAllItems = () => {
switch (this.mode) {
case "plugins":
return new Set(Object.values(this.manifests));
case "snippets":
return new Set(this.app.customCss.snippets.map((s) => ({ name: s, id: s })));
}
};
this.getEnabledFromObsidian = () => {
switch (this.mode) {
case "plugins":
return this.app.plugins.enabledPlugins;
case "snippets":
return new Set(this.app.customCss.snippets.filter((snippet) => this.app.customCss.enabledSnippets.has(snippet)));
}
};
this.enableItem = (id) => {
switch (this.mode) {
case "plugins":
return this.app.plugins.enablePluginAndSave(id);
case "snippets":
return new Promise((resolve) => {
this.app.customCss.setCssEnabledStatus(id, true);
setTimeout(() => resolve({}), CSS_DELAY);
});
}
};
this.disableItem = (id) => {
switch (this.mode) {
case "plugins":
return this.app.plugins.disablePluginAndSave(id);
case "snippets":
return new Promise((resolve) => {
this.app.customCss.setCssEnabledStatus(id, false);
setTimeout(() => resolve({}), CSS_DELAY);
});
}
};
this.getFilters = () => {
switch (this.mode) {
case "plugins":
return this.settings.pluginFilterRegexes;
case "snippets":
return this.settings.snippetFilterRegexes;
}
};
this.addCommands();
this.app.workspace.onLayoutReady(() => {
var _a, _b;
let appContainer = document.getElementsByClassName("app-container").item(0);
(_a = this.enabledColor) != null ? _a : this.enabledColor = tinycolor(simpleCalc(appContainer.getCssPropertyValue("--checkbox-color"))).spin(180).toHexString();
(_b = this.disabledColor) != null ? _b : this.disabledColor = tinycolor(this.enabledColor).darken(35).toHexString();
});
});
}
loadData() {
var __superGet = (key) => super[key];
return __async(this, null, function* () {
this.settings = Object.assign({}, DEFAULT_SETTINGS, yield __superGet("loadData").call(this));
this.mode2DisabledStates = this.settings.disabledStates ? new Map(Object.entries(JSON.parse(this.settings.disabledStates)).map(([mode, states]) => [mode, states.map((state) => new Set(state))])) : new Map();
this.mode2Snapshot = this.settings.snapshots ? new Map(Object.entries(JSON.parse(this.settings.snapshots)).map(([mode, states]) => [mode, new Set(states)])) : new Map();
});
}
saveData(restore = true) {
var __superGet = (key) => super[key];
return __async(this, null, function* () {
if (this.mode2DisabledStates)
this.settings.disabledStates = JSON.stringify(Object.fromEntries([...this.mode2DisabledStates.entries()].map(([mode, sets]) => [mode, [...sets].map((set) => [...set])])));
else
this.settings.disabledStates = void 0;
if (this.mode2Snapshot)
this.settings.snapshots = JSON.stringify(Object.fromEntries([...this.mode2Snapshot.entries()].map(([mode, set]) => [mode, [...set]])));
else
this.settings.snapshots = void 0;
if (restore)
yield this.restore();
yield __superGet("saveData").call(this, this.settings);
});
}
addControls() {
var _a;
let container = this.getControlContainer();
(_a = this.mode2Controls) != null ? _a : this.mode2Controls = new Map();
if (!this.mode2Controls.has(this.mode))
this.mode2Controls.set(this.mode, [...UIButtons.map((o) => new import_obsidian2.ExtraButtonComponent(container).setTooltip(o.tooltip).setIcon(this.key2Icon.get(o.id)).onClick(this.wrapCall(this.mode, o.id)).setDisabled(false).extraSettingsEl), this.createLevelText()]);
this.controls.last().setText(`Level: ${this.mode2Level.get(this.mode)}`);
this.controls.forEach((control) => container.appendChild(control));
}
addCommands() {
pluginCommands.forEach((command) => this.addCommand(Object.assign(command, { callback: this.mode2Call.get("plugins")(this[command.id]) })));
snippetCommands.forEach((command) => this.addCommand(Object.assign(command, { callback: this.mode2Call.get("snippets")(this[command.id]) })));
}
bisect() {
return __async(this, null, function* () {
this.level = this.level + 1;
if (this.level === 1) {
this.restore();
return;
}
const { enabled } = this.getCurrentState();
const half = yield this.disableItems(enabled.slice(0, Math.floor(enabled.length / 2)));
if (half.length > 0)
this.disabledState.push(new Set(half));
else
this.level--;
return half;
});
}
unBisect() {
return __async(this, null, function* () {
this.level = this.level > 0 ? this.level - 1 : 0;
const { disabled } = this.getCurrentState();
yield this.enableItems(disabled);
if (this.disabledState.length > 1)
return this.disabledState.pop();
return new Set();
});
}
reBisect() {
return __async(this, null, function* () {
if (this.level < 2) {
new import_obsidian2.Notice("Cannot re-bisect the original state.");
return;
}
const reenabled = yield this.unBisect();
const { enabled } = this.getCurrentState();
const toDisable = enabled.filter((id) => !reenabled.has(id));
yield this.disableItems(toDisable);
if (toDisable.length > 0) {
this.disabledState.push(new Set(toDisable));
this.level = this.level + 1;
}
});
}
reset() {
this.disabledState = this.snapshot = void 0;
this.level = 1;
let { enabled, disabled } = this.getEnabledDisabled();
this.disabledState = [new Set(disabled)];
this.snapshot = new Set(disabled);
this.saveData(false);
}
restore() {
return __async(this, null, function* () {
if (this.disabledState.length < 1)
return;
this.disabledState.slice(1).reverse().map((set) => this.enableItems(set));
yield this.disableItems(this.snapshot);
yield this.app.plugins.requestSaveConfig();
setTimeout(() => this.reset(), RESET_DELAY);
});
}
getCurrentState() {
const { enabled, disabled } = this.getEnabledDisabled();
this.disabledState = this.disabledState.length < 1 ? [new Set(disabled)] : this.disabledState;
const currentDisabled = this.disabledState.last();
return { enabled, disabled: currentDisabled };
}
getEnabledDisabled() {
let excluded = [...this.getExcludedItems()];
let included = [...this.getAllItems()].filter((item) => !excluded.some((i) => i.id === item.id)).sort((a, b) => b.name.localeCompare(a.name)).map((item) => item.id);
let result = {
enabled: included.filter((id) => this.getEnabledFromObsidian().has(id)),
disabled: included.filter((id) => !this.getEnabledFromObsidian().has(id))
};
return result;
}
getIncludedItems(mode) {
return this.getExcludedItems(mode, true);
}
getExcludedItems(mode, outIncluded = false) {
let oldmode = this.mode;
if (mode)
this.setMode(mode);
const plugins = [...this.getAllItems()].filter((p) => outIncluded !== this.getFilters().some((filter) => {
var _a, _b;
return p.id.match(new RegExp(filter, "i")) || this.settings.filterUsingDisplayName && p.name.match(new RegExp(filter, "i")) || this.settings.filterUsingAuthor && ((_a = p.author) == null ? void 0 : _a.match(new RegExp(filter, "i"))) || this.settings.filterUsingDescription && ((_b = p.description) == null ? void 0 : _b.match(new RegExp(filter, "i")));
}));
if (mode)
this.setMode(oldmode);
return new Set(plugins);
}
enableItems(items) {
return __async(this, null, function* () {
if (items instanceof Set)
items = [...items];
console.log("Enabling:", items);
items.reverse().map((id) => this.enableItem(id));
return items;
});
}
disableItems(items) {
return __async(this, null, function* () {
if (items instanceof Set)
items = [...items];
console.log("Disabling:", items);
for (const id of items) {
yield this.disableItem(id);
}
return items;
});
}
getControlContainer(tab) {
tab != null ? tab : tab = this.tab;
return queryText(tab.containerEl, ".setting-item-heading", tab.heading).querySelector(".setting-item-control");
}
getReloadButton(tab) {
tab != null ? tab : tab = this.mode2Tab.get(this.mode);
let controls = this.getControlContainer(tab);
return controls.find(`[aria-label="${tab.reloadLabel}"]`);
}
getSettingsTab(id) {
return this.app.setting.settingTabs.filter((t) => t.id === id).shift();
}
createLevelText() {
let span = document.createElement("span");
span.setText(`Level: ${this.level}`);
return span;
}
overrideDisplay(mode, tab, old) {
let plugin = this;
return function display(...args) {
plugin.setMode(mode);
plugin.refreshTab = () => {
console.log("refreshing tab", mode);
plugin.setMode(mode);
tab.reload().then(() => {
old.apply(tab, args);
plugin.addControls();
plugin.colorizeIgnoredToggles();
});
};
plugin.refreshTab();
}.bind(plugin, tab);
}
colorizeIgnoredToggles() {
var _a;
let name2Toggle = this.createToggleMap(this.getItemEls());
let included = new Set([...this.getIncludedItems()].map((m) => m.name));
console.log("included", included, this.getIncludedItems(), name2Toggle);
for (let [name, toggle] of name2Toggle) {
if (!(included == null ? void 0 : included.has(name))) {
let colorToggle = () => {
if (toggle.classList.contains("is-enabled"))
toggle.style.backgroundColor = this.enabledColor;
else
toggle.style.backgroundColor = this.disabledColor;
};
colorToggle();
toggle.addEventListener("click", colorToggle);
}
let id = (_a = [...this.getAllItems()].find((p) => p.name == name)) == null ? void 0 : _a.id;
if (id && this.snapshot && this.snapshot.has(id)) {
toggle.style.outlineOffset = "1px";
toggle.style.outline = "outset";
}
}
}
createToggleMap(items) {
let name2Toggle = new Map();
for (var i = 0; i < items.length; i++) {
let child = items[i];
let name = child.querySelector(".setting-item-name").innerText;
let toggle = child.querySelector(".setting-item-control").querySelector(".checkbox-container");
if (name && toggle)
name2Toggle.set(name, toggle);
}
return name2Toggle;
}
wrapCall(mode, key) {
return this.wrapper(this[key]);
}
};
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uI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W5nKGNvbnRhaW5lckVsKVxyXG4gICAgICAgICAgICAuc2V0TmFtZSgnVXNlIEZpbHRlcnMgb24gUGx1Z2luIEF1dGhvcnMnKVxyXG4gICAgICAgICAgICAuYWRkVG9nZ2xlKCh0b2dnbGUpID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMudG9nZ2xlcy5wdXNoKHRvZ2dsZSk7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9nZ2xlXHJcbiAgICAgICAgICAgICAgICAgICAgLnNldFZhbHVlKHRoaXMucGx1Z2luLnNldHRpbmdzLmZpbHRlclVzaW5nQXV0aG9yKVxyXG4gICAgICAgICAgICAgICAgICAgIC5vbkNoYW5nZShhc3luYyAodmFsdWUpID0+IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5wbHVnaW4uc2V0dGluZ3MuZmlsdGVyVXNpbmdBdXRob3IgPSB2YWx1ZTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgYXdhaXQgdGhpcy5wbHVnaW4uc2F2ZURhdGEoKTtcclxuICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICApO1xyXG5cclxuICAgICAgICBuZXcgU2V0dGluZyhjb250YWluZXJFbClcclxuICAgICAgICAgICAgLnNldE5hbWUoJ1VzZSBGaWx0ZXJzIG9uIFBsdWdpbiBEZXNjcmlwdGlvbnMnKVxyXG4gICAgICAgICAgICAuYWRkVG9nZ2xlKCh0b2dnbGUpID0+IHtcclxuICAgICAgICAgICAgICAgIHRoaXMudG9nZ2xlcy5wdXNoKHRvZ2dsZSk7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4gdG9nZ2xlXHJcbiAgICAgICAgICAgICAgICAgICAgLnNldFZhbHVlKHRoaXMucGx1Z2luLnNldHRpbmdzLmZpbHRlclVzaW5nRGVzY3JpcHRpb24pXHJcbiAgICAgICAgICAgICAgICAgICAgLm9uQ2hhbmdlKGFzeW5jICh2YWx1ZSkg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